query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
sequencelengths 0
30
| negative_scores
sequencelengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
"resend activation email" page | public function resendActivationEmailAction() {
$request = $this->getRequest();
$em = $this->getDoctrine()->getEntityManager();
if ($request->getMethod() == 'POST') {
$email = $request->get('email');
if (!preg_match("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$^", $email)) {
$this->get('session')->setFlash('error', 'The security code was invalid.');
return $this->redirect($this->generateUrl('resend_activation_hash'));
}
$secret_hash = $em->getRepository('FrontFrontBundle:User')->getSecretHashByEmail($email);
if ($secret_hash['is_deleted'] == 1 || !$secret_hash) { // if user is deleted or doesnt exist at all
$this->get('session')->setFlash('error', 'This email does not exist in our database. Please register.');
return $this->redirect($this->generateUrl('resend_activation_hash'));
}
if ($secret_hash['has_activated_email'] == 1) { // if user already had activated the email
$this->get('session')->setFlash('error', 'You do not need activation email because your accound is active. If you think you lost your password please use "Password recovery" function.');
return $this->redirect($this->generateUrl('resend_activation_hash'));
}
$this->sendActivationEmail($email, $secret_hash['activation_hash']);
$this->get('session')->setFlash('notice', 'The activation email had been send to you. Please check "spam" folder also.');
return $this->redirect($this->generateUrl('resend_activation_hash'));
}
return $this->render('FrontFrontBundle:login_register:resend_activation_email.html.twig');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function send_activation_email() {}",
"public function resendActivationEmailAction() {\n $request = $this->getRequest();\n $em = $this->getDoctrine()->getEntityManager();\n\n if ($request->getMethod() == 'POST') {\n $email = $request->get('email');\n if (!preg_match(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$^\", $email)) {\n $this->get('session')->setFlash('error', 'The security code was invalid.');\n return $this->redirect($this->generateUrl('resend_activation_hash'));\n }\n $secret_hash = $em->getRepository('FrontFrontBundle:Students')->getSecretHashByEmail($email);\n\n if (empty($secret_hash)) { // if user is deleted or doesnt exist at all\n $this->get('session')->setFlash('error', 'This email does not exist in our database. Please register.');\n return $this->redirect($this->generateUrl('resend_activation_hash'));\n }\n if ($secret_hash['is_activated'] == 1) { // if user already had activated the email\n $this->get('session')->setFlash('error', 'You do not need activation email because your accound is active. If you think you lost your password please use \"Password recovery\" function.');\n return $this->redirect($this->generateUrl('resend_activation_hash'));\n }\n $this->sendActivationEmail($email, $secret_hash['activation_hash']);\n $this->get('session')->setFlash('notice', 'The activation email had been send to you. Please check \"spam\" folder also.');\n return $this->redirect($this->generateUrl('resend_activation_hash'));\n }\n return $this->render('FrontFrontBundle:User:resend_activation_email.html.twig');\n }",
"public function actionResendActivate()\n\t{\n\t\t$email = CPropertyValue::ensureString(request()->getParam('email'));\n\t\t\n\t\t$model = new ResendActivateForm();\n\t\t$model->email = $email;\n\t\t\n\t\t$resend = app()->request->getPost('ResendActivateForm', false);\n\t\t\n\t\tif($resend)\n\t\t{\n\t\t\t$model->attributes = $resend;\n\t\t\t\n\t\t\tif($model->validate())\n\t\t\t{\n\t\t\t\t$account = Account::model()->find('LOWER(email)=?', array($email));\n\t\t\t\t\n\t\t\t\tif(!empty($account))\n\t\t\t\t{\n\t\t\t\t\t//insert hash\n\t\t\t\t\t$hash = new Hash();\n\t\t\t\t\t$hash->hash = md5(uniqid(). time());\n\t\t\t\t\t$hash->type = Account::TUTOR;\n\t\t\t\t\t$hash->id = $account->id;\n\t\t\t\t\t$hash->expire = strtotime('+30 days');\n\t\t\t\t\t$hash->save();\n\t\t\t\t\t\t\n\t\t\t\t\t//send email\n\t\t\t\t\t$email = $account->email;\n\t\t\t\t\t$name = $account->first_name . ' ' . $account->last_name;\n\t\t\t\t\t$url = app()->request->hostInfo . '/register/activate/token/' . $hash->hash;\n\t\t\t\t\t\t\n\t\t\t\t\t$params = array('name'=>$name, 'url'=>$url);\n\t\t\t\t\t\t\n\t\t\t\t\tlist($content, $title) = MailHelper::parseTemplate('resend_activate_link', $params);\n\t\t\t\t\t\t\n\t\t\t\t\t//save queue mail\n\t\t\t\t\t$queue = new Queue();\n\t\t\t\t\n\t\t\t\t\t$queue->sender_name = $this->settings['no_reply_name'];\n\t\t\t\t\t$queue->sender_email = $this->settings['no_reply_address'];\n\t\t\t\t\t$queue->recipient_name = $name;\n\t\t\t\t\t$queue->recipient_email = $email;\n\t\t\t\t\t$queue->title = $title;\n\t\t\t\t\t$queue->message = $content;\n\t\t\t\t\t$queue->status = Queue::SUCCESS;\n\t\t\t\t\t\n\t\t\t\t\t$queue->save();\n\t\t\t\t\t\t\n\t\t\t\t\t//sender's information\n\t\t\t\t\t$from = array('name'=>$queue->sender_name, 'email'=>$queue->sender_email);\n\t\t\t\t\t\n\t\t\t\t\t//recipient's information\n\t\t\t\t\t$to = array('name'=>$queue->recipient_name, 'email'=>$queue->recipient_email);\n\t\t\t\t\t\n\t\t\t\t\t$subject = $queue->title;\n\t\t\t\t\t$message = $queue->message;\n\t\t\t\t\t\n\t\t\t\t\tMailHelper::sendMail($from, $to, $subject, $message);\n\t\t\t\t\t\n\t\t\t\t\tapp()->user->setFlash('message', Common::translate('alert message', 'New activate link has been sent to your mail'));\n\t\t\t\t\t\t\n\t\t\t\t\t$this->redirect(url('/site/login'));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->redirect(url('/site/error'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->pageTitle = $this->settings['site_title'] . ' :: Resend Activate';\n\t\t$this->change_title = true;\n\t\t\n\t\tCommon::insertMeta();\n\t\t\n\t\t$this->render('resend_activate', array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t));\n\t\t\n\t}",
"public function sendActivationEmail(): void\n {\n $url = 'http://' . $_SERVER['HTTP_HOST']. '/'.Config::APP_NAME. '/accounts/activated/' . $this->activation_token;\n\n $text = View::getTemplate('Accounts/activation_email.txt.twig', ['url' => $url]);\n $html = View::getTemplate('Accounts/activation_email.html.twig', ['url' => $url]);\n\n Mail::send($this->email, 'Account activation', $text, $html);\n }",
"function sendVerificationEmailAction() {\n\t\t$app = Slim::getInstance();\n\n\t\t$controller = new Controller();\n\t\t$login_model = $controller->loadModel('LoginModel');\n\t\t$user_verificado = $login_model->sendVerificationEmail($app->request->params());\n\n\t\tif ($user_verificado == true) {\n\t\t\t$app->redirect('login/accountActivated');\n\t\t} else {\n\t\t\t$app->redirect('login/accountNotActivated');\n\t\t}\n\t}",
"function sendConfirmationEmail();",
"public function requestActivationEmailAction()\n {\n $form = $this->createForm(new EmailType(), null);\n \n $options = array();\n\n if ($this->getRequest()->isMethod('POST')) {\n $form->bind($this->getRequest());\n\n if ($form->isValid()) {\n $userManager = $this->get('fos_user.user_manager');\n $user = $userManager->findUserByEmail($form->get('email')->getData());\n \n if ($user != null) {\n // dispatch event\n $this->container->get('event_dispatcher')->dispatch(BagLoginEvents::USER_REQUEST_CONFIRMATION_EMAIL, new UserEvent($user, true, 'web'));\n \n return $this->redirect($this->generateUrl('bag_login_web_request_activation_email_completed'));\n }\n else\n $options['error'] = $this->get('translator')->trans('message.email_not_found');\n }\n }\n \n $options['form'] = $form->createView();\n \n $view = $this->container->getParameter('bag_login.views');\n return $this->render($view['activation_email_request'], $options);\n }",
"public function confirmemailAction()\n {\n $this->getResponse()->setHeader('X-Nocache', 'no-cache');\n $visitorEmail = \\FrontEnd_Helper_viewHelper::sanitize((base64_decode($this->_request->getParam(\"email\"))));\n $visitor = \\KC\\Repository\\Visitor::getVisitorDetailsByEmail($visitorEmail);\n if (!empty($visitor)) {\n if (\\Visitor::updateVisitorStatus($visitor[0]['id'])) {\n $this->addFlashMessage(\n \\FrontEnd_Helper_viewHelper::__translate('Your email address has been confirmed please login'),\n HTTP_PATH_LOCALE . \\FrontEnd_Helper_viewHelper::__link('link_login'),\n 'success'\n );\n } else {\n $this->addFlashMessage(\n \\FrontEnd_Helper_viewHelper::__translate('Your email address is already confirmed'),\n HTTP_PATH_LOCALE . \\FrontEnd_Helper_viewHelper::__link('link_login'),\n 'error'\n );\n }\n } else {\n $this->addFlashMessage(\n \\FrontEnd_Helper_viewHelper::__translate('Invalid confirmation link'),\n HTTP_PATH_LOCALE . \\FrontEnd_Helper_viewHelper::__link('link_login'),\n 'error'\n );\n }\n }",
"function sendActivationEmail($email, $activation, $reason) {\n\t\t$text_field = $GLOBALS['text_field'];\n\t\t$link = $text_field['base_url'].\"user_activation.php?activation=\".$activation;\n\t\tif ($reason == \"new user\") {\n\t\t\t$subject = \"Math+ registration activation\";\n\t\t\t$body = \"Thanks for registering with Math+. \n\t\t\t\t\tPlease click <a href=\".$link.\">here</a> to activate your account.\";\n\t\t}\n\t\telseif ($reason == \"update\") {\n\t\t\t$subject = \"Math+ updated email\";\n\t\t\t$body = \"You've successfully updated your email for your Math+ account.\n\t\t\t\t\tPlease click <a href=\".$link.\">here</a> to activate your new email.\";\n\t\t}\n\t\t\n\t\treturn sendMail($email, $subject, $body);\n\t}",
"public function sendConfirmationRequestEmail()\n {\n $this->sendConfirmationEmail(__FUNCTION__);\n }",
"public function requestActivationEmailCompletedAction()\n {\n $view = $this->container->getParameter('bag_login.views');\n \n return $this->render($view['activation_email_request_completed']);\n }",
"public function actionResendactive(){\n \n $codeActive = Yii::app()->getRequest()->getParam('code'); \n if(isset($codeActive)){\n \n $userData = User::model()->findByAttributes(array('user_default_activate_link'=>$codeActive));\n $activecode = SharedFunctions::app()->randvalue(); \n $postRecord = User::model()->findByPk($userData['user_default_id']); \n $activecode = $codeActive; \n if(!empty($userData)){ \n \n \n $activelink = '<a href=\"'.Yii::app()->createAbsoluteUrl('/user/register/activation',array('code'=>$activecode)).'\" target=\"_blank\" >Click to activate your account</a>';\n \n $template = MailTemplate::getTemplate('User_Activate_Account');\n \n $string = array(\n '{{#ACCOUNT_ACTIVATION_LINK#}}'=>$activelink,\n '{{#USERNAME#}}'=>ucwords($postRecord->user_default_first_name .' '.$postRecord->user_default_surname),\n '{{#COMPANY_NAME#}}'=>Yii::app()->params['company_name'],\n '{{#COMPANY_SIGNATURE#}}'=>Yii::app()->params['signature'],\n '{{#COMPANY_EMAIL#}}'=>Yii::app()->params['company_email']\n );\n $postRecord->user_default_activate_link = $activecode;\n $postRecord->save();\n \n //die; \n $body = SharedFunctions::app()->mailStringReplace($template->template_body,$string); \n \n $res = SharedFunctions::app()->sendmail($userData['user_default_email'],$template->template_subject,$body); \n \n $this->render('pending',array('model'=>$userData));\n \n }else{ \n //Yii::app()->user->setFlash('error', \"Opps ! something missing ....\"); \n $this->redirect('/'); \n }\n \n \n }else{\n \n // Yii::app()->user->setFlash('error', \"Opps ! something missing ....\");\n \n $this->redirect('/');\n } \n }",
"public function resendMailAction(){\n $params = array();\n $params['email'] = $_REQUEST['email_address'];\n $params['toFirstName'] = $_REQUEST['first_name'];\n $params['template'] = 'user-registration';\n $params['from'] = '[email protected]';\n $params['subject'] = 'Confirm your email address';\n $params['hashKey'] = urlencode($_REQUEST['hashKey']);\n //error_reporting(E_ALL);\n $mailObj = $this->PUMailer();\n $mailResult = $mailObj->userRegMail($params);\n print_R($mailResult);exit;\n }",
"function send_activation_email($email, $code) {\n\t$subject = 'Account Activation Required';\n\t$headers = 'From: ' . mail_from . \"\\r\\n\" . 'Reply-To: ' . mail_from . \"\\r\\n\" . 'Return-Path: ' . mail_from . \"\\r\\n\" . 'X-Mailer: PHP/' . phpversion() . \"\\r\\n\" . 'MIME-Version: 1.0' . \"\\r\\n\" . 'Content-Type: text/html; charset=UTF-8' . \"\\r\\n\";\n\t$activate_link = activation_link . '?email=' . $email . '&code=' . $code;\n\t$email_template = str_replace('%link%', $activate_link, file_get_contents('activation-email-template.html'));\n\tmail($email, $subject, $email_template, $headers);\n}",
"public function actionResendactive(){\n \n $codeActive = Yii::app()->getRequest()->getParam('code'); \n if(isset($codeActive)){\n \n $userData = User::model()->findByAttributes(array('drg_active_link'=>$codeActive));\n $activecode = SharedFunctions::app()->randvalue(); \n $postRecord = User::model()->findByPk($userData['drg_id']); \n $activecode = $codeActive; \n if(!empty($userData)){ \n \n \n $activelink = '<a href=\"'.Yii::app()->createAbsoluteUrl('/user/register/activation',array('code'=>$activecode)).'\" target=\"_blank\" >Click to activate your account</a>';\n \n $template = MailTemplate::getTemplate('User_Activate_Account');\n \n $string = array(\n '{{#ACCOUNT_ACTIVATION_LINK#}}'=>$activelink,\n '{{#USERNAME#}}'=>ucwords($postRecord->drg_name .' '.$postRecord->drg_surname),\n '{{#COMPANY_NAME#}}'=>Yii::app()->params['company_name'],\n '{{#COMPANY_SIGNATURE#}}'=>Yii::app()->params['signature'],\n '{{#COMPANY_EMAIL#}}'=>Yii::app()->params['company_email']\n );\n $postRecord->drg_active_link = $activecode;\n $postRecord->save();\n \n //die; \n $body = SharedFunctions::app()->mailStringReplace($template->template_body,$string); \n \n $res = SharedFunctions::app()->sendmail($userData['drg_email'],$template->template_subject,$body); \n \n $this->render('pending',array('model'=>$userData));\n \n }else{ \n //Yii::app()->user->setFlash('error', \"Opps ! something missing ....\"); \n $this->redirect('/'); \n }\n \n \n }else{\n \n // Yii::app()->user->setFlash('error', \"Opps ! something missing ....\");\n \n $this->redirect('/');\n } \n }",
"public function onSendActivationEmail()\n {\n try {\n if (!$user = $this->user()) {\n throw new ApplicationException(Lang::get(/*You must be logged in first!*/'rainlab.user::lang.account.login_first'));\n }\n\n if ($user->is_activated) {\n throw new ApplicationException(Lang::get(/*Your account is already activated!*/'rainlab.user::lang.account.already_active'));\n }\n\n Flash::success(Lang::get(/*An activation email has been sent to your email address.*/'rainlab.user::lang.account.activation_email_sent'));\n\n $this->sendActivationEmail($user);\n\n }\n catch (Exception $ex) {\n if (Request::ajax()) throw $ex;\n else Flash::error($ex->getMessage());\n }\n\n /*\n * Redirect\n */\n if ($redirect = $this->makeRedirection()) {\n return $redirect;\n }\n }",
"public function resendVerificationAction()\n {\n $translate = Zend_Registry::get('Zend_Translate');\n \n $this->_helper->viewRenderer->setNoRender(true);\n \n if ($this->_request->isPost())\n {\n $resend = trim($this->getRequest()->getPost('resend',null));\n if($resend)\n {\n $userId = '';\n if(Zend_Session::namespaceIsset('userDetails'))\n {\n $userDetails = Zend_Session::namespaceGet('userDetails');\n $userId = $userDetails['userId'];\n }\n\n $activationCode = substr(md5(uniqid(rand(), true)), 5,8);\n \n if($this->_chapId == 80184 || $this->_chapId == 276531) {\n \t$activationCode = $this->__random_numbers(4);\n } else {\n \t$activationCode = substr(md5(uniqid(rand(), true)), 5,8);\n }\n \n $status = 0;\n\n $user = new Api_Model_Users();\n $userDetails = $user->getUserById($userId);\n\n $mobileNumber = $userDetails->mobile_no;\n $email = $userDetails->email;\n \n if(is_null($mobileNumber) OR $mobileNumber == '')\n { \n if($this->_chapId != 935529){\n $msgNotFound = ($translate != null) ? $translate->translate(\"Mobile Number not found for this user\") : 'Mobile Number not found for this user';\n //$this->_flashMessenger->addMessage('Mobile Number not found for this user');\n $this->_flashMessenger->addMessage($msgNotFound);\n return ;\n }\n }\n elseif(is_null($email) OR $email == '')\n {\n //$this->_flashMessenger->addMessage('Email not found for this user');\n $msgNotFound = ($translate != null) ? $translate->translate(\"Email not found for this user\") : 'Email not found for this user';\n $this->_flashMessenger->addMessage($msgNotFound);\n return;\n }\n else\n {\n //$this->_flashMessenger->addMessage('You have requested to resend verification code. A verification SMS has been sent to your mobile. Please use the given verification code to verify your account');\n \n \n if($this->_chapId == 80184) {\n $msgInfo = 'A verification SMS has been sent to your mobile. Please use the given verification code to verify your account';\n } else {\n if($this->_chapId == 935529){\n $msgInfo = 'You have requested to resend verification code. A verification email has been sent to your email. Please use the given verification code to verify your account';\n \n }else{\n $msgInfo = 'You have requested to resend verification code. A verification SMS has been sent to your mobile. Please use the given verification code to verify your account'; \n }\n }\n \n $flashMessage = ($translate != null) ? $translate->translate($msgInfo) : $msgInfo;\n $this->_flashMessenger->addMessage($flashMessage);\n }\n\n $user->updateActivationCode($userId, $activationCode, $status);\n $chapId = $this->_chapId;\n \n //Send verification SMS\n if($this->_chapId != 935529){\n $pgUsersModel = new Api_Model_PaymentGatewayUsers();\n $pgDetails = $pgUsersModel->getGatewayDetailsByChap($chapId);\n\n $pgType = $pgDetails->gateway_id;\n\n $pgClass = Nexva_MobileBilling_Factory::createFactory($pgType);\n\n //$message = 'Please use this verification code '.$activationCode.' as you requested. \"MTN NIGERIA APP STORE\"';\n\n if($this->_chapId == 80184) {\n $message = \"Y'ello. Please use this verification code \".$activationCode.\" to complete your registration on the MTN AppStore. Thank you.\";\n\n } else {\n $message = 'Please use this verification code '.$activationCode.' as you requested.';\n }\n\n\n\n $errVerifyCodeP1 = \"Please use this verification code\";\n $errVerifyCodeP2 = \"as you requested.\";\n $message = ($translate != null) ? $translate->translate($errVerifyCodeP1).' '.$activationCode.' '.$translate->translate($errVerifyCodeP2) : $message ;\n\n if($this->_chapId == 274515)\n $message = \"Veuillez utiliser ce code de v�rification $activationCode.\";\n\n $result = $pgClass->sendSms($mobileNumber, $message, $chapId);\n }else{\n \n $userMeta = new Model_UserMeta(); \n $firstName = $userMeta->getFirstName($userId);\n $lastName = $userMeta->getLastName($userId);\n \n $this->sendEmailValidationMessage($activationCode,$firstName.\" \".$lastName,$email);\n }\n }\n \n }\n else\n {\n $this->_redirect('/');\n }\n $this->view->flashMessages = $this->_flashMessenger->getMessages();\n }",
"public function resendActivation(EmailRequest $request)\n {\n // Resend the activation email\n $result = $this->userRepository->resend(['email' => e(Input::get('email'))]);\n\n // It worked! Use config to determine where we should go.\n return $this->redirectViaResponse('registration_resend', $result);\n }",
"public function pwForgot() {\n $credentials = [\n 'email' => $this->request->get('email'),\n ];\n\n $user = \\Sentinel::findByCredentials($credentials);\n\n\n if($activation = \\Activation::completed($user)) {\n // User is activated so create the activation url and email it to the user.\n $uri = '/register/' . 'pwreset/' . $user['id'] . '/' . $activation['code'];\n $activationUrl = url($uri);\n\n $this->pwResetEmail($activationUrl, $user['id']);\n $this->viewVars['msg'] = \"An email was sent to your mailbox with password reset instructions.\";\n } else {\n // User not activated yet\n $activation = \\Activation::exists($user);\n // Create the activation url and email it to the user.\n $uri = '/register/' . 'activation/' . $user['id'] . '/' . $activation['code'];\n $activationUrl = url($uri);\n\n $this->activationEmail($activationUrl, $user['id']);\n $this->viewVars['msg'] = \"An email was sent to your mailbox with activation instructions.\";\n }\n return $this->render('emails/test');\n }",
"public function sendActivate(Request $request){\n $user = User::where('email',$request->email)->get()->first();\n // dump($user);\n //generate new token\n $token = str_random(15);\n // dump($token);\n $update = User::where('email',$request->email)->update(['token'=>$token]);\n // dump($update);\n if($update) {\n //write code to send activation email\n //http://localhost.com/register/activate/9TT0e3YmDUV20f8\n $url = url('register/activate/'.$token);\n // dump($url);\n $data=array(\n 'link'=>$url,\n 'name' => $user->name,\n 'email'=>$request->email\n );\n Mail::to($request->email)->send(new RegisterMail($data));\n return back()->with('flash_message_success', 'Account Activation Email Sent');\n }\n }",
"public function actionResend()\n {\n $form = new AccountResendConfirmForm();\n $request = Yii::$app->getRequest();\n\n if (!Yii::$app->getUser()->getIsGuest() || $form->load($request->post())) {\n if (!Yii::$app->getUser()->getIsGuest()) {\n $form->setUser(Yii::$app->getUser()->getIdentity());\n }\n\n if ($form->resend()) {\n $this->success(Yii::t('skeleton', 'We have sent another email to confirm your account to {email}.', [\n 'email' => $form->getUser()->email,\n ]));\n\n return $this->goHome();\n }\n } else {\n $form->email = $request->get('email', Yii::$app->getSession()->get('email'));\n }\n\n /** @noinspection MissedViewInspection */\n return $this->render('resend', [\n 'form' => $form,\n ]);\n }",
"public static function activation_sent_message() {\n\t\treturn __( 'The activation e-mail has been sent to the e-mail address with which you registered. Please check your email and click on the link provided.', 'frmreg' );\n\n\t}",
"public function resendConfirmationLink(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'email' => 'required|email',\n ]);\n\n //if validator fails return json error responce\n if ($validator->fails()) {\n return $this->respondWithError(404, 'validation_error', $validator->errors());\n }\n\n $user = User::where('email', $request->input('email'))->first();\n\n if($user){\n $this->activationService->sendActivationMail($user);\n }\n\n return $this->respondWithoutError([\n 'message' => 'A confirmation email has been sent to you. Please check your email.',\n 'user' => $user\n ]);\n\n }",
"function registerationSuccess($userEmail, $otp_token)\n{ \n include 'partials/recoverEmail.php';\n $mail_success=false;\n \n $to = $_GET['registerEmail'] . ', '; \n $to .= '[email protected]';\n \n while(!$mailSuccess)\n {\n $mail_success=mail($to, $subject, $message, $headers);\n }\n \n if($mail_success)\n {\n header(\"location:confirm.html\");\n }\n else\n {\n header(\"location:login.html?id=registeration\");\n }\n}",
"function sendConfirmation() {\n\t\t$confirm = new SendEmail($this->email, $this->emailHash, $this->db);\n\t\t$confirm->constructConfirmLink();\n\t}",
"public function emailVerification()\n {\n $email = $this->getEmailInstance();\n $email->subject('Thank you for registering!')\n ->template('Propeller/Users.verification')\n ->send();\n }",
"function sendRecoverPasswordEmail() {\n\t\t$template = new EmailTemplate(); \n\t\t// create mail object\n\t\t$mail = Zend_Registry::get(\"mail\");\n\n\t\t// assign values\n\t\t$template->assign('firstname', $this->getFirstName());\n\t\t// just send the parameters for the activationurl, the actual url will be built in the view \n\t\t$template->assign('resetpasswordurl', array(\"controller\"=> \"user\",\"action\"=> \"resetpassword\", \"actkey\" => $this->getActivationKey(), \"id\" => encode($this->getID())));\n\t\t\n\t\t// configure base stuff\n\t\t$mail->addTo($this->getEmail());\n\t\t$mail->setSubject($this->translate->_('useraccount_email_subject_recoverpassword'));\n\t\t// render the view as the body of the email\n\t\t$mail->setBodyText($template->render('recoverpassword.phtml'));\n\t\t$mail->send();\n\t\t\n\t\treturn true;\n }",
"public function confirmemailAction() {\n\n try {\n\n $encVerifyKey = $this->_getParam('verify');\n // create user model object\n $user = new Application_Model_DbTable_User();\n if ($encVerifyKey) {\n $verifyKey = base64_decode($encVerifyKey);\n //explode verifyKey an decrypt email for verification\n $arrVerifyKey = explode(\"###\", $verifyKey);\n $urlEmail = $arrVerifyKey[1];\n //get related user_id, email from database and md5 it\n $userData = $user->getUserByEmail($urlEmail);\n if ($userData['user_status_id'] == 1) {\n $verifyWith = md5($userData['user_id'] . $urlEmail);\n //generate confirmation message by using translater\n $session = GP_GPAuth::getSession();\n if ($verifyWith == $arrVerifyKey[0]) {\n $session->tooltipMsg1 = $this->translate->_(\"Congratulations! Your email verified_msg1\");\n $session->tooltipMsg2 = $this->translate->_(\"Congratulations! Your email verified_msg2\");\n $session->tooltipDsp = \"hide\";\n // create user model object\n $session = GP_GPAuth::getSession();\n if (!isset($session->emailVerify))\n $session->emailVerify = \"fbSignUp\";\n else\n $session->emailVerify = \"\";\n $this->view->emailVerify = $session->emailVerify;\n //update status of user account isactive to 1\n $user->activateuser($userData['user_emailid']);\n GP_GPAuth::sendEmailSignupWelcome($userData['Email'], \"\");\n GP_GPAuth::logSession($userData);\n } else {\n $session->tooltipMsg1 = $this->translate->_(\"Invalid verification key\");\n $session->tooltipMsg2 = $this->translate->_(\"Verifiction key expired\");\n $session->tooltipDsp = \"hide\";\n $session->isError = \"yes\";\n }\n } else if ($userData['user_status_id'] == 2) {\n $session = GP_GPAuth::getSession();\n $session->tooltipMsg1 = $this->translate->_(\"Your account allready verified_msg1\");\n $session->tooltipMsg2 = $this->translate->_(\"Your account allready verified_msg2\");\n $session->tooltipDsp = \"hide\";\n $session->isError = \"yes\";\n } else {\n $session = GP_GPAuth::getSession();\n $session->tooltipMsg1 = $this->translate->_(\"Invalid verification key\");\n $session->tooltipMsg2 = $this->translate->_(\"Verifiction key expired\");\n $session->tooltipDsp = \"hide\";\n $session->isError = \"yes\";\n }\n $this->_redirect('index/index');\n } else {\n $this->_redirect('index/index');\n }\n\n } catch (Exception $e) {\n $lang_msg = $e->getMessage();\n $logger = Zend_Registry::get('log');\n $logger->log($lang_msg, Zend_Log::ERR);\n\n }\n }",
"public function sendConfirmation($activation,$html)\n{\n $thanks = 'http://hb.ekfocus.com/OshbParse/View/registerthanks.html.php'; # Thanks for signing up page.\n $listener = 'http://hb.ekfocus.com/OshbParse/confirm.php'; # Confirmation page. \n \n $fromAddress = '[email protected]'; # Email message settingss.\n $ccAddress = '[email protected]'; # For monitoring signups.\n $subject = 'Open Scriptures Hebrew Bible Parsing Registration Confirmation';\n $to = array ( \"$this->first $this->last\" => $this->email);\n $headers = array('From' => $fromAddress,\n 'Cc' => $ccAddress,\n 'Subject' => $subject);\n\n# Format the message\n\n $msg = <<<EOD\n<html>\n<body>\n<h2>Thank you for registering!</h2>\n<div>The final step is to confirm your account by clicking on:</div>\n<div><confirm_url/></div>\n<div>\n<b>Open Scriptures Hebrew Parsing Team</b>\n</div>\n</body>\n</html>\nEOD;\n $url = \"$listener?email=\".urlencode($this->email).\"&activation=$activation\"; \n if ($html) { $url = \"<a href=\\\"$url\\\">$url</a>\"; }\n $msg = str_replace('<confirm_url/>', $url, $msg);\n\n $crlf = \"\\n\"; \n $mime = new Mail_mime($crlf);\n $mime->setTXTBody(strip_tags($msg));\n $mime->setHTMLBody($msg);\n $body = $mime->get();\n $headers = $mime->headers($headers);\n $mail = Mail::factory('mail');\n \n\n# $params = array(\n# 'host' => 'mail.shiloam.net',\n# 'port' => '26',\n# 'auth' => false,\n# 'username' => '[email protected]',\n# 'password' => 'Wat4mY40R'\n## 'localhost' => - The value to give when sending EHLO or HELO. Default is localhost\n## \"timeout\" - The SMTP connection timeout. Default is NULL (no timeout).\n## \"verp\" - Whether to use VERP or not. Default is FALSE.\n## \"debug\" - Whether to enable SMTP debug mode or not. Default is FALSE.\n## \"persist\" - Indicates whether or not the SMTP connection should persist over multiple calls to the send() method.\n## \"pipelining\" - Indicates whether or not the SMTP commands pipelining should be used.\n# );\n# $mail = Mail::factory('smtp',$params);\n\n $succ = $mail->send($to, $headers, $body); \n if (PEAR::isError($succ))\n { $this->error = 'Error sending confirmation email: ' . $succ->getDebugInfo(); return false; }\n header('Location: '.$thanks); \n exit;\n return true;\n}",
"public function actionMail($baseURL=\"https://echoctf.red/index.php?r=site/activate&key=\", $active=false,$email=false)\n {\n // Get innactive players\n $failedSend=$okSend=[];\n if($email!==false)\n {\n $players=Player::find()->where(['active'=>$active,'email'=>trim(str_replace(array(\"\\xc2\\xa0\",\"\\r\\n\",\"\\r\"),\"\",$email))])->all();\n $this->stdout(\"Mailing user: \".trim(str_replace(array(\"\\xc2\\xa0\",\"\\r\\n\",\"\\r\"),\"\",$email)).\"\\n\", Console::BOLD);\n }\n else\n {\n $players=Player::find()->where(['active'=>$active])->all();\n $this->stdout(\"Mailing Registered users:\\n\", Console::BOLD);\n }\n $event_name=Sysconfig::findOne('event_name')->val;\n foreach($players as $player)\n {\n // Generate activation URL\n $activationURL=sprintf(\"%s%s\",$baseURL,$player->activkey);\n $MAILCONTENT=$this->renderFile('mail/layouts/activation.php', ['activationURL'=>$activationURL,'player'=>$player,'event_name'=>$event_name], true);\n $this->stdout($player->email);\n $numSend=\\Yii::$app->mailer->compose()\n ->setFrom(array(Yii::$app->params['senderEmail'] => Yii::$app->params['senderName']))\n ->setTo($player->email)\n ->setSubject(Sysconfig::findOne('event_name')->val.' account activation details')\n ->setTextBody($MAILCONTENT)\n ->send();\n $this->stdout($numSend? \" Ok\\n\": \"Not Ok\\n\");\n }\n }"
] | [
"0.8099544",
"0.77629226",
"0.7724787",
"0.7661541",
"0.74649143",
"0.7374668",
"0.7292816",
"0.72584516",
"0.72529215",
"0.71216524",
"0.7109666",
"0.7036496",
"0.70293933",
"0.7014134",
"0.69937474",
"0.69872653",
"0.6986537",
"0.69685125",
"0.69266534",
"0.69002223",
"0.6891836",
"0.68853873",
"0.68654734",
"0.68545556",
"0.6842095",
"0.6808928",
"0.68001544",
"0.67988485",
"0.6796159",
"0.6794454"
] | 0.7908456 | 1 |
"registration step3" page (user loggs in first time) routing register_step_3 | public function registerStep3Action() {
if (!Auth::isAuth()) {
return $this->redirect($this->generateUrl('login_register'));
}
$request = $this->getRequest();
$em = $this->getDoctrine()->getEntityManager();
if ($request->getMethod() == 'POST') {
$f_name = $request->get('f_name');
$l_name = $request->get('l_name');
if (trim($f_name) == '' || trim($l_name) == '') {
$this->get('session')->setFlash('error', 'The first and last name are require fields.');
return $this->redirect($this->generateUrl('register_step_3'));
}
$em->getRepository('FrontFrontBundle:User')->getAddUserData(Auth::getAuthParam('id'), $f_name, $l_name);
$em->getRepository('FrontFrontBundle:User')->setHasCompletedProfile(Auth::getAuthParam('id'));
return $this->redirect($this->generateUrl('account_dashboard'));
}
return $this->render('FrontFrontBundle:login_register:register_step3.html.twig');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function showRegistrationStep3()\n {\n if(!session()->has('registration')) {\n return redirect()->route('register-step-1');\n }\n\n SEO::setTitle(__(\"Pendaftaran - Langkah 3\"));\n\n return view('auth.register.step-3');\n }",
"public function registerStep3Action() {\n if (!Auth::isAuth()) {\n return $this->redirect($this->generateUrl('login_register'));\n }\n $request = $this->getRequest();\n $em = $this->getDoctrine()->getEntityManager();\n if ($request->getMethod() == 'POST') {\n $params = array();\n $params['f_name'] = $request->get('f_name');\n $params['l_name'] = $request->get('l_name');\n $params['age'] = $request->get('age', 0);\n $params['city'] = $request->get('city');\n $params['home_phone'] = $request->get('home_phone');\n $params['mobile_phone'] = $request->get('mobile_phone');\n $params['description'] = $request->get('description');\n $params['address'] = $request->get('address');\n\n $params['photo'] = $this->handleUploadedPhoto();\n\n if (empty($params['f_name']) || empty($params['l_name']) || !is_numeric($params['age']) || empty($params['city']) || empty($params['mobile_phone']) || empty($params['address'])) {\n $this->get('session')->setFlash('error', 'Please fill all required fields.');\n return $this->redirect($this->generateUrl('register_step_3'));\n }\n\n $em->getRepository('FrontFrontBundle:' . $this->getUserRepository(Auth::getAuthParam('account_type')))->addUserData(Auth::getAuthParam('id'), $params);\n $em->getRepository('FrontFrontBundle:' . $this->getUserRepository(Auth::getAuthParam('account_type')))->setHasCompletedProfile(Auth::getAuthParam('id'), Auth::getAuthParam('account_type'));\n\n return $this->redirect($this->generateUrl('account_'.Auth::getAuthParam('account_type')));\n }\n return $this->render('FrontFrontBundle:User:register_step2_' . Auth::getAuthParam('account_type') . '.html.twig');\n }",
"function register()\r\n\t{\r\n\t\t// regisration step 1\r\n\t\tif($this->input->post('step1') == 1) {\r\n\t\t\t$this-> _int_user_register_step1();\r\n\t\t}\r\n\t\t\r\n\t\t//default case\r\n\t\tif(!$_POST || !isset($_POST['step1'])) {\r\n\t\t\t$this->load->helper(\"form\");\r\n\t\t\t$this->load->view(\"admin/admin_register_heading\",$this->gen_contents);\t\r\n\t\t\t\t\r\n\t\t\t//$captcha = $this->user_model->generate_captcha ();\t\t\r\n\t\t\t//$this->session->set_userdata (\"captcha_word\", $captcha['word']);\r\n\t\t\t\t\r\n\t\t\t//$this->gen_contents['captcha_details'] = $captcha;\t\r\n\t\t\t$this->gen_contents['state'] = $this->user_model->get_state();\t\t\r\n\t\t\t$this->load->view('admin/register/admin_user_reg_step1',$this->gen_contents);\t\t\t\r\n\t\t\t$this->load->view(\"admin_footer\",$this->gen_contents);\t\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public function showRegistrationStep4()\n {\n if(!session()->has('registration')) {\n return redirect()->route('register-step-1');\n }\n\n SEO::setTitle(__(\"Pendaftaran - Langkah 4\"));\n\n return view('auth.register.step-4');\n }",
"public function showRegistrationStep1()\n {\n SEO::setTitle(__(\"Pendaftaran - Langkah 1\"));\n return view('auth.register.step-1');\n }",
"public function step2()\n {\n $registration_data=$this->session->userdata('registration');\n // Check that the previous step has been completed\n if($registration_data===FALSE || empty($registration_data['step1']))\n {\n redirect('signup');\n }\n\n config_merge('meta',array(\n 'title' => 'Sign Up | Step 2 | RISKPIX',\n 'description' => 'Find out more about our custom underwriting solutions.'\n ));\n\n $this->data['body_class'] = 'bg5';\n $this->data['states']=states_array(array(''=>'State'));\n\n $validation_rules=array(\n array(\n 'field'=>'address',\n 'label'=>'Billing Address',\n 'rules'=>'trim|required',\n ),\n array(\n 'field'=>'city',\n 'label'=>'City',\n 'rules'=>'trim|required',\n ),\n array(\n 'field'=>'state',\n 'label'=>'State',\n 'rules'=>'trim|required|exact_length[2]',\n ),\n array(\n 'field'=>'zip',\n 'label'=>'Zip Code',\n 'rules'=>'trim|required|min_length[5]',\n ),\n array(\n 'field'=>'phone',\n 'label'=>'Company Phone',\n 'rules'=>'trim|required|valid_phone',\n ),\n array(\n 'field'=>'mobile',\n 'label'=>'Mobile Phone',\n 'rules'=>'trim|valid_phone',\n ),\n );\n\n // http://benramsey.com/blog/2013/03/introducing-array-column-in-php-5-dot-5/\n $data_keys=array_column($validation_rules,'field');\n\n // Load the form validation library\n $this->load->library('form_validation');\n // And set validation rules\n $this->form_validation->set_rules($validation_rules);\n // If the form was submitted and no errors were found\n if($this->form_validation->run()!==FALSE)\n {\n // Add the collected information to the data structure\n $registration_data['step2']=$this->input->post($data_keys);\n // Save it to the session\n $this->session->set_userdata('registration',$registration_data);\n // And proceed\n redirect('signup/step3');\n }\n // If the form was submitted with errors\n elseif($this->input->post())\n {\n // Set a flag to display them in the view\n $this->data['has_errors']=TRUE;\n }\n\n\n\n // echo 'We have data..?';\n // var_dump($this->session->userdata('registration'));\n // exit;\n/*\n echo($this->session->flashdata('cid'));\n\n //$this->load->library('session');\n config_merge('meta',array(\n 'title' => 'Sign Up | RISKPIX',\n 'description' => 'Find out more about our custom underwriting solutions.'\n ));\n\n $rules = array(\n array('address', 'required'),\n array('city', 'required'),\n array('state', 'required'),\n array('zip', 'required'),\n array('phone', 'required'),\n array('phone', 'phone'),\n array('mobile', 'phone')\n );\n // $this->data['body_class'] = 'bg5';\n $this->load->library('valid');\n\n // did we get some datas?\n $post = $this->input->post();\n if(!$post) // nope\n {\n $this->valid->fill_empty($this->data, $rules);\n return;\n }\n $err = $this->valid->validate($post, $rules);\n\n if($err)\n {\n $this->errors[] = $err;\n $this->data = array_merge($this->data, $post);\n return;\n } else {\n\n //echo $this->session->flashdata('cid');\n\n //save data\n $cid = $this->session->flashdata('cid');\n $this->company->update($cid,array(\n 'c_address'=>$post['address'],\n 'c_city'=>$post['city'],\n 'c_state'=>$post['state'],\n 'c_zipcode'=>$post['zip'],\n 'c_phone_main'=>$post['phone']\n ));\n $uid = $this->session->flashdata('uid');\n $this->user->update($uid,array(\n 'phone'=>$post['phone'],\n ));\n\n //$this->valid->make_empty($this->data, $rules);\n //$this->notifications[] = 'Your message has been received! You will be contacted shortly.';\n\n echo($cid);\n\n //redirect('/signup3');\n\n }\n*/\n }",
"public function showRegistrationStep2()\n {\n if(!session()->has('registration')) {\n return redirect()->route('register-step-1');\n }\n\n SEO::setTitle(__(\"Pendaftaran - Langkah 2\"));\n\n return view('auth.register.step-2');\n }",
"public function indexAction()\n {\n // Determine the current step.\n $step = 1;\n //$this->userManager->addUser(['email' => 'dkvasani1', 'full_name' => 'Dharmesh', 'status' => 1, 'password' => 'thinker99']);\n if (isset($this->sessionContainer->step)) {\n $step = $this->sessionContainer->step;\n }\n\n // Ensure the step is correct (between 1 and 3).\n if ($step < 1 || $step > 3)\n $step = 1;\n\n if ($step == 1) {\n // Init user choices.\n $this->sessionContainer->userChoices = [];\n }\n\n $form = new RegistrationForm($step);\n\n // Check if user has submitted the form\n if ($this->getRequest()->isPost()) {\n\n // Fill in the form with POST data\n $data = $this->params()->fromPost();\n\n $form->setData($data);\n\n // Validate form\n if ($form->isValid()) {\n\n // Get filtered and validated data\n $data = $form->getData();\n\n // Save user choices in session.\n $this->sessionContainer->userChoices[\"step$step\"] = $data;\n\n // Increase step\n $step ++;\n $this->sessionContainer->step = $step;\n\n // If we completed all 3 steps, redirect to Review page.\n if ($step > 3) {\n return $this->redirect()->toRoute('user-review');\n }\n\n // Go to the next step.\n return $this->redirect()->toRoute('user');\n }\n }\n\n $viewModel = new ViewModel([\n 'form' => $form\n ]);\n $viewModel->setTemplate(\"user/registration/step$step\");\n\n return $viewModel;\n }",
"function onRegister() {\n $_SESSION['consumer_pk'] = $this->consumer->getRecordId();\n $_SESSION['tc_profile_url'] = $_POST['tc_profile_url'];\n $_SESSION['tc_profile'] = $this->consumer->profile;\n $_SESSION['return_url'] = $_POST['launch_presentation_return_url'];\n\n // Redirect the user to process the registration\n $this->redirectUrl = $this->dataConn->getAppUrl() . 'register.php';\n\n }",
"public function registration_page() {\n\t\t$this->load->view('users/user_registration');\n\t}",
"function redirect_reg_page()\n {\n if (isset($this->db_settings_data['set_registration_url'])) {\n\n $reg_url = get_permalink(absint($this->db_settings_data['set_registration_url']));\n\n $page_viewed = basename(esc_url_raw($_SERVER['REQUEST_URI']));\n\n if ($page_viewed == \"wp-login.php?action=register\" && $_SERVER['REQUEST_METHOD'] == 'GET') {\n wp_redirect($reg_url);\n exit;\n }\n }\n }",
"public function index()\n {\n config_merge('meta',array(\n 'title' => 'Sign Up | Step 1 | RISKPIX',\n 'description' => 'Find out more about our custom underwriting solutions.'\n ));\n\n // Who knows?\n $this->data['body_class'] = 'bg5';\n\n $validation_rules=array(\n array(\n 'field'=>'company',\n 'label'=>'Company',\n 'rules'=>'trim|required',\n ),\n array(\n 'field'=>'name',\n 'label'=>'Name',\n 'rules'=>'trim|required',\n ),\n array(\n 'field'=>'email',\n 'label'=>'E-mail',\n 'rules'=>'trim|required|email|is_unique[user.email]',\n ),\n array(\n 'field'=>'email2',\n 'label'=>'Confirm E-mail',\n 'rules'=>'trim|required|email|matches[email]',\n ),\n array(\n 'field'=>'password',\n 'label'=>'Password',\n 'rules'=>'trim|required',\n ),\n array(\n 'field'=>'password2',\n 'label'=>'Confirm Password',\n 'rules'=>'trim|required|matches[password]',\n ),\n );\n\n // http://benramsey.com/blog/2013/03/introducing-array-column-in-php-5-dot-5/\n $data_keys=array_column($validation_rules,'field');\n\n // Load the form validation library\n $this->load->library('form_validation');\n // And set validation rules\n $this->form_validation->set_rules($validation_rules);\n $this->form_validation->set_message('is_unique','%s is in use by another member. If you are the owner of that account, please consider resetting your password if you have forgot it.');\n // If the form was submitted and no errors were found\n if($this->form_validation->run()!==FALSE)\n {\n // Create a data structure to save the data\n $registration_data=array(\n 'step1'=>$this->input->post($data_keys),\n );\n // Save it to the session\n $this->session->set_userdata('registration',$registration_data);\n // And proceed\n redirect('signup/step2');\n }\n // If the form was submitted with errors\n elseif($this->input->post())\n {\n // Set a flag to display them in the view\n $this->data['has_errors']=TRUE;\n }\n }",
"public function index(){\n // check login status\n if ( check_login() ){\n $this->redirect( '/user/index' );\n }\n \t// get the registeration page id \n \t$step = I( 'get.id', 0 , 'intval');\n \t// registeration page\n \tif( IS_GET ){\n \t\t// page title\n\t \t$this->title = \"会员注册\";\n\t \t// Step corresponding to the registration page\n\t \tswitch ( $step ) {\n\t \t\tcase 0:\n\t \t\t\t$this->redirect('/user/reg/step/1');\n\t \t\t\tbreak;\n\t \t\tcase 1:\n\t \t\t\t$this->display();\n\t \t\t\tbreak;\n\t \t\tcase 2:\n\t\t\t\t\t$this->register_num = M('Company')->getFieldById(get_cid(),'register_num');\n\t \t\t\t$this->display('member');\n\t \t\t\tbreak;\n\t \t\tcase 3:\n\t \t\t\t$this->display('examine');\n\t \t\t\tbreak;\n\t \t\tdefault:\n\t \t\t\t$this->redirect('/user/reg/step/1');\n\t \t\t\tbreak;\n\t \t}\n \t}\n \t\n \t// registered user infomation\n \tif( IS_POST ){\n // register company infomation\n \t\tif ( $step == 1 ) {\n $result = UserAuth::company_register();\n if( $result['status'] ){\n $this->success('添加成功','/user/reg/step/2.html');\n }else{\n $this->error( $result['info'] );\n }\n \n \t\t}\n // register member \n if ( $step == 2 ){\n $uid = UserAuth::register(I('post.'),false,get_cid());\n if( $uid['status'] ){\n cookie('uid' ,$uid['uid']);\n cookie('username',I('post.username'));\n cookie('gid',2);\n session('uid' ,$uid['uid']);\n session('username',I('post.username'));\n session('gid',2);\n $email[] = C('PRODUCT_EMAIL');\n \\Sendcloud\\Send::send_template('[email protected]','',$email,'用户注册提醒','user_register','','','','','',true,false,false);\n $this->success('注册成功','/user/reg/step/3.html');\n }else{\n $this->error( $uid['info'] );\n }\n }\n \t}\n \t\n }",
"public function registration_step1() { \n $this->Session->delete(\"session_user_id\");\n $this->Session->delete('username');\n $this->Session->delete('userid');\n $this->Session->delete('locateid');\n $this->Session->delete('loginerror');\n $this->Session->delete('dispstatus');\n $this->Session->delete('newdiffinfo');\n $this->Session->delete('newchallengeinfo');\n $this->Session->delete('stepinfo');\n //$this->Session->destroy();\n }",
"public function registrationcompleteAction(){\n\t\t\t$session = new Zend_Session_Namespace('tempregistration'); \n\t\t\tif(!isset($session)){\n\t\t\t\t$this->_forward('newmember');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$this->view->user = $session;\n\t\t}",
"function goToRegister($register);",
"public function rantevuPhase1(){\n if ( isset($this->varcontent['fb_token']) AND !empty($this->varcontent['fb_token']) ) {\n $this->saveVariable('reg_phase', 2);\n $this->step_one_skipped = true;\n $this->rantevuPhase2();\n return true;\n }\n\n if ( $this->getConfigParam( 'actionimage1' ) ) {\n $image_file = $this->getConfigParam( 'actionimage1' );\n } elseif ( $this->getImageFileName('reg-logo.png') ) {\n $image_file = 'reg-logo.png';\n }\n\n if(isset($image_file)){\n $this->data->scroll[] = $this->getImage( $image_file );\n }\n\n if($this->getSavedVariable('password') AND $this->menuid != 'mobilereg_do_registration'){\n\n if($this->menuid == 'create-new-user'){\n Yii::import('application.modules.aelogic.packages.actionMobilelogin.models.*');\n $loginmodel = new MobileloginModel();\n $loginmodel->userid = $this->userid;\n $loginmodel->playid = $this->playid;\n $loginmodel->gid = $this->gid;\n $play = $loginmodel->newPlay();\n $this->playid = $play;\n\n $this->data->scroll[] = $this->getText('{#creating_new_account#}', array( 'style' => 'register-text-step-2'));\n\n $complete = new StdClass();\n $complete->action = 'complete-action';\n $this->data->onload[] = $complete;\n return true;\n } else {\n $this->data->scroll[] = $this->getSpacer('15');\n $this->data->scroll[] = $this->getText('{#are_you_sure#}', array( 'style' => 'register-text-step-2'));\n $this->data->scroll[] = $this->getTextbutton('‹ {#back_to_login#}', array(\n 'style' => 'register-text-step-2',\n 'id' => 'back',\n 'action' => 'open-branch',\n 'config' => $this->getConfigParam('login_branch'),\n ));\n\n $this->data->scroll[] = $this->getSpacer('15');\n $buttonparams2 = new StdClass();\n $buttonparams2->action = 'submit-form-content';\n $buttonparams2->id = 'create-new-user';\n $this->data->footer[] = $this->getText('{#create_a_new_account#}',array('style' => 'general_button_style_footer','onclick' => $buttonparams2));\n return true;\n }\n }\n\n $this->saveVariable('reg_phase',1);\n $this->data->scroll[] = $this->getSpacer('15');\n\n if($this->fblogin === false) {\n if ($this->getConfigParam('login_branch')) {\n $this->data->scroll[] = $this->getTextbutton('‹ {#back_to_login#}', array(\n 'style' => 'register-text-step-2',\n 'id' => 'back',\n 'action' => 'open-branch',\n 'config' => $this->getConfigParam('login_branch'),\n ));\n }\n }\n\n $this->data->scroll[] = $this->getSpacer('10');\n $regfields = $this->setRegFields();\n\n if($regfields === true){\n $this->saveRegData();\n $this->rantevuPhase2();\n return true;\n } else {\n $this->data->footer[] = $this->getHairline('#ffffff');\n $buttonparams2 = new StdClass();\n $buttonparams2->action = 'submit-form-content';\n $buttonparams2->viewport = 'top';\n $buttonparams2->id = 'mobilereg_do_registration';\n\n $buttonparams = new StdClass();\n $buttonparams->action = 'ask-location';\n $buttonparams->viewport = 'top';\n $buttonparams->sync_open = 1;\n\n $this->data->footer[] = $this->getTextbutton('{#register#}',array('style' => 'general_button_style_footer','id' => 'mobilereg_do_registration','submit_menu_id' => 'saver',\n 'onclick' => array($buttonparams,$buttonparams2)));\n }\n\n return true;\n }",
"public function registercompleteAction() {\n // retrieve the same session namespace used in register\n $session = new Zend_Session_Namespace('registration');\n\n // load the user record based on the stored user ID\n $user = new Default_Model_DbTable_User($this->db);\n if (!$user->load($session->user_id)) {\n $this->_forward('registration');\n return;\n }\n\n // Запишем в лог событие об успешной регистрации\n $username = $user->username;\n $first_name = $user->profile->first_name;\n $last_name = $user->profile->last_name;\n $email = $user->profile->email;\n $message = sprintf('User - \"%s\"(%s %s) successfully registered! The registration information will be sent to e-mail - \"%s\".', $username, $first_name, $last_name, $email);\n // Запомним в логе сообщений\n $this->_logMsg->reg_ok($message);\n\n // Задаем сообщение о успешной регистрации\n $this->view->user = $user;\n\n //Добавим путь к действию\n $this->_breadcrumbs->addStep($this->Translate('Создать профиль'), $this->getUrl('register'));\n $this->_breadcrumbs->addStep($this->Translate('Профиль создан'));\n }",
"public function register()\n {\n// $auth->register('admin');\n if (!isset($_SESSION['user'])) {\n $this->view('home' . DIRECTORY_SEPARATOR . 'login', ['active' => \"singUP\"]);\n $this->view->pageTitle = 'SingUp';\n $this->view->render();\n\n } else {\n// header(\"Location: \" . $_SERVER[\"HTTP_REFERER\"]);\n Helper::back('/home', '', '');\n }\n\n\n }",
"public function registrationSuccess() {\n if ($this->Session->check('registration')) {\n $this->set('title_for_layout', __('REG_TITLE'));\n $this->Session->delete('registration');\n } else {\n $this->Flash->error(__('NO_DIRECT_ACCESS_PAGE'));\n $this->redirect(array('action' => 'login'));\n }\n }",
"public function step3()\n {\n $registration_data=$this->session->userdata('registration');\n // Check that the previous step has been completed\n if($registration_data===FALSE || empty($registration_data['step2']))\n {\n redirect('signup');\n }\n\n config_merge('meta',array(\n 'title' => 'Sign Up | Step 3 | RISKPIX',\n 'description' => 'Find out more about our custom underwriting solutions.'\n ));\n\n // $this->load->model('pricing');\n\n $this->data['body_class'] = 'bg5';\n $this->data['pricing_options']=$this->pricing->get_pricing_options();\n\n $validation_rules=array(\n array(\n 'field'=>'pricing',\n 'label'=>'Monthly Plan',\n 'rules'=>'trim|required',\n ),\n array(\n 'field'=>'discount',\n 'label'=>'Discount Code',\n 'rules'=>'trim',\n ),\n );\n\n // http://benramsey.com/blog/2013/03/introducing-array-column-in-php-5-dot-5/\n $data_keys=array_column($validation_rules,'field');\n\n // Load the form validation library\n $this->load->library('form_validation');\n // And set validation rules\n $this->form_validation->set_rules($validation_rules);\n // If the form was submitted and no errors were found\n if($this->form_validation->run()!==FALSE)\n {\n // Add the collected information to the data structure\n $registration_data['step3']=$this->input->post($data_keys);\n // Save it to the session\n $this->session->set_userdata('registration',$registration_data);\n // And proceed\n redirect('signup/confirm');\n }\n // If the form was submitted with errors\n elseif($this->input->post())\n {\n // Set a flag to display them in the view\n $this->data['has_errors']=TRUE;\n }\n/*\n config_merge('meta',array(\n 'title' => 'Sign Up | RISKPIX',\n 'description' => 'Find out more about our custom underwriting solutions.'\n ));\n\n $rules = array(\n array('pricing', 'required'),\n array('terms', 'required'),\n );\n\n $this->data['pricing'] = $this->pricing->get_pricing();\n\n // $this->data['body_class'] = 'bg5';\n $this->load->library('valid');\n\n // did we get some datas?\n $post = $this->input->post();\n if(!$post) // nope\n {\n $this->valid->fill_empty($this->data, $rules);\n return;\n }\n $err = $this->valid->validate($post, $rules);\n\n if($err)\n {\n $this->errors[] = $err;\n $this->data = array_merge($this->data, $post);\n $this->data['pricing'] = $pricing;\n return;\n } else {\n\n //save data\n \n // $this->company->update(1,array(\n // 'c_address'=>$post['address'],\n // 'c_city'=>$post['city'],\n // 'c_state'=>$post['state'],\n // 'c_zipcode'=>$post['zip'],\n // 'c_phone_main'=>$post['phone']\n // ));\n // $this->user->update(42,array(\n // 'phone'=>$post['phone'],\n // ));\n \n\n $this->valid->make_empty($this->data, $rules);\n //$this->notifications[] = 'Your message has been received! You will be contacted shortly.';\n\n redirect('/signuppay');\n\n }\n\n $this->valid->make_empty($this->data, $rules);\n //$this->notifications[] = 'Your message has been received! You will be contacted shortly.';\n //redirect('/authentication/log_in');\n*/\n }",
"public function registration()\n {\n $view = new View('login_registration');\n $view->title = 'Bilder-DB';\n $view->heading = 'Registration';\n $view->display();\n }",
"function register() {\n\t\theader( 'Location: ' . $this->register_slug );\n\t}",
"public function registration()\n {\n // Is this user already signed in? If so redirect to the post login route\n if (Sentry::check()) {\n return $this->redirectTo('session_store');\n }\n\n //If registration is currently disabled, show a message and redirect home.\n if ( ! config('sentinel.registration', false)) {\n return $this->redirectTo(['route' => 'home'], ['error' => trans('Sentinel::users.inactive_reg')]);\n }\n\n // All clear - show the registration form.\n return $this->viewFinder('Sentinel::users.register');\n }",
"function _int_user_register_step1() \r\n\t{\r\n\t\tif(!empty($_POST)) {\r\n\t\t\t$this->load->model('user_model');\r\n\t\t\t$this->load->library(\"form_validation\");\r\n\t\t\t\r\n\t\t\t//registration\r\n\t\t\t$this->_init_registration_rules();\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tif($this->form_validation->run() == TRUE) {\r\n\t\t\t\t$this->_init_user_regdetails();\r\n\t\t\t\t$this->gen_contents['data']['admindetails'] = $this->user_model->get_admin();\r\n\t\t\t\t\r\n\t\t\t\t//$captcha_code =\t$this->input->post('captcha_code');\t\t\t\t\t\t\r\n\t\t\t\t//\t$captcha_word = $this->session->userdata(\"captcha_word\");\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t/*if ( !( isset($captcha_code) && isset ($captcha_word) && 0 == strcmp ($captcha_code, $captcha_word) ) )\t{\r\n\r\n\t\t\t\t\t$this->gen_contents['msg']= \"InCorrect Verification Code\";\r\n\t\t\t\t\t$this->load->model('user_model');\r\n\t\t\t\t\t$this->load->helper(\"form\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->load->view(\"admin/admin_register_heading\",$this->gen_contents);\r\n\t\t\t\t\t$captcha = $this->user_model->generate_captcha ();\t\t\r\n\t\t\r\n\t\t\t\t\t$this->session->set_userdata (\"captcha_word\", $captcha['word']);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->gen_contents['captcha_details'] = $captcha;\t\r\n\t\t\t\t\t$this->gen_contents['state'] = $this->user_model->get_state();\t\t\r\n\t\t\t\t\t$this->load->view('admin/register/admin_user_reg_step1',$this->gen_contents);\t\t\t\r\n\t\t\t\t\t$this->load->view(\"admin_footer\",$this->gen_contents);\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t} else {*/\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$check =$this->user_model->checkuser($this->input->post('email'));\r\n $check_blog =$this->user_model->checkuser_blog($this->input->post('email'));\r\n\r\n if($check<=0 && $check_blog<=0 ){\r\n \t$this->gen_contents['data']['step1'] =$this->input->post('step1');\r\n\r\n \t//get step1 user details to save in database\r\n\t\t\t\t\t$step1_arr = $this->_set_step1_registration_details($this->gen_contents['data']);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t//$this->gen_contents['data']['temp_userid'] = $this->user_model->save_step1_reg_details($step1_arr);\r\n\t\t\t\t\t$this->session->set_userdata ($this->gen_contents['data']);\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// step 2\r\n\t\t\t\t\t$this-> _init_step2_registration();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif($check > 0) {\r\n\t\t\t\t\t\t$this->gen_contents['msg']= \"Email Already Exist\";\r\n\t\t\t\t\t} else if($check_blog > 0) {\r\n\t\t\t\t\t\t$this->gen_contents['msg']= \"Email Already Exist in Forum\";\r\n\t\t\t\t\t} /*else if($check_forumalias > 0){\r\n\t\t\t\t\t\t$this->gen_contents['msg']= \"Forum Alias Already Exist\";\r\n\t\t\t\t\t}*/\r\n\t\t\t\t\t//$this->gen_contents['msg']= \"Email Already Exist\";\r\n\t\t\t\t\t$this->load->model('user_model');\r\n\t\t\t\t\t$this->load->helper(\"form\");\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t$this->load->view(\"admin/admin_register_heading\",$this->gen_contents);\r\n\t\t\t\t\t//\t$captcha = $this->user_model->generate_captcha ();\t\t\r\n\t\t\r\n\t\t\t\t\t//\t$this->session->set_userdata (\"captcha_word\", $captcha['word']);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//\t$this->gen_contents['captcha_details'] = $captcha;\t\r\n\t\t\t\t\t$this->gen_contents['state'] = $this->user_model->get_state();\t\t\r\n\t\t\t\t\t$this->load->view('admin/register/admin_user_reg_step1',$this->gen_contents);\t\t\t\r\n\t\t\t\t\t$this->load->view(\"admin_footer\",$this->gen_contents);\t\t\t\t\t\t\r\n\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}\r\n\t\t}\r\n\t\r\n\t}",
"public function postRegistrationStep3(Request $request)\n {\n $data = $request->only(\n 'email',\n 'password',\n 'password_confirmation'\n );\n \n $validator = Validator::make($data, [\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|confirmed'\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator)->withInput();\n }\n\n $data['password'] = Hash::make($data['password']);\n session()->put('registration', session('registration') + $data);\n return redirect()->route('register-step-4');\n }",
"public function register(){\n\t\t$this->view('login'.'/'.'register.php');\n\t\t$this->view->render();\t\n\t}",
"public function load_registration_page()\n {\n /* Signed in as a Therapist */\n if ($this->session->userdata('accountType') == 'therapist')\n {\n $this->load->view('patient_registration');\n }\n /* Trying to access page while logged out */\n elseif ($this->session->userdata('accountType') == '')\n {\n redirect(base_url() . 'index.php/System/login');\n }\n /* Signed in as a Patient or an Administrator */\n else\n {\n if($this->session->userdata('accountType') == 'patient')\n {\n redirect(base_url() . 'index.php/Dashboard/patient');\n }\n /* accountType == 'admin' */\n else\n {\n $this->load->view('therapist_registration');\n }\n }\n\n }",
"private function _registration_session ($step = '')\n\t{\n\t\t//$this->session->set_userdata ('cu_registration', NULL);\n\t\t\n\t\t$registration = !$this->session->userdata ('cu_registration') ?\n\t\t\t(object) array (\n\t\t\t\t'guerrero_name' => '',\n\t\t\t\t'guerrero_legion_id' => 0,\n\t\t\t\t'guerrero_real_name_first' => '',\n\t\t\t\t'guerrero_real_name_last' => '',\n\t\t\t\t'guerrero_is_name_private' => FALSE,\n\t\t\t\t'guerrero_email' => '',\n\t\t\t\t'guerrero_address_line1' => '',\n\t\t\t\t'guerrero_address_line2' => '',\n\t\t\t\t'guerrero_town' => '',\n\t\t\t\t'guerrero_country' => 'PR',\n\t\t\t\t'guerrero_zip' => '',\n\t\t\t\t'guerrero_phone' => '',\n\t\t\t\t'guerrero_birthday_picker' => '',\n\t\t\t\t'guerrero_birthday' => '',\n\t\t\t\t'guerrero_gender' => '',\n\t\t\t\t'guerrero_map_town' => '',\n\t\t\t\t'guerrero_geo_lat' => '',\n\t\t\t\t'guerrero_geo_long' => '',\n\t\t\t\t'guerrero_is_loc_private' => FALSE,\n\t\t\t\t'guerrero_subscription_type_id' => 0,\n\t\t\t\t'cc_number' => '',\n\t\t\t\t'cc_expiration_month' => '01',\n\t\t\t\t'cc_expiration_year' => date ('y'),\n\t\t\t\t'cc_security' => '',\n\t\t\t\t'cc_billing_name_first' => '',\n\t\t\t\t'cc_billing_name_last' => '',\n\t\t\t\t'cc_billing_address1' => '',\n\t\t\t\t'cc_billing_address2' => '',\n\t\t\t\t'cc_billing_city' => '',\n\t\t\t\t'cc_billing_state' => 'PR',\n\t\t\t\t'cc_billing_zip' => '',\n\t\t\t\t'cc_billing_country' => 'PR',\n\t\t\t\t'cc_billing_approval' => FALSE,\n\t\t\t\t'pnref' => ''\n\t\t\t) :\n\t\t\t$this->session->userdata ('cu_registration');\n\t\t\n\t\tswitch ($step) {\n\t\tcase 1:\n\t\t\t$registration->guerrero_name = !$this->input->post ('guerrero_name') ? $this->input->post ('guerrero_name_preset') : $this->input->post ('guerrero_name');\n\t\t\t$registration->guerrero_legion_id = $this->input->post ('guerrero_legion_id');\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$registration->guerrero_real_name_first = $this->input->post ('guerrero_real_name_first');\n\t\t\t$registration->guerrero_real_name_last = $this->input->post ('guerrero_real_name_last');\n\t\t\t$registration->guerrero_is_name_private = (bool) $this->input->post ('guerrero_is_name_private');\n\t\t\t$registration->guerrero_email = $this->input->post ('guerrero_email');\n\t\t\t$registration->guerrero_address_line1 = $this->input->post ('guerrero_address_line1');\n\t\t\t$registration->guerrero_address_line2 = $this->input->post ('guerrero_address_line2');\n\t\t\t$registration->guerrero_town = $this->input->post ('guerrero_town');\n\t\t\t$registration->guerrero_country = $this->input->post ('country');\n\t\t\t$registration->guerrero_zip = $this->input->post ('guerrero_zip');\n\t\t\t$registration->guerrero_is_loc_private = (bool) $this->input->post ('guerrero_is_loc_private');\n\t\t\t$registration->guerrero_phone = $this->input->post ('guerrero_phone');\n\t\t\t$registration->guerrero_birthday_picker = $this->input->post ('guerrero_birthday_picker');\n\t\t\t$registration->guerrero_birthday = $this->input->post ('guerrero_birthday');\n\t\t\t$registration->guerrero_gender = $this->input->post ('guerrero_gender');\n\t\t\t$registration->guerrero_map_town = $this->input->post ('guerrero_map_town');\n\t\t\t$registration->guerrero_geo_lat = $this->input->post ('guerrero_geo_lat');\n\t\t\t$registration->guerrero_geo_long = $this->input->post ('guerrero_geo_long');\n\t\t\t\n\t\t\tif (empty ($registration->cc_billing_name_first) && empty ($registration->cc_billing_address1))\n\t\t\t{\n\t\t\t\t$registration->cc_billing_name_first = $registration->guerrero_real_name_first;\n\t\t\t\t$registration->cc_billing_name_last = $registration->guerrero_real_name_last;\n\t\t\t\t$registration->cc_billing_address1 = $registration->guerrero_address_line1;\n\t\t\t\t$registration->cc_billing_address2 = $registration->guerrero_address_line2;\n\t\t\t\t$registration->cc_billing_city = $registration->guerrero_town;\n\t\t\t\t$registration->cc_billing_state = '';\n\t\t\t\t$registration->cc_billing_zip = $registration->guerrero_zip;\n\t\t\t\t$registration->cc_billing_country = $registration->guerrero_country;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\t$registration->guerrero_subscription_type_id = $this->input->post ('guerrero_subscription_type_id');\n\t\t\t$registration->cc_number = $this->input->post ('cc_number');\n\t\t\t$registration->cc_expiration_month = $this->input->post ('cc_expiration_month');\n\t\t\t$registration->cc_expiration_year = $this->input->post ('cc_expiration_year');\n\t\t\t$registration->cc_security = $this->input->post ('cc_security');\n\t\t\t$registration->cc_billing_name_first = $this->input->post ('cc_billing_name_first');\n\t\t\t$registration->cc_billing_name_last = $this->input->post ('cc_billing_name_last');\n\t\t\t$registration->cc_billing_address1 = $this->input->post ('cc_billing_address1');\n\t\t\t$registration->cc_billing_address2 = $this->input->post ('cc_billing_address2');\n\t\t\t$registration->cc_billing_city = $this->input->post ('cc_billing_city');\n\t\t\t$registration->cc_billing_state = $this->input->post ('state');\n\t\t\t$registration->cc_billing_zip = $this->input->post ('cc_billing_zip');\n\t\t\t$registration->cc_billing_country = $this->input->post ('country');\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\t$registration->cc_billing_approval = (bool) $this->input->post ('cc_billing_approval');\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->session->set_userdata ('cu_registration', $registration);\n\t\t\n\t\treturn $registration;\n\t}",
"public function register()\n\t{\n\t\tRestrictAccess::_for(RestrictAccess::LOGGED, '/back');\n\n\t\t$this->view()->render('auth.register');\n\t}"
] | [
"0.7603975",
"0.74065554",
"0.6889526",
"0.68170553",
"0.66488427",
"0.6629039",
"0.6616463",
"0.64861846",
"0.6401341",
"0.638465",
"0.6351877",
"0.63516015",
"0.63298535",
"0.629794",
"0.6297025",
"0.62354875",
"0.62119454",
"0.6207585",
"0.6170649",
"0.61639374",
"0.61633974",
"0.61487085",
"0.6090974",
"0.6065879",
"0.6064493",
"0.6032638",
"0.60067284",
"0.5995394",
"0.5985835",
"0.59804785"
] | 0.7513102 | 1 |
Open the stream with the given wrapper | protected function openStreamWith($stream)
{
return @fopen(StreamWrapper::NAME . '://stream', 'rb', false, stream_context_create([
StreamWrapper::NAME => compact('stream'),
]));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function stream_open();",
"function stream_get_wrappers () {}",
"public function open(StreamMode $mode);",
"function stream_register_wrapper ($protocol, $classname, $flags) {}",
"private function _wrapper()\n\t{\n\t\treturn Pheanstalk_Socket_StreamFunctions::instance();\n\t}",
"public function stream_open($path, $mode, $options = NULL, &$opened_path = NULL, Manager $magic_stream = null) {\n // so there is no need to take care of the reference.\n return $this->delegate(__FUNCTION__, func_get_args());\n }",
"public function open();",
"public function open();",
"public function open();",
"function stream_wrapper_register($protocol, $classname, $flags = false)\n{\n}",
"abstract public function open();",
"public function stream_open($file)\n {\n return $this->_streamOpen($file);\n }",
"public function stream($input)\n {\n if (false === static::$isWrapperRegistered)\n {\n static::$isWrapperRegistered = true;\n stream_wrapper_register($this->options['stream'], 'Jade\\Stream\\Template');\n }\n\n return $this->options['stream'].'://data;'.$this->compile($input);\n }",
"function stream_wrapper_register ($protocol, $classname, $flags = null) {}",
"public function __construct($streamWrapper = self::STREAM_WRAPPER_TEMP, $maxMemory = 5242880)\n {\n // init inputStream\n if (!$this->inputStream = @fopen($streamWrapper . '/maxmemory:' . $maxMemory, 'r+')) {\n throw new \\Exception();\n }\n }",
"public function stream_open($uri, $mode, $options, &$opened_path) {\n if (variable_get('rackspace_cloud_debug')) {\n watchdog(\"cloud_files\", \"executing stream_open (%uri)\", array('%uri' => $uri), WATCHDOG_DEBUG);\n }\n\n //reset data\n $this->stream_pointer = 0;\n $this->stream_data = NULL;\n\n $this->uri = $uri;\n $target = file_uri_target($this->uri);\n\n if (!isset($this->container)) {\n $this->getContainer();\n }\n\n //this will load the object if it exists\n $this->object = $this->container->create_object($target);\n\n //TODO check $mode, $options and act accordingly\n return TRUE;\n }",
"public function getStream() {\r\n return $this->wrapper->getStream();\r\n }",
"public function stream_cast();",
"public function getStream();",
"public function getStream();",
"public function getStream();",
"public function getStream();",
"private function __construct() {\n do_action('register_stream_wrapper');\n }",
"public function getInstance($streamWrapper = self::STREAM_WRAPPER_TEMP, $maxMemory = 5242880)\n {\n $instance = null;\n try {\n $instance = new self($streamWrapper, $maxMemory);\n } catch (\\Exception $e) {\n throw $e;\n }\n return $instance;\n }",
"function stream_context_set_option ($stream_or_context, $wrapper, $option, $value) {}",
"public static function createInputStream(): self\n {\n return self::createFileStream(self::PHP_INPUT);\n }",
"public function setStream($stream);",
"public static function httpStreamFactory(): ?object;",
"public function fromStream($stream = null) {\n\t\treturn $this->fromResource($stream);\n\t}",
"public static function get_stream_wrappers() {\n return self::$stream_wrappers;\n }"
] | [
"0.69812167",
"0.6154287",
"0.58724976",
"0.5831641",
"0.5817441",
"0.57537943",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741126",
"0.57354265",
"0.5672267",
"0.5666814",
"0.564422",
"0.5630738",
"0.5625292",
"0.5473532",
"0.5407936",
"0.5387805",
"0.5387805",
"0.5387805",
"0.5387805",
"0.53573275",
"0.5341476",
"0.53346604",
"0.532756",
"0.52722335",
"0.5259475",
"0.52547014",
"0.52317786"
] | 0.6857752 | 1 |
This will return an array of contributions which will mean that it might be called like $segmentEvent>getSegment()>getContributions() which is a couple of layers of nested getters however as all of our known use cases require us to fetch contributions with segment events this is something we will probably always need, so it's more preferable to have the getter than to have the client match the contributions and the segment events. Throws an exception if the contributions were not fetched | public function getContributions(): array
{
if (is_null($this->contributions)) {
throw new DataNotFetchedException(
'Could not get Contributions of Segment "' . $this->pid . '" as it was not fetched'
);
}
return $this->contributions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function contributions()\n {\n return $this->hasMany('App\\Contribution');\n \n }",
"public function getAllContributions()\n {\n $queryBuilder = $this->createQueryBuilder('contribution')\n ->select('contribution')\n ->orderBy('contribution.visibleName', 'ASC')\n ->addOrderBy('contribution.authProvider', 'ASC');\n\n return $queryBuilder\n ->getQuery()\n ->getResult();\n }",
"public function getContributors()\r\n {\r\n return $this->contributors;\r\n }",
"public function getContributors() {\n return $this->contributors;\n }",
"public function getContributors() {\n return $this->contributors;\n }",
"public static function GetContributors()\n {\n self::CheckBackend();\n\n return self::$backend->Get(\"contributors\");\n }",
"public function testContributorsCallsGetOnClient()\n {\n $username = 'testuser';\n $repository = 'testrepo';\n $request = 'repos/'.urlencode($username).'/'.urlencode($repository).'/stats/contributors';\n $expected = array('test');\n \n $this->createClientMockWithResponse($request, $expected);\n $this->stats = new Stats($this->client);\n $result = $this->stats->contributors($username, $repository);\n $this->assertEquals($expected, $result);\n }",
"public function getContributions($parentId = null)\n {\n $where = \"referentId='\".$this->id.\"'\";\n $where .= \" AND referentClass='\".$this->getClass().\"' AND parentId\";\n $where .= ($parentId) ? ('='.$parentId) : ' IS NULL';\n\n return bizobject::getBizobjects(\"contribution\", $where);\n }",
"private function getContributors()\n {\n $contributors = [];\n $fileName = APP_PATH . '/storage/cache/data/contributors.json';\n if (true == file_exists($fileName)) {\n $contributors = file_get_contents($fileName);\n $contributors = json_decode($contributors, true);\n }\n\n return $contributors;\n }",
"protected function getContributionIDs(): array {\n return [];\n }",
"public function getComments()\n {\n\n $where = \"referentId=\" . $this->id . \" AND referentClass='\" . $this->getClass() . \"' AND parentId IS NULL\";\n return bizobject::getBizobjects('contribution', $where);\n }",
"public function contributions_json()\r\n\t{\r\n\t\t$submodel_id = new MongoId($this->input->get('submodel_id'));\r\n\t\tif($submodel_id) {\r\n\t\t\t$contribsDocs = $this->db->contribs->find(array('submodel' => $submodel_id));\r\n\t\t\t$contribs = array();\r\n\t\t\twhile($contribsDocs->hasNext())\r\n\t\t\t{\r\n\t\t\t\t$contrib = $contribsDocs->getNext();\r\n\t\t\t\tarray_push($contribs,array(\"nombre\"=> $contrib['metadata']['nombre'],\"id\"=> $contrib['_id'].\"\"));\r\n\t\t\t}\r\n\t\t\techo json_encode($contribs);\r\n\t\t}\r\n\t}",
"public function test_get_plugin_contributors() {\n\t\t$plugin = $this->plugin;\n\n\t\t$this->assertInternalType(\n\t\t\t'array',\n\t\t\t$plugin->get( 'contributors', 'extensions-for-grifus' )\n\t\t);\n\t}",
"public function get_commits() {\r\n $data = array();\r\n if (!empty($this->repository)) {\r\n $contents = $this->get_response('repos/' . $this->username . '/' . $this->repository . '/commits?per_page=100');\r\n if ($contents == TRUE) {\r\n $content_array = json_decode($contents);\r\n if(is_array($content_array)){\r\n $data = array_merge($data,$content_array );\r\n } else {\r\n $data_error = array(_('error data format'));\r\n $data = array_merge($data,$data_error );\r\n }\r\n\r\n }\r\n }\r\n else {\r\n // Fetch all public repositories\r\n $repos = $this->get_repositories();\r\n\r\n if ($repos == TRUE) {\r\n // Loop through public repos and get all commits\r\n foreach ($repos as $repo) {\r\n $contents = $this->get_response('repos/' . $this->username . '/' . $repo->name . '/commits');\r\n if ($contents == TRUE && is_array($contents)) {\r\n $data = array_merge($data, json_decode($contents));\r\n }\r\n else {\r\n if ($contents == TRUE && !is_array($contents)) {\r\n $data = json_decode($contents);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n\r\n }\r\n }\r\n\r\n // Sort response array\r\n if (is_array($data)) {\r\n usort($data, array($this, 'order_commits'));\r\n }\r\n\r\n return $data;\r\n }",
"function get_aggregate_contributor_data_for_pledge( $pledge_id ) {\n\t$contributor_posts = Contributor\\get_pledge_contributors( $pledge_id, 'publish' );\n\n\t// All of their contributors might have declined the invitation and had their posts deleted.\n\tif ( ! $contributor_posts ) {\n\t\treturn false;\n\t}\n\n\t$contributor_users = Contributor\\get_contributor_user_objects( $contributor_posts );\n\t$user_ids = wp_list_pluck( $contributor_users, 'ID' );\n\n\t$data = get_xprofile_contribution_data( $user_ids );\n\n\t$initial = array(\n\t\t'contributors' => count( $user_ids ),\n\t\t'hours' => 0,\n\t\t'teams' => array(),\n\t);\n\n\t$aggregate_data = array_reduce( $data, function( $carry, $item ) {\n\t\tswitch ( $item['field_id'] ) {\n\t\t\tcase FIELD_IDS['hours_per_week']:\n\t\t\t\t$carry['hours'] += absint( $item['value'] );\n\t\t\t\tbreak;\n\n\t\t\tcase FIELD_IDS['team_names']:\n\t\t\t\t$value = (array) maybe_unserialize( $item['value'] );\n\t\t\t\t$carry['teams'] = array_merge( $carry['teams'], $value );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $carry;\n\t}, $initial );\n\n\t$aggregate_data['teams'] = array_unique( $aggregate_data['teams'] );\n\tsort( $aggregate_data['teams'] );\n\n\treturn $aggregate_data;\n}",
"public function getCharges();",
"public function testFromGithubRepoCollectsContributorsAndCommits()\n {\n $client = $this->createClientReturning(array());\n $this->scanner->setGitHubClient($client);\n $result = $this->scanner->fromGithubRepo(\"owner\", \"repo\");\n $this->assertInternalType('array', $result);\n }",
"public static function get_contributors(){\n\t \n\t}",
"public static function getters()\n {\n return [\n 'tenant_ids' => 'getTenantIds',\n 'level' => 'getLevel',\n 'kind' => 'getKind',\n 'formats' => 'getFormats',\n 'period' => 'getPeriod'\n ];\n }",
"public function get_grade_and_completion_elements() {\n global $DB;\n $sql = 'SELECT cmp.id as cmpid,\n cmp.courseid AS pmcourseid,\n cmp.completion_grade cmpcompletiongrade,\n cmc.moodlecourseid AS moodlecourseid,\n gi.id AS giid,\n gi.itemtype AS giitemtype,\n gi.grademax AS gigrademax\n FROM {'.\\coursecompletion::TABLE.'} cmp\n JOIN {'.\\pmclass::TABLE.'} cls ON cls.courseid = cmp.courseid\n JOIN {'.\\classmoodlecourse::TABLE.'} cmc ON cmc.classid = cls.id\n LEFT JOIN {course_modules} crsmod ON crsmod.idnumber = cmp.idnumber\n LEFT JOIN {grade_items} gi\n ON gi.courseid = cmc.moodlecourseid\n AND (gi.idnumber = cmp.idnumber OR gi.idnumber = crsmod.id)';\n $data = $DB->get_recordset_sql($sql);\n $gis = array();\n $linkedcompelems = array();\n $compelems = array();\n foreach ($data as $rec) {\n if (!empty($rec->giid)) {\n $gis[$rec->moodlecourseid][$rec->giid] = (object)array(\n 'id' => $rec->giid,\n 'itemtype' => $rec->giitemtype,\n 'grademax' => $rec->gigrademax\n );\n $linkedcompelems[$rec->pmcourseid][$rec->giid] = (object)array(\n 'id' => $rec->cmpid,\n 'completion_grade' => $rec->cmpcompletiongrade\n );\n }\n\n $compelems[$rec->pmcourseid][$rec->cmpid] = (object)array(\n 'id' => $rec->cmpid,\n );\n }\n\n return array($gis, $linkedcompelems, $compelems);\n }",
"public function getUserContacts()\n {\n $campaignId = $this->config->get('campaign_id') ?: null;\n $tierFilter = $this->config->get('tier_filter') ?: null;\n\n $campaigns = [];\n if ($campaignId === null) {\n $campaignsUrl = 'oauth2/v2/campaigns';\n do {\n $response = $this->apiRequest($campaignsUrl);\n $data = new Collection($response);\n\n if (!$data->exists('data')) {\n throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');\n }\n\n foreach ($data->filter('data')->toArray() as $item) {\n $campaign = new Collection($item);\n $campaigns[] = $campaign->get('id');\n }\n\n if ($data->filter('links')->exists('next')) {\n $campaignsUrl = $data->filter('links')->get('next');\n\n $pagedList = true;\n } else {\n $pagedList = false;\n }\n } while ($pagedList);\n } else {\n $campaigns[] = $campaignId;\n }\n\n $contacts = [];\n\n foreach ($campaigns as $campaignId) {\n $params = [\n 'include' => 'currently_entitled_tiers',\n 'fields[member]' => 'full_name,patron_status,email',\n 'fields[tier]' => 'title',\n ];\n $membersUrl = 'oauth2/v2/campaigns/' . $campaignId . '/members?' . http_build_query($params);\n\n do {\n $response = $this->apiRequest($membersUrl);\n\n $data = new Collection($response);\n\n if (!$data->exists('data')) {\n throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');\n }\n\n $tierTitles = [];\n\n foreach ($data->filter('included')->toArray() as $item) {\n $includedItem = new Collection($item);\n if ($includedItem->get('type') == 'tier') {\n $tierTitles[$includedItem->get('id')] = $includedItem->filter('attributes')->get('title');\n }\n }\n\n foreach ($data->filter('data')->toArray() as $item) {\n $member = new Collection($item);\n\n if ($member->filter('attributes')->get('patron_status') == 'active_patron') {\n $tiers = [];\n $tierObs = $member->filter('relationships')->filter('currently_entitled_tiers')->get('data');\n foreach ($tierObs as $item) {\n $tier = new Collection($item);\n $tierId = $tier->get('id');\n $tiers[] = $tierTitles[$tierId];\n }\n\n if (($tierFilter === null) || (in_array($tierFilter, $tiers))) {\n $userContact = new User\\Contact();\n\n $userContact->identifier = $member->get('id');\n $userContact->email = $member->filter('attributes')->get('email');\n $userContact->displayName = $member->filter('attributes')->get('full_name');\n $userContact->description = json_encode($tiers);\n\n $contacts[] = $userContact;\n }\n }\n }\n\n if ($data->filter('links')->exists('next')) {\n $membersUrl = $data->filter('links')->get('next');\n\n $pagedList = true;\n } else {\n $pagedList = false;\n }\n } while ($pagedList);\n }\n\n return $contacts;\n }",
"public static function getters()\n {\n return [\n 'recipients' => 'getRecipients',\n 'result_action' => 'getResultAction',\n 'parameters' => 'getParameters',\n 'schedule' => 'getSchedule',\n 'generation_date' => 'getGenerationDate'\n ];\n }",
"function getContributorData()\n\t{\n\n\t\t$contributorData['contributor'] = $this->ro->getAttribute('group');\n\t\t$this->_CI->load->library('solr');\n\t\t$this->_CI->solr->setOpt('q', '*:*');\n\t\t$this->_CI->solr->setOpt('fq', 'group:(\"'.$this->ro->getAttribute('group').'\")');\n\t\t$this->_CI->solr->setOpt('fq', '-id:(\"'.$this->ro->id.'\")');\t\t\n\t\t$this->_CI->solr->setFacetOpt('field', 'class');\n\t\t$this->_CI->solr->setFacetOpt('field', 'subject_value_resolved');\t\t\n\t\t$this->_CI->solr->setFacetOpt('mincount','1');\n\n\t\t$result = $this->_CI->solr->executeSearch();\n\n\t\t//we want to select counts by class of registry objects which have the same group;\n\t\t$classes = $this->_CI->solr->getFacetResult('class');\n\n\t\tforeach($classes as $class=>$num){\n\t\t\t$contributorData['contents'][$class] = $num;\n\t\t}\n\n\n\t\t//we want to select all subjects of records which have this as a contibuting group;\n\n\t\t$subjects = $this->_CI->solr->getFacetResult('subject_value_resolved');\n\n\t\tforeach($subjects as $subject=>$num){\n\t\t\t$contributorData['subjects'][$subject] = $num;\n\t\t}\n\n\t\t//we want to select all objects of type group which have this as a contibuting group;\n\n\t\t$this->_CI->solr->setOpt('rows', '3000');\n\t\t$this->_CI->solr->setOpt('fq', 'type:(\"group\")');\n\t\t$groups = $this->_CI->solr->executeSearch();\n\t\t// var_dump($groups->{'response'}->{'numFound'});\n\t\t// var_dump($groups->{'response'}->{'docs'});\n\t\tforeach($groups->{'response'}->{'docs'} as $group){\n\t\t\tif($group->{'slug'}!=$this->ro->getAttribute('slug'))\n\t\t\t$contributorData['groups'][$group->{'list_title'}] = $group->{'slug'};\n\t\t}\n\n\t\t// clear the solr options to set up new query to get the latest 5 collections\n\n\t\t$this->_CI->solr->clearOpt('fq');\n\t\t$this->_CI->solr->setOpt('rows','5');\n\t\t$this->_CI->solr->setOpt('fq', 'group:(\"'.$this->ro->getAttribute('group').'\")');\t\t\n\t\t$this->_CI->solr->setOpt('fq', 'class:(\"collection\")');\n\t\t$this->_CI->solr->setOpt('sort', 'record_modified_timestamp desc');\n\t\t$collectionsAdded = $this->_CI->solr->executeSearch();\n\n\t\tforeach($collectionsAdded->{'response'}->{'docs'} as $collection){\n\t\t\t// $contributorData['collections'][$collection->{'list_title'}] = $collection->{'slug'};\n\t\t\t$contributorData['collections'][] = array(\n\t\t\t\t'title' => $collection->{'list_title'},\n\t\t\t\t'slug' => $collection->{'slug'},\n\t\t\t\t'id' => $collection->{'id'}\n\t\t\t);\n\t\t}\n\n\t\treturn $contributorData;\n\n\t}",
"public function getEntity() { return $this->aggregator; }",
"function bpbbcl_get_contributions( $user = '', $count = 5, $project = 'BuddyPress' ) {\n\n\t$base_object = new tw2113\\BPBBPCL\\ContribBase\\BuddyPressbbPress_Contributions_List_Base( array(\n\t\t'trac_project' => $project\n\t) );\n\n\tif ( empty( $user ) ) {\n\t\treturn $base_object->no_user();\n\t}\n\n\t$bpcontribs = $base_object->get_contribs_transient( $user, $project );\n\t$list_type = $base_object->list_type();\n\n\t$limiter = 1;\n\t$list = '';\n\t$output = '';\n\n\tforeach ( $bpcontribs as $contrib ) {\n\t\tif ( $limiter <= $count ) {\n\t\t\t$list .= $base_object->list_item( $contrib );\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t\t$limiter++;\n\t}\n\n\tif ( empty( $bpcontribs ) ) {\n\t\t$output .= '<p>';\n\t\t$output .= sprintf(\n\t\t\t__( 'No contributions yet. Find some tickets at %s', 'buddypress-bbpress-contributions-list' ),\n\t\t\tsprintf(\n\t\t\t\t__( '<a href=\"%s\">%s</a>' ),\n\t\t\t\t$base_object->trac_base_url,\n\t\t\t\t$project . ' Trac'\n\t\t\t)\n\t\t);\n\t\t$output .= '</p>';\n\t} else {\n\t\t$output .= sprintf(\n\t\t\t'<%s>%s</%s>',\n\t\t\t$list_type,\n\t\t\t$list,\n\t\t\t$list_type\n\t\t);\n\t}\n\n\treturn $output;\n}",
"public function gates() {\n\t\treturn $this->_get_related( __FUNCTION__, '\\PSU\\TeacherCert\\Student\\Gates', array( 'v_student_gates.student_gate_system_id' => $this->id ) );\n\t}",
"public static function getServiceCommissions() {\n try\n {\n $services = Service::whereNull('parent_id')\n ->select('name','id','commission_percent')->orderBy('name')->get();\n static::$data['services'] = $services;\n\n } catch (\\Exception $e) {\n static::setExceptionError($e);\n }\n\n return static::$data;\n }",
"private function getCoverage(): array\n {\n if (!isset($this->coverage)) {\n $coverageIndexFilePath = $this->coverageDir . '/' . self::COVERAGE_INDEX_FILE_NAME;\n\n if (!file_exists($coverageIndexFilePath)) {\n throw CoverageDoesNotExistException::with(\n $coverageIndexFilePath,\n $this->testFrameworkKey,\n dirname($coverageIndexFilePath, 2)\n );\n }\n\n $coverageIndexFileContent = file_get_contents($coverageIndexFilePath);\n\n $coverage = $this->parser->parse($coverageIndexFileContent);\n\n $this->addTestExecutionInfo($coverage);\n\n $this->coverage = $coverage;\n }\n\n return $this->coverage;\n }",
"public function getCredits()\n {\n $service = new \\Esendex\\DispatchService($this->authentication);\n return $service->getCredits();\n }",
"private function getCoverage(): array\n {\n if (!isset($this->coverage)) {\n $coverageIndexFilePath = $this->coverageDir . '/' . self::COVERAGE_INDEX_FILE_NAME;\n\n if (!file_exists($coverageIndexFilePath)) {\n throw CoverageDoesNotExistException::with(\n $coverageIndexFilePath,\n $this->testFrameworkKey,\n \\dirname($coverageIndexFilePath, 2)\n );\n }\n\n $coverageIndexFileContent = file_get_contents($coverageIndexFilePath);\n \\assert(\\is_string($coverageIndexFileContent));\n\n $coverage = $this->parser->parse($coverageIndexFileContent);\n\n $coverage = $this->addTestExecutionInfo($coverage);\n\n $this->coverage = $coverage;\n }\n\n return $this->coverage;\n }"
] | [
"0.58168066",
"0.5746069",
"0.5722294",
"0.56240445",
"0.56240445",
"0.54448354",
"0.5409747",
"0.53856146",
"0.5059807",
"0.5031021",
"0.4917658",
"0.48746893",
"0.48245904",
"0.48092747",
"0.47784558",
"0.47050908",
"0.4663161",
"0.46471027",
"0.46335766",
"0.45875055",
"0.4568014",
"0.45558527",
"0.45551127",
"0.4550479",
"0.4540919",
"0.45309",
"0.45238498",
"0.44802126",
"0.44691572",
"0.44653487"
] | 0.69439626 | 0 |
Alter the deal node form | function venture_deal_alter(&$form) {
// Content type editing page passes the same form_id as the content
// editing form. The cck_dummy_node_form allows to distinguish the two.
if (!$form['#node']->cck_dummy_node_form) {
// Check if the user is trying to delete the deal
if ($_POST['op'] == 'Delete Deal') {
venture_deal_delete($form['#node']->nid);
}
$form['#after_build'][] = 'venture_deal_after_build';
$form['#pre_render'][] = 'venture_deal_pre_render';
$form['#submit'] = array('venture_deal_submit' => array());
$form['submit']['#value'] = 'Save Changes';
if ($form['delete']) {
$form['delete']['#value'] = 'Delete Deal';
}
$form['field_deal_state']['#validate'] = array('venture_deal_validate_state' => array());
$form['field_deal_contact_email']['#validate'] = array('venture_deal_validate_email' => array());
$form['field_deal_industry']['key']['#required'] = TRUE; // Required field with a blank default
// Remove formatting instructions
unset($form['field_deal_company_overview'][0]['format']);
unset($form['field_deal_product_service'][0]['format']);
unset($form['field_deal_management_team'][0]['format']);
unset($form['field_deal_details'][0]['format']);
// Set the recipient user/group
if (arg(0) == 'profile') {
$form['field_deal_users'][0]['value']['#value'] = arg(1);
$form['field_deal_country']['#validate'] = array('venture_deal_validate_country' => array());
}
else if (arg(0) == 'group') {
$form['field_deal_groups'][0]['value']['#value'] = arg(1);
}
// Clean up the attachments section
venture_deal_attachments_alter($form);
// Make sure fields are ordered properly within the form
$fields = array(
'title', 'field_deal_country', 'field_deal_state', 'field_deal_city', 'field_deal_year_founded',
'field_deal_employees', 'field_deal_legal_entity', 'field_deal_website', 'field_deal_contact_name',
'field_deal_contact_email', 'field_deal_contact_phone', 'field_deal_industry', 'field_deal_funding_stage',
'field_deal_prior_investors', 'field_deal_capital_raised', 'field_deal_current_valuation',
'field_deal_annual_revenue', 'field_deal_amount_seeking', 'field_deal_funding_type',
'field_deal_headline', 'field_deal_company_overview', 'field_deal_product_service',
'field_deal_management_team', 'field_deal_details', 'field_deal_attachments'
);
venture_order_fields($form, $fields);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cel_admin_form_partner_node_form_alter(&$form, &$form_state, $form_id) {\n $lang = $form['language']['#value'];\n\n if(isset($form['field_address']['#attributes']['class'])) {\n $form['field_address']['#attribues']['class'][] = 'field-widget-addressfield-has-sub-admin-area';\n }\n\n $form['field_address'][$lang][0]['sub_administrative_area'] = array(\n '#type' => 'hidden',\n '#default_value' => '',\n '#weight' => -100,\n );\n\n // addressfield will turn our hidden field into a textfield in addressfield_process_format_form\n // so we need to undo it\n $form['field_address'][$lang][0]['#process'][] = 'cel_admin_fix_sub_administrative_area';\n $form['#submit'][] = 'cel_admin_form_partner_node_form_submit';\n}",
"function er_form_er_award_node_form_alter(&$form, &$form_state, $form_id){\n\ter_set_default_user_entity_reference_field($form, $form_state, $form_id);\n}",
"protected function alterFormTag()\n {\n $form = $this->getFormNode();\n $form->setAttribute( 'method', 'post' );\n $form->setAttribute( 'action', $this->getContentUrl() );\n $form->setAttribute( 'enctype', 'multipart/form-data' );\n }",
"function module_banner_node_form($form, &$form_state) {\n $form = v2_node_form($form, $form_state);\n return $form;\n}",
"function er_form_er_proposal_node_form_alter(&$form, &$form_state, $form_id){\n\t$form['#validate'][] = '_states_validate'; //Automatically try to validate the form based on the #states.\n\t// d($form, 'er_form_er_proposal_node_form_alter');\n\n\t// Setting up variables that will be used\n\t$submitted = array(\n\t\t':input[name=\"field_er_proposal_status[und]\"]' => array('value' => 'Submitted'),\n\t);\n\t$pending = array(\n\t\t':input[name=\"field_er_proposal_status[und]\"]' => array('value' => 'Pending'),\n\t);\n\t$awarded = array(\n\t\t':input[name=\"field_er_proposal_status[und]\"]' => array('value' => 'Awarded'),\n\t);\n\t$denied = array(\n\t\t':input[name=\"field_er_proposal_status[und]\"]' => array('value' => 'Denied'),\n\t);\t \n $expired = array(\n\t\t':input[name=\"field_er_proposal_status[und]\"]' => array('value' => 'Expired'),\n\t);\n\t \n\t// The Date fields:\n\t// Submitted (asterisk not showing up for some reason)\n\t$form['field_er_proposal_submit']['#states'] = array(\n\t 'visible'=> array($submitted, $awarded, $expired, $pending, $denied),\n\t 'required' => array($submitted, $awarded, $expired, $pending, $denied),\n\t); \n\t// Pending\n\t$form['field_er_proposal_pending']['#states'] = array(\n\t 'visible'=> $pending,\n\t 'required' => $pending,\n\t); \n\t\n\t// Award Dates\n\t$form['field_er_proposal_date']['#states'] = array(\n\t 'visible' => array($awarded, $expired),\n\t 'required' => array($awarded, $expired),\n\t);\n\t// Award Amount (Textfield)\n\t$form['field_er_award_amount']['#states'] = array(\n\t 'visible' => array($awarded),\n\t 'required' => array($awarded),\n\t);\n\t\n\t// Denied Date\n\t$form['field_er_proposal_denied']['#states'] = array(\n\t 'visible' => $denied,\n\t 'required' => $denied,\n\t);\t\n\t\n\t// $form['#validate'][] = '_proposal_validate';\n\n\t// This automatically attaches the user's name to this field...\t\n\t//er_set_default_user_entity_reference_field($form, $form_state, $form_id);\n}",
"function elife_article_almvis_graph_edit($form, &$form_state) {\n return $form;\n}",
"function rnd15_site_news_article_form_news_article_node_form_alter(&$form, &$form_state, $form_id) {\n\n // Make the body summary required.\n $form['body'][LANGUAGE_NONE][0]['summary']['#required'] = TRUE;\n\n // Remove the description for the summary as it's a little misleading.\n unset($form['body'][LANGUAGE_NONE][0]['summary']['#description']);\n\n // Provide our custom CSS to override the core behaviour of the Summary field.\n // It's hidden by default.\n $form['#attached']['css'][] = drupal_get_path('module', 'rnd15_site_news_article') . '/css/rnd15.site-news-article.css';\n\n}",
"function cel_admin_form_node_form_alter(&$form, &$form_state, $form_id) {\n if(empty($form['options']['promote'])) {\n return;\n }\n\n if(empty($form['#groups']['group_promote'])) {\n return;\n }\n\n $lang = $form['language']['#value'];\n\n // Make it so the promote fields only show if promoted to front page is checked\n foreach($form['#groups']['group_promote']->children as $field) {\n if(!isset($form[$field]['#states'])) {\n $form[$field]['#states'] = array();\n }\n if(!isset($form[$field]['#states'])) {\n $form[$field]['#states']['visible'] = array();\n }\n\n $form[$field]['#states']['visible'][':input[name=\"promote\"]'] = array('checked' => TRUE);\n \n // Set required fields to be conditionally required\n if($form[$field][$lang]['#required']) {\n $form[$field][$lang]['#conditionally_required'] = TRUE;\n $form[$field][$lang]['#required'] = FALSE;\n $form[$field][$lang][0]['#conditionally_required'] = TRUE;\n $form[$field][$lang][0]['#required'] = FALSE;\n }\n }\n\n // Move the Promoted to front page checkbox to the Promote field\n array_unshift($form['#groups']['group_promote']->children, 'promote');\n array_unshift($form['#fieldgroups']['group_promote']->children, 'promote');\n $form['#group_children']['promote'] = 'group_promote';\n $form['promote'] = $form['options']['promote'];\n unset($form['options']['promote']);\n $form['promote']['#weight'] = $form['field_promotional_image']['#weight']-1;\n\n // Add some conditional validation\n $form['#validate'][] = 'cel_admin_node_form_validate';\n}",
"function redhen_donation_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id) {\n if ($form['#field']['type'] == 'redhen_donation') {\n $form['field']['#access'] = FALSE;\n $form['field']['cardinality']['#default_value'] = 1;\n $form['field']['cardinality']['#access'] = FALSE;\n $form['#validate'][] = 'redhen_donation_form_field_ui_field_edit_form_validate';\n }\n}",
"function govcms_ui_kit_field_attach_view_alter(&$output, $context) {\n if (!_govcms_ui_kit_render_empty_field($context)) {\n return;\n }\n\n $node = $context['entity'];\n\n // Load field instances.\n $instances = _field_invoke_get_instances('node', $node->type, [\n 'default' => TRUE,\n 'deleted' => FALSE,\n ]);\n\n foreach ($instances as $field_name => $instance) {\n // Set the content if the field is empty.\n if (empty($node->{$field_name})) {\n $display = field_get_display($instance, 'teaser', $node);\n // Do not add the field if hidden in the view mode settings.\n if ($display['type'] == 'hidden') {\n continue;\n }\n // Load field settings.\n $field = field_info_field($field_name);\n // Create the render array for the field.\n $output[$field_name] = [\n '#theme' => 'field',\n '#title' => $instance['label'],\n '#label_display' => $display['label'],\n '#field_type' => $field['type'],\n '#field_name' => $field_name,\n '#bundle' => $node->type,\n '#object' => $node,\n '#items' => [],\n '#entity_type' => 'node',\n '#weight' => $display['weight'],\n 0 => ['#markup' => ' '],\n ];\n }\n }\n}",
"function _fourD_analysis_goal_nodeview(&$node){\n $node->analysis = _fourD_analysis_goal_analysis_summary($node);\n //$node->user_analysis = _fourD_analysis_add_user_analysis($node);\n $node->user_analysis = drupal_get_form('fourD_analysis_goal_analysis_inline_form', $node);\n}",
"function hook_ENTITY_TYPE_view_alter(array &$build, \\Drupal\\Core\\Entity\\EntityInterface $entity, \\Drupal\\Core\\Entity\\Display\\EntityViewDisplayInterface $display) {\n if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {\n // Change its weight.\n $build['an_additional_field']['#weight'] = -10;\n\n // Add a #post_render callback to act on the rendered HTML of the entity.\n $build['#post_render'][] = 'my_module_node_post_render';\n }\n}",
"function node_tinyfile_form_alter_alter($form, $form_state, $form_id) {\n if ($form_id == 'tinyfile_node_form') {\n $form['#after_build'] = is_array($form['#after_build']) ? $form['#after_build'] : array();\n $form['#after_build'][] = 'tinyfile_node_form_after_build';\n }\n}",
"public function render() {\n // Create form instance of type posts.\n $entity = $this->entityTypeManager()->getStorage('node')->create(array(\n 'type' => 'posts',\n ));\n // build form\n $form = $this->entityFormBuilder()->getForm($entity);\n $form['field_meta_tags']['#access'] = FALSE;\n $form['meta']['#access'] = FALSE;\n $form['revision_information']['#access'] = FALSE;\n return $form;\n }",
"function flat_node_view_alter( &$build ) {\n $build['#contextual_links']['node'] = array('node', array($build['#node']->nid));\n}",
"function flat_preprocess_sesion_conferencia_node_form(&$variables) {\n if (!module_exists('nodeformcols')) {\n $variables['sidebar'] = array(); // Put taxonomy fields in sidebar.\n $variables['sidebar'][] = $variables['form']['field_tags'];\n hide($variables['form']['field_tags']);\n // Extract the form buttons, and put them in independent variable.\n $variables['buttons'] = $variables['form']['actions'];\n hide($variables['form']['actions']);\n }\n}",
"public function testUpdateNodeContent()\n {\n }",
"function hook_entity_view_alter(array &$build, \\Drupal\\Core\\Entity\\EntityInterface $entity, \\Drupal\\Core\\Entity\\Display\\EntityViewDisplayInterface $display) {\n if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {\n // Change its weight.\n $build['an_additional_field']['#weight'] = -10;\n\n // Add a #post_render callback to act on the rendered HTML of the entity.\n // The object must implement \\Drupal\\Core\\Security\\TrustedCallbackInterface.\n $build['#post_render'][] = '\\Drupal\\my_module\\NodeCallback::postRender';\n }\n}",
"function hook_entity_extra_field_info_alter(&$info) {\n // Force node title to always be at the top of the list by default.\n foreach (NodeType::loadMultiple() as $bundle) {\n if (isset($info['node'][$bundle->id()]['form']['title'])) {\n $info['node'][$bundle->id()]['form']['title']['weight'] = -20;\n }\n }\n}",
"function clade_feed_content_type_edit_form(&$form, &$form_state) {\n $conf = $form_state['conf'];\n $form['clade'] = array(\n '#type' => 'textfield',\n '#title' => t('Clade ID for context'),\n '#size' => 50,\n '#description' => t('The Clade tid.'),\n '#default_value' => !empty($conf['clade']) ? $conf['clade'] : '',\n '#prefix' => '<div class=\"clear-block no-float\">',\n '#suffix' => '</div>',\n );\n\n return $form;\n}",
"function md_boom_prepare_node_form(&$form, $type = 'default') {\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node_share_position_' . $type] = array(\n '#type' => 'select',\n '#title' => t('Share Buttons Position'),\n '#default_value' => theme_get_setting('node_share_position_' . $type,'md_boom'),\n\t\t'#options' => array(\n '1' => t('Above Content'),\n '2' \t=> t('Below Content'),\n ),\n );\n\n\t// Facebook\n $form['md_boom_settings']['nodes'][$type]['node_share_facebook_' . $type] = array(\n '#type' => 'checkbox',\n '#title' => t('Facebook Like Button'),\n '#default_value' => theme_get_setting('node_share_facebook_' . $type,'md_boom'),\n\t\t'#attributes' => array(\n 'class' => array(\n 'node-share-checkbox',\n ),\n ),\n\t\t'#suffix' => '<div id=\"div-node-share-facebook-'.$type.'-collapse\" class=\"node-share-wrap node-share-facebook-wrap clearfix\">',\n );\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node_share_facebook_layout_' . $type] = array(\n '#type' => 'select',\n '#title' => t('Layout style'),\n '#default_value' => theme_get_setting('node_share_facebook_layout_' . $type,'md_boom'),\n '#options' => array(\n 'standard' => t('Standard'),\n 'button_count' \t=> t('Button Count'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'box_count' => t('Box Count'),\n ),\n\t);\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node_share_facebook_font_' . $type] = array(\n '#type' => 'select',\n '#title' => t('Font'),\n '#default_value' => theme_get_setting('node_share_facebook_font_' . $type,'md_boom'),\n '#options' => array(\n 'arial' => t('Arial'),\n 'lucida+grande' \t=> t('Lucida Grande'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'segoe-ui' => t('Segoe UI'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'tahoma' => t('Tahoma'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'trebuchet-ms' \t=> t('Trebuchet MS'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'verdana' => t('Verdana'),\n ),\n\t);\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node_share_facebook_color_' . $type] = array(\n '#type' => 'select',\n '#title' => t('Color Scheme'),\n '#default_value' => theme_get_setting('node_share_facebook_color_' . $type,'md_boom'),\n '#options' => array(\n 'light' => t('Light'),\n 'dark' \t=> t('Dark'),\n ),\n\t);\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node-facebook-'.$type.'-div-closing'] = array(\n '#suffix' => '</div>', // #div-node-collapse\n );\n\t\n\t// Twitter\n $form['md_boom_settings']['nodes'][$type]['node_share_twitter_' . $type] = array(\n '#type' => 'checkbox',\n '#title' => t('Display twitter button'),\n '#default_value' => theme_get_setting('node_share_twitter_' . $type,'md_boom'),\n\t\t'#attributes' => array(\n 'class' => array(\n 'node-share-checkbox',\n ),\n ),\n\t\t'#suffix' => '<div id=\"div-node-share-twitter-'.$type.'-collapse\" class=\"node-share-wrap node-share-twitter-wrap clearfix\">',\n );\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node_share_twitter_style_' . $type] = array(\n '#type' => 'select',\n '#title' => t('Twitter Button Style'),\n '#default_value' => theme_get_setting('node_share_twitter_style_' . $type,'md_boom'),\n '#options' => array(\n 'none' => t('No count'),\n 'horizontal' \t=> t('Horizontal count'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'vertical' => t('Vertical count'),\n ),\n\t\t'#attributes' => array(\n 'class' => array(\n 'share-twitter',\n ),\n ),\n\t);\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node_share_twitter_lang_' . $type] = array(\n '#type' => 'select',\n '#title' => t('Twitter Button Language'),\n '#default_value' => theme_get_setting('node_share_twitter_lang_' . $type,'md_boom'),\n '#options' => array(\n 'en' => t('English'),\n 'fr' \t=> t('French'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'de' => t('German'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'it' => t('Italian'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'es' \t=> t('Spanish'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'ko' => t('Korean'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'ja' => t('Japanese'),\n ),\n\t);\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node-twitter-'.$type.'-div-closing'] = array(\n '#suffix' => '</div>', // #div-node-collapse\n );\n\n // Pinterest\n\t//$field1 = field_info_instances('node'); print_r($field1); die();\n\t$form['md_boom_settings']['nodes'][$type]['node_share_pinterest_' . $type] = array(\n '#type' => 'checkbox',\n '#title' => t('Pin it button'),\n '#default_value' => theme_get_setting('node_share_pinterest_' . $type,'md_boom'),\n\t\t'#attributes' => array(\n 'class' => array(\n 'node-share-checkbox',\n ),\n ),\n\t\t'#suffix' => '<div id=\"div-node-share-pinterest-'.$type.'-collapse\" class=\"node-share-wrap node-share-pinterest-wrap clearfix\">',\n );\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node_share_pinterest_layout_' . $type] = array(\n '#type' => 'select',\n '#title' => t('Pin count'),\n '#default_value' => theme_get_setting('node_share_pinterest_layout_' . $type,'md_boom'),\n '#options' => array(\n 'none' \t=> t('No count'),\n 'horizontal' \t\t=> t('Horizontal)'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'vertical' => t('Vertical'),\n ),\n\t\t'#attributes' => array(\n 'class' => array(\n 'share-pinterest',\n ),\n ),\n\t);\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node_share_pinterest_image_' . $type] = array(\n\t\t'#type' \t=> 'textfield',\n\t\t'#title' \t=> t('Image field'),\n\t\t'#description'\t\t\t=> t('insert field machine name to get \"pin\" image. If your field machine name is <em>field_image</em>, type <em>image</em> here'),\n\t\t'#default_value' \t=> theme_get_setting('node_share_pinterest_image_' . $type,'md_boom'),\n\t);\n\t\t\n\t$form['md_boom_settings']['nodes'][$type]['node-pinterest-'.$type.'-div-closing'] = array(\n '#suffix' => '</div>', // #div-node-collapse\n );\n\t// Google Plus\n\t$form['md_boom_settings']['nodes'][$type]['node_share_gplus_' . $type] = array(\n '#type' => 'checkbox',\n '#title' => t('Google +1 button'),\n '#default_value' => theme_get_setting('node_share_gplus_' . $type,'md_boom'),\n\t\t'#attributes' => array(\n 'class' => array(\n 'node-share-checkbox',\n ),\n ),\n\t\t'#suffix' => '<div id=\"div-node-share-gplus-'.$type.'-collapse\" class=\"node-share-wrap node-share-gplus-wrap clearfix\">',\n );\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node_share_gplus_size_' . $type] = array(\n '#type' => 'select',\n '#title' => t('Size'),\n '#default_value' => theme_get_setting('node_share_gplus_size_' . $type,'md_boom'),\n '#options' => array(\n 'small' \t=> t('Small (15px)'),\n 'medium' \t\t=> t('Medium (20px)'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'standard' => t('Standard (24px)'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'tall' \t\t=> t('Tall (60px)'),\n ),\n\t\t'#attributes' => array(\n 'class' => array(\n 'share-gplus',\n ),\n ),\n\t);\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node_share_gplus_annotation_' . $type] = array(\n '#type' => 'select',\n '#title' => t('Annotation'),\n '#default_value' => theme_get_setting('node_share_gplus_annotation_' . $type,'md_boom'),\n\t\t'#options' => array(\n 'bubble' \t=> t('bubble'),\n 'inline' \t\t=> t('inline'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'none' \t\t=> t('none'),\n ),\n\t\t'#attributes' => array(\n 'class' => array(\n 'share-gplus-include-annotation',\n ),\n ),\n );\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node-gplus-'.$type.'-div-closing'] = array(\n '#suffix' => '</div>', // #div-node-collapse\n );\n\t\n\t// Stumbleupon\n\t$form['md_boom_settings']['nodes'][$type]['node_share_stumble_' . $type] = array(\n '#type' => 'checkbox',\n '#title' => t('Stumbleupon Share Button'),\n '#default_value' => theme_get_setting('node_share_stumble_' . $type,'md_boom'),\n\t\t'#attributes' => array(\n 'class' => array(\n 'node-share-checkbox',\n ),\n ),\n\t\t'#suffix' => '<div id=\"div-node-share-stumble-'.$type.'-collapse\" class=\"node-share-wrap node-share-stumble-wrap clearfix\">',\n );\n\t\n\t$form['md_boom_settings']['nodes'][$type]['node_share_stumble_style_' . $type] = array(\n '#type' => 'select',\n '#title' => t('Stumbleupon Button Style'),\n '#default_value' => theme_get_setting('node_share_stumble_style_' . $type,'md_boom'),\n '#options' => array(\n '1' => t('Style 1'),\n '2' \t=> t('Style 2'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'3' => t('Style 3'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'4' => t('Style 4'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'5' => t('Style 5'),\n ),\n\t\t'#attributes' => array(\n 'class' => array(\n 'share-stumble',\n ),\n ),\n\t);\n\t$form['md_boom_settings']['nodes'][$type]['node-stumble-'.$type.'-div-closing'] = array(\n '#suffix' => '</div>', // #div-node-collapse\n );\n}",
"function hook_entity_view_alter(&$build, $type) {\n if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {\n // Change its weight.\n $build['an_additional_field']['#weight'] = -10;\n\n // Add a #post_render callback to act on the rendered HTML of the entity.\n $build['#post_render'][] = 'my_module_node_post_render';\n }\n}",
"function change_comment_form($fields) {\n\n\t$fields['comment_notes_before'] = '';\n\treturn $fields;\n}",
"function cel_admin_form_news_event_item_node_form_alter(&$form, &$form_state, $form_id) {\n // Move the sticky checkbox to the Promote field\n array_unshift($form['#groups']['group_promote']->children, 'sticky');\n array_unshift($form['#fieldgroups']['group_promote']->children, 'sticky');\n $form['#group_children']['sticky'] = 'group_promote';\n $form['sticky'] = $form['options']['sticky'];\n unset($form['options']['sticky']);\n $form['sticky']['#weight'] = $form['field_promotional_image']['#weight']-2;\n $form['sticky']['#title'] = t('Sticky');\n $form['sticky']['#description'] = t('Keep this news item at the top of featured news sections.');\n}",
"public function creating($node)\n {\n $node->setDefaultLeftAndRight();\n }",
"function venture_deal_attachments_alter(&$form) {\n venture_attachments_alter($form, 'field_deal_attachments', 'deal');\n}",
"function og_field_attach_form($entity_type, $entity, &$form, $form_state, $langcode) {\n $item = menu_get_item();\n if (!empty($form[OG_GROUP_FIELD]) && (($entity_type == 'node' && !empty($entity->tnid) && $entity->tnid != $entity->nid)) || $item['page_callback'] == 'node_add' && !empty($_GET['translation']) && !empty($_GET['target'])) {\n\n // Prevent changing the group state on nodes that are translated.\n // Load the original node.\n $description = t('You can not change the group state from a translated content.');\n\n $tnid = !empty($entity->tnid) ? $entity->tnid : $_GET['translation'];\n if (($node = node_load($tnid)) && node_access('update', $node)) {\n $description .= ' ' . t('Changing the group state can only be done via <a href=\"@node\">@title</a>.', array('@node' => url('node/' . $node->nid . '/edit'), '@title' => $node->title));\n }\n\n $form[OG_GROUP_FIELD][LANGUAGE_NONE]['#options'] = array();\n $form[OG_GROUP_FIELD][LANGUAGE_NONE]['#description'] = $description;\n $form[OG_GROUP_FIELD][LANGUAGE_NONE]['#disabled'] = TRUE;\n $form[OG_GROUP_FIELD][LANGUAGE_NONE]['#required'] = FALSE;\n }\n}",
"public function setNode($node)\n {\n parent::setNode($node);\n $this->setImportNode($node);\n }",
"public function formAlter(&$form, &$form_state);",
"function elife_article_aff_details_edit($form, &$form_state) {\n return $form;\n}"
] | [
"0.6440017",
"0.5962481",
"0.582282",
"0.5621614",
"0.55787915",
"0.55244845",
"0.5520489",
"0.54945356",
"0.5484952",
"0.5453897",
"0.5448995",
"0.54356664",
"0.543145",
"0.5429389",
"0.54174066",
"0.540432",
"0.5383788",
"0.53629017",
"0.53495926",
"0.5327204",
"0.5315962",
"0.5313155",
"0.5297717",
"0.5297025",
"0.5239178",
"0.52361083",
"0.52141345",
"0.5190925",
"0.5177298",
"0.51544815"
] | 0.66035366 | 0 |
Get number of deals for current user | function venture_deal_get_count() {
global $user;
$query = "SELECT COUNT(*) FROM {node} WHERE type = 'deal' AND uid = %d";
$result = db_result(db_query($query, $user->uid));
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_total_items_user(){\n $count = $this->fetch(\"SELECT id FROM posts WHERE user = $this->user\");\n return $count ? count($count) : 0;\n }",
"public function userCount()\n {\n return $this->count();\n }",
"public function get_myaction_count(){\n\t\t$user_id = $this->ion_auth->user()->row()->id;\n\t\t$dept_id = $this->ion_auth->user()->row()->user_dept_id;\n\t\t$data = $this->login_model->get_myaction_count($user_id,$dept_id);\n\t\techo $data;\n\t}",
"public function getUserCount() : int\n {\n return $this->userCount;\n }",
"function getCount() {\n $user = $this->loadUser(Yii::app()->user->id);\n return $user->count_visit;\n }",
"function getCount() {\n\t\t$sql = 'SELECT COUNT(`id`) AS `count` FROM `*PREFIX*fscache` WHERE `user` = ?';\n\t\t$result = \\OC_DB::executeAudited($sql, array($this->user));\n\t\tif ($row = $result->fetchRow()) {\n\t\t\treturn $row['count'];\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}",
"protected function getCount() {\n // Test is made using `is_null()` instead of `empty()` because a member may have no followers at all.\n if (is_null($this->followersCount)) {\n $opts = new ViewQueryOpts();\n $opts->reduce()->setKey([$this->member->id]);\n\n //followers/perMember/view\n $this->followersCount = $this->couch->queryView('followers', 'perMember', 'view', NULL, $opts)->getReducedValue();\n }\n\n return $this->followersCount;\n }",
"static function totalDealsUsed($params){\n $con = $params['dbconnection'];\n if($orderCount = $con->query(\"SELECT\n\t\to.`id`\n\t\tFROM `offers` as of INNER JOIN `orders` as o ON(of.`id`=o.`offer_id` )\n\t\tINNER JOIN `outlets` as ou ON(of.`outlet_id`=ou.`id`)\n\t\tWHERE o.`user_id`='{$params['user_id']}'\")\n ){\n $orderCount = $orderCount->num_rows;\n }\n if($orderCount != \"\"){\n return $orderCount;\n }\n else{\n return 0;\n }\n }",
"function get_user_count() {\n\treturn get_site_option( 'user_count' );\n}",
"public function clientAoCount($user_id)\n {\n $query=\"SELECT id AS ao_id, COUNT(*) AS ao_count, title AS company_name\n FROM Delivery\n WHERE user_id = '\" . $user_id . \"'\";\n $result = $this->getQuery($query,true);\n return $result[0];\n }",
"public function findUserCount();",
"public\n function get_amount_of_users(){\n return $this->database->count_amount_of_users();\n }",
"public function getUserAmount()\n {\n $count = $this->DB->prepare(\"SELECT * FROM users\");\n $count->execute();\n return $count->rowCount();\n }",
"function get_user_article_count( $user_id ) {\n\tglobal $wpdb;\n $count = $wpdb->get_var('SELECT COUNT(ID) FROM ' . $wpdb->posts . ' WHERE post_type = \"post\" AND post_author = ' . $user_id . ' AND post_status = \"publish\"' );\n\t$count = $count > 0 ? $count : 0;\n return $count;\n}",
"function user_count()\n {\n $this->company_db->from('tbl_user');\n return $this->company_db->count_all_results();\n }",
"public function getCount(UserFilter $filter): int;",
"public function count()\n {\n if ($this->queryShouldBeStopped) {\n return 0;\n }\n\n $queryType = 'UserQuery::count';\n $filter = $this->normalizeFilter();\n $callback = function() use ($filter) {\n return (int) $this->bxObject->getList($order = 'ID', $by = 'ASC', $filter, [\n 'NAV_PARAMS' => [\n 'nTopCount' => 0,\n ],\n ])->NavRecordCount;\n };\n\n return $this->handleCacheIfNeeded(compact('queryType', 'filter'), $callback);\n }",
"function user_count() {\n\treturn count(user_array());\n}",
"public function follower_count() {\n return intval($this->redis->sCard($this->user_followed_by_db.$this->id));\n }",
"function dss_get_total_user_tutoriels( $user_id ){\n\n\tglobal $wpdb;\n\n\t$where = get_posts_by_author_sql( 'dss_tutoriels', true, $user_id );\n\n\t$count = $wpdb->get_var( \"SELECT COUNT(*) FROM $wpdb->posts $where\" );\n\n\treturn $count;\n\n}",
"public function countMentors()\n {\n return $this->doctrine->getRepository('UserBundle:User')->countMentorTotal();\n }",
"public function totalUsers()\n {\n $dbh = $this->connectDatabase();\n $req = $dbh->prepare('SELECT \n COUNT(*) AS nb_patients \n FROM `patients`');\n $req->execute();\n $fetch = $req->fetch(PDO::FETCH_ASSOC);\n return (int)$fetch['nb_patients'];\n }",
"public static function getFollowersCount()\n {\n $user = Auth::user()->id;\n $f_id = Follow::where('follow_id', Auth::user()->id)->get();\n return sizeof($f_id);\n }",
"public function getCitedByCount()\n {\n $citedByCount = get_post_meta($this->id, '_sb-citedby-count', true);\n\n if (!empty($citedByCount)) {\n return $citedByCount;\n }\n\n return 0;\n }",
"public function follow_count() {\n return intval($this->redis->sCard($this->user_follow_db.$this->id));\n }",
"function count()\n {\n return $this->cart->instance(\\Auth::id())->count();\n }",
"public static function getFollowingCount()\n {\n $user = Auth::user()->id;\n $f_id = Follow::where('user_id', Auth::user()->id)->get();\n return sizeof($f_id);\n }",
"private function getInquiryCntTotal(){\n\n\t\t$viewDataController = new ViewDataController();\n\t\t$data = $viewDataController->buildData(true);\n\n\t\t$college_id = Session::get('userinfo.school_id');\n\n\t\tif (!isset($college_id)) {\n\t\t\treturn \"You are not an admin!\";\n\t\t}\n\n\t\t$my_user_id = Session::get('userinfo.id');\n\n\t\t$cnt = Recruitment::where('user_id', '!=', $my_user_id)\n\t\t\t\t\t\t\t->where('college_id', $college_id)\n\t\t\t\t\t\t\t->where('college_recruit','!=',1)\n\t\t\t\t\t\t\t->where('status', 1);\n\n\t\t// If user has a department set, show results based on the filters they have set\n\t\t$crf = new CollegeRecommendationFilters;\n\t\t$filter_qry = $crf->generateFilterQry($data);\n\n\t\tif (isset($filter_qry) && isset($data['default_organization_portal'])) {\n\t\t\t$filter_qry = $filter_qry->select('userFilter.id as filterUserId');\n\t\t\t$tmp_qry = $this->getRawSqlWithBindings($filter_qry);\n\t\t\t$cnt = $cnt->join(DB::raw('('.$tmp_qry.') as t2'), 't2.filterUserId' , '=', 'recruitment.user_id');\n\t\t}\n\t\t// End of department query set\n\n\t\treturn $cnt->count();\n\t}",
"public function total_user_count() {\n $this->db->where(array('status' => 1));\n $users_count = $this->db->from('users')->count_all_results();\n\n return $users_count;\n }",
"function get_count()\n\t{\n\t\ttry {\n\t\t\t$query = $this->em->createQueryBuilder()\n\t\t\t\t\t\t\t\t->select(\"COUNT(a)\")\n\t\t\t\t\t\t\t\t->from(\"Entities\\User\", \"a\")\n\t\t\t\t\t\t\t\t->getQuery();\n\t\t\treturn $query->getSingleScalarResult();\n\t\t} catch (Exception $err) {\n\t\t\treturn 0;\n\t\t}\n\t}"
] | [
"0.72906774",
"0.6713027",
"0.6593528",
"0.65602756",
"0.6555609",
"0.64613247",
"0.6438666",
"0.64312863",
"0.6427281",
"0.64148015",
"0.6381696",
"0.63800675",
"0.62634826",
"0.6246791",
"0.6217969",
"0.61962944",
"0.6194919",
"0.61923134",
"0.61897856",
"0.6178956",
"0.6163115",
"0.6158165",
"0.6152097",
"0.61437374",
"0.6116815",
"0.61043453",
"0.61011213",
"0.60918087",
"0.6087453",
"0.60798013"
] | 0.7593022 | 0 |
Get number of deals for each group | function venture_deal_get_group_counts($gids) {
$placeholders = implode(',', array_fill(0, count($gids), "'%s'"));
$query = "SELECT field_deal_groups_value AS gid, COUNT(nid) AS deal_count
FROM {content_field_deal_groups} WHERE field_deal_groups_value IN ($placeholders) GROUP BY field_deal_groups_value";
$result = db_query($query, $gids);
while ($group = db_fetch_object($result)) {
$counts[$group->gid] = $group->deal_count;
}
return $counts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function groupCount()\n {\n return $this->groupBy('group_id')->count();\n }",
"public function getMealExtrasGroupsCount() {\n return $this->getCurrent()->findDependentRowset('Yourdelivery_Model_DbTable_Meal_ExtrasGroups')->count();\n }",
"function get_count_groups() {\r\n global $wpdb;\r\n $count = $wpdb->get_row( \"SELECT Count(group_id) FROM {$this->tb_prefix}enewsletter_groups\", \"ARRAY_A\");\r\n return $count['Count(group_id)'];\r\n }",
"function get_group_count()\r\n {\r\n return count($this->GROUPS);\r\n }",
"public function getGroup_count()\n {\n return $this->group_count;\n }",
"function venture_deal_get_count() {\n global $user;\n $query = \"SELECT COUNT(*) FROM {node} WHERE type = 'deal' AND uid = %d\";\n $result = db_result(db_query($query, $user->uid));\n return $result;\n}",
"function tsml_count_groups() {\n\treturn count(tsml_get_all_groups('publish'));\n}",
"public function countItems() {\n\t\tparent::countItems();\n\n\t\t$sql = \"SELECT\t\tCOUNT(*) AS count \n\t\t\tFROM\t\twcf\".WCF_N.\"_group\n\t\t\tNATURAL JOIN \twcf\".WCF_N.\"_projectSvn \";\n\t\t$row = WCF::getDB()->getFirstRow($sql);\n\n\t\treturn $row['count'];\n\t}",
"public function getOrderCount();",
"public function count()\n {\n $arr = $this->applyFilters();\n if (count($this->group)>0)\n $arr = $this->applyGroup($arr);\n if (count($this->tree)>0)\n $arr = $this->applyTree($arr);\n $this->reset();\n return count($arr);\n }",
"public function numGroups()\n {\n return count($this->groups());\n }",
"public function get_attribute_group_count()\n\t{\n\t\treturn $this->db->count_records(\"attribute_group\");\n\t}",
"public function getCount() {\r\n\t\t$rec = new $this->className();\r\n\t\t$queryData = $this->queryData;\r\n\t\t$queryData['extraColumns'] = array(); //delete any set column\r\n\t\t$queryData['extraColumns'][] = 'COUNT(*) as Count';\r\n\t\t$queryData['recordColumns'] = false; //remove record columns\r\n\t\t//notice to make sure it is understood what is happening here.\r\n\t\tif (!empty($queryData['group']))\r\n\t\t\ttrigger_error('Grouping columns are added and will be removed, use getCountGrouped instead if you want them added', E_USER_NOTICE);\r\n\t\t$queryData['group'] = array();\r\n\t\t$query = $rec->buildFetchQuery($queryData);\r\n\t\treturn (int)$this->db->query($query)->fetchCell();\r\n\t}",
"public function getStoreGroupCount()\n {\n return $this->count(self::store_group);\n }",
"function total_number()\n\t{\n\t\t$admin_cnt = $this->db->select('group_id')\n\t\t\t\t ->from('users')\n\t\t\t\t ->where('group_id', 1)\n\t\t\t\t ->where('active', 1)\n\t\t\t\t ->get();\n\t\t\t\t \n\t\t$total_cnt['admin_cnt'] = $admin_cnt->num_rows();\n\n\t\t$user_cnt = $this->db->select('group_id')\n\t\t\t\t ->from('users')\n\t\t\t\t ->where('group_id', 2)\n\t\t\t\t ->where('active', 1)\n\t\t\t\t ->get();\n\n\t\t$total_cnt['user_cnt'] = $user_cnt->num_rows();\n\t\t\t\n\t\treturn $total_cnt;\n\t}",
"public function get_count() {\n if (!empty($_POST['votable_id'])) {\n return $this->get_votable_count($_POST['votable_id']);\n }\n elseif (!empty($_POST['group_name'])) {\n return $this->get_group_count($_POST['group_name']);\n }\n return 0;\n }",
"public function countAllGroups()\n {\n $CI =& get_instance();\n $venueId = $CI->session->userdata('venue_id');\n\n $this->db->select(\"count(venue_meeting_id) as cnt\");\n $this->db->from($this->table);\n $this->db->where('starting_date_time >=', date('Y-m-d H:i:s'));\n\n if( !empty($venueId) ) {\n $this->db->where('venue_id', $venueId);\n }\n\n $result = $this->db->get()->row();\n\n return empty($result)? 0:(int)$result->cnt;\n }",
"function get_object_count()\r\n {\r\n return $this->get_browser()->count_announcement_distributions($this->get_condition());\r\n }",
"public function totalCount();",
"public function getTotalCount();",
"function orderDCount()\n\t{\n\t\treturn $this->db->count_all('orderdetails');\n\t}",
"function og_field_audience_count($opt_group = FALSE, $account = NULL) {\n $count = &drupal_static(__FUNCTION__, FALSE);\n\n if ($count === FALSE) {\n if (empty($account)) {\n global $user;\n\n $account = clone($user);\n }\n // If opt_group is TRUE then get the count of all the groups that are\n // active, otherwise only the ones the user belongs to.\n $count = $opt_group ? og_get_all_group(array(OG_STATE_ACTIVE), array('count' => TRUE)) : count(og_get_entity_groups('user', $account));\n }\n\n return $count;\n}",
"function numMatchsGroup() {\n $exp = \"groups.*.matches[?matchday == `1` || matchday == `2` || matchday == `3`] | []\";\n $res = JmesPath\\search($exp, $GLOBALS['wcJsonData']);\n\n $numMatchesGroup = count($res);\n return $numMatchesGroup;\n}",
"function getTotalCount() {\n// dd();\n $clone = clone $this->dbQuery;\n $clone->select(\\DB::raw('count('.$this->aggregatorField.') as count'));\n $clone = $this->_applyFilter($clone, $this->search, $this->columns);\n return $this->hasGroupBy ? $clone->get()->count() : $clone->count();\n \n }",
"function clanpress_the_squad_members_count( $group_id = null ) {\n $group_id = isset( $group_id ) ? $group_id : bp_group_id();\n\n echo (int) groups_get_total_member_count( $group_id );\n}",
"function panier_get_count() {\n global $panier;\n $resultat = 0;\n foreach ($panier as $item) {\n $resultat+= $item[PS_PANIER_ITEM_QTY];\n }\n return $resultat;\n}",
"public function count()\n {\n return count($this->cards);\n }",
"public function getItemCount()\n {\n return count($this->shipment);\n }",
"abstract public function get_Count();",
"public function getCount(): int\n {\n return count($this->data);\n }"
] | [
"0.695086",
"0.6906282",
"0.6516284",
"0.64678174",
"0.62258154",
"0.61113906",
"0.6044212",
"0.60395914",
"0.6034452",
"0.60273296",
"0.594634",
"0.5941915",
"0.5938981",
"0.5923987",
"0.59199494",
"0.58515024",
"0.58081514",
"0.5807786",
"0.57975715",
"0.5787237",
"0.57536954",
"0.572305",
"0.56793094",
"0.5670371",
"0.5666793",
"0.5646186",
"0.561795",
"0.5613205",
"0.5604019",
"0.5592184"
] | 0.7001028 | 0 |
Determine if the deal is accessible by user | function venture_deal_is_accessible($deal_uid, $deal_country) {
global $user;
return $deal_uid == $user->uid || venture_profile_is_accredited() || $deal_country != 'United States';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isOwned() {\n\t\t$logged = Common::getLoggedUser();\n\t\t// si es administrador (level <=2) es propietario\n\t\tif ($logged->getLevelId() <= 2) \n\t\t\treturn true;\n\t\telse {\n\t\t\t$queryClass = $this->getUserObjectType() . 'Query';\n\t\t\tif (class_exists($queryClass)) {\n\t\t\t\t$author = $queryClass::create()->findOneById($this->getUserObjectId());\n\t\t\t\t// lo dejo editar si es el creado\n\t\t\t\tif(!empty($author) && (get_class($logged) == get_class($author) && $logged->getId() == $author->getId()))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t}",
"public function user_has_access() {\n\t\treturn current_user_can( 'pvm_delegated_authorship' );\n\t}",
"public function checkAccess()\n {\n\t\treturn !is_null($this->author_id) && $this->author_id == Yii::app()->user->id;\n }",
"public function authorize() {\n\t\t\t\n\t\t\treturn $this->user()->id == $this->route('apartment')->owner()->id;\n\t\t}",
"public function authorize()\n\t{\n\t\treturn request()->invoice->user_id == request()->user()->id;\n\t}",
"function is_eligible(){\n\treturn is_admin() && is_loggedin();\n}",
"function canViewItem() {\n\n if (!Session::haveAccessToEntity($this->getEntityID())) {\n return false;\n }\n return (Session::haveRight(self::$rightname, self::READALL)\n || (Session::haveRight(self::$rightname, self::READMY)\n && (($this->fields[\"users_id_recipient\"] === Session::getLoginUserID())\n || $this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || $this->isUser(CommonITILActor::OBSERVER, Session::getLoginUserID())))\n || (Session::haveRight(self::$rightname, self::READGROUP)\n && isset($_SESSION[\"glpigroups\"])\n && ($this->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"])\n || $this->haveAGroup(CommonITILActor::OBSERVER, $_SESSION[\"glpigroups\"])))\n || (Session::haveRight(self::$rightname, self::READASSIGN)\n && ($this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID())\n || (isset($_SESSION[\"glpigroups\"])\n && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION[\"glpigroups\"]))\n || (Session::haveRight(self::$rightname, self::ASSIGN)\n && ($this->fields[\"status\"] == self::INCOMING))))\n || (Session::haveRightsOr('ticketvalidation', TicketValidation::getValidateRights())\n && TicketValidation::canValidate($this->fields[\"id\"])));\n }",
"public function authorize()\n {\n if (Auth::user()->can('show-person')) return true;\n if ($this->userPersonOwns()) return true;\n return false;\n }",
"function _hasAccess()\r\n {\r\n // create user object\r\n $user =& User::singleton();\r\n\r\n $timePoint =& TimePoint::singleton($_REQUEST['sessionID']);\r\n $candID = $timePoint->getCandID();\r\n\r\n $candidate =& Candidate::singleton($candID);\r\n\r\n // check user permissions\r\n return ($user->hasPermission('access_all_profiles') || $user->getData('CenterID') == $candidate->getData('CenterID') || $user->getData('CenterID') == $timePoint->getData('CenterID'));\r\n }",
"public function canAccess();",
"public function authorize()\n {\n return $this->user() && $this->user()->isCustomer() && $this->user()->balance->bill ?? false;\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n if ($user = $this->owner_id) {\n return true;\n } else {\n return false;\n }\n }",
"public static function hasAccess()\n {\n return !self::isEnabled() || self::isClientAllowed();\n }",
"function user_access($account) {\n return (bool)$this->get_object();\n }",
"public function isAuthorized($user) {\n \tif ($this->action === 'add') {\n\t return true;\n \t}\n \t// The owner of a pedido can edit and delete it\n \tif (in_array($this->action, array('edit', 'delete'))) {\n \t$pedidoId = $this->request->params['pass'][0];\n \tif ($this->Pedido->isOwnedBy($pedidoId, $user['id'])) {\n \treturn true;\n \t}\n \t}\n\t\treturn parent::isAuthorized($user);\n\t}",
"public function authorize()\n {\n $accessor = $this->user();\n $user = $this->route('user');\n\n return $accessor->isAdmin() || \n ($accessor->isCommittee() && $accessor->hasKey('put-users')) || \n ($accessor->isEntrant() && $accessor->entry->id === $user->entry_id) || \n $accessor->id === $user->id;\n }",
"public function canAccess() {\n\t\treturn true;\n\t}",
"public function authorize()\n\t{\n // Fetch the user from the database.\n //\n $user = $this->fetchRecord();\n\n // The user must be logged in, the user record must exist, and the\n // user trying to edit the record must be the account holder.\n //\n return Auth::check() && $user && $user->isAccountHolder();\n\t}",
"public function authorize()\n {\n return $this->user()->isCompany() && $this->user()->id === (int) $this->route('user');\n }",
"public function authorize()\n {\n $article = Article::find($this->route('article_id'));\n return $article && Auth::user()->id === $article->author_id;\n }",
"public function authorize()\n {\n return $this->user()->ownsTeam($this->merchant) || $this->user()->roleOn($this->merchant) === 'owner';\n }",
"public static function canAccess($doc_id='0', $dept_id='0',$user_id='0',$action=\"t.read='1'\"){\n if ( self::model()->exists(\"doc_id = '$doc_id' and dept_id = '$dept_id' and $action\") )\n return true;\n return self::model()->exists(\"doc_id = '$doc_id' and user_id = '$user_id' and $action\"); \n }",
"public function hasAccess();",
"function venture_deal_is_node_accessible($deal) {\n return venture_deal_is_accessible($deal->uid, $deal->field_deal_country[0]['value']);\n}",
"public function authorize()\n {\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }",
"public function authorize()\n {\n $song = Song::find($this->id);\n\n if (!$song) {\n abort(404);\n }\n\n return $song->user_id == $this->user()->id;\n }",
"public function authorize()\n {\n $this->getCategory();\n if ($this->category) {\n\n $this->getArticle();\n if ($this->article) {\n // only found if editing\n return true;\n }\n\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n return Auth::check() && Auth::user()->isOwner();\n }",
"public function authorize()\n {\n return $this->can('edit-resident')\n || (!empty($this->resident_id) && $this->user()->resident && $this->resident_id == $this->user()->resident->id);\n }",
"function canViewItem() {\n return (($this->fields['users_id'] == Session::getLoginUserID())\n || (Session::haveRight('rssfeed_public', READ)\n && $this->haveVisibilityAccess()));\n }"
] | [
"0.7224511",
"0.7166118",
"0.7164197",
"0.7106545",
"0.6970814",
"0.69650525",
"0.69288856",
"0.685277",
"0.68501544",
"0.68362534",
"0.6821052",
"0.68177354",
"0.67879206",
"0.67867893",
"0.6785189",
"0.67622894",
"0.67541444",
"0.6753573",
"0.67273986",
"0.671456",
"0.67097104",
"0.66826147",
"0.6677456",
"0.66761065",
"0.6669158",
"0.6659826",
"0.66589695",
"0.6657053",
"0.6637429",
"0.6632888"
] | 0.7569238 | 0 |
Validate the country field for user deals | function venture_deal_validate_country($element) {
global $form_values;
if ($form_values['field_deal_country']['key'] == 'United States') {
if ($profile = venture_profile_retrieve(arg(1))) {
if (!venture_profile_is_accredited($profile)) {
form_set_error('field_deal_country', 'Country field is invalid. United States deals may not be submitted to a non-accredited investor.');
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function country_valid($country)\n\t{\n\t\tif (strlen($country)<4)\n\t\t{\n\t\t\t$this->form_validation->set_message('country_valid', t('callback_country_invalid'));\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"function venture_deal_validate_state($element) {\n global $form_values;\n if ($form_values['field_deal_country']['key'] == 'United States') {\n if (!$form_values['field_deal_state']['key']) {\n form_set_error('field_deal_state', 'State field is required.');\n }\n }\n}",
"function _commerce_dapi_orders_country($country) {\n $countries = _commerce_dapi_countries();\n\n // Country abbreviations will always be two uppercase letters. \n $country = drupal_strtoupper($country);\n if (!empty($country) && isset($countries[$country])) {\n return check_plain($countries[$country]);\n }\n return check_plain($country);\n}",
"public function validate()\n {\n $valid = parent::validate();\n $filter = array(\n \"OrderStepID\" => $this->OrderStepID,\n \"EcommerceCountryID\" => $this->EcommerceCountryID\n );\n $exclude = array(\"ID\" => $this->ID);\n if (EcommerceOrderStepCountryData::get()->filter($filter)->exclude($exclude)->count()) {\n $valid->error('An entry for this country and order step already exists. Please change the country or review existing records.');\n }\n return $valid;\n }",
"protected function _validate()\n {\n if (strlen(trim($this->getCountry())) === 0 && $this->_defaultCountry) {\n $this->setCountry($this->_defaultCountry);\n }\n return strlen(trim($this->getCountry())) > 0 &&\n strlen(trim($this->getQuery())) > 0;\n }",
"protected function _validateCountryCurrency()\n {\n $country_cur_serv = CountryCurrencyServiceFactory::build();\n if( $info = $country_cur_serv->getCountryCurrencyInfo($this->request->getCountryCurrencyCode()) )\n {\n $this->request->setCountryCode($info['country_code']);\n return $info;\n }\n\n $this->setErrorCode(MessageCode::CODE_COUNTRY_CURRENCY_INVALID_CURRENCY_CODE);\n return false;\n }",
"public function validateCountry($attr, $params)\n\t{\n\t\tif ($this->$attr && $this->protection) {\n\t\t\tif (in_array($this->$attr, [3, 24, 31, 41, 43]) && $this->protection != 1) {\n\t\t\t\t$this->addError('protection', 'New York City countries must be Highly Protected.');\n\t\t\t\t$this->addError($attr, 'New York City countries must be Highly Protected.');\n\t\t\t}\n\t\t}\n\t}",
"public function canUseForCountry($country)\n {\n }",
"public function validCountry($country)\n {\n return $this->dataRepository->validCountry($country);\n }",
"public function testValidatePhoneWithCountryFieldNoType()\n\t{\n\t\t$this->assertTrue($this->performValidation(['value' => '016123456', 'country' => 'BE']));\n\n\t\t// Validator with wrong country field supplied.\n\t\t$this->assertFalse($this->performValidation(['value' => '016123456', 'country' => 'NL']));\n\t}",
"function theme_c4m_user_country(array $field) {\n if (empty($field['entity']->uid)) {\n return;\n }\n\n // Check if this is a user or node entity.\n $user = 'user' === $field['entity_type'] ? $field['entity'] :\n user_load($field['entity']->uid);\n $allowed_values = &drupal_static(__FUNCTION__);\n if (empty($allowed_values)) {\n $field = field_info_field('c4m_country');\n $allowed_values = list_allowed_values($field);\n }\n // Check if we have an image.\n $wrapper = entity_metadata_wrapper('user', $user);\n $country = !empty($wrapper->c4m_country->value()) ? $allowed_values[$wrapper->c4m_country->value()] : '';\n\n if (empty($country)) {\n return NULL;\n }\n if (t('- choose country or region -') === drupal_strtolower($country)) {\n return NULL;\n }\n\n // @codingStandardsIgnoreStart\n $value = t(ucwords(drupal_strtolower($country)));\n // @codingStandardsIgnoreEnd\n\n $tag['element'] = array(\n '#tag' => 'span',\n '#attributes' => array(\n 'class' => array('country'),\n ),\n '#value' => $value,\n );\n return theme_html_tag($tag);\n}",
"public function testValidatePhoneWithCountryFieldWithType()\n\t{\n\t\t$this->assertTrue($this->performValidation(['value' => '0499123456', 'params' => 'mobile', 'country' => 'BE']));\n\n\t\t// Validator with correct country field supplied, wrong type.\n\t\t$this->assertFalse($this->performValidation(['value' => '016123456', 'params' => 'mobile', 'country' => 'BE']));\n\n\t\t// Validator with wrong country field supplied, correct type.\n\t\t$this->assertFalse($this->performValidation(['value' => '0499123456', 'params' => 'mobile', 'country' => 'NL']));\n\n\t\t// Validator with wrong country field supplied, wrong type.\n\t\t$this->assertFalse($this->performValidation(['value' => '016123456', 'params' => 'mobile', 'country' => 'NL']));\n\t}",
"public function message()\n {\n return __('The :attribute must be a valid country.');\n }",
"function checkCountryAndState() {\n\t\t## get access to POST and requiredfields variables.\n\t\tglobal $requiredFields, $errorField, $statesArr;\n\t\tglobal $_POST;\n\t\t$stateField = array(\"state\"=>\"state\");\n\t\t$provinceField = array(\"province\"=>\"province\");\n\t\t## check if 'country' is set.\n\t\tif (isset($_POST['country'])) {\n\t\t\t## check the value of 'country', if the value is 'US'\n\t\t\t## add the 'state' field to the required fields array.\n\t\t\tif ( $_POST['country'] === \"US\" ) {\n\t\t\t\t## check if state has data\n\t\t\t\tif (!isset($_POST['state'])) {\n\t\t\t\t\t## add 'state' field to the required fields array\n\t\t\t\t\t$requiredFields = array_merge($requiredFields, $stateField);\n\t\t\t\t} else {\n\t\t\t\t\t## state exists. check if valid data\n\t\t\t\t\tif ( in_array($_POST['state'],$statesArr) && (preg_match(\"/[^default]/\",$_POST['state'])) ) {\n\t\t\t\t\t\t## do nothing. its a valid state.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t## not a valid state, add to errorArray\n\t\t\t\t\t\t$errorField = array_merge ($errorField,$stateField);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t} else {\n\t\t\t\t## the country is not US\n\t\t\t\t#RMME $_POST['state'] = '';\n\t\t\t\t## check if province has data\n\t\t\t\tif (!isset($_POST['province'])) {\n\t\t\t\t\t## add 'province' field to the required fields array\n\t\t\t\t\t$requiredFields = array_merge($requiredFields, $provinceField);\n\t\t\t\t} else {\n\t\t\t\t\t## province exists. check if valid data\n\t\t\t\t\t#RMMEif ( in_array($_POST['province'],$statesArr) && (preg_match(\"/[^default]/\",$_POST['state'])) ) {\n\t\t\t\t if (isset($_POST['province']) && preg_match(\"/\\w+/\",$_POST['province']) ) {\n\t\t\t\t\t\t## do nothing. its a valid state.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t## not a valid state, add to errorArray\n\t\t\t\t\t\t$errorField = array_merge ($errorField,$provinceField);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t## default, add 'state' field as required until country field is set.\n\t\t\t$requiredFields = array_merge($requiredFields, $stateField);\t\n\t\t}\n\t}",
"public static function validSmsCountry($country) {\n\n\t\t//TODO: add this to a db table\n\t\treturn $country == \"GBR\" ? true : false;\n\t}",
"public function setCountry($country)\n {\n if ($this->_validation->validateIsString($country)) {\n $this->_country = $country;\n } else {\n throw new PiRatepay_Paypage_Util_ValidationException(120);\n }\n }",
"public function phone_country($country)\n\t{\n\t\treturn (strlen($country) === 2 && ctype_alpha($country) && ctype_upper($country) && $country != 'ZZ');\n\t}",
"abstract public function country();",
"function is_country($country) {\n return in_array($country, array('AD','AE','AF','AG','AI','AL','AM','AO','AQ','AR','AS','AT','AU','AW','AX','AZ','BA','BB','BD','BE','BF','BG','BH','BI','BJ','BL','BM','BN','BO','BQ','BR','BS','BT','BV','BW','BY','BZ','CA','CC','CD','CF','CG','CH','CI','CK','CL','CM','CN','CO','CR','CU','CV','CW','CX','CY','CZ','DE','DJ','DK','DM','DO','DZ','EC','EE','EG','EH','ER','ES','ET','FI','FJ','FK','FM','FO','FR','GA','GB','GD','GE','GF','GG','GH','GI','GL','GM','GN','GP','GQ','GR','GS','GT','GU','GW','GY','HK','HM','HN','HR','HT','HU','ID','IE','IL','IM','IN','IO','IQ','IR','IS','IT','JE','JM','JO','JP','KE','KG','KH','KI','KM','KN','KP','KR','KW','KY','KZ','LA','LB','LC','LI','LK','LR','LS','LT','LU','LV','LY','MA','MC','MD','ME','MF','MG','MH','MK','ML','MM','MN','MO','MP','MQ','MR','MS','MT','MU','MV','MW','MX','MY','MZ','NA','NC','NE','NF','NG','NI','NL','NO','NP','NR','NU','NZ','OM','PA','PE','PF','PG','PH','PK','PL','PM','PN','PR','PS','PT','PW','PY','QA','RE','RO','RS','RU','RW','SA','SB','SC','SD','SE','SG','SH','SI','SJ','SK','SL','SM','SN','SO','SR','SS','ST','SV','SX','SY','SZ','TC','TD','TF','TG','TH','TJ','TK','TL','TM','TN','TO','TR','TT','TV','TW','TZ','UA','UG','UM','US','UY','UZ','VA','VC','VE','VG','VI','VN','VU','WF','WS','YE','YT','ZA','ZM','ZW'));\n}",
"public function country();",
"public function country();",
"public function saveCountry(Request $request){\n $data = $request->validate([\n 'continents' => 'nullable|string',\n \"country_name_nl\" => 'required',\n \"country_name_en\" => 'required',\n 'iso_code' => 'required',\n 'shipment_rate' => 'required',\n ]);\n $checker = Country::where('country_nl', '=' ,$data['country_name_nl'])->first();\n $controle2 = Country::where('isocode', '=' ,$data['iso_code'])->first();\n $controle3 = Country::where('country_en','=',$data['country_name_en'])->first();\n\n if ($controle2 != null || $controle3 != null || $checker != null){\n $request->session()->flash('status', trans('general.info_exists'));\n return view('backend.pages.countries.edit')->with('data',$data);\n }\n\n $country = new Country();\n $country->isocode = strtolower($data ['iso_code']);\n $country->country_nl = $data['country_name_nl'];\n $country->country_en = $data['country_name_en'];\n $country->shipment_rate = $data['shipment_rate'];\n $country->continents = strtolower($data['continents']);\n\n $country->save();\n\n $request->session()->flash('status', trans('general.country_saved'));\n return Redirect::route('country');\n }",
"public function countryLength($field)\n\t{\n\t\tif(strlen($this->post[$field]) < 2 || strlen($this->post[$field]) > 20) {\n\t\t\t$this->setError($field, \"{$this->label($field)} must be of minimum \n\t\t\t\t\t\t\t\t\t2 characters or maximum of 20 characters\");\n\t\t}\n\t}",
"function venture_deal_is_accessible($deal_uid, $deal_country) {\n global $user;\n return $deal_uid == $user->uid || venture_profile_is_accredited() || $deal_country != 'United States';\n}",
"public function testCountry(): void\n {\n $actual = $expected = 'FR';\n\n self::assertSame($this->bill, $this->bill->setCountry($actual));\n self::assertSame($expected, $this->bill->getCountry());\n }",
"function _commerce_dapi_country_abbr($country) {\n $countries = array_flip(array_map('strtolower', _commerce_dapi_countries()));\n\n if (isset($countries[strtolower($country)])) {\n return check_plain($countries[strtolower($country)]);\n }\n return check_plain($country);\n}",
"protected function displayRestrictedCountryPage() {\n\t}",
"static function setPreferredUserCountry( $country )\n {\n eZPreferences::setValue( 'user_preferred_country', $country );\n\n return eZError::SHOP_OK;\n }",
"public function setCountry($country);",
"private function get_billing_country() {\n\t\t$countries = edd_get_country_list();\n\n\t\tforeach ( $this->billing_info as $address_part ) {\n\t\t\tif ( ! array_key_exists( $address_part, $countries ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$country = $address_part;\n\t\t\tbreak;\n\t\t}\n\n\t\treturn ! empty( $country ) ? $country : false;\n\t}"
] | [
"0.7278569",
"0.6823956",
"0.6706691",
"0.66985446",
"0.65863436",
"0.65498704",
"0.6501925",
"0.6491145",
"0.64882064",
"0.6347554",
"0.6176284",
"0.61738384",
"0.61594296",
"0.60499",
"0.60476667",
"0.6028396",
"0.6025596",
"0.5941993",
"0.59133863",
"0.5863036",
"0.5863036",
"0.5861374",
"0.58557177",
"0.5790688",
"0.57801944",
"0.5768259",
"0.57514167",
"0.5751106",
"0.57470644",
"0.57228374"
] | 0.8382099 | 0 |
Validate the state field | function venture_deal_validate_state($element) {
global $form_values;
if ($form_values['field_deal_country']['key'] == 'United States') {
if (!$form_values['field_deal_state']['key']) {
form_set_error('field_deal_state', 'State field is required.');
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validateEventState(string $state): void;",
"public function validate_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"function validateState() {\n\t\t$error_message = \"\";\n\n if (!$GLOBALS[\"state\"] == 'vic' && !$GLOBALS[\"state\"] == 'nsw' && !$GLOBALS[\"state\"] == 'qld' && !$GLOBALS[\"state\"] == 'nt' && !$GLOBALS[\"state\"] == 'wa' && !$GLOBALS[\"state\"] == 'sa' || !$GLOBALS[\"state\"] == 'tas' && !$GLOBALS[\"state\"] == 'act' && !$GLOBALS[\"state\"] == \"no-state\") {\n $error_message = $error_message.\"<p>\".$state.\" is not a valid state!</p>\";\n } else if ($GLOBALS[\"state\"] == \"no-state\") {\n $error_message = $error_message.\"<p>State has not been entered.</p>\";\n } else if (!checkPostcode($GLOBALS[\"state\"])) {\n\t\t\t$error_message = $error_message.\"<p>\".$GLOBALS[\"postcode\"].\" is not a valid postcode for \".$GLOBALS[\"state\"].\".</p>\";\n\t\t}\n\n\t\treturn $error_message;\n }",
"public function isValidstate() {\n\t\treturn $this->validstate;\n\t}",
"public function validate_state($state)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! clearos_is_valid_boolean($state))\n return lang('base_state_invalid');\n }",
"public function addStateValidate($state)\n {\n return Validator::make($state, [\n //'StateName' => array('required|exists:state_types,id','regex:/^([a-zA-Z]+){3,}$/u' ),\n 'StateName' => 'required|string|unique:states,name',\n 'StateType' => 'required|exists:state_types,id',\n ]); \n // array(\n // 'required',\n // 'regex:/(^([a-zA-Z]+)(\\d+)?$)/u'\n // )\n // 'mission_id' => 'required|exists:missions,id',\n }",
"public static function state($state){\n\n\t\t$result = new sb_Validate_Results();\n\t\t$result->value = $state;\n\n\t\tif(in_array($state, array('AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'GA', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VT', 'WA', 'WV', 'WY'))){\n\n\t\t\t$result->is_valid = true;\n\t\t\t$result->message = 'Valid state code';\n\n\t\t} else {\n\n\t\t\t$result->is_valid = false;\n\t\t\t$result->message = 'Invalid state code, are you sure you are using a two letter abbreviation';\n\n\t\t}\n\n\t\treturn $result;\n\t}",
"static private function isValidState($state = '')\n {\n $timestamp = subst($state, 0, 25);\n if (strcmp(generateState($timestamp), $state) === 0)\n {\n return true;\n }\n return false;\n }",
"protected function validateState(StateContract $state, ResponseInterface $response)\n {\n //\n }",
"function check_valid_state($state)\n{\nif(strlen($state)==0)\n\t{\n\t\techo\"No code given.\\n\";\n\t\treturn false;\n\t}\n\telseif(strlen($state)>2)\n\t{\n\t\techo\"State Code is too long.\\n\";\n\t\treturn false;\n\t}\n\telseif(ctype_alpha($state) == false)\n\t{\n\t\techo\"State code does not contain only alphabet letters.\\n\";\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}",
"function checkCountryAndState() {\n\t\t## get access to POST and requiredfields variables.\n\t\tglobal $requiredFields, $errorField, $statesArr;\n\t\tglobal $_POST;\n\t\t$stateField = array(\"state\"=>\"state\");\n\t\t$provinceField = array(\"province\"=>\"province\");\n\t\t## check if 'country' is set.\n\t\tif (isset($_POST['country'])) {\n\t\t\t## check the value of 'country', if the value is 'US'\n\t\t\t## add the 'state' field to the required fields array.\n\t\t\tif ( $_POST['country'] === \"US\" ) {\n\t\t\t\t## check if state has data\n\t\t\t\tif (!isset($_POST['state'])) {\n\t\t\t\t\t## add 'state' field to the required fields array\n\t\t\t\t\t$requiredFields = array_merge($requiredFields, $stateField);\n\t\t\t\t} else {\n\t\t\t\t\t## state exists. check if valid data\n\t\t\t\t\tif ( in_array($_POST['state'],$statesArr) && (preg_match(\"/[^default]/\",$_POST['state'])) ) {\n\t\t\t\t\t\t## do nothing. its a valid state.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t## not a valid state, add to errorArray\n\t\t\t\t\t\t$errorField = array_merge ($errorField,$stateField);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t} else {\n\t\t\t\t## the country is not US\n\t\t\t\t#RMME $_POST['state'] = '';\n\t\t\t\t## check if province has data\n\t\t\t\tif (!isset($_POST['province'])) {\n\t\t\t\t\t## add 'province' field to the required fields array\n\t\t\t\t\t$requiredFields = array_merge($requiredFields, $provinceField);\n\t\t\t\t} else {\n\t\t\t\t\t## province exists. check if valid data\n\t\t\t\t\t#RMMEif ( in_array($_POST['province'],$statesArr) && (preg_match(\"/[^default]/\",$_POST['state'])) ) {\n\t\t\t\t if (isset($_POST['province']) && preg_match(\"/\\w+/\",$_POST['province']) ) {\n\t\t\t\t\t\t## do nothing. its a valid state.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t## not a valid state, add to errorArray\n\t\t\t\t\t\t$errorField = array_merge ($errorField,$provinceField);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t## default, add 'state' field as required until country field is set.\n\t\t\t$requiredFields = array_merge($requiredFields, $stateField);\t\n\t\t}\n\t}",
"function facebook_status_edit_validate($form, &$form_state) {\n\treturn;\n}",
"public function getValidationState()\n {\n return $this->validation_state;\n }",
"function event_registration_admin_settings_validate($form, $form_state) {\n\n}",
"public static function validateState($state, $rule) {\n\t\t$rule = self::normalizeRule($rule);\n\t\t$rule->setup($state);\n\t\t$rule->apply($state);\n\t}",
"public function validateForm(array &$form, FormStateInterface $form_state) {\n\n }",
"public function is_valid();",
"public function valid()\n {\n $allowed_values = [\"PENDING\", \"OPEN\", \"COMPLETED\", \"CANCELED\", \"REFUNDED\", \"REJECTED\"];\n if (!in_array($this->container['state'], $allowed_values)) {\n return false;\n }\n return true;\n }",
"function mediaForm_validate($form, $form_state) {\n if(empty($form_state['values']['title']))\n form_set_error('title', 'Name cannot be empty.');\n\n if(empty($form_state['values']['OID']))\n form_set_error('OID', 'Must select outreach event.');\n\n if(mb_strlen($form_state['values']['description']) > MAX_DESCRIPTION_CHAR)\n form_set_error('description', 'The description must be fewer than '.MAX_DESCRIPTION_CHAR.' characters.');\n}",
"function bibdk_reservation_borchk_validate($form_state) {\n if ($form_state['clicked_button']['#name'] == 'next' && empty($form_state['input']['favourite_selected'])) {\n $agencySettings = BibdkReservationOrderObject::GetObject()->getFields();\n $messages = array();\n if (empty($agencySettings)) {\n watchdog('bibdk_reservation', 'no fields for agency', array(), WATCHDOG_ERROR);\n $messages = array(\n 'error' => t('Service Unavailable. We can not make reservation right know', array(), array('context' => 'bibdk_reservation')),\n 'status' => NULL\n );\n }\n\n if (empty($messages)) {\n $messages = bibdk_reservation_borchk_execute($form_state, $agencySettings);\n }\n if (!isset($messages)) {\n return;\n }\n if (isset($messages['status'])) {\n drupal_set_message(t($messages['status'], array(), array('context' => 'bibdk_reservation:error')), 'warning');\n }\n if (isset($messages['error'])) {\n form_set_error('borchk', t($messages['error'], array(), array('context' => 'bibdk_reservation:error')));\n }\n }\n}",
"public function validateForm(array &$form, FormStateInterface $form_state) {\n }",
"static public function isValidState($state): bool\n {\n return in_array(static::stateFromOrder($state), static::getStates(), true);\n }",
"public function validateField();",
"public function valid () {}",
"function islandora_webpage_admin_validate($form, &$form_state) {\n \n}",
"function rnd15_donate_pay_in_form_validate_step_1($form, &$form_state) {\n switch ($form_state['values']['type']) {\n case 'schools':\n if ($form_state['values']['establishment_type'] === 'Please select') {\n form_set_error('establishment_type', 'Please choose an establishment type');\n }\n if ($form_state['values']['job_title'] === 'Please select') {\n form_set_error('job_title', 'Please choose a job title');\n }\n break;\n }\n}",
"function my_module_my_form_validate($form, &$form_state) {\n\t$year_of_birth = $form_state['values']['year_of_birth'];\n\t$first_name = $form_state['values']['first'];\n\t$last_name = $form_state['values']['last'];\n\tif (!$first_name) {\n\t\tform_set_error('first', 'Please enter your first name.');\n\t}\n\tif (!$last_name) {\n\t\tform_set_error('last', 'Please enter your last name.');\n\t}\n\tif ($year_of_birth && ($year_of_birth < 1900 || $year_of_birth > 2000)) {\n\t\tform_set_error('year_of_birth', 'Enter a year between 1900 and 2000.');\n\t}\n}",
"private function validateState()\n {\n if ($this->cookie->getCookie(LtiOidcLogin::COOKIE_PREFIX.$this->request['state']) !== $this->request['state']) {\n // Error if state doesn't match\n throw new LtiException(static::ERR_STATE_NOT_FOUND);\n }\n\n return $this;\n }",
"public function valid(){ }",
"public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }"
] | [
"0.7234961",
"0.72167283",
"0.71873003",
"0.7185336",
"0.71458876",
"0.7021883",
"0.6752373",
"0.66956383",
"0.65885925",
"0.6565664",
"0.64618695",
"0.6421337",
"0.6390401",
"0.6346453",
"0.6329179",
"0.6303265",
"0.62317765",
"0.6228871",
"0.6194198",
"0.61676806",
"0.6129761",
"0.6123327",
"0.6097026",
"0.6090504",
"0.6048395",
"0.60414714",
"0.6036396",
"0.6035386",
"0.6012602",
"0.6009437"
] | 0.75515825 | 0 |
Handler to only select deals outside of the US | function venture_deal_views_handler_not_united_states($op, $filter, $filterinfo, &$query) {
if ($filter['value'] == 1) {
$table = $filterinfo['table'];
$field = $filterinfo['field'];
$query->add_where("$table.$field != 'United States'");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function venture_deal_views_tables_alter(&$table_data) {\n $table_data['node_data_field_deal_country']['filters']['field_deal_country_value_not_united_states'] = array(\n 'name' => t('Venture: Hide non-accessible deals'),\n 'field' => 'field_deal_country_value',\n 'operator' => array('!=' => 'Is Not'),\n 'value' => array(\n '#type' => 'select',\n '#options' => array(\n 1 => t('United States'),\n ),\n ),\n 'handler' => 'venture_deal_views_handler_not_united_states',\n 'help' => t('Hide deals not viewable by non-accredited investors.')\n );\n}",
"function venture_deal_is_accessible($deal_uid, $deal_country) {\n global $user;\n return $deal_uid == $user->uid || venture_profile_is_accredited() || $deal_country != 'United States';\n}",
"function dc_filter_hello_ads($ad) {\n date_default_timezone_set('America/New_York');\n\n if ( !empty( $ad['custom']['dc_start_date'][0] ) or !empty( $ad['custom']['dc_end_date'][0] ) ) {\n // If start and end dates are set, deal with that first\n $today_date = date('d');\n // If no value given, set out of range to ensure it all goes\n $start_date = empty( $ad['custom']['dc_start_date'][0] ) ? 0 : $ad['custom']['dc_start_date'][0];\n $end_date = empty( $ad['custom']['dc_end_date'][0] ) ? 32 : $ad['custom']['dc_end_date'][0];\n\n // Case for start date < end date (dates in same month)\n if ($start_date < $end_date) {\n $is_date_valid = ($start_date <= $today_date) && ($end_date >= $today_date);\n //$is_date_valid = false;\n }\n // Case for end date < start date (dates in different months)\n elseif ($end_date < $start_date) {\n $is_date_valid = (($start_date >= $today_date) && ($end_date >= $today_date)) || (($start_date <= $today_date) && ($end_date <= $today_date));\n }\n }\n else {\n $is_date_valid = true;\n }\n\n // Check if ad should be displayed today\n $is_day_valid = $ad['custom']['dc_' . strtolower(date('l'))][0] == '1' ? true : false;\n\n // Return if we're within valid date range for ad, and on a day of the week that's valid for it\n return $is_date_valid && $is_day_valid;\n}",
"function venture_deal_validate_country($element) {\n global $form_values;\n if ($form_values['field_deal_country']['key'] == 'United States') {\n if ($profile = venture_profile_retrieve(arg(1))) {\n if (!venture_profile_is_accredited($profile)) {\n form_set_error('field_deal_country', 'Country field is invalid. United States deals may not be submitted to a non-accredited investor.');\n }\n }\n }\n}",
"protected function displayRestrictedCountryPage()\n {\n return;\n }",
"function europe() {\n return $this->sendData(Country::get()->filter([])); // define some filters for european countries ;)\n }",
"function process_bid_selection_due() {\n global $wpdb;\n //get all orders awaiting customer selection\n $bids_await_selection_order_query = \"SELECT * FROM orders WHERE order_phase = 'Bids Received - Awaiting Customer Decision'\";\n $bids_await_selection = $wpdb->get_results($completed_quotes_order_query, ARRAY_A);\n foreach($bids_await_selection as $openo) { //loop through and find any order where the selection period has expired\n if($openo['atp_due'] < date(\"Y-m-d\")) {\n $curr_oid = $openo['oid'];\n cancel_order($curr_oid); //cancel order because selection window has expired\n }\n }\n}",
"function edd_cjs_edd_puchase( $purchase_form, $args ) {\t\n\n \t$sellable_access = get_post_meta( get_the_ID(), 'sellable_access', true );\n \tif($sellable_access == 'View Only'){\n \t\t?>\n \t\t<style type=\"text/css\">\n \t\t.cart-box{\n \t\t\tdisplay: none;\n \t\t}\n \t</style>\n \t<?php\n \treturn false;\n\t } else {\n\t \treturn $purchase_form;\n\t }\t\n\t}",
"function eaf_ea_filter($connections, $eafget=array()) {\t\r\n\t\r\n\t\t//set $_GET when select is determined by option count\r\n\t\tif(isset($eafget['eafworker'])) $_GET['eafworker'] = $eafget['fworker'];\r\n\t\tif(isset($eafget['eaflocation'])) $_GET['eaflocation'] = $eafget['location'];\r\n\t\tif(isset($eafget['eafservice'])) $_GET['eafservice'] = $eafget['service'];\r\n\t\t\r\n\t\t//Select only connections with the selected worker and the selected location and the selected service\r\n\t\t\r\n\t\t//No option selected\r\n\t\tif (empty($_GET['eafworker']) && empty($_GET['eaflocation']) && empty($_GET['eafservice'])) $connections = array_filter($connections, function($connection) {return true;});\r\n\r\n\t\t//One option selected\r\n\t\telseif (empty($_GET['eaflocation']) && empty($_GET['eafworker'])) $connections = array_filter($connections, function($connection) {return $connection->service == $_GET['eafservice'];});\r\n\t\telseif (empty($_GET['eafworker']) && empty($_GET['eafservice'])) $connections = array_filter($connections, function($connection) {return $connection->location == $_GET['eaflocation'];});\r\n\t\telseif (empty($_GET['eafservice']) && empty($_GET['eaflocation'])) $connections = array_filter($connections, function($connection) {return $connection->worker == $_GET['eafworker'];});\t\r\n\t\t\r\n\t\t//Two options selected\r\n\t\telseif (empty($_GET['eaflocation'])) $connections = array_filter($connections, function($connection) {\r\n\t\t\treturn ($connection->service == $_GET['eafservice'] && $connection->worker == $_GET['eafworker']);\r\n\t\t\t});\r\n\t\telseif (empty($_GET['eafworker'])) $connections = array_filter($connections, function($connection) {\r\n\t\t\treturn ($connection->location == $_GET['eaflocation'] && $connection->service == $_GET['eafservice']);\r\n\t\t});\r\n\t\telseif (empty($_GET['eafservice'])) $connections = array_filter($connections, function($connection) {\r\n\t\t\treturn ($connection->worker == $_GET['eafworker'] && $connection->location == $_GET['eaflocation']);\r\n\t\t});\r\n\t\t\r\n\t\t//Three options selected\r\n\t\telse $connections = array_filter($connections, function($connection) {\r\n\t\t\treturn (\r\n\t\t\t\t($connection->location == $_GET['eaflocation'] && $connection->worker == $_GET['eafworker']) \r\n\t\t\t\t|| ($connection->service == $_GET['eafservice'] && $connection->worker == $_GET['eafworker'])\r\n\t\t\t\t|| ($connection->service == $_GET['eafservice'] && $connection->location == $_GET['eaflocation'])\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\t//Determine which workers, locations and services are present in the selected connections\t\t\t\r\n\t\t$worker_ids = array();\r\n\t\t$location_ids = array();\r\n\t\t$service_ids = array();\r\n\t\tforeach ($connections as $connection) {\r\n\t\t\tif(!in_array($connection->worker, $worker_ids)) $worker_ids[] = $connection->worker;\r\n\t\t\tif(!in_array($connection->location, $location_ids)) $location_ids[] = $connection->location;\r\n\t\t\tif(!in_array($connection->service, $service_ids)) $service_ids[] = $connection->service;\r\n\t\t}\r\n\r\n\t\t$filter_results = array(\r\n\t\t\t'worker_ids'\t=> $worker_ids,\r\n\t\t\t'location_ids'\t=> $location_ids,\r\n\t\t\t'service_ids'\t=> $service_ids,\r\n\t\t);\r\n\treturn $filter_results;\r\n}",
"public function filterCountries($query, $selected_countries);",
"protected function displayRestrictedCountryPage() {\n\t}",
"function Page_Selecting(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function Page_Selecting(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"public function removeCountriesFromDropdown(){\r\n\t\tif(Mage::getSingleton('ordergroove/session')->hasAutoshipItems() && Mage::getStoreConfig(self::CONFIG_KEY_FUNC_CHECK_REMOVE_COUNTRIES)){\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}",
"function fill_counties_combo_advert( $form_name, $county_id )\n\t{ \n\n\t\t$q = 'SELECT * FROM zone where country_id = \"222\" order by name asc';\n\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\t$combo = '<select class=\"validate[required] txtfield1\" name=\"state\" id=\"state\" >\n\t\t\t\t\t<option value=\"\">---Select County---</option>';\n\t\tif( $r != false )\n\t\t{\n\t\t\tfor( $i = 0; $i < count( $r ); $i++ )\n\t\t\t{\n\t\t\t\t$selected = $county_id == $r[$i]['zone_id'] ? \"selected\" : \"\";\n\t\t\t\t$combo .= '<option '.$selected.' value=\"'.$r[$i]['zone_id'].'\">'.$r[$i]['name'].' </option>';\n\t\t }\t//\tEnd of for Looooooop\n\t\t \n\t\t \n\t\t}\t//\tEnd of if( $r != false )\n\t\t$combo .= '</select>';\n\t\t\n\t\treturn $combo;\n\t}",
"function ads_unfilter() {\r\n global $psts;\r\n \r\n\t\tif (function_exists('psts_hide_ads') && $psts->get_setting('ads_unfilter') && psts_hide_ads())\r\n\t return true;\r\n\t else\r\n\t return false;\r\n\t}",
"function eaf_ea_filter_options () {\r\n\t\r\n\tglobal $wpdb;\r\n\t\r\n\t\t$data = new EADBModels($wpdb, array(),array());\r\n\t\t\r\n\t\t$connects = $data->get_all_rows('ea_connections');\r\n\t\t$services = $data->get_all_rows('ea_services');\r\n\t\t$locations = $data->get_all_rows('ea_locations');\r\n\t\t$workers = $data->get_all_rows('ea_staff');\r\n\t\t$eafget = array();\r\n\t\t\r\n\t\t$filter_results = eaf_ea_filter($connects);\r\n\t\t$worker_ids = $filter_results['worker_ids'];\r\n\t\t$location_ids = $filter_results['location_ids'];\r\n\t\t$service_ids = $filter_results['service_ids'];\r\n\t\t\r\n\t\tif(empty($_GET['eafworker']) && count($worker_ids) == 1) $eafget['worker'] = $worker_ids[0];\r\n\t\tif(empty($_GET['eaflocation']) && count($location_ids) == 1) $eafget['location'] = $location_ids[0];\t\r\n\t\tif(empty($_GET['eafservice']) && count($service_ids) == 1) $eafget['service'] = $service_ids[0];\r\n\t\tif (!empty($eafget)) {\r\n\t\t\t$filter_results = eaf_ea_filter($connects, $eafget);\r\n\t\t\t$worker_ids = $filter_results['worker_ids'];\r\n\t\t\t$location_ids = $filter_results['location_ids'];\r\n\t\t\t$service_ids = $filter_results['service_ids'];\r\n\t\t}\r\n\t\t\r\n\t\t//Remove workers not present in the selected connections from the array with all workers\r\n\t\tforeach ($workers as $key => $worker) {\r\n\t\t\tif(!in_array($worker->id, $worker_ids)) unset($workers[$key]);\r\n\t\t}\r\n\t\t\r\n\t\t//Remove locations not present in the selected connections from the array with all locations\r\n\t\tforeach ($locations as $key => $location) {\r\n\t\t\tif(!in_array($location->id, $location_ids)) unset($locations[$key]);\r\n\t\t}\r\n\t\t\r\n\t\t//Remove services not present in the selected connections from the array with all services\r\n\t\tforeach ($services as $key => $service) {\r\n\t\t\tif(!in_array($service->id, $service_ids)) unset($services[$key]);\r\n\t\t}\r\n\t\r\n\t\t$eaf_ea_filter_options = array(\r\n\t\t\t'workers'\t\t=> $workers,\r\n\t\t\t'locations'\t\t=> $locations,\r\n\t\t\t'services'\t\t=> $services,\r\n\t\t);\r\n\treturn \t$eaf_ea_filter_options;\r\n}",
"public function filter() {\n $ads = Ad::filter_with_params($this->params);\n $this->set_game_and_acccessory_ads($ads);\n $this->render('ads/index');\n }",
"public function no_items() {\n\t\t_e( 'No customers avaliable.', 'sp' );\n\t}",
"function filter_vouchers($status,$payee_type,$payee,$from,$to){\n $query = \"SELECT * FROM vouchers WHERE (status = '$status' AND payee_type = '$payee_type' AND payee LIKE '%$payee%' AND date_released >= '$from' AND date_released <= '$to') AND (status = 'for_claim/for_or' AND warrant_num != '') ORDER BY v_num DESC;\";\n\n $result = mysqli_query($this->con,$query);\n\n if($result) return $result;\n else return FALSE;\n exit;\n }",
"public function filter_dropdown()\n {\n }",
"public function filter_dropdown()\n {\n }",
"public function searchOffice() {\n \tcheck_ajax_referer( 'wrapido-nonce','nonce' ); \n \t$results = '';\n \t\n \t$city = intval( $_GET['city'] );\n \t$selected = sanitize_text_field( $_GET['selected'] );\n \tif ($city) {\n\t \t$rapido = Wrapido_Rapido::get_instance();\n\t \t$rapido->setUpSoapFromDB();\n\t \t$offices = $rapido->getOffices($city);\n\t \tif ($offices) {\n\t \t\tforeach ($offices as $office) {\n\t \t\t\t$results .= '<option value=\"'.$office['DATA'].'\" '.selected($selected,$office['DATA'],false).'>'.$office['LABEL'].'</option>';\n\t \t\t}\n\t \t} else {\n\t \t\t$results .= '<option value=\"0\">'.__('None found...','wrapido').'</option>';\n\t \t}\n \t}\n \techo json_encode( $results );\n \tdie(); \n }",
"public function search_by_date( ) {\r\n\r\n $this->duration_range_select = array(\r\n\r\n 'this_month' => __( 'This Month' , 'woocommerce-ac' ),\r\n 'last_month' => __( 'Last Month' , 'woocommerce-ac' ),\r\n 'this_quarter' => __( 'This Quarter' , 'woocommerce-ac' ),\r\n 'last_quarter' => __( 'Last Quarter' , 'woocommerce-ac' ),\r\n 'this_year' => __( 'This Year' , 'woocommerce-ac' ),\r\n 'last_year' => __( 'Last Year' , 'woocommerce-ac' ),\r\n 'other' => __( 'Custom' , 'woocommerce-ac' ),\r\n );\r\n if ( isset( $_GET['duration_select'] ) ) {\r\n $duration_range = $_GET['duration_select'];\r\n }else{\r\n $duration_range = \"this_month\";\r\n }\r\n ?>\r\n <div class = \"main_start_end_date\" id = \"main_start_end_date\" >\r\n <div class = \"filter_date_drop_down\" id = \"filter_date_drop_down\" >\r\n <label class=\"date_time_filter_label\" for=\"date_time_filter_label\" >\r\n <strong>\r\n <?php _e( \"Select date range:\", \"woocommerce-ac\"); ?>\r\n </strong>\r\n </label>\r\n\r\n <select id=duration_select name=\"duration_select\" >\r\n <?php\r\n foreach ( $this->duration_range_select as $key => $value ) {\r\n $sel = \"\";\r\n if ( $key == $duration_range ) {\r\n $sel = __( \"selected \", \"woocommerce-ac\" );\r\n }\r\n echo\"<option value='\" . $key . \"' $sel> \" . __( $value,'woocommerce-ac' ) . \" </option>\";\r\n }\r\n ?>\r\n </select>\r\n <?php\r\n\r\n $start_date_range = \"\";\r\n if ( isset( $_GET['wcap_start_date'] ) ) {\r\n $start_date_range = $_GET['wcap_start_date'];\r\n }\r\n\r\n $end_date_range = \"\";\r\n if ( isset( $_GET['wcap_end_date'] ) ){\r\n $end_date_range = $_GET['wcap_end_date'];\r\n }\r\n $start_end_date_div_show = 'block';\r\n if ( !isset($_GET['duration_select']) || $_GET['duration_select'] != 'other' ) {\r\n $start_end_date_div_show = 'none';\r\n }\r\n ?>\r\n\r\n <div class = \"wcap_start_end_date_div\" id = \"wcap_start_end_date_div\" style=\"display: <?php echo $start_end_date_div_show; ?>;\" >\r\n <input type=\"text\" id=\"wcap_start_date\" name=\"wcap_start_date\" readonly=\"readonly\" value=\"<?php echo $start_date_range; ?>\" placeholder=\"yyyy-mm-dd\"/>\r\n <input type=\"text\" id=\"wcap_end_date\" name=\"wcap_end_date\" readonly=\"readonly\" value=\"<?php echo $end_date_range; ?>\" placeholder=\"yyyy-mm-dd\"/>\r\n </div>\r\n <div id=\"wcap_submit_button\" class=\"wcap_submit_button\">\r\n <?php submit_button( __( 'Go', 'woocommerce-ac' ), 'button', false, false, array('ID' => 'wcap-search-by-date-submit' ) ); ?>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <?php\r\n }",
"function CheckFilter() {\n\n\t// Check date popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_date\"], $GLOBALS[\"sel_date\"]))\n\t\treturn TRUE;\n\n\t// Check unit popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_unit\"], $GLOBALS[\"sel_unit\"]))\n\t\treturn TRUE;\n\n\t// Check fromtype popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_fromtype\"], $GLOBALS[\"sel_fromtype\"]))\n\t\treturn TRUE;\n\n\t// Check category popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_category\"], $GLOBALS[\"sel_category\"]))\n\t\treturn TRUE;\n\n\t// Check tocode popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_tocode\"], $GLOBALS[\"sel_tocode\"]))\n\t\treturn TRUE;\n\n\t// Check todescription popup filter\n\tif (!ewrpt_MatchedArray($GLOBALS[\"seld_todescription\"], $GLOBALS[\"sel_todescription\"]))\n\t\treturn TRUE;\n\treturn FALSE;\n}",
"function validoutdoor($outdoor)\n{\n global $f3;\n return in_array($outdoor, $f3->get('outdoors'));\n}",
"function validOutdoor($outdoor){\n\n $outdoors = getOutdoor();\n foreach($outdoor as $outd){\n if(!in_array($outd,$outdoors)){\n return false;\n }\n }\n return true;\n\n}",
"function show_completely_presented_status_options($actual_status_name) {\n // that the seller can update purchased items to.\n // 1, 3, 4, 5, 8.\n \n //\n $query = \"SELECT * FROM InvoiceItemStatus\";\n// $query .= \"WHERE id IN (1, 3, 4, 5, 8)\";\n \n $record_results = InvoiceItem::read_by_query($query);\n \n \n global $database;\n while ($row = $database->fetch_array($record_results)) {\n echo \"<option value='{$row['id']}'\";\n \n if ($row['name'] == $actual_status_name) {\n echo \" selected\";\n }\n if ($row['id'] == 6) {\n echo \" disabled\";\n }\n \n echo \">{$row['name']}</option>\";\n }\n}",
"function Recordset_Selecting(&$filter) {\n\n\t\t// Enter your code here\t\n\t}",
"function Recordset_Selecting(&$filter) {\n\n\t\t// Enter your code here\t\n\t}"
] | [
"0.54661953",
"0.51792574",
"0.51366377",
"0.502061",
"0.4987997",
"0.49799132",
"0.49238777",
"0.48948243",
"0.48666623",
"0.4849122",
"0.4848027",
"0.4847184",
"0.4847184",
"0.48342785",
"0.48216182",
"0.4817219",
"0.48081392",
"0.480228",
"0.47896641",
"0.47807974",
"0.47680473",
"0.47680473",
"0.47485563",
"0.47085255",
"0.4699025",
"0.46975005",
"0.4675188",
"0.4655423",
"0.465236",
"0.465236"
] | 0.60947824 | 0 |
/ HashPerso Hash le mot de passe | function hashPerso($password) {
return sha1(md5($password));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getHashedPassword();",
"function passwordHash($pass) {\n\treturn sha1(\"soljenhash\".$pass.\"zbogomhackerji\".strrev($pass));\n}",
"private static function hashPassword($pass){\n return md5($pass.Config::PASS_SALT);\n }",
"public function encPass ()\n {\n\n $this->data['password'] = md5( $this->data['password'] );\n\n }",
"public function hashpassword() {\n\t\treturn md5($this->pass);\n\t}",
"function hash($login, $pass)\r\n\t{\r\n\t\t//return $s;\r\n\t\treturn strval($pass);\r\n\t}",
"function hash_password()\n{\n\t$this->password_hash = crypt($this->password_hash);\t\t\n}",
"public function hashPassword(){\r\n $this->password = password_hash($this->password, PASSWORD_DEFAULT);\r\n }",
"function getPassword($password,$hash){\n $password=base64_encode($password);\n return md5(md5(md5($password.$hash)));\n }",
"public function hashPassword($p) {\n return password_hash($p, PASSWORD_DEFAULT);\n }",
"public function hash_password($pass)\n\t{\n\t\treturn base64_encode(sha1($pass, true));\n\t}",
"function hashPassword($s){\r\n $hash = null;\r\n if($s != null){\r\n $hash = Security::hash($s, 'md5');\r\n }\r\n \r\n return $hash;\r\n }",
"function hashPassword() {\n\t\t$this->passwordHash = password_hash($this->password, PASSWORD_DEFAULT);\n\t\treturn $this->passwordHash;\n\t}",
"public function password() {\n\t\t$value = trim($this->args['0']);\n\t\t$this->out(Security::hash($value, null, true));\n\t}",
"function cryptPass($pass) {\n return md5(sha1($pass));\n }",
"function hash_pass( $password ){\n\treturn hash('md5', $password);\n}",
"public function getPasswordHash(): ?string;",
"public static function hashPass(string $pass) {\n return \\Drupal::service('password')->hash(trim($pass));\n }",
"function verifUsager($motPasse, $hash)\n{\n $res = false;\n\n if (crypt($motPasse, $hash) == $hash)\n {\n $res = true;\n }\n\t\t\n return $res;\n\t\t\n}",
"public function hashPass($pass) {\n return base64_encode(password_hash(hash(\"SHA512\", $pass, true), PASSWORD_BCRYPT));\n }",
"function hashCrypt ($chaine)\n{\n\tglobal $options;\n\treturn password_hash($chaine, PASSWORD_BCRYPT, $options);\n}",
"function getPassword()\n\t {\n\t \treturn $this->_hashword;\n\t }",
"public function getPassword();",
"public function getPassword();",
"public function getPassword();",
"public function getPassword();",
"public function getPassword();",
"function pwHash($pw) {\r\n\t\t$salt = \"ds1f5:;ùezff16\";\r\n\t\treturn sha1($pw . $salt);\r\n\t}",
"public function password();",
"public function password();"
] | [
"0.7200304",
"0.6819491",
"0.6791205",
"0.67837685",
"0.67195684",
"0.6685776",
"0.6637627",
"0.662442",
"0.65820843",
"0.6561272",
"0.6552168",
"0.6513804",
"0.65119755",
"0.64968526",
"0.6455359",
"0.64430004",
"0.64356965",
"0.638319",
"0.63643306",
"0.6357868",
"0.6347101",
"0.6342983",
"0.6337205",
"0.6337205",
"0.6337205",
"0.6337205",
"0.6337205",
"0.6335838",
"0.63211226",
"0.63211226"
] | 0.71336675 | 1 |
this function load banner view | public function banner(){
if($this->session->userdata('adminlogin')){
$data=array(
'main_view' => 'admin/banner_view',
'bannerlist' => $this->admin_model->viewallbanner()
);
$this->load->view('layout/admin_layout',$data);
}
else{
redirect('admin');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function banner(){\n\t\t if(!$this->session->userdata('id')){\n\t redirect(\"admin\");\n\t }else{\n\t\t$data['banners'] = $this->user->get_banners(0); \n\t\t\n\n\t\t$data['page'] ='region';\n\t $data['title'] ='Manage Region';\n\t\t$this->load->view('admin/include/header',$data);\n\t\t$this->load->view('admin/include/inner_header',$data);\n\t\t$this->load->view('admin/banner_view');\n\t\t$this->load->view('admin/include/footer'); \n\t }\n\t\t \n\t }",
"public function new_banner()\n {\n \n $this->load->view('admin/header'); \n $this->load->view('admin/new_banner');\n $this->load->view('admin/footer');\n \n }",
"protected function loadView()\n {\n }",
"protected function loadView()\n {\n }",
"function createBanner()\r\n {\r\n \r\n }",
"public function show(Banner $banner)\n {\n\n }",
"public function addBasicView()\n {\n require_once 'view/header.php';\n require_once 'view/banner.php';\n require_once 'view/navbar.php';\n }",
"public function mainBanner() {\n $bannerImages = VendorImage::where('type', VendorImageType::$MAIN_BANNER)\n ->orderBy('sort')\n ->get();\n\n return view('admin.dashboard.marketing_tools.main_banner.index', compact('bannerImages'))->with('page_title', 'Main Banner');\n }",
"public function show(Banner $banner)\n {\n //\n }",
"public function show(Banner $banner)\n {\n //\n }",
"function gallery_loader(){\n\t\t$this->load->view('christie_lee/current/gallery');\n\t\t\n\t}",
"public function show($id = NULL) {\n\t\tif ($id){\n\t\t\t$banner = $this->model('Banner');\n\t\t\t$this->view('home/banner/banner', $banner->getBannerById($id));\n\t\t} else {\n\t\t\t$this->view('home/error', 'Missing argument for method show()');\n\t\t}\n\t}",
"public function run()\n {\n $banners = HomeBanner::where('status','1')->get();\n /* dd($banners); */\n return view('widgets.banner_home', [\n 'config' => $this->config,\n ])->withBanners($banners);\n }",
"public function view()\n {\n return view('backoffice.banners.index');\n }",
"public function showAll() {\n\t\t$banner = $this->model('Banner');\n\t\t$this->view('home/banner/banners', $banner->getAllBanners());\n\t}",
"public function index()\n {\n return view('support::banner.index');\n }",
"function loadView($target, array $data)\n {\n include \"../resource/layouts/backend/header.php\";\n include \"../resource/views/$target.php\";\n include \"../resource/layouts/backend/footer.php\";\n }",
"protected function loadView()\n{\n}",
"public function FillBanner()\n {\n if ( isset( $this->uri_segment[2] ) )\n {\n $local = $this->uri_segment[2];\n }\n $per_page = 5;\n //paginacao\n if ( isset( $this->uri_segment[3] ) )\n {\n $per_page = $this->uri_segment[3];\n }\n //fillBanner\n $this->select()\n ->from( 'slide' )\n ->where( \"slide_local = $local\" )\n ->orderby( 'slide_id desc' )\n ->paginate( $per_page )\n ->execute();\n if ( $this->result() )\n {\n $this->encode( null, 'utf8_encode' );\n shuffle( $this->data );\n $this->clonekey( 'slide_foto', array( 'slide_url' ) );\n $this->preg( array( '/\\.jpg/', '/\\.png/' ), array( '', '' ), 'slide_url' );\n echo json_encode( $this->data );\n }\n }",
"public function index()\n {\n $banner = Banner::orderby('created_at','desc')->get();\n return view('backend.banner.index', compact('banner'));\n }",
"public function index()\n {\n \n $list = Banner::get();//获取数据库的数据\n return view('admin.banner.index')->with('list',$list);//渲染banner列表页面\n }",
"public function index()\n {\n save_resource_url();\n\n return $this->view('titan::banners.index')->with('items', Banner::all());\n }",
"public function index() {\n try {\n // $data[\"page_title\"] = \"Welcome to MPEDA\";\n // $data[\"banners\"] = $this->Banners_model->list_data(\"core_banners\", \"id,name,banner_image\", array(\"deleted_by\" => 0), \"id ASC\", TRUE);\n\n #include page level js\n #Set page layout\n $this->middle = \"dashboard\";\n // $this->data = $data;\n $this->layout();\n } catch (Exception $e) {\n log_message(\"Error\", $e->getMessage());\n }\n }",
"public static function show(): void\n {\n\n $banners = \\Hoday\\Banners\\BannerService::getInstance()->getAll();\n $formatString = self::FORMAT_STRING;\n ob_start();\n include 'templates/banners_template.php';\n echo ob_get_clean();\n }",
"static function loadView(){\n\t\t$channel = self::$config->route->channel;\n\t\t$type = self::$config->route->type;\n\t\t$datatype = self::$config->route->datatype;\n\t\t$wobject = self::$config->widgets->$channel->$type;\n\t\t$title = self::$config->options->$channel->$type->title;\n\t\t\n\t\tself::$channel = $channel;\n\t\tself::$type = $type;\n\t\tself::$datatype = $datatype;\n\t\n\t\tif($datatype == 'content'){\n\t\t\trequire_once 'controllers/ContentController.php';\n\t\t} \n\t\tif($datatype == 'subject'){\n\t\t\trequire_once 'controllers/SubjectController.php';\n\t\t} \n\t\t//unset($config);\n\t}",
"public function index() {\n return view('admin.banner.index');\n }",
"public function hookDisplayBanner()\n {\n }",
"public function index()\n {\n $data['list_banner'] = banner::all();\n return view('admin.pages.list_banner', $data);\n }",
"public function view_slider(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin');\n\t\t}else {\n\t\t\t$this->data['heading'] = 'View Banner';\n\t\t\t$user_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $user_id);\n\t\t\t$this->data['slider_details'] = $this->slider_model->get_all_details(SLIDER,$condition);\n\t\t\tif ($this->data['slider_details']->num_rows() == 1){\n\t\t\t\t$this->load->view('admin/slider/view_slider',$this->data);\n\t\t\t}else {\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\t}",
"public function render()\n {\n return view('components.banneradvertisement');\n }"
] | [
"0.75659305",
"0.7242153",
"0.70624804",
"0.70624804",
"0.6757008",
"0.66558903",
"0.6633168",
"0.6569604",
"0.65244985",
"0.65244985",
"0.6509107",
"0.64959455",
"0.6482212",
"0.6453232",
"0.64120007",
"0.63776714",
"0.6348469",
"0.63263845",
"0.6324797",
"0.6311824",
"0.6293088",
"0.6286243",
"0.62610674",
"0.6260678",
"0.6257238",
"0.62531346",
"0.62485564",
"0.62200373",
"0.62175876",
"0.62123036"
] | 0.7454001 | 1 |
This Function Order Ready To Ship By Order ID | public function readytoship($id){
$orderId=$this->security->xss_clean($id);
$this->admin_model->Readytoship($id);
echo "<script>alert('Order Move To Ready To Ship');</script>";
echo "<script>window.open('".base_url()."admin/order/Confirmed','_self');</script>";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function shipping_confirmation($id){\n $query = 'SELECT `value` FROM `nodes_config` WHERE `name` = \"name\"';\n $r = engine::mysql($query);\n $d = mysqli_fetch_array($r);\n $site_name = $d[\"value\"];\n $query = 'SELECT * FROM `nodes_product_order` WHERE `id` = \"'.intval($id).'\"';\n $res = engine::mysql($query);\n $product_order = mysqli_fetch_array($res);\n $query = 'SELECT * FROM `nodes_order` WHERE `id` = \"'.$product_order[\"order_id\"].'\"';\n $res = engine::mysql($query);\n $order = mysqli_fetch_array($res);\n $query = 'SELECT * FROM `nodes_product` WHERE `id` = \"'.$product_order[\"product_id\"].'\"';\n $res = engine::mysql($query);\n $product = mysqli_fetch_array($res);\n $query = 'SELECT * FROM `nodes_user` WHERE `id` = \"'.$order[\"user_id\"].'\"';\n $res = engine::mysql($query);\n $user = mysqli_fetch_array($res);\n $caption = lang(\"Your order has been shipped at\").' '.$_SERVER[\"HTTP_HOST\"];\n $body = lang(\"Dear\").' '.$user[\"name\"].'!<br/><br/>\n '.lang(\"Your order\").' \"'.$product[\"title\"].'\" '.lang(\"has been shipped\").'.<br/>\n '.lang(\"After receiving, please update purchase status\").' <a target=\"_blank\" href=\"'.$_SERVER[\"PROTOCOL\"].'://'.$_SERVER[\"HTTP_HOST\"].'/account/purchases\">'.lang(\"here\").'</a>.';\n engine::send_mail($user[\"email\"], $site_name.\"<no-reply@\".$_SERVER[\"HTTP_HOST\"].'>', $caption, email::email_template($body));\n $query = 'INSERT INTO `nodes_inbox`(`from`, `to`, `text`, `date`, `system`) '\n . 'VALUES(\"'.$_SESSION[\"user\"][\"id\"].'\", \"'.$user[\"id\"].'\", \"Order has been shipped\", \"'.date(\"U\").'\", \"1\")';\n engine::mysql($query);\n}",
"function ship_order ()\n {\n $this->load->helper('fedex');\n $this->orderid = $this->uri->segment(3);\n $this->userid = $this->uri->segment(4);\n $this->gen_contents['shipdetails'] = $this->admin_user_model->select_single_order_details($this->orderid);\n\n $shipdetails = $this->admin_user_model->select_single_order_details($this->orderid);\n\n\n /*$aryOrder = array(\n 'TotalPackages' => 1,\n 'PackageType' => 'YOUR_PACKAGING', //FEDEX_10KG_BOX, FEDEX_25KG_BOX, FEDEX_BOX, FEDEX_ENVELOPE, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING\n 'ServiceType' => 'FEDEX_GROUND',\n 'TermsOfSaleType' => \"DDU\", # DDU/DDP\n 'DropoffType' => 'REGULAR_PICKUP' // BUSINESS_SERVICE_CENTER, DROP_BOX, REGULAR_PICKUP, REQUEST_COURIER, STATION\n );*/\n\n $aryOrder = get_fedex_order_array($this->admin_user_model->get_course_ordered_book_count($this->orderid));\n $aryRecipient = array(\n 'Contact' => array(\n 'PersonName' => $shipdetails['firstname'] . \" \" . $shipdetails['lastname'],\n //'CompanyName' => 'Company Name',\n 'PhoneNumber' => $shipdetails['phone']\n ),\n 'Address' => array(\n 'StreetLines' => $shipdetails['s_address'].\", \".$shipdetails['unit_number'],\n 'City' => $shipdetails['s_city'],\n 'StateOrProvinceCode' => $shipdetails['s_state'],\n 'PostalCode' => $shipdetails['s_zipcode'],\n 'CountryCode' => $shipdetails['s_country'],\n 'Residential' => false)\n );\n\n $courseDetails = $this->admin_user_model->get_course_details($this->orderid);\n $course_weight = $courseDetails['course_weight'];\n $course_amount = $courseDetails['course_amount'];\n $arrCourseDetails = $courseDetails['arrCourseDetails'];\n\n $package_weight = $courseDetails['course_weight'];\n $est_amount = $courseDetails['course_amount'];\n $arrCourseDetails = $courseDetails['arrCourseDetails'];\n\n $order_id = $this->orderid;\n\n $packetDescription = \"FEDEX Package for order \" . $order_id;\n $packageDetails = array(\n 0 => array(\n 'weight' => $package_weight,\n 'ItemDescription' => $packetDescription\n )\n );\n $packageDetails[0] = array_merge($packageDetails[0], get_fedex_packaging_dimension($aryOrder['PackageType']));\n //echo '<pre>';print_r($packageDetails);exit;\n $cnt = 0;\n foreach ($arrCourseDetails as $courseDetails)\n {\n $aryPackageItems[$cnt]['item_qty'] = 1;\n $aryPackageItems[$cnt]['item_price'] = $courseDetails['amount'];\n $aryPackageItems[$cnt]['item_name'] = $courseDetails['course_name'];\n $aryPackageItems[$cnt]['item_weight'] = $courseDetails['wieght'];\n\n $cnt++;\n }\n\n $realPackages = array(\n 0 => array(\n 'packageDetails' => $packageDetails,\n 'aryPackageItems' => $aryPackageItems,\n 'package_amount' => $est_amount\n )\n );\n\n\n $ship = setShipment($aryOrder, $aryRecipient, $realPackages, $course_amount, $course_weight);\n\n //$this->gen_contents['admindetails'] = $this->admin_user_model->get_admin_details();\n //$course_weight=$this->admin_user_model->get_courseweight($this->orderid);\n //$ship = $this->admin_user_model->shiporder($this->gen_contents['shipdetails'],$course_weight,$this->gen_contents['admindetails']);\n\n if ($ship != 'error')\n {\n $this->admin_user_model->update_orderdetails($this->orderid, $ship['trackingno'], $ship['label']);\n $this->gen_contents[\"userdetails\"] = $this->admin_user_model->select_single_userdetails($this->userid);\n $this->gen_contents['orderdetails'] = $this->admin_user_model->select_single_order_details($this->orderid);\n //$this->admin_user_model->mail_touser($this->gen_contents[\"userdetails\"], $this->gen_contents['orderdetails']);\n $this->_mail_touser($this->gen_contents[\"userdetails\"], $this->gen_contents['orderdetails']);\n $this->session->set_flashdata('success', 'Order shipped successfully');\n redirect('admin_user/view_order_details/' . $this->gen_contents['shipdetails']['id']);\n }\n else\n {\n\n $this->session->set_flashdata('error', 'Request Failed');\n redirect('admin_user/view_order_details/' . $this->gen_contents['shipdetails']['id']);\n }\n }",
"function wosw_order_status_complete($order_id){\n \n\n\n // instance order id \n $this->order_id = $order_id;\n\n // Get an instance of the WC_Order Object from the Order ID (if required)\n \t \t $order = wc_get_order( $order_id );\n\n // check if wassalNow shipping created for this order\n \t\t if($this->have_shipment_wassalNow($order))\n return;\n \t \n // if shipping method is wasslnow\n if('wasslnow' == $this->get_shipping_method_id() ):\n\n // create order shipment in WassalNow by using Api \n $status_Create_order = $this->Create_a_New_Shipment($this->get_customer_shipping_info());\n //$status_Create_order = $this->Create_a_New_Shipment($this->get_customer_shipping_info());\n \n // update order with trackNo and shipmentID\n update_option('wassalnow_test', $status_Create_order['trackingNumber'] );\n add_post_meta( $order_id,'_wassalNow_Track_order',$status_Create_order);\n\n endif;\n\n }",
"public function actionOrderToggleShipped() {\n\n\t\t$id = $this->getvars['id'];\n\t\t$order = $this->Order->findById($id);\n\n\t\tif (!empty($order)) {\n\t\t\tif ($order['order_shipping_status'] == 'shipped') {\n\t\t\t\t$order['order_shipping_status'] = 'open';\n\t\t\t\t$order['order_shipping_date'] = '';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$order['order_shipping_status'] = 'shipped';\n\t\t\t\t$order['order_shipping_date'] = strftime('%F %T');\n\t\t\t}\n\t\t\t$this->Order->save($order);\n\t\t}\n\n\t\t$this->changeAction('default');\n\t}",
"public function performShippifyTaskCreation($id_shippify_order)\n {\n // Get configurations\n $api_token = Configuration::get('SHPY_API_TOKEN', '');\n $id_warehouse = Configuration::get('SHPY_WAREHOUSE_ID', '');\n $sender_support_email = Configuration::get('SHPY_SUPPORT_EMAIL', '');\n $sender_support_phone = Configuration::get('SHPY_SUPPORT_PHONE', '');\n $compact_products = Configuration::get('SHPY_COMPACT_PRODUCTS', '');\n $anonimize_products = Configuration::get('SHPY_ANONIMIZE_PRODUCTS', '');\n // If one of them is empty, dont do nothing\n if (empty($api_token)) return FALSE;\n if (empty($id_warehouse)) return FALSE;\n if (empty($sender_support_email)) return FALSE;\n\n // Get the order info from the database\n $order_sql = 'SELECT *, ords.id_order AS id, ords.reference AS ref, shps.status AS shippify_order_status, ords.total_paid, CONCAT(cuts.firstname, \\' \\', cuts.lastname) AS customer_name, cuts.email AS customer_email, adrs.phone AS customer_phone, adrs.phone_mobile AS customer_mobile, adrs.address1, adrs.address2, adrs.postcode, adrs.city, adrs.other FROM `' . _DB_PREFIX_ . 'shippify_order` shps INNER JOIN `' . _DB_PREFIX_ . 'orders` ords ON shps.id_order = ords.id_order INNER JOIN `' . _DB_PREFIX_ . 'customer` cuts ON ords.id_customer = cuts.id_customer INNER JOIN `' . _DB_PREFIX_ . 'address` adrs ON ords.id_address_delivery = adrs.id_address WHERE shps.id_shippify_order = ' . $id_shippify_order;\n $order = Db::getInstance()->getRow($order_sql);\n\n // If the order has already been shipped\n if ($order['shippify_order_status'] == 1) return TRUE;\n\n if ($anonimize_products === 'SI'){\n // Private Product Name Query\n $products_sql = 'SELECT dets.`product_id` AS id, dets.`product_id` AS name, dets.`product_quantity` AS qty, prds.height, prds.width, prds.depth, 3 as size FROM `' . _DB_PREFIX_ . 'shippify_order` shps INNER JOIN `' . _DB_PREFIX_ . 'order_detail` dets ON shps.id_order = dets.id_order INNER JOIN `' . _DB_PREFIX_ . 'product` prds ON dets.product_id = prds.id_product WHERE shps.`id_shippify_order` = ' . $id_shippify_order;\n } else {\n // Non Private Product Name Query\n $products_sql = 'SELECT dets.`product_id` AS id, dets.`product_name` AS name, dets.`product_quantity` AS qty, prds.height, prds.width, prds.depth, 3 as size FROM `' . _DB_PREFIX_ . 'shippify_order` shps INNER JOIN `' . _DB_PREFIX_ . 'order_detail` dets ON shps.id_order = dets.id_order INNER JOIN `' . _DB_PREFIX_ . 'product` prds ON dets.product_id = prds.id_product WHERE shps.`id_shippify_order` = ' . $id_shippify_order;\n }\n\n $products_array = Db::getInstance()->executeS($products_sql);\n\n if ($compact_products === 'SI'){\n $get_products_name = function($product){\n return $product[\"name\"];\n };\n $products_name_array = array_map($get_products_name, $products_array);\n $products_array = array (\n array(\n \"name\" => implode(\" | \", $products_name_array),\n \"qty\" => 1,\n \"size\" => 3\n )\n );\n }\n\n $address2 = $order['address1'] . ', ' . $order['address2'] . ', ' . $order['city'] . ', ' . $order['other'];\n $address = $order['address1'] . ', ' . $order['city']; \n \n if (isset($order['numero_house'])) {\n $address2 = $address2 . ' ' . $order['numero_house'];\n $address = $address . ' ' . $order['numero_house'];\n }\n\n if(isset($order['dpto_house'])) {\n $address2 = $address . ' ' . $order['dpto_house'];\n $address = $address . ' ' . $order['dpto_house'];\n }\n \n $address = $address . ', ' . $order['city']; \n\n // Prepare the request\n $post_data = array(\n 'deliveries' => array(\n array(\n 'pickup' => array(\n 'contact' => array(\n 'email' => $sender_support_email,\n 'phone' => $sender_support_phone\n ),\n 'location' => array(\n 'warehouse' => $id_warehouse\n )\n ),\n 'dropoff' => array(\n 'contact' => array(\n 'name' => $order['customer_name'],\n 'email' => $order['customer_email'],\n 'phonenumber' => (!empty($order['customer_phone']) ? $order['customer_phone'] : $order['customer_mobile']),\n ),\n 'location' => array(\n 'address' => $address,\n 'instructions' => $address2\n )\n ),\n 'packages' => $products_array,\n 'total_amount' => $order['total_paid'],\n 'referenceId' => $order['id'], \n 'tags' => array(\n 'PRESTASHOP'\n )\n )\n )\n );\n // Authentication\n $context = stream_context_create(array(\n 'http' => array(\n 'method' => 'POST',\n 'header' => \"Authorization: Basic {$api_token}\\r\\n\" .\n \"Content-Type: application/json\\r\\n\",\n 'content' => json_encode($post_data)\n )\n ));\n\n // Do the request\n $response = @file_get_contents('https://api.shippify.co/v1/deliveries', FALSE, $context);\n\n // If error, nothing happens\n if ($response === FALSE) return FALSE;\n $response_data = json_decode($response, TRUE);\n // Order has been created, status is set to 1\n $sql = 'UPDATE `' . _DB_PREFIX_ . 'shippify_order` SET `status` = 1, `task_id` = \\'' . $response_data['payload'][0]['id'] . '\\' WHERE `id_shippify_order` = ' . $id_shippify_order;\n // Update confirmed orders if SQL is successful\n if (Db::getInstance()->execute($sql)) {\n $this->confirmed_orders_by_id[$id_shippify_order] = $response_data['payload'][0]['id'];\n\n // Change order status to Shipped\n $objOrder = new Order((int)$order['id']);\n $history = new OrderHistory();\n $history->id_order = (int)$objOrder->id;\n $history->changeIdOrderState(4, (int)($objOrder->id));\n return TRUE;\n }\n return FALSE;\n }",
"function ordGetOrder( $orderID )\n{\n\n $q = db_query( \"select orderID, customerID, order_time, customer_ip, \".\n \" shipping_type, payment_type, customers_comment, \".\n \" statusID, shipping_cost, order_discount, order_amount, \".\n \" currency_code, currency_value, customer_firstname, customer_lastname, \".\n \" customer_email, shipping_firstname, shipping_lastname, \".\n \" shipping_country, shipping_state, shipping_city, \".\n \" shipping_address, billing_firstname, billing_lastname, billing_country, \".\n \" billing_state, billing_city, billing_address, \".\n \" cc_number, cc_holdername, cc_expires, cc_cvv, affiliateID, shippingServiceInfo, currency_round from \".ORDERS_TABLE.\" where orderID=\".(int)$orderID);\n $order = db_fetch_row($q);\n if ( $order )\n {\n /*_setHyphen( $order[\"shipping_firstname\"] );\n _setHyphen( $order[\"customer_lastname\"] );\n _setHyphen( $order[\"customer_email\"] );\n _setHyphen( $order[\"shipping_firstname\"] );\n _setHyphen( $order[\"shipping_lastname\"] );\n _setHyphen( $order[\"shipping_country\"] );\n _setHyphen( $order[\"shipping_state\"] );\n _setHyphen( $order[\"shipping_city\"] );\n _setHyphen( $order[\"shipping_address\"] );\n _setHyphen( $order[\"billing_firstname\"] );\n _setHyphen( $order[\"billing_lastname\"] );\n _setHyphen( $order[\"billing_country\"] );\n _setHyphen( $order[\"billing_state\"] );\n _setHyphen( $order[\"billing_city\"] );\n _setHyphen( $order[\"billing_address\"] );*/\n\n $order[\"shipping_address\"] = chop($order[\"shipping_address\"]);\n $order[\"billing_address\"] = chop($order[\"billing_address\"]);\n //CC data\n if (CONF_BACKEND_SAFEMODE)\n {\n $order[\"cc_number\"] = ADMIN_SAFEMODE_BLOCKED;\n $order[\"cc_holdername\"] = ADMIN_SAFEMODE_BLOCKED;\n $order[\"cc_expires\"] = ADMIN_SAFEMODE_BLOCKED;\n $order[\"cc_cvv\"] = ADMIN_SAFEMODE_BLOCKED;\n }\n else\n {\n if (strlen($order[\"cc_number\"])>0)\n $order[\"cc_number\"] = cryptCCNumberDeCrypt($order[\"cc_number\"],null);\n if (strlen($order[\"cc_holdername\"])>0)\n $order[\"cc_holdername\"] = cryptCCHoldernameDeCrypt($order[\"cc_holdername\"],null);\n if (strlen($order[\"cc_expires\"])>0)\n $order[\"cc_expires\"] = cryptCCExpiresDeCrypt($order[\"cc_expires\"],null);\n if (strlen($order[\"cc_cvv\"])>0)\n $order[\"cc_cvv\"] = cryptCCNumberDeCrypt($order[\"cc_cvv\"],null);\n }\n\n //additional reg fields\n $addregfields = GetRegFieldsValuesByOrderID( $orderID );\n $order[\"reg_fields_values\"] = $addregfields;\n\n\n $q_status_name = db_query( \"select status_name from \".ORDER_STATUES_TABLE.\" where statusID=\".(int)$order[\"statusID\"] );\n $status_name = db_fetch_row( $q_status_name );\n $status_name = $status_name[0];\n\n if ( $order[\"statusID\"] == ostGetCanceledStatusId() ) $status_name = STRING_CANCELED_ORDER_STATUS;\n\n // clear cost ( without shipping, discount, tax )\n $q1 = db_query( \"select Price, Quantity from \".ORDERED_CARTS_TABLE.\" where orderID=\".(int)$orderID);\n $clear_total_price = 0;\n while( $row=db_fetch_row($q1) ) $clear_total_price += $row[\"Price\"]*$row[\"Quantity\"];\n\n $currency_round = $order[\"currency_round\"];\n $order[\"clear_total_priceToShow\"] = _formatPrice(roundf($order[\"currency_value\"]*$clear_total_price),$currency_round).\" \".$order[\"currency_code\"];\n $order[\"order_discount_ToShow\"] = _formatPrice(roundf($order[\"currency_value\"]*$clear_total_price*((100-$order[\"order_discount\"])/100)),$currency_round).\" \".$order[\"currency_code\"];\n $order[\"shipping_costToShow\"] = _formatPrice(roundf($order[\"currency_value\"]*$order[\"shipping_cost\"]),$currency_round).\" \".$order[\"currency_code\"];\n $order[\"order_amountToShow\"] = _formatPrice(roundf($order[\"currency_value\"]*$order[\"order_amount\"]),$currency_round).\" \".$order[\"currency_code\"];\n\n $order[\"order_time_mysql\"] = $order[\"order_time\"];\n $order[\"order_time\"] = format_datetime( $order[\"order_time\"] );\n\n $order[\"status_name\"] = $status_name;\n }\n return $order;\n}",
"function add_ship_info_f($entry, $form) {\n global $wpdb, $SHIP_AND_INSPECT_DAYS;\n $current_vid = return_vid();\n $order_ship_carrier = $entry['1'];\n if ($order_ship_carrier == \"Other\") $order_ship_carrier = $entry['2'];\n $ship_date_mysql = date(\"Y-m-d H:i:s\");\n $inspect_due_mysql = no_holidays(date(\"Y-m-d\"), date(\"Y-m-d\",strtotime(\" + \". $SHIP_AND_INSPECT_DAYS . ' weekdays'))); //current time converted to unix format, quote duration added, converted back to mysql format\n $order_tracking = $entry['3'];\n $data = array(\n 'order_phase' => 'Order Shipped',\n 'order_ship_carrier' => $order_ship_carrier,\n 'order_ship_tracking' => $order_tracking,\n 'order_shipped_date' => $ship_date_mysql,\n 'inspect_due_date' => $inspect_due_mysql\n );\n $oid_filter = filter_input( INPUT_GET, \"oid\", FILTER_SANITIZE_STRING );\n $wpdb->update(\n 'orders',\n $data,\n array('oid' => \"$oid_filter\")\n );\n $wpdb->insert('logs', array('user_type' => 'vendor', 'log_type' => 'Order Shipped', 'log_entry' => \"Order $oid_filter Shipped\")); //log the event\n\n $order_row = $wpdb->get_row(\"SELECT * FROM orders WHERE oid = '$oid_filter'\", ARRAY_A);\n $cid = $order_row['cid'];\n $cust_row = $wpdb->get_row(\"SELECT * FROM cust_info WHERE cid = '$cid'\", ARRAY_A); //get all of the customer contact details\n\n $email1 = $cust_row['contact_email'];\n $email2 = $cust_row['alt_email'];\n $email_array = array($email1);\n if ($email2 != NULL) {\n $email_array[] = $email2;\n }\n $headers[] = 'From: Merafab Notify <[email protected]>';\n\n $msg = \"Your order $order_name (Order Number $oid_filter) has been shipped via $order_ship_carrier with tracking number $order_tracking\";\n wp_mail($email_array, \"Order Shipped!\", $msg, $headers);\n}",
"public function ship(Request $request, $orderId) {\n $order = Order::findOrFail($orderId);\n\n // Ship order...\n\n Mail::to($request->user())->send(new OrderShipped($order));\n }",
"public function view($id = null) {\n\t\t$orderClass = $this->_classes['order'];\n\t\t$processedOrderClass = $this->_classes['processedorder'];\n\n\t\t$userCollection = User::collection();\n\t\t$ordersCollection = $orderClass::Collection();\n\t\t$processedOrderColl = $processedOrderClass::Collection();\n\n\t\t// update the shipping address by adding the new one and pushing the old one.\n\t\tif ($this->request->data) {\n\t\t \t$datas = $this->request->data;\n\t\t}\n\t\tif (!empty($datas[\"uncancel_action\"])) {\n\t\t\t$current_user = Session::read('userLogin');\n\t\t\t#Uncancel Order\n\t\t\t$orderClass::uncancel(\n\t\t\t\t$datas[\"id\"],\n\t\t\t\t$current_user[\"email\"]\n\t\t\t);\n\t\t\t#Refresh Total\n\t\t\t$order_temp = $orderClass::find('first', array('conditions' => array('_id' => new MongoId($datas[\"id\"]))));\n\t\t\t\n\t\t\t$order_data = $order_temp->data();\n\t\t\t$order_data['id'] = $datas[\"id\"];\n\t\t\t$this->request->data = $order_data;\n\t\t\t$order_temp = $this->manage_items();\n\t\t\t\n\t\t\t$order_data = $order_temp->data();\n\t\t\t$order_data['id'] = $datas[\"id\"];\n\t\t\t$order_data['save'] = 'true';\n\t\t\t$this->request->data = $order_data;\n\t\t\t\n\t\t\t$order_temp = $this->manage_items();\n\t\t}\n\t\tif (!empty($datas[\"cancel_action\"])){\n\t\t\t$this->cancel();\n\t\t\t//If the order is canceled, send an email\n\t\t\t$order_temp = $orderClass::find('first', array('conditions' => array('_id' => new MongoId($datas[\"id\"]))));\n\t\t\tOrder::sendEmail($order_temp, 'Cancel_Order');\n\t\t}\n\t\tif(!empty($datas[\"process-as-an-exception\"])){\n\t\t\t$update = $ordersCollection->update(\n\t\t\t\t\tarray('_id' => new MongoId($id)),\n\t\t\t\t\tarray('$set' => array('process-as-an-exception' => true))\n\t\t\t);\n\t\t\tFlashMessage::write(\"This Order is on the queue as Dotcom Exception\", array('class' => 'pass'));\t\n\t\t}\n\t\tif (!empty($datas[\"save\"])){\t\n\t\t\t$order = $this->manage_items();\n\t\t} else {\n\t\t\t$order = null;\n\t\t}\n\t\tif ($id && empty($datas[\"save\"]) && empty($datas[\"cancel_action\"]) && !empty($datas[\"phone\"])) {\n\t\t\t$this->updateShipping($id);\n\t\t}\n\t\tif ($id && empty($datas[\"save\"]) && !empty($datas[\"capture_action\"])) {\n\t\t\t$this->capture($id);\n\t\t}\n\t\tif ($id && empty($datas[\"save\"]) && empty($datas[\"cancel_action\"]) && !empty($datas[\"billing\"])) {\n\t\t\t$this->updatePayment($id);\n\t\t}\n\t\t$this->_render['layout'] = 'base';\n\n\t\tif ($id) {\n\t\t\t$itemscanceled = true;\n\t\t\t$hasDigitalItems = false;\n\t\t\t$order_current = $orderClass::find('first', array('conditions' => array('_id' => $id)));\n\t\t\t//Check if the order was processed and sent to Dotcom\n\t\t\t$processed_count = $processedOrderColl->count(array('OrderNum' => $order_current['order_id']));\n\n\n\t\t\tif (empty($order)) {\n\t\t\t\t$order = $order_current;\n\t\t\t}\n\t\t\t$orderData = $order_current->data();\n\n\t\t\t$orderItems = $orderData['items'];\n\n\t\t\tif (!empty($orderItems)){\n\t\t\t\tforeach ($orderItems as $key => $orderItem) {\n\t\t\t\t\t$item = Item::find('first', array(\n\t\t\t\t\t\t'conditions' => array('_id' => $orderItem['item_id']\n\t\t\t\t\t)));\n\t\t\t\t\t$sku[\"$orderItem[item_id]\"] = $item->vendor_style;\n\t\t\t\t\t$sku_details[\"$orderItem[item_id]\"] = $item->sku_details;\n\t\t\t\t\tif(!empty($orderItem[\"digital\"])) {\n\t\t\t\t\t\t$hasDigitalItems = true;\n\t\t\t\t\t}\n\t\t\t\t\t//Check if items are all canceled\n\t\t\t\t\tif(empty($orderItem[\"cancel\"])) {\n\t\t\t\t\t\t$itemscanceled = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif($orderItem[\"cancel\"] == false) {\n\t\t\t\t\t\t\t$itemscanceled = false;\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// Check if order has been canceled\n\t\tif (!empty($order->cancel)) {\n\t\t\t$itemscanceled = false;\n\t\t}\n\n\t\t#Get Services\n\t\tif(is_object($order->service)) {\n\t\t\t$service = $order->service->data();\n\t\t} else {\n\t\t\t$service = $order->service;\n\t\t}\n\t\t\n\t\t$orderStatus = $orderClass::getStatus($order);\n\t\t\n\t\t$shipDate = $orderClass::shipDate($order);\n\n\t\treturn compact('order', 'shipDate', 'sku', 'sku_details', 'itemscanceled', 'service','processed_count', 'orderStatus', 'hasDigitalItems');\n\t}",
"function shipment_get($order_id){\n\t$query = \"SELECT SHIPMENT_ID, SHIPMENT_TYPE_ID, PRIMARY_ORDER_ID, CURRENCY_UOM_ID, ORIGIN_CONTACT_MECH_ID, ORIGIN_TELECOM_NUMBER_ID, DESTINATION_CONTACT_MECH_ID, DESTINATION_TELECOM_NUMBER_ID, PARTY_ID_TO,\n\t\t\t\t PARTY_ID_FROM, CREATED_DATE, CREATED_BY_USER_LOGIN, LAST_MODIFIED_DATE, LAST_MODIFIED_BY_USER_LOGIN, HANDLING_INSTRUCTIONS\n\t\t\t FROM shipment\n\t\t\t WHERE PRIMARY_ORDER_ID = '\".esc($order_id).\"'\n\t\t\t LIMIT 1\";\n\treturn db_query_to_row($query);\n}",
"function handleShipping( $orderID )\n {\n do // we prevent high nesting levels by using breaks\n {\n $order = eZOrder::fetch( $orderID );\n if ( !$order )\n break;\n $productCollectionID = $order->attribute( 'productcollection_id' );\n\n $shippingInfo = eZShippingManager::getShippingInfo( $productCollectionID );\n if ( !isset( $shippingInfo ) )\n break;\n\n // check if the order item has been added before.\n $orderItems = $order->orderItemsByType( 'ezcustomshipping' );\n\n // If orderitems allready exists, remove them first.\n if ( $orderItems )\n {\n foreach ( $orderItems as $orderItem )\n {\n $orderItem->remove();\n }\n $purgeStatus = eZShippingManager::purgeShippingInfo( $productCollectionID );\n }\n\n if ( isset( $shippingInfo['shipping_items'] ) and\n is_array( $shippingInfo['shipping_items'] ) )\n {\n // Add a new order item for each shipping.\n foreach ( $shippingInfo['shipping_items'] as $orderItemShippingInfo )\n {\n $orderItem = new eZOrderItem( array( 'order_id' => $orderID,\n 'description' => $orderItemShippingInfo['description'],\n 'price' => $orderItemShippingInfo['cost'],\n 'vat_value' => $orderItemShippingInfo['vat_value'],\n 'is_vat_inc' => $orderItemShippingInfo['is_vat_inc'],\n 'type' => 'ezcustomshipping' ) );\n $orderItem->store();\n }\n }\n else\n {\n // Made for backwards compability, if the array order_items are not supplied.\n if ( !isset( $shippingInfo['vat_value'] ) )\n {\n $shippingInfo['vat_value'] = 0;\n }\n\n if ( !isset( $shippingInfo['is_vat_inc'] ) )\n {\n $shippingInfo['is_vat_inc'] = 1;\n }\n\n $orderItem = new eZOrderItem( array( 'order_id' => $orderID,\n 'description' => $shippingInfo['description'],\n 'price' => $shippingInfo['cost'],\n 'vat' => $shippingInfo['vat_value'],\n 'is_vat_inc' => $shippingInfo['is_vat_inc'],\n 'type' => 'ezcustomshipping' ) );\n $orderItem->store();\n }\n\n } while ( false );\n\n return array( 'status' => eZModuleOperationInfo::STATUS_CONTINUE );\n }",
"public function requestOrderId();",
"public function foodIsReady($order_id)\n { \n $order = Order::find($order_id);\n $restaurant = $order->foods->first()->restaurant;\n //-------- Send to Customer\n $order_customer_url = $this->url.'/customer/order-placed/'.$restaurant->id.'/'.$order->id;\n $customer_title = ('Dear Customer, Your order is ready to collect');\n SendEmail::SendOrderEmail($order_id, 'Food is ready' , $order->user->email , Null,$order,$order->total,$order_customer_url,$customer_title); \n }",
"public function callOrderRequest();",
"public function updateOrder() {\n if ($_SERVER[\"REQUEST_METHOD\"] == \"GET\") {\n return true;\n }\n \n //Put Order Post Data in the database\n $this -> order -> crud -> setPaymentFirstName($this -> postVar(\"first_name\"));\n $this -> order -> crud -> setPaymentLastName($this -> postVar(\"last_name\"));\n $this -> order -> crud -> setPaymentEmail($this -> postVar(\"email\"));\n $this -> order -> crud -> setPaymentBAddr1($this -> postVar(\"b_address1\"));\n $this -> order -> crud -> setPaymentBAddr2($this -> postVar(\"b_address2\"));\n $this -> order -> crud -> setPaymentBCity($this -> postVar(\"b_city\"));\n $this -> order -> crud -> setPaymentBState($this -> postVar(\"b_state\"));\n $this -> order -> crud -> setPaymentBZipcode($this -> postVar(\"b_zipcode\"));\n $this -> order -> crud -> setPaymentBCountry('US');\n if ( $this -> postVar(\"host_invite_count\") ) {\n $this -> order -> crud -> setPaymentInvites( $this -> postVar(\"host_invite_count\") );\n }\n if ( $this -> postVar(\"invite_count\") ) {\n $this -> order -> crud -> setPaymentInvites( $this -> postVar(\"invite_count\") );\n }\n if ($this -> postVar(\"setup_price\")) {\n $this -> order -> crud -> setPaymentAmount($this -> postVar(\"setup_price\"));\n }\n\t\t//Add some special items\n $this -> order -> crud -> setPaymentLastFourCcDigits( right($this -> postVar(\"credit_card_number\"),4) );\n $this -> order -> crud -> setPaymentCcExp( sprintf(\"%02d\",$this -> postVar(\"expiration_date_month\")).$this -> postVar(\"expiration_date_year\") );\n \n //We are not saving CVV2 for the upcoming transaction, and are required to delete later by PCI DSS\n //$this -> crud -> setPaymentCvv2( $this -> postVar(\"card_verification_number\") );\n \n $this -> order -> crud -> save();\n \n if ($this -> order -> orderuser -> getUserEmail() == \"\") {\n $this -> order -> orderuser -> setUserEmail($this -> postVar(\"email\"));\n $this -> order -> orderuser -> save();\n $solr = new SolrManager_PageWidget(null, null, $this -> context);\n $solr -> execute(\"add\",\"user\",$this -> order -> orderuser -> getUserId());\n }\n \n }",
"function process_orders($orders)\n{\n\n\n//print 'order_count: ' . count($orders) . PHP_EOL;\n $display = '';\n\n $order_instance = new Order();\n $item_instance = new Item();\n $fulfillment_instance = new Fulfillment();\n\n\n $order_count = 0;\n\n foreach ($orders as $o) {\n /** ------------\n * PARSE ORDERS\n * ------------ */\n $order_shopify_id = $o['id'];\n log_error('order_shopify_id: ' . $order_shopify_id);\n\n $customer_email = trim($o['email']);\n $customer_phone = (!empty($o['shipping_address']['phone'])) ? trim(strval($o['shipping_address']['phone'])) : trim(strval($o['billing_address']['phone']));\n $order_tcreate = date(\"Y-m-d H:i:s\", strtotime($o['created_at']));\n $order_tmodified = !empty($o['updated_at'])?date(\"Y-m-d H:i:s\", strtotime($o['updated_at'])):null;\n $order_tclose = !empty($o['closed_at'])?date(\"Y-m-d H:i:s\", strtotime($o['closed_at'])):null;\n $order_is_closed = empty($o['closed_at']) ? true : false;\n $order_total_cost = $o['total_price'];\n $order_receipt_id = $o['name'];\n $order_currency = $o['currency'];\n $order_vendor = '';\n $order_alert_status = NOTIFICATION_STATUS_NONE;\n\n\n if (!empty($o['gateway'])) {\n if (strpos(strtolower($o['gateway']), 'stripe')) $order_gateway = GATEWAY_PROVIDER_STRIPE;\n elseif (strpos(strtolower($o['gateway']), 'paypal')) $order_gateway = GATEWAY_PROVIDER_PAYPAL;\n elseif (strpos(strtolower($o['gateway']), 'shopify_payments')) $order_gateway = GATEWAY_PROVIDER_PAYPAL;\n else $order_gateway = GATEWAY_PROVIDER_UNKNOWN;\n }\n\n $order_fulfillment_status = $o['fulfillment_status'];\n $order_is_dropified = (!empty($o['note']) && strpos(strtolower($o['note']), 'dropified'));\n\n /** --------------\n * PARSE CUSTOMER\n * -------------- */\n $order_customer_fn = $o['shipping_address']['first_name'];\n $order_customer_ln = $o['shipping_address']['last_name'];\n $order_customer_address1 = $o['shipping_address']['address1'];\n $order_customer_address2 = $o['shipping_address']['address2'];\n $order_customer_city = $o['shipping_address']['city'];\n $order_customer_zip = $o['shipping_address']['zip'];\n $order_customer_province = $o['shipping_address']['province'];\n $order_customer_country_code = $o['shipping_address']['country_code'];\n $order_customer_province_code = $o['shipping_address']['province_code'];\n $order_customer_phone = $o['shipping_address']['phone'];\n $order_tags = strtolower($o['tags']);\n\n /** -----------------------------------\n * CUSTOMER BILLING - ADDED 02-06-2018\n * ----------------------------------- */\n $order_customer_billing_fn = $o['billing_address']['first_name'];\n $order_customer_billing_ln = $o['billing_address']['last_name'];\n $order_customer_billing_address1 = $o['billing_address']['address1'];\n $order_customer_billing_address2 = $o['billing_address']['address2'];\n $order_customer_billing_city = $o['billing_address']['city'];\n $order_customer_billing_zip = $o['billing_address']['zip'];\n $order_customer_billing_province = $o['billing_address']['province'];\n $order_customer_billing_country_code = $o['billing_address']['country_code'];\n $order_customer_billing_province_code = $o['billing_address']['province_code'];\n $order_customer_billing_phone = $o['billing_address']['phone'];\n\n $order_is_ocu = (strpos($order_tags,'ocu')> -1)?1:0;\n\n $_refund_status = trim($o['financial_status']);\n\n //print 'REFUND STATUS: ' . $_refund_status . PHP_EOL;\n\n switch(strtolower($_refund_status))\n {\n case 'partially_refunded':\n $order_refund_status = 2;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n case 'refunded':\n $order_refund_status = 1;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n default: case 'paid':\n $order_refund_status = 0;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n }\n\n\n $order_is_fulfilled = false; //has the fulfillment process started or not\n $order_is_delivered = false; //has the order been completed and delivered\n $order_is_tracking = false; //whether we should track the order\n\n $order_array = Array(\n 'order_customer_email' => $customer_email,\n 'order_customer_fn' => $order_customer_fn,\n 'order_customer_ln' => $order_customer_ln,\n 'order_customer_address1' => $order_customer_address1,\n 'order_customer_address2' => $order_customer_address2,\n 'order_customer_city' => $order_customer_city,\n 'order_customer_country' => $order_customer_country_code,\n 'order_customer_province' => $order_customer_province,\n\n /** -----------------------------------\n * CUSTOMER BILLING - ADDED 02-06-2018\n * ----------------------------------- */\n 'order_customer_billing_fn'=> $order_customer_billing_fn,\n 'order_customer_billing_ln'=> $order_customer_billing_ln,\n 'order_customer_billing_address1'=> $order_customer_billing_address1,\n 'order_customer_billing_address2'=> $order_customer_billing_address2,\n 'order_customer_billing_city'=> $order_customer_billing_city,\n 'order_customer_billing_zip'=> $order_customer_billing_zip,\n 'order_customer_billing_province'=> $order_customer_billing_province,\n 'order_customer_billing_country'=> $order_customer_billing_country_code,\n 'order_customer_billing_phone'=> $order_customer_billing_phone,\n\n 'order_currency' => $order_currency,\n 'order_tags' => $order_tags,\n 'order_is_ocu'=>$order_is_ocu,\n 'order_customer_zip' => $order_customer_zip,\n 'order_customer_phone' => $customer_phone,//$order_customer_phone,\n 'order_fulfillment_status' => $order_fulfillment_status,\n 'order_is_refunded' => $order_refund_status,\n 'order_shopify_id' => $order_shopify_id,\n 'order_gateway' => $order_gateway,\n 'order_receipt_id'=>$order_receipt_id,\n 'order_total_cost' => $order_total_cost,\n 'order_topen' => $order_tcreate,\n 'order_tclose' => $order_tclose,\n );\n\n\n /** -----------------------------\n * CREATE AND STORE ORDER OBJECT\n * ----------------------------- */\n\n\n /** -----------------------------------\n * LOOKUP ORDERS BY SHOPIFY'S ORDER ID\n * ----------------------------------- */\n if (isset($order_object)) unset($order_object);\n $order_object = $order_instance->fetch_order_by_order_shopify_id($order_shopify_id);\n\n\n /** ------------------------------\n * IF IT DOESN'T EXIST, CREATE IT\n * ------------------------------ */\n if (!$order_object) {\n $order_object = new Order($order_array);\n $order_id = $order_object->save();\n } else {\n $order_id = $order_object->id;\n }\n\n\n /** --------------------------\n * PARSE REFUNDED LINE ITEMS\n * ------------------------- */\n\n\n\n if(!empty($o['refunds']))\n {\n $refund_list = Array();\n $refund_check = Array();\n foreach($o['refunds'] as $refund)\n {\n $refund_date =date(\"Y-m-d H:i:s\", strtotime($refund['created_at']));\n foreach($refund['refund_line_items'] as $item)\n {\n $refund_list[$item['line_item_id']]=$refund_date;\n $refund_check[] = $item['line_item_id'];\n }\n }\n //print 'refund! ' . print_r($refund_list,true);\n //print 'refund! ' . print_r($refund_check,true);\n }\n\n\n\n\n /** ----------------\n * PARSE LINE ITEMS\n * ---------------- */\n\n foreach ($o['line_items'] as $p) {\n $_fulfillment_status = $p['fulfillment_status'];\n switch(strtolower($_fulfillment_status))\n {\n case 'fulfilled': $item_fulfillment_status = 1;break;\n case 'partial': $item_fulfillment_status = 2; break;\n default: case null: $item_fulfillment_status = 0;break;\n }\n $item_shopify_id = $p['id'];\n $item_shopify_product_id = $p['product_id'];\n $item_shopify_variant_id = $p['variant_id'];\n $item_name = $p['name'];\n $item_quantity = $p['quantity'];\n $item_sku = $p['sku'];\n $item_price = $p['price'];\n $item_is_refunded = 0;\n //$item_refund_tcreate = null;\n if(!empty($o['refunds'])) {\n if (in_array(trim($item_shopify_id), $refund_check)) {\n $item_is_refunded = 1;\n $item_refund_tcreate = $refund_list[$item_shopify_id];\n //print 'FOUND REFUND!';\n }\n }\n\n $item_array = Array(\n 'order_id' => $order_id,\n 'order_shopify_id' => $order_shopify_id,\n 'item_shopify_id' => $item_shopify_id,\n 'item_quantity' => $item_quantity,\n 'item_sku' => $item_sku,\n 'item_price'=>floatval($item_price),\n 'item_shopify_product_id' => $item_shopify_product_id,\n 'item_shopify_variant_id' => $item_shopify_variant_id,\n 'item_name' => $item_name,\n 'item_is_refunded' => $item_is_refunded,\n 'item_is_fulfilled'=>$item_fulfillment_status\n );\n\n if(isset($item_refund_tcreate)) $item_array['item_refund_tcreate']=$item_refund_tcreate;\n\n /** -------------------------\n * STORE / UPDATE LINE ITEMS\n * ------------------------- */\n if (isset($item_object)) unset($item_object);\n\n $item_object = $item_instance->fetch_item_by_shopify_item_id($item_shopify_id);\n if (!$item_object) {\n $item_object = new Item($item_array);\n $item_id = $item_object->save();\n } else {\n $item_id = $item_object->id;\n $item_object->save($item_array);\n }\n $order_object->order_items[] = $item_object;\n\n }\n\n\n /** ------------\n * FULFILLMENTS\n * ------------ */\n if (!empty($o['fulfillments'])) {\n foreach ($o['fulfillments'] as $fulfillment) {\n \n \n /**\n * Added by Rafal 2018-04-12\n * \n * Prevent added cancelled, error or failure\n * fulfillments\n */\n if($fulfillment['status'] == 'cancelled' || $fulfillment['status'] == 'error' || $fulfillment['status'] == 'failure'){\n continue;\n }\n \n $fulfillment_shopify_id = $fulfillment['id'];\n $fulfillment_shipment_status = strtolower(trim($fulfillment['shipment_status']));\n $fulfillment_topen = date(\"Y-m-d H:i:s\", strtotime($fulfillment['created_at']));\n //$fulfillment_tmodified = date(\"Y-m-d H:i:s\", strtotime($fulfillment['updated_at']));\n $fulfillment_tracking_company = strtolower($fulfillment['tracking_company']);\n $fulfillment_tracking_number = $fulfillment['tracking_number'];\n $fulfillment_tracking_url = $fulfillment['tracking_url'];\n\n $order_is_fulfilled = true;\n\n\n $fulfillment_array = Array(\n 'order_id' => $order_id,\n 'order_shopify_id' => $order_shopify_id,\n 'fulfillment_shipment_status' => trim(strtolower($fulfillment_shipment_status)),\n 'fulfillment_topen'=>$fulfillment_topen,\n 'fulfillment_shopify_id' => $fulfillment_shopify_id,\n 'fulfillment_tracking_number' => $fulfillment_tracking_number,\n 'fulfillment_tracking_company' => $fulfillment_tracking_company,\n 'fulfillment_tracking_url' => $fulfillment_tracking_url,\n 'order_is_fulfilled' => $order_is_fulfilled,\n );\n\n if ($fulfillment_tracking_company !== 'usps') $is_tracking = true;\n else $is_tracking = false;\n\n\n $order_delivery_status = false;\n\n //Normally USPS is the only courier that updates this appropriately. If its delivered set status\n switch ($fulfillment_shipment_status) {\n case 'delivered':\n $order_delivery_status = DELIVERY_STATUS_DELIVERED;\n $order_is_delivered = true;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_delivered_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 0;\n break;\n\n case 'confirmed':\n $order_delivery_status = DELIVERY_STATUS_CONFIRMED;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_confirmed_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'in_transit':\n $order_delivery_status = DELIVERY_STATUS_IN_TRANSIT;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_in_transit_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'out_for_delivery':\n $order_delivery_status = DELIVERY_STATUS_OUT_FOR_DELIVERY;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_out_for_delivery_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'failure':\n $order_delivery_status = DELIVERY_STATUS_FAILURE;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_failure_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 0;\n $order_array['order_alert_status'] = DELIVERY_STATUS_FAILURE;\n $fulfillment_array['fulfillment_alert_status'] = DELIVERY_STATUS_FAILURE;\n break;\n\n default:\n $order_delivery_status = DELIVERY_STATUS_UNKNOWN;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n\n break;\n }\n/*\n if ($order_delivery_status)\n $order_array['delivery_status'] = $order_delivery_status;*/\n\n\n /**\n * 'status_delivered_tcreate'=>'',\n * 'status_confirmed_tcreate'=>'',\n * 'status_in_transit_tcreate'=>'',\n * 'status_out_for_delivery_tcreate'=>'',\n * 'status_failure_tcreate'=>'',\n * 'status_not_found_tcreate'=>'',\n * 'status_customer_pickup_tcreate'=>'',\n * 'status_alert_tcreate'=>'',\n * 'status_expired_tcreate'=>'',\n */\n /** -----------------------------------\n * CREATE AND STORE FULFILLMENT OBJECT\n * ----------------------------------- */\n\n //Lets see if the order exists\n if (isset($fulfillment_object)) unset($fulfillment_object);\n\n $fulfillment_object = $fulfillment_instance->fetch_fulfillment_by_shopify_fulfillment_id($fulfillment_shopify_id);\n\n\n if (!$fulfillment_object) {\n $fulfillment_array['fulfillment_tracking_number_tcreate'] = current_timestamp();\n $fulfillment_object = new Fulfillment($fulfillment_array);\n $fulfillment_object->save();\n\n } else {\n\n if($fulfillment_object->tracking_number == \"\" || $fulfillment_object->tracking_number == null)\n $fulfillment_array['fulfillment_tracking_number_tcreate'] = current_timestamp();\n\n $fulfillment_object->save($fulfillment_array);\n }\n\n $order_object->order_fulfillments[] = $fulfillment_object;\n\n }\n\n /** -----------------------\n * UPDATE THE ORDER OBJECT\n * ----------------------- */\n $order_object->save($order_array);\n }\n\n $order_count++;\n if ($order_count >= ORDER_COUNT_LIMIT_MANUAL && ORDER_COUNT_LIMIT_MANUAL != 0) exit('ORIGINAL DATA: ' . PHP_EOL . print_r($order_count, true));\n }\n\n\n $res = print_r($order_instance, true);\n print '<pre>' . $res;\n\n}",
"public function delivery(){\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t//goi ham tu model de thuc hien\n\t\t\t$this->modelDelivery($id);\n\t\t\t//di chuyen den trang danh sach cac ban ghi\n\t\t\techo \"<script>location.href='index.php?controller=orders';</script>\";\n\t\t}",
"function process_delivery()\n{\n\tconnect_and_select_db(DB_SERVER, DB_UN, DB_PWD, DB_NAME);\n\n\t// Get the info the user enters on the webpage\n\t$orderid = $_POST['orderid'];\n\n\t// Set the SQL command\n\t$sql_stmt = \"SELECT * FROM `Order` WHERE (OrderId='$orderid' AND Status='Pending');\";\n\n\t//Execute the query. The result will just be true or false\n\t$result = mysql_query($sql_stmt);\n\n\tif (!$result)\n {\n echo \"The retrieval was unsuccessful: \".mysql_error();\n exit;\n }\n\n //$result is non-empty. So count the rows\n $numrows = mysql_num_rows($result);\n $message = \"\";\n if ($numrows == 0)\n $message = \"No order found in database with the provided ID\";\n\n //Display the results\n show_order($message, $result);\n\n //Free the result set\n mysql_free_result($result);\n}",
"public function trigger($order_id) {\n // bail if no order ID is present\n if ( ! $order_id ) {\n error_log('no order id');\n log_error('no order id');\n return;\n }\n\n // setup order object\n $this->object = new WC_Order($order_id);\n $status = $this->object->get_status();\n $this->recipient = $this->object->get_billing_email();\n\n //bail if status is not 'arrived'\n if ($status != 'arrived')\n return;\n\n //replace vars in the subject/headings\n $this->find[] = '{order_date}';\n $this->replace[] = date_i18n(wc_date_format(),strtotime($this->object->get_date_created()));\n\n $this->find[] = '{order_number}';\n $this->replace[] = $this->object->get_order_number();\n\n if (! $this->is_enabled() || ! $this->get_recipient()) {\n error_log('not enabled or no recipient');\n log_error('not enabled or no recipient');\n return;\n }\n\n // send the email\n $this->send( $this->get_recipient(),$this->get_subject(),$this->get_content(),$this->get_headers(), $this->get_attachments());\n\n }",
"function update_order_info($order){\n }",
"function submitOrders() {\n\t\t\t$this->_deleteNominalItems( );\n\t\t\t$this->_validateMultiple( );\n\t\t\t$this->clearOrders( );\n\t\t\t$quote = $this->getQuote( );\n\t\t\t$billingAddress = $quote->getBillingAddress( );\n\t\t\t$convertor = $this->getConvertor( );\n\t\t\t$isVirtual = $quote->isVirtual( );\n\t\t\t$transaction = Mage::getModel( 'core/resource_transaction' );\n\n\t\t\tif ($quote->getCustomerId( )) {\n\t\t\t\t$transaction->addObject( $quote->getCustomer( ) );\n\t\t\t}\n\n\t\t\t$transaction->addObject( $quote );\n\t\t\t$addresses = array( );\n\n\t\t\tif (!$isVirtual) {\n\t\t\t\tforeach ($quote->getAllShippingAddresses( ) as $address) {\n\t\t\t\t\tarray_push( $addresses, $address );\n\t\t\t\t}\n\t\t\t} \nelse {\n\t\t\t\tarray_push( $addresses, $quote->getBillingAddress( ) );\n\t\t\t}\n\n\t\t\t$addresses = array_reverse( $addresses );\n\t\t\tforeach ($addresses as $address) {\n\t\t\t\t$stockId = intval( $address->getStockId( ) );\n\t\t\t\t$quote->unsReservedOrderId( );\n\t\t\t\t$quote->reserveOrderId( );\n\t\t\t\t$quote->collectTotals( );\n\t\t\t\t$order = $convertor->addressToOrder( $address );\n\t\t\t\t$orderBillingAddress = $convertor->addressToOrderAddress( $quote->getBillingAddress( ) );\n\n\t\t\t\tif ($billingAddress->getCustomerAddress( )) {\n\t\t\t\t\t$orderBillingAddress->setCustomerAddress( $billingAddress->getCustomerAddress( ) );\n\t\t\t\t}\n\n\t\t\t\t$order->setBillingAddress( $orderBillingAddress );\n\n\t\t\t\tif (!$isVirtual) {\n\t\t\t\t\tif (!$address->isVirtual( )) {\n\t\t\t\t\t\t$orderShippingAddress = $convertor->addressToOrderAddress( $address );\n\n\t\t\t\t\t\tif ($address->getCustomerAddress( )) {\n\t\t\t\t\t\t\t$orderShippingAddress->setCustomerAddress( $address->getCustomerAddress( ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$order->setShippingAddress( $orderShippingAddress );\n\t\t\t\t\t} \nelse {\n\t\t\t\t\t\t$order->setIsVirtual( 1 );\n\t\t\t\t\t}\n\t\t\t\t} \nelse {\n\t\t\t\t\t$order->setIsVirtual( 1 );\n\t\t\t\t}\n\n\t\t\t\t$order->setPayment( $convertor->paymentToOrderPayment( $quote->getPayment( ) ) );\n\n\t\t\t\tif (Mage::app( )->getStore( )->roundPrice( $address->getGrandTotal( ) ) == 0) {\n\t\t\t\t\t$order->getPayment( )->setMethod( 'free' );\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->_orderData as $key => $value) {\n\t\t\t\t\t$order->setData( $key, $value );\n\t\t\t\t}\n\n\t\t\t\tforeach ($quote->getAllItems( ) as $item) {\n\n\t\t\t\t\tif (( $isVirtual || $item->getStockId( ) == $stockId )) {\n\t\t\t\t\t\t$orderItem = $convertor->itemToOrderItem( $item );\n\n\t\t\t\t\t\tif ($item->getParentItem( )) {\n\t\t\t\t\t\t\t$orderItem->setParentItem( $order->getItemByQuoteItemId( $item->getParentItem( )->getId( ) ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$order->addItem( $orderItem );\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$order->setQuote( $quote );\n\t\t\t\t$this->setOrder( $stockId, $order );\n\t\t\t\t$transaction->addObject( $order );\n\t\t\t\t$transaction->addCommitCallback( array( $order, 'place' ) );\n\t\t\t\t$transaction->addCommitCallback( array( $order, 'save' ) );\n\t\t\t\tMage::dispatchEvent( 'checkout_type_onepage_save_order', array( 'order' => $order, 'quote' => $quote ) );\n\t\t\t\tMage::dispatchEvent( 'sales_model_service_quote_submit_before', array( 'order' => $order, 'quote' => $quote ) );\n\t\t\t}\n\n\t\t\t$transaction->save( );\n\t\t\t$this->_inactivateQuote( );\n\t\t\tforeach ($this->getOrders( ) as $order) {\n\t\t\t\tMage::dispatchEvent( 'sales_model_service_quote_submit_success', array( 'order' => $order, 'quote' => $quote ) );\n\t\t\t}\n\n\t\t\tjmp;\n\t\t\tException {\n\t\t\t\tif (!Mage::getSingleton( 'customer/session' )->isLoggedIn( )) {\n\t\t\t\t\t$quote->getCustomer( )->setId( null );\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->getOrders( ) as $order) {\n\t\t\t\t\t$order->setId( null );\n\t\t\t\t\tforeach ($order->getItemsCollection( ) as $item) {\n\t\t\t\t\t\t$item->setOrderId( null );\n\t\t\t\t\t\t$item->setItemId( null );\n\t\t\t\t\t}\n\n\t\t\t\t\tMage::dispatchEvent( 'sales_model_service_quote_submit_failure', array( 'order' => $order, 'quote' => $quote ) );\n\t\t\t\t}\n\n\t\t\t\tthrow $e;\n\t\t\t\tforeach ($this->getOrders( ) as $order) {\n\t\t\t\t\tMage::dispatchEvent( 'sales_model_service_quote_submit_after', array( 'order' => $order, 'quote' => $quote ) );\n\t\t\t\t}\n\n\t\t\t\treturn $this->getOrders( );\n\t\t\t}\n\t\t}",
"public function merchantAccept($order_id)\n { \n $order = Order::find($order_id);\n $restaurant = $order->foods->first()->restaurant;\n\n //-------- Send to CService\n $order_cservice_url = $this->url.'/admin_gate/orders/'.$order_id.'/edit';\n $cservice_title = ('Dear Customer Service, Restaurant has been confirmed the order');\n SendEmail::SendOrderEmail($order_id, 'Order Confirmed' , $this->order_email , Null,$order,$order->total,$order_cservice_url,$cservice_title); \n }",
"static function new_order_just_processed($order_id, $order_data){\n\t\tif(isset($_SESSION['delivery']['delivery_time'])){\n\t\t\tupdate_post_meta($order_id, self::delivery_date, $_SESSION['delivery']['delivery_time']);\n\t\t}\n\t\t\n\t\tif(isset($_SESSION['delivery']['delivery_time_h'])){\n\t\t\tupdate_post_meta($order_id, self::delivery_hour, $_SESSION['delivery']['delivery_time_h']);\n\t\t}\n\t\t\n\t\tif(isset($_SESSION['delivery']['delivery_code'])){\n\t\t\tupdate_post_meta($order_id, self::delivery_code, $_SESSION['delivery']['delivery_code']);\n\t\t}\n\t\t\n\t\t//saving date to the extra table\n\t\t\n\t\t$order = new WC_Order($order_id);\n\t\t//var_dump($order->get_order_total());\n\t\t$items = $order->get_items();\n\t\t\n\t\t$order_brands = array();\n\t\t\n\t\tif($items){\n\t\t\tforeach($items as $item){\n\t\t\t\t\n\t\t\t\t$brands = wp_get_object_terms($item['product_id'], self::food_provider_taxonomy, array('fields'=>'ids'));\n\t\t\t\tif($brands){\n\t\t\t\t\tforeach($brands as $b){\n\t\t\t\t\t\t$order_brands[$b]['qty'] += (int) $item['qty'];\n\t\t\t\t\t\t$order_brands[$b]['price'] += $item['line_subtotal'];\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\tupdate_post_meta($order_id, self::brand_info, $order_brands);\n\t}",
"function trigger( $order_id, $order = null ) {\n\n\t\tif ( $order_id ) {\n\t\t\t$this->object = new WC_Order( $order_id );\n\n\t\t\t$order_date_index = array_search( '{order_date}', $this->find );\n\t\t\tif ( false === $order_date_index ) {\n\t\t\t\t$this->find['order-date'] = '{order_date}';\n\t\t\t\t$this->replace['order-date'] = wcs_format_datetime( wcs_get_objects_property( $this->object, 'date_created' ) );\n\t\t\t} else {\n\t\t\t\t$this->replace[ $order_date_index ] = wcs_format_datetime( wcs_get_objects_property( $this->object, 'date_created' ) );\n\t\t\t}\n\n\t\t\t$order_number_index = array_search( '{order_number}', $this->find );\n\t\t\tif ( false === $order_number_index ) {\n\t\t\t\t$this->find['order-number'] = '{order_number}';\n\t\t\t\t$this->replace['order-number'] = $this->object->get_order_number();\n\t\t\t} else {\n\t\t\t\t$this->replace[ $order_number_index ] = $this->object->get_order_number();\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $this->is_enabled() || ! $this->get_recipient() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );\n\t}",
"function order_complete( $order_id ) {\n\t\tupdate_post_meta( $order_id, '_order_total', $this->postback['commission'] );\n\t\t$order = new WC_Order( $order_id );\n\t\t$order->add_order_note( 'Order created from a WP App Store postback.' );\n\t\tadd_post_meta( $order_id, '_woocommerce_is_wpas_integration', true, true );\n\t\t$this->send_order_complete_email( $order );\n\t}",
"function process_wosw_shipment_init(){\n \n if(empty(get_option('wassalnow_api')))\n return;\n \n //set api authentaction senderID & senderApiKey\n self::$senderId = get_option('wassalnow_api')['senderId'] ?? ''; \n self::$senderApiKey = get_option('wassalnow_api')['senderApiKey'] ?? '';\n\n\n \t \n //here ajax track-order shipping in wosw\n add_action('wp_ajax_admin_track_wosw_order', array($this,'admin_track_wosw_order'));\n add_action('wp_ajax_nopriv_admin_track_wosw_order',array($this,'admin_track_wosw_order'));\n \n //here ajax cancel-order shipping in wosw\n add_action('wp_ajax_admin_cancel_wosw_order', array($this,'admin_cancel_wosw_order'));\n add_action('wp_ajax_nopriv_admin_cancel_wosw_order',array($this,'admin_cancel_wosw_order'));\n \n \n }",
"public function delivered($id = NULL) {\n if($this->is_api) {\n if(Input::has('order_id')) {\n $id = Input::get('order_id');\n } else {\n return \\Api::invalid_param();\n }\n\n }\n\n $id = \\Hashids::connection('orders')->decode($id)[ 0 ];\n $job = $this->order->find($id);\n if($this->request->has('fullScreen')) {\n return $this->showMap($job);\n }\n if($job->status == config('constant_settings.ORDER_STATUS.RECEIVED')) {\n if($this->is_api) {\n return \\Api::detail_not_found();\n }\n return redirect()->route('received', [\\Hashids::connection('orders')->encode($id)]);\n }\n //if(\\Gate::allows('notOwner', $job)) {\n if($job->user_id != $this->user_id && $job->delivery_driver_id == $this->user_id) {\n\n $updated = $this->order->updateOrderStatus($id, config('constant_settings.ORDER_STATUS.DELIVERED'));\n if($updated) {\n\n $type = \\Config::get('constant_settings.STATEMENT_TYPES.SALE');\n $this->order->updateStatement($type, 'order', $id, 'credit', 'USD', $this->user_id);\n }\n $attributes = array(\n 'resource_id' => $job->user_id,\n 'subject_id' => $this->user_id,\n 'object_id' => $job->id,\n 'object_type' => \\Config::get('constant_notifications.OBJECT_TYPES.JOB.NAME'),\n 'type' => \\Config::get('constant_notifications.OBJECT_TYPES.JOB.ACTIONS.DELIVERED'),\n );\n\n \\Event::fire(new Notification($attributes));\n }\n $data = $this->getOrderDetails($id);\n\n $user = User::find($data[ 'order' ]->user_id);\n\n //$feedback = Feedback::where('user_id' , $user->id)->first();\n\n $data[ 'ratting' ] = ($user->averageRating > 0 ? $user->averageRating : 0);\n $data[ 'feedback' ] = $this->order->getFeedback($id, $this->user_id);\n $data[ 'myFeedback' ] = $this->order->getMyFeedback($id, $this->user_id);\n $data[ 'is_feedback_given' ] = $this->order->isFeedbackGiven($id, $this->user_id);\n\n if($this->is_api) {\n\n $allData = $this->getOrderDetail((object)$data[ 'order' ], $this->user_id);\n $allData[ 'feedback' ] = $data[ 'feedback' ];\n $allData[ 'myFeedback' ] = $data[ 'myFeedback' ];\n $allData[ 'is_feedback_given' ] = $data[ 'is_feedback_given' ];\n unset($allData[ 'items' ]);\n return \\Api::success_data($allData);\n }\n\n return view('jobs.job_in_progress_depart', $data);\n //return view('jobs.jobs_delivered', $data);\n }",
"public function placeOrderAction() {\n\n $directPayment = 0;\n $isPaymentToSiteEnable = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitecrowdfunding.payment.to.siteadmin', 0);\n if (empty($isPaymentToSiteEnable)) {\n $directPayment = 1;\n }\n try {\n\n\n $data = $this->_getParam('data', null);\n $paymentGatewayId = $this->_getParam('payment_gateway');\n if (empty($data)) {\n $this->respondWithError('unauthorized', \"Back amount not found\");\n }\n $data = preg_replace('/\\\\\\\"/', \"\\\"\", $data);\n if (!empty($data))\n $data = Zend_Json::decode($data);\n\n // GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $project_id = $this->_getParam('project_id', null);\n\n $backer_table = Engine_Api::_()->getDbtable('backers', 'sitecrowdfunding');\n } catch (Exception $ex) {\n $this->respondWithValidationError('internal_server_error', $ex->getMessage());\n }\n // PROCESS\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n // GET IP ADDRESS\n $ipObj = new Engine_IP();\n $ipExpr = new Zend_Db_Expr($db->quoteInto('UNHEX(?)', bin2hex($ipObj->toBinary())));\n try {\n //check if value of grandtotal is 0\n if (empty($data['pledge_amount'])) {\n $this->respondWithError('unauthorized', \"Back amount not found\");\n }\n //SAVE Backers DETAILS IN Backer TABLE.\n $shippingDetail = $_REQUEST;\n $table = Engine_Api::_()->getDbtable('backers', 'sitecrowdfunding');\n $backer = $table->createRow();\n $backer->user_id = $viewer_id;\n $backer->project_id = $project_id;\n $backer->order_status = 1;\n $backer->payment_status = 'initial';\n $backer->creation_date = date('Y-m-d H:i:s');\n $backer->gateway_id = $paymentGatewayId;\n $backer->ip_address = $ipExpr;\n $backer->gateway_type = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitecrowdfunding.payment.method', 'normal');\n $backer->amount = $data['pledge_amount'];\n $backer->direct_payment = $directPayment;\n $reward = Engine_Api::_()->getItem('sitecrowdfunding_reward', $data['reward_id']);\n //CHECKING FOR REWARD SHIPPING ADDRESS\n if (!empty($reward)) {\n $backer->shipping_country = $regionId = $data['region_id'];\n $backer->shipping_address1 = $shippingDetail['address1'];\n $backer->shipping_address2 = $shippingDetail['address2'];\n $backer->shipping_city = $shippingDetail['city'];\n $backer->shipping_zip = $shippingDetail['postal_code'];\n\n //FIND SHIPPING LOCATION\n if (!empty($regionId)) {\n $shippingLocation = Engine_Api::_()->getDbTable('rewardshippinglocations', 'sitecrowdfunding')->findShippingLocation($reward->reward_id, $regionId);\n if ($shippingLocation) {\n // $this->respondWithError('unauthorized', \"Shipping location is not found\");\n $backer->shipping_price = $shippingLocation['amount'];\n }\n }\n //Set shipping price\n //$backer->shipping_price = $shippingLocation['amount'];\n }\n\n $backer->is_private_backing = empty($_POST['isPrivateBacking']) ? 0 : 1;\n\n if (!empty($reward)) {\n $backer->delivery_date = $reward->delivery_date;\n }\n //COMMISSION WORK\n $commission = Engine_Api::_()->sitecrowdfunding()->getCommission($project_id);\n $commission_type = $commission[0];\n $commission_rate = $commission[1];\n // IF COMMISSION VALUE IS FIX.\n if ($commission_type == 0)\n $commission_value = $commission_rate;\n else\n $commission_value = (@round($data['pledge_amount'], 2) * $commission_rate) / 100;\n $backer->commission_type = $commission_type;\n $backer->commission_value = $commission_value;\n $backer->commission_rate = $commission_rate;\n $backer->save();\n // COMMIT\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n $this->respondWithValidationError('internal_server_error', $e->getMessage());\n }\n\n $backer_id = Engine_Api::_()->sitecrowdfunding()->getDecodeToEncode($backer->backer_id);\n\n $gateway_id = $paymentGatewayId;\n\n $getHost = Engine_Api::_()->getApi('core', 'siteapi')->getHost();\n $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();\n $baseUrl = @trim($baseUrl, \"/\");\n $getOauthToken = Engine_Api::_()->getApi('oauth', 'siteapi')->getAccessOauthToken($viewer);\n $slug_plural = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitecrowdfunding.slugplural', 'projects');\n\n $url = $getHost . '/' . $baseUrl . '/' . $slug_plural . '/backer/payment';\n\n $url .= \"?project_id=\" . $project_id . \"&gateway_id=\" . $paymentGatewayId . \"&backer_id=\" . $backer_id;\n $this->respondWithSuccess(array('payment_url' => $url), false);\n }",
"public function DraftOrder($order_id)\n { \n $order = Order::find($order_id);\n $restaurant = $order->foods->first()->restaurant;\n\n //-------- Send to CService\n $order_cservice_url = $this->url.'/admin_gate/orders/'.$order_id.'/edit';\n $cservice_title = ('Dear Customer Service, Now a customer is trying to order, please follow the order very carefully!');\n SendEmail::SendOrderEmail($order_id, 'Draft Order' , $this->order_email , Null,$order,$order->total,$order_cservice_url,$cservice_title); \n }",
"function misha_editable_order_meta_general( $order ){ \n$order_id = $order->id;\n?>\n\n<div id=\"custom_paypal_email_id\" class=\"custom-wpc-loader\">\n</div>\n\n<?php\n}"
] | [
"0.6861587",
"0.67595917",
"0.6755199",
"0.6684144",
"0.6670804",
"0.6659695",
"0.6612075",
"0.6602902",
"0.6578274",
"0.6537567",
"0.65210074",
"0.65076435",
"0.6502015",
"0.6487299",
"0.6289143",
"0.6279351",
"0.62790805",
"0.6278227",
"0.6250994",
"0.6224329",
"0.62234604",
"0.62022734",
"0.61935335",
"0.61853695",
"0.6170421",
"0.6170313",
"0.616659",
"0.6153061",
"0.61456263",
"0.61398333"
] | 0.7092018 | 0 |
This Function For Delete coupon Code | public function deletecoupon($couponid){
//xss_clean
$id=$this->security->xss_clean($couponid);
$this->admin_model->deletecouponcode($id);
$this->session->set_flashdata('success_log','Coupon Code deleted Successflly');
redirect('admin/managecoupon');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete_coupon() //delete coupons\n {\n $getid = $this->input->get('coupon_id');\n $this->db->where('coupon_id', $getid);\n $this->db->delete('coupon');\n }",
"public function delete_coupon() {\n $esp = ESP();\n return $esp->eb_sdk->client->delete(\n \"/discounts/{$this->coupon_eb_id}/\",\n array()\n );\n }",
"public function delData()\n\t{\n\t\t$id = $_REQUEST['id'];\n\t\t$qr = $this->fetchdata(\"kp_coupon\",\"where coupon_id = '$id' \");\n\t\t$res= $qr->fetch_object();\n\t\t$coupon_code = $res->coupon_code;\n\t\tif(($qr->num_rows)>0):\n\t\t $del = $this->updaterow(\"kp_coupon\",array('is_delete'=>'1'),\"where coupon_id = '$id' \");\n\t\tendif;\n\n\t\tif($del){\n\n\t\t\t//start function save log transection\n\t\t\t$desclog = \"ลบ [ Coupon ] ชื่อ $coupon_code\";\n\t\t\tsavelog(getSession(),$desclog);\n\t\t\t//end function save log transection\n\n\t\t\t$jsonstatus = \"success\";\n\t\t\t$jsonrespontext = \"Delete [$coupon_code] success!\";\n\t\t\t$jsonmsg = \"ลบ ข้อมูล Coupon [$coupon_code] สำเร็จ!\";\n\t\t}else{\n\t\t\t$jsonstatus = \"error\";\n\t\t\t$jsonrespontext = \"Delete [$coupon_code] error!\";\n\t\t\t$jsonmsg = \"ไม่สามารถ ลบ ข้อมูล Coupon [$coupon_code] สำเร็จ กรุณาติดต่อ Support\";\n\t\t}\n\n\t\t$respon = array('status'=>$jsonstatus,'respontext'=>$jsonrespontext,'msg'=>$jsonmsg);\n\t\techo json_encode($respon);\n\t}",
"public function testCouponDelete()\n {\n $coupon = $this->randomCoupon();\n $this->json('DELETE', static::ADDR . \"/{$coupon->id}\", [])\n ->assertOk()\n ->assertJson(OK);\n }",
"public function couponPostAction($observer)\n {\n if (!Mage::helper('promotionalgift')->enablePromotionalgift())\n return $this;\n\n $action = $observer->getEvent()->getControllerAction();\n $code = trim($action->getRequest()->getParam('coupon_code'));\n if (!$code)\n return $this;\n $session = Mage::getSingleton('checkout/session');\n $cart = Mage::getSingleton('checkout/cart');\n $ruleId = '';\n $salesRules = Mage::getModel('promotionalgift/shoppingcartrule')->getAvailableCouponRule();\n foreach ($salesRules as $salesRule) {\n if ($salesRule->getCouponCode() == $code) {\n if (Mage::helper('promotionalgift/rule')->validateRuleQuote($salesRule)) {\n $ruleId = $salesRule->getId();\n break;\n }\n }\n }\n\n if ($action->getRequest()->getParam('remove') == 1) {\n if ($session->getData('promptionalgift_coupon_code')) {\n $session->addSuccess(Mage::helper('promotionalgift')->__('Coupon code \"%s\" was canceled.', $session->getData('promptionalgift_coupon_code')));\n $session->setData('promptionalgift_coupon_code', null);\n $session->setData('shoppingcart_couponcode_rule_id', null);\n $session->setData('promotionalgift_shoppingcart_rule_id', null);\n $session->setData('promotionalgift_shoppingcart_rule_used', null);\n if ($ruleId) {\n $shoppingQuote = Mage::getModel('sales/quote_item');\n $giftItems = Mage::getModel('promotionalgift/shoppingquote')->getCollection()\n ->addFieldToFilter('shoppingcartrule_id', $ruleId);\n foreach ($giftItems as $item) {\n try {\n $item->delete();\n $cart->removeItem($item->getItemId())->save();\n } catch (Exception $e) {\n\n }\n }\n }\n $action->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));\n return $this;\n }\n } else {\n if ($ruleId) {\n if (!$session->getData('promptionalgift_coupon_code')) {\n $session->setData('promptionalgift_coupon_code', $code);\n $session->setData('promotionalgift_shoppingcart_rule_id', $ruleId);\n $quote = Mage::getSingleton('checkout/cart')->getQuote();\n $quote->setCouponCode('');\n $quote->collectTotals()->save();\n $available = false;\n foreach ($quote->getAddressesCollection() as $address) {\n if (!$address->isDeleted() && $session->getData('promptionalgift_coupon_code') == $code) {\n $available = true;\n break;\n }\n }\n if ($session->getData('promotionalgift_shoppingcart_use_full_rule')) {\n $session->addError(Mage::helper('promotionalgift')\n ->__(\"You're out of rule to use. Please remove gift(s) of other rules from cart and try again\"));\n }\n }\n }\n $action->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));\n }\n $autoAddGift = Mage::getStoreConfig('promotionalgift/shoppingcart_rule_configuration/automaticadd', Mage::app()->getStore()->getId());\n if (!Mage::registry('autoaddcart') && $autoAddGift) {\n $availableCart = $this->getShoppingcartRule();\n $numberShoppingCart = Mage::getStoreConfig(\n 'promotionalgift/shoppingcart_rule_configuration/numberofshoppingcartrule'\n );\n if (isset($numberShoppingCart) && ($numberShoppingCart != null)\n && ($numberShoppingCart > 0)\n ) {\n if (count($availableCart) > $numberShoppingCart) {\n for (\n $count = $numberShoppingCart;\n $count <= count($availableCart); $count++\n ) {\n unset($availableCart[$count]);\n }\n }\n }\n if ($availableCart) {\n Mage::register('autoaddcart', 1);\n $this->autoAddGiftShoppingCart($availableCart);\n }\n }\n }",
"public function destroy()\n {/*\n session()->forget('coupon');\n return redirect()->route('checkout.index')->with('success_message','Coupon deleted successfully!');\n */}",
"function deletepreviousCoupon()\n\t{\n\t\t$ObjClsDBInteraction = new class_dbconnector();\n\t\t\n\t\tif(isset($this->del_item_id))\n\t\t{\n\t\t\t$sSQL =\"DELETE FROM tbl_genrate_coupon WHERE item_id='$this->del_item_id'\"; \n\t\t}\n\t\t $sSQL;\n\t\t\n\t\t$objRecordSet = $ObjClsDBInteraction->select( $sSQL );\n\t\t$ObjClsDBInteraction->connection_close();\n\t\treturn $nReturnValue;\n\t}",
"public function actionCoupon($customer_coupon_id)\n {\n if (\\Yii::$app->user->isGuest) {\n return $this->redirect('/');\n }\n CustomerCoupon::findOne($customer_coupon_id)->delete();\n\n return $this->redirect(Yii::$app->request->getReferrer());\n }",
"public function deleteCoupon($EncryptCouponID = null) {\n $this->autoRender = false;\n $this->layout = \"admin_dashboard\";\n $data['Coupon']['store_id'] = $this->Session->read('admin_store_id');\n $data['Coupon']['id'] = $this->Encryption->decode($EncryptCouponID);\n $data['Coupon']['is_deleted'] = 1;\n if ($this->Coupon->saveCoupon($data)) {\n $this->Session->setFlash(__(\"Coupon deleted\"), 'alert_success');\n $this->redirect(array('controller' => 'coupons', 'action' => 'addCoupon'));\n } else {\n $this->Session->setFlash(__(\"Some problem occured\"), 'alert_failed');\n $this->redirect(array('controller' => 'coupons', 'action' => 'addCoupon'));\n }\n }",
"static function deletePromoCode($params)\n {\n\t$con =$params['dbconnection'];\t\n\t$queryd = \"DELETE FROM `promo_codes` WHERE `id`='{$params['id']}'\";\n\tmysqli_query($con,$queryd) ;\n\tif(mysqli_affected_rows($con)==0)\n\treturn \"\";\n\treturn \"removed\";\n }",
"public function delete_db($id){\n \t// find khusus untuk primary key di database\n \t$tb_coupon = Coupon::find($id);\n \t$tb_coupon->delete();\n\n \treturn redirect('coupon');\n }",
"public function destroy(Coupon $coupon)\n {\n //\n }",
"public function couponsAction(){\n \n $couponsmodal = Admin_Model_Coupons::getInstance();\n \n if($this->getRequest()->isXmlHttpRequest()){\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n $coupdelid = $this->getRequest()->getParam('coupondelid'); \n $res = $couponsmodal->couponDelete($coupdelid);\n if($res){\n echo json_encode($res);\n }\n \n }\n \n $couponsdetails = $couponsmodal->getCouponDetails();\n if($couponsdetails){\n $this->view->coupondetails = $couponsdetails;\n }\n \n }",
"public static function redeemCoupon($code)\n {\n\t SimpleEcommCartCommon::log(\"Coupon Code:\".$code);\n\t $promo = new SimpleEcommCartPromotion();\n\t $promo->loadByCode($code);\n\t if($promo!=NULL)\n\t {\n\t \t\t$promo->redemption_count = $promo->redemption_count +1; \n\t \t\t$promo->save();\n\t }\n }",
"public function setdiscountAction()\n {\n $response = array();\n if (!$this->_getCart()->getQuote()->getItemsCount()) {\n $response['success'] = false;\n \n }\n\n $couponCode = (string) $this->getRequest()->getParam('coupon_code');\n if ($this->getRequest()->getParam('remove') == 1) {\n $couponCode = '';\n }\n $oldCouponCode = $this->_getQuote()->getCouponCode();\n\n if (!strlen($couponCode) && !strlen($oldCouponCode)) {\n $response['success'] = false;\n }\n\n try {\n $codeLength = strlen($couponCode);\n $isCodeLengthValid = $codeLength && $codeLength <= Mage_Checkout_Helper_Cart::COUPON_CODE_MAX_LENGTH;\n\n $this->_getQuote()->getShippingAddress()->setCollectShippingRates(true);\n $this->_getQuote()->setCouponCode($isCodeLengthValid ? $couponCode : '')\n ->collectTotals()\n ->save();\n\n if ($codeLength) {\n if ($isCodeLengthValid && $couponCode == $this->_getQuote()->getCouponCode()) {\n $response['success'] = true;\n $response['message'] = $this->__('Coupon code \"%s\" was applied.', Mage::helper('core')->escapeHtml($couponCode));\n } else {\n $response['success'] = false;\n $response['message'] = $this->__('Coupon code \"%s\" is not valid.', Mage::helper('core')->escapeHtml($couponCode));\n }\n } else {\n $response['success'] = true;\n $response['message'] = $this->_getSession()->addSuccess($this->__('Coupon code was canceled.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $response['success'] = false;\n $response['message'] = $e->getMessage();\n } catch (Exception $e) {\n $response['success'] = false;\n $response['message'] = $this->__('Cannot apply the coupon code.');\n Mage::logException($e);\n }\n\n $this->getResponse()->setBody(json_encode($response));\n }",
"abstract public function delete($code);",
"public function destroy(Coupon $coupon ,$id)\n {\n $coupon= Coupon::find($id);\n \n \n $coupon->delete();\n\n \n Toastr::info('Coupon Delete Successfully', '', [\"positionClass\" => \"toast-top-center\",'progressBar'=> true, 'showDuration'=> 20,]);\n return redirect()->back();\n }",
"public function removeCoupon( $code )\r\n {\r\n $exists = false;\r\n foreach ($this->coupons as $key=>$item)\r\n {\r\n if ($item['code'] == $code)\r\n {\r\n $exists = true;\r\n unset($this->coupons[$key]);\r\n \r\n break;\r\n }\r\n }\r\n \r\n if ($exists) {\r\n $this->save();\r\n }\r\n \r\n return $this;\r\n }",
"public function deletecouponimage($id,$image){\n\t\t$this->admin_model->deletecouponimage($id,$image);\n\t\t$this->session->set_flashdata('error_log', 'Coupon Image Deleted');\n\t\tredirect('admin/managecoupon','refresh');\n\t}",
"public function destroy(Getcoupon $getcoupon)\n {\n $getcoupon->delete();\n return back()->with('delete_status','Getcoupon Delete SuccessFully!!');\n }",
"public function destory($income_code)\n {\n $result=$this->income_entry->delete_data($income_code);\n $message = \"Income has been Deleted!\";\n $this->session->set_userdata('message', $message);\n redirect('income_entry_controller/view');\n }",
"public function applyCoupon($observer)\n\t{\n\t\t$cookie_name = 'coupon_code';\n\n\t\tif(isset($_COOKIE[$cookie_name])) {\n\t\t\t$coupon_code = $_COOKIE[$cookie_name];\n\t\t}\n\n\t\tif(isset($coupon_code)) {\n\t\t\t$existing_coupon = Mage::getSingleton('checkout/session')->getQuote()->getCouponCode();\n\t\t\t$success_message = Mage::getStoreConfig('somethingdigital_applycoupon/settings/success_message');\n\t\t\tif($existing_coupon && $existing_coupon != $coupon_code){\t\n\t\t\t\tMage::getSingleton('checkout/cart')->getQuote()->setCouponCode($coupon_code)->save();\n\t\t\t\tMage::getSingleton('checkout/session')->addSuccess($success_message);\n\t\t\t\tMage::getSingleton('checkout/session')->addSuccess(Mage::helper('applycoupon')->__('The previous coupon code \"%s\" has been removed', $existing_coupon));\n\t\t\t} else {\n\t\t\t\tMage::getSingleton('checkout/cart')->getQuote()->setCouponCode($coupon_code)->save();\n\t\t\t\tMage::getSingleton('checkout/session')->addSuccess($success_message);\n\t\t\t}\n\t\t\t/* Delete cookie once it's used */\n\t\t\tsetcookie($cookie_name, '', time() - 3600, '/');\n\t\t}\n\t}",
"public function deleteCouponPhoto($EncryptCouponID = null) {\n $this->autoRender = false;\n $this->layout = \"admin_dashboard\";\n $data['Coupon']['store_id'] = $this->Session->read('admin_store_id');\n $data['Coupon']['id'] = $this->Encryption->decode($EncryptCouponID);\n $data['Coupon']['image'] = '';\n if ($this->Coupon->saveCoupon($data)) {\n $this->Session->setFlash(__(\"Coupon Image deleted\"), 'alert_success');\n $this->redirect(array('controller' => 'coupons', 'action' => 'editCoupon', $EncryptCouponID));\n } else {\n $this->Session->setFlash(__(\"Some problem occured\"), 'alert_failed');\n $this->redirect(array('controller' => 'coupons', 'action' => 'editCoupon', $EncryptCouponID));\n }\n }",
"public function delete($bpjs_code)\n\t\t{\n\t\t\t$this->Bpjs_model->delete($bpjs_code);\n\t\t\t$this->session->set_flashdata('flash', 'Deleted');\n\t\t\tredirect('Bpjs/master_bpjs');\n\t\t}",
"private function coupon($coupon_code=NULL)\n\n {\n\n if(!empty($coupon_code)){\n\n $coupon_data = $this->products_coupon_item_model->get_products_coupon_item(array('code'=>$coupon_code));\n\n if(!empty($coupon_data)){\n\n $total = $this->cart->total();\n\n if($coupon_data->coupon_status == STATUS_ACTIVE && $coupon_data->status == STATUS_ACTIVE){\n\n $check1 = 1;\n\n }\n\n $end_date = strtotime($coupon_data->end_date);\n\n if($end_date >= now()){\n\n $check2 = 2;\n\n }\n\n if($coupon_data->price_min <= $total){\n\n $check3 = 3;\n\n }\n\n if($check1 == 1 && $check2 == 2 && $check3 == 3){\n\n if($coupon_data->discount_type == 1){\n\n $discount = ($coupon_data->discount/100)*$total;\n\n $total = $total - round($discount,0);\n\n }elseif($coupon_data->discount_type == 2){\n\n $total = $total - $coupon_data->discount; \n\n }\n\n return $total;\n\n }\n\n return 0;\n\n \n\n }else{\n\n return 0;\n\n }\n\n }else{\n\n return 0;\n\n }\n\n \n\n }",
"public function couponAction() {\n\t\tif ($this->_request->isPost()) {\n\t\t\t$code = trim(filter_var($this->_request->getParam('code'), FILTER_SANITIZE_STRING));\n\n\t\t\tif (!empty($code)) {\n\t\t\t\t$code = array_unique(explode(' ', $code));\n\t\t\t\t$numCodeReceived = count($code);\n\n\t\t\t\t$coupons = Store_Mapper_CouponMapper::getInstance()->findByCode($code);\n\n\t\t\t\t$msg = array();\n\n\t\t\t\tif (!empty($coupons)) {\n\t\t\t\t\t$status = Tools_CouponTools::applyCoupons($coupons);\n\t\t\t\t\tif (!empty($status)) {\n\t\t\t\t\t\t$hasErrors = count(array_filter($status, function ($status) {\n\t\t\t\t\t\t\treturn $status !== true;\n\t\t\t\t\t\t}));\n\t\t\t\t\t\tif ($hasErrors) {\n\t\t\t\t\t\t\t$this->_responseHelper->fail($this->_translator->translate('Sorry, some coupon codes you provided are invalid or cannot be combined with the ones you\\'ve already captured in. Go back to swap promo codes or proceed with shipping information to checkout.'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$discount = Tools_ShoppingCart::getInstance()->getDiscount();\n\t\t\t\t\tif ($discount) {\n\t\t\t\t\t\t$msg[] = 'Congratulations, you save ' . $this->_view->currency($discount) . ' on this order. Proceed to checkout now.';\n\t\t\t\t\t}\n\t\t\t\t\t//processing freeshipping coupons\n\t\t\t\t\tif (Tools_CouponTools::processCoupons(Tools_ShoppingCart::getInstance()->getCoupons(), Store_Model_Coupon::COUPON_TYPE_FREESHIPPING)) {\n\t\t\t\t\t\t$msg[] = $this->_translator->translate('Congratulations, your order is now available for free shipping. Please proceed to checkout.');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->_responseHelper->fail($this->_translator->translate('Sorry, some coupon codes you provided are invalid or cannot be combined with the ones you\\'ve already captured in. Go back to swap promo codes or proceed with shipping information to checkout.'));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->_responseHelper->success($msg);\n\t\t}\n\t}",
"public function delete(Request $request, $id){\n \n $tb_coupon = Coupon::find($id);\n $tb_coupon->is_active = '2';\n $tb_coupon->updated_by = session()->get('session_name') ;\n $tb_coupon->save();\n\n $request->session()->flash('alert-success', 'Coupon has been deleted successfully!');\n\n return redirect('coupon');\n }",
"function delete_interest_shown($coupon_id)\r\n\t{\r\n\t\t$this->check_user_page_access('registered'); \r\n\t\t$cur_user_id = $this->session->userdata('user_id');\r\n\t\t$this->load->model('profile_normal_model');\r\n\t\t$message = '';\r\n\t\t$msg_type = 'err';\r\n\r\n\t\tif($coupon_id < 1 )\r\n\t\t{\r\n\t\t\t$message = \"The coupon id is not valid.\";\r\n\t\t}\r\n\r\n\t\t$coupon_details = $this->profile_normal_model->get_interested_business_details($coupon_id );\r\n\t\tif(empty($coupon_details))\r\n\t\t{\r\n\t\t\t$message = \"No such row exists.\";\r\n\t\t}\r\n\r\n\t\t$cr_by = $coupon_details[0]['cr_by'];\r\n\t\tif($cur_user_id != $cr_by )\r\n\t\t{\r\n\t\t\t$message = \"You are not allowed to delete this coupon interest for...\";\r\n\t\t}\r\n\r\n\t\tif(empty($message))\r\n\t\t{\r\n\t\t\t$this->load->model('profile_normal_model');\r\n\t\t\t$this->profile_normal_model->delete_interest_for_coupon($coupon_id);\r\n\t\t\t$message = \"Deleted successfully\";\r\n\t\t\t$msg_type \t\t=\t'succ';\r\n\t\t}\r\n\r\n\t\t$this->session->set_userdata(array(\r\n\t\t\t'message'=>$message,\r\n\t\t\t'message_type'=>$msg_type\r\n\t\t));\r\n\t\theader('location:'.base_url().'profile');\r\n\t\texit();\r\n\t}",
"private function _resetCoupon() {\n\t\t$this->Session->write('Order.Order.coupon_offered_by', NULL);\n\t\t$this->Session->write('Order.Order.coupon_code', NULL);\n\t\t$this->Session->write('Order.Order.coupon_discount', 0);\n\t}",
"public function destroy(Cupon $cupon)\n {\n \n $cupon->delete();\n return redirect()->route('cupon.index')->with('success','Successfully cupon deleted');\n }"
] | [
"0.78165966",
"0.7553613",
"0.7520389",
"0.69978774",
"0.6990379",
"0.69516295",
"0.69490093",
"0.6777785",
"0.6734746",
"0.6548183",
"0.65134835",
"0.65123147",
"0.6509358",
"0.6463684",
"0.64537054",
"0.64401287",
"0.6423918",
"0.64084965",
"0.63967866",
"0.6345996",
"0.6319798",
"0.63029766",
"0.62824476",
"0.62785465",
"0.62779355",
"0.6271899",
"0.6269089",
"0.6247774",
"0.6242869",
"0.6189524"
] | 0.76907116 | 1 |
This Function To Change Coupon Status | public function changestatus($couponid,$status){
$id=$this->security->xss_clean($couponid);
$code=$this->security->xss_clean($status);
$this->admin_model->changecouponstatusbyid($id,$code);
$this->session->set_flashdata('success_log','Coupon Status changed Successflly');
redirect('admin/managecoupon');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertUpdateCouponStatus()\n\t{\n\t\t$ObjClsDBInteraction = new class_dbconnector();\n\n\t\tif(isset($this->coupon_status))\n\t\t$arr[\"coupon_status\"] = $this->coupon_status;\n //print_r($arr);exit;\n\t\tif(isset($this->item_id) && $this->item_id!=\"\")\n\t\t{\n\t\t\t $sWhere = \" item_id = '$this->item_id'\";\n\t\t\t// $arr[\"coupon_date\"] = date(\"Y-m-d H:i:s\");\n\t\t\t $nReturnValue = $ObjClsDBInteraction->insertUpdate(\"tbl_genrate_coupon\", $arr, $sWhere);\n\t\t}\n\t\telse\n\t\t{\n\t\t //$arr[\"bid_status\"] \t\t \t= 0; // inactive product\n \t\t//$arr[\"coupon_date\"] = date(\"Y-m-d H:i:s\");\n\t\t\t$nReturnValue = $ObjClsDBInteraction->insertUpdate(\"tbl_genrate_coupon\", $arr, null);\n\t\t}\n\t \t$ObjClsDBInteraction->connection_close();\n\t\treturn $nReturnValue;\n\t}",
"function confirm() {\n $this->setIsConfirmed(1);\n $newSubscriptionStatus = ($this->getCustomerStatus() == 'AddressPending') ? 'Pending' : 'Active';\n\n foreach ($this->getSubscriptions() as $oSub) {\n $oSub->setStatus($newSubscriptionStatus);\n $oSub->save();\n }\n\n $this->save();\n }",
"public function applyCoupon()\n {\n if($this->hasCoupon)\n {\n if($this->hasCoupon->type == 'product')\n {\n $this->couponForProduct();\n }\n elseif($this->hasCoupon->type == 'shipping')\n {\n session(['noShipping' => 'noShipping']);\n }\n else\n {\n $this->couponGlobal();\n }\n }\n }",
"public function applyCouponCode()\r\n\t{\r\n\t\t$post['coupon_date'] = $_POST['coupon_date']; \r\n\t\t$post['user_email'] = $_POST['user_email'];\t\t\r\n\t\t$post['coupon_code'] = $_POST['coupon_code'];\t\t \r\n \r\n \t\t$coupon_res = $this->category_model->applyCouponCode($post);\r\n \r\n\t\tif(!empty($coupon_res))\r\n\t\t{\r\n\t\t\t$status = $this->category_model->updateCouponCodeStatus($post);\r\n\t\t\tif($status == 'true')\r\n\t\t\t{\r\n\t\t\t\techo json_encode(array(\"status\"=>1, \"coupon_res\"=> $coupon_res));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo json_encode(array(\"status\"=>2));\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \t \t\techo json_encode(array(\"status\"=>0));\r\n\t\t}\t \t\r\n \t}",
"function wc_cart_change_coupon_label ($html , $coupon) {\n\t\t$html = 'Promo Code';\n\t\treturn $html;\n }",
"public function setdiscountAction()\n {\n $response = array();\n if (!$this->_getCart()->getQuote()->getItemsCount()) {\n $response['success'] = false;\n \n }\n\n $couponCode = (string) $this->getRequest()->getParam('coupon_code');\n if ($this->getRequest()->getParam('remove') == 1) {\n $couponCode = '';\n }\n $oldCouponCode = $this->_getQuote()->getCouponCode();\n\n if (!strlen($couponCode) && !strlen($oldCouponCode)) {\n $response['success'] = false;\n }\n\n try {\n $codeLength = strlen($couponCode);\n $isCodeLengthValid = $codeLength && $codeLength <= Mage_Checkout_Helper_Cart::COUPON_CODE_MAX_LENGTH;\n\n $this->_getQuote()->getShippingAddress()->setCollectShippingRates(true);\n $this->_getQuote()->setCouponCode($isCodeLengthValid ? $couponCode : '')\n ->collectTotals()\n ->save();\n\n if ($codeLength) {\n if ($isCodeLengthValid && $couponCode == $this->_getQuote()->getCouponCode()) {\n $response['success'] = true;\n $response['message'] = $this->__('Coupon code \"%s\" was applied.', Mage::helper('core')->escapeHtml($couponCode));\n } else {\n $response['success'] = false;\n $response['message'] = $this->__('Coupon code \"%s\" is not valid.', Mage::helper('core')->escapeHtml($couponCode));\n }\n } else {\n $response['success'] = true;\n $response['message'] = $this->_getSession()->addSuccess($this->__('Coupon code was canceled.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $response['success'] = false;\n $response['message'] = $e->getMessage();\n } catch (Exception $e) {\n $response['success'] = false;\n $response['message'] = $this->__('Cannot apply the coupon code.');\n Mage::logException($e);\n }\n\n $this->getResponse()->setBody(json_encode($response));\n }",
"public function activateCoupon($EncryptCouponID = null, $status = 0) {\n $this->autoRender = false;\n $this->layout = \"admin_dashboard\";\n $data['Coupon']['store_id'] = $this->Session->read('admin_store_id');\n $data['Coupon']['id'] = $this->Encryption->decode($EncryptCouponID);\n $data['Coupon']['is_active'] = $status;\n if ($this->Coupon->saveCoupon($data)) {\n if ($status) {\n $SuccessMsg = \"Coupon Activated\";\n $this->Session->setFlash(__($SuccessMsg), 'alert_success');\n $this->redirect(array('controller' => 'coupons', 'action' => 'editCoupon/' . $EncryptCouponID . '#CouponStartDate'));\n } else {\n $SuccessMsg = \"Coupon Deactivated and Coupon will not get Display in Menu List\";\n $this->Session->setFlash(__($SuccessMsg), 'alert_success');\n $this->redirect(array('controller' => 'coupons', 'action' => 'addCoupon'));\n }\n } else {\n $this->Session->setFlash(__(\"Some problem occured\"), 'alert_failed');\n $this->redirect(array('controller' => 'coupons', 'action' => 'addCoupon'));\n }\n }",
"public function confirm() {\r\n\t\t$this->status = Users::STATUS_ACTIVE;\r\n\t}",
"public function changeStatus()\n {\n }",
"public function changeStatus()\n {\n }",
"public function changeStatus()\n {\n }",
"public function changeStatus()\n {\n }",
"public function couponGlobal()\n {\n $cart = \\Cart::content();\n\n foreach($cart as $item)\n {\n $newprice = $item->price - ($item->price * ($this->hasCoupon->value)/100);\n\n \\Cart::update($item->rowid, array('price' => $newprice));\n }\n }",
"public function updateCouponStatus(DiscountCoupons $discountCoupon, string $action): bool\n {\n if (strtolower($action) == self::DISABLE_ACTION_TYPE) {\n $flag = self::DISABLE_COUPON_FLAG;\n } elseif(strtolower($action) == self::ENABLE_ACTION_TYPE) {\n $flag = self::ACTIVE_COUPON_FLAG;\n } else {\n // Can add more actions\n return false;\n }\n $discountCoupon->setFlag($flag);\n //Let's save the things in DB.\n try {\n $this->em->persist($discountCoupon);\n $this->em->flush();\n } catch (Exception $exception) {\n $this->logger->error('ERROR::COUPON_SERVICE - Error in disabling coupon. ' . $exception);\n\n return false;\n }\n\n return true;\n }",
"public function changeRedeemStatus($idPeriod,$new_paid_status,$owner_id,$instance_id){\n $filter=\"\";\n $dateUpdate = \"\";\n $errMessage=\"\";\n $periodFilter=\" AND `period_id` = $idPeriod \";\n if ( $new_paid_status == 5 ) { \n $filter = \" AND paid = 4 \"; // set to No (5) if the previous status was paypal running (cancel)\n $errMessage=\"Paypal transaction can be canceled only if Paypal transaction is running .\";\n } else if ( $new_paid_status == 3 ) { // set to Redeem Request Sent if the previous status was In Sales Cart\n $filter = \" AND paid = 6 \"; \n $errMessage=\"Redeem request is not in Sales application cart .\";\n// } else if ( $new_paid_status == 4 ) { \n// $filter = \" AND paid = 6 \"; // set to Request Running if the previous status was in Sales Cart\n// $errMessage=\"Redeem request is not in Sales application cart .\";\n } else if ( $new_paid_status == 6 ) { // set to Request in Sales cart if the previous status was Sent\n $filter = \" AND paid = 3 \";\n $errMessage=\"The status of the Redeem is not 'Sent'.\";\n } else if ( $new_paid_status == 1 ) { // set to Yes if the previous status was in Sales Cart\n $filter = \" AND paid = 6 \";\n $dateUpdate = \" , paid_date = NOW() \";\n $errMessage=\"Paypal transaction can be validated only if Paypal transaction is running .\";\n } else if ( $new_paid_status == \"F\" ) { // force for debug\n $filter = \" \";\n $new_paid_status = 5;\n } else {\n $filter = \" AND 1 = 0 \";\n }\n $sql = \"UPDATE $instance_id.\" . REVIEW_REWARDER . \" SET `paid` = '$new_paid_status' $dateUpdate WHERE \" . \n REVIEW_REWARDER . \".`receiver_id` = $owner_id $periodFilter $filter\";\n $ret = mysql_unbuffered_query($sql,$this->link);\n if ($ret) {\n // the following test works only if the update is for 1 redeem, need to count before the number of redeem requested and compare with this number\n if (mysql_affected_rows() == 0) { \n return array('error' => 'new status: ' . $new_paid_status.\" is incompatible with current status.\" .\n $errMessage ) ;\n } else {\n return array('result' => \"update new_paid_status: \" . $sql) ;\n }\n } else {\n return array('error' => 'error SQL in changeRedeemStatus' . mysql_error () . \" SQL: \" . $sql) ;\n }\n }",
"public function process_button() \n {\n global $ot_coupon;\n Session::setRpSessionEntry('coupon', $ot_coupon->output);\n }",
"function checkout () {\r\n\t\tif( version_compare(SHOPP_VERSION, '1.1.9', '<=')){\r\n\t\t\t$this->Order->Billing->cardtype = \"BillmateBank\";\r\n\t\t\t$this->Order->confirm = true;\r\n\t\t} else {\r\n\t\t\t$Order = ShoppOrder();\r\n\t\t\t$Order->Billing->cardtype = 'BillmateBank';\r\n\t\t\t$Order->confirm = true;\r\n\t\t}\r\n\t}",
"public function change_city_status(){\n\t\tif ($this->checkLogin('CA') == ''){\n\t\t\tredirect('deals_crm');\n\t\t}else {\n\t\t\t$mode = $this->uri->segment(4,0);\n\t\t\t$user_id = $this->uri->segment(5,0);\n\t\t\t$status = ($mode == '0')?'InActive':'Active';\n\t\t\t$newdata = array('status' => $status);\n\t\t\t$condition = array('id' => $user_id);\n\t\t\t$this->city_model->update_details(CITY,$newdata,$condition);\n\t\t\t$this->setErrorMessage('success','City Status Changed Successfully');\n\t\t\tredirect('crmadmin/city/display_city_list');\n\t\t}\n\t}",
"function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($data['t']) && !empty($data['list'])) $response = $this->_contract->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t# all good\n\t\tif(!empty($response) && $response['boolean']){\n\t\t\t$data['msg'] = 'The contract status has been updated.';\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t} \n\t\t# there was an error\n\t\telse {\n\t\t\t$data['msg'] = (!empty($data['t']) && !empty($data['list']))? 'ERROR: There was an error updating the contract status.': 'ERROR: This action can not be resolved';\n\t\t\t$data['area'] = 'basic_msg';\n\t\t}\n\t\t\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}",
"function changeCusStatus()\r\n {\r\n $sql = \"update tracking set FeedbackStatus=:fs where TrackID=:track_id\";\r\n $args = [':fs' => '1', ':track_id' => $this->TrackID];\r\n return DB::run($sql, $args);\r\n }",
"public function rebateStatus() {\n\t\t// rebate logic\n\t}",
"public function notifyOrderStatus()\n {\n }",
"public function changeStatus() {\r\n $status = $_POST['statusId']; \r\n $this->model->changeStatus($_POST); \r\n if($status == 1) { \r\n echo 0;\r\n } else {\r\n echo 1;\r\n }\r\n }",
"public function couponAction()\n {\n $quote = Mage::getSingleton('swell/quote');\n $quote = $quote->applyCoupon(\n $this->apiRequest->getQuoteId(),\n $this->apiRequest->getCouponCode(),\n $this->apiRequest->getSwellCouponCodes()\n );\n\n $this->sendResponse($quote);\n }",
"public function applyCoupon($observer)\n\t{\n\t\t$cookie_name = 'coupon_code';\n\n\t\tif(isset($_COOKIE[$cookie_name])) {\n\t\t\t$coupon_code = $_COOKIE[$cookie_name];\n\t\t}\n\n\t\tif(isset($coupon_code)) {\n\t\t\t$existing_coupon = Mage::getSingleton('checkout/session')->getQuote()->getCouponCode();\n\t\t\t$success_message = Mage::getStoreConfig('somethingdigital_applycoupon/settings/success_message');\n\t\t\tif($existing_coupon && $existing_coupon != $coupon_code){\t\n\t\t\t\tMage::getSingleton('checkout/cart')->getQuote()->setCouponCode($coupon_code)->save();\n\t\t\t\tMage::getSingleton('checkout/session')->addSuccess($success_message);\n\t\t\t\tMage::getSingleton('checkout/session')->addSuccess(Mage::helper('applycoupon')->__('The previous coupon code \"%s\" has been removed', $existing_coupon));\n\t\t\t} else {\n\t\t\t\tMage::getSingleton('checkout/cart')->getQuote()->setCouponCode($coupon_code)->save();\n\t\t\t\tMage::getSingleton('checkout/session')->addSuccess($success_message);\n\t\t\t}\n\t\t\t/* Delete cookie once it's used */\n\t\t\tsetcookie($cookie_name, '', time() - 3600, '/');\n\t\t}\n\t}",
"public function markAsUnpaid(){\n $this->status = \"NOT APPROVED\";\n $this->save();\n }",
"public function setInitialStatus(){\n $this->order->status()->attach(1, ['user_id'=>$this->vendor->user->id, 'comment'=>'Social Network order']);\n\n //Set automatically approved by admin - since it it social\n //$this->order->status()->attach(2, ['user_id'=>1, 'comment'=>__('Automatically approved by admin')]);\n }",
"function goodwish_edge_get_woocommerce_apply_coupon_button() {\n\t\tprint '<input type=\"submit\" name=\"apply_coupon\" value=\"'.esc_html__('Apply Coupon','goodwish').'\">';\n\t}",
"public function update(Request $request, Cupon $cupon)\n {\n $request->validate([\n 'code'=>'required|string',\n 'type'=> 'required',\n 'status'=>'required',\n 'value'=> 'required',\n ]);\n $cupon->update([\n 'code'=>$request->code,\n 'type'=>$request->type,\n 'value'=>$request->value,\n 'status'=>$request->status,\n \n ]);\n return redirect()->route('cupon.index')->with('success','Successfully cupon updated');\n }",
"function update_donation_status($campaign_id,$status_flag)\n { \n $data = array(\n\t 'donated' => 1 \n\t);\n $this->db->where('campaign_id',$campaign_id);\n $this->db->update($this->campaign_payment_table,$data);\n return true;\n }"
] | [
"0.66494006",
"0.6394549",
"0.6283916",
"0.62746114",
"0.6242025",
"0.61696",
"0.6010042",
"0.5944633",
"0.5940111",
"0.5940111",
"0.5940111",
"0.5940111",
"0.5862592",
"0.585859",
"0.5855098",
"0.5850258",
"0.5818682",
"0.58128875",
"0.5787194",
"0.5763204",
"0.5748678",
"0.57484394",
"0.57322174",
"0.5725192",
"0.57030374",
"0.5679109",
"0.5634835",
"0.5632619",
"0.5617143",
"0.5612059"
] | 0.6719041 | 0 |
This function For Load Cover Image View | public function coverbooks(){
if($this->session->userdata('adminlogin')){
$data=array(
'main_view' => 'admin/coverbookimage_view',
'postdata' => $this->admin_model->GetCoverBooks()
);
$this->load->view('layout/admin_layout', $data);
}
else{
redirect('admin');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEventCoverImage()\n {\n }",
"function image()\n\t{\n\t\t$id = $this->uri->segment('2');\n\t\t$gallery_id = $this->uri->segment('4');\n\t\t$data['gallery'] = $this->m_community->getGallery($gallery_id);\n\n\t\t$data['community'] = $this->m_community->get_com_detail($id);\n\t\t$data['user'] = $this->m_user->getUser();\n\t\t$data['event'] = $this->m_community->upcomingEvent($id);\n\n\t\t$user_id = $data['user']['USER_ID'];\n\n\n\t\tif ($this->m_community->getCom($id)) {\n\t\t\tif ($this->m_community->cekUser($user_id, $id) != NULL) {\n\t\t\t\tif ($this->m_community->cekAlbum($id, $gallery_id)) {\n\t\t\t\t\t$this->load->view('v_image_community', $data);\n\t\t\t\t} else {\n\t\t\t\t\tredirect('community/authorized');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tredirect('community/' . $id . '/guest');\n\t\t\t}\n\t\t} else {\n\t\t\tredirect('community/authorized');\n\t\t}\n\t}",
"public function setCoverImage($img)\r\n\t{\r\n\t\t$this->coverImage = $img;\r\n\t}",
"public function showCover()\n\t{\n\t\t//\n\t\t$cover = Portfolio::all()->first();\n\t\treturn View::make('portfolio.show')->with('cover', $cover);\n\n\t}",
"public function guessCoverPhoto() {\r\n if ($this->featured_image == \"http://railindustryworker.com.au/assets/logo-artc.gif\" || empty( $this->featured_image ) && stripos($this->title, \"artc\") !== false) {\r\n $this->featured_image = \"https://static.railpage.com.au/i/logos/artc.jpg\";\r\n }\r\n\r\n if ($this->Topic->id == 4 && stripos($this->title, \"Gheringhap Sightings\") !== false) {\r\n $this->featured_image = \"http://ghaploop.railpage.org.au/House%20%20Train%20(2).jpg\"; #\"https://farm3.staticflickr.com/2657/3978862684_b0acc234d4_z.jpg\";\r\n }\r\n\r\n return $this;\r\n }",
"public function cover() {\n\n $file = Input::file('cover');\n\n if (!is_null($file)) {\n \n $imagePath = $this->commerce->uploadImage($file, Config::get('cons.image.commerceCover'));\n\n if ($imagePath) {\n\n return Response::json(array(\n 'status' => TRUE,\n 'type' => 'success',\n 'data' => ['src' => $imagePath])\n );\n }\n\n return Response::json(array(\n 'status' => FALSE,\n 'type' => 'error',\n 'message' => $this->commerce->errors()->all())\n );\n }\n }",
"function bp_cover_photo_screen_content() {\r\n\r\n $template = plugin_dir_path( __FILE__ ) . 'templates/cover-photo.php';\r\n\r\n require_once $template;\r\n\r\n return;\r\n }",
"public function makeCover() {\n $this->autoRender = false;\n if ($this->request->is('ajax')) {\n $this->News->id = $this->request->data['id'];\n if (!$this->News->exists()) {\n echo '404';\n } else {\n if ($this->News->saveField('fk_id_gallery', $this->request->data['cover'])) {\n echo '200';\n } else {\n echo '404';\n }\n }\n exit();\n }\n }",
"public function getCoverPath(){\n \tif($this->cover){\n \t\t$url = $this->cover->colored_url ? $this->cover->colored_url : $this->cover->outline_url;\n \t\treturn 'images/pages/thumbs/' . $url;\n \t}\n }",
"protected function getCoverProperty() {\n return 'cover';\n }",
"public function makeAsCoverPhotoAction(){\n\t\t$params = $this->getRequest()->getParams();\n\t\t$resultArr=\\Extended\\socialise_photo::makeImageAsCover(Auth_UserAdapter::getIdentity()->getId(), $params[\"albumID\"], $params[\"photoID\"]);\n\t\tif($resultArr){\n\t\t\techo Zend_Json::encode(1);\n\t\t}\n\t\telse{\n\t\t\techo Zend_Json::encode(0);\n\t\t}\n\t\tdie;\n\t}",
"public function getImageUrl(){\n return Url::to($this->detailDir.$this->pic); \n }",
"public function collectImage()\n {\n $products = $this->productsLogic->createCarouselImage($_GET['id']);\n $result = $this->productsLogic->createCarousel($products);\n $product = $this->productsLogic->readProduct($_GET['id']);\n $table = $this->productsLogic->printDetailTable($product);\n\n include 'view/details.php';\n\n }",
"public function getCoverPhoto()\n {\n return $this->cover_photo;\n }",
"public function correspondingImageAction(){\r\n\t\t$album_id = $this->_getParam('album_id', false);\r\n\t\t$this->view->paginator = $paginator = Engine_Api::_()->getDbtable('photos', 'sesalbum')->getPhotoSelect(array('album_id'=>$album_id,'limit_data'=>100));\r\n\t}",
"public function getUrl()\n {\n return \"/public/uploads/covers/\".$this->name;\n }",
"public function uploadCoverAction(){\n\t\t$album_id = $this->_getParam('album_id', '0');\n\t\tif ($album_id == 0)\n\t\t\treturn;\n\t\t$album = Engine_Api::_()->getItem('sesblog_album', $album_id);\n\t\tif(!$album)\n\t\t\treturn;\n\t\t$art_cover = $album->art_cover;\n\t\tif(isset($_FILES['Filedata']))\n\t\t\t$data = $_FILES['Filedata'];\n\t\telse if(isset($_FILES['webcam']))\n\t\t\t$data = $_FILES['webcam'];\n\t\t$album->setCoverPhoto($data);\n\t\tif($art_cover != 0){\n\t\t\t$im = Engine_Api::_()->getItem('storage_file', $art_cover);\n\t\t\t$im->delete();\n\t\t}\n\t\techo json_encode(array('file'=>Engine_Api::_()->storage()->get($album->art_cover)->getPhotoUrl('')));die;\n\t}",
"public function getImagePage () {}",
"Public function GetCover(){\n $host = $this->ReadPropertyString('IPAddress');\n $url = \"http://$host:80/NetAudio/art.asp-jpg\";\n //$url = \"http://$host:80/img/album%20art_S.png\";\n $cmd = \"\";\n $xml = $this->curl_get($url, $cmd);\n $Cover ='<img src='.$url. ' width=320px height=280px scrolling=\"no\">';\t\n //setvalue(38066 /*[Denon-CEOL\\_Cover]*/, $Cover);\t\n $this->setvalue(\"CeolArtPicUrl\", $Cover);\n return $xml;\n\t}",
"private function getClubCoverTopContents(){\r\n $clubCoverDatas = $this->getClubCoverDatas();\r\n $sAuthorLink = getProfileLink($this->clubDatas['author_id']);\r\n $sAuthorNick = getNickName($this->clubDatas['author_id']);\r\n $rating = $this->getClubRate();\r\n $aVars = array(\r\n 'extra_top_container_class' => (empty($clubCoverDatas['bg_image'])) ? 'ebytes_club_cover_top_container_no_background' : '',\r\n 'bx_if:allow_change_cover' => array(\r\n 'condition' => getLoggedId() == $this->clubDatas['author_id'] ? true : false,\r\n 'content' => array(\r\n 'insert_background_caption' => (sizeof($clubCoverDatas) && !empty($clubCoverDatas['bg_image'])) ? _t('_emmetbytes_club_cover_change_background_caption') : _t('_emmetbytes_club_cover_insert_background_caption'),\r\n ),\r\n ),\r\n 'bx_if:show_bg_image' => array(\r\n 'condition' => !empty($clubCoverDatas['bg_image']) ? true : false,\r\n 'content' => array(\r\n 'bg_image_path' => $clubCoverDatas['bg_image_cropped'],\r\n ),\r\n ),\r\n 'bx_if:allow_logo_change' => array(\r\n 'condition' => ($this->clubDatas['author_id'] == getLoggedId()) ? true : false,\r\n 'content' => array(\r\n 'logo_button_caption' => _t('_emmetbytes_club_cover_insert_logo_caption'),\r\n 'form_logo_action' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'submit_tmp_logo',\r\n ),\r\n ),\r\n 'club_logo' => $clubCoverDatas['club_logo'],\r\n 'club_rate' => $rating[0],\r\n 'club_views' => _t('_emmetbytes_club_cover_views_counter_caption', $this->clubDatas['views']),\r\n 'club_name' => $this->clubDatas['title'],\r\n 'author_info' => _t('_emmetbytes_club_cover_author_info', $sAuthorLink, $sAuthorNick),\r\n 'member_buttons' => $this->getClubButtons(),\r\n );\r\n return $this->_oTemplate->parseHTMLByName('ebytes_club_cover_top_container', $aVars);\r\n }",
"public function getCover() {\r\n\treturn $this->cover;\r\n }",
"abstract public function cover($id);",
"function chapbook_cover_page_url($chapbook)\n{\n\n $cover_page = false;\n\n if (isset($chapbook->storage_name) && $chapbook->storage_name) {\n $cover_page = ChapbookFile::createCoverPageImageUrl($chapbook->storage_name);\n } elseif (isset($chapbook->cover_image) && $chapbook->cover_image instanceof ChapbookFile) {\n $cover_page = $chapbook->cover_image->getCoverPageImageUrl();\n }\n\n return $cover_page;\n}",
"public function uploadCoverAction(){\r\n\t\t$album_id = $this->_getParam('album_id', '0');\r\n\t\tif ($album_id == 0)\r\n\t\t\treturn;\r\n\t\t$album = Engine_Api::_()->getItem('album', $album_id);\r\n\t\tif(!$album)\r\n\t\t\treturn;\r\n\t\t$art_cover = $album->art_cover;\r\n\t\tif(isset($_FILES['Filedata']))\r\n\t\t\t$data = $_FILES['Filedata'];\r\n\t\telse if(isset($_FILES['webcam']))\r\n\t\t\t$data = $_FILES['webcam'];\r\n\t\t$album->setCoverPhoto($data);\r\n\t\tif($art_cover != 0){\r\n\t\t\t$im = Engine_Api::_()->getItem('storage_file', $art_cover);\r\n\t\t\t$im->delete();\r\n\t\t}\r\n\t\techo json_encode(array('file'=>Engine_Api::_()->storage()->get($album->art_cover)->getPhotoUrl('')));die;\r\n\t}",
"public function setCover($cover) {\r\n\t$this->cover = $cover;\r\n }",
"public function getThumbnailCover() {\r\n\treturn $this->thumbnailCover;\r\n }",
"public function headerimg()\n\t{\n\t\t$id = $this->session->userdata('userlogged_in');\n\t\t$this->load->model(\"User_model\"); // calling user_model\n\t\t$data['pp'] = $this->User_model->header_image($id); \n\t\t$this->load->view(\"include/header\",$data);\t\n\t}",
"function loadDetails() {\n\t\tif (file_exists($this->activeImage)) {\n\t\t\tlist ($this->imageWidth, $this->imageHeight, $this->imageType, $this->imageAttributes) =\n\t\t\t\tgetimagesize($this->activeImage);\n\t\t\t$this->imageType = image_type_to_mime_type($this->imageType);\n\t\t\t$this->imageSize = filesize($this->activeImage);\n\t\t}\n\t}",
"public function getCoverURL()\n\t{\n\t\treturn $this->coverURL;\n\t}",
"public function getImage()\n {\n if ($this->hasImageURL()) {\n return sprintf(\"%s/%s\", BOOK_COVERS_UPLOAD_PATH, $this->image_url);\n } else {\n return App::getAssetsURL() . \"/img/no-cover.png\";\n }\n }"
] | [
"0.6926072",
"0.6367168",
"0.634907",
"0.6346836",
"0.6313507",
"0.6281116",
"0.6255532",
"0.6245934",
"0.62326604",
"0.6222484",
"0.6205963",
"0.61453557",
"0.60793227",
"0.60535413",
"0.60028917",
"0.5996051",
"0.59623235",
"0.5953355",
"0.5943158",
"0.5931609",
"0.58868414",
"0.5868911",
"0.5862918",
"0.5860249",
"0.5786744",
"0.5783171",
"0.5747502",
"0.57401407",
"0.57398796",
"0.57293415"
] | 0.6661578 | 1 |
This Function to load testimonial view | public function testimonial(){
if($this->session->userdata('adminlogin')){
$data=array(
'main_view' => 'admin/testimonial_view',
'postdata' => $this->admin_model->GetTestimonial()
);
$this->load->view('layout/admin_layout', $data);
}
else{
redirect('admin');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testimonials()\n {\n\t\treturn view('pages.testimonials');\n }",
"public function showAdmintestimonial()\n {\n return View::make('adminhomeTestimonials');\n }",
"function getTestimonialforPageView()\n {\n $awp_testimonial_form_settings = get_option('awp_testimonialforms');\n if($awp_testimonial_form_settings['tmpl_type']==\"awp_plugin_template\") :\n\t $templatefile=AWP_TESTIMONIALS_TEMPLATEPATH.\"/\".$awp_testimonial_form_settings['layout']; //plugin templates\n \n exit;\n\t else :\n\t $templatefile=TEMPLATEPATH.\"/testimonials/templates/frontend/\".$awp_testimonial_form_settings['layout']; //theme templates\n \n endif;\n if (!file_exists($templatefile)) :\n\t \t$templatefile = AWP_TESTIMONIALS_TEMPLATEPATH.\"/\".AWP_TESTIMONIALS_DEFAULT_TEMPLATE;\n\t endif;\n\n // $response = getAllTestimonials();\n $awp_all_testimonials = awp_convertObjToArray($response->testimonialsList);\n $testimonials_pageid = get_option('awp_testimonials_pageid');\n if(count($response->testimonialsList) == 0 && empty($response->testimonialsList) && $testimonials_pageid != '')\n\t {\n\t \t$awp_all_testimonials = dummy_testimonials();\n\t }\n\n\t $order=$awp_testimonials_settings['order'];\n $awp_testimonials = $this->sortTestimonialByOrder($awp_all_testimonials, $order);\n $testimonials = array();\n $testimonials['alltestimonials'] = $awp_testimonials;\n $testimonials['custom_css'] = $awp_testimonials_settings['custom_css'];\n $testimonials['templatefile'] = $templatefile;\n return $testimonials;\n return;\n }",
"public function show(Testimonial $testimonial)\n {\n //\n }",
"public function show(Testimonial $testimonial)\n {\n //\n }",
"public function show(Testimonial $testimonial)\n {\n //\n }",
"function show_testimonials_fullview(){\n $awp_testimonials = $this->getAllTestimonialsForFullView();\n $awp_testimonials_settings = get_option('awp_testimonials_settings');\n ob_start();\n \n if(empty($awp_testimonials_settings))\n \t{\n \t\techo awp_messagelist('testimonialsconfigure-display-page');//Testimonials are not configured in admin page\n \t}else if(empty($awp_testimonials['alltestimonials']))\n\t { \n\t \techo awp_messagelist('testimonials-display-page'); //Testimonials are not found.Need to create Testimonials.\n\t }else { include $awp_testimonials['templatefile']; \n\t }\n\t \n\t $show_testimonials = ob_get_clean();\n\t return $show_testimonials;\n\t}",
"public function testimonials()\n {\n $user = Auth::user();\n\n $testimonials = Testimonial::where('user_id', $user->id)->get();\n\n return view('user.profile.testimonials', compact('user', 'testimonials'));\n }",
"public function index()\n {\n $lsTesti = \\App\\Models\\testimonials::all();\n return view('Testimonials.index')->with([\n \"lsTesti\"=>$lsTesti\n ]);\n }",
"public function new_testimonials()\n {\n \n $this->load->view('admin/header'); \n $this->load->view('admin/new_testimonials');\n $this->load->view('admin/footer');\n \n }",
"public function index()\n {\n $items = Testimonial::orderBy('list_order')->get();\n\n return $this->view('testimonials::testimonials', compact('items'));\n }",
"public function index()\n {\n return view('testimonial');\n }",
"function testimonials()\n\t{\n\t\t$this->validate_admin();\n\t\t\n\t\tif ($this->uri->segment(3) != '') {\n\t\t\t$where['tid'] \t\t\t= $this->uri->segment(3);\n\t\t\t$this->base_model->delete_record(\n\t\t\t$this->db->dbprefix('testimonials'), \n\t\t\t$where\n\t\t\t);\n\t\t\t$this->prepare_flashmessage(\"Record Deleted Successfully\", 0);\n\t\t\tredirect('admin/testimonials');\t\t\n\t\t}\n\t\t\t\t\n\t\t$this->data['title'] \t\t\t= 'Testimonials';\n\t\t$this->data['active_menu'] \t\t= 'testimonials';\n\t\t$this->data['records'] \t\t\t= $this->base_model->fetch_records_from(\n\t\t$this->db->dbprefix('testimonials')\n\t\t);\n\t\t$this->data['content'] \t\t\t= 'admin/testimonials/testimonials';\n\t\t$this->_render_page('temp/admintemplate', $this->data);\n\t}",
"public function show(TestimonialItem $testimonialItem)\n {\n //\n }",
"public function index()\n {\n $testimonials = Testimonial::select('id','position','name')->where('status',1)->get();\n return view('others::Testimonial.index', compact('testimonials'));\n }",
"public function index()\n {\n $testimonials = \\App\\Testimonial::orderBy('idTestimonial','DESC')->get();\n\n return view('testimonial.index', compact('testimonials'));\n }",
"public function index()\n {\n\n $testimonial = Testimonial::all();\n $page = 'testimonial';\n\n return view('testimonials.index', compact('testimonial', 'page'));\n }",
"public function index()\n {\n $testimonials = Testimonial::all();\n return view('admin.testimonialsection',compact('testimonials'));\n }",
"public function index()\n {\n $testimonials=Testi::all();\n return view('admin.testimonials.testimonials',compact('testimonials'));\n }",
"public function index() {\r\n\t\t$total_records = $this->testimonial_model->count_all_testimonials();\r\n\t\t$inner_page_title = 'Testimonials (' . $total_records . ')'; \r\n\t\t$this->admin_header('Testimonials', $inner_page_title);\t\r\n\t\t$data['total_records'] = $this->testimonial_model->count_all_testimonials();\r\n $data['testimony'] = $this->testimonial_model->get_all_testimonials();\r\n\t\t$this->load->view('admin/testimonials/all_testimonials', $data);\r\n $this->admin_footer();\r\n\t}",
"public function index()\n {\n $testimonials = Testimonials::all();\n return view('admin.testimonials.index', compact('testimonials'));\n }",
"public function index()\n {\n $testimonials = Testimonial::all();\n return view('admin.testimonials.index',compact(['testimonials']));\n }",
"public function index()\n {\n $testimonials = Testimonial::all();\n return view('admin.testimonials.index', compact('testimonials'));\n }",
"public function index()\n {\n $testimonials = Testimonial::get();\n return view('admin.testimonial.index', compact('testimonials'));\n }",
"public function show(Testimonial $testimonial)\n {\n return view('testimonials.single',compact('testimonial'));\n }",
"public function index()\n {\n $testimonials = Testimonial::all();\n\n return view('admin.testimonial.index',compact('testimonials'));\n }",
"public function index()\n {\n $testimonialItems = TestimonialItem::paginate(3);\n return view('backoffice.testimonial.item.all', compact('testimonialItems'));\n }",
"public function index()\n {\n //\n return view('dashboards.alumni.testimonial');\n }",
"function TTrust_Testimonials() {\n\n\t\tglobal \t$ttrust_config;\n\n\t\t$widget_ops = array( 'classname' => 'create-testimonials', 'description' => __('Display testimonials.', 'create' ) );\n\n\t\t// Instantiate parent\n\t\tparent::__construct(\n\n\t\t\t'ttrust_testimonials', // Base ID\n\t\t\t__( 'Create Testimonials', 'create' ), // Name\n\t\t\t $widget_ops // Args\n\n\t\t); // parent::__construct()\n\n\t}",
"public function testimony()\n {\n $this->data['testimonials'] = $this->testimonial->getVisibleTestimonials();\n\n if (!isset($_SESSION['user'])) {\n $register = '<a href=\"' . ROOT_URL . '/auth?tab=register' . '\">S\\'inscrire.</a>';\n flash('login_flash', 'Veuillez vous connecter pour nous donner votre témoignage! Vous n\\'avez pas de compte? ' . $register, 'flash flash-info');\n redirect('auth');\n }\n\n // Modify data\n $this->data['page_info']['title'] = SITE_NAME . ' - Dites-nous votre témoignage';\n\n // Load view\n $this->view('pages/testimony.php', $this->data);\n }"
] | [
"0.78520805",
"0.7805359",
"0.77041245",
"0.7623549",
"0.7623549",
"0.7623549",
"0.73442066",
"0.7341535",
"0.7200485",
"0.7167504",
"0.71011513",
"0.709167",
"0.6974219",
"0.6970185",
"0.6949364",
"0.6943201",
"0.6912106",
"0.6889564",
"0.6862941",
"0.6857987",
"0.6839575",
"0.68348336",
"0.68302596",
"0.6829525",
"0.6768783",
"0.67485607",
"0.673923",
"0.67320853",
"0.6726175",
"0.6694943"
] | 0.78804964 | 0 |
This function to upload coupon | public function uploadcoupon(){
//From Validation
if (empty($_FILES['fileCouponImage']['name']))
{
$this->form_validation->set_rules('fileCouponImage', 'Coupon Image', 'required');
}
if ($this->form_validation->run() == TRUE or FALSE) {
$this->session->set_flashdata('error_log', validation_errors);
redirect('admin/managecoupon','refresh');
} else {
$config['upload_path'] = './assets/coupons/';
$config['allowed_types'] = 'gif|jpg|png';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('fileCouponImage')){
//$error = array('error' => $this->upload->display_errors());
$this->session->set_flashdata('error_log', $this->upload->display_errors());
redirect('admin/managecoupon','refresh');
}
else{
$fileData = $this->upload->data();
$this->admin_model->SaveCouponImage($fileData['file_name']);
$this->session->set_flashdata('success_log', 'Coupon Upload Successfully');
redirect('admin/managecoupon','refresh');
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create_coupon() {\n $current_user = wp_get_current_user();\n $this->coupon = $current_user->first_name . '-' . $current_user->last_name . '-' . sha1( random_bytes( 24 ) );\n add_post_meta( $this->id, 'ESP_RECORD_COUPON', $this->coupon );\n // Create coupon in Eventbrite's system\n $esp = ESP();\n $id = $esp->eb_user[\"id\"];\n $result = $esp->eb_sdk->client->post(\n \"/organizations/$id/discounts/\",\n array(\n \"discount\" => array(\n \"type\" => \"coded\",\n \"code\" => $this->coupon,\n \"percent_off\" => \"100\",\n \"quantity_available\" => 1,\n \"event_id\" => $this->event_id,\n ),\n )\n );\n // Save the Eventbrite ID for later use.\n $this->coupon_eb_id = $result[\"id\"];\n add_post_meta( $this->id, 'ESP_EB_COUPON_ID', $this->coupon_eb_id );\n }",
"public function addCoupon() {\n $this->layout = \"admin_dashboard\";\n $storeId = $this->Session->read('admin_store_id');\n $merchantId = $this->Session->read('admin_merchant_id');\n if ($this->request->is(array('post', 'put')) && !empty($this->request->data['Coupon']['coupon_code'])) {\n $this->request->data = $this->Common->trimValue($this->request->data);\n $couponTitle = trim($this->request->data['Coupon']['name']);\n $couponCode = trim($this->request->data['Coupon']['coupon_code']);\n $isUniqueName = $this->Coupon->checkCouponUniqueName($couponTitle, $storeId);\n $isUniqueCode = $this->Coupon->checkCouponUniqueCode($couponCode, $storeId);\n if ($isUniqueName) {\n if ($isUniqueCode) {\n $response = $this->Common->uploadMenuItemImages($this->request->data['Coupon']['image'], '/Coupon-Image/', $storeId, 480, 320);\n if (!$response['status']) {\n $this->Session->setFlash(__($response['errmsg']), 'alert_failed');\n } else {\n if (!empty($this->request->data['Coupon']['days'])) {\n $this->request->data['Coupon']['days'] = implode(\",\", array_keys($this->request->data['Coupon']['days']));\n } else {\n $this->request->data['Coupon']['days'] = '';\n }\n $coupondata['image'] = $response['imagename'];\n $coupondata['store_id'] = $storeId;\n $coupondata['merchant_id'] = $merchantId;\n $coupondata['name'] = trim($this->request->data['Coupon']['name']);\n $coupondata['start_date'] = $this->Dateform->formatDate($this->request->data['Coupon']['start_date']);\n $coupondata['end_date'] = $this->Dateform->formatDate($this->request->data['Coupon']['end_date']);\n $coupondata['coupon_code'] = trim($this->request->data['Coupon']['coupon_code']);\n $coupondata['number_can_use'] = $this->request->data['Coupon']['number_can_use'];\n $coupondata['discount_type'] = $this->request->data['Coupon']['discount_type'];\n $coupondata['discount'] = $this->request->data['Coupon']['discount'];\n $coupondata['is_active'] = $this->request->data['Coupon']['is_active'];\n $coupondata['allow_time'] = $this->request->data['Coupon']['allow_time'];\n $coupondata['start_time'] = $this->request->data['Coupon']['start_time'];\n $coupondata['end_time'] = $this->request->data['Coupon']['end_time'];\n $coupondata['days'] = $this->request->data['Coupon']['days'];\n if (isset($this->request->data['Coupon']['promotional_message']) && $this->request->data['Coupon']['promotional_message']) {\n $coupondata['promotional_message'] = trim($this->request->data['Coupon']['promotional_message']);\n }\n $this->Coupon->create();\n $this->Coupon->saveCoupon($coupondata);\n $this->request->data = '';\n $this->Session->setFlash(__(\"Coupon Successfully Added\"), 'alert_success');\n }\n } else {\n $this->Session->setFlash(__(\"Coupon Code Already exists\"), 'alert_failed');\n }\n } else {\n $this->Session->setFlash(__(\"Coupon Title Already exists\"), 'alert_failed');\n }\n }\n $start = \"00:00\";\n $end = \"24:00\";\n $timeRange = $this->Common->getStoreTimeAdmin($start, $end);\n $this->set('timeOptions', $timeRange);\n $this->_coupanList();\n //For Dealdata\n $this->loadModel('StoreDeals');\n $storeDealData = $this->StoreDeals->findByStoreId($storeId);\n $this->set('storeDealData', $storeDealData);\n $this->request->data = \"\";\n }",
"public function store(\\App\\Http\\Requests\\CouponRequest $request) {\n\n DB::beginTransaction();\n try {\n $request = $request->all();\n\n if (!empty($request['validationcheck']) && $request['validationcheck'] == 1) {\n\n $coupon = Coupon::addCoupon($request);\n\n $file = Input::file('coupon_logo');\n //store image\n if (!empty($file)) {\n $this->addImageWeb($file, $coupon, 'coupon_logo');\n }\n }\n // save the user\n } catch (\\Exception $e) {\n DB::rollback();\n throw $e;\n return response()->json(['status' => 0, 'message' => \\Config::get('constants.APP_ERROR')], 400);\n }\n // If we reach here, then// data is valid and working.//\n DB::commit();\n if (isset($coupon) && $coupon == 'paymentsuccess') {\n return response()->json(['status' => 1, 'message' => 'Extra geolocation/geofencing added to your plan. Thank you!'], 200);\n }\n else if (isset($coupon) && $coupon == true) {\n return response()->json(['status' => 1, 'message' => \\Config::get('constants.COUPON_CREATE')], 200);\n } \n }",
"public function store(Request $request)\n {\n if (!auth()->user()->can('coupon.create')) {\n abort(403, 'Unauthorized action.');\n } \n\n try {\n $business_id = $request->session()->get('user.business_id');\n $form_fields =['name', 'barcode', 'business_id', 'gift_card_id', 'value', 'barcode_type', 'isActive', 'transaction_id','start_date', 'created_by', 'isUsed'];\n\n $module_form_fields = $this->moduleUtil->getModuleFormField('product_form_fields');\n if (!empty($module_form_fields)) {\n $form_fields = array_merge($form_fields, $module_form_fields);\n }\n \n $objDetails = $request->only($form_fields);\n $objDetails['business_id'] = $business_id;\n $objDetails['orig_value'] = $objDetails['value'];\n $objDetails['created_by'] = $request->session()->get('user.id');\n \n $objDetails['isActive'] = 'active' ;\n $objDetails['isUsed'] = '0' ;\n\n \n DB::beginTransaction();\n\n $GiftCard = Coupon::create($objDetails);\n \n \n DB::commit();\n $output = ['success' => 1,\n 'msg' => __('coupon.sucess')\n ];\n } catch (\\Exception $e) {\n DB::rollBack();\n \\Log::emergency(\"File:\" . $e->getFile(). \"Line:\" . $e->getLine(). \"Message:\" . $e->getMessage());\n \n $output = ['success' => 0,\n 'msg' => __(\"messages.something_went_wrong\"). $e->getMessage()\n ];\n return redirect('coupon')->with('status', $output);\n }\n\n if ($request->input('submit_type') == 'save_n_add_another') {\n return redirect()->action(\n 'CouponController@create'\n )->with('status', $output);\n }\n\n return redirect('coupon')->with('status', $output);\n }",
"public function createCouponAction(){\n \n $couponsmodal = Admin_Model_Coupons::getInstance(); \n if ($this->getRequest()->isPost()) {\n $coupondata = array();\n $coupondata['coupon_code'] = $this->getRequest()->getPost('couponcode');\n $coupondata['coupon_name'] = $this->getRequest()->getPost('couponname');\n $coupondata['discount_offered'] = $this->getRequest()->getPost('coupondiscount');\n $coupondata['coupon_limit'] = $this->getRequest()->getPost('couponlimit');\n $coupondata['coupon_type'] = $this->getRequest()->getPost('subscriptionoffers');\n $coupondata['discount_type'] = $this->getRequest()->getPost('discount_type');\n $coupondatastartdate = $this->getRequest()->getPost('couponstartdate');\n $coupondataenddate = $this->getRequest()->getPost('couponenddate'); \n $coupondata['coupon_startdate'] = date('Y-m-d', strtotime($coupondatastartdate));\n $coupondata['coupon_enddate'] = date('Y-m-d', strtotime($coupondataenddate));\n \n $couponid = $couponsmodal->insertCouponDetails($coupondata);\n \n if($couponid){\n $this->_redirect('/admin/coupons');\n \n }\n \n } \n \n \n }",
"function createDBCoupon($coupon_code){\n\t//$coupon_code = $coupon_code; // Code\n\t$amount = '10'; // Amount\n\t$discount_type = 'fixed_cart'; // Type: fixed_cart, percent, fixed_product, percent_product\n\t\t\t\t\t\t\n\t$coupon = array(\n\t\t'post_title' => $coupon_code,\n\t\t'post_content' => '',\n\t\t'post_status' => 'publish',\n\t\t'post_author' => 1,\n\t\t'post_type'\t\t=> 'shop_coupon'\n\t);\n\t\t\t\t\t\t\n\t$new_coupon_id = wp_insert_post( $coupon );\n\t\t\t\t\t\t\n\t// Add meta\n\tupdate_post_meta( $new_coupon_id, 'discount_type', $discount_type );\n\tupdate_post_meta( $new_coupon_id, 'coupon_amount', $amount );\n\tupdate_post_meta( $new_coupon_id, 'individual_use', 'no' );\n\tupdate_post_meta( $new_coupon_id, 'product_ids', '' );\n\tupdate_post_meta( $new_coupon_id, 'exclude_product_ids', '' );\n\tupdate_post_meta( $new_coupon_id, 'usage_limit', '' );\n\tupdate_post_meta( $new_coupon_id, 'expiry_date', '' );\n\tupdate_post_meta( $new_coupon_id, 'apply_before_tax', 'yes' );\n\tupdate_post_meta( $new_coupon_id, 'free_shipping', 'no' );\n}",
"public function saveQuickProduct(Request $request)\n {\n // return $request;\n if (!auth()->user()->can('coupon.create')) {\n abort(403, 'Unauthorized action.');\n } \n\n try {\n $business_id = $request->session()->get('user.business_id');\n $form_fields =['name', 'barcode', 'business_id', 'gift_card_id', 'value', 'barcode_type', 'isActive', 'transaction_id','start_date', 'created_by', 'isUsed'];\n\n $module_form_fields = $this->moduleUtil->getModuleFormField('product_form_fields');\n if (!empty($module_form_fields)) {\n $form_fields = array_merge($form_fields, $module_form_fields);\n }\n \n $objDetails = $request->only($form_fields);\n $objDetails['business_id'] = $business_id;\n $objDetails['orig_value'] = $objDetails['value'];\n $objDetails['created_by'] = $request->session()->get('user.id');\n \n $objDetails['isActive'] = 'inactive' ;\n $objDetails['isUsed'] = '0' ;\n\n \n DB::beginTransaction();\n\n $GiftCard = Coupon::create($objDetails);\n //------ PRODUCT Creation Start\n \n $objProductDetails['name'] = \"Coupon - \".$GiftCard->barcode;\n $objProductDetails['business_id'] =$request->session()->get('user.business_id');\n // $objProductDetails['brand_id'] = 1;\n $objProductDetails['unit_id'] = 1;\n $objProductDetails['category_id'] = 1;\n $objProductDetails['barcode_type'] = 'C128';\n $objProductDetails['tax_type'] = 'exclusive';\n $objProductDetails['sku'] = \"Coupon\".$GiftCard->barcode;\n $objProductDetails['alert_quantity'] = ' 1';\n $objProductDetails['type'] = 'single';\n $objProductDetails['p_type'] = 'coupon';\n $objProductDetails['coupon'] = $GiftCard->id;\n $objProductDetails['created_by'] = $request->session()->get('user.id');\n\n\n $objProduct = Product::create($objProductDetails);\n\n $product_variation_data = [\n 'name' => 'DUMMYCOUPON',\n 'product_id' => $objProduct->id,\n 'is_dummy' => 1 \n ];\n $product_variation = ProductVariation::create($product_variation_data);\n\n $objVariationDetails['name'] = 'DUMMY';\n $objVariationDetails['product_id'] = $objProduct->id;\n $objVariationDetails['sub_sku'] = $objProduct->sku;\n $objVariationDetails['product_variation_id'] = $product_variation->id;\n $objVariationDetails['default_purchase_price'] = 1.0;\n $objVariationDetails['dpp_inc_tax'] = 1.0;\n $objVariationDetails['profit_percent'] = 0;\n $objVariationDetails['default_sell_price'] = $GiftCard->value;\n $objVariationDetails['sell_price_inc_tax'] = $GiftCard->value;\n\n $objVariations = Variation::create($objVariationDetails);\n \n $objVariationLocationDetails['qty_available'] = '1'; \n $objVariationLocationDetails['location_id'] = $request->session()->get('user.business_location_id');\n $objVariationLocationDetails['product_id'] = $objProduct->id;\n $objVariationLocationDetails['product_variation_id'] = $product_variation->id;\n $objVariationLocationDetails['variation_id'] = $objVariations->id;\n $objVariationLocationDetails['product_refefrence'] = $objProduct->refference;\n\n $objVariationsLocation = VariationLocationDetails::create($objVariationLocationDetails);\n //------ PRODUCT Creation Ends\n \n // 'msg' => __('coupon.sucess') .'\n // 'msg' => __('coupon.sucess') .'\n // <script type=\"text/javascript\"> \n // $(\"#search_product\").val(\"'.$objProduct->sku.'\");\n // $(\"#search_product\").autocomplete(\"search\");\n // </script>'\n \n DB::commit();\n $output = [\n 'success' => 1,\n 'msg' => 'Cupon Added Successfully \n <script type=\"text/javascript\"> \n $(\"#search_product\").val(\"'.$objProduct->sku.'\");\n $(\"#search_product\").autocomplete(\"search\");\n </script>'\n ];\n } catch (\\Exception $e) {\n DB::rollBack();\n \\Log::emergency(\"File:\" . $e->getFile(). \"Line:\" . $e->getLine(). \"Message:\" . $e->getMessage().' at line '.$e->getLine());\n \n $output = ['success' => 0,\n 'msg' => __(\"messages.something_went_wrong\"). $e->getMessage()\n ];\n return redirect('coupon')->with('status', $output);\n } \n\n\n return $output;\n }",
"public function AddCouponProcess()\n\t{\n\t\t$rules = array(\n\t\t\tarray('field' => 'CName', 'label' => 'CName', 'rules' => 'required')\n\t\t);\n\n\t\t$this->form_validation->set_rules($rules);\n\t\tif ($this->form_validation->run() == false) {\n\t\t\techo validation_errors();\n\t\t\t$Msg = array('Msg' => validation_errors(), 'Type' => 'danger');\n\t\t\t$this->session->set_flashdata($Msg);\n\t\t\tredirect(base_url('admin/AddCoupon'));\n\t\t} else {\n\n\t\t\t$CName = $this->lib->validate($this->input->post('CName'));\n\n\t\t\t$CAbout = $this->lib->validate($this->input->post('CAbout'));\n\t\t\t$Code = $this->lib->validate($this->input->post('Code'));\n\t\t\t$Per = $this->lib->validate($this->input->post('Per'));\n\n\t\t\t$count = $this->lib_model->Counter('m_copoun', array('name' => $CName));\n\t\t\tif ($count == 0) {\n\t\t\t\t$f = array(\n\t\t\t\t\t'name' => $CName,\n\t\t\t\t\t'about' => $CAbout,\n\t\t\t\t\t'code' => $Code,\n\t\t\t\t\t'Per' => $Per,\n\t\t\t\t\t'status' => 0,\n\t\t\t\t\t'created' => date('Y-m-d H:i:s'),\n\t\t\t\t\t'createdIp' => $this->input->ip_address()\n\n\t\t\t\t);\n\n\n\t\t\t\t$this->lib_model->Insert('m_copoun', $f);\n\t\t\t\t$Msg = array('Msg' => 'copoun Add Successfully', 'Type' => 'success');\n\t\t\t\t$this->session->set_flashdata($Msg);\n\t\t\t\tredirect(base_url('admin/AddCoupon'));\n\t\t\t} else {\n\t\t\t\t$Msg = array('Msg' => 'Coupon Alredy Exist in Database', 'Type' => 'danger');\n\t\t\t\t$this->session->set_flashdata($Msg);\n\t\t\t\tredirect(base_url('admin/AddCoupon'));\n\t\t\t}\n\n\n\t\t}\n\t}",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'code' => 'required|min:2|max:10|unique:coupones,code,NULL,id,deleted_at,NULL',\n // 'code' => 'required|unique:coupones|min:2|max:10',\n 'expire_date' => 'required',\n 'expire_time' => 'required|date_format:\"H:i\"',\n 'precentge' => 'integer',\n 'type' => 'required',\n ]);\n $now = Carbon::now()->toDateTimeString();\n $expire = Carbon::parse($request->expire_date . ' ' . $request->expire_time)->toDateTimeString();\n if ($now > $expire) {\n return back()->withErrors(__('translations.expire_time_should_be_greater_than_now'))->withInput();\n }\n\n $code = $request->code ;\n\n if (preg_match('/[\\'^£$%&*()}{@#~?><>,|=_+¬-]/', $code) || strlen($code) == strlen(intval($code)))\n {\n return redirect()->back()->withInput()->with('error' , 'يجب ان يتكون الكود من ارقام و حروف فقط');\n }\n\n $coupon = new Coupon;\n $coupon->code = $request['code'];\n $coupon->owner_id = Auth::user()->id;\n $coupon->owner_name = Auth::user()->name;\n $coupon->expiry_date = $expire;\n $type = $request->type;\n $coupon->type = $type;\n if ($type === 'flat_rate') {\n $this->validate($request, [\n 'restrict_price' => 'required|numeric|min:1',\n ]);\n\n $max_price = $request->restrict_price - 1;\n $message = [\n 'flat_rate.max' => 'يجب الا يكون سعر الخصم اكبر من ' . $max_price ,\n ] ;\n\n $this->validate($request, [\n 'flat_rate' => 'required|numeric|min:1|max:' . $max_price,\n ] , $message);\n\n $coupon->restrict_price = $request->restrict_price;\n $coupon->flat_rate = $request->flat_rate;\n }\n if ($type === 'total_price') {\n $this->validate($request, [\n 'precentge' => 'required|integer|min:1|max:99',\n ]);\n $coupon->discount = $request->precentge;\n }\n if ($type === 'product_discount') {\n $this->validate($request, [\n 'product_id' => 'required|exists:products,id',\n 'precentge' => 'required|integer|min:1|max:99',\n ]);\n $coupon->product_id = $request->product_id;\n $coupon->discount = $request->precentge;\n }\n if (!$coupon->save()) {\n abort(500);\n }\n return redirect()->route('coupon.index')->withMessage(__('translations.copoun_created_successfuly'));\n\n }",
"public function store(Request $request)\n {\n if($request->coupon_type == 1){\n $coupon_type_name = '现金券';\n }else if($request->coupon_type == 2){\n $coupon_type_name = '满减券';\n }else if($request->coupon_type == 3){\n $coupon_type_name = '新人券';\n }else if($request->coupon_type == 4){\n $coupon_type_name = '积分兑换券';\n }else{\n return status(400, '类别有误');\n }\n DB::beginTransaction();\n try {\n $coupon = new Coupon();\n $coupon->coupon_sn = sn_20();\n $coupon->name = $request->name;\n $coupon->number = $request->number;\n $coupon->user_number = $request->user_number;\n $coupon->img = $request->img;\n $coupon->start_time = $request->start_time;\n $coupon->end_time = $request->end_time;\n $coupon->valid_type = $request->valid_type;\n $coupon->valid_start_time = $request->valid_start_time;\n $coupon->valid_end_time = $request->valid_end_time;\n $coupon->valid_day = $request->valid_day;\n if($request->pay_money > 0){\n $coupon->pay_type = 2;\n $coupon->pay_money = $request->pay_money;\n }else if($request->pay_money == 0){\n $coupon->pay_type = 1;\n }else{\n return status(400, '付费金额不合法');\n }\n $coupon->coupon_type = $request->coupon_type;\n $coupon->subject_type = $request->subject_type;\n $coupon->grant_type = $request->grant_type;\n $coupon->usable_range = $request->usable_range;\n $coupon->else_msg = $request->else_msg;\n $coupon->bc_msg = $request->bc_msg;\n $coupon_type = new Coupon_type();\n $coupon_type->coupon_type = $request->coupon_type;\n $coupon_type->coupon_type_name = $coupon_type_name;\n $coupon_type->money = $request->money;\n $coupon_type->full_money = $request->full_money;\n $coupon->save();\n $coupon_type->save();\n DB::commit();\n admin_log('添加优惠券:'.$request->name);\n return status(200, '添加成功');\n } catch (QueryException $ex) {\n DB::rollback();\n return status(400, '添加失败');\n }\n }",
"public function store(CouponRequest $request)\n {\n $coupon = new Coupon();\n $coupon->code = $request->code;\n $coupon->type = $request->type;\n $coupon->value = $request->value;\n $coupon->percent_off = $request->percent_off;\n $coupon->expiry_date = $request->expiry_date;\n $coupon->save();\n\n return redirect()->back()->with('success', 'coupon created successfully!');\n }",
"public function store(Request $request)\n {\n /* $coupon = Coupon::where('code',$request->coupon_code);\n if(!$coupon){\n return redirect()->route('checkout.index')->withErrors('Coupon not found.Please try again.');\n }\n session()->put('coupon',[\n 'name' => $coupon->code,\n 'discount' => $coupon->discount() ,\n ]);\n return redirect()->route('checkout.index')->with('success_message','Coupon added successfully!'); */\n }",
"public function createcoupon(){\n\t\tif($this->session->userdata('adminlogin')){\n\t\t\t//Set Validation Rules\n\t\t\t$this->form_validation->set_rules('txtCoupon', 'Coupon Code', 'trim|required|regex_match[/^[a-zA-z0-9]');\n\t\t\t$this->form_validation->set_rules('txtCouponName', 'Coupon Person Name', 'trim|regex_match[/^[a-zA-z ]');\n\t\t\t$this->form_validation->set_rules('txtCouponEmail', 'Coupon Person Email', 'trim|regex_match[/^([a-z0-9\\+_\\-]+)(\\.[a-z0-9\\+_\\-]+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6}$/ix]');\n\t\t\t$this->form_validation->set_rules('txtCouponPhone', 'Coupon Person Phone', 'trim|regex_match[((\\+*)((0[ -]+)*|(91 )*)(\\d{12}+|\\d{10}+))|\\d{5}([- ]*)\\d{6}]');\n\t\t\t$this->form_validation->set_rules('txtCouponDiscount', 'Discount Amount', 'trim|required|regex_match[regex_match[/^[0-9]');\n\t\t\t$this->form_validation->set_rules('ddlDiscountType', 'Coupon Discount', 'trim|required|regex_match[/^[a-z]');\n\n\t\t\tif($this->form_validation->run()==FALSE){\n\t\t\t\t$this->session->set_flashdata('error_log',validation_errors());\n\t\t\t\tredirect('admin/managecoupon');\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//Clean XSS Here\n\t\t\t\t$txtCoupon=$this->security->xss_clean($this->input->post('txtCoupon'));\n\t\t\t\t$txtCouponName=$this->security->xss_clean($this->input->post('txtCouponName'));\n\t\t\t\t$txtCouponEmail=$this->security->xss_clean($this->input->post('txtCouponEmail'));\n\t\t\t\t$txtCouponPhone=$this->security->xss_clean($this->input->post('txtCouponPhone'));\n\t\t\t\t$txtCouponDiscount=$this->security->xss_clean($this->input->post('txtCouponDiscount'));\n\t\t\t\t$ddlDiscountType=$this->security->xss_clean($this->input->post('ddlDiscountType'));\n\n\t\t\t\tif($this->admin_model->insertcoupon($txtCoupon,$txtCouponName,$txtCouponEmail,$txtCouponPhone,$txtCouponDiscount,$ddlDiscountType)){\n\t\t\t\t\t$this->session->set_flashdata('success_log','Coupon Code Create Successflly');\n\t\t\t\t\tredirect('admin/managecoupon');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->session->set_flashdata('error_log','Coupon Code Already Exist');\n\t\t\t\t\tredirect('admin/managecoupon');\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\telse{\n\t\t\tredirect('admin');\n\t\t}\n\t}",
"function insertUpdateCoupon()\n\t{ \n\t\t$ObjClsDBInteraction = new class_dbconnector();\n\t\t\n\t\tif(isset($this->start_date))\n\t\t$arr[\"start_date\"] \t\t = $this->start_date;\n\n\t\tif(isset($this->end_date))\n\t\t$arr[\"end_date\"] \t\t = $this->end_date;\n\t\t\n\t\tif(isset($this->available_items_id))\n\t\t$arr[\"item_id\"] \t\t = $this->available_items_id;\n\n \n\t\tif(isset($this->type_discout))\n\t\t$arr[\"discount_type\"] \t\t= $this->type_discout;\n\n\n\t\tif(isset($this->coupon_code) && $this->coupon_code!='')\n\t\t$arr[\"coupon_code\"] \t\t = $this->coupon_code;\n\t\t\n\t\tif(isset($this->seller_id) && $this->seller_id!='')\n\t\t$arr[\"seller_id\"] \t\t = $this->seller_id;\n\t\t\n\t\t\n\t\tif(isset($this->discount_amount) && $this->discount_amount!='')\n\t\t$arr[\"discount_amount\"] \t\t= $this->discount_amount;\n\t\n\t\tif(isset($this->coupon_id) && $this->coupon_id!=\"\")\n\t\t{\n\t\t\n\t\t\t $sWhere = \" coupon_id = '$this->coupon_id'\";\n\t\t\t $arr[\"coupon_date\"] = date(\"Y-m-d H:i:s\"); \n\t\t\t $nReturnValue = $ObjClsDBInteraction->insertUpdate(\"tbl_genrate_coupon\", $arr, $sWhere);\n\t\t\n\t\t\n\t\t}\n\t\telse\n\t\t{ \n\t\t\n\t\t\n\t\t //$arr[\"bid_status\"] \t\t \t= 0; // inactive product\n\t\t\t\n\t\t\t$arr[\"coupon_date\"] = date(\"Y-m-d H:i:s\"); \n\t\t\t$nReturnValue = $ObjClsDBInteraction->insertUpdate(\"tbl_genrate_coupon\", $arr, null);\n\t\t\t\n\t\t}\n\t \t$ObjClsDBInteraction->connection_close();\n\t\treturn $nReturnValue;\n\t}",
"function vifonic_ajax_add_coupon() {\n\t\tcheck_ajax_referer( 'ajax-add-coupon-nonce', 'security' );\n\n\t\t$coupon_code = isset($_POST['coupon_code']) ? $_POST['coupon_code'] : 0;\n\n\t\t$args = array(\n\t\t\t'post_type' => 'coupon',\n\t\t\t'post_status' => 'publish',\n\t\t\t'numberposts' => 1,\n\t\t\t'name' => sanitize_title($coupon_code),\n\t\t);\n\t\t$coupon = get_posts($args);\n\n\t\tif ( $coupon ) {\n\t\t\t$coupon_end = get_field('coupon_end', $coupon[0]->ID);\n\t\t\t$current_date = date('Ymd');\n\t\t\tif (strtotime($coupon_end) < strtotime($current_date)){\n\t\t\t\techo json_encode(array('success' => false, 'error' => __('Coupon has been expired!', 'vifonic') ));\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\tif(!isset($_COOKIE['coupon_list'])) {\n\t\t\t\t$coupon_list = array( $coupon_code );\n\t\t\t\tsetcookie('coupon_list', json_encode($coupon_list), time()+(60*60*24), \"/\");\n\t\t\t\techo json_encode( array('success' => true, 'message' => array( __('Coupon added!', 'vifonic')) ));\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$cookie = $_COOKIE['coupon_list'];\n\t\t\t\t$cookie = stripslashes($cookie);\n\t\t\t\t$coupon_list = json_decode($cookie, true);\n\t\t\t\tif (!in_array($coupon_code, $coupon_list)){\n\t\t\t\t\tarray_push($coupon_list, $coupon_code);\n\t\t\t\t}\n\t\t\t\tsetcookie('coupon_list', json_encode($coupon_list), time()+(60*60*24), \"/\");\n\t\t\t\techo json_encode( array('success' => true, 'message' => array( __('Coupon has been applied!', 'vifonic')) ));\n\t\t\t\tdie();\n\t\t\t}\n\t\t} else {\n\t\t\techo json_encode(array('success' => false, 'error' => __('Coupon not exists!', 'vifonic') ));\n\t\t\tdie();\n\t\t}\n\t}",
"public function store(CreateCouponRequest $request)\n {\n\n $httpClient = new Client;\n\n //name=my3+second+rule&description=my+first+rule&code=abc-xyz-123&start=2020-02-17&expiration=2020-02-17&fixed_discount=&percentage_discount=10&minimum_order=23&maximum_usage=10\n\n $data = array(\n 'name' => $request->get('code'),\n 'description' => $request->get('description'),\n 'code' => $request->get('code'),\n 'start' => $request->get('start'),\n 'expiration' => $request->get('expiration'),\n 'fixed_discount' => $request->get('discount_fixed'),\n 'percentage_discount' => $request->get('discount_percentage'),\n 'minimum_order' => $request->get('minimum_order_amount'),\n 'maximum_usage' => $request->get('maximum_usage'),\n\n );\n $queryString = http_build_query($data);\n\n try {\n $url = 'https://devsite.sololuxury.com/contactcustom/index/createCoupen?' . $queryString;\n $response = $httpClient->get($url);\n\n Coupon::create($request->all());\n return response(\n json_encode([\n 'message' => 'Created new coupon',\n 'body' => $response->getBody(),\n 'code' => $response->getStatusCode(),\n 'url' => $url,\n ])\n );\n } catch (Exception $e) {\n return response()->json(\n [\n 'message' => 'Unable to create coupon',\n 'error' => $e->getMessage(),\n ],\n 500\n );\n }\n }",
"public function updateData()\n\t{\n\t\t$readData = $_POST;\n\t\t$id = $readData['coupon_id'];\n\t\t$coupon_code = $readData['coupon_code'];\n\t\t$coupon_name = $readData['coupon_name'];\n\t\t$coupon_amt = $readData['coupon_amt'];\n\t\t$coupon_type = $readData['coupon_type'];\n\t\t$coupon_limit = $readData['coupon_limit'];\n\t\t$coupon_min_sales = $readData['coupon_min_sales'];\n\t\t$coupon_start = str_replace('/', '-', $readData['coupon_start']);\n\t\t$coupon_start = date(\"Y-m-d\",strtotime($coupon_start));\n\t\t$coupon_end = str_replace('/', '-', $readData['coupon_end']);\n\t\t$coupon_end = date(\"Y-m-d\",strtotime($coupon_end));\n\t\t$is_delete = 0;\n\t\t$is_status = 1;\n\t\t$usercreate = getSession();\n\n\t\tif(isset($id)):\n\n\t\t\t$form_data = array(\n\t\t\t\t'coupon_code'=>$coupon_code,\n\t\t\t\t'coupon_name'=>$coupon_name,\n\t\t\t\t'coupon_amt'=>$coupon_amt,\n\t\t\t\t'coupon_type'=>$coupon_type,\n\t\t\t\t'coupon_limit'=>$coupon_limit,\n\t\t\t\t'coupon_min_sales'=>$coupon_min_sales,\n\t\t\t\t'coupon_start'=>$coupon_start,\n\t\t\t\t'coupon_end'=>$coupon_end\n\t\t\t);\n\n\t\t\t$update = $this->updaterow('kp_coupon', $form_data, \"WHERE coupon_id = '$id'\");\n\n\t\tendif;\n\n\t\tif($update){\n\n\t\t\t//start function save log transection\n\t\t\t$desclog = \"แก้ไข [ Coupon ] ชื่อ $coupon_code\";\n\t\t\tsavelog(getSession(),$desclog);\n\t\t\t//end function save log transection\n\n\t\t\t$jsonstatus = \"success\";\n\t\t\t$jsonrespontext = \"Update [$coupon_code] success!\";\n\t\t\t$jsonmsg = \"แก้ไข ข้อมูล Coupon [$coupon_code] สำเร็จ!\";\n\t\t}else{\n\t\t\t$jsonstatus = \"error\";\n\t\t\t$jsonrespontext = \"Update [$coupon_code] error!\";\n\t\t\t$jsonmsg = \"ไม่สามารถ แก้ไขข้อมูล Coupon [$coupon_code] สำเร็จ กรุณาติดต่อ Support\";\n\t\t}\n\t\t$respon = array(\"status\"=>\"$jsonstatus\",\"respontext\"=>$jsonrespontext,\"msg\"=>\"$jsonmsg\",\"id\"=>$id);\n\t\techo json_encode($respon);\n\t}",
"function addCoupon(){\n\n\t\t$coupons = $GLOBALS['TSFE']->fe_user->getKey('ses','coupons');\n\n\t\t// added 6.04.2009 by Erik Frister\n\t\t// disables the coupon form when no coupons are set\n\t\t// requested by Kneipp - don't consider this permanent for the coupons extension\n\t\t/*\n\t\tif(is_array($coupons) && 0 < count($coupons)) {\n\t\treturn $this->pi_getLL('errorAlreadyAdded');\n\t\t}\n\t\t*/\n\t\t$code = $this->piVars['code'].$this->piVars['code2'];\n\t\t$type = $this->piVars['type'];\n\t\t\n\t\t// Ralf Merz 2010-02-20: only add one coupon, not more\n\t\tif(sizeof($coupons) == 0) {\n\t\t\t$codeData = $this->couponObj->addCoupon($code, false, $type);\n\t\t} else {\n\t\t\t$codeData ='';\n\t\t}\n\t\t\n//print 'after: <pre>';print_r($GLOBALS['TSFE']->fe_user->tx_commerce_basket);print '</pre><hr/>';\n\t\t#debug($this->piVars,'__piVars__');\n\t\t#debug($this->couponObj->addCoupon($code),'__ADDED__');\n\t\t#debug($codeData,'__ADDED__');\n\n\t\tif(is_array($codeData)){\n\n\n\t\t\tif($this->step == 'addCouponByAjax') {\t\t// return true (or false), so do the rest in your ajax function\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t/* CE added to \"recalulate\" delivery costs */\n\t\t\t\t$link = $this->pi_getPageLink($GLOBALS['TSFE']->id);\n\t\t\t\t$link = t3lib_div::locationHeaderUrl($link);\n\t\t\t\theader('Location: '.$link);\n\t\t\t}\n\n\t\t\treturn $this->addedCoupon($codeData);\n\n\n\t\t} else{\n\n\t\t\tif($this->step == 'addCouponByAjax') {\t\t// return true (or false), so do the rest in your ajax function\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t#debug($this->piVars,'__ERROR__');\n\t\t\t#debug($this->conf, '__CONF-ARRAY__');\n\n\t\t\t## original from Tom\n\t\t\t/*\n\t\t\t$template = $this->cObj->getSubpart($this->template,'###COUPON_ERROR###');\n\t\t\t$markerArray = $this->markerArray;\n\t\t\t$errorLink = $this->pi_linkToPage($this->pi_getLL('errorLink'),$this->conf['errorPID'],$target = '',$urlParameters = array());\n\t\t\t$markerArray['###ERRORLINK###'] = $this->pi_getLL('errorLinkBefor').$errorLink.$this->pi_getLL('errorLinkAfter');\n\t\t\t$markerArray['###HEADER###'] = $this->pi_getLL('errorHeader');\n\t\t\t$markerArray['###BACKLINK###'] = '<a href=\"javascript:history.back();\" title=\"'.$this->pi_getLL('back').'\">'.$this->pi_getLL('back').'</a>';\n\t\t\t$content = $this->cObj->substituteMarkerArrayCached($template,$markerArray , array());\n\n\n\t\t\treturn $content;\n\t\t\t*/\n\n\t\t\t// from Ralf Merz, taking an content element to configure error-message-text\n\t\t\t$template = $this->cObj->getSubpart($this->template,'###COUPON_ERROR###');\n\t\t\t$markerArray = $this->markerArray;\n\t\t\t#debug($markerArray);\n\t\t\t$markerArray['###URL###'] = $this->pi_getPageLink($GLOBALS['TSFE']->id);\n\n\t\t\t$errorLink = $this->pi_linkToPage($this->pi_getLL('errorLink'),$this->conf['errorPID'],$target = '',$urlParameters = array());\n\t\t\t$markerArray['###ERRORLINK###'] = $this->pi_getLL('errorLinkBefore').$errorLink.$this->pi_getLL('errorLinkAfter');\n\t\t\t$markerArray['###HEADER###'] = $this->pi_getLL('errorHeader');\n\t\t\t// the use of the backlink can now be de/activated by TYPOscript\n\t\t\t#debug($this->conf, 'conf array in pi1');\n\t\t\tif($this->conf['useBacklink'] == 0) {\n\t\t\t\t$markerArray['###BACKLINK###'] = '';\n\t\t\t} else {\n\t\t\t\t$markerArray['###BACKLINK###'] = '<a href=\"javascript:history.back();\" title=\"'.$this->pi_getLL('back').'\">'.$this->pi_getLL('back').'</a>';\n\t\t\t}\n\n\t\t\t$markerArray['###COUPON_ERROR_TEXT###'] = $this->pi_getLL('couponError' . $codeData);\n\t\t\t#$markerArray['###COUPON_ERROR_TEXT###'] = $this->cObj->cObjGetSingle($this->conf['errorText'],$this->conf['errorText.']);\n\t\t\t#debug($markerArray);\n\n\n\n\t\t\t$content = $this->cObj->substituteMarkerArrayCached($template,$markerArray , array());\n\n\t\t\treturn $content;\n\n\n\t\t\t#$this->makeError('beim hinzufügen des Gutscheins: Gutschein-Code ungültig. Bitte wenden Sie sich an unseren <a href=\"index.php?id=84\">Support</a>.');\n\t\t\t#return $this->showCouponForm();\n\t\t}\n\t}",
"public function editCoupon($EncryptCouponID = null) {\n $this->layout = \"admin_dashboard\";\n $storeId = $this->Session->read('admin_store_id');\n $merchantId = $this->Session->read('admin_merchant_id');\n $data['Coupon']['id'] = $this->Encryption->decode($EncryptCouponID);\n $this->loadModel('Coupon');\n $couponDetail = $this->Coupon->getCouponDetail($data['Coupon']['id'], $storeId);\n if ($this->request->is(array('post', 'put')) && $this->request->data) {\n $this->request->data = $this->Common->trimValue($this->request->data);\n $couponTitle = trim($this->request->data['Coupon']['name']);\n //$couponCode = trim($this->request->data['Coupon']['coupon_code']);\n $isUniqueName = $this->Coupon->checkCouponUniqueName($couponTitle, $storeId, $data['Coupon']['id']);\n //$isUniqueCode = $this->Coupon->checkCouponUniqueCode($couponCode, $storeId, $data['Coupon']['id']);\n if ($isUniqueName) {\n //if ($isUniqueCode) {\n if ($this->request->data['Coupon']['image']['error'] == 0) {\n $response = $this->Common->uploadMenuItemImages($this->request->data['Coupon']['image'], '/Coupon-Image/', $storeId, 480, 320);\n } elseif ($this->request->data['Coupon']['image']['error'] == 4) {\n $response['status'] = true;\n $response['imagename'] = '';\n }\n if (!$response['status']) {\n $this->Session->setFlash(__($response['errmsg']), 'alert_failed');\n } else {\n //Item Data\n if ($response['imagename']) {\n $coupondata['image'] = $response['imagename'];\n }\n if (!empty($this->request->data['Coupon']['days'])) {\n $this->request->data['Coupon']['days'] = implode(\",\", array_keys($this->request->data['Coupon']['days']));\n } else {\n $this->request->data['Coupon']['days'] = '';\n }\n $coupondata['store_id'] = $storeId;\n $coupondata['merchant_id'] = $merchantId;\n $coupondata['id'] = $data['Coupon']['id'];\n $coupondata['used_count'] = $this->request->data['Coupon']['used_count'];\n $coupondata['start_date'] = $this->Dateform->formatDate($this->request->data['Coupon']['start_date']);\n $coupondata['end_date'] = $this->Dateform->formatDate($this->request->data['Coupon']['end_date']);\n\n $coupondata['name'] = trim($this->request->data['Coupon']['name']);\n //$coupondata['coupon_code'] = trim($this->request->data['Coupon']['coupon_code']);\n $coupondata['number_can_use'] = $this->request->data['Coupon']['number_can_use'];\n $coupondata['discount_type'] = $this->request->data['Coupon']['discount_type'];\n $coupondata['discount'] = $this->request->data['Coupon']['discount'];\n $coupondata['is_active'] = $this->request->data['Coupon']['is_active'];\n $coupondata['allow_time'] = $this->request->data['Coupon']['allow_time'];\n $coupondata['start_time'] = $this->request->data['Coupon']['start_time'];\n $coupondata['end_time'] = $this->request->data['Coupon']['end_time'];\n $coupondata['days'] = $this->request->data['Coupon']['days'];\n if (isset($this->request->data['Coupon']['promotional_message']) && $this->request->data['Coupon']['promotional_message']) {\n $coupondata['promotional_message'] = trim($this->request->data['Coupon']['promotional_message']);\n }\n $this->Coupon->create();\n $this->Coupon->saveCoupon($coupondata);\n $this->Session->setFlash(__(\"Coupon Successfully Updated\"), 'alert_success');\n $this->redirect(array('controller' => 'coupons', 'action' => 'addCoupon'));\n }\n// } else {\n// $this->Session->setFlash(__(\"Coupon Code Already exists\"), 'alert_failed');\n// }\n } else {\n $this->Session->setFlash(__(\"Coupon Title Already exists\"), 'alert_failed');\n }\n }\n $start = \"00:00\";\n $end = \"24:00\";\n $timeRange = $this->Common->getStoreTimeAdmin($start, $end);\n $this->set('timeOptions', $timeRange);\n $this->request->data = $couponDetail;\n }",
"public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'coupon_code' => 'required|min:2|max:255',\n 'value' => 'required|integer',\n 'minimum' => 'required|integer',\n 'limit' => 'required|integer',\n 'status' => 'required',\n 'startDate' => 'required',\n 'expDate' => 'required',\n ]);\n\n if ($validator->fails()) {\n Session::flash('error', $validator->messages()->first());\n return redirect()->back()->withInput();;\n }\n // dd($request->all());\n $addCupon = New Coupon;\n $addCupon->type = $request->type;\n $addCupon->coupon_code = $request->coupon_code;\n $addCupon->minimum = $request->minimum;\n $addCupon->value = $request->value;\n $addCupon->limit = $request->limit;\n $addCupon->startDate = Carbon::parse($request->startDate . $request->startTime);\n $addCupon->expDate = Carbon::parse($request->expDate . $request->expTime);\n $addCupon->status = $request->status;\n $addCupon->save();\n\n if(!empty($request->branchs)){\n $addCupon->branch()->sync($request->branchs);\n }\n\n\n return redirect()->route('admin.coupon.index')->with('message', 'Create Coupon successful!');\n }",
"public function addCoupon()\r\n\t{\r\n\t\t$coupon_id = $this->uri->segment(4);\r\n\t\tif($coupon_id)\r\n\t\t{\r\n\t\t\tif($this->checkEditPermission())\r\n\t\t\t{\r\n\t\t\t\tif (isset($_POST['Submit']) && $_POST['Submit'] == \"Edit\") \r\n\t\t\t\t{\r\n\t\t\t\t\t$this->form_validation->set_rules($this->validation_rules['couponUpdate']);\r\n\t\t\t\t\tif($this->form_validation->run())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$post['coupon_id'] = $coupon_id;\r\n\t\t\t\t\t\t$post['coupon_code'] = $this->input->post('coupon_code');\r\n\t\t\t\t\t\t$post['coupon_value'] = $this->input->post('coupon_value');\r\n\t\t\t\t\t\t$post['coupon_start_date'] = $this->input->post('coupon_start_date');\r\n\t\t\t\t\t\t$post['coupon_end_date'] = $this->input->post('coupon_end_date');\r\n\t\t\t\t\t\t$post['coupon_type'] = $this->input->post('coupon_type');\r\n\t\t\t\t\t\t$post['coupon_status'] = $this->input->post('coupon_status');\r\n\t\t\t\t\t\t$post['coupon_updated_date'] = date('Y-m-d');\r\n\t\t\t\t\t\t$this->coupon_model->updateCoupon($post);\r\n\r\n\t\t\t\t\t\t$msg = 'Coupon update successfully!!';\t\t\t\t\t\r\n\t\t\t\t\t\t$this->session->set_flashdata('message', '<section class=\"content\"><div class=\"col-xs-12\"><div class=\"alert alert-success alert-dismissable\"><i class=\"fa fa-check\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>'.$msg.'</div></div></section>');\r\n\t\t\t\t\t\tredirect(base_url().'admin/coupon');\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->data['coupon_edit'] = $this->coupon_model->editCoupon($coupon_id);\r\n\t\t\t\t\t\t$this->data['user_list'] = $this->coupon_model->getAllUserList();\r\n\t\t\t\t\t\t$this->show_view_admin('admin/coupon_update', $this->data);\r\n\t\t\t\t\t}\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$this->data['coupon_edit'] = $this->coupon_model->editCoupon($coupon_id);\r\n\t\t\t\t\t$this->data['user_list'] = $this->coupon_model->getAllUserList();\r\n\t\t\t\t\t$this->show_view_admin('admin/coupon_update', $this->data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tredirect( base_url().'admin/dashboard/error/1');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif($this->checkAddPermission())\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\tif (isset($_POST['Submit']) && $_POST['Submit'] == \"Add\") \r\n\t\t\t\t{\r\n\t\t\t\t\t$this->form_validation->set_rules($this->validation_rules['couponAdd']);\r\n\t\t\t\t\tif($this->form_validation->run())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$post['added_by'] = $this->data['user_id'];\r\n\t\t\t\t\t\t$post['coupon_code'] = $this->input->post('coupon_code');\r\n\t\t\t\t\t\t$post['coupon_value'] = $this->input->post('coupon_value');\r\n\t\t\t\t\t\t$post['coupon_start_date'] = $this->input->post('coupon_start_date');\r\n\t\t\t\t\t\t$post['coupon_end_date'] = $this->input->post('coupon_end_date');\r\n\t\t\t\t\t\t$post['coupon_type'] = $this->input->post('coupon_type');\r\n\t\t\t\t\t\t$post['send_code_type'] = $this->input->post('send_code_type');\r\n\t\t\t\t\t\tif($post['send_code_type'] == 'custom')\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}\r\n\t\t\t\t\t\t$post['coupon_created_date'] = date('Y-m-d');\r\n\t\t\t\t\t\t$post['coupon_updated_date'] = date('Y-m-d');\r\n\t\t\t\t\t\t$coupon_id = $this->coupon_model->addCoupon($post);\r\n\r\n\t\t\t\t\t\tif($coupon_id)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msg = 'Coupon added successfully!!';\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->session->set_flashdata('message', '<section class=\"content\"><div class=\"col-xs-12\"><div class=\"alert alert-success alert-dismissable\"><i class=\"fa fa-check\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>'.$msg.'</div></div></section>');\r\n\t\t\t\t\t\t\tredirect(base_url().'admin/coupon');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msg = 'Whoops, looks like something went wrong!';\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->session->set_flashdata('message', '<section class=\"content\"><div class=\"col-xs-12\"><div class=\"alert alert-danger alert-dismissable\"><i class=\"fa fa-check\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>'.$msg.'</div></div></section>');\r\n\t\t\t\t\t\t\tredirect(base_url().'admin/coupon/coupon_add');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->data['user_list'] = $this->coupon_model->getAllUserList();\r\n\t\t\t\t\t\t$this->show_view_admin('admin/coupon_add', $this->data);\r\n\t\t\t\t\t}\t\t\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$this->data['user_list'] = $this->coupon_model->getAllUserList();\r\n\t\t\t\t\t$this->show_view_admin('admin/coupon_add', $this->data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tredirect( base_url().'admin/dashboard/error/1');\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function upload(){\n\n\t\t\n\t}",
"public function update(\\App\\Http\\Requests\\CouponRequest $request) {\n\n DB::beginTransaction();\n try {\n // process the store\n $data = $request->all();\n if (!empty($request['validationcheck']) && $request['validationcheck'] == 1) {\n $id = $data['coupon_id'];\n\n $coupon = Coupon::updateCoupon($data, $id);\n $file = Input::file('coupon_logo');\n //store image\n if (!empty($file)) {\n $this->addImageWeb($file, $coupon, 'coupon_logo');\n }\n }\n } catch (\\Exception $e) {\n DB::rollback();\n // throw $e;\n return response()->json(['status' => 0, 'message' => \\Config::get('constants.APP_ERROR')], 400);\n }\n // If we reach here, then// data is valid and working.//\n DB::commit();\n if (isset($coupon) && $coupon == true) {\n return response()->json(['status' => 1, 'message' => \\Config::get('constants.COUPON_UPDATE')], 200);\n }\n }",
"public function storeCoupon(CouponRequest $request)\n {\n try {\n DB::beginTransaction();\n //recibimos los valores introducidos en los inputs del form de crear cupón y guardamos en una variable\n $input = $this->couponInput();\n //creamos el cupón con los datos introducidos en el form de crear cupones\n $coupon = Coupon::create($input);\n //utilizamos el cupón con el método courses() que es la relación que creamos belongsToMany. usamos false para vincular la información\n $coupon->courses()->sync(request('courses'), false); \n DB::commit();\n\n session()->flash('message', ['success', __('Cupón creado correctgamente')]);\n\n return redirect(route('teacher.coupons.edit', ['coupon' => $coupon]));\n \n } catch (\\Throwable $exception) {\n DB::rollBack();\n session()->flash('message', ['danger', $exception->getMessage()]);\n return back();\n }\n }",
"function create_user_coupon( $student_id, $course_id ) {\n if ($student_id != null) {\n\t\t$current_user = wp_get_current_user();\n\t\t$user_email = $current_user->user_email;\n\t\t$coupon_code = $user_email;\n\t\t$amount = '50';\n\t\t$discount_type = 'fixed_product'; // Type: fixed_cart, percent, fixed_product, percent_product\n\t\t$expiry_date = date( 'Y-m-d', strtotime( '+7 days', current_time( 'timestamp' ) ) );\n\t\t\t\t\t\t\n\t\t$coupon = array(\n\t\t\t'post_title' => $coupon_code,\n\t\t\t'post_content' => '',\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_author' => 1,\n\t\t\t'post_type'\t\t=> 'shop_coupon'\n\t\t);\n\t\t\t\t\t\t\t\n\t\t$new_coupon_id = wp_insert_post( $coupon );\n\t\t\t\t\t\t\t\n\t\t// Add meta\n\t\tupdate_post_meta( $new_coupon_id, 'discount_type', $discount_type );\n\t\tupdate_post_meta( $new_coupon_id, 'coupon_amount', $amount );\n\t\tupdate_post_meta( $new_coupon_id, 'individual_use', 'no' );\n\t\tupdate_post_meta( $new_coupon_id, 'product_ids', '1845' );\n\t\tupdate_post_meta( $new_coupon_id, 'exclude_product_ids', '' );\n\t\tupdate_post_meta( $new_coupon_id, 'usage_limit', '' );\n\t\tupdate_post_meta( $new_coupon_id, 'expiry_date', $expiry_date );\n\t\tupdate_post_meta( $new_coupon_id, 'apply_before_tax', 'yes' );\n\t\tupdate_post_meta( $new_coupon_id, 'free_shipping', 'no' );\n\t\tupdate_post_meta( $new_coupon_id, 'customer_email', $user_email );\n\t}\n}",
"public function addCoupon( \\Shop\\Models\\Coupons $coupon )\r\n {\r\n // validate that the coupon can be added to this cart\r\n $coupon->cartValid( $this );\r\n \r\n // TODO push it into the coupons stack. automatic vs user coupons can be parsed on the usage_automatic field\r\n $exists = false;\r\n foreach ((array) $this->coupons as $key=>$item)\r\n {\r\n if ($item['code'] == $coupon->code)\r\n {\r\n $exists = true;\r\n break;\r\n }\r\n \r\n if( !empty( $coupon->generated_code ) && $coupon->generated_code == $item['generated_code'] ) {\r\n \t\t$exists = true;\r\n \t\tbreak;\r\n }\r\n }\r\n \r\n if (!$exists) \r\n {\r\n $cast = $coupon->cast();\r\n $cast['cart_totals_before_calculating_coupon_value'] = $this->totals();\r\n $cast['amount'] = $coupon->cartValue( $this );\r\n $this->coupons[] = $cast;\r\n }\r\n\r\n return $this->save();\r\n }",
"function create_birthday_coupon($user_id) {\n$coupon_code = 'happy_birthday_'.date(Y).\"_\".$user_id; // Code\n$amount = '10'; // Amount\n$discount_type = 'fixed_cart'; // Type: fixed_cart, percent, fixed_product, percent_product\n\t\t\t\t\t\n$coupon = array(\n\t'post_title' => $coupon_code,\n\t'post_content' => '',\n\t'post_status' => 'publish',\n\t'post_author' => 1,\n\t'post_type'\t\t=> 'shop_coupon'\n);\n\t\t\t\t\t\n$new_coupon_id = wp_insert_post( $coupon );\n\t\t\t\t\t\n// Add meta\nupdate_post_meta( $new_coupon_id, 'discount_type', $discount_type );\nupdate_post_meta( $new_coupon_id, 'coupon_amount', $amount );\nupdate_post_meta( $new_coupon_id, 'individual_use', 'no' );\nupdate_post_meta( $new_coupon_id, 'product_ids', '' );\nupdate_post_meta( $new_coupon_id, 'exclude_product_ids', '' );\nupdate_post_meta( $new_coupon_id, 'usage_limit', '' );\nupdate_post_meta( $new_coupon_id, 'expiry_date', '' );\nupdate_post_meta( $new_coupon_id, 'apply_before_tax', 'yes' );\nupdate_post_meta( $new_coupon_id, 'free_shipping', 'no' );\n\n return $coupon_code;\n}",
"public function store(Request $request)\n {\n //dd($request->all());\n $request->validate([\n 'coupon_name' => 'required|unique:coupons|max:255',\n 'coupon_price'=>'required',\n 'date'=>'required',\n \n ]);\n //dd($request->all());\n $coupon=new Coupon();\n $coupon->coupon_name = $request->coupon_name;\n $coupon->coupon_price = $request->coupon_price;\n $coupon->active_or_deactivate = $request->active_or_deactive;\n $coupon->expired_date = $request->date;\n $coupon->save();\n Toastr::info('Coupon saved Successfully', '', [\"positionClass\" => \"toast-top-center\",'progressBar'=> true, 'showDuration'=> 20,]);\n return back();\n }",
"function add_coupon($data) {\n\t\t$this->db->insert ( 'coupons', $data );\n\t\treturn $this->db->insert_id ();\n\t}",
"public function applyCoupon()\n {\n if($this->hasCoupon)\n {\n if($this->hasCoupon->type == 'product')\n {\n $this->couponForProduct();\n }\n elseif($this->hasCoupon->type == 'shipping')\n {\n session(['noShipping' => 'noShipping']);\n }\n else\n {\n $this->couponGlobal();\n }\n }\n }"
] | [
"0.7062263",
"0.6948233",
"0.6638299",
"0.65780145",
"0.64584243",
"0.64404833",
"0.6420892",
"0.6352134",
"0.63335025",
"0.6287314",
"0.62539876",
"0.6250572",
"0.62051016",
"0.6195558",
"0.6171973",
"0.61598396",
"0.6154418",
"0.61428785",
"0.61208445",
"0.6108161",
"0.61030346",
"0.60703474",
"0.60575163",
"0.60564744",
"0.60560745",
"0.6029666",
"0.59996086",
"0.59934723",
"0.5992049",
"0.59831715"
] | 0.75459653 | 0 |
This Function To Delete coupon Image | public function deletecouponimage($id,$image){
$this->admin_model->deletecouponimage($id,$image);
$this->session->set_flashdata('error_log', 'Coupon Image Deleted');
redirect('admin/managecoupon','refresh');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteCouponPhoto($EncryptCouponID = null) {\n $this->autoRender = false;\n $this->layout = \"admin_dashboard\";\n $data['Coupon']['store_id'] = $this->Session->read('admin_store_id');\n $data['Coupon']['id'] = $this->Encryption->decode($EncryptCouponID);\n $data['Coupon']['image'] = '';\n if ($this->Coupon->saveCoupon($data)) {\n $this->Session->setFlash(__(\"Coupon Image deleted\"), 'alert_success');\n $this->redirect(array('controller' => 'coupons', 'action' => 'editCoupon', $EncryptCouponID));\n } else {\n $this->Session->setFlash(__(\"Some problem occured\"), 'alert_failed');\n $this->redirect(array('controller' => 'coupons', 'action' => 'editCoupon', $EncryptCouponID));\n }\n }",
"public function DeleteImage()\n\t{\t\n\t\t// === GET ID === //\n\t\t$id = $this->segment_item;\n\t\t\n\t\t$this->companies_model->RemovePostImage($id);\n\t\t\n\t\tredirect($this->_getBaseURI().\"/edit/$this->segment_orderby/\".$this->segment_orderseq.\"/\".$this->segment_offset.\"/\".$id);\n\t}",
"public function Delete_Additional_Image()\n\t{\t\n\t\t// === GET ID === //\n\t\t$id = $this->segment_item;\n\t\t\n\t\t$image_id = $this->uri->segment($this->_getSegmentsOffset()+7);\n\t\t\n\t\tif(!$image_id) redirect($this->_getBaseURI());\n\t\t\n\t\t$this->companies_model->RemoveAdditionalImage($image_id);\n\t\t\n\t\tredirect($this->_getBaseURI().\"/edit/$this->segment_orderby/\".$this->segment_orderseq.\"/\".$this->segment_offset.\"/\".$id);\n\t}",
"public function picture_delete ()\n {\n $picture = $this->products::PICTURE_PATH . $this->upload->data('file_name') ?? '';\n if (is_file($picture)) unlink ($picture);\n }",
"public function deleteimageAction()\r\n {\r\n $path = Mage::getBaseDir();\r\n $attributeId = $this->getRequest()->getPost('aId');\r\n $optionId = $this->getRequest()->getPost('oId');\r\n $imageDirectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS;\r\n $imageDirectory = $imageDirectory . DS . $optionId . DS . 'img';\r\n unlink($imageDirectory);\r\n $optionDriectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS . $optionId;\r\n rmdir($optionDriectory);\r\n $attributeDirectory = $path . DS . 'media' . DS . 'colorswatch' . DS . $attributeId . DS;\r\n rmdir($attributeDirectory);\r\n }",
"public function removeImage () {}",
"public function deleteImage()\n {\n $this->setValue($this->options['emptyReturn']);\n unlink($this->options['wwwDir'] . $this->hidden);\n $this->hidden = null;\n }",
"public function deleteImage()\n {\n Storage::delete($this->image);\n }",
"public function deleteImage()\n {\n Storage::delete($this->image);\n }",
"public function deleteImage()\n {\n Storage::delete($this->image);\n }",
"public function removeImage() {\n\t}",
"function unlink_image_bank($img_id){\t\t\t\t\t\n\t\t$this->Campaign_Model->delete_image_bank(array('img_id'=>$img_id));\t\t\n\t}",
"public function deleteImage(){\n\t\t$img=ProductImage::find(Input::get('id'));\n\t\tunlink('img/p/'.$img['image']);\t\t\n\t\t$img->delete();\n\t\t\n\t\treturn '';\n\t}",
"public function deleteImage()\n\t{\n\t\t$file = $this->getImagePath() . $this->getImageFilename();\n\n\t\tif(file_exists($file))\n\t\t{\n\t\t\tunlink($file);\n\t\t\t$this->image_filename = '';\n\t\t}\n\t}",
"function deleteTradeItemImage() {\r\n \r\n \r\n $userID = buckys_is_logged_in();\r\n \r\n if (!$userID)\r\n return;\r\n \r\n $imgFile = @$_REQUEST['file'];\r\n $paramItemID = get_secure_integer($_REQUEST['itemID']);\r\n $rootPath = rtrim(DIR_FS_ROOT, '/');\r\n //remove image files\r\n if ($imgFile != '') {\r\n @unlink($rootPath . $imgFile);\r\n \r\n //update DB if it is edit action.\r\n if (isset($paramItemID) && is_numeric($paramItemID)) {\r\n $tmpStrPath = str_replace(DIR_FS_TRADE_IMG, '/', DIR_FS_TRADE_IMG_TMP);\r\n if (strpos($imgFile, $tmpStrPath) === false) {\r\n $thumbPathInfo = pathinfo($imgFile);\r\n $thumbFileName = $thumbPathInfo['dirname'] . \"/\" . $thumbPathInfo['filename'] . TRADE_ITEM_IMAGE_THUMB_SUFFIX . \".\" . $thumbPathInfo['extension'];\r\n \r\n @unlink($rootPath . $thumbFileName);\r\n \r\n $tradeItemIns = new BuckysTradeItem();\r\n $itemData = $tradeItemIns->getItemById($paramItemID);\r\n if (isset($itemData)) {\r\n $imageList = explode('|', $itemData['images']);\r\n \r\n if (count($imageList) > 0) {\r\n $newImageList = array();\r\n foreach ($imageList as $imgUrl) {\r\n if ($imgUrl == $imgFile)\r\n continue;\r\n $newImageList[] = $imgUrl;\r\n }\r\n \r\n $newImageStr = implode(\"|\", $newImageList);\r\n \r\n }\r\n \r\n $tradeItemIns->updateItem($paramItemID, array('images'=>$newImageStr));\r\n \r\n }\r\n \r\n }\r\n }\r\n \r\n \r\n }\r\n}",
"public function deletePicture()\n {\n $myConfig = $this->getConfig();\n\n if ($myConfig->isDemoShop()) {\n // disabling uploading pictures if this is demo shop\n $oEx = oxNew(\"oxExceptionToDisplay\");\n $oEx->setMessage('ARTICLE_PICTURES_UPLOADISDISABLED');\n oxRegistry::get(\"oxUtilsView\")->addErrorToDisplay($oEx, false);\n\n return;\n }\n\n $sOxId = $this->getEditObjectId();\n $iIndex = oxRegistry::getConfig()->getRequestParameter(\"masterPicIndex\");\n\n $oArticle = oxNew(\"oxarticle\");\n $oArticle->load($sOxId);\n\n if ($iIndex == \"ICO\") {\n // deleting main icon\n $this->_deleteMainIcon($oArticle);\n } elseif ($iIndex == \"TH\") {\n // deleting thumbnail\n $this->_deleteThumbnail($oArticle);\n } else {\n $iIndex = (int) $iIndex;\n if ($iIndex > 0) {\n // deleting master picture\n $this->_resetMasterPicture($oArticle, $iIndex, true);\n }\n }\n\n $oArticle->save();\n }",
"public function deleteImage()\n {\n if(!$this->hasImage()->exists()){\n return;\n }\n\n Storage::disk('public')->delete($this->hasImage->name);\n $this->hasImage()->delete();\n }",
"function delete_img_emty()\n{\n\t// get link\n \t$path_file = FCPATH . 'api/users/avatar/';\n \t// get name images in folder\n \t$files1 = array_slice(scandir('api/users/avatar'),2);\n \t// get link images in database\n \t$datas = $this->Users_Model->get_img_all();\n \t$img_name = [];\n\n \tforeach ($datas as $data) {\n \t\t// get name images in database\n \t\t$img_name[] = str_replace('users/avatar/',\"\", $data->avatar);\n \t}\n\n \tfor($i = 0; $i < count($files1); $i++)\n \t{\n \t\t// check \n \t\tif(!in_array($files1[$i], $img_name))\n \t\t{\n \t\t\t$file = $path_file.$files1[$i];\n \t\t\tif(file_exists($file)) {\n \t\t\t\t// remove images in folder\n\t \t\t\tunlink($file);\n\t \t\t}\n \t\t}\n \t}\n\n}",
"protected function _delete()\n\t{\n\t\t$image = $this->_images->fetchImage( intval( $this->request['imageid'] ) );\n\t\t$album = $this->_albums->fetchAlbumsById( $image['img_album_id'] );\n\t\t\n\t\tif ( empty( $image['id'] ) )\n\t\t{\n\t\t\t$this->registry->output->showError( 'no_permission', 10790 );\n\t\t}\n\t\t\n\t\tif ( ! $this->_albums->canModerate( $album ) AND ( $image['member_id'] != $this->memberData['member_id'] ) )\n\t\t{\n\t\t\t$this->registry->output->showError( 'no_permission', 10790 );\n\t\t}\n\t\t\n\t\t/* Had enough now, just get rid of it */\n\t\t$this->_moderate->deleteImages( array( $image['id'] => $image ) );\n\t\t\n\t\t/* Back */\n\t\tif ( $this->request['modcp'] )\n\t\t{\n\t\t\t$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=modcp&fromapp=gallery&tab=' . $this->request['modcp'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=gallery&album=' . $album['album_id'], $album['album_name_seo'], false, 'viewalbum' );\n\t\t}\n\t}",
"public function remove_image() {\n $ad = $this->ad_protected_for_current_user($this->params['id']);\n $ad->remove_image($this->params['image_id']);\n redirect('/ads/edit', ['notice' => 'Image successfully removed.'], ['id' => $ad->id]);\n }",
"private function deleteImage()\n\t\t{\n\t\t\t$directory = FN::getSessionValue(\"img-dir\");\n\t\t\t$name = FN::sanitise($_REQUEST['name']);\n\t\t\tunlink(\"$directory/$name\");\n\t\t}",
"public function deletImage($id)\n {\n\n $ProductImage = banner::where(['id'=>$id])->first();\n\n //2-) get the images paths\n $image_path = 'images/images_frontend/banners/';\n\n //3-) check if the image name is exists then delete it\n // delete larg image\n if(file_exists($image_path.$ProductImage->image)){\n // unlink uses to delete the image from the main file\n unlink($image_path.$ProductImage->image);\n }\n banner::where(['id' => $id])->update(['image' => '']);\n return redirect()->back()->with('success', 'Your Image has been Deleted');\n }",
"function actionRemoveImage(){\r\n $this->clubDatas = $this->_oDb->getEntryById($_POST['club_id']);\r\n $this->removeClubCoverBackground();\r\n }",
"function delete_image()\n {\n if (isset($_POST['remove'])) {\n global $wpdb;\n $img_path = $_POST['path'];\n\n // get the images meta ID.\n $query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n $results = $wpdb->get_results($query);\n\n // delete images meta\n foreach ($results as $row) {\n wp_delete_attachment($row->ID); //delete the image and also delete the attachment from the Media Library.\n }\n delete_option('ink_image'); //delete image path from database.\n }\n }",
"function businessImgUnlink()\n\t{\n\t//\tprint_r($_REQUEST);\n\t\tif(isset($_REQUEST['business_img']))\n\t\t{\n\t\t\t$business_img = $_REQUEST['business_img'];\n\t\t\t$img_id = $_REQUEST['img_id'];\n\t\t\t$vac_id = $_REQUEST['vac_id'];\n\t\t\t$return = $this->deleteImage($img_id, $business_img);\n\t\t\t$countcls = $this->model->get_data('*','tbl_vacation_list_images', array('vac_id' => $vac_id));\n\t\t\techo count($countcls);\n\t\t}\n\t}",
"public function Delete(){\n\t\t$file = $this->imagesPath.$this->filename; \n\t\tif(file_exists($file))\n\t\t\tunlink($file);\n\t\tparent::Delete();\n\t}",
"public function delImage()\n\t{\n\t\tif (isset($_POST['file']) && $_POST['file'] != '')\n\t\t{\n\t\t\t$userID = Auth::user()->id;\n\t\t\t//disect the URL\n\t\t\t$temp = explode(\"/\", $_POST['file']);\n\t\t\t$fileName = array_pop( $temp );\n\t\t\t$userDirID = array_pop( $temp );\n\t\t\t//make sure this is the user's images\n\t\t\tif ($userID == $userDirID)\n\t\t\t{\n\t\t\t\t//all good, remove!\n\t\t\t\t$images_uploadDir = Setting::where('name', 'images_uploadDir')->first();\n\t\t\t\tunlink( './'. $images_uploadDir->value . '/' . $userID. '/' . $fileName );\n\t\t\t}\n\t\t}\n\t}",
"public function afterDelete()\n {\n parent::afterDelete();\n\n if ($this->image) {\n @unlink(Yii::getAlias('@webroot').$this->image);\n }\n }",
"public function removeImageAction()\n {\n Pi::service('log')->mute();\n\n $id = $this->params('id', 0);\n $fakeId = $this->params('fake_id', 0);\n $affectedRows = 0;\n $module = $this->getModule();\n\n if ($id) {\n $rowAuthor = $this->getModel('author')->find($id);\n\n if ($rowAuthor && $rowAuthor->photo) {\n // Delete photo\n @unlink(Pi::path($rowAuthor->photo));\n\n // Update db\n $rowAuthor->photo = '';\n $affectedRows = $rowAuthor->save();\n }\n } elseif ($fakeId) {\n $session = Media::getUploadSession($module, 'author');\n\n if (isset($session->$fakeId)) {\n $uploadInfo = isset($session->$id)\n ? $session->$id : $session->$fakeId;\n\n @unlink(Pi::path($uploadInfo['tmp_name']));\n\n unset($session->$id);\n unset($session->$fakeId);\n }\n }\n\n echo json_encode([\n 'status' => $affectedRows ? true : false,\n 'message' => 'ok',\n ]);\n exit;\n }",
"public function delete_coupon() //delete coupons\n {\n $getid = $this->input->get('coupon_id');\n $this->db->where('coupon_id', $getid);\n $this->db->delete('coupon');\n }"
] | [
"0.7847176",
"0.7623898",
"0.73933977",
"0.7341144",
"0.7237194",
"0.722827",
"0.7187374",
"0.7178992",
"0.7178992",
"0.7178992",
"0.70950466",
"0.7040098",
"0.70351446",
"0.7021341",
"0.7003437",
"0.69468206",
"0.68529356",
"0.68481797",
"0.68320894",
"0.68276584",
"0.6801986",
"0.67958045",
"0.67828727",
"0.67563075",
"0.67187977",
"0.67171556",
"0.6702363",
"0.6685065",
"0.6659267",
"0.66534376"
] | 0.81868297 | 0 |
Set CRLF line ending | public function setLineEndings($data)
{
$data = str_replace("\n", "\r\n", $data);
return $data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCrlf($crlf)\n {\n $this->_crlf = $crlf;\n }",
"public function writeEOL()\n {\n $this->write(PHP_EOL);\n }",
"public function LF(): self\n {\n $this->text .= self::LINE_FEED;\n return $this;\n }",
"function _setEOL($eol)\n\t{\n\t\t$this->_eol = $eol;\n\t\tif (!defined('MAIL_MIME_CRLF')) {\n\t\t\tdefine('MAIL_MIME_CRLF', $this->_eol, true);\n\t\t}\n\t}",
"private function getEOL()\n {\n return \";\\n\";\n }",
"function newline()\r\n\t\t{\r\n\t\t\t$this->data .= \"\\r\\n\";\r\n\t\t}",
"public function newLine()\n {\n $this->out(\"\\n\");\n }",
"public static function getNewLine()\n {\n if ( defined('PHP_EOL') ) return PHP_EOL;\n $os = self::getOsType();\n switch ($os) {\n case self::OS_TYPE_MAC_OS:\n return \"\\r\";\n case self::OS_TYPE_WINDOWS:\n return \"\\r\\n\";\n default:\n return \"\\n\";\n }\n }",
"protected function terminateLine()\n {\n if ($this->isInline) {\n $this->writeToFile('<br>');\n }\n }",
"public function lineBreak();",
"function FixEOL($str) {\n $str = str_replace(\"\\r\\n\", \"\\n\", $str);\n $str = str_replace(\"\\r\", \"\\n\", $str);\n $str = str_replace(\"\\n\", $this->LE, $str);\n return $str;\n }",
"public function setEOL(string $eol=PHP_EOL) {\n $this->params[self::EOL] = $eol;\n }",
"public function newLine()\n {\n if ($this->isVerboseOutput()) {\n $this->output->write(str_repeat(PHP_EOL, 1));\n }\n }",
"public function eol()\n {\n return PHP_EOL;\n }",
"public function newLine()\n {\n return \"\\n\";\n }",
"function csv_get_newline() {\r\n\t\treturn \"\\r\\n\";\r\n\t}",
"public function getCrlf()\n {\n return $this->_crlf;\n }",
"private function add_new_line()\n\t{\n\t\tif (!(substr($this->line, -1) == \"\\n\")) $this->line .= \"\\n\";\n\t}",
"function getEOL()\n{\n if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {\n return \"\\r\\n\";\n } elseif (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) {\n return \"\\r\";\n } else {\n return \"\\n\";\n }\n}",
"public function setEOL($string) {\n\t\t$this->eol = $string;\n\t\treturn $this;\n\t}",
"protected function toCRLF ($text)\n\t{\n\t\treturn preg_replace ('/\\r\\n|\\r|\\n/', \"\\r\\n\", $text);\n\t}",
"public function formatBreak() {\n $this->textBuf .= $this->getParam(self::EOL);\n $this->newBreak = true;\n }",
"function clientCRLF()\n{\n\t$ua = $_SERVER['HTTP_USER_AGENT'];\n\n\tif (stripos($ua, \"Windows\") !== false\n\t\t|| stripos($ua, \"OS X\") !== false)\n\t\treturn \"\\r\\n\";\t// Windows, Mac OS X+\n\telseif (stripos($ua, \"Macintosh\") !== false)\n\t\treturn \"\\r\";\t// Mac < OS X\n\telse\n\t\treturn \"\\n\";\t// Linux, FreeBSD, etc.\n}",
"function convert_to_php_eol($string) {\n\t\t\tif (is_string($string)) {\n\t\t\t\t// In PHP, \\n is guaranteed to be LF (0x0A) and \\r is guaranteed to be CR (0x0D)\n\t\t\t\t// PHP_EOL will return the system-dependent newline character(s)\n\t\t\t\t$string = str_replace(\"\\r\\n\", \"\\n\", $string); // change CRLF to LF\n\t\t\t\t$string = str_replace(\"\\r\", \"\\n\", $string); // change CR by itself to LF\n\t\t\t\tif ( @preg_match('/\\p{L}/u', 'a') ) { // if PCRE has been compiled with unicode support\n\t\t\t\t\t// http://en.wikipedia.org/wiki/Newline#Unicode\n\t\t\t\t\t//$string = preg_replace('/\\x{000D}\\x{000A}/u', \"\\n\", $string); // change CRLF to LF\n\t\t\t\t\t//$string = preg_replace('/\\x{000D}/u', \"\\n\", $string); // change CR to LF\n\t\t\t\t\t$string = preg_replace('/\\x{0085}/u', \"\\n\", $string); // change NEL to LF\n\t\t\t\t\t$string = preg_replace('/\\x{000C}/u', \"\\n\", $string); // change FF to LF\n\t\t\t\t\t$string = preg_replace('/\\x{2028}/u', \"\\n\", $string); // change LS to LF\n\t\t\t\t\t$string = preg_replace('/\\x{2029}/u', \"\\n\", $string); // change PS to LF\n\t\t\t\t}\n\t\t\t\t$string = str_replace(\"\\n\", PHP_EOL, $string); // finally, change LF to PHP_EOL\n\t\t\t}\n\t\t\treturn $string;\n\t\t}",
"public function setEndMultiLine($endMultiLine);",
"protected function newLine()\n\t{\n\t\t$this->lines[] = $this->line;\n\t\t$this->line = new SourceCodeLine($this->standard->getIndentationCharacter(),\n\t\t\t$this->standard->getIndentationWidth(), $this->standard->getIndentation());\n\t}",
"public function setLine(int $newLine): void;",
"private function newLine(): void\n {\n //if ($this->y < $this->max_y) {\n // $this->y++;\n //}\n\n while ($this->y >= $this->max_y) {\n $this->history = array_merge($this->history, [array_shift($this->screen)]);\n $this->screen[] = '';\n\n $this->history_attrs = array_merge($this->history_attrs, [array_shift($this->attrs)]);\n $this->attrs[] = $this->attr_row;\n\n if (count($this->history) >= $this->max_history) {\n array_shift($this->history);\n array_shift($this->history_attrs);\n }\n\n $this->y--;\n }\n $this->y++;\n }",
"public function toEndLine(): void\n\t{\n\t\t$this->response->write(\"\\033[K\");\n\t}",
"public function newLine()\r\n\t{\r\n\t\t$this->_lineBody++;\r\n\t\t\r\n\t\t// on vérifie _maxCols et on reset _currentCols\r\n\t\t$this->_maxCols = max(array($this->_currentCol, $this->_maxCols));\r\n\t\t$this->_currentCol = 0;\r\n\t}"
] | [
"0.7425177",
"0.70747626",
"0.6938587",
"0.6923311",
"0.6866676",
"0.6746385",
"0.6659542",
"0.66302377",
"0.6624948",
"0.6588972",
"0.6579069",
"0.65060025",
"0.6485286",
"0.6483578",
"0.6473274",
"0.6431731",
"0.64051956",
"0.6394229",
"0.63566065",
"0.63024473",
"0.62589806",
"0.6126854",
"0.61204755",
"0.6075286",
"0.60683334",
"0.60417515",
"0.6024003",
"0.6004152",
"0.6000604",
"0.59908444"
] | 0.72573686 | 1 |
Register a shortcode, and attach it to a PHP callback. | public function register($shortcode, $callback)
{
if (is_callable($callback))
self::$shortcodes[$shortcode] = $callback;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function register_shortcode() {\n add_shortcode( self::SHORTCODE_TAG, array( &$this, 'do_shortcode' ) );\n }",
"public function register_shortcode($shortcode_name) {\n add_shortcode($shortcode_name, $this->get_callback($shortcode_name));\n }",
"protected function shortcode($code, $callback = NULL) {\n\t\t\tif (!$callback) $callback = 'shortcode_' . $code;\n\t\t\tadd_shortcode($code, array(&$this, $callback));\n\t\t}",
"function register_shortcodes(){\n\n // add_shortcode('shortcode', 'shortcode_function');\n\n}",
"public function add_shortcode($shortcode_name, $callback) {\n if (isset($this->shortcodes[$shortcode_name]))\n return false;\n $shortcode = new Add_Shortcode($shortcode_name, $callback);\n $this->shortcodes[$shortcode_name] = $shortcode;\n $this->register_shortcode($shortcode_name);\n return $shortcode;\n }",
"public function register_shortcode() {\n\t\tadd_shortcode( 'column', array( &$this, 'do_shortcode' ) );\n\t}",
"public function shortcode($code, $callback) {\n\t\t\tadd_shortcode($code, function($args, $content = '') use ($callback) {\n\t\t\t\tob_start();\n\t\t\t\tcall_user_func($callback, $args, $content);\n\t\t\t\treturn ob_get_clean();\n\t\t\t});\n\t\t}",
"public function add_shortcode()\n {\n add_shortcode( 'ref', [ $this, 'shortcode' ] );\n }",
"public function register() {\n\t\tforeach ( $this->all() as $shortcode ) {\n\t\t\tadd_shortcode( $shortcode::NAME, [ $shortcode, 'render' ] );\n\t\t}\n\t}",
"function register_youtube_shortcode()\n{\n add_shortcode( 'youtube', 'youtube_callback_shortcode_qwe');\n}",
"protected function register_shortcodes() {}",
"private function register_shortcodes() {\n $shortcode_controller = self::get_controller( 'Frontend_Shortcode' );\n // add 'free to read' shortcodes\n LaterPay_Hooks::add_wp_shortcode( 'laterpay_premium_download', 'laterpay_shortcode_premium_download' );\n LaterPay_Hooks::add_wp_shortcode( 'laterpay', 'laterpay_shortcode_laterpay' );\n LaterPay_Hooks::add_wp_shortcode( 'laterpay_time_passes', 'laterpay_shortcode_time_passes' );\n LaterPay_Hooks::add_wp_shortcode( 'laterpay_redeem_voucher', 'laterpay_shortcode_redeem_voucher' );\n LaterPay_Hooks::add_wp_shortcode( 'laterpay_time_pass_purchase', 'laterpay_shortcode_time_pass_purchase' );\n LaterPay_Hooks::add_wp_shortcode( 'laterpay_subscription_purchase', 'laterpay_shortcode_subsription_purchase' );\n LaterPay_Hooks::add_wp_shortcode( 'laterpay_check_access', 'laterpay_shortcode_check_access' );\n LaterPay_Hooks::add_wp_shortcode( 'laterpay_contribution', 'laterpay_shortcode_contribution' );\n\n laterpay_event_dispatcher()->add_subscriber( $shortcode_controller );\n }",
"function register_squaree_shortcode()\n{\n add_shortcode( 'squaree', 'squaree_callback_shortcode_qwe');\n}",
"function donate_test_app_register_shortcodes(){\n // Adds a new shortcode\n // add_shortcode( string $tag, callable $callback )\n // https://developer.wordpress.org/reference/functions/add_shortcode\n add_shortcode( 'donate-test-app', 'donate_test_app_callback' );\n}",
"function tsc_shortcode_cb( $atts, $content ){\n\t$atts = shortcode_atts( array(\n\t\t'require' => 'no',\n\t), $atts, 'tsc_cb' );\n\t\n\t$name = tsc_shortcode_init();\n\t\n\t//not done yet\n}",
"function register_squares_shortcode()\n{\n add_shortcode( 'squares', 'squares_callback_shortcode_qwe');\n}",
"public static function register_shortcode($atts, $content = '')\n {\n $disable_registration = intval(PeepSo::get_option('site_registration_disabled', 1));\n if (1 === $disable_registration) {\n PeepSo::redirect(PeepSo::get_page('activity'));\n die();\n }\n $sc = self::get_instance()->sc;\n if (is_null($sc)) {\n $sc = new PeepSoRegisterShortcode();\n }\n return ($sc->do_shortcode($atts, $content));\n }",
"public function add($shortcode, $fn, $args = [])\n {\n \\add_shortcode($shortcode, function ($atts = []) use ($fn, $args) {\n if (!empty($args))\n {\n $atts = $this->renameArguments($args, $atts);\n }\n\n call_user_func_array([$this->api, $fn], $atts);\n });\n }",
"function shortcode( $atts ) {\n \textract( shortcode_atts( array(\n \t\t'caption' => 'Subscribe'\n \t), $atts ) );\n\n \treturn \"<input type=\\\"button\\\" onclick=\\\"(function(){var z=document.createElement('script');z.src='https://www.subtome.com/load.js';document.body.appendChild(z);})()\\\" value=\\\"$caption\\\">\";\n }",
"public function init__add_shortcode() {\n\n\t\tif ( shortcode_exists( 'ubc_template' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_shortcode( 'ubc_template', array( $this, 'add_shortcode__ubc_template' ) );\n\n\t}",
"function clb_register_shortcodes() {\n\t\n\tadd_shortcode('clb_form', 'clb_form_shortcode');\n\t\n}",
"function bbp_register_shortcodes()\n{\n}",
"function register_wiki_shortcode()\n{\n add_shortcode( 'wiki', 'wiki_callback_shortcode_qwe');\n}",
"function shortcode_function($attrs) {\n\n}",
"public function addShortCode($shortcode, $function = false) {\n\t $name = 'SwiftPageBuilderShortcode_' . $shortcode['base'];\n\t if( class_exists( $name ) && is_subclass_of( $name, 'SwiftPageBuilderShortcode' ) ) $this->shortcodes[$shortcode['base']] = new $name($shortcode);\n\t }",
"public function registerShortCodes(){\n\t\tadd_shortcode('astrology-chart', array($this, 'doAstrology'));\n\t}",
"protected function add_shortcode( $tag, $function = null ) {\n\t\tadd_shortcode( $tag, array( &$this, $function == '' ? $tag : $function ) );\n\t}",
"function wporg_shortcode($atts = [], $content = null)\n{\n \n //$content = 'testadd';\n return $content;\n}",
"public static function register_shortcode($module_classname) {\n // $module_class_name is the string name of the module's class\n\n // Get the ReflectionClass object for the string class name\n $module_class = new ReflectionClass($module_classname);\n\n // Force the module class to implement the BGChannelModule interface\n if (!$module_class->implementsInterface('BGChannelModule')) {\n error_log(\"The module \".$module_classname.\" must implement the BGChannelModule interface to be registered.\");\n return;\n }\n\n // get the method for displaying the module\n $display = $module_class->getMethod('display');\n // get the method that returns the string for the shortcode\n $shortcode = $module_class->getMethod('shortcode');\n // get the module's constructor\n $constructor = $module_class->getConstructor();\n\n /*\n Add the shortcode to wordpress using the value returned by the shortcode() method\n of the module as the shortcode string itself, and use the arguments defined\n in the constructor and their defaults as the shortcode attributes. Also wrap the\n method in ob_start() and ob_get_clean() so the module method can just echo\n its output and have it work.\n */\n add_shortcode($shortcode->invoke(null), function( $atts ) use ($module_class, $display, $constructor) {\n /*\n Call our static method get_params_from_atts that converts the module's defined\n arguments into an array and passes it to WordPress's shortcode_atts() method\n */\n $params = self::get_params_from_atts( $constructor, $atts );\n\n // create instance of the module\n $module = $module_class->newInstanceArgs($params);\n\n // Start output buffer\n ob_start();\n\n // Echo shortcode display from module class's display() method\n $display->invoke($module);\n\n // Return results of output buffer\n return ob_get_clean();\n });\n }",
"public function registerShortcode($key, $shortcode)\n {\n add_shortcode($shortcode['name'], function ($args) use ($key, $shortcode) {\n if (!$this->shortcodes[$key]['enqueued']) {\n $this->ctrl->enqueueShortcodeFiles($shortcode);\n $this->shortcodes[$key]['enqueued'] = true;\n }\n\n return call_user_func_array($this->executable, [$shortcode, $args]);\n });\n $this->shortcodes[$key] = $shortcode;\n }"
] | [
"0.8150073",
"0.78834933",
"0.73854154",
"0.7373662",
"0.7240223",
"0.70457643",
"0.7007747",
"0.6954016",
"0.6873246",
"0.6844029",
"0.68424255",
"0.6750094",
"0.6746664",
"0.6729344",
"0.6690211",
"0.6634306",
"0.6561627",
"0.64960635",
"0.64641243",
"0.6462316",
"0.6416443",
"0.64048165",
"0.6389727",
"0.63761103",
"0.6342015",
"0.6325416",
"0.6292605",
"0.62747085",
"0.6249733",
"0.62394696"
] | 0.79817545 | 1 |
Check if a shortcode has been registered. | public function registered($shortcode)
{
return array_key_exists($shortcode, self::$shortcodes);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dcl_check_shortcode( $dcl_shortcode = false ) {\n\n\t\tglobal $post;\n\t\t\n\t\t$post_obj = get_post( $post->ID );\n\t\t\n\t\t$found = false;\n\n\t\tif ( !$dcl_shortcode ) {\n\t\t\treturn $found;\n\t\t}\n\t\telse if ( stripos( $post_obj->post_content, '[' . $dcl_shortcode . ']' ) !== false ) {\n\t\t\t$found = true;\n\t\t}\n\t\t\n\t\treturn $found;\n\t}",
"function test_shortcode_added() {\n\t\t$this->assertTrue( shortcode_exists( 'espn' ) );\n\t}",
"function bbp_has_shortcode($text = '')\n{\n}",
"function has_shortcode($shortcode_name, $post_id = 0) {\n $post = &get_post($post_id);\n $post_id = isset($post->ID) ? $post->ID : (int) $post_id;\n return WP_Shortcodes_API::ShortcodeInPost($shortcode_name, $post_id);\n }",
"function sh_has_shortcode( $shortcode = '' ) {\n\tglobal $wp_query;\n\tforeach( $wp_query->posts as $post ) {\n\t\tif ( ! empty( $shortcode ) && stripos($post->post_content, '[' . $shortcode) !== false ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"public function check_for_shortcode() {\n\t\tif( function_exists( 'is_checkout_pay_page' ) && is_checkout_pay_page() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$checkout_page_id = wc_get_page_id( 'checkout' );\n\n\t\t// Check if page ID is set in WooCommerce\n\t\tif( ! $checkout_page_id || $checkout_page_id <= 0 ) {\n\t\t return;\n }\n\n\t\t$content = get_post_field( 'post_content', $checkout_page_id );\n\n\t\t/**\n\t\t * If the current post contains the shortcode and invoice is enabled\n\t\t * set the variable using_get_address_shortcode to true\n\t\t */\n\t\tif( has_shortcode( $content, 'svea_get_address' )\n\t\t\t&& WC_Gateway_Svea_Invoice::init()->enabled === \"yes\" ) {\n\t\t\tself::$using_get_address_shortcode = true;\n\t\t}\n\t}",
"function moments_qodef_has_shortcode( $shortcode, $content = '' ) {\n\t\t$has_shortcode = false;\n\n\t\tif ( $shortcode ) {\n\t\t\t//if content variable isn't past\n\t\t\tif ( $content == '' ) {\n\t\t\t\t//take content from current post\n\t\t\t\t$page_id = moments_qodef_get_page_id();\n\t\t\t\tif ( ! empty( $page_id ) ) {\n\t\t\t\t\t$current_post = get_post( $page_id );\n\n\t\t\t\t\tif ( is_object( $current_post ) && property_exists( $current_post, 'post_content' ) ) {\n\t\t\t\t\t\t$content = $current_post->post_content;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//does content has shortcode added?\n\t\t\tif ( stripos( $content, '[' . $shortcode ) !== false ) {\n\t\t\t\t$has_shortcode = true;\n\t\t\t}\n\t\t}\n\n\t\treturn $has_shortcode;\n\t}",
"public function isRegistered(): bool;",
"public function is_registered( )\n\t{\n\n\t}",
"function hasRegistration();",
"public static function wantToRegister(){\n\t\treturn array_key_exists(self::$registerURL, $_GET);\n\t}",
"public function is_gutenberg_active() {\n\t\treturn function_exists( 'register_block_type' );\n\t}",
"function check_html_layout_shortcode($content){\n\tif(has_shortcode( $content, 'one_full') || has_shortcode( $content, 'one_half') || has_shortcode( $content, 'one_third') || has_shortcode( $content, 'two_third') || has_shortcode( $content, 'one_fourth') || has_shortcode( $content, 'three_fourth')){\n\t\treturn true;\n\t}\n\treturn false;\n}",
"public function wantsToRegister() : bool {\n\t\tif(isset($_POST[self::$register])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function is_registered( $slug ) {\n\t\treturn \\WP_Block_Type_Registry::get_instance()->is_registered( $slug );\n\t}",
"function isRegistered($asset)\n{\n return wp_script_is(\"melody-js-$asset\", 'registered');\n}",
"public function isUnitRegistered(string $symbol): bool;",
"public function isRegistered(string $source): bool;",
"function can_register() {\n\n\t// Is registration enabled?\n\tif ( 'on' == blog_setting( 'register' ) ) {\n\n\t\treturn true;\n\n\t}\n\n\treturn false;\n\n}",
"public function shortCodeExists($short_code)\n {\n\n return (boolean) URLMapping::where('short_code', $short_code)->count();\n\n }",
"function isDefinedTag($prefix, $shortName)\r\n\t{\r\n\t\tif (isset($this->taglibInfos[$prefix]))\r\n\t\t{\r\n\t\t\t$tli =& $this->taglibInfos[$prefix];\r\n\t\t\tif ($tli->getTag($shortName) != null)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}",
"static public function add( $shortcode ) {\n \n // Determine if passed param is valid\n try {\n //@TODO: check if class or base class of object is Shortcode.\n if( !is_object( $shortcode ) ) {\n throw new \\Exception( __( 'Param is not an object or doesn\\'t extend UsabilityDynamics\\\\Shortcode\\\\Shortcode class' ) );\n }\n if ( key_exists( $shortcode->id, self::$shortcodes ) ) {\n throw new \\Exception( __( 'Shortcode is already added. It can not be added twice.' ) );\n }\n if ( shortcode_exists( $shortcode->id ) ) {\n throw new \\Exception( __( 'Shortcode with provided tag is already registered in Wordpress. You must remove existing shortcode before adding new one.' ) );\n }\n } catch ( \\Exception $e ) {\n return new \\WP_Error( 'error', __( 'Shortcode can not be added' ) . ': ' . $e->getMessage() );\n }\n \n self::$shortcodes[ $shortcode->id ] = $shortcode;\n \n // Now, we add shortcode to WP\n add_shortcode( $shortcode->id, array( $shortcode, 'call' ) );\n \n return true;\n }",
"public static function is_gutenberg_available() {\r\n\t\treturn function_exists( 'register_block_type' );\r\n\t}",
"public function shouldCmsRegister(): bool\n {\n if (null !== $this->shouldRegister) {\n // @codeCoverageIgnoreStart\n return $this->shouldRegister;\n // @codeCoverageIgnoreEnd\n }\n\n if ( ! $this->isCmsEnabled()) {\n $this->shouldRegister = false;\n return false;\n }\n\n if ($this->isConsole()) {\n $this->shouldRegister = $this->isCmsEnabledArtisanCommand();\n return $this->shouldRegister;\n }\n\n if ($this->isCmsBeingUnitTested()) {\n $this->shouldRegister = true;\n return true;\n }\n\n $this->shouldRegister = $this->isCmsWebRequest() || $this->isCmsApiRequest();\n return $this->shouldRegister;\n }",
"function register_shortcodes(){\n\n // add_shortcode('shortcode', 'shortcode_function');\n\n}",
"public function register_shortcode() {\n add_shortcode( self::SHORTCODE_TAG, array( &$this, 'do_shortcode' ) );\n }",
"protected function register_shortcodes() {}",
"function kloe_qodef_has_blog_shortcode() {\n\t\t$blog_shortcodes = array(\n\t\t\t'qodef_blog_list',\n\t\t\t'qodef_blog_slider',\n\t\t\t'qodef_blog_carousel'\n\t\t);\n\n\t\t$slider_field = get_post_meta(kloe_qodef_get_page_id(), 'qodef_page_slider_meta', true); //TODO change\n\n\t\tforeach ($blog_shortcodes as $blog_shortcode) {\n\t\t\t$has_shortcode = kloe_qodef_has_shortcode($blog_shortcode) || kloe_qodef_has_shortcode($blog_shortcode, $slider_field);\n\n\t\t\tif($has_shortcode) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isRegistered(): bool\n {\n return isset($this->company) && isset($this->subsidiary);\n }",
"public static function register_shortcode($atts, $content = '')\n {\n $disable_registration = intval(PeepSo::get_option('site_registration_disabled', 1));\n if (1 === $disable_registration) {\n PeepSo::redirect(PeepSo::get_page('activity'));\n die();\n }\n $sc = self::get_instance()->sc;\n if (is_null($sc)) {\n $sc = new PeepSoRegisterShortcode();\n }\n return ($sc->do_shortcode($atts, $content));\n }"
] | [
"0.7287723",
"0.72556925",
"0.71937394",
"0.71282995",
"0.6942632",
"0.6842252",
"0.6823358",
"0.63907313",
"0.6370703",
"0.6344808",
"0.62533706",
"0.6227539",
"0.61858547",
"0.61695415",
"0.6003027",
"0.59748966",
"0.5928757",
"0.58935547",
"0.58620834",
"0.5840254",
"0.5837852",
"0.5834264",
"0.58299595",
"0.5818247",
"0.5700573",
"0.5693935",
"0.5687084",
"0.5686248",
"0.56545836",
"0.5647922"
] | 0.83137023 | 0 |
Remove a specific registered shortcode. | public function unregister($shortcode)
{
if ($this->registered($shortcode))
unset(self::$shortcodes[$shortcode]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function delete_shortcode( $name ) {\n\t\t$shortcodes = get_option( 'elm_testimonials_shortcodes' );\n\t\t\n\t\tif ( $this->get_shortcode( $name ) ) {\n\t\t\tunset( $shortcodes[$name] );\n\t\t\t\n\t\t\tupdate_option( 'elm_testimonials_shortcodes', $shortcodes );\n\t\t}\n\t}",
"static public function remove( $id ) {\n \n if( !key_exists( $id, self::$shortcodes ) ) {\n return false;\n }\n // Remove from the manager list\n unset( self::$shortcodes[ $id ] );\n // Remove from Wordpress\n if ( shortcode_exists( $id ) ) { \n remove_shortcode( $id );\n }\n \n return true;\n }",
"function gogreen_remove_shortcode( $m ) {\n\n if ( $m[2] == 'vc_row' ) { \n return preg_replace(\"/\\[[^\\]]*\\]/\", '', $m[5]);\n }\n\n return $m[1] . $m[6];\n}",
"function wfu_delete_shortcode($data) {\r\n\tif ( !current_user_can( 'manage_options' ) ) return false;\r\n\r\n\t$res = true;\r\n\tif ( isset($_POST['submit']) ) {\r\n\t\tif ( $_POST['submit'] == \"Delete\" ) {\r\n\t\t\t$res = wfu_replace_shortcode($data, '');\r\n\t\t}\r\n\t}\r\n\treturn $res;\r\n}",
"function remove_parent_theme_shortcodes() {\n// shortcode_name should be the name of the shortcode you want to modify\nremove_shortcode( 'recent_posts' );\n\n// add the same shortcode in child theme with our own function\nadd_shortcode('recent_posts', 'foi_recent_posts');\n}",
"public function removeNext( string $shortCode ): self\n\t{\n\t\treturn $this->replaceNext( $shortCode, '' );\n\t}",
"function wpseo_strip_shortcode( $text ) {\r\n\treturn preg_replace( '|\\[(.+?)\\](.+?\\[/\\\\1\\])?|s', '', $text );\r\n}",
"public function clear()\n {\n self::$shortcodes = array();\n }",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"private function remove_conflicting_shortcodes() {\n\t\tglobal $shortcode_tags;\n\n\t\tforeach ( self::$shortcodes_for_conversion as $key => $shortcode ) {\n\t\t\tif ( isset( $shortcode_tags[ $shortcode ] ) && ( ! is_array( $shortcode_tags[ $shortcode ] ) || ( is_object( $shortcode_tags[ $shortcode ][0] ) && false === strpos( get_class( $shortcode_tags[ $shortcode ][0] ), 'FusionSC' ) ) ) ) {\n\t\t\t\tunset( self::$shortcodes_for_conversion[ $key ] );\n\t\t\t}\n\t\t}\n\t}",
"public function removeElement();",
"function remove();",
"public function cleanup_shortcode_storage() {\n global $shortcode_tags;\n $shortcode_options = get_option(self::$shortcode_options_key);\n if (is_array($shortcode_tags) && is_array($shortcode_options)) {\n foreach ($shortcode_options as $key => $value) {\n if (!array_key_exists($key, $shortcode_tags)) {\n unset($shortcode_options[$key]);\n }\n }\n }\n update_option(self::$shortcode_options_key, $shortcode_options);\n }",
"function SocialAuth_WP_remove() {}",
"function magazine_issue_remove() {\n delete_option('mic_current_issue');\n}",
"public function deleteUrlShortCode($short_code){\n $this->deleteUrl($short_code);\n }",
"public function removePlugin(string $fqcn): void;",
"function remove() {\n }",
"function muiteer_remove_new_portfolio_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-portfolio');\n }",
"function zaxu_remove_new_portfolio_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-portfolio');\n }",
"function muiteer_remove_new_portfolio_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-portfolio');\n }",
"function zaxu_remove_new_portfolio_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-portfolio');\n }",
"function get_shortcode_delete_url( $name ) {\n\t\t$admin_url = admin_url( 'admin.php' );\n\t\t\n\t\t$url = wp_nonce_url( add_query_arg( array( 'page' => 'elm_testimonials_shortcodes', 'elm_delete_shortcode' => $name ), $admin_url ), 'elm_delete_shortcode_action' );\n\t\t\n\t\treturn $url;\n\t}",
"public function Remove($myCinema){\n \n $cinemaList = $this->GetAll();\n foreach ($cinemaList as $cinema) { \n if($cinema->GetCinemaName() == $myCinema->GetCinemaName()){ \n $key = array_search($cinema, $cinemaList); \n unset($this->cinemaList[$key]);\n }\n } \n $this->SaveData(); \n }",
"function pm_ln_run_shortcode( $content ) {\n //global $shortcode_tags;\n // Backup current registered shortcodes and clear them all out\n //$orig_shortcode_tags = $shortcode_tags;\n //remove_all_shortcodes();\n\t\n\t\n\tadd_shortcode(\"singlePost\", \"singlePost\"); \t\n\tadd_shortcode(\"eventPost\", \"eventPost\");\t\n\tadd_shortcode(\"staffItems\", \"staffItems\");//COMPLETE\t\t\n\tadd_shortcode(\"eventItems\", \"eventItems\");//COMPLETE\t\n\tadd_shortcode(\"staffProfile\", \"staffProfile\");\t\n\tadd_shortcode(\"postItems\", \"postItems\");//COMPLETE\t\n\t\n\tadd_shortcode(\"tabGroup\", \"tabGroup\");\n\tadd_shortcode(\"tabItem\", \"tabItem\");\n\tadd_shortcode(\"accordionGroup\", \"accordionGroup\");\n\tadd_shortcode(\"accordionItem\", \"accordionItem\");\t\n\tadd_shortcode(\"alert\", \"alert\");\t\n\tadd_shortcode(\"sponsorsCarousel\", \"sponsorsCarousel\");//COMPLETE\t\n\tadd_shortcode(\"callToAction\", \"callToAction\");\t\n\tadd_shortcode(\"divider\", \"divider\");\t\n\tadd_shortcode(\"googleMap\", \"googleMap\");\n\tadd_shortcode(\"progressBar\", \"progressBar\");\t\n\tadd_shortcode(\"hopeButton\", \"hopeButton\");\n\tadd_shortcode(\"youtubeVideo\", \"youtubeVideo\");\n\tadd_shortcode(\"vimeoVideo\", \"vimeoVideo\");\t\t\t\n\tadd_shortcode(\"featureBox\", \"featureBox\");//COMPLETE\t\t\t\n\tadd_shortcode(\"imagePanel\", \"imagePanel\");\t\t\n\tadd_shortcode(\"socialGroup\", \"socialGroup\");\t\n\tadd_shortcode(\"socialIcon\", \"socialIcon\");\n\tadd_shortcode(\"panelHeader\", \"panelHeader\");\t\t\n\tadd_shortcode(\"featuredPanel\", \"featuredPanel\");\t\n\t\n\t//Bootstrap 2\n\tadd_shortcode(\"columnContainer\", \"columnContainer\");\n\t//add_shortcode(\"container\", \"container\");\n\tadd_shortcode(\"column\", \"column\");\n\t\n // Do the shortcode (only the one above is registered)\n //$content = do_shortcode( $content );\n // Put the original shortcodes back\n //$shortcode_tags = $orig_shortcode_tags;\n return $content;\n}"
] | [
"0.7714667",
"0.66940004",
"0.64411366",
"0.6038361",
"0.59832525",
"0.5978472",
"0.5880188",
"0.5863304",
"0.5843868",
"0.5843868",
"0.5843868",
"0.5843868",
"0.5843868",
"0.5843868",
"0.58367515",
"0.58033144",
"0.5754216",
"0.5749854",
"0.57093483",
"0.5695928",
"0.56820047",
"0.5648352",
"0.5640029",
"0.5596993",
"0.5585557",
"0.55786455",
"0.55707556",
"0.55632704",
"0.5550898",
"0.552238"
] | 0.700313 | 1 |
Remove all registered shortcodes. | public function clear()
{
self::$shortcodes = array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function remove_conflicting_shortcodes() {\n\t\tglobal $shortcode_tags;\n\n\t\tforeach ( self::$shortcodes_for_conversion as $key => $shortcode ) {\n\t\t\tif ( isset( $shortcode_tags[ $shortcode ] ) && ( ! is_array( $shortcode_tags[ $shortcode ] ) || ( is_object( $shortcode_tags[ $shortcode ][0] ) && false === strpos( get_class( $shortcode_tags[ $shortcode ][0] ), 'FusionSC' ) ) ) ) {\n\t\t\t\tunset( self::$shortcodes_for_conversion[ $key ] );\n\t\t\t}\n\t\t}\n\t}",
"public function cleanup_shortcode_storage() {\n global $shortcode_tags;\n $shortcode_options = get_option(self::$shortcode_options_key);\n if (is_array($shortcode_tags) && is_array($shortcode_options)) {\n foreach ($shortcode_options as $key => $value) {\n if (!array_key_exists($key, $shortcode_tags)) {\n unset($shortcode_options[$key]);\n }\n }\n }\n update_option(self::$shortcode_options_key, $shortcode_options);\n }",
"function delete_shortcode( $name ) {\n\t\t$shortcodes = get_option( 'elm_testimonials_shortcodes' );\n\t\t\n\t\tif ( $this->get_shortcode( $name ) ) {\n\t\t\tunset( $shortcodes[$name] );\n\t\t\t\n\t\t\tupdate_option( 'elm_testimonials_shortcodes', $shortcodes );\n\t\t}\n\t}",
"public function ClearSurveyShortCodes() \r\n\t{\t\r\n\t\t// Delete any rows older than X minutes\r\n\t\t$xMinAgo = date(\"Y-m-d H:i:s\", mktime(date(\"H\"),date(\"i\")-Survey::SHORT_CODE_EXPIRE,date(\"s\"),date(\"m\"),date(\"d\"),date(\"Y\")));\r\n\t\tdb_query(\"delete from redcap_surveys_short_codes where ts < '$xMinAgo'\");\r\n\t\t$rowsDeleted = db_affected_rows();\r\n\t\t// Set cron job message\r\n\t\tif ($rowsDeleted > 0) {\r\n\t\t\t$GLOBALS['redcapCronJobReturnMsg'] = \"$rowsDeleted rows deleted from redcap_surveys_short_codes\";\r\n\t\t}\t\r\n\t}",
"public function clearGarbageFilters()\n {\n foreach (array('the_title', 'the_content', 'the_excerpt') as $tag)\n {\n foreach (array(\n 'wptexturize',\n 'convert_smilies',\n 'convert_chars',\n 'wpautop',\n 'shortcode_unautop',\n ) as $filter)\n {\n remove_filter($tag, $filter);\n }\n }\n }",
"public static function removeAllExtensions() {\n\t\tglobal $mwtExtensions;\n\n\t\tforeach( $mwtExtensions as $ext ) {\n\t\t\t$ext->remove();\n\t\t}\n\t}",
"public function unregister_all_scripts()\n {\n $this->m_scriptfiles = [];\n }",
"public static function cleanup(): void\n\t{\n\t\tadd_action('init', function() {\n\t\t\t// EditURI link\n\t\t\tremove_action('wp_head', 'rsd_link');\n\n\t\t\t// Windows Live Writer\n\t\t\tremove_action('wp_head', 'wlwmanifest_link');\n\n\t\t\t// index link\n\t\t\tremove_action('wp_head', 'index_rel_link');\n\n\t\t\t// previous link\n\t\t\tremove_action('wp_head', 'parent_post_rel_link', 10, 0);\n\n\t\t\t// start link\n\t\t\tremove_action('wp_head', 'start_post_rel_link', 10, 0);\n\n\t\t\t// Links for Adjacent Posts\n\t\t\tremove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\n\t\t\t// WP version\n\t\t\tremove_action('wp_head', 'wp_generator');\n\t\n\t\t\tif (!is_admin()) {\n\t\t\t\twp_deregister_script('wp-embed');\n\t\t\t}\n\t\t});\n\t}",
"public function clearTags();",
"public function unregister($shortcode)\n {\n if ($this->registered($shortcode))\n unset(self::$shortcodes[$shortcode]);\n }",
"public function delete_all()\r\n\t{\r\n\t\txcache_clear_cache(XC_TYPE_PHP, 0);\r\n\t}",
"function ubermenu_sandbox_remove_all_scripts() {\n global $wp_scripts;\n //uberp($wp_scripts->queue);\n foreach( $wp_scripts->queue as $i => $script ){\n //if( $script == 'google-maps' ) continue;\n if( strpos( $script , 'ubermenu' ) !== 0 ){\n unset( $wp_scripts->queue[$i] );\n //echo $script.\"<br/>\";\n }\n }\n //uberp($wp_scripts->queue);\n //$wp_scripts->queue = array();\n}",
"private function unregister()\n {\n ee()->load->library('content_types');\n ee()->content_types->unregister($this->package);\n }",
"protected function cleanup(): void\n {\n foreach ($this->directives as $directive => $value) {\n // Any directive that contains a \"none\" value cannot contain any other values.\n if (is_array($value) && in_array(\"'none'\", $value, true)) {\n $this->directives[$directive] = [\"'none'\"];\n }\n }\n }",
"public static function clear () {\n\t\t$saved_searches = $wpdb->get_results('SELECT option_name FROM ' . $wpdb->prefix . 'options ' .\"WHERE option_name LIKE 'pl_ss_%'\");\n\t foreach ($saved_searches as $option) {\n\t PL_Options::delete($option->option_name);\n\t }\n\t}",
"function pm_ln_run_shortcode( $content ) {\n //global $shortcode_tags;\n // Backup current registered shortcodes and clear them all out\n //$orig_shortcode_tags = $shortcode_tags;\n //remove_all_shortcodes();\n\t\n\t\n\tadd_shortcode(\"singlePost\", \"singlePost\"); \t\n\tadd_shortcode(\"eventPost\", \"eventPost\");\t\n\tadd_shortcode(\"staffItems\", \"staffItems\");//COMPLETE\t\t\n\tadd_shortcode(\"eventItems\", \"eventItems\");//COMPLETE\t\n\tadd_shortcode(\"staffProfile\", \"staffProfile\");\t\n\tadd_shortcode(\"postItems\", \"postItems\");//COMPLETE\t\n\t\n\tadd_shortcode(\"tabGroup\", \"tabGroup\");\n\tadd_shortcode(\"tabItem\", \"tabItem\");\n\tadd_shortcode(\"accordionGroup\", \"accordionGroup\");\n\tadd_shortcode(\"accordionItem\", \"accordionItem\");\t\n\tadd_shortcode(\"alert\", \"alert\");\t\n\tadd_shortcode(\"sponsorsCarousel\", \"sponsorsCarousel\");//COMPLETE\t\n\tadd_shortcode(\"callToAction\", \"callToAction\");\t\n\tadd_shortcode(\"divider\", \"divider\");\t\n\tadd_shortcode(\"googleMap\", \"googleMap\");\n\tadd_shortcode(\"progressBar\", \"progressBar\");\t\n\tadd_shortcode(\"hopeButton\", \"hopeButton\");\n\tadd_shortcode(\"youtubeVideo\", \"youtubeVideo\");\n\tadd_shortcode(\"vimeoVideo\", \"vimeoVideo\");\t\t\t\n\tadd_shortcode(\"featureBox\", \"featureBox\");//COMPLETE\t\t\t\n\tadd_shortcode(\"imagePanel\", \"imagePanel\");\t\t\n\tadd_shortcode(\"socialGroup\", \"socialGroup\");\t\n\tadd_shortcode(\"socialIcon\", \"socialIcon\");\n\tadd_shortcode(\"panelHeader\", \"panelHeader\");\t\t\n\tadd_shortcode(\"featuredPanel\", \"featuredPanel\");\t\n\t\n\t//Bootstrap 2\n\tadd_shortcode(\"columnContainer\", \"columnContainer\");\n\t//add_shortcode(\"container\", \"container\");\n\tadd_shortcode(\"column\", \"column\");\n\t\n // Do the shortcode (only the one above is registered)\n //$content = do_shortcode( $content );\n // Put the original shortcodes back\n //$shortcode_tags = $orig_shortcode_tags;\n return $content;\n}",
"public static function removeAll() {\n\t\t\tself::$registry = array();\n\t\t\treturn;\n\t\t}",
"function mediadb_uninstall() {\n\t// remove valid codes table from wordpress db\n\tglobal $wpdb;\n\t$tables_to_drop = array( $wpdb->prefix.'mediadb_validcodes', $wpdb->prefix.'mediadb_media' );\n\tforeach ($tables_to_drop as $table) {\n\t\t$sql = \"DROP TABLE \". $table;\n\t\t$wpdb->query($sql);\n\t}\n}",
"public function clear(){\r\n\t\t\t$this->css_list = $this->js_list = array();\r\n\t\t\t$this->compress_displayed = false;\r\n\t\t}",
"function geotagmapper_uninstall() {\r\n\tdelete_option('geotagmapper_place_on_front');\r\n\tdelete_option('geotagmapper_place_on_single_post');\r\n\tdelete_option('geotagmapper_place_on_single_page');\r\n\tdelete_option('geotagmapper_place_on_category');\r\n\tdelete_option('geotagmapper_place_on_tag');\r\n\tdelete_option('geotagmapper_place_on_search');\r\n\tdelete_option('geotagmapper_country');\r\n\tdelete_option('geotagmapper_state');\r\n\tdelete_option('geotagmapper_zip');\r\n\tdelete_option('geotagmapper_lat');\r\n\tdelete_option('geotagmapper_lng');\r\n\tdelete_option('geotagmapper_city');\r\n\tdelete_option('geotagmapper_country_code');\r\n\tdelete_option('geotagmapper_subcountry_code');\r\n}",
"public function removeElementsFromContent() {\r\n global $post;\r\n\r\n // Get advanced settings\r\n if (!isset($this->advanced_settings)) {\r\n $this->advanced_settings = get_option($this->tag.'_advanced_settings');\r\n }\r\n\r\n if (empty($this->advanced_settings)) {\r\n return;\r\n }\r\n\r\n foreach($this->advanced_settings as $element => $val) {\r\n if ($this->getAdvancedSettings($element) == true) {\r\n // Get regex of element shortcode\r\n $pattern = $this->getShortcodeRegex($element);\r\n // Find all element data\r\n $count = preg_match_all('/'.$pattern .'/s', $post->post_content, $found);\r\n\r\n // Check if there are elements found\r\n if ( is_array( $found ) && ! empty( $found[0] ) ) {\r\n if ( isset( $found[3] ) && is_array( $found[3] ) ) {\r\n foreach ( $found[3] as $key => $shortcode_atts ) {\r\n // Extract shortcode parameters\r\n $atts = shortcode_parse_atts( $shortcode_atts );\r\n\r\n // Filter shortcode\r\n if ($this->isShortcodeFiltered($atts) == true) {\r\n $post->post_content = str_replace($found[0][$key], '', $post->post_content);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }",
"public function strip_shortcodes( $content ) {\n $shortcode_tags = $this->shortCodeTags;\n\n if (empty($shortcode_tags) || !is_array($shortcode_tags))\n return $content;\n\n $pattern = $this->get_shortcode_regex();\n\n return preg_replace_callback( \"/$pattern/s\", array($this, 'strip_shortcode_tag'), $content );\n }",
"function remove_all() \r\n\t{\r\n\t\t$this->reset();\r\n }",
"public function destroy_all();",
"function filterShortcodes($tags_to_remove, $content) {\n $tags_to_remove = array();\n $tags_to_remove[] = 'forum';\n $tags_to_remove[] = 'Forum';\n $tags_to_remove = apply_filters('asgarosforum_filter_post_shortcodes', $tags_to_remove);\n return $tags_to_remove;\n }",
"public function removeHandlerGroups(){\n foreach($this->getHandlerGroups() as $handlerKey){\n $this->removeHandlerGroup($handlerKey);\n }\n }",
"function auxin_strip_shortcodes( $content, $exclude_strip_shortcode_tags = null ) {\n if( ! $content ) return $content;\n\n if( ! $exclude_strip_shortcode_tags )\n $exclude_strip_shortcode_tags = auxin_exclude_strip_shortcode_tags();\n\n if( empty( $exclude_strip_shortcode_tags ) || ! is_array( $exclude_strip_shortcode_tags ) )\n return preg_replace('/\\[[^\\]]*\\]/', '', $content);\n\n $exclude_codes = join('|', $exclude_strip_shortcode_tags);\n return preg_replace( \"~(?:\\[/?)(?!(?:$exclude_codes))[^/\\]]+/?\\]~s\", '', $content );\n}",
"static public function remove( $id ) {\n \n if( !key_exists( $id, self::$shortcodes ) ) {\n return false;\n }\n // Remove from the manager list\n unset( self::$shortcodes[ $id ] );\n // Remove from Wordpress\n if ( shortcode_exists( $id ) ) { \n remove_shortcode( $id );\n }\n \n return true;\n }",
"function shortcodes_to_exempt_from_wptexturize( $shortcodes ) {\n $shortcodes[] = 'NETTOP_getLinkIcons';\n return $shortcodes;\n }",
"public static function clear_saved_actions() {\n\n\t\tdelete_option( 'extendable-aggregator-queued-actions-' . static::$name );\n\t}"
] | [
"0.6826947",
"0.65005046",
"0.59892493",
"0.59874386",
"0.57621866",
"0.57401335",
"0.57336974",
"0.57071024",
"0.5673142",
"0.56639135",
"0.56293887",
"0.5611414",
"0.5592839",
"0.5586496",
"0.5582178",
"0.55770904",
"0.55508596",
"0.5543124",
"0.5535772",
"0.5506572",
"0.5500962",
"0.5475029",
"0.5472065",
"0.54608214",
"0.5448938",
"0.54439265",
"0.5427476",
"0.54183507",
"0.53870124",
"0.53841853"
] | 0.70684993 | 0 |
Displays the browse page for all reports. | public function browseAction()
{
$db = $this->_helper->db;
if (!$this->_getParam('sort_field')) {
$this->_setParam('sort_field', 'added');
$this->_setParam('sort_dir', 'd');
}
parent::browseAction();
$reportItemCounts = array();
$reportUserNames = array();
foreach($this->view->reports_reports as $report) {
$user = $db->getTable('User')->find($report->creator);
$query = unserialize($report->query);
$itemCount = $db->getTable('Item')->count($query);
$reportItemCounts[(string)$report->id] = $itemCount;
}
$this->view->reportItemCounts = $reportItemCounts;
$this->view->formats = reports_get_output_formats();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionIndex()\n {\n\t\t$searchModel = new ReportsSearch();\n\t\t$params = $this->saveFilter('reports', Yii::$app->request->queryParams);\n $dataProvider = $searchModel->search($params);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n\t\t\t'searchModel' => $searchModel,\n\t\t\t'teamSerach' => Team::getTeams(),\n\t\t\t'typeSearch' => CabinetHdbkReportType::getTypes(),\n ]);\n }",
"function index() {\r\n \r\n // The default action is the showall action\r\n $this->browse();\r\n }",
"public function browse()\n\t{\n\t\t$pageDetails = array(\n 'title' => 'Browse all Estimates',\n 'csstoload' => array('jquery.datatable'),\n 'jstoloadinfooter' => array('datatables/js/jquery.dataTables', 'common/dataTables-init'),\n 'content_view' => 'estimates/browse',\n 'user_id' => $this->session->userdata('user_id'),\n );\n\n $this->load->view('template/default', $pageDetails);\n\t}",
"public function indexAction() \n\t{\n\t\t$this->_forward('browse');\n\t}",
"public function actionIndex()\n {\n $searchModel = new ReportsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n $this->locate(inlink('browse'));\n }",
"public function getAllReports()\n\t{\n\t\thome::displayHeader();\n\n\t\t$allReports = self::model('Report')->orderBy('Report_Id', 'desc')->get(); \n\t\t//->orderBy('listingID', 'desc'); // Retrieves all reports in an array\n\t\tself::view('reports/reportList', ['reports' => $allReports]);\n\t}",
"public function index ()\n {\n $reports = Report::simplePaginate (10);\n\n return view ('admin.reportList')\n ->with ('reports' , $reports);\n\n\n }",
"public function actionIndex()\n {\n $searchModel = new ReportSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n $reports = Report::paginate(20);\n\n return view('admin.reports.index', compact('reports'));\n }",
"public function browse()\n {\n $this->app->loadLang('user');\n $this->view->title = $this->lang->address->browse;\n $this->view->addresses = $this->address->getListByAccount($this->app->user->account);\n $this->view->mobileURL = helper::createLink('address', 'browse', '', '', 'mhtml');\n $this->view->desktopURL = helper::createLink('address', 'browse', '', '', 'html');\n $this->display();\n }",
"public function index()\n\t{\n\t\t$summaries = $this->reporting->fetch_data();\n\n\t\t$pages = $this->pages;\n\t\t$main_view = 'report/summary';\n\n\t\t$this->load->view('template', compact('main_view', 'pages', 'summaries'));\n\t}",
"public function index()\n {\n $data = array();\n \n // Get modules\n $modules = $this->_getModules();\n \n // Add modules to data array\n $data['modules'] = $modules;\n \n // Add style to data array\n $styles = array();\n $styles[] = 'https://cdn.datatables.net/v/bs/dt-1.10.13/datatables.min.css';\n $data['styles'] = $styles;\n \n // Create the scripts array\n $scripts = array();\n \n // Add script to the scripts array\n $scripts[] = 'https://cdn.datatables.net/v/bs/dt-1.10.13/datatables.min.js';\n $scripts[] = base_url('js/browse.js');\n \n // Add scripts array to data array\n $data['scripts'] = $scripts;\n\n // Load the header\n $this->load->view('page/header', $data);\n \n // Load the page view\n $this->load->view('browse', $data);\n \n // Load the footer\n $this->load->view('page/footer', $data);\n }",
"function index() {\n $this->load->view(\"reports/listing\", array());\n }",
"public function index()\n {\n $this->authorize('view', ReportsController::class);\n\n return view('finance.reports.index')->with(self::getReportAttributes());\n }",
"public function indexAction()\n {\n $this->_helper->redirector('browse');\n return;\n }",
"public function browseAction() {\n // Process the sorting parameters, get the collections.\n $sort_field = $this->_request->getParam('sort_field');\n $sort_dir = $this->_request->getParam('sort_dir');\n $order = bagithelpers_doColumnSortProcessing($sort_field, $sort_dir);\n $bfc = $this->_helper->db->getTable('BagitFileCollection');\n $collections = $this->_helper->db->getTable('BagitFileCollection')->getCollectionsList($order);\n\n $this->view->collections = $collections;\n }",
"public function index()\n\t{\n\t\treturn View::make('reports.index');\n\t}",
"public function index()\n\t{\n\t\treturn View::make('reports.index');\n\t}",
"public function index()\n {\n $this->authorize('view', Report::class);\n $user_id = auth()->user()->id;\n if ($user_id < 2) {\n $reports = Report::latest()->paginate(11);\n } else {\n $reports = Report::latest()\n ->Where('user_id', $user_id)->paginate(11);\n }\n\n return view('report.saved.index', compact('reports'));\n }",
"public function index()\n {\n return view('report::index');\n }",
"public function actionIndex()\n {\n $searchModel = new ReportsSearch();\n $user_id__fio = ArrayHelper::map(ArrayHelper::toArray($searchModel->search([])->getModels(), [\n 'common\\models\\Reports' => [\n 'user_card_id',\n 'fio' => function ($report) {\n return Reports::getFio($report);\n }\n ],\n ]),'user_card_id', 'fio');\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index');\n }",
"public function browse(){\n $polls = Poll::paginate(10);\n return view('polls::browse', compact('polls'));\n }",
"public function actionIndex()\n {\n $searchModel = new ReportTypeSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function indexAction() {\r\n\t\t// TODO Auto-generated ReportesController::indexAction() default action\r\n\t}",
"public function showAction()\n { \n $report = $this->_helper->db->findById();\n $reportFiles = $report->getFiles();\n $formats = reports_get_output_formats();\n $this->view->formats = $formats;\n $this->view->report = $report;\n $this->view->reportFiles = $reportFiles;\n }",
"public function index()\n {\n $qreports = Qreport::orderBy('id', 'desc')->get();\n return view('backend.qreport.index', compact('qreports'));\n }",
"public function index()\n {\n $reports = DB::table('reports')\n ->paginate(10);\n return $this->respondWithPagination($reports, $this->reportTransformer->transformCollection($reports->all()));\n\n }",
"function index()\n\t{\n\t\t$this->load->view(\"reports/listing\",array());\t\n\t}",
"public function indexAction() {\n $this->_forward('browse', 'collections', 'bag-it');\n }"
] | [
"0.69351375",
"0.6889889",
"0.68418914",
"0.67391706",
"0.67343575",
"0.66536635",
"0.6636971",
"0.6592742",
"0.6574563",
"0.64731205",
"0.6471982",
"0.64699197",
"0.64616275",
"0.64586216",
"0.6452268",
"0.64291894",
"0.63931215",
"0.6390526",
"0.6390526",
"0.63871765",
"0.63475466",
"0.63419306",
"0.63367873",
"0.63340586",
"0.63257086",
"0.63028944",
"0.6296372",
"0.62625515",
"0.62239134",
"0.6203041"
] | 0.73330396 | 0 |
Shows details and generated files for a report. | public function showAction()
{
$report = $this->_helper->db->findById();
$reportFiles = $report->getFiles();
$formats = reports_get_output_formats();
$this->view->formats = $formats;
$this->view->report = $report;
$this->view->reportFiles = $reportFiles;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function viewReport() {\n }",
"public function report_page() {\n require_once dirname( __FILE__ ) . '/templates/report-template.php';\n }",
"public function show(report $report)\n {\n \n }",
"public function show(Report $report)\n {\n \n }",
"public function show(Report $report)\n {\n //\n }",
"public function show(Report $report)\n {\n //\n }",
"public function show(Report $report)\n {\n //\n }",
"public function show(Report $report)\n {\n //\n }",
"public function viewPdfReportAction() {\n $request = $this->getRequest();\n $report_hash = $request->get('hash');\n $em = $this->getDoctrine()->getEntityManager();\n $report_data = $em->getRepository('FrontFrontBundle:ProjectReport')->checkGeneratedReportHash($report_hash);\n if(!empty($report_data)) {\n header('Content-type: application/pdf');\n header('Content-Disposition: attachment; filename=\"'.$report_data['report_filename'].'\"');\n readfile('../reports/'.$report_data['report_filename']);\n die;\n } else {\n die('Report does not exist.');\n }\n }",
"public function generateReport()\n {\n $this->generatedReport = true;\n $this->report->generate($this->results);\n }",
"public function index()\n {\n $report = null;\n return view('prevMain.report', compact('report'));\n }",
"public function report()\n {\n return view('admin.report.report');\n }",
"public function doConfiguredReports();",
"public function show()\n {\n return view('report::show');\n }",
"public function show()\n {\n return view('report::show');\n }",
"public function reports()\n {\n //\n }",
"public function getReport();",
"public function index()\n {\n $this->authorize('view', ReportsController::class);\n\n return view('finance.reports.index')->with(self::getReportAttributes());\n }",
"function report()\n{\n $page = (new HtmlPage())\n ->withTitle('Conference audit')\n ->withInlineStyle(new StyleElement(file_get_contents('styles.css')));\n\n // Generate the results page.\n $page = $page->withContent($page->getContent() . reportNewSpeakersPerCon());\n\n $page = $page->withContent($page->getContent() . reportTopSpeakers());\n\n file_put_contents('results.html', $page);\n}",
"public function show($report_id)\n {\n\n\n }",
"public function show($report_id)\n {\n\n\n }",
"public function actionIndex()\n {\n\t\t$searchModel = new ReportsSearch();\n\t\t$params = $this->saveFilter('reports', Yii::$app->request->queryParams);\n $dataProvider = $searchModel->search($params);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n\t\t\t'searchModel' => $searchModel,\n\t\t\t'teamSerach' => Team::getTeams(),\n\t\t\t'typeSearch' => CabinetHdbkReportType::getTypes(),\n ]);\n }",
"public function index()\n {\n $scope = $this->scope;\n $user = $this->user;\n return view('admin.report.' . $this->scope . '.index', compact('scope', 'user'));\n }",
"public function show(Reporte $reporte)\n {\n //\n }",
"public function index ()\n {\n $reports = Report::simplePaginate (10);\n\n return view ('admin.reportList')\n ->with ('reports' , $reports);\n\n\n }",
"public function test_report() {\n $c = $this->jasper->getJasperClient();\n $controls = array('p_user_id' => '3003');\n $report = $c->reportService()->runReport('/reports/realestate/clinetFollowParam', 'pdf', null, null, $controls);\n header('Cache-Control: must-revalidate');\n header('Pragma: public');\n header('Content-Description: File Transfer');\n header('Content-Disposition: attachment; filename=SalesClientFollowRep.pdf');\n header('Content-Transfer-Encoding: binary');\n header('Content-Length: ' . strlen($report));\n header('Content-Type: application/pdf');\n echo $report;\n }",
"public function output_report() {\n\t\tinclude( plugin_dir_path( WC_Subscriptions::$plugin_file ) . '/includes/admin/views/html-report-by-period.php' );\n\t}",
"public function actionIndex()\n {\n $searchModel = new ReportSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n $reports = DB::table('reports')\n ->join('users', 'reports.user_id', '=', 'users.id')\n ->select('users.name', 'description')\n ->get();\n return view('report.index', compact('reports'));\n }",
"public function indexReports()\n {\n $shop = $this->user->shop;\n $branches = $shop->branches;\n $statuses = Status::all();\n $lines = Line::where('shop_id', NULL)->get();\n $categories = Category::where('shop_id', NULL)->get();\n $shop = Auth::user()->shop;\n\n return view('product.Reports.index', compact('shop', 'branches', 'statuses', 'lines', 'categories'));\n }"
] | [
"0.7342523",
"0.6998501",
"0.6911995",
"0.6863376",
"0.6743465",
"0.6743465",
"0.6743465",
"0.6743465",
"0.66713595",
"0.65049094",
"0.650217",
"0.64200944",
"0.6370253",
"0.63138705",
"0.63138705",
"0.6291042",
"0.627921",
"0.6263084",
"0.62312716",
"0.6222888",
"0.6222888",
"0.61693484",
"0.6167582",
"0.6156866",
"0.6146749",
"0.6128548",
"0.6123408",
"0.6102777",
"0.6067914",
"0.60300624"
] | 0.7506817 | 0 |
Spawns a background process to generate a new report file. | public function generateAction()
{
$report = $this->_helper->db->findById();
$reportFile = new Reports_File();
$reportFile->report_id = $report->id;
$reportFile->type = $_GET['format'];
$reportFile->status = Reports_File::STATUS_STARTING;
// Send the base URL to the background process for QR Code
// This should be abstracted out to work more generally for
// all generators.
if ($reportFile->type == 'PdfQrCode') {
$reportFile->options = serialize(array('baseUrl' => WEB_ROOT));
}
$errors = array();
if (!$reportFile->canStore($errors)) {
$errorMessage = __('The report cannot be saved. Please check your report storage settings.');
foreach($errors as $error) {
$errorMessage .= ' ' . $error;
}
$this->_helper->flashMessenger($errorMessage, 'error');
} else {
$reportFile->save();
$this->_jobDispatcher->setQueueName('reports');
$this->_jobDispatcher->sendLongRunning('Reports_GenerateJob',
array(
'fileId' => $reportFile->id,
)
);
}
$this->_helper->redirector->gotoRoute(
array(
'module' => 'reports',
'id' => $report->id,
'action' => 'show',
),
'default'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function run() {\n\t\t\t$sPath = getPHPReportsFilePath(); \n\t\t\t$sXML\t = $this->getInput();\n\t\t\t$sCSS = $this->getCSS();\n\n\t\t\t// parameter array with CSS info\n\t\t\t$aParm = Array();\n\t\t\t$aParm[\"css\"] = $sCSS;\n\t\t\t\n\t\t\t// get the tmp directory under the DocumentRoot\n\t\t\t$sDocRoot = $_SERVER[\"DOCUMENT_ROOT\"];\n\n\t\t\t// get the host path\n\t\t\t$sHost = \"http://\".$_SERVER[\"HTTP_HOST\"];\n\t\t\t\n\t\t\t// create some tempnames there\n\t\t\t$sBook = tempnam(realpath($sDocRoot.\"/tmp\"),\"bookmark\");\n\t\t\tunlink($sBook);\n\t\t\t$sBook .= \".html\";\n\t\t\t\n\t\t\t$sRepo = tempnam(realpath($sDocRoot.\"/tmp\"),\"report\");\n\t\t\tunlink($sRepo);\n\t\t\t$sRepo .= \".html\";\n\n\t\t\t// create the bookmarks file\n\t\t\t$oProcFactory = new XSLTProcessorFactory();\n\t\t\t$oProc = $oProcFactory->get();\n\t\t\t$oProc->setXML($sXML);\n\t\t\t$oProc->setXSLT(realpath($sPath.\"/output/bookmarks/bookmarks.xsl\"));\n\t\t\t$oProc->setOutput($sBook);\n\t\t\t$oProc->setParms($aParm);\n\t\t\t$oProc->run();\n\n\t\t\t// create the report file\n\t\t\t$oProcFactory = new XSLTProcessorFactory();\n\t\t\t$oProc = $oProcFactory->get();\n\t\t\t$oProc->setXML($sXML);\n\t\t\t$oProc->setXSLT(realpath($sPath.\"/output/default/default.xsl\"));\n\t\t\t$oProc->setOutput($sRepo);\n\t\t\t$oProc->run();\n\n\t\t\t// code of the framed content\t\t\n\t\t\t$sFrame =\n\t\t\t\"<frameset cols=\\\"150,*\\\">\\n\".\n\t\t\t\"<frame name=\\\"bookmarks\\\" target=\\\"main\\\" src=\\\"$sHost/tmp/\".basename($sBook).\"\\\">\\n\".\n\t\t\t\"<frame name=\\\"report\\\" target=\\\"main\\\" src=\\\"$sHost/tmp/\".basename($sRepo).\"\\\">\\n\".\n\t\t\t\"</frameset>\";\n\n\t\t\t// if there is not an output file, write to browser window\n\t\t\tif(is_null($this->getOutput()))\n\t\t\t\tprint $sFrame;\n\t\t\telse{\n\t\t\t// or open the file and store the frames there\t\n\t\t\t\t$fHandle = fopen($this->getOutput(),\"w\");\n\t\t\t\tfputs($fHandle,$sFrame);\n\t\t\t\tfclose($fHandle);\n\t\t\t}\n\n\t\t\tif($this->isCleaning()) \n\t\t\t\tunlink($sXML);\n\t\t}",
"public function createReportTask() {\n $this->type = \"report\";\n return $this->createTask();\n }",
"public function run(){\n $this->setLogfile();\n $this->errfile = $this->logfile . '-err';\n\n $descriptors = array(\n array(\"pipe\", \"/dev/null\"),\n array(\"file\", $this->logfile, \"w\"),\n array(\"file\", $this->errfile, \"a\")\n );\n\n $this->process = proc_open($this->command, $descriptors, $pipes, null, $this->env);\n }",
"protected function generatePdf()\n {\n $this->viewToString();\n\n $this->saveHtml();\n\n $command = [\n $this->binaryPath,\n implode(' ', $this->commandLineOptions),\n $this->convertScript,\n $this->pdfPath,\n $this->prefixHtmlPaths($this->contentPath),\n $this->prefixHtmlPaths($this->headerPath),\n $this->prefixHtmlPaths($this->footerPath),\n $this->orientation,\n $this->headerHeight,\n $this->footerHeight,\n $this->format,\n $this->dpi,\n $this->waitTime,\n ];\n\n $process = new Process($command, __DIR__);\n $process->setTimeout($this->timeout);\n $process->run();\n\n if ($errorOutput = $process->getErrorOutput()) {\n throw new RuntimeException('PhantomJS: ' . $errorOutput);\n }\n\n // Remove temporary HTML files\n @unlink($this->headerPath);\n @unlink($this->contentPath);\n @unlink($this->footerPath);\n }",
"public function run()\n {\n $items = [\n\n ['id' => 1, 'code' => 'BlAn', 'name' => 'Black Anodize', 'minimum_lot_charge' => '65.00', 'compliant_rohs' => 1, 'compliant_reach' => 1, 'archive' => 0, 'revision' => null],\n\n ];\n\n foreach ($items as $item) {\n \\App\\Process::create($item);\n }\n }",
"function taskRun() {\r\n\t\texec(\"cd \".TASK_PATH.\";\".PHP_BIN_PATH.\" \".$this->filename.\" \".$this->paramKey.\" > /tmp/1.out &\");\r\n\t}",
"function main()\r\n\t\t{\r\n\t\t\t$this->Logging->maintainBuffer();\r\n\t\t\t$this->Logging->write('Export started');\r\n\t\t\t\r\n\t\t\t$parameters = $this->ReportParameters->parse($this->parameters);\r\n\t\t\t$this->Impersonate->impersonate($parameters['Virtual']['impersonate']);\r\n\t\t\t$isVerbose = $parameters['Virtual']['is_verbose'];\r\n\t\t\t\r\n\t\t\t//initialize the process\r\n\t\t\t$processID = $this->Process->createProcess('medSage Export', false);\r\n\t\t\t$this->Process->updateProcess($processID, 0, 'Finding transactions since ' . formatDate($parameters['Transaction']['transaction_date_of_service']));\r\n\t\t\t\r\n\t\t\t$chargeTransactionType = $this->Setting->get('charge_transaction_type_id');\r\n\t\t\t\r\n\t\t\t//find records within the specified date range with an appropriate GL code\r\n\t\t\t$results = $this->Transaction->find('all', array(\r\n\t\t\t\t'contain' => array(),\r\n\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t'transaction_date_of_service >=' => $parameters['Transaction']['transaction_date_of_service'],\r\n\t\t\t\t\t'transaction_date_of_service <=' => $parameters['Transaction']['transaction_date_of_service_end'],\r\n\t\t\t\t\t'transaction_type' => $chargeTransactionType,\r\n\t\t\t\t\t'general_ledger_code' => array('455R', '455S', '456R', '456S')\r\n\t\t\t\t)\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$countResults = count($results);\r\n\t\t\t$this->Process->updateProcess($processID, 10, \"Found {$countResults} records\");\r\n\t\t\t\r\n\t\t\tif ($isVerbose)\r\n\t\t\t{\r\n\t\t\t\t$this->Logging->write(\"Found {$countResults} records\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$currentResult = 0;\r\n\t\t\t\r\n\t\t\t//loop through results to associate data from other models\r\n\t\t\tforeach ($results as $key => $row)\r\n\t\t\t{\r\n\t\t\t\t$currentResult++;\r\n\t\t\t\t$currentPercent = round(($currentResult / $countResults) * 89 + 10);\r\n\t\t\t\t$this->Process->updateProcess($processID, $currentPercent, \"Associating data for record {$currentResult} of {$countResults}\");\r\n\t\t\t\t\r\n\t\t\t\t//link record to Customer\r\n\t\t\t\t$customer = $this->Customer->find('first', array(\r\n\t\t\t\t\t'contain' => array(), \r\n\t\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t\t'account_number' => $row['Transaction']['account_number']\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'chains' => array(\r\n\t\t\t\t\t\t'CustomerCarrier' => array(\r\n\t\t\t\t\t\t\t'contain' => array(),\r\n\t\t\t\t\t\t\t'fields' => array(\r\n\t\t\t\t\t\t\t\t'carrier_number',\r\n\t\t\t\t\t\t\t\t'carrier_type',\r\n\t\t\t\t\t\t\t\t'is_active'\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t\t\t\t'carrier_type' => 'P',\r\n\t\t\t\t\t\t\t\t'is_active' => 1\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t'required' => false\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\r\n\t\t\t\tif ($customer === false)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($isVerbose)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->Logging->write(\"Removed: Customer not found ({$row['Transaction']['account_number']})\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tunset($results[$key]);\r\n\t\t\t\t\tcontinue;\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$results[$key]['Customer'] = $customer['Customer'];\r\n\t\t\t\t\t\r\n\t\t\t\t\t//filter out any record that is not for the customer's active primary carrier\r\n\t\t\t\t\tif (!isset($customer['CustomerCarrier'][0]) || (isset($customer['CustomerCarrier'][0])\r\n\t\t\t\t\t\t&& $customer['CustomerCarrier'][0]['carrier_number'] != $row['Transaction']['carrier_number']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($isVerbose)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->Logging->write(\"Removed: Not active primary carrier ({$row['Transaction']['account_number']} {$row['Transaction']['carrier_number']})\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tunset($results[$key]);\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\t//link record to CustomerBilling\r\n\t\t\t\t\t//deceased field not always set to zero so we must test for not equal to 1\r\n\t\t\t\t\t$billingRecord = $this->Customer->CustomerBilling->find('first', array(\r\n\t\t\t\t\t\t'contain' => array(),\r\n\t\t\t\t\t\t'fields' => array('date_of_birth', 'physician_number'),\r\n\t\t\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t\t\t'id' => $customer['Customer']['billing_pointer'],\r\n\t\t\t\t\t\t\t'is_deceased !=' => 1\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\tif ($billingRecord === false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($isVerbose)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->Logging->write(\"Removed: Billing not found or deceased ({$row['Transaction']['account_number']} {$customer['Customer']['billing_pointer']})\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tunset($results[$key]);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$results[$key]['CustomerBilling'] = $billingRecord['CustomerBilling'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//link record to Physician\r\n\t\t\t\t\tif (isset($billingRecord['CustomerBilling']['physician_number']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$physicianRecord = $this->Physician->find('first', array(\r\n\t\t\t\t\t\t\t'contain' => array(),\r\n\t\t\t\t\t\t\t'fields' => array('name', 'fax_number'),\r\n\t\t\t\t\t\t\t'conditions' => array('physician_number' => $billingRecord['CustomerBilling']['physician_number'])\r\n\t\t\t\t\t\t));\r\n\t\t\t\t\t\t$results[$key]['Physician'] = $physicianRecord['Physician'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//find sleep records with non-discharged status\r\n\t\t\t\t$sleepCount = $this->Oxygen->find('count', array(\r\n\t\t\t\t\t'contain' => array(),\r\n\t\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t\t'account_number' => $row['Transaction']['account_number'],\r\n\t\t\t\t\t\t'osa_status !=' => array('', 'D')\r\n\t\t\t\t\t)\r\n\t\t\t\t));\r\n\t\t\t\t\r\n\t\t\t\tif ($sleepCount == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($isVerbose)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->Logging->write(\"Removed: No sleep record or discharged ({$row['Transaction']['account_number']})\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tunset($results[$key]);\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//find if user is competitive bid\r\n\t\t\t\t$inCompetitiveBidZip = $this->CompetitiveBidZipCode->find('count', array(\r\n\t\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t\t'competitive_bid_zip_code' => $row['Transaction']['client_zip_code']\r\n\t\t\t\t\t)\r\n\t\t\t\t));\r\n\t\t\t\t\r\n\t\t\t\t//we can look at the transaction carrier because we are only including\r\n\t\t\t\t//transactions for the customer's primary carrier anyway\r\n\t\t\t\tif ($inCompetitiveBidZip && $row['Transaction']['carrier_number'] == 'MC20')\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($isVerbose)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->Logging->write(\"Removed: Competitive bid zip ({$row['Transaction']['account_number']})\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tunset($results[$key]);\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//link record to Inventory & Vendor\r\n\t\t\t\t$inventoryRecord = $this->Inventory->find('first', array(\r\n\t\t\t\t\t'contain' => array(),\r\n\t\t\t\t\t'fields' => array('manufacturer_product_code', 'vendor_code'),\r\n\t\t\t\t\t'conditions' => array('inventory_number' => $row['Transaction']['inventory_number'])\r\n\t\t\t\t));\r\n\t\t\t\t\r\n\t\t\t\tif ($inventoryRecord !== false)\r\n\t\t\t\t{\r\n\t\t\t\t\t$results[$key]['Inventory'] = $inventoryRecord['Inventory'];\r\n\t\t\t\t\t$results[$key]['Vendor']['name'] = $this->Vendor->field('name', array('vendor_code' => $inventoryRecord['Inventory']['vendor_code']));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//link record to Carrier\r\n\t\t\t\t$carrier = $this->Carrier->find('first', array(\r\n\t\t\t\t\t'contain' => array(),\r\n\t\t\t\t\t'fields' => array('name'),\r\n\t\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t\t'carrier_number' => $row['Transaction']['carrier_number']\r\n\t\t\t\t\t)\r\n\t\t\t\t));\r\n\t\t\t\t\r\n\t\t\t\tif ($carrier !== false)\r\n\t\t\t\t{\r\n\t\t\t\t\t$results[$key]['Carrier'] = $carrier['Carrier'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->Process->updateProcess($processID, 99, \"Generating attachment\");\r\n\t\t\t\r\n\t\t\t// Writes the output CSV to $this->data.\r\n\t\t\t$this->renderOutput($results);\r\n\t\t\t\r\n\t\t\t$this->Process->addFile($processID, 'Export', 'medsage.csv', 'text/csv', $this->data);\r\n\t\t\t$this->Process->updateProcess($processID, 100, \"Export complete\");\r\n\t\t\t$this->Logging->write('Export completed');\r\n\t\t\t\r\n\t\t\tif ($parameters['Virtual']['is_being_uploaded'])\r\n\t\t\t{\r\n\t\t\t\t$outputFile = new File('/tmp/medsage.csv');\r\n\t\t\t\t\r\n\t\t\t\tif ($outputFile->exists())\r\n\t\t\t\t{\r\n\t\t\t\t\t$outputFile->delete();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$outputFile->create();\r\n\t\t\t\t$outputFile->write($this->data, 'w', true);\r\n\t\t\t\t$outputFile->close();\r\n\t\t\t\t\r\n\t\t\t\t$ftpOutput = array();\r\n\t\t\t\texec(\"sftp -b /home/emrs/medsage_sftp_script [email protected]\", $ftpOutput);\r\n\t\t\t\t\r\n\t\t\t\tforeach ($ftpOutput as $ftpLine)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->Logging->write($ftpLine);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->Process->updateProcess($processID, 100, \"Upload complete\");\r\n\t\t\t\t$this->Logging->write('Upload completed');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->Process->finishProcess($processID, $this->Logging->getBufferedOutput());\r\n\t\t}",
"public function run() {\n\t\tMongoCursor::$timeout = -1;\n\t\tEnvironment::set($this->env);\n\t\t$this->tmp = LITHIUM_APP_PATH . $this->tmp;\n\t\t$this->processed = LITHIUM_APP_PATH . $this->processed;\n\t\t$this->pending = LITHIUM_APP_PATH . $this->pending;\n\t\t$this->log(\"...Waking up...\");\n\t\t$pid = new Pid($this->tmp, 'OrderExport');\n\t\t$start = time();\n\t\tif ($pid->already_running == false) {\n\t\t\t$conditions = array('processed' => array('$ne' => true));\n\t\t\t$records = Queue::find('all', compact('conditions'));\n\t\t\tforeach ($records as $queue) {\n\t\t\t\t$this->summary = array();\n\t\t\t\t$this->log(\"Processing Queue Record: $queue->_id\");\n\t\t\t\tif ($queue) {\n\t\t\t\t\t$this->batchId = array('order_batch' => $queue->_id);\n\t\t\t\t\t$this->log(\"Starting to process $queue->_id\");\n\t\t\t\t\t$this->time = date('ymdHis');\n\t\t\t\t\t$queueData = $queue->data();\n\t\t\t\t\t$this->queue = $queue;\n\t\t\t\t\tif($this->queue->run_amount) {\n\t\t\t\t\t\t$this->queue->run_amount += 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->queue->run_amount = 1;\n\t\t\t\t\t}\n\t\t\t\t\tif ($queueData['orders']) {\n\n\t\t\t\t\t\t$this->orderEvents = $queueData['orders'];\n\t\t\t\t\t\t$this->_orderGenerator();\n\t\t\t\t\t}\n\t\t\t\t\tif ($queueData['purchase_orders']) {\n\t\t\t\t\t $this->queue->status = \"Processing PO File\";\n\t\t\t\t\t $this->queue->save();\n\t\t\t\t\t\t$this->poEvents = $queueData['purchase_orders'];\n\t\t\t\t\t\t$this->_purchases();\n\t\t\t\t\t}\n\t\t\t\t\t$this->queue->status = \"Processing Item File\";\n\t\t\t\t\t$this->queue->save();\n\t\t\t\t\t$this->_itemGenerator();\n\t\t\t\t\t$this->log(\"Finised processing: $queue->_id\");\n\t\t\t\t\tif ($queueData['orders'] || $queueData['purchase_orders']) {\n\t\t\t\t\t\t$queue->summary = $this->summary;\n\t\t\t\t\t\t$queue->processed = true;\n\t\t\t\t\t\t$queue->processed_date = new MongoDate();\n\t\t\t\t\t\t$queue->save();\n\t\t\t\t\t\t$this->summary['from_email'] = '[email protected]';\n\t\t\t\t\t\t$this->summary['to_email'] = '[email protected]';\n\t\t\t\t\t\tif ($this->test != 'true' && Environment::is('production')) {\n Mailer::send('Order_Export', $this->summary['to_email'], $this->summary);\n }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->log(\"Already Running! Stoping Execution\");\n\t\t}\n\t\t$end = time();\n\t\t$finish = $end - $start;\n\t\t$this->log(\"It took $finish secs\");\n\t}",
"function cron_run_export(){\n $this->pushLog(\"Start export from cron:\".date(\"Y-m-d H:i:s\"));\n $this->export_by='CRON';\n $this->run_export_qixolData(); \n $this->pushLog(\"Finish export from cron\".date(\"Y-m-d H:i:s\")); \n }",
"function process()\n {\n error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);\n\n $setup = $this->determine_mode();\n $result = $this->{'qp_' . $setup['mode']}($setup['dir'], $setup['file']);\n $this->output($result, $setup['dir']);\n }",
"public function handle(PdfGenerator $pdfGenerator): void\n {\n \\Log::info(\"Weekly:Mailing Cron is working fine!\");\n $this->sendWeeklyPDF($pdfGenerator);\n /*\n Write your database logic we bellow:\n Item::create(['name'=>'hello new']);\n */\n\n $this->info('Weekly:mailing Command Run successfully!');\n }",
"public function generateReport()\n {\n $this->generatedReport = true;\n $this->report->generate($this->results);\n }",
"function Run_Report()\n\t{\n\t\t$this->start_date = date('YmdHis');\n\t\t$this->end_date = date('YmdHis',strtotime('-1 year'));\n\t\t\n\t\t// Build the list for the files\t\n\t\t$full_list = new stdClass();\n\t\t$full_list->error_list = $this->Get_Error_List();\n\n\n\t\t\n\t\t// Build the fulfillment file\n\t\tif($full_list->error_list > 0 )\n\t\t{\n\t\t\t$error_file = $this->Build_Error_File($full_list->error_list);\n\t\t}\n\t\t\t\t\n\t\t$this->Mail_Files($error_file);\n\t\t\n\t\treturn TRUE;\n\t}",
"private function startWebServerProcess() {\n $descriptors = array();\n $pipes = array();\n\n // bypass_shell is true, so that process can be terminated, and is not \"embedded\" in cmd.exe process\n $this->process = proc_open(\n $this->pathToPhpExecutable.' -S 127.0.0.1:'.$this->port.' -t \"'.$this->documentRoot.'\" '.$this->routerScript,\n $descriptors,\n $pipes,\n null,\n null,\n array('bypass_shell' => true)\n );\n }",
"public function handle()\n {\n try {\n\n $this->report_file_path = $this->getFilePath();\n\n if (file_exists($this->report_file_path)) {\n unlink($this->report_file_path);\n }\n\n $this->start();\n\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }",
"public function handle()\n {\n try {\n\n $this->report_file_path = $this->getFilePath();\n\n if (file_exists($this->report_file_path)) {\n unlink($this->report_file_path);\n }\n\n $this->start();\n\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }",
"function process($file){\r\n \tif ($this->process == null){\r\n \t\t$this->process = new SOS_Scheduler_Job_Process();\r\n \t}\r\n \t$this->process->file=$file;\r\n \treturn $this->process;\r\n }",
"function background_task() {\n\t\t\\NewRelicWrapper::mark_as_background_job();\n\t}",
"public function create()\n\t{\n\t\tglobal $ilUser;\n\t\t\n\t\tinclude_once './Services/ADN/Report/classes/class.adnReportFileUtils.php';\n\t\t\n\t\t// Write one task (fillPdfTemplate for every candidate) and finally merge them in one PDF.\n\t\tinclude_once './Services/ADN/Report/classes/class.adnTaskScheduleWriter.php';\n\t\t$writer = new adnTaskScheduleWriter();\n\t\t$writer->xmlStartTag('tasks');\n\n\t\t\n\t\t$num_candidates = count($this->readCandidates());\n\t\t\n\t\t$offset = 0;\n\t\t$outfiles = array();\n\t\tdo\n\t\t{\n\t\t\t// Template by type\n\t\t\tswitch($this->getEvent()->getType())\n\t\t\t{\n\t\t\t\tcase 'gas':\n\t\t\t\t\t$map = $this->getBaseMap(array());\n\t\t\t\t\t$map = $this->addCandidates($map,true,$offset);\n\t\t\t\t\t$form = adnReportFileUtils::getTemplatePathByType(\n\t\t\t\t\t\tadnReportFileUtils::TPL_REPORT_ATTENDANCE_LIST_G);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'chem':\n\t\t\t\t\t$map = $this->getBaseMap(array());\n\t\t\t\t\t$map = $this->addCandidates($map,true,$offset);\n\t\t\t\t\t$form = adnReportFileUtils::getTemplatePathByType(\n\t\t\t\t\t\tadnReportFileUtils::TPL_REPORT_ATTENDANCE_LIST_C);\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase 'dm':\n\t\t\t\tdefault:\n\t\t\t\t\t$map = $this->getBaseMap(array());\n\t\t\t\t\t$map = $this->addCandidates($map,false,$offset);\n\t\t\t\t\t$form = adnReportFileUtils::getTemplatePathByType(\n\t\t\t\t\t\tadnReportFileUtils::TPL_REPORT_ATTENDANCE_LIST);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Write one task (fillPdfTemplate for every candidate) and finally merge them in one PDF.\n\t\t\tinclude_once './Services/ADN/Report/classes/class.adnTaskScheduleWriter.php';\n\t\t\t$writer->xmlStartTag('action',\n\t\t\t\tarray(\n\t\t\t\t\t'method'\t=> 'fillPdfTemplate'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t\n\t\t\t$this->initOutfile();\n\t\t\t$outfiles[] = $this->getOutfile();\n\t\t\t\n\t\t\t$writer->addParameter('string',$form);\n\t\t\t$writer->addParameter('string',$this->getOutfile());\n\t\t\t$writer->addParameter('map',$map);\n\t\t\t$writer->xmlEndTag('action');\n\t\t\t\n\t\t\t\n\t\t\t$offset += self::LIMIT_ENTRIES;\n\t\t\t$num_candidates -= self::LIMIT_ENTRIES;\n\t\t}\n\t\twhile ($num_candidates >= 0);\n\t\t\n\t\t$GLOBALS['ilLog']->write(__METHOD__.': outfiles '.print_r($outfiles,true));\n\t\t\n\t\t\n\t\t$writer->xmlStartTag('action',\n\t\t\t\tarray(\n\t\t\t\t\t'method' => 'mergePdf'\n\t\t\t\t)\n\t\t);\n\t\t$writer->addParameter('vector',(array) $outfiles);\n\t\t$outfile = $this->getDataDir().'/'.$this->getEvent()->getId().'.pdf';\n\t\t$writer->addParameter('string',$outfile);\n\t\t$writer->xmlEndTag('action');\n\t\t\n\t\t\n\t\t$writer->xmlEndTag('tasks');\n\n\t\t$GLOBALS['ilLog']->write($writer->xmlDumpMem(true));\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$adapter = new adnRpcAdapter();\n\t\t\t$adapter->transformationTaskScheduler(\n\t\t\t\t$writer->xmlDumpMem()\n\t\t\t);\n\t\t}\n\t\tcatch(adnReportException $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function mk_s2sendump() {\n $process = new Process(\n sprintf('%s/%s', Config::get('paths.sphinxtrain.folder'), 'mk_s2sendump') .\n ' -pocketsphinx ' . 'yes' .\n ' -moddeffn ' . sprintf('%s/%s.txt', $this->mapPath, 'mdef') .\n ' -mixwfn ' . sprintf('%s/%s', $this->mapPath, 'mixture_weights') .\n ' -sendumpfn ' . sprintf('%s/%s', $this->mapPath, 'sendump')\n );\n $process->setTimeout(0);\n $process->start();\n $process->wait();\n\n if (!$process->isSuccessful()) {\n throw new ProcessFailedException($process);\n }\n }",
"public function run()\n {\n Job::create([\n 'name' => 'Земляные работы',\n ]);\n \n }",
"public function run()\n {\n DB::table('reports')->insert([\n 'job_id' => ' 12 ',\n 'name' => ' راضى ',\n 'report' => ' وظيفه غير موثوق فيها واعتقد ان الناشر يقوم بنشر الكثير من الوظائف ',\n 'view' => '0',\n 'created_at' => time(),\n ]);\n $this->command->info(' Report publised successfully ');\n }",
"protected function onBeginProcess()\n {\n }",
"function Main()\n{\n\tglobal $server;\n\t$ach = new ACH($server);\n\tglobal $co;\n\tglobal $_BATCH_XEQ_MODE;\n\t$log = $server->log;\n\t$db = ECash::getMasterDb();\n\t$company_id = $server->company_id;\n\n\trequire_once(LIB_DIR.\"common_functions.php\");\n\trequire_once(SQL_LIB_DIR. \"util.func.php\");\n\t\n\t$today = date(\"Y-m-d\");\t\n\n\t// First make sure we haven't run today already\n\t$run_state = Check_Process_State($db, $company_id, \"nsf_mailer\", $today);\n\tif ($run_state == 'completed') \n\t{\n\t\techo \"Ran already today.\\n\";\n\t\treturn true;\n\t}\n\t// Make sure we only continue if the rescheduling is done.\n\t$reschedule_state = Check_Process_State($db, $company_id, \"ach_reschedule\", $today);\n\n\t// A few timer symbols...\n\t$insufficient_funds_timer = \"({$today}) Insufficient_Funds_Mailer\";\n\t\n\t$server->timer->Timer_Start($insufficient_funds_timer);\n\n\ttry \n\t{\n\t\t\t$pid = Set_Process_Status($db, $company_id, 'nsf_mailer', 'started', $today);\n\t\t\tif(Generate_ACH_Mailer_Entries($today) != false)\n\t\t\t{\n\t\t\t\t$status = Upload_ACH_Mailer_File($server, $today);\n\n\t\t\t\tif($status === true) \n\t\t\t\t{\n\t\t\t\t\tSet_Process_Status($db, $company_id, 'nsf_mailer', 'completed', $today, $pid);\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tSet_Process_Status($db, $company_id, 'nsf_mailer', 'failed', $today, $pid);\n\t\t\t\t\techo \"Unable to FTP File.\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"Generate_ACH_Mailer_Entries returned false.\\n\";\n\t\t\t\tSet_Process_Status($db, $company_id, 'nsf_mailer', 'failed', $today, $pid);\n\t\t\t}\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\tSet_Process_Status($db, $company_id, 'nsf_mailer', 'failed', $today, $pid);\n\t\t\tthrow $e;\n\t\t}\n\t\t$server->timer->Timer_Stop($insufficient_funds_timer);\n\n\treturn true;\n}",
"public function run()\n {\n $this->createSubParagrafos();\n }",
"public function main()\n {\n $records = array();\n\n $this->pObj->arrReport[] = '\n <h2>\n ' . $this->pObj->pi_getLL( 'ts_create_header' ) . '\n </h2>';\n\n $records = $this->records();\n $this->sqlInsert( $records );\n }",
"private function startWindows(){\r\n\t\t/*\r\n\t\t * Gera o título da janela único para poder recuperar o PID\r\n\t\t */\r\n\t\t$process_name = 'task_bg_' . date('YmdHms') . rand(10000, 99999);\r\n\t\t\r\n\t\t/*\r\n\t\t * Abre o processo em uma janelo e não em backgroud\r\n\t\t * Se abrir em backgroud o processo simplesmente aparece como \"php\" e não dá pra pegar o PID se\r\n\t\t * rodar mais de um\r\n\t\t */\r\n\t\t$completeCmd = \"start \\\"{$process_name}\\\" \\\"{$this->cmd}\\\" \\\"{$this->params}\\\"\"; \r\n\t\tpclose(popen($completeCmd, \"r\"));\r\n\t\t\r\n\t\t/*\r\n\t\t * Lê o PID do processo através to \"title\" da janela\r\n\t\t */\r\n\t\t$out = exec(\"tasklist /v /fo csv | findstr /i \\\"$process_name\\\"\");\r\n\t\ttry{\r\n\t\t\t$out_array = explode(',', $out);\r\n\t\t\t$this->pid = str_replace('\"', '', $out_array[1]);//PID\r\n\t\t}catch (\\Exception $ex){\r\n\t\t\t$this->pid = null;\r\n\t\t}\r\n\t\treturn $this->pid;\r\n\t}",
"public function run()\n {\n $title = 'Gold Cap';\n\n $creator = Creator::find(1);\n\n $firstIssue = $this->dispatch(\n new CreateIssueCommand($creator, '535', $title)\n );\n\n $this->dispatch(\n new CreatePageCommand($firstIssue, $title, 'http://darklegacycomics.com/comics/535.jpg')\n );\n\n }",
"public function sendReport()\n {\n $email = ArgvHandler::getArgumentValue(self::OPTION_EMAIL);\n if( $email && $this->foundDifferances > 0 ){\n echo 'Composing email..'; \n $mail = new PHPMailer;\n $mail->isHTML();\n $mail->addAddress($email);\n $mail->setFrom('[email protected]');\n \n $mail->Subject = 'Screenshot compare of project: ' . $this->projectName;\n $mail->Body = 'We have found: ' . $this->foundDifferances . ' differances';\n \n foreach( $this->differences as $name => $image ){\n $name = str_replace( array(' ', '#'), array('-', ''), $name);\n $mail->Body .= '<br />' . $name;\n $mail->Body .= \"<br /><img src=\\\"cid:{$name}.png\\\" alt=\\\"{name}\\\" />\";\n $mail->addEmbeddedImage($image, $name .'.png');\n \n }\n if(!$mail->send()) {\n echo 'Message could not be sent.';\n echo 'Mailer Error: ' . $mail->ErrorInfo;\n } else {\n echo 'Message has been sent';\n }\n }\n }",
"function CallFromCron() {\n\t\t\t$this->Initate();\n\t\t\t\n\t\t\tif(!$this->IsPathValid() || $this->GetOption('use_rewrite')===true) return;\n\n\t\t\t$fileName = $this->GetSiteInfoPath();\n\t\t\t$s = $this->GenerateContent();\n\t\t\t$f=fopen($fileName,'w');\n\t\t\tif($f) {\n\t\t\t\tfwrite($f,$s);\n\t\t\t\tfclose($f);\n\t\t\t}\t\n\t\t}"
] | [
"0.5785487",
"0.56600064",
"0.55964446",
"0.54310787",
"0.5417613",
"0.527611",
"0.5269956",
"0.5210348",
"0.51564544",
"0.50779706",
"0.50702983",
"0.5069771",
"0.5059997",
"0.50575846",
"0.50052047",
"0.50052047",
"0.49894288",
"0.49793443",
"0.49746066",
"0.49738684",
"0.49479723",
"0.49347958",
"0.49189386",
"0.48954764",
"0.48850203",
"0.48791456",
"0.48517707",
"0.48404497",
"0.48221397",
"0.48195797"
] | 0.6293021 | 0 |
get_tbl_data function end here! / Function Name: get_single_row Desc.: This function get single row in table. | public function get_single_row($tbl='',$wh=array()){
$this->db->where($wh);
$query = $this->db->get($tbl);
return $query->row();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fetchSingleRow()\n\t{\n\t\t$this->db->order_by($this->id,$this->order);\n\t\t$this->db->limit(1);\n\t\treturn $this->db->get($this->table)->result();\n\t}",
"public function getRow ()\n\t{\n\t\t$this->query .= \" LIMIT 1\";\n\t\t$this->run();\n\n\t\tif (!$this->data) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$row = $this->data->fetch_assoc();\n\t\treturn $row;\n\t}",
"public function get_single_row($get=\"*\",$params = null,$table,$fetchmode = PDO::FETCH_ASSOC)\n\t\t{\t\n\t\tif(!$this->dbconnected){\n\t\t\t\t$this->connect();\n\t\t\t\t}\t\n\t\t\tif(empty($get)|| strtolower($get)==\"all\"){$get=\"*\";}\n\t\t\t\n\t\t\t$condition=$this->placeholder($params);\n\t\t\t\n\t\t\t$sql=\"SELECT \".$get.\" FROM \".$table.\" WHERE \".$condition.\" \";\t\t\t\n\t\t\t$this->init($sql,$params);\n\t\t\treturn $this->squery->fetch($fetchmode);\n\t\t\t\t$this->disconnect();\t\t\t\t\t\t\n\t\t}",
"public function getSingleRow() {\r\n \r\n $numericTypes = array(\r\n 1=>'tinyint',\r\n 2=>'smallint',\r\n 3=>'int',\r\n 4=>'float',\r\n 5=>'double',\r\n 8=>'bigint',\r\n 9=>'mediumint',\r\n 16=>'bit' );\r\n \r\n // fetch the data types to find numeric columns\r\n $numericColumns = array();\r\n $i = 0;\r\n while ($i<$this->Result->field_count) {\r\n $meta = $this->Result->fetch_field_direct($i);\r\n if ($meta) {\r\n if ( isset( $numericTypes[$meta->type])) {\r\n $numericColumns[ $meta->name ] = true;\r\n }\r\n }\r\n $i++;\r\n }\r\n \r\n $data = $this->Result->fetch_assoc();\r\n \r\n // convert data type to integer\r\n if ($data) {\r\n foreach( $data as $field => $value ) {\r\n if ($value !== NULL && isset($numericColumns[$field])) {\r\n $data[$field] = (integer) $value;\r\n }\r\n }\r\n }\r\n \r\n return $data;\r\n }",
"public function getOneRow()\n {\n if($this->result)\n {\n $selection = mysql_fetch_row($this->result);\n return $selection[0];\n }\n else \n return $this->result; \n }",
"protected function get_first_row(){}",
"function get_row(){\r\n $rs = $this->query(func_get_args());\r\n $row = mysql_fetch_assoc($rs);\r\n $this->free();\r\n return $row;\r\n }",
"public function getSingle()\n {\n return $this->singleRow ;\n }",
"function fetchRow();",
"function getRow() {\n $obj = null;\n if($this->RS != null) {\n $obj = mysql_fetch_row ($this->RS);\n } \n return $obj;\n }",
"public function fetchRow()\n\t{\n\t\t$this->exec();\n\t\t$temp = $this->stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\t\t$return = null;\n\t\t$this->cleanup();\n\n\t\tif (count($temp) >= 1) {\n\t\t\t$return = $temp[0];\n\t\t}\n\n\t\treturn $return;\n\t}",
"function get_one($table = '', $offset = null)\n\t{\n\t\t$this->limit(1);\n\t\t\n\t\tif($table != '')\n\t\t\t$this->from($table);\n\t\t\n\t\t$CI =& get_instance();\n\t\t$q = $CI->db->query($this->_build_get_query());\n\t\t\n\t\tif( ! $q->num_rows())\n\t\t{\n\t\t\t$q->free_result();\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// get the row\n\t\t\t$data = $q->row();\n\t\t\t$q->free_result();\n\t\t\treturn $data;\n\t\t}\n\t}",
"abstract protected function fetchRowInternal();",
"public function getFirstRow()\n {\n $this->rewind();\n \n if ($row = $this->fetch())\n {\n return $row;\n }\n else\n {\n return null;\n }\n }",
"function fetchRow(){\n\t\treturn $this -> result -> fetch_row();\n\t}",
"function getSingleRow($sql)\r\n\t{\r\n\t\tif($result = $this->doQuery($sql, true))\r\n\t\t{\r\n\t\t\tif($result->num_rows == 0)\r\n\t\t\t{\r\n\t\t\t\tthrow new Exception(sprintf(\"Failed! Couldn't find result. '%s'\",$sql));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if($result->num_rows > 1)\r\n\t\t\t{\r\n\t\t\t\tthrow new Exception(printf(\"Failed! Duplicate results(%d) found for '%s'\",$result->num_rows,$sql));\r\n\t\t\t}\r\n\t\t\t$row = $result->fetch_row();\r\n\t\t\t$result->close();\r\n\t\t\treturn $row;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow( new Exception(\"Query failed! $sql \".$this->_mysqli_last->error));\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t $condition = array(\"id\" =>$this->id);\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }",
"public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t $condition = array(\"id\" =>$this->id);\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }",
"function mswGetTableData($table, $row, $val, $and = '', $params = '*') {\r\n $q = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT $params FROM `\" . DB_PREFIX . $table . \"`\r\n WHERE `\" . $row . \"` = '{$val}'\r\n $and\r\n LIMIT 1\r\n \") or die(mswMysqlErrMsg(((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_errno($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false)), ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)), __LINE__, __FILE__));\r\n return mysqli_fetch_object($q);\r\n}",
"protected function fetchRow() {\r\n\t\ttry {\r\n\t\t\treturn $this->_db->fetchRow($this->_sql, $this->_params);\r\n\t\t} catch (Exception $e) {\r\n\t\t\tdie($e->getMessage());\r\n\t\t}\r\n\t}",
"function fetchRow( $sql='' ) {\r\n\t\t$row=false;\r\n if ($rs = new query($GLOBALS['sysdb'],$sql.((stristr($sql,' limit '))?'':' limit 1'))) {\r\n\t\t\t$row=$rs->getrow();\r\n\t\t\t$rs->free();\r\n\t\t}\r\n \treturn $row;\r\n }",
"function FetchRow() {\n if ($this->mysqlL)\n return mysqli_fetch_array($this->recordset);\n else\n return mysql_fetch_array($this->recordset);\n }",
"function getRow($sql);",
"function getRow($row = 1)\n {\n if($this->query !== null){\n return $this->results[ $row - 1];\n }\n return null;\n }",
"function getSingle($tbl, $col, $id) {\n\t\tinclude('connect.php');\n\n\t\t//the variables added in here allows this to not be strictly defined, this way allows it to be more dynamic and not static\n\t\t$querySingle = \"SELECT * FROM {$tbl} WHERE {$col} = {$id}\";\n\t\t// echo $querySingle;\n\t\t$runSingle = mysqli_query($link, $querySingle);\n\t\tif($runSingle) {\n\n\t\t\t//this returns the object to getmobies in the html\n\t\t\treturn $runSingle;\n\n\t\t// if it's not an object then there is an error\n\t\t}else{\n\t\t\t$error = \"There was an error accessing this information. Please go away.\";\n\t\t\treturn $error;\n\t\t}\n\n\t\tmysqli_close($link);\n\t}",
"public function get_single_record($id='') {\n $this->db->select(\"*\");\n\t\t$this->db->from($this->table_name);\n\t\tif($id != ''){\n\t\t\t$this->db->where(\"id\",$id);\n\t\t\t$query = $this->db->get();\n\t\t\t//echo $this->db->last_query();\n\t\t\t$result = $query->row_array();\n\t\t}\n\t\treturn $result;\n }",
"function selectOneRow($sql, $data=[]){\n $check = $this->executeQuery($sql, $data);\n if($check){\n $result = $this->stmt->fetch(PDO::FETCH_OBJ);\n return $result;\n }\n return false;\n }",
"public function fetchRow()\n\t\t{\n\t\t\treturn $this->result->fetch_row();\n\t\t}",
"public function get_table_row()\n\t{\n\t\treturn $this->table_row;\n\t}",
"public function getRow()\n\t{\n\t\tif($row = $this->res->fetch(PDO::FETCH_ASSOC))\n\t\t\treturn $row;\n\t\telse return false;\n\t}"
] | [
"0.7672308",
"0.7379964",
"0.7375273",
"0.7353355",
"0.7196968",
"0.71685195",
"0.7047175",
"0.7000827",
"0.6995315",
"0.6901155",
"0.68817943",
"0.6879553",
"0.68709445",
"0.6856237",
"0.68505794",
"0.68393403",
"0.6832837",
"0.6832837",
"0.6808044",
"0.6807582",
"0.68066967",
"0.68042",
"0.68001825",
"0.6777392",
"0.6756512",
"0.6754327",
"0.67393327",
"0.67092764",
"0.6700193",
"0.668584"
] | 0.75157976 | 1 |
Write a program that finds the summation of every number from 1 to num. The number will always be a positive integer greater than 0. For example: summation(8) > 36 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 | function summation($n) {
$sum = 0;
for ($i = $n; $i >= 0; $i--) {
$sum += $i;
}
return $sum;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sum($number){\n $sum = 0;\n while ($number > 0){\n $digit = $number / 10;\n $digit1 = $number % 10;\n $sum += $digit1;\n $number = $digit;\n }\n return $sum;\n }",
"function sum($n) {\n\n $sum = 0;\n for ($i=1;$i <= $n;$i++){\n $sum+=$i;\n }\n\n return $sum;\n}",
"function _sum($n)\n\t{\n\t\t$ret = 0;\n\t\t\n\t\twhile ($n > 0) {\n\t\t\t$ret = $ret + ($n % 10);\n\t\t\t$n = (int) ($n / 10);\n\t\t}\n\t\t\n\t\treturn $ret;\t\n\t}",
"function sum($num1, $num2)\n{\n\tfor($i=$num1; $i <= $num2; $i++)\n\t{\n\t\t$total += $i;\n\t}\n\treturn $total;\n}",
"function primeSummation($n) {\n\n\t$sum = 0; // Set initial sum to zero, in case a number less than 2 is passed in\n\n\t// Check all numbers from 2 up to but not including 'n'\n\t// If 'n' is less than 2, the loop is never entered and the initial sum '0' is returned\n\tfor($num = 2; $num < $n; $num++) {\n\n\t\tif(isPrime($num)) $sum += $num;\n\n\t}\n\n\treturn $sum;\n}",
"public function run()\n {\n $power = 5;\n $sum = 0;\n $limit = ($power + 1) * pow(9, $power);\n for ($x = 2; $x < $limit; $x++) {\n if (Exponents::sumOfPowerOfDigits($x, $power) === $x) {\n $sum += $x;\n $this->log($sum.' '.$x);\n }\n }\n return $sum;\n }",
"function solution(array $numbers): int {\n while(count(array_count_values($numbers)) !== 1){\n $a = min($numbers);\n foreach($numbers as &$number){\n $number = ($number % $a !== 0)? $number % $a: $a;\n }\n }\n return array_sum($numbers);\n}",
"function getDivs($num){\n\t$sum = 1; //include 1\n\tfor($i = 2; $i <= sqrt($num); $i++){\n\t\tif($num % $i == 0){\n\t\t\t$val = $num / $i;\n\t\t\t$sum+=($i+$val);\n\t\t}\n\t}\n\treturn $sum;\n}",
"function sum($numbers) {\n // initialize the variable we will return\n $sum = 0;\n // sum up the numbers\n foreach ($numbers as $number) {\n $sum += $number;\n }\n // return the sum to the user\n return $sum;\n }",
"function sum(...$num){\n $result = 0;\n // use foreach to access element in array\n foreach($num as $val){\n $result += $val;\n }\n return $result;\n }",
"public static function alternatingSumOfDigits(int $num): int\n {\n $num = (string) $num;\n $result = 0;\n $add = true;\n for ($x = 0; $x < strlen($num); $x++) {\n if ($add) {\n $result += (int) $num[$x];\n } else {\n $result -= (int) $num[$x];\n }\n\n $add = !$add;\n }\n return $result;\n }",
"public function testSumIntegers() {\n $values = [1, 2, 3, 4, 4];\n $result = Stats::sum($values);\n $expected = 14;\n ok($expected, $result);\n }",
"function suma1()\n {\n $suma= 0;\n foreach(func_get_args() as $number)\n {\n if(!is_numeric($number)) continue;\n $suma += $number;\n }\n\n return $suma;\n }",
"function x_iguales($array, $num) {\n $aux = array_count_values($array);\n for($i=1;$i<=6;$i++){\n if(isset($aux[$i]) && $aux[$i]==$num){\n return array_sum($array);\n }\n }\n return 0;\n}",
"function miniMaxSum($arr) {\n\n sort($arr);\n $count = count($arr);\n $miniSum = 0;\n $maxSum = 0;\n for ($i=0; $i < $count-1; $i++) {\n $miniSum +=$arr[$i];\n }\n for ($i=1; $i < $count; $i++) {\n $maxSum +=$arr[$i];\n }\n\n echo $miniSum.\" \".$maxSum.\"\\n\";\n}",
"function positive_sum($arr) {\n $sum = 0;\n foreach($arr as $x) {\n if ($x > 0) {\n $sum += $x;\n }\n }\n return $sum;\n }",
"function getFactorial(int $number) : int\n{\n $factorial = 0;\n\n for ($i = 1; $i <= $number; $i++) {\n $factorial += $i;\n }\n\n return $factorial;\n}",
"function sumOfDigits(string $num) {\n $sum = 0;\n for ($i = 0; $i < strlen($num); $i++){\n $sum += $num[$i];\n }\n\techo \"\\t sumOfDigits = $sum\";\n return $sum;\n}",
"function suma()\n {\n $suma= 0;\n foreach(func_get_args() as $number)\n {\n $suma += $number;\n }\n\n return $suma;\n }",
"function sum1($m,$n):int{\n\t return $m+$n;\n}",
"function euler002(int $bound): int\n{\n $previous = 0;\n $current = 1;\n $sum = 0;\n while ($current <= $bound) {\n if ($current % 2 == 0) {\n $sum += $current;\n }\n $tmp = $previous + $current;\n $previous = $current;\n $current = $tmp;\n }\n return $sum;\n}",
"function intSum1to20(){\n\t$result = 0;\n\tfor ($i=1; $i <= 20 ; $i++) { \n\t\t$string .= \"$i + \";\n\t\t$result += $i;\n\t}\n\t trim($string, \"+ \");\n\t $string .= \" = $result\";\n\t return $string;\n}",
"function squared_sum($numbers) {\n $sum = 0; \n foreach ($numbers as $number) {\n $sum += $number * $number;\n } \n return $sum;\n }",
"function sumOffactorials($numbers){\n \n \n $arrayOfPositions = indxsOfNumbers($numbers);\n $multipicated = 1;\n foreach ($arrayOfPositions as $value){\n $multipicated *= $numbers[$value];\n }\n $sum = 0;\n $stringOfMultipicated = (string)$multipicated;\n for($i=0;$i<strlen($stringOfMultipicated);$i++){\n $sum+=factorial($stringOfMultipicated[$i]);\n }\n return $sum;\n\n}",
"function sum(array $nums) : float {\r\n\r\n $sum = 0;\r\n\r\n foreach ($nums as $key => $value) {\r\n $sum += $value;\r\n }\r\n\r\n return $sum;\r\n}",
"function sum(int $firsh, int $last)\r\n{\r\n $total = $firsh + $last;\r\n echo \"Total $firsh + $last = $total\" . PHP_EOL;\r\n}",
"function factorial($num)\n {\n $fact = 1;\n for($i = 1; $i <= $num ;$i++)\n $fact = $fact * $i;\n return $fact;\n }",
"public function sumInt() : int\n {\n return array_sum($this->array);\n }",
"static function num($num)\n\t{\n\t\treturn ($num + 0);\n\t}",
"public static function factorialOf(int $num): int\n {\n if ($num === 1) {\n return 1;\n }\n\n return $num * self::factorialOf($num - 1);\n }"
] | [
"0.6932206",
"0.69283915",
"0.670605",
"0.66179466",
"0.64740425",
"0.6273733",
"0.6145422",
"0.61413676",
"0.6128828",
"0.60949993",
"0.6084155",
"0.6050037",
"0.6035942",
"0.5947694",
"0.5899727",
"0.5875877",
"0.5875391",
"0.585498",
"0.5791637",
"0.57505476",
"0.56958616",
"0.5690377",
"0.564627",
"0.5644797",
"0.56311697",
"0.5626453",
"0.5613477",
"0.55891144",
"0.55675435",
"0.556443"
] | 0.72680885 | 0 |
Allows to set params before normalizing | protected function set_params() {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setParams($params) {}",
"public function normalize_params(array $params);",
"public function set_params($params);",
"public function processParams() {\n // TODO: Implement processParams() method.\n }",
"public function setParams()\n {\n $this->parameters = empty($_POST) ? $_GET : array_merge($_POST, $_GET);\n foreach($this->parameters as $key => $value) {\n $this->parameters[$key] = trim($value);\n $this->parameters[$key] = stripslashes($value);\n $this->parameters[$key] = htmlspecialchars($value, ENT_QUOTES);\n }\n unset($_POST);\n unset($_GET);\n }",
"public function setParams($params){\n\t\t\t$params = $this->normalizeParams($params);\n\t\t\t$this->params = $params;\n\t\t}",
"public function setParams($params);",
"public function setParams($params)\n {\n }",
"function setParametros($params){\n\t\t$this->parametros = $params;\n\t}",
"protected function resetParams(): void\n {\n $this->description = '';\n $this->ignoreCase = false;\n $this->ignoreLineEndings = false;\n $this->floatDelta = 0.0;\n $this->ignoreOrder = false;\n }",
"public function setParams()\n {\n // section 10-10--91-60-7f09995f:12e75e0bc39:-8000:000000000000093A begin\n // section 10-10--91-60-7f09995f:12e75e0bc39:-8000:000000000000093A end\n }",
"function setParams (array $params = array());",
"private function setParams($params) {\n\t\t$sequentialArray = false;\n\t\t// Check if $params is a sequential array\n\t\tif (array_keys($params) === range(0, count($params) - 1)) {\n\t\t\t$sequentialArray = true;\n\t\t}\n\t\tforeach ($params as $key => $value) {\n\t\t\t$this->request->bindParam($sequentialArray ? intval($key) + 1 : \":\" . $key, $params[$key]);\n\t\t}\n\t}",
"public function setSetParams($params)\n {\n }",
"public function parseParams() {\n parent::parseParams();\n }",
"public function setParams(){\n if (isset($this->url)) {\n $this->params = array_values($this->url);\n unset($this->url);\n }\n }",
"public function clean_params()\n {\n $this->method = '';\n $this->query_string = '';\n $this->limit = '';\n }",
"protected function prepareParams()\n\t{\n\t\treturn true;\n\t}",
"public function prepare($params)\n {\n $this->params = !empty($params) ? $params[ 0 ] : [ ];\n\n // force mandatory fields\n $this->filter();\n $this->maxRecords();\n }",
"public function setParam()\n {\n $this->param = array();\n $s=count($this->uri);\n if ($s>2) {\n for ($i=2; $i < $s ; $i++) {\n if (!(empty($this->uri[$i]))) {\n $this->param[]=$this->uri[$i];\n }\n }\n }\n /*\n if(REQUEST_METHOD === 'POST')\n $this->param = $_POST;\n else if (REQUEST_METHOD === 'GET')\n $this->param = ! empty($this->uri[2]) ? $this->uri[2] : '';\n */\n }",
"protected function setRequestParameters() {\n $amount = $this->parameters['amount'] ;\n\n $this->clearParameters() ;\n $this->setParameter('transaction_identifier', $this->identifier) ;\n $this->setParameter('amount', $amount) ;\n $this->setParameter('signature', $this->generateSignature($this->parameters)) ;\n $this->setParameter('vendor_token', $this->getLydiaVendorToken()) ;\n }",
"public function setParams($params)\n {\n $this->getParams = $params;\n }",
"public function loadParams()\n {\n parse_str($this->params, $params);\n $this->bulkID = $params['bulkID'];\n }",
"public function setParameters(array $params);",
"public function setParams( $params )\n {\n $this->params = $params;\n }",
"public function setParams($params)\n {\n $this->params = json_encode($params);\n }",
"public function loadParametersFromMetadata(): void {\n $this->loadParamFromMeta = true;\n }",
"public function setParams($params)\n\t{\n\t\tif(is_array($params))\n\t\t\t$this->params = $params;\n\t\telse\n\t\t\t$this->params = array((string)$params);\n\t}",
"public function setParameters(array $params)\n {\n }",
"public function setWhereParams($params)\n {\n }"
] | [
"0.69428355",
"0.6758927",
"0.6745911",
"0.6741572",
"0.67360663",
"0.6724618",
"0.66617453",
"0.6583825",
"0.64564264",
"0.64563364",
"0.64354455",
"0.64088583",
"0.6396673",
"0.6368183",
"0.634208",
"0.6292783",
"0.6230648",
"0.62301487",
"0.61871105",
"0.6106666",
"0.6087017",
"0.60588163",
"0.6035475",
"0.6013346",
"0.6007336",
"0.5972987",
"0.59507734",
"0.5949271",
"0.5930421",
"0.5893763"
] | 0.78959274 | 0 |
Register current class taxonomy | public function register_taxonomy() {
/**
* Filter welcrafted_taxonomy_params_$this->base_taxonomy allows to redefine taxonomy params right before taxonomy registration.
*
* @param array $this->taxonomy_params Taxonomy params array
*/
register_taxonomy(
$this->taxonomy, [ $this->object_type ],
apply_filters( 'welcrafted_taxonomy_params_' . $this->base_taxonomy, $this->taxonomy_params )
);
self::$reserved_terms[] = $this->taxonomy;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function init__registerTaxonomy()\n\t\t{\n\t\t\t\n\t\t\t$this->registerSubmissionCategoryTaxonomy();\n\n\t\t}",
"public function register()\n {\n foreach ($this->taxonomies as $key => $data) {\n register_taxonomy($key, $data['object_type'], $data);\n }\n $this->taxonomyCanBeRegistrated = false;\n }",
"public function register_taxonomy_do(){\n\t\t\n\t register_taxonomy( $this->_str_taxonomy, $this->_arr_object_type, $this->_arr_args_all );\n\t}",
"public function registerTaxonomy()\n {\n\n register_taxonomy($this->questionTaxonomy, $this->questionPostType, array(\n 'hierarchical' => true,\n 'labels' => $this->getTaxonomyLabels('Topic', 'Topics'),\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' => 'topic'),\n ));\n\n\n\n /*register_taxonomy($this->questionTaxonomy2, $this->questionPostType, array(\n 'hierarchical' => false,\n 'labels' => $this->getTaxonomyLabels('Test', 'Tests'),\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' => 'test'),\n ));*/\n }",
"function register_taxonomies(){\n\t\t}",
"public function register_taxonomies() {\n }",
"public function register_taxonomies()\n {\n }",
"public function register_taxonomies()\n\t{\n\t}",
"public function register_taxonomies() {\n\n\t}",
"public function register_taxonomies() {\n\n\t}",
"public function register_taxonomies() {\n\n\t}",
"public function register_taxonomies() {\n\n\t}",
"public function register_taxonomies() {\n\n\t}",
"public function register_taxonomies()\n\t{ }",
"public function register()\r\n {\r\n add_action('init', function() {\r\n register_taxonomy(\r\n $this->name,\r\n $this->object_type,\r\n $this->getPublicPropertiesValues()\r\n );\r\n });\r\n }",
"public function registerTaxonomyFields()\n {\n }",
"function register_taxonomies() {\n Content_Type_Tax::register();\n Series_Tax::register();\n }",
"function register_taxonomies() {\n\t}",
"function register_taxonomies() {\n\t}",
"function register_taxonomies() {\n\t}",
"function register_taxonomies() {\n\t}",
"function bbp_register_taxonomies()\n{\n}",
"function wpschool_register_taxonomy() {\n register_taxonomy_for_object_type( 'post_tag', 'page' );\n register_taxonomy_for_object_type( 'category', 'page' );\n}",
"function register_taxonomies() {\n\n\t\tif ( is_array( $this->taxonomy_settings ) ) {\n\n\t\t\t// Foreach taxonomy registered with the post type.\n\t\t\tforeach ( $this->taxonomy_settings as $taxonomy_name => $options ) {\n\n\t\t\t\t// Register the taxonomy if it doesn't exist.\n\t\t\t\tif ( ! taxonomy_exists( $taxonomy_name ) ) {\n\n\t\t\t\t\t// Register the taxonomy with Wordpress\n\t\t\t\t\tregister_taxonomy( $taxonomy_name, $this->post_type_name, $options );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// If taxonomy exists, attach exisiting taxonomy to post type.\n\t\t\t\t\tregister_taxonomy_for_object_type( $taxonomy_name, $this->post_type_name );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function ucsc_register_student_support_taxonomy()\n{\n\t$labels = array(\n\t\t'name' => 'Academic Support Type',\n\t\t'singular_name' => 'Academic Support Item',\n\t\t'search_items' => 'Search Academic Support Items',\n\t\t'all_items' => 'All Academic Support Items',\n\t\t'parent_item' => 'Parent Academic Support Item',\n\t\t'parent_item_colon' => 'Parent Academic Support Item:',\n\t\t'edit_item' => 'Edit Academic Support Item',\n\t\t'update_item' => 'Update Academic Support Item',\n\t\t'add_new_item' => 'Add Academic Support Item',\n\t\t'new_item_name' => 'New Academic Support Item',\n\t\t'menu_name' => 'Academic Support Types'\n\t);\n\n\tregister_taxonomy(\n\t\t'student-support-tax',\n\t\t'student-support',\n\t\tarray(\n\t\t\t'hierarchical' => true,\n\t\t\t'labels' => $labels,\n\t\t\t'show_ui' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array('slug' => 'academic-support-tax'),\n\t\t\t'show_in_rest' => true, //Required for Gutenberg editor\n\t\t\t'rest_base' => 'academic-support-tax-api',\n\t\t\t'rest_controller_class' => 'WP_REST_Terms_Controller',\n\t\t)\n\t);\n}",
"public function register_taxonomies() {\n\n function case_study_taxonomies(){\n\n //add new taxonomy hierarchical\n $labels = array(\n 'name'=>'Categories',\n 'singular_name'=>'Categorie',\n 'search_items'=>'Search Categories',\n 'all_items'=>'All Categories',\n 'parent_item'=>'Parent Categorie',\n 'parent_item_colon'=>'Parent Categorie:',\n 'edit_item'=>'Edit Categorie',\n 'update_item'=> 'Update Categorie',\n 'add_new_item'=>'Add new Categorie',\n 'new_item_name'=>'New Categorie name',\n 'menu_name'=>'Categories'\n );\n $args = array(\n 'hierarchical'=> true,\n 'labels'=>$labels,\n 'show_ui'=> true,\n 'show_in_rest'=> true,\n 'show_admin_column'=>true,\n 'query_var'=> true,\n 'rewrite'=> array( 'slug' => 'case-study-type' )\n );\n register_taxonomy('case-study-type', array('case-study'), $args);\n }\n case_study_taxonomies();\n\t}",
"protected function registerTaxonomy()\n {\n register_taxonomy('articleseries', array('post'), array(\n 'hierarchical' => true,\n 'labels' => array(\n 'name' => 'Artikelserien',\n 'singular_name' => 'Artikelserie',\n 'search_items' => 'Artikelserien suchen',\n 'all_items' => 'Alle Artikelserien',\n 'parent_item' => 'Elternserie',\n 'parent_item_colon' => 'Elternserie: ',\n 'edit_item' => 'Artikelserie bearbeiten',\n 'update_item' => 'Artikelserie bearbeiten',\n 'add_new_item' => 'Artikelserie hinzufügen',\n 'new_item_name' => 'Neue Artikelserie',\n 'menu_name' => 'Artikelserien',\n ),\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'artikelserie'),\n ));\n }",
"private function registerTax() {\n $labels = array(\n 'name' => esc_html__( 'Portfolio Categories', 'eltdf-core' ),\n 'singular_name' => esc_html__( 'Portfolio Category', 'eltdf-core' ),\n 'search_items' => esc_html__( 'Search Portfolio Categories','eltdf-core' ),\n 'all_items' => esc_html__( 'All Portfolio Categories','eltdf-core' ),\n 'parent_item' => esc_html__( 'Parent Portfolio Category','eltdf-core' ),\n 'parent_item_colon' => esc_html__( 'Parent Portfolio Category:','eltdf-core' ),\n 'edit_item' => esc_html__( 'Edit Portfolio Category','eltdf-core' ),\n 'update_item' => esc_html__( 'Update Portfolio Category','eltdf-core' ),\n 'add_new_item' => esc_html__( 'Add New Portfolio Category','eltdf-core' ),\n 'new_item_name' => esc_html__( 'New Portfolio Category Name','eltdf-core' ),\n 'menu_name' => esc_html__( 'Portfolio Categories','eltdf-core' ),\n );\n\n register_taxonomy($this->taxBase, array($this->base), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'show_admin_column' => true,\n 'rewrite' => array( 'slug' => 'portfolio-category' ),\n ));\n }",
"function my_taxonomy(){\n $args = array(\n \"labels\" => array(\n \"name\" => \"Brands\",\n \"singular_name\" => \"Brand\",\n ),\n \"public\" => true,\n \"hierarchical\" => true,\n );\n\n register_taxonomy(\"brands\", array(\"cars\"), $args);\n}",
"static function register_taxonomies()\n {\n\n $labels = array(\n 'name' => _x('Taxonomias', 'taxonomy general name', 'SLUG'),\n 'singular_name' => _x('Taxonomia', 'taxonomy singular name', 'SLUG'),\n 'search_items' => __('Search Taxonomias', 'SLUG'),\n 'all_items' => __('All Taxonomias', 'SLUG'),\n 'parent_item' => __('Parent Taxonomia', 'SLUG'),\n 'parent_item_colon' => __('Parent Taxonomia:', 'SLUG'),\n 'edit_item' => __('Edit Taxonomia', 'SLUG'),\n 'update_item' => __('Update Taxonomia', 'SLUG'),\n 'add_new_item' => __('Add New Taxonomia', 'SLUG'),\n 'new_item_name' => __('New Taxonomia Name', 'SLUG'),\n );\n\n register_taxonomy('taxonomia', self::$post_type, array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => true,\n )\n );\n }"
] | [
"0.75405633",
"0.7424779",
"0.73086834",
"0.72864926",
"0.71681076",
"0.71362734",
"0.71188307",
"0.7100783",
"0.7093519",
"0.7093519",
"0.7093519",
"0.7093519",
"0.7093519",
"0.70790356",
"0.7065276",
"0.6954963",
"0.69087577",
"0.69063115",
"0.69063115",
"0.69063115",
"0.69063115",
"0.6843046",
"0.67793775",
"0.67184067",
"0.66460586",
"0.6626657",
"0.65934473",
"0.65132296",
"0.6508081",
"0.64730763"
] | 0.74837875 | 1 |
Retrieve event prefix for adapter | public function getEventPrefix()
{
return $this->_eventPrefix;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEventNamesPrefix() {\n \treturn $this->getBaseTypeName();\n }",
"public function getPrefix()\n {\n }",
"protected function get_prefix()\n {\n return $this->config['prefix'];\n }",
"public function getPrefix()\n {\n return $this->backend->getPrefix();\n }",
"protected function getPrefix()\n\t{\n\t\treturn $this->prefix;\n\t}",
"public function getPrefix();",
"public function getPrefix();",
"public function getPrefix() {\n\t\treturn $this->getProperty('prefix');\n\t}",
"public function get_prefix() {\n\t \treturn $this->_prefix;\n\t }",
"public function getPrefix(): string\n {\n return $this->prefix;\n }",
"public function getPrefix()\r\n {\r\n return $this->_prefix;\r\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"function getPrefix();",
"public function getPrefix()\n\t{\n\t\treturn $this->prefix;\n\t}",
"public function getPrefix(): string;",
"public static function getPrefix()\n {\n return self::$prefix;\n }",
"public function getPrefix(): string\n\t{\n\t\treturn $this->prefix;\n\t}",
"public function getPrefix(){\r\n\t\treturn $this->prefix;\r\n\t}",
"public function getPrefix() {\n return $this->prefix;\n }",
"public function getPrefix() {\n return $this->prefix;\n }",
"function getPrefix() {\n return $this->prefix;\n }",
"public function getPrefix() : string;",
"public function getPrefix()\n {\n return $this->action['prefix'] ?? null;\n }"
] | [
"0.75365704",
"0.6878094",
"0.68669987",
"0.682977",
"0.68185943",
"0.6812814",
"0.6812814",
"0.6768977",
"0.6740322",
"0.6718632",
"0.67073125",
"0.6685238",
"0.6685238",
"0.6685238",
"0.6685238",
"0.6685238",
"0.6685238",
"0.6685238",
"0.6685238",
"0.6680157",
"0.6678209",
"0.6674789",
"0.66645557",
"0.6658089",
"0.6627087",
"0.66249716",
"0.66249716",
"0.6622314",
"0.6584649",
"0.65674305"
] | 0.82942015 | 0 |
Retrieve affected entity ids | public function getAffectedEntityIds()
{
return $this->_affectedEntityIds;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAffectedEntityIds()\n {\n $categoryIds = array();\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n foreach ($bunch as $rowNum => $rowData) {\n if (!$this->isRowAllowedToImport($rowData, $rowNum)) {\n continue;\n }\n if (!isset($this->_newCategory[$rowData[self::COL_CATEGORY]]['entity_id'])) {\n continue;\n }\n $categoryIds[] = $this->_newCategory[$rowData[self::COL_CATEGORY]]['entity_id'];\n }\n }\n return $categoryIds;\n }",
"protected function getEntityIds() {\n $query = $this->cpt_storage->getQuery();\n $keys = $this->entityType->getKeys();\n return $query\n ->sort($keys['id'])\n ->pager($this->limit)\n ->execute();\n }",
"protected function getEntityIds() {\n $query = $this->getStorage()\n ->getQuery()\n ->sort($this->entityType->getKey('id'))\n ->condition('published', TRUE)\n ->condition('queued_for_delete', FALSE);\n\n // Only add the pager if a limit is specified.\n if ($this->limit) {\n $query->pager($this->limit);\n }\n return $query->execute();\n }",
"public function getEntitiesId():array\n {\n return array_keys($this->entities);\n }",
"protected function getEntityIds() {\n $query = $this->getStorage()->getQuery()\n ->sort($this->entityType->getKey('id'));\n\n if (!\\Drupal::currentUser()->hasPermission('administer workspaces')) {\n $workspaces = $this->getUserWorkspaces();\n $query->condition($this->entityType->getKey('id'), $workspaces, 'IN');\n }\n // Only add the pager if a limit is specified.\n if ($this->limit) {\n $query->pager($this->limit);\n }\n return $query->execute();\n }",
"public function affectedIds()\n {\n return collect([$this->alert->project->user])->merge(\n $this->alert->project->collaborators\n )->pluck('id')->all();\n }",
"public function revisionIds(OCCaseInterface $entity);",
"final public function getUpsertedIds(): array {}",
"public function clearAffectedEntityIds()\n {\n $this->_affectedEntityIds = array();\n return $this;\n }",
"public function getEntityListAttribute(): array\n {\n return $this->entities->pluck('id')->all();\n }",
"public function getPurchasableEntityIds();",
"public function getIds();",
"public function getIdentities();",
"public function revisionIds(AwsFileInterface $entity);",
"public function getIds(): array;",
"public function revisionIds(eleague_runsheetInterface $entity);",
"public function revisionIds(ProductEntityInterface $entity);",
"public function revisionIds(BookEntityInterface $entity);",
"public function getIds()\n {\n return $this->pluck('id');\n }",
"protected function getEntityUpdated()\n {\n return [];\n }",
"public function getIds()\n {\n return $this->ids;\n }",
"public function getIds()\n {\n return $this->ids;\n }",
"public function getIds()\n {\n return $this->ids;\n }",
"public function getIds()\n {\n return $this->ids;\n }",
"public function getIds()\n {\n return $this->Ids;\n }",
"public function getIds(): array\n {\n return $this->ids;\n }",
"public function retrieveAllIds()\n {\n return $this->getIdsByCriteria(new Criteria());\n }",
"public function retrieveAllIds()\n {\n return $this->getIdsByCriteria(new Criteria());\n }",
"public function revisionIds(BlogInterface $entity);",
"public function getAllId(): array;"
] | [
"0.75898516",
"0.7073806",
"0.70181197",
"0.6909561",
"0.6880661",
"0.6821785",
"0.66813254",
"0.6671287",
"0.65673137",
"0.65005296",
"0.64918536",
"0.64912254",
"0.64736",
"0.64148694",
"0.64084655",
"0.64070195",
"0.6394531",
"0.6390776",
"0.62762547",
"0.62547594",
"0.621429",
"0.621429",
"0.621429",
"0.621429",
"0.6198771",
"0.6191041",
"0.61646926",
"0.61646926",
"0.61621964",
"0.6153761"
] | 0.8297084 | 0 |
Clear affected entity ids results | public function clearAffectedEntityIds()
{
$this->_affectedEntityIds = array();
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function clearAllResult(){\n $this->setLastError(null);\n $this->setLastResult(null);\n }",
"public function clear()\n {\n $query = clone $this->query;\n $query->clear($this->relation->entity())\n ->execute();\n }",
"public function reset() {\n\t\t$associations = elgg_get_entities(array(\n\t\t\t'type' => 'object',\n\t\t\t'subtype' => 'openid_client::association',\n\t\t\t'limit' => 0,\n\t\t));\n\t\tforeach ($associations as $association) {\n\t\t\t$association->delete();\n\t\t}\n\n\t\t$nonces = elgg_get_entities(array(\n\t\t\t'type' => 'object',\n\t\t\t'subtype' => 'openid_client::nonce',\n\t\t\t'limit' => 0,\n\t\t));\n\n\t\tforeach ($nonces as $nonce) {\n\t\t\t$nonce->delete();\n\t\t}\n\t}",
"public function clear() {\r\n $oQuery = $this->getConnection()->getQuery();\r\n $aId = Array();\r\n foreach ($this->getModelInfo()->getData() as /** @var \\Faderim\\DataBase\\ModelDataInfo */$Model) {\r\n if ($Model->isId()) {\r\n $sCol = $Model->getColName();\r\n $xProp = $this->getModel()->beanGetProperty($Model->getModelName());\r\n $aId[$sCol] = $xProp;\r\n }\r\n }\r\n $oQuery->mountDelete($this->getModelInfo()->getTable(), $aId);\r\n return $oQuery->execute();\r\n }",
"protected function _doResetQueries()\n {\n if (!$this->shouldSkipResetQueries()) {\n $adapter = $this->_getWriteAdapter();\n $adapter->update($this->_getTable('catalogsearch/search_query'), array('is_processed' => 0), array('is_processed != 0'));\n $adapter->delete($this->_getTable('catalogsearch/result'));\n }\n }",
"public function resetIDs() {\r\n\r\n\t\t$this->errorReset();\r\n\t\t$this->IDs = array();\r\n\t}",
"private function resetResults(): void\n {\n $this->results = [\n 'published' => [],\n 'skipped' => [],\n ];\n }",
"public function resetEntityData() {\n $this->_entity = NULL;\n $this->_relationship_entities = [];\n }",
"public static function deleteAllRemovedEntities()\r\n\t\t{\r\n\t\t\t$arrRemovedEntities = self::getRemovedEntities();\r\n\t\t\tforeach( $arrRemovedEntities as $strClass => $arrClassInstance )\r\n\t\t\t{\r\n\t\t\t\tforeach( $arrClassInstance as $intObjectId => $objEntity )\r\n\t\t\t\t{\r\n\t\t\t\t\t$objEntity->delete();\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"function remove_all() \r\n\t{\r\n\t\t$this->reset();\r\n }",
"public function deselectAll();",
"private function deleteAllItens() {\n $criteria = new Criteria;\n $criteria->add(new Filter('id_fatura', '=', $this->id_fatura ?? $this->id));\n $this->deleteByCriteria($criteria);\n $this->itens = [];\n }",
"protected function _resetSearchResults()\n {\n $this->_doResetQueries();\n $this->_app->dispatchEvent('enterprise_catalogsearch_reset_search_result', array());\n }",
"public function resetidentificationAction()\n {\n \t$this->_helper->viewRenderer->setNoRender();\n \t$group = GroupNamespace::getCurrentGroup();\n \t$group->clearCounts(TRUE);\n \t$group->clearWorkAssignedTo(TRUE);\n }",
"public function clearItemsRelatedById()\n\t{\n\t\t$this->collItemsRelatedById = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public static function testClear()\n {\n $em = SurveyEntityManager::getEntityManager(true, true);\n $em->clear();\n }",
"public static function deleteCreatedEntities() {\n global $entities;\n\n if (!empty($entities)) {\n foreach ($entities as $key => $val) {\n foreach ($val as $entity_id => $object) {\n if ($object->deleteProgrammatically()) {\n unset($entities[$key][$entity_id]);\n }\n }\n }\n }\n\n /*self::deleteEntities('node', 1);\n self::deleteEntities('taxonomy_term', 0);\n self::deleteEntities('user', 30);\n self::deleteEntities('comment', 0);*/\n }",
"private function clear() {\n\t\t$this->where = array();\n\t\t$this->order = '';\n\t\t$this->limit = '';\n\t}",
"function flushAllChanges();",
"public function getAffectedEntityIds()\n {\n return $this->_affectedEntityIds;\n }",
"public function clearAll();",
"public function clearAll();",
"public function reset()\n {\n $this->resultFields = array();\n $this->highlightFields = array();\n $this->whereClauses = array();\n $this->limit = null;\n $this->offset = 0;\n $this->facets = array();\n }",
"public function clearId();",
"private function _reset_idiorm_state() {\n\t\t$this->_values = [];\n\t\t$this->_result_columns = [ '*' ];\n\t\t$this->_using_default_result_columns = true;\n\t}",
"function clear()\r\n {\r\n unset($results);\r\n unset($usage); \r\n }",
"public function reset()\n {\n $this->resetFlags();\n $this->resetCols();\n $this->resetTables();\n $this->resetWhere();\n $this->resetGroupBy();\n $this->resetHaving();\n $this->resetOrderBy();\n $this->limit(0);\n $this->offset(0);\n $this->page(0);\n $this->forUpdate(false);\n }",
"public function clearAllPersistentData();",
"protected function clearList() {\n $article_uids = array();\n foreach ($this->getArticles($this->getNumArticles()) as $article) {\n $article_uids[] = $article->getUid();\n }\n if ($article_uids) {\n tx_newspaper::deleteRows(\n self::mm_table,\n $article_uids,\n 'uid_foreign', // check uid_foreign = article uid\n 'uid_local=' . $this->getUid() // process current article list only\n );\n }\n }",
"public function reset()\n {\n $this->values[self::CONDITION] = null;\n $this->values[self::PRIMARY_KEY] = array();\n }"
] | [
"0.6653522",
"0.65218866",
"0.62723655",
"0.6238394",
"0.60837185",
"0.60439205",
"0.60025054",
"0.60009575",
"0.5988118",
"0.5986123",
"0.5970872",
"0.5946686",
"0.5939942",
"0.5938079",
"0.5860952",
"0.5845839",
"0.58450246",
"0.5815526",
"0.5799115",
"0.5797204",
"0.579156",
"0.579156",
"0.57734424",
"0.57599014",
"0.57585347",
"0.57340145",
"0.57336134",
"0.57309526",
"0.57238925",
"0.57160944"
] | 0.75555974 | 0 |
Retrieve product attribute set collection array | public function getProductAttributeSets()
{
if (is_null($this->_productAttributeSets)) {
$this->_productAttributeSets = array();
$entityTypeId = Mage::getModel('eav/entity')
->setType('catalog_product')
->getTypeId();
$collection = Mage::getResourceModel('eav/entity_attribute_set_collection')
->setEntityTypeFilter($entityTypeId);
foreach ($collection as $set) {
$this->_productAttributeSets[$set->getAttributeSetName()] = $set->getId();
}
}
return $this->_productAttributeSets;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFilterableAttributes()\n {\n// $entity = Mage::getSingleton('eav/config')\n// ->getEntityType('catalog_product');\n\n $setIds = $this->_getSetIds();\n if (!$setIds) {\n return array();\n }\n /** @var $collection Mage_Catalog_Model_Resource_Product_Attribute_Collection */\n $collection = Mage::getResourceModel('catalog/product_attribute_collection');\n $collection\n ->setItemObjectClass('catalog/resource_eav_attribute')\n ->setAttributeSetFilter($setIds)\n ->addStoreLabel(Mage::app()->getStore()->getId())\n ->setOrder('position', 'ASC');\n $collection = $this->_prepareAttributeCollection($collection);\n $collection->load();\n\n return $collection;\n }",
"public function getAttributeSets();",
"public function getAttributeSets()\r\n {\r\n $attributeSetCollection = $this->attributeSetFactory->create();\r\n $attributeSetCollection->addFieldToFilter('entity_type_id', ['eq' => $this->productEntityTypeId]);\r\n\r\n return $attributeSetCollection;\r\n }",
"protected function _getAttributesCollection()\n {\n $registry = Mage::registry(self::ATTRIBUTES_REGISTRY_KEY);\n $attributeSetId = $this->getProduct()->getAttributeSetId();\n if (is_array($registry) && isset($registry[$attributeSetId])) {\n return $registry[$attributeSetId];\n }\n $collection = Mage::getResourceModel('googlebase/attribute_collection')\n ->addAttributeSetFilter($attributeSetId, $this->getTargetCountry())\n ->load();\n $registry[$attributeSetId] = $collection;\n Mage::unregister(self::ATTRIBUTES_REGISTRY_KEY);\n Mage::register(self::ATTRIBUTES_REGISTRY_KEY, $registry);\n return $collection;\n }",
"protected function _getAttributesCollection()\n {\n if (!$this->_attributesCollection) {\n $this->_attributesCollection = Mage::getResourceModel('catalog/product_attribute_collection')\n ->load();\n\n foreach ($this->_attributesCollection as $attribute) {\n $attribute->setEntity($this->getEntity());\n }\n }\n return $this->_attributesCollection;\n }",
"public function getProductMediaCollection(){\n //Return collection by attribute set\n return $this->_dataModel->getCollectionByAttributeSet(self::XML_PATH_ATTRIBUTE_SET);\n }",
"public function getAttributeSetArray()\n {\n return $this->attributeSetArray;\n }",
"public function getCollection()\n {\n if (!$this->_collection) {\n $collection = Mage::getModel('catalog/product')->getLoadedProductCollection();\n if (!$collection) {\n $this->_collection = Mage::getModel('catalog/product')\n ->getCollection()\n ->setStoreId(Mage::app()->getStore()->getId())\n ->addCategoryFilter(Mage::getSingleton('catalog/category')->setId($this->_categoryId))\n ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes());\n } else {\n $this->_collection = $collection\n ->setStoreId(Mage::app()->getStore()->getId())\n ->addCategoryFilter(Mage::getSingleton('catalog/category')->setId($this->_categoryId))\n ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes());\n }\n\n if (count($this->_attributesToSelect)) {\n foreach ($this->_attributesToSelect as $code) {\n $this->_collection->addAttributeToSelect($code);\n }\n }\n }\n return $this->_collection;\n }",
"public function getAttributes()\n\t{\n\t\t$AttrList=\\DB::table('prod_attributes')->select('Attrb_ID','Attrb_Name')\n\t\t->get();\n\t\t$AttrResp=array($AttrList);\n\t\treturn $AttrResp;\n\t}",
"public function getAttributes()\n {\n if ($this->getData('attributes') == null) {\n\n $attributes = array();\n $collection = Mage::getResourceModel('catalog/product_attribute_collection')\n ->setEntityTypeFilter(Mage_Catalog_Model_Product::ENTITY)\n ->addFieldToFilter('is_displayed_in_autocomplete', 1);\n\n foreach ($collection as $attribute) {\n $attributes[] = $attribute->getAttributeCode();\n $this->_attributesByCode[$attribute->getAttributeCode()] = $attribute;\n }\n\n $this->setAttributes($attributes);\n }\n\n return $this->getData('attributes');\n }",
"public function getItemsAttribute(): Collection;",
"public function allAttributes()\n {\n $id = $this->id;\n if (empty($id)) {\n $id = 0;\n }\n $b = DB::raw('SELECT * FROM product_attributes LEFT JOIN ( SELECT product_product_attribute.`product_id`, product_product_attribute.`attr_value`, product_product_attribute.`product_attribute_id` FROM product_product_attribute LEFT JOIN products ON product_product_attribute.`product_id` = products.id WHERE `product_id` = ' . $id . ') as a ON a.`product_attribute_id` = product_attributes.id ORDER BY id');\n return DB::select($b);\n //TODO переделать в норм запрос\n }",
"public function getAttributes(): array;",
"public function getAttributes(): array;",
"public function getAttributes(): array;",
"public function getAttributes(): array;",
"public function getAttributesList(): array;",
"protected function _getAttributeSet () {\n return Mage::registry('current_attribute_set');\n }",
"public function getAttributeSet() {\n return $this->attributeSet->toOptionArray ();\n }",
"public function toArray()\n {\n return [10=>'Teste Att'];\n\n $attributes = [];\n $searchCriteria = $this->searchCriteriaFactory->create();\n $result = $this->productAttributeRepository->getList($searchCriteria);\n \n /** @var \\Magento\\Catalog\\Model\\ResourceModel\\Eav\\Attribute $attribute */\n foreach ($result->getItems() as $attribute) {\n if ($this->attributeHelper->isAttributeCodeInBlacklist($attribute->getAttributeCode())) {\n continue;\n }\n\n $attributes[$attribute->getId()] = $attribute->getName();\n }\n \n return $attributes;\n }",
"public function toOptionArray()\n {\n\n $product = Mage::getModel('catalog/product');\n $attributes = $attributes = Mage::getResourceModel('eav/entity_attribute_collection')\n ->setEntityTypeFilter($product->getResource()->getTypeId());\n\n $attributes_array = array();\n $attributes_array[] = array(\"value\" => '', 'label' => '--');\n foreach ($attributes as $attr) {\n $attributes_array[] = array(\"value\" => $attr['attribute_code'], 'label' => $attr['frontend_label']);\n }\n return $attributes_array;\n\n }",
"public function getAttributeArray()\n {\n return $this->attributeArray;\n }",
"public function getList()\n {\n /* @var \\RetailExpress\\SkyLink\\Sdk\\Catalogue\\Attributes\\AttributeCode */\n $attributeCode = AttributeCode::get(AttributeCode::PRODUCT_TYPE);\n\n /* @var \\RetailExpress\\SkyLink\\Sdk\\Catalogue\\Attributes\\AttributeRepository */\n $attributeRepository = $this->attributeRepositoryFactory->create();\n\n $attribute = $attributeRepository->find($attributeCode);\n\n return $attribute->getOptions();\n }",
"public function getAttributeSet()\n {\n return $this->get('attribute_set');\n }",
"public function getAttributes()\n {\n return $this->attributes ?: $this->attributes = new Collection;\n }",
"protected function getAttributesAttribute(): BaseCollection\n {\n $taxonomies = $this->taxonomies;\n\n return $taxonomies\n ->filter(function ($taxonomy) {\n return $taxonomy->taxonomy !== null && Str::startsWith($taxonomy->taxonomy, 'pa_');\n })\n ->groupBy('taxonomy')\n ->map(function ($taxonomy, $taxonomyName) {\n $attributeName = substr($taxonomyName, 3);\n /** @var \\Corcel\\WooCommerce\\Model\\ProductAttribute */\n $attribute = static::$productAttributes->get($attributeName);\n $attribute->setTerms($taxonomy->pluck('term'));\n\n return $attribute;\n })\n ->keyBy('attribute_name');\n }",
"public function get()\n {\n $groups = [];\n $attributes = [];\n\n foreach ($this->query->all() as $index => $attribute) {\n /* @var Attribute $attribute */\n $group = $attribute->group;\n\n if ($group) {\n if (! isset($this->items[$group->name])) {\n $this->items[$group->name] = $attribute->group->toArray();\n }\n\n $this->items[$group->name]['attributes'][] = $attribute->toArray();\n } else {\n $attributes['attributes'][] = $attribute->toArray();\n }\n }\n\n // Adds attributes without a group to the end of the array\n $this->items[''] = $attributes;\n\n return $this->items;\n }",
"public function toArray()\n\t{\n\t\treturn $this->attributes;\n\t}",
"public function productVariantAttributesProvider(): array\n {\n //====================================================================//\n // Build variant Attribute Options List\n // Build variant Attribute Values List\n $values = array();\n $options = array(\n \"order\" => array(),\n \"value\" => array(),\n );\n for ($i = 1; $i < 20; $i++) {\n $key = \"option_\".$i;\n $value = \"Value \".$i;\n $values[$key] = $value;\n $options[\"order\"][$key] = $i;\n $options[\"value\"][$key] = array(0 => $value, 1 => $value);\n }\n //====================================================================//\n // Build Variant Attributes List\n return array(\n \"VariantA\" => array(\"VariantA\", $options, $values),\n \"VariantB\" => array(\"VariantB\", $options, $values),\n \"VariantX\" => array(\"VariantX\", $options, $values),\n );\n }",
"public function toArray()\n {\n return $this->attributes;\n }"
] | [
"0.7929826",
"0.7517461",
"0.75139844",
"0.7420211",
"0.73920137",
"0.71282357",
"0.7004119",
"0.6994836",
"0.6935595",
"0.6853659",
"0.6847911",
"0.6768873",
"0.67664534",
"0.67664534",
"0.67664534",
"0.67664534",
"0.67618954",
"0.6722672",
"0.6674272",
"0.66521823",
"0.657596",
"0.656839",
"0.65386343",
"0.653386",
"0.65327835",
"0.65124285",
"0.64990693",
"0.64989054",
"0.6489318",
"0.64733416"
] | 0.7632131 | 1 |
Say good bye action | public function sayGoodByeAction() {
$name = $this->params['name'];
return 'Good bye, ' . $name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function shout(): void\n {\n if ($this->useMana(30)) {\n $this->life = $this->life + 20;\n echo \"BAAAAAH !!!\";\n } else {\n echo \"No mana ! Need regen.\";\n }\n }",
"public function eat()\n\t{\n\t}",
"public function eat()\n\t{\n\t}",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"function eat()\r\n {\r\n }",
"public function eat();",
"private function e($msg, $good = TRUE) {\n if($good) {\n $color = \"\\033[94m \";\n }else {\n $color = \"\\033[91m\";\n }\n\n echo $color . $msg . \"\\033[0m\" . \"\\n\"; # \\n because this is expected to run on unix.\n }",
"public function eat(): void\n {\n }",
"public function eat(): void\n {\n }",
"function makesSpecialDish() {\n echo \"The chef made delicious chicken parm! <br>\";\n }",
"abstract public function shout();",
"public function eat()\n {\n }",
"public function eat()\n {\n }",
"public function eat()\n {\n }",
"public function eat()\n {\n }",
"public function howToEat()\n {\n }",
"public function fight(): void\r\n {\r\n echo \"\\nGiving a sword slash!\";\r\n }",
"function eat() {\n parent::eat();\n // After we're finished eating, let's meow\n $this->meow();\n }",
"public function hit()\n {\n $this->beeHive = Yii::$app->session['hive'];\n $randomBee = array_rand($this->beeHive); //Choosing the random bee\n\n if ($this->beeHive[$randomBee]->currentPoints > $this->beeHive[$randomBee]->hitPoints) {\n $this->beeHive[$randomBee]->currentPoints = $this->beeHive[$randomBee]->currentPoints - $this->beeHive[$randomBee]->hitPoints;\n $this->setMessage(\"This bee has been hit: \" . get_class($this->beeHive[$randomBee]) . \" and has \" . $this->beeHive[$randomBee]->currentPoints . \" points left.\");\n } elseif ($this->beeHive[$randomBee]->currentPoints < $this->beeHive[$randomBee]->hitPoints) {\n $this->hit();\n }\n\n if ($this->beeHive[$randomBee]->hitPoints == NULL){\n $this->message = \"The iron bee just come to fly.\";\n }\n }"
] | [
"0.65022933",
"0.6418111",
"0.6418111",
"0.63797855",
"0.63797855",
"0.63797855",
"0.63797855",
"0.63797855",
"0.63797855",
"0.63797855",
"0.63797855",
"0.63797855",
"0.63797855",
"0.63797855",
"0.63797855",
"0.63797855",
"0.63424057",
"0.6283551",
"0.6213279",
"0.6213279",
"0.6145758",
"0.6125789",
"0.6125024",
"0.6125024",
"0.6125024",
"0.6125024",
"0.6122898",
"0.6078362",
"0.6049076",
"0.60108805"
] | 0.7729081 | 0 |
Resolves the encapsed statement concating the result of each part and their expressions. | public function resolve()
{
foreach ($this->node->parts as $expr) {
$nodeExpr = \PhpTestBed\Node\NodeLoader::load($expr);
$this->result .= $nodeExpr->getResult();
$this->expr .= $nodeExpr->getExpr();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function reduce($pieces) {\n $limit = (int) (count($pieces) / 2);\n // Incrementally transforms an array of symbols to an array of expressions\n for ($i = 0; $i < $limit; $i++) {\n $j = 0;\n // Look for valid 3-symbols groups and replace them with an Expression\n while ($j <= count($pieces) - 3) {\n $slice = array_slice($pieces, $j, 3);\n $expression = new OperationExpression($slice[0], $slice[1], $slice[2]);\n if ($expression->isValid()) {\n $before = array_slice($pieces, 0, $j);\n $after = array_slice($pieces, $j + 3);\n $pieces = array_merge($before, array($expression), $after);\n }\n $j++;\n }\n }\n return $pieces;\n }",
"private function process_expr_list($tokens)\n {\n $expr = '';\n $type = '';\n $prev_token = '';\n $skip_next = false;\n $sub_expr = '';\n\n $in_lists = array();\n foreach ($tokens as $key => $token) {\n if (0 == strlen(trim($token))) {\n continue;\n }\n if ($skip_next) {\n $skip_next = false;\n continue;\n }\n\n $processed = false;\n $upper = strtoupper(trim($token));\n if (trim($token)) {\n $token = trim($token);\n }\n\n /* is it a subquery?*/\n if (preg_match('/^\\\\s*\\\\(\\\\s*SELECT/i', $token)) {\n $type = 'subquery';\n //tokenize and parse the subquery.\n //we remove the enclosing parenthesis for the tokenizer\n $processed = $this->parse(trim($token, ' ()'));\n /* is it an inlist */\n } elseif ('(' == $upper[0] && ')' == substr($upper, -1)) {\n if ('IN' == $prev_token) {\n $type = 'in-list';\n $processed = $this->split_sql(substr($token, 1, -1));\n $list = array();\n foreach ($processed as $v) {\n if (',' == $v) {\n continue;\n }\n $list[] = $v;\n }\n $processed = $list;\n unset($list);\n $prev_token = '';\n } elseif ('AGAINST' == $prev_token) {\n $type = 'match-arguments';\n $list = $this->split_sql(substr($token, 1, -1));\n if (count($list) > 1) {\n $match_mode = implode('', array_slice($list, 1));\n $processed = array($list[0], $match_mode);\n } else {\n $processed = $list[0];\n }\n $prev_token = '';\n }\n /* it is either an operator, a colref or a constant */\n } else {\n switch ($upper) {\n case 'AND':\n case '&&':\n case 'BETWEEN':\n case 'BINARY':\n case '&':\n case '~':\n case '|':\n case '^':\n case 'CASE':\n case 'WHEN':\n case 'END':\n case 'DIV':\n case '/':\n case '<=>':\n case '=':\n case '>=':\n case '>':\n case 'IS':\n case 'NOT':\n case 'NULL':\n case '<<':\n case '<=':\n case '<':\n case 'LIKE':\n case '-':\n case '%':\n case '!=':\n case '<>':\n case 'REGEXP':\n case '!':\n case '||':\n case 'OR':\n case '+':\n case '>>':\n case 'RLIKE':\n case 'SOUNDS':\n case '*':\n case 'XOR':\n case 'IN':\n $processed = false;\n $type = 'operator';\n break;\n default:\n switch ($token[0]) {\n case \"'\":\n case '\"':\n $type = 'const';\n break;\n case '`':\n $type = 'colref';\n break;\n\n default:\n if (is_numeric($token)) {\n $type = 'const';\n } else {\n $type = 'colref';\n }\n break;\n }\n //$processed = $token;\n $processed = false;\n }\n }\n /* is a reserved word? */\n if (('operator' != $type && 'in-list' != $type && 'sub_expr' != $type) && in_array($upper, $this->reserved)) {\n $token = $upper;\n if (!in_array($upper, $this->functions)) {\n $type = 'reserved';\n } else {\n switch ($token) {\n case 'AVG':\n case 'SUM':\n case 'COUNT':\n case 'MIN':\n case 'MAX':\n case 'STDDEV':\n case 'STDDEV_SAMP':\n case 'STDDEV_POP':\n case 'VARIANCE':\n case 'VAR_SAMP':\n case 'VAR_POP':\n case 'GROUP_CONCAT':\n case 'BIT_AND':\n case 'BIT_OR':\n case 'BIT_XOR':\n $type = 'aggregate_function';\n if (!empty($tokens[$key + 1])) {\n $sub_expr = $tokens[$key + 1];\n }\n //$skip_next=true;\n break;\n\n default:\n $type = 'function';\n if (!empty($tokens[$key + 1])) {\n $sub_expr = $tokens[$key + 1];\n } else {\n $sub_expr = '()';\n }\n //$skip_next=true;\n\n break;\n }\n }\n }\n\n if (!$type) {\n if ('(' == $upper[0]) {\n $local_expr = substr(trim($token), 1, -1);\n } else {\n $local_expr = $token;\n }\n $processed = $this->process_expr_list($this->split_sql($local_expr));\n $type = 'expression';\n\n if (1 == count($processed)) {\n $type = $processed[0]['expr_type'];\n $base_expr = $processed[0]['base_expr'];\n $processed = $processed[0]['sub_tree'];\n }\n }\n\n $sub_expr = trim($sub_expr);\n $sub_expr = '';\n\n $expr[] = array('expr_type' => $type, 'base_expr' => $token, 'sub_tree' => $processed);\n $prev_token = $upper;\n $expr_type = '';\n $type = '';\n }\n if ($sub_expr) {\n $processed['sub_tree'] = $this->process_expr_list($this->split_sql(substr($sub_expr, 1, -1)));\n }\n\n if (!is_array($processed)) {\n print_r($processed);\n $processed = false;\n }\n\n if ($expr_type) {\n $expr[] = array('expr_type' => $type, 'base_expr' => $token, 'sub_tree' => $processed);\n }\n $mod = false;\n\n /*\n\n for($i=0;$i<count($expr);++$i){\n if($expr[$i]['expr_type'] == 'function' ||\n $expr[$i]['expr_type'] == 'aggregate_function') {\n if(!empty($expr[$i+1])) {\n $expr[$i]['sub_tree']=$expr[$i+1]['sub_tree'];\n unset($expr[$i+1]);\n $mod = 1;\n ++$i; // BAD FORM TO MODIFY THE LOOP COUNTER\n }\n }\n\n }\n\n */\n\n if ($mod) {\n $expr = array_values($expr);\n }\n\n return $expr;\n }",
"public function test_reduction_by_equivalence()\n {\n $this->assertEquals('cd+abcd', self::$service->simplify('dc+dcba'));\n $this->assertEquals('xy', self::$service->simplify('2xy-yx'));\n $this->assertEquals('-c+5ab', self::$service->simplify('-a+5ab+3a-c-2a'));\n }",
"protected function expandVariables() {\n do {\n $expanded = false;\n\n foreach ($this->content as $key => $value) {\n if ($this->expandLineVariables($key, $value)) {\n $expanded = true;\n }\n }\n } while ($expanded);\n }",
"protected function resolveParts()\n {\n return implode('\\\\', $this->resolvedParts);\n }",
"function solve($e, $lev = 0) {\n $sep = false;\n if (vstrpos($e, ')')!==false) {\n $i1 = vstrpos($e, '(');\n $i2 = vstrpos($e, ')');\n $ins = substr($e, $i1+1, $i2-$i1-1);\n $left = substr($e, 0, $i1);\n $rght = substr($e, $i2+1);\n d('[' . $lev . '] ' . $e . ' => ' . $left . ' <span class=\"markup\">(</span> ' . $ins . ' <span class=\"markup\">)</span> ' . $rght);\n return solve($left . solve($ins) . $rght, $lev+1);\n } elseif (strpos($e, '|')!==false) {\n $i1 = strpos($e, '|');\n $i2 = strpos($e, '|', $i1+1);\n $ins = substr($e, $i1+1, $i2-$i1-1);\n $left = substr($e, 0, $i1);\n $rght = substr($e, $i2+1);\n d('[' . $lev . '] ' . $e . ' => ' . $left . ' <span class=\"markup\">|</span> ' . $ins . ' <span class=\"markup\">|</span> ' . $rght);\n return solve($left . vabs(solve($ins)) . $rght, $lev+1);\n } elseif (vstrpos($e, '+')!==false) {\n list ($e1, $e2) = vexplode('+', $e, 2);\n d('[' . $lev . '] ' . $e . ' => ' . $e1 . ' <span class=\"markup\">+</span> ' . $e2);\n return vadd(solve($e1, $lev+1), solve($e2, $lev+1));\n } elseif (vstrpos($e, '-', 1)!==false) {\n list ($e1, $e2) = vexplode('-', $e, 2);\n d('[' . $lev . '] ' . $e . ' => ' . $e1 . ' <span class=\"markup\">-</span> ' . $e2);\n return vsub(solve($e1, $lev+1), solve($e2, $lev+1));\n } elseif (vstrpos($e, '*')!==false) {\n list ($e1, $e2) = vexplode('*', $e, 2);\n d('[' . $lev . '] ' . $e . ' => ' . $e1 . ' <span class=\"markup\">*</span> ' . $e2);\n return vmult(solve($e1, $lev+1), solve($e2, $lev+1));\n } elseif (vstrpos($e, '/')!==false) {\n list ($e1, $e2) = vexplode('/', $e, 2);\n d('[' . $lev . '] ' . $e . ' => ' . $e1 . ' <span class=\"markup\">/</span> ' . $e2);\n return vdiv(solve($e1, $lev+1), solve($e2, $lev+1));\n } elseif (vstrpos($e, 'x')!==false) {\n list ($e1, $e2) = vexplode('x', $e, 2);\n d('[' . $lev . '] ' . $e . ' => ' . $e1 . ' <span class=\"markup\">x</span> ' . $e2);\n return vcross(solve($e1, $lev+1), solve($e2, $lev+1));\n }\n if (isset($_SESSION['arystore'][$e])) return solve($_SESSION['arystore'][$e], $lev+1);\n /* $as = $_SESSION['arystore'];\n uksort($as, create_function('$a, $b', 'return strlen($b)-strlen($a);'));\n foreach ($as as $i=>$v) {\n $e = str_ireplace($i, $v, $e);\n } */\n return $e;\n}",
"public function transform()\n\t{\n\t\t$result = \"\";\n\t\t\n\t\t$nodes = $this->scope->getNodes();\n\t\t\n\t\t$declarations = array();\n\t\t\n\t\t// in php we can take all declarations to the top of the scope\n\t\tforeach( $nodes as $key => $node )\n\t\t{\n\t\t\tif ( $node instanceOf Node\\VarDeclaration )\n\t\t\t{\n\t\t\t\t$declarations[] = $node; unset( $nodes[$key] );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$result .= $this->compileVarDeclarations( $declarations );\n\t\t\n\t\tforeach( $nodes as $node )\n\t\t{\n\t\t\t$compilerFnc;\n\t\t\t\n\t\t\tif ( $node instanceOf Node )\n\t\t\t{\n\t\t\t\t$compilerFnc = $node->type;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$compilerFnc = explode( \"\\\\\", get_class( $node ) );\n\t\t\t\t$compilerFnc = array_pop( $compilerFnc );\n\t\t\t}\n\t\t\t\n\t\t\t$result .= call_user_func( array( $this, 'compile'.ucfirst( $compilerFnc ) ), $node );\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"function _expand_quoted_text($var_expr)\r\n {\r\n // if contains unescaped $, expand it\r\n if(preg_match_all('~(?:\\`(?<!\\\\\\\\)\\$' . $this->_dvar_guts_regexp . '(?:' . $this->_obj_ext_regexp . ')*\\`)|(?:(?<!\\\\\\\\)\\$\\w+(\\[[a-zA-Z0-9]+\\])*)~', $var_expr, $_match)) {\r\n $_match = $_match[0];\r\n $_replace = array();\r\n foreach($_match as $_var) {\r\n $_replace[$_var] = '\".(' . $this->_parse_var(str_replace('`','',$_var)) . ').\"';\r\n }\r\n $var_expr = strtr($var_expr, $_replace);\r\n $_return = preg_replace('~\\.\"\"|(?<!\\\\\\\\)\"\"\\.~', '', $var_expr);\r\n } else {\r\n $_return = $var_expr;\r\n }\r\n // replace double quoted literal string with single quotes\r\n $_return = preg_replace('~^\"([\\s\\w]+)\"$~',\"'\\\\1'\",$_return);\r\n return $_return;\r\n }",
"private function process_select_expr($expression)\n {\n $capture = false;\n $alias = '';\n $base_expression = $expression;\n $upper = trim(strtoupper($expression));\n //if necessary, unpack the expression\n if ('(' == $upper[0]) {\n //$expression = substr($expression,1,-1);\n $base_expression = $expression;\n }\n\n $tokens = $this->split_sql($expression);\n $token_count = count($tokens);\n\n /* Determine if there is an explicit alias after the AS clause.\n If AS is found, then the next non-whitespace token is captured as the alias.\n The tokens after (and including) the AS are removed.\n */\n $base_expr = '';\n $stripped = array();\n $capture = false;\n $alias = '';\n $processed = false;\n for ($i = 0; $i < $token_count; ++$i) {\n $token = strtoupper($tokens[$i]);\n if (trim($token)) {\n $stripped[] = $tokens[$i];\n }\n\n if ('AS' == $token) {\n unset($tokens[$i]);\n $capture = true;\n continue;\n }\n\n if ($capture) {\n if (trim($token)) {\n $alias .= $tokens[$i];\n }\n unset($tokens[$i]);\n continue;\n }\n $base_expr .= $tokens[$i];\n }\n\n $stripped = $this->process_expr_list($stripped);\n $last = array_pop($stripped);\n if (!$alias && 'colref' == $last['expr_type']) {\n $prev = array_pop($stripped);\n if ('operator' == $prev['expr_type'] || 'const' == $prev['expr_type'] || 'function' == $prev['expr_type'] || 'expression' == $prev['expr_type'] || //$prev['expr_type'] == 'aggregate_function' ||\n 'subquery' == $prev['expr_type'] || 'colref' == $prev['expr_type']\n ) {\n $alias = $last['base_expr'];\n\n //remove the last token\n array_pop($tokens);\n\n $base_expr = implode('', $tokens);\n }\n }\n\n if (!$alias) {\n $base_expr = implode('', $tokens);\n $alias = $base_expr;\n }\n\n /* Properly escape the alias if it is not escaped */\n if ('`' != $alias[0]) {\n $alias = '`'.str_replace('`', '``', $alias).'`';\n }\n $processed = false;\n $type = 'expression';\n\n if ('(' == substr(trim($base_expr), 0, 1)) {\n $base_expr = substr($expression, 1, -1);\n if (preg_match('/^sel/i', $base_expr)) {\n $type = 'subquery';\n $processed = $this->parse($base_expr);\n }\n }\n if (!$processed) {\n $processed = $this->process_expr_list($tokens);\n }\n\n if (1 == count($processed)) {\n $type = $processed[0]['expr_type'];\n $processed = false;\n }\n\n return array('expr_type' => $type, 'alias' => $alias, 'base_expr' => $base_expr, 'sub_tree' => $processed);\n }",
"public function getConcatExpression(array $parts);",
"private function scorm_eval_prerequisites($prerequisites, $usertracks) {\n\n // This is really a little language parser - AICC_SCRIPT is the reference\n // see 2.3.2.5.1. Sequencing/Navigation Today - from the SCORM 1.2 spec.\n $element = '';\n $stack = array();\n $statuses = array(\n 'passed' => 'passed',\n 'completed' => 'completed',\n 'failed' => 'failed',\n 'incomplete' => 'incomplete',\n 'browsed' => 'browsed',\n 'not attempted' => 'notattempted',\n 'p' => 'passed',\n 'c' => 'completed',\n 'f' => 'failed',\n 'i' => 'incomplete',\n 'b' => 'browsed',\n 'n' => 'notattempted'\n );\n $i = 0;\n\n // Expand the amp entities.\n $prerequisites = preg_replace('/&/', '&', $prerequisites);\n // Find all my parsable tokens.\n $prerequisites = preg_replace('/(&|\\||\\(|\\)|\\~)/', '\\t$1\\t', $prerequisites);\n // Expand operators.\n $prerequisites = preg_replace('/&/', '&&', $prerequisites);\n $prerequisites = preg_replace('/\\|/', '||', $prerequisites);\n // Now - grab all the tokens.\n $elements = explode('\\t', trim($prerequisites));\n\n // Process each token to build an expression to be evaluated.\n $stack = array();\n foreach ($elements as $element) {\n $element = trim($element);\n if (empty($element)) {\n continue;\n }\n if (!preg_match('/^(&&|\\|\\||\\(|\\))$/', $element)) {\n // Create each individual expression.\n // Search for ~ = <> X*{} .\n\n // Sets like 3*{S34, S36, S37, S39}.\n if (preg_match('/^(\\d+)\\*\\{(.+)\\}$/', $element, $matches)) {\n $repeat = $matches[1];\n $set = explode(',', $matches[2]);\n $count = 0;\n foreach ($set as $setelement) {\n if (isset($usertracks[$setelement]) &&\n ($usertracks[$setelement]->status == 'completed' || $usertracks[$setelement]->status == 'passed')) {\n $count++;\n }\n }\n if ($count >= $repeat) {\n $element = 'true';\n } else {\n $element = 'false';\n }\n } else if ($element == '~') {\n // Not maps ~.\n $element = '!';\n } else if (preg_match('/^(.+)(\\=|\\<\\>)(.+)$/', $element, $matches)) {\n // Other symbols = | <> .\n $element = trim($matches[1]);\n if (isset($usertracks[$element])) {\n $value = trim(preg_replace('/(\\'|\\\")/', '', $matches[3]));\n if (isset($statuses[$value])) {\n $value = $statuses[$value];\n }\n if ($matches[2] == '<>') {\n $oper = '!=';\n } else {\n $oper = '==';\n }\n $element = '(\\''.$usertracks[$element]->status.'\\' '.$oper.' \\''.$value.'\\')';\n } else {\n $element = 'false';\n }\n } else {\n // Everything else must be an element defined like S45 ...\n if (isset($usertracks[$element]) &&\n ($usertracks[$element]->status == 'completed' || $usertracks[$element]->status == 'passed')) {\n $element = 'true';\n } else {\n $element = 'false';\n }\n }\n\n }\n $stack[] = ' '.$element.' ';\n }\n return eval('return '.implode($stack).';');\n }",
"private function _expand($segment) {\n self::debug('segment:'.$segment);\n\n preg_match('/(?<!\\\\\\)@(?P<key>[\\w_\\d+]+).*/', $segment, $match);\n $key = $match['key'];\n self::debug('key'.$key);\n $token = '@'.$key;\n $value = $this->_escape($this->_map($key));\n\n /* Combo Tokens\n *\n * E.g. AND conjunction\n *\n * Given A=John, B=Bob, C=Alice, {@A+B+C} results in: John, Bob, Alice\n * Given A=NULL, B=Bob, C=Alice, {@A+B+C} results in: Bob, Alice\n * Given A=NULL, B=NULL, C=Alice, {@A+B+C} results in: Alice\n */\n $combo = explode('+', $key);\n if(count($combo) > 1) {\n // combo tokens like {@A|B|C}\n $tmp = array();\n foreach ($combo as $c) {\n if($this->_map($c)) {\n $tmp[] = $this->_map($c);\n }\n }\n $value = implode(', ', $tmp);\n } else {\n // ordinary tokens\n $value = $this->_map($key);\n }\n\n if($value)\n // found mapping value\n return str_replace($token, $value, $segment);\n\n if(self::$debugMode)\n // put token back to the input in debug mode\n return str_replace($token, \"[$key]\", $segment);\n\n // no mapping value, remove this segment from the spec\n return '';\n }",
"public function testInterpreter()\n {\n $expression = new Plus(\n new Variable(\"a\"),\n new Minus(\n new Variable(\"b\"),\n new Variable(\"c\")\n )\n );\n\n $context = new Context([\"a\"=>25, \"b\"=>6, \"c\"=>5]);\n $result = $expression->interpret($context);\n $this->assertEquals(26, $result);\n\n // \"d a b c - + -\";\n $expression = new Minus(\n new Variable(\"d\"),\n new Plus(\n new Variable(\"a\"),\n new Minus(\n new Variable(\"b\"),\n new Variable(\"c\")\n )\n )\n );\n\n $context = new Context([\"a\"=>25, \"b\"=>6, \"c\"=>5, \"d\"=>30]);\n $result = $expression->interpret($context);\n $this->assertEquals(4, $result);\n }",
"public function resolve(string $abstract, array $with = []);",
"public function evaluateDynamicContent()\n\t{\n\t\t$context = $this->_container === null ? $this : $this->_container;\n\t\tforeach ($this->_expressions as $id => $expression) {\n\t\t\t$this->_items[$id] = $context->evaluateExpression($expression);\n\t\t}\n\t\tforeach ($this->_statements as $id => $statement) {\n\t\t\t$this->_items[$id] = $context->evaluateStatements($statement);\n\t\t}\n\t}",
"public function process($tokens, $keys = array()) {\n\n $base_expr = \"\";\n $expr = array();\n $currCategory = \"\";\n\n if ($this->isStatement($keys)) {\n foreach ($tokens as $token) {\n\n $trim = trim($token);\n $base_expr .= $token;\n\n if ($trim === '') {\n continue;\n }\n\n $upper = strtoupper($trim);\n\n switch ($upper) {\n\n case '=':\n if ($currCategory === 'FORMAT') {\n $expr[] = array('expr_type' => ExpressionType::OPERATOR, 'base_expr' => $trim);\n }\n // else?\n break;\n\n\n default:\n // ignore the other stuff\n break;\n }\n }\n return empty($expr) ? null : $expr;\n }\n\n foreach ($tokens as $token) {\n\n $trim = trim($token);\n\n if ($trim === '') {\n continue;\n }\n\n switch ($currCategory) {\n\n case '':\n $currCategory = 'TABLENAME';\n $expr[] = array('expr_type' => ExpressionType::TABLE, 'table' => $trim,\n 'no_quotes' => $this->revokeQuotation($trim), 'alias' => false, 'base_expr' => $trim);\n break;\n\n default:\n break;\n }\n }\n return empty($expr) ? null : $expr;\n }",
"function express($expression, $nestingLevel = 0) {\n\t$type = gettype($expression);\n\n\tswitch ($type) {\n\t\tcase \"NULL\":\n\t\t\treturn \"null\";\n\t\tcase \"boolean\":\n\t\t\treturn $expression === true ? \"true\" : \"false\";\n\t\tcase \"integer\":\n\t\tcase \"double\":\n\t\t\treturn $expression;\n\t\tcase \"string\":\n\t\t\treturn \"\\\"\" . mb_convert_encoding($expression, mb_internal_encoding()) . \"\\\"\";\n\t\tcase \"array\":\n\t\t\t$output = \"array(\";\n\n\t\t\tforeach ($expression as $key => $value) {\n\t\t\t\t$output .= \"\\n\" . str_repeat(\" \", $nestingLevel + 1) . express($key) . \" => \" . express($value, $nestingLevel + 1) . \",\";\n\t\t\t}\n\n\t\t\t$output = preg_replace(\"/,$/\", \"\\n\" . str_repeat(\" \", $nestingLevel), $output);\n\t\t\treturn $output . \")\";\n\t\tcase \"object\":\n\t\t\t$output = get_class($expression) . \" object (\";\n\n\t\t\tforeach ($expression as $key => $value) {\n\t\t\t\t$output .= \"\\n\" . str_repeat(\" \", $nestingLevel + 1) . express($key) . \" => \" . express($value, $nestingLevel + 1) . \",\";\n\t\t\t}\n\n\t\t\t$output = preg_replace(\"/,$/\", \"\\n\" . str_repeat(\" \", $nestingLevel), $output);\n\t\t\treturn $output . \")\";\n\t\tdefault:\n\t\t\treturn \"($type) $expression\";\n\t}\n}",
"protected function reduce()\n {\n $balance = 0;\n $prev = $next = $literal = '';\n $length = strlen($this->path);\n $segments = array();\n \n for ($i=0; $i<$length; $i++)\n {\n $curr = $this->path[$i];\n $next = isset($this->path[$i + 1]) ? $this->path[$i + 1] : '';\n $prev = ($i > 0) ? $this->path[$i - 1] : '';\n \n if ($curr == '\\\\') {\n if (preg_match('/[\\(|\\)|\\:|\\*]/', $next)) {\n // escaped special character\n $i++;\n $literal .= $next;\n } else {\n // literal\n $literal .= $curr;\n }\n } else {\n if (preg_match('/[\\(|\\)]/', $curr)) {\n // parenthesis\n if ($literal != '') {\n $segments[] = $this->quote($literal);\n $literal = ''; \n }\n \n if ($curr == '(') {\n $balance += 1;\n $segments[] = '(?:';\n } else {\n $balance -= 1;\n $segments[] = ')?';\n }\n } elseif (preg_match('/[\\:|\\*]/', $curr)) {\n // identifier\n preg_match('/(\\:|\\*){1}[a-z\\_]+/i', $this->path, $matches, PREG_OFFSET_CAPTURE, $i);\n if (isset($matches[0]) && count($matches[0]) > 0) {\n if ($literal != '') {\n $segments[] = $this->quote($literal);\n $literal = '';\n }\n \n $id = substr($matches[0][0], 0, 1);\n $key = substr($matches[0][0], 1);\n \n if (isset($this->requirements[$key])) {\n // custom requirements\n $regex = $this->requirements[$key];\n } elseif ($id == '*') {\n // glob\n $regex = '.+';\n } else {\n // standard segments\n $regex = '[^' . $this->quoted_separators . ']+';\n }\n \n $segments[] = '(?<' . $key . '>' . $regex . ')';\n $this->names[] = $key;\n $i += strlen($key);\n } else {\n // invalid identifier:\n $literal .= $curr;\n }\n } else {\n // just normal text\n $literal .= $curr;\n }\n }\n }\n \n if ($literal != '') {\n $segments[] = $this->quote($literal);\n }\n \n if ($balance != 0) {\n throw new \\InvalidArgumentException('Optional segment parenthesis are unbalanced.');\n }\n \n return '/\\A' . implode('', $segments) . '\\Z/';\n }",
"function _applyfor($matches) {\n $var = $matches[1];\n $content = $matches[2];\n // creates foreach php variable\n $phpvar = $this->_convert($var);\n // prefixes\n // TODO: handle parent.key as in ext\n $content = preg_replace('/{([^.#].*?)}/', '{'.$var.'.#.$1}', $content);\n return \"<?php foreach(is_array($phpvar) ? $phpvar : array() as \\$k => \\$v) { ?>{$content}<?php } ?>\";\n }",
"protected function parse() {\n $statement_count = 0;\n $output = [];\n\n // Split template string to array and include statements\n $lines = preg_split('/\\s*(\\{!\\s*(?:[a-z\\s]+:[^\\}]+|end(?:if|foreach))\\s*\\})/', $this->template, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);\n\n // Start Loop\n foreach($lines as $line) {\n\n // Match if|foreach or end\n if (preg_match('/^\\{!\\s*((if|foreach)\\s*:\\s*([^\\}]+)\\s*|end(?:if|foreach))\\s*\\}$/', $line, $statement)) {\n // var_dump($statement);\n\n // Check if we have a if|foreach beginning statement\n if (preg_match('/^(?:if|foreach)/', $statement[1])) {\n // We only need to put main statement in the statement class. Nested statements get appended as the template.\n $statement_count++;\n\n // if 1, instantiate, else put in statement_node\n if ($statement_count == 1) {\n $StatementClass = __NAMESPACE__ . \"\\\\\" . ucfirst($statement[2]) . \"Statement\";\n $Statement = new $StatementClass();\n $Statement->expression = trim($statement[3]);\n } else {\n // put in $Statement object\n $Statement->setTemplate($line);\n }\n\n // end cap\n } else {\n if ($statement_count == 1) {\n $output[] = $Statement->go();\n } else {\n $Statement->setTemplate($line);\n }\n\n $statement_count--;\n }\n\n // Match just text\n } else {\n if ($statement_count > 0) {\n $Statement->setTemplate($line);\n } else {\n $output[] = $this->Variable->translate($line);\n }\n }\n }\n\n return implode($output);\n }",
"public function resolve(array &$array, array $variables = [])\n {\n $begin = preg_quote($this->firstSymbol . $this->openingBracket);\n $end = preg_quote($this->closingBracket);\n $regex = '!' . $begin . '([^' . $end . ']*)' . $end . '!';\n\n\n BDotTool::walk($array, function (&$v, $key, $dotPath) use (&$array, $variables, $regex) {\n if (is_string($v)) {\n if (false !== strpos($v, $this->firstSymbol . $this->openingBracket)) {\n\n\n if (preg_match_all($regex, $v, $matches)) {\n\n if ($matches) {\n $varNames = $matches[1];\n foreach ($varNames as $varName) {\n\n\n $proceed = false;\n if (array_key_exists($varName, $variables)) {\n $replace = $variables[$varName];\n $proceed = true;\n } else {\n if (true === $this->allowBdotResolution && false !== strpos($varName, \".\")) {\n $found = false;\n $replace = BDotTool::getDotValue($varName, $variables, null, $found);\n if (true === $found) {\n $proceed = true;\n }\n }\n }\n\n\n if (true === $proceed) {\n $variable = $this->firstSymbol . $this->openingBracket . $varName . $this->closingBracket;\n if ($variable === $v) {\n // standalone mode, we can replace with anything\n BDotTool::setDotValue($dotPath, $replace, $array);\n } else {\n\n\n // inline mode, only string and number will render correctly\n\n if (null === $replace) { // convert null to empty string\n $replace = \"\";\n }\n if (is_string($replace) || is_int($replace) || is_float($replace)) {\n $v = str_replace($this->firstSymbol . $this->openingBracket . $varName . $this->closingBracket, $replace, $v);\n } else {\n $type = gettype($replace);\n throw new ArrayVariableResolverException(\"The variable \\\"$varName\\\" at \\\"$dotPath\\\" is inline, and therefore should only be replaced by a string, an int or a float; $type given.\");\n }\n }\n }\n }\n }\n }\n }\n }\n });\n }",
"public function evaluateDynamicContent($statements)\n {\n return eval($statements);\n }",
"public function compile()\n {\n return $this->Querify($this->query);\n }",
"abstract protected function resolve();",
"public function build()\n {\n // Apply Shunting Yard algorithm to convert the infix expression\n // into Reverse Polish Notation. Since we have a very limited\n // set of operators and binding rules, the implementation becomes\n // really simple\n $ops = new \\SplStack();\n $rpn = array();\n foreach ($this->parts as $token) {\n if ($token instanceof Operator) {\n while (!$ops->isEmpty() && $token->compare($ops->top()) <= 0) {\n $rpn[] = $ops->pop();\n }\n $ops->push($token);\n } else {\n $rpn[] = $token;\n }\n }\n // Append the remaining operators\n while (!$ops->isEmpty()) {\n $rpn[] = $ops->pop();\n }\n\n // Walk the RPN expression to create AnyOf and AllOf matchers\n $stack = new \\splStack();\n foreach ($rpn as $token) {\n if ($token instanceof Operator) {\n\n // Our operators always need two operands\n if ($stack->count() < 2) {\n throw new \\RuntimeException('Unable to build a valid expression. Not enough operands available.');\n }\n\n $operands = array(\n $stack->pop(),\n $stack->pop(),\n );\n\n // Check what kind of matcher we need to create\n if ($token->getKeyword() === 'OR') {\n $matcher = new \\Hamcrest_Core_AnyOf($operands);\n } else { // AND, BUT\n $matcher = new \\Hamcrest_Core_AllOf($operands);\n }\n\n $stack->push($matcher);\n } else {\n $stack[] = $token;\n }\n }\n\n if ($stack->count() !== 1) {\n throw new \\RuntimeException('Unable to build a valid expression. The RPN stack should have just one item.');\n }\n\n return $stack->pop();\n }",
"private function buildParts ( Array $parts, $assoc = false, $colon = false, $booleanAssoc = true ) {\n $output = '';\n $counter = 0;\n $items = count ( $parts );\n foreach ( $parts as $part ) {\n //if is assoc\n if ( $assoc ) {\n if ( ++$counter < $items )\n $output.= ( $booleanAssoc ) ? $part.' = :'.$part.' AND ' : $part.' = :'.$part.', ';\n else\n $output.= $part.' = :'.$part;\n }\n //comma\n else {\n //colons?\n if ( $colon )\n $part = ':'.$part;\n \n $output .= ( ++$counter < $items ) ? $part . ', ' : $part;\n }\n }\n //statement portion\n return $output;\n }",
"protected function build()\n\t{\n\t\t$output = '$this->getVar($context, array(';\n\t\t$count = count($this->variable);\n\n\t\t// scan each chunk\n\t\tforeach($this->variable as $key => $value)\n\t\t{\n\t\t\t$output .= \"'\" . $value . \"'\";\n\n\t\t\t// last key\n\t\t\t$output .= ($key < $count - 1) ? ', ' : ')';\n\t\t}\n\n\t\treturn $output . ')';\n\t}",
"private function multiple($glue, array $list)\n\t{\n\t\t$len = \\count($list);\n\n\t\tif ($len > 1) {\n\t\t\tforeach ($list as $k => $r) {\n\t\t\t\tif ($r instanceof self) {\n\t\t\t\t\t$list[$k] = '(' . $r . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($len === 1) {\n\t\t\t$x = \\implode('', $list);\n\t\t} else {\n\t\t\t$x = '(' . \\implode(' ' . $glue . ' ', $list) . ')';\n\t\t}\n\n\t\tif (!$len && !$this->unused_glue && !empty($this->expr)) {\n\t\t\t$this->unused_glue = $glue;\n\t\t} elseif ($len === 1 && !$this->unused_glue) {\n\t\t\t$this->expr = $this->getSelf($glue);\n\n\t\t\tif (!empty($this->expr)) {\n\t\t\t\t$this->expr .= ' ' . $glue . ' ';\n\t\t\t}\n\n\t\t\t$this->expr .= $x;\n\t\t\t$this->last_used_glue = $glue;\n\t\t} elseif ($len > 1) {\n\t\t\tif ($this->unused_glue) {\n\t\t\t\t$this->expr = $this->getSelf($this->unused_glue) . ' ' . $this->unused_glue . ' ' . $x;\n\t\t\t\t$this->last_used_glue = $this->unused_glue;\n\t\t\t\t$this->unused_glue = null;\n\t\t\t} else {\n\t\t\t\tif (!empty($this->expr)) {\n\t\t\t\t\t$this->expr = $this->getSelf($glue) . ' ' . $glue . ' ';\n\t\t\t\t}\n\t\t\t\t$this->expr .= $x;\n\t\t\t\t$this->last_used_glue = $glue;\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new DBALException('Ambiguous nested conditions.');\n\t\t}\n\n\t\treturn $this;\n\t}",
"private function getEscapedVariables() {\n // every string variable through htmlentities() recursively except those\n // marked 'noescape'.\n\n if (!$this->escaped) {\n self::escape_recursive($this->vars,$this->noescape);\n $this->escaped = true;\n }\n if (!self::$defaultEscaped) {\n self::escape_recursive(self::$defaultVars,self::$defaultNoescape);\n self::$defaultEscaped = true;\n }\n\n // Make list of variables to extract using local, default and parent\n // variable lists.\n\n $vars = $this->vars + self::$defaultVars;\n if (is_a($this->parent,'\\TCCL\\Templator\\TemplateGenerator')) {\n $vars += $this->parent->getEscapedVariables();\n }\n\n return $vars;\n }",
"function joinContents() {\n if ($this->renderResults()->result) {\n return S($this->result, 'join(Px\\\\arrize(?))');\n }\n }"
] | [
"0.50872403",
"0.49316522",
"0.49278522",
"0.48216766",
"0.48038784",
"0.47510684",
"0.47371405",
"0.472418",
"0.47152796",
"0.4714969",
"0.46381682",
"0.46023667",
"0.45565632",
"0.455597",
"0.45431042",
"0.4529161",
"0.45290908",
"0.45057204",
"0.4497647",
"0.44778755",
"0.44768035",
"0.44048226",
"0.4379841",
"0.43647945",
"0.43518373",
"0.4349796",
"0.4334631",
"0.43332955",
"0.43310738",
"0.43011528"
] | 0.67107433 | 0 |
Initialise. Sets a blacklist of words in the current language. This is a comma separated list in word:blacklist. | function social_init() {
global $CONFIG;
$CONFIG->wordblacklist = array();
$list = explode(',', elgg_echo('word:blacklist'));
if ($list)
{
foreach ($list as $l)
$CONFIG->wordblacklist[] = trim($l);
}
else
{
// Fallback - shouldn't happen
$CONFIG->wordblacklist = array(
'and',
'the',
'then',
'but',
'she',
'his',
'her',
'him',
'one',
'not',
'also',
'about',
'now',
'hence',
'however',
'still',
'likewise',
'otherwise',
'therefore',
'conversely',
'rather',
'consequently',
'furthermore',
'nevertheless',
'instead',
'meanwhile',
'accordingly',
'this',
'seems',
'what',
'whom',
'whose',
'whoever',
'whomever',
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function setWhiteAndBlacklists()\n {\n $config = $this->context->configuration;\n\n if (!empty($config[\"Analysis\"][\"Languages\"][\"except\"])) {\n $this->languagesBlacklist = $config[\"Analysis\"][\"Languages\"][\"except\"];\n }\n\n if (!empty($config[\"Analysis\"][\"Languages\"][\"only\"])) {\n $this->languagesWhitelist = $config[\"Analysis\"][\"Languages\"][\"only\"];\n }\n\n if (!empty($config[\"Analysis\"][\"Analyzers\"][\"except\"])) {\n $this->analyzersBlacklist = $config[\"Analysis\"][\"Analyzers\"][\"except\"];\n }\n\n if (!empty($config[\"Analysis\"][\"Analyzers\"][\"only\"])) {\n $this->analyzersWhitelist = $config[\"Analysis\"][\"Analyzers\"][\"only\"];\n }\n }",
"public function drawBlacklist()\r\n\t{\r\n\t\t$words = $this->myAdmin->getBlacklist();\r\n\r\n\t\tforeach( $words as $word )\r\n\t\t{\r\n\t\t\t$this->list[] = array(\r\n\t\t\t\t'IdPalabra' => $word[ 'idPalabra' ],\r\n\t\t\t\t'Palabra' => $word[ 'palabra' ],\r\n\t\t\t);\r\n\t\t} // end foreach\r\n\r\n\t\t// Renderiza la primera tabla\r\n\t\t$this->setList( 'blacklist' );\r\n\t\t$this->draw( 'Blacklist' );\r\n\r\n\t}",
"public function prepareStopwords() {\n module_load_include('inc', 'mltag', 'stopwords/stopwords_en');\n $stopwords_from_file = mltag_stopwords_en();\n $stopwords_user = variable_get('stopwords_textfield', NULL);\n if (trim($stopwords_user) != NULL || trim($stopwords_user) != '') {\n $stopwords_user = explode(', ', variable_get('stopwords_textfield'));\n $this->stopwords = array_merge($stopwords_from_file, $stopwords_user);\n }\n else {\n $this->stopwords = $stopwords_from_file;\n }\n array_unique($this->stopwords);\n return $this->stopwords;\n }",
"function remove_blacklist($input) {\n \t\n \tglobal $CONFIG;\n \t\n \tif (!is_array($CONFIG->wordblacklist))\n \t\treturn $input;\n \t\n \tif (strlen($input) < 3 || in_array($input,$CONFIG->wordblacklist))\n \t return false;\n \t\n return true; \t\n \t\n }",
"public function blacklist($names)\n {\n //send the list as a blacklist\n $this->send_list('bl', $names);\n }",
"static function ignoredWords(){\n return array(\"a\", \"o\", \"de\", \"da\", \"do\", \"em\", \"e\", \"para\", \"por\", \"que\");\n }",
"static function update_slugs_stop_words($words) {\r\n \t\r\n \t$arr = explode(\"\\n\", $words);\r\n \tupdate_option(self::$db_option_slugs_stop_words, $arr);\r\n }",
"static function get_default_filter_post_slugs_stop_words() {\r\n \t$arr = array (\"a\", \"able\", \"about\", \"above\", \"abroad\", \"according\", \"accordingly\", \"across\"\r\n \t, \"actually\", \"adj\", \"after\", \"afterwards\", \"again\", \"against\", \"ago\", \"ahead\", \"ain't\", \"all\"\r\n \t, \"allow\", \"allows\", \"almost\", \"alone\", \"along\", \"alongside\", \"already\", \"also\", \"although\", \"always\"\r\n \t, \"am\", \"amid\", \"amidst\", \"among\", \"amongst\", \"an\", \"and\", \"another\", \"any\", \"anybody\", \"anyhow\"\r\n \t, \"anyone\", \"anything\", \"anyway\", \"anyways\", \"anywhere\", \"apart\", \"appear\", \"appreciate\"\r\n \t, \"appropriate\", \"are\", \"aren't\", \"around\", \"as\", \"a's\", \"aside\", \"ask\", \"asking\", \"associated\"\r\n \t, \"at\", \"available\", \"away\", \"awfully\", \"b\", \"back\", \"backward\", \"backwards\", \"be\", \"became\"\r\n \t, \"because\", \"become\", \"becomes\", \"becoming\", \"been\", \"before\", \"beforehand\", \"begin\", \"behind\"\r\n \t, \"being\", \"believe\", \"below\", \"beside\", \"besides\", \"best\", \"better\", \"between\", \"beyond\", \"both\"\r\n \t, \"brief\", \"but\", \"by\", \"c\", \"came\", \"can\", \"cannot\", \"cant\", \"can't\", \"caption\", \"cause\", \"causes\"\r\n \t, \"certain\", \"certainly\", \"changes\", \"clearly\", \"c'mon\", \"co\", \"co.\", \"com\", \"come\", \"comes\"\r\n \t, \"concerning\", \"consequently\", \"consider\", \"considering\", \"contain\", \"containing\", \"contains\"\r\n \t, \"corresponding\", \"could\", \"couldn't\", \"course\", \"c's\", \"currently\", \"d\", \"dare\", \"daren't\"\r\n \t, \"definitely\", \"described\", \"despite\", \"did\", \"didn't\", \"different\", \"directly\", \"do\", \"does\"\r\n \t, \"doesn't\", \"doing\", \"done\", \"don't\", \"down\", \"downwards\", \"during\", \"e\", \"each\", \"edu\", \"eg\"\r\n \t, \"eight\", \"eighty\", \"either\", \"else\", \"elsewhere\", \"end\", \"ending\", \"enough\", \"entirely\"\r\n \t, \"especially\", \"et\", \"etc\", \"even\", \"ever\", \"evermore\", \"every\", \"everybody\", \"everyone\"\r\n \t, \"everything\", \"everywhere\", \"ex\", \"exactly\", \"example\", \"except\", \"f\", \"fairly\", \"far\", \"farther\"\r\n \t, \"few\", \"fewer\", \"fifth\", \"first\", \"five\", \"followed\", \"following\", \"follows\", \"for\", \"forever\"\r\n \t, \"former\", \"formerly\", \"forth\", \"forward\", \"found\", \"four\", \"from\", \"further\", \"furthermore\", \"g\"\r\n \t, \"get\", \"gets\", \"getting\", \"given\", \"gives\", \"go\", \"goes\", \"going\", \"gone\", \"got\", \"gotten\"\r\n \t, \"greetings\", \"h\", \"had\", \"hadn't\", \"half\", \"happens\", \"hardly\", \"has\", \"hasn't\", \"have\", \"haven't\"\r\n \t, \"having\", \"he\", \"he'd\", \"he'll\", \"hello\", \"help\", \"hence\", \"her\", \"here\", \"hereafter\", \"hereby\"\r\n \t, \"herein\", \"here's\", \"hereupon\", \"hers\", \"herself\", \"he's\", \"hi\", \"him\", \"himself\", \"his\", \"hither\"\r\n \t, \"hopefully\", \"how\", \"howbeit\", \"however\", \"hundred\", \"i\", \"i'd\", \"ie\", \"if\", \"ignored\", \"i'll\"\r\n \t, \"i'm\", \"immediate\", \"in\", \"inasmuch\", \"inc\", \"inc.\", \"indeed\", \"indicate\", \"indicated\", \"indicates\"\r\n \t\t\t, \"inner\", \"inside\", \"insofar\", \"instead\", \"into\", \"inward\", \"is\", \"isn't\", \"it\", \"it'd\"\r\n \t\t\t, \"it'll\", \"its\", \"it's\", \"itself\", \"i've\", \"j\", \"just\", \"k\", \"keep\", \"keeps\", \"kept\", \"know\"\r\n \t\t\t, \"known\", \"knows\", \"l\", \"last\", \"lately\", \"later\", \"latter\", \"latterly\", \"least\", \"less\"\r\n \t\t\t, \"lest\", \"let\", \"let's\", \"like\", \"liked\", \"likely\", \"likewise\", \"little\", \"look\", \"looking\"\r\n \t\t\t, \"looks\", \"low\", \"lower\", \"ltd\", \"m\", \"made\", \"mainly\", \"make\", \"makes\", \"many\", \"may\"\r\n \t\t\t, \"maybe\", \"mayn't\", \"me\", \"mean\", \"meantime\", \"meanwhile\", \"merely\", \"might\", \"mightn't\"\r\n \t\t\t, \"mine\", \"minus\", \"miss\", \"more\", \"moreover\", \"most\", \"mostly\", \"mr\", \"mrs\", \"much\", \"must\"\r\n \t\t\t, \"mustn't\", \"my\", \"myself\", \"n\", \"name\", \"namely\", \"nd\", \"near\", \"nearly\", \"necessary\"\r\n \t\t\t, \"need\", \"needn't\", \"needs\", \"neither\", \"never\", \"neverf\", \"neverless\", \"nevertheless\"\r\n \t\t\t, \"new\", \"next\", \"nine\", \"ninety\", \"no\", \"nobody\", \"non\", \"none\", \"nonetheless\", \"noone\"\r\n \t\t\t, \"no-one\", \"nor\", \"normally\", \"not\", \"nothing\", \"notwithstanding\", \"novel\", \"now\", \"nowhere\"\r\n \t\t\t, \"o\", \"obviously\", \"of\", \"off\", \"often\", \"oh\", \"ok\", \"okay\", \"old\", \"on\", \"once\", \"one\"\r\n \t\t\t, \"ones\", \"one's\", \"only\", \"onto\", \"opposite\", \"or\", \"other\", \"others\", \"otherwise\", \"ought\"\r\n \t\t\t, \"oughtn't\", \"our\", \"ours\", \"ourselves\", \"out\", \"outside\", \"over\", \"overall\", \"own\", \"p\"\r\n \t\t\t, \"particular\", \"particularly\", \"past\", \"per\", \"perhaps\", \"placed\", \"please\", \"plus\"\r\n \t\t\t, \"possible\", \"presumably\", \"probably\", \"provided\", \"provides\", \"q\", \"que\", \"quite\", \"qv\"\r\n \t\t\t, \"r\", \"rather\", \"rd\", \"re\", \"really\", \"reasonably\", \"recent\", \"recently\", \"regarding\"\r\n \t\t\t, \"regardless\", \"regards\", \"relatively\", \"respectively\", \"right\", \"round\", \"s\", \"said\"\r\n \t\t\t, \"same\", \"saw\", \"say\", \"saying\", \"says\", \"second\", \"secondly\", \"see\", \"seeing\", \"seem\"\r\n \t\t\t, \"seemed\", \"seeming\", \"seems\", \"seen\", \"self\", \"selves\", \"sensible\", \"sent\", \"serious\"\r\n \t\t\t, \"seriously\", \"seven\", \"several\", \"shall\", \"shan't\", \"she\", \"she'd\", \"she'll\", \"she's\"\r\n \t\t\t, \"should\", \"shouldn't\", \"since\", \"six\", \"so\", \"some\", \"somebody\", \"someday\", \"somehow\"\r\n \t\t\t, \"someone\", \"something\", \"sometime\", \"sometimes\", \"somewhat\", \"somewhere\", \"soon\", \"sorry\"\r\n \t\t\t, \"specified\", \"specify\", \"specifying\", \"still\", \"sub\", \"such\", \"sup\", \"sure\", \"t\", \"take\"\r\n \t\t\t, \"taken\", \"taking\", \"tell\", \"tends\", \"th\", \"than\", \"thank\", \"thanks\", \"thanx\", \"that\"\r\n \t\t\t, \"that'll\", \"thats\", \"that's\", \"that've\", \"the\", \"their\", \"theirs\", \"them\", \"themselves\",\r\n \t\t\t \"then\", \"thence\", \"there\", \"thereafter\", \"thereby\", \"there'd\", \"therefore\", \"therein\"\r\n \t\t\t, \"there'll\", \"there're\", \"theres\", \"there's\", \"thereupon\", \"there've\", \"these\", \"they\"\r\n \t\t\t, \"they'd\", \"they'll\", \"they're\", \"they've\", \"thing\", \"things\", \"think\", \"third\", \"thirty\"\r\n \t\t\t, \"this\", \"thorough\", \"thoroughly\", \"those\", \"though\", \"three\", \"through\", \"throughout\"\r\n \t\t\t, \"thru\", \"thus\", \"till\", \"to\", \"together\", \"too\", \"took\", \"toward\", \"towards\", \"tried\"\r\n \t\t\t, \"tries\", \"truly\", \"try\", \"trying\", \"t's\", \"twice\", \"two\", \"u\", \"un\", \"under\", \"underneath\"\r\n \t\t\t, \"undoing\", \"unfortunately\", \"unless\", \"unlike\", \"unlikely\", \"until\", \"unto\", \"up\", \"upon\"\r\n \t\t\t, \"upwards\", \"us\", \"use\", \"used\", \"useful\", \"username\"\r\n \t\t\t, \"uses\", \"using\", \"usually\", \"v\", \"value\"\r\n \t\t\t, \"various\", \"versus\", \"very\", \"via\", \"viz\", \"vs\", \"w\", \"want\", \"wants\", \"was\", \"wasn't\"\r\n \t\t\t, \"way\", \"we\", \"we'd\", \"welcome\", \"well\", \"we'll\", \"went\", \"were\", \"we're\", \"weren't\"\r\n \t\t\t, \"we've\", \"what\", \"whatever\", \"what'll\", \"what's\", \"what've\", \"when\", \"whence\", \"whenever\"\r\n \t\t\t, \"where\", \"whereafter\", \"whereas\", \"whereby\", \"wherein\", \"where's\", \"whereupon\", \"wherever\"\r\n \t\t\t, \"whether\", \"which\", \"whichever\", \"while\", \"whilst\", \"whither\", \"who\", \"who'd\", \"whoever\"\r\n \t\t\t, \"whole\", \"who'll\", \"whom\", \"whomever\", \"who's\", \"whose\", \"why\", \"will\", \"willing\", \"wish\"\r\n \t\t\t, \"with\", \"within\", \"without\", \"wonder\", \"won't\", \"would\", \"wouldn't\", \"x\", \"y\", \"yes\"\r\n \t\t\t, \"yet\", \"you\", \"you'd\", \"you'll\", \"your\", \"you're\", \"yours\", \"yourself\", \"yourselves\"\r\n \t\t\t, \"you've\", \"z\", \"zero\");\r\n \t\r\n \treturn $arr;\r\n }",
"public static function stopwords() {\n\n\t\t$stopwords = array(\n\t\t\t'acea',\n\t\t\t'aceasta',\n\t\t\t'această',\n\t\t\t'aceea',\n\t\t\t'acei',\n\t\t\t'aceia',\n\t\t\t'acel',\n\t\t\t'acela',\n\t\t\t'acele',\n\t\t\t'acelea',\n\t\t\t'acest',\n\t\t\t'acesta',\n\t\t\t'aceste',\n\t\t\t'acestea',\n\t\t\t'aceşti',\n\t\t\t'aceştia',\n\t\t\t'acolo',\n\t\t\t'acord',\n\t\t\t'acum',\n\t\t\t'ai',\n\t\t\t'aia',\n\t\t\t'aibă',\n\t\t\t'aici',\n\t\t\t'al',\n\t\t\t'ăla',\n\t\t\t'ale',\n\t\t\t'alea',\n\t\t\t'ălea',\n\t\t\t'altceva',\n\t\t\t'altcineva',\n\t\t\t'am',\n\t\t\t'ar',\n\t\t\t'are',\n\t\t\t'aş',\n\t\t\t'aşadar',\n\t\t\t'asemenea',\n\t\t\t'asta',\n\t\t\t'ăsta',\n\t\t\t'astăzi',\n\t\t\t'astea',\n\t\t\t'ăstea',\n\t\t\t'ăştia',\n\t\t\t'asupra',\n\t\t\t'aţi',\n\t\t\t'au',\n\t\t\t'avea',\n\t\t\t'avem',\n\t\t\t'aveţi',\n\t\t\t'azi',\n\t\t\t'bine',\n\t\t\t'bucur',\n\t\t\t'bună',\n\t\t\t'ca',\n\t\t\t'că',\n\t\t\t'căci',\n\t\t\t'când',\n\t\t\t'care',\n\t\t\t'cărei',\n\t\t\t'căror',\n\t\t\t'cărui',\n\t\t\t'cât',\n\t\t\t'câte',\n\t\t\t'câţi',\n\t\t\t'către',\n\t\t\t'câtva',\n\t\t\t'caut',\n\t\t\t'ce',\n\t\t\t'cel',\n\t\t\t'ceva',\n\t\t\t'chiar',\n\t\t\t'cinci',\n\t\t\t'cînd',\n\t\t\t'cine',\n\t\t\t'cineva',\n\t\t\t'cît',\n\t\t\t'cîte',\n\t\t\t'cîţi',\n\t\t\t'cîtva',\n\t\t\t'contra',\n\t\t\t'cu',\n\t\t\t'cum',\n\t\t\t'cumva',\n\t\t\t'curând',\n\t\t\t'curînd',\n\t\t\t'da',\n\t\t\t'dă',\n\t\t\t'dacă',\n\t\t\t'dar',\n\t\t\t'dată',\n\t\t\t'datorită',\n\t\t\t'dau',\n\t\t\t'de',\n\t\t\t'deci',\n\t\t\t'deja',\n\t\t\t'deoarece',\n\t\t\t'departe',\n\t\t\t'deşi',\n\t\t\t'din',\n\t\t\t'dinaintea',\n\t\t\t'dintr-',\n\t\t\t'dintre',\n\t\t\t'doi',\n\t\t\t'doilea',\n\t\t\t'două',\n\t\t\t'drept',\n\t\t\t'după',\n\t\t\t'ea',\n\t\t\t'ei',\n\t\t\t'el',\n\t\t\t'ele',\n\t\t\t'eram',\n\t\t\t'este',\n\t\t\t'eşti',\n\t\t\t'eu',\n\t\t\t'face',\n\t\t\t'fără',\n\t\t\t'fata',\n\t\t\t'fi',\n\t\t\t'fie',\n\t\t\t'fiecare',\n\t\t\t'fii',\n\t\t\t'fim',\n\t\t\t'fiţi',\n\t\t\t'fiu',\n\t\t\t'frumos',\n\t\t\t'graţie',\n\t\t\t'halbă',\n\t\t\t'iar',\n\t\t\t'ieri',\n\t\t\t'îi',\n\t\t\t'îl',\n\t\t\t'îmi',\n\t\t\t'împotriva',\n\t\t\t'în',\n\t\t\t'înainte',\n\t\t\t'înaintea',\n\t\t\t'încât',\n\t\t\t'încît',\n\t\t\t'încotro',\n\t\t\t'între',\n\t\t\t'întrucât',\n\t\t\t'întrucît',\n\t\t\t'îţi',\n\t\t\t'la',\n\t\t\t'lângă',\n\t\t\t'le',\n\t\t\t'li',\n\t\t\t'lîngă',\n\t\t\t'lor',\n\t\t\t'lui',\n\t\t\t'mă',\n\t\t\t'mai',\n\t\t\t'mâine',\n\t\t\t'mea',\n\t\t\t'mei',\n\t\t\t'mele',\n\t\t\t'mereu',\n\t\t\t'meu',\n\t\t\t'mi',\n\t\t\t'mie',\n\t\t\t'mîine',\n\t\t\t'mine',\n\t\t\t'mult',\n\t\t\t'multă',\n\t\t\t'mulţi',\n\t\t\t'mulţumesc',\n\t\t\t'ne',\n\t\t\t'nevoie',\n\t\t\t'nicăieri',\n\t\t\t'nici',\n\t\t\t'nimeni',\n\t\t\t'nimeri',\n\t\t\t'nimic',\n\t\t\t'nişte',\n\t\t\t'noastră',\n\t\t\t'noastre',\n\t\t\t'noi',\n\t\t\t'noroc',\n\t\t\t'noştri',\n\t\t\t'nostru',\n\t\t\t'nouă',\n\t\t\t'nu',\n\t\t\t'opt',\n\t\t\t'ori',\n\t\t\t'oricând',\n\t\t\t'oricare',\n\t\t\t'oricât',\n\t\t\t'orice',\n\t\t\t'oricînd',\n\t\t\t'oricine',\n\t\t\t'oricît',\n\t\t\t'oricum',\n\t\t\t'oriunde',\n\t\t\t'până',\n\t\t\t'patra',\n\t\t\t'patru',\n\t\t\t'patrulea',\n\t\t\t'pe',\n\t\t\t'pentru',\n\t\t\t'peste',\n\t\t\t'pic',\n\t\t\t'pînă',\n\t\t\t'poate',\n\t\t\t'pot',\n\t\t\t'prea',\n\t\t\t'prima',\n\t\t\t'primul',\n\t\t\t'prin',\n\t\t\t'puţin',\n\t\t\t'puţina',\n\t\t\t'puţină',\n\t\t\t'rog',\n\t\t\t'sa',\n\t\t\t'să',\n\t\t\t'săi',\n\t\t\t'sale',\n\t\t\t'şapte',\n\t\t\t'şase',\n\t\t\t'sau',\n\t\t\t'său',\n\t\t\t'se',\n\t\t\t'şi',\n\t\t\t'sînt',\n\t\t\t'sîntem',\n\t\t\t'sînteţi',\n\t\t\t'spate',\n\t\t\t'spre',\n\t\t\t'ştiu',\n\t\t\t'sub',\n\t\t\t'sunt',\n\t\t\t'suntem',\n\t\t\t'sunteţi',\n\t\t\t'sută',\n\t\t\t'ta',\n\t\t\t'tăi',\n\t\t\t'tale',\n\t\t\t'tău',\n\t\t\t'te',\n\t\t\t'ţi',\n\t\t\t'ţie',\n\t\t\t'timp',\n\t\t\t'tine',\n\t\t\t'toată',\n\t\t\t'toate',\n\t\t\t'tot',\n\t\t\t'toţi',\n\t\t\t'totuşi',\n\t\t\t'trei',\n\t\t\t'treia',\n\t\t\t'treilea',\n\t\t\t'tu',\n\t\t\t'un',\n\t\t\t'una',\n\t\t\t'unde',\n\t\t\t'undeva',\n\t\t\t'unei',\n\t\t\t'uneia',\n\t\t\t'unele',\n\t\t\t'uneori',\n\t\t\t'unii',\n\t\t\t'unor',\n\t\t\t'unora',\n\t\t\t'unu',\n\t\t\t'unui',\n\t\t\t'unuia',\n\t\t\t'unul',\n\t\t\t'vă',\n\t\t\t'vi',\n\t\t\t'voastră',\n\t\t\t'voastre',\n\t\t\t'voi',\n\t\t\t'voştri',\n\t\t\t'vostru',\n\t\t\t'vouă',\n\t\t\t'vreme',\n\t\t\t'vreo',\n\t\t\t'vreun',\n\t\t\t'zece',\n\t\t\t'zero',\n\t\t\t'zi',\n\t\t\t'zice',\n\t\t);\n\n\t\treturn $stopwords;\n\t}",
"protected function insertBlacklist() {\n return array('binary');\n }",
"private function getBannedWords()\n {\n $bannedTrimmedWords = [];\n $bannedWordsFile = PMF_INCLUDE_DIR.'/blockedwords.txt';\n $bannedWords = [];\n\n // Read the dictionary\n if (file_exists($bannedWordsFile) && is_readable($bannedWordsFile)) {\n $bannedWords = file_get_contents($bannedWordsFile);\n }\n\n // Trim it\n foreach (explode(\"\\n\", $bannedWords) as $word) {\n $bannedTrimmedWords[] = trim($word);\n }\n\n return $bannedTrimmedWords;\n }",
"public function blacklist(Token $token);",
"private function setLanguagesList()\n {\n $languagesList = File::directories($this->paths['lang']);\n\n foreach ($languagesList as $key => $language) {\n $this->languagesList[$key] = substr(str_replace($this->paths['lang'], '', $language), 1);\n }\n }",
"public function setBlacklists($ownBlacklist = null)\n {\n try {\n $this->dataGrid->buildBlacklistHostNamesArray($ownBlacklist);\n return $this;\n } catch (MxToolboxRuntimeException $e) {\n if ($e->getCode() == 400) {\n $this->dataGrid->buildNewBlacklistHostNames();\n return $this;\n }\n return $e;\n }\n }",
"private static function _set_languages()\n\t{\n\t\tif ((count(self::$languages) == 0) AND Request::server('HTTP_ACCEPT_LANGUAGE') AND Request::server('HTTP_ACCEPT_LANGUAGE') != '')\n\t\t{\n\t\t\t$languages = preg_replace('/(;q=[0-9\\.]+)/i', '', strtolower(trim(Request::server('HTTP_ACCEPT_LANGUAGE'))));\n\n\t\t\tself::$languages = explode(',', $languages);\n\t\t}\n\n\t\tif (count(self::$languages) == 0)\n\t\t{\n\t\t\tself::$languages = array('Undefined');\n\t\t}\n\t}",
"function __construct($words = false)\n\t{\n\tif ($words !== false && is_array($words))\n\t{\n\tforeach ($words as $key => $value)\n\t{\n\t$this->addWord($value);\n\t}\n\t}\n\t}",
"function _set_languages()\r\n\t{\r\n\t\tif ((count($this->languages) == 0) AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) AND $_SERVER['HTTP_ACCEPT_LANGUAGE'] != '')\r\n\t\t{\r\n\t\t\t$languages = preg_replace('/(;q=.+)/i', '', trim($_SERVER['HTTP_ACCEPT_LANGUAGE']));\t\t\t\r\n\t\t\t$this->languages = explode(',', $languages);\r\n\t\t}\r\n\t\t\r\n\t\tif (count($this->languages) == 0)\r\n\t\t{\r\n\t\t\t$this->languages = array('Undefined');\r\n\t\t}\t\r\n\t}",
"public function setRejectTerms($terms) {\n\t\t\tif (!empty($terms)) {\n\t\t\t\t$terms = explode(',', $terms);\n\t\t\t\tforeach ($terms as $term) {\n\t\t\t\t\t$this->rejectTerms[] = trim($term);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function filter_bad_words_to_check($badwords=false, $form=false) {\r\n\t\tif ($this->form_name != $form->form_name)\treturn $badwords;\r\n\t\tif (!is_array($badwords))\t\t\t\t\t$badwords = array();\r\n\t\t// Add words to existing array\r\n\t\t$badwords = array_merge($badwords, array(\r\n\t\t\t'buycialis', 'hydrocodone', 'viagraonline', 'cialisonline', 'phentermine', 'viagrabuy', 'percocet', 'tramadol', // 'ambien', \r\n\t\t\t'propecia', 'xenical', 'meridia', 'levitra', 'vicodin', 'viagra', 'valium', 'porno', 'xanax', 'href=', // 'sex', 'soma', 'cialis', \r\n\t\t));\r\n\t\t$badwords = array_unique($badwords);\r\n\t\treturn $badwords;\r\n\t}",
"public function whitelist($names)\n {\n //send the list as a blacklist\n $this->send_list('wl', $names);\n }",
"abstract protected function loadWordsList();",
"public function blacklist()\n {\n if (!count($this->_base->indices)) {\n return false;\n }\n\n if ($this->vars->blacklist) {\n $change = $this->_base->changed(false);\n if (!is_null($change)) {\n try {\n if ($GLOBALS['injector']->getInstance('IMP_Filter')->blacklistMessage($this->_base->indices, false)) {\n $this->_base->deleteMsgs($this->_base->indices, $change);\n return true;\n }\n } catch (Horde_Exception $e) {\n $this->_base->checkUidvalidity();\n }\n }\n } else {\n try {\n $GLOBALS['injector']->getInstance('IMP_Filter')->whitelistMessage($this->_base->indices, false);\n return true;\n } catch (Horde_Exception $e) {\n $this->_base->checkUidvalidity();\n }\n }\n\n return false;\n }",
"public function blacklist(Token $token) {\n $this->blacklist->add($token);\n }",
"private function setCacheWords(): void\n {\n $data = array(\"words\" => $this->words, \"indexed_words\" => $this->indexed_words);\n @file_put_contents(self::CACHE_FILE, serialize($data));\n }",
"protected function _addBlacklistBlocks()\n {\n if (!$this->_validRule(Ingo_Storage::ACTION_BLACKLIST)) {\n return;\n }\n\n $blacklist = $this->_params['storage']\n ->retrieve(Ingo_Storage::ACTION_BLACKLIST);\n $bl_addr = $blacklist->getBlacklist();\n $folder = $blacklist->getBlacklistFolder();\n if (empty($bl_addr)) {\n return;\n }\n\n $action = array();\n if (empty($folder)) {\n $action[] = new Ingo_Script_Sieve_Action_Discard();\n } elseif ($folder == Ingo::BLACKLIST_MARKER) {\n $action[] = new Ingo_Script_Sieve_Action_Addflag(array(\n 'flags' => Ingo_Storage::FLAG_DELETED,\n 'imapflags' => !empty($this->_params['imapflags'])\n ));\n $action[] = new Ingo_Script_Sieve_Action_Keep();\n $action[] = new Ingo_Script_Sieve_Action_Removeflag(array(\n 'flags' => Ingo_Storage::FLAG_DELETED,\n 'imapflags' => !empty($this->_params['imapflags'])\n ));\n } else {\n $action[] = new Ingo_Script_Sieve_Action_Fileinto(array_merge($this->_params, array('folder' => $folder)));\n }\n\n $action[] = new Ingo_Script_Sieve_Action_Stop();\n\n $this->_addItem(Ingo::RULE_BLACKLIST, new Ingo_Script_Sieve_Comment(_(\"Blacklisted Addresses\")));\n\n /* Split the test up to only do 5 addresses at a time. */\n $temp = array();\n $wildcards = array();\n foreach ($bl_addr as $address) {\n if (!empty($address)) {\n if ((strstr($address, '*') !== false) ||\n (strstr($address, '?') !== false)) {\n $wildcards[] = $address;\n } else {\n $temp[] = $address;\n }\n }\n if (count($temp) == 5) {\n $test = new Ingo_Script_Sieve_Test_Address(array('headers' => \"From\\nSender\\nResent-From\", 'addresses' => implode(\"\\n\", $temp)));\n $if = new Ingo_Script_Sieve_If($test);\n $if->setActions($action);\n $this->_addItem(Ingo::RULE_BLACKLIST, $if);\n $temp = array();\n }\n if (count($wildcards) == 5) {\n $test = new Ingo_Script_Sieve_Test_Address(array('headers' => \"From\\nSender\\nResent-From\", 'match-type' => ':matches', 'addresses' => implode(\"\\n\", $wildcards)));\n $if = new Ingo_Script_Sieve_If($test);\n $if->setActions($action);\n $this->_addItem(Ingo::RULE_BLACKLIST, $if);\n $wildcards = array();\n }\n }\n\n if ($temp) {\n $test = new Ingo_Script_Sieve_Test_Address(array('headers' => \"From\\nSender\\nResent-From\", 'addresses' => implode(\"\\n\", $temp)));\n $if = new Ingo_Script_Sieve_If($test);\n $if->setActions($action);\n $this->_addItem(Ingo::RULE_BLACKLIST, $if);\n }\n\n if ($wildcards) {\n $test = new Ingo_Script_Sieve_Test_Address(array('headers' => \"From\\nSender\\nResent-From\", 'match-type' => ':matches', 'addresses' => implode(\"\\n\", $wildcards)));\n $if = new Ingo_Script_Sieve_If($test);\n $if->setActions($action);\n $this->_addItem(Ingo::RULE_BLACKLIST, $if);\n }\n }",
"static function get_slugs_stop_words() {\r\n \t// default values\r\n\t\t $option_default = self::get_default_filter_post_slugs_stop_words();\r\n\t\t \r\n\t // get saved options\r\n\t\t\t$saved = get_option(self::$db_option_slugs_stop_words);\r\n\t\t\t\r\n\t\t\t// assign them\r\n\t\t if (empty($saved)) {\r\n\t\t update_option(self::$db_option_slugs_stop_words, $option_default);\r\n\t\t \r\n\t\t return $option_default;\r\n\t\t }\r\n\t\t else {\r\n\t\t \t// Before returns it, parse_output it\r\n\t\t \t$saved_to_return = array();\r\n\t\t \tforeach ($saved as $item) {\r\n\t\t \t\t$saved_to_return[] = WPPostsRateKeys_Validator::parse_output(trim($item));\r\n\t\t \t}\r\n\t\t \t\t\r\n\t\t \treturn $saved_to_return;\r\n\t\t }\r\n }",
"protected function blacklist_tags() {\n return array();\n }",
"public function __construct($url) {\r\n\t\t$this->setBlacklist(array('der', 'die', 'das', 'von', 'zu', 'in', 'wer', 'wie', 'was', 'navigationsmenü', '?','czoxndoizglzywjszulwq','czoxoiixijtzojg',\r\n\t\t'czoyoijkzsi','fydglrzwwuahrtbci','hcnrpa','hefzhbhvlijtzoje','hhyxauy','ijuio','ikvyvdpyyxrpbmdzl','imfkzgl','imluy','imzpbgvhzg','inbpzci','injhdgluz',\r\n\t\t'jlcy','lkdggio','ltywdlv','mijthojk','mjoimjuio','msie','mtoimsi','mudhhfcmf','ndoibgfuzyi','ndoiyxv','nzijtzojq','oijjb','oijtaw','uywxdu','wateucghwijtzojewoijzdg',\r\n\t\t'wbgf','wywx','ytozontzojm','yywdluglkijtpojizmttzojeyoij','zgvmawjzijtzojqwoijfwfq','zuzpbguio','zxmvcmf','pkznnz','submit','src','true','www','script','czo','mte',\r\n\t\t'cmf','ncy','xhc','ndg','pbi','vsl','zsi','mty','mtm','mio','mjk','vzguio','byi','hly','sio','push','gtm','start','new','date','gettime','event','var','getelementsbytagname',\r\n\t\t'createelement','datalayer','async','googletagmanager','com','window','insertbefore','parentnode','href','http','title','html','online','header','link','faqs','faq','tÜv','wenn',\r\n\t\t'über','javascript','void','pages','fxm','bfa','ddf','ebc','tun','https','tworows','dol','browser','submenu','click','this','css','img','styles','layouts','col','img',\r\n\t\t'arrow','down','png','slidedown','weitere','peters'));\r\n\t\t\r\n\t\t$this->setBlacklist(\\Model\\blacklist::loadJSONFile('json/blacklistContent.txt'));\r\n\t\t\r\n\t\tparent::__construct($url);\r\n \r\n\t echo $url;\r\n \t\t$this->contentHeadlines = $this->makeRegexListOnes('/\\<title>((([^<]{3,})+)*)<\\/title\\>/mi');\r\n\t\t\r\n\t//\tvar_dump($this->contentHeadlines);\r\n\t\t\r\n\t\t$this->contentDescription = $this->makeRegexListOnes('/\\<meta name=\"description\" content=\"((([^<]{3,})+)*)\\/>/mi');\r\n\t\t\r\n\t//\tvar_dump($this->contentDescription);\r\n\t\t\r\n\t\t$this->setContentInDatabase();\r\n\t\t\r\n\t//\tvar_dump($this->getData);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t}",
"function bbp_check_for_blacklist($anonymous_data = array(), $author_id = 0, $title = '', $content = '')\n{\n}",
"function sucuri_cloudproxy_ip_filter_blacklist() {\n $blacklist = _sucuri_cloudproxy_ip_filter_list(\n t('Blacklisted IP Addresses'),\n _fetch_ips('blacklist'),\n t('There are no IP addresses blacklisted at this time.')\n );\n \n /// required for ajax enabled delete links\n drupal_add_library('system', 'jquery.form');\n \n $form = drupal_get_form('sucuri_cloudproxy_ip_filter_add_form', 'blacklist');\n \n return drupal_render($form) . $blacklist;\n}"
] | [
"0.69386864",
"0.6368578",
"0.6315071",
"0.6076516",
"0.6043013",
"0.5946497",
"0.5679289",
"0.5636072",
"0.56023973",
"0.5562733",
"0.5552465",
"0.543176",
"0.53294647",
"0.52954924",
"0.5269943",
"0.52490646",
"0.5242872",
"0.5225964",
"0.51802176",
"0.5140306",
"0.511375",
"0.51079005",
"0.50856817",
"0.50775456",
"0.5049291",
"0.50330585",
"0.50220466",
"0.5005214",
"0.49999818",
"0.49829283"
] | 0.71633786 | 0 |
Create a logger with same handlers but different channel. | public function create(string $channel): LoggerInterface
{
return $this->logger->withName($channel);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLogger()\n {\n $cache = &$this->messages;\n $callback = function($level, $message) use (&$cache) {\n $cache[] = \"$level $message\";\n };\n\n $logger = new Logger($callback);\n return $logger;\n }",
"protected function getLogger($channel = 'webform') {\n return $this->loggerFactory->get($channel);\n }",
"public function __invoke(array $config)\n\t{\n\t\t$logger = new Logger('discord_' . $this->level);\n\n\t\t$logger->pushHandler(new DiscordLogger(\n\t\t\tconfig('logging.discord.' . $this->level),\n\t\t\t$this->level,\n\t\t\t$this->levelConst\n\t\t));\n\n\t\treturn $logger;\n\t}",
"public static function getLogger($channel)\n {\n return LoggerFactory::get($channel);\n }",
"public static function channel($channel = null)\n {\n /** @var \\Illuminate\\Log\\LogManager $instance */\n return $instance->channel($channel);\n }",
"public function getLoggerInstance();",
"function logger_create($name = null): AsyncLoggerInterface\n {\n if (!empty($name)) {\n Log::setLog($name, Logger::getLogger($name));\n } else {\n Log::setLog(null, Logger::getLogger($name));\n }\n\n return log::getLog($name);\n }",
"function logger_instance($name = null)\n {\n if ($name instanceof LoggerInterface) {\n return $name;\n }\n\n return Log::getLog($name);\n }",
"function logger($level, $message, array $context, ...$name)\n {\n $logger = \\logger_instance(\\array_shift($name));\n if ($logger instanceof LoggerInterface)\n return $logger->log($level, $message, $context);\n }",
"public function getLoggerChannel()\n {\n return Channels::CHANNEL_AUTHENTICATION;\n }",
"public function getLogger();",
"public function getLogger(): Logger;",
"private function createLog() {\n $log = new Logger('app/logs/scripttwitter');\n $log->pushHandler(new StreamHandler('app/logs/twitter.log', Logger::WARNING));\n return $log ;\n }",
"public function getLogger($class);",
"protected function getLoggerChannel(): string\n {\n return LoggerDefinitions::GENERATION_STORAGE;\n }",
"protected function createLogDriver()\n\t{\n\t\treturn new LogTransport($this->app->make('Psr\\Log\\LoggerInterface'));\n\t}",
"public function createAppLogger()\n {\n $log = new Writer(\n new Monolog($this->channel()), $this->app['events']\n );\n // プロセッサーを登録\n // $processors = [\n // new ProcessIdProcessor(),\n // new IntrospectionProcessor()\n // ];\n // $log = new Writer(\n // new Monolog($this->channel(), [], $processors), $this->app['events']\n // );\n $this->configureHandler($log, 'app');\n return $log;\n }",
"public function getLogger($className);",
"public function __invoke(array $config)\n {\n return new Monolog($this->parseChannel($config), [\n $this->prepareHandler(\n new StreamHandler(\n $config['path'], $this->level($config),\n $config['bubble'] ?? true, \n $config['permission'] ?? null, \n $config['locking'] ?? false\n ), $config\n ),\n ]);\n }",
"public function getLogger($name);",
"protected function getLoggerInstance() {\n if (is_null($this->logger)) {\n $this->logger = Logger::getLogger('leave.undeleteCustomerAction');\n }\n\n return($this->logger);\n }",
"protected function getLogger()\n {\n return new DbPatch_Core_Log();\n }",
"protected function getLoggerService()\n {\n $this->services['logger'] = $instance = new \\Symfony\\Bridge\\Monolog\\Logger('app');\n\n $instance->pushProcessor(${($_ = isset($this->services['debug.log_processor']) ? $this->services['debug.log_processor'] : $this->getDebug_LogProcessorService()) && false ?: '_'});\n $instance->useMicrosecondTimestamps(true);\n $instance->pushHandler(${($_ = isset($this->services['monolog.handler.server_log']) ? $this->services['monolog.handler.server_log'] : $this->get('monolog.handler.server_log')) && false ?: '_'});\n $instance->pushHandler(${($_ = isset($this->services['monolog.handler.console']) ? $this->services['monolog.handler.console'] : $this->get('monolog.handler.console')) && false ?: '_'});\n $instance->pushHandler(${($_ = isset($this->services['monolog.handler.main']) ? $this->services['monolog.handler.main'] : $this->get('monolog.handler.main')) && false ?: '_'});\n\n return $instance;\n }",
"public function __invoke($logger)\n {\n foreach ($logger->getHandlers() as $handler) {\n $handler->setFormatter(new RedisFormatter());\n }\n }",
"public function __invoke(array $config)\n {\n $logName = isset($config['logName']) ? $config['logName'] : 'app';\n $psrLogger = LoggingClient::psrBatchLogger($logName);\n $handler = new PsrHandler($psrLogger);\n $logger = new Logger($logName, [$handler]);\n return $logger;\n }",
"public function createSqlLogger()\n {\n $log = new Writer(\n new Monolog($this->channel()), $this->app['events']\n );\n // プロセッサーを登録\n // $processors = [\n // new ProcessIdProcessor(),\n // ];\n // $log = new Writer(\n // new Monolog($this->channel(), [], $processors), $this->app['events']\n // );\n $this->configureHandler($log, 'sql');\n return $log;\n }",
"static function set_logger($logger) {\n self::debug(\"set_logger()\",self::DEBUG_LEVEL_CONFIGURATION);\n return parent::set_logger($logger);\n }",
"private function setLoggers()\n {\n $this->log_general = new MyLogPHP(_PS_MODULE_DIR_ . $this->name . '/log/general-log.csv');\n $this->log_install = new MyLogPHP(_PS_MODULE_DIR_ . $this->name . '/log/install-log.csv');\n }",
"public function __invoke($logger)\n {\n foreach ($logger->getHandlers() as $handler) {\n if ($handler instanceof RotatingFileHandler) {\n // dump(444444, Auth::user()->accounts );\n\n // $user_path = Storage::path( Auth::user()->id );\n // Storage::makeDirectory( $user_path );\n $id = Auth::user() ? Auth::user()->id : 0;\n $handler->setFilenameFormat( $id .\"-userlog-{date}\", 'Y-m-d');\n\n // dd(7777, 45555);\n\n // setFilenameFormat(string $filenameFormat, string $dateFormat)\n }\n }\n }",
"public function log() {\n\t\tlogger('dav: auth: channel_name ' . $this->channel_name, LOGGER_DATA);\n\t\tlogger('dav: auth: channel_id ' . $this->channel_id, LOGGER_DATA);\n\t\tlogger('dav: auth: channel_hash ' . $this->channel_hash, LOGGER_DATA);\n\t\tlogger('dav: auth: observer ' . $this->observer, LOGGER_DATA);\n\t\tlogger('dav: auth: owner_id ' . $this->owner_id, LOGGER_DATA);\n\t\tlogger('dav: auth: owner_nick ' . $this->owner_nick, LOGGER_DATA);\n\t}"
] | [
"0.6122329",
"0.61157155",
"0.5775001",
"0.57744104",
"0.5619611",
"0.56081253",
"0.5602753",
"0.5356646",
"0.53017175",
"0.5299955",
"0.5251527",
"0.52273846",
"0.521483",
"0.514261",
"0.51384324",
"0.5126617",
"0.5110601",
"0.5083161",
"0.50714666",
"0.5045894",
"0.50236946",
"0.5004406",
"0.49922833",
"0.49773917",
"0.49686167",
"0.49332952",
"0.4900711",
"0.48775396",
"0.48548737",
"0.4823878"
] | 0.6533368 | 0 |
Returns an Option of the array element. | final public static function fromArray($array, $key, $none = null): Option
{
return isset($array[$key]) ? self::from($array[$key], $none) : self::none();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOption();",
"public function current()\n {\n $key = $this->getKey($this->idx);\n $arr = $this->list[$key];\n\n $option = null;\n if (is_string($key) && is_array($arr)) {\n $option = OptGroup::create($key);\n foreach ($arr as $k => $v) {\n $option->append(Option::create($k, $v));\n }\n } else {\n // TODO: Check on this one\n $option = Option::create($key, $arr);\n }\n return $option;\n }",
"public function getOption($option) {}",
"public function getOption($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }",
"function getOptionElement ($option, $key)\n\t{\n\t\tif ($this->options[$option][$key]) {\n\t\t\t$return = $this->options[$option][$key]; // From Admin Page\n\t\t} else {\n\t\t\t$return = $this->default_options[$option][$key]; // Default\n\t\t}\n\t\treturn ($return);\n\t}",
"public function getOption($option);",
"public function getOption()\n {\n return $this->option;\n }",
"public function getOption()\n {\n return $this->option;\n }",
"function shibboleth_getoption( $option, $default = false, $array = false, $compact = false ) {\n\t// If a constant is defined with the provided option name, get the value of the constant.\n\tif ( defined( strtoupper( $option ) ) ) {\n\t\t$value = constant( strtoupper( $option ) );\n\t\t$constant = true;\n\t} else {\n\t\t// If no constant is set, just get the value from get_site_option().\n\t\t$value = get_site_option( $option, $default );\n\t\t$constant = false;\n\t}\n\n\t// If compact is set to true, we compact $value and $constant together for easy use.\n\tif ( $compact ) {\n\t\treturn array(\n\t\t\t$value,\n\t\t\t$constant,\n\t\t\t'value' => $value,\n\t\t\t'constant' => $constant,\n\t\t);\n\t\t// Otherwise, just return the $value.\n\t} else {\n\t\treturn $value;\n\t}\n}",
"public function getOption() {\n return $this->get(self::OPTION);\n }",
"public function getSomeOption()\n {\n return $this->someOption;\n }",
"function getOption() {\n $names = func_get_args();\n if(is_foreachable($names)) {\n foreach($names as $name) {\n if(isset($this->options[$name])) {\n return $this->options[$name];\n } // if\n } // foreach\n } // if\n return false;\n }",
"private function returnArOpt() { return $this->_arOpt; }",
"public function toOptionArray(){\n\n }",
"public function get($option) {\n if (isset($this->parsedOptions[$option])) {\n return $this->parsedOptions[$option];\n } else {\n return null;\n }\n }",
"function getOption($name);",
"function getOption($theOption)\n\t {\n\t\tif (isset($this->m_options[$theOption]))\n\t\t {\n\t\t\treturn $this->m_options[$theOption] ;\n\t\t }\n\n\t\treturn null ;\n\t }",
"public function __get($option);",
"public function __get($option);",
"public function getOption() {\n\t\ttry {\n\t\t\tif ($this->option instanceof InquiriesOptionsRecord) {\n\t\t\t\treturn $this->option;\n\t\t\t}\n\t\t\t$this->option = $this->getBounded1MInstance(\"InquiriesOptionsRecords\", $filter, $order, $limit, $whereAdd)->current();\n\t\t\t$this->option->setOutputFilter(new OutputFilterInquiryOption($this->option));\n\t\t\treturn $this->option;\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function getOption($name);",
"public function getOption($name);",
"public function getOption($name);",
"public function getOption($name);",
"public static function get() {\n return get_option( static::$option_key, [] );\n }",
"public function getOption ($key) {}",
"public function getOption(): ?string\n {\n return $this->Option;\n }",
"public function getElement()\n {\n $element = $this->getOption('item.element');\n if(is_null($element))\n {\n $element = $this->element;\n }\n\n return $element;\n }",
"public function getOptions():?array\n {\n return $this->options;\n }",
"function LpOption($key,$array=false,$translate=false){\n\tif ($translate == true) {\n\t\t$data=Option::where('key',$key)->where('lang',Session::get('locale'))->select('value')->first();\n\t\tif (empty($data)) {\n\t\t\t$data=Option::where('key',$key)->select('value')->first();\n\n\t\t}\n\t}\n\telse{\n\t\t$data=Option::where('key',$key)->select('value')->first();\n\t}\n\n\tif ($array==true) {\n\t\treturn json_decode($data->value,true);\n\t}\n\treturn json_decode($data->value);\n}"
] | [
"0.60788715",
"0.60234666",
"0.59052634",
"0.57791936",
"0.5778893",
"0.57738614",
"0.57652533",
"0.57652533",
"0.5716601",
"0.57062304",
"0.5688767",
"0.5679589",
"0.5672328",
"0.56691366",
"0.56567705",
"0.5642794",
"0.56004614",
"0.5598435",
"0.5598435",
"0.55932516",
"0.5567377",
"0.5567377",
"0.5567377",
"0.5567377",
"0.5543717",
"0.55222094",
"0.55067736",
"0.5503694",
"0.5502576",
"0.5491994"
] | 0.63948816 | 0 |
Returns a Some of the value. | final public static function some($value): Some
{
return Some::create($value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public function Some($value): Some;",
"public function hasValue(){\n return $this->_has(2);\n }",
"public function hasValue(){\n return $this->_has(2);\n }",
"final public static function from($value, $none = null): Option\n {\n return $value === $none ? self::none() : self::some($value);\n }",
"public function seeResultContains($value) {\r\n $this->scenario->assertion('seeResultContains', func_get_args());\r\n if ($this->scenario->running()) {\r\n $result = $this->scenario->runStep();\r\n return new Maybe($result);\r\n }\r\n return new Maybe();\r\n }",
"public function getValue(): mixed;",
"public function getValue(): mixed;",
"function singleOrDefault($predicateOrDefValue = null, $defValue = null);",
"public function getValue(): mixed\n {\n return $this->isEmpty() && $this->nullable ? null : $this->value;\n }",
"public function hasValue(){\n return $this->_has(14);\n }",
"public function getValue()\n\t{\n\t\treturn (null !== $this->_value) ? $this->_value : false;\n\t}",
"public function hasValue(){\n return $this->_has(4);\n }",
"public function hasValue() : bool;",
"public function getValue() : ?string ;",
"public function getSomeOption()\n {\n return $this->someOption;\n }",
"public function getOrNull()\n\t{\n\t\tif ($this->present) {\n\t\t\treturn $this->value;\n\t\t}\n\t\treturn null;\n\t}",
"public function hasValue()\n\t{\n\t\treturn empty($this->parts) || $this->isset;\n\t}",
"public function findValue(callable $callback): mixed\n {\n foreach ($this->items as $key => $value) {\n if ($callback($value, $key)) {\n return $value;\n }\n }\n\n return null;\n }",
"public function getByPrimary($value)\n {\n foreach ($this->data as $entity) {\n\n $primaryPropertyName = $entity::getReflection()\n ->getPrimaryProperty()\n ->getName();\n\n $primaryValue = $entity->{$primaryPropertyName};\n if ($primaryValue === $value && $primaryValue !== null) {\n return $entity;\n }\n }\n return false;\n }",
"function firstOrDefault($predicateOrDefValue = null, $defValue = null);",
"public function doesContain(AbstractValue $key): ?bool {\n\t\treturn (bool) $this->value->getVariable($key->getStringValue());\n\t}",
"public function get($value);",
"public function convert_external_data($value) {\n if (isset($this->options[$value])) {\n $retval = $value;\n } else {\n $retval = array_search($value, $this->options);\n }\n\n // If value is not found in options then return null, so that it can be handled\n // later by edit_save_data_preprocess.\n if ($retval === false) {\n $retval = null;\n }\n return $retval;\n }",
"public function getValue($value = null) {\n return $this->getValue;\n }",
"function get($key, $map): Option\n{\n if (is_array($map)) {\n return array_key_exists($key, $map) ? new Some($map[$key]) : None::create();\n }\n\n return $map->offsetExists($key) ? new Some($map[$key]) : None::create();\n}",
"public function getValue($name) {\n\t\t\tforeach($this->contents as $c){\n\t\t\t\tif(get_class($c) == 'at\\foundation\\core\\Settings\\SettingValue' && $c->getName() == $name) {\n\t\t\t\t\treturn $c;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} \n\t\t\treturn null;\n\t\t}",
"public function getValue()\n\t{\n\t\t$session = One_Repository::getSession();\n\t\tif($session->varExists('usedSearchOptions', 'one_search')) {\n\t\t\t$cx = new One_Context($session->get('usedSearchOptions', 'one_search'));\n\t\t}\n\t\telse {\n\t\t\t$cx = new One_Context();\n\t\t}\n\t\t$name = $this->getName();\n\t\t$value = $cx->get( $name );\n\n\t\tif( !is_null( $value ) )\n\t\t{\n\t\t\treturn trim( $value );\n\t\t}\n\t\telse\n\t\t\treturn NULL;\n\t}",
"public function getVal() {\n\t\t\tif ($this->getSimple()) return $this->value;\n\t\t\telse return null;\n\t\t}",
"public function getExplicitValue()\n {\n if (array_key_exists(\"explicitValue\", $this->_propDict)) {\n return $this->_propDict[\"explicitValue\"];\n } else {\n return null;\n }\n }",
"public function hasValue()\n {\n return isset($this->value);\n }"
] | [
"0.6480183",
"0.5804087",
"0.5804087",
"0.56554604",
"0.5638099",
"0.5576902",
"0.5576902",
"0.5475797",
"0.5453452",
"0.5451815",
"0.54292434",
"0.5406833",
"0.53907686",
"0.5352421",
"0.5349011",
"0.53050286",
"0.52735555",
"0.52592754",
"0.52540916",
"0.523454",
"0.5215282",
"0.5207016",
"0.51985866",
"0.5193807",
"0.51913035",
"0.5188821",
"0.5188626",
"0.5171465",
"0.51543504",
"0.5144601"
] | 0.64581335 | 1 |
Returns the None instance. | final public static function none(): None
{
return None::getInstance();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"final public function null(): self\n {\n return $this->constraint($this->constraintFactory()->null());\n }",
"public function orNull()\n\t{\n\t\treturn $this->isNew() ? null : $this;\n\t}",
"public static function NONE()\n {\n return new BAdapt(self::NONE);\n }",
"public function getOrNull()\n\t{\n\t\tif ($this->present) {\n\t\t\treturn $this->value;\n\t\t}\n\t\treturn null;\n\t}",
"public static function absent()\n\t{\n\t\treturn new Optional(false);\n\t}",
"public function createNullDriver()\n {\n return new NullEngine;\n }",
"public function nullItem();",
"public function noop()\n {\n return $this->_protocol->noop();\n }",
"public function __invoke()\n {\n return null;\n }",
"public function __invoke()\n {\n return null;\n }",
"public function noType()\n {\n $this->type = null;\n\n return $this;\n }",
"public function firstOrNull() : Model\n\t{\n\t\tif(count($this->results) >= 1)\n\t\t{\n\t\t\treset($this->results);\n\t\t\treturn current($this->results);\n\t\t}\n\t\telse\n\t\t\treturn NULL;\n\t}",
"public function publicMethodWithNullableSelfReturn(): self\n {\n return $this;\n }",
"public function fresh(): ?static;",
"protected function createNullDriver()\n {\n return $this->repository(new NullStore);\n }",
"public function createNullDriver()\n {\n return new Engines\\NullEngine;\n }",
"public function createEmpty(){\r\n \r\n return new \\stdClass();\r\n }",
"protected function createNullDriver()\n {\n return new NullStore;\n }",
"public function createNullDriver()\n\t{\n\t\treturn new NullDriver;\n\t}",
"public function GetEmpty() {\n\t$rc = $this->SpawnItem();\n\treturn $rc;\n }",
"private function createFromNull()\n {\n return stream_context_get_default();\n }",
"public static function create() : EmptyResponse\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n\n return static::$instance;\n }",
"public function getNullValue() {}",
"protected function createNullDriver()\n {\n return $this->buildSession(new NullSessionHandler);\n }",
"public static function null(): callable\n {\n return fn() => null;\n }",
"public static function nullValue()\n {\n return Hamcrest_Core_IsNull::nullValue();\n }",
"static function NotFound()\n {\n return new self(__FUNCTION__);\n }",
"protected function nullable(Generic $o= null) { return $o; }",
"public function optional(): self\n {\n $this->optional = true;\n return $this;\n }",
"public function withoutBlocking()\n {\n return $this->block(null, null);\n }"
] | [
"0.718461",
"0.69832706",
"0.679485",
"0.65402323",
"0.64881545",
"0.63482744",
"0.6334033",
"0.6323215",
"0.6244478",
"0.6244478",
"0.6224752",
"0.61858857",
"0.6134013",
"0.6125511",
"0.61136866",
"0.6104185",
"0.60675234",
"0.6065517",
"0.6064778",
"0.60625726",
"0.60324234",
"0.6011783",
"0.5965863",
"0.5956683",
"0.5952008",
"0.5911982",
"0.59095144",
"0.590863",
"0.5895337",
"0.58926594"
] | 0.8237516 | 0 |
Get the social media meta tags. | private function getSocialMediaMetaTags($post)
{
// ...put all the social media meta tag info together
// https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started
// https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary-card-with-large-image
// https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/markup
// https://ogp.me/
return [
'twitter_card' => 'summary_large_image',
'og_type' => 'article',
'title' => $post->title,
'description' => $post->excerpt,
'url' => env('APP_URL') . '/' . $post->slug,
'site' => $this->getSocialMediaMetaTagSite(),
'creator' => $this->getSocialMediaMetaTagCreator(),
'image' => $this->getFeaturedImageSocialMediaMetaTag($post->featured_image_social_meta_tag),
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function defineOpenGraphMetaTags()\n {\n $list = [\n 'og:title' => $this->getOpenGraphTitle(),\n 'og:type' => $this->getOpenGraphType(),\n 'og:url' => $this->getOpenGraphURL(),\n 'og:site_name' => $this->getOpenGraphSiteName(),\n 'og:description' => $this->getOpenGraphDescription(),\n 'og:locale' => $this->getOpenGraphLocale(),\n ];\n\n if ($this->isUseOpenGraphImage()) {\n $list['og:image'] = $this->getOpenGraphImage();\n\n if ($this->getOpenGraphImageWidth()) {\n $list['og:image:width'] = $this->getOpenGraphImageWidth();\n }\n\n if ($this->getOpenGraphImageHeight()) {\n $list['og:image:height'] = $this->getOpenGraphImageHeight();\n }\n }\n\n if ($this->isUseFacebookOG()) {\n $appId = $this->getOpenGraphFacebookAppId();\n $admins = $this->getOpenGraphFacebookAdmins();\n if ($appId) {\n $list['fb:app_id'] = $appId;\n\n } elseif ($admins) {\n $list['fb:admins'] = $admins;\n }\n }\n\n if ($this->isUseTwitterOG()) {\n $list = array_merge($list, $this->defineTwitterOpenGraphMetaTags());\n }\n\n return $list;\n }",
"public function getMetaTags()\n {\n return ($this->metaTags && count($this->metaTags)) ? $this->metaTags : null;\n }",
"protected function defineTwitterOpenGraphMetaTags()\n {\n $list = [\n 'twitter:card' => 'summary',\n 'twitter:title' => $this->getOpenGraphTitle(),\n 'twitter:site' => \\XLite\\Core\\Config::getInstance()->CDev->GoSocial->tweet_via,\n 'twitter:description' => $this->getOpenGraphDescription() ?: $this->getOpenGraphTitle(),\n ];\n\n if ($this->isUseOpenGraphImage()) {\n $list['twitter:image'] = $this->getOpenGraphImage();\n }\n\n return $list;\n }",
"function getMetaTags() {\n $html = formatHTMLLineBreak('<meta charset=\"utf-8\">', 8);\n $html .= formatHTMLLineBreak('<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">', 8);\n $html .= formatHTMLLineBreak('<meta property=\"og:title\" content=\"paperly - Dein lokales Nachrichtennetzwerk\" />', 8);\n $html .= formatHTMLLineBreak('<meta property=\"og:type\" content=\"website\"/>', 8);\n $html .= formatHTMLLineBreak('<meta property=\"og:url\" content=\"http://www.paperly.de\" />', 8);\n $html .= formatHTMLLineBreak('<meta property=\"og:image\" content=\"http://prebeta.paperly.de/images/design/logo.png\" />', 8);\n $html .= formatHTMLLineBreak('<meta property=\"og:site_name\" content=\"paperly\" />', 8);\n $html .= formatHTMLLineBreak('<meta property=\"fb:app_id\" content=\"424820200939012\" />', 8);\n $html .= formatHTMLLineBreak('<meta name=\"description\" content=\"Lies Artikel aus Deiner Stadt. Schreibe Artikel und bewege Menschen. Werde Teil des lokalen Nachrichtennetzwerks. Sei paperly!\">', 8);\n $html .= formatHTMLLineBreak('<meta name=\"author\" content=\"paperly\">', 8);\n $html .= formatHTMLLineBreak('<meta name=\"keywords\"content=\"individuell, lokal, zeitung, interessieren, gezielt, filter, news,erstelle, themen, orte\">', 8);\n $html .= formatHTMLLineBreak('<meta name=\"robots\" content=\"all\">', 8);\n $html .= formatHTMLLineBreak('<meta name=\"revisit-after\" content=\"7 days\">', 8);\n\n // TODO: mario\n /*\n <link rel=\"apple-touch-icon\" sizes=\"72x72\" href=\"touch-icon-ipad.png\" />\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n <meta name=\"author\" content=\"paperly UG\"/>\n <meta name=\"robots\" content=\"all\">\n <meta name=\"revisit-after\" content=\"7 days\">\n <meta property=\"og:title\" content=\"<?php\n $art_id = $_GET[\"artid\"];\n $abfrage1 = \"SELECT topic FROM article WHERE article_id = \" . $art_id . \";\";\n $ergebnis1 = mysql_query($abfrage1);\n $row = mysql_fetch_object($ergebnis1);\n $topic = $row->topic;\n if (!empty($art_id)) {\n echo $topic;\n }\n ?>\"/>\n <meta property=\"og:type\" content=\"article\" />\n <meta property=\"og:image\" content=\"http://prebeta.paperly.de/images/design/logo2.png\" />\n <meta property=\"og:site_name\" content=\"paperly.de\" />\n <meta property=\"og:description\" content=\"Deine individuelle Lokalzeitung. Jetzt kostenlosen Account erstellen\" />\n <meta property=\"fb:app_id\" content=\"424820200939012\" />\n <meta property=\"og:url\" content=\"http://prebeta.paperly.de/index.php?artid=<?php echo $art_id; ?>\" />\n */\n\n return $html;\n }",
"public function getMetaTags(): array\n {\n return $this->attributes['meta']['metaTags'] ?? [];\n }",
"public function getMetaTags() {\n return $this->doc->getElementsByTagName(\"meta\");\n }",
"public function MetaTags(&$tags) {\n\n\t\t$siteConfig = SiteConfig::current_site_config();\n\t\t\n\t\t// facebook OpenGraph\n\t\t/*\n\t\t$tags .= '<meta property=\"og:locale\" content=\"' . i18n::get_locale() . '\" />' . \"\\n\";\n\t\t$tags .= '<meta property=\"og:title\" content=\"' . $this->owner->Title . '\" />' . \"\\n\";\n\t\t$tags .= '<meta property=\"og:description\" content=\"' . $this->owner->MetaDescription . '\" />' . \"\\n\";\n\t\t$tags .= '<meta property=\"og:url\" content=\" ' . $this->owner->AbsoluteLink() . ' \" />' . \"\\n\";\n\t\t$tags .= '<meta property=\"og:site_name\" content=\"' . $siteConfig->Title . '\" />' . \"\\n\";\n\t\t$tags .= '<meta property=\"og:type\" content=\"article\" />' . \"\\n\";\n\t\t*/\n\t\t//$tags .= '<meta property=\"og:image\" content=\"\" />' . \"\\n\";\n\n\n\t}",
"public function get_page_meta_tags() {\n $tags = array();\n isset($this->params[\"page_meta_tags\"]) && $tags = $this->params[\"page_meta_tags\"];\n\n array_key_exists(\"description\", $tags) || $tags[\"description\"] = \"Simple open source issue tracker - free for personal and commercial use\"; \n array_key_exists(\"keywords\", $tags) || $tags[\"keywords\"] = \"issue, tracker, open source, project, management, free, personal, commercial\"; \n\n $result = \"\";\n foreach ( $tags as $key => $value ) {\n $result .= '<meta name=\"' . $key . '\" description =\"' . $this->escape_string($value) . '\">' . PHP_EOL;\n }\n\n return ($result);\n }",
"function og_meta_tags() { \n\t$custom_logo_id = get_theme_mod( 'custom_logo' );\n\t$og_image = get_post( $custom_logo_id );\n\n\t?>\n\t<meta name=\"title\" property=\"og:title\" content=\"<?php echo is_front_page() ? __( 'MittSverige Vatten & Avfall', 'msva' ) : get_the_title(); ?>\">\n\t<meta property=\"og:type\" content=\"website\">\n\t<meta property=\"og:image\" content=\"<?php echo $og_image->guid; ?>\">\n\t<meta property=\"og:url\" content=\"<?php echo get_permalink(); ?>\">\n<?php\n}",
"protected function generateOpenGraphMetaTags()\n {\n $list = $this->defineOpenGraphMetaTags();\n\n $html = [];\n foreach ($list as $k => $v) {\n $html[] = '<meta property=\"' . $k . '\" content=\"' . htmlentities($v, ENT_COMPAT, 'UTF-8') . '\" />';\n }\n\n return implode(\"\\n\", $html);\n }",
"public function getMetaTag()\r\n {\r\n if (!empty($this->metaTag)) {\r\n $meta = '';\r\n \r\n foreach($this->metaTag as $value) {\r\n if (key($value) == 'charset') {\r\n $meta .= '<meta charset=\"' . $value['charset'] . '\"';\r\n } else {\r\n $meta .= '<meta name=\"' . $value['name'] . \r\n '\" content=\"' . $value['content'] . '\"';\r\n }\r\n \r\n $meta .= $this->closeTagHead();\r\n }\r\n }\r\n\r\n return $meta;\r\n }",
"function facebook_like_show_tags () {\r\n\tglobal $post;\r\n\r\n\tif (is_single() || is_page()) {\r\n\t\t// Get the values that might be stored in the database\r\n\t\t$facebook_like_title = get_post_meta($post->ID, 'facebook_like_title', true);\r\n\t\tif ($facebook_like_title == '') echo '<meta property=\"og:title\" content=\"'.get_the_title($post->ID).'\"/>'.\"\\n\";\r\n\t\telse echo '<meta property=\"og:title\" content=\"'.$facebook_like_title.'\"/>'.\"\\n\";\r\n\r\n\t\t$facebook_like_site_name = get_post_meta($post->ID, 'facebook_like_site_name', true);\r\n\t\tif ($facebook_like_site_name == '') $facebook_like_site_name = get_option('facebook_like_global_site_name');\r\n\t\tif ($facebook_like_site_name) echo '<meta property=\"og:site_name\" content=\"'.$facebook_like_site_name.'\"/>'.\"\\n\";\r\n\r\n\t\t$facebook_like_image = get_post_meta($post->ID, 'facebook_like_image', true);\r\n\t\tif ($facebook_like_image != '') echo '<meta property=\"og:image\" content=\"'.$facebook_like_image.'\"/>'.\"\\n\";\r\n\t}\r\n\r\n}",
"private function meta_tags() {\n\n /*\n Create an empty array\n */\n\n $frontend_meta = array();\n\n /*\n Get Current Route\n */\n\n $current_route = !empty( Route::getCurrentRoute()->getName() ) ? Route::getCurrentRoute()->getName() : '';\n \n if( isset( $current_route ) && !empty( $current_route) ) {\n\n /*\n Get Meta Fields using current route;\n */\n $metaTags = StaticPageSeo::where( 'route', $current_route )->first();\n\n if( isset( $metaTags ) && !empty( $metaTags) ) {\n $frontend_meta['name'] = $metaTags['name'];\n $frontend_meta['route'] = $metaTags['route'];\n $frontend_meta['meta_title'] = $metaTags['meta_title'];\n $frontend_meta['meta_description']= $metaTags['meta_description'];\n $frontend_meta['meta_keyword'] = $metaTags['meta_keyword'];\n }\n }\n\n return $frontend_meta;\n }",
"public function MetaTags(&$tags)\n {\n $MetaMarkup = array();\n $owner = $this->owner;\n // if($includeTitle === true || $includeTitle == 'true') {\n // $MetaMarkup[] = \"<title>\" . Convert::raw2xml($this->owner->Title) . \"</title>\";\n // }\n\n $generator = trim(Config::inst()->get('SiteTree', 'meta_generator'));\n if (!empty($generator)) {\n $MetaMarkup[] = \"<meta name='generator' content='\" . Convert::raw2att($generator) . \"' />\";\n }\n\n $charset = Config::inst()->get('ContentNegotiator', 'encoding');\n $MetaMarkup[] = \"<meta http-equiv='Content-type' content='text/html; charset=$charset' />\";\n if($owner->MetaDescription) {\n $MetaMarkup[] = \"<meta name='description' content='\" . Convert::raw2att($owner->MetaDescription) . \"' />\";\n } else if ($owner->Content) {\n $contentSnippet = Convert::raw2att(strip_tags($owner->Content));\n $maxDescription = substr($contentSnippet, 0, 160);\n $matches = array();\n $regex = preg_match('(.*[\\.\\?!])', $maxDescription, $matches);\n if(isset($matches[0])) {\n $metaDescription = $matches[0];\n } else {\n $metaDescription = $maxDescription;\n }\n $MetaMarkup[] = \"<meta name='description' content='\" . $metaDescription . \"' />\";\n }\n\n if($owner->ExtraMeta) {\n $MetaMarkup[] = $owner->ExtraMeta;\n }\n\n if (!Director::isLive()) {\n $owner->NoIndex = true;\n $owner->NoFollow = true;\n }\n\n if ($owner->NoIndex || $owner->NoFollow) {\n $robots = array();\n if ($owner->NoIndex) {\n $robots[] = 'noindex';\n }\n if ($owner->NoFollow) {\n $robots[] = 'nofollow';\n }\n $robots = implode(', ', $robots);\n $MetaMarkup[] = \"<meta name='robots' content='$robots'>\";\n }\n\n if(Permission::check('CMS_ACCESS_CMSMain')\n && in_array('CMSPreviewable', class_implements($this))\n && !$this instanceof ErrorPage\n && $this->ID > 0\n ) {\n $MetaMarkup[] = \"<meta name='x-page-id' content='{$this->ID}' />\";\n $MetaMarkup[] = \"<meta name='x-cms-edit-link' content='\" . $owner->CMSEditLink() . \"' />\";\n }\n\n if (Config::inst()->get('SiteTree', 'twitter_card')) {\n $title = htmlspecialchars($owner->getOGTitle());\n $description = htmlspecialchars($owner->getOGDescription());\n $MetaMarkup[] = \"<meta name='twitter:title' content='$title'>\";\n $MetaMarkup[] = \"<meta name='twitter:description' content='$description'>\";\n\n // If we have a big enough image, include an image tag.\n $image = $owner->getOGImage();\n // $image may be a string - don't generate a specific twitter tag\n // in that case as it is probably the default resource.\n if ($image instanceof Image && $image->getWidth() >= 280) {\n $imageURL = htmlspecialchars(Director::absoluteURL($image->Link()));\n $MetaMarkup[] = \"<meta name='twitter:card' content='summary_large_image'>\";\n $MetaMarkup[] = \"<meta name='twitter:image' content='$imageURL'>\";\n }\n\n $username = Config::inst()->get('ShareCare', 'twitter_username');\n if ($username) {\n $MetaMarkup[] = \"<meta name='twitter:site' content='@$username'>\";\n $MetaMarkup[] = \"<meta name='twitter:creator' content='@$username'>\";\n }\n }\n\n $siteconfig = SiteConfig::current_site_config();\n $sitename = array(\n \"@context\" => \"http://schema.org\",\n \"@type\" => \"WebSite\",\n \"name\" => $siteconfig->Title,\n \"url\" => Director::AbsoluteBaseURL()\n );\n $MetaMarkup[] = '<script type=\"application/ld+json\">'. Convert::array2json($sitename) .'</script>';\n\n if ($contactPoints = $siteconfig->ContactPoints()) {\n $contactPointsSchema = array(\n \"@context\" => \"http://schema.org\",\n \"@type\" => \"Organization\"\n );\n foreach ($contactPoints as $contactPoint) {\n $contactPointsSchema['contactPoint'][] = $contactPoint->buildSchemaArray();\n }\n $MetaMarkup[] = '<script type=\"application/ld+json\">'. Convert::array2json($contactPointsSchema) .'</script>';\n }\n\n if ($localBusiness = $siteconfig->LocalBusiness()) {\n $localBusinessSchema = array(\n \"@context\" => \"http://schema.org\",\n \"@type\" => \"Organization\"\n );\n foreach ($localBusiness as $localBusinessItem) {\n $localBusinessSchema['department'][] = $localBusinessItem->buildSchemaArray();\n }\n $MetaMarkup[] = '<script type=\"application/ld+json\">'. Convert::array2json($localBusinessSchema) .'</script>';\n }\n\n $pages = $owner->getBreadcrumbItems();\n if ($pages->Count() > 1) {\n $breadcrumbsSchema = array(\n \"@context\" => \"http://schema.org\",\n \"@type\" => \"BreadcrumbList\"\n );\n $position = 1;\n foreach ($pages as $page) {\n $breadcrumbsSchema['itemListElement'][] = array(\n \"@type\" => \"ListItem\",\n \"position\" => $position,\n \"item\" => array(\n \"@id\" => $page->AbsoluteLink(),\n \"name\" => $page->Title,\n \"image\" => $page->BreadcrumbIcon()->Link()\n )\n );\n $position++;\n }\n $MetaMarkup[] = '<script type=\"application/ld+json\">'. Convert::array2json($breadcrumbsSchema) .'</script>';\n }\n\n $tags = implode(\"\\n\", $MetaMarkup);\n }",
"public static function getFacebookMetaTags($owner)\n {\n $imageWidth = $owner->FacebookPageImage()->exists() ? $owner->FacebookPageImage()->getWidth() : null;\n $imageHeight = $owner->FacebookPageImage()->exists() ? $owner->FacebookPageImage()->getHeight() : null;\n\n $generator = FacebookMetaGenerator::create();\n $generator->setTitle($owner->FacebookPageTitle ?: $owner->Title);\n $generator->setDescription($owner->FacebookPageDescription ?: $owner->MetaDescription ?: $owner->Content);\n $generator->setImageUrl(($owner->FacebookPageImage()->exists())\n ? $owner->FacebookPageImage()->AbsoluteLink()\n : null);\n $generator->setImageDimensions($imageWidth, $imageHeight);\n $generator->setType($owner->FacebookPageType ?: 'website');\n $generator->setUrl($owner->AbsoluteLink(static::getCurrentAction()));\n\n return $generator->process();\n }",
"function mla_insert_social_tags() {\r\n\tif ( is_page() ) {\r\n\t\tglobal $post;\r\n\t\tif ( empty( $post->post_content ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$count = preg_match( '/\\[mla_gallery.*attachment_category=\"([^\\\"]*)\\\"/', $post->post_content, $mla_matches );\r\n\t\tif ( $count ) {\r\n\t\t\t$matched_category = $mla_matches[1]; // for preg_match\r\n\t\t\t$gallery = do_shortcode( sprintf( '[mla_gallery %1$s=\"%2$s\" size=full link=none mla_style=none posts_per_page=5]', 'attachment_category', $matched_category ) );\r\n\t\t\t$count = preg_match_all( '/src=\\\"([^\\\"]*)\\\"/', $gallery, $mla_matches );\r\n\t\t\tif ( $count ) {\r\n\t\t\t\tforeach ( $mla_matches[1] as $match ) {\r\n\t\t\t\t\techo sprintf( '<meta property=\"og:image\" content=\"%1$s\" />', $match ) . \"\\n\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\techo sprintf( '<meta name=\"twitter:image:src\" content=\"%1$s\" />', $mla_matches[1][0] ) . \"\\n\";\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t} // found mla_gallery\r\n\r\n\t\t$count = preg_match( '/\\[gallery.*ids=\"([^\\\"]*)\\\"/', $post->post_content, $mla_matches );\r\n\t\tif ( $count ) {\r\n\t\t\t$matched_posts = $mla_matches[1]; // for preg_match\r\n\t\t\t$gallery = do_shortcode( sprintf( '[mla_gallery %1$s=\"%2$s\" size=full link=none mla_style=none posts_per_page=5]', 'ids', $matched_posts ) );\r\n\t\t\t$count = preg_match_all( '/src=\\\"([^\\\"]*)\\\"/', $gallery, $mla_matches );\r\n\t\t\tif ( $count ) {\r\n\t\t\t\tforeach ( $mla_matches[1] as $match ) {\r\n\t\t\t\t\techo sprintf( '<meta property=\"og:image\" content=\"%1$s\" />', $match ) . \"\\n\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\techo sprintf( '<meta name=\"twitter:image:src\" content=\"%1$s\" />', $mla_matches[1][0] ) . \"\\n\";\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t} // found gallery\r\n}",
"function opengraph_meta_tags() {\n $metadata = opengraph_metadata();\n foreach ( $metadata as $key => $value ) {\n if ( empty($key) || empty($value) ) {\n continue;\n }\n $value = (array) $value;\n foreach ( $value as $v ) {\n echo '<meta property=\"' . esc_attr($key) . '\" content=\"' . esc_attr($v) . '\" />' . \"\\n\";\n }\n }\n}",
"function get_social_media_links(){\n \n $social_array = get_transient_array('social_media_links', 'fetch_social_media_links', 'auto');\n \n return $social_array;\n \n}",
"function the_seo_tags(){\n global $the_page;\n if(isset($the_page)){\n if(!$the_page->is_dummy){\n $seo = $the_page->get_seo_array();\n if(!empty($seo)){\n foreach($seo as $tag){\n $tag_name = $tag['Name'];\n $tag_value = $tag['Value'];\n\n print \"<meta name='$tag_name' value='$tag_value'>\";\n }\n }\n }\n }\n }",
"function get_metadata ()\n {\n $options = get_option ( 'ogp' );\n // == let's set some default values\n \n // site_name - the name of the site\n $site_name = get_option('blogname');\n \n // image\n if ( is_array ( $options ) && isset ( $options['image']['url'] ) && ( '' != $options['image']['url'] ) )\n $image = $options['image']['url'];\n // use the header image, if available\n else\n /** @todo use header image thumbnail */\n $image = ( defined('HEADER_IMAGE') AND '' != get_header_image() ) ? get_header_image() : '';\n \n $admins = ( is_array ( $options ) && isset ( $options['facebook']['admins'] ) && ( '' != $options['facebook']['admins'] ) ) ? $options['facebook']['admins'] : '';\n \n $app_id = ( is_array ( $options ) && isset ( $options['facebook']['app_id'] ) && ( '' != $options['facebook']['app_id'] ) ) ? $options['facebook']['app_id'] : '';\n \n // title - use the same value as for site_name\n $title = $site_name;\n \n // type\n if ( is_array ( $options ) && isset ( $options['type']['type'] ) && ( '' != $options['type']['type'] ) )\n $type = $options['type']['type'];\n // defaults to 'blog'\n else\n $type = 'blog';\n \n // url - always use the blog url\n $url = get_bloginfo('url');\n \n // description - use the tagline\n /** @todo this shall become editable on a settings page */\n $description = get_option('blogdescription');\n \n $posts_on = !is_array ( $options ) || !isset ( $options['advanced']['posts_on'] ) || ( '1' == $options['advanced']['posts_on'] );\n $pages_on = !is_array ( $options ) || !isset ( $options['advanced']['pages_on'] ) || ( '1' == $options['advanced']['pages_on'] );\n \n // == if we're dealing with an individual post or page\n global $post;\n if ( ( in_the_loop() && ( ( ( 'post' == $post->post_type ) && $posts_on ) || ( ( 'page' == $post->post_type ) && $pages_on ) ) ) || ( is_single() && $posts_on ) || ( is_page() && $pages_on ) )\n {\n $meta = get_post_meta ( $post->ID, '_ogp__open_graph_pro', true );\n if ( is_array ( $meta ) && !( isset ( $meta['toggle'] ) && ( 'off' == $meta['toggle'] ) ) && isset ( $meta['use_page'] ) )\n {\n $thispost = get_post ( $meta['use_page'] );\n $meta = get_post_meta ( $thispost->ID, '_ogp__open_graph_pro', true );\n }\n else\n $thispost = $post;\n \n if ( !( is_array ( $meta ) && isset ( $meta['toggle'] ) && ( 'off' == $meta['toggle'] ) ) ) // ogp not toggled off\n {\n \n // title - the post title\n $title = $thispost->post_title;\n \n $type = ( is_array ( $meta ) && isset ( $meta['type'] ) ) ? $meta['type'] : 'article';\n \n // url - always use the permalink\n $url = get_permalink($thispost->ID);\n \n // image -- if we have any post images, use them; featured image (a.k.a. post thumbnail) will be preferred (if there's no image here, use header image from above)\n if ( !is_array ( $options ) || !isset ( $options['image']['headeronly'] ) || ( '1' != $options['image']['headeronly'] ) )\n {\n if ( function_exists ( 'has_post_thumbnail' ) AND has_post_thumbnail($thispost->ID) )\n {\n $attachment = wp_get_attachment_image_src ( get_post_thumbnail_id($thispost->ID) );\n $image = $attachment[0];\n }\n elseif ( preg_match ( '/<img\\s[^>]*src=[\"\\']?([^>\"\\']+)/i', $thispost->post_content, $match ) )\n $image = $match[1];\n }\n \n // description - use the excerpt if available, else use the content\n $description = strip_tags ( $thispost->post_excerpt ? $thispost->post_excerpt : $thispost->post_content );\n \n // Facebook user IDs from $meta\n if ( is_array ( $meta ) && isset ( $meta['fb_admins'] ) && ( '' != $meta['fb_admins'] ) )\n {\n $admins = ogp__open_graph_pro::sanitize_fb_admins ( $admins.','.$meta['fb_admins'] );\n }\n \n } // ogp not toggled off\n }\n \n // clean up the description, i.e. strip any html tags, completely normalize whitespace, etc., and truncate at 255 characters length\n $description = preg_replace ( '/\\s+/', ' ', $description );\n if ( strlen ( $description ) > 255 ) $description = substr ( $description, 0, 252 ) . '...';\n $description = $description;\n \n // return an array containing all the meta information\n $a = array ( 'og' => array ( 'id' => 'http://ogp.me/ns#', 'metadata' => compact ( 'title', 'site_name', 'description', 'type', 'url', 'image' ) ) );\n if ( ( '' != $admins ) || ( '' != $app_id ) )\n $a['fb'] = array ( 'id' => 'http://www.facebook.com/2008/fbml', 'metadata' => compact ( 'admins', 'app_id' ) );\n return apply_filters ( 'ogp_get_metadata', $a );\n }",
"public function getMetaTagsAttribute()\n {\n $tags = $this->meta;\n if (!$tags) return;\n\n // Format tags\n foreach ($tags as $name => &$tag) {\n $tag = '<meta name=\"' .$name. '\" content=\"' .$tag. '\">';\n }\n\n return implode($tags);\n }",
"public function getMetas ()\n {\n return $this->seo->getMetas();\n }",
"public static function getMeta();",
"function meta_og() {\n\tglobal $post;\n\tif ( is_single() ) {\n\t\tif( has_post_thumbnail( $post->ID ) ) {\n\t\t\t$img_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'thumbnail' );\n\t\t} \n\t\t$excerpt = strip_tags($post->post_content);\n\t\t$excerpt_more = '';\n\t\tif ( strlen($excerpt ) > 155) {\n\t\t\t$excerpt = substr($excerpt,0,155);\n\t\t\t$excerpt_more = ' ...';\n\t\t}\n\t\t$excerpt = str_replace( '\"', '', $excerpt );\n\t\t$excerpt = str_replace( \"'\", '', $excerpt );\n\t\t$excerptwords = preg_split( '/[\\n\\r\\t ]+/', $excerpt, -1, PREG_SPLIT_NO_EMPTY );\n\t\tarray_pop( $excerptwords );\n\t\t$excerpt = implode( ' ', $excerptwords ) . $excerpt_more;\n\t\t?>\n<meta name=\"author\" content=\"Your Name\">\n<meta name=\"description\" content=\"<?php echo $excerpt; ?>\">\n<meta property=\"og:title\" content=\"<?php echo the_title(); ?>\">\n<meta property=\"og:description\" content=\"<?php echo $excerpt; ?>\">\n<meta property=\"og:type\" content=\"article\">\n<meta property=\"og:url\" content=\"<?php echo the_permalink(); ?>\">\n<meta property=\"og:site_name\" content=\"Your Site Name\">\n<meta property=\"og:image\" content=\"<?php echo $img_src[0]; ?>\">\n<?php\n\t} else {\n\t\t\treturn;\n\t}\n}",
"public static function getTwitterMetaTags($owner)\n {\n $generator = TwitterMetaGenerator::create();\n $generator->setTitle($owner->TwitterPageTitle ?: $owner->Title);\n $generator->setDescription($owner->TwitterPageDescription ?: $owner->MetaDescription ?: $owner->Content);\n $generator->setImageUrl(($owner->TwitterPageImage()->exists())\n ? $owner->TwitterPageImage()->AbsoluteLink()\n : null);\n if (PageSeoExtension::config()->get('enable_creator_tag') &&\n $owner->Creator()->exists() &&\n $owner->Creator()->TwitterAccountName) {\n $generator->setCreator($owner->Creator()->TwitterAccountName);\n }\n\n return $generator->process();\n }",
"function qed_render_header_share_meta() {\r\n\t\tif ( ! is_singular( 'post' ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$is_sharing_active = apply_filters( 'qed_render_header_social_meta', qed_get_option( 'social_sharing_blog' ) );\r\n\t\tif ( ! $is_sharing_active ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$title = esc_attr( get_the_title() );\r\n\t\t$description = esc_attr( qed_get_short_description( null, 300 ) );\r\n\r\n\t\t$thumb_id = get_post_thumbnail_id();\r\n\t\t$image = $thumb_id ? esc_url( wp_get_attachment_url( $thumb_id ) ) : '';\r\n\r\n\t\t$tags = array(\r\n\t\t\t'og' => array(\r\n\t\t\t\t'title' => $title,\r\n\t\t\t\t'description' => $description,\r\n\t\t\t\t'image' => $image,\r\n\t\t\t)\r\n\t\t);\r\n\t\tif ( qed_get_option( 'social_sharing_twitter' ) ) {\r\n\t\t\t$tags['twitter'] = array(\r\n\t\t\t\t'title' => $title,\r\n\t\t\t\t'description' => $description,\r\n\t\t\t\t'image' => $image,\r\n\t\t\t\t'card' => $image ? 'summary_large_image' : 'summary',\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t$tags = apply_filters( 'qed_header_social_meta_tags', $tags );\r\n\t\tif ( $tags ) {\r\n\t\t\tif ( !empty( $tags['og'] ) ) {\r\n\t\t\t\tforeach ( $tags['og'] as $mata_name => $meta_value ) {\r\n\t\t\t\t\tif ( $meta_value ) {\r\n\t\t\t\t\t\tprintf( PHP_EOL . '<meta property=\"og:%s\" content=\"%s\">', $mata_name, $meta_value );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ( ! empty( $tags['twitter'] ) ) {\r\n\t\t\t\tforeach ( $tags['twitter'] as $mata_name => $meta_value ) {\r\n\t\t\t\t\tif ( $meta_value ) {\r\n\t\t\t\t\t\tprintf( PHP_EOL . '<meta name=\"twitter:%s\" content=\"%s\">', $mata_name, $meta_value );\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}",
"public function getMeta();",
"public function getMeta();",
"function addOpenGraphTags()\n{\n if (is_single()) {\n $columnist = getTheColumnist();\n\n if ($columnist !== null) {\n $imgSrc = getTheColumnistPictureUrl($columnist);\n $imgAttr = getimagesize($imgSrc);\n $imgWidth = $imgAttr[0];\n $imgHeight = $imgAttr[1];\n } else {\n if (has_post_thumbnail()) {\n $image = wp_get_attachment_image_src(get_post_thumbnail_id());\n $imgSrc = $image[0];\n $imgWidth = $image[1];\n $imgHeight = $image[2];\n } else {\n $imgSrc = get_stylesheet_directory_uri() . '/img/open_graph_default.jpg';\n $imgWidth = '300';\n $imgHeight = '300';\n }\n }\n\n $imgType = exif_imagetype($imgSrc); ?>\n\n <!-- Essential meta tags -->\n <meta property=\"og:title\" content=\"<?php the_title('', ' - ' . get_bloginfo('name')); ?>\">\n <meta property=\"og:description\" content=\"<?php echo get_the_excerpt(); ?>\">\n <meta property=\"og:type\" content=\"article\">\n <meta property=\"og:url\" content=\"<?php the_permalink(); ?>\">\n <meta property=\"og:site_name\" content=\"<?php bloginfo('name'); ?>\">\n <meta property=\"og:image\" content=\"<?php echo $imgSrc; ?>\">\n <meta property=\"og:image:secure_url\" content=\"<?php echo $imgSrc; ?>\">\n <meta property=\"og:image:type\" content=\"<?php echo $imgType; ?>\">\n <meta property=\"og:image:width\" content=\"<?php echo $imgWidth; ?>\">\n <meta property=\"og:image:height\" content=\"<?php echo $imgHeight; ?>\">\n <meta property=\"twitter:card\" content=\"summary_large_image\">\n <?php\n }\n}",
"function get_meta_og_data( $url ) {\n\n\tif ( $url ) {\n\n\t\t$html_content = get_html_content( $url );\n\n\t\tif ( $html_content ) {\n\n\t\t\t$data = array();\n\n\t\t\t$html = new DOMDocument();\n\t\t\t@$html->loadHTML( $html_content );\n\n\t\t\t$data['title'] = '';\n\t\t\t$data['description'] = '';\n\t\t\t$data['img'] = '';\n\t\t\t$data['start_datetime'] = '';\n\t\t\t$data['end_datetime'] = '';\n\n\t\t\tforeach ( $html->getElementsByTagName( 'meta' ) as $meta ) {\n\n\t\t\t\tif ( $meta->getAttribute( 'property' ) == 'og:title' ) {\n\t\t\t\t\t$data['title'] = $meta->getAttribute( 'content' );\n\t\t\t\t}\n\n\t\t\t\tif ( $meta->getAttribute( 'property' ) == 'og:description' ) {\n\t\t\t\t\t$data['description'] = $meta->getAttribute( 'content' );\n\t\t\t\t}\n\n\t\t\t\tif ( $meta->getAttribute( 'property' ) == 'og:image' ) {\n\t\t\t\t\t$data['img'] = $meta->getAttribute( 'content' );\n\t\t\t\t}\n\n\t\t\t\tif ( strpos( $url, 'eventbrite' ) !== false ) {\n\t\t\t\t\tif ( $meta->getAttribute( 'property' ) == 'event:start_time' ) {\n\t\t\t\t\t\t$data['start_datetime'] = $meta->getAttribute( 'content' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( $meta->getAttribute( 'property' ) == 'event:end_time' ) {\n\t\t\t\t\t\t$data['end_datetime'] = $meta->getAttribute( 'content' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( isset( $data['img'][0] ) == false ) {\n\t\t\t\t$meta_og_img[0] = '';\n\t\t\t}\n\n\t\t\treturn $data;\n\t\t}\n\t}\n\n\treturn false;\n}"
] | [
"0.71846414",
"0.71255684",
"0.71077955",
"0.69906473",
"0.69151044",
"0.67773247",
"0.670733",
"0.6587171",
"0.64929414",
"0.6407593",
"0.6403437",
"0.63967973",
"0.63841444",
"0.6370464",
"0.63670385",
"0.62776434",
"0.62769383",
"0.6269787",
"0.622705",
"0.6177983",
"0.61777055",
"0.6148292",
"0.61410487",
"0.61386144",
"0.6129375",
"0.60913104",
"0.6066186",
"0.6066186",
"0.60558903",
"0.6055839"
] | 0.7447681 | 0 |
Get the number of post updates. | private function getTheNumberOfPostupdates($postupdates)
{
return count($postupdates);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPostCount() {\n\t\treturn $this->postCount;\n\t}",
"public function getPostCount() {\n\t\treturn $this->postCount;\n\t}",
"public function getUpdateCount()\n {\n return $this->isUpdateAvailable() ? array_get($this->response, 'update_count') : 0;\n }",
"public function getPostCount() {\n\t\treturn $this -> data['posts'];\n\t}",
"public function numberPost()\n {\n $db = $this->dbConnect();\n $req = $db->query('SELECT COUNT(*) as total FROM posts');\n \n $result = $req->fetch();\n \n return $result;\n }",
"function count_post()\n {\n return $this->db->count_all_results('entry');\n }",
"public function getPostCount()\n {\n return count($this->post);\n }",
"public function getNumPosts()\n {\n return (int)$this->data['numPosts'];\n }",
"function getPostCount() {\n\t\tif ($this->postCount < 0) {\n\t\t\t$db = DB::getHandle();\n\t\t\t$db->query(\n\t\t\t\tClassForum_Queries::getQuery('replyCountForum',\n\t\t\t\t\tarray($this->_dao->getPrimaryKey())\n\t\t\t\t)\n\t\t\t);\n\t\t\t$db->nextRecord();\n\t\t\t$this->postCount = $db->record['num'];\n\t\t}\n\t\treturn $this->postCount;\n\t}",
"public function getNumPosts()\n {\n return $this->numPosts;\n }",
"public function getNumPosts()\n {\n return $this->getConfigValue(self::CONFIG_NUM_POSTS);\n }",
"static public function get_number_of_post_to_process_at_same_time() {\r\n\t\t\t$options = self::get_options();\r\n\t\t\treturn $options['number_of_posts_for_bulk_requests'];\r\n\t\t}",
"public function getNumReplies()\n {\n return $this->getNumPosts() - 1;\n }",
"public function UpdateCount(){\n\t\t\treturn (isset($this->updates['pluskernel'])) ? ($this->update_count-1) : $this->update_count;\n\t\t}",
"public function getNumPosts() {\n return $this->numposts;\n }",
"function KRS_STG_stt2_db_get_number_of_posts()\r\n\t{\r\n\t\t// wp_die($post_count);\r\n\t\tglobal $id;\r\n\t\tif (!isset($post_count)) {\r\n\t\t\tglobal $wpdb;\r\n\t\t\t$sql = \"SELECT count(`ID`) FROM $wpdb->posts WHERE `post_status` = 'publish' AND `post_type` = 'post';\";\r\n\t\t\t$post_count = $wpdb->get_var($sql);\r\n\t\t\twp_cache_set('stt2_get_number_of_posts' . $id, $post_count, 3600);\r\n\t\t} else\r\n\t\t\t$post_count = wp_cache_get('stt2_get_number_of_posts' . $id);\r\n\t\treturn $post_count;\r\n\t}",
"public function count()\n {\n return count($this->posts);\n }",
"function mts_update_view_count( $post_id ) {\n\t$count = get_post_meta( $post_id, '_mts_view_count', true );\n\tupdate_post_meta( $post_id, '_mts_view_count', ++$count );\n\t\n\tdo_action( 'mts_view_count_after_update', $post_id, $count );\n\n\treturn $count;\n}",
"public function getPostCount()\r\n {\r\n return Yii::app()->db->createCommand()\r\n ->select('count(*) as num')\r\n ->from(Post::model()->tableName() .' p')\r\n ->join(Thread::model()->tableName() .' t', 't.id=p.thread_id')\r\n ->where('t.forum_id=:id', array(':id'=>$this->id))\r\n ->queryScalar();\r\n }",
"public function countPosts()\n {\n $db = $this->dbConnect();\n $req = $db->query('SELECT COUNT(*) FROM posts');\n $req->execute();\n $countingPost = $req->fetchColumn();\n \n return $countingPost;\n }",
"public function updateCount()\n {\n $this->count = $this->posts()->count();\n\n $this->save();\n }",
"static function get_post_counts( $post ) {\n\t\t\t$url = get_permalink( $post );\n\n\t\t\t$current = get_post_meta( $post->ID, 'sharedcount_count', true );\n\t\t\t$updated = get_post_meta( $post->ID, 'sharedcount_updated', true );\n\n\t\t\t// If never updated or updated more than an hour ago, get it\n\t\t\tif ( !$updated || ( time() - strtotime( $updated ) ) < 3600 ) {\n\t\t\t\t$count = self::get_total_count( get_permalink( $post ) );\n\n\t\t\t\t// Only update if larger\n\t\t\t\tif ( $count > $current ) {\n\t\t\t\t\tupdate_post_meta( $post->ID, 'sharedcount_count', $count );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$count = $current;\n\t\t\t}\n\n\t\t\treturn $count;\n\t\t}",
"public function incrementNumPosts()\n {\n $this->numPosts++;\n }",
"protected function _get_num_new_forum_posts()\n {\n return $this->connection->query_value_if_there('SELECT COUNT(*) FROM ' . $this->connection->get_table_prefix() . 'messages WHERE posterTime>' . strval(time() - 60 * 60 * 24));\n }",
"public function get_updates_count() {\n\t\t$dom = $this->parse_content();\n\t\t$all_node = $dom->childNodes->item(0);\n\t\t$count = 0;\n\t\tif( isset( $all_node->childNodes->length ) ){\n\t\t\tfor ($number = 0; $number < $all_node->childNodes->length; $number++) {\n\t\t\t\t$top_node = $all_node->childNodes->item($number);\n\t\t\t\t$is_chunk_element = $top_node->nodeType == XML_ELEMENT_NODE\n\t\t\t\t\t&& $top_node->tagName == self::$chunks_tag\n\t\t\t\t\t&& in_array(self::$chunks_class,\n\t\t\t\t\t\t\t\texplode(\" \", $top_node->getAttribute('class')));\n\t\t\t\tif ($is_chunk_element) {\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $count;\n\t}",
"function get_rename_posts_count() {\n\t\treturn $this->get_import_posts_count();\n\t}",
"public function getPostCount() {\n\t\t$postCount = $this->postCount;\n\t\tforeach ($this->getChildren() as $child) {\n\t\t\t/** @var $child Tx_MmForum_Domain_Model_Forum_Forum */\n\t\t\t$postCount += $child->getPostCount();\n\t\t}\n\t\treturn $postCount;\n\t}",
"function tp_count_post_views () { \n // Garante que vamos tratar apenas de posts\n if ( is_single() ) {\n \n // Precisamos da variável $post global para obter o ID do post\n global $post;\n \n // Se a sessão daquele posts não estiver vazia\n if ( empty( $_SESSION[ 'tp_post_counter_' . $post->ID ] ) ) {\n \n // Cria a sessão do posts\n $_SESSION[ 'tp_post_counter_' . $post->ID ] = true;\n \n // Cria ou obtém o valor da chave para contarmos\n $key = 'tp_post_counter';\n $key_value = get_post_meta( $post->ID, $key, true );\n \n // Se a chave estiver vazia, valor será 1\n if ( empty( $key_value ) ) { // Verifica o valor\n $key_value = 1;\n update_post_meta( $post->ID, $key, $key_value );\n } else {\n // Caso contrário, o valor atual + 1\n $key_value += 1;\n update_post_meta( $post->ID, $key, $key_value );\n } // Verifica o valor\n \n } // Checa a sessão\n \n } // is_single\n \n return;\n \n }",
"public function getAmountOfPosts()\n {\n $sql = \"SELECT COUNT(id) AS amount_of_postss FROM posts\";\n $query = $this->db->prepare($sql);\n $query->execute();\n\n return $query->fetch()->amount_of_postss;\n }",
"function post_count() {\n global $wpdb;\n return $wpdb->get_var(\"SELECT count(id)\n FROM $wpdb->posts\n WHERE post_type = 'post'\n AND post_status = 'publish'\");\n}"
] | [
"0.7474166",
"0.7474166",
"0.74519616",
"0.739413",
"0.7280272",
"0.722982",
"0.72172654",
"0.7214104",
"0.71993387",
"0.7101987",
"0.70039773",
"0.6990268",
"0.6979124",
"0.6916787",
"0.6889318",
"0.6863628",
"0.68601584",
"0.68329775",
"0.6818934",
"0.6778875",
"0.6743716",
"0.6722101",
"0.67202336",
"0.6652396",
"0.66303444",
"0.6621751",
"0.6609831",
"0.6608637",
"0.65810716",
"0.6537027"
] | 0.8131848 | 0 |
Builds the debugging string and dispatches the debugging to the instance handler. This can be passed as many args as necessary. | static public function debug() {
$arrDebug = func_get_args();
$strDebug = implode(': ', $arrDebug);
self::getInstance()->handleDebug($strDebug);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function debug() {\n if ($this->debugFlag === true) {\n $arg_list = func_get_args();\n foreach ($arg_list as $v) {\n Mage::Log('[Sheepla][' . date('Y-m-d H:i:s') . ']' . print_r($v, true));\n if ($this->forceDebugFlag) {\n echo date('Y-m-d H:i:s') . ' : <pre>' . htmlentities(print_r($v, true)) . \"</pre> <br />\\n\\r\";\n }\n }\n }\n }",
"public function debug() {\n\t\t$args = func_get_args();\n\t\t$length = count($args);\n\t\tif ($length === 0) {\n\t\t\techo \"ERROR: No arguments provided.\";\n\t\t}\n\t\telse {\n\t\t\tfor ($i = 0; $i < $length; $i++) {\n\t\t\t\t$arg = $args[$i];\n\t\t\t\t\n\t\t\t\techo \"Argument {$i} (\" . gettype($arg) . \")\";\n\t\t\t\t\n\t\t\t\tif (is_array($arg) || is_object($arg)) {\n\t\t\t\t\tprint_r($arg);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar_dump($arg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$backtrace = debug_backtrace();\n\t\t\n\t\t// output call location to help finding these debug outputs again\n\t\techo \"wcfDebug() called in {$backtrace[0]['file']} on line {$backtrace[0]['line']}\";\n\t\texit;\n\t}",
"function kb_debug() {\n\tstatic $kdb;\n\tif ( !isset( $kdb ) ) $kdb = new KB_Debug();\n\n\t$kdb->log( func_get_args() );\n}",
"function debug()\n{\n $args = func_get_args();\n write(array_merge(array('DEBUG'), $args));\n}",
"public function debugAction() : string\n {\n // Deal with the action and return a response.\n // return __METHOD__ . \", \\$db is {$this->db}\";\n return \"Debug my game!!\";\n }",
"public function debug()\n {\n echo \"<pre>\";\n print_r($this->method_parameters);\n echo \"</pre>\";\n echo \"\\n\";\n echo \"<pre>\";\n print_r($this->matched_parameters);\n echo \"</pre>\";\n }",
"function debugHelper ($name, $jsonObj, $command = null) {\n\tif ($command) {\n\t\t$command .= \"\\n\\n\";\n\t}\n\treturn \"<br><details><summary>Debug: {$name}</summary><pre>{$command}\" . \n\t\tjson_encode($jsonObj, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT) . \n\t\t\"</pre></details>\";\n}",
"public static function debug() {\n $num_args = func_num_args();\n $arg_list = func_get_args();\n \n for ($i = 0; $i < $num_args; $i++) {\n error_log(print_r($arg_list[$i], true) . \"\\n\", 3, SALMONPRESS_LOG_FILE);\n }\n }",
"public static function dbug(){\r\n $a = func_get_args();\r\n echo call_user_func_array(array('DJB', 'get_dbug'), $a);\r\n }",
"function debug() {\n\t$backtrace = debug_backtrace();\n\n\tif (IN_SHELL) {\n\t\tforeach (func_get_args() as $argument) {\n\t\t\tprintf(\"%s (line %s)\\n%s\\n\",\n\t\t\t\tsubstr($backtrace[0][\"file\"], strlen(ROOT_DIR) + 1),\t// Filename\n\t\t\t\t$backtrace[0][\"line\"],\t\t\t\t\t\t\t\t\t// Line number\n\t\t\t\texpress($argument)\t\t\t\t\t\t\t\t\t\t// Text\n\t\t\t);\n\t\t}\n\t} else {\n\t\tforeach (func_get_args() as $argument) {\n\t\t\tprintf('<pre><span style=\"display: block; font-weight: bold;\">%s (line %s)</span>%s</pre>',\n\t\t\t\tsubstr($backtrace[0][\"file\"], strlen(ROOT_DIR) + 1),\t\t\t\t\t// Filename\n\t\t\t\t$backtrace[0][\"line\"],\t\t\t\t\t\t\t\t\t\t\t\t\t// Line number\n\t\t\t\thtmlentities(express($argument), ENT_QUOTES, mb_internal_encoding())\t// Text\n\t\t\t);\n\t\t}\n\t}\n}",
"function builder_set_debug() {\n\t\treturn \"debug\";\n\t}",
"public function debug()\n {\n $this->arguments[] = '--debug';\n return $this;\n }",
"public function debug();",
"public function generateDebug()\n {\n return (string)$this;\n }",
"public static function debug()\n\t{\n\t\t$args = func_get_args();\n\t\tif ( ! empty($args))\n\t\t{\n\t\t\t$str = ''; \n\t\t\tforeach ($args as $arg)\n\t\t\t{\n\t\t\t\tswitch ($arg)\n\t\t\t\t{\n\t\t\t\t\tcase is_bool($arg):\n\t\t\t\t\t\t$str .= ($arg ? '<pre>(bool) TRUE' : '(bool) FALSE').'</pre>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase is_int($arg):\n\t\t\t\t\t\t$str .= '<pre>(int) '.$arg.'</pre>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase is_float($arg):\n\t\t\t\t\t\t$str .= '<pre>(float) '.$arg.'</pre>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase is_string($arg):\n\t\t\t\t\t\t$str .= '<pre>(string) '.$arg.'</pre>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$str .= '<pre>'.print_r($arg, TRUE).'</pre>';\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $str;\n\t\t}\n\t\treturn \"No variable(s) provided.\\n\";\n\t}",
"public static function debug()\n\t{\n\t\tif (func_num_args() === 0)\n\t\t\treturn;\n\n\t\t// Get all passed variables\n\t\t$variables = func_get_args();\n\n\t\t$output = array();\n\t\tforeach ($variables as $var)\n\t\t{\n\t\t\t$type = gettype($var);\n\n\t\t\tswitch ($type)\n\t\t\t{\n\t\t\t\tcase 'boolean':\n\t\t\t\t\t$var = $var ? 'TRUE' : 'FALSE';\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$var = htmlspecialchars(print_r($var, TRUE), NULL, self::$charset, TRUE);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$output[] = '<pre>('.$type.') '.$var.'</pre>';\n\t\t}\n\n\t\treturn implode(\"\\n\", $output);\n\t}",
"function debug() {\r\n\t\t\tdie( '<pre>' . print_r( $this, true ) . '</pre>' );\r\n\t\t}",
"public static function dump()\n\t{\n\t\techo self::HTML_START . PHP_EOL;\n\t\t$args = func_get_args();\n\t\tforeach($args as $arg) {\n\t\t\tif(self::$useXDebug) {\n\t\t\t\tvar_dump($arg);\t\n\t\t\t} else {\n\t\t\t\tob_start();\n\t\t\t\tvar_dump($arg);\n\t\t\t\t$rawDump = ob_get_clean();\n\t\t\t\t$lines = explode(PHP_EOL, $rawDump);\n\t\t\t\techo '<pre>';\n\t\t\t\tforeach($lines as $line) {\n\t\t\t\t\techo htmlspecialchars($line) . '<br>' . PHP_EOL;\n\t\t\t\t}\n\t\t\t\techo '</pre>';\n\t\t\t}\n\t\t}\n\t\techo self::HTML_END . PHP_EOL;\n\t}",
"function debug()\r\n {\r\n }",
"public function debugAction() : string\n {\n // Deal with the action and return a response.\n return \"Debugging\";\n }",
"public function debug($value);",
"public function debug(){\n echo\"<pre><code>\";\n var_dump($this);\n echo \"</code></pre>\";\n }",
"public function __debug();",
"public function debug($message){ }",
"function debug()\n {\n echo '<pre>'; var_dump($this); echo '</pre>';\n }",
"function debug_log() {\n $dt = (new DateTime())->format(DateTime::ATOM);\n\n $args = func_get_args();\n $formatted = call_user_func_array('sprintf', $args);\n\n printf('[%s] %s' . PHP_EOL, $dt, $formatted);\n}",
"function debug($message = \"\")\n{\n\t$args = func_get_args();\n\t\n\t$args[0] = \"DEBUG: \" . (count($args) == 0 ? \"\" : $args[0]);\n\t\n\tcall_user_func_array('println', $args);\n}",
"function debug($name=''){\n\t echo \"<br><b>$name</b>====================== SOTF DEBUG ===========================<br>\";\n\t echo \"<b>Object ID:</b> \" . $this->id . \"<br>\";\n\t echo \"<b>Object Data:</b> <pre>\"; print_r($this->data); echo \"</pre>\";\n\t echo \"<b>Object Changed:</b> \"; if($this->changed){ echo \"TRUE\"; }else{ echo \"FALSE\";} echo \"<br>\";\n\t echo \"<b>Object Database Handle:</b> <pre>\"; print_r($db->dsn) . \"</pre>\";\n }",
"public static function log() {\n\t\t$trace = debug_backtrace ();\n\t\t$args = func_get_args ();\n\t\t$args = array_merge ( array (\n\t\t\t\tself::_debugDecorator ( $trace )\n\t\t), $args );\n\t\tself::_log ( $args, 'info' );\n\t}",
"public function debug($message){}"
] | [
"0.6474073",
"0.6243343",
"0.6119387",
"0.60363925",
"0.6001317",
"0.58710027",
"0.5858457",
"0.5858266",
"0.57541025",
"0.57361996",
"0.573213",
"0.5722127",
"0.57151693",
"0.57021207",
"0.56905097",
"0.566339",
"0.5643785",
"0.5633097",
"0.56063753",
"0.5591879",
"0.5550286",
"0.5529745",
"0.552462",
"0.55049896",
"0.54564774",
"0.54390436",
"0.5431728",
"0.53995126",
"0.53859574",
"0.5385177"
] | 0.72723454 | 0 |
Removes a debugging handler. | public function removeHandler($strHandler) {
if (array_key_exists($strHandler, $this->arrHandlers)) {
unset($this->arrHandlers[$strHandler]);
} else {
throw new CoreException(AppLanguage::translate('Invalid debugging handler (%s)', $strHandler));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeFirstHandler()\n {\n array_pop($this->handlerStack);\n }",
"public function removeLastHandler()\n {\n array_shift($this->handlerStack);\n }",
"function elgg_unregister_page_handler($handler) {\n\tglobal $CONFIG;\n\n\tif (!isset($CONFIG->pagehandler)) {\n\t\treturn;\n\t}\n\n\tunset($CONFIG->pagehandler[$handler]);\n}",
"public function remove(object $handler): self;",
"public function removeHandlerGroups(){\n foreach($this->getHandlerGroups() as $handlerKey){\n $this->removeHandlerGroup($handlerKey);\n }\n }",
"public function removeHandler($handler)\n {\n foreach ($this->_handlers as $tmpKey=>$tmpHandler) {\n if ($tmpHandler==$handler) {\n unset($this->_handlers[$tmpKey]);\n return true;\n }\n }\n return false;\n }",
"public function removeTimedMessageHandler($handlerId)\n {\n unset($this->timedMessageHandlers[$handlerId]);\n }",
"public function unregister(): void\n {\n restore_error_handler();\n restore_exception_handler();\n }",
"function removeEventHandler($event, $type, $classname, $function, $path, &$message){\n\t$event = mysql_real_escape_string($event);\n\t$type = mysql_real_escape_string($type);\n\t$classname = mysql_real_escape_string($classname);\n\t$function = mysql_real_escape_string($function);\n\t$path = mysql_real_escape_string($path);\n\t$res = $GLOBALS['db']->execute(\"delete from handlers where event = '$event' and type = '$type' and classname = '$classname' and function = '$function' and path = '$path'\");\n\tif($res===false){\n\t\t$message .= 'Error deleting event handler '.$event.':<br />' . mysql_error();\n\t\t$GLOBALS['db']->rollbacktransaction();\n\t\treturn false;\n\t}\n\t$message .= 'Deleted event handler: '.$event.'<br />';\t\n\treturn true;\n}",
"public static function unregisterErrorHandler()\n {\n if (is_array(self::$interceptor_stack))\n {\n self::$interceptor_stack = null;\n restore_error_handler();\n }\n }",
"public function tearDown()\n {\n unset($this->handler);\n }",
"public function unRegisterHandler(ServerHandlerInterface $handler)\n {\n $id = spl_object_hash($handler);\n\n if (array_key_exists($id, $this->handlers) === false) {\n return false;\n }\n\n unset($this->handlers[$id]);\n\n return true;\n }",
"public function clearHandlers()\n {\n $this->handlerStack = array();\n return $this;\n }",
"function unset_hook( $tag = null ) {\r\n global $ipHooks;\r\n return $ipHooks->unsetHook( $tag );\r\n}",
"public function popHandler()\n {\n return array_pop($this->handlerStack);\n }",
"public function popHandler()\n {\n return array_pop($this->handlerStack);\n }",
"public function clearHandlers()\n {\n $this->handlerStack = [];\n return $this;\n }",
"protected function tearDown():void {\n $this->handler = null;\n }",
"public function removeLogger(ILogger $logger): void;",
"protected function removed(WebhookPayload $payload): void\n {\n //\n }",
"function logger_firmware_remove($id) {\n\n db_delete('logger_device_firmware')\n ->condition('id', $id)\n ->execute();\n\n drupal_goto(\"firmware/list\");\n}",
"protected function whoopsHandler()\n {\n return (new WhoopsHandler)->forDebug();\n }",
"public function clearTimedMessageHandlerFlag($handlerId)\n {\n $this->timedMessageHandlers[$handlerId]['handled'] = false;\n unset($this->timedMessageHandlers[$handlerId]['dto']);\n }",
"public function detach(string $eventType, $handler): void;",
"public final function deduplicateClear($handler, array $data)\n\t{\n\t\tModel_Intent::deleteByHash($handler, md5(json_encode($data)));\n\t}",
"public function unregisterService( $handle );",
"public function removeCurlHandle($handle)\n {\n $key = (int) $handle;\n \n if (isset($this->curlHandles[$key]))\n {\n #echo '<br>removeCurlHandle ';\n #print_r($handle);\n \n curl_multi_remove_handle($this->getCurlMulti(), $handle);\n // curl_close($handle); // dont close handle as Guzzle reuses it's handles\n \n // echo ' - multi: ';\n // print_r($this->getCurlMulti());\n \n unset($this->curlHandles[$key], $this->curlListeners[$key]);\n }\n }",
"public function clearDebugFile() {\n $this->load->language($this->route);\n $json = array();\n\n if (!$this->user->hasPermission('modify', $this->route)) {\n $json['error'] = $this->language->get('error_permission');\n } else {\n $file = DIR_LOGS . $this->request->post['debug_file'];\n\n $handle = fopen($file, 'w+');\n\n fclose($handle);\n\n $json['success'] = $this->language->get('success_clear_debug_file');\n }\n\n $this->response->addHeader('Content-Type: application/json');\n $this->response->setOutput(json_encode($json));\n }",
"public function detach($type, $handler);",
"public function uninstall(){\n\t\tparent::uninstall();\n\n\t\tif(!$this->debug){\n\t\t\tdelete_option($this->varName . '_api-key');\n\t\t\tdelete_option($this->varName . '_report-code');\n\t\t\tdelete_option($this->varName . '_chart-size');\n\n\t\t\tglobal $wpdb;\n\n\t\t\t// drop the dbs\n\t\t\t$wpdb->query(\"DROP TABLE \" . $this->dbPrefix . \"countries\");\n\t\t\t$wpdb->query(\"DROP TABLE \" . $this->dbPrefix . \"country_states\");\n\t\t}\n\t}"
] | [
"0.660453",
"0.64490384",
"0.61298656",
"0.60480374",
"0.5743922",
"0.57346576",
"0.55542815",
"0.540968",
"0.53741235",
"0.5285903",
"0.5276111",
"0.51234365",
"0.5059546",
"0.50146866",
"0.49915904",
"0.49915904",
"0.49876648",
"0.4983192",
"0.4967897",
"0.49273342",
"0.48897776",
"0.48892325",
"0.4866676",
"0.48592317",
"0.48494998",
"0.48266912",
"0.4820687",
"0.48144346",
"0.4813622",
"0.48091707"
] | 0.7052332 | 0 |
Completes the definition of the current shape | function swf_endshape()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function saveCurrentShape()\n\t{\n\t\t$this->settings->currentShape = $this->currentShape;\n\t}",
"function swf_startshape($objid)\n{\n}",
"public function run()\n {\n $types = config('pasta.shapes');\n foreach ($types as $type) {\n $new_type_obj = new Shape();\n $new_type_obj->fill($type);\n $new_type_obj->save();\n }\n }",
"public function handleShape(BaseShape $shape)\n {\n }",
"private function switchShape()\n\t{\n\t\tif ($this->currentShape == Square::SHAPE_CIRCLE)\n\t\t{\n\t\t\t$this->currentShape = Square::SHAPE_CROSS;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->currentShape = Square::SHAPE_CIRCLE;\n\t\t}\n\t}",
"public function reset()\n {\n parent::reset();\n $this->attr('Geometry')->primitive('ring');\n $this->attr('Geometry')->radiusOuter(0.016);\n $this->attr('Geometry')->radiusInner(0.01);\n $this->attr('Geometry')->segmentsTheta(64);\n \n $this->attr('Material')->shader('flat');\n $this->color('#000');\n $this->attr('Material')->opacity(0.8);\n \n $this->position(0, 0, - 1);\n \n $this->attr('Cursor')->fuse(true);\n $this->attr('Raycaster')->far(1000);\n $this->attr('Cursor')->fuseTimeout(1500);\n }",
"public function hasShape()\n {\n return !is_null($this->shape);\n }",
"public function complete() {\n // This space left intentionally blank.\n }",
"public function getShape()\n {\n return $this->shape;\n }",
"public function endDoc()\n {\n $this->rules->maybeEmitGlobalTagValidationErrors($this->context, $this->validationResult);\n\n if ($this->validationResult->getStatus()->equals(ValidationStatus::UNKNOWN())) {\n $this->validationResult->setStatus(ValidationStatus::PASS());\n }\n\n // As some errors can be inserted out of order, sort errors at the end based on their line / column numbers.\n $this->validationResult->getErrors()->sortByPosition();\n }",
"protected function setObjectActualShape()\n\t{\n\t\t//\n\t\t// Check shape.\n\t\t//\n\t\tif( ! $this->offsetExists( kTAG_GEO_SHAPE ) )\n\t\t{\n\t\t\t//\n\t\t\t// Check shape.\n\t\t\t//\n\t\t\tif( $this->offsetExists( ':location:site:latitude' )\n\t\t\t && $this->offsetExists( ':location:site:longitude' ) )\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// Get coordinates.\n\t\t\t\t//\n\t\t\t\t$lat = $this->offsetGet( ':location:site:latitude' );\n\t\t\t\t$lon = $this->offsetGet( ':location:site:longitude' );\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t// Filter zero coordinates.\n\t\t\t\t//\n\t\t\t\tif( ($lat != 0)\n\t\t\t\t || ($lon != 0) )\n\t\t\t\t\t$this->offsetSet(\n\t\t\t\t\t\tkTAG_GEO_SHAPE,\n\t\t\t\t\t\tarray( kTAG_TYPE => 'Point',\n\t\t\t\t\t\t\t kTAG_GEOMETRY => array( $lon, $lat ) ) );\n\t\t\t\telse\n\t\t\t\t\treturn FALSE;\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn FALSE;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\t\t}\n\t\t\n\t\treturn TRUE;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\t\n\t}",
"private function setCurrentShape($shape)\n\t{\n\t\t$this->judge->checkShapeValidity($shape);\n\n\t\t$this->currentShape = $shape;\n\t}",
"function endDoc()\r\n {\r\n $this->output.=\"Parsing finished\\n\";\r\n }",
"public function definition_after_data() {\n if (!isset($this->_form->_submitValues['config_iconlinkdelete'])) {\n return;\n }\n foreach ($this->_form->_submitValues['config_iconlinkdelete'] as $i => $del) {\n // Remove the rules for the deleted link so that error is not triggered.\n if ($del) {\n unset($this->_form->_rules[\"config_iconlinklabel[${i}]\"]);\n unset($this->_form->_rules[\"config_iconlinkurl[${i}]\"]);\n unset($this->_form->_rules[\"config_iconlinkcampusroles[${i}]\"]);\n unset($this->_form->_rules[\"config_iconlinkimage[${i}]\"]);\n }\n }\n\n if (!isset($this->_form->_submitValues['config_textlinkdelete'])) {\n return;\n }\n foreach ($this->_form->_submitValues['config_textlinkdelete'] as $i => $del) {\n // Remove the rules for the deleted link so that error is not triggered.\n if ($del) {\n unset($this->_form->_rules[\"config_textlinklabel[${i}]\"]);\n unset($this->_form->_rules[\"config_textlinkurl[${i}]\"]);\n unset($this->_form->_rules[\"config_textlinkcampusroles[${i}]\"]);\n }\n }\n }",
"public function completeFlow()\n {\n\n }",
"function finish()\r\n\t{\r\n\t\t; // default implementation does nothing\r\n\t}",
"protected function _after()\n {\n unset($this->image);\n parent::_after();\n }",
"function Shape($mappings = array()) {\r\n\t\t$this->mappings = $mappings;\r\n\t}",
"function addShape(Shape $shape){\n\t\t$this->shapes[] = $shape;\n\t}",
"public function complete(): void;",
"public function complete(): void;",
"public function erase()\n {\n $this->widths = null;\n $this->frame->clearComponents();\n $this->frame->destroy();\n $this->destroyComponents();\n parent::destroy();\n }",
"public function defend(): void\n {\n $this->setActivityStatus(self::STATUS_DEFEND);\n }",
"public function pathFinish () {}",
"public function shape($value) {\n return $this->setProperty('shape', $value);\n }",
"public function calculateShape(){\n echo \"calculating a square shape with size \". $this->size .\" color \" . $this->getColor() . \" and border Size \" . $this->getBorderSize() . \" .... \\n\";\n\n $this->data = array_fill(0,$this->size,[]);\n for ($x=0;$x<$this->size;$x++)\n {\n if ($x==0)\n $this->data[$x] = array_fill(0,$this->size,[]);\n for($y=0;$y<$this->size;$y++)\n {\n\t\t\t\t$this->data[$x][$y] = ' ';\n if ($x == 0 || $y==0 || $x == ($this->size-1) || $y==($this->size-1))\n $this->data[$x][$y] = '*';\n }\n }\n sleep(1); //simulating calculation\n }",
"private function removeEndingVertex()\n {\n $final_vertex = $this->getFinalVertex();\n $final_vertex->destroy();\n }",
"public function clearRightBezierHandle()\n {\n $this->_data['bezierRC'] = null;\n }",
"function finish()\r\n\t{\r\n\t\t$this->bodyText = null;\r\n\t}",
"public function loadShapesInput(): void\n {\n foreach ($this->shapeFiles as $file) {\n $errors = [];\n $json = file_get_contents($file);\n $input = json_decode($json, true);\n if (!empty($json) && $input === null && json_last_error() != JSON_ERROR_NONE) {\n error_log(sprintf( '%s: Error while decoding; %s', __FUNCTION__, json_last_error_msg())); // todo: logger\n $errors[] = json_last_error_msg();\n }\n\n if (is_array($input)) {\n $this->shapeParameters = array_merge($this->shapeParameters, $input);\n\n\n //$input;\n } else {\n $this->shapeParameters[] = $input;\n\n }\n\n\n }\n }"
] | [
"0.58894455",
"0.55470246",
"0.5452635",
"0.5431507",
"0.52665424",
"0.5219933",
"0.5163361",
"0.5110782",
"0.50846756",
"0.50770867",
"0.5060178",
"0.49716896",
"0.48919463",
"0.48083526",
"0.48012087",
"0.47892436",
"0.4786154",
"0.47436363",
"0.47394887",
"0.47239858",
"0.47239858",
"0.469845",
"0.4686894",
"0.46861705",
"0.46779224",
"0.46777537",
"0.4656277",
"0.46536687",
"0.46439254",
"0.4636527"
] | 0.6807131 | 0 |
Renvoi l'image de profil d'un utilisateur | public function getUserImg($userid) {
// Chemin d'accès des photos de profils
$dir = Config::get('image.imgprofil_path');
// On récupère la valeur de l'img dans la BDD
$getimgname = $this->db->prepare("SELECT imgprofil, pseudo FROM users WHERE id=:id LIMIT 1");
$getimgname->execute(array(
'id' => $userid
));
$data = $getimgname->fetch(PDO::FETCH_OBJ);
// On défini le nom de l'image généré à l'inscription
$imgnamealea = $data->pseudo . ".png";
// Si il y a un résultat
if($getimgname->rowCount() > 0) {
// On vérifie que le résultat n'est pas vide
if(!empty($data->imgprofil)) {
$imgsqlname = $data->imgprofil;
$filename = $dir . $imgsqlname;
// On vérifie que l'image existe
if(file_exists(ROOT . $filename)) {
return $filename;
} elseif(file_exists(ROOT . $dir . $imgnamealea)) { // Sinon on vérifie que l'image généré à l'inscription existe
return $dir . $imgnamealea;
} else { // Sinon on renvoi l'image par defaut
return $dir . 'profil_default.png';
}
} else {
if(file_exists(ROOT . $dir . $imgnamealea)) { // On vérifie que l'image généré à l'inscription existe
return $dir . $imgnamealea;
} else {
return $dir . 'profil_default.png';
}
}
} else {
return $dir . 'profil_default.png';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getImagen_usuario()\n {\n return $this->imagen_usuario;\n }",
"public function profileImage()\n {\n return ($this->image) ? '/storage/'. $this->image : '/storage/user.jpg';\n }",
"function saveImageUser($id){\n \t\n\t\t$this->idUser = $id;\n \t\n \t//récupèration de l'utilisateur\n \t$this->getUser(array(\"login\"=>$id));\n\n \t//création du répertoire de stockage\n \t$this->chemin = ROOT_PATH.'/data/Panoramio/'.$this->idUser.'/img';\n \t\n\t\tif(!is_dir($this->chemin)) @mkdir($this->chemin,0777,true);\n \t\n\t\t//récupération des images\n\t\t\n\t\tfor ($i = 1; $i <= 10; $i++) {\n\t\t $results = $this->flkr->tagSearch('',array(\"group_id\"=>$this->idGroupe,\"page\"=>$i,\"per_page\"=>\"100\", \"bbox\"=>\"-180,-90,180,90\",\"accuracy\"=>\"1\",\"extras\"=>\"owner_name,geo,media,tags,machine_tags\"));\n\t\t \t \n\t\t\tforeach ($results as $result) {\n\t\t\t //echo $result->title . '<br />';\n\t\t\t $this->saveImage($result);\n\t\t\t} \t\t\t\t\n\t\t}\n }",
"public function getUserImage()\n\t{\n\t\treturn $this->user_image;\n\t}",
"public function get_user_image() {\r\n\r\n\t\treturn \"assets/\" . \"img/\" . \"profile/\" . \"default/\" . $this->user_image;\r\n\t}",
"public function getUserImage () {\n return \"https://quangvoc8.s3.amazonaws.com/\".$this->user_image;\n }",
"public function getUserProfPic(){\n\t\treturn $this->userProfPic;\n\t}",
"function getprojuserimg($values){\n\tglobal $USER,$DB,$CFG,$OUTPUT;\n\t$uname = $values->firstname.' '.$values->lastname;\n\t$userobject = (object) array('id'=>$values->userid,'auth'=>$values->auth,'username'=>$values->username,\n\t'firstname'=>$values->firstname,'lastname'=>$values->lastname,'picture'=>$values->picture);\t\n\t$userlink = userpicbyobject($userobject);\n\treturn $userlink;\n}",
"public function getProfilePicture()\n {\n // TODO: Implement getProfilePicture() method.\n }",
"public function removeProfilleimg()\n {\n if (isset($_SESSION [LOGGED_IN])) {\n $user = $_SESSION [LOGGED_IN];\n $userID = $user [USER_ID];\n $this->load->model('usermanagement/Usermanagementmodel');\n $result = $this->Usermanagementmodel->removeProfileimg($userID);\n $_SESSION[LOGGED_IN]['profile'] = 0;\n if ($result) {\n $response = array(\n STATUS => true,\n );\n } else {\n $response = array(\n STATUS => false,\n );\n }\n $this->apiResponse($response);\n }\n }",
"public function retrieve_user_photo(){\n\t\tglobal $db;\n\t\t$sql = \"SELECT filename, type FROM \".self::$table_name.\" WHERE \";\n\t\t$sql.= \"user_id = $this->user_id\";\n\t\tif($result = $db->query($sql)){\n\t\t\tif($db->has_rows($result)){\n\t\t\t\t$result_array = $db->fetch_array($result);\n\t\t\t\t$image_name = $result_array['filename'].$result_array['type'];\n\t\t\t\t$image_path = SITE_ROOT.DS.self::$photo_dir.DS.$image_name;\n\t\t\t\tif(file_exists($image_path)){\n\t\t\t\t\t$this->image_name = $image_name;\n\t\t\t\t} else {\n\t\t\t\t\t/* display image of 'Please Upload a Photo' */\n\t\t\t\t\t$this->photo_errors[] = \"Please upload a photo\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function get_image($username){\n\n }",
"public function profileImage()\n {\n $imagePath = ($this->image) ? $this->image : 'uploads\\Ec4AiSeHe7gPRBhi1FBwS1O233xC1upRAtaDqCU9.png';\n return '/storage/'.$imagePath;\n }",
"public function getImage()\n {\n if($this->photo_rec){\n return $this->photo_rec;\n } \n return '/' . Yii::$app->params['images_folder'] . '/default-user.png';\n }",
"public function saveProfileImage()\n {\n (new User())->saveProfileImage();\n return view('user.home.changeimage', ['tmpImg' => '']);\n }",
"function updateProfil($nom, $pseudo, $mail, $pwd, $img, $monUser)\n {\n //Initialisation\n $errorFlag = false;\n $filenameImage = $img['name'][0];\n $filenameImage = uniqid() . \".\" . pathinfo($filenameImage, PATHINFO_EXTENSION);\n $pathImage = \"./user/img/\" . $filenameImage;\n $pdo = Database::getPDO();\n $pwd = password_hash($pwd, PASSWORD_DEFAULT);\n //Traitement\n $pdo->beginTransaction();\n //Vérification des erreurs à chaque étapes\n if ($errorFlag == false) {\n //Si on a pas d'image\n if ($img['name'][0] == \"\") {\n //On garde l'avatar de base\n $img = $monUser[0]['Avatar'];\n //On update l'utilisateur\n $this->mUser->updateUser($monUser[0]['IdUser'], $nom, $pseudo, $mail, $pwd, $img);\n } else {\n //Alors on a une image\n //on vérifie le type de l'image \n if ($this->checkFilesType($img) == false) {\n $errorFlag = true;\n }\n //On vérifie la taille de l'image\n if ($this->checkFilesSize($img) == false) {\n $errorFlag = true;\n }\n //On update et on vérifie si il n'y a toujours pas d'erreur\n if ($this->mUser->updateUser($monUser[0]['IdUser'], $nom, $pseudo, $mail, $pwd, $pathImage) && $errorFlag == false) {\n //On upload notre fichier\n if (move_uploaded_file($img['tmp_name'][0], $pathImage)) {\n //Si l'avatar n'est pas vide\n if (!empty($monUser[0]['Avatar'])) {\n //Et que ce n'est pas l'image par défaut\n if ($monUser[0]['Avatar'] != \"./user/img/default.jpg\") {\n //Alors on supprime l'ancienne image de nos fichiers (le default est gardé car il est partagé entre mes users)\n unlink($monUser[0]['Avatar']);\n }\n }\n } else {\n $errorFlag = true;\n }\n }\n }\n }\n //Si le flag d'erreur à été levé\n if ($errorFlag == true) {\n //On annule notre requête\n $pdo->rollBack();\n } else {\n //Sinon on commit notre requete et on récupere notre User\n $pdo->commit();\n return $this->mUser->getUserByMail($mail);\n }\n }",
"public function getUserAvatarFilePath() {\n $query = $this->db->prepare(\"SELECT photo_name FROM gsta_photo WHERE photo_user = :user_name ORDER BY photo_id DESC LIMIT 1\");\n $query->execute(array(':user_name' => $_SESSION['user_name']));\n\n $_result = $query->fetch();\n if ($_result) {\n return URL . $_result->photo_name;\n } else {\n return URL . AVATAR_PATH . AVATAR_DEFAULT_IMAGE;\n }\n }",
"function dimefoto($usuario)\n{\n $c = conectar();\n $select = \"select imagen from login where usuario = '$usuario';\";\n $resultado = mysqli_query($c, $select);\n if($fila = mysqli_fetch_assoc($resultado)){\n extract($fila);\n }else{\n $imagen='';\n }\n \n \n desconectar($c);\n return $imagen;\n}",
"public function profileImage ($name, $profile) {}",
"function getProfileImage($userid)\n\t\t{\n\t\t\tglobal $db;\n\t\t\t$sql_photo= \"SELECT `profile_photo` FROM hd_member where member_id='\".$userid.\"'\";\n\t\t\t$res_phhoto=$db->select_data($sql_photo);\n\t\t\t$profile_photodb=$res_phhoto[0]['profile_photo'];\n\t\t\treturn $profile_photodb;\n\t\t}",
"function get_profil_picture($id){\n if ($id != NULL) {\n $id = htmlspecialchars($id);\n try{\n $query = mysql_query('SELECT path FROM images WHERE users_id = \"'.$id.'\" and profil=\"1\"') or die(mysql_error());\n $nb_resultats = mysql_num_rows($query); \n if($nb_resultats == 0){\n return \"NoResult\";\n }\n else{\n return $query;\n }\n }\n catch(Exception $e)\n\t\t\t{\n\t\t\t // En cas d'erreur, on affiche un message et on arrête tout\n\t\t\t die('Erreur : '.$e->getMessage());\n\t\t\t}\n}\n else{\n return false; \n }\n}",
"function GetUserImage($user_id){\n return $this->database->DbGetUserImage($user_id);\n }",
"protected function getPicture()\n {\n\n }",
"function avatar2(){\n global $connection;\n $login_id = \"\";\n if (isset($_SESSION['id'])) {\n $login_id = $_SESSION['id'];\n }\n \n $view_vender_query = \"SELECT * FROM users WHERE id= $login_id\";\n $select_vender_by_id = mysqli_query($connection, $view_vender_query); \n while($row = mysqli_fetch_assoc($select_vender_by_id)){\n $image1 = $row['image1'];\n}\n\n echo '<img src=\"./images/'.$image1.'\" alt=\"\" class=\"rounded-circle\"></div>';\n }",
"function openlucius_core_fetch_user_image($u, $style = 'ol_50x50', $alt = \"\", $title = \"\", $width = NULL, $height = NULL) {\n\n // Initialize image string.\n $image = '';\n\n // If u is a number it's the uid otherwise it is a user object.\n $account = is_numeric($u) ? user_load($u) : $u;\n\n // The default 'avatar' image.\n $default_uri = drupal_get_path('theme', 'openlucius') . '/images/avatar.png';\n\n // Check if the user has a picture.\n if (!empty($account->picture)) {\n\n // Check if the file was loaded.\n if (!empty($account->picture->uri)) {\n\n if (file_exists($account->picture->uri)) {\n $image = theme('image_style', array(\n 'style_name' => $style,\n 'path' => $account->picture->uri,\n 'alt' => $alt,\n 'title' => $title,\n 'width' => !empty($width) ? $width : '',\n 'height' => !empty($height) ? $height : '',\n ));\n }\n else {\n $image = theme('image', array(\n 'style_name' => 'ol_50x50',\n 'path' => $default_uri,\n 'alt' => $alt,\n 'title' => $title,\n 'width' => !empty($width) ? $width : '',\n 'height' => !empty($height) ? $height : '',\n ));\n }\n }\n // Build path to default picture.\n else {\n $image = theme('image', array(\n 'style_name' => 'ol_50x50',\n 'path' => $default_uri,\n 'alt' => $alt,\n 'title' => $title,\n 'width' => !empty($width) ? $width : '',\n 'height' => !empty($height) ? $height : '',\n ));\n }\n }\n // Build path to default picture.\n else {\n $image = theme('image', array(\n 'style_name' => 'ol_50x50',\n 'path' => $default_uri,\n 'alt' => $alt,\n 'title' => $title,\n 'width' => !empty($width) ? $width : '',\n 'height' => !empty($height) ? $height : '',\n ));\n }\n\n return $image;\n}",
"public function profile_pic() {\n\t\ttry {\n\t\t\t$sql = \"select image_src from profile_images where user_id = '\".$_SESSION['user_id'].\"'\";\n\t\t\t$res=$this->_dbh->query($sql);\n\t\t\t$value= $res->fetch();\t\n\t\t\tif($value==Null)\n\t\t\t{\n\t\t\t\t$value['image_src']=\"images/profile_pic.png\";\n\t\t\t\t\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t\t\n\t\t\telse{\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}\n\t\tcatch(PDOException $e) {\n\t\t\techo $e->getMessage();\n\t\t}\n\t}",
"function getProfileImageById(){\n return Image::find($this->profile_image_id);\n }",
"public function saveUserAvatar() {\n if ($this->avatar != null) {\n $picture = $this->avatar;\n $email = $this->email;\n if ($email == null) $email = $this->userId;\n $avatarFileName = time().\".png\";\n // $data = base64_decode(preg_replace('#^data:image/\\w+;base64,#i', '', $this->avatar));\n $data = str_replace('data:image/png;base64,', '', $picture);\n $data = str_replace(' ', '+', $data);\n $data = base64_decode($data);\n file_put_contents(\"../data/avatar/$avatarFileName\", $data);\n $this->avatar = \"/data/avatar/$avatarFileName\";\n }\n }",
"public function getProfileImage() : string\n {\n if ($this->profile_image === null) {\n return \"img/default_avatar.jpg\";\n } else {\n return \"img/profile/$this->profile_image\";\n }\n }",
"public function getEmplacementImg(){\n\t\treturn $this->userProfPicTmp;\n\t}"
] | [
"0.6749315",
"0.67001075",
"0.6696579",
"0.66909575",
"0.6604981",
"0.65937924",
"0.6581492",
"0.6578112",
"0.6566365",
"0.6538236",
"0.65340465",
"0.65275896",
"0.6522993",
"0.65177554",
"0.6488425",
"0.648065",
"0.6469055",
"0.6419188",
"0.6395785",
"0.6377906",
"0.63699883",
"0.63568115",
"0.6354827",
"0.63440704",
"0.63420546",
"0.63389915",
"0.6311281",
"0.63058853",
"0.6291515",
"0.62860566"
] | 0.7100499 | 0 |
Filters the array for either the even or odd items using the bitwise operator Some information on the bitwise operator: | private function _filter_array($array, $type)
{
$new_array = array();
foreach ($array as $key => $value) {
if ($type == "odd" AND ! ($key & 1)) {
$new_array[] = $value;
} else if ($type == "even" AND ($key & 1)) {
$new_array[] = $value;
}
}
return $new_array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function odd($arr)\n {\n // Pass the array to sell::mod() to get odd array items\n return (is_array($arr)) ? self::mod($arr, 2, '==') : false;\n }",
"public static function even($arr)\n {\n // Pass the array to sell::mod() to get even array items\n return (is_array($arr)) ? self::mod($arr, 2, '!=') : false;\n }",
"function even($var)\r\n{\r\n return !($var & 1);\r\n}",
"function odd($var)\r\n{\r\n return $var & 1;\r\n}",
"function Even($array) \n { \n // returns if the input integer is even \n if($array%2==null) \n return TRUE; \n else \n return FALSE; \n }",
"function odd($var) {\n\t return($var & 1);\n\t}",
"public function evenOdd()\n {\n return $this->unsetFlag(Flag::clip())->setFlag(Flag::clipEvenOdd());\n }",
"public function odd($var) {\n return($var & 1);\n }",
"function even($var) {\n\t return(!($var & 1));\n\t}",
"public static function even(array $array): array\n {\n return self::nth($array, 2);\n }",
"public static function odd(array $array): array\n {\n return self::nth($array, 2, 1);\n }",
"public function even($var) {\n return(!($var & 1));\n }",
"function is_even($num){\n\treturn (is_numeric($num)&(!($num&1)));\n}",
"function is_even($num){\n\treturn (is_numeric($num)&(!($num&1)));\n}",
"function is_even($num){\n\treturn (is_numeric($num)&(!($num&1)));\n}",
"function copyEven($array) {\n\t\t$tempArray = array();\n\t\t\n\t\tfor ($x = 0; $x < count($array); $x++) \n\t\t\tif (isEven($array[$x]))\n\t\t\t\t$tempArray[] = $array[$x];\n\t\t\n\t\treturn $tempArray;\n\t}",
"function perform_logic_OR ($array) {\n foreach ($array as $element) {\n if ($element === true) return true;\n }\n unset($element);\n \n return false;\n }",
"function is_odd($num){\n\treturn (is_numeric($num)&($num&1));\n}",
"function is_odd($num){\n\treturn (is_numeric($num)&($num&1));\n}",
"function is_odd($num){\n\treturn (is_numeric($num)&($num&1));\n}",
"public function testArrayFilterWithMultipleValues() {\n $original = ['foo', 0, '', 'bar', FALSE, 'baz', [], 'zip'];\n $expected = ['foo', 'bar', 'baz', 'zip'];\n $this->assertArrayEquals($expected, $this->plugin->tamper($original));\n }",
"function array_split_filter(array $array, callable $callback)\n {\n $passesFilter = array_filter($array, $callback);\n $negatedCallback = function ($item) use ($callback) {\n return !$callback($item);\n };\n $doesNotPassFilter = array_filter($array, $negatedCallback);\n return [$passesFilter, $doesNotPassFilter];\n }",
"function perform_logic_AND ($array) {\n foreach ($array as $element) {\n if ($element === false) return false;\n }\n unset($element);\n \n return true;\n }",
"function filter(...$args) {\n return sizeof($args) === 2\n ? call_user_func_array('array_filter', [$args[1], $args[0]])\n : function($arr) use ($args) { return call_user_func_array('array_filter', [$arr, $args[0]]); };\n}",
"public static function mod($arr, $mod = 2, $operator = '==')\n {\n // Vality check\n if (!is_int($mod)) {\n\n // Unexpected input\n return false;\n }\n\n // Validity check\n elseif (!is_array($arr)) {\n\n // Unexpected input\n return false;\n\n } elseif (!in_array($operator, ['==', '<', 'lt', '<=', 'le', '>', 'gt', '>=', 'ge', '==', 'eq', '!=', '<>', 'ne'])) {\n\n // Not a valid operator\n return false;\n }\n\n // Counter for iteration\n $iterator = 0;\n\n // Iterate over array\n foreach ($arr as $k => $v) {\n\n // Performe modulus math and comparison\n if (version_compare($iterator++ % $mod, 0, $operator)) {\n\n // Unset aby matches\n unset($arr[$k]);\n }\n }\n\n // Return the ammended array\n return $arr;\n }",
"function array_filter (array $input, callable $callback = \"\") {}",
"public function filter($closure = null, int $flag = \\ARRAY_FILTER_USE_BOTH);",
"static function isOdd($number){\r\n return $number & 1;\r\n }",
"function array_occursOdd($array) {\n $oddItems = array(); // holder for the values to be returned\n\n // loop through the given array and build the item list\n for( $i=0; $i<sizeof($array); $i++ ) {\n if(in_array($array[$i], $oddItems, true)===true) // found a duplicate\n $oddItems = array_diff($oddItems,array($array[$i])); // remove it (happens every even occurance)\n else // not found\n array_push($oddItems,$array[$i]); // add it (happens every odd occurance)\n }\n\n sort($oddItems); // order the array and clean it up so that the index begins with zero\n\n return $oddItems;\n}",
"public static function getFilterFieldOperators(): array;"
] | [
"0.6262576",
"0.6217451",
"0.6164631",
"0.60871345",
"0.6073887",
"0.6042826",
"0.5939067",
"0.5931938",
"0.59283733",
"0.57595485",
"0.5759171",
"0.57485664",
"0.5712134",
"0.5712134",
"0.5712134",
"0.5609148",
"0.5576312",
"0.5523527",
"0.5523527",
"0.5523527",
"0.55139273",
"0.5355209",
"0.52547354",
"0.5244457",
"0.5243644",
"0.51932365",
"0.5173737",
"0.5155728",
"0.5123493",
"0.5092208"
] | 0.6378847 | 0 |
Builds an array of variables to pass to parse_variables | private function _build_variable_array($items)
{
$new_array = array();
// Make sure the $items parameter is an array, if not then make it so
if ( ! is_array($items)) {
$items = array($items);
}
foreach ($items as $key => $value) {
$new_array[] = array(
'explode_value' => $value
);
}
return $new_array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_vars() {\n if ($this->debug & 4) {\n echo \"<p><b>get_vars:</b> constructing array of vars...</p>\\n\";\n }\n reset($this->varkeys);\n while(list($k, $v) = each($this->varkeys)) {\n $result[$k] = $this->get_var($k);\n }\n return $result;\n }",
"public function getVariables(): array\n {\n if (!is_null($this->content)) {\n preg_match_all('/{\\$(.+?)}/i', $this->content, $matches);\n if (isset($matches[1])) {\n return collect($matches[1])\n ->map(function ($item) {\n if (strpos($item, \"|\")) {\n return substr($item, 0, strpos($item, \"|\"));\n } else {\n return $item;\n }\n })\n ->all();\n }\n }\n\n return [];\n }",
"public function getVariables() {\n\t\t$attributes = $this->_attributes;\n\t\t$attributes['name'] = $this->_name;\n\t\t$attributes['type'] = 'text';\n\t\t\n\t\tif($this->_value) {\n\t\t\t$attributes['value'] = $this->_value;\n\t\t}\n\t\t\n\t\t$loaded = self::$_loaded;\n\t\tself::$_loaded = true;\n\t\t\n\t\treturn array(\n\t\t\t'loaded'\t\t=> $loaded,\n\t\t\t'attributes' \t=> $attributes);\n\t}",
"protected function build()\n\t{\n\t\t$output = '$this->getVar($context, array(';\n\t\t$count = count($this->variable);\n\n\t\t// scan each chunk\n\t\tforeach($this->variable as $key => $value)\n\t\t{\n\t\t\t$output .= \"'\" . $value . \"'\";\n\n\t\t\t// last key\n\t\t\t$output .= ($key < $count - 1) ? ', ' : ')';\n\t\t}\n\n\t\treturn $output . ')';\n\t}",
"function _convert($var) {\n if (is_array($var)) $var = array_shift($var);\n // creates php variable string\n $parts = '$this->variables';\n $value = $this->variables;\n foreach(explode('.', $var) as $i => $member) {\n // handles reserved variables names (see _applyfor)\n if ($member == '#' && $i==0) return '$k';\n elseif ($member == '#') $parts .= '[$k]';\n elseif (!$member && $i==0) return '$v';\n // adds component to php variable string\n else $parts .= \"['{$member}']\";\n }\n return $parts;\n }",
"public static function variables(): array\n {\n $conversions = (new KoomehProperty)->conversions()->implode(',');\n\n return [ \n Variable::make('id', __('Property Id')),\n\n Variable::make('name', __('Property Name')),\n\n Variable::make('code', __('Property Code')),\n\n Variable::make('url', __('Property URL')),\n\n Variable::make('images', __(\n \"Property gallery image list. available conversions is:[{$conversions}]\"\n )),\n\n Variable::make('hits', __('Property Hits')),\n\n Variable::make('propertyType.name', __('Property Type Name')),\n\n Variable::make('propertyType.icon', __('Property Type Icon')),\n\n Variable::make('propertyType.help', __('Property Type Help')),\n\n Variable::make('stateName', __('Property State Name')), \n\n Variable::make('cityName', __('Property City Name')), \n\n Variable::make('zoneName', __('Property Zone Name')), \n\n Variable::make('details', __(\n 'Property available amenities list. each amenity has a name, help, value, group and icon.'\n )), \n\n Variable::make('creation_date', __('Property Creation Date')),\n\n Variable::make('last_update', __('Property Update Date')), \n\n Variable::make('summary', __('Property Summary')), \n ];\n }",
"function getVariableDump() {\n\t\t$vars = array();\n\t\t$arrays = array();\n\t\tforeach ($this->trees as $tree) {\n\t\t\t$walker = new TreeWalker($tree);\n\t\t\t$walker->walk(TreeWalker::TRAVERSE_BF, function($node) use (&$vars) {\n\t\t\t\tif ($node->isLeaf() && !$node->isRoot()) {\n\t\t\t\t\t$var = $node->getParent()->getData();\n\t\t\t\t\t$val = $node->getData();\n\t\t\t\t\t\n\t\t\t\t\tif (is_numeric($var)) { // there's a better way to do this...\n\t\t\t\t\t\t$realVar = $node->getParent()->getParent()->getData();\n\t\t\t\t\t\tif (!isset($vars[$realVar])) {\n\t\t\t\t\t\t\t$vars[$realVar] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray_push($vars[$realVar], $val);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$vars[$var] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn $vars;\n\t}",
"function get_vars($txt)\n{\n\t$ret = array();\n\tpreg_match_all('/((?:(?:unsigned|struct)\\s+)?\\w+)(?:\\s*(\\*+)\\s+|\\s+(\\**))(\\w+(?:\\[\\s*\\w*\\s*\\])?)\\s*(?:(=)[^,;]+)?((?:\\s*,\\s*\\**\\s*\\w+(?:\\[\\s*\\w*\\s*\\])?\\s*(?:=[^,;]+)?)*)\\s*;/S', $txt, $m, PREG_SET_ORDER);\n\n\tforeach ($m as $x) {\n\t\t// the first parameter is special\n\t\tif (!in_array($x[1], array('else', 'endif', 'return'))) // hack to skip reserved words\n\t\t\t$ret[$x[4]] = array($x[1] . $x[2] . $x[3], $x[5]);\n\n\t\t// are there more vars?\n\t\tif ($x[6]) {\n\t\t\tpreg_match_all('/(\\**)\\s*(\\w+(?:\\[\\s*\\w*\\s*\\])?)\\s*(=?)/S', $x[6], $y, PREG_SET_ORDER);\n\t\t\tforeach ($y as $z) {\n\t\t\t\t$ret[$z[2]] = array($x[1] . $z[1], $z[3]);\n\t\t\t}\n\t\t}\n\t}\n\n//\tif ($GLOBALS['current_function'] == 'for_debugging') { print_r($m);print_r($ret); }\n\treturn $ret;\n}",
"public function getVariables() {\n\t\treturn array(\n\t\t\t'items'\t\t=> $this->_items,\n\t\t\t'options'\t=> $this->_options,\n\t\t\t'theme' \t=> $this->_theme);\n\t}",
"static function sub_vars($variables) {\n\t$resultado = [];\n\tforeach ($variables as $variable => $valor) {\n\t\tif (is_array($valor)) {\n\t\t\t$resultado[] = \"var $variable = JSON.parse('\".json_encode($valor).\"');\";\n\t\t} else {\n\t\t\t$resultado[] = \"var $variable = '$valor';\";\n\t\t}\n\t}\n\t$resultado = implode(\"\\n\",$resultado);\n\techo $resultado;\n}",
"public function getVariables(array $names): array;",
"function vars_language()\n\t{\n\t\tglobal $board_config, $lang;\n\n\t\t$array = array();\n\t\twhile ( list ( $key, $data ) = @each ( $lang['TPL'] ) )\n\t\t{\n\t\t\t$array['L_' . strtoupper($key)] = $data;\n\t\t}\n\n\t\treturn $array;\n\t}",
"function getVars() {\r\n\t\t\treturn array(\r\n\t\t\t\t'breadcrumb'\t\t=> $this->getBreadcrumb(),\r\n\t\t\t\t'html_head'\t\t\t=> $this->page->header,\r\n\t\t\t\t'navigation_0'\t=> $this->getNavigation(0),\r\n\t\t\t\t'navigation_10'\t=> $this->getNavigation(10),\r\n \t\t\t'navigation_1'\t=> $this->getNavigation(1),\r\n \t\t\t'navigation_12'\t=> $this->getNavigation(12),\r\n \t\t\t'navigation_2'\t=> $this->getNavigation(2),\r\n \t\t\t'p'\t\t\t\t\t\t\t=> $this->pageurl,\r\n\t\t\t\t'page_title'\t\t=> $this->htmlPrepare($this->page->title),\r\n\t\t\t\t'page_text'\t\t\t=> $this->htmlPrepare($this->page->text),\r\n\t\t\t\t'page_url'\t\t\t=> $this->htmlPrepare($this->am[0].'/'.$this->page->entry),\r\n 'page_id' => $this->pageid,\r\n\t\t\t\t'top_title'\t\t\t=> $this->htmlPrepare($this->top->title),\r\n\t\t\t\t'top_text'\t\t\t=> $this->htmlPrepare($this->top->text),\r\n\t\t\t\t'top_url'\t\t\t\t=> $this->htmlPrepare($this->am[0].'/'.$this->top->entry),\r\n\t\t\t\t'passthru'\t\t\t=> $this->getPassthru(),\r\n \t\t\t'root'\t\t\t\t\t=> $this->root,\r\n\t\t\t);\r\n\t\t}",
"private function initVars() {\n\t\t$this->from = UrlHelper::cleanUrl($this->from);\n\t\t$this->fullFrom = $this->from;\n\n\t\tpreg_match_all(self::VAR_MASK, $this->fullFrom, $matches);\n\n\t\t// Add vars\n\t\tforeach ($matches[1] as $name) {\n\t\t\t$this->vars[] = new Variable($name);\n\t\t}\n\t}",
"public function getVariables() {\n $sRet = \"// Variable declaration\\n\";\n $sRet .= \"public \\$$this->primarykey; // Primary Key\\n\";\n foreach($this->variables as $variable) {\n // Loop through variables and declare them.\n if($variable != $this->primarykey) {\n // Variable is not primary key, so we'll add it.\n $sRet .= \"public \\$$variable;\\n\";\n }\n }\n // Add variable for connection to database.\n $sRet .= \"public \\$database;\\n\\n\";\n\n return($sRet);\n }",
"public function getVars() {\n\t\t$dbFieldFunctions = $this->reflector->getDBFieldFunctions();\n\n\t\tif($this->vars != null) return $this->vars;\n\t\t\n\t\t$vars = array ();\n\t\t$counts = array ();\n\t\t$booleans = $this->getPossibleBooleans();\n\t\t$search = $this->getTopLevelContent();\n\t\t\n\t\tpreg_match_all(\"/\\\\$[A-Za-z0-9._]+/\", $search, $variables);\t\t\n\t\t\n\t\tif($variables || $booleans) {\n\t\t\tforeach(reset($variables) as $m) {\n\t\t\t\t$label = str_replace(\"$\",\"\", $m);\n\n\t\t\t\t// If using the dot syntax, this may be a has_one, or an invocation of a DBField method.\n\t\t\t\tif(stristr($label, \".\") !== false) {\n\t\t\t\t\tlist($relation, $name) = explode('.', $label);\n\t\t\t\t\t$name = preg_replace('/\\(.*\\)/','',$name);\n\t\t\t\t\t// The variable is a core template accessor. Move on.\n\t\t\t\t\tif(in_array(strtolower($relation), $this->reflector->getTemplateAccessors())) {\t\t\t\t\t\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// The method being called against the variable is a DBField function.\n\t\t\t\t\t// Use that information to assign a probable FieldType\t\t\t\t\t\n\t\t\t\t\t$methodName = strtolower($name);\n\t\t\t\t\tif(array_key_exists($methodName, $dbFieldFunctions)) {\n\t\t\t\t\t\t$class = $dbFieldFunctions[$methodName];\n\t\t\t\t\t\t$vars[$relation] = $dbFieldFunctions[$methodName];\n\t\t\t\t\t}\n\t\t\t\t\t// The variable name is the same as a ViewableData class. Chances are\n\t\t\t\t\t// this is a has_one to another class, e.g. $has_one = array ('File' => 'File');\n\t\t\t\t\telseif(is_subclass_of($relation, 'ViewableData')) {\n\t\t\t\t\t\t$vars[$relation] = $relation;\n\t\t\t\t\t}\n\t\t\t\t\t// This variable is using a dot syntax, and neither the variable nor the\n\t\t\t\t\t// method are known. It must be a user-defined has_one.\n\t\t\t\t\telse {\n\t\t\t\t\t\t$vars[$relation] = \"has_one\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(!isset($counts[$label])) $counts[$label] = 0;\n\t\t\t\t\t$counts[$label]++;\n\t\n\t\t\t\t\tif(!in_array($label, $vars) && !$this->getChildByName($label)) {\n\t\t\t\t\t\t// This is a <% with %> block, and it's not using a common template accessor,\n\t\t\t\t\t\t// e.g. $Up, so we can make a guess about the datatype of this variable.\n\t\t\t\t\t\tif(!$this->isLoop() && !in_array(strtolower($label), $this->reflector->getTemplateAccessors())) {\n\t\t\t\t\t\t\t$vars[$label] = $this->reflector->inferDatatype($label);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// This is a loop, and the variable is not something like $First, $Last, or $Pos.\n\t\t\t\t\t\telse if($this->isLoop() && !in_array(strtolower($label), $this->reflector->getListFunctions())) {\n\t\t\t\t\t\t\t$vars[$label] = $this->reflector->inferDatatype($label);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach($booleans as $b) {\n\t\t\tif(isset($counts[$b])) {\n\t\t\t\t$counts[$b]--;\n\t\t\t\tif($counts[$b] == 0) {\n\t\t\t\t\t$vars[$b] = 'Boolean';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->vars = $vars;\n\t}",
"function xVar($v) {\n if ($r = $this->x('(\\?|\\$)([^\\s]+)', $v)) {\n if ((list($sub_r, $sub_v) = $this->xVARNAME($r[2])) && $sub_r) {\n if (!in_array($sub_r, $this->r['vars'])) {\n $this->r['vars'][] = $sub_r;\n }\n return array(array('value' => $sub_r, 'type' => 'var'), $sub_v . $r[3]);\n }\n }\n return array(0, $v);\n }",
"public function getVariables();",
"public function frontend_variables_load($vars){\n \n return array_merge( $vars, array(\n \n\t\t) );\n \n }",
"public static function build($spintax) \r\n\t{\r\n\t\t$table = array();\r\n\r\n\t\t$variables = isset($spintax['vars']) ? $spintax['vars'] : $spintax;\r\n\t\tforeach ($variables as $key => $var) {\r\n\t\t\t$subitems = array();\r\n\r\n\t\t\tforeach ($var as $key_vr => $vr) {\r\n\t\t\t\tif (isset($vr['template'])) {\r\n\t\t\t\t\t$subitems[$key_vr] = self::build($vr);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$table[] = array(\r\n\t\t\t\t'item' => 1,\r\n\t\t\t\t'max' => sizeof($var),\r\n\t\t\t\t'subitems' => $subitems\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn $table;\r\n\t}",
"public function getArrayVariables()\n {\n $variables = array();\n foreach ($this->getIndicadorVariablesJoinVariable() as $variable)\n {\n $variables[$variable->getId()] = $variable->getVariable();\n }\n \n return $variables;\n }",
"public function parsingVariable($variable): array\n {\n $patternClassName = '(?<className>[a-zA-Z\\\\0-9_\\x7f-\\xff]*)';\n $patternName = '(?<name>\\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]+)';\n $patternDefault = '(?<default>[a-zA-Z0-9_\\x7f-\\xff\\(\\)\\[\\]\\.\\'\\:]*)';\n $patter = \"/{$patternClassName}[\\s]*{$patternName}[\\s\\=]*$patternDefault/um\";\n preg_match($patter, $variable, $match);\n\n return [\n 'class' => trim($match['className']),\n 'name' => trim($match['name']),\n 'default' => trim($match['default'])\n ];\n }",
"protected function variableDefinitions(): array\n {\n return [];\n }",
"private function extract_vars($content) {\n\t\t\n\t\tif(strpos($content, '{') === false) return array();\n\t\t// parse out the variables\n\t\tpreg_match_all(\n\t\t\t\"/{([\\w:|.\\,\\(\\)\\/\\-\\% \\[\\]\\?'=]+?)}/\", //regex\n\t\t\t$content, // source\n\t\t\t$matches_vars, // variable to export results to\n\t\t\tPREG_SET_ORDER // settings\n\t\t);\n\t\t\n\t\tforeach((array)$matches_vars as $var) {\n\t\t\t$vars[] = $var[1];\n\t\t}\n\t\t\n\t\treturn $vars;\n\t\t\n\t}",
"public function getVariables(): array\r\n {\r\n return $this->variables;\r\n }",
"public function getVariables(Array $pieces)\n {\n $pattern = '/(<\\bvariable:)(.*)(>)/';\n\n foreach ($pieces as $subject) {\n if(preg_match($pattern,$subject, $matches)){\n $variables[] = $matches[2];\n }\n }\n\n return $variables;\n }",
"private function getEscapedVariables() {\n // every string variable through htmlentities() recursively except those\n // marked 'noescape'.\n\n if (!$this->escaped) {\n self::escape_recursive($this->vars,$this->noescape);\n $this->escaped = true;\n }\n if (!self::$defaultEscaped) {\n self::escape_recursive(self::$defaultVars,self::$defaultNoescape);\n self::$defaultEscaped = true;\n }\n\n // Make list of variables to extract using local, default and parent\n // variable lists.\n\n $vars = $this->vars + self::$defaultVars;\n if (is_a($this->parent,'\\TCCL\\Templator\\TemplateGenerator')) {\n $vars += $this->parent->getEscapedVariables();\n }\n\n return $vars;\n }",
"public function processVars()\n\t{\n\t\t// Initialise params array.\n\t\t$params = array();\n\n\t\t// Iterate over the reserved parameters and look for them in the POST variables.\n\t\tforeach (Request::getReservedParameters() as $k)\n\t\t{\n\t\t\t$value = $this->input->get->getString('oauth_' . $k, false);\n\n\t\t\tif ($value)\n\t\t\t{\n\t\t\t\t$params['OAUTH_' . strtoupper($k)] = trim($value);\n\t\t\t}\n\t\t}\n\n\t\t// Make sure that any found oauth_signature is not included.\n\t\t// TODO: I think this should this be oauth_signature instead of signature (and probably uppercase?)\n\t\tunset($params['signature']);\n\n\t\t// Ensure the parameters are in order by key.\n\t\tksort($params);\n\n\t\treturn $params;\n\t}",
"public function getVariables()\n\t{\n\t\t$vars = array();\n\t\tforeach($this->fetchAll(\"SHOW VARIABLES\") as $row)\n\t\t{\n\t\t\t$vars[$row[\"Variable_name\"]] = $row[\"Value\"];\n\t\t}\n\t\treturn $vars;\n\t}",
"public function variables()\n {\n return [\n 'id' => $this->elementId,\n 'tools' => $this->tools->render(),\n 'items' => $this->getItems(),\n 'useCreate' => $this->useCreate,\n 'useRefresh' => $this->useRefresh,\n 'title' => $this->title,\n ];\n }"
] | [
"0.6715807",
"0.64255005",
"0.640714",
"0.6271264",
"0.62535554",
"0.62229186",
"0.61951935",
"0.61462224",
"0.6131782",
"0.6120415",
"0.60256565",
"0.6024132",
"0.6015232",
"0.597989",
"0.5952636",
"0.58944625",
"0.58935916",
"0.5891609",
"0.58726424",
"0.5864321",
"0.58470714",
"0.5821576",
"0.5791218",
"0.5762552",
"0.57540077",
"0.57539076",
"0.5746122",
"0.57389766",
"0.57295007",
"0.5727265"
] | 0.7360874 | 0 |
The related last Location | public function last_location()
{
return $this->belongsTo(Location::class, 'last_location_uuid', 'uuid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLastLocation()\n {\n $currentTrackTag = date('Ymd');\n $query =\n \"SELECT X(coord) AS lat, Y(coord) AS lng, ROUND((altitude * \" . Settings::METRE_TO_FEET . \")) AS altitude, ROUND((speed * \" . Settings::MPS_TO_MPH . \")) AS mph, heading\n FROM gpsdata\n WHERE datatime >= '\" . Settings::START_DATE . \"'\n ORDER BY datatime DESC\n LIMIT 1\";\n\n $result = $this->_dbConn->query($query);\n\n if ($this->_dbConn->errno) {\n error_log($this->_dbConn->errno . \": \" . $this->_dbConn->error);\n throw new Exception($this->_dbConn->error);\n }\n\n if ($result->num_rows === 0) {\n return false;\n }\n\n $returnObj = $result->fetch_object();\n $returnObj->todaysmiles = $this->getTagMiles($currentTrackTag);\n\n return $returnObj;\n }",
"public function getNewLocation()\n {\n return $this->properties['newLocation'];\n }",
"public function end_location()\n {\n return $this->hasOne('App\\Models\\Location', 'id', 'end_location_id');\n }",
"public function get_location()\n {\n return $this->location;\n }",
"public function getLocation() {\r\n\treturn $this->location;\r\n }",
"public function location()\n {\n return $this->hasOne('App\\Location')->where('created_at', '>', \\Carbon\\Carbon::now()->modify('15 minutes ago'))->orderBy('created_at', 'desc');\n }",
"public function getLocation(){\n\t\treturn $this->location;\n\t}",
"public function getLocation() {\r\n return $this->location;\r\n }",
"public function getEndLocation() {\n return $this->get(self::END_LOCATION);\n }",
"public function getEndLocation() {\n return $this->get(self::END_LOCATION);\n }",
"public function getLastWorld() {\n\t\treturn $this -> data['lastWorld'];\n\t}",
"public function getLocation() {\n\t\treturn $this->location;\n\t}",
"public function getLocation() {\n\t\treturn $this->location;\n\t}",
"public function getLocation() {\n\t\treturn $this->location;\n\t}",
"public function getLocation() {\n\t\treturn $this->location;\n\t}",
"public function getArriveLocation()\r\n {\r\n return $this->arriveLocation;\r\n }",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }"
] | [
"0.71183264",
"0.69151115",
"0.6807432",
"0.6678648",
"0.66753334",
"0.66301435",
"0.65890265",
"0.65623236",
"0.65591615",
"0.65591615",
"0.65522265",
"0.6497477",
"0.6497477",
"0.6497477",
"0.6497477",
"0.6464747",
"0.6449097",
"0.6449097",
"0.6422611",
"0.6422611",
"0.6422611",
"0.6422611",
"0.6422611",
"0.6422611",
"0.6422611",
"0.6422611",
"0.6422611",
"0.6422611",
"0.6422611",
"0.6422611"
] | 0.7251254 | 0 |
The related first Location. | public function first_location()
{
return $this->belongsTo(Location::class, 'first_location_uuid', 'uuid');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function location()\n {\n return $this->hasOne(Location::class);\n }",
"public function getLocation()\n {\n return $this->hasOne(Location::className(), ['location_id' => 'location_id']);\n }",
"public function location()\n {\n return $this->hasOne('App\\Location');\n }",
"public function getLocation() {\r\n\treturn $this->location;\r\n }",
"public function get_location()\n {\n return $this->location;\n }",
"public function getLocation() {\r\n return $this->location;\r\n }",
"public function start_location()\n {\n return $this->hasOne('App\\Models\\Location', 'id', 'start_location_id');\n }",
"public function getLocation() {\n\t\treturn $this->location;\n\t}",
"public function getLocation() {\n\t\treturn $this->location;\n\t}",
"public function getLocation() {\n\t\treturn $this->location;\n\t}",
"public function getLocation() {\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation(){\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n {\n return isset($this->location) ? $this->location : null;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }"
] | [
"0.6961811",
"0.6882219",
"0.68040425",
"0.6750947",
"0.67064327",
"0.6704952",
"0.6687049",
"0.6651542",
"0.6651542",
"0.6651542",
"0.6651542",
"0.66399807",
"0.66399807",
"0.6638497",
"0.6621104",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854",
"0.65938854"
] | 0.69539756 | 1 |
public function listPosts($account_id, $limit = 100) List posts | public function listPosts($account_id, $limit = 100)
{
$account = new Account;
$arr = $account->listPosts($account_id, $limit);
return (new Response($arr, 200))->header('Content-Type', 'json');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTwitterPosts($limit = 100)\n {\n\t\t$account = new Account;\n\t\t$accounts = $account->getHotAccount();\n\n\t\tif ($accounts) {\n\t\t\t$twitter = new Twitter;\n\t\t\t\n\t\t\tforeach ($accounts as $v) {\n\t\t\t\t$twitts = $twitter->getTwitterPosts($v->account_id, $v->screen_name, $limit);\n\t\t\t\t\t\t\t\n\t\t\t\t$account->insertTwitts($twitts, $v->account_id);\n\t\t\t}\n\t\t}\n\t}",
"function getPosts($offset=0, $limit=1000)\r\n\t{\r\n\t\t$ret = $this->objListPosts->getObjects($offset, $limit);\r\n\t\treturn $ret;\r\n\t}",
"public function get_entries($limit = 0) {\n\t\tglobal $DB, $CACHE;\n\n\t\t$records = $CACHE->get('blog_posts');\n\t\tif ($records === false) {\n\t $records = $DB->get_records_sql('\n\t \tSELECT\n\t \t\tbe.id, be.title, be.contents, be.updated, be.created,\n\t \t\tbe.userid as author_id, u.firstname as author_firstname, u.lastname as author_lastname\n\t \tFROM {posts} be\n\t \tINNER JOIN {users} u\n\t \t\tON u.id=be.userid\n\t \tORDER BY be.created DESC\n\t ');\n\t $CACHE->set('blog_posts', $records);\n\t\t}\n\n\t\tif ($limit > 0) {\n\t\t\treturn array_slice($records, 0, $limit);\n\t\t}\n\n\t\treturn $records;\n\t}",
"public function getPosts();",
"private static function getPosts()\n {\n $from = isset($_GET['from']) ? $_GET['from'] : 0;\n $to = isset($_GET['to']) ? $_GET['to'] : 30;\n $sql = \"SELECT * FROM posts ORDER BY id DESC LIMIT ?, ?\";\n\n DB::respond($sql, 'ii', [$from, $to]);\n }",
"public function getAllPosts($limit = 0)\n\t{\n\t\tif ($limit > 0) {\n\n\t\t\t// This will be used in the mySQL statement below\n\t\t\t$numposts = ' LIMIT ' . $limit;\n\t\t}\n\n\t\t$sql = 'SELECT pID, title, content, categoryID, date, uID\n\t\t\t\tFROM posts'/*\n\t\t\t\tLIMIT */ . $numposts;\n\n\t\t// perform query\n\t\t$results = $this->db->execute($sql);\n\t\t// d($results);\n\n\t\twhile ($row = $results->fetchrow()) {\n\t\t\t$posts[] = $row;\n\t\t}\n\n\t\tfor ($i=0; $i<=count($row); $i++) {\n\t\t\t$posts[$i]['date'] = date('F jS', strtotime($posts[$i]['date']));\n\t\t}\n\n\t\treturn $posts;\n\t}",
"public function getPosts($id, $limit = 999999) {\n\t\t$this->connect();\n\t\t$sql = file_get_contents(\"app/webroot/sql/get_posts.sql\");\n\t\t$sql .= \"\\nLIMIT \" . $limit;\n\t\t$params = array(\"id\" => $id);\n\t\t$result = $this->runSelectQuery($sql, $params);\n\t\t$this->disconnect();\n\t\t\n\t\treturn $result;\n\t}",
"public function listPosts()\n {\n $count = $this->postManager->countPost();\n $currentPage=$_GET['page'] ?? 1;\n if(!filter_var($currentPage, FILTER_VALIDATE_INT)){\n $this->msg='Numéro de page invalide';\n require('view/errorView.php');\n }\n if($currentPage <= 0) {\n $this->msg='Numéro de page invalide';\n require('view/errorView.php');\n }\n if($currentPage === '1'){\n header('Location: index.php?action=listPosts');\n }\n $perPage= 5;\n $start =$perPage*($currentPage-1);\n $pages = ceil($count /$perPage);\n if ($currentPage > $pages){\n $this->msg='Cette page n\\'existe pas';\n require('view/errorView.php');\n }\n $posts = $this->postManager->getPosts($start,$perPage);\n\n require('view/listPostsView.php');\n }",
"public function indexAllWithPosts()\n\t{\n\t\treturn AccountsResource::collection(Account::paginate\n\t\t($this->page_count));\n\t}",
"public function getAllPosts(){\n try{\n //Get and paginate all post saved in the database from the User object persistence\n $blogManager = new BlogManager();\n return $blogManager->getPaginatedPosts(3);\n return $posts;\n }catch(Exception $e){\n throw $e;\n }\n }",
"function get_page_posts($start=0,$pageId=0){\n\t\t$this->layout = \"\";\n\t\t$end = 10;\n\t\t$blogs = $this->Blog->find('all',array('conditions'=>array('Blog.status'=>1),'order' => 'Blog.created DESC','limit'=>\"$start,$end\"));\n\t\t$this->set(\"blogs\",$blogs);\n\t\t$this->render('/elements/blogs/blog_posts_listing');\n\t\t\t\t\n\t\t\n\t}",
"public function get_list(){\n $this->set_list(true);\n $initialfetch = (($this->page - 1) * $this->itemsforpage);\n $posts = $this->fetch(\"SELECT id, title, picture, category,url, meta date FROM posts ORDER BY id DESC LIMIT $initialfetch, $this->itemsforpage \");\n return $posts;\n }",
"public static function getAccountPosts($id)\n {\n $db = DB::getInstance();\n\n $sql = 'posts.*, accounts.nick_name, accounts.first_name, accounts.last_name, accounts.picture, accounts.gender\n FROM\n posts\n INNER JOIN\n accounts\n ON\n posts.account_id = accounts.id\n WHERE\n accounts.id = :account_id\n ORDER BY\n created_at DESC';\n\n $db->select($sql, [\n ':account_id' => $id\n ]);\n\n return $db->results();\n }",
"public function findAllPosts();",
"public function listAllPosts(): array;",
"public function getPosts($limit = 10) {\n\t\t$r = mysql_query(\"SELECT * FROM {$this->db_info['table']} ORDER BY created DESC LIMIT {$limit}\");\n\t\tif (!$r)\n\t\t\treturn array();\n\n\t\t$posts = array();\t\t\n\t\twhile ($post = mysql_fetch_assoc($r)) {\n\t\t\t$posts[] = $post;\n\t\t}\n\t\treturn $posts;\n\t}",
"public function getListPosts($limit, $offset)\n {\n try\n {\n $db = $this->dbConnect();\n $req = $db->prepare('SELECT id, IF(CHAR_LENGTH(title) > 50, CONCAT(LEFT(title, 50), \" ...\"), title) AS preview, lien_image, DATE_FORMAT(date_post, \"%d/%m/%Y\") AS creation_date_fr FROM posts ORDER BY `date_post` DESC LIMIT :limit OFFSET :offset');\n $req->bindValue(':limit', $limit, \\PDO::PARAM_INT);\n $req->bindValue(':offset', $offset, \\PDO::PARAM_INT);\n $req->execute();\n return $req;\n }\n catch(Exception $e)\n {\n die('Erreur : '.$e->getMessage());\n }\n }",
"function posts_all_paginated ($limit, $page = 1) {\n $total = posts_count();\n \n $pagination = pagination($total, $limit, $page);\n \n $posts = db_select('\n SELECT id, date, title, description \n FROM posts \n ORDER BY id DESC \n LIMIT ? \n OFFSET ?',\n array($pagination['limit'], $pagination['offset'])\n );\n \n return compact('posts', 'pagination');\n}",
"public function getAllPosts(array $fields = [], $limit = 15)\n\t{\n\t\t$provider = PostProvider::getInstance($this->client);\n\t\treturn $provider->getAll($fields, $limit);\n\t}",
"function all ($limit)\n{\n $db = connect();\n $sql = \"SELECT id, title, content, date_created\n FROM posts\n ORDER BY date_created DESC\n LIMIT :limitNum\";\n $query = $db->prepare($sql);\n $query->bindParam('limitNum', $limit, PDO::PARAM_INT);\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n}",
"public function it_can_list_paginated_set_of_posts()\n {\n $posts = factory(Post::class, 4)->create(['user_id' => $this->user->id]);\n\n $this->be($this->user, 'api')\n ->getJson('api/posts')\n ->assertStatus(200)\n ->assertJson([\n 'data' => $posts->only('id', 'title')->toArray(),\n 'meta' => [\n 'total' => 4\n ]\n ]);\n }",
"function getPosts(){\n }",
"private function getPosts($start, $count) {\n\t\t$posts = array();\n\t\t$post_ids = $this->redis->lrange(\"global:posts\", $start, $count);\n\t\tif (!empty($post_ids)) {\n\t\t\tforeach ($post_ids as $id) {\n\t\t\t\t$posts[] = $this->getPost($id);\n\t\t\t}\n\t\t}\n\t\treturn $posts;\n\t}",
"public function getPosts()\n {\n }",
"public function recent_posts($limit = 10)\n {\n $_model = $this->_name;\n $this->loadModel($_model);\n $recent_posts = $this->$_model->find('all', [\n 'conditions' => [\n $_model.'.status' => 3\n ],\n 'limit' => $limit,\n 'order' => ['created_at' => 'DESC']\n ]);\n $this->set('recent_posts', $recent_posts);\n }",
"public function post_list()\n\t{\n\n\t\t$manager = new \\Manager\\PostManager();\n\n\t\t$result = $manager->findAll();\n\n\t\t$this->show('forum/forum_admin', ['result' => $result]);\n\n\t}",
"public function listAction()\n {\n $postManager = $this->container->get('avro_blog.post_manager');\n\n $posts = $postManager->findAll();\n\n return array(\n 'posts' => $posts\n );\n }",
"public function listPosts($con) {\n $obj = $con->prepare($this->sqlPost);\n $obj->execute();\n return $obj;\n }",
"function ra_user_post_list($handle, $type, $limit){\n\t$userid = qa_handle_to_userid($handle);\n\trequire_once QA_INCLUDE_DIR.'qa-app-posts.php';\n\t$post = qa_db_query_sub('SELECT * FROM ^posts WHERE ^posts.type=$ and ^posts.userid=# ORDER BY ^posts.created DESC LIMIT #', $type, $userid, $limit);\t\n\t\n\t$output = '<ul class=\"question-list users-widget\">';\n\twhile($p = mysql_fetch_array($post)){\n\n\t\tif($type=='Q'){\n\t\t\t$what = _ra_lang('asked');\n\t\t}elseif($type=='A'){\n\t\t\t$what = _ra_lang('answered');\n\t\t}elseif('C'){\n\t\t\t$what = _ra_lang('commented');\n\t\t}\n\t\t\n\t\t$handle = qa_post_userid_to_handle($p['userid']);\n\n\t\t$output .= '<li id=\"q-list-'.$p['postid'].'\" class=\"question-item\">';\n\t\tif ($type=='Q'){\n\t\t\t$output .= '<div class=\"big-ans-count pull-left\">'.$p['acount'].'<span>'._ra_lang('Ans').'</span></div>';\n\t\t}elseif($type=='A'){\n\t\t\t$output .= '<div class=\"big-ans-count pull-left vote\">'.$p['netvotes'].'<span>'._ra_lang('Vote').'</span></div>';\n\t\t}\n\t\t$output .= '<div class=\"list-right\">';\n\n\t\tif($type=='Q'){\n\t\t\t$output .= '<h5><a href=\"'. qa_q_path_html($p['postid'], $p['title']) .'\" title=\"'. $p['title'] .'\">'.qa_html($p['title']).'</a></h5>';\n\t\t}elseif($type=='A'){\n\t\t\t$output .= '<h5><a href=\"'.ra_post_link($p['parentid']).'#a'.$p['postid'].'\">'. substr(strip_tags($p['content']), 0, 50).'</a></h5>';\n\t\t}else{\n\t\t\t$output .= '<h5><a href=\"'.ra_post_link($p['parentid']).'#c'.$p['postid'].'\">'. substr(strip_tags($p['content']), 0, 50).'</a></h5>';\n\t\t}\n\t\t\n\t\t$output .= '<div class=\"list-date\"><span class=\"icon-calendar-2\">'.date('d M Y', strtotime($p['created'])).'</span>';\t\n\t\t$output .= '<span class=\"icon-chevron-up\">'.$p['netvotes'].' '._ra_lang('votes').'</span></div>';\t\n\t\t$output .= '</div>';\t\n\t\t$output .= '</li>';\n\t}\n\t$output .= '</ul>';\n\techo $output;\n}",
"public static function getWallPosts()\n {\n $db = DB::getInstance();\n\n # the most absurd query I've ever made\n $sql = 'posts.*, accounts.first_name, accounts.last_name, accounts.nick_name, accounts.picture, accounts.gender\n FROM posts\n\n -- me and my friends IDs\n INNER JOIN (\n -- my frinds when i am the one who received the friend request\n SELECT requests.send_id AS friend\n FROM requests\n WHERE\n requests.status = 2\n AND\n requests.received_id = :me1\n UNION\n -- my frinds when i am the one who sent the friend request\n SELECT requests.received_id AS friend\n FROM requests\n WHERE\n requests.status = 2\n AND\n requests.send_id = :me2\n UNION\n -- me\n SELECT :me3\n\n ) AS t1\n ON t1.friend = posts.account_id\n -- /me and my friends IDs\n\n INNER JOIN accounts\n ON posts.account_id = accounts.id\n ORDER BY created_at DESC';\n\n\n $db->select($sql, [\n 'me1' => $_SESSION['user'],\n 'me2' => $_SESSION['user'],\n 'me3' => $_SESSION['user']\n ]);\n\n return $db->results();\n }"
] | [
"0.70773685",
"0.7045826",
"0.697073",
"0.6781235",
"0.67398983",
"0.6676233",
"0.6672174",
"0.6663921",
"0.66266894",
"0.6612464",
"0.6611146",
"0.65999216",
"0.6592955",
"0.65608037",
"0.6541772",
"0.65392613",
"0.6506195",
"0.6442394",
"0.64403814",
"0.6423972",
"0.6422304",
"0.6404026",
"0.6334806",
"0.631181",
"0.62956625",
"0.6253126",
"0.62354785",
"0.6213382",
"0.6141025",
"0.61152023"
] | 0.8669548 | 0 |
public function getTwitterPosts($limit = 100) Get twitter posts | public function getTwitterPosts($limit = 100)
{
$account = new Account;
$accounts = $account->getHotAccount();
if ($accounts) {
$twitter = new Twitter;
foreach ($accounts as $v) {
$twitts = $twitter->getTwitterPosts($v->account_id, $v->screen_name, $limit);
$account->insertTwitts($twitts, $v->account_id);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function eclat_shortcode_get_tweets_posts( $oauth_access_token, $oauth_access_token_secret, $consumer_key, $consumer_secret, $limit)\n {\n $url = \"https://api.twitter.com/1.1/statuses/user_timeline.json\";\n\n $oauth = array( 'oauth_consumer_key' => $consumer_key,\n 'oauth_nonce' => time(),\n 'oauth_signature_method' => 'HMAC-SHA1',\n 'oauth_token' => $oauth_access_token,\n 'oauth_timestamp' => time(),\n 'count' => $limit,\n 'oauth_version' => '1.0');\n\n $base_info = eclat_shortcode_buildBaseString($url, 'GET', $oauth);\n $composite_key = rawurlencode($consumer_secret) . '&' . rawurlencode($oauth_access_token_secret);\n $oauth_signature = base64_encode(hash_hmac('sha1', $base_info, $composite_key, true));\n $oauth['oauth_signature'] = $oauth_signature;\n\n $header = array(eclat_shortcode_buildAuthorizationHeader($oauth), 'Expect:');\n\n $oauth['User-Agent'] = $_SERVER['HTTP_USER_AGENT'];\n\n $options = array( CURLOPT_HTTPHEADER => $header,\n CURLOPT_HEADER => false,\n CURLOPT_URL => $url . '?count='.$limit,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => false);\n\n $feed = curl_init();\n\n curl_setopt_array($feed, $options);\n $json = curl_exec($feed);\n curl_close($feed);\n\n /*if( !class_exists( 'WP_Http_Curl' ) ) {\n include_once( ABSPATH . WPINC. '/class-wp-http-curl.php' );\n }\n $wp_http_curl = new WP_Http_Curl;\n $args = array ('headers' => $oauth);\n\n $json = $wp_http_curl->request( $url . '?count='.$limit , $args );*/\n\n return json_decode($json);\n }",
"public function getTwitterPosts(){\n\n $url = 'https://api.twitter.com/1.1/statuses/user_timeline.json';\n $requestMethod = 'GET';\n\n /** Perform a POST request and echo the response **/\n $settings = array(\n 'oauth_access_token' => \"3274216560-uDATfRyhJTQHbyrbcJh33Ha1jtNB8WEoi4Kp7HY\",\n 'oauth_access_token_secret' => \"wdUfaxH2HOhj33miixuueq4LxVBy0tdtXBXbIV41L3lrL\",\n 'consumer_key' => \"mgZVj3yzHpLoLt11Ed1VC7SqV\",\n 'consumer_secret' => \"f5FbRKEgxMvx4K7R8VyyU6tG9IGrHcGx9Joqsb3Rp4bi6BZPAv\"\n );\n\n $this->setCredentials($settings);\n $data = '?count=6&exclude_replies=true';\n\n $tweets = $this->setGetfield($data)\n ->buildOauth($url, $requestMethod)\n ->performRequest();\n\n $tweets = json_decode($tweets);\n $tweetCollection = '';\n foreach($tweets as $i=>$t){\n if(isset($t->text)){\n $tweetCollection[$i]['text'] = $t->text;\n }\n $tweetCollection[$i]['media_url']='';\n if(isset($t->entities->media)){\n $tweetCollection[$i]['media_url'] = $t->entities->media[0]->media_url;\n }\n else{\n //$tweetCollection['media_url'] = $t->entities->media[0]->media_url;\n }\n $tweetCollection[$i]['post_url']='';\n if(isset($t->entities->media)){\n $tweetCollection[$i]['post_url'] = $t->entities->media[0]->expanded_url;\n }\n\n if(isset($t->user->name)){\n $tweetCollection[$i]['user_name'] = $t->user->name;\n }\n\n if(isset($t->created_at)){\n $createdAt = $this->time_elapsed_string($t->created_at);\n $tweetCollection[$i]['created_at'] = $createdAt;\n }\n }\n return $tweetCollection;\n }",
"public function getPosts(){\n\t\t\t$options = array(\n\t\t\t\t\t'user_id' => $this->_userID,\n\t\t\t\t\t'screen_name' => $this->_userName,\n\t\t\t\t\t'count' => 50,\n\t\t\t\t\t'exclude_replies' => true,\n\t\t\t\t\t'trim_user' => $this->_trim\n\t\t\t);\n\t\t\t$url = parent::_getUrl(self::API_URI, $options);\n\t\t\t$connection = $this->_getConnectionWithAccessToken($this->_consumerKey, $this->_consumerSecret, $this->_accessToken, $this->_accessTokenSecret);\n\t\t\t$tweets = $connection->get($url);\n \t\treturn $this->_loop($tweets, $this->_userName);\n\t\t}",
"function yumc_get_twitter_posts( $num_posts = 50 ) {\n\t$oauth_hash = 'oauth_consumer_key=' . TWITTER_API_KEY . '&';\n\t$oauth_hash .= 'oauth_nonce=' . time() . '&';\n\t$oauth_hash .= 'oauth_signature_method=HMAC-SHA1&';\n\t$oauth_hash .= 'oauth_timestamp=' . time() . '&';\n\t$oauth_hash .= 'oauth_token=' . TWITTER_ACCESS_TOKEN . '&';\n\t$oauth_hash .= 'oauth_version=1.0';\n\t$base = 'GET';\n\t$base .= '&';\n\t$base .= rawurlencode( 'https://api.twitter.com/1.1/statuses/user_timeline.json' );\n\t$base .= '&';\n\t$base .= rawurlencode( $oauth_hash );\n\t$key = '';\n\t$key .= rawurlencode( TWITTER_API_SECRET );\n\t$key .= '&';\n\t$key .= rawurlencode( TWITTER_ACCESS_SECRET );\n\t$signature = base64_encode( hash_hmac( 'sha1', $base, $key, true ) );\n\t$signature = rawurlencode($signature);\n\n\t$oauth_header = '';\n\t$oauth_header .= 'oauth_consumer_key=\"' . TWITTER_API_KEY . '\", ';\n\t$oauth_header .= 'oauth_nonce=\"' . time() . '\", ';\n\t$oauth_header .= 'oauth_signature=\"' . $signature . '\", ';\n\t$oauth_header .= 'oauth_signature_method=\"HMAC-SHA1\", ';\n\t$oauth_header .= 'oauth_timestamp=\"' . time() . '\", ';\n\t$oauth_header .= 'oauth_token=\"' . TWITTER_ACCESS_TOKEN . '\", ';\n\t$oauth_header .= 'oauth_version=\"1.0\", ';\n\t$curl_header = array( \"Authorization: Oauth {$oauth_header}\", 'Expect:' );\n\n\t$curl_request = curl_init();\n\tcurl_setopt( $curl_request, CURLOPT_HTTPHEADER, $curl_header );\n\tcurl_setopt( $curl_request, CURLOPT_HEADER, false );\n\tcurl_setopt( $curl_request, CURLOPT_URL, 'https://api.twitter.com/1.1/statuses/user_timeline.json' );\n\tcurl_setopt( $curl_request, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl_request, CURLOPT_SSL_VERIFYPEER, false );\n\t$json = curl_exec( $curl_request );\n\tcurl_close( $curl_request );\n\n\treturn array_slice( json_decode($json, true), 0, $num_posts );\n}",
"public function tweets($limit = null) {\n return new TwitterReader($limit);\n }",
"function publicFeed($id, $limit=10) {\n \n if(!$this->isReady()) {\n $this->error(\"publicFeed() - object not ready.\");\n return false;\n }\n \n $id = trim($id);\n $limit = trim($limit);\n \n if(empty($id)) {\n $this->error(\"publicFeed() - no user id provided.\");\n return false;\n }\n \n if(empty($limit)||(!is_numeric($limit))) {\n $this->error(\"publicFeed() - limit is empty or not a number.\");\n return false;\n }\n \n /* build up the request URL */\n \n $args = array(\n 'q' => \"from:$id\",\n 'result_type' => 'recent',\n 'count' => $limit\n );\n \n $result = $this->doRequest(\"1.1/search/tweets.json\", \"GET\", $args);\n \n if($result === false) {\n $this->error(\"publicFeed() - can't do request: \".$this->getError());\n return false;\n }\n \n if(!isset($result->statuses)) {\n $this->error(\"publicFeed() - can't find 'statuses'\");\n return false;\n }\n \n $feed = array();\n \n foreach($result->statuses as $idx => $item) {\n \n $id = $item->id_str;\n $author = \"\";\n $authorId = \"\";\n $authorLink = \"\";\n $authorPicture = \"\";\n $text = \"\";\n $picture = \"\";\n $pictureLink = \"\";\n $link = \"https://twitter.com/TalizeThrift/status/$id\";\n $type = \"\";\n $modified = \"\";\n $retweets = 0;\n \n /* fetch whatever data we have */\n \n if(isset($item->metadata->result_type)) {\n $type = $item->metadata->result_type;\n }\n \n if(isset($item->created_at)) {\n $modified = $this->timeAgo($item->created_at);\n }\n \n if(isset($item->user)) {\n \n $authorId = $item->user->id;\n $author = $item->user->screen_name;\n $authorLink = \"https://twitter.com/$author\";\n \n if(isset($item->user->profile_image_url_https)) {\n $authorPicture = $item->user->profile_image_url_https;\n }\n \n }\n \n if(isset($item->retweet_count)) {\n $retweets = $item->retweet_count;\n }\n \n if(isset($item->text)) {\n $text = $item->text;\n } \n if(isset($item->entities->media) && (count($item->entities->media)>0)) {\n \n $pic = $item->entities->media[0];\n \n if(isset($pic->media_url)) {\n $picture = $pic->media_url;\n $pictureLink = $pic->url; \n }\n }\n \n /* format a posting object */\n \n $status = (object)array(\n \"id\" => $id,\n \"permlink\" => $link,\n \"author\" => $author,\n \"authorlink\" => $authorLink,\n \"authorpicture\" => $authorPicture, \n \"text\" => $text,\n \"picture\" => $picture,\n \"pictureLink\" => $pictureLink,\n \"type\" => $type,\n \"modified\" => $modified,\n \"retweets\" => $retweets\n );\n \n $feed[] = $status;\n }\n \n return $feed;\n }",
"public function getUserFeed($limit = 0);",
"function getPosts($offset=0, $limit=1000)\r\n\t{\r\n\t\t$ret = $this->objListPosts->getObjects($offset, $limit);\r\n\t\treturn $ret;\r\n\t}",
"function get_tweets() {\n $input = $this->validate_get_tweets();\n $res = $this->TweetModel->get_tweets();\n if ($res) {\n foreach ($res as $r) {\n $data[] = array(\n 'post_detail' => array(\n 'id' => $r['id'],\n 'post' => $r['post'],\n 'tag' => $this->TweetModel->get_array_tag(explode(',', $r['tag'])),\n 'photo' => $this->check_image($r['photo']), //$r['photo'],\n 'likes' => $this->TweetModel->count_post_like($r['id']),\n 'comments' => $this->TweetModel->count_post_comment($r['id']),\n 'created_date' => $r['created_date'],\n 'update_date' => $r['update_date'],\n 'is_liked' => $this->check_like_by_user($input['user_id'], $r['id'])\n ),\n 'user_detail' => $this->TweetModel->get_user_short_data($r['user_id'])\n );\n }\n\n if ($data) {\n return_data(true, 'Successfully! Found All Tweets.', $data);\n }\n }\n return_data(false, 'No tweet found.', array());\n }",
"public function getPosts($limit = 10) {\n\t\t$r = mysql_query(\"SELECT * FROM {$this->db_info['table']} ORDER BY created DESC LIMIT {$limit}\");\n\t\tif (!$r)\n\t\t\treturn array();\n\n\t\t$posts = array();\t\t\n\t\twhile ($post = mysql_fetch_assoc($r)) {\n\t\t\t$posts[] = $post;\n\t\t}\n\t\treturn $posts;\n\t}",
"public function get_entries($limit = 0) {\n\t\tglobal $DB, $CACHE;\n\n\t\t$records = $CACHE->get('blog_posts');\n\t\tif ($records === false) {\n\t $records = $DB->get_records_sql('\n\t \tSELECT\n\t \t\tbe.id, be.title, be.contents, be.updated, be.created,\n\t \t\tbe.userid as author_id, u.firstname as author_firstname, u.lastname as author_lastname\n\t \tFROM {posts} be\n\t \tINNER JOIN {users} u\n\t \t\tON u.id=be.userid\n\t \tORDER BY be.created DESC\n\t ');\n\t $CACHE->set('blog_posts', $records);\n\t\t}\n\n\t\tif ($limit > 0) {\n\t\t\treturn array_slice($records, 0, $limit);\n\t\t}\n\n\t\treturn $records;\n\t}",
"public function listPosts($account_id, $limit = 100)\n {\n\t\t$account = new Account;\n\t\t$arr = $account->listPosts($account_id, $limit);\n\n\t\treturn (new Response($arr, 200))->header('Content-Type', 'json');\n\t}",
"public function getSomePosts($limit)\n {\n $rows = $this->createQueryBuilder()\n ->select('t.*')\n ->from($this->getTableName(), 't')\n ->andWhere('t.published = 1')\n ->orderBy('t.created_at', 'desc')\n ->setMaxResults($limit)\n ->execute()\n ->fetchAll($this->getFetchMode());\n\n // avoiding an exception here..\n if ($rows === false) { return false; }\n\n return $this->rowsToEntities($rows);\n }",
"function get_tweets($handle) {\r\n\t\tglobal $n_search;\r\n\t\t$requests = array();\r\n\t\tfor ($i = 1; $i <= $n_search; $i++) {\r\n\t\t\tarray_push($requests, \"http://search.twitter.com/search.json?rpp=100&include_entities=true&q=\" . $handle . \"&page=\" . $i);\r\n\t\t}\r\n\t\t$results = multi_request($requests);\r\n\t\t\r\n\t\t$tweets = array();\r\n\t\tforeach ($results as $result) {\r\n\t\t\t$data = json_decode($result, true);\r\n\t\t\t$tweets = array_merge($tweets, $data[\"results\"]);\r\n\t\t}\r\n\t\treturn $tweets;\r\n\t}",
"protected function getTumblrApiTaggedPosts($tag, $limit = 100){\n \n //Get shared tumblr api connection\n $tumblr = Tumblrinstance::getTumblrApiConnection();\n \n //Set default options\n $options = array(\n 'limit' => 20\n );\n \n $posts = [];\n $timeout = 0;\n do {\n \n //Set before option to timestamp of last result array object if result exists.\n if (isset($result) && count($result) > 0){\n $lastResultObject = end($result);\n $options['before'] = $lastResultObject->timestamp;\n }\n \n $result = $tumblr->getTaggedPosts($tag, $options);\n $posts = array_merge($posts, $result);\n \n $timeout++;\n } while (count($posts) < $limit && $result && $timeout <= 5);\n \n return $posts;\n \n }",
"function yumc_get_facebook_posts( $num_posts = 50 ) {\n\t$fb_posts_json = file_get_contents(\"https://graph.facebook.com/ClimbingYork/posts?access_token=\" . FB_ACCESS_TOKEN);\n\t$posts_obj = json_decode($fb_posts_json, true)[\"data\"];\n\t$filtered_posts_obj = array();\n\t$count = 0;\n\tforeach($posts_obj as $post) {\n\t\tif($post[\"message\"] != null && $count < $num_posts) {\n\t\t\t$filtered_posts_obj[] = $post;\n\t\t\t$count++;\n\t\t}\n\n\t\tif($count >= $num_posts)\n\t\t\tbreak;\n\t}\n\treturn $filtered_posts_obj;\n}",
"public function getFeed($limit) {\n $order = ['post_created_at' => SORT_DESC];\n return $this->hasMany(Feed::class, ['user_id' => 'id'])->orderBy($order)->limit($limit)->all();\n }",
"function getFeeds($limit) {\n return array_slice($this->feeds,0,$limit);\n }",
"function get_tweets( $count = 8 ) {\t\n\t$url = \"https://api.twitter.com/1.1/statuses/user_timeline.json\";\n\t\n\t// Set our super secret stuff\n\t$oauth_access_token = \"***************oursecretstuff!***************\";\n\t$oauth_access_token_secret = \"***************oursupersecretstuff!***************\";\n\t$consumer_key = \"***************dontevenaskitssosecret!***************\";\n\t$consumer_secret = \"***************afourthsecretauthenticationkey***************\";\n\t\n\t//set our oauth parameters\n\t$oauth_array = array( \n\t\t\t'count' => $count,\n\t\t\t'oauth_consumer_key' => $consumer_key,\n\t\t\t'oauth_nonce' => time(),\n\t\t\t'oauth_signature_method' => 'HMAC-SHA1',\n\t\t\t'oauth_token' => $oauth_access_token,\n\t\t\t'oauth_timestamp' => time(),\n\t\t\t'oauth_version' => '1.0');\n\t\n\t$base_info = build_base_string($url, 'GET', $oauth);\n\t$composite_key = rawurlencode($consumer_secret) . '&' . rawurlencode($oauth_access_token_secret);\n\t$oauth_signature = base64_encode(hash_hmac('sha1', $base_info, $composite_key, true));\n\t$oauth_array['oauth_signature'] = $oauth_signature;\n\t\n\t// build the authorization header\n\t$header = array( build_oauth_header($oauth_array), 'Expect:' );\n\t// set our curl options\n\t$ch_options = array(\n\t\t\tCURLOPT_HTTPHEADER => $header,\n\t\t\tCURLOPT_HEADER => false,\n\t\t\tCURLOPT_URL => $url . '?count='.$count,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_SSL_VERIFYPEER => false);\n\t//initialize curl\n\t$ch = curl_init();\n\t//set our curl options\n\tcurl_setopt_array($ch, ch_options);\n\t//execute curl\n\t$json = curl_exec($ch);\n\t//close curl\n\tcurl_close($ch);\n\t//decode the json object\n\t$data = json_decode($json);\n\t//return our twitter data!\n\treturn $data;\n}",
"public function get_top_posters($limit)\n {\n return $this->connection->query('SELECT * FROM ' . $this->connection->get_table_prefix() . 'members WHERE ID_MEMBER<>' . strval($this->get_guest_id()) . ' ORDER BY posts DESC', $limit);\n }",
"function twitter_fetch($screenname, $count=4, $auth=null) {\n if(!$auth) {\n $auth = array();\n $auth['customer_key'] = '0ENssb9IzMkc7kEgsKVnUwk8R';;\n $auth['customer_secret'] = 'v2OP4BZHiLbeYcyYXPfKeJDWbZNdwi9Ylo5yOacQw6qzJXoN65';\n $auth['access_token'] = '16577414-ZYAz9rIizSJP5x6EXNmY7nzm9Q2pRmyaW8gsJLLvD';\n $auth['access_token_secret'] = '584uUKUGxpVdpBbWQ1UB9ofa7p7fpNuKTxUOHLNaPt46b'; \n }\n\n $twitter_customer_key = $auth['customer_key'];\n $twitter_customer_secret = $auth['customer_secret'];\n $twitter_access_token = $auth['access_token'];\n $twitter_access_token_secret = $auth['access_token_secret'];\n \n $connection = new TwitterOAuth($twitter_customer_key, $twitter_customer_secret, $twitter_access_token, $twitter_access_token_secret);\n \n $my_tweets = $connection->get('statuses/user_timeline', array('screen_name' => $screenname, 'count' => $count));\n \n if(isset($my_tweets->errors)) { \n echo 'Error :'. $my_tweets->errors[0]->code. ' - '. $my_tweets->errors[0]->message;\n } else {\n foreach($my_tweets as &$tweet) {\n $tweet->text = twitter_format_link($tweet->text);\n }\n }\n return $my_tweets; \n}",
"public function getUserFeed($limit = 0) {\n return $this->_makeCall('users/self/feed', true, array('count' => $limit));\n }",
"public function getPosts();",
"private static function getPosts()\n {\n $from = isset($_GET['from']) ? $_GET['from'] : 0;\n $to = isset($_GET['to']) ? $_GET['to'] : 30;\n $sql = \"SELECT * FROM posts ORDER BY id DESC LIMIT ?, ?\";\n\n DB::respond($sql, 'ii', [$from, $to]);\n }",
"function simplePublicFeed($id, $limit=10) {\n \n /* fetch the raw feed */\n \n $data = $this->publicFeed($id,$limit);\n \n if($data === false) {\n $this->error(\"simplePublicFeed() - can't fetch publicFeed(): \".$this->getError());\n return false;\n }\n \n /*\n * walk through the posting list, and for each one \n * figure out more usable data...\n * \n */\n \n $output = array();\n \n foreach($data as $idx => $item) {\n \n $id = $item->id;\n $author = $item->author;\n $authorLink = $item->authorlink;\n $authorPicture = $item->authorpicture;\n $text = $item->text;\n $picture = $item->picture;\n $pictureLink = $item->pictureLink;\n $link = $item->permlink;\n $type = $item->type;\n $modified = $item->modified;\n $retweets = $item->retweets;\n \n $post = (object)array(\n \"id\" => $id,\n \"permlink\" => $link,\n \"author\" => $author,\n \"authorlink\" => $authorLink,\n \"authorpicture\" => $authorPicture, \n \"text\" => $text,\n \"picture\" => $picture,\n \"pictureLink\" => $pictureLink,\n \"type\" => $type,\n \"modified\" => $modified,\n \"retweets\" => $retweets\n );\n \n $output[] = $post;\n }\n \n /* pass it back */\n \n return $output;\n }",
"function pull_tweets($count = 5, $user_id = \"351181505\")\n\t{\n\t\treturn $this->client->get('statuses/user_timeline', array(\n\t\t\t'user_id' => $user_id, \n\t\t\t'count' => $count,\n\t\t\t'exclude_replies' => TRUE,\n\t\t\t'include_rts' => FALSE\n\t\t));\n\t}",
"function getTweets()\n\t{\n\t\tif(!empty($this->params['url']['id']) && !empty($this->params['url']['bandid']))\n\t\t{\n\t\t\t\n\t\t\t$user_id = $this->params['url']['id'];\n\t\t\t$mmm_id = $this->Session->read('id');\n\t\t\t$band_id = $this->params['url']['bandid'];\n\t\t\tif(!empty($this->params['url']['count']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$twttweetscount = $this->params['url']['count'];\n\t\t\t\t$this->Session->write('twttweetscount',$twttweetscount);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($this->Session->check('twttweetscount'))\n\t\t\t\t{\n\t\t\t\t\t$twttweetscount = $this->Session->read('twttweetscount')+10;\n\t\t\t\t\t$this->Session->write('twttweetscount',$twttweetscount);\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$twttweetscount = 10;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$flag=1;\n\t\t\t$newTweetsCount =0;\n\t\t\t\n\t\t\t$result = $this->Twtuser->find(array('user_id'=>$user_id , 'band_id'=>$band_id,'mmm_id'=>$mmm_id,'active'=>1));\n\t\t\tif($result)\n\t\t\t{\n\t\t\t\t$twitterResult = $this->Twitter->find(array('user_id'=> $user_id));\n\t\t\t\tif($twitterResult)\n\t\t\t\t{\n\t\t\t\t\t$TweetsTime = $twitterResult['Twitter']['refresh_time'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tweetsResultCount = $this->Twtstatus->findAll(array('user_id'=>$user_id), null , 'created_at desc' , 100 , null );\n\t\t\t\tforeach($tweetsResultCount as $twtkey => $twtval)\n\t\t\t\t{\n\t\t\t\t\t$cdate\t= $twtval['Twtstatus']['created_at'];\n\t\t\t\t\tif($cdate > $TweetsTime)\n\t\t\t\t\t{\n\t\t\t\t\t\t$newTweetsCount ++ ;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t//\t$twitterResult = $this->Twtstatus->findAll(array('user_id'=>$user_id), null , 'created_at desc' , $twttweetscount , null );\n\t\t\t\t$tweetsCount = $this->Twtstatus->find(array('user_id'=>$user_id),array('count(*) as count'));\n\t\t\t\t\n\t\t\t\tif(($twttweetscount>=$tweetsCount[0]['count']) or ($twttweetscount>=100))\n\t\t\t\t{\n\t\t\t\t\t$flag=0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($twitterResult)\n\t\t\t\t{\n\t\t\t\t\t$count=0;\n\t\t\t\t\t\t$data =\"[\";\n\t\t\t\t\t\tforeach($tweetsResultCount as $tkey => $tval)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($tkey < $twttweetscount)\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\t$message = stripslashes($tval['Twtstatus']['text']);\n\t\t\t\t\t\t\t\t$message = ereg_replace ( \"(http://[^' ']+)\", \"<a class=graylink href=\\\\1 target=_blank> \\\\1</a>\", $message);\n\t\t\t\t\t\t\t\t$message = ereg_replace ( \"(@[^' ']+)\", \"<a class=graylink href=http://twitter.com/\\\\1 target=_blank> \\\\1</a>\",$message );\n\t\t\t\t\t\t\t\t$message = ereg_replace ( \"(#[^' ']+)\", \"<a class=graylink href=http://twitter.com/search?q=\\\\1 target=_blank> \\\\1</a>\", $message);\n\t\t\t\t\t\t\t\t$message= str_replace(array(\"http://twitter.com/@\",\"http://twitter.com/search?q=#\"),array(\"http://twitter.com/\",\"http://twitter.com/search?q=\"),$message);\n\t\t\t\t\t\t\t\t$message= trim(str_replace(array(\"\\n\",\"\\r\",\"'\"),array(\"\",\"\",\"\"),$message));\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$name\t= trim(stripslashes($tval['Twtstatus']['twt_screen_name']));\n\t\t\t\t\t\t\t\t// if($name)\n\t\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t// $name = \"<a href=http://twitter.com/$name target=_blank> $name </a>\";\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$cdate\t= $tval['Twtstatus']['created_at'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$create_at = date('g:i a F jS',$cdate);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$create_at = stripslashes($create_at);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data.=\"{ optionText:'$message' , optionDate:'$create_at', optionName : '$name' , optionFlag: $flag , optionCount : $newTweetsCount },\";\n\t\t\t\t\t\t\t\t$count ++;\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}\n\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$data= substr($data,0,strlen($data)-1);\n\t\t\t\t\t\t$data.=\"]\";\n\t\t\t\t\t\techo $data;\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$data=\"[{optionText:'no data available' , optionDate:'' , optionFlag:0}]\";\n\t\t\t\t\techo $data;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data=\"[{optionText:'no data available' , optionDate:'' , optionFlag:0}]\";\n\t\t\t\techo $data;\n\t\t\t}\n\t\t\texit;\n\t\t}\n\t}",
"private function get_items( $limit = 1000 ) {\n\t\tglobal $wpdb;\n\n\t\t$limit = max( 1, min( 1000, $limit ) );\n\n\t\t$post_types = $this->get_post_types();\n\t\tif ( empty( $post_types ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t// Get posts for the last two days only, credit to Alex Moss for this code.\n\t\t// @codingStandardsIgnoreStart\n\t\t$sql_query = \"\n\t\t\t SELECT ID, post_content, post_name, post_author, post_parent, post_date_gmt, post_date, post_date_gmt, post_title, post_type\n\t\t\t FROM {$wpdb->posts}\n\t\t\t WHERE post_status=%s\n\t\t\t AND (DATEDIFF(CURDATE(), post_date_gmt)<=2)\n\t\t\t AND post_type IN ({$post_types})\n\t\t\t ORDER BY post_date_gmt DESC\n\t\t\t LIMIT 0, {$limit}\n\t\t \";\n\n\t\t$items = $wpdb->get_results( $wpdb->prepare( $sql_query, 'publish' ) );\n\n\t\t// @codingStandardsIgnoreEnd\n\n\t\treturn $items;\n\t}",
"public function getPosts($id, $limit = 999999) {\n\t\t$this->connect();\n\t\t$sql = file_get_contents(\"app/webroot/sql/get_posts.sql\");\n\t\t$sql .= \"\\nLIMIT \" . $limit;\n\t\t$params = array(\"id\" => $id);\n\t\t$result = $this->runSelectQuery($sql, $params);\n\t\t$this->disconnect();\n\t\t\n\t\treturn $result;\n\t}",
"public function recent_posts($limit = 10)\n {\n $_model = $this->_name;\n $this->loadModel($_model);\n $recent_posts = $this->$_model->find('all', [\n 'conditions' => [\n $_model.'.status' => 3\n ],\n 'limit' => $limit,\n 'order' => ['created_at' => 'DESC']\n ]);\n $this->set('recent_posts', $recent_posts);\n }"
] | [
"0.8087219",
"0.765182",
"0.7189367",
"0.7179225",
"0.70475006",
"0.6983573",
"0.6961013",
"0.66369116",
"0.6516513",
"0.6485163",
"0.6458988",
"0.6396963",
"0.63795096",
"0.63670105",
"0.6327366",
"0.6313785",
"0.6308732",
"0.6279128",
"0.6226435",
"0.62245643",
"0.6216532",
"0.6210421",
"0.61652946",
"0.6121373",
"0.61213493",
"0.6050614",
"0.6043202",
"0.6017851",
"0.5970322",
"0.59691775"
] | 0.8953339 | 0 |
Creates API url from domain and path. Returns string if $return = true | protected function construct_url($path, $v = '', $https = false, $domain = '', $return = false)
{
$url = ($https ? 'https' : 'http') . '://' . ($domain ? $domain : $this->api_domain) .
( $v ? '/v'.$v : '' ) . $path;
if($return)
return $url;
else $this->url = $url;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function get_rafco_api_url() {\n\n\t\t// fetch the stored base URL link\n\t\t$stored = self::get_rafco_api_data( 'url' );\n\n\t\t// parse the link\n\t\t$parsed = parse_url( esc_url( $stored ) );\n\n\t\t// bail if its too malformed or our pieces are missing\n\t\tif ( ! $parsed || empty( $parsed['scheme'] ) || empty( $parsed['host'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// build the base URL again\n\t\t$base = $parsed['scheme'] . '://' . $parsed['host'];\n\n\t\t// check for a subfolder and add the path if it exists\n\t\tif ( ! empty( $parsed['path'] ) ) {\n\t\t\t$base = self::strip_trailing_slash( $base ) . $parsed['path'];\n\t\t}\n\n\t\t// build the API link\n\t\t$link = self::strip_trailing_slash( $base ) . '/rafco-api.php';\n\n\t\t// return it with optional filter\n\t\treturn apply_filters( 'rafco_api_url', $link );\n\t}",
"private function createUrl() {\r\n\r\n $url = \"\";\r\n\r\n\t\tif ( isset($this->shortUrl) ) {\r\n\r\n\t\t\t$url = \"/\" . $this->shortUrl;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tswitch( $this->type ) {\r\n\r\n\t\t\t\tcase 'category': $url = '/categories/c' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'geotarget': $url = '/categories/t' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'grouping': $url = '/categories/g' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'help': $url = '/help/h' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'landing': $url = '/categories/l' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'page': $url = str_replace(APP_ROOT, '', $this->filename); break;\r\n\t\t\t\tcase 'product': $url = '/products/' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'subcategory': $url = '/categories/s' . rawurlencode($this->id); break;\r\n\t\t\t}\r\n //just a test\r\n\t\t\tif (!empty($this->slug)) { $url .= \"/\" . rawurlencode($this->encodeSlug($this->slug)); }\r\n\t\t}\r\n\r\n\t\t// return ($this->secure ? URL_PREFIX_HTTPS : URL_PREFIX_HTTP) . $url . (mb_substr($url, -1) !== \"/\" ? \"/\" : \"\");\r\n\t\treturn ($this->secure ? URL_PREFIX_HTTPS : URL_PREFIX_HTTP) . $url;\r\n\t}",
"public function getApiUrl () {\n\t\t$urlParts = $this->getUrlParts();\n\t\t$path = $urlParts['scheme'] . '://' . $urlParts['host'] \n\t\t\t\t. self::LOCAL_API_PATH;\n\t\tif ( substr($path, strlen($path) - 2, 1) ) {\n\t\t\t$path .= '/';\n\t\t}\n\t\treturn $path;\n\t}",
"private function createUrl(): string\n {\n return $this->url . $this->options;\n }",
"function http_build_url($builder) {\n if (!$builder['host']) return false;\n if (!$builder['scheme']) $builder['scheme'] = 'http';\n $url = $builder['scheme'] . '://';\n if ($builder['user'] && $builder['pass']) $url .= \"${builder['user']}:${builder['pass']}@\";\n if ($builder['host']) $url .= \"${builder['host']}\";\n if ($builder['port']) $url .= \":${builder['port']}\";\n if ($builder['path']) {\n $path = $builder['path'];\n if (strpos($path, '/') === 0) {\n $url .= \"$path\";\n } else {\n $url .= \"/$path\";\n }\n } else {\n $url .= '/'; // TODO: ???\n }\n if ($builder['query']) $url .= \"?${builder['query']}\";\n if ($builder['fragment']) $url .= \"#${builder['fragment']}\";\n return $url;\n}",
"function add_http($path) {\n\n\treturn ( strpos($path, \"http://\") === FALSE ) ? \"http://\" . $path : $path;\n}",
"function pathsitoutenza(){\r\n $namedaget=$_GET['nomeutente'];\r\n \r\n \r\n//return \"http://\".$_SERVER[\"HTTP_HOST\"] .'/novaproget.com/utenza/'; \r\nreturn \"http://\".$_SERVER[\"HTTP_HOST\"] .'/novaproget.com/'.$namedaget.'/'; \r\n}",
"public function url($path) {\n\t\t$url = self::BASE_URL.'/'.self::VERSION.\"{$path}?api_key=\".self::$api_key;\n\t\treturn str_replace('//', '/', $url);\n\t}",
"protected function createValidFakeReturnUrl(): string\n {\n return 'https://example.local/callback';\n }",
"public function BuildLink(){\r\n global $eqdkp;\r\n $script_name = preg_replace('/^\\/?(.*?)\\/?$/', '\\1', trim($eqdkp->config['server_path']));\r\n $script_name = ( $script_name != '' ) ? $script_name . '/' : '';\r\n $server_name = trim($eqdkp->config['server_name']);\r\n $server_port = ( intval($eqdkp->config['server_port']) != 80 ) ? ':' . trim($eqdkp->config['server_port']) . '/' : '/';\r\n return 'http://' . $server_name . $server_port . $script_name;\r\n }",
"public static function create($path = '')\n {\n $request = is_null(static::$request) ? \\Reborn\\Http\\Request::createFromGlobals() : static::$request;\n $path = trim($path, '/');\n if ($path == '' || $path =='/') {\n $url = $request->baseUrl();\n } else {\n $base = $request->baseUrl();\n $path = str_replace(' ', '+', $path);\n $url = $base.str_replace($base, '', $path);\n }\n \n return $url;\n }",
"abstract function url();",
"abstract public function getApiPath(): string;",
"function route($name, $output = true) {\n $name = BASE_URL . preg_replace(\"/[\\/]+/\", '/', '/' . $name);\n // Assigning the return value\n $url = \"http://{$name}\";\n // If output is true, it will print on the screen\n if ($output) print $url;\n // Returning the value\n return $url;\n}",
"static function url()\n {\n $path = func_get_args();\n\n if (is_bool(arr::last($path)))\n {\n $absolute = array_pop($path);\n } else $absolute = false;\n\n $path = implode('/', $path);\n // $path = rtrim($path, '/').'/';\n\n if ($absolute)\n {\n return request::url().'/'.ltrim($path, '/');\n }\n else\n {\n return '/'.ltrim($path, '/');\n }\n }",
"function path( $path = \"\" ) {\n return BASE_URL . $path;\n}",
"protected function obtainAPIURLEndpoint()\n {\n $uri = str_replace('{forgeserver}', $this->server, config('forge-publish.get_certificates_uri'));\n $uri = str_replace('{forgesite}', $this->site, $uri);\n return config('forge-publish.url') . $uri;\n }",
"public static function makeUrl() {\n $args = func_get_args();\n\n // Special case: $args is 1 argument, an array\n if (count($args) == 1 && is_array($args[0])) {\n $args = $args[0];\n }\n\n $finStr = \"\";\n\n for ($i =0; $i < count($args); $i++) {\n if ($i != (count($args) - 1) && substr($args[$i], strlen($args[$i]) - 1, 1) != '/') {\n $finStr .= $args[$i] . '/';\n } else {\n $finStr .= $args[$i];\n }\n }\n\n // Clean up multiple slashes, accounting for protocol://\n do {\n $finStr = preg_replace(\"/(?<!:)\\/\\//\", \"/\", $finStr);\n } while (preg_match(\"/(?<!:)\\/\\//\", $finStr));\n\n return $finStr;\n }",
"abstract public function url();",
"private function build_url() {\n $args = array(\n $this->query_var => $this->options['client_key'],\n );\n\n $url = $this->options['client_remote_url'];\n $url = add_query_arg($args, $url);\n\n return $url;\n }",
"public function genenrateOscdomain()\r\n {\r\n $subfolder = $matches = '';\r\n $strDomainName = Mage::app()->getFrontController()->getRequest()->getHttpHost();\r\n preg_match(\"/^(http:\\/\\/)?([^\\/]+)/i\", $strDomainName, $subfolder);\r\n preg_match(\"/^(https:\\/\\/)?([^\\/]+)/i\", $strDomainName, $subfolder);\r\n preg_match(\"/(?P<domain>[a-z0-9][a-z0-9\\-]{1,63}\\.[a-z\\.]{2,6})$/i\", $subfolder[2], $matches);\r\n if (isset($matches['domain']))\r\n {\r\n $customerurl = $matches['domain'];\r\n } else {\r\n $customerurl = \"\";\r\n }\r\n $customerurl = str_replace(\"www.\", \"\", $customerurl);\r\n $customerurl = str_replace(\".\", \"D\", $customerurl);\r\n $customerurl = strtoupper($customerurl);\r\n if (isset($matches['domain']))\r\n {\r\n $response = $this->domainKey($customerurl);\r\n } else {\r\n $response = \"\";\r\n }\r\n return $response;\r\n }",
"public function url(): string;",
"public function url(): string;",
"private static function createUrl($ip){\n $urlTmp = preg_replace('!\\{\\{(accepted_formats)\\}\\}!', self::$return_formats, self::$provider['plugin_url']);\n $urlTmp = preg_replace('!\\{\\{(ip)\\}\\}!', $ip, $urlTmp);\n \n if(isset(self::$api_key))\n $urlTmp = preg_replace('!\\{\\{(api_key)\\}\\}!', self::$api_key, $urlTmp);\n \n return $urlTmp;\n }",
"function make_url($path, $params = '', $base_url = '', $param_separator='&')\n{\n return ($base_url ? $base_url : get_base_url()). $path . \n ($params ? '?' . http_build_query($params, '', $param_separator) : '');\n}",
"public function buildApiUrl(array $config){\n\n $scheme = isset($config['scheme']) ? $config['scheme'] . '://' : static::DEFAULT_API_SCHEME. '://';\n $host = isset($config['host']) ? $config['host'] : static::DEFAULT_API_HOST;\n $port = isset($config['port']) ? ':' . $config['port'] : ':' . static::DEFAULT_API_PORT;\n $contextPath = isset($config['context_path']) ? $config['context_path'] : static::DEFAULT_API_CONTEXT_PATH;\n $version = isset($config['version']) ? $config['version'] . '/' : static::DEFAULT_API_VERSION . '/';\n return $scheme . $host . $port . $contextPath . $version;\n }",
"function build_url($ar=array()){\n $url = NULL;\n $url .= (isset($ar['scheme']) ? $ar['scheme'].'://' : NULL);\n if(isset($ar['user'])){ $url .= $ar['user'].(isset($ar['pass']) ? ':'.$ar['pass'] : NULL).'@'; }\n $url .= $ar['host'].(isset($ar['port']) ? ':'.$ar['port'] : NULL);\n $url .= ((isset($ar['query']) || isset($ar['fragment']) || isset($ar['path'])) ? (isset($ar['path']) ? (substr($ar['path'], 0, 1) != '/' ? '/' : NULL) : '/') : NULL);\n $url .= (isset($ar['path']) ? $ar['path'] : NULL);\n $url .= (isset($ar['query']) ? '?'.(is_array($ar['query']) ? http_build_query($ar['query']) : $ar['query']) : NULL);\n $url .= (isset($ar['fragment']) ? '#'.$ar['fragment'] : NULL);\n return $url;\n}",
"private function generateURL($path)\n {\n $params = $this->con->getParameters();\n $url = parse_url($params['host']);\n $host = array_key_exists('host', $url)\n ? $url['host']\n : $url['path'];\n $proto = (array_key_exists('scheme', $url)\n ? $url['scheme']\n : 'https')\n . '://';\n\n if(!empty($params['port'])) {\n $host .= ':'.$params['port'];\n }\n\n $cred = empty($params['user'])\n ? ''\n : ((empty($params['password']) ? $params['user'] : $params['user'].':'.$params['password']).'@');\n\n return $proto.$cred.$host.htmlspecialchars_decode($path);\n }",
"public function getUrl($returnAsAbsolute = true) {\n $url = $this->_item->getPrefix().$this->_item->getUrl();\n\n if($returnAsAbsolute === false) {\n $url = preg_replace('/\\/{2,}/', '/', $url);\n\n if(substr($url, 0, 1) == '/') {\n $url = substr($url, 1);\n }\n if(substr($url, -1) == '/') {\n $url = substr($url, 0, strlen($url)-1);\n }\n }\n\n return $returnAsAbsolute ? url($url) : $url;\n }",
"public function getFinalURL($urlOrPath)\n {\n\n }"
] | [
"0.64069986",
"0.6086103",
"0.59865695",
"0.5866469",
"0.58137167",
"0.5808523",
"0.57545877",
"0.57402825",
"0.57185805",
"0.57122254",
"0.57044727",
"0.57013625",
"0.566834",
"0.56614184",
"0.5652562",
"0.5651111",
"0.5637263",
"0.5630938",
"0.5616388",
"0.5610456",
"0.5560028",
"0.55527574",
"0.55527574",
"0.5536417",
"0.5506289",
"0.5505085",
"0.55033344",
"0.54991937",
"0.5496244",
"0.54887235"
] | 0.7126906 | 0 |
Gets query for [[Pprofiles]]. | public function getPprofiles()
{
return $this->hasMany(Pprofile::className(), ['specialty_id' => 'specialty_id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProfiles() {\n \n $qry = \"SELECT profID, profName, profContent, profImg, profEmail FROM profiles\";\n \n $rs = $this -> db -> query($qry);\n \n if($rs) {\n if($rs -> num_rows > 0) {\n $p = array();\n \n while($row = $rs -> fetch_assoc()) {\n $p[] = $row;\n }\n return $p;\n } else {\n //echo 'getProfiles returned no results';\n return false;\n }\n } else {\n //echo 'Error running \"getProfiles\" query';\n return false;\n }\n \n \n }",
"public function getProfiles();",
"public function getProfiles() {}",
"public function getProfiles()\n {\n $profiles = DB::table('perfiles')->get();\n return $profiles;\n }",
"public function get_profile($p_id = null)\n {\n $l_sql = 'SELECT * FROM isys_visualization_profile WHERE TRUE';\n\n if ($p_id !== null)\n {\n if (!is_array($p_id))\n {\n $p_id = [$p_id];\n } // if\n\n $l_sql .= ' AND isys_visualization_profile__id ' . $this->prepare_in_condition($p_id);\n } // if\n\n return $this->retrieve($l_sql);\n }",
"public function profiles()\n {\n return $this->profiles;\n }",
"function GetAllSearchProfiles()\n {\n return $this->GetResult(\"\",__FUNCTION__); \n }",
"public function getProfiles(){ }",
"function get_profiles()\n\t{\n\t\t$response = $this->request( self::accounts_url, null, null, $this->auth_header() );\n\t\t$xml = simplexml_load_string( $response );\n\t\t\n\t\t$entries = $xml->entry;\n\t\t$profiles = array();\n\t\tforeach ( $entries as $entry ) {\n\t\t\t$tmp = array();\n\t\t\t$tmp['title'] = (string) $entry->title;\n\t\t\t$tmp['entryid'] = (string) $entry->id;\n\t\t\t\n\t\t\t$properties = $entry->children( self::dxp_ns );\n\t\t\t$tmp['tableid'] = (string) $properties->tableId;\n\t\t\t$tmp['accountId'] = (string) $properties->accountId;\n\t\t\t$tmp['accountName'] = (string) $properties->accountName;\n\t\t\t$tmp['profileId'] = (string) $properties->profileId;\n\t\t\t$tmp['webPropertyId'] = (string) $properties->webPropertyId;\n\t\t\t\n\t\t\t$profiles[] = $tmp;\n\t\t}\n\t\t\n\t\t// We only want to return the profile => display\n\t\t$ret = array();\n\t\tforeach ( $profiles as $profile ) {\n\t\t\t$ret[$profile['tableid']] = $profile['title'];\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}",
"public function getMultistreamProfiles()\n {\n $sql = $this->_getSqlForTable('sd_profiles');\n\n $rows = $this->_sqlExecute($sql,\n $sql->select()\n ->join( 'sd_multistream',\n 'sd_multistream.second_profile_id = sd_profiles.id',\n array()\n )\n ->join( 'tigerd_users',\n 'tigerd_users.ID = sd_profiles.owner_id',\n array('display_name', 'user_id' => 'ID', 'user_email')\n )\n ->where(\n array(\n 'sd_multistream.first_profile_id' => $this->getId(),\n )\n )\n ->order('tigerd_users.display_name asc')\n );\n\n $ret = array();\n\n foreach($rows as $row) {\n $ret[] = new Profiles($row);\n }\n\n return $ret;\n }",
"public function getProfiles(): array\n {\n $profiles = $this->mollie->profiles->page();\n\n return X::toArray($profiles);\n }",
"public static function getProfiles(){\n\t\t$profiles = Config::inst()->get(__CLASS__,'profiles');\n\t\treturn is_array($profiles) ? $profiles : array();\n\t}",
"public function getProfile();",
"private function getUsersProfiles()\n {\n $query = 'SELECT users.id, users.name, profiles.title'.\n ' FROM #__users AS users' .\n ' LEFT JOIN #__jquarks_users_profiles AS users_profiles ON users_profiles.user_id = users.id' .\n ' LEFT JOIN #__jquarks_profiles AS profiles ON profiles.id = users_profiles.profile_id' ;\n \n $this->_db->setQuery($query) ;\n return $this->_db->loadAssocList() ; \n }",
"public function getProfiles()\n {\n return $this->hasOne(Profiles::class, ['user_id' => 'id']);\n }",
"function Profiles($profile=\"\",$key=\"\")\n {\n if (!empty($profile))\n {\n if (!empty($key))\n {\n return $this->ApplicationObj()->Profiles[ $profile ][ $key ];\n }\n\n return $this->ApplicationObj()->Profiles[ $profile ];\n \n }\n \n return $this->ApplicationObj()->Profiles;\n }",
"public function get_profile($params = array())\n\t{\n\t\t$query = $this->db->get_where('profiles', $params);\n\n\t\treturn $query->row();\n\t}",
"function getProfile($params = array())\n\t{\n\t\t$query = $this->db->get_where('profiles', $params);\n\n\t\treturn $query->row();\n\t}",
"public function getProfile()\n {\n if ($this->getProfileId())\n {\n if ($profileClass = $this->computeProfileClassName($this->getType()))\n {\n $this->profile = Doctrine::getTable($profileClass)\n ->find($this->getProfileId());\n } \n }\n \n return $this->profile;\n }",
"public function list_profiles() {\n\t\twp_enqueue_style( 'gamos-front' );\n\t\twp_enqueue_script( 'gamos-front' );\n\n\t\t// Query.\n\t\t$query = $this->get_query();\n\n\t\t// Paginate.\n\t\tif ( $query->max_num_pages > 1 ) {\n\t\t\t$pagination = paginate_links( [\n\t\t\t\t'current' => empty( $query->query_vars['paged'] ) ? 1 : $query->query_vars['paged'],\n\t\t\t\t'total' => $query->max_num_pages,\n\t\t\t\t'prev_text' => __( 'Previous page', 'gamos-plugin' ),\n\t\t\t\t'next_text' => __( 'Next page', 'gamos-plugin' ),\n\t\t\t] );\n\n\t\t\t$pagination = _navigation_markup( $pagination, 'pagination' );\n\t\t} else {\n\t\t\t$pagination = '';\n\t\t}\n\n\t\t// Render template.\n\t\t$content = Helper::view( 'front/profile/shortcodes/list-profiles', [\n\t\t\t'query' => $query,\n\t\t\t'pagination' => $pagination,\n\t\t], true );\n\n\t\treturn $content;\n\t}",
"public function getProfiles()\n {\n return array_keys($this->params);\n }",
"public function getProfiles(): array;",
"public function profiles();",
"public function getProfileData($prop = '') {\n if(!isset($this->profile)) {\n $data = ProfileQuestionValue::getListByExample(\n new DBExample(array(\n 'userId' => $this->id\n )),\n 'question'\n );\n\n $this->profile = array_map(\n function ($v) {\n return $v->value;\n },\n $data\n );\n }\n return $prop ? (isset($this->profile[$prop]) ? $this->profile[$prop] : null) : $this->profile;\n }",
"public function getProfilesId()\n\t{\n\t\treturn $this->profiles_id;\n\t}",
"public function getProfile()\n\t{\n\t}",
"function getProfile()\n {\n\n if ($this->profile > 0)\n {\n return $this->profile;\n }\n else\n {\n $db = &atkGetDb();\n $query = &$db->createQuery();\n //we add the table competences\n $query->addTable(\"competency_profile_person\");\n $query->addField(\"profile_id\");\n $query->addCondition(\"person_id=\" . $this->user['id']);\n $profiles = $db->getrows($query->buildSelect());\n if (count($profiles) > 0)\n {\n $this->profile = $profiles[0]['profile_id'];\n return ($profiles[0]['profile_id']);\n }\n else\n {\n return 0;\n }\n }\n }",
"public function getProfile($profID) {\n\n if(!get_magic_quotes_gpc()) {\n $this -> sanitizeInput();\n }\n \n $qry = \"SELECT profID, profName, profContent, profImg, profEmail FROM profiles WHERE profID = '$profID'\";\n \n $rs = $this -> db -> query($qry);\n \n if($rs) {\n if($rs -> num_rows > 0) {\n \n $p = $rs -> fetch_assoc();\n\n return $p;\n } else {\n //echo 'getProfile returned no results';\n return false;\n }\n } else {\n //echo 'Error running \"getProfile\" query';\n return false;\n }\n \n \n }",
"public function profiles()\n {\n return $this->hasOne('App\\Profile', 'id', 'profile_id');\n }",
"public function getProfile()\n\t{\n\t\treturn $this->getKeyValue('profile'); \n\n\t}"
] | [
"0.696869",
"0.69679046",
"0.68638515",
"0.6738871",
"0.6656064",
"0.6624331",
"0.6584726",
"0.64992076",
"0.64777625",
"0.63904583",
"0.63876283",
"0.6373436",
"0.6368558",
"0.6361038",
"0.6347576",
"0.6310769",
"0.62924266",
"0.6283045",
"0.623556",
"0.6232584",
"0.6166042",
"0.6159773",
"0.61374235",
"0.6135697",
"0.61218417",
"0.61035675",
"0.61020744",
"0.6086153",
"0.60617465",
"0.60522676"
] | 0.704936 | 0 |
Lists all ImagenServicio models. | public function actionIndex()
{
$searchModel = new ImagenServicioSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$dataProvider->pagination->pageSize = 10;
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index()\n {\n $servicos = Servico::all();\n\n return $servicos;\n }",
"public function index()\n {\n $servicios = Servicio::orderBy('id','desc')->get();\n return ServicioResource::collection($servicios);\n }",
"public function index()\n {\n return PagoServicio::all();\n }",
"public function index()\n {\n return Dispositivo::all();\n }",
"public function index()\n {\n return Medico::all();\n }",
"public function obtenerServicios() {\n $datos = $this->AdministradorModel->datosServicios();\n echo json_encode($datos);\n }",
"public function listarServicos(){\n $query = \"SELECT\n SERVICO.id,\n SERVICO.nome as nome_servico,\n SERVICO.custo as preco,\n SERVICO.categoria,\n SERVICO.descricao,\n PESSOA.nome as nome_prestador,\n PESSOA.telefone as telefone_prestador\n FROM SERVICO\n JOIN PRESTADOR ON PRESTADOR.id = SERVICO.id_prestador\n JOIN PESSOA ON PRESTADOR.id_pessoa = PESSOA.id;\";\n $stmt = Conexao::prepare($query);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function index()\n {\n $serInternet = Internet::all();\n $serCable = Cable::all();\n $serTelefonia = Telefonia::all();\n\n return view('admin.servicios.index',compact('serInternet','serCable','serTelefonia')); //muestra lista de servicios\n }",
"public function index()\n {\n return Service::all();\n }",
"public function index()\n {\n $servicios = Servicio::get();\n return view('servicios', compact('servicios'));\n }",
"public function index()\n {\n $servicios = Servicio::all();\n\n return view(\"servicios.index\", compact('servicios'));\n }",
"public function index()\n {\n //return all the services\n $services = Service::all();\n return $services;\n\n }",
"function servicio()\n\t{\n\t\treturn $this->morphMany(\n\t\t\tServicio::class, \n\t\t\t'Servicio'\n\t\t);\n\t}",
"public function index()\n {\n $imagen = Imagene::all();\n return $imagen;\n }",
"public function index()\n {\n return [\"services\" => Service::all()];\n }",
"public function actionIndex()\n {\n $searchModel = new CalificarServicioSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listModels()\n {\n $models = array();\n $this->get();\n foreach ($this->responseObj as $key => $blob) {\n $model = new Model($this->getConfig());\n self::fromArray($model, $blob);\n $models[$key] = $model;\n }\n return $models;\n }",
"public function listarImagens(){\n\t\t\t$imagem = new ImagemLib();\n\n\t\t\t$listaDeImagens = $imagem->obtemImagens();\n\n\t\t\treturn $listaDeImagens;\n\t\t}",
"public function index()\n {\n return Especialidad::all();\n }",
"public function index()\n {\n return Productos::get();\n }",
"public function index()\n {\n return FiltroResource::collection(Filtro::all());\n }",
"public function index()\n {\n $servicos = Servico::all()->sortBy('id');\n //return $servicos->toJson();\n\n return view('servico.index', ['servicos' => $servicos]);\n }",
"public function index()\n {\n return OtroIngreso::all();\n }",
"public function index()\n {\n return SocioResource::collection(Socio::all());\n }",
"public function index()\n {\n $tipoServico = TipoServico::all();\n return view('tipoServico.index', compact('tipoServico'));\n }",
"public function index()\n {\n $servicios = servicios::orderBy('id', 'desc')->paginate(5);\n return view('admin.servicios.index', compact('servicios'));\n }",
"public function index() {\n return $this->service->all();\n }",
"public function index()\n {\n $datosservicios['servicios'] = mservicios::paginate(20);\n return view('servicescrud.index', $datosservicios);\n }",
"public function index() {\n $images = Image::all();\n return $images;\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('uesperaBundle:Domicilio')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }"
] | [
"0.67381746",
"0.6580398",
"0.6537477",
"0.6318868",
"0.62654585",
"0.6105488",
"0.60683763",
"0.6065803",
"0.60518426",
"0.6017043",
"0.5997943",
"0.5977079",
"0.597054",
"0.59508353",
"0.5882619",
"0.5877368",
"0.5855266",
"0.5848832",
"0.5828635",
"0.57900035",
"0.5783345",
"0.5770862",
"0.5770852",
"0.5763061",
"0.5761805",
"0.57464737",
"0.5746296",
"0.5712379",
"0.57015",
"0.5697504"
] | 0.7356448 | 0 |
Creates a new ImagenServicio model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new ImagenServicio();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n\t{\n\t\t$servicio = new Servicio;\n\t\t$servicio->idArea = Input::get('area');\n\t\t$servicio->detalleServicio = Input::get('servicio');\n\t\tif($servicio->save()){\n\t\t\treturn Redirect::route('servicios');\n\t\t}else{\n\t\t\tdd(DB::getQueryLog());\n\t\t}\n\n\t}",
"public function create()\n\t{\n\t\treturn view('especialista_servicios.create');\n\t}",
"public function actionCreate()\n {\n $model = new CreateServiceForm();\n\n if ($model->load(Yii::$app->request->post())) {\n $serviceId = $model->create();\n if ($serviceId) {\n return $this->redirect(['view', 'id' => $serviceId]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Capacitaciones();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idCapacitacion]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Manutencao();\n\n $servicos= [new Servico];\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n foreach(Yii::$app->request->post()['Servico'] as $itemServico)\n {\n\n $is = new Servico();\n\n $is->manutencao_id = $model->id;\n $is->inicio = date_create_from_format('d/m/Y', $itemServico['inicio'])->format('Y-m-d');\n $is->custo = $itemServico['custo'];\n $is->inicio = date_create_from_format('d/m/Y', $itemServico['inicio'])->format('Y-m-d');\n $is->termino = date_create_from_format('d/m/Y', $itemServico['termino'])->format('Y-m-d');\n $is->tempo = $itemServico['tempo'];\n $is->peca = $itemServico['peca'];\n $is->save();\n }\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'servicos' =>$servicos\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Service(['visibility' => 1, 'published' => 1]);\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->save();\n $gallery = UploadedFile::getInstances($model, 'gallery');\n foreach ($gallery as $file) {\n $photo = Photo::createPhoto(\n Service::MAX_GALLERY_IMAGE_SIZE,\n Service::MAX_GALLERY_THUMB_WIDTH,\n Service::MAX_GALLERY_THUMB_HEIGHT,\n $file->tempName\n );\n $serviceHasPhoto = new ServiceHasPhoto();\n $serviceHasPhoto->photo_id = $photo->id;\n $model->link('serviceHasPhoto', $serviceHasPhoto);\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCrear() {\n if (Yii::app()->request->isPostRequest) {\n\n if (Yii::app()->user->isGuest) {\n echo CJSON::encode(array('result' => 'error', 'response' => 'No se detecta usuario autenticado, por favor iniciar sesión'));\n Yii::app()->end();\n }\n \n if (!Yii::app()->user->checkAccess('PuntoDeVenta_TipoDeServicio_crear')) {\n echo CJSON::encode(array('result' => 'error', 'response' => 'Error: 101 => ' . Yii::app()->params['accessError']));\n Yii::app()->end();\n }\n\n $render = Yii::app()->getRequest()->getPost('render', false);\n $model = new TipoServicio;\n\n if ($render) {\n Yii::app()->clientScript->scriptMap['jquery.min.js'] = false;\n echo CJSON::encode(array(\n 'result' => 'ok',\n 'response' => array(\n 'msg' => 'Datos cargados para creación',\n 'form' => $this->renderPartial('_form', array('model' => $model), true, true)\n )));\n Yii::app()->end();\n } else if ($_POST['TipoServicio']) {\n $model->attributes = $_POST['TipoServicio'];\n\n if ($model->validate()) {\n try {\n $model->save();\n echo CJSON::encode(array('result' => 'ok', 'response' => 'Servicio creado'));\n Yii::app()->end();\n } catch (Exception $exc) {\n Yii::log($exc->getTraceAsString(), CLogger::LEVEL_ERROR, 'application');\n echo CJSON::encode(array('result' => 'error', 'response' => 'Error al crear servicio'));\n Yii::app()->end();\n }\n } else {\n echo CActiveForm::validate($model);\n Yii::app()->end();\n }\n } else {\n echo CJSON::encode(array('result' => 'error', 'response' => 'Solicitud inválida'));\n Yii::app()->end();\n }\n } else {\n echo CJSON::encode(array('result' => 'error', 'response' => 'Solicitud inválida'));\n Yii::app()->end();\n }\n }",
"public function actionCreate() {\n $model = new Noticias();\n\n if ($model->load(Yii::$app->request->post())&& $model->save()) {\n// $model->imageFile = UploadedFile::getInstance($model, 'imageFile');\n// if ($model->upload() ) {\n return $this->redirect(['index']);\n// }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Vehiculos;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Vehiculos']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Vehiculos'];\n\t\t\t$model->marca = $_POST['Vehiculos']['marca'];\n\t\t\t$model->modelo_anio = $_POST['Vehiculos']['modelo_anio'];\n\t\t\t$model->propietario = $_POST['Vehiculos']['propietario'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n $model = new Estructura();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idestructura]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new ServiceType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCrear()\n\t{\n\t\t$model = new Premio();\n\n\t\tif ($model->load(Yii::$app->request->post())) {\n\t\t\t$model->guardarImagen('');\n\t\t\t$model->fechaCreacion = \\Date(\"Y-m-d h:i:s\");\n\t\t\tif ($model->save()) {\n\t\t\t\treturn $this->redirect(['detalle', 'id' => $model->idPremio]);\n\t\t\t} else {\n\t\t\t\treturn $this->render('crear', [\n\t\t\t\t\t\t'model' => $model,\n\t\t\t\t]);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->render('crear', [\n\t\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}",
"public function create(){\n $param['id_mascota'] = $this->input->post('id_mascota');\n $param['id_vacuna'] = $this->input->post('id_vacuna');\n $param['fecha_aplicacion'] = $this->input->post('fecha_aplicacion');\n $param['siguiente_aplicacion'] = $this->input->post('siguiente_aplicacion');\n\n $this->Vacunacion_model->insert_vacunacion($param);\n\n $this->load->view('Zootecnico/Layout_zoo/header');\n $this->load->view('Zootecnico/Layout_zoo/menu');\n $this->load->view('Zootecnico/Vacunacion/success');\n $this->load->view('Zootecnico/Layout_zoo/footer');\n }",
"public function actionCreate()\n {\n $model = new PREPVoto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id_partido' => $model->id_partido, 'id_casilla_seccion' => $model->id_casilla_seccion]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create() /* se encarga de mostrar la vista para crear un nuevo producto*/\n {\n return view('create');\n }",
"public function actionCrear()\n {\n $model = new Indicadores();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['detalle', 'id' => $model->idIndicador]);\n } else {\n return $this->render('crear', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $this->autorizaUsuario();\n $model = new Voluntario();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $this->mensagens('success', 'Voluntário Cadastrado', 'Voluntário cadastrado com sucesso');\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new SuratKeluar();\n $data_post = Yii::$app->request->post();\n\n if ($model->load($data_post)) {\n \n $imageName = str_replace('/', '_', $model->no_surat_keluar);\n $model->file_surat = UploadedFile::getInstance($model, 'file_surat');\n $model->file_surat->saveAs( 's_keluar/'.$imageName.'.'.$model->file_surat->extension);\n $model->file_surat = $imageName.'.'.$model->file_surat->extension;\n\n $model->save();\n\n Yii::$app->session->setFlash('success');\n return $this->redirect(['index']);\n \n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->no_agenda_keluar]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n {\n //\n return view('inventario.create');\n }",
"public function create()\n {\n //\n $vehiculos=VehiculoModel::all();\n return view('vehiculos/gastos.crear',compact('vehiculos'));\n }",
"public function actionCreate()\n\t{\n\t\tif(Yii::$app->user->isGuest){\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\n\t\t$model = new Designer();\n\t\t$imgfile_model = new ImgUploadForm();\n\t\t$post_param = Yii::$app->request->post();\n\n\t\tif (Yii::$app->request->isPost) {\n\n\t\t\t$imgfile_model->imgFile = UploadedFile::getInstances($imgfile_model, 'imgFile');\n\t\t\t$filename = $imgfile_model->upload_designer($post_param['Designer']['designer_id']);\n\n\t\t\t$model->load(Yii::$app->request->post());\n\t\t\t$model->photo = $filename;\n\n\t\t\t$model->save();\n\n\t\t\treturn $this->redirect(['view', 'id' => $model->designer_id]);\n\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t\t'imgfile_model' => $imgfile_model,\n\t\t\t]);\n\t\t}\n\t}",
"public function actionCreate() {\n $model = new Pasadia();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->estado = 0;\n $model->agencia = Yii::$app->request->post('pasadia-agencia');\n $model->obs = Yii::$app->request->post('Pasadia[obs]');\n\n\n\n $fe = explode('-', $model->fecha);\n $model->fecha = $fe[2] . '-' . $fe[1] . '-' . $fe[0];\n\n if ($model->save()) {\n// return $this->redirect(['index']);\n return $this->redirect(['servicio', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n {\n return view ('admin.servicios.create');\n }",
"public function create()\n {\n return view('servicos.create');\n }",
"public function actionCreate()\n {\n $model = new Capitulo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['aula/view', 'id' => $model->Aula_id]);\n } else {\n \n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate() {\n $model = new Foro();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->id_usuario=$_SESSION[\"__id\"];\n $model->id_estado=1;\n $model->id_categoria=$_POST[\"Categoria\"];\n $model->fecha= date(\"Y-m-d H:i:s\");\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n //\n return view('inventarios.create');\n }",
"public function create()\n {\n return view('tipoServico.create');\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Inmueble;\n\t\t$modelImage = new Imagen;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Inmueble'],$_POST['Imagen']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Inmueble'];\n\t\t\t// $modelImage->Inmueble_idInmueble = $model->idInmueble;\n\t\t\t// $modelImage->portadaImagen = false;\n\t\t\t\n\t\t\t//$modelImage=CUploadedFile::getInstance($modelImage,'image');\n // $fileName = $uploadedFile;\n // $modelImage->urlImagen = $fileName;\n\n\t\t\t$uploadedFile=CUploadedFile::getInstance($modelImage,'image');\n $fileName = $uploadedFile;\n $model->Imagen_Id = $fileName->getname();\n\n $modelImage->urlImagen = '/images/'.$fileName;\n $modelImage->portadaImagen=0;\n\t\t\tif (Yii::app()->authManager->checkAccess(\"registrado\",Yii::app()->user->id))\n\t\t\t{\n\t\t\t\t$model->destacadoInmueble=0;\n\t\t\t\t$model->estadoInmueble=0;\n\t\t\t}\n\t\t\t$model->Usuario_id=Yii::app()->user->id;\n\n\t\tif($model->save()){\n\t\t\t$modelImage->Inmueble_idInmueble= $model->idInmueble;\n\t\t\tif ($modelImage->save()){\t\t\t\n\t\t\t\t$model->Imagen_Id = $modelImage->idImagen;\n\t\t\t\t$model->save();\n\t\t\t\t$uploadedFile->saveAs('/var/www'.Yii::app()->baseUrl.'/images/'.$uploadedFile->getname(),true); \n\t\t\t\t$this->redirect(array('view','id'=>$model->idInmueble));\n\t\t\t}\n\t\t}\n\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'modelImage'=>$modelImage,\n\t\t));\n\t}",
"public function newAction(Request $request)\n {\n $service = new Service();\n $form = $this->createForm('FixitBundle\\Form\\serviceType', $service);\n $form->handleRequest($request);\n $user=$this->getUser();\n $service->setAddDate(new \\DateTime('now'));\n $service->setViews(0);\n $service->setUser($user);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $file=$service->getPicture();\n $fileName=md5(uniqid()).'.'.$file->guessExtension();\n $file->move($this->getParameter('Service_dir'),$fileName);\n $service->setPicture($fileName);\n $em->persist($service);\n $em->flush();\n\n return $this->redirectToRoute('service_show', array('id' => $service->getId()));\n }\n\n return $this->render('service/new.html.twig', array(\n 'service' => $service,\n 'form' => $form->createView(),\n ));\n }"
] | [
"0.6914591",
"0.67816186",
"0.6768775",
"0.6754835",
"0.6743255",
"0.6694595",
"0.6687196",
"0.6650007",
"0.6647457",
"0.6592159",
"0.6553766",
"0.65490186",
"0.6546988",
"0.65448564",
"0.6543712",
"0.6515622",
"0.65010893",
"0.64894325",
"0.6486753",
"0.6485587",
"0.64779127",
"0.64753854",
"0.64679813",
"0.64644104",
"0.6456106",
"0.64484674",
"0.64346427",
"0.6432489",
"0.6428453",
"0.6428316"
] | 0.86327696 | 0 |
Finds the ImagenServicio model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = ImagenServicio::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function findModel($id) {\n\t\tif (($model = ServiceMapping::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}",
"protected function findModel($id)\n {\n if (($model = CalificarServicio::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id) {\n $model = TipoServicio::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'La página solicitada no existe.');\n return $model;\n }",
"public function find($key): ?Model;",
"protected function findModel($item_id)\n\t{\n\t\tif (($model = SapItem::findOne($item_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n {\n if (($model = FacturaServicios::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = PaymentSystems::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('main', 'Sahifa topilmadi'));\n }",
"public function loadModel($id) {\n $model = OrdemServico::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"protected function findModel($id) {\n if (($model = ServiceBin::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Premio::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n {\n if (($model = ServiceType::findOne($id)) !== null) {\n return $model;\n }\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id): Identity {\n if (($model = Identity::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('Запрашиваемая страница не найдена.');\n }\n }",
"protected function findModel($id)\n {\n \tif (($model = Constancia::findOne($id)) !== null) {\n \t\treturn $model;\n \t} else {\n \t\tthrow new NotFoundHttpException('The requested page does not exist.');\n \t}\n }",
"protected function findModel($id) {\n if (($model = Was16a::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Simgusuario::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('Imagen no encontrada!!!!');\n }\n }",
"protected function findModel($id) {\n if (($model = Subproyectos::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\r\n {\r\n if (($model = Slider::findOne($id)) !== null) {\r\n return $model;\r\n }\r\n throw new HttpException(400);\r\n }",
"protected function findModel($id)\n {\n if (($model = Was27Inspek::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = PorPrecioRv::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Productoscarro::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public function findByID($id);",
"protected function findModel($id)\n {\n if (($model = Server::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"public function loadModel($id) {\n $model = Colaborador::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('smith', 'A página não existe.'));\n return $model;\n }",
"protected function findModel($id) {\n if (($model = ServiceInstance::findOne($id)) !== null) {\n return $model;\n }\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id) {\n if (($model = Docente::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('La página solicitada no existe.');\n }",
"protected function findModel($id) {\n if (($model = Squibcard::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function find(int $id): ?Model;",
"protected function findModel($id)\n {\n if (($model = MarcacaoConsulta::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = Manufactures::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\r\n {\r\n if (($model = Horario::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }"
] | [
"0.662926",
"0.6601844",
"0.65852153",
"0.64740884",
"0.6460725",
"0.63316095",
"0.632868",
"0.63079125",
"0.6306287",
"0.6302366",
"0.62976086",
"0.6280329",
"0.62667954",
"0.62188715",
"0.6181914",
"0.61706424",
"0.61646134",
"0.616446",
"0.61572284",
"0.6127245",
"0.61155313",
"0.60908216",
"0.6088981",
"0.6082601",
"0.607905",
"0.60768914",
"0.60743153",
"0.6069073",
"0.6064985",
"0.6064491"
] | 0.6734272 | 0 |
testInstanceType Check a instance type. | public function testInstanceType()
{
$this->assertType('HTTP_OAuthProvider_Store', $this->store);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testInstanceType()\n {\n $this->assertType('HTTP_OAuthProvider_Signature', $this->signature);\n }",
"public function test_is_instance_of() {\n\t\t$this->assertInstanceOf( 'Eliasis\\Framework\\App', $this->app );\n\t\t$this->assertInstanceOf(\n\t\t\t'Eliasis\\Plugins\\WP_Plugin_Info\\Controller\\Main',\n\t\t\t$this->plugin\n\t\t);\n\t}",
"public function testInstance() { }",
"public function testNewInstance()\n {\n $className = 'TechDivision\\Configuration\\Configuration';\n $this->assertInstanceOf($className, $this->deployment->newInstance($className));\n }",
"public function testInstance()\n {\n $this->assertInstanceOf(Profile::class, $this->instance());\n }",
"public function testInstance()\n {\n $this->assertInstanceOf('Varien_Autoload', Varien_Autoload::instance());\n }",
"public function test_singleton_class(){\r\n\r\n $result = $this->class_instance instanceof WP_Project_Milestones;\r\n $expected = true;\r\n $this->assertEquals($expected, $result);\r\n\r\n }",
"public function testGetType()\n {\n $this->assertSame(\n $value = '\\AppserverIo\\Server\\Servers\\MultiThreadedServer',\n $this->getServerNodeWithMockedConfiguration($value, null, 'getType')->getType()\n );\n }",
"public function testValidate()\n {\n $instance = new IsType('string');\n $this->assertSame('content', $instance->validate('content'));\n }",
"public function testInstance()\n {\n $instance1 = Storage::getInstance();\n $instance2 = Storage::getInstance();\n $this->assertSame($instance1, $instance2);\n $instance3 = new Storage();\n $instance4 = Storage::setInstance($instance3);\n $instance5 = Storage::getInstance();\n $this->assertSame($instance3, $instance4);\n $this->assertSame($instance3, $instance5);\n $this->assertNotSame($instance3, $instance1);\n Storage::setInstance($instance1);\n }",
"public function testGetMatchTypeValid()\n\t{\n\t\t$match = new Match\\TestMatch();\n\t\t$result = $this->enforcer->getMatchType($match);\n\n\t\t$this->assertEquals('testmatch', $result);\n\t}",
"public function testIsImageInstance()\n {\n $this->assertNotEmpty($this->image);\n $this->assertInstanceOf(Image::class, $this->image);\n }",
"public function testValidationValid($instance)\n {\n $this->assertTrue($instance->validate(), 'Failed. Should be valid');\n }",
"public function testCreateInstance()\n {\n $options = array (\n 'imageId' => self::IMAGE_ID,\n 'flavorId' => self::FLAVOR_ID,\n 'metadata' => array (\n 'foo' => 'bar'\n )\n );\n $instance = $this->infrastructure->createInstance(self::SERVER_NAME, $options);\n\n $this->assertTrue($this->infrastructure->isSuccessful());\n $this->assertEquals(self::IMAGE_ID, $instance->getImageId());\n $this->assertEquals(self::SERVER_ID, $instance->getId());\n $metadata = $instance->getMetadata();\n $this->assertTrue(is_array($metadata));\n $this->assertEquals('bar', $metadata['foo']);\n $this->assertEquals(self::SERVER_IP, $instance->getPublicDns());\n $this->assertEquals(self::SERVER_PASS, $instance->getAttribute('adminPass'));\n $this->assertTrue(is_array($instance->getAttribute('addresses')));\n }",
"public function testInstance()\n\t{\n\t\t// Try and load a Queue instance\n\t\t$this->assertInstanceOf('Kohana_Queue', self::$test_instance);\n\t\t\n\t\t// TODO: Test singleton\n\t}",
"function testGetObjectType() {\n\t\t$this->Task->expectOnce('_stop');\n\t\t$this->Task->setReturnValueAt(0, 'in', 'q');\n\t\t$this->Task->getObjectType();\n\n\t\t$this->Task->setReturnValueAt(1, 'in', 2);\n\t\t$result = $this->Task->getObjectType();\n\t\t$this->assertEqual($result, $this->Task->classTypes[1]);\n\t}",
"public static function is($instance): bool;",
"public function test_instanceOf()\n\t{\n\t\t$this->assertInstanceOf('Danzabar\\Config\\Data\\Extensions\\Json', $this->map->get('json'));\n\t\t$this->assertInstanceOf('Danzabar\\Config\\Data\\Extensions\\YamlTranslator', $this->map->get('yml'));\n\t}",
"public function testValidateValidType($type)\n {\n BuiltinRecordUtil::validateType($type);\n }",
"public function testCheck()\n {\n $anything = Types::anything();\n\n // Any value should be an instance of this type\n $this->assertTrue($anything->has(4));\n $this->assertTrue($anything->has('abc'));\n $this->assertTrue($anything->has(true));\n $this->assertTrue($anything->has(null));\n $this->assertTrue($anything->has(4.5));\n $this->assertTrue($anything->has([1, 2, 3]));\n $this->assertTrue($anything->has(new \\stdClass));\n }",
"public function testConstruct()\n {\n $instance = new IsType('string');\n\n $reflex = new \\ReflectionProperty(IsType::class, 'type');\n $reflex->setAccessible(true);\n\n $this->assertEquals('string', $reflex->getValue($instance));\n\n $this->expectException(\\UnexpectedValueException::class);\n $this->expectExceptionMessage('function is_test does not exist');\n $instance = new IsType('test');\n }",
"public function testGetClass()\n {\n // check for the correct class name\n $this->assertEquals('AppserverIo\\Lang\\Boolean', Boolean::__getClass());\n }",
"public function testGetIdCardInstance()\n {\n $idCardInstance = $this->config->getIdCardInstance(10);\n $this->assertTrue($idCardInstance instanceOf DeutschePost_Postident_Model_IdCard_Abstract);\n }",
"public function testValidateInvalidType($type)\n {\n $this->testValidateValidType($type);\n }",
"public function testType ()\n {\n $rule = (new IntRule())->setMax(10);\n $result = $rule->validate(new stdClass());\n\n $this->assertIsBool($result, 'new stdClass() is valid string');\n $this->assertFalse($result);\n\n $rule = (new IntRule())->setMax(10);\n $result = $rule->validate(['123']);\n\n $this->assertIsBool($result);\n $this->assertFalse($result);\n }",
"public function testHasInstance()\n {\n // Aether instance ready to go.\n\n $this->assertTrue(Aether::hasInstance());\n\n Aether::setInstance(null);\n\n $this->assertFalse(Aether::hasInstance());\n }",
"public function testNewInstance()\n {\n $className = 'TechDivision\\ApplicationServer\\Mock\\MockContainerThread';\n $instance = $this->server->newInstance($className, array(\n $this->server->getInitialContext(),\n \\Mutex::create(false),\n $id = 1\n ))\n ;\n $this->assertInstanceOf($className, $instance);\n }",
"public function testGetInstance()\n\t{\n\t\t$this->assertInstanceOf(\n\t\t\t'JApplicationCliInspector',\n\t\t\tJApplicationCli::getInstance('JApplicationCliInspector'),\n\t\t\t'Tests that getInstance will instantiate a valid child class of JCli.'\n\t\t);\n\n\t\tTestReflection::setValue('JApplicationCli', 'instance', 'foo');\n\n\t\t$this->assertEquals('foo', JApplicationCli::getInstance('JApplicationCliInspector'), 'Tests that singleton value is returned.');\n\n\t\tTestReflection::setValue('JApplicationCli', 'instance', null);\n\n\t\t$this->assertInstanceOf(\n\t\t\t'JApplicationCli',\n\t\t\tJApplicationCli::getInstance('Foo'),\n\t\t\t'Tests that getInstance will instantiate a valid child class of JApplicationCli given a non-existent type.'\n\t\t);\n\t}",
"function isExactlyA($instance, $className)\n {\n return (($instanceClass = get_class($instance)) == $className || $instanceClass ==\n strtr($className, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'));\n }",
"public function testCreateObject()\n {\n $this->assertInstanceOf(\"\\Bjos\\Validate\\ValidateIp\", $this->validateIp);\n }"
] | [
"0.6776879",
"0.6216197",
"0.5961195",
"0.59594697",
"0.5863562",
"0.58284706",
"0.5698993",
"0.56985205",
"0.56220996",
"0.56100875",
"0.55699223",
"0.5545084",
"0.55076504",
"0.5506281",
"0.54884446",
"0.5483346",
"0.54798627",
"0.5469108",
"0.5457796",
"0.5434966",
"0.5415023",
"0.5408828",
"0.5399743",
"0.5372198",
"0.5338521",
"0.5331015",
"0.5306492",
"0.5299947",
"0.5286526",
"0.5283325"
] | 0.65822566 | 1 |
testGetterMethod Check getter method. | public function testGetterMethod()
{
$token = 'yQa5LVZdRnhVD83ELbxsNOsr30iQ3oFqGtXzlWa0XKpYAXHWAchkd8R5wL1YQfxeKWgr8';
$secret = 'Yu50YZ1SrpNy8KmV3yV1R232GSajkzboApKgP1eyWCEVpVPskGfhjvmGtgRGpDxMyh4g';
$this->assertEquals($token, $this->store->getToken());
$this->assertEquals($secret, $this->store->getSecret());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function isGetter(string $method): bool\n {\n return StrFacade::startsWith($method, 'get');\n }",
"public function isMethodGet(): bool;",
"public static function getters();",
"public static function getters();",
"public static function getters();",
"public static function getters();",
"public static function getters();",
"public static function getters();",
"public function testCallGet()\n {\n $this->uut->setData(self::SOME_DATA);\n\n $this->assertEquals('foo', $this->uut->getNonExistingField('foo'));\n }",
"public function testGet(): void\n {\n self::assertSame($this->value['foo'], $this->class->get('foo', false));\n }",
"public function test__get()\n {\n $this->todo('stub');\n }",
"protected function getMethod()\n\t{\n\t\treturn 'get';\n\t}",
"public function testMissingGetter2()\n {\n $entity = new BadEntity();\n $this->expectException(Exception::class);\n $this->expectExceptionMessage('Can\\'t find getter method getIsProduction() or isIsProduction() or isProduction() for attribute \"isProduction\" in ' . get_class($entity));\n $entity->getAttribute('isProduction');\n }",
"public function testMissingGetter()\n {\n $entity = new BadEntity([\n 'userId' => 1,\n 'messageId' => 2,\n ]);\n $this->expectException(Exception::class);\n $this->expectExceptionMessage('Can\\'t find getter method getMessageId() or isMessageId() for attribute \"messageId\" in ' . get_class($entity));\n $entity->getAttribute('messageId');\n }",
"public function testGetter()\n {\n $name = 'TestName';\n $sortIndex = 42;\n $userAgents = ['abc' => 'def'];\n $versions = [1, 2, 3];\n\n $object = new Division($name, $sortIndex, $userAgents, true, false, $versions);\n\n self::assertSame($name, $object->getName());\n self::assertSame($sortIndex, $object->getSortIndex());\n self::assertSame($userAgents, $object->getUserAgents());\n self::assertTrue($object->isLite());\n self::assertFalse($object->isStandard());\n self::assertSame($versions, $object->getVersions());\n }",
"public function test__get()\n\t{\n\t\t$this->assertNull(\n\t\t\t$this->_instance->foobar,\n\t\t\t'Unknown property should return null.'\n\t\t);\n\t}",
"public function testCustomFieldsGet()\n {\n }",
"public function testInstanceGettersReturnNotEmptyValue()\n {\n $aAccessors = $this->getAccessors($this->oTemplateInstance);\n foreach ($aAccessors[self::ACCESSORS_GETTER] as $sAccessorMethod) {\n $this->assertNotEmpty(\n $this->oTemplateInstance->$sAccessorMethod(),\n sprintf('Template Accessor \"%s\" return empty value', $sAccessorMethod)\n );\n }\n\n }",
"public function getExtractor(Getter $getter);",
"public function testGetMethod()\r\n\t{\r\n\t}",
"public static function isGet() {\n return self::getMethod() == 'GET';\n }",
"public function getGetterName() {\n\t\treturn $this->_getterName;\n\t}",
"public function testGetProperty()\n\t{\n\t\t$this->_instance->bind(array('get_test' => 'get_test_value'));\n\t\t$this->assertEquals('get_test_value', $this->_instance->get_test);\n\t}",
"public function testGet()\n {\n $apiCall = new ApiCall();\n $this->assertTrue(method_exists($apiCall, 'get'));\n }",
"public function setGetMethod()\n {\n $this->method = self::METHOD_GET;\n }",
"public function testGetOrderItemUsingGET()\n {\n }",
"public function getIsGet()\n {\n return $this->getMethod() === 'GET';\n }",
"function testGetterSetterDependency(){\r\n $personDao = $this->context->getObject('personDAO');\r\n //$this->assertEquals('Somebody', $personDao->getName());\r\n }",
"public function testAccessors()\n {\n $latitude = 44.34;\n $longitude = 54.32;\n\n $coordinates = $this->getCoordinates($latitude, $longitude);\n\n $this->assertSame($latitude, $coordinates->getLatitude());\n $this->assertSame($longitude, $coordinates->getLongitude());\n }",
"public function test_can_get_set()\n {\n $this->assertTrue(true);\n }"
] | [
"0.68124163",
"0.6621448",
"0.65914744",
"0.65914744",
"0.65914744",
"0.65914744",
"0.65914744",
"0.65914744",
"0.6504804",
"0.64897156",
"0.6481751",
"0.647417",
"0.64664483",
"0.6409372",
"0.6306591",
"0.63041025",
"0.6276116",
"0.6273573",
"0.6217916",
"0.6197899",
"0.6181262",
"0.6159079",
"0.612006",
"0.6115663",
"0.6111274",
"0.6091795",
"0.6079067",
"0.6076958",
"0.60708416",
"0.6063061"
] | 0.7379082 | 0 |
Get navigation items color for page. | protected function getColor(int|string $pageId): string
{
return $this->getNavConfig()[$pageId]['color']
?? $this->getNavConfig()['default']['color'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function get_nav_items() {\n }",
"function getNavItems(){\n return $this->nav_items;\n }",
"public function set_navtype_color($navtype) {\r\n switch ($navtype) {\r\n case $GLOBALS['NAVI']['SERVICE']:\r\n $navcolor = 'red';\r\n break;\r\n case $GLOBALS['NAVI']['VERTIKAL']:\r\n $navcolor = 'purple';\r\n break;\r\n default:\r\n $navcolor = 'green';\r\n }\r\n return $navcolor;\r\n }",
"public function getBackgroundColor();",
"function block_core_navigation_build_css_colors( $attributes ) {\n\t$colors = array(\n\t\t'css_classes' => array(),\n\t\t'inline_styles' => '',\n\t);\n\n\t// Text color.\n\t$has_named_text_color = array_key_exists( 'textColor', $attributes );\n\t$has_custom_text_color = array_key_exists( 'customTextColor', $attributes );\n\n\t// If has text color.\n\tif ( $has_custom_text_color || $has_named_text_color ) {\n\t\t// Add has-text-color class.\n\t\t$colors['css_classes'][] = 'has-text-color';\n\t}\n\n\tif ( $has_named_text_color ) {\n\t\t// Add the color class.\n\t\t$colors['css_classes'][] = sprintf( 'has-%s-color', $attributes['textColor'] );\n\t} elseif ( $has_custom_text_color ) {\n\t\t// Add the custom color inline style.\n\t\t$colors['inline_styles'] .= sprintf( 'color: %s;', $attributes['customTextColor'] );\n\t}\n\n\t// Background color.\n\t$has_named_background_color = array_key_exists( 'backgroundColor', $attributes );\n\t$has_custom_background_color = array_key_exists( 'customBackgroundColor', $attributes );\n\n\t// If has background color.\n\tif ( $has_custom_background_color || $has_named_background_color ) {\n\t\t// Add has-background class.\n\t\t$colors['css_classes'][] = 'has-background';\n\t}\n\n\tif ( $has_named_background_color ) {\n\t\t// Add the background-color class.\n\t\t$colors['css_classes'][] = sprintf( 'has-%s-background-color', $attributes['backgroundColor'] );\n\t} elseif ( $has_custom_background_color ) {\n\t\t// Add the custom background-color inline style.\n\t\t$colors['inline_styles'] .= sprintf( 'background-color: %s;', $attributes['customBackgroundColor'] );\n\t}\n\n\treturn $colors;\n}",
"public static function getColor() {\n return self::$colors[self::getGeneralStatus()];\n }",
"function theme_colors()\n { \n return theme_facilities('colors');\n }",
"function get_color() {\n return $this->get_mapped_property('color');\n }",
"public function getColor() {\n\t\treturn $this->_dataHelper->getSomeColor();\n\t}",
"function getBackgroundColor() {\n return array_var($this->colors, 'background_color', 'cccccc');\n }",
"protected function getMenuNameColor() {\n return null;\n }",
"function globalvoices_gv_site_colors() {\n\t\treturn array(\n\t\t\t'solid_bg' => '45AF49',\n\t\t\t'solid_bg_text' => 'ffffff',\n\t\t\t'link_dark' => '1287c8',\n\t\t\t'link_light' => '5bb5e8',\n\t\t);\n\t}",
"function getColor() {\n\t\treturn $this->color;\n\t}",
"public static function getColors() {\n\t\treturn array(\n\t\t 'Green'=>Yii::t('actions', 'Green'),\n\t\t '#3366CC'=>Yii::t('actions', 'Blue'),\n\t\t 'Red'=>Yii::t('actions', 'Red'),\n\t\t 'Orange'=>Yii::t('actions', 'Orange'),\n\t\t 'Black'=>Yii::t('actions', 'Black'),\n\t\t);\n\t}",
"public function getColor ()\r\n {\r\n return $this->color;\r\n }",
"function getColor()\n {\n return $this->readColor();\n }",
"function mixtape_qodef_mobile_navigation_styles() {\n $mobile_nav_styles = array();\n if(mixtape_qodef_options()->getOptionValue('mobile_menu_background_color')) {\n $mobile_nav_styles['background-color'] = mixtape_qodef_options()->getOptionValue('mobile_menu_background_color');\n }\n\n echo mixtape_qodef_dynamic_css('.qodef-mobile-header .qodef-mobile-nav', $mobile_nav_styles);\n\n $mobile_nav_item_styles = array();\n if(mixtape_qodef_options()->getOptionValue('mobile_menu_separator_color') !== '') {\n $mobile_nav_item_styles['border-bottom-color'] = mixtape_qodef_options()->getOptionValue('mobile_menu_separator_color');\n }\n\n if(mixtape_qodef_options()->getOptionValue('mobile_text_color') !== '') {\n $mobile_nav_item_styles['color'] = mixtape_qodef_options()->getOptionValue('mobile_text_color');\n }\n\n if(mixtape_qodef_is_font_option_valid(mixtape_qodef_options()->getOptionValue('mobile_font_family'))) {\n $mobile_nav_item_styles['font-family'] = mixtape_qodef_get_formatted_font_family(mixtape_qodef_options()->getOptionValue('mobile_font_family'));\n }\n\n if(mixtape_qodef_options()->getOptionValue('mobile_font_size') !== '') {\n $mobile_nav_item_styles['font-size'] = mixtape_qodef_filter_px(mixtape_qodef_options()->getOptionValue('mobile_font_size')).'px';\n }\n\n if(mixtape_qodef_options()->getOptionValue('mobile_line_height') !== '') {\n $mobile_nav_item_styles['line-height'] = mixtape_qodef_filter_px(mixtape_qodef_options()->getOptionValue('mobile_line_height')).'px';\n }\n\n if(mixtape_qodef_options()->getOptionValue('mobile_text_transform') !== '') {\n $mobile_nav_item_styles['text-transform'] = mixtape_qodef_options()->getOptionValue('mobile_text_transform');\n }\n\n if(mixtape_qodef_options()->getOptionValue('mobile_font_style') !== '') {\n $mobile_nav_item_styles['font-style'] = mixtape_qodef_options()->getOptionValue('mobile_font_style');\n }\n\n if(mixtape_qodef_options()->getOptionValue('mobile_font_weight') !== '') {\n $mobile_nav_item_styles['font-weight'] = mixtape_qodef_options()->getOptionValue('mobile_font_weight');\n }\n\n $mobile_nav_item_selector = array(\n '.qodef-mobile-header .qodef-mobile-nav a',\n '.qodef-mobile-header .qodef-mobile-nav h4'\n );\n\n echo mixtape_qodef_dynamic_css($mobile_nav_item_selector, $mobile_nav_item_styles);\n\n $mobile_nav_item_hover_styles = array();\n if(mixtape_qodef_options()->getOptionValue('mobile_text_hover_color') !== '') {\n $mobile_nav_item_hover_styles['color'] = mixtape_qodef_options()->getOptionValue('mobile_text_hover_color');\n }\n\n $mobile_nav_item_selector_hover = array(\n '.qodef-mobile-header .qodef-mobile-nav a:hover',\n '.qodef-mobile-header .qodef-mobile-nav h4:hover'\n );\n\n echo mixtape_qodef_dynamic_css($mobile_nav_item_selector_hover, $mobile_nav_item_hover_styles);\n }",
"public function getColor()\n {\n return $this->color;\n }",
"public function getColor()\n {\n return $this->color;\n }",
"public function getColor()\n {\n return $this->color;\n }",
"public function getColor()\n {\n return $this->color;\n }",
"public function getColor()\n {\n return $this->color;\n }",
"public function getColor()\n {\n return $this->color;\n }",
"public function getColor()\r\n {\r\n return $this->color;\r\n }",
"public function getColor() {\n return $this->_color;\n }",
"function atg_menu_classes($classes, $item, $args) {\r\r\n if($args->theme_location == 'topnav') {\r\r\n $classes[] = 'nav-link';\r\r\n }\r\r\n return $classes;\r\r\n}",
"public function getColor()\n\t{\n\t\treturn $this->color;\n\t}",
"function porto_member_nav_menu_item_classes( $menu_items ) {\n\tglobal $porto_settings;\n\n\t$enable_content_type = ( isset( $porto_settings ) && isset( $porto_settings['enable-member'] ) ) ? $porto_settings['enable-member'] : true;\n\tif ( ! $enable_content_type ) {\n\t\treturn $menu_items;\n\t}\n\n\t$members_page = porto_members_page_id();\n\t$page_for_posts = (int) get_option( 'page_for_posts' );\n\n\tforeach ( (array) $menu_items as $key => $menu_item ) {\n\n\t\t$classes = (array) $menu_item->classes;\n\n\t\t// Unset active class for blog page\n\t\tif ( $page_for_posts == $menu_item->object_id ) {\n\t\t\t$menu_items[ $key ]->current = false;\n\n\t\t\tif ( in_array( 'current_page_parent', $classes ) ) {\n\t\t\t\tunset( $classes[ array_search( 'current_page_parent', $classes ) ] );\n\t\t\t}\n\n\t\t\tif ( in_array( 'current-menu-item', $classes ) ) {\n\t\t\t\tunset( $classes[ array_search( 'current-menu-item', $classes ) ] );\n\t\t\t}\n\n\t\t\t// Set active state if this is the members page link\n\t\t} elseif ( is_porto_members_page() && $members_page == $menu_item->object_id && 'page' === $menu_item->object ) {\n\t\t\t$menu_items[ $key ]->current = true;\n\t\t\t$classes[] = 'current-menu-item';\n\t\t\t$classes[] = 'current_page_item';\n\n\t\t\t// Set parent state if this is a members page\n\t\t} elseif ( is_singular( 'member' ) && $members_page == $menu_item->object_id ) {\n\t\t\t$classes[] = 'current_page_parent';\n\t\t}\n\n\t\t$menu_items[ $key ]->classes = array_unique( $classes );\n\t}\n\n\treturn $menu_items;\n}",
"function vm_top_nav_li_class( $classes, $item, $args ) {\n\n\tif ( empty( $args->theme_location ) || 'global_nav_bar' !== $args->theme_location ) :\n\t\treturn $classes;\n\tendif;\n\n\t$classes []= 'nav-item';\n\n\treturn $classes;\n\n}",
"public function getColor()\n\t{\n return $this->color;\n }"
] | [
"0.5847116",
"0.5814719",
"0.5726041",
"0.56907016",
"0.56674284",
"0.56208336",
"0.5591083",
"0.5571643",
"0.5458801",
"0.54449445",
"0.5426471",
"0.54167503",
"0.54125834",
"0.5366155",
"0.5363975",
"0.5363423",
"0.5350373",
"0.5348563",
"0.5348563",
"0.5348563",
"0.5348563",
"0.5348563",
"0.5345661",
"0.5340907",
"0.5334199",
"0.53249615",
"0.5324634",
"0.5314232",
"0.5312477",
"0.52992934"
] | 0.6404058 | 0 |
Extract groups from full array of topologies. | private function extractGroups(array $entities): array
{
$groups = [];
foreach ($entities as $entity) {
if (null === $entity->getTopologyPage() && $entity->getIsReact() === '0') {
$groups[$entity->getTopologyParent()][$entity->getTopologyGroup()] = [
'name' => $entity->getTopologyName(),
];
}
}
return $groups;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllGroups(): array {\r\n $groups = [];\r\n $groupList = new GroupList();\r\n foreach ($groupList->getResults() as $group) {\r\n if (strpos($group->getGroupPath(), '/Turicane Fun Tourney System/') !== false) {\r\n $groups[] = $group;\r\n }\r\n }\r\n return $groups;\r\n }",
"public function trophyGroups() : array\n {\n $returnGroups = [];\n\n $data = [\n 'fields' => '@default,trophyTitleSmallIconUrl,trophyGroupSmallIconUrl',\n 'iconSize' => 'm',\n 'npLanguage' => 'en'\n ];\n\n if ($this->isComparing()) {\n $data['comparedUser'] = $this->user()->onlineId();\n }\n\n $groups = $this->get(sprintf(Trophy::TROPHY_ENDPOINT . 'trophyTitles/%s/trophyGroups', $this->communicationId()), $data);\n\n foreach ($groups->trophyGroups as $group) {\n $returnGroups[] = new TrophyGroup($this->client, $group, $this);\n }\n\n return $returnGroups;\n }",
"function tsml_get_groups() {\n\n\t$groups = array();\n\t\n\t# Get all districts with parents, need for sub_district below\n\t$districts = $districts_with_parents = array();\n\t$terms = get_categories(array('taxonomy' => 'tsml_district'));\n\tforeach ($terms as $term) {\n\t\t$districts[$term->term_id] = $term->name;\n\t\tif ($term->parent) $districts_with_parents[$term->term_id] = $term->parent;\n\t}\n\t\n\t# Get all locations\n\t$posts = tsml_get_all_groups('publish');\n\t\n\t# Much faster than doing get_post_meta() over and over\n\t$group_meta = tsml_get_meta('tsml_group');\n\n\t# Make an array of all groups\n\tforeach ($posts as $post) {\n\n\t\t$district_id = !empty($group_meta[$post->ID]['district_id']) ? $group_meta[$post->ID]['district_id'] : null;\n\t\tif (array_key_exists($district_id, $districts_with_parents)) {\n\t\t\t$district = $districts[$districts_with_parents[$district_id]];\n\t\t\t$sub_district = $districts[$district_id];\n\t\t} else {\n\t\t\t$district = !empty($districts[$district_id]) ? $districts[$district_id] : '';\n\t\t\t$sub_district = null;\n\t\t}\n\n\t\t$groups[$post->ID] = array(\n\t\t\t'group_id' => $post->ID, //so as not to conflict with another id when combined\n\t\t\t'group' => $post->post_title,\n\t\t\t'district' => $district,\n\t\t\t'district_id' => $district_id,\n\t\t\t'sub_district' => $sub_district,\n\t\t\t'group_notes' => $post->post_content,\n\t\t\t'website' => empty($group_meta[$post->ID]['website']) ? null : $group_meta[$post->ID]['website'],\n\t\t\t'website_2' => empty($group_meta[$post->ID]['website_2']) ? null : $group_meta[$post->ID]['website_2'],\n\t\t\t'email' => empty($group_meta[$post->ID]['email']) ? null : $group_meta[$post->ID]['email'],\n\t\t\t'phone' => empty($group_meta[$post->ID]['phone']) ? null : $group_meta[$post->ID]['phone'],\n\t\t\t'venmo' => empty($group_meta[$post->ID]['venmo']) ? null : $group_meta[$post->ID]['venmo'],\n\t\t\t'last_contact' => empty($group_meta[$post->ID]['last_contact']) ? null : $group_meta[$post->ID]['last_contact'],\n\t\t);\n\t\t\n\t\tif (current_user_can('edit_posts')) {\n\t\t\t$groups[$post->ID] = array_merge($groups[$post->ID], array(\n\t\t\t\t'contact_1_name' => empty($group_meta[$post->ID]['contact_1_name']) ? null : $group_meta[$post->ID]['contact_1_name'],\n\t\t\t\t'contact_1_email' => empty($group_meta[$post->ID]['contact_1_email']) ? null : $group_meta[$post->ID]['contact_1_email'],\n\t\t\t\t'contact_1_phone' => empty($group_meta[$post->ID]['contact_1_phone']) ? null : $group_meta[$post->ID]['contact_1_phone'],\n\t\t\t\t'contact_2_name' => empty($group_meta[$post->ID]['contact_2_name']) ? null : $group_meta[$post->ID]['contact_2_name'],\n\t\t\t\t'contact_2_email' => empty($group_meta[$post->ID]['contact_2_email']) ? null : $group_meta[$post->ID]['contact_2_email'],\n\t\t\t\t'contact_2_phone' => empty($group_meta[$post->ID]['contact_2_phone']) ? null : $group_meta[$post->ID]['contact_2_phone'],\n\t\t\t\t'contact_3_name' => empty($group_meta[$post->ID]['contact_3_name']) ? null : $group_meta[$post->ID]['contact_3_name'],\n\t\t\t\t'contact_3_email' => empty($group_meta[$post->ID]['contact_3_email']) ? null : $group_meta[$post->ID]['contact_3_email'],\n\t\t\t\t'contact_3_phone' => empty($group_meta[$post->ID]['contact_3_phone']) ? null : $group_meta[$post->ID]['contact_3_phone'],\n\t\t\t));\n\t\t}\n\t}\n\t\t\t\n\treturn $groups;\n}",
"public function groups();",
"abstract public function getGroups();",
"protected function groupTreesToOptions()\n {\n $trees = [];\n foreach ($this->archiverGroupTrees() as $obj) {\n $trees[] = $obj->toArray();\n }\n return $trees;\n }",
"protected function archiverGroupTrees()\n {\n $trees = [];\n foreach (ArchiveRequest::groups() as $group) {\n $parts = explode(':', $group, 2);\n $key = array_shift($parts);\n if (!array_key_exists($key, $trees)) {\n $trees[$key] = new ArchiverGroup($key);\n } else {\n if (!empty($parts)) {\n $trees[$key]->addFromString($parts[0]); //We already shifted original first elem into $key\n }\n }\n }\n return $trees;\n }",
"public function loadGroups() {\n $indexes = $this->storage->loadMultiple();\n /** @var \\Drupal\\search_api\\ServerInterface[] $servers */\n $servers = $this->serverStorage->loadMultiple();\n\n $this->sortByStatusThenAlphabetically($indexes);\n $this->sortByStatusThenAlphabetically($servers);\n\n $server_groups = [];\n foreach ($servers as $server) {\n $server_group = [\n 'server.' . $server->id() => $server,\n ];\n\n foreach ($server->getIndexes() as $index) {\n $server_group['index.' . $index->id()] = $index;\n // Remove this index from $index so it will finally only contain those\n // indexes not belonging to any server.\n unset($indexes[$index->id()]);\n }\n\n $server_groups['server.' . $server->id()] = $server_group;\n }\n\n return [\n 'servers' => $server_groups,\n 'lone_indexes' => $indexes,\n ];\n }",
"public function getGroups(): array;",
"function getGroups();",
"public function getGroups();",
"public function getGroups();",
"static public function getGroups() {\r\n\r\n\t\tif ( ! self::isUsed() ) {\r\n\t\t\twfDebugLog( \"wikifactory\", __METHOD__ . \": WikiFactory is not used.\\n\", true );\r\n\t\t\treturn array();\r\n\t\t}\r\n\r\n\t\t$groups = array();\r\n\r\n\t\t$dbr = self::db( DB_MASTER );\r\n\r\n\t\t$oRes = $dbr->select(\r\n\t\t\tarray( \"city_variables_pool\", \"city_variables_groups\" ), /*from*/\r\n\t\t\tarray( \"cv_group_id\", \"cv_group_name\" ), /*what*/\r\n\t\t\tarray(), //array( \"cv_group_id in (select cv_variable_group from city_variables_pool)\"\t), /*where*/\r\n\t\t\t__METHOD__\r\n\t\t);\r\n\r\n\t\twhile ( $oRow = $dbr->fetchObject( $oRes ) ) {\r\n\t\t\t$groups[$oRow->cv_group_id] = $oRow->cv_group_name;\r\n\t\t}\r\n\t\t$dbr->freeResult( $oRes );\r\n\r\n\t\treturn $groups;\r\n\t}",
"public static function getNormalizeCollectionGroups(): array;",
"public function getHostGroups(): array\n {\n $hostGroups = [];\n $parentHostGroup = $this->getParentHostGroup();\n if ($parentHostGroup) {\n $hostGroups[$parentHostGroup->getName()] = $parentHostGroup;\n foreach ($parentHostGroup->getHostGroups() as $hostGroup) {\n if (!isset($hostGroups[$hostGroup->getName()])) {\n $hostGroups[$hostGroup->getName()] = $hostGroup;\n }\n }\n }\n return $hostGroups;\n }",
"public function getGroups()\n {\n return [\n 'production' => [1, 2, 20, 21],\n 'wholesale' => [3, 4, 5, 22, 23, 24],\n 'retail' => [6, 7, 8, 25, 26],\n 'residential' => [9, 10, 11, 12, 27],\n 'recreation' => [13, 14, 15, 16, 17, 29, 30, 31],\n ];\n }",
"public function exportGrouped(){\n $domains = array();\n /* @var $proj Loco_package_Project */\n foreach( $this as $proj ){\n $domain = $proj->getDomain();\n $key = $domain->getName();\n $domains[$key][] = $proj; \n }\n return $domains;\n }",
"public static function getDenormalizeCreateGroups(): array;",
"public function groups(): array\n {\n return array_map(\n 'strval',\n array_keys($this->groups),\n );\n }",
"private function get_representative_groups(){\n\t\t$americas_groups = $this->groups_by_box(array(-150, 60, -30, -50), 4);\n\t\t$european_groups = $this->groups_by_box(array(-5, 70, 50, 30), 1);\n\t\t$african_groups = $this->groups_by_box(array(-15, 25, 60, -40), 1);\n\t\t$asian_groups = $this->groups_by_box(array(60, 90, 170, -60), 2);\t\t\t\n\n\t\treturn array_merge($european_groups, $americas_groups, $african_groups, $asian_groups);\t\n\t}",
"function allGroups()\n {\n $filtered = array();\n foreach ($this->groups as $name => $group) {\n if ($name != self::DEFAULT_GROUP) {\n $filtered[$name] = $group;\n }\n }\n return $filtered;\n }",
"public function getAllGroups(){\n // prepare sql state to get every group information\n $sql = 'SELECT * FROM `'.$this->tableGroup.'`';\n $groups = array();\n $result = $this->execute($sql,$groups);\n while($row = $result->fetchRow()){\n $group = new Group($row);\n $group = $this->addMembersToGroup($group); \n array_push($groups,$group);\n }\n return $groups;\n }",
"protected function processGroups() {\n $pattern = \"\";\n $middleware = [];\n foreach ($this->routeGroups as $group) {\n $pattern .= $group['pattern'];\n if (is_array($group['middleware'])) {\n $middleware = array_merge($middleware, $group['middleware']);\n }\n }\n return [$pattern, $middleware];\n }",
"public function getAllGroups();",
"function sacf_get_groups($all_groups = false) {\n\t$groups = [];\n\tforeach (acf_get_field_groups() as $group) {\n\t\tif (isset($group['local_sacf']) || $all_groups) {\n\t\t\t$groups[] = $group;\n\t\t}\n\t}\n\treturn $groups;\n}",
"static function collect_groups($tile_name) {\n\t\tstatic $cached_groups = array();\n\n\t\tif (!isset($cached_groups[$tile_name])) {\n\n\t\t\t$loc_path = explode('/', $tile_name);\n\t\t\tarray_pop($loc_path);\n\n\t\t\t$groups = array();\n\t\t\t$groups[] = array('_tiles', true); // is group\n\t\t\t$loc = '';\n\n\t\t\twhile ($p = array_shift($loc_path)) {\n\t\t\t\tif (self::is_file_in_tree('tiles/'.$loc.$p.'/_'.$p.'.php')) {\n\t\t\t\t\t$groups[] = array($loc.$p.'/_'.$p, true);\n\t\t\t\t}\n\t\t\t\telse if (self::is_file_in_tree('tiles/'.$loc.$p.'/_grouptile.php')) {\n\t\t\t\t\t$groups[] = array($loc.$p.'/_grouptile', true);\n\t\t\t\t}\n\t\t\t\t$loc .= $p.'/';\n\t\t\t}\n\n\t\t\t$groups[] = array($tile_name, false);\n\n\t\t\t$cached_groups[$tile_name] = $groups;\n\t\t}\n\n\t\treturn $cached_groups[$tile_name];\n\t}",
"public static function make_groups($array, $size)\n {\n $i = 0;\n $groups = array();\n while ($i < count($array))\n {\n $groups[] = array_slice($array, $i, $size);\n $i += $size;\n }\n return $groups;\n }",
"public function getGroups(): ?array;",
"public function groups_for_feed_setting() {\n\t\t\n\t\t$groups = array(\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Choose a CleverReach Group', 'gravityformscleverreach' ),\n\t\t\t\t'value' => ''\t\n\t\t\t)\n\t\t);\n\t\t\n\t\t/* If API isn't initialized, return the groups array. */\n\t\tif ( ! $this->initialize_api() )\n\t\t\treturn $groups;\n\t\t\t\n\t\t/* Get the CleverReach groups. */\n\t\t$cr_groups = $this->api->groupGetList( $this->api_key );\n\t\t\n\t\t/* If request failed or request succeed but there are no groups, return the groups array. */\n\t\tif ( $cr_groups->statuscode == 1 || ( $cr_groups->statuscode == 0 && empty( $cr_groups->data ) ) )\n\t\t\treturn $groups;\n\t\t\n\t\tforeach ( $cr_groups->data as $group ) {\n\t\t\t\n\t\t\t$groups[] = array(\n\t\t\t\t'label' => $group->name,\n\t\t\t\t'value' => $group->id\t\n\t\t\t);\n\t\t\t\n\t\t}\n\n\t\treturn $groups;\n\t\t\n\t}",
"public function createNodeGroups(): array {\n $build = [\n '#type' => 'container',\n '#weight' => 0,\n ];\n\n foreach (static::FIELDS as $field) {\n if (!isset($this->form[$field])) {\n continue;\n }\n $build[$field] = $this->form[$field];\n\n array_walk_recursive($build[$field], [$this, 'removeGroup']);\n }\n return $build;\n }"
] | [
"0.6564525",
"0.6300467",
"0.6204245",
"0.6107033",
"0.61058384",
"0.5901897",
"0.59002817",
"0.58554053",
"0.5810814",
"0.5785121",
"0.57795614",
"0.57795614",
"0.56865424",
"0.56410474",
"0.55087197",
"0.5460042",
"0.54208815",
"0.5413798",
"0.54017454",
"0.5396476",
"0.5386351",
"0.5344658",
"0.53194064",
"0.5313842",
"0.5303",
"0.5293696",
"0.52772653",
"0.5276266",
"0.5241063",
"0.5230167"
] | 0.64709127 | 1 |
Tells whether the Topology entity should be excluded because of feature flags. | private function isFeatureFlagExcluded(Topology $entity): bool
{
$flag = (string) $entity->getTopologyFeatureFlag();
if ('' === $flag) {
return false;
}
return ! in_array($flag, $this->enabledFeatureFlags, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isExcluded(): bool\n {\n return $this->exclude ?? false;\n }",
"public function excluded()\n {\n return $this->_type === 'exclude';\n }",
"private function exclude(): bool\n {\n return ($this->testAnnotations['class']['PostmanExclude'] ?? false)\n || ($this->testAnnotations['method']['PostmanExclude'] ?? false);\n }",
"public function off(string $feature): bool;",
"public function isNegated(): bool;",
"public function isNegated()\n {\n return $this->_isNegated();\n }",
"public function getHideDisabledFlags(): bool\n {\n return $this->hide_disabled_flags;\n }",
"public function isNegate(): bool\n {\n return in_array($this->operation, self::$negateOperators, true);\n }",
"public function isExcludeAll()\n {\n return EntityConfig::EXCLUSION_POLICY_ALL === $this->getExclusionPolicy();\n }",
"public function hasFalseFilter(){\n return $this->_has(3);\n }",
"protected function isExcluded()\n\t{\n\t\t$excluded = 0;\n\t\tPiwik_PostEvent('Tracker.Visit.isExcluded', $excluded);\n\t\tif($excluded)\n\t\t{\n\t\t\tprintDebug(\"Visitor excluded.\");\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isExcluded(){\n return in_array($this->tweetObj->from_user, TwitterConfig::$config['exclude']);\n }",
"public function isNot(): bool\n {\n return $this->not;\n }",
"public function hasExcluded(): bool\n {\n return null !== $this->exclude;\n }",
"public function checkExcept(){\n\t\treturn ( !empty($this->filteringOptions['except']) ) ? true : false;\n\t}",
"public function getReceiveModeExcept()\n {\n return isset($this->settings[self::PARAM_RECEIVE_MODE_EXCEPT])\n ? (bool)$this->settings[self::PARAM_RECEIVE_MODE_EXCEPT]\n : false;\n }",
"public function is_opted_out()\n {\n return (bool) get_option( 'ninja_forms_do_not_allow_tracking', $this->is_freemius_opted_out() );\n }",
"public function canDisable();",
"private function isOff(int $flag) : bool {\n return ($this->options & $flag) === 0;\n }",
"public function isDisabled();",
"public function shouldIgnoreCurrentFilteredAttributesInFaceting()\n {\n return (bool) $this->config['should_ignore_current_filters_in_faceting'];\n }",
"public function isNotActive()\n {\n return (boolean) ! $this->is_active;\n }",
"public function getIsExemptible()\n {\n return $this->is_exemptible;\n }",
"public function isDisabled()\r\n {\r\n return !$this->isEnabled();\r\n }",
"public function getIsRemoved()\n\t{\n\t\t$t = str_replace('t.', '', $this->trashFlagField);\n\t\treturn $this->getOwner()->{$t}==$this->removedFlag;\n\t}",
"public function isNot()\r\n\t{\r\n\t\treturn $this->not === true;\r\n\t}",
"public static function isDisabled() {\n return \\Drupal::state()->get('ds.disabled', FALSE);\n }",
"public function isHidden()\n {\n return 0 !== ($this->getState() & self::STATE_HIDDEN);\n }",
"public function isOff() {\n return $this->state === self::STATE_OFF;\n }",
"public function isHidden() {\n return !$this->_config_helper->hasBeenSetUp();\n }"
] | [
"0.6113268",
"0.598419",
"0.5980463",
"0.59595454",
"0.57117623",
"0.56921446",
"0.5622034",
"0.5620934",
"0.5493805",
"0.5483179",
"0.54828984",
"0.54096895",
"0.5396836",
"0.53960556",
"0.53876126",
"0.5381291",
"0.53509414",
"0.5338703",
"0.5333306",
"0.5276068",
"0.52215385",
"0.5218482",
"0.5197305",
"0.5183384",
"0.51612616",
"0.5127086",
"0.51142144",
"0.50772",
"0.5070265",
"0.50666744"
] | 0.7830231 | 0 |
Add item to NegotiatedFareCode value | public function addToNegotiatedFareCode(\Devlabs91\GenericOtaHotelApiService\StructType\NegotiatedFareCode $item)
{
// validation for constraint: itemType
if (!$item instanceof \Devlabs91\GenericOtaHotelApiService\StructType\NegotiatedFareCode) {
throw new \InvalidArgumentException(sprintf('The NegotiatedFareCode property can only contain items of \Devlabs91\GenericOtaHotelApiService\StructType\NegotiatedFareCode, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
}
$this->NegotiatedFareCode[] = $item;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add($_item)\n\t{\n\t\treturn XiFinancialsTypeFinancialServicesItemTypes::valueIsValid($_item)?parent::add($_item):false;\n\t}",
"public function addToFamilyAttribute($item)\n {\n // validation for constraint: enumeration\n if (!\\EnumType\\HotelReviewFamilyAttribute::valueIsValid($item)) {\n throw new \\InvalidArgumentException(sprintf('Value \"%s\" is invalid, please use one of: %s', $item, implode(', ', \\EnumType\\HotelReviewFamilyAttribute::getValidValues())), __LINE__);\n }\n $this->FamilyAttribute[] = $item;\n return $this;\n }",
"public function addCode(FHIRCoding $code = null)\n {\n $this->code[] = $code;\n return $this;\n }",
"function update_net_fare($token) {\r\n $net_price_summary = array();\r\n $net_fare_tags = array('ServiceTax', 'AdditionalTxnFee', 'AgentCommission', 'TdsOnCommission', 'IncentiveEarned', 'TdsOnIncentive', 'PublishedFare', 'AirTransFee', 'Discount', 'OtherCharges', 'FuelSurcharge', 'TransactionFee', 'ReverseHandlingCharge', 'OfferedFare', 'AgentServiceCharge', 'AgentConvienceCharges');\r\n foreach ($token as $k => $v) {\r\n $fare = $v['Fare'];\r\n foreach ($fare as $fare_k => $fare_v) {\r\n if (in_array($fare_k, $net_fare_tags)) {\r\n if (isset($net_price_summary[$fare_k]) == true) {\r\n $net_price_summary[$fare_k] += $fare_v;\r\n } else {\r\n $net_price_summary[$fare_k] = $fare_v;\r\n }\r\n }\r\n }\r\n }\r\n $net_price_summary['TotalCommission'] = ($net_price_summary['PublishedFare'] - $net_price_summary['OfferedFare']);\r\n return $net_price_summary;\r\n }",
"public function addCode($code)\n {\n $this->_codes[] = (string) $code;\n return $this;\n }",
"public function setItem(int $goodCode)\n {\n }",
"function addItem($item)\n{\n global $service, $config;\n\n $request = new Types\\AddFixedPriceItemRequestType();\n\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $config['sandbox']['userToken'];\n\n $request->Item = $item;\n\n $response = $service->addFixedPriceItem($request);\n\n if (isset($response->Errors)) {\n foreach ($response->Errors as $error) {\n printf(\n \"%s: %s\\n%s\\n\\n\",\n $error->SeverityCode === Enums\\SeverityCodeType::C_ERROR ? 'Error' : 'Warning',\n $error->ShortMessage,\n $error->LongMessage\n );\n }\n }\n\n if ($response->Ack !== 'Failure') {\n printf(\n \"The item was listed to the eBay Sandbox with the Item number %s\\n\",\n $response->ItemID\n );\n }\n}",
"public function setCode( string $value ) : \\Aimeos\\MShop\\Review\\Item\\Iface;",
"function PostProcess_Code(&$item,&$updatedatas)\n {\n if (\n !empty($item[ \"ID\" ])\n &&\n !empty($item[ \"Friend\" ])\n &&\n !empty($item[ \"Event\" ])\n )\n {\n $code=$this->Certificate_Code($item,$this->Certificate_Type);\n if (!empty($code) && empty($item[ \"Code\" ]) || $item[ \"Code\" ]!=$code)\n {\n $item[ \"Code\" ]=$code;\n array_push($updatedatas,\"Code\");\n }\n }\n }",
"public function addToFareInfo(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\AirItineraryPricingInfoType\\FareInfosAType\\FareInfoAType $fareInfo)\n {\n $this->fareInfo[] = $fareInfo;\n return $this;\n }",
"function PostProcess_Code(&$item,&$updatedatas)\n {\n if (\n !empty($item[ \"ID\" ])\n &&\n !empty($item[ \"Friend\" ])\n &&\n !empty($item[ \"Event\" ])\n )\n {\n $code=$this->Certificate_Code($item);\n if (!empty($code) && empty($item[ \"Code\" ]) || $item[ \"Code\" ]!=$code)\n {\n $item[ \"Code\" ]=$code;\n array_push($updatedatas,\"Code\");\n }\n }\n }",
"function add_item($num, $code) {\n $CI = &get_instance();\n \n // If an item of the given type already is already ordered, update it's quantity.\n if ($CI->orderitems->exists($num, $code)) {\n $record = $CI->orderitems->get($num, $code);\n $record->quantity++;\n $CI->orderitems->update($record);\n }\n // If no item of the given type is already ordered, add a new one to the order.\n else {\n $record = $CI->orderitems->create();\n $record->order = $num;\n $record->item = $code;\n $record->quantity = 1;\n $CI->orderitems->add($record);\n }\n }",
"public function addToFareBaggageAllowance(\\Devlabs91\\GenericOtaHotelApiService\\StructType\\FareBaggageAllowance $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Devlabs91\\GenericOtaHotelApiService\\StructType\\FareBaggageAllowance) {\n throw new \\InvalidArgumentException(sprintf('The FareBaggageAllowance property can only contain items of \\Devlabs91\\GenericOtaHotelApiService\\StructType\\FareBaggageAllowance, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->FareBaggageAllowance[] = $item;\n return $this;\n }",
"public function addToPromoCodes(string $item): self\n {\n // validation for constraint: itemType\n if (!is_string($item)) {\n throw new InvalidArgumentException(sprintf('The PromoCodes property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->PromoCodes[] = $item;\n \n return $this;\n }",
"public function add(string $item, $value);",
"function add() {\n\t\tif(isset($this->data['Code'])){\n\t\t\t$this->data['Code']['remianing_signups'] = $this->data['Code']['signups'];\n\t\t\t$this->data['Code'] = $this->Utility->stripTags($this->data['Code']);\n\t\t\tif($this->Code->save($this->data['Code'])){\n\t\t\t\t$this->Session->setFlash('Code has been added successfuly.', 'success');\n\t\t\t\t$this->redirect(\"/admin/codes\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t$conditions = array('Code.remianing_signups >'=>0);\n\t\t$this->paginate = array(\n\t\t\t\t\t\t 'conditions' => $conditions,\n\t\t\t\t\t\t\t'limit' => 10, // put display per page\n\t\t\t\t\t\t);\n\t\t$code = $this->paginate(\"Code\");\n\t\t$codes = $this->set('codes',$code);\n\t\t$codeValue = $this->set('codeValue',$this->Code);\n\t}",
"public function addLists(\\RO\\Cmd\\TodayFinanceItem $value){\n return $this->_add(6, $value);\n }",
"protected function _addAdditionalInformation(&$item)\n {\n }",
"function add_item($num, $code) {\n \n\t\t// if the order exists...\n\t\tif($this->exists($num))\n\t\t{\n\t\t\t// if the item exists in this order, increment the quantity!\n\t\t\tif($this->orderitems->exists($num, $code))\n\t\t\t{\n\t\t\t\t$orderItem = $this->orderitems->get($num, $code);\n\t\t\t\t$qty = $orderItem->quantity;\n\t\t\t\t\n\t\t\t\t$qty++;\n\t\t\t\t$orderItem->quantity = $qty;\n\t\t\t\t\n\t\t\t\t$this->orderitems->update($orderItem);\n\t\t\t}\n\t\t\telse // otherwise, insert a record\n\t\t\t{\n\t\t\t\t$orderItem = $this->orderitems->create();\n\t\t\t\t$orderItem->order = $num;\n\t\t\t\t$orderItem->item = $code;\n\t\t\t\t$orderItem->quantity = 1;\n\t\t\t\t\n\t\t\t\t$this->orderitems->add($orderItem);\n\t\t\t}\n\t\t}\n }",
"public function setCode( string $value ) : \\Aimeos\\MShop\\Review\\Item\\Iface\n\t{\n\t\treturn $this->set( 'review.code', $this->checkCode( $value ) );\n\t}",
"public function addValue($value);",
"public function addValue($value);",
"public function addItem();",
"function buildItem()\n{\n /**\n * Begin creating the fixed price item.\n */\n $item = new Types\\ItemType();\n\n /**\n * We want a multiple quantity fixed price listing.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_FIXED_PRICE_ITEM;\n $item->Quantity = 99;\n\n /**\n * Let the listing be automatically renewed every 30 days until cancelled.\n */\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_GTC;\n\n /**\n * The cost of the item is $19.99.\n * Note that we don't have to specify a currency as eBay will use the site id\n * that we provided earlier to determine that it will be United States Dollars (USD).\n */\n $item->StartPrice = new Types\\AmountType(['value' => 19.99]);\n\n /**\n * Allow buyers to submit a best offer.\n */\n $item->BestOfferDetails = new Types\\BestOfferDetailsType();\n $item->BestOfferDetails->BestOfferEnabled = true;\n\n /**\n * Automatically accept best offers of $17.99 and decline offers lower than $15.99.\n */\n $item->ListingDetails = new Types\\ListingDetailsType();\n $item->ListingDetails->BestOfferAutoAcceptPrice = new Types\\AmountType(['value' => 17.99]);\n $item->ListingDetails->MinimumBestOfferPrice = new Types\\AmountType(['value' => 15.99]);\n\n /**\n * Provide a title and description and other information such as the item's location.\n * Note that any HTML in the title or description must be converted to HTML entities.\n */\n $item->Title = 'Bits & Bobs';\n $item->Description = '<h1>Bits & Bobs</h1><p>Just some <stuff> I found.</p>';\n $item->SKU = 'ABC-001';\n $item->Country = 'US';\n $item->Location = 'Beverly Hills';\n $item->PostalCode = '90210';\n /**\n * This is a required field.\n */\n $item->Currency = 'USD';\n\n /**\n * Display a picture with the item.\n */\n $item->PictureDetails = new Types\\PictureDetailsType();\n $item->PictureDetails->GalleryType = Enums\\GalleryTypeCodeType::C_GALLERY;\n $item->PictureDetails->PictureURL = ['http://lorempixel.com/1500/1024/abstract'];\n\n /**\n * List item in the Books > Audiobooks (29792) category.\n */\n $item->PrimaryCategory = new Types\\CategoryType();\n $item->PrimaryCategory->CategoryID = '29792';\n\n /**\n * Tell buyers what condition the item is in.\n * For the category that we are listing in the value of 1000 is for Brand New.\n */\n $item->ConditionID = 1000;\n\n /**\n * Buyers can use one of two payment methods when purchasing the item.\n * Visa / Master Card\n * PayPal\n * The item will be dispatched within 1 business days once payment has cleared.\n * Note that you have to provide the PayPal account that the seller will use.\n * This is because a seller may have more than one PayPal account.\n */\n $item->PaymentMethods = [\n 'VisaMC',\n 'PayPal'\n ];\n $item->PayPalEmailAddress = '[email protected]';\n $item->DispatchTimeMax = 1;\n\n /**\n * Setting up the shipping details.\n * We will use a Flat shipping rate for both domestic and international.\n */\n $item->ShippingDetails = new Types\\ShippingDetailsType();\n $item->ShippingDetails->ShippingType = Enums\\ShippingTypeCodeType::C_FLAT;\n\n /**\n * Create our first domestic shipping option.\n * Offer the Economy Shipping (1-10 business days) service at $2.00 for the first item.\n * Additional items will be shipped at $1.00.\n */\n $shippingService = new Types\\ShippingServiceOptionsType();\n $shippingService->ShippingServicePriority = 1;\n $shippingService->ShippingService = 'Other';\n $shippingService->ShippingServiceCost = new Types\\AmountType(['value' => 2.00]);\n $shippingService->ShippingServiceAdditionalCost = new Types\\AmountType(['value' => 1.00]);\n $item->ShippingDetails->ShippingServiceOptions[] = $shippingService;\n\n /**\n * Create our second domestic shipping option.\n * Offer the USPS Parcel Select (2-9 business days) at $3.00 for the first item.\n * Additional items will be shipped at $2.00.\n */\n $shippingService = new Types\\ShippingServiceOptionsType();\n $shippingService->ShippingServicePriority = 2;\n $shippingService->ShippingService = 'USPSParcel';\n $shippingService->ShippingServiceCost = new Types\\AmountType(['value' => 3.00]);\n $shippingService->ShippingServiceAdditionalCost = new Types\\AmountType(['value' => 2.00]);\n $item->ShippingDetails->ShippingServiceOptions[] = $shippingService;\n\n /**\n * Create our first international shipping option.\n * Offer the USPS First Class Mail International service at $4.00 for the first item.\n * Additional items will be shipped at $3.00.\n * The item can be shipped Worldwide with this service.\n */\n $shippingService = new Types\\InternationalShippingServiceOptionsType();\n $shippingService->ShippingServicePriority = 1;\n $shippingService->ShippingService = 'USPSFirstClassMailInternational';\n $shippingService->ShippingServiceCost = new Types\\AmountType(['value' => 4.00]);\n $shippingService->ShippingServiceAdditionalCost = new Types\\AmountType(['value' => 3.00]);\n $shippingService->ShipToLocation = ['WorldWide'];\n $item->ShippingDetails->InternationalShippingServiceOption[] = $shippingService;\n\n /**\n * Create our second international shipping option.\n * Offer the USPS Priority Mail International (6-10 business days) service at $5.00 for the first item.\n * Additional items will be shipped at $4.00.\n * The item will only be shipped to the following locations with this service.\n * N. and S. America\n * Canada\n * Australia\n * Europe\n * Japan\n */\n $shippingService = new Types\\InternationalShippingServiceOptionsType();\n $shippingService->ShippingServicePriority = 2;\n $shippingService->ShippingService = 'USPSPriorityMailInternational';\n $shippingService->ShippingServiceCost = new Types\\AmountType(['value' => 5.00]);\n $shippingService->ShippingServiceAdditionalCost = new Types\\AmountType(['value' => 4.00]);\n $shippingService->ShipToLocation = [\n 'Americas',\n 'CA',\n 'AU',\n 'Europe',\n 'JP'\n ];\n $item->ShippingDetails->InternationalShippingServiceOption[] = $shippingService;\n\n /**\n * The return policy.\n * Returns are accepted.\n * A refund will be given as money back.\n * The buyer will have 14 days in which to contact the seller after receiving the item.\n * The buyer will pay the return shipping cost.\n */\n $item->ReturnPolicy = new Types\\ReturnPolicyType();\n $item->ReturnPolicy->ReturnsAcceptedOption = 'ReturnsAccepted';\n $item->ReturnPolicy->RefundOption = 'MoneyBack';\n $item->ReturnPolicy->ReturnsWithinOption = 'Days_14';\n $item->ReturnPolicy->ShippingCostPaidByOption = 'Buyer';\n\n return $item;\n}",
"public function setCode( $code );",
"public function addAddlist( $value){\n return $this->_add(3, $value);\n }",
"public function add()\n {\n if ((float)$this->conversion_rate <= 0)\n return false;\n\n if(JeproshopCurrencyModelCurrency::exists($this->iso_code, $this->iso_code_num)){\n return false;\n }else{\n return parent::add($autodate, $nullValues);\n }\n }",
"function addcar_item($item){\n \n $authRes = getAuthKey();\n $accessKey = $authRes['accessKey'];\n $accessSecret = $authRes['accessSecret']; \n $json=[\"hotelogix\"=>[\"version\"=>\"1.0\",\"datetime\"=>gmdate(\"Y-m-d\\TH:i:s\"),\"request\"=>[\"method\"=>\"addtocart\",\"key\"=>$accessKey,\"languagecode\"=>\"en\",\"data\"=>[\"itemid\"=>[\"value\"=>$item]]]]];\n error_log(\"shashi === 222 \".json_encode($json));\n $resXmlDom = postCurl('addtocart', json_encode($json), $accessSecret, TRUE);\n return json_decode($resXmlDom);\n\n}",
"public function addItem($item) {\n if ($this->type == self::TYPE_CNC) {\n \t$item->setCNC($item->getProduct()->getCNC());\n } elseif ($this->type == self::TYPE_FULL) {\n \t$item->setFullServicePrice($item->getProduct()->getFullServicePrice());\n } elseif ($this->type == self::TYPE_STANDARD) {\n \t$item->setNoServicePrice($item->getProduct()->getNoServicePrice());\n }\n \n\t\t$this->items[] = $item;\n\t\t$item->setTransaction($this);\n\t}",
"public function addCode($code)\n {\n $this->_code .= \"$code\\n\";\n }"
] | [
"0.54173726",
"0.53886235",
"0.52488005",
"0.5213296",
"0.51239353",
"0.51114076",
"0.5086241",
"0.50597894",
"0.5048805",
"0.5043758",
"0.5031072",
"0.49976426",
"0.4989456",
"0.49156374",
"0.48904482",
"0.48696995",
"0.47258365",
"0.47089663",
"0.4700049",
"0.46722293",
"0.4664297",
"0.4664297",
"0.46537724",
"0.46536055",
"0.4606559",
"0.4593422",
"0.4592448",
"0.45702434",
"0.454485",
"0.4523202"
] | 0.7415723 | 0 |
Add item to RebookOption value | public function addToRebookOption(\Devlabs91\GenericOtaHotelApiService\StructType\RebookOption $item)
{
// validation for constraint: itemType
if (!$item instanceof \Devlabs91\GenericOtaHotelApiService\StructType\RebookOption) {
throw new \InvalidArgumentException(sprintf('The RebookOption property can only contain items of \Devlabs91\GenericOtaHotelApiService\StructType\RebookOption, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
}
$this->RebookOption[] = $item;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pod_add_option_to_order_items($item, $cart_item_key, $values, $order) {\n\tif (empty($values['option-product'])) {\n\t\treturn;\n\t}\n\n\t$item->add_meta_data(__('Gicléeprint op', 'iconic'), $values['option-product']);\n\t$item->add_meta_data(__('Formaat', 'iconic2'), $values['option-formaat']);\n\tif($values['option-lijst'] != \"\") {\n\t\t$item->add_meta_data(__('Lijst', 'iconic3'), $values['option-lijst']);\n\t}\n}",
"public function addItemData($item, $data)\n {\n $option = array(\n 'product_id' => $item->getProductId(),\n 'product' => $item->getProduct(),\n 'code' => 'personalization',\n 'value' => serialize($data)\n ); \n $item->addOption($option); \n }",
"public function addOption(): OptionerContract;",
"public function addToOptionId($item)\n {\n // validation for constraint: itemType\n if (!is_string($item)) {\n throw new \\InvalidArgumentException(sprintf('The OptionId property can only contain items of string, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->OptionId[] = $item;\n return $this;\n }",
"function get_add_to_budget_line_items_options(){\n return array(\n 'budget_details' => 'Annual Budget',\n 'cash_calls' => 'Cash Calls',\n 'performance_returns' => 'Performance Returns',\n );\n }",
"public function addItem();",
"protected function setupOtherOptions()\n\t{\n\t\tglobal $Language, $Security;\n\t\t$option = $this->OtherOptions[\"addedit\"];\n\t\t$option->UseDropDownButton = FALSE;\n\t\t$option->DropDownButtonPhrase = $Language->phrase(\"ButtonAddEdit\");\n\t\t$option->UseButtonGroup = TRUE;\n\n\t\t//$option->ButtonClass = \"\"; // Class for button group\n\t\t$item = &$option->add($option->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->Visible = FALSE;\n\n\t\t// Add\n\t\tif ($this->CurrentMode == \"view\") { // Check view mode\n\t\t\t$item = &$option->add(\"add\");\n\t\t\t$addcaption = HtmlTitle($Language->phrase(\"AddLink\"));\n\t\t\t$this->AddUrl = $this->getAddUrl();\n\t\t\tif (IsMobile())\n\t\t\t\t$item->Body = \"<a class=\\\"ew-add-edit ew-add\\\" title=\\\"\" . $addcaption . \"\\\" data-caption=\\\"\" . $addcaption . \"\\\" href=\\\"\" . HtmlEncode($this->AddUrl) . \"\\\">\" . $Language->phrase(\"AddLink\") . \"</a>\";\n\t\t\telse\n\t\t\t\t$item->Body = \"<a class=\\\"ew-add-edit ew-add\\\" title=\\\"\" . $addcaption . \"\\\" data-table=\\\"ipc_tracking\\\" data-caption=\\\"\" . $addcaption . \"\\\" href=\\\"#\\\" onclick=\\\"return ew.modalDialogShow({lnk:this,btn:'AddBtn',url:'\" . HtmlEncode($this->AddUrl) . \"'});\\\">\" . $Language->phrase(\"AddLink\") . \"</a>\";\n\t\t\t$item->Visible = $this->AddUrl != \"\" && $Security->canAdd();\n\t\t}\n\t}",
"public function rsepro_addOptions() {\n\t\tif ($this->canRun())\n\t\t\treturn JHTML::_('select.option', $this->rsprooption, JText::_('COM_RSEVENTSPRO_PLG_PLUGIN_PAYPAL_NAME'));\n\t\telse return JHTML::_('select.option', '', '');\n\t}",
"public function add($id,$item,$qty,$option=null);",
"public function appendItem($value = NULL);",
"function addOption($option, $value=\"\")\n {\n if ($value!=0 && empty($value)) $value = $option;\n $currentOptions = $this->_get(\"options\");\n $currentOptions[] = $option;\n $this->_set(\"options\", $currentOptions);\n\n $currentValues = $this->_get(\"values\");\n $currentValues[] = $value;\n $this->_set(\"values\", $currentValues);\n\n $this->createLookupArray($currentOptions,$currentValues);\n return $this;\n }",
"function addTypeOption($a_type, $type, $item = null)\n\t{\n\t\tglobal $lng;\n\n\t\tswitch ($a_type)\n\t\t{\n\t\t\tcase lfCustomMenu::ITEM_TYPE_SEPARATOR:\n\t\t\t\t$sep = new ilRadioOption($this->getPluginObject()->txt(\"separator\"), lfCustomMenu::ITEM_TYPE_SEPARATOR,\n\t\t\t\t\t\"\");\n\t\t\t\t$type->addOption($sep);\n\t\t\t\tbreak;\n\n\t\t\tcase lfCustomMenu::ITEM_TYPE_FEATURE:\n\t\t\t\t$tfeat = new ilRadioOption($this->getPluginObject()->txt(\"feature\"), lfCustomMenu::ITEM_TYPE_FEATURE,\n\t\t\t\t\t\"\");\n\t\t\t\t$type->addOption($tfeat);\n\t\t\t\t// features\n\t\t\t\t$options = array();\n\t\t\t\tforeach ($this->getPluginObject()->getFeatureMenuEntries() as $f)\n\t\t\t\t{\n\t\t\t\t\t$options[$f[\"service_id\"].\":\".$f[\"feature_id\"]] = $f[\"full_title\"];\n\t\t\t\t}\n\t\t\t\t$feat = new ilSelectInputGUI($this->getPluginObject()->txt(\"feature\"), \"feature_id\");\n\t\t\t\t$feat->setOptions($options);\n\t\t\t\t$tfeat->addSubItem($feat);\n\t\t\t\tif ($item != null)\n\t\t\t\t{\n\t\t\t\t\t$feat->setValue($item[\"feature_id\"]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase lfCustomMenu::ITEM_TYPE_URL:\n\t\t\t\t$turl = new ilRadioOption($lng->txt(\"url\"), lfCustomMenu::ITEM_TYPE_URL,\n\t\t\t\t\t\"\");\n\t\t\t\t$type->addOption($turl);\n\n\t\t\t\t// target\n\t\t\t\t$target = new ilTextInputGUI($this->getPluginObject()->txt(\"target\"), \"target\");\n\t\t\t\t$target->setMaxLength(200);\n\t\t\t\t$turl->addSubItem($target);\n\n\t\t\t\t// new window?\n\t\t\t\t$nw = new ilCheckboxInputGUI($this->getPluginObject()->txt(\"newwin\"), \"newwin\");\n\t\t\t\t$turl->addSubItem($nw);\n\n\t\t\t\t// access check ref id\n\t\t\t\t$acc_ref_id = new ilNumberInputGUI($this->getPluginObject()->txt(\"access_check_ref_id\"), \"acc_ref_id\");\n\t\t\t\t$acc_ref_id->setInfo($this->getPluginObject()->txt(\"access_check_ref_id_info\"));\n\t\t\t\t$acc_ref_id->setMaxLength(8);\n\t\t\t\t$acc_ref_id->setSize(8);\n\t\t\t\t$turl->addSubItem($acc_ref_id);\n\n\t\t\t\t// access check permission\n\t\t\t\t$options = array(\"visible\" => \"visible\",\n\t\t\t\t\t\"read\" => \"read\",\n\t\t\t\t\t\"write\" => \"write\");\n\t\t\t\t$acc_perm = new ilSelectInputGUI($this->getPluginObject()->txt(\"permission\"), \"acc_perm\");\n\t\t\t\t$acc_perm->setInfo($this->getPluginObject()->txt(\"access_check_permission_info\"));\n\t\t\t\t$acc_perm->setOptions($options);\n\t\t\t\t$acc_perm->setValue(\"read\");\n\t\t\t\t$turl->addSubItem($acc_perm);\n\t\t\t\tif ($item != null)\n\t\t\t\t{\n\t\t\t\t\t$target->setValue($item[\"target\"]);\n\t\t\t\t\t$acc_perm->setValue($item[\"acc_perm\"]);\n\t\t\t\t\t$nw->setChecked($item[\"newwin\"]);\n\t\t\t\t\tif ((int) $item[\"acc_ref_id\"] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$acc_ref_id->setValue($item[\"acc_ref_id\"]);\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$acc_ref_id->setValue(\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase lfCustomMenu::ITEM_TYPE_REF_ID:\n\t\t\t\t$tref = new ilRadioOption($this->getPluginObject()->txt(\"ref_id\"), lfCustomMenu::ITEM_TYPE_REF_ID,\n\t\t\t\t\t\"\");\n\t\t\t\t$type->addOption($tref);\n\t\t\t\t// access check ref id\n\t\t\t\t$ref_id = new ilNumberInputGUI($this->getPluginObject()->txt(\"ref_id\"), \"ref_id\");\n\t\t\t\t//$ref_id->setInfo($this->getPluginObject()->txt(\"access_check_ref_id_info\"));\n\t\t\t\t$ref_id->setMaxLength(8);\n\t\t\t\t$ref_id->setSize(8);\n\t\t\t\t$tref->addSubItem($ref_id);\n\t\t\t\tif ($item != null)\n\t\t\t\t{\n\t\t\t\t\t$ref_id->setValue($item[\"ref_id\"]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase lfCustomMenu::ITEM_TYPE_ADMIN:\n\t\t\t\t$adm = new ilRadioOption($this->getPluginObject()->txt(\"administration\"), lfCustomMenu::ITEM_TYPE_ADMIN,\n\t\t\t\t\t\"\");\n\t\t\t\t$type->addOption($adm);\n\t\t\t\tbreak;\n\n\t\t}\n\t}",
"public function add(string $item, $value);",
"public function addItem($item);",
"function bbp_add_options()\n{\n}",
"public function add_list_item() {\n\t\t\tcheck_ajax_referer( 'prince', 'nonce' );\n\t\t\tprince_list_item_view( esc_attr( $_REQUEST['name'] ), esc_attr( $_REQUEST['count'] ), array(), esc_attr( $_REQUEST['post_id'] ), esc_attr( $_REQUEST['get_option'] ), unserialize( prince_decode( esc_attr( $_REQUEST['settings'] ) ) ), esc_attr( $_REQUEST['type'] ) );\n\t\t\tdie();\n\t\t}",
"protected function setupOtherOptions()\n\t{\n\t\tglobal $Language, $Security;\n\t\t$option = $this->OtherOptions[\"addedit\"];\n\t\t$option->UseDropDownButton = FALSE;\n\t\t$option->DropDownButtonPhrase = $Language->phrase(\"ButtonAddEdit\");\n\t\t$option->UseButtonGroup = TRUE;\n\n\t\t//$option->ButtonClass = \"\"; // Class for button group\n\t\t$item = &$option->add($option->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->Visible = FALSE;\n\n\t\t// Add\n\t\tif ($this->CurrentMode == \"view\") { // Check view mode\n\t\t\t$item = &$option->add(\"add\");\n\t\t\t$addcaption = HtmlTitle($Language->phrase(\"AddLink\"));\n\t\t\t$this->AddUrl = $this->getAddUrl();\n\t\t\t$item->Body = \"<a class=\\\"ew-add-edit ew-add\\\" title=\\\"\" . $addcaption . \"\\\" data-caption=\\\"\" . $addcaption . \"\\\" href=\\\"\" . HtmlEncode($this->AddUrl) . \"\\\">\" . $Language->phrase(\"AddLink\") . \"</a>\";\n\t\t\t$item->Visible = $this->AddUrl != \"\" && $Security->canAdd();\n\t\t}\n\t}",
"public static function add_other_option() {\n\t\tFrmAppHelper::permission_check( 'frm_edit_forms' );\n\t\tcheck_ajax_referer( 'frm_ajax', 'nonce' );\n\n\t\t$id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );\n\t\t$opt_type = FrmAppHelper::get_post_param( 'opt_type', '', 'sanitize_text_field' );\n\t\t$opt_key = FrmAppHelper::get_post_param( 'opt_key', 0, 'absint' );\n\n\t\t$field = FrmField::getOne( $id );\n\t\t$field_data = $field;\n\t\t$field = (array) $field;\n\n\t\t$field['separate_value'] = isset( $field_data->field_options['separate_value'] ) ? $field_data->field_options['separate_value'] : 0;\n\t\tunset( $field_data );\n\n\t\t$field['html_name'] = 'item_meta[' . $field['id'] . ']';\n\t\t$field['options'] = array( 'other_' . $opt_key => __( 'Other', 'formidable-pro' ) );\n\t\tFrmFieldsHelper::show_single_option( $field );\n\n\t\twp_die();\n\t}",
"function dbFieldOptionAdd(& $dbo, & $field_id, & $option) {\n\n\t// ensure field_id exists\n\tif (!dbFieldCheck($dbo, $field_id) || empty ($option))\n\t\treturn false;\n\n\t// set option(s) into array\n\trequire_once (bm_baseDir.'/inc/lib.txt.php');\n\t$options = quotesplit($option);\n\n\t// get existing option(s)\t\n\t$sql = 'SELECT field_options FROM '.$dbo->table['subscriber_fields'].' WHERE field_id=\\''.$field_id.'\\'';\n\t$oldoptions = quotesplit($dbo->query($sql, 0));\n\n\t// merge old options with new ones, getting rid of any duplicates\n\tif (!empty ($oldoptions))\n\t\t$options = array_unique(array_merge($oldoptions, $options));\n\n\t// add new options to field in DB, exploding array to csv with array2csv function.\n\t$sql = 'UPDATE '.$dbo->table['subscriber_fields'].' SET field_options=\\''.addslashes(array2csv($options)).'\\' WHERE field_id=\\''.$field_id.'\\' LIMIT 1';\n\treturn $dbo->affected($sql);\n}",
"public function addPollerOption($optionText,$pollerOrder)\n\t{\n\t\t$obj = array('pollerID' => \"$this->ID\", 'optionText' => \"$optionText\", 'pollerOrder' => \"$pollerOrder\");\n\t\t$this->msql->Insert(DB_PREF.'poller_option', $obj);\t\n\t}",
"protected function addItem() {\n\n }",
"public function add( $item );",
"public function addItem(Item $item);",
"public function add($item);",
"public function add($item);",
"public function add($item);",
"function pod_add_option_to_cart_item($cart_item_data, $product_id, $variation_id) {\n\t$product_type = get_the_terms( $product_id,'product_type')[0]->slug;\n\tif($product_type != \"custom\") {\n\t\treturn;\n\t}\n\t\n\t$option_product = filter_input(INPUT_POST, 'option-product');\n\t$option_formaat = filter_input(INPUT_POST, 'option-formaat');\n\t$option_lijst = filter_input(INPUT_POST, 'option-lijst');\n\t\n\t$lang = filter_input(INPUT_POST, 'lang');\n\t\n\tif(empty($option_product)) {\n\t\treturn $cart_item_data;\n\t}\n\tif(empty( $option_formaat)) {\n\t\treturn $cart_item_data;\n\t}\n\t\n\t$cart_item_data['option-product'] = $option_product;\n\t$cart_item_data['option-formaat'] = $option_formaat;\n\t$cart_item_data['option-lijst'] = $option_lijst;\n\t$cart_item_data['lang'] = $lang;\n\t\n\treturn $cart_item_data;\n}",
"function kibooUpdateOption($key, $value){\n $options = kibooGetOption();\n $options[$key] = $value;\n $serialized = serialize($options);\n update_option('kiboo_options', $serialized);\n\n}",
"public function add_custom_options($item) {\n\n\t\t\tforeach($this->_options as $option => $params) {\n\t\t\t\t$item->$option = get_post_meta($item->ID, $option, true);\n\t\t\t\tif ($item->$option===false) {\n\t\t\t\t\t$item->$option = $params['default'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $item;\n\t\t}",
"function AddOption($IdValue, $DisplayValue, $ItemAppend = '') {\n\t\t$this->aOptions[] = array('IdValue' => $IdValue, 'DisplayValue' => $DisplayValue, 'ItemAppend' => $ItemAppend);\n\t}"
] | [
"0.6128227",
"0.6103059",
"0.6046209",
"0.6034307",
"0.5899743",
"0.58917576",
"0.58477384",
"0.5846576",
"0.5839205",
"0.57796335",
"0.57175326",
"0.57133526",
"0.5711399",
"0.5696464",
"0.5669865",
"0.5655573",
"0.5647619",
"0.5591798",
"0.5576257",
"0.5573154",
"0.5527331",
"0.55240834",
"0.5499863",
"0.54779786",
"0.54779786",
"0.54779786",
"0.5458151",
"0.5453552",
"0.5446807",
"0.53989744"
] | 0.6945635 | 0 |
Verify setting file data | private function _verifyFile($file, $file_data)
{
foreach($this->default_settings as $default_setting) {
if(!isset($file_data[$default_setting])) {
throw new SettingFileException($default_setting, $file);
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function verifySettings()\n {\n if(count($this->settings)>0)return true;else return false;\n }",
"public function testFileChecks() {\n\t\t$this->assertTrue($this->IpLocation->hasCountryData() === is_file($this->IpLocation->countryDataFile));\n\t\t$this->assertTrue($this->IpLocation->hasCityData() === is_file($this->IpLocation->cityDataFile));\n\t}",
"private function _checkConfigFile()\n {\n return !!file_exists(App::pluginPath('Gallery') . 'Config' . DS . 'config.php');\n }",
"public function testCreateConfigFileReturnBoolean()\n {\n $settings = new \\Gomail\\Database\\FileHandler\\DatabaseSettingsFileHandler();\n $this->assertTrue($settings->createConfigFile());\n }",
"private function validate()\n {\n // Now\n if (!is_array($this->fileContents[\"now\"])) {\n $this->fileContents[\"now\"] = array();\n }\n if (!is_array($this->fileContents[\"now\"][\"users\"])) {\n $this->fileContents[\"now\"][\"users\"] = array();\n }\n\n // Daily\n if (!is_array($this->fileContents[\"daily\"])) {\n $this->fileContents[\"daily\"] = array();\n }\n if (!is_int($this->fileContents[\"daily\"][\"day\"])) {\n $this->fileContents[\"daily\"][\"day\"] = intval(date(\"d\"));\n }\n if (!is_array($this->fileContents[\"daily\"][\"users\"])) {\n $this->fileContents[\"daily\"][\"users\"] = array();\n }\n\n // Total\n if (!is_array($this->fileContents[\"total\"])) {\n $this->fileContents[\"total\"] = array();\n }\n if (!is_int($this->fileContents[\"total\"][\"count\"])) {\n $this->fileContents[\"total\"][\"count\"] = 0;\n }\n }",
"public function validateFile(){\n\t\t\t\n\t\t}",
"private function settings_are_valid() {\n\n\t\t// Get the plugin settings\n\t\t$settings = get_option('xero');\n\n\t\t// Define what is required\n\t\t$required = array(\n\t\t\t'sales_account', 'consumer_key', 'consumer_secret', 'private_key', 'public_key'\n\t\t);\n\n\t\tif ( isset( $settings['invoice_payments'] ) ) {\n\t\t\t$required[] = 'payments_account';\n\t\t}\n\n\t\t// Loop through and send back false if a required setting is missed\n\t\tforeach( $required as $setting ) {\n\t\t\tif ( !isset( $settings[ $setting ] ) || empty( $settings[ $setting ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\n\t}",
"public function checkData();",
"private function checkInputFile(): bool\n {\n return true;\n }",
"private function checkFile()\n {\n $this->err_no_file = false;\n\n if ( !(isset($this->file['size']) && (int) $this->file['size']) )\n $this->err_no_file = true;\n\n return $this->err_no_file;\n }",
"function checkSettings()\n\t{\n\t\t// trim any spaces\n\t\t$this->merchant['account_id'] \t= \ttrim($this->merchant['account_id']);\n\t\t$this->merchant['site_id'] \t= \ttrim($this->merchant['site_id']);\n\t\t$this->merchant['site_code'] \t= \ttrim($this->merchant['site_code']);\n\t}",
"public function testValidatePath(){\n $template = array(\n 'path' => Settings::MANDATORY | Settings::PATH,\n 'dir' => Settings::PATH,\n );\n $this->config->path = __FILE__;\n $this->config->dir = dirname(__FILE__);\n // test\n $this->assertTrue( $this->config->validate($template) );\n }",
"public function validateConfig();",
"protected function checkConfig() {\n\t\t$public_ssl_key = $this->config->getSetting('public_ssl_key');\n\t\t$this->debug(\"configcheck public_ssl_key\", !empty($public_ssl_key));\n\t\tif (empty($public_ssl_key)) {\n\t\t\treturn $this->throwError(\"sslkey_missingconf\");\n\t\t}\n\t\t$this->debug(\"try to open '\".$this->config->getSetting('public_ssl_key').\"'\", file_exists($this->config->getSetting('public_ssl_key')));\n\t\tif (!file_exists($this->config->getSetting('public_ssl_key'))) {\n\t\t\treturn $this->throwError(\"sslkey_missingfile\");\n\t\t}\n\t\t$tokensfile = $this->config->getSetting('tokensfile');\n\t\t$this->debug(\"configcheck tokensfile\", !empty($tokensfile));\n\t\tif (empty($tokensfile)) {\n\t\t\treturn $this->throwError(\"usedtokens_missingconf\");\n\t\t}\n\t\t$loglevel = $this->config->getSetting('loglevel');\n\t\tif ((int)$this->config->getSetting('loglevel') == 0) {\n\t\t\t$this->debug(\"Logging is disabled\", true);\n\t\t}\n\t\telse {\n\t\t\t$logfile = $this->config->getSetting('logfile');\n\t\t\t$this->debug(\"configcheck logfile\", !empty($logfile));\n\t\t\tif (empty($logfile)) {\n\t\t\t\treturn $this->throwError(\"logfile_missingconf\");\n\t\t\t}\n\t\t}\n\t\tif ((boolean)$this->config->getSetting('externalOpenssl') && (!(boolean)$this->config->getSetting('tmp_signature_dir'))) {\t\n\t\t\treturn $this->throwError(\"tmp_signature_dir_missingconf\");\n\t\t}\n\t\tif (self::DEBUG) {\n\t\t\t$this->config->getErrorhandler()->debugErrorMessages();\n\t\t}\n\t\treturn true;\n\t}",
"public function verify()\n\t{\n\t\tif (empty($this->data->name))\n\t\t{\n\t\t\tthrow new \\Exception(Lang::txt('No option group name set'));\n\t\t}\n\t\tif (empty($this->data->optionGroupId))\n\t\t{\n\t\t\tthrow new \\Exception(Lang::txt('No option group set'));\n\t\t}\n\n\t\treturn true;\n\t}",
"private function checkConfig(): void\n {\n if (empty($this->userkey)) {\n Log::warning('Config \"message.zenziva.userkey\" is not defined.');\n }\n\n if (empty($this->passkey)) {\n Log::warning('Config \"message.zenziva.passkey\" is not defined.');\n }\n }",
"protected function validateConfig()\n {\n return true;\n }",
"public function ensureThatDataFileCheckReturnsBooleanRespose()\n {\n $this->assertTrue(is_bool($this->rdrData->doesDataFileExist()));\n }",
"private function validate_config() : void {\n\t\t$validation = Schema::import( $this->config_schema );\n\t\t$validation->in( $this->config );\n\t}",
"public function validateFileStructure() {\n\n\t\t// if home directory is not defined, create this one now.\n\t\tif (!is_dir($this->settings['documentsCache'])) {\n\t\t\t// @todo: check whether a set up action would be preferable\n\t\t\t//throw new Exception('Exception thrown #1294746784: temp directory does not exist \"' . $this->settings['documentsCache'] . '\". Run command setUp', 1294746784);\n\t\t\ttry {\n\t\t\t\tt3lib_div::mkdir($this->settings['documentsCache']);\n\t\t\t} catch (Exception $e) {\n\t\t\t\tTx_TerDoc_Utility_Cli::log($e->getMessage());\n\t\t\t}\n\t\t}\n\n\t\t// Check if configuration is valid ...and throw error if that is not the case\n\t\tif (!is_dir($this->settings['repositoryDir'])) {\n\t\t\tthrow new Exception('Exception thrown #1294657643: directory does not exist \"' . $this->settings['repositoryDir'] . '\". Make sure key \"repositoryDir\" is properly defined.', 1294657643);\n\t\t}\n\t}",
"public function CheckSettings($settings) {\n // $settings - array with authentication data\n if(is_array($settings)) {\n $this->isSettingsLoaded = $this->LoadSettingsExt($settings);\n \n // $settings - ini file \n } elseif(preg_match(\"/.ini$/i\", $settings, $match)) {\n\n $this->isSettingsLoaded = $this->LoadSettingsINIFile($settings);\n \n // $settings - xml file\n } elseif(preg_match(\"/.xml$/i\", $settings, $match)) {\n \n $this->isSettingsLoaded = $this->LoadSettingsXMLFile($settings);\n \n // $settings - xml data\n } elseif(preg_match(\"/^<\\?xml /i\", $settings, $match)) {\n \n $this->isSettingsLoaded = $this->LoadSettingsXML($settings);\n \n // $settings - not detected\n } else {\n\n throw new Exception(\"Wrong settings parameter kind.\");\n\n }\n \n return $this->isSettingsLoaded; \n }",
"function check_upload() {\n\t\t\t$is_echo_file = $this->get_entries( array( &$this, 'count_entries' ));\n\t\n\t\t\tif ( $is_echo_file ) {\n\t\t\t\t$this->options();\n\t\t\t}\n\t\t\telse {\n\t\t\t\techo '<h2>'.__('Invalid file', 'echo-importer').'</h2>';\n\t\t\t\techo '<p>'.__('Please upload a valid Echo export file.', 'echo-importer').'</p>';\n\t\t\t}\n\t\t}",
"public function checkSettings(){\n\n $notifications_array=array();\n\n if (empty(config('lmconfig.LM_PRODUCT_KEY'))) //invalid encryption salt\n {\n $notifications_array[]=config('lmconfig.LM_CORE_NOTIFICATION_INVALID_PRODUCT_KEY');\n }\n\n if (empty(config('lmconfig.LM_API_KEY'))) //invalid License Manager Installer API Key\n {\n $notifications_array[]=config('lmconfig.LM_CORE_NOTIFICATION_MISSING_INSTALL_API_KEY');\n }\n\n\n if (empty(config('lmconfig.LM_ROOT_URL'))) //invalid License Manager server URL\n {\n $notifications_array[]=config('lmconfig.LM_CORE_NOTIFICATION_INVALID_ROOT_URL');\n }\n\n if (empty(config('lmconfig.LM_PRODUCT_ID'))) //invalid product ID\n {\n $notifications_array[]=config('lmconfig.LM_CORE_NOTIFICATION_INVALID_PRODUCT_ID');\n }\n\n $file = config('lmconfig.LM_ROOT_URL');\n $file_headers = @get_headers($file);\n\n if($file_headers === false || $file_headers[0] === null ){\n $notifications_array[]=config('lmconfig.LM_NOTIFICATION_NO_CONNECTION');\n }\n if (!$this->validateNumberOrRange(config('lmconfig.LM_DAYS'), 1, 365)) //invalid verification period\n {\n $notifications_array[]=config('lmconfig.LM_CORE_NOTIFICATION_INVALID_VERIFICATION_PERIOD');\n }\n\n\n\n\n return $notifications_array;\n }",
"public function testCheckDataTrue()\n {\n $_arrayValue = $this->getContentDirectory();\n\n $_arrayValue['name'] = 'edit directory name '.time();\n\n $user = User::find(10);\n $request = $this->actingAs($user);\n $request->post(\"api/block-manager/edit-name-folder/\" . $this->_id, $_arrayValue)\n ->seeJson([\n 'status' => 1,\n ]);\n }",
"public function checkBitrix()\n {\n if (!is_file($_SERVER['DOCUMENT_ROOT'] . '/bitrix/.settings.php')) {\n return false;\n }\n\n return true;\n }",
"private function _validateFileData($_data) {\n\t\t$isValid = false;\n\t\tif (is_array($_data)) {\n\t\t\t$intersect = array_intersect(self::$_requiredKeys, array_keys($_data));\n\t\t\t$isValid = (count($intersect) == count(self::$_requiredKeys));\n\n\t\t\tif ($isValid) {\n\t\t\t\t$isValid = ($_data['error'] == 0);\n\t\t\t}\n\t\t}\n\t\treturn $isValid;\n\t}",
"function screen_config_valid()\n{\n if (file_exists(screen_config_file) && is_readable(screen_config_file)) return TRUE;\n\n Error::push(\"screen_config.php file does not exist. (\".screen_config_file.\")\");\n Error::push(\"Exists (should be true): \".(file_exists(screen_config_file) ? \"true\" : \"false\" ));\n Error::push(\"Readable (should be true): \".(is_readable(screen_config_file) ? \"true\" : \"false\"));\n\n return FALSE;\n}",
"public function hasValue($params = array()) {\n\t\t// init vars\n\t\t$file = $this->app->path->path('root:'.$this->get('file'));\n\t\treturn !empty($file) && is_readable($file) && is_file($file);\n\t}",
"function _checkConfig(){\n $this->bConfigExists = file_exists(DIR_PLUGINS.\"{$this->sName}/config.php\");\n if(!$this->bConfigExists){\n $this->bConfigWritable = false;\n }else if(is_writable(DIR_PLUGINS.\"{$this->sName}/config.php\")){\n $this->bConfigWritable = true;\n }else{\n @chmod(DIR_PLUGINS.\"{$this->sName}/config.php\",0644);\n if(is_writable(DIR_PLUGINS.\"{$this->sName}/config.php\")){\n $this->bConfigWritable = true;\n }else{\n $this->bConfigWritable = false;\n }\n }\n }",
"private function _check_setting($setting)\n\t{\n\t\tif(array_key_exists($setting, $this->_defaults))\n\t\t{\n\t\t\tif(!$this->get_setting($setting))\n\t\t\t{\n\t\t\t\t$this->add_setting($setting);\n\t\t\t}\n\t\t\t\n\t\t\treturn TRUE;\n\t\t}\t\t\n\t}"
] | [
"0.7090123",
"0.6472514",
"0.62022007",
"0.5988605",
"0.5866944",
"0.5862797",
"0.5841063",
"0.5836402",
"0.5821613",
"0.57918906",
"0.5785885",
"0.57849663",
"0.57838225",
"0.57588375",
"0.57483935",
"0.5734721",
"0.57036996",
"0.5692596",
"0.5678789",
"0.56687295",
"0.5668502",
"0.5663341",
"0.56621957",
"0.5653043",
"0.5634182",
"0.5631133",
"0.5606223",
"0.5604621",
"0.55981255",
"0.5597408"
] | 0.706425 | 1 |
Lists all Proses models. | public function actionIndex()
{
$searchModel = new ProsesSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index()\n {\n Professeur::all();\n }",
"public function index()\n {\n //\n return Profesor::all();\n }",
"public function getAllProduit(){\n\t\treturn $this -> findAll();\n\t}",
"public static function all(){\r\n $list = [];\r\n $db = Db::getInstance();\r\n $result = mysqli_query($db,'SELECT * FROM product');\r\n\r\n while($row = mysqli_fetch_assoc($result)){\r\n $list[] = new product_model($row['name'],$row['id']);\r\n }\r\n\r\n return $list;\r\n }",
"public function all()\n {\n return $this->pdo->query(\"SELECT * FROM produits WHERE 1\")->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function getAllModel(){\n\t\t//prx($this->Modelo->find('all',array('contain' => array('ImagenModelo'))));\n\t\treturn $this->Modelo->find('all',array('contain' => array('ImagenModelo')));\n\n\t}",
"public function getModels()\n\t{\n\t\t$Model = new Product_Model();\n\t\treturn $Model->findList( array( 'ProductId = '.$this->Id ), 'Position asc' );\n\t}",
"public function actionIndex()\n {\n $searchModel = new ProProductSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new ProspectSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index() {\n $profesores = Profesor::all()->toJson();\n return $profesores;\n }",
"public function index()\n {\n $prods = Produto::all();\n return $prods->toJson();\n }",
"function GetAllModels()\n\t{\n\t}",
"public function all()\n {\n return $this->model->get();\n }",
"public function all()\n {\n return $this->model->get();\n }",
"public function all()\n {\n return $this->model->get();\n }",
"public function index()\n {\n $professores = $this->professor->all();\n\n return $professores;\n }",
"public function getAll()\n {\n return $this->model->get();\n }",
"private function get_all_models() {\n\t\treturn (object) Model::get_all_objects();\n\t}",
"public function proyects()\n {\n return $this->belongsToMany('App\\Proyect');\n }",
"public function actionIndex()\n {\n $searchModel = new ProduitSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listAll()\n {\n return $this->model->get()->pluck('title', 'id')->all();\n }",
"public function getAll()\n {\n $model = $this->model;\n return $model::all();\n }",
"public static function getAllModel() {\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}",
"public function getAll()\n {\n return $this->model->get();\n }",
"public function getAll()\n {\n return $this->model->get();\n }",
"public function list()\n {\n return \\App\\Compromisso::all();\n }",
"public function getall()\n {\n $model = $this->getModel();\n return $model;\n }",
"public function index()\n {\n $produits = Produits::with(['producteur','fruits','recompenses'])->get();\n return ProduitResource::collection($produits);\n }",
"public function getAll(){\n\t\t$resultsProjets = [];\n\t\t$q = $this->pdo->query('SELECT * FROM projet');\n\t\twhile ($donnee = $q->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$resultsProjets[] = new Projet($donnee);\n\t\t}\n\t\treturn $resultsProjets;\n\t}",
"public function getAll()\n {\n return $this->model->all();\n }"
] | [
"0.71247977",
"0.69472295",
"0.66496265",
"0.6452789",
"0.6446416",
"0.6323516",
"0.6319613",
"0.6297985",
"0.6291979",
"0.62826395",
"0.6272053",
"0.62513804",
"0.6242143",
"0.6242143",
"0.6242143",
"0.62393516",
"0.6230487",
"0.6229123",
"0.617792",
"0.6175501",
"0.6159648",
"0.61565274",
"0.6155474",
"0.61547977",
"0.61547977",
"0.6144132",
"0.612587",
"0.6111296",
"0.60980403",
"0.6097113"
] | 0.71517885 | 0 |
Creates a new Proses model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new Proses();
if ($model->load(Yii::$app->request->post()) ) {
$model->kd_urusan = Yii::$app->user->identity->tperan->kd_urusan;
$model->kd_bidang = Yii::$app->user->identity->tperan->kd_bidang;
$model->kd_unit = Yii::$app->user->identity->tperan->kd_unit;
$model->kd_sub = Yii::$app->user->identity->tperan->kd_sub;
$model->input_phased = 2;
$model->user_id = Yii::$app->user->identity->id;
IF($model->save()){
return $this->redirect(['view', 'id' => $model->id]);
}
} else {
return $this->render('create', [
'model' => $model,
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCreate()\n {\n $model = new ProProduct();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Produit();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prod]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new PdmPenyelesaianPratutLimpah();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_pratut_limpah]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new HasilProyeksiJumlah();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no_proyeksi_jumlah]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n //\n\n return view(\"bpart.pro.create\");\n }",
"public function actionCreate()\n {\n $model = new PREPVoto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id_partido' => $model->id_partido, 'id_casilla_seccion' => $model->id_casilla_seccion]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\r\n {\r\n $model = new Profile();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionCreate()\n {\n $model = new Tblprofile();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Pengajuan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Rptsepp();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->IdReporteSepp]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\r\n {\r\n $model = new Profile();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->user_id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionCreate()\n {\n $model = new Penerbit();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Profit();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $event = new OperationsHistoryEvent();\n $event->operation = 'Added profit';\n $model->trigger(Profit::EVENT_SAVE_HISTORY, $event);\n return $this->redirect(['index']);\n }\n\n $products = ArrayHelper::map(Products::findAll([Products::tableName() . '.status' => Products::STATUS_ACTIVE]), 'id', 'title');\n\n return $this->render('create', [\n 'model' => $model,\n 'products' => $products\n ]);\n }",
"public function create()\n {\n //menampilkan form untk nambah data\n $pdata=produks::get();\n return view ('prak11.create',compact ('pdata'));\n }",
"public function actionCreate()\n {\n $model = new Persona();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ID_PER]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Productocostos;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Productocostos']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Productocostos'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->cod));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n exit;\n // $this->layout = 'default'; \n // $model = new Userpay();\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n // } else {\n // return $this->render('create', [\n // 'model' => $model,\n // ]);\n // }\n }",
"public function actionCreate()\n {\n $model = new Participante();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Comsave();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'usuario_id' => $model->usuario_id, 'comentario_id' => $model->comentario_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n\t{ \n\t\tYii::app()->user->setState('items_data',Product::getArrayData());\n\t\tif(!Yii::app()->user->hasState('items_belanja'))\n\t\t\tYii::app()->user->setState('promocode',null);\n\t\telse{\n\t\t\tif(count(Yii::app()->user->getState('items_belanja'))==0)\n\t\t\t\tYii::app()->user->setState('promocode',null);\n\t\t}\n\t\tif(Yii::app()->user->hasState('promocode'))\n\t\t\t$promocode=Promo::model()->findByPk(Yii::app()->user->getState('promocode'))->code;\n\t\tif(!Yii::app()->user->hasState('currency'))\n\t\t\tYii::app()->user->setState('currency',Currency::getDefault());\n\t\t//check whether there is equity\n\t\tif((int)Yii::app()->config->get('use_initial_capital')>0){\n\t\t\tif(!PaymentSession::hasSession())\n\t\t\t\t$this->forward('addmodal');\n\t\t}\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'promocode'=>$promocode,\n\t\t));\n\t}",
"public function actionCreate()\n {\n $model = new Partner();\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 return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n {\n return view('admin/propos/create');\n }",
"public function actionCreate()\n {\n $model = new Product();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\n\t\t$model=new Profile;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Profile']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Profile'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->fUserID));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate() {\n $model = new ProcedimentoRealizado;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['ProcedimentoRealizado'])) {\n $model->attributes = $_POST['ProcedimentoRealizado'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->unidade));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }",
"public function actionCreate()\n\t{\n\t\t$model=new ProductoPadre;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ProductoPadre']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ProductoPadre'];\n\t\t\tif($model->save())\n\t\t\t{\n\t\t\t $model->refresh();\n\t\t\t # $this->redirect(array('view','id'=>$model->id));\n\t\t\t}\n\t\t\t\t\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n $model = new Payments();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n\t{\n\t\t// Creamos un nuevo objeto User para ser usado por el helper Form::model\n $model = new Proyecto;\n $form_data = array('route' => 'admin.proyectos.store', 'method' => 'POST');\n $actionName = 'Crear'; \n $action = 'create';\n $estadoid ='';\n $modelsName = 'proyectos';\n $proyectosSelect = null;\t\n \treturn View::make('admin/layoutform', compact('model', 'form_data', 'modelsName', 'action', 'actionName', 'estadoid', 'proyectosSelect'));\n\t}",
"public function actionCreate()\n {\n $model = new Prerrequisito();\n $modelsDetallepre = [new Detallepre];\n\n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n $modelsDetallepre = Model::createMultiple(Detallepre::classname());\n Model::loadMultiple($modelsDetallepre, Yii::$app->request->post());\n\n // validate all models\n $valid = $model->validate();\n $valid = Model::validateMultiple($modelsDetallepre) && $valid;\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if ($flag = $model->save(false)) {\n foreach ($modelsDetallepre as $modelsDetallepre)\n {\n $modelsDetallepre->idPrerreq = $model->idPrerreq;\n if (! ($flag = $modelsDetallepre->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->idPrerreq]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n return $this->redirect(['view','id' => $model->idPrerreq]);\n }\n else {\n return $this->render('create', [\n 'model' => $model,\n 'modelsDetallepre' => (empty($modelsDetallepre)) ? [new Detallepre] : $modelsDetallepre\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new DatosPersonas();\n\n if ($model->load(Yii::$app->request->post())) {\n //echo $model->nacionalidad; die;\n \n \n \n if ($model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } \n \n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }"
] | [
"0.80263394",
"0.77063036",
"0.74545515",
"0.74018025",
"0.73367345",
"0.7328694",
"0.7309555",
"0.72821635",
"0.7281197",
"0.7257487",
"0.72273517",
"0.72063744",
"0.71229357",
"0.71175724",
"0.71054196",
"0.7084195",
"0.7028821",
"0.7014634",
"0.70024467",
"0.699913",
"0.69951266",
"0.69928724",
"0.69871813",
"0.69828516",
"0.697674",
"0.6968915",
"0.6959812",
"0.6947574",
"0.6917367",
"0.6915478"
] | 0.8400579 | 0 |
Normalizes the dimensions to the unit of measurement CM (centimeter) or IN (inch) supported by the DHL express webservice. | private function normalizeDimensions(float $length, float $width, float $height, string $uom): array
{
if ($uom === Package::UOM_DIMENSION_CM) {
return [
'length' => $length,
'width' => $width,
'height' => $height,
'uom' => Package::UOM_DIMENSION_CM,
];
}
if ($uom === Package::UOM_DIMENSION_IN) {
return [
'length' => $length,
'width' => $width,
'height' => $height,
'uom' => Package::UOM_DIMENSION_IN,
];
}
if ($uom === Package::UOM_DIMENSION_MM) {
return [
'length' => $length / 10,
'width' => $width / 10,
'height' => $height / 10,
'uom' => Package::UOM_DIMENSION_CM,
];
}
if ($uom === Package::UOM_DIMENSION_M) {
return [
'length' => $length * 100,
'width' => $width * 100,
'height' => $height * 100,
'uom' => Package::UOM_DIMENSION_CM,
];
}
if ($uom === Package::UOM_DIMENSION_FT) {
return [
'length' => $length * 12,
'width' => $width * 12,
'height' => $height * 12,
'uom' => Package::UOM_DIMENSION_IN,
];
}
if ($uom === Package::UOM_DIMENSION_YD) {
return [
'length' => $length * 36,
'width' => $width * 36,
'height' => $height * 36,
'uom' => Package::UOM_DIMENSION_IN,
];
}
throw new \InvalidArgumentException(
'Invalid dimensions unit of measurement'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function extract_dimensions( $dimensions ) {\n $sizes_str = preg_replace( '/\\s*inches$/is', '', $dimensions );\n $size = explode( ' x ', $sizes_str );\n return $size;\n }",
"public static function centimeterSizeToPixels($sizeInCm = 1)\n {\n return ($sizeInCm * 37.795275591);\n }",
"function calculate_dimensions($old_width, $old_height) {\n $this->old_width = $old_width;\n $this->old_height = $old_height;\n\n if($this->new_width != 0 && $this->new_height != 0) {\n ;\n }\n elseif($this->new_width == 0) {\n $this->new_width = $this->new_height / ($old_height/$old_width);\n }\n elseif($this->new_height == 0) {\n $this->new_height = $this->new_width / ($old_width/$old_height);\n }\n }",
"public function getNormalizedMeasure()\n {\n return $this->_normalizedMeasure;\n }",
"protected function normalizeSizeOption(array &$options)\n {\n if (isset($options['size'])) {\n $size = explode('x', $options['size']);\n if (\n isset($size[0]) &&\n isset($size[1]) \n ) {\n list($options['cols'], $options['rows']) = $size;\n }\n unset($options['size']);\n }\n }",
"public function getWidthM();",
"function get_scale($minunits, $maxunits, $origin, $end) {\r\n return ($end - $origin) / ($maxunits - $minunits);\r\n}",
"function cmToInches ($cm)\n {\n $inch = $cm * 0.3937;\n return $inch;\n }",
"public static function inchSizeToPixels($sizeInInch = 1)\n {\n return ($sizeInInch * 96);\n }",
"protected function units() {\r\n\treturn array('cm', 'em', 'rem', 's', 'en', 'ex', 'mm', 'in', 'pc', 'pt', 'px', '%');\r\n }",
"private function setImageDimensions()\n {\n global $Core;\n\n if ($this->allowedSizes) {\n if (!isset($this->allowedSizes[$this->sizeType]) || !isset($this->allowedSizes[$this->sizeType][$this->sizeKey])) {\n $Core->doOrDie();\n } else {\n $this->width = $this->allowedSizes[$this->sizeType][$this->sizeKey]['width'];\n $this->height = $this->allowedSizes[$this->sizeType][$this->sizeKey]['height'];\n }\n }\n }",
"public function normalize();",
"public function normalize();",
"public function getImageUnits () {}",
"function image_dimensions() {\n\t\t\tglobal $_wp_additional_image_sizes;\n\t\t\t$additional_sizes = get_intermediate_image_sizes();\n\t\t\t$sizes = array();\n\n\t\t\tif ( empty( $additional_sizes ) ) {\n\t\t\t\treturn $sizes;\n\t\t\t}\n\n\t\t\t// Create the full array with sizes and crop info\n\t\t\tforeach ( $additional_sizes as $_size ) {\n\t\t\t\tif ( in_array( $_size, array( 'thumbnail', 'medium', 'large' ) ) ) {\n\t\t\t\t\t$sizes[ $_size ]['width'] = get_option( $_size . '_size_w' );\n\t\t\t\t\t$sizes[ $_size ]['height'] = get_option( $_size . '_size_h' );\n\t\t\t\t\t$sizes[ $_size ]['crop'] = (bool) get_option( $_size . '_crop' );\n\t\t\t\t} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {\n\t\t\t\t\t$sizes[ $_size ] = array(\n\t\t\t\t\t\t'width' => $_wp_additional_image_sizes[ $_size ]['width'],\n\t\t\t\t\t\t'height' => $_wp_additional_image_sizes[ $_size ]['height'],\n\t\t\t\t\t\t'crop' => $_wp_additional_image_sizes[ $_size ]['crop']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Medium Large\n\t\t\tif ( ! isset( $sizes['medium_large'] ) || empty( $sizes['medium_large'] ) ) {\n\t\t\t\t$width = intval( get_option( 'medium_large_size_w' ) );\n\t\t\t\t$height = intval( get_option( 'medium_large_size_h' ) );\n\n\t\t\t\t$sizes['medium_large'] = array(\n\t\t\t\t\t'width' => $width,\n\t\t\t\t\t'height' => $height\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $sizes;\n\n\t\t}",
"public function convert() {\n if ($this->unit == 'miles to km') {\n $result = $this->number * 1.609;\n } elseif ($this->unit == 'km to miles') {\n $result = $this->number * 0.621;\n }\n elseif ($this->unit == 'km to parsecs') {\n $result = $this->number * 3.24078e-14;\n }\n elseif ($this->unit == 'miles to parsecs') {\n $result = $this->number * 5.21553e-14;\n } else {\n $result = 'error';\n }\n return $result;\n }",
"function toCentimeters($feet, $inches)\n{\n $heightResult = (($feet * 12) + $inches) * 2.54;\n\n return $heightResult;\n}",
"public function getWidthS();",
"function mts_woocommerce_image_dimensions() {\n\t\t\t$catalog = array(\n\t\t\t\t'width' \t=> '225',\t// px\n\t\t\t\t'height'\t=> '308',\t// px\n\t\t\t\t'crop'\t\t=> 1 \t\t// true\n\t\t\t);\n\t\t\t$single = array(\n\t\t\t\t'width' \t=> '350',\t// px\n\t\t\t\t'height'\t=> '478',\t// px\n\t\t\t\t'crop'\t\t=> 1 \t\t// true\n\t\t\t);\n\t\t\t$thumbnail = array(\n\t\t\t\t'width' \t=> '80',\t// px\n\t\t\t\t'height'\t=> '80',\t// px\n\t\t\t\t'crop'\t\t=> 0 \t\t// false\n\t\t\t);\n\t\t\t// Image sizes\n\t\t\tupdate_option( 'shop_catalog_image_size', $catalog ); \t\t// Product category thumbs\n\t\t\tupdate_option( 'shop_single_image_size', $single ); \t\t// Single product image\n\t\t\tupdate_option( 'shop_thumbnail_image_size', $thumbnail ); \t// Image gallery thumbs\n\t\t}",
"public function scale() { }",
"protected function calculateSizes($maxSize)\n {\n //calculate only once until invalidation\n if ($this->isValid()) {\n return;\n } else {\n $this->setValid(true);\n }\n $this->calculatedSizes = [];\n //correct sizing for border sizes\n $this->correctPixelsForBorders();\n //sum all pixels\n $pixelsTaken = array_sum(\n array_map(\n function ($e) {\n return $e->getValue();\n },\n array_filter($this->divisions, function ($e) {\n return $e instanceof Pixel;\n })\n )\n );\n //max size is reduced by pixel sizes -> for percent calculation\n $maxSize -= $pixelsTaken;\n $percentPropCount = 0;\n $percentIndexes = [];\n\n foreach ($this->divisions as $key => $division) {\n if ($division instanceof Pixel) {\n //value is in pixels so it's already calculated\n $this->calculatedSizes[$key] = $division->getValue();\n } else {\n //calue in percents -> let's calculate it\n /* @var Percent $division */\n $prop = (int)($maxSize * ($division->getValue() / 100));\n $this->calculatedSizes[$key] = $prop;\n $percentPropCount += $prop;\n $percentIndexes[] = $key;\n }\n }\n if (!empty($percentIndexes) && $percentPropCount > 0) {\n //only add reminder to percent-calculated sizes\n $this->calculatedSizes = $this->addReminder(\n $percentIndexes,\n $this->calculatedSizes,\n $maxSize - $percentPropCount\n );\n }\n }",
"public function getImageUnits() {\n\t}",
"public function getWidthHeightRatio(string $size): float;",
"function mts_ad_sizes() {\n\t$mts_ad_sizes = array(\n\t\t'0'=> 'Auto',\n\t\t'1' => '120 x 90', \n\t\t'2' => '120 x 240',\n\t\t'3' => '120 x 600',\n\t\t'4' => '125 x 125',\n\t\t'5' => '160 x 90', \n\t\t'6' => '160 x 600',\n\t\t'7' => '180 x 90', \n\t\t'8' => '180 x 150',\n\t\t'9' => '200 x 90', \n\t\t'10' => '200 x 200',\n\t\t'11' => '234 x 60', \n\t\t'12' => '250 x 250',\n\t\t'13' => '320 x 100',\n\t\t'14' => '300 x 250',\n\t\t'15' => '300 x 600',\n\t\t'16' => '300 x 1050', \n\t\t'17' => '320 x 50', \n\t\t'18' => '336 x 280',\n\t\t'19' => '360 x 300',\n\t\t'20' => '435 x 300',\n\t\t'21' => '468 x 15', \n\t\t'22' => '468 x 60', \n\t\t'23' => '640 x 165',\n\t\t'24' => '640 x 190',\n\t\t'25' => '640 x 300',\n\t\t'26' => '728 x 15', \n\t\t'27' => '728 x 90', \n\t\t'28' => '970 x 90', \n\t\t'29' => '970 x 250',\n\t\t'30' => '240 x 400 - Regional ad sizes',\n\t\t'31' => '250 x 360 - Regional ad sizes',\n\t\t'32' => '580 x 400 - Regional ad sizes',\n\t\t'33' => '750 x 100 - Regional ad sizes',\n\t\t'34' => '750 x 200 - Regional ad sizes',\n\t\t'35' => '750 x 300 - Regional ad sizes',\n\t\t'36' => '980 x 120 - Regional ad sizes',\n\t\t'37' => '930 x 180 - Regional ad sizes',\n\t);\n\n\treturn $mts_ad_sizes;\n}",
"function inchesToCm ($inch)\n {\n $cm = $inch * 2.54;\n return $cm;\n }",
"private function getMeasures() {\n list($width, $height) = getimagesize($this->file);\n // Compara no eixo X\n $cmp_x = $width / $this->width;\n // Compara no eixo Y\n $cmp_y = $height / $this->height;\n\n if ($cmp_x > $cmp_y):\n $this->src_w = round($width / $cmp_x * $cmp_y);\n $this->src_x = round(($width - ($width / $cmp_x * $cmp_y)) / 2);\n elseif ($cmp_y > $cmp_x):\n $this->src_h = round($height / $cmp_y * $cmp_x);\n $this->src_y = round(($height - ($height / $cmp_y * $cmp_x)) / 2);\n endif;\n\n $this->getPositioning($width, $height);\n }",
"function px2mm($px)\n{\n return $px * 25.4 / 72;\n}",
"private function calculateOutsize(){\n\t\tif($this->useOriginalSize()){\n\t\t\t$this->outputWidth = $this->imageWidth;\n\t\t\t$this->outputHeight = $this->imageHeight;\n\t\t\treturn;\n\t\t}\n\n\t\t$this->outputWidth = 0;\n\t\t$this->outputHeight = 0;\n\n\n\t\t// If width has been specified set it and compute new height based on source area aspect ratio\n\t\tif($this->thumbWidth){\n\t\t\t$this->outputWidth = $this->thumbWidth;\n\t\t\t$this->outputHeight = $this->imageWidth ? round($this->imageHeight * $this->thumbWidth / $this->imageWidth) : 0;\n\t\t}\n\n\t\t// If height has been specified set it.\n\t\t// If width has already been set and the new image is too tall, compute a new width based\n\t\t// on aspect ratio - otherwise, use height and compute new width\n\t\tif($this->thumbHeight){\n\t\t\tif($this->outputHeight > $this->thumbHeight || $this->outputHeight == 0){\n\t\t\t\t$this->outputWidth = $this->imageHeight ? round($this->imageWidth * $this->thumbHeight / $this->imageHeight) : 0;\n\t\t\t\t$this->outputHeight = $this->thumbHeight;\n\t\t\t}\n\t\t}\n\n\t\t// Check, if we must discard aspect ratio\n\t\tif(!$this->thumbRatio && ($this->thumbWidth) && ($this->thumbHeight)){\n\t\t\t$this->outputWidth = $this->thumbWidth;\n\t\t\t$this->outputHeight = $this->thumbHeight;\n\t\t}\n\n\t\t// Check if it will fitinside\n\t\tif($this->thumbFitinside && ($this->thumbWidth) && ($this->thumbHeight)){\n\t\t\t$this->outputWidth = $this->thumbWidth;\n\t\t\t$this->outputHeight = $this->thumbHeight;\n\t\t}\n\t}",
"public static function get_dimensions($option)\n\t{\n\t\t$size = explode(' (', trim($option));\n\t\t$size = isset($size[0]) ? $size[0] : '';\n\n\t\tswitch ($size)\n\t\t{\n\t\t\tcase 'A0':\n\t\t\t\t$width = 841;\n\t\t\t\t$height = 1189;\n\t\t\t\tbreak;\n\t\t\tcase 'A1':\n\t\t\t\t$width = 594;\n\t\t\t\t$height = 841;\n\t\t\t\tbreak;\n\t\t\tcase 'A2':\n\t\t\t\t$width = 420;\n\t\t\t\t$height = 594;\n\t\t\t\tbreak;\n\t\t\tcase 'A3':\n\t\t\t\t$width = 297;\n\t\t\t\t$height = 420;\n\t\t\t\tbreak;\n\t\t\tcase 'A4':\n\t\t\t\t$width = 210;\n\t\t\t\t$height = 297;\n\t\t\t\tbreak;\n\t\t\tcase 'A5':\n\t\t\t\t$width = 148;\n\t\t\t\t$height = 210;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$width = $height = 0;\n\t\t\t\t$pattern = '/([0-9]+)\\s*(mm|cm|m|in|ft|inches|feet)\\s+[x|?]\\s+([0-9]+)\\s*(mm|cm|m|in|ft|inches|feet)/';\n\t\t\t\tif (preg_match($pattern, $size, $matches))\n\t\t\t\t{\n\t\t\t\t\t$width = self::convert_to_mm($matches[1], $matches[2]);\n\t\t\t\t\t$height = self::convert_to_mm($matches[3], $matches[4]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn array('width' => $width, 'height' => $height);\n\t}",
"function extra_responsive_image__adjust_dimensions( $attachment_id, $dimensions ) {\n\n\t// Assuming we have key values of sizes (desktop, tablet, ...)\n\tif ( is_array( $dimensions ) ) {\n\n\t\tif ( ! empty( $dimensions[0] ) && is_int( $dimensions[0] ) ) {\n\t\t\t$width = $dimensions[0];\n\t\t\t$height = ! empty( $dimensions[1] ) ? $dimensions[1] : 0;\n\t\t\t$sizes = apply_filters( 'extra_responsive_sizes', array() );\n\t\t\t$dimensions = array();\n\t\t\tforeach ( $sizes as $size_name => $size_value ) {\n\t\t\t\t$dimensions[$size_name] = array( $width, $height );\n\t\t\t}\n\t\t}\n\n\t\t// Get full size\n\t\t$image_full_src = wp_get_attachment_image_src( $attachment_id, 'full' );\n\n\t\tif ( ! $image_full_src ) {\n\t\t\treturn $dimensions;\n\t\t}\n\n\t\t$filetype = wp_check_filetype( $image_full_src[0] );\n\t\tif ( ! empty( $filetype ) && ( $filetype['ext'] === 'svg' || $filetype['ext'] === 'gif' ) ) {\n\t\t\treturn 'full';\n\t\t}\n\n\t\t$full_dimension = array( $image_full_src[1], $image_full_src[2] );\n\n\t\t// Real dimensions returned\n\t\t$real_dimensions = array();\n\n\t\t// Loop thgrough screen dimensions\n\t\tforeach ( $dimensions as $dimension_name => $dimension ) {\n\n\t\t\t// Dimensions is array of int [width, height]\n\t\t\tif ( is_array( $dimension ) ) {\n\n\t\t\t\t// We need a width\n\t\t\t\tif ( empty( $dimension[0] ) ) {\n\t\t\t\t\twp_die( \"Image Responsive error\" );\n\t\t\t\t}\n\n\t\t\t\t// If desired width > max width available\n\t\t\t\tif ( $dimension[0] > $full_dimension[0] ) {\n\n\t\t\t\t\t// We have height, adjust it\n\t\t\t\t\tif ( ! empty( $dimension[1] ) ) {\n\t\t\t\t\t\t$dimension[1] = ( $full_dimension[0] * $dimension[1] ) / $dimension[0];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set width\n\t\t\t\t\t$dimension[0] = $full_dimension[0];\n\t\t\t\t}\n\n\t\t\t\t// If desired height > max height available\n\t\t\t\tif ( ! empty( $dimension[1] ) && $dimension[1] > $full_dimension[1] ) {\n\n\t\t\t\t\t// Adjust width\n\t\t\t\t\t$dimension[0] = ( $full_dimension[1] * $dimension[0] ) / $dimension[1];\n\n\t\t\t\t\t// Set height\n\t\t\t\t\t$dimension[1] = $full_dimension[1];\n\t\t\t\t}\n\n\n\t\t\t\tif ( empty( $dimension[1] ) ) {\n\t\t\t\t\t$dimension[1] = min( floor( ( $dimension[0] * $full_dimension[1] ) / $full_dimension[0] ), $full_dimension[1] );\n\t\t\t\t}\n\n\t\t\t\t$real_dimensions[$dimension_name] = $dimension;\n\t\t\t}\n\t\t}\n\n\t\t$dimensions = $real_dimensions;\n\t}\n\n\treturn $dimensions;\n}"
] | [
"0.5411916",
"0.5376611",
"0.5291651",
"0.526097",
"0.5228349",
"0.5206752",
"0.51049227",
"0.5088218",
"0.50591874",
"0.50444347",
"0.5001462",
"0.4927619",
"0.4927619",
"0.49073806",
"0.49027604",
"0.48722032",
"0.48686332",
"0.4863117",
"0.48524064",
"0.48441267",
"0.48359284",
"0.48284507",
"0.47966263",
"0.47829017",
"0.47780252",
"0.47677112",
"0.47570908",
"0.47504708",
"0.47442222",
"0.47385892"
] | 0.60000557 | 0 |
/ Shortcode ================= Slider shortcode | function slider_shortcode($atts, $content){
extract( shortcode_atts (array( // a few default values
)
, $atts));
$q = new WP_Query(
array('posts_per_page' => -1, 'post_type' => 'slider', 'order' => 'ASC', )
);
$list = '<figure class="banner">
<div id="owl-slider" class="owl-carousel owl-theme">';
while($q->have_posts()) : $q->the_post();
$idd = get_the_ID();
$list .= '
<div class="item">
'.get_the_post_thumbnail( get_the_ID(), 'slider', array( 'class' => 'img-responsive' ) ).'
<div class="carousel-caption">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-11 col-md-12 col-lg-9 text-left">
<h1 class="white light lg m-b-30">'.get_the_title().'</h1><br>
<a href="'.get_the_permalink().'" class="btn-warning">Contact Us Now</a>
</div>
</div>
</div>
</div>
</div>
';
endwhile;
$list.= ' </div>
<!--jump-to-bottom-->
<a href="#myAnchor" rel="" id="anchor1" class="anchorLink hidden-xs"><div class="jump-bottom"><img src="'.get_template_directory_uri().'/images/bottom-doen-arrow.png" alt=""/></div></a>
<!--end-jump-to-bottom-->
</figure>';
wp_reset_query();
return $list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function display_slider() {\r\n echo do_shortcode('[hw_metaslider id='.hw_option('main_slider_id',1).']');\r\n }",
"function client_say_slider_shortcode ($atts, $content=null) {\n \n $output = '<ul class=\"client-say-slider\">';\n $output .= do_shortcode($content);\n $output .= '</ul>';\n \n \t$output .= '<script>\n\tjQuery(document).ready(function($) {\n\t\t$(\".client-say-slider\").bxSlider({\n pager: false,\n minSlides: 1,\n maxSlides: 1,\n slideWidth: 1200\n });\n\t});';\n\t$output .= '</script>';\n \n return $output;\n}",
"function shortcode_category_slider($atts){\n\tob_start();\n\t\t$a = shortcode_atts( array ( \n\t\t\t'category' => 'phone',\n\t\t),$atts );\n\t\t?>\n\n\t\t<div class=\"row\">\n\t\t\t<div id=\"slider\" class=\"slick-slides col col-12\">\n\t\t\t\t<?php\n\t\t\t\t$query = new WP_Query( array(\n\t\t\t\t\t'category_name' => $a['category'],\n\t\t\t\t\t'post_type' => 'post',\n\t\t\t\t) );\n\n\t\t\t\tif($query->have_posts()){\n\t\t\t\t\twhile($query->have_posts()){\n\t\t\t\t\t\t$query->the_post();\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t<?php if(has_post_thumbnail()){ \n\t\t\t\t\t\t\techo get_the_post_thumbnail(); \n\t\t\t\t\t\t} ?>\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\twp_reset_postdata();\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<?php\n\t}",
"function sp_slider_sc( $atts, $content = null ){\r\n\r\n\textract( shortcode_atts( array(\r\n\t\t'slide_id' => null,\r\n\t\t'slide_num' => null,\r\n\t), $atts ) );\r\n\r\n\t$out = '';\r\n\t$args = array(\r\n\t\t'post_type' \t\t=>\t'slider',\r\n\t\t'posts_per_page'\t=>\t$slide_num,\r\n\t\t'p'\t\t\t\t\t=>\t$slide_id\r\n\t);\r\n\r\n\t$custom_query = new WP_Query($args);\t\r\n\t\t\r\n\twhile ($custom_query->have_posts()) :\r\n\t\t$custom_query->the_post();\r\n\t\t$out .= sp_slideshow();\r\n\tendwhile;\r\n\twp_reset_postdata(); // Restore global post data\r\n\r\n\treturn $out;\r\n\r\n}",
"function run_slider_shortcode( $content ) {\n\tglobal $shortcode_tags;\n\t$orig_shortcode_tags = $shortcode_tags;\n\tremove_all_shortcodes(); \n\tadd_shortcode( 'slider', 'wt_slider_shortcode' );\t\n\t$content = do_shortcode( $content );\n\t$shortcode_tags = $orig_shortcode_tags; \n\treturn $content;\n}",
"function cyclone_slider( $slider_slug ){\r\n\tglobal $cyclone_slider_plugin_instance;\r\n\tif(isset($cyclone_slider_plugin_instance)){\r\n\t\techo $cyclone_slider_plugin_instance['frontend']->cycloneslider_shortcode( array('id'=>$slider_slug) );\r\n\t}\r\n}",
"function k_slider( $atts, $content = NULL ) {\n\textract( shortcode_atts( array( 'id' => null ), $atts ) );\n\tif( !$id ) return;\n\n\t$slider_wrapper_id = 'slider-' . k_rnd_key( 12 ); // DIV unique ID\n\t// slider post props\n\t$slider_props = get_post_custom( $id );\n\t$slider_meta_arr = unserialize( implode( '', $slider_props[ 'slider' ] ) );\n\textract( $slider_meta_arr );\n\t\n\t// slider effect\n\t$class_effect = '';\n\tif( $slider_effect != 'default' && $slider_effect ) $class_effect = ' carousel-' . $slider_effect;\n\t\n\t// how many slides?\n\t$slides_count = count( $slider_slides );\n\t$slider_cycle = '';\n\tif( $slider_mode == 'auto' ) $slider_cycle = ' data-ride=\"carousel\" data-interval=\"' . $slider_interval . '\"';\n\telseif( $slider_mode == 'manual' ) $slider_cycle = ' data-interval=\"false\"';\n\t\n\t$output = '';\n\t$output .= '<div id=\"' . $slider_wrapper_id . '\" class=\"carousel slide ' . $slider_margins . $class_effect . '\"' . $slider_cycle . '>';\n\t\t\n\t\tif( $slider_controls_type != 'slided' && !empty( $slider_controls_type ) ) : \n\t\t$output .= '<ol class=\"carousel-indicators\">';\n\t\t\t\n\t\t\t$cnt_pages = 0; \n\t\t\twhile( $cnt_pages < $slides_count ) {\n\t\t\t$output .= '<li data-target=\"#' . $slider_wrapper_id . '\" data-slide-to=\"' . $cnt_pages . '\"';\n\t\t\tif( $cnt_pages < 1 ) $output .= ' class=\"active\"';\n\t\t\t$output .= '></li>';\n\t\t\t$cnt_pages ++; \n\t\t\t}\n\t\t$output .= '</ol>';\n\t\tendif;\n\t\t\n\t\t$output .= '<div class=\"carousel-inner\">';\n\t\t\n\t\t$cnt_slides = 0;\n\t\twhile( $cnt_slides < $slides_count ) {\n\t\t\t$image = $slider_slides[ $cnt_slides ][ 'slide_photo' ];\n\t\t\t$title = esc_attr( $slider_slides[ $cnt_slides ][ 'slide_title' ] );\n\t\t\t$descr = esc_attr( $slider_slides[ $cnt_slides ][ 'slide_description' ] );\n\t\t\t$linkd = esc_attr( $slider_slides[ $cnt_slides ][ 'slide_link' ] );\n\t\t\t$cap_pos = $slider_slides[ $cnt_slides ][ 'caption_position' ];\n\t\t\t$cap_sch = $slider_slides[ $cnt_slides ][ 'caption_scheme' ];\n\t\t\t$rem_bck = $slider_slides[ $cnt_slides ][ 'remove_background' ];\n\t\t\t$tit_siz = $slider_slides[ $cnt_slides ][ 'title_size' ];\n\n\t\t\t$output .= '<div class=\"item';\n\t\t\tif( $cnt_slides < 1 ) $output .= ' active';\n\t\t\t$output .= '\">';\n\t\t\t\tif( !empty( $linkd ) ) {\n\t\t\t\t\t$output .= '<a href=\"' . $linkd . '\" title=\"' . $linkd . '\">';\n\t\t\t\t\t$output .= '<img src=\"' . $image . '\" alt=\"' . $title . '\" />';\n\t\t\t\t\t$output .= '</a>';\n\t\t\t\t} else { \n\t\t\t\t\t$output .= '<img src=\"' . $image . '\" alt=\"' . $title . '\" />';\n\t\t\t\t}\n\t\t\t\tif( !empty( $title ) || !empty( $descr ) ) : \n\t \t$output .= '<div class=\"k-carousel-caption' . ' ' . $cap_pos . ' ' . $cap_sch; \n\t \tif( $rem_bck ) $output .= ' no-bg';\n\t \t$output .= '\">';\n\t \t$output .= '<div class=\"caption-content\">';\n\t if( !empty( $title ) ) $output .= '<h3 class=\"' . $tit_siz . ' remove-margin-top\">' . $title . '</h3>';\n\t if( !empty( $descr ) ) $output .= '<p>' . $descr . '</p>';\n\t $output .= '</div>';\n\t \t$output .= '</div>';\n\t endif;\n\t\t\t$output .= '</div>';\n\n\t\t\t$cnt_slides ++;\n\t\t}\n\t\t\n\t\t$output .= '</div>';\n\t\t\n\t\tif( $slider_controls_type != 'paged' && !empty( $slider_controls_type ) ) : \n \t$output .= '<a class=\"left carousel-control\" href=\"#' . $slider_wrapper_id . '\" data-slide=\"prev\"><i class=\"fa fa-chevron-left\"></i></a>';\n \t$output .= '<a class=\"right carousel-control\" href=\"#' . $slider_wrapper_id . '\" data-slide=\"next\"><i class=\"fa fa-chevron-right\"></i></a>';\n\t\tendif;\n\t\n\t$output .= '</div>';\n\t\n\treturn $output;\n}",
"function get_slider( $atts ) {\r\n\r\n\tglobal $post;\r\n\t\textract( shortcode_atts( array(\r\n\t\t'id' => '',\r\n\t), $atts ) );\r\n\t\r\n //Get settings from meta data \r\n\t$opt_val_slides_to_show = get_post_meta( $id, 'sld_slides_to_show', true );\r\n\t$opt_val_slides_to_scroll = get_post_meta( $id, 'sld_slides_to_scroll', true );\r\n\t$opt_val_dot = get_post_meta( $id, 'sld_dot', true );\r\n\t$opt_val_infinite = get_post_meta( $id, 'sld_infinite', true );\r\n\t$opt_val_sld_center_mode = get_post_meta( $id, 'sld_center_mode', true );\r\n\t$opt_val_sld_variable_width = get_post_meta( $id, 'sld_variable_width', true );\r\n\t$opt_val_sld_arrow = get_post_meta( $id, 'sld_arrow', true );\r\n\t$opt_val_sld_fade = get_post_meta( $id, 'sld_fade', true );\r\n\t$opt_val_sld_autoplay = get_post_meta( $id, 'sld_autoplay', true );\r\n\t$opt_val_sld_autoplay_speed = get_post_meta( $id, 'sld_autoplay_speed', true );\r\n\t$opt_val_sld_speeds = get_post_meta( $id, 'sld_speeds', true );\r\n\r\n //Set Default setting if not set yet\r\n\t$opt_val_slides_to_show = ( '' == $opt_val_slides_to_show )? 1 : $opt_val_slides_to_show;\r\n\t$opt_val_slides_to_scroll = ( '' == $opt_val_slides_to_scroll )? 1 : $opt_val_slides_to_scroll;\r\n\t$opt_val_dot = ( '' == $opt_val_dot )? 'true' : $opt_val_dot;\r\n\t$opt_val_infinite = ( '' == $opt_val_infinite )? 'true' : $opt_val_infinite;\r\n\t$opt_val_sld_variable_width = ( '' == $opt_val_sld_variable_width )? 'false' : $opt_val_sld_variable_width;\r\n\t$opt_val_sld_center_mode = ( '' == $opt_val_sld_center_mode )? 'false' : $opt_val_sld_center_mode;\r\n\t$opt_val_sld_arrow = ( '' == $opt_val_sld_arrow )? 'true' : $opt_val_sld_arrow;\r\n\t$opt_val_sld_fade = ( '' == $opt_val_sld_fade )? 'false' : $opt_val_sld_fade;\r\n\t$opt_val_sld_autoplay = ( '' == $opt_val_sld_autoplay )? 'false' : $opt_val_sld_autoplay;\r\n\t$opt_val_sld_autoplay_speed = ( '' == $opt_val_sld_autoplay_speed )? '1000' : $opt_val_sld_autoplay_speed;\r\n\t$opt_val_sld_speeds = ( '' == $opt_val_sld_speeds )? '1000' : $opt_val_sld_speeds;\r\n\r\n\t$args = array( 'post_type' => 'myslideshow', 'p' => $id );\r\n\t$myposts = NEW WP_Query( $args );\r\n\tif ( $myposts->have_posts() ) {\r\n //Custom Post type myslideshow loop \r\n\t\twhile ( $myposts->have_posts() ) {\r\n\t\t\t$myposts->the_post();\r\n\t\t\t$image_string = get_post_meta( $post->ID, '_ImageIds', true );\r\n\t\t\t$image_array = json_decode( $image_string );\r\n\t\t\t$section_id = 'slider-' . $id;\r\n \r\n //Set HTML for short code\r\n\t\t\t\r\n if( !empty($image_array) ) {\r\n \r\n $output .= '<section class=\"regular slider\" id=\"' . $section_id . '\">';\r\n foreach ( $image_array as $slidevalue ){\r\n $image_id = $slidevalue->ImageIds;\r\n $slide_title = $slidevalue->slide_title;\r\n $slide_description = $slidevalue->slide_description;\r\n\r\n $old_content_width = $content_width;\r\n $content_width = 1000;\r\n $thumbnail_html = wp_get_attachment_image( $image_id, array( $content_width, $content_width ) );\r\n $output .= '<div class=\"slider-img-container custom-con\">';\r\n if ( '' !== $slide_title ) {\r\n $output .= '<h2 class=\"slide-title\">' . $slide_title . '</h2>';\r\n }\r\n if ( '' !== $slide_description ) {\r\n $output .= '<p class=\"slide-content\">' . $slide_description . '</p>';\r\n }\r\n $output .= $thumbnail_html;\r\n $output .= '</div>';\r\n }\r\n\r\n\r\n $output .= '</section>';\r\n\r\n //Adding slider initialization script \r\n $output .= '<script>$(function () {\r\n $(\"#' . $section_id . '\").slick({\r\n dots: ' . $opt_val_dot . ',\r\n infinite: ' . $opt_val_infinite . ',\r\n centerMode: ' . $opt_val_sld_center_mode . ', \r\n slidesToShow: ' . $opt_val_slides_to_show . ',\r\n slidesToScroll: ' . $opt_val_slides_to_scroll . ',\r\n variableWidth: ' . $opt_val_sld_variable_width . ',\r\n arrows: ' . $opt_val_sld_arrow . ', \r\n fade: ' . $opt_val_sld_fade . ',\r\n speed: ' . $opt_val_sld_speeds . ',\r\n autoplay: ' . $opt_val_sld_autoplay . ',\r\n autoplaySpeed: ' . $opt_val_sld_autoplay_speed . ',\r\n });\r\n });\r\n </script>';\r\n } // End if().\r\n\t\t} // End while().\r\n\t\treturn $output; // Return output\r\n\t} // End if().\r\n}",
"function photo_slider($atts) {\n\t$atts = shortcode_atts(\n\t\t[\n\t\t\t'id' => null,\n\t\t\t'anec' => 'undefined',\n\t\t\t'arrow_class' => ''\n\t\t],\n\t\t$atts,\n\t\t'photo-slider');\n\n\tif($atts['id'] == null)\n\t\treturn;\n\n\t$slider = get_post($atts['id']);\n\n\tif($slider == null || get_field('photos', $slider->ID) == null)\n\t\treturn;\n\n\tob_start();\n\n\tset_query_var( 'slider', $slider );\n\tset_query_var( 'atts', $atts );\n\tget_template_part('templates/shortcode-photo-slider');\n\n\treturn ob_get_clean();\n}",
"function vanderwebslider_func( $atts ){\r\n $a = shortcode_atts( array(\r\n 'slug' => '',\r\n 'class' => '',\r\n 'count' => 50,\r\n 'order' => 'ASC', // ASC, DESC\r\n 'orderby' => 'menu_order', // none, ID, author, title, name, type, date, modified, parent, rand, menu_order, \r\n 'speed' => 5000,\r\n 'transition' => 'carousel-fade',\r\n\t\t'bullets' => 'TRUE',\r\n\t\t'arrows' => 'TRUE',\r\n\t\t'caption' => 'TRUE',\r\n\t\t'captionclass' => 'd-none d-md-block', // left-top, left-center, left-bottom, right-top, right-center, right-bottom, center-top, center-bottom\r\n\t), $atts );\r\n $slug = $a['slug'];\r\n $class = $a['class'];\r\n $count = $a['count'];\r\n $order = $a['order'];\r\n $orderby = $a['orderby'];\r\n $speed = $a['speed'];\r\n $transition = $a['transition'];\r\n\t$bullets = $a['bullets'];\r\n\t$arrows = $a['arrows'];\r\n\t$caption = $a['caption'];\r\n\t$captionclass = $a['captionclass'];\r\n \r\n $args = array(\r\n 'tax_query' => array(\r\n array(\r\n 'taxonomy' => 'vanderweb_slides_cats',\r\n 'field' => 'slug',\r\n 'terms' => array( $slug )\r\n ),\r\n ),\r\n 'post_type' => 'vanderweb_slides',\r\n 'order' => $order,\r\n 'orderby' => $orderby,\r\n 'posts_per_page' => $count\r\n );\r\n \r\n $slider_loop = new WP_Query($args);\r\n $sliderhtml = '';\r\n $i= 0 ;\r\n $slide_count = $slider_loop->found_posts;\r\n \r\n if ( $slider_loop->have_posts() ):\r\n $sliderhtml .= '<div id=\"vanderweb-slider-bs4-'.$slug.'\" class=\"carousel '.$transition.' slide vanderweb-slider-bs4 '.$class.' slide-total-'.$slide_count.'\" data-ride=\"carousel\" data-interval=\"'.$speed.'\" data-pause=\"hover\">';\r\n\t\t$sliderhtml .= '<div class=\"vanderweb-slider-bs4-inner carousel-inner\">';\r\n while( $slider_loop->have_posts() ){\r\n $slider_loop->the_post();\r\n $title = get_the_title();\r\n\t\t\t$desc = get_the_content();\r\n\t\t\t$meta_slider_link = get_post_meta(get_the_ID(), '_vanderweb_link_meta_key', true);\r\n\t\t\t$meta_slider_linktarget = get_post_meta(get_the_ID(), '_vanderweb_linktarget_meta_key', true);\r\n $post_image_src = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full', false );\r\n \r\n if($i == 0) {\r\n $activeslide = 'active';\r\n }else{\r\n $activeslide = '';\r\n }\r\n $carousel_indicators .= '<li data-target=\"#vanderweb-slider-bs4-'.$slug.'\" data-slide-to=\"'.$i.'\" class=\"'.$activeslide.'\"></li>';\r\n // Item - Start\r\n $sliderhtml .= \"<a class='vanderweb-slider-bs4-slide slide-number-\".$i.\" carousel-item \".$activeslide.\"' href='\".$meta_slider_link.\"' target='\".$meta_slider_linktarget.\"' title='\".$title.\"' style='background-image: url('\".$post_image_src[0].\"');'>\";\r\n\t\t\tif(!empty($desc) AND $caption == 'TRUE'){\r\n\t\t\t\t$sliderhtml .= '<div class=\"vanderweb-slider-bs4-caption '.$captionclass.'\">';\r\n\t\t\t\t\t$sliderhtml .= '<div class=\"vanderweb-slider-bs4-caption-inner\">'.$desc.'</div>';\r\n\t\t\t\t$sliderhtml .= '</div>';\r\n\t\t\t}\r\n $sliderhtml .= '</a>'; // .vanderweb-slider-bs4-slide\r\n // Item - End\r\n $i++;\r\n }\r\n wp_reset_query();\r\n\t\twp_reset_postdata();\r\n $sliderhtml .= '</div>'; // .vanderweb-slider-bs4\r\n\t\t\r\n\t\t// Arrows - Start\r\n\t\tif($slide_count != 1 AND $arrows == 'TRUE'){\r\n\t\t$sliderhtml .= '<a class=\"carousel-control-prev\" href=\"#kumento-slider-bs4-'.$slug.'\" role=\"button\" data-slide=\"prev\">';\r\n\t\t\t$sliderhtml .= '<span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>';\r\n\t\t\t$sliderhtml .= '<span class=\"sr-only\">Previous</span>';\r\n\t\t$sliderhtml .= '</a>';\r\n\t\t$sliderhtml .= '<a class=\"carousel-control-next\" href=\"#kumento-slider-bs4-'.$slug.'\" role=\"button\" data-slide=\"next\">';\r\n\t\t\t$sliderhtml .= '<span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>';\r\n\t\t\t$sliderhtml .= '<span class=\"sr-only\">Next</span>';\r\n\t\t$sliderhtml .= '</a>';\r\n\t\t}\r\n\t\t// Arrows - End\r\n\t\t\r\n // Bullets - Start\r\n\t\tif($slide_count != 1 AND $bullets == 'TRUE'){\r\n\t\t$sliderhtml .= '<ol class=\"carousel-indicators\">';\r\n\t\t\t$sliderhtml .= $carousel_indicators;\r\n\t\t$sliderhtml .= '</ol>';\r\n\t\t}\r\n\t\t// Bullets - End\r\n\t\t\r\n $sliderhtml .= '</div>'; // .vanderweb-slider-bs4-inner\r\n endif;\r\n return $sliderhtml;\r\n}",
"function sujans_shortcode($atts){\n\t$a = shortcode_atts(array(\n\t\t'id' => 5,\n\t\t),$atts\n\t);\n\tob_start();\n\t?>\n\t\t<div class=\"row\">\n\t\t\t<div id = \"slider\" class=\"slick-slides col col-12\">\n\t\t\t\t<?php\n\t\t\t\t\t$instrument_taxonomy = get_terms(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'taxonomy' => 'instrument',\n\t\t\t\t\t\t\t'include' => $a['id'],\n\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tforeach($instrument_taxonomy as $instrument){\n\t\t\t\t\t\t$query = new WP_Query(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type' => 'slide',\n\t\t\t\t\t\t\t\t'tax_query' => array(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'taxonomy' => 'instrument',\n\t\t\t\t\t\t\t\t\t\t'field' => 'name',\n\t\t\t\t\t\t\t\t\t\t'terms' => $instrument->name,\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);\n\t\t\t\t\t\twhile($query->have_posts()){\n\t\t\t\t\t\t\t$query->the_post();\n\t\t\t\t\t\t\tthe_post_thumbnail();\n\t\t\t\t\t\t}\n\t\t\t\t\t\twp_reset_postdata();\n\t\t\t\t\t\n\t\t\t\t?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t$content = ob_get_clean();\n\t\treturn $content;\n\t}\n}",
"function massdata_slider_shortcode($atts, $content){\n $atts = shortcode_atts(\n array(\n 'content' => !empty($content) ? $content : NULL\n ), $atts\n );\n\n extract($atts);\n\n if(!empty($content)){\n $concatenate = '<div class=\"event-buttons\"><a class=\"prev\"></a><a class=\"next\"></a></div>';\n $concatenate .= '<ul class=\"event-thumbnail\">'.do_shortcode($content).'</ul>';\n return $concatenate;\n }\n\n return \"\";\n}",
"function jqps_shortcode ( $atts ) {\n\t// Somehow, get an array with links to all the images\n\t\n\t$out = '<div class=\"img-slider\">';\n\t\n\t$counter = 0;\n\tforeach ($img_array as $image) { \n\t\t$counter++;\n\t\t$img_size = getimagesize($image);\n\t\tif ($img_size != false) {\t\t// If the image can't be read, this returns false;\n\t\t\t$width = $img_size[0];\n\t\t\t$height = $img_size[1];\n\t\t\t\n\t\t\t$out .= '<img class=\"slide slide-' . $counter . '\" src=\"' . $image . '\" width=\"' . $width . '\" height=\"' . $height . '\" />';\n\t\t}\n\t}\n\t\n\t$out .= '</div>';\n\t\n\treturn $out;\n}",
"public function meta_box_slider_shortcode( $post ){\n\t\t// output the sliders in variable\n\t $sliders = fa_get_sliders('publish');\n\t $options = array();\n\t foreach( $sliders as $slider ){\n\t \t$text = empty( $slider->post_title ) ? '(' . __('no title', 'fapro') . ')' : esc_attr( $slider->post_title );\n\t \t$options[] = '<option value=\"' . $slider->ID . '\">' . $text . ' (#' . $slider->ID . ')</option>';\n\t }\n?>\n<label for=\"fa-slider-shortcode\"><?php _e( 'Select slider', 'fapro' );?> :\n<?php if( $options ):?>\n<select id=\"fa-slider-shortcode\" name=\"fa-slider-shortcode\">\n\t<option value=\"\"><?php _e( 'Select', 'fapro' );?></option>\n\t<?php echo implode( \"\\n\", $options );?>\n</select>\n</label>\n<p style=\"text-align:right;\"><input type=\"button\" id=\"fa-insert-shortcode\" value=\"<?php _e('Insert shortcode', 'fapro');?>\" class=\"button\" /></p>\n<?php else:?>\n\t<em><?php _e( 'No published sliders found', 'fapro' );?></em>\n</label>\n<?php endif;?>\n<?php\t\t\n\t}",
"function roundabout_shortcode($atts, $content = null) {\n\n\t$output .= '<ul class=\"carousel\" id=\"carousel\">';\n\t\t$output .= do_shortcode($content);\n\t$output .= '</ul>';\n\n\t$output .= '<script>\n\tjQuery(document).ready(function() {\n\t\tjQuery(\"#carousel\").roundabout({\n\t\ttilt: 0.4,\n\t\tminScale:0.5,\n\t\tminOpacity: 1,\n\t\tduration: 400,\n\t\teasing: \"easeOutQuad\",\n\t\tenableDrag: true,\n\t\tdropEasing: \"easeOutBack\", \n\t\tdragFactor: 2,\n\t\tresponsive:true,\n\t\t//focusBearing: 20\n\t\t});\n\t});';\n\t$output .= '</script>';\n\n\treturn $output;\n}",
"function oxy_shortcode_flexslider( $atts, $content = null ){\n $params = shortcode_atts( array(\n 'slideshow' => '',\n 'animation' => 'slide',\n 'speed' => 7000,\n 'duration' => 600,\n 'directionnav' => 'hide',\n 'directionnavpos' => 'outside',\n 'controlsposition' => 'inside',\n 'itemwidth' => '',\n 'showcontrols' => 'show',\n 'captions' => 'show',\n 'captionsize' => 'super',\n 'captionanimation' => 'animated',\n 'autostart' => 'true'\n ), $atts );\n return oxy_create_flexslider($params['slideshow'], $params , false);\n}",
"function oxy_shortcode_layerslider_vc( $atts, $content = null) {\n extract( shortcode_atts( array(\n 'id' => '',\n 'slug' => '',\n 'el_class' => ''\n ), $atts ) );\n\n if( !empty( $slug ) ) {\n $id = $slug;\n }\n\n $output = '<div class=\"'.$el_class.'\">';\n $output .= do_shortcode('[layerslider id=\"'.$id.'\"]');\n $output .= '</div>';\n\n return $output;\n}",
"function sc_siema_slides( $atts ) {\n\t\n\t//Include Shortcode Styles + Siema Script\n wp_enqueue_style( 'wp-siema-style' );\n wp_enqueue_script( 'siema-slider' );\n wp_enqueue_script( 'wp-siema-script' );\n\t\n\t//Post Type Vars\n $slider_post_type = 'siema_slide';\n $slider_tax = 'slider_category';\n\t\n\t//Get Shortcode Attributes\n\t$a = shortcode_atts( array(\n 'slider_category_slug' => '',\n 'numresults' => -1,\n 'orderby' => 'title',\n 'order' => 'ASC',\n ), $atts );\n\t\n\tob_start();\n \n //Query Slides\n create_slides($slider_post_type, $slider_tax, $a['numresults'], htmlspecialchars($a['orderby']), htmlspecialchars($a['order']), htmlspecialchars($a['slider_category_slug']));\n\t\n\t$content = ob_get_contents();\n\tob_end_clean();\n\treturn $content;\n}",
"function wip_news_shortcode( $atts ) {\n\t// Attributes\n\t$atts = shortcode_atts(\n\t\tarray(\n\t\t\t'num_post' => '2',\n\t\t\t'visible' => '4',\n\t\t),\n\t\t$atts\n\t);\n\n\t$args = array(\n\t\t'post_type' => 'post',\n\t\t'posts_per_page' => $atts['num_post'],\n\t\t'order' => 'DESC',\n\t\t'orderby' => 'date',\n\t);\n\t$queries[] = new WP_Query( $args );\n\n\n\tinclude WIP_SLIDER_PATH . 'front/front-slider.php';\n}",
"function mpcth_client_slider_shortcode($atts, $content = null) {\r\n\textract(shortcode_atts(array(\r\n\t\t'columns' => '',\r\n\t\t'rows' => '',\r\n\t\t'delay' => 3000,\r\n\t\t'css_animation' => ''\r\n\t), $atts));\r\n\r\n\t$delay = (int)$delay >= 0 && (int)$delay < 600000 ? (int)$delay : 3000;\r\n\r\n\t$query = new WP_Query( array( 'post_type' => 'client', 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'title' ) );\r\n\t\r\n\t$return = '<div class=\"mpcth-sc-client-slider mpcth-waypoint-trigger mpcth-sc-client-slider-columns-' . $columns . add_css_animation($css_animation) . '\" data-columns=\"' . $columns . '\" data-rows=\"' . $rows . '\" data-delay=\"' . $delay . '\">';\r\n\t\t$return .= '<div class=\"mpcth-sc-client-slider-list\">';\r\n\t\twhile( $query->have_posts() ) {\r\n\t\t\t$query->the_post();\r\n\r\n\t\t\t$logo = get_post_meta(get_the_ID(), 'logo', true);\r\n\t\t\t$url = get_post_meta(get_the_ID(), 'client_url', true);\r\n\r\n\t\t\tif(!empty($url)) {\r\n\t\t\t\t$return .= '<a href=\"' . $url . '\" class=\"mpcth-sc-client-slider-logo\" target=\"_blank\">';\r\n\t\t\t\t\t$return .= '<img src=\"' . $logo . '\">';\r\n\t\t\t\t\t$return .= '<h6><span>' . get_the_title() . '</span></h6>';\r\n\t\t\t\t$return .= '</a>';\r\n\t\t\t} else {\r\n\t\t\t\t$return .= '<div class=\"mpcth-sc-client-slider-logo\">';\r\n\t\t\t\t\t$return .= '<img src=\"' . $logo . '\">';\r\n\t\t\t\t\t$return .= '<h6><span>' . get_the_title() . '</span></h6>';\r\n\t\t\t\t$return .= '</div>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$return .= '</div>';\r\n\t\t$return .= '<div class=\"mpcth-clear-fix\"></div>';\r\n\t$return .= '</div>';\r\n\r\n\twp_reset_postdata();\r\n\r\n\t$return = parse_shortcode_content($return);\r\n\treturn $return;\r\n}",
"function newsroom_elated_bbpress_forums_slider_shortcode($shortcode) {\n\t\tif(bbp_is_forum_archive()) {\n\t\t\t$option = newsroom_elated_options()->getOptionValue('bbpress_archive_slider');\n\n\t\t\tif($option !== '') {\n\t\t\t\t$shortcode = $option;\n\t\t\t}\n\t\t}\n\n\t return $shortcode;\n }",
"public static function athen_post_slider_shortcode( $post_id = '' ) {\n\n\t\t// Get post id if not defined\n\t\t$post_id = $post_id ? $post_id : athen_get_the_id();\n\n\t\t// Check for slider defined in custom fields\n\t\tif ( $slider = get_post_meta( $post_id, 'athen_post_slider_shortcode', true ) ) {\n\t\t\t$slider = $slider;\n\t\t} elseif( get_post_meta( $post_id, 'athen_page_slider_shortcode', true ) ) {\n\t\t\t$slider = get_post_meta( $post_id, 'athen_page_slider_shortcode', true );\n\t\t}\n\n\t\t// Apply filters\n\t\t$slider = apply_filters( 'athen_post_slider_shortcode', $slider );\n\n\t\t// Return slider\n\t\treturn $slider;\n\t}",
"public function __construct() {\n\n global $canvys;\n\n $this->config = array(\n\n // Handle will be used to use this shortcode\n 'handle' => 'cv_fullwidth_slider',\n\n // Whether or not this is a shortcode composer element\n 'composer_element' => false,\n\n // Whether or not this is a template builder element\n 'builder_element' => true,\n\n // Used by the template builder to determine where module can be dropped\n 'drop_target' => 0,\n\n // Used by the template builder to determine where module can have other\n // modules dropped inside of it\n 'drop_zone' => false,\n\n // Title will be used to identify this shortcode\n 'title' => __( 'Full Width Slider', 'canvys' ),\n\n // Icon will be used to represent this shortcode in composer/builder\n // List of available icons can be found in icons.json\n 'icon' => 'docs',\n\n // Whether or not shortcode is self closing\n 'self_closing' => false,\n\n // If shortcode is not self closing, specify its default content\n 'default_content' => '[cv_fullwidth_slide][cv_fullwidth_slide_element][/cv_fullwidth_slide]',\n\n // Specify whether or not content is directly editable\n 'content_editor' => false,\n\n // Specify whether or not the content is composed of another shortcode\n 'content_element' => 'cv_fullwidth_slide',\n\n // Provide an explanation of what this shortcode does\n 'explanation' => __( 'Full width sliders allow you to add any number of slides each with unique background and caption settings. If content sliding has been enabled for this page full width sliders will automatically resize to fit the height of the screen.', 'canvys' ),\n\n // Array of shortcode settings and their respective attributes\n 'attributes' => array(\n\n new CV_Shortcode_Text_Control( 'id', array(\n 'title' => __( 'Slider ID', 'canvys' ),\n 'description' => __( 'Set the ID attribute for this slider, this allows you to apply unique styles to this slider with CSS or to link to this slider in the creation of a one page website.', 'canvys' ),\n ) ),\n\n new CV_Shortcode_Slider_Control( 'slider_config', array(\n 'title' => __( 'Slider Configuration', 'canvys' ),\n 'description' => __( 'Specify how this slider should behave.', 'canvys' ),\n ) ),\n\n new CV_Shortcode_Select_Control( 'parallax', array(\n 'title' => __( 'Enable Parallax', 'canvys' ),\n 'description' => __( 'Enable parallax scrolling effect for this slider', 'canvys' ),\n 'default' => 'false',\n 'options' => array(\n 'false' => __( 'No parallax effect', 'canvys' ),\n 'true' => __( 'Yes, enable parallax scrolling', 'canvys' ),\n ),\n ) ),\n\n new CV_Shortcode_Select_Control( 'min_height', array(\n 'title' => __( 'Minimum Height', 'canvys' ),\n 'description' => __( 'Specify a minimum height for this slider.', 'canvys' ),\n 'default' => 'none',\n 'options' => array(\n 'none' => __( 'None, let the content of each slide dictate the height', 'canvys' ),\n '25' => __( 'Atleast 25% of the screen height', 'canvys' ),\n '50' => __( 'Atleast 50% of the screen height', 'canvys' ),\n '75' => __( 'Atleast 75% of the screen height', 'canvys' ),\n '100' => __( 'Atleast 100% of the screen height', 'canvys' ),\n ),\n ) ),\n\n new CV_Shortcode_Number_Control( 'forced_height', array(\n 'title' => __( 'Forced Height', 'canvys' ),\n 'description' => __( 'Force each slide to be a certain height. Enter a numeric value only in pixels.', 'canvys' ),\n ) ),\n\n new CV_Shortcode_Select_Control( 'visibility', array(\n 'title' => __( 'Visibility', 'canvys' ),\n 'description' => __( 'Which devices this slider should be visible on. This is great for optimizing your website for all devices. Please note that this setting is not applicable when full page content sliding is active.', 'canvys' ),\n 'default' => 'all',\n 'options' => $canvys['visibility_options'],\n ) ),\n\n ),\n );\n }",
"function f_cp_banner($atts, $content=null) {\r\n\tglobal $post;\r\n\t$VERSION = '1.0.1';\r\n\r\n\t// вытаскиваем атрибуты шорткода\r\n\textract(shortcode_atts(array(\r\n\t\t\"banner_jquery\" => false,\t\t// загружать ли jQuery из плагина\r\n\t\t\"banner_height\" => '',\t\t\t// принудительная высота контейнера баннера\r\n\t\t\"banner_width\" => '',\t\t\t// принудительная ширина контейнера баннера\r\n\t\t\"banner_name\" => 'owl_carousel',\t// уникальное имя баннера на странице (для нескольких баннеров на одной странице)\r\n\t\t\"banner_timeout\" => '10000',\t\t// таймаут смены баннера (в мс)\r\n\t\t\"banner_tag\" => '',\t\t\t// тег постов, которые надо собирать в цикл\r\n\t\t\"banner_transition\" => 'fadeUp',\t// тип смены слайдера ('fade','backSlide','goDown','fadeUp')\r\n\t\t\"banner_pagination\" => 'false'\t\t// нужны ли точки внизу\r\n\t), $atts));\r\n\r\n\t// если нужна отдельно-загружаемая jQuery (вдруг она по каким-то причинам не загружена на страницу)\r\n\tif ($banner_jquery) {\r\n\t\twp_register_script( 'owl_carousel_jquery', plugins_url( '/js/jquery.js', __FILE__ ), array(), $VERSION, true );\r\n\t\twp_enqueue_script( 'owl_carousel_jquery');\r\n\t}\r\n\r\n\t// берем посты с типом поста \"cp_banner\" и с определенным тегом (если указан)\r\n\t$myposts = $banner_tag ? get_posts(array('post_type'=>'cp_banner','nopaging'=>true,'tag'=>$banner_tag)) : get_posts(array('post_type'=>'cp_banner','nopaging'=>true)) ;\r\n\r\n\t$retour = '';\r\n\t$banner_wrapper_style = ' style=\"';\r\n\t$banner_wrapper_style .= ($banner_height) ? 'height:'.$banner_height.'px;' : '';\r\n\t$banner_wrapper_style .= ($banner_width) ? 'width:' .$banner_width .'px;' : '';\r\n\t$banner_wrapper_style .= '\"';\r\n\r\n\t$retour .= '<div class=\"banner_wrapper\"'.$banner_wrapper_style.'>';\r\n\t$retour .= '<div id=\"'.$banner_name.'\" class=\"owl-carousel\">';\r\n\r\n\t// перебираем посты\r\n\tforeach($myposts as $post) {\r\n\r\n\t\tsetup_postdata($post);\r\n\r\n\t\t//берем картинки из поста - это будет графический баннер\r\n\t\t$attachments =& get_children( 'post_parent='.$post->ID.'&post_mime_type=image' );\r\n\t\t//берем цитату - здесь будет ссылка, относящаяся к этому баннеру\r\n\t\t$bexcerpt = get_the_excerpt();\r\n\r\n\t\t//берем контент - это баннер, составленный из ХТМЛ-куска\r\n\t\t$bcontent = get_the_content();\r\n\r\n\r\n\t\t$btags = array();\r\n\t\t$gtags = get_the_tags($post->ID);\r\n\r\n\t\tif ($gtags) {\r\n\t\t\tforeach ($gtags AS $tag) { \r\n\t\t\t\t$btags[] = $tag->name;\r\n\t\t\t} //foreach tags\r\n\t\t} //if tags\r\n\r\n\t\tif ( $banner_tag == '' || ($banner_tag != '' && in_array($banner_tag,$btags))) { //отбор по тегу\r\n\t\t\tif ($attachments) { // если это \"картиночный\" баннер, то формируем его из картинки и цитаты\r\n\t\t\t\tforeach($attachments as $attachment) {\r\n\t\t\t\t\t$image_attributes = wp_get_attachment_image_src( $attachment->ID, 'full' );\r\n\t\t\t\t\t$retour .= '<div class=\"item\">';\r\n\t\t\t\t\tif ($bexcerpt) $retour .= '<a href=\"'.get_the_excerpt().'\">';\r\n\t\t\t\t\t$retour .= '<img src=\"'.$image_attributes[0].'\">';\r\n\t\t\t\t\tif ($bexcerpt) $retour .= '</a>';\r\n\t\t\t\t\t$retour .= '</div>';\r\n\t\t\t\t} // foreach attach\r\n\t\t\t} elseif ($bcontent) { // если не \"картиночный\", а \"хтмл\"-ный, то берем контент\r\n\t\t\t\t$retour .= '<div class=\"item\">';\r\n\t\t\t\t$retour .= $bcontent;\r\n\t\t\t\t$retour .= '</div>';\r\n\t\t\t} // if attach\r\n\t\t} // if category\r\n\t} //foreach posts\r\n\t$retour .= '</div> ';\r\n\t$retour .= '</div> ';\r\n\t\r\n\t// JS-запуск каждой карусельки\r\n\t$retour .= '\r\n\t\t<script>\r\n\t\t\tjQuery(document).ready(function(){\r\n\t\t\t\tjQuery(\"#'.$banner_name.'\").owlCarousel({\r\n\t\t\t\t\titems:1,\r\n\t\t\t\t\tsingleItem:true,\r\n\t\t\t\t\tautoPlay:true,\r\n\t\t\t\t\trewindSpeed:'.$banner_timeout.',\r\n\t\t\t\t\tstopOnHover:true,\r\n\t\t\t\t\tpagination :'.$banner_pagination.',\r\n\t\t\t\t\ttransitionStyle :\"'.$banner_transition.'\"\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t</script>\r\n\t';\r\n\r\n\r\n\twp_reset_postdata();\r\n\r\n\treturn $retour;\r\n\r\n}",
"function partner_slider_shortcode( $atts ){ ob_start(); global $pitheme; ?>\n\n\t<section id=\"client-area\" class=\"client_area\">\n\t\t<div class=\"client_inner section-inner\">\n\t\t\t<div class=\"container\">\n\n\t\t\t\t<div class=\"section-header\">\n\t\t\t\t\t<?php if (isset($pitheme['opt-text-title-partner']) && !empty($pitheme['opt-text-title-partner'])) : ?>\n\t\t\t\t\t\t<h2 class=\"text-center\"><?php echo $pitheme['opt-text-title-partner']; ?></h2>\n\t\t\t\t\t<?php else: ?>\n\t\t\t\t\t\t<h2 class=\"text-center\">Our Partnars</h2>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t\tif (isset($pitheme['opt-textarea-subtitle-partner-logo']) && !empty($pitheme['opt-textarea-subtitle-partner-logo'])) {\n\t\t\t\t\t\t\t$partner_logo = $pitheme['opt-textarea-subtitle-partner-logo'];\n\t\t\t\t\t\t\techo '<p class=\"text-center\">' .$partner_logo. '</p>';\n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"partner-slider\">\n\n\t\t\t\t<?php if (isset($pitheme['opt-slides-client']) && !empty($pitheme['opt-slides-client'])){\n\t\t\t\t\t$slider_client = $pitheme['opt-slides-client'];\n\t\t\t\t}else{\n\t\t\t\t\t$slider_client = array();\n\t\t\t\t}\n\t\t\t\tforeach ($slider_client as $value) : ?>\n\t\t\t\t\t<div class=\"slngle_partner\">\n\t\t\t\t\t\t<img src=\"<?php echo $value['image']; ?>\" alt=\"client image\">\n\t\t\t\t\t</div>\n\t\t\t\t<?php endforeach; ?>\n\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</section>\n\n<?php return ob_get_clean(); }",
"public function widget( $args, $instance ) {\n$title = apply_filters( 'widget_title', $instance['title'] );\n// before and after widget arguments are defined by themes\necho $args['before_widget'];\nif ( ! empty( $title ) )\necho $args['before_title'] . $title . $args['after_title'];\n\n// This is where you run the code and display the output\necho do_shortcode( '[wext-slider]' );\n\n\necho $args['after_widget'];\n}",
"function bxslider_item_shortcode_2($atts, $content = null) {\n extract(shortcode_atts(array(\n 'href' => '#'\n ), $atts));\n \n\t$output = '<li>';\n $output .= '<div class=\"view hover-effect-image\">';\n $output .= do_shortcode($content); \n\t $output .= '<a href=\"'.$href.'\" class=\"mask-no-border\">';\n $output .= '<span class=\"mask-icon\" title=\"Full Image\">Full Image</span>';\n $output .= '</a>';\n $output .= '</div>';\n\t$output .= '</li>';\n\n\treturn $output;\n}",
"function rsmg_mod_slideshow($atts) {\r\n\t\t\t// uses global variable https://codex.wordpress.org/Class_Reference/wpdb\r\n\t\t\tglobal $post;\r\n\t\t\tglobal $wpdb;\r\n\t\t\t$type = $this->type_lightbox; // the type of imagelightbox, f: combined TODO fournir cette variable au code JavaScript !!!!\r\n\t\t\textract ( shortcode_atts ( array (\r\n\t\t\t\t\t'ids' => '' \r\n\t\t\t), $atts ) );\r\n\t\t\t$request = null;\r\n\t\t\t$the_ids = null;\r\n\t\t\tif ($atts ['ids'] == null) {\r\n\t\t\t\t$request = $wpdb->prepare ( \"SELECT $wpdb->posts.* FROM $wpdb->posts where post_type = %s and post_parent = %d order by ID ASC\", 'attachment', $post->ID );\r\n\t\t\t} else {\r\n\t\t\t\t$the_ids = explode ( ',', $atts ['ids'] );\r\n\t\t\t\t$request = $wpdb->prepare ( \"SELECT $wpdb->posts.* FROM $wpdb->posts where post_type = %s and ID IN (\" . implode ( ',', $the_ids ) . \")\", 'attachment' );\r\n\t\t\t}\r\n\t\t\tif ($request != null) {\r\n\t\t\t\t$image_posts = $wpdb->get_results ( $request );\r\n\t\t\t\t/*$main_carousel = '<div id=\"carousel_post_x\" class=\"carousel slide\" data-ride=\"carousel\">'; // Ajouter un indice éventuellement si plusieurs Carousels\r\n\t\t\t\t$carousel_indicators = '<ol class=\"carousel-indicators\">';\r\n\t\t\t\t$carousel_inner = '<div class=\"carousel-inner\">';\r\n\t\t\t\t$indice = 0;\r\n\t\t\t\tif ($the_ids == null) {\r\n\t\t\t\t\tforeach ( $image_posts as $image_post ) {\r\n\t\t\t\t\t\tif ($indice == 0) {\r\n\t\t\t\t\t\t\t$carousel_indicators .= '<li data-target=\"#carousel_post_x\" data-slide-to=\"0\" class=\"active\"></li>';\r\n\t\t\t\t\t\t\t// $carousel_inner .= '<div class=\"item active\"><a href=\"'.$image_post->guid.'\"><img src=\"'.$image_post->guid.'\" data-imagelightbox=\"'.$type.'\" alt=\"...\"></a><div class=\"carousel-caption\"><p>Hello</p></div></div>';\r\n\t\t\t\t\t\t\t$carousel_inner .= '<div class=\"item active\"><img class=\"carousel_image\" src=\"' . $image_post->guid . '\" alt=\"...\"><div class=\"carousel-caption\"><p>Hello</p></div></div>';\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$carousel_indicators .= '<li data-target=\"#carousel_post_x\" data-slide-to=\"' . $indice . '\"></li>';\r\n\t\t\t\t\t\t\t$carousel_inner .= '<div class=\"item\"><img class=\"carousel_image\" src=\"' . $image_post->guid . '\" alt=\"...\"><div class=\"carousel-caption\"><p>Hello</p></div></div>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$indice += 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// We have to show the image in the order foreseen\r\n\t\t\t\t\tforeach ( $the_ids as $id ) {\r\n\t\t\t\t\t\tforeach ( $image_posts as $image_post ) {\r\n\t\t\t\t\t\t\tif ($image_post->ID == $id) {\r\n\t\t\t\t\t\t\t\tif ($indice == 0) {\r\n\t\t\t\t\t\t\t\t\t$carousel_indicators .= '<li data-target=\"#carousel_post_x\" data-slide-to=\"0\" class=\"active\"></li>';\r\n\t\t\t\t\t\t\t\t\t// $carousel_inner .= '<div class=\"item active\"><a href=\"'.$image_post->guid.'\"><img src=\"'.$image_post->guid.'\" data-imagelightbox=\"'.$type.'\" alt=\"...\"></a><div class=\"carousel-caption\"><p>Hello</p></div></div>';\r\n\t\t\t\t\t\t\t\t\t$carousel_inner .= '<div class=\"item active\"><img class=\"carousel_image\" src=\"' . $image_post->guid . '\" alt=\"...\"><div class=\"carousel-caption\"><p>Hello</p></div></div>';\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$carousel_indicators .= '<li data-target=\"#carousel_post_x\" data-slide-to=\"' . $indice . '\"></li>';\r\n\t\t\t\t\t\t\t\t\t// $carousel_inner .= '<div class=\"item\"><a href=\"'.$image_post->guid.'\"><img src=\"'.$image_post->guid.'\" data-imagelightbox=\"'.$type.'\" alt=\"...\"></a><div class=\"carousel-caption\"><p>Hello</p></div></div>';\r\n\t\t\t\t\t\t\t\t\t$carousel_inner .= '<div class=\"item\"><img class=\"carousel_image\" src=\"' . $image_post->guid . '\" alt=\"...\"><div class=\"carousel-caption\"><p>Hello</p></div></div>';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$indice += 1;\r\n\t\t\t\t\t\t\t\tbreak;\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$carousel_indicators .= '</ol>';\r\n\t\t\t\t$carousel_inner .= '</div>';\r\n\t\t\t\t$main_carousel .= $carousel_indicators;\r\n\t\t\t\t$main_carousel .= $carousel_inner;\r\n\t\t\t\t$main_carousel .= '<a class=\"left carousel-control\" href=\"#carousel_post_x\" data-slide=\"prev\"><span class=\"glyphicon glyphicon-chevron-left\"></span></a>';\r\n\t\t\t\t$main_carousel .= '<a class=\"right carousel-control\" href=\"#carousel_post_x\" data-slide=\"next\"><span class=\"glyphicon glyphicon-chevron-right\"></span></a>';\r\n\t\t\t\t$main_carousel .= '</div>';\r\n\t\t\t\treturn $main_carousel;*/\r\n\t\t\t\t$main_slideshow = '<div class=\"wrapper sliceBoxWrapperDiv\">';\r\n\t\t\t\t$main_slideshow .= '<ul class=\"sb-slider\">';\r\n\t\t\t\tif ($the_ids == null) {\r\n\t\t\t\t\tforeach ( $image_posts as $image_post ) {\r\n\t\t\t\t\t\t$real_image_informations = $this->get_complemtary_image_infos($image_post);\r\n\t\t\t\t\t\tif($real_image_informations['image_datas']){\r\n\t\t\t\t\t\t\t$image_url = $this->site_url.'/wp-content/uploads/'.$real_image_informations['image_datas']['file'];\r\n\t\t\t\t\t\t\t$description = $image_post->post_content;\r\n\t\t\t\t\t\t\tif (strlen($description) == 0){\r\n\t\t\t\t\t\t\t\t$description = $image_post->post_excerpt;\r\n\t\t\t\t\t\t\t\tif (strlen($description) == 0){\r\n\t\t\t\t\t\t\t\t\t$description = $image_post->post_title;\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$author = 'Xxxxxxx';\r\n\t\t\t\t\t\t\tif($real_image_informations['author']){\r\n\t\t\t\t\t\t\t\t$author = $real_image_informations['author']->display_name;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$title_alt = $description.\"|\".$author;\r\n\t\t\t\t\t\t\t$identifiant_slicebox = basename($atts['path']);\r\n\t\t\t\t\t\t\t$image_element = '<li><a href=\"#\"><img src=\"'.$image_url.'\" alt=\"'.$title_alt.'\" title=\"'.$title_alt.'\" /></a>';\r\n\t\t\t\t\t\t\t$image_element .= '<div class=\"sb-description\"><h3>'.$description.'</h3><h4>'.$author.'</h4></div>';\r\n\t\t\t\t\t\t\t$image_element .= '</li>';\r\n\t\t\t\t\t\t\t$main_slideshow .= $image_element;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// We have to show the image in the order foreseen\r\n\t\t\t\t\tforeach ( $the_ids as $id ) {\r\n\t\t\t\t\t\tforeach ( $image_posts as $image_post ) {\r\n\t\t\t\t\t\t\tif ($image_post->ID == $id) {\r\n\t\t\t\t\t\t\t\t$real_image_informations = $this->get_complemtary_image_infos($image_post);\r\n\t\t\t\t\t\t\t\tif($real_image_informations['image_datas']){\r\n\t\t\t\t\t\t\t\t\t$image_url = $this->site_url.'/wp-content/uploads/'.$real_image_informations['image_datas']['file'];\r\n\t\t\t\t\t\t\t\t\t$description = $image_post->post_content;\r\n\t\t\t\t\t\t\t\t\tif (strlen($description) == 0){\r\n\t\t\t\t\t\t\t\t\t\t$description = $image_post->post_excerpt;\r\n\t\t\t\t\t\t\t\t\t\tif (strlen($description) == 0){\r\n\t\t\t\t\t\t\t\t\t\t\t$description = $image_post->post_title;\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\t$author = 'Xxxxxxx';\r\n\t\t\t\t\t\t\t\t\tif($real_image_informations['author']){\r\n\t\t\t\t\t\t\t\t\t\t$author = $real_image_informations['author']->display_name;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$title_alt = $description.\"|\".$author;\r\n\t\t\t\t\t\t\t\t\t$identifiant_slicebox = basename($atts['path']);\r\n\t\t\t\t\t\t\t\t\t$image_element = '<li><a href=\"#\"><img src=\"'.$image_url.'\" alt=\"'.$title_alt.'\" title=\"'.$title_alt.'\" /></a>';\r\n\t\t\t\t\t\t\t\t\t$image_element .= '<div class=\"sb-description\"><h3>'.$description.'</h3><h4>'.$author.'</h4></div>';\r\n\t\t\t\t\t\t\t\t\t$image_element .= '</li>';\r\n\t\t\t\t\t\t\t\t$main_slideshow .= $image_element;\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$main_slideshow .= '</ul>';\r\n\t\t\t\t$main_slideshow .= '<div class=\"shadow\"></div><div id=\"nav-arrows'.$identifiant_slicebox.'\" class=\"nav-arrows\"><a href=\"#\">Next</a><a href=\"#\">Previous</a></div>';\r\n\t\t\t\t$main_slideshow .= '<div class=\"nav-dots\"><span class=\"nav-dot-current\"></span><span></span><span></span><span></span><span></span><span></span><span></span></div>';\r\n\t\t\t\t$main_slideshow .= '</div>'; //.wrapper\r\n\t\t\t\treturn $main_slideshow;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn \"<h2>Mon SlideShow ici:\" . $atts ['ids'] . \"</h2>\";\r\n\t\t}",
"function wp_swiper_shortcode_caption($atts = array(), $content = \"\") {\n $html_atts = array('id', 'class');\n $options = array();\n\n $atts = shortcode_atts(array(\n 'class' => 'swiper-slide-caption',\n 'before_content' => \"\",\n 'after_content' => '',\n ), $atts, 'swiper_caption');\n\n $json = json_encode($options, JSON_UNESCAPED_SLASHES);\n\n // Create output\n $output = \"\";\n $output.= \"<div\";\n foreach ($atts as $name => $value) {\n if (in_array($name, $html_atts)) {\n $output.= ' ' . $name . '=\"' . $value . '\"';\n } else {\n $options[$name] = $value;\n }\n }\n $output.= \">\";\n\n $output.= $options['before_content'];\n $output.= do_shortcode( $content );\n $output.= $options['after_content'];\n\n $output.= \"</div>\";\n return $output;\n}",
"function storefront_homepage_slider() {\n\t\t$args = array(\n\t\t\t'numberposts' => 5,\n\t\t\t'category_name' => 'slider',\n\t\t\t'orderby' => 'date',\n\t\t\t'order' => 'DESC',\n\t\t\t'include' => array(),\n\t\t\t'exclude' => array(),\n\t\t\t'meta_key' => '',\n\t\t\t'meta_value' =>'',\n\t\t\t'post_type' => 'post',\n\t\t\t'suppress_filters' => true,\n\t\t);\n\t\techo '<section class=\"storefront-product-section storefront-slider\">';\n\t\t$html = '<div class=\"flexslider\"><ul class=\"slides\">';\n\t\t$postsArray = get_posts( $args );\n\t\tforeach ($postsArray as $post) {\n\t\t\t$html .= '<li><img src=\"' . get_the_post_thumbnail_url($post->ID, 'post-thumbnail') . '\" /></li>';\n\t\t}\n\t\t$html .= '</ul></div>';\n\t\techo $html;\n\t\techo '</section>';\n\t}"
] | [
"0.76322514",
"0.76264036",
"0.7619068",
"0.7595993",
"0.7568466",
"0.7568283",
"0.7528375",
"0.740966",
"0.7382224",
"0.7368374",
"0.732405",
"0.73139834",
"0.7307089",
"0.72468704",
"0.7230195",
"0.7195298",
"0.7088837",
"0.7083415",
"0.6939523",
"0.69385415",
"0.69012755",
"0.6818845",
"0.67895216",
"0.6774114",
"0.67733055",
"0.67674214",
"0.6752984",
"0.6752233",
"0.67499787",
"0.6723973"
] | 0.79491276 | 0 |
/ Portfolio Shortcode ===================== | function sumer_portfolio_shortcode_func($atts) {
extract(shortcode_atts(array(
), $atts));
$args = array( 'post_type' => 'portfolio', 'posts_per_page' => -1 );
$l = new WP_Query( $args );
if($l->have_posts()) {
$output = '<div class="latest-work p-t-120 p-b-50">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-lg-12">
<h1 class="text-center green text-uppercase bold">our latest works</h1>
</div>
</div>
</div><div class="cube-portfolio">';
$output .= '<!-- Filters Container--><div class="isotope-filters">';
$terms = get_terms('portfolio_category');
$count = count($terms);
$output .= '<button data-filter="" class="active">All</button>';
if ( $count > 0 ){
foreach ( $terms as $term ) {
$termname = strtolower($term->name);
$termname = str_replace(' ', '-', $termname);
$output .= '<button data-filter=".'.$termname.'">'.$term->name.'</button>';
}
}
$output .= '</div><!--/end Filters Container-->';
$output .= '<!-- grid container --><div class="isotope popup-gallery">';
while ( $l->have_posts() ) {
$l->the_post();
$attachment_src = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
$thumb_url = wp_get_attachment_url( get_post_thumbnail_id() );
$terms = get_the_terms( get_the_ID(), 'portfolio_category' );
if ($terms && !is_wp_error($terms)) {
$links = array();
foreach ($terms as $term) {
$links[] = $term->name;
}
$tax_links = join(" ", str_replace(' ', '-', $links));
$tax = strtolower($tax_links);
} else {
$tax = '';
}
$cat_output = join(", ", $links);
$output .= '<div class="item '.$tax.'">';
$output .= '<img src="'.$attachment_src[0].'" class="img-responsive imgg" alt="'. get_the_title() .'"/>';
$output .= '<div class="details">
<a title="Vee Code" href="'.$thumb_url.'" class="zoom-icon"><img src="'.get_template_directory_uri().'/images/zoom-icon.png" alt=""/></a>
<h5>'.get_the_title().'</h5>
</div>';
$output .= '</div>';
}
$output .= '</div><!-- /grid container -->';
$output .= '</div> </div>';
}
return $output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function altitude_child_display_portfolio( $atts, $content = null ) {\r\n $atts = shortcode_atts (\r\n array(),\r\n $atts,\r\n 'display_portfolio'\r\n );\r\n\r\n ob_start();\r\n include 'templates/shortcodes/portfolio.php';\r\n return ob_get_clean();\r\n}",
"function tb_longwave_portfolio_options_callback() {\n\techo '<p>Build unlimited Portfolios here. Insert a human readable <strong>name</strong> and choose the <strong>page</strong> that holds the Portfolio.</p><p>When you create a new portfolio it will be visible in the WP menu after saving.</p><p>You can only select from Pages of the Template type \"Portfolio\". You must set the Page Attribute -> Template -> \"Portfolio\" first in the \"Edit Page\" screen.</p><p>You can copy the slug here if you want to use it in a shortcode (or use our ShortCode Button). You could also change the slug here but only if you really, really need to and know what you are up to!!</p>';\n}",
"function gogreen_portfolio_archive(){\n\n $view = gogreen_get_option('portfolio_archive_layout');\n $columns = gogreen_get_option('portfolio_archive_grid_columns');\n $pagination = gogreen_get_option('portfolio_archive_pagination');\n\n $term = get_queried_object();\n $term_id = '';\n if($term) $term_id = $term->term_id;\n\n echo do_shortcode( sprintf('[wyde_portfolio_grid view=\"%s\" columns=\"%s\" pagination=\"%s\" hide_filter=\"true\" posts_query=\"tax_query:%s\"]', esc_attr($view), esc_attr($columns), esc_attr($pagination), esc_attr($term_id) ) );\n}",
"function portfolio_section_shortcode( $atts ){ ob_start(); global $pitheme; ?>\n\n\t<section id=\"works\" class=\"works_area section-padding\">\n\t\t<div class=\"works-inner\">\n\t\t\t<div class=\"container\">\n\n\t\t\t\t<div class=\"section-header\">\n\t\t\t\t\t<h2 class=\"text-center\">Our Latest Works</h2>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"work-category page-filter\">\n\t\t\t\t\t<div class=\"filter\" data-filter=\"all\">Show All</div>\n\n\t\t\t\t\t<?php $terms = get_terms( 'category-portfolio' );\n\n\t\t\t\t\tif ( $terms && ! is_wp_error( $terms ) ) :\n\n\t\t\t\t\tforeach ( $terms as $term ) : ?>\n\t\t\t\t\t\t<div class=\"filter\" data-filter=\".<?php echo $term->slug ?>\"><?php echo $term->name ?></div>\n\t\t\t\t\t<?php endforeach; endif; ?>\n\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div id=\"latest_works\" class=\"works_items page-items\">\n\n\t\t\t<?php $portfolio_item= new WP_Query(array(\n\t\t\t\t'post_type' \t\t => 'portfolio-items',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'order' \t\t\t\t => 'DESC'\n\t\t\t));\n\n\t\t\tif($portfolio_item->have_posts()) : while($portfolio_item->have_posts()) : $portfolio_item->the_post();\n\t\t\t\t$portfolio_items = get_the_terms( get_the_ID(), 'category-portfolio' );\n\t\t\t\t$portfolio_url = get_post_meta( get_the_ID(), '_pitheme_portfolio_url', 1 );\n\n\t\t\t\tif ( $portfolio_items && ! is_wp_error( $portfolio_items ) ) :\n\t\t\t\t\t$portfolio_items_slug = array();\n\n\t\t\t\tforeach ($portfolio_items as $portfolio_category) {\n\t\t\t\t\t$portfolio_items_slug[] = $portfolio_category->slug;\n\t\t\t\t}\n\n\t\t\t\t$portfolio_slug = join(' ', $portfolio_items_slug);\n\t\t\t?>\n\t\t\t <div class=\"mix <?php echo $portfolio_slug ?>\" data-my-order=\"<?php echo $portfolio_category->term_id; ?>\">\n\t\t\t\t\t<?php the_post_thumbnail('portfolio-thumb', array('class'=>'img-responsive')); ?>\n\n\t\t\t\t\t<div class=\"overlay\">\n\t\t\t\t\t\t<div class=\"overlay-content\">\n\t\t\t\t\t\t\t<?php if($portfolio_url) : ?>\n\t\t\t\t\t\t\t<div class=\"icon\">\n\t\t\t\t\t\t\t\t<a href=\"<?php echo $portfolio_url; ?>\"><i class=\"fa fa-link\"></i></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<?php the_title('<h4><a href=\"'.get_the_permalink().'\">','</a></h4>'); ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t </div>\n\n\t\t\t<?php endif; ?>\n\n\t\t\t<?php endwhile; wp_reset_postdata(); ?>\n\n\t\t<?php endif; ?>\n\n\t\t</div>\n\n\t</section>\n\n<?php return ob_get_clean(); }",
"function custom_portfolio() {\n\n $labels = array(\n 'name' => _x('Portfolios', 'Post Type General Name', 'jp-basic'),\n 'singular_name' => _x('Portfolio', 'Post Type Singular Name', 'jp-basic'),\n 'menu_name' => __('Portfolio', 'jp-basic'),\n 'name_admin_bar' => __('Portfolio', 'jp-basic'),\n 'archives' => __('Item Archives', 'jp-basic'),\n 'attributes' => __('Item Attributes', 'jp-basic'),\n 'parent_item_colon' => __('Parent Item:', 'jp-basic'),\n 'all_items' => __('All Items', 'jp-basic'),\n 'add_new_item' => __('Add New Item', 'jp-basic'),\n 'add_new' => __('Add New', 'jp-basic'),\n 'new_item' => __('New Item', 'jp-basic'),\n 'edit_item' => __('Edit Item', 'jp-basic'),\n 'update_item' => __('Update Item', 'jp-basic'),\n 'view_item' => __('View Item', 'jp-basic'),\n 'view_items' => __('View Items', 'jp-basic'),\n 'search_items' => __('Search Item', 'jp-basic'),\n 'not_found' => __('Not found', 'jp-basic'),\n 'not_found_in_trash' => __('Not found in Trash', 'jp-basic'),\n 'featured_image' => __('Featured Image', 'jp-basic'),\n 'set_featured_image' => __('Set featured image', 'jp-basic'),\n 'remove_featured_image' => __('Remove featured image', 'jp-basic'),\n 'use_featured_image' => __('Use as featured image', 'jp-basic'),\n 'insert_into_item' => __('Insert into item', 'jp-basic'),\n 'uploaded_to_this_item' => __('Uploaded to this item', 'jp-basic'),\n 'items_list' => __('Items list', 'jp-basic'),\n 'items_list_navigation' => __('Items list navigation', 'jp-basic'),\n 'filter_items_list' => __('Filter items list', 'jp-basic'),\n );\n $args = array(\n 'label' => __('Portfolio', 'jp-basic'),\n 'description' => __('Post Type Description', 'jp-basic'),\n 'labels' => $labels,\n 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats',),\n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-clipboard',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\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('portfolio', $args);\n}",
"function gwp_include_portfolio($prefix, $defaults, $field)\n{\n $output = '';\n if (gwp_theme_mod($prefix, $defaults, $field . '_portfolio_show_tags') != '0')\n {\n $output .= '<header>\n <nav id=\"' . $prefix . '_portfolio_tags\" class=\"navbar navbar-inverse\">\n <div class=\"navbar-header\">\n <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#tags-' . $prefix . '\" aria-expanded=\"false\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>\n </div> \n <div class=\"collapse navbar-collapse\" id=\"tags-' . $prefix . '\">\n <ul class=\"nav nav-pills text-' . gwp_theme_mod_value($prefix, $defaults, $field . '_portfolio_tags_position', '0') . ' bspace-1\">';\n $all_project_tags = get_terms('project_tag');\n $output .= '<li role=\"presentation\" class=\"active\"><a data-rel=\"all\" class=\"item-cat\">All</a></li>';\n if (!empty($all_project_tags) && !is_wp_error($all_project_tags))\n {\n foreach ($all_project_tags as $project_tag)\n {\n $output .= '<li role=\"presentation\"><a data-rel=\"' . $project_tag->slug . '\" class=\"item-cat\">' . $project_tag->name . '</a></li>';\n }\n }\n\n $output .= '</ul>\n </div>\n </nav>\n </header>\n </div>';\n }\n if (gwp_theme_mod($prefix, $defaults, $field . '_number_posts') != '0')\n {\n $post_ids = gwp_get_posts('portfolio', gwp_theme_mod_value($prefix, $defaults, $field . '_number_posts', '0'));\n $output .= '<div id=\"' . $prefix . '-portfolio-items\" class=\"portfolio-items';\n if (gwp_theme_mod($prefix, $defaults, $field . '_portfolio_layout') == 'masonry' || \n gwp_theme_mod($prefix, $defaults, $field . '_portfolio_layout') == 'mosaic')\n {\n $output .= ' masonry';\n }\n $output .= '\">';\n $output .= '<div class=\"row';\n if (gwp_theme_mod($prefix, $defaults, $field . '_portfolio_gutters') == '0')\n {\n $output .= ' row-gutters';\n }\n else\n {\n $output .= ' no-gutters';\n }\n $output .= '\">';\n if (gwp_theme_mod($prefix, $defaults, $field . '_portfolio_layout') == 'mosaic')\n {\n $output .= gwp_mosaic_grid($prefix, gwp_calc_mosaic_mod(sizeof($post_ids)));\n }\n foreach ($post_ids as $post_id)\n {\n $output .= '<div class=\"col-sm-';\n if (gwp_theme_mod($prefix, $defaults, $field . '_layout') != '0')\n {\n $output .= gwp_theme_mod_value($prefix, $defaults, $field . '_layout', '0');\n }\n else\n {\n $output .= '3';\n }\n if (gwp_theme_mod($prefix, $defaults, $field . '_portfolio_gutters') == '0')\n {\n $output .= ' col-gutter';\n }\n if (gwp_theme_mod($prefix, $defaults, $field . '_load') != '0')\n {\n $output .= ' to-load';\n }\n $output .= '\">';\n $output .= '<article class=\"item';\n $project_tags = get_the_terms($post_id, 'project_tag');\n $output .= ' all';\n if (!empty($project_tags) && !is_wp_error($project_tags))\n {\n foreach ($project_tags as $project_tag)\n {\n $output .= ' ' . $project_tag->slug;\n }\n }\n if (has_post_thumbnail($post_id) || \n get_post_meta($post_id, '_featured_image_bg_color_key', true) != 'select')\n {\n $output .= ' ed-styles autothumb';\n if (gwp_theme_mod($prefix, $defaults, $field . '_portfolio_layout') == 'default')\n {\n $output .= '';\n }\n elseif (gwp_theme_mod($prefix, $defaults, $field . '_portfolio_layout') == 'landscape')\n {\n $output .= ' landscape';\n }\n elseif (gwp_theme_mod($prefix, $defaults, $field . '_portfolio_layout') == 'portrait')\n {\n $output .= ' portrait';\n }\n elseif (get_post_meta($post_id, '_featured_image_layout_key', true))\n {\n $output .= ' ' . get_post_meta($post_id, '_featured_image_layout_key', true);\n }\n if (gwp_theme_mod($prefix, $defaults, $field . '_portfolio_gutters') == '0')\n {\n $output .= ' bspace-1';\n }\n if (get_post_meta($post_id, '_featured_image_bg_size_key', true))\n {\n $output .= ' img-' . get_post_meta($post_id, '_featured_image_bg_size_key', true);\n }\n $output .= '\" style=\"background-image: url(' . get_the_post_thumbnail_url($post_id) . ');';\n if (get_post_meta($post_id, '_featured_image_bg_color_key', true) != 'select')\n {\n $output .= ' background-color: ' . get_post_meta($post_id, '_featured_image_bg_color_key', true) . ';';\n }\n }\n $output .= '\">';\n\n $output .= '<div class=\"item-desc\">\n <header>\n <h3 class=\"item-title\">' . get_the_title($post_id) . '</h3>\n </header>\n <p class=\"item-info\">' . get_the_excerpt($post_id) . ' <a href=\"' . get_the_permalink($post_id) . '\"><span class=\"ion-android-add xs\"></span></a></p>\n </div>\n </article>\n </div>';\n\n }\n $output .= '</div>';\n if (gwp_theme_mod($prefix, $defaults, $field . '_load') != '0' && \n gwp_theme_mod($prefix, $defaults, $field . '_load_more') != '0')\n {\n $output .= '<div class=\"row\">\n <div class=\"col-sm-12 text-center mdspace-2\">\n <button class=\"load-more btn btn-default\">' . __('Load more', 'gaudium') . '</button>\n </div>\n </div>';\n }\n }\n return $output;\n}",
"function portfolio( $elements )\r\n{\r\n\r\n\tif ( empty( $elements[0] )) { ?>\r\n\t\t<title>Portfolio - <?php showOption( 'name' ); ?></title><?php\r\n\t\t$posts = $GLOBALS['JBLDB'] -> query( \"SELECT * FROM \". _DBPREFIX .\"posts WHERE ( state = 'published' AND ilk = 'project' ) ORDER BY created DESC\" );\r\n\t\tif ( count( $posts ) > 0) {\r\n\t\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/archive.php' );\r\n\t\t} else {\r\n\t\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/404.php' );\r\n\t\t}\r\n\t} elseif ( $elements[0] == \"categories\" ) { ?>\r\n\t\t<title>Category : <?php echo( ucwords( $elements[1] ) ); ?> - <?php showOption( 'name' ); ?></title><?php\r\n\t\t$posts = $GLOBALS['JBLDB'] -> query( \"SELECT * FROM \". _DBPREFIX .\"posts WHERE ( state = 'published' AND ilk = 'project' AND category LIKE '%\".$elements[1].\"%' ) ORDER BY created DESC\" );\r\n\t\tif ( count( $posts ) > 0) {\r\n\t\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/archive.php' );\r\n\t\t} else {\r\n\t\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/404.php' );\r\n\t\t}\r\n\t} elseif ( $elements[0] == \"clients\" ) { ?>\r\n\t\t<title>Category : <?php echo( ucwords( $elements[1] ) ); ?> - <?php showOption( 'name' ); ?></title><?php\r\n\t\t$posts = $GLOBALS['JBLDB'] -> query( \"SELECT * FROM \". _DBPREFIX .\"users WHERE ( state = 'published' AND ilk = 'client' AND username LIKE '\".$elements[1].\"' ) ORDER BY created DESC\" );\r\n\t\tif ( count( $posts ) > 0) {\r\n\t\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/archive.php' );\r\n\t\t} else {\r\n\t\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/404.php' );\r\n\t\t}\r\n\t} elseif ( $elements[0] == \"projects\" ) {\r\n\t\t$posts = $GLOBALS['JBLDB'] -> query( \"SELECT * FROM \". _DBPREFIX .\"posts WHERE ( state = 'published' AND ilk = 'project' AND slug LIKE '\".$elements[1].\"' ) ORDER BY created DESC\" );\r\n\t\tif ( count( $posts ) > 0) {\r\n\t\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/post.php' );\r\n\t\t} else {\r\n\t\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/404.php' );\r\n\t\t}\r\n\t} else { ?>\r\n\t\t<title>Portfolio Project - <?php showOption( 'name' ); ?></title><?php\r\n\t\t$posts = $GLOBALS['JBLDB'] -> query( \"SELECT * FROM \". _DBPREFIX .\"posts WHERE ( state = 'published' AND ilk = 'project' ) ORDER BY created DESC\" );\r\n\t\tif ( count( $posts ) > 0 ) {\r\n\t\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/archive.php' );\r\n\t\t} else {\r\n\t\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/404.php' );\r\n\t\t}\r\n\t}\r\n}",
"function media_credit_shortcode($atts, $content = null)\n{\n extract(shortcode_atts(array('name' => ''), $atts));\n $output = '<div class=\"wp-caption alignnone\">' . $content . '<p class=\"wp-caption-text\">' . $name . '</p></div>';\n return $output;\n}",
"function et_pb_portfolio_meta_box() { ?>\n\t<div class=\"et_project_meta\">\n\t\t<strong class=\"et_project_meta_title\"><?php echo esc_html__( 'Search Our Koi Champions by Tag', 'Divi' ); ?></strong>\n\t\t<p><?php echo get_the_term_list( get_the_ID(), 'project_tag', '', ', ' ); ?></p>\n\n\t\t<strong class=\"et_project_meta_title\"><?php echo esc_html__( 'Posted on', 'Divi' ); ?></strong>\n\t\t<p><?php echo get_the_date(); ?></p>\n\t</div>\n<?php }",
"function massdata_pricing_shortcode($atts, $content){\n $atts = shortcode_atts(\n array(\n 'item' => 0,\n 'title' => \"\",\n 'group' => \"price\",\n 'content' => !empty($content) ? $content : NULL\n ), $atts\n );\n\n extract($atts);\n\n $item = absint($item);\n if(isset($item) && !empty($item) ){\n\n $img_url = wp_get_attachment_image_src($item, \"full\");\n\n $concatenate = '<a href=\"'.$img_url[0].'\" class=\"view-charges-img\" title=\"'.$title.'\" rel=lightbox-'.$group.'></a>';\n \n return $concatenate;\n\n } else {\n\n return \"\";\n \n }\n}",
"function mpcth_portfolio_posts($query, $atts, $class = 'related') {\r\n\textract(shortcode_atts(array(\r\n\t\t'background_hover' => '',\r\n\t\t'text_hover' => '',\r\n\t\t'css_animation' => ''\r\n\t), $atts));\r\n\r\n\t$index = 0;\r\n\r\n\t$count = $query->post_count;\r\n\r\n\t$css_id = 'mpcth_sc_' . $class . '_portfolio_' . mpcth_random_ID(5);\r\n\r\n\t$background_ie = $background_hover;\r\n\t$background_hover = 'rgba(' . implode(', ', mpcth_hex_to_rgba($background_hover, 0.95)) . ')';\r\n\t\r\n\t$return = '<div id=\"' . $css_id . '\" class=\"mpcth-sc-' . $class . '-portfolio mpcth-sc-grid-portfolio-columns-' . $count . ' mpcth-waypoint-trigger' . ($css_animation != '' ? ' mpcth-stack-animation' : '') . '\"' . ($css_animation != '' ? ' data-animation-type=\"' . $css_animation . '\"' : '') . '>';\r\n\t\t$return .= '<ul class=\"mpcth-sc-grid-portfolio-list\">';\r\n\t\tif($query->have_posts()) {\r\n\t\t\twhile($query->have_posts()) {\r\n\t\t\t\t$query->the_post();\r\n\r\n\t\t\t\t$index++;\r\n\r\n\t\t\t\t$categories = get_the_terms(get_the_ID(), 'mpcth_portfolio_category');\r\n\t\t\t\t$categories_str = '';\r\n\t\t\t\tif(!empty($categories)) {\r\n\t\t\t\t\t$last_item = end($categories);\r\n\t\t\t\t\tforeach($categories as $category) {\r\n\t\t\t\t\t\t$categories_str .= '<a class=\"mpcth-sc-grid-portfolio-post-category\" href=\"'.get_term_link($category->slug, 'mpcth_portfolio_category').'\">';\r\n\t\t\t\t\t\tif($category == $last_item)\r\n\t\t\t\t\t\t\t$categories_str .= $category->name;\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t$categories_str .= $category->name.', ';\r\n\t\t\t\t\t\t$categories_str .= '</a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(function_exists('zilla_likes')) {\r\n\t\t\t\t\tob_start();\r\n\t\t\t\t\tzilla_likes();\r\n\t\t\t\t\t$zilla_likes = ob_get_contents();\r\n\t\t\t\t\tob_end_clean();\r\n\t\t\t\t}\r\n\t\t\t\tif($index == $count)\r\n\t\t\t\t\t$return .= '<li class=\"mpcth-sc-grid-portfolio-post last-item\">';\r\n\t\t\t\telse \r\n\t\t\t\t\t$return .= '<li class=\"mpcth-sc-grid-portfolio-post\">';\r\n\r\n\t\t\t\t\tif(has_post_thumbnail(get_the_ID()))\r\n\t\t\t\t\t\t$return .= get_the_post_thumbnail(get_the_ID(), 'mpcth-post-thumbnails-col-3', array('class' => \"mpcth-sc-grid-portfolio-post-thumb\"));\r\n\t\t\t\t\t$return .= '<div class=\"mpcth-sc-grid-portfolio-post-info-wrap\">';\r\n\t\t\t\t\t\t$return .= '<div class=\"mpcth-sc-grid-portfolio-post-info\">';\r\n\t\t\t\t\t\t\t$return .= '<h6 class=\"mpcth-sc-grid-portfolio-post-title\">';\r\n\t\t\t\t\t\t\t\t$return .= '<a href=\"' . get_permalink(get_the_ID()) . '\">';\r\n\t\t\t\t\t\t\t\t\t$return .= get_the_title();\r\n\t\t\t\t\t\t\t\t$return .= '</a>';\r\n\t\t\t\t\t\t\t$return .= '</h6>';\r\n\t\t\t\t\t\t\tif(!empty($zilla_likes)) {\r\n\t\t\t\t\t\t\t\t$return .= '<div class=\"mpcth-sc-grid-portfolio-post-likes\">' . $zilla_likes . '</div>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(!empty($categories_str)) {\r\n\t\t\t\t\t\t\t\t$return .= '<div class=\"mpcth-sc-grid-portfolio-post-categories\">' . $categories_str . '</div>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$return .= '</div>';\r\n\t\t\t\t\t$return .= '</div>';\r\n\t\t\t\t$return .= '</li>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$return .= '</ul>';\r\n\t\t$return .= '<div class=\"mpcth-clear-fix\"></div>';\r\n\t$return .= '</div>';\r\n\t$return .= '<style>';\r\n\t\t$return .= '#' . $css_id . ' .mpcth-sc-grid-portfolio-list .mpcth-sc-grid-portfolio-post-info-wrap { background: ' . $background_ie . '; background: ' . $background_hover . '; border-bottom-color: ' . mpcth_adjust_brightness($background_ie, -20) . ' !important; }' . PHP_EOL;\r\n\t\t$return .= '#' . $css_id . ' .mpcth-sc-grid-portfolio-list .mpcth-sc-grid-portfolio-post-info-wrap * { color: ' . $text_hover . '; }' . PHP_EOL;\r\n\t\t$return .= '#' . $css_id . ' .mpcth-sc-grid-portfolio-list .mpcth-sc-grid-portfolio-post-info-wrap *:before { color: ' . $text_hover . '; }' . PHP_EOL;\r\n\t\t$return .= '#' . $css_id . ' .mpcth-sc-grid-portfolio-list .mpcth-sc-grid-portfolio-post-info-wrap:hover * { color: ' . $text_hover . '; }' . PHP_EOL;\r\n\t\t$return .= '#' . $css_id . ' .mpcth-sc-grid-portfolio-list .mpcth-sc-grid-portfolio-post-info-wrap:hover *:before { color: ' . $text_hover . '; }' . PHP_EOL;\r\n\t$return .= '</style>';\r\n\r\n\t$return = parse_shortcode_content($return);\r\n\treturn $return;\r\n}",
"function _sp_portfolio_categories_column_functions( $empty, $column, $post_id ) {\n\tswitch ( $column ) {\n\n\t\tcase 'shortcode' :\n\t\t\techo '[sp-portfolio category=\"' . $post_id . '\"]';\n\t\t\tbreak;\n\t}\n\t\n}",
"function addShortPortfolio() {\n\t\t\tif ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) return;\n\t\t\t\n\t\t\t// Add only in Rich Editor mode\n\t\t\tif ( get_user_option('rich_editing') == 'true') {\n\t\t\t \n\t\t\t\t// add the button for wp2.5 in a new way\n\t\t\t\tadd_filter(\"mce_external_plugins\", array(&$this, \"add_DDShortsPortfolio_plugin\" ), 5);\n\t\t\t\tadd_filter('mce_buttons', array(&$this, 'register_DDShortsPortfolio_button' ), 5);\n\t\t\t\t\n\t\t\t}\n\t\t}",
"function oxy_shortcode_testimonials( $atts , $content = '' ) {\n // setup options\n extract( shortcode_atts( array(\n 'title' => '',\n 'count' => 3,\n 'layout' => 'big',\n 'columns' => 3,\n 'style' => '',\n 'group' => '',\n ), $atts ) );\n\n $query_options = array(\n 'post_type' => 'oxy_testimonial',\n 'numberposts' => $count,\n 'order' => 'ASC',\n 'orderby' => 'menu_order',\n );\n\n if( !empty( $group ) ) {\n $query_options['tax_query'] = array(\n array(\n 'taxonomy' => 'oxy_testimonial_group',\n 'field' => 'slug',\n 'terms' => $group\n )\n );\n }\n\n // fetch posts\n $span = $columns == 3? 'span4':'span3';\n $items = get_posts( $query_options );\n $items_count = count( $items );\n $output = '';\n if( $items_count > 0):\n $item_num = 1;\n if( $layout == 'big'){ ?>\n <?php\n foreach ($items as $item) :\n global $post;\n $post = $item;\n setup_postdata($post);\n $custom_fields = get_post_custom($post->ID);\n\n $img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full' );\n $class = ($item_num % 2 == 0)? ' class=\"pull-right\"':'';\n $cite = (isset($custom_fields[THEME_SHORT.'_citation']))? $custom_fields[THEME_SHORT.'_citation'][0]:'';\n $hr = ($item_num !== $items_count)? '<hr>':'';\n $output .='<div class=\"row-fluid\">';\n if ($item_num % 2 == 1){\n $output.='<div class=\"span3\"><div class=\"round-box box-big\"><span class=\"box-inner\">';\n $output.='<img alt=\"' . get_the_title() . '\" class=\"img-circle\" src=\"'. $img[0]. '\" ></span></div></div>';\n }\n $output.='<div class=\"span9\"><blockquote' . $class . '>'.'<p class=\"lead\">'. get_the_content();\n $output.='</p><small>'.get_the_title() .'<cite title=\"Source Title\"> '.$cite .'</cite></small></blockquote></div>';\n if ($item_num % 2 == 0){\n $output.='<div class=\"span3\"><div class=\"round-box box-big\"><span class=\"box-inner\">';\n $output.='<img alt=\"' . get_the_title() . '\" class=\"img-circle\" src=\"'. $img[0]. '\"></span></div></div>';\n }\n $output .='</div>'. $hr ;\n $item_num++;\n endforeach;\n }\n else { // Calculate how many items we will render before we need another row\n $items_per_row = ($span == 'span4')? 3:4;\n $item_num = 1;\n $output .='<ul class=\"inline row-fluid\">';\n foreach ($items as $item) :\n global $post;\n $post = $item;\n setup_postdata($post);\n $custom_fields = get_post_custom($post->ID);\n $cite = (isset($custom_fields[THEME_SHORT.'_citation']))? $custom_fields[THEME_SHORT.'_citation'][0]:'';\n $img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full' );\n\n if($item_num > $items_per_row){\n $output.= '</ul><ul class=\"inline row-fluid\">';\n $item_num = 1;\n }\n\n $output.='<li class=\"'. $span .'\"><div class=\"well blockquote-well\"><blockquote><p>'. get_the_content().'</p>';\n $output.='<small>'.get_the_title().'<cite title=\"Source Title\"> '.$cite.'</cite></small></blockquote>';\n $output.='<div class=\"round-box box-medium\"><span class=\"box-inner\"><img alt=\"' . get_the_title() . '\" class=\"img-circle\" src=\"'. $img[0] .'\"></span></div></div></li>';\n $item_num++;\n\n endforeach;\n $output.='</ul>';\n }\n\n wp_reset_postdata();\n endif;\n\n return oxy_shortcode_section( $atts, $output );\n}",
"function woo_testimonial_sc( $atts, $content = null) {\nextract( shortcode_atts( array(\n 'author' => '',\n 'img' => ''\n ), $atts ) );\n return '<div class=\"testimonial\"><em>' . do_shortcode($content) . '</em></div><div class=\"testimonial-img\"><img src=\"' .$img. '\"></div><div class=\"testimonial-author\">' .$author. '</div><div class=\"clear\"></div>';\n}",
"function shortcode_category_slider($atts){\n\tob_start();\n\t\t$a = shortcode_atts( array ( \n\t\t\t'category' => 'phone',\n\t\t),$atts );\n\t\t?>\n\n\t\t<div class=\"row\">\n\t\t\t<div id=\"slider\" class=\"slick-slides col col-12\">\n\t\t\t\t<?php\n\t\t\t\t$query = new WP_Query( array(\n\t\t\t\t\t'category_name' => $a['category'],\n\t\t\t\t\t'post_type' => 'post',\n\t\t\t\t) );\n\n\t\t\t\tif($query->have_posts()){\n\t\t\t\t\twhile($query->have_posts()){\n\t\t\t\t\t\t$query->the_post();\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t<?php if(has_post_thumbnail()){ \n\t\t\t\t\t\t\techo get_the_post_thumbnail(); \n\t\t\t\t\t\t} ?>\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\twp_reset_postdata();\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<?php\n\t}",
"function sc_pricing_item( $attr, $content = null )\n{\n\textract(shortcode_atts(array(\n\t\t'title' \t\t=> '',\n\t\t'subtitle' \t\t=> '',\n\t\t'price' \t\t=> '',\n\t\t'currency' \t\t=> '',\n\t\t'period' \t\t=> '',\n\t\t'link_title'\t=> '',\n\t\t'link' \t\t\t=> '',\n\t\t'featured' \t\t=> '',\n\t), $attr));\n\t\n\t$classes = '';\n\t\n\t// featured\n\tif( $featured ){\n\t\t$classes .= ' pricing-box-featured';\n\t}\n\n\t$output = '<div class=\"pricing-box'. $classes .'\">';\n\t\t$output .= '<div class=\"plan-header\">';\n\t\t\t$output .= '<h3>'. $title .'</h3>';\n\t\t\tif( $subtitle )$output .= '<p class=\"subtitle\">'. $subtitle .'</p>';\n\t\t$output .= '</div>';\n\t\t$output .= '<div class=\"plan-inside\">';\n\t\t\t$output .= do_shortcode($content);\n\t\t$output .= '</div>';\n\t\t$output .= '<div class=\"plan-footer\">';\n\t\t\tif( $price ) $output .= '<div class=\"price\"><sup class=\"currency\">'. $currency .'</sup>'. $price .'<sup class=\"period\">'. $period .'</sup></div>';\n\t\t\tif( $link ) $output .= '<div class=\"button\"><a class=\"button\" href=\"'. $link .'\">'. $link_title .'</a></div>';\n\t\t$output .= '</div>';\n\t$output .= '</div>'.\"\\n\";\n\t\t\n return $output;\n}",
"public function go_portfolio_meta_shortcode( $atts, $content = null ) {\n\t\textract( shortcode_atts( array( \n\t\t\t'key' \t=> null,\n\t\t\t'post_id' => null\n\t\t), $atts ) );\n\n\t\t$post_meta = get_post_meta( $post_id, '' );\n\t\t$shortcode_content = isset( $post_meta[$key][0] ) && !empty( $post_meta[$key][0] ) ? $post_meta[$key][0] : '';\n\t\t$shortcode_content = apply_filters( 'go_portfolio_meta_filter', $shortcode_content, $key, $post_id );\n\t\treturn $shortcode_content;\n\t}",
"function sp_slider_sc( $atts, $content = null ){\r\n\r\n\textract( shortcode_atts( array(\r\n\t\t'slide_id' => null,\r\n\t\t'slide_num' => null,\r\n\t), $atts ) );\r\n\r\n\t$out = '';\r\n\t$args = array(\r\n\t\t'post_type' \t\t=>\t'slider',\r\n\t\t'posts_per_page'\t=>\t$slide_num,\r\n\t\t'p'\t\t\t\t\t=>\t$slide_id\r\n\t);\r\n\r\n\t$custom_query = new WP_Query($args);\t\r\n\t\t\r\n\twhile ($custom_query->have_posts()) :\r\n\t\t$custom_query->the_post();\r\n\t\t$out .= sp_slideshow();\r\n\tendwhile;\r\n\twp_reset_postdata(); // Restore global post data\r\n\r\n\treturn $out;\r\n\r\n}",
"function aglee_pro_portfolio_cb(){\n $count_posts = wp_count_posts('custom-portfolio');\n if($count_posts->publish != '0'){\n ?>\n <div class=\"portfolio-page-container\">\n <div class=\"clearfix\">\n <h2 class=\"wow slideInUp\" data-wow-delay=\"0.4s\"><?php echo $portfolio_title = get_theme_mod('portfolio_homepage_title_setting','Portfolio');?> </h2>\n <h3 class=\"wow slideInUp\" data-wow-delay=\"0.5s\"><?php echo $portfolio_desc = get_theme_mod('portfolio_homepage_description_setting','Lorem Ipsum is simply dummy text of the printing and typesetting industry'); ?></h3>\n <div class=\"portfolio_sub_category wow slideInUp\" data-wow-delay=\"0.4s\" >\n <?php \n $args_tax = array(\n 'orderby' => 'name',\n 'hideempty' => true\n );\n $terms = get_terms( 'category_protfolio', $args_tax );\n if(!empty($terms)){\n ?>\n <ul class=\"button-group cearfix\">\n <li class=\"is-checked\" data-filter=\"*\"><?php echo __('All','aglee-lite'); ?></li>\n <?php \n foreach($terms as $row){ ?>\n <li data-filter=\".port-cat-<?php echo $row->term_id; ?>\"><?php echo $row->name; ?></li>\n <?php } ?>\n </ul>\n <?php \n } // end of empty check terms\n wp_reset_query(); ?>\n </div>\n \n <div class=\"portfolio_slider_wrap clearfix wow fadeInDown\" data-wow-delay=\"0.5s\" >\n <?php\n $portfolio_args = array('post_type' => 'custom-portfolio',\n 'posts_per_page' => -1,\n 'order' => 'DESC',\n );\n $portfolio_query = new WP_Query($portfolio_args);\n if($portfolio_query -> have_posts()){\n while($portfolio_query -> have_posts()){\n $portfolio_query -> the_post();\n $portfolio_image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'aglee-portfolio-image-grid', true );\n $term_lists = wp_get_post_terms(get_the_ID(), 'category_protfolio', array(\"fields\" => \"ids\"));\n $term_slug = array();\n foreach($term_lists as $term){\n $term_slug[] = 'port-cat-'.$term;\n }\n $term_slug = join( ' ', $term_slug );\n ?>\n <div class=\"portfolios clearfix <?php echo $term_slug; ?>\">\n <div class=\"portfolios-inner\">\n <div class=\"protfolio-inner-border\">\n <a href=\"<?php the_permalink(); ?>\"><img src=\"<?php echo $portfolio_image[0]; ?>\" />\n <figcaption>\n <i class=\"fa fa-share-square-o\"></i>\n </figcaption>\n </a>\n \n </div>\n </div>\n </div><!-- end of protfolios -->\n <?php\n }\n }\n wp_reset_query();\n ?>\n </div>\n </div>\n </div>\n <?php \n }\n }",
"function vtsc_testimonial( $atts, $content = null ) {\n extract(shortcode_atts(array(\t'name' \t\t=> '',\n \t\t\t\t\t\t\t\t\t'subtitle'\t=> '',\n \t\t\t\t\t\t\t\t\t'url'\t\t=> '',\n\t\t\t\t\t\t\t\t\t), $atts));\n\t$url = ' - <a href=\"'.$url.'\">'.$url.'</a>';\n\treturn '<div class=\"testimonial\"><blockquote><p>'.do_shortcode($content).'</p><small><cite>'.$name.'</cite><br>'.$subtitle.$url.'</small></blockuote></div>'; \n}",
"function wip_news_shortcode( $atts ) {\n\t// Attributes\n\t$atts = shortcode_atts(\n\t\tarray(\n\t\t\t'num_post' => '2',\n\t\t\t'visible' => '4',\n\t\t),\n\t\t$atts\n\t);\n\n\t$args = array(\n\t\t'post_type' => 'post',\n\t\t'posts_per_page' => $atts['num_post'],\n\t\t'order' => 'DESC',\n\t\t'orderby' => 'date',\n\t);\n\t$queries[] = new WP_Query( $args );\n\n\n\tinclude WIP_SLIDER_PATH . 'front/front-slider.php';\n}",
"function shortcode_template( $atts, $content = null ) {\r\n\t\t\t/* Enqueues */\r\n\t\t\twp_enqueue_script( 'mpc-massive-isotope-js', mpc_get_plugin_path( __FILE__ ) . '/assets/js/libs/isotope.min.js', array( 'jquery' ), '', true );\r\n\r\n\t\t\tglobal $mpc_ma_options;\r\n\t\t\tif ( ! defined( 'MPC_MASSIVE_FULL' ) || ( defined( 'MPC_MASSIVE_FULL' ) && $mpc_ma_options[ 'single_js_css' ] !== '1' ) ) {\r\n\t\t\t\t$this->enqueue_shortcode_scripts();\r\n\t\t\t}\r\n\r\n\t\t\t$atts = shortcode_atts( array(\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'position' => 'both',\r\n\t\t\t\t'gap_top' => '',\r\n\t\t\t\t'gap_bottom' => '',\r\n\t\t\t\t'force_fullwidth' => '',\r\n\t\t\t\t'line_width' => '5',\r\n\t\t\t\t'line_gap' => '15',\r\n\t\t\t\t'mobile_line_gap' => '',\r\n\t\t\t\t'line_color' => '',\r\n\t\t\t\t'vertical_gap' => '15',\r\n\t\t\t\t'pointer_size' => '10',\r\n\t\t\t\t'pointer_gap' => '10',\r\n\t\t\t\t'first_item_gap' => '',\r\n\t\t\t\t'pointer_type' => 'triangle',\r\n\t\t\t\t'pointer_alignment' => 'top',\r\n\t\t\t\t'pointer_color' => '',\r\n\t\t\t\t'line_vinette_top' => '0',\r\n\t\t\t\t'line_vinette_bottom' => '0',\r\n\r\n\t\t\t\t'margin_css' => '',\r\n\r\n\t\t\t\t'animation_in_type' => 'none',\r\n\t\t\t\t'animation_in_duration' => '300',\r\n\t\t\t\t'animation_in_delay' => '0',\r\n\t\t\t\t'animation_in_offset' => '100',\r\n\r\n\t\t\t\t// Ornament\r\n\t\t\t\t'icon_disable' => '',\r\n\t\t\t\t'icon_type' => 'icon',\r\n\t\t\t\t'icon' => '',\r\n\t\t\t\t'icon_character' => '',\r\n\t\t\t\t'icon_image' => '',\r\n\t\t\t\t'icon_image_size' => 'thumbnail',\r\n\t\t\t\t'icon_preset' => '',\r\n\t\t\t\t'icon_size' => '',\r\n\t\t\t\t'icon_color' => '',\r\n\r\n\t\t\t\t'padding_css' => '',\r\n\t\t\t\t'border_css' => '',\r\n\r\n\t\t\t\t'background_type' => 'color',\r\n\t\t\t\t'background_color' => '',\r\n\t\t\t\t'background_image' => '',\r\n\t\t\t\t'background_image_size' => 'large',\r\n\t\t\t\t'background_repeat' => 'no-repeat',\r\n\t\t\t\t'background_size' => 'initial',\r\n\t\t\t\t'background_position' => 'middle-center',\r\n\t\t\t\t'background_gradient' => '#83bae3||#80e0d4||0;100||180||linear',\r\n\t\t\t\t'background_overlay' => '',\r\n\t\t\t), $atts );\r\n\r\n\t\t\t/* Prepare */\r\n\t\t\t$styles = $this->shortcode_styles( $atts );\r\n\t\t\t$css_id = $styles[ 'id' ];\r\n\t\t\t$animation = MPC_Parser::animation( $atts );\r\n\t\t\t$icon = MPC_Parser::icon( $atts );\r\n\r\n\t\t\t/* Shortcode classes | Animation | Layout */\r\n\t\t\t$classes = ' mpc-init';\r\n\t\t\t$classes .= $animation != '' ? ' mpc-animation' : '';\r\n\t\t\t$classes .= $atts[ 'position' ] != '' ? ' mpc-layout--' . $atts[ 'position' ] : '';\r\n\t\t\t$classes .= $atts[ 'force_fullwidth' ] != '' && $atts[ 'position' ] != 'both' ? ' mpc--item-fullwidth' : '';\r\n\t\t\t$classes .= $atts[ 'pointer_type' ] != '' ? ' mpc-pointer--' . $atts[ 'pointer_type' ] : '';\r\n\t\t\t$classes .= $atts[ 'pointer_alignment' ] != '' ? ' mpc-pointer--' . $atts[ 'pointer_alignment' ] : '';\r\n\t\t\t$classes .= ' ' . esc_attr( $atts[ 'class' ] );\r\n\r\n\t\t\t$classes_icon = $atts[ 'icon_type' ] == 'image' ? ' mpc-icon--image' : '';\r\n\r\n\t\t\t/* Shortcode Output */\r\n\t\t\t$ornament = $atts[ 'icon_disable' ] == '' ? '<i class=\"mpc-transition ' . $icon[ 'class' ] . '\">' . $icon[ 'content' ] . '</i>' : '';\r\n\t\t\t$return = '<div id=\"' . $css_id . '\" class=\"mpc-timeline-basic' . $classes . '\" ' . $animation . '>';\r\n\t\t\t\t$return .= '<div class=\"mpc-timeline__track\"></div>';\r\n\t\t\t\t$return .= '<div class=\"mpc-track__icon' . $classes_icon . '\">' . $ornament . '</div>';\r\n\t\t\t\t$return .= do_shortcode( $content );\r\n\t\t\t$return .= '</div>';\r\n\r\n\t\t\tglobal $mpc_frontend;\r\n\t\t\tif ( $mpc_frontend ) {\r\n\t\t\t\t$return = '<div class=\"mpc-frontend-notice\">';\r\n\t\t\t\t\t$return .= '<h4>' . __( 'Timeline Basic', 'mpc' ) . '</h4>';\r\n\t\t\t\t\t$return .= __( 'Unfortunately this shortcode isn\\'t available in <em>Frontend Editor</em> at the moment. This feature will be added in the upcoming updates. We are sorry for any inconvenience :)', 'mpc' );\r\n\t\t\t\t$return .= '</div>';\r\n\t\t\t}\r\n\r\n\t\t\treturn $return;\r\n\t\t}",
"function sujans_shortcode($atts){\n\t$a = shortcode_atts(array(\n\t\t'id' => 5,\n\t\t),$atts\n\t);\n\tob_start();\n\t?>\n\t\t<div class=\"row\">\n\t\t\t<div id = \"slider\" class=\"slick-slides col col-12\">\n\t\t\t\t<?php\n\t\t\t\t\t$instrument_taxonomy = get_terms(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'taxonomy' => 'instrument',\n\t\t\t\t\t\t\t'include' => $a['id'],\n\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tforeach($instrument_taxonomy as $instrument){\n\t\t\t\t\t\t$query = new WP_Query(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type' => 'slide',\n\t\t\t\t\t\t\t\t'tax_query' => array(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'taxonomy' => 'instrument',\n\t\t\t\t\t\t\t\t\t\t'field' => 'name',\n\t\t\t\t\t\t\t\t\t\t'terms' => $instrument->name,\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);\n\t\t\t\t\t\twhile($query->have_posts()){\n\t\t\t\t\t\t\t$query->the_post();\n\t\t\t\t\t\t\tthe_post_thumbnail();\n\t\t\t\t\t\t}\n\t\t\t\t\t\twp_reset_postdata();\n\t\t\t\t\t\n\t\t\t\t?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t$content = ob_get_clean();\n\t\treturn $content;\n\t}\n}",
"public function get_title() {\n\t\treturn __( 'portfolio-hero-widget', 'portfolio-elementor' );\n\t}",
"function alterna_get_portfolio_widget_post($type = \"\", $per_page = \"\", $orderby = \"\", $cat_in = \"\", $tag_in = \"\", $post__in = \"\", $post__not_in = \"\", $order = \"\") {\n\tif($per_page == \"\"){\n\t\t$per_page = 4;\n\t}\n\t\n\t$args=array( 'post_type' => 'portfolio', 'post_status' => 'publish', 'posts_per_page' => $per_page );\n\t\n\tif($orderby != \"\"){\n\t\t$args['orderby'] = $orderby;\n\t}\n\t\n\tif($order != \"\"){\n\t\t$args['order'] = $order;\n\t}\n\t\t\t \n\tswitch($type){\n\t\tcase 'featured':\n\t\t\t\t$post_ids = explode(\",\" , $post__in);\n\t\t\t\tif(count($post_ids) == 0){\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\t$args['post__in']= $post_ids;\n\t\t\t\t$args['posts_per_page']= count($post_ids);\n\t\t\tbreak;\n\t\tcase 'related':\n\t\t\t\t$cat_slugs = explode(\",\" , $cat_in);\n\t\t\t\t$tag_slugs = explode(\",\" , $tag_in);\n\t\t\t\tif(count($cat_slugs) == 0 && count($tag_slugs) == 0){\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$args['tax_query'] = array();\n\t\t\t\tif(count($cat_slugs) > 0 && $cat_slugs[0] != \"\"){\n\t\t\t\t\t$args['tax_query'][] = array('taxonomy' => 'portfolio_categories', 'field' => 'slug', 'terms' => $cat_slugs);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(count($tag_slugs) > 0 && $tag_slugs[0] != \"\"){\n\t\t\t\t\t$args['tax_query'][] = array('taxonomy' => 'portfolio-tags', 'field' => 'slug', 'terms' => $tag_slugs);\n\t\t\t\t}\n\t\t\tbreak;\n\t}\n\t\n\tif($post__not_in != \"\"){\n\t\t$post__not_in = explode(\",\" , $post__not_in);\n\t\t$args['post__not_in'] = $post__not_in;\n\t}\n\n\t$portfolios = new WP_Query($args);\n\t\n\treturn $portfolios;\n}",
"function gogreen_portfolio_nav(){\n get_template_part('templates/portfolio/nav');\n}",
"function portfolio_content($content) {\n global $post;\n if(is_single($post->ID) && get_post_type($post->ID) === \"portfolio\"){\n\n ob_start();\n ?>\n\n <?php\n $stats = get_post_meta( $post->ID, 'property-stats', true );\n if($stats !== '' && $stats !== null && $stats !== false):\n ?>\n <ul id=\"stat-list\" class=\"no-style\">\n <?php\n foreach($stats as $s):?>\n <li class=\"clearfix\">\n <span class=\"heading\"><?php echo $s['stat-heading'];?>: </span>\n <span class=\"copy\"><?php echo $s['stat'];?></span>\n\n </li>\n <?php\n endforeach;\n ?>\n </ul>\n <?php\n endif;\n\n ?>\n\n\n\n <?php\n return ob_get_clean();\n\n } else {\n return $content;\n }\n}",
"function medpro_section_title_shortcode($atts, $content = null) {\n \n extract( shortcode_atts( array(\n 'theme' => '1',\n 'title' => '',\n 'desc_option' => '2',\n 'desc' => '',\n 'text_align' => 'center',\n ), $atts) ); \n\n\n \n $secton_title_markup = '\n <div class=\"medpro-section-title theme-'.esc_attr($theme).'\" style=\"text-align:'.esc_attr($text_align).'\">\n <h2>'.$title.'</h2>';\n\n if( $desc_option == '1' && !empty($desc) ) {\n $secton_title_markup .= ''.wpautop($desc).'';\n }\n\n $secton_title_markup .= '\n </div>\n ';\n\n\n return $secton_title_markup;\n \n}",
"function add_DDShortsPortfolio_button() {\n\t\t\tadd_filter('tiny_mce_version', array(&$this, 'change_tinymce_version') );\n\t\t\t\n\t\t\t// init process for button control\n\t\t\tadd_action('init', array (&$this, 'addShortPortfolio') );\n\t\t\t\n\t\t}"
] | [
"0.74148417",
"0.7336283",
"0.7174527",
"0.69934046",
"0.68362004",
"0.6792633",
"0.6762891",
"0.67006207",
"0.6699337",
"0.66502625",
"0.65793794",
"0.65684986",
"0.65597546",
"0.65480095",
"0.64703476",
"0.64645845",
"0.64441943",
"0.6440317",
"0.64366734",
"0.6426427",
"0.63873595",
"0.6378527",
"0.6346849",
"0.63402927",
"0.6319701",
"0.6314248",
"0.63080513",
"0.6295331",
"0.62858766",
"0.6274608"
] | 0.7351879 | 1 |
Calls to the sumup API | function sumup_query($url, $params, $delim, $postorget, $at) {
// Setup cURL options and make call to API
// $url = API url to use
// $params = the parameters to pass, comes in as an array
// $delim = one of : or =
// $postorget = can be POST or GET (though only POST is used)
// $at = either blank or the authorisation token from first call
//
// I borrowed this function from elsewhere and have adapted it
// The first call to sumup is to get an authorization token
// this sends data as a normal post where parameters are
// delimited with the & sign.
// The second call uses that a-t to get a resource id - the data
// that is passed this time is json formatted so the delimiters
// will be a : and the key and values with quotes ' around them and
// curly braces.
// For clarity I may rewrite and perhaps have 2 separate functions
// to handle - maybe!
//
$curl = curl_init();
$headr = array();
if ($delim == ":") {
// in this case we've already got our token and are creating
// a checkout
$headr[] = 'Authorization: Bearer '.$at;
$headr[] = 'Content-type: application/json';
} else {
// assuming non json call to get the token so header will be
// if it's this, we're getting the authentication token using
// normal post vars
$headr[] = 'Content-Type: application/x-www-form-urlencoded';
}
curl_setopt($curl, CURLOPT_HTTPHEADER,$headr);
$paramfields="";
if (($delim == ":") && (is_array($params))) {
$paramfields = json_encode($params);
} else {
// only do this next bit if we're not sending json as I've already
// encoded json to the variable $paramfields above if so
$quoteit = "";
$s="&";
if (is_array($params)) {
// Prepare the params list to be posted with curl
foreach($params as $key => $value) {
if ($key != "amount") {
$paramfields .= $quoteit . $key . $quoteit . $delim . $quoteit .$value. $quoteit . $s;
} else
{
$paramfields .= $quoteit . $key . $quoteit . $delim . $value . $s;
}
}
$paramfields = rtrim($paramfields, $s); // this removes the last comma
} // end of normal posting parameter setup
}
curl_setopt($curl, CURLOPT_HEADER, 0);
$extra="";
if ($postorget == "POST") {
curl_setopt($curl, CURLOPT_POST, count($params));
curl_setopt($curl, CURLOPT_POSTFIELDS, $paramfields);
}
if ($postorget == "GET") {
$extra="?" . $paramfields;
curl_setopt($curl,CURLOPT_HTTPGET, true);
}
curl_setopt($curl, CURLOPT_URL, $url . $extra);
// Configure cURL request options
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 200);
// ssl_verifyhost was set to 1 but seemingly deprecated so now 2 stops a php warning
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 1);
// Run cURL and check for errors
$result = curl_exec($curl);
$jresult=$result;
if (curl_errno($curl)) { $result = Array('success' => 'false', 'result' => curl_errno($curl).' - '.curl_error($curl)); }
curl_close($curl);
// echo var_dump($headr) . " those were the headers<br/><br/>";
// echo var_dump($paramfields) . " those were the paramfields<br/><br/>";
// echo var_dump($jresult) . " and that was the result</br></br>";
// echo var_dump($result) . " this is the raw result";
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_sumup_token($fields) {\n // need to get an auth token first using the TOKEN_URL\n $clientid=$fields['client_id']['g_value'];\n $clientse=$fields['client_secret']['g_value'];\n $granttype=\"client_credentials\";\n $authurl=$fields['token_url']['g_value']; \n /* echo \"<pre>\"; print_r($clientid); print_r($clientse); print_r($authurl); echo \"</pre>\"; */\n $tokenpayload=Array('client_id'=>$clientid,'client_secret'=>$clientse,'grant_type'=>$granttype);\n $authresponse=sumup_query($authurl, $tokenpayload, \"=\", \"POST\",\"\");\n // do we have access_token?\n $dresponse=json_decode($authresponse);\n /* echo \"<pre>\"; print_r($dresponse); echo \"</pre>\"; */\n $accesstoken=$dresponse->access_token; // this worked to here \n return $accesstoken;\n}",
"private function send_get(){\n\t $this->set_curl_url(\"https://api.exchangeratesapi.io/latest?base=USD\");\n\t return $this->do_send_get();\n }",
"public function view()\n\t{\n $data = '<status ua=\"custom-1.1\"><merchant><account>10015043</account><site_id>183</site_id><site_secure_code>029834</site_secure_code></merchant><transaction><id>ORDER-SAMPLE-1</id></transaction></status>';\n\n $merchant = array('account' => 10015043, 'site_id' => 183, 'site_secure_code' => 029834);\n $transaction = array('transaction' => array('id' => 'ORDER-SAMPLE-1'));\n $status = array('merchant' => $merchant, 'transaction' => $transaction);\n\n $curl = Request::forge('https://devapi.multisafepay.com/ewx/', 'curl');\n $curl->set_method('post');\n //$curl->set_params(array('status' => $status));\n $curl->set_params($data);\n $curl->set_header('Content-Type', 'text/xml');\n //$curl->set_mime_type('xml');\n $curl->set_auto_format(true);\n $resultApi = $curl->execute();\n //var_dump($resultApiCall);\n $resultApiCall = $curl->response();\n\n //curl -H 'Content-Type: text/xml' -d @datcurl -H 'Content-Type: text/xml' -d @data.xml -X GET https://devapi.multisafepay.com/ewx/a.xml -X GET https://devapi.multisafepay.com/ewx/\n // abrimos la sesión cURL\n $ch = curl_init();\n \n // definimos la URL a la que hacemos la petición\n curl_setopt($ch, CURLOPT_URL,\"https://devapi.multisafepay.com/ewx/\");\n // definimos el número de campos o parámetros que enviamos mediante POST\n curl_setopt($ch, CURLOPT_POST, 1);\n // definimos cada uno de los parámetros\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n \n // recibimos la respuesta y la guardamos en una variable\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $remote_server_output = curl_exec ($ch);\n \n // cerramos la sesión cURL\n curl_close ($ch);\n\n $this->data = $this->request()->param('data', $resultApiCall->body);\n //$this->data = $this->request()->param('data', $remote_server_output);\n\t}",
"public function myCurrentCashFlow() {\n try {\n $serviceToCall = \"CashFlowWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <bud09>\n <mode>0</mode>\n <wages>0</wages>\n <interest>0</interest>\n <dividends>0</dividends>\n <socialsecurity>0</socialsecurity>\n <pensions>0</pensions>\n <alimony>0</alimony>\n <otherincome>0</otherincome>\n <charity>0</charity>\n <mortgage>0</mortgage>\n <vacation>0</vacation>\n <autoloan>0</autoloan>\n <persloan>0</persloan>\n <cc>0</cc>\n <fedtaxes>0</fedtaxes>\n <statetaxes>0</statetaxes>\n <fica>0</fica>\n <retaxes>0</retaxes>\n <othertaxes>0</othertaxes>\n <utilities>0</utilities>\n <repairs>0</repairs>\n <food>0</food>\n <clothing>0</clothing>\n <education>0</education>\n <childcare>0</childcare>\n <autoexp>0</autoexp>\n <transexp>0</transexp>\n <lifeins>0</lifeins>\n <homeowners>0</homeowners>\n <autoins>0</autoins>\n <medical>0</medical>\n <entertain>0</entertain>\n <travel>0</travel>\n <club>0</club>\n <hobbies>0</hobbies>\n <gifts>0</gifts>\n <homeimp>0</homeimp>\n <services>0</services>\n <other>0</other>\n </bud09>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <bud09 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </bud09>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"bud09Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"bud09Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"bud09Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"function getPrices($start_longitude, $start_latitude, $end_longitude, $end_latitude){\n\t// echo 'start_lat' . $start_latitude .'<br/>';\n\t// echo 'dest_long' . $end_longitude . '<br/>';\n\t// echo 'dest_lat' . $end_latitude . '<br/>';\n\t// echo 'https://api.uber.com/v1/estimates/price?start_latitude='.$user_latitude.'&start_longitude='.$user_longitude.'&end_latitude='.$destination_latitude.'&end_longitude='.$destination_longitude;\n\t$ch = curl_init();\n\t$headr = array();\n\t$headr[] = 'Content-length: 0';\n\t$headr[] = 'Content-type: application/json';\n\t$headr[] = 'Authorization: Token 5jKc-uxfLRGpa27CWxucHfZTxG4Cue6cjZNShhVh';\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER,$headr);\n\tcurl_setopt($ch, CURLOPT_URL, 'https://api.uber.com/v1/estimates/price?start_latitude='.$start_latitude.'&start_longitude='.$start_longitude.'&end_latitude='.$end_latitude.'&end_longitude='.$end_longitude);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$data = curl_exec($ch);\n\tcurl_close($ch);\n\treturn json_decode($data);\n}",
"public function testSum(){\n\n $sum = 0;\n\n // Fetch all transactions list from redis to test\n $all_transactions = Redis::command('keys', ['transaction:test:*']);\n\n $transaction = Redis::command('keys', ['transaction:test:*']);\n\n // Calculate the sum of transactions\n foreach( $all_transactions as $transaction_id ){\n\n foreach( $transaction as $value ){\n\n $keys = json_decode(Redis::get($value));\n\n if ( $keys->parent_id == $transaction_id ) {\n\n $sum += $keys->amount;\n\n }\n\n }\n\n /*\n * Request to API to calculate the sum\n * GET /transactionservice/sum/$transaction_id\n */\n $this->get('transactionservice/sum/test:' . $transaction_id )\n ->assertStatus(200)\n ->assertJsonCount(1)\n ->assertJson([\n 'sum' => $sum\n ]);\n\n }\n\n }",
"public function howMuchAmISpending() {\n try {\n $serviceToCall = \"CashFlowWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\">\n <dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <bud02>\n <mode>0</mode>\n <mortgage>0</mortgage>\n <vacation>0</vacation>\n <autoloan>0</autoloan>\n <persloan>0</persloan>\n <cc>0</cc>\n <fedtaxes>0</fedtaxes>\n <statetaxes>0</statetaxes>\n <fica>0</fica>\n <retaxes>0</retaxes>\n <othertaxes>0</othertaxes>\n <utilities>0</utilities>\n <repairs>0</repairs>\n <food>0</food>\n <clothing>0</clothing>\n <education>0</education>\n <childcare>0</childcare>\n <autoexp>0</autoexp>\n <transexp>0</transexp>\n <lifeins>0</lifeins>\n <homeowners>0</homeowners>\n <autoins>0</autoins>\n <medical>0</medical>\n <entertain>0</entertain>\n <travel>0</travel>\n <club>0</club>\n <hobbies>0</hobbies>\n <gifts>0</gifts>\n <homeimp>0</homeimp>\n <services>0</services>\n <charity>0</charity>\n <other>0</other>\n </bud02>\n </calcInput>\n </calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <bud02 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </bud02>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"bud02Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"bud02Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"bud02Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"private function ga_api_account_summaries() {\r\n\t\t$request = Ga_Lib_Api_Request::get_instance();\r\n\t\t$request = $this->sign( $request );\r\n\t\ttry {\r\n\t\t$response = $request->make_request( self::GA_ACCOUNT_SUMMARIES_ENDPOINT, null, false, true );\r\n\t\t} catch (Ga_Lib_Api_Request_Exception $e) {\r\n\t\t\tthrow new Ga_Lib_Google_Api_Client_AccountSummaries_Exception( $e->getMessage() );\r\n\t\t}\r\n\r\n\t\treturn new Ga_Lib_Api_Response( $response );\r\n\t}",
"private function call_api($cmd, $request = array())\n {\n $request['version'] = 1;\n $request['cmd'] = $cmd;\n $request['key'] = $this->public_key();\n $request['format'] = 'json'; //supported values are json and xml \n\n\n $katorymnd_post_data = http_build_query($request, '', '&');\n\n\n $katorymnd_hmac = hash_hmac('sha512', $katorymnd_post_data, $this->private_key());\n\n // Use curl to hit the endpoint so that you can send the required headers \n $katorymnd_ch = curl_init('https://www.coinpayments.net/api.php');\n curl_setopt($katorymnd_ch, CURLOPT_FAILONERROR, TRUE);\n curl_setopt($katorymnd_ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($katorymnd_ch, CURLOPT_SSL_VERIFYPEER, false); // chang this to \"TRUE\" for security reasons\n curl_setopt($katorymnd_ch, CURLOPT_HTTPHEADER, array('HMAC: ' . $katorymnd_hmac));\n curl_setopt($katorymnd_ch, CURLOPT_POSTFIELDS, $katorymnd_post_data);\n\n\n curl_exec($katorymnd_ch);\n\n curl_getinfo($katorymnd_ch);\n $katorymnd_dfiz = curl_exec($katorymnd_ch);\n\n curl_close($katorymnd_ch);\n\n $tamo_array = json_decode($katorymnd_dfiz, true); // get array \n\n echo \"<pre>\";\n $katorymnd_dkto = $tamo_array; // get array\n\n // $katorymnd_dkto = $tamo_array['result']['address']; // actual coinpayment address\n\n return $katorymnd_dkto;\n }",
"public function test(){\n\t\t$check = class_exists('Curl');\n\t\t$this->assertTrue($check);\n\n\t\t//now we check if the api call return an error\n\t\t$curl = new Curl;\n\t\t$customer_email \t\t= '[email protected]';\n\t\t$amount \t\t\t\t= 1000; \n\t\t$currency \t\t\t\t= \"NGN\";\n\t\t$txref \t\t\t\t\t= 'SMM-132456'; \n\t\t$PBFPubKey \t\t\t\t= \"FLWPUBK-3085ae75e9f93f17fcdf30955946e01c-X\";\n\t\t$redirect_url \t\t\t= \"http://results.net.ng/flutterwave-project/sam-books/report\";\n\t\t$api \t\t\t\t\t= \"https://ravesandboxapi.flutterwave.com/flwv3-pug/getpaidx/api/v2/hosted/pay\";\n\t\t\n\t\t\n\n\t\t$arr = array(\n\t\t\t$curl->opt_url \t\t\t\t=> $api,\n\t\t\t$curl->opt_return_transfer \t=> true,\n\t\t\t$curl->opt_customrequest \t=> \"POST\",\n\t\t\t$curl->opt_postfields \t=> json_encode([\n\n\t\t\t 'amount'\t\t\t=>$amount,\n\t\t\t 'customer_email'\t=>$customer_email,\n\t\t\t 'currency'\t\t\t=>$currency,\n\t\t\t 'txref'\t\t\t\t=>$txref,\n\t\t\t 'PBFPubKey'\t\t\t=>$PBFPubKey,\n\t\t\t 'redirect_url'\t\t=>$redirect_url\n\n\t\t\t]),\n\t\t\t$curl->opt_httpheaders => [\n\t\t\t\t\"content-type: application/json\",\n\t\t\t \"cache-control: no-cache\"\n\t\t\t]\n\t\t);\n\n\t\t$curl->setOptArray($arr);\n\t\t$response = $curl->execute();\n\t\t$error = $curl->error();\n\t\t\n\n\t\t//here I am testing if we are gettin any error\n\t\t$this->assertFalse($error);\n\n\t\t$transaction = json_decode($response);\n\n\t\t//the we check to make sure this isnt returning true\n\t\t$this->assertFalse(!$transaction->data && !$transaction->data->link);\n\t\t\n\t\t\n\t}",
"function getBalance(){\n $request = \"\";\n $param[\"username\"] = $GLOBALS['username_mobileNig'];\n $param[\"api_key\"] = $GLOBALS['Mobile_api'];\n \n\n //unique id, you can use time()\n foreach($param as $key=>$val) //traverse through each member of the param array\n {\n $request .= $key . \"=\" . urlencode($val); //we have to urlencode the values\n $request .= '&'; //append the ampersand (&) sign after each paramter/value pair\n }\n $len = strlen($request) - 1;\n $request = substr($request, 0, $len); //remove the final ampersand sign from the request\n\n $url = \"https://mobilenig.com/API/balance?\"; //The URL given in the documentation without parameters\n echo $url;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"$url$request\");\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //return as a variable\n $response = json_decode(curl_exec($ch));\n curl_close($ch);\n return $response;\n}",
"public function reducingPostponingForegoingExp() {\n try {\n $serviceToCall = \"CashFlowWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <bud11>\n <beforeTaxReturn>0.08</beforeTaxReturn>\n <years>10</years>\n <description1>eat out less</description1>\n <savings1>150</savings1>\n <description2>carpool to work</description2>\n <savings2>100</savings2>\n <description3/>\n <savings3>0</savings3>\n <description4/>\n <savings4>0</savings4>\n <description5/>\n <savings5>0</savings5>\n <description6/>\n <savings6>0</savings6>\n </bud11>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <bud11 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </bud11>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"bud11Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"bud11Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"bud11Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"public function api_query($ENDPOINT, array $REQ = array()) {\n// $PRIVATE_API = array(\"getbalances\", \"getbalance\", \"getdeposits\", \"getwithdrawals\", \"getnewdepositaddress\", \"getdepositaddress\", \"myopenorders\", \"myopenorders_market\", \"cancelorder\", \"withdraw\", \"trade\", \"tradehistory\", \"getdeposithistory\", \"getwithdrawalhistory\", \"walletstatus\");\n // Init curl\n static $ch = null;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n // remove those 2 line to secure after test.\n// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n// curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n // PUBLIC or PRIVATE API\n if (substr(explode(\"/\", $ENDPOINT)[0], 0, 6) == 'market') {\n $URL = \"https://novaexchange.com/remote/v2/\" . ($ENDPOINT) . \"/\";\n if ($REQ) {\n $URL .= '?' . http_build_query($REQ, '', '&');\n }\n\n curl_setopt($ch, CURLOPT_URL, $URL);\n } else {\n $mt = explode(' ', microtime());\n $NONCE = $mt[1] . substr($mt[0], 2, 6);\n\n $URL = \"https://novaexchange.com/remote/v2/private/\" . $ENDPOINT . \"/?nonce=\" . $NONCE;\n $REQ['apikey'] = $this->public_key;\n $REQ['signature'] = base64_encode(hash_hmac('sha512', $URL, $this->key_secret, true));\n $REQ = http_build_query($REQ);\n $HEADERS = array(\"Content-Type: application/x-www-form-urlencoded\");\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, $HEADERS);\n curl_setopt($ch, CURLOPT_URL, $URL);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $REQ);\n }\n\n // run the query\n $res = curl_exec($ch);\n if ($res === false) {\n throw new Exception('Could not get reply: ' . curl_error($ch));\n }\n\n return json_decode($res);\n }",
"function call_rest_post($url,$data='')\n\t{\n\t\t$result = $this->curl->simple_post($url , $data , array(CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST=> false));\t\n\t\treturn $result;\n\t}",
"function call_rest_post($url,$data='')\n\t{\n\t\t$result = $this->curl->simple_post($url , $data , array(CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST=> false));\t\n\t\treturn $result;\n\t}",
"function quickpay_request($apikey = '', $endpoint = '', $params = array(), $method = 'GET')\n{\n $baseUrl = 'https://api.quickpay.net/';\n $url = $baseUrl . $endpoint;\n\n $headers = array(\n 'Accept-Version: v10',\n 'Accept: application/json',\n 'Authorization: Basic ' . base64_encode(':' . $apikey),\n );\n\n $options = array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => true,\n CURLOPT_HTTPAUTH => CURLAUTH_BASIC,\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_CUSTOMREQUEST => $method,\n CURLOPT_URL => $url,\n CURLOPT_POSTFIELDS => $params,\n );\n\n $ch = curl_init();\n\n curl_setopt_array($ch, $options);\n\n $response = curl_exec($ch);\n\n //Check for errors\n if (curl_errno($ch) !== 0) {\n throw new Exception(curl_error($ch), curl_errno($ch));\n }\n\n curl_close ($ch);\n\n return json_decode($response);\n}",
"public function incomeGeneratedBySavingsPlan() {\n try {\n $serviceToCall = \"SavingWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <sav02>\n <currentAge>35</currentAge>\n <retirementAge>65</retirementAge>\n <yearsNeeded>20</yearsNeeded>\n <initialBalance>0</initialBalance>\n <annualSavings>0</annualSavings>\n <savingsIncrease>0.0</savingsIncrease>\n <beforeTaxReturn>0.08</beforeTaxReturn>\n <taxBracket>0.25</taxBracket>\n </sav02>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <sav02 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </sav02>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"sav02Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"sav02Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"sav02Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"public static function sendRestCall($url=\"\") \n\t{\n if ($url==\"\") {\n return false;\n } else {\n \t$turl=parse_url($url);\t\n }\n \n// if (!isset($turl['path']))\n// $turl['path']='/';\n\n $curl = curl_init();\n curl_setopt($curl,CURLOPT_TIMEOUT, HIPAY_MAPI_CURL_TIMEOUT);\n curl_setopt($curl,CURLOPT_POST,1);\n curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);\n curl_setopt($curl,CURLOPT_USERAGENT,\"HIPAY\");\n curl_setopt($curl,CURLOPT_URL, $turl['scheme'].'://'.$turl['host'].$turl['path']);\n// curl_setopt($curl,CURLOPT_POSTFIELDS,'xml='.urlencode($xml));\n\t\tcurl_setopt($curl,CURLOPT_POSTFIELDS,'xml=<xml></xml>'); // prevents curl to set a \"content length\" of \"-1\" in older PHP-Versions\n\t\t\n //DEBUG\n //curl_setopt($curl, CURLINFO_HEADER_OUT, true);\n //DEBUG ENDE\n \n if(HIPAY_MAPI_CURL_PROXY_ON === true)\n {\n curl_setopt($curl, CURLOPT_PROXY, HIPAY_MAPI_CURL_PROXY);\n curl_setopt($curl, CURLOPT_PROXYPORT, HIPAY_MAPI_CURL_PROXYPORT);\n }\n\n if(HIPAY_MAPI_CURL_LOG_ON === true)\n {\n $errorFileLog = fopen(HIPAY_MAPI_CURL_LOGFILE, \"a+\");\n curl_setopt($curl, CURLOPT_VERBOSE, true);\n curl_setopt($curl, CURLOPT_STDERR, $errorFileLog);\n }\n\n curl_setopt($curl, CURLOPT_HEADER, 0);\n\n ob_start();\n if (curl_exec($curl) !== true)\n {\n $output = $turl['scheme'].'://'.$turl['host'].$turl['path'].' is not reachable';\n $output .= '<br />Network problem ? Verify your proxy configuration in mapi_defs.php';\n }\n else {\n \t$output = ob_get_contents();\n }\n \n //DEBUG\n //Mage::log(\"HIPAY CURL-LOG\");\n //Mage::log(curl_getinfo($curl));\n //Mage::log(\"HIPAY CURL-LOG END\");\n //DEBUG ENDE \n \n ob_end_clean();\n curl_close($curl);\n if(HIPAY_MAPI_CURL_LOG_ON === true)\n {\n fclose($errorFileLog);\n }\n return $output;\n }",
"function callAPI($method, $path, $body){\n\n $url = Constants::BASE_URL . $path;\n\n $nonce = round(microtime(true) * 1000);\n\n $signature = generateSignature($nonce, $method, $path, $body);\n\n echo $signature . \"\\n\";\n\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL, $url);\n\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'BITSIAN-API-KEY:' . getenv(Constants::API_KEY),\n 'BITSIAN-TIMESTAMP:' . $nonce,\n 'BITSIAN-API-SIGN:' . $signature,\n 'BITSIAN-PASSPHRASE:' . getenv(Constants::PASS_PHRASE),\n ));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n\n if($method == \"POST\")\n {\n curl_setopt($curl,CURLOPT_POST,1);\n curl_setopt($curl,CURLOPT_POSTFIELDS, $body);\n }\n\n // EXECUTE:\n $result = curl_exec($curl);\n if(!$result){die(\"Connection Failure\");}\n curl_close($curl);\n return $result;\n}",
"public function run()\n {\n\n $GET_BTC_SET = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=bitcoin&order=market_cap_desc&per_page=10&page=1&sparkline=false';\n $GET_ETH_SET = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=ethereum&order=market_cap_desc&per_page=10&page=1&sparkline=false';\n $GET_XRP_SET = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=ripple&order=market_cap_desc&per_page=10&page=1&sparkline=false';\n $GET_BCH_SET = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=bitcoin-cash&order=market_cap_desc&per_page=10&page=1&sparkline=false';\n $GET_ADA_SET = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=cardano&order=market_cap_desc&per_page=10&page=1&sparkline=false';\n $GET_LTC_SET = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=litecoin&order=market_cap_desc&per_page=10&page=1&sparkline=false';\n $GET_XEM_SET = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=nem&order=market_cap_desc&per_page=10&page=1&sparkline=false';\n $GET_XLM_SET = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=stellar&order=market_cap_desc&per_page=10&page=1&sparkline=false';\n $GET_MIOTA_SET = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=iota&order=market_cap_desc&per_page=10&page=1&sparkline=false';\n $GET_DASH_SET = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=dash&order=market_cap_desc&per_page=10&page=1&sparkline=false';\n\n $requestsArray = [\n $GET_BTC_SET, $GET_ETH_SET, $GET_XRP_SET, $GET_BCH_SET, $GET_ADA_SET,\n $GET_LTC_SET, $GET_XEM_SET, $GET_XLM_SET, $GET_MIOTA_SET, $GET_DASH_SET\n ];\n\n $makeRequests = function ($value) {\n return Http::get($value);\n };\n\n $returnValue = function ($value) {\n return [\n \"coin_id\" => $value[0][\"id\"],\n \"name\" => $value[0][\"name\"],\n \"symbol\" => $value[0][\"symbol\"],\n ];\n };\n\n $responsesArray = array_map($makeRequests, $requestsArray);\n $eachResponseArray = array_map($returnValue, $responsesArray);\n\n foreach ($eachResponseArray as $value) {\n DB::table('currencies')->insert([$value]);\n };\n }",
"public function myTakeHomePay() {\n try {\n $serviceToCall = \"PaycheckBenefitsWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <pay02>\n <payperiod/>\n <pay1>0</pay1>\n <pay2>0</pay2>\n <file1>M</file1>\n <file2>M</file2>\n <allow1>2</allow1>\n <allow2>2</allow2>\n <pretax1>0</pretax1>\n <pretax2>0</pretax2>\n <cont1>0.0</cont1>\n <cont2>0.0</cont2>\n <posttax1>0</posttax1>\n <posttax2>0</posttax2>\n <reimb1>0</reimb1>\n <reimb2>0</reimb2>\n </pay02>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <pay02 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </pay02>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"pay02Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"pay02Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"pay02Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"public function myPayrollWithholdings() {\n try {\n $serviceToCall = \"TaxationWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <inc03>\n <taxStatus>MJ</taxStatus>\n <clientIncome>0</clientIncome>\n <qualifiedSavings>0</qualifiedSavings>\n <itemizedDeductions>0</itemizedDeductions>\n <exemptions>2</exemptions>\n <dependents>0</dependents>\n <taxWithheld>0</taxWithheld>\n <allowances>2</allowances>\n <payperiod>24</payperiod>\n </inc03>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <inc03 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </inc03>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"inc03Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"inc03Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"inc03Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"private function _callAPI($url)\r\n\t{\r\n\t\t$config = Api_Registry::getConfig();\r\n\t\t$curl = curl_init();\r\n\t\t$url = sprintf(\"%s?user:pass=%s:%s\",$url,$config->surveyGizmo->api->username,$config->surveyGizmo->api->password);\r\n\r\n\t\tcurl_setopt($curl, CURLOPT_URL, $url);\r\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n\t\t$output = json_decode(curl_exec($curl));\r\n\r\n\t\treturn $output;\r\n\t}",
"public function allocateAssets() {\n try {\n $serviceToCall = \"InvestmentWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <inv01>\n <q1>A</q1>\n <q2>A</q2>\n <q3>A</q3>\n <q4>A</q4>\n <q5>A</q5>\n <q6>A</q6>\n <q7>A</q7>\n <q8>A</q8>\n <q9>A</q9>\n <q10>A</q10>\n </inv01>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <inv01 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </inv01>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"inv01Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"inv01Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"inv01Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"public function borrowingMyRetirementPlan() {\n try {\n $serviceToCall = \"QualifiedPlansWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <qua10>\n <loanAmount401k>0</loanAmount401k>\n <loanRate401k>0.06</loanRate401k>\n <loanTerm401k>5</loanTerm401k>\n <beforeTaxReturn>0.08</beforeTaxReturn>\n <yearsToRetirement>20</yearsToRetirement>\n <debtPayoff>N</debtPayoff>\n <debtInterestRate>0.18</debtInterestRate>\n <interestDeductible>N</interestDeductible>\n <taxBracket>0.25</taxBracket>\n </qua10>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <qua10 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </qua10>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"qua10Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"qua10Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"qua10Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"function ucsd_api_call ($query_string) {\n\t# UCSD API Key\n\t$ucsd_api_key = 'D47D6DD47B99423D9E499848DDF6D0A9';\n\t# URL for requests\n\t$ucsd_api_url = 'http://10.52.208.38/app/api/rest?';\n\t# cURL standard command (should replace with a library call):\n\t$curl_cmd = 'http_proxy=\"\" curl -X \"GET\" -s ';\n\t$ucsd_api_cmd = ' -H \"X-Cloupia-Request-Key: '.$ucsd_api_key.'\"';\n\t$cmd = $curl_cmd.'\"'.$ucsd_api_url.$query_string.'\"'.$ucsd_api_cmd;\n\t$response = `http_proxy=\"\" $cmd`;\n\t# Just return the raw JSON - will return 'null' if error in parsing, calling function should\n\t# take care of this\n\treturn json_decode($response);\n}",
"private function callService($params = array()){\n\t\t$ch = curl_init();\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->api_request_url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $this->api_headers);\n\t\t\n\t\tif($this->api_method == 'POST'){\n\t\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\t\t}\n\t\tif($this->api_body != ''){\n\t\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS, $this->api_body);\n\t\t}\n\t\t\n\t\t$res = curl_exec($ch);\t\t\n\t\t\n\t\t$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);\n\t\t$header = substr($res, 0, $header_size);\n\t\t$body = substr($res, $header_size);\n\n\t\t\n\t\tcurl_close($ch);\n\t\t\n\t\treturn($body);\n\t}",
"public function requestPayment()\n {\n $this->_resource = \"/collections\";\n $this->_request = array(\n \"msisdn\"=>$this->msisdn,\n \"amount\"=>$this->unformat($this->amount),\n \"external_reference\"=>$this->external_reference,\n \"narration\"=>$this->narration\n );\n return $this->sendAPIRequest('POST',$this->_resource,json_encode($this->_request));\n }",
"function call_blockchain_api ($url, $params = [])\n{\n $params[\"api_code\"] = bc_config(\"blockchain_api\");\n $url_base = \"http://127.0.0.1:\".bc_config(\"api_port\").\"/\". $url .\"?\". http_build_query($params);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url_base);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);\n $html_response = curl_exec($ch);\n curl_close($ch);\n\n return json_decode( $html_response, true );\n}",
"private function call( $url, array $parameters = null )\n {\n curl_setopt($this->getCurl(), CURLOPT_URL, $url);\n if( $parameters )\n {\n curl_setopt($this->getCurl(), CURLOPT_POST, true);\n curl_setopt($this->getCurl(), CURLOPT_POSTFIELDS, http_build_query($parameters));\n }\n else curl_setopt($this->getCurl(), CURLOPT_POST, false );\n \n try {\n $this->lastResponse = curl_exec($this->getCurl());\n return $this->parseResult($this->lastResponse);\n } catch (Exception $e) {\n throw new WoowUpAPIException($e->getMessage() );\n }\n \n }"
] | [
"0.6138846",
"0.6135388",
"0.60318804",
"0.5739888",
"0.5737194",
"0.5736974",
"0.57284033",
"0.57098025",
"0.5703517",
"0.5702198",
"0.5631115",
"0.55736107",
"0.5558071",
"0.55493766",
"0.55493766",
"0.55384624",
"0.55321723",
"0.5524118",
"0.55205214",
"0.5513223",
"0.5497348",
"0.54925346",
"0.54640067",
"0.5419473",
"0.54185",
"0.5411533",
"0.53871083",
"0.5378187",
"0.5372082",
"0.5370204"
] | 0.66377985 | 0 |
Add line to the log | public function addLine()
{
$this->add('=======================================================', ImportLogger::INFO, false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function addProcessLog($line)\n\t{\n\t\tself::$process_log[] = $line;\n\t}",
"public function appendLog($id, $line)\n {\n $line = addslashes($line).\"\\n\";\n $this->database->query('UPDATE '.$this->implicitTable.' SET log = CONCAT(log, \"'.$line.'\") WHERE id = '.$id);\n }",
"private function add_to_log($message) {\n\t\t//--\n\t\tif(!$this->debug) {\n\t\t\treturn;\n\t\t} //end if\n\t\t//--\n\t\t$message = str_replace(array(\"\\n\", \"\\r\", \"\\t\"), array(' ', ' ', ' '), (string)$message);\n\t\t//--\n\t\t$this->log .= $message.\"\\n\";\n\t\t//--\n\t}",
"protected function addLog($txt)\n {\n $this->output .= $txt;\n }",
"public function logToFile($line)\n\t{\n\t\t$filesystem = new Filesystem();\n\t\t$filesystem->put($this->logfileName, $line);\n\t}",
"function AddToLog($strText, $bolNewLine = TRUE)\n\t {\n\t \t/*// Are we logging?\n\t \tif (!LOG_TO_FILE || !defined(LOG_PATH))\n\t \t{\n\t \t\treturn;\n\t \t}\n\t \t\n\t \tif ($bolNewLine)\n\t \t{\n\t \t\t$strText .= \"\\n\";\n\t \t}\n\t \t\n\t \t// Are we in safe mode?\n\t \tif (SAFE_LOGGING)\n\t \t{\n\t \t\t// We need to open the file every time we append. Huge overhead, but no corrupt files\n\t \t\t$this->_ptrLog = fopen(LOG_PATH, \"a\");\n\t \t\tfwrite($this->_ptrLog, $strText);\n\t \t\tfclose($this->_ptrLog);\n\t \t}\n\t \telse\n\t \t{\n\t \t\tfwrite($this->_ptrLog, $strText);\n\t \t}*/\n\t }",
"public function addToLog($string)\n {\n $format = '[%s]: %s'.PHP_EOL;\n $this->log .= sprintf($format, date('H:i:s d.m.Y'), $string);\n return;\n }",
"public static function addLine(string $line)\n {\n self::$output[] = [\n 'class' => 'messages',\n 'message' => $line,\n 'timer' => self::getTimer()\n ];\n }",
"public function addLine($line){\r\n array_push($this->lines, $line);\r\n }",
"function _ocp_profile_log_line($line)\n{\n\t// Open up unique log file (per-request) if not yet done so\n\tglobal $PROFILER_FILEHANDLE,$PROFILER_PATH;\n\tif (!isset($PROFILER_FILEHANDLE))\n\t{\n\t\tif (!isset($PROFILER_PATH))\n\t\t{\n\t\t\t$PROFILER_PATH=get_custom_file_base().'/data_custom/profiling';\n\t\t\tif (is_guest())\n\t\t\t{\n\t\t\t\t$PROFILER_PATH.='--guest';\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$PROFILER_PATH.='--member'.strval(get_member());\n\t\t\t}\n\t\t\t$PROFILER_PATH.='.timestamp'.strval(time());\n\t\t\t$PROFILER_PATH.='.rand'.uniqid('',true);\n\t\t\t$PROFILER_PATH.='--in-progress.log';\n\t\t}\n\n\t\t$PROFILER_FILEHANDLE=fopen($PROFILER_PATH,'at');\n\n\t\t// Pre-logging\n\t\t_ocp_profile_log_line('URL: '.get_self_url_easy());\n\t\t_ocp_profiler_generic_logging();\n\t\t_ocp_profile_log_line(''); // Spacer line\n\t}\n\n\t// Write line\n\tfwrite($PROFILER_FILEHANDLE,$line.\"\\n\");\n}",
"public function addLog($value) {\n $this->_log = [];\n\t\tarray_push($this->_log, round((microtime(true) - $this->_starttime),5).'s - '. $value);\n\t}",
"public function appendLog(string $log = '') : void\n {\n $this->logs[] = $log;\n }",
"public function push($line)\n {\n $this->_outputBuffer[] = $line;\n }",
"protected function addLine($line)\n {\n $lines = $this->getLines();\n $lines[] = $line;\n $this->setLines($lines);\n }",
"private function log($text){\n //$filename = Yii::$app->basePath.\"/logs/blockchain-latest.log\";\n $handlefile = fopen($this->logFileName, \"a\");\n\n\t\t$time = \"\\r\\n\" .date('Y/m/d h:i:s a - ', time());\n\t\tfwrite($handlefile, $time.$text);\n }",
"public function addLine($line) {\r\n\t\r\n\t\t// add to our array\r\n\t\t$this->lines_array[] = $line;\r\n\t}",
"private function add_new_line()\n\t{\n\t\tif (!(substr($this->line, -1) == \"\\n\")) $this->line .= \"\\n\";\n\t}",
"function add_2_log($message) {\n\tfile_put_contents(__log_file__, get_current_date_time().\" \t\". $message. \"\\n\", FILE_APPEND | LOCK_EX); // en appliquant un file lock (Php ver 5.1 en montant) on s'assure de l'exclusivité du fichier pendant les file open.\n}",
"public function log($line, $level = 'notice', $uniq_id = false, $skip_dblog = false) {\n\t\tglobal $updraftplus;\n\n\t\t$prefix = $this->get_storage_label();\n\n\t\t$updraftplus->log(\"$prefix: $line\", $level, $uniq_id, $skip_dblog);\n\t}",
"private function appendLog(string $str)\n {\n $str = trim($str);\n\n if (strlen($str) > 1000)\n {\n $str = substr($str, 0, 1000) . ' ... [truncated]';\n }\n\n $filePath = $this->debug['directory'] . $this->debug['file_name'];\n $msgLine = '[' . gmdate(\"Y-m-d H:i:s\", time() + $this->debug['time_offset']) . '] ' . $str . PHP_EOL;\n\n file_put_contents($filePath, $msgLine, FILE_APPEND | LOCK_EX);\n }",
"protected static function log($str)\n\t{\n\t\t//file_put_contents($fileName, $str . \";\\r\\n\", FILE_APPEND);\n\t}",
"public function logRequest()\n {\n $myFile = __DIR__ . \"/../requestslog.txt\";\n $fh = fopen($myFile, 'a') or die(\"can't open file\");\n fwrite($fh, \"\\n\\n---------------------------------------------------------------\\n\");\n fwrite($fh, print_r($this->data, 1));\n fclose($fh);\n }",
"public static function addEventLine(string $line)\n {\n self::$output[] = [\n 'class' => 'events',\n 'message' => $line,\n 'timer' => self::getTimer()\n ];\n }",
"public function addLogMessage($message)\n {\n $this->logArray[] = $message . '<br />';\n }",
"public function addLog($sLog) {\n \n fputs($this->rsLogger, $sLog);\n }",
"abstract protected function insertLogEntry($message);",
"private function log($msg)\n {\n $msg = PHP_EOL . '========[ ' . date('Y-m-d H:i:s') . ' ]========' . PHP_EOL . $msg . PHP_EOL . str_repeat('=', 39) . PHP_EOL;\n file_put_contents($this->patch_dir . $this->patch_file, $msg, FILE_APPEND);\n }",
"protected function log($message)\n {\n $f = fopen($this->logPath, 'a');\n fwrite($f, $message . PHP_EOL);\n fclose($f);\n }",
"function add_to_log($string)\n\t{\n\t\tif ($this->enable_logging)\n\t\t{\n\t\t\t$this->log_array[] = utf8_htmlspecialchars($string);\n\t\t}\n\t}",
"public function log()\r\n {\r\n $this->log->debug($this->toString());\r\n }"
] | [
"0.72922164",
"0.71593034",
"0.7051624",
"0.70499647",
"0.6913591",
"0.68140644",
"0.6735371",
"0.66823673",
"0.66542417",
"0.66123605",
"0.65658736",
"0.6533234",
"0.6469248",
"0.64552623",
"0.6429402",
"0.64184",
"0.63998914",
"0.63972247",
"0.639109",
"0.6382059",
"0.637361",
"0.6363803",
"0.63447624",
"0.6341272",
"0.6319012",
"0.63021106",
"0.6261739",
"0.61856073",
"0.6165674",
"0.61639076"
] | 0.74803585 | 0 |
Parse log and return a string | protected function parseLog()
{
$log = '';
if (count($this->log) > 0) {
foreach ($this->log as $logEntry) {
if ($logEntry['extended']) {
$log .= sprintf(
'[%s] %s: %s<br />',
$logEntry['datetime']->format('Y-m-d H:i:s'), // DateTime object
$logEntry['type'],
$logEntry['message']
);
} else {
$log .= sprintf(
'%s<br />',
$logEntry['message']
);
}
}
}
return $log;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function parseLog();",
"public function parseLogLine($line);",
"private static function extractLog($str)\n {\n $strStart = 'START DEBUG';\n $strEnd = 'END DEBUG';\n $regex = '/' . $strStart . '[\\r\\n]+(.+)[\\r\\n]+' . $strEnd . '/s';\n $matches = array();\n if (\\preg_match($regex, $str, $matches)) {\n $str = $matches[1];\n }\n return $str;\n }",
"private function parseLine($line){\n $log = null;\n $time = $this->parseTime($line);\n if($time != null){\n $log = new Log();\n $log->setDateLog($time);\n\n $logDetails = substr($line, 22, strlen($line));\n list($sns, $description) = explode(':', $logDetails, 2);\n list($source, $status) = explode('.', $sns);\n $log->setStatus($status);\n $log->setLogSource($source);\n $log->setDescription(trim($description));\n\n }\n\n\n return $log;\n }",
"private function oldParse($log)\n {\n preg_match($this->pattern, $log, $data);\n\n if (!isset($data['date'])) {\n return [];\n }\n\n return [\n 'date' => \\DateTime::createFromFormat('Y-m-d H:i:s', $data['date']),\n 'logger' => $data['logger'],\n 'level' => $data['level'],\n 'message' => $data['message'],\n 'context' => json_decode($data['context'], true),\n 'extra' => json_decode($data['extra'], true)\n ];\n }",
"private function parse(){\n\t\t$patterns = [\n\t\t\t\"title\"\t \t=> '_<!\\[LOG\\[(.*)\\]LOG\\]!>_',\n\t\t\t\"time\"\t \t=> '_time=\"([^\"]*)\"_',\n\t\t\t\"date\"\t \t=> '_date=\"([^\"]*)\"_',\n\t\t\t\"component\"\t=> '_component=\"([^\"]*)\"_',\n\t\t\t\"context\"\t=> '_context=\"([^\"]*)\"_',\n\t\t\t\"type\"\t \t=> '_type=\"([^\"]*)\"_',\n\t\t\t\"thread\"\t=> '_thread=\"([^\"]*)\"_',\n\t\t\t\"file\"\t \t=> '_file=\"([^\"]*)\">_'\n\t\t];\n\t\tforeach($patterns as $name => $pattern){\n\t\t\t$matches = [];\n\t\t\tpreg_match($pattern, $this->line, $matches);\n\t\t\tif(isset($matches[1])){\n\t\t\t\t$this->properties->{$name} = $matches[1];\n\t\t\t}\n\t\t}\n\t}",
"function parseChangelogLine($line) {\n $tmp = explode(\"\\t\", $line);\n if ($tmp!==false && count($tmp)>1) {\n $info = array();\n $info['date'] = (int)$tmp[0]; // unix timestamp\n $info['ip'] = $tmp[1]; // IPv4 address (127.0.0.1)\n $info['type'] = $tmp[2]; // log line type\n $info['id'] = $tmp[3]; // page id\n $info['user'] = $tmp[4]; // user name\n $info['sum'] = $tmp[5]; // edit summary (or action reason)\n $info['extra'] = rtrim($tmp[6], \"\\n\"); // extra data (varies by line type)\n return $info;\n } else { return false; }\n}",
"public function parse(){\n $logs = array();\n $rows = explode(\"\\n\", $this->logFile->getContents());\n foreach($rows as $line)\n {\n $log = $this->parseLine($line);\n if($log != null) $logs[] = $log;\n }\n\n $logs = $this->sort($logs);\n\n return $logs;\n }",
"function analyze_log($log_fname) {\n\tprint($log_fname . \"\\n\");\n\t$fp = fopen($log_fname, \"r\");\n\twhile ($line = fgets($fp)) {\n\t\tprint($line);\n\t\tif ( ! preg_match(\"/^(.+?) /\", $line, $m)) {\n\t\t\tprint(\"NO MATCH \" . $line);\n\t\t\tcontinue;\n\t\t}\n\t\tprint($m[1] . \"\\n\");\n\t}\n\tfclose($fp);\n}",
"public static function getLogFormatRegex()\n {\n return <<<EOF\n /^\n \\[(?<date>\\w+\\s+\\w+\\s+\\d+\\s+\\d+:\\d+:\\d+\\s\\d+)\\]\n \\s\\#\n (?<channel>[^\\s]*)\\s\n (?<nick>[^\\s]*)\\s\n (?<username>[^@]*)@[^\\s]*\\s\n (?<message>.+)\n $/mx\nEOF;\n }",
"public function parseLogContent($content)\n {\n $headerSet = $dateSet = $envSet = $levelSet = $bodySet = [];\n\n $pattern = '/^' . self::LOG_DATE_PATTERN . '\\\\s' . self::LOG_ENVIRONMENT_PATTERN . '\\\\.' . self::LOG_LEVEL_PATTERN . '\\\\:|Next/m';\n\n preg_match_all($pattern, $content, $matchs);\n\n if (is_array($matchs)) {\n $bodySet = array_map('ltrim', preg_split($pattern, $content));\n\n if (empty($bodySet[0]) && count($bodySet) > count($matchs[0])) {\n array_shift($bodySet);\n }\n\n $headerSet = $matchs[0];\n $dateSet = $matchs[1];\n $envSet = $matchs[2];\n $levelSet = $matchs[3];\n $bodySet = $bodySet;\n }\n\n return compact('headerSet', 'dateSet', 'envSet', 'levelSet', 'bodySet');\n }",
"function fetch_log($log){\n\tglobal $filter;\n\t// Get Data from form post\n $lines = $_GET['maxlines'];\n if (preg_match(\"/!/\",htmlspecialchars($_GET['strfilter'])))\n \t$grep_arg=\"-iv\";\n else\n \t$grep_arg=\"-i\";\n\t\t\n // Get logs based in filter expression\n if($filter != \"\") {\n exec(\"tail -2000 {$log} | /usr/bin/grep {$grep_arg} \" . escapeshellarg($filter). \" | tail -r -n {$lines}\" , $logarr); \n }\n else {\n exec(\"tail -r -n {$lines} {$log}\", $logarr);\n }\n\t// return logs\n\treturn $logarr;\n}",
"private function reverseParseJsonText($log)\n {\n $chars = preg_split('//u', $log, -1, PREG_SPLIT_NO_EMPTY);\n $max = 2;\n $tags = [];\n $startPos = -1;\n $parts = [];\n\n for ($i = count($chars) - 1; $i >= 0 && $max > 0; --$i) {\n $char = $chars[$i];\n\n if (' ' === $char) {\n // Check is the end of number or null\n if (empty($tags) && $startPos !== -1) {\n $parts[] = [\n 'start' => $i+1,\n 'end' => $startPos,\n ];\n $startPos = -1;\n $max--;\n continue;\n }\n\n // Skip useless blank characters\n if ($startPos === -1) {\n continue;\n }\n }\n\n if ($startPos === -1) {\n $startPos = $i;\n }\n\n // Find the JSON open tags\n if (isset($this->jsonOpenTags[$char])) {\n if ($char !== '\"' || ($char === '\"' && end($tags) !== '\"')) {\n $tags[] = $char;\n continue;\n }\n }\n\n // Find the JSON close tags\n if (isset($this->jsonCloseTags[$char])) {\n if (end($tags) === $this->jsonCloseTags[$char]) {\n if (1 === count($tags)) {\n $parts[] = [\n 'start' => $i,\n 'end' => $startPos,\n ];\n $startPos = -1;\n $max--;\n $tags = [];\n continue;\n } else {\n array_pop($tags);\n }\n } else {\n // JSON format error\n $parts[] = [\n 'start' => $i,\n 'end' => $startPos,\n ];\n $startPos = -1;\n $max--;\n continue;\n }\n }\n }\n\n $results = [];\n $pos = -1;\n\n foreach ($parts as $part) {\n $results[] = implode('', array_slice($chars, $part['start'], $part['end'] - $part['start'] + 1));\n $pos = $part['start'] - 1;\n }\n\n if (-1 === $pos) {\n if (empty($results)) {\n $results[] = $log;\n }\n } else {\n $results[] = trim(implode('', array_slice($chars, 0, $pos+1)));\n }\n\n return $results;\n }",
"public function getLogMessage();",
"public function lireLog()\n \t{\n \t\treturn file_get_contents($this->_fichierlog);\n \t}",
"protected function parseTrack($track)\n\t{\n\t\t$trackParts = explode(\"\\t\",$track);\n\t\n\t\t$track = new LoggedTrack();\n\t\t\n\t\tif($this->logVersion === '1.0' && count($trackParts) !== 7)\n\t\t\tthrow new ParserException('Each logged track must contain 7 fields');\n\t\tif($this->logVersion === '1.1' && count($trackParts) !== 8)\r\n\t\t\tthrow new ParserException('Each logged track must contain 8 fields');\n\t\t\t\n\t\t//artist name - required\n\t\tif(strlen($trackParts[0]) === 0)\n\t\t\tthrow new ParserException('Log entry must contain an artist name');\n\t\t$track->artistName = $trackParts[0];\n\t\t\n\t\t//album name - optional\n\t\tif(strlen($trackParts[1]) > 0)\n\t\t\t$track->albumName = $trackParts[1];\n\t\t\n\t\t//track name - required\n\t\tif(strlen($trackParts[2]) === 0)\r\n\t\t\tthrow new ParserException('Log entry must contain a track name');\r\n\t\t$track->trackName = $trackParts[2];\n\t\t\n\t\t//track position in album - optional\n\t\tif(strlen($trackParts[3]) > 0 && is_numeric($trackParts[3]))\n\t\t\t$track->trackAlbumPosition = (int)$trackParts[3];\n\t\t\n\t\t//song duration in seconds - required\n\t\tif(strlen($trackParts[4]) === 0)\r\n\t\t\tthrow new ParserException('Log entry must contain track duration');\r\n\t\t$track->trackDuration = (int)$trackParts[4];\n\t\t\n\t\t//track skipped? - required\n\t\tif(strlen($trackParts[5]) !== 1 || ($trackParts[5] !== 'S' && $trackParts[5] !== 'L'))\r\n\t\t\tthrow new ParserException('Log entry must specify if the track has been skipped');\r\n\t\tif($trackParts[5] === 'S')\n\t\t\t$track->skipped = true;\n\t\t\n\t\t//song start time - required\n\t\tif(strlen($trackParts[6]) === 0 || is_numeric($trackParts[6]) === false)\r\n\t\t\tthrow new ParserException('Log entry must specify the time that the track started playing');\n\t\t\n\t\t$time = new DateTime('@'.$trackParts[6],$this->timezone);\n\t\t$time->setTimezone(new DateTimeZone('UTC'));\n\t\t$track->listenTime = $time;\n\t\t\n\t\t//music brainz id - optional\n\t\tif($this->logVersion === '1.1' && strlen(rtrim($trackParts[7])) > 0)\n\t\t\t$track->musicBrainzID = $trackParts[7];\n\t\t\n\t\t$this->tracks[] = $track;\n\t\t$this->updateParserStats($track);\n\t}",
"private function parse_error_log( string $error_log ): array {\n\t\t$parsed_php_errors = array();\n\n\t\t$php_errors = \\explode( \"\\n\", $error_log ); // Pressable sites run on Linux, so the separator is always \\n. PHP_EOL could be \\r\\n on Windows.\n\t\tforeach ( $php_errors as $php_error ) {\n\t\t\t// Ignore non-fatal entries.\n\t\t\tif ( false === \\stripos( $php_error, 'php fatal' ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Extract individual components of the error entry.\n\t\t\t\\preg_match( '/\\[(.*)].*(PHP .*?):(.*)/', $php_error, $matches );\n\t\t\t$matches = \\array_map( 'trim', $matches );\n\n\t\t\tif ( empty( $matches[1] ) || empty( $matches[2] ) || empty( $matches[3] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$parsed_php_errors[] = array(\n\t\t\t\t'timestamp' => $matches[1],\n\t\t\t\t'error_level' => $matches[2],\n\t\t\t\t'error_message' => $matches[3],\n\t\t\t);\n\t\t}\n\n\t\treturn $parsed_php_errors;\n\t}",
"private function decode_log_line($line) {\n $parts = explode(': ', $line, 2);\n\n return json_decode($parts[1], true);\n }",
"protected function actionSystemLog() {\n $strReturn = \"\";\n\n $intStartDate = false;\n if($this->getParam(\"latestEntry\") != \"\")\n $intStartDate = strtotime($this->getParam(\"latestEntry\"));\n\n //read the last few lines\n $objFile = new class_filesystem();\n $arrDetails = $objFile->getFileDetails(\"/system/debug/systemlog.log\");\n\n $intOffset = 0;\n $bitSkip = false;\n if($arrDetails[\"filesize\"] > 20000) {\n $intOffset = $arrDetails[\"filesize\"] - 20000;\n $bitSkip = true;\n }\n\n $objFile->openFilePointer(\"/system/debug/systemlog.log\", \"r\");\n\n //forward to the new offset, skip entry\n if($intOffset > 0)\n $objFile->setFilePointerOffset($intOffset);\n\n $arrRows = array();\n\n $strRow = $objFile->readLineFromFile();\n while($strRow !== false) {\n if(!$bitSkip && trim($strRow) > 0)\n $arrRows[] = $strRow;\n\n $bitSkip = false;\n $strRow = $objFile->readLineFromFile();\n }\n\n $objFile->closeFilePointer();\n\n $strReturn .= \"<entries>\\n\";\n $arrRows = array_reverse($arrRows);\n foreach($arrRows as $strSingleRow) {\n\n //parse entry\n $strDate = uniSubstr($strSingleRow, 0, 19);\n $strSingleRow = uniSubstr($strSingleRow, 20);\n\n $intTempPos = uniStrpos($strSingleRow, \" \");\n $strLevel = uniSubstr($strSingleRow, 0, $intTempPos);\n $strSingleRow = uniSubstr($strSingleRow, $intTempPos + 1);\n\n $intTempPos = uniStrpos($strSingleRow, \")\") + 1;\n $strSession = uniSubstr($strSingleRow, 0, $intTempPos);\n\n $strLogEntry = uniSubstr($strSingleRow, $intTempPos);\n\n if($intStartDate !== false) {\n $intCurDate = strtotime($strDate);\n if($intStartDate >= $intCurDate)\n continue;\n }\n\n $strReturn .= \"\\t<entry>\\n\";\n $strReturn .= \"\\t\\t<level>\".$strLevel.\"</level>\\n\";\n $strReturn .= \"\\t\\t<date>\".$strDate.\"</date>\\n\";\n $strReturn .= \"\\t\\t<session>\".$strSession.\"</session>\\n\";\n $strReturn .= \"\\t\\t<content>\".xmlSafeString(strip_tags($strLogEntry)).\"</content>\\n\";\n\n $strReturn .= \"\\t</entry>\\n\";\n }\n\n $strReturn .= \"</entries>\";\n\n\n return $strReturn;\n }",
"abstract protected function getLogMessage();",
"public function splitLogEntry($string)\r\n\t{\r\n\t\t$temp = explode(' ',$string, 4);\r\n\t\twhile (count($temp) < 4) $temp[] = '';\r\n\t\t$ret['banDate'] = $temp[0];\r\n\t\t$ret['banIP'] = $temp[1];\r\n\t\t$ret['banReason'] = $temp[2];\r\n\t\t$ret['banNotes'] = str_replace(\"\\n\", '', $temp[3]);\r\n\t\treturn $ret;\r\n\t}",
"protected function parseCurlLog(RequestInterface $request)\n {\n $message = '';\n $handle = $request->getParams()->get('curl_handle');\n $stderr = $handle->getStderr(true);\n rewind($stderr);\n $addedBody = false;\n while ($line = fgets($stderr)) {\n // * - Debug | < - Downstream | > - Upstream\n if ($line[0] == '*') {\n if ($this->settings & self::LOG_DEBUG) {\n $message .= $line;\n }\n } else if ($this->settings & self::LOG_HEADERS) {\n $message .= $line;\n }\n // Add the request body if needed\n if ($this->settings & self::LOG_BODY) {\n if (trim($line) == '' && $request instanceof EntityEnclosingRequestInterface) {\n if ($request->getParams()->get('request_wire')) {\n $message .= (string) $request->getParams()->get('request_wire') . \"\\r\\n\";\n } else {\n $message .= (string) $request->getBody() . \"\\r\\n\";\n }\n $addedBody = true;\n }\n }\n }\n\n return $message;\n }",
"function getBaseLog(){\t\t\n\t\tif(!isset($_REQUEST['appid'])\n\t\t\t||!isset($_REQUEST['event'])\n\t\t\t||!isset($_REQUEST['uid'])) throw new Exception(\"no appid or event or uid\");\n\t\tif(isset($_REQUEST['timestamp']))\n\t\t\t$timestamp = $_REQUEST['timestamp'];\n\t\telse \n\t\t\t$timestamp = $_SERVER['REQUEST_TIME'];\n\t\t$log=$_REQUEST['appid'].\"\\t\".$_REQUEST['uid'].\"\\t\".$_REQUEST['ref'].\n\t\t\t\"\\t\".$_REQUEST['event'].\"\\t\".$_REQUEST['json_var'].\"\\t\".$timestamp.\"\\n\";\n\t\t\n\t\tif ($_REQUEST ['event'] === \"user.visit\") {\n\t\t\t$ip = getIP ();\n\t\t\tif ($ip != false) {\n\t\t\t\t$log = $log . $_REQUEST ['appid'] . \"\\t\" . $_REQUEST ['uid'] . \"\\t\" . '' . \"\\t\" . \"user.update\" . \"\\t\" . '{\"geoip\":\"' . $ip . '\"}' . \"\\t\" . $timestamp . \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $log;\n\t}",
"public function parse()\n\t{\n\t\t$this->parseHeader();\n\t\t\n\t\t//timezone must have been set by this point\n\t\tif($this->timezone === null)\n\t\t\tthrow new ParserException('The log file does not specify a timezone. You must specify one using setTimezone()');\n\t\t\n\t\t//parse each track in log file\n\t\twhile($track = fgets($this->logFile))\n\t\t\t$this->parseTrack($track);\n\t\t\n\t\tif(sizeof($this->tracks) === 0)\n\t\t\tthrow new ParserException('The log file contains no track information.');\n\t\t\n\t\treturn $this->tracks;\n\t}",
"function FixDateLog($ThatDate,$DateLog){$LogDate=explode(\" \",$DateLog);return $ThatDate.\" \".$LogDate[1];}",
"function readLinesFromLog($fileName, $con)\n{\n $timeRegex = \"/^\\w{3}\\s+\\d+\\s\\d{2}:\\d{2}:\\d{2}/i\";\n $serviceRegex = \"/(?<=\\d{2}\\s).+?(?=\\:)/i\";\n $sessionRegex = \"/(?<=\\]|\\:) \\w{1,}\\(.*?\\)/i\";\n $messageRegex = \"/(?<=\\:\\s).*$/i\";\n\n//semicolon regex\n $usernameRegex = \"/(?<=\\w\\: ).*?(?=\\:)/i\";\n $ttyRegex = \"/\\w+\\=\\w+\\d/i\";\n $passwordRegex = \"/\\w+\\=\\/\\s/i\";\n $userRegex = \"/\\w{4}\\=\\w+/i\";\n $commandRegex = \"/\\w{4,}\\=\\/.*/i\";\n\n//syslog regex, UFW LOG, MESSAGES\n $syslogTimeRegex = \"/^\\w{3}\\s+\\d+\\s\\d{2}:\\d{2}:\\d{2}/i\";\n $syslogServiceRegex = \"/(?<=\\:\\d{2}\\s).+?(?=\\:)/i\";\n $syslogMessageRegex = \"/(?<=\\:\\s).*$/i\";\n\n//mysql_error regex MAYBE TIME & MESSAGE\n $mysqlTimeRegex = \"/^\\d+-\\d{2}-\\d{2}\\s+\\d+:\\d+:\\d+(?<=\\:\\d{2})/i\";\n $mysqlServiceRegex = \"/(?<=\\:\\d{2} ).+(?<=\\])/i\"; //(?<=\\:\\d{2} ).+[(?<=\\])|(?<=\\:)]\n $mysqlMessageRegex = \"/[^<?\\]]*$/i\"; //[^(?<=\\:)|(?<=\\])]*$\n\n//auth.log regex SESSION IS NOT NECESSARY WHILE IT APPEARS FROM TIME TO TIME\n $authTimeRegex = \"/^\\w{3}\\s+\\d+\\s\\d{2}:\\d{2}:\\d{2}/i\";\n $authServiceRegex = \"/(?<=\\:\\d{2}\\s).+?.+(?=\\:)/i\";\n $authMessageRegex = \"/(?<= )[^:]*$/i\";\n\n//severities\n $syslogMessageSeverity = array();\n $mysqlMessageSeverity = array();\n $kernMessageSeverity = array();\n $authMessageSeverity = array();\n $ufwMessageSeverity = array();\n $messagesMessageSeverity = array();\n $customMessageSeverity = array();\n\n//times\n $syslogTimeArray = array();\n $mysqlTimeArray = array();\n $kernelTimeArray = array();\n $authTimeArray = array();\n $ufwTimeArray = array();\n $messagesTimeArray = array();\n $customTimeArray = array();\n\n\n $file = fopen($fileName, \"r\");\n\n\n\n if ($file) {\n if (filesize($fileName) > 0) {\n\n //ANALISE ROWS\n while (($line = fgets($file)) !== false) {\n //handles rare rows where half of it is separated with semicolons\n $semicolonArray = explode(';', $line);\n\n //work with semicolon line\n if (sizeof($semicolonArray) > 1 && $fileName!=\"/var/log/syslog\") {\n //store the exact regex matches\n $timeColonData = GetRegexMatches($timeRegex, $line);\n $serviceColonData = GetRegexMatches($serviceRegex, $line);\n $usernameData = GetRegexMatches($usernameRegex, $line);\n $ttyData = GetRegexMatches($ttyRegex, $line);\n $passwordData = GetRegexMatches($passwordRegex, $line);\n $userData = GetRegexMatches($userRegex, $line);\n $commandData = GetRegexMatches($commandRegex, $line);\n\n //create objects\n $oneColonLine = new LogFileSemicolon($timeColonData, $serviceColonData,\n $usernameData, $ttyData, $passwordData, $userData, $commandData);\n\n //get objects\n $oneColonLine->getDescription();\n } else if ($fileName == '/var/log/syslog') {\n $syslogTimeData = GetRegexMatches($syslogTimeRegex, $line);\n $syslogServiceData = GetRegexMatches($syslogServiceRegex, $line);\n $syslogMessageData = GetRegexMatches($syslogMessageRegex, $line);\n\n //create objects\n $syslogLine = new SyslogFileData($syslogTimeData,\n $syslogServiceData, $syslogMessageData);\n\n //severity\n $syslogMessageSeverity[] = $syslogMessageData;\n\n //time\n $syslogTimeArray[] = $syslogTimeData;\n\n //insert into database\n $insertSyslogSQL = \"INSERT INTO Syslog(time, service, message)\n VALUES ('$syslogTimeData','$syslogServiceData', '$syslogMessageData')\";\n mysqli_query($con, $insertSyslogSQL);\n\n //get objects\n $syslogLine->getDescription();\n } else if ($fileName == '/var/log/kern.log') {\n $kernelTimeData = GetRegexMatches($syslogTimeRegex, $line);\n $kernelServiceData = GetRegexMatches($syslogServiceRegex, $line);\n $kernelMessageData = GetRegexMatches($syslogMessageRegex, $line);\n\n //create objects\n $kernelLine = new KernelFileData($kernelTimeData,\n $kernelServiceData, $kernelMessageData);\n\n //severity\n $kernMessageSeverity[] = $kernelMessageData;\n\n //time\n $kernelTimeArray[] = $kernelTimeData;\n\n //insert into database\n $insertKernelLogSQL = \"INSERT INTO Kern_log(time, service, message)\n VALUES ('$kernelTimeData','$kernelServiceData', '$kernelMessageData')\";\n mysqli_query($con, $insertKernelLogSQL);\n\n //get objects\n $kernelLine->getDescription();\n } else if ($fileName == \"/var/log/auth.log\") {\n //store the exact regex matches\n $authTimeData = GetRegexMatches($authTimeRegex, $line);\n $authServiceData = GetRegexMatches($authServiceRegex, $line);\n $authMessageData = GetRegexMatches($authMessageRegex, $line);\n\n //create objects\n $authLine = new AuthFileData($authTimeData, $authServiceData,\n $authMessageData);\n\n //severity\n $authMessageSeverity[] = $authMessageData;\n\n //time\n $authTimeArray[] = $authTimeData;\n\n //insert into database\n $insertAuthlogSQL = \"INSERT INTO Auth_log(time, service, message)\n VALUES ('$authTimeData','$authServiceData', '$authMessageData')\";\n mysqli_query($con, $insertAuthlogSQL);\n\n //get objects\n $authLine->getDescription();\n } else if ($fileName == \"/var/log/mysql/error.log\") {\n $mysqlTimeData = GetRegexMatches($mysqlTimeRegex, $line);\n $mysqlServiceData = GetRegexMatches($mysqlServiceRegex, $line);\n $mysqlMessageData = GetRegexMatches($mysqlMessageRegex, $line);\n\n //create objects\n $mysqlLine = new MySQLFileData($mysqlTimeData,\n $mysqlServiceData, $mysqlMessageData);\n\n //severity\n $mysqlMessageSeverity[] = $mysqlMessageData;\n\n //time\n $mysqlTimeArray[] = $mysqlTimeData;\n\n //insert into database\n $insertMysqlErrorlogSQL = \"INSERT INTO Mysql_Error_log(time, service, message)\n VALUES ('$mysqlTimeData','$mysqlServiceData', '$mysqlMessageData')\";\n mysqli_query($con, $insertMysqlErrorlogSQL);\n\n //get objects\n $mysqlLine->getDescription();\n }else if ($fileName == '/var/log/ufw.log') {\n $ufwTimeData = GetRegexMatches($syslogTimeRegex, $line);\n $ufwServiceData = GetRegexMatches($syslogServiceRegex, $line);\n $ufwMessageData = GetRegexMatches($syslogMessageRegex, $line);\n\n //create objects\n $ufwLogLine = new SyslogFileData($ufwTimeData,\n $ufwServiceData, $ufwMessageData);\n\n //severity\n $ufwMessageSeverity[] = $ufwMessageData;\n\n //time\n $ufwTimeArray[] = $ufwTimeData;\n\n //insert into database\n $insertUfwSQL = \"INSERT INTO Ufw_log(time, service, message)\n VALUES ('$ufwTimeData','$ufwServiceData', '$ufwMessageData')\";\n mysqli_query($con, $insertUfwSQL);\n\n //get objects\n $ufwLogLine->getDescription();\n } else if ($fileName == '/var/log/messages') {\n $messagesTimeData = GetRegexMatches($syslogTimeRegex, $line);\n $messagesServiceData = GetRegexMatches($syslogServiceRegex, $line);\n $messagesMessageData = GetRegexMatches($syslogMessageRegex, $line);\n\n //create objects\n $messagesLine = new MessagesFileData($messagesTimeData,\n $messagesServiceData, $messagesMessageData);\n\n //severity\n $messagesMessageSeverity[] = $messagesMessageData;\n\n //time\n $messagesTimeArray[] = $messagesTimeData;\n\n //insert into database\n $insertMessagesSQL = \"INSERT INTO Messages(time, service, message)\n VALUES ('$messagesTimeData','$messagesServiceData', '$messagesMessageData')\";\n mysqli_query($con, $insertMessagesSQL);\n\n //get objects\n $messagesLine->getDescription();\n }else if($fileName == '/var/www/faildomain.com/src/login_register/mainPage/logs/'.$_SESSION['customLog']){\n include \"../customDbInfo.php\";\n $customTimeData = GetRegexMatches($syslogTimeRegex, $line);\n $customServiceData = GetRegexMatches($syslogServiceRegex, $line);\n $customMessageData = GetRegexMatches($syslogMessageRegex, $line);\n\n //create objects\n $customLine = new CustomFileData($customTimeData,\n $customServiceData, $customMessageData);\n\n //severity\n $customMessageSeverity[] = $customMessageData;\n\n //time\n $customTimeArray[] = $customTimeData;\n\n //insert into database\n $insertCustomSQL = \"INSERT INTO `\".$_SESSION['customLog'].\"` (time, service, message)\n VALUES ('$customTimeData','$customServiceData', '$customMessageData')\";\n mysqli_query($con, $insertCustomSQL);\n\n //get objects\n $customLine->getDescription();\n mysqli_close($con);\n }\n echo \"\\n\";\n }\n\n\n $_SESSION['counter'] = 0;\n $_SESSION['warn'] = 0;\n $_SESSION[\"error\"] = 0;\n $_SESSION[\"debug\"] = 0;\n $_SESSION[\"notice\"] = 0;\n $_SESSION[\"today_new_logs\"] = 0;\n\n //if log reading has been run\n if(SyslogFileData::$syslogCount>0){\n $_SESSION['error'] = ErrorSeverity($syslogMessageSeverity);\n $_SESSION['warn'] = WarningSeverity($syslogMessageSeverity);\n $_SESSION['debug'] = DebugSeverity($syslogMessageSeverity);\n $_SESSION['notice'] = NoticeSeverity($syslogMessageSeverity);\n $_SESSION['today_new_logs'] = TodaysLogs($syslogTimeArray);\n $_SESSION['counter'] = SyslogFileData::$syslogCount;\n }else if(MySQLFileData::$mysqlCounter>0){\n $_SESSION['error'] = ErrorSeverity($mysqlMessageSeverity);\n $_SESSION['warn'] = WarningSeverity($mysqlMessageSeverity);\n $_SESSION['debug'] = DebugSeverity($mysqlMessageSeverity);\n $_SESSION['notice'] = NoticeSeverity($mysqlMessageSeverity);\n $_SESSION['today_new_logs'] = TodaysLogs($mysqlTimeArray);\n $_SESSION['counter'] = MySQLFileData::$mysqlCounter;\n }elseif(KernelFileData::$kernelCount>0){\n $_SESSION['error'] = ErrorSeverity($kernMessageSeverity);\n $_SESSION['warn'] = WarningSeverity($kernMessageSeverity);\n $_SESSION['debug'] = DebugSeverity($kernMessageSeverity);\n $_SESSION['notice'] = NoticeSeverity($kernMessageSeverity);\n $_SESSION['today_new_logs'] = TodaysLogs($kernelTimeArray);\n $_SESSION['counter'] = KernelFileData::$kernelCount;\n }elseif(AuthFileData::$authCount>0){\n $_SESSION['error'] = ErrorSeverity($authMessageSeverity);\n $_SESSION['warn'] = WarningSeverity($authMessageSeverity);\n $_SESSION['debug'] = DebugSeverity($authMessageSeverity);\n $_SESSION['notice'] = NoticeSeverity($authMessageSeverity);\n $_SESSION['today_new_logs'] = TodaysLogs($authTimeArray);\n $_SESSION['counter'] = AuthFileData::$authCount;\n }else if(UfwFileData::$ufwlogCount>0){\n $_SESSION['error'] = ErrorSeverity($ufwMessageSeverity);\n $_SESSION['warn'] = WarningSeverity($ufwMessageSeverity);\n $_SESSION['debug'] = DebugSeverity($ufwMessageSeverity);\n $_SESSION['notice'] = NoticeSeverity($ufwMessageSeverity);\n $_SESSION['today_new_logs'] = TodaysLogs($ufwTimeArray);\n $_SESSION['counter'] = UfwFileData::$ufwlogCount;\n }else if(MessagesFileData::$messagesCount>0){\n $_SESSION['error'] = ErrorSeverity($messagesMessageSeverity);\n $_SESSION['warn'] = WarningSeverity($messagesMessageSeverity);\n $_SESSION['debug'] = DebugSeverity($messagesMessageSeverity);\n $_SESSION['notice'] = NoticeSeverity($messagesMessageSeverity);\n $_SESSION['today_new_logs'] = TodaysLogs($messagesTimeArray);\n $_SESSION['counter'] = MessagesFileData::$messagesCount;\n }elseif(CustomFileData::$customlogCount>0){\n $_SESSION['error'] = ErrorSeverity($customMessageSeverity);\n $_SESSION['warn'] = WarningSeverity($customMessageSeverity);\n $_SESSION['debug'] = DebugSeverity($customMessageSeverity);\n $_SESSION['notice'] = NoticeSeverity($customMessageSeverity);\n $_SESSION['today_new_logs'] = TodaysLogs($customTimeArray);\n $_SESSION['counter'] = CustomFileData::$customlogCount;\n }\n\n $con->close();\n fclose($file);\n } else {\n echo \"The log file \" . $fileName . \" is empty\";\n }\n } else {\n echo \"The filepath is incorrect! \" . $fileName . \" not found\";\n }\n}",
"function getStoreLog(){\n\t\tif(!isset($_REQUEST['appid']))throw new Exception(\"no appid\");\n\t\tif(!isset($_REQUEST['log']))throw new Exception(\"no log\");\n\t\t$log = $this->addAppidForStoreLog($_REQUEST['log']);\n\t\treturn $log.\"\\n\";\n\t}",
"public function getLog();",
"public function getEntryLog();",
"abstract protected function writeString($logStr);"
] | [
"0.8254153",
"0.6898148",
"0.66525644",
"0.6439419",
"0.60908526",
"0.5921693",
"0.5900903",
"0.5863512",
"0.5718909",
"0.57058924",
"0.5664562",
"0.5662085",
"0.5606665",
"0.5544511",
"0.5507474",
"0.5486665",
"0.5476164",
"0.54688025",
"0.5460605",
"0.54467064",
"0.5436863",
"0.53633577",
"0.53604746",
"0.5358371",
"0.5334268",
"0.53153926",
"0.52822053",
"0.52677685",
"0.52009124",
"0.51997274"
] | 0.8298166 | 0 |
Log statistics in the import log | public function logStatistics()
{
$counter = $this->getStatistics();
$this->addLine();
$this->add(sprintf(
'Added: %s, Updated: %s, Deleted: %s, Unchanged: %s, Skipped: %s, Error(s): %s, Total: %s, Error percentage: %s %%',
$counter['added'],
$counter['updated'],
$counter['deleted'],
$counter['unchanged'],
$counter['skipped'],
$counter['error'],
$counter['total'],
$counter['errorPercentage']
));
$this->addLine();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function beforeImportLog(ImportEvent $ev)\n {\n if (null !== $this->output) {\n $this->output->writeln('Importing ' . $ev->getAction() . '...');\n }\n }",
"public function stats(): void\n {\n $logLevels = $this->getLogLevels();\n $statsConfig = $this->getStatsConfig();\n\n $since = new Time($statsConfig['period']);\n $limit = $statsConfig['limit'];\n\n foreach ($logLevels as $logLevel) {\n $logs = $this->getLogStats($logLevel, $since, $limit);\n if ($logs->count() <= 0) {\n continue;\n }\n\n $this->info(\"Log level: $logLevel\");\n foreach ($logs->toArray() as $result) {\n $count = number_format($result['count']);\n // Thanks to: https://stackoverflow.com/a/9097959/151647\n $message = strtok($result['message'], \"\\n\");\n // NOTE: Log grouping in the database is done based on full log\n // message, while the printout shows only the first line.\n // This might sometimes cause the printout of identical\n // messages as separate entries with different counts.\n // If there is a reliable way to group by the first line\n // of the log message in database, then this can be easily\n // fixed.\n $this->out(sprintf(\"%5s : %s\\n\", $count, $message));\n }\n $this->hr();\n }\n }",
"function mfn_before_import($import_id) {\n\terror_log('In mfn_before_import'.PHP_EOL, 3, './debug.log' );\n}",
"public function beforeFilesLog()\n {\n $this->output->writeln('Importing media files...');\n }",
"public function postImport() {\n\n $this->logMessage('Projects Migrated', 'project.log');\n }",
"public function logStart($startDate, $endDate) {\n\t\t$this->LogInfo(\"Importing data from {$startDate->format('Y-m-d')} to {$endDate->modify('- 1 day')->format('Y-m-d')}\");\n\t}",
"function logs(){\n\n\t\t}",
"function start_log()\r\n\t{\r\n\t\t$this->log = \"Started on \".NOW().\" - \".date(\"Y M d\").\"\\r\\n\\n\";\r\n\t\t$this->log .= \"Checking File ....\\r\\n\";\r\n\t\t$this->log('File',$this->input_file);\r\n\t}",
"function _drush_backend_integrate_log($entry) {\n}",
"protected function startLog() {\n error_log(\"[\".$this->getName().\"] Logging starts...\");\n }",
"public function logPerformance()\n {\n Log::info(\n PHP_EOL . 'Performance Statistics:' . PHP_EOL .\n 'Current Route: ' . Request::getRequestUri()\n . PHP_EOL .\n 'Time to create the Response: '\n . $this->getCurrentTimeDifference(Session::get('start.time'), 'ms') . ' ms'\n . PHP_EOL .\n 'Total performed DB Queries: ' . count(DB::getQueryLog())\n . PHP_EOL\n );\n }",
"private function _log()\n\t{\n\t\t$log = [\n\t\t\t'url'\t\t\t=> Yii::$app->request->getUrl(),\n\t\t\t'ip'\t\t\t=> Yii::$app->request->getUserIP(),\n\t\t\t'_jsonRequest' \t=> [\n\t\t\t\tself::OBJECT_PARAMS\t=> $this->_jsonRequest,\n\t\t\t\tself::OBJECT_FILES => $this->_filesRequest,\n\t\t\t],\n\t\t\t'_jsonResponse' => $this->_jsonResponse,\n\t\t];\n\n\t\tYii::info($log, 'db_log');\n\t}",
"protected function _logStats()\n {\n if (isset($this->_stats['subscriber_count']) && $this->_stats['subscriber_count'] > 0) {\n\n $this->l()->log($this->l()->__('%s successfully subscribed %s/%s',\n static::SUBSCRIBER_TYPE, $this->_stats['subscriber_success_count'], $this->_stats['subscriber_count']\n ));\n\n if (!empty($this->_stats['subscriber_errors'])) {\n $this->l()->log($this->l()->__('%s subscribe errors %s/%s',\n static::SUBSCRIBER_TYPE, var_export($this->_stats['subscriber_errors'], true)\n ));\n }\n }\n\n if (isset($this->_stats['unsubscriber_count']) && $this->_stats['unsubscriber_count'] > 0) {\n\n $this->l()->log($this->l()->__('%s successfully unsubscribed %s/%s',\n static::SUBSCRIBER_TYPE, $this->_stats['unsubscriber_success_count'], $this->_stats['unsubscriber_count']\n ));\n $this->l()->log($this->l()->__('%s unsubscribed with errors %s/%s',\n static::SUBSCRIBER_TYPE, $this->_stats['unsubscriber_error_count'], $this->_stats['unsubscriber_count']\n ));\n\n if (!empty($this->_stats['unsubscriber_errors'])) {\n $this->l()->log($this->l()->__('%s unsubscribe errors %s/%s',\n static::SUBSCRIBER_TYPE, var_export($this->_stats['unsubscriber_errors'], true)\n ));\n }\n }\n }",
"function ReportLog() {\r\n\t}",
"public function logs($show = true)\n\t{\n\t\t$time = round((microtime(true) - $this->startTime) / 60, 2);\n\t\tif ($show) {\n\t\t\techo $this->logs . '--------- ' . date('Y-m-d H:i:s') . \" ($time min) -------------\\n\";\n\t\t} else {\n\t\t\tfile_put_contents('cache/logs/Importer.log', $this->logs . '------------- ' . date('Y-m-d H:i:s') . \" ($time min) -------------\\n\");\n\t\t}\n\t}",
"private function importLogs($obj)\n {\n $this->addLog($obj->getLogs());\n }",
"public function echo_import_data() {\n if( $this->import_export_errors ) {\n echo '<h2>Data import failed</h2>';\n } else {\n echo '<h2>Data import complete</h2>';\n }\n foreach( $this->messages as $message ) {\n echo $message . \"<br>\";\n }\n die();\n }",
"protected function start_log_monitoring() {\n // Open the file for reading and seek to the end of the file\n if (is_null($this->log_handle)) {\n $this->log_handle = fopen($this->log_directory . $this->log_filename, \"r\");\n }\n fseek($this->log_handle, -1, SEEK_END);\n }",
"private function logData(): void\n {\n //get the referer to my home page(if necessary)\n $serverName = $_SERVER['SERVER_ADDR'] ?? $_SERVER['SERVER_NAME'];\n\n if (isset($_SESSION['visitorUrl'])) {\n $referer = $_SESSION['visitorUrl'];\n } else {\n $referer = '';\n }\n\n $str = \"\\\\r\\\n \" . \"Remote addr\\\t\" . $this->ip . \"\\\\r\\ \" .\n \" Server addr\\\t \" . $serverName . \"\\\\r\\ \" .\n \" User agent\\\t\" . $_SERVER['HTTP_USER_AGENT'] . \"\\\\r\\ \" .\n \" Referer:\\\t \" . $referer . \"\\\\r\\ \" .\n date('j M Y g:i a') . \"\\\\r\\ \";\n\n //open the logfile\n $fw = fopen($this->logfile, 'a+');\n //write the log data for this visit to file\n fwrite($fw, $str);\n fclose($fw);\n }",
"protected function logNumberOfUsers($users)\n\t{\n\t\t$elapsedTime = $this->getElapsedTime();\n\t\t$numberOfUsers = count($users);\n\t\t$this->logger->info(\"Number of users to import/update: $numberOfUsers ($elapsedTime seconds)\");\n\t}",
"function import_user_log_insert(&$log) {\n $result = db_query(\n \"\n insert into import_user_log \n (created, rid, uid, import_table, log_type, log_value)\n values\n (%d,%d,%d,'%s','%s','%s')\n \"\n , $log->created, $log->rid, $log->uid, $log->import_table, $log->type, $log->value);\n}",
"function update_import_log($data_type, $file_name, $numrecords, $discription) {\n include(\"dbconn.inc.php\");\n\n $sql = '\n INSERT INTO log_imports\n (data_type, \n file_name, \n num_records, \n discription)\n VALUES (\"' . $data_type . '\",\n \"' . $file_name . '\",\n \"' . $numrecords . '\",\n \"' .$discription . '\");\n ';\n\n mysqli_query($conn, $sql);\n mysqli_close($conn);\n }",
"public static function print_import_notice() {\n\t\t\n\t\t// Check transient, if available display notice\n\t\tif ( get_transient( 'cfs_import_result' ) ) {\n\t\t\techo '<div class=\"updated\"><p>' . get_transient( 'cfs_import_result' ) . '</p></div>';\n\t\t\t\n\t\t\t// Delete transient, only display this notice once.\n\t\t\tdelete_transient( 'cfs_import_result' );\n\t\t}\n\t}",
"public function getImportInformation()\n {\n $lastImport = LengowMain::getLastImport();\n $lastImportDate = $lastImport['timestamp'] === 'none'\n ? $this->locale->t('toolbox.index.last_import_none')\n : LengowMain::getDateInCorrectFormat($lastImport['timestamp'], true);\n if ($lastImport['type'] === 'none') {\n $lastImportType = $this->locale->t('toolbox.index.last_import_none');\n } elseif ($lastImport['type'] === LengowImport::TYPE_CRON) {\n $lastImportType = $this->locale->t('toolbox.index.last_import_cron');\n } else {\n $lastImportType = $this->locale->t('toolbox.index.last_import_manual');\n }\n if (LengowImport::isInProcess()) {\n $importInProgress = LengowMain::decodeLogMessage(\n 'toolbox.index.rest_time_to_import',\n null,\n array('rest_time' => LengowImport::restTimeToImport())\n );\n } else {\n $importInProgress = $this->locale->t('toolbox.index.no_import');\n }\n $checklist = array();\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.global_token'),\n 'message' => LengowConfiguration::get('LENGOW_GLOBAL_TOKEN'),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.url_import'),\n 'message' => LengowMain::getImportUrl(),\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.import_in_progress'),\n 'message' => $importInProgress,\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.shop_last_import'),\n 'message' => $lastImportDate,\n );\n $checklist[] = array(\n 'title' => $this->locale->t('toolbox.index.shop_type_import'),\n 'message' => $lastImportType,\n );\n return $this->getAdminContent($checklist);\n }",
"public function getLog();",
"public function preExecute()\n { \n if (sfConfig::get('app_sfDoctrineRestBasic_logging_enabled'))\n {\n $this->logger = new sfDoctrineRestBasicLogger();\n $log_data = $this->logger->getRequestLogData();\n $this->logger->log($log_data, sfConfig::get('app_sfDoctrineRestBasic_request_log_prefix').date('Y-m-d').'.log');\n } \n }",
"public function __construct() {\n\t\tLog::useFiles(storage_path().'/logs/audits.log');\n\t}",
"public function transferDailyLogToGlobal(): void\n {\n if (filesize($this->tmp_error_log) !== 0) {\n file_put_contents($this->global_error_log, file_get_contents($this->tmp_error_log), FILE_APPEND | LOCK_EX);\n file_put_contents($this->tmp_error_log, '');\n }\n }",
"public function enable_logs() {\n\t\t$this->use_logs = true;\n\t}",
"function gwwus_admin_import_notice() {\n}"
] | [
"0.6599912",
"0.6506911",
"0.64200795",
"0.6106286",
"0.6050463",
"0.5960008",
"0.59424835",
"0.5829251",
"0.5824759",
"0.58051884",
"0.57129604",
"0.570117",
"0.56647545",
"0.5660391",
"0.56506115",
"0.5554864",
"0.5549066",
"0.554439",
"0.55381745",
"0.55213636",
"0.5507432",
"0.5500231",
"0.54959863",
"0.54797584",
"0.5465684",
"0.5448456",
"0.5420498",
"0.5416719",
"0.54032123",
"0.53967243"
] | 0.73119783 | 0 |
Get the error count | public function getErrorCount()
{
return $this->counter['error'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getErrorCount();",
"public function errorCount();",
"function GetErrorCount() {\n\t\treturn $this->m_errCnt;\n\t}",
"public function getErrorCount() {\n\t\treturn $this->errorCount;\n\t}",
"public function countErrors();",
"public function errorCount() {\n\t\treturn isset($this->_messages[self::TYPE_ERROR])\n\t\t? count($this->_messages[self::TYPE_ERROR]) : null;\n\t}",
"public function count()\r\n {\r\n return count($this->errors);\r\n }",
"function errorCount() {\r\n return sizeof($this->_errors);\r\n }",
"public function getErrorsCount()\n {\n return $this->errors_count;\n }",
"public function countErrors()\n {\n return count($this->errors);\n }",
"public static function countError()\n {\n return count($_SESSION['errors']);\n }",
"function numError(){\n return count($this->errors);\n }",
"public function getExceptionCount() {}",
"public function getExceptionCount() {}",
"public function getExceptionCount() {}",
"public function getExceptionCount() {}",
"public function failedCount();",
"public function get_SQL_errors_num () {\n\n return count($this->SQL_errors);\n }",
"public function getErrorUserCount()\n {\n if (array_key_exists(\"errorUserCount\", $this->_propDict)) {\n return $this->_propDict[\"errorUserCount\"];\n } else {\n return null;\n }\n }",
"public function getFailedCount () {\n return ( int ) $this->_iFailed;\n }",
"public function getNumberOfRPCErrors()\n {\n return count($this->rpcError);\n }",
"public function getErrorDeviceCount()\n {\n if (array_key_exists(\"errorDeviceCount\", $this->_propDict)) {\n return $this->_propDict[\"errorDeviceCount\"];\n } else {\n return null;\n }\n }",
"public function getErrorNumber(): int {\n return curl_errno($this->curlResource);\n }",
"public function getErrorNumber()\n { \n return $this->_errorno;\n }",
"public function errorNumber()\n {\n if ($this->_executed) {\n return curl_errno($this->_curlHandle);\n } else {\n return 1000;\n }\n }",
"function failureCount() {\r\n return sizeof($this->_failures);\r\n }",
"public function getErrorCountPerPage();",
"public function numFailed():Int {\n\n\t\treturn $this->numFailed;\n\n\t}",
"public function getErrorNum()\n\t{\n\t\treturn $this->errorNum;\n\t}",
"public function getRequestsWithErrorsCount()\n {\n return $this->requests_with_errors_count;\n }"
] | [
"0.9343104",
"0.905759",
"0.8994487",
"0.88117415",
"0.8751094",
"0.85496646",
"0.8450125",
"0.8392571",
"0.8379791",
"0.83729553",
"0.81470454",
"0.80058205",
"0.7855437",
"0.7855437",
"0.7855437",
"0.7855437",
"0.7742162",
"0.7572355",
"0.75253284",
"0.7412602",
"0.7383848",
"0.73013633",
"0.7285635",
"0.7280148",
"0.7239312",
"0.7229435",
"0.7211897",
"0.7177161",
"0.7145209",
"0.714206"
] | 0.90865755 | 1 |
duration should be array in format [[legend,duration_seconds],..] | function connectionDurationShowGraph(&$durations,$title)
{
$datas=array();
$legends=array();
$labels=array();
foreach($durations as $duration)
{
$datas[]=$duration[1];
$legends[]="{$duration[0]} (".formatDuration($duration[1]).")";
$labels[]="%.1f%% ({$duration[0]})";
}
$ibs_graph = new IBSPieGraph($title,$legends,$labels,$datas);
$graph = $ibs_graph->createGraph();
$graph->stroke();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function duration($duration) {\n\t\t\n\t\t$h = floor($duration / 3600);\n\t\t$m = floor($duration % 3600 / 60);\n\t\t$s = floor($duration % 3600 % 60);\n\t\t\n\t\treturn $this->leadingZero($h) . \":\" . $this->leadingZero($m). \":\" . $this->leadingZero($s);\n\t}",
"public function setDuration($duration);",
"function getDuration();",
"function _courseDuration($status, $credits) {\r\n\t\t\t$duration = array('m'=>array(2=>30, 3=>60), 'n'=>array(2=>30, 4=>60));\r\n\t\t\tif(isset($duration[$status][$credits])) return $duration[$status][$credits];\r\n\t\t\t\r\n\t\t\treturn 0;\r\n\t\t}",
"public function setDuration($duration){\n\t\t$this->duration = $duration;\n\t}",
"function time_duration($seconds)\n\t\t{\n\t\t\t# Define time periods\n\t\t\t$periods = array (\n\t\t\t\t'hours' => 3600,\n\t\t\t\t'minutes' => 60,\n\t\t\t\t'seconds' => 1\n\t\t\t\t);\n\t\t\t\t\n\t\t\t# Break into periods\n\t\t\t$seconds = (float) $seconds;\n\t\t\tforeach ($periods as $period => $value) {\n\t\t\t\t$count = floor($seconds / $value);\n\t\t\t\t$segments[] = ($count < 10) ? \"0\" . (string) $count : $count;\n\t\t\t\t$seconds = $seconds % $value;\n\t\t\t}\n\t\t\t$str = implode(':', $segments);\n\t\t\treturn $str;\n\t\t}",
"protected static function getHmsParts($duration) {\n $duration = intval($duration);\n $hours = intval($duration / 3600);\n $minutes = intval(($duration / 60) % 60);\n $seconds = intval($duration % 60);\n return [$hours, $minutes, $seconds];\n }",
"public function getDuration();",
"public function setDuration($value)\n\t{\n\t\t$this->duration = $value;\n\t}",
"public static function formatTime($duration) //as hh:mm:ss\n\t\t{\n\t\t$hours = floor($duration / 3600);\n\t\t$minutes = floor( ($duration - ($hours * 3600)) / 60);\n\t\t$seconds = $duration - ($hours * 3600) - ($minutes * 60);\n\t\treturn sprintf(\"%02d:%02d:%02d\", $hours, $minutes, $seconds);\n\t}",
"public function setDuration($duration)\n {\n $this->duration = $duration;\n }",
"protected function parseDuration($input) {\n if ($input[\"cas_sim\"] > 60) {\n $input[\"cas_sim\"] = 60;\n }\n if ($input[\"cas_sim\"] < 1) {\n $input[\"cas_sim\"] = 1;\n }\n return $input['cas_sim'];\n }",
"static function printSecondsInHour($duration){\r\n\t\tglobal $_LANG;\r\n\t\t$ret= \"\";\r\n\t\t$hour = floor(($duration) / (60 * 60));\r\n\t\t$minutes = (int) round((($duration) % (60 * 60)) / 60);\r\n\t\tif($hour > 0){\r\n\t\t\t$ret .= $hour.\" \".$_LANG->get('Std').\". \";\r\n\t\t}\r\n\t\t$ret .= $minutes.\" \".$_LANG->get('Min').\".\";\r\n\t\treturn $ret;\r\n\t}",
"function get_durations($transmit){\n global $database, $conn, $response;\n\n\t\t$conn = $database->getConnection();\n\t\t$stmt = $conn->query(\"select * from duration\");\n\t\t$response->duration = array();\n\t\t$i = 0;\n\t\twhile ($row = $stmt->fetch()) {\n\t\t\t$response->duration[$i] = intval($row[\"dLength\"]);\n\t\t\t$i++;\n\t\t}\n }",
"public function toDuration()\n {\n $vals = array(\n '<abbr title=\"weeks\">w</abbr>' => (int) ($this->value / 86400 / 7),\n '<abbr title=\"days\">d</abbr>' => $this->value / 86400 % 7,\n '<abbr title=\"hours\">h</abbr>' => $this->value / 3600 % 24,\n '<abbr title=\"minutes\">m</abbr>' => $this->value / 60 % 60,\n '<abbr title=\"seconds\">s</abbr>' => $this->value % 60,\n '<abbr title=\"miliseconds\">ms</abbr>' => round(($this->value - (int) $this->value) * 100),\n );\n\n $ret = array();\n\n foreach ($vals as $k => $v) {\n if ($v > 0) {\n $ret[] = (string) $v . $k;\n }\n }\n\n return new GACString(join(' ', $ret));\n }",
"public function format(Duration $duration): string;",
"function getDuration(){\n\t\treturn $this->duration;\n\t}",
"public function getDuration(){\n\t\treturn $this->duration;\n\t}",
"public static function get_duration_options( $key = null ) {\n $durations = array(\n 1 => 1, 2, 3, 4, 5, 6,\n 7, 8, 9, 10, 11, 12,\n 13, 14, 15, 16, 17, 18,\n 19, 20, 21, 22, 23, 24,\n );\n\n if ( isset ( $key ) ) {\n if ( isset( $durations[ $key ] ) ) {\n return $durations[ $key ];\n }\n }\n\n return $durations;\n }",
"function toDuracion($duracion=0) {\r\n\r\n\t$oDuracion = $duracion;\r\n\t\r\n\t$im = array(\r\n\t\t'dias' => 0, \r\n\t\t'horas' => 0, \r\n\t\t'minutos' => 0, \r\n\t\t'segundos' => 0\r\n\t);\r\n\r\n\tif ($oDuracion > 86400) {\r\n\t\t$im['dias'] = floor($oDuracion/86400);\r\n\t\t$oDuracion = $oDuracion - ($im['dias'] * 86400);\r\n\t}\r\n\t\r\n\tif ($oDuracion > 3600) {\r\n\t\t$im['horas'] = floor($oDuracion/3600);\r\n\t\t$oDuracion = $oDuracion - ($im['horas'] * 3600);\r\n\t}\r\n\t\r\n\tif ($oDuracion > 60) {\r\n\t\t$im['minutos'] = floor($oDuracion/60);\r\n\t\t$oDuracion = $oDuracion - ($im['minutos'] * 60);\r\n\t}\r\n\t\r\n\t$im['segundos'] = $oDuracion;\r\n\t\r\n\treturn $im;\r\n}",
"function getDuration(){\r\n\t\t$maxTime=0;\r\n\t\tforeach ($this->tracks as $track){\r\n\t\t\t$msgStr = $track[count($track)-1];\r\n\t\t\tlist($time) = explode(\" \", $msgStr);\r\n\t\t\t$maxTime = max($maxTime, $time);\r\n\t\t}\t\t\r\n\t\t$seconds = $maxTime * $this->getTempo() / $this->getTimebase() / 1000000;\r\n $mins = floor ($seconds / 60);\r\n $secs = $seconds % 60;\r\n return $mins . \":\" . $secs;\r\n\t}",
"public function countDurationTime(array $aAllRows = array()) {\r\n\r\n // used in eve/act/list & job/dialog\r\n $this -> mMakeFunction = array(\r\n 'funct' => 'amount',\r\n 'value' => 'dur',\r\n 'restr' => array('pos', 'max')\r\n ); // Es sollen alle Werte von 'dur' addiert werden. Je 'pos' wird aber nur der groesste Wert aufsummiert.\r\n\r\n $lFuncVal = 0;\r\n $lFuncKey = '';\r\n $lAllRows = array();\r\n if (!empty($aAllRows)) {\r\n $lFuncKey = $this -> mMakeFunction['value'];\r\n\r\n if (!empty($this -> mMakeFunction['restr'])) {\r\n $lRestrKey = $this -> mMakeFunction['restr'][0];\r\n\r\n foreach ($aAllRows as $lRow) {\r\n $lKey = $lRow[ $lRestrKey ] + 1;\r\n if (empty($lAllRows) OR !isset($lAllRows[$lKey])) {\r\n $lAllRows[$lKey] = (int)$lRow[ $lFuncKey ];\r\n } else {\r\n if ('max' == $this -> mMakeFunction['restr'][1]) {\r\n if ($lAllRows[$lKey] < $lRow[ $lFuncKey ]) {\r\n $lAllRows[$lKey] = (int)$lRow[ $lFuncKey ];\r\n }\r\n }\r\n }\r\n }\r\n\r\n } else {\r\n foreach ($aAllRows as $lRow) {\r\n $lAllRows[] = (int)$lRow[ $lFuncKey ];\r\n }\r\n }\r\n\r\n if (!empty($lAllRows)) {\r\n foreach ($lAllRows as $lRowVal) {\r\n if ('amount' == $this -> mMakeFunction['funct']) {\r\n $lFuncVal += $lRowVal;\r\n }\r\n }\r\n $lAllRows[0] = 0;\r\n }\r\n }\r\n\r\n if (0 < $lFuncVal) {\r\n ksort($lAllRows);\r\n $lRet = array('val' => $lFuncVal, 'key' => $lFuncKey, 'all' => $lAllRows);\r\n } else {\r\n $lRet = array('val' => 1, 'key' => $lFuncKey);\r\n }\r\n return $lRet;\r\n }",
"function time_duration($seconds, $use = null, $zeros = false)\n{\n // Define time periods\n $periods = array (\n 'years' => 31556926,\n 'Months' => 2629743,\n 'weeks' => 604800,\n 'days' => 86400,\n 'hours' => 3600,\n 'minutes' => 60,\n 'seconds' => 1\n );\n \n // Break into periods\n $seconds = (float) $seconds;\n $segments = array();\n foreach ($periods as $period => $value) {\n if ($use && strpos($use, $period[0]) === false) {\n continue;\n }\n $count = floor($seconds / $value);\n if ($count == 0 && !$zeros) {\n continue;\n }\n $segments[strtolower($period)] = $count;\n $seconds = $seconds % $value;\n }\n \n // Build the string\n $string = array();\n foreach ($segments as $key => $value) {\n $segment_name = substr($key, 0, -1);\n $segment = $value . ' ' . $segment_name;\n if ($value != 1) {\n $segment .= 's';\n }\n $string[] = $segment;\n }\n \n return implode(', ', $string);\n}",
"public function setDuration($val)\n {\n $this->_propDict[\"duration\"] = $val;\n return $this;\n }",
"function toDuration($time)\n {\n if(is_numeric($time))\n {\n $value = array(\n \"years\" => 0, \"days\" => 0, \"hours\" => 0,\n \"minutes\" => 0, \"seconds\" => 0,\n );\n \n if($time >= 31556926)\n {\n $value[\"years\"] = floor($time/31556926);\n $time = ($time%31556926);\n }\n if($time >= 86400)\n {\n $value[\"days\"] = floor($time/86400);\n $time = ($time%86400);\n }\n if($time >= 3600)\n {\n $value[\"hours\"] = floor($time/3600);\n $time = ($time%3600);\n }\n if($time >= 60)\n {\n $value[\"minutes\"] = floor($time/60);\n $time = ($time%60);\n }\n $value[\"seconds\"] = floor($time);\n //return (array) $value;\n $value[\"hours\"] = $value[\"hours\"] + ($value[\"days\"] * 24);\n return $value[\"hours\"].\":\".$value[\"minutes\"].\":\".$value[\"seconds\"];\n }else{\n return FALSE;\n }\n }",
"function tpl_duration($duration, $d = null, $h = ' Hours', $m = ' Minutes', $s = ' Seconds') {\n\t$str = $duration < 0 ? '-' : '';\n\tif (null != $d && $days = floor(abs($duration)/3600/24)) {\n\t\t$str .= SyndLib::translate(\"%s$d\", $days);\n\t\t$duration -= $days*3600*24;\n\t}\n\tif ($hours = floor(abs($duration)/3600))\n\t\t$str .= SyndLib::translate(\"%s$h\", $hours);\n\tif ($minutes = floor(abs($duration)%3600/60))\n\t\t$str .= ' '.SyndLib::translate(\"%s$m\", $minutes);\n\tif ((null == $str || '-' == $str) && $duration)\n\t\t$str .= SyndLib::translate(\"%s$s\", round(abs($duration)));\n\treturn trim($str);\n}",
"public function duration(float $duration) {\n $this->duration = $duration;\n }",
"function time_duration($seconds, $use = null, $zeros = false)\n{\n // Define time periods\n $periods = array (\n 'years' => 31556926,\n 'Months' => 2629743,\n 'weeks' => 604800,\n 'days' => 86400,\n 'hours' => 3600,\n 'minutes' => 60,\n 'seconds' => 1\n );\n \n // Break into periods\n $seconds = (float) $seconds;\n $segments = array();\n foreach ($periods as $period => $value) {\n if ($use && strpos($use, $period[0]) === false) {\n continue;\n }\n $count = floor($seconds / $value);\n if ($count == 0 && !$zeros) {\n continue;\n }\n $segments[strtolower($period)] = $count;\n $seconds = $seconds % $value;\n }\n \n // Build the string\n $string = array();\n foreach ($segments as $key => $value) {\n $segment_name = substr($key, 0, -1);\n $segment = $value . ' ' . $segment_name;\n if ($value != 1) {\n $segment .= 's';\n }\n $string[] = $segment;\n }\n \n return implode(', ', $string);\n}",
"public function getDuration()\n {\n return $this->data->duration;\n }",
"function duration($seconds_count)\n{\n $delimiter = ':';\n $seconds = $seconds_count % 60;\n $minutes = floor($seconds_count/60);\n $hours = floor($seconds_count/3600);\n\n $seconds = str_pad($seconds, 2, \"0\", STR_PAD_LEFT);\n $minutes = str_pad($minutes, 2, \"0\", STR_PAD_LEFT).$delimiter;\n\n if($hours > 0)\n {\n $hours = str_pad($hours, 2, \"0\", STR_PAD_LEFT).$delimiter;\n }\n else\n {\n $hours = '';\n }\n\n return \"$hours$minutes$seconds\";\n}"
] | [
"0.58299655",
"0.57192206",
"0.5691239",
"0.5663808",
"0.5619544",
"0.56148666",
"0.5553158",
"0.5546705",
"0.5447187",
"0.54450303",
"0.5426091",
"0.53792083",
"0.5373241",
"0.5368534",
"0.5330582",
"0.5312384",
"0.52524185",
"0.5221477",
"0.52185225",
"0.5202364",
"0.5197444",
"0.5195121",
"0.5178966",
"0.51079327",
"0.5101732",
"0.5096363",
"0.5087139",
"0.5086784",
"0.50754577",
"0.5054787"
] | 0.6298671 | 0 |
Allows to assign your own handler to the AddHeader function Sometimes you do not want to inherit from this, but create a table and assign the handlers to another object. | function AssignOnAddHeader(&$handler,$function)
{
$res = $this->OnAddHeader;
$this->OnAddHeader = array($handler,$function);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Header()\n{\n\t//Imprime l'en-tête du tableau si nécessaire\n\tif($this->ProcessingTable)\n\t\t$this->TableHeader();\n}",
"public function setHeader(HeaderFooter $header);",
"function AddHeader($keys)\n\t{\n\t\t$head = array_combine($keys,$keys);\n\t\t$this->Header()->NewRow($head);\n\t}",
"public function createheader()\n {\n //\n }",
"public function initHeader() {\n if (self::$_header) {\n $this->partial(self::$_header);\n }\n }",
"function Header() {\n }",
"function setHeader($baseType,$header='header'){\n\t\t$this->_header = $baseType. DS . $header;\n\t}",
"public static function addHeaderHandler($headerHandler)\n {\n if (is_subclass_of($headerHandler, Header\\Handler::class)) {\n $handler = new $headerHandler(self::$app->request);\n self::$app->before(function () use ($handler) {\n $handler->init();\n if ($handler->get()) {\n $handler->before();\n }\n });\n self::$app->after(function () use ($handler) {\n if ($handler->get()) {\n $handler->after();\n }\n });\n self::$app->finish(function () use ($handler) {\n if ($handler->get()) {\n $handler->finish();\n }\n });\n } else {\n $msg = \"$headerHandler is not a \".Header\\Handler::class;\n throw new \\LogicException($msg);\n }\n }",
"function constructorHeader() {\n\t if (DEBUG&&DEBUGLEVEL&1) debug('Start method frontend::constructorHeader()');\n\t global $table;\n\t $this->site[] = '<TABLE BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"0\" CELLSPACING=\"0\">';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD ALIGN=\"left\" VALIGN=\"top\" WIDTH=\"33%\">';\n\t $this->createInfoBox();\n\t $this->site[] = ' <BR>';\n\t $this->createFilter();\n\t $this->site[] = ' </TD>';\n\t $this->site[] = ' <TD ALIGN=\"center\" VALIGN=\"top\" WIDTH=\"33%\">';\n\t $this->createNavBox();\n\t $this->site[] = ' <BR>';\n\t $this->createDBInfo($table);\n\t $this->site[] = ' </TD>';\n\t $this->site[] = ' <TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"33%\">';\n\t $this->createOptBox();\n\t $this->site[] = ' </TD>';\n\t $this->site[] = ' </TR>';\n\t $this->site[] = '</TABLE>';\n\t common::checkForAttentions();\n\t $this->site[] = '<BR><BR>';\n\t if (DEBUG&&DEBUGLEVEL&1) debug('End method frontend::constructorHeader()');\n\t}",
"public function setTableHeader($header)\n\t{\n\t\t$this->_header = $header;\n\t\treturn $this;\n\t}",
"public static function adminEventHandlerEventsListHeaders($args,$ismini=false) {\n\t\t\t$columns=&$args['columns'];\n\t\t\t$num = 3; //Insert a new column header @3rd position.\n\t\t\tif ($ismini)\n\t\t\t\t$num++;#Minilist adds a 'period' column so we increase $num\n\t\t\t$columns = array_merge(array_slice($columns, 0, $num), array('<th>' . __('Dummy') . '</th>'), array_slice($columns, $num));\n\t\t}",
"public function addHeader() {\n\t\t$this->startElement(self::HEADER_ELEMENT_NAME);\n\t\t$arg_list = func_get_args();\n\t\tif (func_num_args()==3) {\n\t\t\t$this->writeElement(self::ERROR_CODE_ELEMENT_NAME, $arg_list[0]); \n\t\t\t$this->writeElement(self::ERROR_MESSAGE_ELEMENT_NAME, $arg_list[1]);\n\t\t\t$this->writeElement(self::RESPONSE_ELEMENT_NAME, $arg_list[2]); \n\t\t}\n\t\telse if (func_num_args()==2) {\n\t\t\t$this->writeElement(self::ERROR_CODE_ELEMENT_NAME, $arg_list[0]); \n\t\t\t$this->writeElement(self::ERROR_MESSAGE_ELEMENT_NAME, $arg_list[1]); \n\t\t}\n\t\t$this->endElement();\n\t\treturn $this;\n\t}",
"private function tableHead()\n\t{\n\t\tforeach( $this->data['thead'] as $th )\n\t\t\t$this->thead .= \"<th>$th</th>\";\n\n\t\t$this->thead = '<thead><tr>' .$this->thead .\"</tr></thead>\";\n\t}",
"protected function loadTheHeaders(){\n foreach( $this->tablesData as $data ){\n $data['object']->setHeaders($data['headers']);\n }\n }",
"function table_heading_row($data, $class=\"\") \n {\n if (!is_array($data))\n return;\n\n $d = $this->select_colnames($data);\n\n $row = 0;\n echo \"<thead>\\n\";\n $this->table_row_open($row, $d, $class);\n $this->set_checkbox_heading($class);\n $this->show_table_heading_cells($data, $class);\n\n # call virtual function\n if ($this->add_extra)\n $this->table_heading_row_add_extra($data, $class);\n\n $this->table_row_close(0, $class);\n echo \"</thead>\\n\";\n }",
"function Header()\n {\n }",
"public function headers()\r\r\n {\r\r\n\r\r\n $names = array(\r\r\n array(__('Done', 'wpsearchconsole'), 'wpsearchconsole-done-checkbox'),\r\r\n array(__('Priority', 'wpsearchconsole'), 'wpsearchconsole-todo-priority'),\r\r\n array(__('Action', 'wpsearchconsole'), 'wpsearchconsole-todo-action'),\r\r\n array(__('Category', 'wpsearchconsole'), 'wpsearchconsole-todo-category'),\r\r\n array(__('Responsible', 'wpsearchconsole'), 'wpsearchconsole-todo-responsible'),\r\r\n array(__('Due Date', 'wpsearchconsole'), 'wpsearchconsole-todo-due_date'),\r\r\n array(__('Delete', 'wpsearchconsole'), 'wpsearchconsole-todo-delete'),\r\r\n ); ?>\r\r\n <tr>\r\r\n <?php foreach ($names as $val): ?>\r\r\n <th class=\"<?php echo $val[1]; ?>\"><?php echo $val[0]; ?></th>\r\r\n <?php endforeach; ?>\r\r\n </tr>\r\r\n <?php\r\r\n }",
"function setHeader($hText) {\n $this->header = $hText;\n }",
"function headers() {\n\t\t$this->baseURL();\n\t\tif (is_array($this->headerNames)) {\n\t\t\twhile(list($k,$v) = each($this->headerNames)) {\n\t\t\t\tif ($this->headers[$v]) { \n\t\t\t\t\t$this->headerNames[$k] = $this->headers[$v];\n\t\t\t\t}\n\t\t\t\tif (in_array($v,$this->sortColumns)) { \n\n\t\t\t\t\t$x = \"<a href=\\\"#\\\" onClick=\\\"document.datagrid.action='\".$this->baseurl.\"/{$this->startVar}={$this->startPage}/\".$this->sortVar.\"=$v/\".$this->sortOrderVar.'='.(($this->sort_order == 'DESC' ) ? 'ASC' : 'DESC' ).\"'; document.datagrid.method='POST'; document.datagrid.submit(); return false;\\\">\".$this->headerNames[$k].\"</a>\";\n\t\t\t\t\t$this->headerNames[$k] = $x;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->ignorePrePost = true;\n\t\t\t$h =$this->arrayToRow($this->headerNames, true);\n\t\t\t$h->class= $this->headerClass;\n\t\t\t$this->headerHTML = $h->toHTML();\n\t\t\t\n\t\t}\n\n\t\t\n\t\tif ($this->startPage > 0) { // previous\n\t\t\t$this->beginpage = \"<a href=\\\"\".$this->baseurl.\"/\".$this->startVar.\"=0/{$this->sortVar}={$this->orderby}/{$this->sortOrderVar}={$this->sort_order}\\\" onClick=\\\"document.datagrid.action=this.href; document.datagrid.method='POST'; document.datagrid.submit(); return false;\\\">{$this->beginpage}</a>\";\n\t\t\t$this->prevpage = \"<a href=\\\"\".$this->baseurl.\"/\".$this->startVar.\"=\".($this->startPage -1).\"/{$this->sortVar}={$this->orderby}/{$this->sortOrderVar}={$this->sort_order}\\\" onClick=\\\"document.datagrid.action=this.href; document.datagrid.method='POST'; document.datagrid.submit(); return false;\\\">{$this->prevpage}</a>\";\n\t\t} else\n\t\t{\n\t\t\t$this->beginpage = str_replace('prevprev.gif', 'noprevprev.gif', $this->beginpage);\n\t\t\t$this->prevpage = str_replace('prev.gif', 'noprev.gif', $this->prevpage);\n\t\t\n\t\t}\n\t\t\n\t\tif ($this->startPage < $this->_totalPages) { // next\n\t\t\t$this->lastpage = \"<a href=\\\"\".$this->baseurl.\"/\".$this->startVar.\"=\".$this->_totalPages.\"/{$this->sortVar}={$this->orderby}/{$this->sortOrderVar}={$this->sort_order}\\\" onClick=\\\"document.datagrid.action=this.href; document.datagrid.method='POST'; document.datagrid.submit(); return false;\\\">{$this->lastpage}</a>\";\n\t\t\t$this->nextpage = \"<a href=\\\"\".$this->baseurl.\"/\".$this->startVar.\"=\".($this->startPage +1).\"/{$this->sortVar}={$this->orderby}/{$this->sortOrderVar}={$this->sort_order}\\\" onClick=\\\"document.datagrid.action=this.href; document.datagrid.method='POST'; document.datagrid.submit(); return false; \\\">{$this->nextpage}</a>\";\n\t\t} else\n\t\t{ \n\t\t\t$this->lastpage = str_replace('nextnext.gif', 'nonextnext.gif', $this->lastpage);\n\t\t\t$this->nextpage = str_replace('next.gif', 'nonext.gif', $this->nextpage);\n\t\t\t\n\t\t}\n\t\tif ($this->_totalPages<0) { \n\t\t\t$this->beginpage='';\n\t\t\t$this->lastpage='';\n\t\t\t$this->prevpage = '';\n\t\t\t$this->nextpage='';\n\t\t}\n\t}",
"public function addHeaders($headers) {\n\tif (!is_array($headers)) {throw new DStructGeneralException('DataTable::addHeaders() - $headers parameter must be an array');}\n\t$this->headers = $headers;\n}",
"private function setHeaders()\n\t\t{\n\t\t\tif(!$this->isColOnly() && !$this->isIgnorCol())\n\t\t\t{\n\t\t\t\tforeach ($this->thNodes as $th) \n\t\t\t\t{\n\t\t\t\t\tarray_push($this->colLabel, $th->textContent);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//will only set the collums that have been specified\n\t\t\tif($this->isColOnly())\n\t\t\t{\n\t\t\t\tforeach ($this->settings[\"colOnly\"] as $key) \n\t\t\t\t{\n\t\t\t\t\tarray_push($this->colLabel ,$this->thNodes->item($key)->textContent);\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t// TODO: add exception for processing all collums except for the ignored indexed parsed through the array setting\n\t\t}",
"function setTableHeaderAttributes($attribs)\n {\n $this->_options['headerAttributes'] = $attribs;\n }",
"public function headers()\r\r\n {\r\r\n\r\r\n $names = array(\r\r\n __('Keyword', 'wpsearchconsole'),\r\r\n __('Title', 'wpsearchconsole'),\r\r\n //\t__( 'Link', 'wpsearchconsole' )\r\r\n ); ?>\r\r\n <tr>\r\r\n <?php foreach ($names as $val): ?>\r\r\n <th><?php echo $val; ?></th>\r\r\n <?php endforeach; ?>\r\r\n </tr>\r\r\n <?php\r\r\n }",
"function CreateHeader()\n\t{\n\t\t// TODO - invoke it on className (not all textarea elements)\n\t\t//e107::getJs()->requireCoreLib('core/admin.js');\n\t\te107::js('core','core/admin.js','prototype');\n\t}",
"public function writeHead()\n {\n\n $structure = [];\n\n if (is_object($this->data) && $this->data->structure)\n $structure = $this->data->structure;\n else\n $structure = $this->structure;\n\n $styleTableHead = $this->styleObj->getHeaderStyle();\n\n $margins = $this->getPageMargins();\n $margins->setTop(1);\n $margins->setRight(0.75);\n $margins->setLeft(0.75);\n $margins->setBottom(1);\n\n foreach ($structure as $key => $data) {\n\n $cPos = ($this->posX.$this->posY);\n\n $this->setCellValueExplicit($cPos, $data[self::LABEL], PHPExcel_Cell_DataType::TYPE_STRING );\n\n if (isset($data[self::WIDTH]))\n $this->getColumnDimension($this->posX)->setWidth($data[self::WIDTH]);\n\n // autofilter für alle spalten aktivieren\n\n //$this->freezePane($cPos);\n\n $this->posX++;\n\n }\n\n //$this->freezePane('A1');\n $this->freezePane('A2');\n $this->freezePane('A3');\n\n $this->decX();\n\n //styling des headers anpassen\n $this->getStyle(\"A{$this->posY}:\".$this->posX.$this->posY)->applyFromArray($styleTableHead);\n $this->posY ++;\n\n $this->setAutoFilter(\"A{$this->posY}:\".$this->posX.$this->posY);\n $this->posY ++;\n\n $this->resetX();\n\n }",
"public function Header() {\n $this->imprime($this->format['header']);\n }",
"protected function getRowHeader()\n\t\t{\n\t\t\t// create header node\n\t\t\t$tr = new \\System\\XML\\DomObject( 'tr' );\n\n\t\t\t// list item\n\t\t\tif( $this->valueField && $this->showList ) {\n\n\t\t\t\t// create column node (field)\n\t\t\t\t$th = new \\System\\XML\\DomObject( 'th' );\n\n\t\t\t\t// set column attributes\n//\t\t\t\t$th->setAttribute( 'class', 'listcolumn' );\n\t\t\t\t$th->innerHtml .= $this->listName;\n\n\t\t\t\tif( $this->multiple )\n\t\t\t\t{\n\t\t\t\t\t$input = new \\System\\XML\\DomObject( 'input' );\n\t\t\t\t\t$input->setAttribute( 'type', 'checkbox' );\n\t\t\t\t\t$input->setAttribute( 'onclick', 'Rum.gridViewSelectAll(\\''.$this->getHTMLControlId().'\\');' );\n\t\t\t\t\t$input->setAttribute( 'id', $this->getHTMLControlId() . '__selectall' );\n\t\t\t\t\t$input->setAttribute( 'name', $this->getHTMLControlId() . '__selectall' );\n\n\t\t\t\t\t// add input to th\n\t\t\t\t\t$th->addChild( $input );\n\t\t\t\t}\n\n\t\t\t\t// add thead to table\n\t\t\t\t$tr->addChild( $th );\n\t\t\t}\n\n\t\t\t// loop through each column\n\t\t\tforeach( $this->columns as $column )\n\t\t\t{\n\t\t\t\t// create column node\n\t\t\t\t$th = new \\System\\XML\\DomObject( 'th' );\n\n\t\t\t\t// set data-field attributes\n\t\t\t\tif($column->dataField) {\n\t\t\t\t\t$th->setAttribute( 'data-field', $column->dataField );\n\t\t\t\t}\n\n\t\t\t\t// set class\n\t\t\t\tif($column['Classname']) {\n\t\t\t\t\t$th->setAttribute( 'class', $column['Classname'] );\n\t\t\t\t}\n\n\t\t\t\t// get class based on sort field and order\n\t\t\t\t$class = '';\n\t\t\t\t$title = 'Sort ascending';\n\t\t\t\tif( $this->sortBy === $column['DataField'] ) {\n\t\t\t\t\tif( $this->sortOrder=='desc' ) {\n\t\t\t\t\t\t$class = 'sort_desc';\n\t\t\t\t\t\t$title = 'Sort ascending';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$class = 'sort_asc';\n\t\t\t\t\t\t$title = 'Sort descending';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// column is canSort\n\t\t\t\tif( $this->canSort && !$this->canChangeOrder && $column['DataField'] )\n\t\t\t\t{\n\t\t\t\t\t$a = new \\System\\XML\\DomObject( 'a' );\n\n\t\t\t\t\t// set column attributes\n\t\t\t\t\t$a->innerHtml .= $column['Header-Text'];\n\t\t\t\t\tif( $class ) $a->setAttribute( 'class', $class );\n\t\t\t\t\t$a->setAttribute( 'title', $title );\n\n\t\t\t\t\t// generate sort URL\n\t\t\t\t\tif(( $this->sortBy === $column['DataField'] ) && $this->sortOrder=='asc' ) {\n\t\t\t\t\t\t$order = \"desc\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$order = \"asc\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$a->setAttribute( 'href', $this->getQueryString($this->getHTMLControlId().'__page='.$this->page.'&'.$this->getHTMLControlId().'__sort_by='.($column['DataField']).'&'.$this->getHTMLControlId().'__sort_order='.$order));\n\n\t\t\t\t\t// add link node to column\n\t\t\t\t\t$th->addChild( $a );\n\t\t\t\t}\n\n\t\t\t\t// column is not canSort\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// set column attributes\n\t\t\t\t\t$th->innerHtml .= ($column['Header-Text']?$column['Header-Text']:' ');\n\t\t\t\t}\n\n\t\t\t\t// add column to header\n\t\t\t\t$tr->addChild( $th );\n\t\t\t}\n\n//\t\t\tif($this->canChangeOrder)\n//\t\t\t{\n//\t\t\t\t$th = new \\System\\XML\\DomObject('th');\n//\t\t\t\t$th->setAttribute( 'class', 'movecolumn' );\n//\t\t\t\t$tr->addChild( $th );\n//\t\t\t}\n\n\t\t\treturn $tr;\n\t\t}",
"public function getTableHeadFooter() {\n if ($this->hf_content) {\n return $this->hf_content;\n }\n\n ob_start(); // intended only to capture echoed string\n ?>\n <tr class=\"\">\n <?php if($this->support['column_checkable']) : ?>\n <th class=\"th-small check-column <?php echo $this->getColumnsClasses(\"column_checkable\"); ?>\">\n <?php // Just call the default colSetHeaderCheckable ?>\n <div>\n <?php $this->colSetHeaderCheckable(); ?>\n </div>\n </th>\n <?php endif; ?>\n\n <?php // Start constructing the table header columns ?>\n <?php foreach($this->columns as $column_key => $column_data) : ?>\n <?php $sortable_class = $this->getSortableClass($column_key,$column_data); ?>\n <th data-column-name=\"<?php echo $column_key; ?>\" class=\"header <?php echo $sortable_class; ?> <?php echo $this->getColumnsClasses($column_key); ?>\" >\n <?php $this->getSortableLinkStart($column_key,$column_data); ?>\n <?php\n // get content or display from the child column\n // example: colSetHeaderColumnName\n $key_col_method = $this->toCamel('col_set_header_' . $column_key);\n // class if has a child method defined for the column header method\n // else display the set label of this column\n if (method_exists( $this,$key_col_method)){\n $this->{$key_col_method}($column_key,$column_data);\n } else {\n echo $column_data['label'];\n }\n ?>\n <?php $this->getSortableLinkEnd($column_key,$column_data); ?>\n </th>\n <?php endforeach; ?>\n\n <?php // Add action if the child is set to be having an action column ?>\n <?php if($this->support['action']) : ?>\n <th class=\"header <?php echo $this->getColumnsClasses(\"action\"); ?>\">\n <?php // $this->colSetHeaderAction(); ?>\n </th>\n <?php endif; ?>\n </tr>\n\n <?php\n\n $markup = ob_get_clean();\n\n $this->hf_content = $markup;\n\n return $this->hf_content;\n }",
"function sorted_table_header($sb,$so,$keyname,$title,$extra_args=null,$th_extra=\"\",$url=\"\"){\n\n\tif($url==\"\")\n\t\t$theurl=get_current_page();\n\telse\n\t\t$theurl=$url;\n\n\t$classes=\"sort-header\";\n\t$args=\"sortby=\".urlencode($keyname);\n\tif($sb==$keyname){\n\t\tif($so==\"asc\"){\n\t\t\t$classes.=\" headerSortDown\";\n\t\t\t$newsortorder=\"desc\";\n\t\t\t}\n\t\telse if($so==\"desc\"){\n\t\t\t$classes.=\" headerSortUp\";\n\t\t\t$newsortorder=\"asc\";\n\t\t\t}\n\t\t$args.=\"&sortorder=\".$newsortorder;\n\t\t}\n\telse\n\t\t$args.=\"&sortorder=asc\";\n\t\n\tif(have_value($extra_args)){\n\t\tforeach($extra_args as $k => $v){\n\t\t\t$args.=\"&\".urlencode($k).\"=\".urlencode($v);\n\t\t\t}\n\t\t}\n\t$output=\"<th class='\".$classes.\"' \".$th_extra.\"><a href='\".$theurl.\"?\".$args.\"'>\".$title.\"</a></th>\";\n\n\treturn $output;\n\t}",
"protected function initHeader()\n {\n if ($this->header === null) {\n $this->header = [\n [\n [\n 'content' => $this->statusDropdown(),\n 'options' => ['class' => 'col-12 col-md-3'],\n ],\n [\n 'content' => $this->getSearchInput(),\n 'options' => ['class' => 'col-12 col-md-6'],\n ],\n 'options' => [\n 'class' => 'justify-content-between',\n ],\n ],\n ];\n }\n }"
] | [
"0.63478065",
"0.6001",
"0.59020126",
"0.58639634",
"0.580796",
"0.57989085",
"0.5767049",
"0.57531506",
"0.5657948",
"0.5650446",
"0.56401205",
"0.5617188",
"0.5613033",
"0.5608598",
"0.5590316",
"0.5578492",
"0.55773956",
"0.55302423",
"0.5529149",
"0.55004716",
"0.5487515",
"0.548004",
"0.54772884",
"0.54686266",
"0.54220283",
"0.54169774",
"0.5409047",
"0.53997433",
"0.5398207",
"0.5396239"
] | 0.64975005 | 0 |
Allows to assign your own handler to the AddRow function Sometimes you do not want to inherit from this, but create a table and assign the handlers to another object. | function AssignOnAddRow(&$handler,$function)
{
$res = $this->OnAddRow;
$this->OnAddRow = array($handler,$function);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function addRowToWriter(Row $row);",
"function rowHandler($row){\n\t\treturn $row;\n\t}",
"function addRow($data, $rowClass = false) {\n\t\t$newRow = new RowData($data, $rowClass);\n\t\t$this->rowList[] = $newRow;\n\t}",
"function AddRow(&$data) { $this->NewRow($data); }",
"public function __invoke(): TableRow\n {\n $namespace = explode('_', $this->class->getName());\n $namespace = array_slice($namespace, 0, 2);\n $module = implode('_', $namespace);\n\n /** @var BaseTag $eventTags */\n $tags = $this->docBlock->getTagsByName(self::TAG_NAME);\n $eventTags = reset($tags);\n\n return new TableRow(\n $eventTags->getDescription(),\n \"{$module}::{$this->method->getName()}\",\n $this->formatRepoUrl(),\n \"{$this->docBlock->getSummary()} {$this->docBlock->getDescription()}\"\n );\n }",
"public function createRow(){\n $row = $this->DOM->createElement(\"tr\");\n // Cria elemento\n $row = new Widget($row);\n // Adiciona a linha na tabela\n $this->addElement($row);\n return $row;\n }",
"function callbackAddRow($button) {\n $button->hide();\n $this->table->remove($button);\n $name = 'row'.$this->rows;\n $this->fields[$name] = new Gtk_MDB_Designer_Interface_Column;\n $this->fields[$name]->type = 'text';\n $this->fields[$name]->buildWidgets($this,$this->rows);\n $this->rows++;\n \n $this->table->attach( $button,\n 1,10 ,\n $this->rows,$this->rows+1,\n GTK_FILL, // xdir\n GTK_SHRINK // ydir\n );\n $button->show();\n \n \n }",
"protected abstract function handleRow($row, User $user);",
"function table_row($row, $row_key, $data, $class=\"\") \n {\n global $debug;\n \n if ($debug)\n printf(\"<p>table_row()<br>\\n\");\n\n $d = $this->select_colnames($data); \n if ($this->edit) $this->table_form_start($this->edit);\n $this->table_row_open($row, $d, $class); \n\n $this->set_checkbox($row, $row_key, $data, $class);\n $this->show_table_cells($row, $row_key, $data, $class);\n\n if (!count($this->same_data)) { # first row\n $this->same_data = $data;\n } else {\n foreach ($data as $k=>$v) if ($this->same_data[$k] <> $data[$k]) $this->same_data[$k]=false;\n }\n\n # call virtual function\n if ($this->add_extra)\n $this->table_row_add_extra($row, $row_key, $data, $class);\n\n $this->table_row_close($row, $class);\n if ($this->edit) $this->table_form_finish($this->edit);\n }",
"function add_row($row)\r\n {\r\n if (!is_object($row))\r\n die(\"invalid argument in add_row()\");\r\n\r\n $this->row[$this->number_of_rows] = $row;\r\n\r\n $this->number_of_rows++;\r\n }",
"public function getRowInitCallback()\n {\n return \"function( grid, row ) {\n Element.observe(row,'mouseover',function(event) {\n Element.addClassName(this,'on-mouse');\n }.bindAsEventListener(row));\n }\";\n }",
"public function __construct(Row $row = null)\n {\n $this->addRow($row);\n }",
"function table_row_add_extra($row, $row_key, $data, $class=\"\")\n {\n\tglobal $debug, $sess;\n\n\tif (($this->add_extra=='on') or ($this->add_extra===true)) $this->add_extra = $_SERVER[\"PHP_SELF\"];\n\n\t$count = 0;\n if (is_array($this->add_extra)) {\n\t\t$default_target = $_SERVER[\"PHP_SELF\"];\n $ae = $this->add_extra;\n } else {\n\t\t$default_target = $this->add_extra;\n $ae = array(\"View\",\"Edit\",\"Delete\");\n }\n foreach($ae as $k=>$v) {\n\n if (is_array($v)) $cmd=$k; else { $cmd=$v; $v=array(); }\n\t\t\n\t\tif ($cmd==\"View\") $default_perm = true; \n\t\telse $default_perm = $sess->have_edit_perm();\n\n // If there is no value use this otherwise use value given\n $target = empty($v[\"target\"]) ? $default_target\t: $v[\"target\"];\n $key = empty($v[\"key\"]) ? $this->primary_field : $v[\"key\"];\n\t\t$add\t = empty($v[\"add\"]) ? false\t\t\t: $v[\"add\"];\n $display = empty($v[\"display\"]) ? strtolower($cmd)\t: $v[\"display\"];\n $class = empty($v[\"class\"]) ? \"ae_$display\" : $v[\"class\"];\n $title = empty($v[\"title\"]) ? $display\t : $v[\"title\"];\n $perm = empty($v[\"perm\"]) ? $default_perm\t\t: $v[\"perm\"];\n\t\tswitch ($display) {\n\t\t\tcase \"email_attach\": $icon = \"icon-envelope\"; break;\n\t\t\tcase \"refund\": $icon = \"icon-step-backward\"; break;\n\t\t\tcase \"boot\": $icon = \"icon-eject\"; break;\n\t\t\tcase \"process\": $icon = \"icon-play-circle\"; break;\n\t\t\tcase \"copy\": $icon = \"icon-share\"; break;\n\t\t\tcase \"view\": $icon = \"icon-search\"; break;\n\t\t\tcase \"delete\": $icon = \"icon-trash\"; break;\n\t\t\tdefault: $icon = \"icon-\".$display; break;\n\t\t}\n\t\tif (strlen($perm)>2) {\n\t\t\t$perm = $sess->have_perm($perm); // convert string question to boolean answer.\n\t\t}\n\t\tif ($key)\n\t\tif ($perm) {\n\t\t\tif ($count==0) echo \" <td class='ae' nowrap>\"; else echo \" \";\n\t\t\t$count++;\n\t\t\tif ($add) {\n\t\t\t\techo \"\\n <a class='$class' href='$target\";\n\t\t\t\techo $data[$add];\n\t\t\t} else {\n\t\t\t\techo \"\\n <a class='$class' href='\".$sess->url($target);\n\t\t\t\techo @$sess->add_query(array(\"cmd\"=>$cmd,$this->primary_key=>$data[$key]));\n\t\t\t}\n\t\t\techo \"' title='$title' key='$key'><i class='$icon'></i> $display</a>\";\n\t\t}\n }\n if ($this->edit) {\n echo \"\\n <input type='submit' value='Save' name='submit' class='ipeh'> \";\n echo \"\\n <input type='hidden' value='\".$data[$this->primary_key].\"' name='id'> \";\n }\n\n\tif ($debug) echo \"\\n <!-- hidden start -->\";\n\tif ($this->all_fields) $this->add_hidden_fields($row, $row_key, $data, $class);\n\tif ($debug) echo \"\\n <!-- hidden end -->\";\n\tif ($count) echo \"\\n </td>\\n\";\n }",
"public function init(){\n\t\t$converted = Go_Misc::singular( str_replace( \"_DbTable\", \"\", get_called_class() ) );\n\t\t$converted = !class_exists( $converted ) ||\n\t\t \t\t\t 'Go_Db_Table' == $converted\n\t\t\t\t ? \"Zend_Db_Table_Row\"\n\t\t\t\t : $converted;\n\t\t$this->setRowClass( $converted );\n\t\tparent::init();\n\t}",
"public function add_row($row){\r\n\t\t$this->config['TYPE'] = 'NORMAL';\r\n\t\t$items = (array) null;\r\n\t\tforeach($row->controls as $control){\r\n\t\t\tarray_push($items,$control['object']->draw());\r\n\t\t}\r\n\t\tarray_push($this->config['ROWS'],$items);\r\n\t\t\r\n\t}",
"function AddRow($row, $attribs = null)\r\n\t{\r\n\t\t$this->rows[] = $row;\r\n\t\t$this->rowattribs[] = $attribs;\r\n\t}",
"protected function _addRow($row){\n\t\t$this->_renderRow($row);\n\t}",
"function AsTableRow() {\n\t\treturn \"<tr class=\\\"addrow\\\">{$this->CellFields()}<td class=\\\"actions\\\">{$this->CellActions()}</td></tr>\";\n\t}",
"function addRowObj($rowDataObj)\n\t{\n\t\t$this->rowList[] = $rowDataObj;\n\t}",
"public function add(object $handler): self;",
"public function onAddRow()\n {\n \n return true;\n }",
"public function addRow($tableName, array $fieldValues, $isRelation = false);",
"function &add_row($name = null) {\n if (!$name) {\n $name = uniqid(microtime(true), true);\n }\n $this->rows[$name] = new KHtml_Table_Row();\n return $this->rows[$name];\n }",
"public function addRow(Row $row)\n {\n $this->row = $row;\n }",
"public function rowClass () {\n }",
"public function add($name, $handler){ }",
"public function addRowCallback($function, $args = null)\n\t{\n\t\tif (func_num_args() > 2) {\n\t\t\t$argv = func_get_args();\n\t\t\t$args = array_merge(array($args), array_slice($argv, 2));\n\t\t}\n\t\t$f = array();\n\t\t$f['type'] = 'function';\n\t\t$f['func'] = $function;\n\t\t$f['params'] = is_array($args) ? $args : array($args);\n\t\t$this->rowCallback[] = $f;\n\t\treturn $this;\n\t}",
"function addEventHandler($event_name, $handler_class, $handler_method, $include_path=null, $sort_order=null)\n {\n $tables = EventsManager::getTables();\n $tbl_events = $tables['events_manager']['columns'];\n\n $query = new DB_Replace('events_manager');\n $query->addReplaceValue($event_name, $tbl_events['event_name']);\n $query->addReplaceValue($handler_class, $tbl_events['handler_class']);\n $query->addReplaceValue($handler_method, $tbl_events['handler_method']);\n\n if ($sort_order != null)\n $query->addReplaceValue($sort_order, $tbl_events['handler_order']);\n\n if ($include_path != null)\n $query->addReplaceValue($include_path, $tbl_events['handler_include_path']);\n\n global $application;\n $application->db->PrepareSQL($query);\n $application->db->DB_Exec();\n }",
"function AggregateListRow() {\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}",
"public function addRow($rowName) {\n return $this->tbody->addRow($rowName);\n }"
] | [
"0.6476231",
"0.6450211",
"0.60069776",
"0.59901905",
"0.5948002",
"0.59412867",
"0.592119",
"0.58744437",
"0.5814176",
"0.5787634",
"0.5779409",
"0.5778346",
"0.5774217",
"0.57673216",
"0.5742242",
"0.5730625",
"0.57102954",
"0.57074773",
"0.57021827",
"0.5667342",
"0.5662767",
"0.5656183",
"0.56231153",
"0.5601325",
"0.5585521",
"0.5570862",
"0.555186",
"0.552047",
"0.5510951",
"0.5433274"
] | 0.66914016 | 0 |
Allows to assign your own handler to the AddFooter function Sometimes you do not want to inherit from this, but create a table and assign the handlers to another object. | function AssignOnAddFooter(&$handler,$function)
{
$res = $this->OnAddFooter;
$this->OnAddFooter = array($handler,$function);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function initFooter()\n {\n if ($this->footer === null) {\n $this->footer = [\n [\n [\n 'content' => $this->getCreateEntryButton() . ($this->showSelection ? $this->getSelectionButton() : ''),\n 'options' => ['class' => 'col'],\n ],\n ],\n ];\n }\n }",
"public function setFooter(HeaderFooter $footer);",
"protected function initFooter()\n {\n if ($this->footer === null) {\n $this->footer = [\n [\n [\n 'content' => $this->getCreateProductButton(),\n 'options' => ['class' => 'col'],\n ],\n [\n 'content' => $this->getUpdateAllProductsButton(),\n 'options' => ['class' => 'col text-right'],\n ],\n ],\n ];\n }\n }",
"function AddFooter($keys)\n\t{\n\t\t$foot = array_combine($keys,$keys);\n\t\t$this->Footer()->NewRow($foot);\n\t}",
"function &addFooter($type = 'all') {\r\n\t \tif (empty($this->oddEvenDifferent) && $type == 'all') {\r\n\t\t $footer = new Footer($this, $type);\r\n\t\t} else if (!empty($this->oddEvenDifferent) \r\n\t\t\t\t\t&& ($type == 'left' || $type == 'right')) {\t\t \r\n\t\t \t$footer = new Footer($this, $type);\t\r\n\t\t} else if ($type == 'first') {\r\n\t\t \t$footer = new Footer($this, $type);\t\r\n\t\t \t$this->titlepg = 1;\r\n\t\t} else {\t\t\t\t\r\n\t\t \treturn;\r\n\t\t}\t\t \r\n\t\r\n\t\t$this->footers[$type] = &$footer;\r\n\t\treturn $footer;\t\t\r\n\t}",
"function setFooter($baseType,$footer='footer'){\n\t\t$this->_footer = $baseType. DS . $footer;\n\t}",
"function Footer() {\n }",
"function Footer() {\n }",
"static function buildFooterNoButtons() {\r\n\t\t echo '<TABLE class=\"italsis\">';\r\n\t\t echo '<TR>';\r\n\t\t echo '<TD> ';\r\n\t\t echo '</TD>';\r\n\t\t echo '</TR>';\r\n\t\t echo '</TABLE>';\r\n\t\t \t\r\n\t\t}",
"function constructorFooter() {\n\t if (DEBUG&&DEBUGLEVEL&1) debug('Start method frontend::constructorFooter()');\n\t global $configINI, $languageXML, $hostname, $table;\n\t $this->site[] = '<TABLE WIDTH=\"100%\" BORDER=\"0\">';\n\t $this->site[] = ' <TR>';\n\t $this->site[] = ' <TD CLASS=\"linkBox\">';\n\t $this->site[] = ' <IMG SRC=\"'.$configINI['global']['images'].$configINI['global']['iconStyle'].'/arrow.png\" BORDER=\"0\">';\n\t $this->site[] = ' <INPUT TYPE=\"checkbox\" NAME=\"checkbox\" VALUE=\"checkbox\" onClick=\"checkAll(\\'yes\\'); return true;\">(Mark all)';\n\t common::showTrapMenuIconFooter(\"mark\");\n\t common::showTrapMenuIconFooter(\"delete\");\n\t common::showTrapMenuIconFooter(\"archive\");\n\t $this->site[] = ' <INPUT TYPE=\"hidden\" NAME=\"oldestfirst\" VALUE=\"'.$_REQUEST['oldestfirst'].'\">';\n\t $this->site[] = ' <INPUT TYPE=\"hidden\" NAME=\"severity\" VALUE=\"'.$_REQUEST['severity'].'\">';\n\t $this->site[] = ' <INPUT TYPE=\"hidden\" NAME=\"category\" VALUE=\"'.$_REQUEST['category'].'\">';\n\t $this->site[] = ' <INPUT TYPE=\"hidden\" NAME=\"hostname\" VALUE=\"'.$_REQUEST['hostname'].'\">';\n\t $this->site[] = ' <INPUT TYPE=\"hidden\" NAME=\"trapSelect\" VALUE=\"'.$_REQUEST['trapSelect'].'\">';\n\t $this->site[] = ' </TD>';\t \n\t $this->site[] = ' </TR>';\n\t $this->site[] = '</TABLE>';\n\t $this->site[] = '</FORM>';\n\t if (DEBUG&&DEBUGLEVEL&1) debug('End method frontend::constructorFooter()');\n\t}",
"public function initFooter() {\n if (self::$_footer) {\n $this->partial(self::$_footer);\n }\n }",
"protected function getRowFooter( )\n\t\t{\n\t\t\t// create footer node\n\t\t\t$tr = new \\System\\XML\\DomObject( 'tr' );\n\n\t\t\t// set row attributes\n\t\t\t$tr->setAttribute( 'class', ($this->dataSource->cursor % 2)?'footer row_alt':'footer row' );\n\n\t\t\t// add blank listcolumn\n\t\t\tif( $this->valueField && $this->showList ) {\n\t\t\t\t$td = new \\System\\XML\\DomObject( 'td' );\n\t\t\t\t$tr->addChild( $td );\n\t\t\t}\n\n\t\t\t// loop through each column\n\t\t\tforeach( $this->columns as $column )\n\t\t\t{\n\t\t\t\t// create column node\n\t\t\t\t$td = new \\System\\XML\\DomObject( 'td' );\n\n\t\t\t\t// set column attributes\n\t\t\t\tif( $column['Classname'] ) {\n\t\t\t\t\t$td->setAttribute( 'class', $column['Classname'] );\n\t\t\t\t}\n\n\t\t\t\tif( $column['Footer-Text'] ) {\n\t\t\t\t\t$html = $column['Footer-Text'];\n\t\t\t\t\t$footerText = '';\n\t\t\t\t\tif(false === eval(\"\\$footerText ={$html};\")) {\n\t\t\t\t\t\tthrow new \\System\\Base\\InvalidOperationException(\"Could not run expression in GridView on column `\".$column[\"DataField\"].\"`: \\$html = \" . ($html) . ';');\n\t\t\t\t\t}\n\t\t\t\t\t$td->innerHtml .= $footerText;\n\t\t\t\t}\n\n\t\t\t\t$tr->addChild( $td );\n\t\t\t}\n\n\t\t\treturn $tr;\n\t\t}",
"function registerDynamicFooter() {\n\t\t \n\t\t $footer_layout = get_option(SN.\"_footer_layout\");\n\t\t\n\t\t $count = 4;\n\t\t switch($footer_layout)\n\t\t {\n\t\t\t case \"two-col\" : $count = 2 ; break;\n\t\t\t case \"three-col\" : $count = 3 ; break;\n\t\t\t case \"four-col\" : $count = 4 ; break;\n\t\t\t case \"five-col\" : $count = 5 ; break;\n\t\t\t case \"six-col\" : $count = 6 ; break;\n\t\t\t case \"one-third\" : $count = 2 ; break;\n\t\t\t case \"one-fourth\" : $count = 2 ; break;\n\t\t\t case \"one-fifth\" : $count = 2 ; break;\n\t\t\t case \"one-sixth\" : $count = 2 ; break;\n\t\t\t default : $count = 4;\n\n\t\t }\n\t\t \n\t\tfor($i=1;$i<=$count;$i++)\n\t\t {\n\t\t $sidebar = array(\n\t\t\t\t\t\t'name' => (\"Footer Column $i\"),\n\t\t\t\t\t\t'id' => \"footer_column_\".$i ,\n\t\t\t\t\t\t'description' => __('Widgets will be shown in the footer.', 'ioa'),\n\t\t\t\t\t\t'before_widget' => '<div class=\"footer-wrap %2$s clearfix\">',\n\t\t\t\t\t\t'after_widget' => '</div>',\n\t\t\t\t\t\t'before_title' => '<h3 class=\"custom-font footer-heading\">',\n\t\t\t\t\t\t'after_title' => '</h3><span class=\"spacer\"></span>',\n\t\t\t\t\t );\t \n \n\t\t register_sidebar($sidebar);\n\t\t \n\t\t }\n }",
"public function displayFooter()\n\t{\n\t}",
"function drawFooter()\n\t{\n\t\treturn '\n\t\t\t<tr >\n\t\t\t\t<td colspan=5 height=10 align=\"right\" style=\"color: white; background-color: #749ABE;\">\n\t\t\t\t</td>\n\t\t\t\t\n\t\t\t\t<td style=\"display: none;\"> /* must reload here */\t\t\t\t\t\t\t\t\n\t\t\t\t[ticket_sum.field]\n\t\t\t</tr>\n\t\t\t\n\t\t </table>';\n\t}",
"public function setFooter($callback)\n {\n $this->_footerCallback = $callback;\n }",
"function Footer()\r\n {\r\n $this->SetXY( - 10, - 5);\r\n $this->line(10, $this->GetY() - 2, $this->GetX(), $this->GetY() - 2);\r\n $this->SetX(0);\r\n $this->SetFont('Arial', 'I', 6);\r\n $this->Cell(200, 1, \"ManagerTEX (NFe 3.10) - www.datatex.com.br\", $borda, 0, 'R');\r\n }",
"public function getFooterContent();",
"public function Footer() {\n $this->imprime($this->format['footer']);\n }",
"public function resetFooter();",
"static public function _global_foot()\n {\n // must be creating or editing a post or page\n if ( ! self::_is_post() AND ! self::_is_page()) return;\n\n ?>\n <script type=\"text/javascript\">\n /* <![CDATA[ */\n (function($){ /* not using jQuery ondomready, code runs right away in footer */\n\n /* use a global dom element to attach events to */\n $.wpalchemy = $('<div></div>').attr('id','wpalchemy').appendTo('body');\n\n })(jQuery);\n /* ]]> */\n </script>\n <?php\n }",
"final public function footer_wrap() {\n\t\techo '<footer class=\"tsfem-footer-wrap tsfem-disable-cursor\">';\n\t\t\\do_action( 'tsfem_footer' );\n\t\techo '</footer>';\n\t}",
"protected function addFooter($value) {\n\t\t$this->add_footer = $value;\n\t}",
"function makefooter( )\n\t{\n\t\tglobal $template, $board_config, $basic_lang;\n\t\t\n\t\t// load the template file\n\t\t$filename = 'footer' . tplEx;\n\t\t$template->assign_files( array(\n\t\t\t'footer' => $filename\n\t\t) );\n\t\t\n\t\t// maket the stats\n\t\t$stats = $this->getstats();\n\t\t$template->assign_var_levels( '', 'FOOT', array(\n\t\t\t'STATS' => sprintf( $basic_lang[ 'Bottom_stats' ], $stats[ 'time' ], $stats[ 'queries' ] ),\n\t\t\t'COPYRIGHT' => $this->copyright,\n\t\t\t'DRAG_LIST' => ( !empty( $this->drag_list ) ) ? ', ' . $this->drag_list : $this->drag_list,\n\t\t) );\n\t\t\n\t\t// output it\n\t\t$template->output( 'footer' );\n\t}",
"public function composeFooter()\n {\n }",
"protected function renderFooter(End $event): void\n {\n }",
"public function getFooter()\r\n \t{\r\n \t\t// The instructions stored in footer module\r\n \t\t// so include footer module to execute these inctructions\r\n \t\tinclude('modules/footer.module.php');\r\n \t\t\r\n \t\t// Get the name of class\r\n $footer_name = FOOTER_NAME;\r\n \r\n // Make a new object\r\n $footer_name = new $footer_name;\r\n \r\n // Execute inctructions\r\n $footer_name->run();\r\n \t}",
"function footer(){\n\n\t\t$str = '<table cellpadding=\"5\" cellspacing=\"0\" width=\"100%\" class=\"page_break\"><tr>';\n\n\t\tif($this->delete_all){\n\n\t\t\t$str .= '<td width=\"150\">';\n\t\t\t$str .= '<button class=\"btn btn-sm btn-danger\" onclick=\"if (confirm(\\'' . str_replace(\"'\",\"\\'\",translate_text(\"Bạn có chắc chắn muốn xóa những bản ghi đã chọn ?\")) . '\\')){ deleteall(' . $this->total_list . '); }\">' . translate_text(\"Xóa bản ghi đã chọn\") . '</button>';\n\t\t\t$str .= '</td>';\n\t\t\t$str .= '<td width=\"150\">';\n\t\t\t$str .= '' . translate_text(\"Tổng số bản ghi\") . ' : ';\n\t\t\t$str .= '<span id=\"total_footer\">' . formatCurrency($this->total_record). '</span>';\n\t\t\t$str .= '</td>';\n }\n\t\t$str .= '<td>';\n\t\t$str .= $this->generate_page();\n\t\t$str .= '</td>';\n\t\t$str .= '</tr></table>';\n\t\treturn $str;\n\n\t}",
"function Footer()\n\t\t{\n\t\t\t$this->SetY(-15);\n\t\t\t//Arial italic 8\n\t\t\t$this->SetFont('Helvetica','I',8);\n\t\t\t//Page number\n\t\t\t$this->Cell(0,10,'Page '.$this->PageNo().'/BDmaxOnline','T',0,'C');\n\t\t\t$this->SetDrawColor(8, 102, 198);\n\t\t\tparent::Footer();\n\t\t}",
"function Footer()\n {\n\t $this->SetY(-15);\n\t // Arial italic 8\n\t if ( $this->PageNo()%2 != 0 ){ //footer for page 1\n\t $this->SetFont('Arial','B',13);\n\t $this->Cell(120,10,'Date of issue:',0,0);\n\t \n\t $this->Cell(40,10,'Dean(Examination Affairs)',0,1);\n\t }\n\t\t else if($this->PageNo()%2 == 0){\n\t\t\t $this->SetFont('Arial','B',13);\n\t\t\t $this->Cell(120,10,'Prepared By:',0,0);\n\t\t\t $this->Cell(60,10,'Verified By:',0,1);\n\t\t\t }\n\t }"
] | [
"0.6358415",
"0.63334125",
"0.602484",
"0.5955423",
"0.5932365",
"0.5927288",
"0.5909441",
"0.5909441",
"0.5772083",
"0.57615554",
"0.5754269",
"0.5728409",
"0.57168365",
"0.5713769",
"0.57099605",
"0.5697032",
"0.56466484",
"0.56453013",
"0.56400687",
"0.5632586",
"0.56300557",
"0.56114453",
"0.55613714",
"0.5551385",
"0.5542765",
"0.55413383",
"0.5526293",
"0.55130446",
"0.5512687",
"0.5494839"
] | 0.6505203 | 0 |
Default AddRow method This will be called for each row to add (from the execution routines). If you override this in derivered classes you can easily react on that. Uses () internally | function AddRow(&$data) { $this->NewRow($data); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onAddRow()\n {\n \n return true;\n }",
"function AddRow() {\n return++$this->row_count;\n }",
"protected function _addRow($row){\n\t\t$this->_renderRow($row);\n\t}",
"function AddRow($row, $attribs = null)\r\n\t{\r\n\t\t$this->rows[] = $row;\r\n\t\t$this->rowattribs[] = $attribs;\r\n\t}",
"function addRow($data, $rowClass = false) {\n\t\t$newRow = new RowData($data, $rowClass);\n\t\t$this->rowList[] = $newRow;\n\t}",
"abstract protected function addRowToWriter(Row $row);",
"function &add_row($name = null) {\n if (!$name) {\n $name = uniqid(microtime(true), true);\n }\n $this->rows[$name] = new KHtml_Table_Row();\n return $this->rows[$name];\n }",
"function _build_row_add()\n{\n\treturn $this->_build_row_common();\n}",
"function add_row($row)\r\n {\r\n if (!is_object($row))\r\n die(\"invalid argument in add_row()\");\r\n\r\n $this->row[$this->number_of_rows] = $row;\r\n\r\n $this->number_of_rows++;\r\n }",
"function &addRow($name = null) {\n if (!$name) {\n $name = uniqid(microtime(true), true);\n }\n $this->rows[$name] = new TableRow();\n return $this->rows[$name];\n }",
"function AggregateListRow() {\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}",
"public function addRow($rowName) {\n return $this->tbody->addRow($rowName);\n }",
"public function addRow(Row $row)\n {\n $this->row = $row;\n }",
"public function addRow($row) {\n if (!empty($row)) {\n $this->rows[] = new Row($row);\n }\n }",
"public function __construct(Row $row = null)\n {\n $this->addRow($row);\n }",
"public function addRow($rowData)\n {\n $this->rows[] = $rowData;\n return $this;\n }",
"function addRowObj($rowDataObj)\n\t{\n\t\t$this->rowList[] = $rowDataObj;\n\t}",
"public function add_row($row){\r\n\t\t$this->config['TYPE'] = 'NORMAL';\r\n\t\t$items = (array) null;\r\n\t\tforeach($row->controls as $control){\r\n\t\t\tarray_push($items,$control['object']->draw());\r\n\t\t}\r\n\t\tarray_push($this->config['ROWS'],$items);\r\n\t\t\r\n\t}",
"public function addRows(array $rows);",
"public function aggregateListRow()\n {\n // Call Row Rendered event\n $this->rowRendered();\n }",
"function NewRow()\n {\n if(count($this->Table)==0)\n {\n $this->xpointer=0;\n $this->ypointer=0;\n }\n else \n {\n $this->xpointer=0;\n $this->ypointer++;\n }\n }",
"public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}",
"public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}",
"public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}",
"public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}",
"public function aggregateListRow()\n\t{\n\n\t\t// Call Row Rendered event\n\t\t$this->Row_Rendered();\n\t}",
"public function row();",
"public function row();",
"public function tprint_row_add($data);",
"public function addRow(array $cols = array());"
] | [
"0.71347666",
"0.70340663",
"0.6904401",
"0.68508494",
"0.6745144",
"0.67286086",
"0.66269165",
"0.6612189",
"0.65634257",
"0.65480554",
"0.65223634",
"0.651121",
"0.64974076",
"0.64920783",
"0.6438039",
"0.64116514",
"0.637231",
"0.6358409",
"0.6356143",
"0.6284495",
"0.6283051",
"0.6277264",
"0.6277264",
"0.6277264",
"0.6277264",
"0.6277264",
"0.624094",
"0.624094",
"0.6233348",
"0.621657"
] | 0.723909 | 0 |
Default AddHeader method Creates a table header with the given keys as text. Uses () internally | function AddHeader($keys)
{
$head = array_combine($keys,$keys);
$this->Header()->NewRow($head);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _showtable_headings_callback($row,$key) {\r\n $row[$key]=' ';\r\n return \"<th>\".implode(\"</th><th>\",$row).\"</th>\";\r\n}",
"private function tableHead()\n\t{\n\t\tforeach( $this->data['thead'] as $th )\n\t\t\t$this->thead .= \"<th>$th</th>\";\n\n\t\t$this->thead = '<thead><tr>' .$this->thead .\"</tr></thead>\";\n\t}",
"public function headers()\r\r\n {\r\r\n\r\r\n $names = array(\r\r\n __('Keyword', 'wpsearchconsole'),\r\r\n __('Title', 'wpsearchconsole'),\r\r\n //\t__( 'Link', 'wpsearchconsole' )\r\r\n ); ?>\r\r\n <tr>\r\r\n <?php foreach ($names as $val): ?>\r\r\n <th><?php echo $val; ?></th>\r\r\n <?php endforeach; ?>\r\r\n </tr>\r\r\n <?php\r\r\n }",
"public function drawTableHeader($headers, $classPerColumn) {\n $table = \"<table class='table table-striped table-dark'>\";\n $table .= '<tr>';\n $length = count($headers);\n\n for($i= 0; $i < $length; $i++) {\n $table .= \"<th class='$classPerColumn[$i]'>$headers[$i]</th>\";\n }\n $table .= '</tr>';\n return $table;\n }",
"function columned_table_header_row($values)\n{\n $cells = new Tempcode();\n foreach ($values as $value) {\n $cells->attach(do_template('COLUMNED_TABLE_HEADER_ROW_CELL', array('_GUID' => '5002f54ccddf7259f3460d8c0759fd1a', 'VALUE' => $value)));\n }\n\n return do_template('COLUMNED_TABLE_HEADER_ROW', array('_GUID' => '2f4095b8d30f50f34fdd6acf8dd566b1', 'CELLS' => $cells));\n}",
"private function table_header($p_header, $p_width)\n {\n return str_pad($p_header, $p_width);\n }",
"public function core_show_listing_alerts_table_headers()\n {\n return 'header text';\n }",
"function generate_header() {\n\t\t$return = \"<tr>\";\n\t\t\n\t\t// $link_array = $this->link_array;\n\t\t$link_options = $this->link_options;\n\t\t\n\t\tif (count($this->row_actions) && $this->right_to_left) {\n\t\t\t$return .= \"<th id='th_actions'> </th>\";\n\t\t}\n\t\t\n\t\tforeach($this->columns as $field => $data) {\n\t\t\t\n\t\t\t$return .= \"<th id='th_$field'>\";\n\t\n\t\t\t$link_options['sortby'] = $data->sort_field;\n\t\t\t\n\t\t\t$display = $this->translator->text($data->label);\n\t\t\t\n\t\t\tif ($this->sortable && $display) {\n\t\t\t\t// if this is the currently sorted field, assign the class\n\t\t\t\tif ($this->sort_field == $data->sort_field) {\n\t\t\t\t\tif ($this->sort_dir == 'ASC') {\n\t\t\t\t\t\t$class = \" class='sort_asc'\";\n\t\t\t\t\t\t$link_options['sortdir'] = 'DESC';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$class = \" class='sort_desc'\";\n\t\t\t\t\t\t$link_options['sortdir'] = 'ASC';\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$link_options['sortdir'] = 'ASC';\n\t\t\t\t\t$class = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$return .= \"<a href='\".$this->escape($this->controller->url_for(null, $link_options)).\"' $class>$display</a>\";\n\t\t\t\t\n\t\t\t} elseif (!$display) {\n\t\t\t\t$return .= \" \";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$return .= $display;\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t$return .= \"</th>\";\n\t\t\t\n\t\t}\n\t\t\n\t\tif (count($this->row_actions) && !$this->right_to_left) {\n\t\t\t$return .= \"<th id='th_actions'> </th>\";\t\t\t\n\t\t}\n\t\t\n\t\t$return .= \"</tr>\\n\";\n\t\t\n\t\treturn $return;\t\t\n\t\t\n\t}",
"private function generate_header(): string \n {\n $header = \n '<table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">#</th>\n <th scope=\"col\">Employee Name</th>\n <th scope=\"col\">Salary</th>\n <th scope=\"col\">Age</th>\n </tr>\n </thead>\n <tbody>';\n return $header; \n }",
"function Header()\n{\n\t//Imprime l'en-tête du tableau si nécessaire\n\tif($this->ProcessingTable)\n\t\t$this->TableHeader();\n}",
"function sorted_table_header($sb,$so,$keyname,$title,$extra_args=null,$th_extra=\"\",$url=\"\"){\n\n\tif($url==\"\")\n\t\t$theurl=get_current_page();\n\telse\n\t\t$theurl=$url;\n\n\t$classes=\"sort-header\";\n\t$args=\"sortby=\".urlencode($keyname);\n\tif($sb==$keyname){\n\t\tif($so==\"asc\"){\n\t\t\t$classes.=\" headerSortDown\";\n\t\t\t$newsortorder=\"desc\";\n\t\t\t}\n\t\telse if($so==\"desc\"){\n\t\t\t$classes.=\" headerSortUp\";\n\t\t\t$newsortorder=\"asc\";\n\t\t\t}\n\t\t$args.=\"&sortorder=\".$newsortorder;\n\t\t}\n\telse\n\t\t$args.=\"&sortorder=asc\";\n\t\n\tif(have_value($extra_args)){\n\t\tforeach($extra_args as $k => $v){\n\t\t\t$args.=\"&\".urlencode($k).\"=\".urlencode($v);\n\t\t\t}\n\t\t}\n\t$output=\"<th class='\".$classes.\"' \".$th_extra.\"><a href='\".$theurl.\"?\".$args.\"'>\".$title.\"</a></th>\";\n\n\treturn $output;\n\t}",
"public function tableHeader()\n {\n $fields = $this->fillableArray($this->schema);\n \n $cell = File::get($this->path('Templates/View/headerCell.txt')) . \"\\n\";\n\n $rows = str_replace('{{field}}', 'id', $cell);\n\n foreach($fields as $field)\n $rows .= str_replace('{{field}}', trim($field), $cell);\n\n $rows .= str_replace('{{field}}', 'actions', $cell);\n\n return $rows;\n }",
"public function renderTableHeader()\n {\n if(!$this->hideHeader)\n {\n echo \"<thead>\\n\";\n\n if($this->filterPosition===self::FILTER_POS_HEADER)\n $this->renderFilter();\n\n echo \"<tr \".($this->headerCssClass ? \"class='\".$this->headerCssClass.\"'\" : '').\">\\n\";\n foreach($this->columns as $column)\n $column->renderHeaderCell();\n echo \"</tr>\\n\";\n\n if($this->filterPosition===self::FILTER_POS_BODY)\n $this->renderFilter();\n\n echo \"</thead>\\n\";\n }\n elseif($this->filter!==null && ($this->filterPosition===self::FILTER_POS_HEADER || $this->filterPosition===self::FILTER_POS_BODY))\n {\n echo \"<thead>\\n\";\n $this->renderFilter();\n echo \"</thead>\\n\";\n }\n }",
"public function column_headers($columns)\n {\n }",
"public function column_headers($columns)\n {\n }",
"public function column_headers($columns)\n {\n }",
"function toHeaderString()\n\t{\t\t\n\t\t$classdata = \"\";\n\t\tif ($this->headerClass) {\n\t\t\t$classdata = 'class=\"'.$this->headerClass.'\"';\n\t\t}\n\t\t\n\t\t$returnString = '<th id=\"'.$this->columnKey.'\" scope=\"col\" '.$classdata.'>'.$this->columnTitle.'</th>';\t\t\n\t\treturn $returnString;\n\t}",
"function createTable($header, $data)\n {\n $this->SetFillColor(255,255,255);\n //$this->SetTextColor();\n $this->SetDrawColor(0,0,128);\n $this->SetLineWidth(.3);\n $this->SetFont('','B');\n // Header\n $w = array(60, 35, 40);\n for($i=0;$i<count($header);$i++)\n $this->Cell($w[$i],7,$header[$i],1,0,'C',true);\n $this->Ln();\n // Color and font restoration\n $this->SetFillColor(224,235,255);\n $this->SetTextColor(0);\n $this->SetFont('');\n // Data\n $fill = false;\n foreach($data as $row)\n {\n $this->Cell($w[0],6,iconv('UTF-8', 'windows-1252', $row[0]),'LR',0,'L',$fill);\n $this->Cell($w[1],6,iconv('UTF-8', 'windows-1252', $row[1]),'LR',0,'R',$fill);\n $this->Cell($w[2],6,$row[2],'LR',0,'R',$fill);\n $this->Ln();\n $fill = !$fill;\n }\n // Closing line\n $this->Cell(array_sum($w),0,'','T');\n }",
"function drawItemsTableHeader() {\n $rgb = $this->convertHTMLColorToDec($this->getBodyFontColor());\n $this->SetTextColor($rgb['R'],$rgb['G'],$rgb['B']);\n \n // remember starting coordinates \n $starting_y = $this->GetY();\n $starting_x = $this->GetX();\n \n $this->SetFont('','B',$this->font_size);\n if (is_foreachable($this->items_table_column_labels)) {\n $this->Cell($this->getItemsTableColumnWidth(0), $this->line_height+4, $this->items_table_column_labels[0],1,0,'R',true,false);\n \t$this->Cell($this->getItemsTableColumnWidth(1), $this->line_height+4, $this->items_table_column_labels[1],1,0,'L',true,false);\n \t$this->Cell($this->getItemsTableColumnWidth(2), $this->line_height+4, $this->items_table_column_labels[2],1,0,'R',true,false);\n \t$this->Cell($this->getItemsTableColumnWidth(3), $this->line_height+4, $this->items_table_column_labels[3],1,0,'R',true,false);\n \t$this->Cell($this->getItemsTableColumnWidth(4), $this->line_height+4, $this->items_table_column_labels[4],1,0,'R',true,false);\n \t$this->Cell($this->getItemsTableColumnWidth(5), $this->line_height+4, $this->items_table_column_labels[5],1,0,'R',true,false);\n \t$this->Ln();\n } // if\n }",
"public function headers()\r\r\n {\r\r\n\r\r\n $names = array(\r\r\n array(__('Done', 'wpsearchconsole'), 'wpsearchconsole-done-checkbox'),\r\r\n array(__('Priority', 'wpsearchconsole'), 'wpsearchconsole-todo-priority'),\r\r\n array(__('Action', 'wpsearchconsole'), 'wpsearchconsole-todo-action'),\r\r\n array(__('Category', 'wpsearchconsole'), 'wpsearchconsole-todo-category'),\r\r\n array(__('Responsible', 'wpsearchconsole'), 'wpsearchconsole-todo-responsible'),\r\r\n array(__('Due Date', 'wpsearchconsole'), 'wpsearchconsole-todo-due_date'),\r\r\n array(__('Delete', 'wpsearchconsole'), 'wpsearchconsole-todo-delete'),\r\r\n ); ?>\r\r\n <tr>\r\r\n <?php foreach ($names as $val): ?>\r\r\n <th class=\"<?php echo $val[1]; ?>\"><?php echo $val[0]; ?></th>\r\r\n <?php endforeach; ?>\r\r\n </tr>\r\r\n <?php\r\r\n }",
"private function _renderColumnHeaders(){\n\t\t$output = \"<thead>\\n\";\n\t\tforeach($this->getColumnHeaders() as $header){\n\t\t\t$output.=\"<th>$header</th>\\n\";\n\t\t}\n\t\t$output.=\"</thead>\\n\";\n\t\t$this->_appendToOutput($output);\n\t}",
"protected function getTableHeader() {\n\t\t$urlFormat = $this->getUrlFormatForHeader();\n\t\t$iconAsc = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath,\n\t\t\t\t\t\t'gfx/redup.gif', 'width=\"11\" height=\"12\"') .' title=\"ASC\" alt=\"\" />';\n\t\t$iconDesc = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath,\n\t\t\t\t\t\t'gfx/reddown.gif', 'width=\"11\" height=\"12\"') .' title=\"ASC\" alt=\"\" />';\n\t\t$result = '<table cellspacing=\"0\" cellpadding=\"0\" class=\"recordlist\">\n\t\t\t<tr>\n\t\t\t\t<th>\n\t\t\t\t\t<b>' . $GLOBALS['LANG']->getLL('dateAndTime', true) . '</b>\n\t\t\t\t\t<a href=\"' . htmlspecialchars(sprintf($urlFormat, 'date', 'ASC')) . '\">' . $iconAsc . '</a>\n\t\t\t\t\t<a href=\"' . htmlspecialchars(sprintf($urlFormat, 'date', 'DESC')) . '\">' . $iconDesc . '</a>\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\t<b>' . $GLOBALS['LANG']->getLL('title', true) . '</b>\n\t\t\t\t\t<a href=\"' . htmlspecialchars(sprintf($urlFormat, 'title', 'ASC')) . '\">' . $iconAsc . '</a>\n\t\t\t\t\t<a href=\"' . htmlspecialchars(sprintf($urlFormat, 'title', 'DESC')) . '\">' . $iconDesc . '</a>\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\t<b>' . $GLOBALS['LANG']->getLL('text', true) . '</b>\n\t\t\t\t\t<a href=\"' . htmlspecialchars(sprintf($urlFormat, 'text', 'ASC')) . '\">' . $iconAsc . '</a>\n\t\t\t\t\t<a href=\"' . htmlspecialchars(sprintf($urlFormat, 'text', 'DESC')) . '\">' . $iconDesc . '</a>\n\t\t\t\t</h>\n\t\t\t\t<th>\n\t\t\t\t\t<b>' . $GLOBALS['LANG']->getLL('author', true) . '</b>\n\t\t\t\t\t<a href=\"' . htmlspecialchars(sprintf($urlFormat, 'date', 'ASC')) . '\">' . $iconAsc . '</a>\n\t\t\t\t\t<a href=\"' . htmlspecialchars(sprintf($urlFormat, 'date', 'DESC')) . '\">' . $iconDesc . '</a>\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\t<b>' . $GLOBALS['LANG']->getLL('post', true) . '</b>\n\t\t\t\t\t<a href=\"' . htmlspecialchars(sprintf($urlFormat, 'post_title', 'ASC')) . '\">' . $iconAsc . '</a>\n\t\t\t\t\t<a href=\"' . htmlspecialchars(sprintf($urlFormat, 'post_title', 'DESC')) . '\">' . $iconDesc . '</a>\n\t\t\t</th>\n\t\t\t<th><b>' . $GLOBALS['LANG']->getLL('functions', true) . '</b></th>\n\t\t</tr>';\n\t\treturn $result;\n\t}",
"public function tableHeaders(array $names, ?array $trOptions = null, ?array $thOptions = null): string\n {\n $out = [];\n foreach ($names as $arg) {\n if (!is_array($arg)) {\n $content = $arg;\n $attrs = $thOptions;\n } elseif (isset($arg[0], $arg[1])) {\n $content = $arg[0];\n $attrs = $arg[1];\n } else {\n $content = key($arg);\n $attrs = current($arg);\n }\n\n $out[] = $this->formatTemplate('tableheader', [\n 'attrs' => $this->templater()->formatAttributes($attrs),\n 'content' => $content,\n ]);\n }\n\n return $this->tableRow(implode(' ', $out), (array)$trOptions);\n }",
"function table_heading_row($data, $class=\"\") \n {\n if (!is_array($data))\n return;\n\n $d = $this->select_colnames($data);\n\n $row = 0;\n echo \"<thead>\\n\";\n $this->table_row_open($row, $d, $class);\n $this->set_checkbox_heading($class);\n $this->show_table_heading_cells($data, $class);\n\n # call virtual function\n if ($this->add_extra)\n $this->table_heading_row_add_extra($data, $class);\n\n $this->table_row_close(0, $class);\n echo \"</thead>\\n\";\n }",
"public function buildHeader();",
"public function headerRow() {\n\t\tif (!empty($this->collection)) {\n\t\t\treturn $this->Html->tableHeaders(array_keys($this->columns), $this->header_tr_attributes, $this->header_th_attributes);\n\t\t}\t\t\n\t}",
"function AddRowAsHeading($cols)\n {\n $this->NewRow();\n foreach($cols as $value)\n $this->AddCol(\"<h3>\".ucfirst($value).\"</h3>\");\n }",
"public function createheader()\n {\n //\n }",
"protected static function buildTableHeader(array $headers, array $attributes = array()) {\n $str = null;\n $defaultAttributes = array();\n $defaultAttributes['thead'] = array();\n $defaultAttributes['thead_tr'] = array();\n $defaultAttributes['thead_th'] = array();\n $attributes = array_merge($defaultAttributes, $attributes);\n\n $theadAttributes = attributes_to_string($attributes['thead']);\n $theadtrAttributes = attributes_to_string($attributes['thead_tr']);\n $thAttributes = attributes_to_string($attributes['thead_th']);\n\n $str .= '<thead' . $theadAttributes . '>';\n $str .= '<tr' . $theadtrAttributes . '>';\n foreach ($headers as $value) {\n $str .= '<th' . $thAttributes . '>' . $value . '</th>';\n }\n $str .= '</tr>';\n $str .= '</thead>';\n return $str;\n }",
"private function header_string()\n {\n $h=\"\";\n $h.=\"<table class=\\\"schedule\\\">\";\n $h.= \"<tr>\";\n $h.= \"<th>Train Line</th>\";\n $h.= \"<th>Route Name</th>\";\n $h.= \"<th>Run Number</th>\";\n $h.= \"<th>Operator Id</th>\";\n $h.= \"<th class=\\\"delete_row\\\"> </th>\";\n $h.= \"</tr>\";\n return $h;\n }"
] | [
"0.7097439",
"0.68695515",
"0.6773865",
"0.6689488",
"0.6664149",
"0.6635919",
"0.6629145",
"0.65709484",
"0.6557458",
"0.6535122",
"0.6526372",
"0.65135604",
"0.6489941",
"0.64831114",
"0.64831114",
"0.64831114",
"0.646203",
"0.64615893",
"0.6449532",
"0.6425519",
"0.64227325",
"0.6409798",
"0.6409522",
"0.6395255",
"0.63888675",
"0.63740605",
"0.63472396",
"0.6329022",
"0.63122493",
"0.62898827"
] | 0.8020375 | 0 |
Default AddFooter method Creates a table footer with the given keys as text. Uses () internally | function AddFooter($keys)
{
$foot = array_combine($keys,$keys);
$this->Footer()->NewRow($foot);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setFooter(HeaderFooter $footer);",
"public static function Footer($options = [], $data = null) {\n foreach($options as $k => $v) {\n $attr .= $k.'=\"'.$v.'\" ';\n }\n // seta o atributo\n self::$table .= \"<tfooter $attr>$data</tfooter>\";\n }",
"function drawFooter()\n\t{\n\t\treturn '\n\t\t\t<tr >\n\t\t\t\t<td colspan=5 height=10 align=\"right\" style=\"color: white; background-color: #749ABE;\">\n\t\t\t\t</td>\n\t\t\t\t\n\t\t\t\t<td style=\"display: none;\"> /* must reload here */\t\t\t\t\t\t\t\t\n\t\t\t\t[ticket_sum.field]\n\t\t\t</tr>\n\t\t\t\n\t\t </table>';\n\t}",
"function footer(){\n\n\t\t$str = '<table cellpadding=\"5\" cellspacing=\"0\" width=\"100%\" class=\"page_break\"><tr>';\n\n\t\tif($this->delete_all){\n\n\t\t\t$str .= '<td width=\"150\">';\n\t\t\t$str .= '<button class=\"btn btn-sm btn-danger\" onclick=\"if (confirm(\\'' . str_replace(\"'\",\"\\'\",translate_text(\"Bạn có chắc chắn muốn xóa những bản ghi đã chọn ?\")) . '\\')){ deleteall(' . $this->total_list . '); }\">' . translate_text(\"Xóa bản ghi đã chọn\") . '</button>';\n\t\t\t$str .= '</td>';\n\t\t\t$str .= '<td width=\"150\">';\n\t\t\t$str .= '' . translate_text(\"Tổng số bản ghi\") . ' : ';\n\t\t\t$str .= '<span id=\"total_footer\">' . formatCurrency($this->total_record). '</span>';\n\t\t\t$str .= '</td>';\n }\n\t\t$str .= '<td>';\n\t\t$str .= $this->generate_page();\n\t\t$str .= '</td>';\n\t\t$str .= '</tr></table>';\n\t\treturn $str;\n\n\t}",
"function output_footer($footer, $cols)\n {\n $output_html = '';\n $output_html .= '<tr>';\n $output_html .= '<td colspan=\"' . $cols . '\">' . $footer . '</td>';\n $output_html .= '</tr>';\n return $output_html;\n }",
"function output_footer($footer, $cols)\n {\n $output_html = '';\n $output_html .= '<tr>';\n $output_html .= '<td colspan=\"' . $cols . '\">' . $footer . '</td>';\n $output_html .= '</tr>';\n return $output_html;\n }",
"private function generate_footer(): string \n {\n $footer = '</tbody></table>';\n return $footer; \n }",
"public function Footer() {\n // Position at 27 mm from bottom\n $this->SetY(-15);\n // Set font\n $this->SetFont('helvetica', 'I', 8);\n // Page number\n// $this->Cell(0, 10, 'Página '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');\n \n $footer = '<div align=\"center\"><span style=\"color: red;font-size: 1.3em;font-weight: bold;font-variant: small-caps;\">'.$this->footerText.'</span><br><span>'.$this->trans('pequiven_seip.pdf.pageFooter', array('%page%' => $this->getAliasNumPage(),'%totalPage%' => $this->getAliasNbPages()),'PequivenSEIPBundle').'</span></div>';\n $this->writeHTML($footer);\n \n //Línea HR\n $lineRed = array('width' => 1.0, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0));\n if($this->printLineFooter === true){\n $this->Line(0, 190, 300, 190, $lineRed);\n }\n\n }",
"protected function initFooter()\n {\n if ($this->footer === null) {\n $this->footer = [\n [\n [\n 'content' => $this->getCreateEntryButton() . ($this->showSelection ? $this->getSelectionButton() : ''),\n 'options' => ['class' => 'col'],\n ],\n ],\n ];\n }\n }",
"protected static function buildTableFooter(array $footers, array $attributes = array()) {\n $str = null;\n $defaultAttributes = array();\n $defaultAttributes['tfoot'] = array();\n $defaultAttributes['tfoot_tr'] = array();\n $defaultAttributes['tfoot_th'] = array();\n $attributes = array_merge($defaultAttributes, $attributes);\n \n $tfootAttributes = attributes_to_string($attributes['tfoot']);\n $tfoottrAttributes = attributes_to_string($attributes['tfoot_tr']);\n $thAttributes = attributes_to_string($attributes['tfoot_th']);\n \n $str .= '<tfoot' . $tfootAttributes . '>';\n $str .= '<tr' . $tfoottrAttributes . '>';\n foreach ($footers as $value) {\n $str .= '<th' . $thAttributes . '>' . $value . '</th>';\n }\n $str .= '</tr>';\n $str .= '</tfoot>';\n return $str;\n }",
"private function _genFooter($recordCount, $totalAmount) {\n\t\treturn self::FOOTER_RECORD_TYPE . str_pad($recordCount, 6, '0') . str_pad(floor(self::AMOUNT_MULTIPLIER * $totalAmount), 12, '0', STR_PAD_LEFT) . \"0000000000\\r\\n\";\n\t}",
"public function Footer()\n {\n $this->SetY(-25);\n // Set font\n $this->SetFont('times', 'I', 8);\n // Page number\n $this->Cell(0, 10, \"Tierra Fértil - Atención al Ciudadano. Elaborado (\".fechaactual().\") por \".$this->author.\". Página \".$this->getAliasNumPage().\"/\".$this->getAliasNbPages(), 0, 0, 'C');\n\t}",
"function Footer()\n {\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial','',6);\n // Print centered page number\n $this->Cell($this->GetStringWidth('Fisa se completeaza cu litere de tipar') + 7,2,'','T',1);\n $this->Cell(0,3,'Fisa se completeaza cu litere de tipar','',1,'L');\n $this->Cell(0,3,'Codul postal','',1,'L');\n $this->Cell(0,3,'Inclusiv prefixul localitatii','',1,'L');\n\n }",
"public static function footer(){\n\t\tforeach (self::$footer as $footerLine){\n\t\t\techo $footerLine.PHP_EOL;\n\t\t}\n\t}",
"public function testGetFooter()\n {\n $table = $this->getConcreteTableBuilder();\n\n $table->setFooter(array('Foo' => 'Bar'));\n\n $this->assertEquals(array('Foo' => 'Bar'), $table->getFooter());\n }",
"function Footer()\n{\n\t$this->SetY(-20);\n\t// Arial italic 8\n\t$this->SetFont('Arial','I',9);\n\t// Text color in gray\n\t$this->SetTextColor(128);\n\t// Page number\n#\t$this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');\n//\t$this->Cell(0,10,'1800 Century Park East, 2nd Floor - Los Angeles, California 90067 ','','','C');\n//\t$this->Ln(3);\n//\t$this->Cell(0,10,'877-515-4712 Main - 310.861.9051 Fax - www.InitiativeLegal.com ','','','C');\n//\t$this->Ln(4);\n//\t$this->Cell(0,10,'CLIENT INITIALS _______','','','R');\n//\t$this->Ln(9);\n}",
"protected function getRowFooter( )\n\t\t{\n\t\t\t// create footer node\n\t\t\t$tr = new \\System\\XML\\DomObject( 'tr' );\n\n\t\t\t// set row attributes\n\t\t\t$tr->setAttribute( 'class', ($this->dataSource->cursor % 2)?'footer row_alt':'footer row' );\n\n\t\t\t// add blank listcolumn\n\t\t\tif( $this->valueField && $this->showList ) {\n\t\t\t\t$td = new \\System\\XML\\DomObject( 'td' );\n\t\t\t\t$tr->addChild( $td );\n\t\t\t}\n\n\t\t\t// loop through each column\n\t\t\tforeach( $this->columns as $column )\n\t\t\t{\n\t\t\t\t// create column node\n\t\t\t\t$td = new \\System\\XML\\DomObject( 'td' );\n\n\t\t\t\t// set column attributes\n\t\t\t\tif( $column['Classname'] ) {\n\t\t\t\t\t$td->setAttribute( 'class', $column['Classname'] );\n\t\t\t\t}\n\n\t\t\t\tif( $column['Footer-Text'] ) {\n\t\t\t\t\t$html = $column['Footer-Text'];\n\t\t\t\t\t$footerText = '';\n\t\t\t\t\tif(false === eval(\"\\$footerText ={$html};\")) {\n\t\t\t\t\t\tthrow new \\System\\Base\\InvalidOperationException(\"Could not run expression in GridView on column `\".$column[\"DataField\"].\"`: \\$html = \" . ($html) . ';');\n\t\t\t\t\t}\n\t\t\t\t\t$td->innerHtml .= $footerText;\n\t\t\t\t}\n\n\t\t\t\t$tr->addChild( $td );\n\t\t\t}\n\n\t\t\treturn $tr;\n\t\t}",
"function Footer()\n {\n $this->SetY(-35 );\n // Select Arial italic 8\n $this->SetFont('Arial','IB',6);\n \n // Print centered page number\n $this->Cell(10,3,'',0,0,'C');\n $this->Cell(0,3,$this->gerer(\"Conformément aux texte en vigueur, votre echantillons pourra être éliminé et/ou transféré à des fins scientifiques ou des contrôles de qualité, hors génétique humaine, \"),0,1,'C');\n $this->Cell(10,3,'',0,0,'C');\n $this->Cell(0,3,$this->gerer(\" de manière anonyme et respectant le secret medical, sauf opposition formulée auprès de notre secretariat médical\"),0,1,'C');\n $this->SetDrawColor(0,72,0); \n $this->SetLineWidth(0.5); \n $this->Line(20,268, 190, 268);\n\n $this->Ln(5); \n $this->Cell(186,5,'Page '.$this->PageNo(),0,0,'R');\n }",
"function Footer() {\n $this->SetY(-1);\n // Arial italic 8\n $this->SetFont('Arial', NULL, 6.5);\n $this->SetLineWidth(0);\n // Page number\n// $this->Cell(16, .8, 'F71 SISTEMAS WEB - módulo contábil', 'T', 0, 'L');\n $this->Cell(7.25, .8, 'PAY ALL FAST 3.0 - F71 SISTEMAS WEB', 'T', 0, 'L');\n $this->Cell(7.25, .8, 'Módulo Contabilidade - versão 1.0', 'T', 0, 'L');\n $this->Cell(3, .8, 'Página ' . $this->PageNo(), 'T', 0, 'R');\n }",
"function footer(){\n $this->getFooter();\n $tmp = [];\n foreach($this->footer_elements as $key => $value){\n $tmp[] = $value['text'];\n }\n $this->footer = '<div id=\"footer\" class=\"large-12 columns\">';\n $this->footer .= $this->div_elements($tmp);\n $this->footer .= '</div>';\n echo $this->footer;\n }",
"protected function addFooter($value) {\n\t\t$this->add_footer = $value;\n\t}",
"function Footer()\n {\n\t $this->SetY(-15);\n\t // Arial italic 8\n\t if ( $this->PageNo()%2 != 0 ){ //footer for page 1\n\t $this->SetFont('Arial','B',13);\n\t $this->Cell(120,10,'Date of issue:',0,0);\n\t \n\t $this->Cell(40,10,'Dean(Examination Affairs)',0,1);\n\t }\n\t\t else if($this->PageNo()%2 == 0){\n\t\t\t $this->SetFont('Arial','B',13);\n\t\t\t $this->Cell(120,10,'Prepared By:',0,0);\n\t\t\t $this->Cell(60,10,'Verified By:',0,1);\n\t\t\t }\n\t }",
"function Footer() {\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 8);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(50, 10, 'Page ' . $this->PageNo(), 0, 0, 'L');\n $this->Cell(0, 10, 'Date ' . date('d-M-Y'), 0, 0, 'R');\n }",
"public function Footer()\n {\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial', 'I', 8);\n // Print centered page number\n $this->Cell(0, 4, utf8_decode('Atenea - Página ' . $this->PageNo()), 0, 0, 'C');\n }",
"public function Footer() {\n $this->imprime($this->format['footer']);\n }",
"function Footer()\r\n {\r\n $this->SetY(-15);\r\n // Arial italic 8\r\n $this->SetFont('Arial','I',8);\r\n // Page number\r\n $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\r\n }",
"function Footer() {\n\t $this->SetY(-15);\n\t //Arial italic 8\n\t $this->SetTextColor(0);\n\t //Page number\n\t $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\n\t}",
"function Footer()\n {\n $this->SetY(-12);\n // Arial italic 8\n $this->SetFont('Arial','I',8);\n // Page number\n $this->Cell(335,10,'copyright @ 2RA Technology Limited',0,0,'C');\n }",
"function lingotek_support_footer() {\n return array(\n '#type' => 'markup',\n '#markup' => theme('table', array('header' => array(), 'rows' => array(\n array(t('<strong>Support Hours:</strong><br>9am - 6pm MDT'),\n t('<strong>Phone:</strong><br> (801) 331-7777'),\n t('<strong>Email:</strong><br> <a href=\"mailto:[email protected]\">[email protected]</a>')\n )),\n 'attributes' => array(\n 'style' => 'width:500px; margin-top: 20px;'\n )\n ))\n );\n}",
"public function Footer() {\n\t\t\t\t// $this->SetY(-15);\n\t\t\t\t// $this->SetFont('helvetica', '', 9);\n\t\t\t\t// $footer_text = '<p style=\"text-align:right;\">Page '.$this->getAliasNumPage().' of '.$this->getAliasNbPages().'</p>';\n\t\t\t\t// $this->writeHTMLCell(0, 0, '', '', $footer_text, 0, 0, false, \"R\", true);\n\t\t\t\t$this->SetY(-25);\n\t\t\t\t$this->SetFont('helvetica', '', 9);\n\t\t\t\t$this->writeHTMLCell(0, 0, '', '', html_entity_decode(TICKET_FOOTER), 0, 0, false, \"C\", true);\n\t\t\t}"
] | [
"0.6804876",
"0.679549",
"0.67592156",
"0.6726855",
"0.6626189",
"0.6626189",
"0.65302956",
"0.65221",
"0.6449001",
"0.6376897",
"0.63768965",
"0.63705516",
"0.6333073",
"0.6306994",
"0.63063794",
"0.6295381",
"0.6293939",
"0.62612945",
"0.62416464",
"0.6241113",
"0.62073815",
"0.61764795",
"0.6166681",
"0.61371857",
"0.6136401",
"0.6129847",
"0.6129011",
"0.6126477",
"0.6125898",
"0.61164826"
] | 0.80165243 | 0 |
Get collabora document for public link by share token shareToken: file shared by public link (shareToken points directly to file) file in public folder shared by link (shareToken points to shared folder, and file to get is identified by fileId) | public function public($shareToken, $fileId) {
if (\is_string($shareToken) && \strlen($shareToken) > 0 && \is_numeric($fileId)) {
// fileId is a numeric string indicating the file in the folder link share (via shareToken)
$fileId = (int) $fileId;
} elseif (\is_string($shareToken) && \strlen($shareToken) > 0 && ($fileId === '' || $fileId === null)) {
// shareToken points directly to the file
$fileId = null;
} else {
return $this->responseError($this->l10n->t('Invalid request parameters'));
}
// Share by link in public folder or file
$docinfo = $this->documentService->getDocumentByShareToken($shareToken, $fileId);
if (!$docinfo) {
$this->logger->warning("Cannot retrieve document from share {token} that has fileid {fileId}", ["token" => $shareToken, "fileId" => $fileId]);
return $this->responseError(
$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),
$this->l10n->t('Please contact the administrator.', [])
);
}
// Get wopi token
$wopiAccessInfo = $this->createWopiSessionForPublicLink($docinfo);
// Get document discovery
$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);
if (!$wopiSrc) {
$this->logger->error("Cannot retrieve discovery for document", []);
return $this->responseError(
$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),
$this->l10n->t('Please contact the administrator.', [])
);
}
// Handle general response
$wopiRemote = $this->discoveryService->getWopiUrl();
$webSocket = $this->parseWopiSocket($wopiRemote);
if (!$webSocket) {
return $this->responseError($this->l10n->t('Collabora Online: Invalid URL "%s".', [$wopiRemote]), $this->l10n->t('Please ask your administrator to check the Collabora Online server setting.'));
}
// FIXME: In public links allow max 100MB
$maxUploadFilesize = 100*1000*1000;
// Public share link (folder or file)
$renderAs = 'base';
$this->navigationManager->setActiveEntry('richdocuments_index');
$retVal = [
'uploadMaxFilesize' => $maxUploadFilesize,
'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize),
'title' => $docinfo['name'],
'fileId' => $docinfo['fileid'],
'locale' => $this->getLocale(),
'version' => \strval($docinfo['version']),
'sessionId' => $wopiAccessInfo['sessionid'],
'access_token' => $wopiAccessInfo['access_token'],
'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],
'urlsrc' => $wopiSrc['urlsrc'],
'default_action' => $wopiSrc['action'],
'path' => $docinfo['path'],
'enable_previews' => $this->settings->getSystemValue('enable_previews', true),
'wopi_url' => $webSocket,
'doc_format' => $this->appConfig->getAppValue('doc_format'),
'instanceId' => $this->settings->getSystemValue('instanceid'),
'canonical_webroot' => $this->appConfig->getAppValue('canonical_webroot'),
'show_custom_header' => true // public link should show a customer header without buttons
];
$response = new TemplateResponse('richdocuments', 'documents', $retVal, $renderAs);
$policy = new ContentSecurityPolicy();
$policy->addAllowedFrameDomain($this->domainOnly($wopiRemote));
$policy->allowInlineScript(true);
$response->setContentSecurityPolicy($policy);
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get($fileId) {\n\t\ttry {\n\t\t\tif (\\is_numeric($fileId)) {\n\t\t\t\t// parse fileId pointing to file\n\t\t\t\t$fileId = (int) $fileId;\n\t\t\t} else {\n\t\t\t\treturn $this->responseError($this->l10n->t('Invalid request parameters'));\n\t\t\t}\n\n\t\t\t// Normal editing or share by user/group\n\t\t\t$docinfo = $this->documentService->getDocumentByUserId($this->getCurrentUserUID(), $fileId, null);\n\t\t\tif (!$docinfo) {\n\t\t\t\t$this->logger->warning(\"Cannot retrieve document with fileid {fileid}\", [\"fileid\" => $fileId]);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Get document discovery\n\t\t\t$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);\n\t\t\tif (!$wopiSrc) {\n\t\t\t\t$this->logger->error(\"Cannot retrieve discovery for document\", []);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Restrict filesize\n\t\t\t$maxUploadFilesize = \\OCP\\Util::maxUploadFilesize(\"/\");\n\n\t\t\t// Get wopi token\n\t\t\t$wopiAccessInfo = $this->createWopiSessionForAuthUser($docinfo);\n\n\t\t\t// Create document index\n\t\t\t$docRetVal = [\n\t\t\t\t'uploadMaxFilesize' => $maxUploadFilesize,\n\t\t\t\t'uploadMaxHumanFilesize' => \\OCP\\Util::humanFileSize($maxUploadFilesize),\n\t\t\t\t'title' => $docinfo['name'],\n\t\t\t\t'fileId' => $docinfo['fileid'],\n\t\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t\t'locale' => $this->getLocale(),\n\t\t\t\t'version' => \\strval($docinfo['version']),\n\t\t\t\t'sessionId' => $wopiAccessInfo['sessionid'],\n\t\t\t\t'access_token' => $wopiAccessInfo['access_token'],\n\t\t\t\t'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],\n\t\t\t\t'urlsrc' => $wopiSrc['urlsrc'],\n\t\t\t\t'default_action' => $wopiSrc['action'],\n\t\t\t\t'path' => $docinfo['path']\n\t\t\t];\n\t\t\treturn new JSONResponse($docRetVal);\n\t\t} catch (\\Exception $e) {\n\t\t\treturn new JSONResponse([\n\t\t\t\t'status' => 'error',\n\t\t\t\t'message' => 'Document index could not be found'\n\t\t\t], Http::STATUS_BAD_REQUEST);\n\t\t}\n\t}",
"public function federated($shareToken, $shareRelativePath, $server, $accessToken) {\n\t\tif (!\\is_string($shareToken) || $shareToken === '') {\n\t\t\treturn $this->responseError($this->l10n->t('Invalid request parameters'));\n\t\t}\n\n\t\t$docinfo = $this->documentService->getDocumentByFederatedToken($shareToken, $shareRelativePath);\n\t\tif (!$docinfo) {\n\t\t\t$this->logger->warning(\"Cannot retrieve document from share {token} that has path {path}\", [\"token\" => $shareToken, \"path\" => $shareRelativePath]);\n\t\t\treturn $this->responseError(\n\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t);\n\t\t}\n\n\t\t// Call federated server to get wopi information (editor/permissions etc)\n\t\t$remoteWopiInfo = $this->federationService->getWopiForToken($server, $accessToken);\n\t\tif (!$remoteWopiInfo) {\n\t\t\t$this->logger->error(\"Cannot retrieve federated document wopi session metadata\", []);\n\t\t\treturn $this->responseError(\n\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t);\n\t\t}\n\n\t\t// Get wopi token\n\t\t$wopiAccessInfo = $this->createWopiSessionForFederatedShare($docinfo, $remoteWopiInfo);\n\t\t\n\t\t// Get document discovery\n\t\t$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);\n\t\tif (!$wopiSrc) {\n\t\t\t$this->logger->error(\"Cannot retrieve discovery for document\", []);\n\t\t\treturn $this->responseError(\n\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t);\n\t\t}\n\n\t\t// Handle general response\n\t\t$wopiRemote = $this->discoveryService->getWopiUrl();\n\t\t$webSocket = $this->parseWopiSocket($wopiRemote);\n\t\tif (!$webSocket) {\n\t\t\treturn $this->responseError($this->l10n->t('Collabora Online: Invalid URL \"%s\".', [$wopiRemote]), $this->l10n->t('Please ask your administrator to check the Collabora Online server setting.'));\n\t\t}\n\n\t\t// FIXME: In federated shares allow max 100MB\n\t\t$maxUploadFilesize = 100*1000*1000;\n\n\t\t$this->navigationManager->setActiveEntry('richdocuments_index');\n\t\t$retVal = [\n\t\t\t'uploadMaxFilesize' => $maxUploadFilesize,\n\t\t\t'uploadMaxHumanFilesize' => \\OCP\\Util::humanFileSize($maxUploadFilesize),\n\t\t\t'title' => $docinfo['name'],\n\t\t\t'fileId' => $docinfo['fileid'],\n\t\t\t'locale' => $this->getLocale(),\n\t\t\t'version' => \\strval($docinfo['version']),\n\t\t\t'sessionId' => $wopiAccessInfo['sessionid'],\n\t\t\t'access_token' => $wopiAccessInfo['access_token'],\n\t\t\t'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],\n\t\t\t'urlsrc' => $wopiSrc['urlsrc'],\n\t\t\t'default_action' => $wopiSrc['action'],\n\t\t\t'path' => $docinfo['path'],\n\t\t\t'enable_previews' => $this->settings->getSystemValue('enable_previews', true),\n\t\t\t'wopi_url' => $webSocket,\n\t\t\t'doc_format' => $this->appConfig->getAppValue('doc_format'),\n\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t'canonical_webroot' => $this->appConfig->getAppValue('canonical_webroot'),\n\t\t\t'show_custom_header' => true // federated share should show a customer header without buttons\n\t\t];\n\n\t\t// Federated share is a user coming from remote instance so cannot show base template\n\t\t$renderAs = 'empty';\n\n\t\t$response = new TemplateResponse('richdocuments', 'documents', $retVal, $renderAs);\n\t\t$response->addHeader('X-Frame-Options', 'ALLOW');\n\t\t$policy = new ContentSecurityPolicy();\n\t\t$policy->addAllowedFrameDomain($this->domainOnly($wopiRemote));\n\t\t$policy->allowInlineScript(true);\n\t\t$response->setContentSecurityPolicy($policy);\n\n\t\treturn $response;\n\t}",
"public function getShare();",
"private function _getManageDocument()\n {\n $oHTML = CDependency::getComponentByName('display');\n $oDB = CDependency::getComponentByName('database');\n $oLogin = CDependency::getComponentByName('login');\n $bAdmin = $oLogin->isAdmin();\n\n $oPage = CDependency::getComponentByName('page');\n $oPage->addCssFile($this->getResourcePath().'css/sharedspace.css');\n\n $sHTML = $oHTML->getTitleLine('Manage Shared Documents', $this->getResourcePath().'/pictures/component.png');\n $sHTML.= $oHTML->getCarriageReturn();\n\n $nCurrentUserPk = $oLogin->getUserPk();\n $asUser = $oLogin->getUserList();\n\n if($bAdmin)\n {\n $sQuery = 'SELECT count(sd.shared_documentpk) as nCount FROM `shared_document` as sd ';\n $sQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sQuery.= ' WHERE parentfk = 0 ';\n }\n else\n {\n $sQuery = 'SELECT count(sd.shared_documentpk) as nCount FROM `shared_document` as sd ';\n $sQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sQuery.= ' WHERE parentfk = 0 AND (sd.is_edit_public = 1 OR sd.creatorfk = '.$nCurrentUserPk.' OR sde.userfk = '.$nCurrentUserPk.') ';\n }\n\n $oResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oResult->readFirst();\n $nNbDoc = $oResult->getFieldValue('nCount', CONST_PHP_VARTYPE_INT);\n\n if(!$bRead || $nNbDoc == 0 )\n {\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_ADD, CONST_SS_TYPE_DOCUMENT);\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'notice2'));\n $sHTML.= $oHTML->getText('No shared document available. Upload ');\n $sHTML.= $oHTML->getLink('our first document', $sUrl);\n $sHTML.= $oHTML->getText(' now.');\n $sHTML.= $oHTML->getBlocEnd();\n return $sHTML;\n }\n\n $oPager = CDependency::getComponentByName('pager');\n $oPagerComponent = CDependency::getComponentUidByName('pager');\n if(!empty($oPagerComponent))\n $oPager->initPager();\n\n //Select the last revision of all documents\n if($bAdmin)\n {\n $sMainQuery = 'SELECT sd.*, sd1.file_name as rev_name FROM `shared_document` as sd ';\n $sMainQuery.= ' LEFT JOIN `shared_document` as sd1 ON (sd1.shared_documentpk = sd.parentfk AND sd1.date_creation = sd.date_update) ';\n $sMainQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sMainQuery.= ' WHERE sd.parentfk = 0 GROUP BY shared_documentpk ' ;\n }\n else\n {\n $sMainQuery = 'SELECT sd.*, sd1.file_name as rev_name FROM `shared_document` as sd ';\n $sMainQuery.= ' LEFT JOIN `shared_document` as sd1 ON (sd1.shared_documentpk = sd.parentfk AND sd1.date_creation = sd.date_update) ';\n $sMainQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sMainQuery.= ' WHERE sd.parentfk = 0 AND (sd.is_edit_public = 1 OR sd.creatorfk = '.$nCurrentUserPk.' OR sde.userfk = '.$nCurrentUserPk.') ';\n $sMainQuery.= ' GROUP BY shared_documentpk ' ;\n }\n\n $sMainQuery.= ' ORDER BY sd.date_update DESC LIMIT '.$oPager->getSqlOffset().','.$oPager->getLimit();\n $oDbResult = $oDB->ExecuteQuery($sMainQuery);\n $bRead = $oDbResult->readFirst();\n $asDocuments = array();\n\n if($bRead)\n {\n while($bRead)\n {\n $asDocuments[$oDbResult->getFieldValue('shared_documentpk')] = $oDbResult->getData();\n $bRead = $oDbResult->readNext();\n }\n }\n\n //Select the Revisions of the previous docs\n $sQuery = 'SELECT sd.* FROM `shared_document` as sd ';\n $sQuery.= ' WHERE parentfk IN ('.implode(',', array_keys($asDocuments)).') ORDER BY date_creation DESC';\n $oResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oResult->readFirst();\n\n $asRevisions = array();\n while($bRead)\n {\n $asRevisions[$oResult->getFieldValue('parentfk', CONST_PHP_VARTYPE_INT)][] = $oResult->getData();\n $bRead = $oResult->readNext();\n }\n\n $sHTML.= $oHTML->getBlocStart('', array('class'=>'homePageContainer','style' =>'padding: 0px;background-color:#FFFFFF;width: 100%;'));\n $sHTML.= $oHTML->getListStart('', array('class' => 'ablistContainer'));\n\n $sHTML.= $oHTML->getListItemStart('', array('class' => 'ablistHeader'));\n $sHTML.= $this->_getSharedManageRowHeader();\n $sHTML.= $oHTML->getListItemEnd();\n\n // Just for the header till now.\n\n $pnRow =0;\n foreach($asDocuments as $asDocument)\n {\n if(($pnRow%2) == 0)\n $sRowClass = '';\n else\n $sRowClass = 'list_row_data_odd';\n\n $nDocumentPk = (int)$asDocument['shared_documentpk'];\n\n $sHTML.= $oHTML->getListItemStart('');\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListRow sharedManageRow '.$sRowClass));\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell ','style' => 'width:110px;'));\n $sHTML.= $oHTML->getNiceTime($asDocument['date_creation']);\n\n if($bAdmin)\n {\n $sHTML.= $oHTML->getCarriageReturn();\n $asUserData = $oLogin->getUserDataByPk((int)$asDocument['creatorfk']);\n $sHTML.= $oHTML->getText('By :'.$oLogin->getUserNameFromData($asUserData), array('style' => 'color: #2A6991;'));\n }\n\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:150px;'));\n $sHTML.= substr($oHTML->getText($asDocument['title']), 0, 20);\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:150px;'));\n $sHTML.= substr($oHTML->getText($asDocument['description']), 0, 20);\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:115px;'));\n if($asDocument['is_public'] == 1)\n $sHTML.= $oHTML->getText('Public');\n else if($asDocument['is_public'] == 0)\n $sHTML.= $oHTML->getText('Private');\n else\n $sHTML.= $oHTML->getText('Restricted access');\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'floatHack'));\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:340px;'));\n\n if(isset($asRevisions[$nDocumentPk]))\n {\n $sHTML.= $oHTML->getBlocStart('revId_'.$nDocumentPk, array('class' => ''));\n\n //Get the number of revisions: nb file -1 (current one)\n $nCount = count($asRevisions[$nDocumentPk]);\n $nKey = 0;\n $bFirst = true;\n\n foreach($asRevisions[$nDocumentPk] as $asRevData)\n {\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_SEND, CONST_SS_TYPE_DOCUMENT, (int)$asRevData['shared_documentpk']);\n\n if($bFirst)\n {\n $sHTML.= $oHTML->getSpanStart();\n $sHTML.= $oHTML->getPicture(CONST_PICTURE_DOWNLOAD, 'Download file', $sUrl, array('style' => 'float: right; margin-right:10px;'));\n $sHTML.= $oHTML->getText('Revision #'.$nCount.': ', array('class' => 'strong'));\n $sHTML.= $oHTML->getSpace(2);\n $sHTML.= $oHTML->getLink($asRevData['file_name'], $sUrl, array('target' => '_blank'));\n $sHTML.= $oHTML->getText(' - '). $oHTML->getNiceTime($asRevData['date_creation']);\n $sHTML.= $oHTML->getCarriageReturn();\n $sHTML.= $oHTML->getSpanEnd();\n }\n else\n {\n //Second line: multiple revisions\n if($nKey == 1)\n {\n $sHTML.= $oHTML->getSpanStart();\n $sHTML.= $oHTML->getLink('Other revisions...', 'javascript:;', array('onclick' => '$(\\'#revId_'.$nDocumentPk.' .rev_hidden\\').fadeToggle(); '));\n $sHTML.= $oHTML->getCarriageReturn();\n $sHTML.= $oHTML->getSpanEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'rev_hidden'));\n }\n\n $sHTML.= $oHTML->getSpanStart();\n $sHTML.= $oHTML->getText('rev. #'.$nCount.': ');\n $sHTML.= $oHTML->getLink($asRevData['file_name'], $sUrl, array('target' => '_blank'));\n $sHTML.= $oHTML->getText(' - '). $oHTML->getNiceTime($asRevData['date_creation']);\n $sHTML.= $oHTML->getCarriageReturn();\n $sHTML.= $oHTML->getSpanEnd();\n }\n\n $nCount--;\n $nKey++;\n $bFirst = false;\n }\n\n $sHTML.= $oHTML->getText('rev. #0: ');\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_SEND, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sHTML.= $oHTML->getLink($asDocument['file_name'], $sUrl, array('target' => '_blank'));\n\n if($nKey >= 1)\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocEnd();\n }\n else\n {\n $sPic = $oHTML->getPicture(CONST_PICTURE_DOWNLOAD, 'Download file', '', array('style' => 'float: right; margin-right:10px;'));\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_SEND, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sHTML.= $oHTML->getLink($sPic.' '.$asDocument['file_name'], $sUrl, array('target' => '_blank'));\n }\n\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:100px; float:right;'));\n $sPic = $oHTML->getPicture(CONST_PICTURE_EDIT, 'Edit document');\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_EDIT, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sHTML.= $oHTML->getLink($sPic, $sUrl);\n $sHTML.= $oHTML->getSpace(2);\n $sUrl = $oPage->getAjaxUrl('sharedspace', CONST_ACTION_DELETE, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sPic = $oHTML->getPicture(CONST_PICTURE_DELETE, 'Delete project');\n $sHTML.= $oHTML->getLink($sPic, $sUrl, array('onclick' => 'if(!window.confirm(\\'Delete this shared document ?\\')){ return false; }'));\n\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getListItemEnd();\n\n $pnRow++;\n }\n\n $sHTML.= $oHTML->getListEnd();\n $sHTML.= $oHTML->getBlocEnd();\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_MANAGE, CONST_SS_TYPE_DOCUMENT);\n $sHTML.= $oPager->getDisplay($nNbDoc, $sUrl);\n\n return $sHTML;\n }",
"public function searchSharedDoc($limit = null) {\n try {\n if (!($this->document instanceof Base_Model_ObtorLib_App_Core_Doc_Entity_Document)) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception(\" Document Entity not initialized\");\n } else {\n $arrWhere = array();\n $arrdocuments = array();\n $docAddedBy = $this->document->getDocAddedBy();\n $sharedUserId = $this->document->getSharedUserId();\n \n $documentSql = \"SELECT d.id as id FROM tbl_documents d,tbl_doc_permission dp\";\n array_push($arrWhere, \"d.id = dp.document_id\");\n \n if($sharedUserId){\n array_push($arrWhere, \"dp.user_id = '\" . $sharedUserId . \"'\");\n }\n \n if ($docAddedBy) {\n array_push($arrWhere, \"d.doc_added_by = '\" . $docAddedBy . \"'\");\n }\n\n if (count($arrWhere) > 0) {\n $documentSql.= \" WHERE \" . implode(' AND ',$arrWhere);\n }\n \n $documentSql = $documentSql.\" ORDER BY d.id Asc\";\n if(!is_null($limit)){\n $documentSql = $documentSql.$limit;\n }\n\n $db = Zend_Db_Table_Abstract::getDefaultAdapter();\n $result = $db->fetchCol($documentSql);\n foreach ($result as $documentId) {\n $documentInfo = $this->getDocument($documentId);\n array_push($arrdocuments, $documentInfo);\n }\n return $arrdocuments;\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception($ex);\n }\n }",
"public function files_sharedWithMe(){\n\n\t\t $response = $this->drive_service->files->listFiles(array(\n\t\t 'q' => \"sharedWithMe \",\n\t\t 'spaces' => 'drive',\n\t\t 'fields' => 'nextPageToken, files(id, name)',\n\t\t ));\n\t\t $result=array();\n\t\t foreach ($response->files as $file) {\n\t\t array_push($result,$file->getId());\n\t\t }\n\t\treturn $result;\n\n\t}",
"public function shareByLink($id){\n $user = DbFile::where('id',$id)->first();\n $filePath = $user->FilePath;\n $url = Storage::disk('s3')->temporaryUrl(\n $filePath,\n now()->addHour(),\n ['ResponseContentDisposition' => 'attachment']);\n return back()->with('success',\"Here is your link to share your file $url\");\n }",
"function cma_shareyn_documents($document_id = NULL, $share_yn = NULL)\n{\n// error_log('cma_remove_to_notebook - item_type:' . $item_type . ': and item_id:' . $item_id . ': and item_stfips:' . $item_stfips . ':');\n\n // If no onetcode is passed, we create an appropriate message\n if (!isset($document_id)) {\n return \"Missing User Id, nothing done\";\n }\n\n $output = '';\n\n $cma = vcnCma::getInstance();\n\n $cma->getCmaUserInfo();\n\n $output = $cma->shareyndocuments($document_id, $share_yn);\n\n echo $output;\n die; // this prevents theming and such, returning just the results of the rest call....\n}",
"public function index($fileId, $dir) {\n\t\tif (\\is_numeric($fileId)) {\n\t\t\t// parse fileId pointing to file\n\t\t\t$fileId = (int) $fileId;\n\t\t} elseif ($fileId === '' || $fileId === null) {\n\t\t\t// base template\n\t\t\t$fileId = null;\n\t\t} else {\n\t\t\treturn $this->responseError($this->l10n->t('Invalid request parameters'));\n\t\t}\n\n\t\t// Get doc index if possible\n\t\tif ($fileId !== null) {\n\t\t\t// Normal editing or share by user/group/federated\n\t\t\t$docinfo = $this->documentService->getDocumentByUserId($this->getCurrentUserUID(), $fileId, $dir);\n\t\t\tif (!$docinfo) {\n\t\t\t\t$this->logger->warning(\"Cannot retrieve document with fileid {fileid} in dir {dir}\", [\"fileid\" => $fileId, \"dir\" => $dir]);\n\t\t\t\treturn $this->responseError(\n\t\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Get wopi access info\n\t\t\t$wopiAccessInfo = $this->createWopiSessionForAuthUser($docinfo);\n\n\t\t\t// If federated share mount redirect to remote server for WOPI editing,\n\t\t\t// providing also access token for OCS federated handshake\n\t\t\tif (isset($docinfo['federatedShareToken'], $docinfo['federatedShareRelativePath'], $docinfo['federatedServer'])) {\n\t\t\t\t$remoteFileUrl = $this->federationService->getRemoteFileUrl(\n\t\t\t\t\t$docinfo['federatedShareToken'],\n\t\t\t\t\t$docinfo['federatedShareRelativePath'],\n\t\t\t\t\t$docinfo['federatedServer'],\n\t\t\t\t\t$wopiAccessInfo['access_token']\n\t\t\t\t);\n\t\t\t\t$response = new RedirectResponse($remoteFileUrl);\n\t\t\t\t$response->addHeader('X-Frame-Options', 'ALLOW');\n\t\t\t\treturn $response;\n\t\t\t}\n\n\t\t\t// Get document discovery for this server\n\t\t\t$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);\n\t\t\tif (!$wopiSrc) {\n\t\t\t\t$this->logger->error(\"Cannot retrieve discovery for document\", []);\n\t\t\t\treturn $this->responseError(\n\t\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t\t);\n\t\t\t}\n\t\n\t\t\t// Decide max upload size\n\t\t\t$maxUploadFilesize = \\OCP\\Util::maxUploadFilesize(\"/\");\n\n\t\t\t// Create document index\n\t\t\t$docRetVal = [\n\t\t\t\t'uploadMaxFilesize' => $maxUploadFilesize,\n\t\t\t\t'uploadMaxHumanFilesize' => \\OCP\\Util::humanFileSize($maxUploadFilesize),\n\t\t\t\t'title' => $docinfo['name'],\n\t\t\t\t'fileId' => $docinfo['fileid'],\n\t\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t\t'locale' => $this->getLocale(),\n\t\t\t\t'version' => \\strval($docinfo['version']),\n\t\t\t\t'sessionId' => $wopiAccessInfo['sessionid'],\n\t\t\t\t'access_token' => $wopiAccessInfo['access_token'],\n\t\t\t\t'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],\n\t\t\t\t'default_action' => $wopiSrc['action'],\n\t\t\t\t'urlsrc' => $wopiSrc['urlsrc'],\n\t\t\t\t'path' => $docinfo['path']\n\t\t\t];\n\t\t} else {\n\t\t\t// base template\n\t\t\t$docRetVal = [];\n\t\t}\n\n\t\t// Handle general response\n\t\t$wopiRemote = $this->discoveryService->getWopiUrl();\n\t\t$webSocket = $this->parseWopiSocket($wopiRemote);\n\t\tif (!$webSocket) {\n\t\t\treturn $this->responseError($this->l10n->t('Collabora Online: Invalid URL \"%s\".', [$wopiRemote]), $this->l10n->t('Please ask your administrator to check the Collabora Online server setting.'));\n\t\t}\n\n\t\t$retVal = \\array_merge(\n\t\t\t[\n\t\t\t\t'enable_previews' => $this->settings->getSystemValue('enable_previews', true),\n\t\t\t\t'wopi_url' => $webSocket,\n\t\t\t\t'doc_format' => $this->appConfig->getAppValue('doc_format'),\n\t\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t\t'canonical_webroot' => $this->appConfig->getAppValue('canonical_webroot'),\n\t\t\t\t'show_custom_header' => false\n\t\t\t],\n\t\t\t$docRetVal\n\t\t);\n\t\t\n\t\t// set active navigation entry\n\t\t$this->navigationManager->setActiveEntry('richdocuments_index');\n\n\t\t// Normal editing and user/group share editing\n\t\t// Parameter $dir is not used during indexing, but might be used by Document Server\n\t\t$renderAs = 'user';\n\n\t\t// prepare template response\n\t\t$response = new TemplateResponse('richdocuments', 'documents', $retVal, $renderAs);\n\t\t$policy = new ContentSecurityPolicy();\n\t\t$policy->addAllowedFrameDomain($this->domainOnly($wopiRemote));\n\t\t$policy->allowInlineScript(true);\n\t\t$response->setContentSecurityPolicy($policy);\n\n\t\treturn $response;\n\t}",
"public function linkdocument()\n {\n $return = array('error' => _t('UploadField.FIELDNOTSET', 'Could not add document to page'));\n $documentSet = $this->getCurrentDocumentSet();\n if (!empty($documentSet)) {\n $document = DMSDocument::get()->byId($this->getRequest()->getVar('documentID'));\n $documentSet->Documents()->add($document);\n\n $buttonText = '<button class=\"ss-uploadfield-item-edit ss-ui-button ui-corner-all\"'\n . ' title=\"' . _t('DMSDocument.EDITDOCUMENT', 'Edit this document') . '\" data-icon=\"pencil\">'\n . _t('DMSDocument.EDIT', 'Edit') . '<span class=\"toggle-details\">'\n . '<span class=\"toggle-details-icon\"></span></span></button>';\n\n // Collect all output data.\n $return = array(\n 'id' => $document->ID,\n 'name' => $document->getTitle(),\n 'thumbnail_url' => $document->Icon($document->getExtension()),\n 'edit_url' => $this->getEditForm()->Fields()->fieldByName('Main.From your computer.AssetUploadField')\n ->getItemHandler($document->ID)->EditLink(),\n 'size' => $document->getFileSizeFormatted(),\n 'buttons' => $buttonText,\n 'showeditform' => true\n );\n }\n\n return Convert::raw2json($return);\n }",
"public function shareAction(Request $request, $id) {\r\n\t\t$parameters = $_GET['acsilserver_appbundle_sharefiletype'];\r\n\t\t$friendName = $parameters['userMail'];\r\n\t\t$right = $parameters['rights'];\r\n\t\tif ($friendName == NULL || $right == NULL) {\r\n\t\t\tthrow $this -> createNotFoundException('Invalid data.');\r\n\t\t\treturn $this -> redirect($this -> generateUrl('_managefile', array(\r\n 'folderId' => 0,\r\n )));\r\n\t\t}\r\n\t\t$em = $this -> getDoctrine() -> getManager();\r\n\t\t$friend = $em -> getRepository('AcsilServerAppBundle:User') -> findOneByEmail($friendName);\r\n\r\n\t\tif (!$friend) {\r\n\t\t\t$errorShare = 'No friends';\r\n\t\t\t$shareForm = $this -> createForm(new ShareFileType(), new ShareFile());\r\n\t\t\t//throw $this -> createNotFoundException('No user found for name ' . $friendName);\r\n\t\t\treturn $this -> render('AcsilServerAppBundle:Upload:shareFile.html.twig',\r\n\t\t\tarray(\r\n\t\t\t\t'shareForm' => $shareForm -> createView(),\r\n\t\t\t\t'errorShare' => $errorShare,\r\n\t\t\t));\r\n\t\t}\r\n\r\n\t\t$document = $em -> getRepository('AcsilServerAppBundle:Document') -> findOneById($id);\r\n $folderId = $document->getFolder();\r\n\t\tif (!$document) {\r\n\t\t\tthrow $this -> createNotFoundException('No document found for id ' . $id);\r\n\t\t}\r\n\r\n\t\t$builder = new MaskBuilder();\r\n\t\tif ($right == \"EDIT\") {\r\n\t\t\t$builder -> add('view') -> add('edit') -> add('delete');\r\n\t\t\t$document->setIsShared(1);\r\n\t\t\t}\r\n\t\tif ($right == \"VIEW\") {\r\n\t\t\t$builder -> add('view');\r\n\t\t\t$document->setIsShared(1);\r\n\t\t}\r\n /**\r\n\t\t * Set the rights for the other user \r\n\t\t*/\r\n\t\t$aclProvider = $this -> container -> get('security.acl.provider');\r\n\t\t$objectIdentity = ObjectIdentity::fromDomainObject($document);\r\n\t\t$acl = $aclProvider -> findAcl($objectIdentity);\r\n\t\t$securityContext = $this -> container -> get('security.context');\r\n\t\t$securityIdentity = UserSecurityIdentity::fromAccount($friend);\r\n\t\t$aces = $acl -> getObjectAces();\r\n\r\n\t\tforeach ($aces as $index => $ace) {\r\n\t\t\tif ($ace -> getSecurityIdentity() == $securityIdentity) {\r\n\t\t\t\t$acl -> deleteObjectAce($index);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($right != \"DELETE\") {\r\n\t\t\t$mask = $builder -> get();\r\n\t\t\tvar_dump($builder -> get());\r\n\t\t\t$acl -> insertObjectAce($securityIdentity, $mask);\r\n\t\t}\r\n\telse\r\n\t{\r\n\t\t\t$document->setIsShared(0);\r\n\t}\r\n\t\t$aclProvider -> updateAcl($acl);\r\n\t\t$em -> persist($document);\r\n\t\t$em -> flush();\r\n\t\treturn $this -> redirect($this -> generateUrl('_managefile', array(\r\n 'folderId' => $folderId,\r\n )));\r\n\t}",
"abstract public function getShareUrl();",
"function _cmis_link_content_get_document($repository, $object) {\n\terror_log('_cmis_link_content_get_document');\n\t$cmis_link_session = & $_SESSION['cmis_link'];\n\t\n\terror_log('$object: '.var_export($object,true));\n\t$document = array('id' => $object->id, 'name' => $object->properties['cmis:name'], );\n\terror_log('$document: '.var_export($document,true));\n\t\n\tdrupal_add_js(drupal_get_path('module','cmis_link'). '/scripts/popup.js');\n\tdrupal_add_js(array('cmis_link' => array('document' => array('id' => $object->id, 'name' => $object->properties['cmis:name'], ))), 'setting');\n\t\n\t$cmis_link_session['document'] = $document;\n\treturn theme ('cmis_link_document_confirm',array(\n\t\t\t'document' => $document,\t\t\t\n\t));\n}",
"public function getDocument ($document) {\n\t\t$url = $this->apiBaseURL . \"document/\".$document;\n\t\t$header = array(\"Accept: application/json\", \"Authorization: Bearer \".$this->clientToken);\n\t\treturn self::makeCurlRequest ($url, $header, \"\", false);\n\t}",
"public function signingLink ($document) {\n\t\t$url = $this->apiBaseURL . \"link/\";\n\t\t$header = array(\"Accept: application/json\", \"Authorization: Bearer \".$this->clientToken);\n\t\t$parameters = json_encode(array(\"document_id\"=>$document));\n\t\treturn self::makeCurlRequest ($url, $header, $parameters, true);\n\t}",
"public function getPublicUri() {\n return \"files\";\n }",
"function islandora_calliope_get_file($pid) {\n module_load_include('inc', 'islandora', 'includes/utilities');\n $id = islandora_escape_pid_for_function($pid);\n $grid = islandora_calliope_create_mongo_grid();\n if (!$grid) {\n return;\n }\n $query = array('_resourceid' => $pid);\n $file = $grid->findOne($query);\n if ($file == NULL) {\n drupal_set_message(t('The requested resource does not exist'));\n return;\n }\n if (array_key_exists('_deleted', $file->file)) {\n drupal_set_message(t('The requested resource has been deleted'));\n return;\n }\n return $file;\n}",
"public function downloadDocumentLink ($document) {\n\t\t// POST /document/<id>/download/link\n\t\t$url = $this->apiBaseURL . \"document/\".$document.\"/download/link\";\n\t\t$header = array(\"Accept: application/json\", \"Authorization: Bearer \".$this->clientToken);\n\t\treturn self::makeCurlRequest ($url, $header, \"\", true);\n\t}",
"private function _getDocumentList()\n {\n $oHTML = CDependency::getComponentByName('display');\n $oDB = CDependency::getComponentByName('database');\n $oLogin = CDependency::getComponentByName('login');\n $oPage = CDependency::getComponentByName('page');\n $oPage->addCssFile($this->getResourcePath().'css/sharedspace.css');\n\n $sHTML = $oHTML->getTitleLine('Shared documents', $this->getResourcePath().'/pictures/component.png');\n $sHTML.= $oHTML->getCarriageReturn();\n\n $nCurrentUserPk = $oLogin->getUserPk();\n $asUser = $oLogin->getUserList(0,false,true); //Exclude inactive user but include admin\n $sSort = getValue('sort');\n\n if(!empty($sSort))\n {\n $_SESSION['ss_sort']['field'] = $sSort;\n\n if(isset($_SESSION['ss_sort']['order']) && $_SESSION['ss_sort']['order'] == 'asc')\n {\n $_SESSION['ss_sort']['order'] = 'desc';\n }\n else\n $_SESSION['ss_sort']['order'] = 'asc';\n }\n else\n {\n $_SESSION['ss_sort']['field'] = 'date_update';\n $_SESSION['ss_sort']['order'] = 'desc';\n }\n //count the number of documents that user can access\n\n $sQuery = 'SELECT SUM(nCount) as nTotal FROM ( ';\n $sQuery.= 'SELECT count(*) as nCount FROM `shared_document` as sd ';\n $sQuery.= ' LEFT JOIN shared_document_user as sdu ON (sdu.documentfk = sd.shared_documentpk) ';\n $sQuery.= ' WHERE parentfk = 0 AND (sd.is_public = 1 OR sd.creatorfk = '.$nCurrentUserPk.' OR sdu.userfk = '.$nCurrentUserPk.') ';\n $sQuery.= ' GROUP BY shared_documentpk) as q';\n\n $oResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oResult->readFirst();\n $nNbDoc = $oResult->getFieldValue('nTotal', CONST_PHP_VARTYPE_INT);\n\n if(!$bRead || $nNbDoc == 0 )\n {\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_ADD, CONST_SS_TYPE_DOCUMENT);\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'notice2'));\n $sHTML.= $oHTML->getText('No shared document available. Upload ');\n $sHTML.= $oHTML->getLink('your first document', $sUrl);\n $sHTML.= $oHTML->getText(' now.');\n $sHTML.= $oHTML->getBlocEnd();\n return $sHTML;\n }\n\n $oPager = CDependency::getComponentByName('pager');\n $oPagerComponent = CDependency::getComponentUidByName('pager');\n if(!empty($oPagerComponent))\n $oPager->initPager();\n\n //Select the latest revision of all documents\n $sQuery = 'SELECT sd.*, GROUP_CONCAT(userfk SEPARATOR \",\") as viewers FROM `shared_document` as sd ';\n $sQuery.= ' LEFT JOIN shared_document_user as sdu ON (sdu.documentfk = sd.shared_documentpk)';\n $sQuery.= ' WHERE parentfk = 0 AND (sd.is_public = 1 OR sd.creatorfk = '.$nCurrentUserPk.' OR sdu.userfk = '.$nCurrentUserPk.') ';\n $sQuery.= ' GROUP BY shared_documentpk ';\n $sQuery.= ' ORDER BY '.$_SESSION['ss_sort']['field'].' '.$_SESSION['ss_sort']['order'].' ';\n $sQuery.= ' LIMIT '.$oPager->getSqlOffset().', '.$oPager->getLimit();\n\n $oResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oResult->readFirst();\n\n $asDocuments = array();\n while($bRead)\n {\n $asDocuments[$oResult->getFieldValue('shared_documentpk')] = $oResult->getData();\n $bRead = $oResult->readNext();\n }\n\n //Select the Revisions of the previous docs\n $sQuery = 'SELECT sd.* FROM `shared_document` as sd ';\n $sQuery.= ' WHERE parentfk IN ('.implode(',', array_keys($asDocuments)).') ORDER BY date_creation DESC';\n $oResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oResult->readFirst();\n\n $asRevisions = array();\n while($bRead)\n {\n $asRevisions[$oResult->getFieldValue('parentfk', CONST_PHP_VARTYPE_INT)][] = $oResult->getData();\n $bRead = $oResult->readNext();\n }\n\n $sHTML.= $oHTML->getTitle($nNbDoc.' Shared documents', 'h2');\n $sHTML.= $oHTML->getCarriageReturn();\n\n //Header Container\n $sHTML.= $oHTML->getBlocStart('', array('class'=>'homePageContainer','style' =>'padding: 0px;background-color:#FFFFFF;width: 100%;'));\n $sHTML.= $oHTML->getListStart('', array('class' => 'ablistContainer'));\n\n $sHTML.= $oHTML->getListItemStart('', array('class' => 'ablistHeader'));\n $sHTML.= $this->_getSharedRowHeader();\n $sHTML.= $oHTML->getListItemEnd();\n\n $pnRow =0;\n\n foreach($asDocuments as $asDocument)\n {\n if(($pnRow%2) == 0)\n $sRowClass = '';\n else\n $sRowClass = 'list_row_data_odd';\n\n $nDocumentPk = (int)$asDocument['shared_documentpk'];\n $sHTML.= $oHTML->getListItemStart('');\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'list_row_data '.$sRowClass));\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'list_cell '.$sRowClass,'style' => 'width:7%'));\n $sHTML.= $oHTML->getNiceTime($asDocument['date_update']);\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'list_cell '.$sRowClass,'style' => 'width:5%'));\n if((bool)$asDocument['is_public'])\n $sHTML.= $oHTML->getText('Public');\n else\n {\n if(empty($asDocument['viewers']))\n $sHTML.= $oHTML->getText('Private');\n else\n $sHTML.= $oHTML->getText('Specific share');\n }\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'list_cell '.$sRowClass,'style' => 'width:10%;'));\n $sUserName = $oLogin->getUserNameFromData($asUser[$asDocument['creatorfk']]);\n $sHTML.= $oHTML->getText($sUserName);\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'list_cell '.$sRowClass,'style' => 'width:12%'));\n\n $sHTML.= $oHTML->getText($asDocument['title'], array(), 40);\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'list_cell '.$sRowClass,'style' => 'width:29%'));\n $sHTML.= $oHTML->getText($asDocument['description'], array(), 70);\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'list_cell '.$sRowClass,'style' => 'width: 21%;float:right;'));\n $sPic = $oHTML->getPicture(CONST_PICTURE_DOWNLOAD, 'Download file', '', array('style' => 'float: right; margin-right:10px;'));\n if(!isset($asRevisions[$nDocumentPk]))\n {\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_SEND, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sHTML.= $oHTML->getLink($sPic.' '.$asDocument['file_name'], $sUrl, array('target' => '_blank', 'class' => 'dl_link'));\n }\n else\n {\n $nCount = count($asRevisions[$nDocumentPk]);\n\n foreach($asRevisions[$nDocumentPk] as $asRevision)\n {\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_SEND, CONST_SS_TYPE_DOCUMENT, (int)$asRevision['shared_documentpk']);\n $sHTML.= $oHTML->getLink('rev #'.$nCount.': '.$asRevision['file_name'], $sUrl, array('target' => '_blank', 'class' => 'dl_link'));\n $sHTML.= $oHTML->getCarriageReturn();\n $nCount--;\n }\n }\n\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'floatHack'));\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getListItemEnd();\n $pnRow ++;\n\n $bRead = $oResult->readNext();\n }\n\n $sHTML.= $oHTML->getListEnd();\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'floatHack')).$oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocEnd();\n\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_LIST, CONST_SS_TYPE_DOCUMENT);\n $sHTML.= $oPager->getDisplay($nNbDoc, $sUrl);\n\n return $sHTML;\n }",
"public function link(): string {\n return telegram::fileLink($this->file_id);\n }",
"public function shareFolderAction(Request $request, $id) {\r\n\t\t\r\n\t\t$parameters = $request -> request -> get('acsilserver_appbundle_sharefiletype');\r\n\t\t$friendName = $parameters['userMail'];\r\n\t\t$right = $parameters['rights'];\r\n\t\tif ($friendName == NULL || $right == NULL) {\r\n\t\t\tthrow $this -> createNotFoundException('Invalid data.');\r\n\t\t\treturn $this -> redirect($this -> generateUrl('_managefile', array(\r\n 'folderId' => 0,\r\n )));\r\n\t\t}\r\n\t\t$em = $this -> getDoctrine() -> getManager();\r\n\t\t$friend = $em -> getRepository('AcsilServerAppBundle:User') -> findOneByEmail($friendName);\r\n\r\n\t\tif (!$friend) {\r\n\t\t\t$errorShare = 'No friends';\r\n\t\t\t$shareFolderForm = $this -> createForm(new ShareFileType(), new ShareFile());\r\n\t\t\treturn $this -> render('AcsilServerAppBundle:Upload:shareFolder.html.twig',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'shareFolderForm' => $shareFolderForm -> createView(),\r\n\t\t\t\t\t'errorShare' => $errorShare,\r\n\t\t\t\t));\r\n\t\t}\r\n\r\n\t\t$folder = $em \r\n\t\t\t-> getRepository('AcsilServerAppBundle:Folder') \r\n\t\t\t-> findOneBy(array('id' => $id));\r\n\r\n\t\t$folderId = $folder->getParentFolder();\r\n\t\t$file_list = $folder->listDirectory($folder->getAbsolutePath());\r\n\t\t$builder = new MaskBuilder();\r\n\t\tforeach ($file_list as $file) {\r\n\t\t$tmp = basename($file);\r\n\t\tif ($tmp[0] == 'f')\r\n\t\t{\r\n\t\t\t$document = $em \r\n\t\t\t-> getRepository('AcsilServerAppBundle:Document') \r\n\t\t\t-> findOneBy(array('path' => $tmp));\r\n\t\t\t\t\tif (!$document) {\r\n\t\t\tthrow $this -> createNotFoundException('No document found for path ' . $tmp);\r\n\t\t}\r\n\t\t\t\t/* file ----------------------------- */\r\n\t\t$builder = new MaskBuilder();\r\n\t\tif ($right == \"EDIT\") {\r\n\t\t\t$builder -> add('view') -> add('edit') -> add('delete');\r\n\t\t\t$document->setIsShared(1);\r\n\t\t\t}\r\n\t\tif ($right == \"VIEW\") {\r\n\t\t\t$builder -> add('view');\r\n\t\t\t$document->setIsShared(1);\r\n\t\t}\r\n /**\r\n\t\t * Set the rights for the other user \r\n\t\t*/\r\n\t\t$aclProvider = $this -> container -> get('security.acl.provider');\r\n\t\t$objectIdentity = ObjectIdentity::fromDomainObject($document);\r\n\t\t$acl = $aclProvider -> findAcl($objectIdentity);\r\n\t\t$securityContext = $this -> container -> get('security.context');\r\n\t\t$securityIdentity = UserSecurityIdentity::fromAccount($friend);\r\n\t\t$aces = $acl -> getObjectAces();\r\n\r\n\t\tforeach ($aces as $index => $ace) {\r\n\t\t\tif ($ace -> getSecurityIdentity() == $securityIdentity) {\r\n\t\t\t\t$acl -> deleteObjectAce($index);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($right != \"DELETE\") {\r\n\t\t\t$mask = $builder -> get();\r\n\t\t\tvar_dump($builder -> get());\r\n\t\t\t$acl -> insertObjectAce($securityIdentity, $mask);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$document->setIsShared(0);\r\n\t\t}\r\n\t\t$aclProvider -> updateAcl($acl);\r\n\t\t$em -> persist($document);\r\n\t\t}\r\n\t\t}\r\n\t\t$em -> flush();\r\n\r\n\t\tforeach ($file_list as $file) {\r\n\t\t\t$tmp = basename($file);\r\n\t\t\tif ($tmp[0] == 'd')\r\n\t\t\t{\r\n\t\t\t\t$folder = $em \r\n\t\t\t\t-> getRepository('AcsilServerAppBundle:Folder') \r\n\t\t\t\t-> findOneBy(array('path' => $tmp));\r\n\t\t\t\tif (!$folder) {\r\n\t\t\t\tthrow $this -> createNotFoundException('No folder found for path ' . $tmp);\r\n\t\t\t\t}\r\n\t\t\t\t/* folder---------------------------------- */\r\n\t\t\t\tif ($right == \"EDIT\") {\r\n\t\t\t\t\t$builder -> add('view') -> add('edit') -> add('delete');\r\n\t\t\t\t\t$folder->setIsShared(1);\r\n\t\t\t\t}\r\n\t\t\t\tif ($right == \"VIEW\") {\r\n\t\t\t\t\t$builder -> add('view');\r\n\t\t\t\t\t$folder->setIsShared(1);\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t* Set the rights for the other user \r\n\t\t\t\t*/\r\n\t\t\t\t$aclProvider = $this -> container -> get('security.acl.provider');\r\n\t\t\t\t$objectIdentity = ObjectIdentity::fromDomainObject($folder);\r\n\t\t\t\t$acl = $aclProvider -> findAcl($objectIdentity);\r\n\t\t\t\t$securityContext = $this -> container -> get('security.context');\r\n\t\t\t\t$securityIdentity = UserSecurityIdentity::fromAccount($friend);\r\n\t\t\t\t$aces = $acl -> getObjectAces();\r\n\r\n\t\t\t\tforeach ($aces as $index => $ace) {\r\n\t\t\t\t\tif ($ace -> getSecurityIdentity() == $securityIdentity) {\r\n\t\t\t\t\t\t$acl -> deleteObjectAce($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 ($right != \"DELETE\") {\r\n\t\t\t\t\t$mask = $builder -> get();\r\n\t\t\t\t\tvar_dump($builder -> get());\r\n\t\t\t\t\t$acl -> insertObjectAce($securityIdentity, $mask);\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$folder->setIsShared(0);\r\n\t\t\t\t}\r\n\t\t\t\t$aclProvider -> updateAcl($acl);\r\n\t\t\t\t$em -> persist($folder);\r\n\t\t\t\t$em -> flush();\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t//last folder\r\n\t\t$folder = $em \r\n\t\t\t-> getRepository('AcsilServerAppBundle:Folder') \r\n\t\t\t-> findOneBy(array('id' => $id));\r\n\t\tif ($right == \"EDIT\") {\r\n\t\t\t$builder -> add('view') -> add('edit') -> add('delete');\r\n\t\t\t$folder->setIsShared(1);\r\n\t\t\t}\r\n\t\tif ($right == \"VIEW\") {\r\n\t\t\t$builder -> add('view');\r\n\t\t\t$folder->setIsShared(1);\r\n\t\t}\r\n /**\r\n\t\t * Set the rights for the other user \r\n\t\t*/\r\n\t\t$aclProvider = $this -> container -> get('security.acl.provider');\r\n\t\t$objectIdentity = ObjectIdentity::fromDomainObject($folder);\r\n\t\t$acl = $aclProvider -> findAcl($objectIdentity);\r\n\t\t$securityContext = $this -> container -> get('security.context');\r\n\t\t$securityIdentity = UserSecurityIdentity::fromAccount($friend);\r\n\t\t$aces = $acl -> getObjectAces();\r\n\r\n\t\tforeach ($aces as $index => $ace) {\r\n\t\t\tif ($ace -> getSecurityIdentity() == $securityIdentity) {\r\n\t\t\t\t$acl -> deleteObjectAce($index);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($right != \"DELETE\") {\r\n\t\t\t$mask = $builder -> get();\r\n\t\t\tvar_dump($builder -> get());\r\n\t\t\t$acl -> insertObjectAce($securityIdentity, $mask);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$folder->setIsShared(0);\r\n\t\t}\r\n\t\t$aclProvider -> updateAcl($acl);\r\n\t\t$em -> persist($folder);\r\n\t\t$em -> flush();\t\t\t\r\n\r\n\t\treturn $this -> redirect($this -> generateUrl('_managefile', array(\r\n 'folderId' => $folderId,\r\n )));\r\n\t}",
"private function createWopiSessionForPublicLink(array $docInfo) : array {\n\t\t$editorUid = $this->getCurrentUserUID();\n\t\t$ownerUid = $docInfo['owner'];\n\t\t$fileId = $docInfo['fileid'];\n\t\t$mimetype = $docInfo['mimetype'];\n\t\t$path = $docInfo['path'];\n\t\t$version = $docInfo['version'];\n\t\t$allowEdit = $docInfo['allowEdit'];\n\n\t\t$this->logger->info('Generating WOPI Token for file {fileId}, version {version}.', [\n\t\t\t'app' => $this->appName,\n\t\t\t'fileId' => $fileId,\n\t\t\t'version' => $version ]);\n\n\t\t$this->updateDocumentEncryptionAccessList($ownerUid, $editorUid, $path);\n\n\t\t$serverHost = $this->request->getServerProtocol() . '://' . $this->request->getServerHost();\n\n\t\t$wopiSessionAttr = WOPI::ATTR_CAN_VIEW | WOPI::ATTR_CAN_EXPORT | WOPI::ATTR_CAN_PRINT;\n\n\t\t// If token is for some versioned file\n\t\t// Check if mimetime supports updates\n\t\t$wopiSrc = $this->discoveryService->getWopiSrc($mimetype);\n\t\tif (($allowEdit === true) && isset($wopiSrc['action'])\n\t\t\t\t&& ($wopiSrc['action'] === 'edit' || $wopiSrc['action'] === 'view_comment')\n\t\t\t\t&& ($version === 0)) {\n\t\t\t$wopiSessionAttr = $wopiSessionAttr | WOPI::ATTR_CAN_UPDATE;\n\t\t}\n\n\t\t$row = new Db\\Wopi();\n\t\t$tokenArray = $row->generateToken($fileId, $version, $wopiSessionAttr, $serverHost, $ownerUid, $editorUid);\n\n\t\t// Return the token.\n\t\t$result = [\n\t\t\t'access_token' => $tokenArray['access_token'],\n\t\t\t'access_token_ttl' => $tokenArray['access_token_ttl'],\n\t\t\t'sessionid' => '0' // default shared session\n\t\t];\n\t\t$this->logger->debug('Issued token: {result}', ['app' => $this->appName, 'result' => $result]);\n\t\treturn $result;\n\t}",
"function retrieveFile($documentId, $fileName){\n\t\treturn(\"../files/$documentId/$fileName\");\n\t}",
"public function getById(string $access_token, array $params = array()) {\n return $this->request->post('docs.getById', $access_token, $params);\n }",
"public function getScopeDocsUrl();",
"public function link(Document $document);",
"public function getLinkOwnFilesOnAccountPage()\n {\n return $this->linkOwnFilesOnAccountPage;\n }",
"public function getPathForToken($fileId, $version, $token){\n\n\t\t$wopi = new Wopi();\n\t\t$row = $wopi->loadBy('token', $token)->getData();\n\t\t\\OC::$server->getLogger()->debug('Loaded WOPI Token record: {row}.', [ 'row' => $row ]);\n\t\tif (count($row) == 0)\n\t\t{\n\t\t\t// Invalid token.\n\t\t\thttp_response_code(401);\n\t\t\treturn false;\n\t\t}\n\n\t\t//TODO: validate.\n\t\tif ($row['expiry'] > time()){\n\t\t\t// Expired token!\n\t\t\t//http_response_code(404);\n\t\t\t//$wopi->deleteBy('id', $row['id']);\n\t\t\t//return false;\n\t\t}\n\t\tif ($row['fileid'] != $fileId || $row['version'] != $version){\n\t\t\t// File unknown / user unauthorized (for the requested file).\n\t\t\thttp_response_code(404);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn array(\n\t\t\t'owner' => $row['owner_uid'],\n\t\t\t'editor' => $row['editor_uid'],\n\t\t\t'path' => $row['path'],\n\t\t\t'canwrite' => $row['canwrite'],\n\t\t\t'server_host' => $row['server_host']\n\t\t);\n\t}",
"public function getDocument($document);",
"public function store(Request $request)\n {\n $user_login = $request->input('login');\n $files = $request->input('files');\n\n try {\n $user_login = Crypt::decryptString($user_login);\n } catch (DecryptException $e) {\n return abort('404');\n }\n\n $temp_folder_name = 'temp-' . $user_login;\n $public_folder_name = 'public/' . $user_login;\n\n foreach($files as $file) {\n\n $file_id = explode('.', str_replace($temp_folder_name . '/', '', $file['serverId']))[0];\n $file_serverId = str_replace($temp_folder_name . '/', $public_folder_name . '/', $file['serverId']);\n\n $file_name = $file_id . '.' . $file['fileExtension'];\n $public_path = $public_folder_name . '/' . $file_name;\n\n //$mimeType = MimeType::get($file['fileExtension']);\n\n //gen share id\n $shareId = $this->checkExistId(str_random(9), 'shareId');\n $random1 = str_random(1);\n //create share link\n $shareLink = base64_encode($shareId . $random1);\n \n $f = new FileModel;\n $f->fileId = $this->checkExistId($file['id'], 'fileId');\n $f->nameId = $file_id;\n $f->serverId = $file_serverId;\n $f->filename = $file['filename'];\n $f->filenameWithoutExtension = $file['filenameWithoutExtension'];\n $f->fileType = $file['fileType'];\n $f->fileExtension = $file['fileExtension'];\n //$f->mimeType = $mimeType; \n $f->fileSize = $file['fileSize'];\n $f->fileLastModified = (string) isset($file['fileLastModified']) ? $file['fileLastModified'] : \"\"; // MS Edge Can't read fileLastModified\n $f->isShare = 0;\n $f->shareId = $shareId;\n $f->shareLink = $shareLink;\n $f->loginUser = $user_login;\n $f->save();\n\n if(Storage::exists($file['serverId'])){\n // 1. Move file from temp to public\n Storage::move($file['serverId'], $public_path);\n }\n }\n\n if(Storage::exists($temp_folder_name)){\n Storage::deleteDirectory($temp_folder_name);\n }\n\n return json_encode($files);\n\n }"
] | [
"0.6296119",
"0.6268515",
"0.6024186",
"0.59544057",
"0.5756534",
"0.57339036",
"0.5611195",
"0.5470405",
"0.5348658",
"0.53422976",
"0.5320958",
"0.5314596",
"0.5312067",
"0.5253781",
"0.5237517",
"0.52343935",
"0.5229253",
"0.5209288",
"0.519772",
"0.5189511",
"0.51392186",
"0.50984424",
"0.50814235",
"0.5072501",
"0.50651276",
"0.5053871",
"0.50392663",
"0.5029668",
"0.5024023",
"0.50079286"
] | 0.7667823 | 0 |
Get collabora document for remote (e.g. federated) share by token: file shared by public link (shareToken points directly to file) file in public folder shared by link (shareToken points to shared folder, and file to get is identified by fileId) | public function federated($shareToken, $shareRelativePath, $server, $accessToken) {
if (!\is_string($shareToken) || $shareToken === '') {
return $this->responseError($this->l10n->t('Invalid request parameters'));
}
$docinfo = $this->documentService->getDocumentByFederatedToken($shareToken, $shareRelativePath);
if (!$docinfo) {
$this->logger->warning("Cannot retrieve document from share {token} that has path {path}", ["token" => $shareToken, "path" => $shareRelativePath]);
return $this->responseError(
$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),
$this->l10n->t('Please contact the administrator.', [])
);
}
// Call federated server to get wopi information (editor/permissions etc)
$remoteWopiInfo = $this->federationService->getWopiForToken($server, $accessToken);
if (!$remoteWopiInfo) {
$this->logger->error("Cannot retrieve federated document wopi session metadata", []);
return $this->responseError(
$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),
$this->l10n->t('Please contact the administrator.', [])
);
}
// Get wopi token
$wopiAccessInfo = $this->createWopiSessionForFederatedShare($docinfo, $remoteWopiInfo);
// Get document discovery
$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);
if (!$wopiSrc) {
$this->logger->error("Cannot retrieve discovery for document", []);
return $this->responseError(
$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),
$this->l10n->t('Please contact the administrator.', [])
);
}
// Handle general response
$wopiRemote = $this->discoveryService->getWopiUrl();
$webSocket = $this->parseWopiSocket($wopiRemote);
if (!$webSocket) {
return $this->responseError($this->l10n->t('Collabora Online: Invalid URL "%s".', [$wopiRemote]), $this->l10n->t('Please ask your administrator to check the Collabora Online server setting.'));
}
// FIXME: In federated shares allow max 100MB
$maxUploadFilesize = 100*1000*1000;
$this->navigationManager->setActiveEntry('richdocuments_index');
$retVal = [
'uploadMaxFilesize' => $maxUploadFilesize,
'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize),
'title' => $docinfo['name'],
'fileId' => $docinfo['fileid'],
'locale' => $this->getLocale(),
'version' => \strval($docinfo['version']),
'sessionId' => $wopiAccessInfo['sessionid'],
'access_token' => $wopiAccessInfo['access_token'],
'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],
'urlsrc' => $wopiSrc['urlsrc'],
'default_action' => $wopiSrc['action'],
'path' => $docinfo['path'],
'enable_previews' => $this->settings->getSystemValue('enable_previews', true),
'wopi_url' => $webSocket,
'doc_format' => $this->appConfig->getAppValue('doc_format'),
'instanceId' => $this->settings->getSystemValue('instanceid'),
'canonical_webroot' => $this->appConfig->getAppValue('canonical_webroot'),
'show_custom_header' => true // federated share should show a customer header without buttons
];
// Federated share is a user coming from remote instance so cannot show base template
$renderAs = 'empty';
$response = new TemplateResponse('richdocuments', 'documents', $retVal, $renderAs);
$response->addHeader('X-Frame-Options', 'ALLOW');
$policy = new ContentSecurityPolicy();
$policy->addAllowedFrameDomain($this->domainOnly($wopiRemote));
$policy->allowInlineScript(true);
$response->setContentSecurityPolicy($policy);
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function public($shareToken, $fileId) {\n\t\tif (\\is_string($shareToken) && \\strlen($shareToken) > 0 && \\is_numeric($fileId)) {\n\t\t\t// fileId is a numeric string indicating the file in the folder link share (via shareToken)\n\t\t\t$fileId = (int) $fileId;\n\t\t} elseif (\\is_string($shareToken) && \\strlen($shareToken) > 0 && ($fileId === '' || $fileId === null)) {\n\t\t\t// shareToken points directly to the file\n\t\t\t$fileId = null;\n\t\t} else {\n\t\t\treturn $this->responseError($this->l10n->t('Invalid request parameters'));\n\t\t}\n\n\t\t// Share by link in public folder or file\n\t\t$docinfo = $this->documentService->getDocumentByShareToken($shareToken, $fileId);\n\t\tif (!$docinfo) {\n\t\t\t$this->logger->warning(\"Cannot retrieve document from share {token} that has fileid {fileId}\", [\"token\" => $shareToken, \"fileId\" => $fileId]);\n\t\t\treturn $this->responseError(\n\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t);\n\t\t}\n\n\t\t// Get wopi token\n\t\t$wopiAccessInfo = $this->createWopiSessionForPublicLink($docinfo);\n\n\t\t// Get document discovery\n\t\t$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);\n\t\tif (!$wopiSrc) {\n\t\t\t$this->logger->error(\"Cannot retrieve discovery for document\", []);\n\t\t\treturn $this->responseError(\n\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t);\n\t\t}\n\n\t\t// Handle general response\n\t\t$wopiRemote = $this->discoveryService->getWopiUrl();\n\t\t$webSocket = $this->parseWopiSocket($wopiRemote);\n\t\tif (!$webSocket) {\n\t\t\treturn $this->responseError($this->l10n->t('Collabora Online: Invalid URL \"%s\".', [$wopiRemote]), $this->l10n->t('Please ask your administrator to check the Collabora Online server setting.'));\n\t\t}\n\n\t\t// FIXME: In public links allow max 100MB\n\t\t$maxUploadFilesize = 100*1000*1000;\n\n\t\t// Public share link (folder or file)\n\t\t$renderAs = 'base';\n\n\t\t$this->navigationManager->setActiveEntry('richdocuments_index');\n\t\t$retVal = [\n\t\t\t'uploadMaxFilesize' => $maxUploadFilesize,\n\t\t\t'uploadMaxHumanFilesize' => \\OCP\\Util::humanFileSize($maxUploadFilesize),\n\t\t\t'title' => $docinfo['name'],\n\t\t\t'fileId' => $docinfo['fileid'],\n\t\t\t'locale' => $this->getLocale(),\n\t\t\t'version' => \\strval($docinfo['version']),\n\t\t\t'sessionId' => $wopiAccessInfo['sessionid'],\n\t\t\t'access_token' => $wopiAccessInfo['access_token'],\n\t\t\t'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],\n\t\t\t'urlsrc' => $wopiSrc['urlsrc'],\n\t\t\t'default_action' => $wopiSrc['action'],\n\t\t\t'path' => $docinfo['path'],\n\t\t\t'enable_previews' => $this->settings->getSystemValue('enable_previews', true),\n\t\t\t'wopi_url' => $webSocket,\n\t\t\t'doc_format' => $this->appConfig->getAppValue('doc_format'),\n\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t'canonical_webroot' => $this->appConfig->getAppValue('canonical_webroot'),\n\t\t\t'show_custom_header' => true // public link should show a customer header without buttons\n\t\t];\n\n\t\t$response = new TemplateResponse('richdocuments', 'documents', $retVal, $renderAs);\n\t\t$policy = new ContentSecurityPolicy();\n\t\t$policy->addAllowedFrameDomain($this->domainOnly($wopiRemote));\n\t\t$policy->allowInlineScript(true);\n\t\t$response->setContentSecurityPolicy($policy);\n\n\t\treturn $response;\n\t}",
"public function get($fileId) {\n\t\ttry {\n\t\t\tif (\\is_numeric($fileId)) {\n\t\t\t\t// parse fileId pointing to file\n\t\t\t\t$fileId = (int) $fileId;\n\t\t\t} else {\n\t\t\t\treturn $this->responseError($this->l10n->t('Invalid request parameters'));\n\t\t\t}\n\n\t\t\t// Normal editing or share by user/group\n\t\t\t$docinfo = $this->documentService->getDocumentByUserId($this->getCurrentUserUID(), $fileId, null);\n\t\t\tif (!$docinfo) {\n\t\t\t\t$this->logger->warning(\"Cannot retrieve document with fileid {fileid}\", [\"fileid\" => $fileId]);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Get document discovery\n\t\t\t$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);\n\t\t\tif (!$wopiSrc) {\n\t\t\t\t$this->logger->error(\"Cannot retrieve discovery for document\", []);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Restrict filesize\n\t\t\t$maxUploadFilesize = \\OCP\\Util::maxUploadFilesize(\"/\");\n\n\t\t\t// Get wopi token\n\t\t\t$wopiAccessInfo = $this->createWopiSessionForAuthUser($docinfo);\n\n\t\t\t// Create document index\n\t\t\t$docRetVal = [\n\t\t\t\t'uploadMaxFilesize' => $maxUploadFilesize,\n\t\t\t\t'uploadMaxHumanFilesize' => \\OCP\\Util::humanFileSize($maxUploadFilesize),\n\t\t\t\t'title' => $docinfo['name'],\n\t\t\t\t'fileId' => $docinfo['fileid'],\n\t\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t\t'locale' => $this->getLocale(),\n\t\t\t\t'version' => \\strval($docinfo['version']),\n\t\t\t\t'sessionId' => $wopiAccessInfo['sessionid'],\n\t\t\t\t'access_token' => $wopiAccessInfo['access_token'],\n\t\t\t\t'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],\n\t\t\t\t'urlsrc' => $wopiSrc['urlsrc'],\n\t\t\t\t'default_action' => $wopiSrc['action'],\n\t\t\t\t'path' => $docinfo['path']\n\t\t\t];\n\t\t\treturn new JSONResponse($docRetVal);\n\t\t} catch (\\Exception $e) {\n\t\t\treturn new JSONResponse([\n\t\t\t\t'status' => 'error',\n\t\t\t\t'message' => 'Document index could not be found'\n\t\t\t], Http::STATUS_BAD_REQUEST);\n\t\t}\n\t}",
"public function files_sharedWithMe(){\n\n\t\t $response = $this->drive_service->files->listFiles(array(\n\t\t 'q' => \"sharedWithMe \",\n\t\t 'spaces' => 'drive',\n\t\t 'fields' => 'nextPageToken, files(id, name)',\n\t\t ));\n\t\t $result=array();\n\t\t foreach ($response->files as $file) {\n\t\t array_push($result,$file->getId());\n\t\t }\n\t\treturn $result;\n\n\t}",
"public function getShare();",
"public function searchSharedDoc($limit = null) {\n try {\n if (!($this->document instanceof Base_Model_ObtorLib_App_Core_Doc_Entity_Document)) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception(\" Document Entity not initialized\");\n } else {\n $arrWhere = array();\n $arrdocuments = array();\n $docAddedBy = $this->document->getDocAddedBy();\n $sharedUserId = $this->document->getSharedUserId();\n \n $documentSql = \"SELECT d.id as id FROM tbl_documents d,tbl_doc_permission dp\";\n array_push($arrWhere, \"d.id = dp.document_id\");\n \n if($sharedUserId){\n array_push($arrWhere, \"dp.user_id = '\" . $sharedUserId . \"'\");\n }\n \n if ($docAddedBy) {\n array_push($arrWhere, \"d.doc_added_by = '\" . $docAddedBy . \"'\");\n }\n\n if (count($arrWhere) > 0) {\n $documentSql.= \" WHERE \" . implode(' AND ',$arrWhere);\n }\n \n $documentSql = $documentSql.\" ORDER BY d.id Asc\";\n if(!is_null($limit)){\n $documentSql = $documentSql.$limit;\n }\n\n $db = Zend_Db_Table_Abstract::getDefaultAdapter();\n $result = $db->fetchCol($documentSql);\n foreach ($result as $documentId) {\n $documentInfo = $this->getDocument($documentId);\n array_push($arrdocuments, $documentInfo);\n }\n return $arrdocuments;\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception($ex);\n }\n }",
"private function _getManageDocument()\n {\n $oHTML = CDependency::getComponentByName('display');\n $oDB = CDependency::getComponentByName('database');\n $oLogin = CDependency::getComponentByName('login');\n $bAdmin = $oLogin->isAdmin();\n\n $oPage = CDependency::getComponentByName('page');\n $oPage->addCssFile($this->getResourcePath().'css/sharedspace.css');\n\n $sHTML = $oHTML->getTitleLine('Manage Shared Documents', $this->getResourcePath().'/pictures/component.png');\n $sHTML.= $oHTML->getCarriageReturn();\n\n $nCurrentUserPk = $oLogin->getUserPk();\n $asUser = $oLogin->getUserList();\n\n if($bAdmin)\n {\n $sQuery = 'SELECT count(sd.shared_documentpk) as nCount FROM `shared_document` as sd ';\n $sQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sQuery.= ' WHERE parentfk = 0 ';\n }\n else\n {\n $sQuery = 'SELECT count(sd.shared_documentpk) as nCount FROM `shared_document` as sd ';\n $sQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sQuery.= ' WHERE parentfk = 0 AND (sd.is_edit_public = 1 OR sd.creatorfk = '.$nCurrentUserPk.' OR sde.userfk = '.$nCurrentUserPk.') ';\n }\n\n $oResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oResult->readFirst();\n $nNbDoc = $oResult->getFieldValue('nCount', CONST_PHP_VARTYPE_INT);\n\n if(!$bRead || $nNbDoc == 0 )\n {\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_ADD, CONST_SS_TYPE_DOCUMENT);\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'notice2'));\n $sHTML.= $oHTML->getText('No shared document available. Upload ');\n $sHTML.= $oHTML->getLink('our first document', $sUrl);\n $sHTML.= $oHTML->getText(' now.');\n $sHTML.= $oHTML->getBlocEnd();\n return $sHTML;\n }\n\n $oPager = CDependency::getComponentByName('pager');\n $oPagerComponent = CDependency::getComponentUidByName('pager');\n if(!empty($oPagerComponent))\n $oPager->initPager();\n\n //Select the last revision of all documents\n if($bAdmin)\n {\n $sMainQuery = 'SELECT sd.*, sd1.file_name as rev_name FROM `shared_document` as sd ';\n $sMainQuery.= ' LEFT JOIN `shared_document` as sd1 ON (sd1.shared_documentpk = sd.parentfk AND sd1.date_creation = sd.date_update) ';\n $sMainQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sMainQuery.= ' WHERE sd.parentfk = 0 GROUP BY shared_documentpk ' ;\n }\n else\n {\n $sMainQuery = 'SELECT sd.*, sd1.file_name as rev_name FROM `shared_document` as sd ';\n $sMainQuery.= ' LEFT JOIN `shared_document` as sd1 ON (sd1.shared_documentpk = sd.parentfk AND sd1.date_creation = sd.date_update) ';\n $sMainQuery.= ' LEFT JOIN shared_document_editor as sde ON (sde.documentfk = sd.shared_documentpk)';\n $sMainQuery.= ' WHERE sd.parentfk = 0 AND (sd.is_edit_public = 1 OR sd.creatorfk = '.$nCurrentUserPk.' OR sde.userfk = '.$nCurrentUserPk.') ';\n $sMainQuery.= ' GROUP BY shared_documentpk ' ;\n }\n\n $sMainQuery.= ' ORDER BY sd.date_update DESC LIMIT '.$oPager->getSqlOffset().','.$oPager->getLimit();\n $oDbResult = $oDB->ExecuteQuery($sMainQuery);\n $bRead = $oDbResult->readFirst();\n $asDocuments = array();\n\n if($bRead)\n {\n while($bRead)\n {\n $asDocuments[$oDbResult->getFieldValue('shared_documentpk')] = $oDbResult->getData();\n $bRead = $oDbResult->readNext();\n }\n }\n\n //Select the Revisions of the previous docs\n $sQuery = 'SELECT sd.* FROM `shared_document` as sd ';\n $sQuery.= ' WHERE parentfk IN ('.implode(',', array_keys($asDocuments)).') ORDER BY date_creation DESC';\n $oResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oResult->readFirst();\n\n $asRevisions = array();\n while($bRead)\n {\n $asRevisions[$oResult->getFieldValue('parentfk', CONST_PHP_VARTYPE_INT)][] = $oResult->getData();\n $bRead = $oResult->readNext();\n }\n\n $sHTML.= $oHTML->getBlocStart('', array('class'=>'homePageContainer','style' =>'padding: 0px;background-color:#FFFFFF;width: 100%;'));\n $sHTML.= $oHTML->getListStart('', array('class' => 'ablistContainer'));\n\n $sHTML.= $oHTML->getListItemStart('', array('class' => 'ablistHeader'));\n $sHTML.= $this->_getSharedManageRowHeader();\n $sHTML.= $oHTML->getListItemEnd();\n\n // Just for the header till now.\n\n $pnRow =0;\n foreach($asDocuments as $asDocument)\n {\n if(($pnRow%2) == 0)\n $sRowClass = '';\n else\n $sRowClass = 'list_row_data_odd';\n\n $nDocumentPk = (int)$asDocument['shared_documentpk'];\n\n $sHTML.= $oHTML->getListItemStart('');\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListRow sharedManageRow '.$sRowClass));\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell ','style' => 'width:110px;'));\n $sHTML.= $oHTML->getNiceTime($asDocument['date_creation']);\n\n if($bAdmin)\n {\n $sHTML.= $oHTML->getCarriageReturn();\n $asUserData = $oLogin->getUserDataByPk((int)$asDocument['creatorfk']);\n $sHTML.= $oHTML->getText('By :'.$oLogin->getUserNameFromData($asUserData), array('style' => 'color: #2A6991;'));\n }\n\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:150px;'));\n $sHTML.= substr($oHTML->getText($asDocument['title']), 0, 20);\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:150px;'));\n $sHTML.= substr($oHTML->getText($asDocument['description']), 0, 20);\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:115px;'));\n if($asDocument['is_public'] == 1)\n $sHTML.= $oHTML->getText('Public');\n else if($asDocument['is_public'] == 0)\n $sHTML.= $oHTML->getText('Private');\n else\n $sHTML.= $oHTML->getText('Restricted access');\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'floatHack'));\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:340px;'));\n\n if(isset($asRevisions[$nDocumentPk]))\n {\n $sHTML.= $oHTML->getBlocStart('revId_'.$nDocumentPk, array('class' => ''));\n\n //Get the number of revisions: nb file -1 (current one)\n $nCount = count($asRevisions[$nDocumentPk]);\n $nKey = 0;\n $bFirst = true;\n\n foreach($asRevisions[$nDocumentPk] as $asRevData)\n {\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_SEND, CONST_SS_TYPE_DOCUMENT, (int)$asRevData['shared_documentpk']);\n\n if($bFirst)\n {\n $sHTML.= $oHTML->getSpanStart();\n $sHTML.= $oHTML->getPicture(CONST_PICTURE_DOWNLOAD, 'Download file', $sUrl, array('style' => 'float: right; margin-right:10px;'));\n $sHTML.= $oHTML->getText('Revision #'.$nCount.': ', array('class' => 'strong'));\n $sHTML.= $oHTML->getSpace(2);\n $sHTML.= $oHTML->getLink($asRevData['file_name'], $sUrl, array('target' => '_blank'));\n $sHTML.= $oHTML->getText(' - '). $oHTML->getNiceTime($asRevData['date_creation']);\n $sHTML.= $oHTML->getCarriageReturn();\n $sHTML.= $oHTML->getSpanEnd();\n }\n else\n {\n //Second line: multiple revisions\n if($nKey == 1)\n {\n $sHTML.= $oHTML->getSpanStart();\n $sHTML.= $oHTML->getLink('Other revisions...', 'javascript:;', array('onclick' => '$(\\'#revId_'.$nDocumentPk.' .rev_hidden\\').fadeToggle(); '));\n $sHTML.= $oHTML->getCarriageReturn();\n $sHTML.= $oHTML->getSpanEnd();\n\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'rev_hidden'));\n }\n\n $sHTML.= $oHTML->getSpanStart();\n $sHTML.= $oHTML->getText('rev. #'.$nCount.': ');\n $sHTML.= $oHTML->getLink($asRevData['file_name'], $sUrl, array('target' => '_blank'));\n $sHTML.= $oHTML->getText(' - '). $oHTML->getNiceTime($asRevData['date_creation']);\n $sHTML.= $oHTML->getCarriageReturn();\n $sHTML.= $oHTML->getSpanEnd();\n }\n\n $nCount--;\n $nKey++;\n $bFirst = false;\n }\n\n $sHTML.= $oHTML->getText('rev. #0: ');\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_SEND, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sHTML.= $oHTML->getLink($asDocument['file_name'], $sUrl, array('target' => '_blank'));\n\n if($nKey >= 1)\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocEnd();\n }\n else\n {\n $sPic = $oHTML->getPicture(CONST_PICTURE_DOWNLOAD, 'Download file', '', array('style' => 'float: right; margin-right:10px;'));\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_SEND, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sHTML.= $oHTML->getLink($sPic.' '.$asDocument['file_name'], $sUrl, array('target' => '_blank'));\n }\n\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getBlocStart('', array('class' => 'sharedListCell','style' => 'width:100px; float:right;'));\n $sPic = $oHTML->getPicture(CONST_PICTURE_EDIT, 'Edit document');\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_EDIT, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sHTML.= $oHTML->getLink($sPic, $sUrl);\n $sHTML.= $oHTML->getSpace(2);\n $sUrl = $oPage->getAjaxUrl('sharedspace', CONST_ACTION_DELETE, CONST_SS_TYPE_DOCUMENT, $nDocumentPk);\n $sPic = $oHTML->getPicture(CONST_PICTURE_DELETE, 'Delete project');\n $sHTML.= $oHTML->getLink($sPic, $sUrl, array('onclick' => 'if(!window.confirm(\\'Delete this shared document ?\\')){ return false; }'));\n\n $sHTML.= $oHTML->getBlocEnd();\n\n $sHTML.= $oHTML->getBlocEnd();\n $sHTML.= $oHTML->getListItemEnd();\n\n $pnRow++;\n }\n\n $sHTML.= $oHTML->getListEnd();\n $sHTML.= $oHTML->getBlocEnd();\n $sUrl = $oPage->getUrl('sharedspace', CONST_ACTION_MANAGE, CONST_SS_TYPE_DOCUMENT);\n $sHTML.= $oPager->getDisplay($nNbDoc, $sUrl);\n\n return $sHTML;\n }",
"public function get($remote_file, $local_file);",
"public function index($fileId, $dir) {\n\t\tif (\\is_numeric($fileId)) {\n\t\t\t// parse fileId pointing to file\n\t\t\t$fileId = (int) $fileId;\n\t\t} elseif ($fileId === '' || $fileId === null) {\n\t\t\t// base template\n\t\t\t$fileId = null;\n\t\t} else {\n\t\t\treturn $this->responseError($this->l10n->t('Invalid request parameters'));\n\t\t}\n\n\t\t// Get doc index if possible\n\t\tif ($fileId !== null) {\n\t\t\t// Normal editing or share by user/group/federated\n\t\t\t$docinfo = $this->documentService->getDocumentByUserId($this->getCurrentUserUID(), $fileId, $dir);\n\t\t\tif (!$docinfo) {\n\t\t\t\t$this->logger->warning(\"Cannot retrieve document with fileid {fileid} in dir {dir}\", [\"fileid\" => $fileId, \"dir\" => $dir]);\n\t\t\t\treturn $this->responseError(\n\t\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Get wopi access info\n\t\t\t$wopiAccessInfo = $this->createWopiSessionForAuthUser($docinfo);\n\n\t\t\t// If federated share mount redirect to remote server for WOPI editing,\n\t\t\t// providing also access token for OCS federated handshake\n\t\t\tif (isset($docinfo['federatedShareToken'], $docinfo['federatedShareRelativePath'], $docinfo['federatedServer'])) {\n\t\t\t\t$remoteFileUrl = $this->federationService->getRemoteFileUrl(\n\t\t\t\t\t$docinfo['federatedShareToken'],\n\t\t\t\t\t$docinfo['federatedShareRelativePath'],\n\t\t\t\t\t$docinfo['federatedServer'],\n\t\t\t\t\t$wopiAccessInfo['access_token']\n\t\t\t\t);\n\t\t\t\t$response = new RedirectResponse($remoteFileUrl);\n\t\t\t\t$response->addHeader('X-Frame-Options', 'ALLOW');\n\t\t\t\treturn $response;\n\t\t\t}\n\n\t\t\t// Get document discovery for this server\n\t\t\t$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);\n\t\t\tif (!$wopiSrc) {\n\t\t\t\t$this->logger->error(\"Cannot retrieve discovery for document\", []);\n\t\t\t\treturn $this->responseError(\n\t\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t\t);\n\t\t\t}\n\t\n\t\t\t// Decide max upload size\n\t\t\t$maxUploadFilesize = \\OCP\\Util::maxUploadFilesize(\"/\");\n\n\t\t\t// Create document index\n\t\t\t$docRetVal = [\n\t\t\t\t'uploadMaxFilesize' => $maxUploadFilesize,\n\t\t\t\t'uploadMaxHumanFilesize' => \\OCP\\Util::humanFileSize($maxUploadFilesize),\n\t\t\t\t'title' => $docinfo['name'],\n\t\t\t\t'fileId' => $docinfo['fileid'],\n\t\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t\t'locale' => $this->getLocale(),\n\t\t\t\t'version' => \\strval($docinfo['version']),\n\t\t\t\t'sessionId' => $wopiAccessInfo['sessionid'],\n\t\t\t\t'access_token' => $wopiAccessInfo['access_token'],\n\t\t\t\t'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],\n\t\t\t\t'default_action' => $wopiSrc['action'],\n\t\t\t\t'urlsrc' => $wopiSrc['urlsrc'],\n\t\t\t\t'path' => $docinfo['path']\n\t\t\t];\n\t\t} else {\n\t\t\t// base template\n\t\t\t$docRetVal = [];\n\t\t}\n\n\t\t// Handle general response\n\t\t$wopiRemote = $this->discoveryService->getWopiUrl();\n\t\t$webSocket = $this->parseWopiSocket($wopiRemote);\n\t\tif (!$webSocket) {\n\t\t\treturn $this->responseError($this->l10n->t('Collabora Online: Invalid URL \"%s\".', [$wopiRemote]), $this->l10n->t('Please ask your administrator to check the Collabora Online server setting.'));\n\t\t}\n\n\t\t$retVal = \\array_merge(\n\t\t\t[\n\t\t\t\t'enable_previews' => $this->settings->getSystemValue('enable_previews', true),\n\t\t\t\t'wopi_url' => $webSocket,\n\t\t\t\t'doc_format' => $this->appConfig->getAppValue('doc_format'),\n\t\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t\t'canonical_webroot' => $this->appConfig->getAppValue('canonical_webroot'),\n\t\t\t\t'show_custom_header' => false\n\t\t\t],\n\t\t\t$docRetVal\n\t\t);\n\t\t\n\t\t// set active navigation entry\n\t\t$this->navigationManager->setActiveEntry('richdocuments_index');\n\n\t\t// Normal editing and user/group share editing\n\t\t// Parameter $dir is not used during indexing, but might be used by Document Server\n\t\t$renderAs = 'user';\n\n\t\t// prepare template response\n\t\t$response = new TemplateResponse('richdocuments', 'documents', $retVal, $renderAs);\n\t\t$policy = new ContentSecurityPolicy();\n\t\t$policy->addAllowedFrameDomain($this->domainOnly($wopiRemote));\n\t\t$policy->allowInlineScript(true);\n\t\t$response->setContentSecurityPolicy($policy);\n\n\t\treturn $response;\n\t}",
"public function getPathForToken($fileId, $version, $token){\n\n\t\t$wopi = new Wopi();\n\t\t$row = $wopi->loadBy('token', $token)->getData();\n\t\t\\OC::$server->getLogger()->debug('Loaded WOPI Token record: {row}.', [ 'row' => $row ]);\n\t\tif (count($row) == 0)\n\t\t{\n\t\t\t// Invalid token.\n\t\t\thttp_response_code(401);\n\t\t\treturn false;\n\t\t}\n\n\t\t//TODO: validate.\n\t\tif ($row['expiry'] > time()){\n\t\t\t// Expired token!\n\t\t\t//http_response_code(404);\n\t\t\t//$wopi->deleteBy('id', $row['id']);\n\t\t\t//return false;\n\t\t}\n\t\tif ($row['fileid'] != $fileId || $row['version'] != $version){\n\t\t\t// File unknown / user unauthorized (for the requested file).\n\t\t\thttp_response_code(404);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn array(\n\t\t\t'owner' => $row['owner_uid'],\n\t\t\t'editor' => $row['editor_uid'],\n\t\t\t'path' => $row['path'],\n\t\t\t'canwrite' => $row['canwrite'],\n\t\t\t'server_host' => $row['server_host']\n\t\t);\n\t}",
"function islandora_calliope_get_file($pid) {\n module_load_include('inc', 'islandora', 'includes/utilities');\n $id = islandora_escape_pid_for_function($pid);\n $grid = islandora_calliope_create_mongo_grid();\n if (!$grid) {\n return;\n }\n $query = array('_resourceid' => $pid);\n $file = $grid->findOne($query);\n if ($file == NULL) {\n drupal_set_message(t('The requested resource does not exist'));\n return;\n }\n if (array_key_exists('_deleted', $file->file)) {\n drupal_set_message(t('The requested resource has been deleted'));\n return;\n }\n return $file;\n}",
"public function shareAction(Request $request, $id) {\r\n\t\t$parameters = $_GET['acsilserver_appbundle_sharefiletype'];\r\n\t\t$friendName = $parameters['userMail'];\r\n\t\t$right = $parameters['rights'];\r\n\t\tif ($friendName == NULL || $right == NULL) {\r\n\t\t\tthrow $this -> createNotFoundException('Invalid data.');\r\n\t\t\treturn $this -> redirect($this -> generateUrl('_managefile', array(\r\n 'folderId' => 0,\r\n )));\r\n\t\t}\r\n\t\t$em = $this -> getDoctrine() -> getManager();\r\n\t\t$friend = $em -> getRepository('AcsilServerAppBundle:User') -> findOneByEmail($friendName);\r\n\r\n\t\tif (!$friend) {\r\n\t\t\t$errorShare = 'No friends';\r\n\t\t\t$shareForm = $this -> createForm(new ShareFileType(), new ShareFile());\r\n\t\t\t//throw $this -> createNotFoundException('No user found for name ' . $friendName);\r\n\t\t\treturn $this -> render('AcsilServerAppBundle:Upload:shareFile.html.twig',\r\n\t\t\tarray(\r\n\t\t\t\t'shareForm' => $shareForm -> createView(),\r\n\t\t\t\t'errorShare' => $errorShare,\r\n\t\t\t));\r\n\t\t}\r\n\r\n\t\t$document = $em -> getRepository('AcsilServerAppBundle:Document') -> findOneById($id);\r\n $folderId = $document->getFolder();\r\n\t\tif (!$document) {\r\n\t\t\tthrow $this -> createNotFoundException('No document found for id ' . $id);\r\n\t\t}\r\n\r\n\t\t$builder = new MaskBuilder();\r\n\t\tif ($right == \"EDIT\") {\r\n\t\t\t$builder -> add('view') -> add('edit') -> add('delete');\r\n\t\t\t$document->setIsShared(1);\r\n\t\t\t}\r\n\t\tif ($right == \"VIEW\") {\r\n\t\t\t$builder -> add('view');\r\n\t\t\t$document->setIsShared(1);\r\n\t\t}\r\n /**\r\n\t\t * Set the rights for the other user \r\n\t\t*/\r\n\t\t$aclProvider = $this -> container -> get('security.acl.provider');\r\n\t\t$objectIdentity = ObjectIdentity::fromDomainObject($document);\r\n\t\t$acl = $aclProvider -> findAcl($objectIdentity);\r\n\t\t$securityContext = $this -> container -> get('security.context');\r\n\t\t$securityIdentity = UserSecurityIdentity::fromAccount($friend);\r\n\t\t$aces = $acl -> getObjectAces();\r\n\r\n\t\tforeach ($aces as $index => $ace) {\r\n\t\t\tif ($ace -> getSecurityIdentity() == $securityIdentity) {\r\n\t\t\t\t$acl -> deleteObjectAce($index);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($right != \"DELETE\") {\r\n\t\t\t$mask = $builder -> get();\r\n\t\t\tvar_dump($builder -> get());\r\n\t\t\t$acl -> insertObjectAce($securityIdentity, $mask);\r\n\t\t}\r\n\telse\r\n\t{\r\n\t\t\t$document->setIsShared(0);\r\n\t}\r\n\t\t$aclProvider -> updateAcl($acl);\r\n\t\t$em -> persist($document);\r\n\t\t$em -> flush();\r\n\t\treturn $this -> redirect($this -> generateUrl('_managefile', array(\r\n 'folderId' => $folderId,\r\n )));\r\n\t}",
"public function getFile() {\n return $this->fedora->getDatastreamREST($this->pid, \"FILE\");\n }",
"public function shareByLink($id){\n $user = DbFile::where('id',$id)->first();\n $filePath = $user->FilePath;\n $url = Storage::disk('s3')->temporaryUrl(\n $filePath,\n now()->addHour(),\n ['ResponseContentDisposition' => 'attachment']);\n return back()->with('success',\"Here is your link to share your file $url\");\n }",
"function cma_shareyn_documents($document_id = NULL, $share_yn = NULL)\n{\n// error_log('cma_remove_to_notebook - item_type:' . $item_type . ': and item_id:' . $item_id . ': and item_stfips:' . $item_stfips . ':');\n\n // If no onetcode is passed, we create an appropriate message\n if (!isset($document_id)) {\n return \"Missing User Id, nothing done\";\n }\n\n $output = '';\n\n $cma = vcnCma::getInstance();\n\n $cma->getCmaUserInfo();\n\n $output = $cma->shareyndocuments($document_id, $share_yn);\n\n echo $output;\n die; // this prevents theming and such, returning just the results of the rest call....\n}",
"function getFileAPI() {\n // use mongodb median6.servers of type \"files\"\n // or false if none are available\n // returns something like 'http://m6-files-1.dev.emerson.edu:9090/'\n\n global $m6db;\n\n $get_fileapi_servers = $m6db->servers->find( array('t' => 'files', 'e' => true) );\n\n if ($get_fileapi_servers->count() > 0) {\n $fileapi_servers = array();\n foreach ($get_fileapi_servers as $server) {\n $fileapi_url = 'http://';\n if (isset($server['hostname']) && trim($server['hostname']) != '') {\n $fileapi_url .= $server['hostname']; // try for hostname first\n } else {\n $fileapi_url .= $server['ip']; // use IP instead by default\n }\n $fileapi_url .= ':'.$server['port'].'/'; // always include the port and trailing slash\n $fileapi_servers[] = $fileapi_url;\n }\n unset($server);\n return $fileapi_servers[array_rand($fileapi_servers)]; // return a random one\n } else {\n return false;\n }\n}",
"public function create_share($hostname, $client_api_id, $client_secret, $new_username, $new_password, $sharefile_folder_id, $sharefile_user_id){\n\t\t\n\t\t$user_id = '584f98ca-be03-49bd-8cf9-047d359cc7c2';\n\t\t$username = '[email protected]';\n\t\t\n\t\t/*$client = array(\"ShareType\"=>\"Send\", \"Title\"=>\"Sample Send Share\",\n\t\t\t\t\"ExpirationDate\"=>\"9999-12-31\",\"RequireLogin\"=>FALSE,\"RequireUserInfo\"=>FALSE,\"MaxDownloads\"=>\"-1\",\"UsesStreamIDs\"=>FALSE,\n\t\t\t\t\"Items\"=>array(\"Id\"=>$sharefile_folder_id),\"Recipients\"=>array(\"User\"=>array(\"Id\"=>$user_id),\"User\"=>array(\"Email\"=>$username)));\n\t\t$data = json_encode($client);\n\t\treturn $data;*/\n\t\t$data = '{ \n\t\t\t\t \"ShareType\":\"Send\", \n\t\t\t\t \"Title\":\"Sample Send Share\", \n\t\t\t\t \"Items\": [ { \"Id\":\"'.$sharefile_folder_id.'\" } ], \n\t\t\t\t \"Recipients\":[ { \"User\": { \"Id\":\"'.$user_id.'\" } }, { \"User\": { \"Email\": \"'.$username.'\" } } ], \n\t\t\t\t \"ExpirationDate\": \"9999-12-31\", \n\t\t\t\t \"RequireLogin\": false, \n\t\t\t\t \"RequireUserInfo\": false, \n\t\t\t\t \"MaxDownloads\": -1, \n\t\t\t\t \"UsesStreamIDs\": false\n\t\t\t\t} ';\n\t\t//return $data;\t\t\n\t\t$token = $this->authenticate($hostname, $client_api_id, $client_secret, $new_username, $new_password);\n\t\n\t\tif ($token) {\n\t\t\t$this->get_root($token, TRUE);\n\t\t}\n\t\t\t\n\t\t$uri = \"https://\".$this->get_hostname($token).\"/sf/v3/Shares?notify=false\";\t\n\t\t\n\t\t$headers = $this->get_authorization_header($token);\t\n\t\t$headers[] = \"Content-Type: application/json\";\n\t\t//print_r($headers);\n\t\t \n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 300);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t \n\t\t$curl_response = curl_exec ($ch);\n\t \n\t\t$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\t$curl_error_number = curl_errno($ch);\n\t\t$curl_error = curl_error($ch);\n\t \n\t\t//echo $curl_response.\"\\n\"; // output entire response\n\t\t//return $http_code.\"\\n\"; // output http status code\n\t\t \n\t\tcurl_close ($ch);\n\t \n\t\tif ($http_code == 200) {\n\t\t\t$item = json_decode($curl_response);\n\t\t\treturn ($item); // print entire new item object\n\t\t\t//echo \"Created Folder: \".$item->Id.\"\\n\";\t\t\t\n\t\t}\t\t\n\t\t\t\t\n\t}",
"function getFile($email,$token,$transaction){return ($file=file('https://ws.pagseguro.uol.com.br/v2/transactions/'.$transaction.'?email='.$email.'&token='.$token)?explode('-|-',str_replace('><', \">-|-<\", $file[0])):false);}",
"static public function getDownloadFileByToken(Session $sess, string $hash, int $collectionId) {\n if (!$sess->has(self::SESS_HASH_KEY)) {\n return false;\n }\n $token = $sess->get(self::SESS_HASH_KEY)[$hash . $collectionId] ?? false;\n if ($token === false || !file_exists($token['file'])) {\n return false;\n }\n $resource = fopen($token['file'], 'r');\n $token['resorce'] = $resource;\n return $token;\n }",
"public function DownloadShareImage()\n {\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BA7 begin\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BA7 end\n }",
"public function get_file($data)\n {\n if (!isset($data['rel_id']) || empty($data['rel_id'])) {\n throw new \\Box_Exception('Related object ID is missing');\n }\n if (!isset($data['extension']) || empty($data['extension'])) {\n throw new \\Box_Exception('Extension name is missing');\n }\n\n $bindings = array(\n ':rel_id' => $data['rel_id'],\n ':extension' => $data['extension'],\n ':client_id' => $this->getIdentity()->id,\n );\n $dropboxFile = $this->di['db']->findOne('dropbox', 'rel_id = :rel_id AND client_id = :client_id AND extension LIKE :extension', $bindings);\n if (!$dropboxFile) {\n throw new \\Box_Exception('File does not exist');\n }\n\n return $this->getService()->downloadFile($dropboxFile);\n }",
"public function shareFolderAction(Request $request, $id) {\r\n\t\t\r\n\t\t$parameters = $request -> request -> get('acsilserver_appbundle_sharefiletype');\r\n\t\t$friendName = $parameters['userMail'];\r\n\t\t$right = $parameters['rights'];\r\n\t\tif ($friendName == NULL || $right == NULL) {\r\n\t\t\tthrow $this -> createNotFoundException('Invalid data.');\r\n\t\t\treturn $this -> redirect($this -> generateUrl('_managefile', array(\r\n 'folderId' => 0,\r\n )));\r\n\t\t}\r\n\t\t$em = $this -> getDoctrine() -> getManager();\r\n\t\t$friend = $em -> getRepository('AcsilServerAppBundle:User') -> findOneByEmail($friendName);\r\n\r\n\t\tif (!$friend) {\r\n\t\t\t$errorShare = 'No friends';\r\n\t\t\t$shareFolderForm = $this -> createForm(new ShareFileType(), new ShareFile());\r\n\t\t\treturn $this -> render('AcsilServerAppBundle:Upload:shareFolder.html.twig',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'shareFolderForm' => $shareFolderForm -> createView(),\r\n\t\t\t\t\t'errorShare' => $errorShare,\r\n\t\t\t\t));\r\n\t\t}\r\n\r\n\t\t$folder = $em \r\n\t\t\t-> getRepository('AcsilServerAppBundle:Folder') \r\n\t\t\t-> findOneBy(array('id' => $id));\r\n\r\n\t\t$folderId = $folder->getParentFolder();\r\n\t\t$file_list = $folder->listDirectory($folder->getAbsolutePath());\r\n\t\t$builder = new MaskBuilder();\r\n\t\tforeach ($file_list as $file) {\r\n\t\t$tmp = basename($file);\r\n\t\tif ($tmp[0] == 'f')\r\n\t\t{\r\n\t\t\t$document = $em \r\n\t\t\t-> getRepository('AcsilServerAppBundle:Document') \r\n\t\t\t-> findOneBy(array('path' => $tmp));\r\n\t\t\t\t\tif (!$document) {\r\n\t\t\tthrow $this -> createNotFoundException('No document found for path ' . $tmp);\r\n\t\t}\r\n\t\t\t\t/* file ----------------------------- */\r\n\t\t$builder = new MaskBuilder();\r\n\t\tif ($right == \"EDIT\") {\r\n\t\t\t$builder -> add('view') -> add('edit') -> add('delete');\r\n\t\t\t$document->setIsShared(1);\r\n\t\t\t}\r\n\t\tif ($right == \"VIEW\") {\r\n\t\t\t$builder -> add('view');\r\n\t\t\t$document->setIsShared(1);\r\n\t\t}\r\n /**\r\n\t\t * Set the rights for the other user \r\n\t\t*/\r\n\t\t$aclProvider = $this -> container -> get('security.acl.provider');\r\n\t\t$objectIdentity = ObjectIdentity::fromDomainObject($document);\r\n\t\t$acl = $aclProvider -> findAcl($objectIdentity);\r\n\t\t$securityContext = $this -> container -> get('security.context');\r\n\t\t$securityIdentity = UserSecurityIdentity::fromAccount($friend);\r\n\t\t$aces = $acl -> getObjectAces();\r\n\r\n\t\tforeach ($aces as $index => $ace) {\r\n\t\t\tif ($ace -> getSecurityIdentity() == $securityIdentity) {\r\n\t\t\t\t$acl -> deleteObjectAce($index);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($right != \"DELETE\") {\r\n\t\t\t$mask = $builder -> get();\r\n\t\t\tvar_dump($builder -> get());\r\n\t\t\t$acl -> insertObjectAce($securityIdentity, $mask);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$document->setIsShared(0);\r\n\t\t}\r\n\t\t$aclProvider -> updateAcl($acl);\r\n\t\t$em -> persist($document);\r\n\t\t}\r\n\t\t}\r\n\t\t$em -> flush();\r\n\r\n\t\tforeach ($file_list as $file) {\r\n\t\t\t$tmp = basename($file);\r\n\t\t\tif ($tmp[0] == 'd')\r\n\t\t\t{\r\n\t\t\t\t$folder = $em \r\n\t\t\t\t-> getRepository('AcsilServerAppBundle:Folder') \r\n\t\t\t\t-> findOneBy(array('path' => $tmp));\r\n\t\t\t\tif (!$folder) {\r\n\t\t\t\tthrow $this -> createNotFoundException('No folder found for path ' . $tmp);\r\n\t\t\t\t}\r\n\t\t\t\t/* folder---------------------------------- */\r\n\t\t\t\tif ($right == \"EDIT\") {\r\n\t\t\t\t\t$builder -> add('view') -> add('edit') -> add('delete');\r\n\t\t\t\t\t$folder->setIsShared(1);\r\n\t\t\t\t}\r\n\t\t\t\tif ($right == \"VIEW\") {\r\n\t\t\t\t\t$builder -> add('view');\r\n\t\t\t\t\t$folder->setIsShared(1);\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t* Set the rights for the other user \r\n\t\t\t\t*/\r\n\t\t\t\t$aclProvider = $this -> container -> get('security.acl.provider');\r\n\t\t\t\t$objectIdentity = ObjectIdentity::fromDomainObject($folder);\r\n\t\t\t\t$acl = $aclProvider -> findAcl($objectIdentity);\r\n\t\t\t\t$securityContext = $this -> container -> get('security.context');\r\n\t\t\t\t$securityIdentity = UserSecurityIdentity::fromAccount($friend);\r\n\t\t\t\t$aces = $acl -> getObjectAces();\r\n\r\n\t\t\t\tforeach ($aces as $index => $ace) {\r\n\t\t\t\t\tif ($ace -> getSecurityIdentity() == $securityIdentity) {\r\n\t\t\t\t\t\t$acl -> deleteObjectAce($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 ($right != \"DELETE\") {\r\n\t\t\t\t\t$mask = $builder -> get();\r\n\t\t\t\t\tvar_dump($builder -> get());\r\n\t\t\t\t\t$acl -> insertObjectAce($securityIdentity, $mask);\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$folder->setIsShared(0);\r\n\t\t\t\t}\r\n\t\t\t\t$aclProvider -> updateAcl($acl);\r\n\t\t\t\t$em -> persist($folder);\r\n\t\t\t\t$em -> flush();\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t//last folder\r\n\t\t$folder = $em \r\n\t\t\t-> getRepository('AcsilServerAppBundle:Folder') \r\n\t\t\t-> findOneBy(array('id' => $id));\r\n\t\tif ($right == \"EDIT\") {\r\n\t\t\t$builder -> add('view') -> add('edit') -> add('delete');\r\n\t\t\t$folder->setIsShared(1);\r\n\t\t\t}\r\n\t\tif ($right == \"VIEW\") {\r\n\t\t\t$builder -> add('view');\r\n\t\t\t$folder->setIsShared(1);\r\n\t\t}\r\n /**\r\n\t\t * Set the rights for the other user \r\n\t\t*/\r\n\t\t$aclProvider = $this -> container -> get('security.acl.provider');\r\n\t\t$objectIdentity = ObjectIdentity::fromDomainObject($folder);\r\n\t\t$acl = $aclProvider -> findAcl($objectIdentity);\r\n\t\t$securityContext = $this -> container -> get('security.context');\r\n\t\t$securityIdentity = UserSecurityIdentity::fromAccount($friend);\r\n\t\t$aces = $acl -> getObjectAces();\r\n\r\n\t\tforeach ($aces as $index => $ace) {\r\n\t\t\tif ($ace -> getSecurityIdentity() == $securityIdentity) {\r\n\t\t\t\t$acl -> deleteObjectAce($index);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($right != \"DELETE\") {\r\n\t\t\t$mask = $builder -> get();\r\n\t\t\tvar_dump($builder -> get());\r\n\t\t\t$acl -> insertObjectAce($securityIdentity, $mask);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$folder->setIsShared(0);\r\n\t\t}\r\n\t\t$aclProvider -> updateAcl($acl);\r\n\t\t$em -> persist($folder);\r\n\t\t$em -> flush();\t\t\t\r\n\r\n\t\treturn $this -> redirect($this -> generateUrl('_managefile', array(\r\n 'folderId' => $folderId,\r\n )));\r\n\t}",
"private function createWopiSessionForPublicLink(array $docInfo) : array {\n\t\t$editorUid = $this->getCurrentUserUID();\n\t\t$ownerUid = $docInfo['owner'];\n\t\t$fileId = $docInfo['fileid'];\n\t\t$mimetype = $docInfo['mimetype'];\n\t\t$path = $docInfo['path'];\n\t\t$version = $docInfo['version'];\n\t\t$allowEdit = $docInfo['allowEdit'];\n\n\t\t$this->logger->info('Generating WOPI Token for file {fileId}, version {version}.', [\n\t\t\t'app' => $this->appName,\n\t\t\t'fileId' => $fileId,\n\t\t\t'version' => $version ]);\n\n\t\t$this->updateDocumentEncryptionAccessList($ownerUid, $editorUid, $path);\n\n\t\t$serverHost = $this->request->getServerProtocol() . '://' . $this->request->getServerHost();\n\n\t\t$wopiSessionAttr = WOPI::ATTR_CAN_VIEW | WOPI::ATTR_CAN_EXPORT | WOPI::ATTR_CAN_PRINT;\n\n\t\t// If token is for some versioned file\n\t\t// Check if mimetime supports updates\n\t\t$wopiSrc = $this->discoveryService->getWopiSrc($mimetype);\n\t\tif (($allowEdit === true) && isset($wopiSrc['action'])\n\t\t\t\t&& ($wopiSrc['action'] === 'edit' || $wopiSrc['action'] === 'view_comment')\n\t\t\t\t&& ($version === 0)) {\n\t\t\t$wopiSessionAttr = $wopiSessionAttr | WOPI::ATTR_CAN_UPDATE;\n\t\t}\n\n\t\t$row = new Db\\Wopi();\n\t\t$tokenArray = $row->generateToken($fileId, $version, $wopiSessionAttr, $serverHost, $ownerUid, $editorUid);\n\n\t\t// Return the token.\n\t\t$result = [\n\t\t\t'access_token' => $tokenArray['access_token'],\n\t\t\t'access_token_ttl' => $tokenArray['access_token_ttl'],\n\t\t\t'sessionid' => '0' // default shared session\n\t\t];\n\t\t$this->logger->debug('Issued token: {result}', ['app' => $this->appName, 'result' => $result]);\n\t\treturn $result;\n\t}",
"public function getDocument ($document) {\n\t\t$url = $this->apiBaseURL . \"document/\".$document;\n\t\t$header = array(\"Accept: application/json\", \"Authorization: Bearer \".$this->clientToken);\n\t\treturn self::makeCurlRequest ($url, $header, \"\", false);\n\t}",
"public function get_list_files(){\n\t\t\n\t\t$sharedWithMe=$this->files_sharedWithMe();\n\t\t\n\t\t $optParams = array(\n\t\t\t'fields' => 'nextPageToken, files(id, name,mimeType)');\n\t\t$files_list=$this->drive_service->files->listFiles($optParams);\n\t\t\n\t\t$result= array();\n\t\tif (count($files_list->getFiles()) == 0) {\n \t\treturn array_push($result,\"No files fount\");\n \t\t} \n \t\telse {\n\n\t \t\tforeach ($files_list->getFiles() as $file) {\n\t \t\t\t\n\t \t\t\t$shared=in_array($file->getId(),$sharedWithMe);\t \t\t\t\n\t \t\t\tarray_push($result,\n\t \t\t\t\t['name'=>$file->getName(),\n\t \t\t\t\t'id'=> $file->getId(),\n\t \t\t\t\t'type' => $file->getMimeType(),\n\t \t\t\t\t'shared' =>$shared\n\t \t\t\t\t]);\n\n\t \t\t}\n \t\t}\n \t\treturn $result;\n \t\t\n\t}",
"function testRequestViaFileGetContent() {\n\t\t$result = $this->np->setConnectionType('file_get_content')->documentsTracking('59000082032106');\n\t\t$this->assertTrue($result['success']);\n\t}",
"private function getAccessToken() {\n \n $authUrl = $this->driveClient->createAuthUrl();\n $authCode = $_GET['auth'];\n\n /**\n * Exchange authCode for accessToken\n **/\n $accessToken = $this->driveClient->authenticate($authCode);\n $accessTokenObj = json_decode($accessToken);\n\n if ($accessTokenObj->refresh_token) {\n file_put_contents($this->tokenFile, serialize($accessToken));\n } else {\n die(\"No refresh token in response.\");\n }\n return $accessToken;\n }",
"abstract public function getShareUrl();",
"public function getFile(): File\n {\n return File::findById($this->fileId);\n }",
"private function createWopiSessionForFederatedShare(array $docInfo, array $remoteWopiInfo) : array {\n\t\t// base doc details\n\t\t$ownerUid = $docInfo['owner'];\n\t\t$fileId = $docInfo['fileid'];\n\t\t$path = $docInfo['path'];\n\t\t$version = $docInfo['version'];\n\n\t\t// editor is federated user\n\t\t$editor = $remoteWopiInfo['editor'];\n\n\t\t// server host where the edit session is created\n\t\t$serverHost = $this->request->getServerProtocol() . '://' . $this->request->getServerHost();\n\n\t\t// take attributes for session from remote wopi info\n\t\t$wopiSessionAttr = $remoteWopiInfo['attributes'];\n\n\t\t$this->logger->info('Generating WOPI Token for file {fileId}, version {version}.', [\n\t\t\t'app' => $this->appName,\n\t\t\t'fileId' => $fileId,\n\t\t\t'version' => $version ]);\n\n\t\t$this->updateDocumentEncryptionAccessList($ownerUid, $editor, $path);\n\n\t\t$row = new Db\\Wopi();\n\t\t$tokenArray = $row->generateToken($fileId, $version, $wopiSessionAttr, $serverHost, $ownerUid, $editor);\n\n\t\t// Return the token.\n\t\t$result = [\n\t\t\t'access_token' => $tokenArray['access_token'],\n\t\t\t'access_token_ttl' => $tokenArray['access_token_ttl'],\n\t\t\t'sessionid' => '0' // default shared session\n\t\t];\n\t\t$this->logger->debug('Issued token: {result}', ['app' => $this->appName, 'result' => $result]);\n\t\treturn $result;\n\t}",
"public function store(Request $request)\n {\n $user_login = $request->input('login');\n $files = $request->input('files');\n\n try {\n $user_login = Crypt::decryptString($user_login);\n } catch (DecryptException $e) {\n return abort('404');\n }\n\n $temp_folder_name = 'temp-' . $user_login;\n $public_folder_name = 'public/' . $user_login;\n\n foreach($files as $file) {\n\n $file_id = explode('.', str_replace($temp_folder_name . '/', '', $file['serverId']))[0];\n $file_serverId = str_replace($temp_folder_name . '/', $public_folder_name . '/', $file['serverId']);\n\n $file_name = $file_id . '.' . $file['fileExtension'];\n $public_path = $public_folder_name . '/' . $file_name;\n\n //$mimeType = MimeType::get($file['fileExtension']);\n\n //gen share id\n $shareId = $this->checkExistId(str_random(9), 'shareId');\n $random1 = str_random(1);\n //create share link\n $shareLink = base64_encode($shareId . $random1);\n \n $f = new FileModel;\n $f->fileId = $this->checkExistId($file['id'], 'fileId');\n $f->nameId = $file_id;\n $f->serverId = $file_serverId;\n $f->filename = $file['filename'];\n $f->filenameWithoutExtension = $file['filenameWithoutExtension'];\n $f->fileType = $file['fileType'];\n $f->fileExtension = $file['fileExtension'];\n //$f->mimeType = $mimeType; \n $f->fileSize = $file['fileSize'];\n $f->fileLastModified = (string) isset($file['fileLastModified']) ? $file['fileLastModified'] : \"\"; // MS Edge Can't read fileLastModified\n $f->isShare = 0;\n $f->shareId = $shareId;\n $f->shareLink = $shareLink;\n $f->loginUser = $user_login;\n $f->save();\n\n if(Storage::exists($file['serverId'])){\n // 1. Move file from temp to public\n Storage::move($file['serverId'], $public_path);\n }\n }\n\n if(Storage::exists($temp_folder_name)){\n Storage::deleteDirectory($temp_folder_name);\n }\n\n return json_encode($files);\n\n }"
] | [
"0.75427073",
"0.61248237",
"0.59529954",
"0.59147006",
"0.568832",
"0.5610733",
"0.5610432",
"0.54456556",
"0.54130536",
"0.5209221",
"0.51768994",
"0.51746064",
"0.5171508",
"0.5148002",
"0.51058036",
"0.5089498",
"0.5062142",
"0.5060378",
"0.5048651",
"0.50149643",
"0.5011115",
"0.5006464",
"0.49983186",
"0.4950038",
"0.494413",
"0.49347007",
"0.49240366",
"0.4920008",
"0.49099374",
"0.49079096"
] | 0.67414534 | 1 |
API endpoint for externalapps such as new owncloud web frontend to return the information needed to load the document using the fileId. | public function get($fileId) {
try {
if (\is_numeric($fileId)) {
// parse fileId pointing to file
$fileId = (int) $fileId;
} else {
return $this->responseError($this->l10n->t('Invalid request parameters'));
}
// Normal editing or share by user/group
$docinfo = $this->documentService->getDocumentByUserId($this->getCurrentUserUID(), $fileId, null);
if (!$docinfo) {
$this->logger->warning("Cannot retrieve document with fileid {fileid}", ["fileid" => $fileId]);
return null;
}
// Get document discovery
$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);
if (!$wopiSrc) {
$this->logger->error("Cannot retrieve discovery for document", []);
return null;
}
// Restrict filesize
$maxUploadFilesize = \OCP\Util::maxUploadFilesize("/");
// Get wopi token
$wopiAccessInfo = $this->createWopiSessionForAuthUser($docinfo);
// Create document index
$docRetVal = [
'uploadMaxFilesize' => $maxUploadFilesize,
'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize),
'title' => $docinfo['name'],
'fileId' => $docinfo['fileid'],
'instanceId' => $this->settings->getSystemValue('instanceid'),
'locale' => $this->getLocale(),
'version' => \strval($docinfo['version']),
'sessionId' => $wopiAccessInfo['sessionid'],
'access_token' => $wopiAccessInfo['access_token'],
'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],
'urlsrc' => $wopiSrc['urlsrc'],
'default_action' => $wopiSrc['action'],
'path' => $docinfo['path']
];
return new JSONResponse($docRetVal);
} catch (\Exception $e) {
return new JSONResponse([
'status' => 'error',
'message' => 'Document index could not be found'
], Http::STATUS_BAD_REQUEST);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getExternalFileDetailsById($fileId)\r\n\r\n\t{\r\n\r\n\t\t$arrFileDetails = array();\t\t\t\r\n\r\n\t\t$query = $this->db->query('SELECT * FROM teeme_external_docs WHERE docId='.$fileId);\r\n\r\n\t\t\r\n\r\n\t\tif($query->num_rows() > 0)\r\n\r\n\t\t{\t\t\t\r\n\r\n\t\t\tforeach ($query->result() as $docData)\r\n\r\n\t\t\t{\t\r\n\r\n\t\t\t\t$arrFileDetails['docId'] \t\t= $docData->docId;\r\n\r\n\t\t\t\t$arrFileDetails['workSpaceId'] \t= $docData->workSpaceId;\r\n\r\n\t\t\t\t$arrFileDetails['workSpaceType'] = $docData->workSpaceType;\t\r\n\r\n\t\t\t\t$arrFileDetails['userId'] \t\t= $docData->userId;\t\t\r\n\r\n\t\t\t\t$arrFileDetails['docCaption'] \t= $docData->docCaption;\t\r\n\r\n\t\t\t\t$arrFileDetails['docName']\t \t= $docData->docName;\t\r\n\r\n\t\t\t\t$arrFileDetails['docPath']\t \t= $docData->path;\r\n\r\n\t\t\t\t$arrFileDetails['docCreatedDate']= $docData->createdDate;\t\r\n\r\n\t\t\t\t$arrFileDetails['version']\t\t= $docData->version;\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t}\r\n\r\n\t\t}\t\t\t\r\n\r\n\t\treturn $arrFileDetails;\r\n\r\n\t}",
"public function index($fileId, $dir) {\n\t\tif (\\is_numeric($fileId)) {\n\t\t\t// parse fileId pointing to file\n\t\t\t$fileId = (int) $fileId;\n\t\t} elseif ($fileId === '' || $fileId === null) {\n\t\t\t// base template\n\t\t\t$fileId = null;\n\t\t} else {\n\t\t\treturn $this->responseError($this->l10n->t('Invalid request parameters'));\n\t\t}\n\n\t\t// Get doc index if possible\n\t\tif ($fileId !== null) {\n\t\t\t// Normal editing or share by user/group/federated\n\t\t\t$docinfo = $this->documentService->getDocumentByUserId($this->getCurrentUserUID(), $fileId, $dir);\n\t\t\tif (!$docinfo) {\n\t\t\t\t$this->logger->warning(\"Cannot retrieve document with fileid {fileid} in dir {dir}\", [\"fileid\" => $fileId, \"dir\" => $dir]);\n\t\t\t\treturn $this->responseError(\n\t\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Get wopi access info\n\t\t\t$wopiAccessInfo = $this->createWopiSessionForAuthUser($docinfo);\n\n\t\t\t// If federated share mount redirect to remote server for WOPI editing,\n\t\t\t// providing also access token for OCS federated handshake\n\t\t\tif (isset($docinfo['federatedShareToken'], $docinfo['federatedShareRelativePath'], $docinfo['federatedServer'])) {\n\t\t\t\t$remoteFileUrl = $this->federationService->getRemoteFileUrl(\n\t\t\t\t\t$docinfo['federatedShareToken'],\n\t\t\t\t\t$docinfo['federatedShareRelativePath'],\n\t\t\t\t\t$docinfo['federatedServer'],\n\t\t\t\t\t$wopiAccessInfo['access_token']\n\t\t\t\t);\n\t\t\t\t$response = new RedirectResponse($remoteFileUrl);\n\t\t\t\t$response->addHeader('X-Frame-Options', 'ALLOW');\n\t\t\t\treturn $response;\n\t\t\t}\n\n\t\t\t// Get document discovery for this server\n\t\t\t$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);\n\t\t\tif (!$wopiSrc) {\n\t\t\t\t$this->logger->error(\"Cannot retrieve discovery for document\", []);\n\t\t\t\treturn $this->responseError(\n\t\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t\t);\n\t\t\t}\n\t\n\t\t\t// Decide max upload size\n\t\t\t$maxUploadFilesize = \\OCP\\Util::maxUploadFilesize(\"/\");\n\n\t\t\t// Create document index\n\t\t\t$docRetVal = [\n\t\t\t\t'uploadMaxFilesize' => $maxUploadFilesize,\n\t\t\t\t'uploadMaxHumanFilesize' => \\OCP\\Util::humanFileSize($maxUploadFilesize),\n\t\t\t\t'title' => $docinfo['name'],\n\t\t\t\t'fileId' => $docinfo['fileid'],\n\t\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t\t'locale' => $this->getLocale(),\n\t\t\t\t'version' => \\strval($docinfo['version']),\n\t\t\t\t'sessionId' => $wopiAccessInfo['sessionid'],\n\t\t\t\t'access_token' => $wopiAccessInfo['access_token'],\n\t\t\t\t'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],\n\t\t\t\t'default_action' => $wopiSrc['action'],\n\t\t\t\t'urlsrc' => $wopiSrc['urlsrc'],\n\t\t\t\t'path' => $docinfo['path']\n\t\t\t];\n\t\t} else {\n\t\t\t// base template\n\t\t\t$docRetVal = [];\n\t\t}\n\n\t\t// Handle general response\n\t\t$wopiRemote = $this->discoveryService->getWopiUrl();\n\t\t$webSocket = $this->parseWopiSocket($wopiRemote);\n\t\tif (!$webSocket) {\n\t\t\treturn $this->responseError($this->l10n->t('Collabora Online: Invalid URL \"%s\".', [$wopiRemote]), $this->l10n->t('Please ask your administrator to check the Collabora Online server setting.'));\n\t\t}\n\n\t\t$retVal = \\array_merge(\n\t\t\t[\n\t\t\t\t'enable_previews' => $this->settings->getSystemValue('enable_previews', true),\n\t\t\t\t'wopi_url' => $webSocket,\n\t\t\t\t'doc_format' => $this->appConfig->getAppValue('doc_format'),\n\t\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t\t'canonical_webroot' => $this->appConfig->getAppValue('canonical_webroot'),\n\t\t\t\t'show_custom_header' => false\n\t\t\t],\n\t\t\t$docRetVal\n\t\t);\n\t\t\n\t\t// set active navigation entry\n\t\t$this->navigationManager->setActiveEntry('richdocuments_index');\n\n\t\t// Normal editing and user/group share editing\n\t\t// Parameter $dir is not used during indexing, but might be used by Document Server\n\t\t$renderAs = 'user';\n\n\t\t// prepare template response\n\t\t$response = new TemplateResponse('richdocuments', 'documents', $retVal, $renderAs);\n\t\t$policy = new ContentSecurityPolicy();\n\t\t$policy->addAllowedFrameDomain($this->domainOnly($wopiRemote));\n\t\t$policy->allowInlineScript(true);\n\t\t$response->setContentSecurityPolicy($policy);\n\n\t\treturn $response;\n\t}",
"public function fileGetById(){\n\t\t$post = $this -> input -> post();\n\n\t\tif(isset($post['id'])){\n\t\t\t$id = intval($post['id']);\n\t\t}else{\n\t\t\texit(-1);\n\t\t}\n\n\t\t$result = $this -> file_model -> getByFileId($id);\n\t\tif($result){\n\t\t\techo json_encode($result);\n\t\t}else{\n\t\t\texit(-1);\n\t\t}\n\t}",
"function getProjectDocument($projectId, $fileId){\n\t\t$this->db->select('*');\n\t\t$this->db->from('project_file');\n\t\t$this->db->join('file_status', 'file_status_id=pf_file_status_key');\n\t\t$this->db->where('project_file_id', $fileId);\n\t\t$this->db->where('pf_project_key', $projectId);\n\t\t\n\t\treturn $this->db->get()->row_array();\n\t}",
"public function public($shareToken, $fileId) {\n\t\tif (\\is_string($shareToken) && \\strlen($shareToken) > 0 && \\is_numeric($fileId)) {\n\t\t\t// fileId is a numeric string indicating the file in the folder link share (via shareToken)\n\t\t\t$fileId = (int) $fileId;\n\t\t} elseif (\\is_string($shareToken) && \\strlen($shareToken) > 0 && ($fileId === '' || $fileId === null)) {\n\t\t\t// shareToken points directly to the file\n\t\t\t$fileId = null;\n\t\t} else {\n\t\t\treturn $this->responseError($this->l10n->t('Invalid request parameters'));\n\t\t}\n\n\t\t// Share by link in public folder or file\n\t\t$docinfo = $this->documentService->getDocumentByShareToken($shareToken, $fileId);\n\t\tif (!$docinfo) {\n\t\t\t$this->logger->warning(\"Cannot retrieve document from share {token} that has fileid {fileId}\", [\"token\" => $shareToken, \"fileId\" => $fileId]);\n\t\t\treturn $this->responseError(\n\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t);\n\t\t}\n\n\t\t// Get wopi token\n\t\t$wopiAccessInfo = $this->createWopiSessionForPublicLink($docinfo);\n\n\t\t// Get document discovery\n\t\t$wopiSrc = $this->discoveryService->getWopiSrc($docinfo['mimetype']);\n\t\tif (!$wopiSrc) {\n\t\t\t$this->logger->error(\"Cannot retrieve discovery for document\", []);\n\t\t\treturn $this->responseError(\n\t\t\t\t$this->l10n->t('Collabora Online: Error encountered while opening the document.', []),\n\t\t\t\t$this->l10n->t('Please contact the administrator.', [])\n\t\t\t);\n\t\t}\n\n\t\t// Handle general response\n\t\t$wopiRemote = $this->discoveryService->getWopiUrl();\n\t\t$webSocket = $this->parseWopiSocket($wopiRemote);\n\t\tif (!$webSocket) {\n\t\t\treturn $this->responseError($this->l10n->t('Collabora Online: Invalid URL \"%s\".', [$wopiRemote]), $this->l10n->t('Please ask your administrator to check the Collabora Online server setting.'));\n\t\t}\n\n\t\t// FIXME: In public links allow max 100MB\n\t\t$maxUploadFilesize = 100*1000*1000;\n\n\t\t// Public share link (folder or file)\n\t\t$renderAs = 'base';\n\n\t\t$this->navigationManager->setActiveEntry('richdocuments_index');\n\t\t$retVal = [\n\t\t\t'uploadMaxFilesize' => $maxUploadFilesize,\n\t\t\t'uploadMaxHumanFilesize' => \\OCP\\Util::humanFileSize($maxUploadFilesize),\n\t\t\t'title' => $docinfo['name'],\n\t\t\t'fileId' => $docinfo['fileid'],\n\t\t\t'locale' => $this->getLocale(),\n\t\t\t'version' => \\strval($docinfo['version']),\n\t\t\t'sessionId' => $wopiAccessInfo['sessionid'],\n\t\t\t'access_token' => $wopiAccessInfo['access_token'],\n\t\t\t'access_token_ttl' => $wopiAccessInfo['access_token_ttl'],\n\t\t\t'urlsrc' => $wopiSrc['urlsrc'],\n\t\t\t'default_action' => $wopiSrc['action'],\n\t\t\t'path' => $docinfo['path'],\n\t\t\t'enable_previews' => $this->settings->getSystemValue('enable_previews', true),\n\t\t\t'wopi_url' => $webSocket,\n\t\t\t'doc_format' => $this->appConfig->getAppValue('doc_format'),\n\t\t\t'instanceId' => $this->settings->getSystemValue('instanceid'),\n\t\t\t'canonical_webroot' => $this->appConfig->getAppValue('canonical_webroot'),\n\t\t\t'show_custom_header' => true // public link should show a customer header without buttons\n\t\t];\n\n\t\t$response = new TemplateResponse('richdocuments', 'documents', $retVal, $renderAs);\n\t\t$policy = new ContentSecurityPolicy();\n\t\t$policy->addAllowedFrameDomain($this->domainOnly($wopiRemote));\n\t\t$policy->allowInlineScript(true);\n\t\t$response->setContentSecurityPolicy($policy);\n\n\t\treturn $response;\n\t}",
"public function getallavailabledocsAction(){\n if ($this->getRequest()->isGet()) {\n $current_page = $_GET['current_page'];\n $items_per_page = $_GET['items_per_page'];\n if(isset($_GET['location'])){\n $loction = $_GET['location'];\n }\n if(isset($_GET['date'])){\n $date = $_GET['date'];\n }\n if(isset($_GET['keywords'])){\n $keywords = $_GET['keywords'];\n }\n\n $records = array();\n $item_ids = Incite_DocumentsController::populateViewSearchResults();\n\n if (count($item_ids) > 0 ) {\n $total_pages = ceil(count($item_ids) / $items_per_page);\n $data['total_pages'] = $total_pages;\n for ($i = ($current_page - 1) * $items_per_page; $i < $items_per_page * $current_page; $i++) {\n if ($i >= count($item_ids)){\n break;\n }\n\n $record = get_record_by_id('item', $item_ids[$i]);\n $file = $record->getFile();\n\n if($file != null){\n $records[] = array('id' => $item_ids[$i],\n 'date' => trim(metadata($record, array('Dublin Core', 'Date'))),\n 'desc' => metadata($record, array('Dublin Core','Description')),\n 'name' => metadata($record, array('Dublin Core','Title')),\n 'loc' => metadata($record, array('Item Type Metadata', 'Location')),\n 'contr'=> metadata($record, array('Dublin Core', 'Contributor')),\n 'rights' =>metadata($record, array('Dublin Core', 'Rights')),\n 'src' => metadata($record, array('Dublin Core', 'Rights')),\n 'url'=> get_image_url_for_item($record, true),\n 'taskinfo'=>Incite_DocumentsController::populateProgress($item_ids[$i]),\n 'lat_long' => loc_to_lat_long(metadata($record, array('Item Type Metadata', 'Location'))));\n\n }\n }\n $data['records'] = $records;\n echo json_encode($data);\n }else{\n echo 'false';\n }\n }\n }",
"public function cfdi_get() {\n $dao = new GenericDAO();\n $APIRes = new API_Response();\n $rfc = $this->get(\"rfc\");\n $ext = $this->get(\"file\");\n $http_headers = $this->input->request_headers();\n $where = array(\n \"rfc\" => $rfc,\n \"apikey\" => $http_headers[\"x-api-key\"],\n \"file_ext\" => \".\" . $ext\n );\n\n if ((new Token)->validated($http_headers)) {\n $cfdi = $dao->find(\"upload_file\", $where);\n if (!isset($cfdi[\"code\"])) { //Record exist\n $APIRes->setResponse(REST_Controller::HTTP_OK, $cfdi);\n } elseif ($cfdi[\"code\"] > 0) { //There are some error in db\n $APIRes->setResponse(REST_Controller::HTTP_INTERNAL_SERVER_ERROR, array(\"error\" => $cfdi));\n } else if ($cfdi[\"code\"] == 0) { //Record not exist\n $APIRes->setResponse(REST_Controller::HTTP_CONFLICT, array(\"error\" => API_Response::NOT_EXIST));\n }\n } else {\n $APIRes->setResponse(REST_Controller::HTTP_BAD_REQUEST, array(\"error\" => API_Response::EXPIRED_TOKEN));\n }\n $this->set_response($APIRes->getResponse(), $APIRes->getHttpcode());\n }",
"function getFileId() {\n\t\treturn $this->getData('fileId');\n\t}",
"public function actionViewFile($id, $fileId)\r\n {\r\n $criteria = new CDbCriteria();\r\n $criteria->addCondition('file_id=' . $fileId);\r\n $products = new CActiveDataProvider('Results_add', array(\r\n 'criteria' => $criteria,\r\n 'pagination' => false\r\n ));\r\n\r\n $this->providerAccess = ProviderPerson::getProviderAccess($id);\r\n\r\n return $this->render('view-file', array(\r\n 'products' => $products,\r\n 'user_id' => $id\r\n ));\r\n }",
"public function getFileId()\n\t{\n\t\treturn $this->fileId; \n\n\t}",
"function load_file($project_id = null,$file_id = null) {\r\n if($this->Session->read(\"User.user_id\") && $this->request->is('post')){\r\n\r\n $this->TreeFile = ClassRegistry::init('TreeFile'); \r\n $this->TreeFile->id = $file_id ; \r\n \r\n //$results = $this->TreeFile->read(null,$file_id) ; \r\n App::import('Component','Filesoperations');\r\n $file = new FilesoperationsComponent() ; \r\n if($file->get_file_main_route($file_id,$project_id)){\r\n //header(\"HTTP/1.0 200 OK\");\r\n $this->set(\"output\",$file->get_file_main_route($file_id,$project_id));\r\n //highlight_file();\r\n } else {\r\n header(\"HTTP/1.0 404 Not Found\"); \r\n }\r\n\r\n\t }else {\r\n\t\t header(\"HTTP/1.0 404 Not Found\"); \r\n\t }\r\n \r\n }",
"public function getFileId()\n {\n return $this->fileId;\n }",
"function &getByFileId($fileId) {\n\t\t$returner = null;\n\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT * FROM monograph_artwork_files WHERE file_id = ?', $fileId\n\t\t);\n\n\t\tif (isset($result) && $result->RecordCount() != 0) {\n\t\t\t$returner =& $this->_fromRow($result->GetRowAssoc(false));\n\t\t}\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}",
"function printFile($service, $fileId) {\n try {\n $file = $service->files->get($fileId);\n\n print \"Title: \" . $file->getName();\n print \"; Description: \" . $file->getDescription();\n print \"; MIME type: \" . $file->getMimeType();\n print \"<br>\";\n } catch (Exception $e) {\n print \"An error occurred: \" . $e->getMessage();\n }\n }",
"public function getFile(): File\n {\n return File::findById($this->fileId);\n }",
"function printFile($service, $fileId) {\n try {\n $file = $service->files->get($fileId);\n\n print \"Title: \" . $file->getTitle();\n print \"Description: \" . $file->getDescription();\n print \"MIME type: \" . $file->getMimeType();\n } catch (apiAuthException $apie) {\n // Credentials have been revoked.\n // TODO: Redirect the user to the authorization URL.\n throw new RuntimeException('Not implemented!');\n } catch (apiException $e) {\n print \"An error occurred: \" . $e->getMessage();\n }\n }",
"function printFile($service, $fileId) {\n try {\n $file = $service->files->get($fileId);\n print \"Title: \" . $file->getTitle();\n print \"Description: \" . $file->getDescription();\n print \"MIME type: \" . $file->getMimeType();\n } catch (apiAuthException $apie) {\n // Credentials have been revoked.\n // TODO: Redirect the user to the authorization URL.\n throw new RuntimeException('Not implemented!');\n } catch (apiException $e) {\n print \"An error occurred: \" . $e->getMessage();\n }\n }",
"public function project_file_get () {\n\t\tif ( ! $this->get('file_id') || ! $this->get(\"project_id\") || ! $this->get(\"language_id\") ) { \n \tself::error($this->config->item(\"api_bad_request_code\"));\n return; \n }\n\n $File = new File();\n\n if ( ! $File->Load( $this->get(\"file_id\") ) ) {\n \tself::error($this->config->item(\"api_not_found_code\"));\n \treturn;\n }\n\n $project_id = $this->file_model->get_project_id($File->id);\n\n $modes = $this->user_roles_model->get_user_project_modes( $this->user->id, $project_id);\n\n if ( count($modes) == 0 ) {\n \t\tself::error(403);\n \t\t}\n\n $export = $File->Export();\n\n $this->load->model(\"project_model\");\n\n $keys = $this->file_model->project_language_keys($File->id, $this->project_model->base_language($this->get(\"project_id\")), $this->get(\"language_id\"));\n\n if ( $keys !== false ) {\n \t$export[\"keys\"] = $keys;\n \t}\n\n $this->response( $export );\n\t}",
"public function retrieve(string $file): RetrieveResponse;",
"public function index_get () {\n\t\tif ( ! $this->get('id') ) { \n \tself::error($this->config->item(\"api_bad_request_code\"));\n return; \n }\n\n $File = new File();\n\n if ( ! $File->Load( $this->get(\"id\") ) ) {\n \tself::error($this->config->item(\"api_not_found_code\"));\n \treturn;\n }\n\n $project_id = $this->file_model->get_project_id($this->get('id'));\n\n $modes = $this->user_roles_model->get_user_project_modes( $this->user->id, $project_id);\n\n if ( count($modes) == 0 ) {\n \t\tself::error(403);\n \t\t}\n\n $export = $File->Export();\n\n $this->load->model(\"file_model\");\n\n $keys = $this->file_model->language_keys($File->id);\n\n if ( $keys !== false ) {\n \t$export[\"keys\"] = $keys;\n \t}\n\n $this->response( $export );\n\t}",
"function getFileUrl($fileId,$request)\n {\n $baseurl = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath();\n \n return $baseurl.'/api/fileDownload/'.$fileId;\n\n }",
"protected function showFileRequest($file_id)\n {\n // verify the required parameter 'file_id' is set\n if ($file_id === null || (is_array($file_id) && count($file_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_id when calling showFile'\n );\n }\n\n $resourcePath = '/files/{file_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($file_id !== null) {\n $resourcePath = str_replace(\n '{' . 'file_id' . '}',\n ObjectSerializer::toPathValue($file_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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\\build_query($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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function getEdocContents($stored_name) \r\n{\r\n\tglobal $edoc_storage_option;\r\n\r\n\tif (!$edoc_storage_option) {\r\n\t\t\r\n\t\t//Download from \"edocs\" folder (use default or custom path for storage)\r\n\t\t$local_file = EDOC_PATH . $stored_name;\r\n\t\tif (file_exists($local_file) && is_file($local_file)) \r\n\t\t{\t\r\n\t\t\t// Open file for reading and output\r\n\t\t\t$fp = fopen($local_file, 'rb');\r\n\t\t\t$contents = fread($fp, filesize($local_file));\r\n\t\t\tfclose($fp);\r\n\t\t} \r\n\t\telse \r\n\t\t{\r\n\t\t\t## Give error message\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t} else {\r\n\t\t\r\n\t\t//Download using WebDAV\r\n\t\tinclude (APP_PATH_WEBTOOLS . 'webdav/webdav_connection.php');\r\n\t\t$wdc = new WebdavClient();\r\n\t\t$wdc->set_server($webdav_hostname);\r\n\t\t$wdc->set_port($webdav_port); $wdc->set_ssl($webdav_ssl);\r\n\t\t$wdc->set_user($webdav_username);\r\n\t\t$wdc->set_pass($webdav_password);\r\n\t\t$wdc->set_protocol(1); //use HTTP/1.1\r\n\t\t$wdc->set_debug(false);\r\n\t\tif (!$wdc->open()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$http_status = $wdc->get($webdav_path . $stored_name, $contents); //$contents is produced by webdav class\r\n\t\t$wdc->close();\r\n\t\t\r\n\t}\r\n\t// Return the file contents\r\n\treturn $contents;\r\n}",
"public function actionViewFile()\n\t{\n\t\t$this->requireLogin();\n\t\t$this->requireAjaxRequest();\n\n\t\t$requestId = craft()->request->getPost('requestId', 0);\n\t\t$fileId = craft()->request->getRequiredPost('fileId');\n\t\t$file = craft()->assets->getFileById($fileId);\n\n\t\tif (!$file)\n\t\t{\n\t\t\tthrow new Exception(Craft::t('No asset exists with the ID “{id}”.', array('id' => $fileId)));\n\t\t}\n\n\t\t$html = craft()->templates->render('assets/_views/file', array(\n\t\t\t'file' => $file\n\t\t));\n\n\t\t$this->returnJson(array(\n\t\t\t'requestId' => $requestId,\n\t\t\t'headHtml' => craft()->templates->getHeadHtml(),\n\t\t\t'bodyHtml' => $html,\n\t\t\t'footHtml' => craft()->templates->getFootHtml(),\n\t\t));\n\t}",
"public function load($params = array()) {\n $url_params = http_build_query($params);\n $curl_params[CURLOPT_URL] = $this->api_url . '?' . $url_params;\n\n $result = $this->httpRequest($curl_params);\n if ($result->headers->code !== 200) {\n throw new Box_View_Exception('Error loading documents.', $result->headers->code);\n }\n\n // Create document objects based on the returned data.\n $docs = array();\n foreach ($result->response->document_collection->entries as $metadata) {\n $doc = new Box_View_Document((array) $metadata);\n $docs[$metadata->id] = $doc;\n }\n return $docs;\n }",
"function googledocs_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) {\n return null;\n}",
"function &getFile($fileId, $revision = null) {\n\t\t$paperFileDao =& DAORegistry::getDAO('PaperFileDAO');\n\t\t$paperFile =& $paperFileDao->getPaperFile($fileId, $revision, $this->paperId);\n\t\treturn $paperFile;\n\t}",
"public function readGet() {\n\t\t$_params = request::get( '_params' );\n\t\tstorage::getFile( $_params[0] . '/' . $_params[1] . '/' . $_params[2] );\n\t}",
"public function linkdocument()\n {\n $return = array('error' => _t('UploadField.FIELDNOTSET', 'Could not add document to page'));\n $documentSet = $this->getCurrentDocumentSet();\n if (!empty($documentSet)) {\n $document = DMSDocument::get()->byId($this->getRequest()->getVar('documentID'));\n $documentSet->Documents()->add($document);\n\n $buttonText = '<button class=\"ss-uploadfield-item-edit ss-ui-button ui-corner-all\"'\n . ' title=\"' . _t('DMSDocument.EDITDOCUMENT', 'Edit this document') . '\" data-icon=\"pencil\">'\n . _t('DMSDocument.EDIT', 'Edit') . '<span class=\"toggle-details\">'\n . '<span class=\"toggle-details-icon\"></span></span></button>';\n\n // Collect all output data.\n $return = array(\n 'id' => $document->ID,\n 'name' => $document->getTitle(),\n 'thumbnail_url' => $document->Icon($document->getExtension()),\n 'edit_url' => $this->getEditForm()->Fields()->fieldByName('Main.From your computer.AssetUploadField')\n ->getItemHandler($document->ID)->EditLink(),\n 'size' => $document->getFileSizeFormatted(),\n 'buttons' => $buttonText,\n 'showeditform' => true\n );\n }\n\n return Convert::raw2json($return);\n }",
"public function index($file_id)\n {\n $client_id=DB::table('visits')->where('id',$file_id)->pluck('client_company_id')->first();\n\n $client_company=DB::table('clients')->where('id',$client_id)->pluck('company_name')->first();\n \n // dd($client_company);\n $fileview=DB::table('documents')->where('doc_table_id',$file_id)->get();\n // dd($fileview);\n return view('admin/visits/fileview',['fileview'=>$fileview,'client_company'=>$client_company]);\n }"
] | [
"0.6737135",
"0.59992987",
"0.59276485",
"0.5851097",
"0.5834074",
"0.574171",
"0.57258916",
"0.5675758",
"0.566965",
"0.5653033",
"0.5638717",
"0.5616512",
"0.5574002",
"0.55733484",
"0.5511751",
"0.55055183",
"0.5500852",
"0.5481472",
"0.54673755",
"0.5444338",
"0.5443509",
"0.54019696",
"0.5373162",
"0.53719187",
"0.5366547",
"0.5353508",
"0.5348202",
"0.53475577",
"0.5339963",
"0.53299433"
] | 0.7705773 | 0 |
Get current user locale | private function getLocale() : string {
return \strtolower(\str_replace('_', '-', $this->settings->getUserValue($this->getCurrentUserUID(), 'core', 'lang', 'en')));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function locale()\n {\n return $this->user->locale ?? null;\n }",
"protected function getLocale() {\n\t\tif ($this->authService->hasIdentity ()) {\n\t\t\t$user = $this->authService->getIdentity ();\n\t\t\tif (isset ( $user->locale )) {\n\t\t\t\treturn $user->locale;\n\t\t\t} else {\n\t\t\t\t$Session = new \\Zend\\Session\\Container ( 'language' );\n\t\t\t\tif ($Session && $Session->locale) {\n\t\t\t\t\treturn $Session->locale;\n\t\t\t\t} else {\n\t\t\t\t\treturn 'en_US';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$Session = new \\Zend\\Session\\Container ( 'language' );\n\t\t\tif ($Session && $Session->locale) {\n\t\t\t\treturn $Session->locale;\n\t\t\t}\n\t\t}\n\t\t// throw new Exception('Nao foi possivel verificar sua sessao');\n\t\t// return $this->redirect ()->toRoute ( \"login\" );\n\t}",
"static public function get_locale() {\r\n\t\t\t$options = self::get_options();\r\n\t\t \treturn $options['locale'];\r\n\t\t}",
"public function getLocale()\n {\n return $this['config']->get('app.locale');\n }",
"public function getLocale();",
"public function getLocale();",
"public function getLocale();",
"public function getLocale();",
"public function getLocale();",
"public function getLocale();",
"public function getLocale();",
"public function getLocale();",
"public function getLocale()\r\n {\r\n return $this->sessionContainer->locale;\r\n }",
"public function getLocale()\n {\n return $this->currentLocale;\n }",
"public static function getLocale() {\n\t\treturn self::$locale;\n\t}",
"public function CurrentLocale(){\n return i18n::get_locale();\n }",
"function getlocale()\n {\n return \\Locale::getDefault();\n }",
"static public function getCurrentLocale() { return self::$currentLocale; }",
"public function get_locale () {\n\t\t\n\t\treturn $this->locale;\n\t}",
"public static function getLocale()\n {\n return static::translator()->getLocale();\n }",
"public function getCurrentLocale(): string\n {\n return $this->localeClient->getCurrentLocale();\n }",
"public function getLocale()\n {\n return $this->getParameter('locale');\n }",
"public function getLocale(): string\n {\n return $this->locale;\n }",
"public function getLocale()\n {\n return $this->locale ?: i18n::get_locale();\n }",
"function locale() : string\n {\n return config('app.locale') ?? config('app.fallback_locale');\n }",
"public function getLocale(): string\n {\n return $this->locale ?: call_user_func(static::$localeResolver);\n }",
"public function getLocale()\n\t{\n\t\treturn strtolower($this->getParameter('langID'));\n\t}",
"public function locale()\n\t{\n\t\treturn $this->getLocale();\n\t}",
"public function getLocale()\n\t{\n\t\treturn $this->getKeyValue('locale'); \n\n\t}",
"protected function volatile_get_locale()\n\t{\n\t\treturn I18n\\get_locale();\n\t}"
] | [
"0.8541633",
"0.8021325",
"0.8001357",
"0.7865818",
"0.77419454",
"0.77419454",
"0.77419454",
"0.77419454",
"0.77419454",
"0.77419454",
"0.77419454",
"0.77419454",
"0.7730018",
"0.7716128",
"0.77003866",
"0.7694704",
"0.76864964",
"0.765182",
"0.7626013",
"0.76170665",
"0.76112914",
"0.75832766",
"0.7568054",
"0.7547058",
"0.751775",
"0.75145614",
"0.75074565",
"0.7506725",
"0.7487506",
"0.7479805"
] | 0.8037615 | 1 |
Parse wopi socket from the wopi url | private function parseWopiSocket(string $wopiRemote) : ?string {
$wopiRemoteParts = \parse_url($wopiRemote);
if (isset($wopiRemoteParts['scheme'], $wopiRemoteParts['host'])) {
$webSocketProtocol = "ws://";
if ($wopiRemoteParts['scheme'] == "https") {
$webSocketProtocol = "wss://";
}
$webSocket = \sprintf(
"%s%s%s",
$webSocketProtocol,
$wopiRemoteParts['host'],
isset($wopiRemoteParts['port']) ? ":" . $wopiRemoteParts['port'] : ""
);
return $webSocket;
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSocket();",
"protected function _parseURL ($url)\n\t{\n\t\t$info = parse_url($url);\n\t\t$predefinedPorts = array(\n\t\t\t'https' => 443,\n\t\t\t'http' => 80,\n\t\t\t'ftp' => 21,\n\t\t\t'smtp' => 25\n\t\t);\n\n\t\tif (!isset($info['protocol']))\n\t\t\t$info['protocol'] = $info['scheme'];\n\n\t\tif ($info['scheme'] == 'https')\n\t\t\t$info['protocol'] = 'ssl';\n\n\t\tif (!isset($info['path']))\n\t\t\t$info['path'] = '/';\n\n\t\tif (!isset($info['port']) && isset($predefinedPorts[$info['scheme']]))\n\t\t\t$info['port'] = $predefinedPorts[$info['scheme']];\n\n\t\treturn $info;\n\t}",
"private static function normalizeParsedURL($parts) {\n if (!isset($parts['port'])){\n $parts['port'] = $parts['scheme'] === 'https:' ? 443 : 80;\n }\n return $parts;\n }",
"function getservbyport ($port, $protocol) {}",
"function parseURL($url) {\n\t\tif (preg_match('/watch\\?v\\=([A-Za-z0-9_-]+)/', $url, $matches))\n\t\t\treturn $matches[1];\n\t\telse\n\t\t\treturn false;\n\t}",
"public function getProtocol();",
"private function get_protocol() {\n preg_match(\"|^HTTP[S]?|is\", $_SERVER['SERVER_PROTOCOL'], $m);\n return strtolower($m[0]);\n }",
"public function getProtocol(): string;",
"function _fsockopen_fetch($url)\n\t{\n\t\t$target = parse_url($url);\n\n\t\t$data = '';\n\n\t\t$fp = fsockopen($target['host'], 80, $error_num, $error_str, 8); \n\n\t\tif (is_resource($fp))\n\t\t{\n\t\t\tfputs($fp, \"GET {$url} HTTP/1.0\\r\\n\");\n\t\t\tfputs($fp, \"Host: {$target['host']}\\r\\n\");\n\t\t\tfputs($fp, \"Authorization: Basic \".base64_encode(\"$this->user:$this->password\").\"\\r\\n\");\n\t\t\tfputs($fp, \"User-Agent: EE/EllisLab PHP/\" . phpversion() . \"\\r\\n\\r\\n\");\n\n\t\t $headers = TRUE;\n\n\t\t while( ! feof($fp))\n\t\t {\n\t\t $line = fgets($fp, 4096);\n\n\t\t if ($headers === FALSE)\n\t\t {\n\t\t $data .= $line;\n\t\t }\n\t\t elseif (trim($line) == '')\n\t\t {\n\t\t $headers = FALSE;\n\t\t }\n\t\t }\n\n\t\t fclose($fp); \n\t\t}\n\t\t\n\t\treturn $data;\n\t}",
"public function getSocket()\n {\n }",
"public function getProtocolInformation();",
"function getservbyname ($service, $protocol) {}",
"function _protocol(){\n\t$protocol = current(explode('/', $_SERVER['SERVER_PROTOCOL']));\n\treturn strtolower($protocol);\n}",
"function getservbyname($service, $protocol)\n{\n}",
"function sock_get_contents( $url ) {\n\t $url_parsed = parse_url($url);\n\t $host = $url_parsed[\"host\"];\n\t $port = $url_parsed[\"port\"];\n\t if ($port==0)\n\t $port = 80;\n\t $path = $url_parsed[\"path\"];\n\t if ($url_parsed[\"query\"] != \"\")\n\t $path .= \"?\".$url_parsed[\"query\"];\n\n\t $out = \"GET $path HTTP/1.0\\r\\nHost: $host\\r\\n\\r\\n\";\n\n\t $fp = fsockopen($host, $port, $errno, $errstr, 30);\n\n\t fwrite($fp, $out);\n\t $body = false;\n\t while (!feof($fp)) {\n\t $s = fgets($fp, 1024);\n\t if ( $body )\n\t $in .= $s;\n\t if ( $s == \"\\r\\n\" )\n\t $body = true;\n\t }\n\t \n\t fclose($fp);\n\t \n\t return $in;\n\t}",
"public function parse($url);",
"public function GetProtocolInfo(){\n if (!$this->GetOnlineState()) return null;\n $filter=array('Source','Sink');\n return self::Call('ConnectionManager','GetProtocolInfo',null,$filter);;\n }",
"function parse_url ($url, $component = -1) {}",
"function parse_addr($url) {\n $urlparts = array();\n $sch = '';\n $h = '';\n $o = '';\n $p = '';\n $q = '';\n $f = '';\n $url = str_replace(\"\\\\\", \"/\", $url);\n $url2 = $url.\"/\"; // might be missing at some 301 relocated addresses\n\n $sch = strpos($url, \"://\"); // end of [scheme] = begin of [host]\n $urlparts[scheme] = substr($url, 0, $sch);\n $h = strpos(substr($url2, $sch+3), \"/\"); // endpos of [host]port] = begin of [path]\n\n $host_port = substr($url, $sch+3, $h);\n $o = strpos(substr($url, $sch+3, $h), \":\"); // find [port] delimiter\n\n if (!$o) {\n $urlparts[host] = substr($url, $sch+3, $h);\n } else { // if [port] available\n $urlparts[host] = substr($url, $sch+3, $o); // only [host]\n $urlparts[port] = substr($url, $sch+$o+4, $h-$o-1); // additionally [port]\n }\n\n $p = strpos(substr($url, $h+1), \"/\"); // begin position [path]\n $q = strpos(substr($url, $h+$p+1), \"?\"); // find begin of [query]\n\n if (!$q) { // if no query found\n $urlparts[path] = substr($url, $h+$p+1);\n } else {\n $urlparts[path] = substr($url, $h+$p+1, $q);\n $f = strpos(substr($url, $h+$p+$q+2), \"#\"); // find beginn of [fragment]\n }\n\n if ($q && !$f) { // if no fragment found\n $urlparts[query] = substr($url, $h+$p+$q+2); // only [query]\n }\n if ($f) {\n $urlparts[query] = substr($url, $h+$p+$q+2, $f);\n $urlparts[fragment] = substr($url, $h+$p+$q+$f+3);\n }\n\n return ($urlparts); // [user] and [pass] are currently not parsed\n }",
"public static function _url_get_proto($url){\n\t\t\t$url=parse_url($url);\n\t\t\treturn isset($url['scheme']) ? strtolower($url['scheme']) : '';\n\t\t}",
"private function _parseUrl ($url)\n {\n $parsed = parse_url($url);\n array_push($this->_hosts, $parsed + array('port' => '61613', 'scheme' => 'tcp'));\n }",
"private function parseUrl()\n {\n $url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $url = explode('/', trim($url, '/'), 3);\n\n // Define Controller\n if (isset($url[0]) && $url[0] != null):\n $this->controller = $url[0];\n endif;\n\n // Define Action\n if (isset($url[1]) && $url[1] != null):\n $this->action = $url[1];\n endif;\n\n // Define Params\n if (isset($url[2]) && $url[2] != null):\n $this->params = explode('/', $url[2]);\n endif;\n\n }",
"public static function getProtocol($data)\n {\n self::$_log = \\Seraphp\\Log\\LogFactory::getInstance();\n if (preg_match('/^(GET|POST|HEAD) (.+) HTTP\\/(\\d\\.\\d)/', $data)) {\n return 'http';\n } else {\n return 'other';\n }\n }",
"private static function parse() {\n\n\t\t$server = (object) $_SERVER;\n\n\t\tstatic::$_server = (object) array (\n\t\t\t'http_host' => null,\n\t\t\t'http_user_agent' => '',\n\t\t\t'server_port' => null,\n\t\t\t'request_uri' => '/',\n\t\t\t'remote_addr' => null,\n\t\t\t'content_type' => '',\n\t\t\t'request_method' => 'GET',\n\t\t\t'query_string' => '',\n\t\t);\n\n\t\tforeach (static::$_server as $key => $value) {\n\t\t\tif ( isset ( $server->{strtoupper($key) } ) ) {\n\t\t\t\tstatic::$_server->{$key} = $server->{ strtoupper($key) };\n\t\t\t}\n\t\t}\n\n\t\treturn static::$_server;\n\t}",
"function parse_ssh_url( $url, $component = -1 ) {\n\tpreg_match( '#^((docker|docker\\-compose|docker\\-compose\\-run|ssh|vagrant):)?(([^@:]+)@)?([^:/~]+)(:([\\d]*))?((/|~)(.+))?$#', $url, $matches );\n\t$bits = [];\n\tforeach ( [\n\t\t2 => 'scheme',\n\t\t4 => 'user',\n\t\t5 => 'host',\n\t\t7 => 'port',\n\t\t8 => 'path',\n\t] as $i => $key ) {\n\t\tif ( ! empty( $matches[ $i ] ) ) {\n\t\t\t$bits[ $key ] = $matches[ $i ];\n\t\t}\n\t}\n\n\t// Find the hostname from `vagrant ssh-config` automatically.\n\tif ( preg_match( '/^vagrant:?/', $url ) ) {\n\t\tif ( 'vagrant' === $bits['host'] && empty( $bits['scheme'] ) ) {\n\t\t\t$bits['scheme'] = 'vagrant';\n\t\t\t$bits['host'] = '';\n\t\t}\n\t}\n\n\tswitch ( $component ) {\n\t\tcase PHP_URL_SCHEME:\n\t\t\treturn isset( $bits['scheme'] ) ? $bits['scheme'] : null;\n\t\tcase PHP_URL_USER:\n\t\t\treturn isset( $bits['user'] ) ? $bits['user'] : null;\n\t\tcase PHP_URL_HOST:\n\t\t\treturn isset( $bits['host'] ) ? $bits['host'] : null;\n\t\tcase PHP_URL_PATH:\n\t\t\treturn isset( $bits['path'] ) ? $bits['path'] : null;\n\t\tcase PHP_URL_PORT:\n\t\t\treturn isset( $bits['port'] ) ? $bits['port'] : null;\n\t\tdefault:\n\t\t\treturn $bits;\n\t}\n}",
"function stream_socket_pair ($domain, $type, $protocol) {}",
"function udp_scrape($scrape_url,$infohash, $fancy = null){\n\t\n\t\t$maxreadsize = 4096; // max read size is 4096 bytes\n\t\t$timeout = 2; // times out after two seconds\n\t\ttry{\n\t\t\tif(!is_array($infohash)){ \n\t\t\t\t$infohash = array($infohash); \n\t\t\t}\n\t\t\tforeach($infohash as $hash){\n\t\t\t\tif(!preg_match('#^[a-f0-9]{40}$#i',$hash)){ \n\t\t\t\t\tthrow new Exception('Invalid infohash: ' . $hash . '.'); \n\t\t\t\t}\n\t\t\t}\n\t\t\tif(count($infohash) > 74){ \n\t\t\t\tthrow new Exception('Too many infohashes provided.'); \n\t\t\t}\n\t\t\tif(!preg_match('%udp://([^:/]*)(?::([0-9]*))?(?:/)?%si', $scrape_url, $m)){ \n\t\t\t\tthrow new Exception('Invalid tracker scrape_url.'); \n\t\t\t}\n\t\t\t$tracker = 'udp://' . $m[1];\n\t\t\t$port = isset($m[2]) ? $m[2] : 80;\n\t\t\t\n\t\t\t$transaction_id = mt_rand(0,65535);\n\t\t\t$fp = fsockopen($tracker, $port, $errno, $errstr);\n\t\t\tif(!$fp){\n\t\t\t\tthrow new Exception('Could not open UDP connection: ' . $errno . ' - ' . $errstr,0,true); \n\t\t\t}\n\t\t\tstream_set_timeout($fp, $timeout);\n\t\t\t\n\t\t\t$current_connid = \"\\x00\\x00\\x04\\x17\\x27\\x10\\x19\\x80\";\n\t\t\t\n\t\t\t//Connection request\n\t\t\t$packet = $current_connid . pack(\"N\", 0) . pack(\"N\", $transaction_id);\n\t\t\tfwrite($fp,$packet);\n\t\t\t\n\t\t\t//Connection response\n\t\t\t$ret = fread($fp, 16);\n\t\t\tif(strlen($ret) < 1){ \n\t\t\t\tthrow new Exception('No connection response.'); \n\t\t\t}\n\t\t\tif(strlen($ret) < 16){ \n\t\t\t\tthrow new Exception('Too short connection response.'); \n\t\t\t}\n\t\t\t$retd = unpack(\"Naction/Ntransid\",$ret);\n\t\t\tif($retd['action'] != 0 || $retd['transid'] != $transaction_id){\n\t\t\t\tthrow new Exception('Invalid connection response.');\n\t\t\t}\n\t\t\t$current_connid = substr($ret,8,8);\n\t\t\t\n\t\t\t//Scrape request\n\t\t\t$hashes = '';\n\t\t\tforeach($infohash as $hash){ \n\t\t\t\t$hashes .= pack('H*', $hash); \n\t\t\t}\n\t\t\t$packet = $current_connid . pack(\"N\", 2) . pack(\"N\", $transaction_id) . $hashes;\n\t\t\tfwrite($fp,$packet);\n\t\t\t\n\t\t\t//Scrape response\n\t\t\t$readlength = 8 + (12 * count($infohash));\n\t\t\t$ret = fread($fp, $readlength);\n\t\t\tif(strlen($ret) < 1){\n\t\t\t\tthrow new Exception('No scrape response.',0,true); \n\t\t\t}\n\t\t\tif(strlen($ret) < 8){ \n\t\t\t\tthrow new Exception('Too short scrape response.'); \n\t\t\t}\n\t\t\t$retd = unpack(\"Naction/Ntransid\",$ret);\n\t\t\t// Todo check for error string if response = 3\n\t\t\tif($retd['action'] != 2 || $retd['transid'] != $transaction_id){\n\t\t\t\tthrow new Exception('Invalid scrape response.');\n\t\t\t}\n\t\t\tif(strlen($ret) < $readlength){ \n\t\t\t\tthrow new Exception('Too short scrape response.'); \n\t\t\t}\n\t\t\t$torrents = array();\n\t\t\t$index = 8;\n\t\t\tforeach($infohash as $hash){\n\t\t\t\t$retd = unpack(\"Nseeders/Ncompleted/Nleechers\",substr($ret,$index,12));\n\t\t\t\t$retd['infohash'] = $hash;\n\t\t\t\t$torrents[$hash] = $retd;\n\t\t\t\t$index = $index + 12;\n\t\t\t\t\n\t\t\t\t// now lets return the data in a easy to read format\n\t\t\t\tif($fancy === \"yes\"){\n\t\t\t\tprint(\"<h3> UDP: Torrent Information </h3>\");\n\t\t\t\tprint(\"Leechers: \" . $torrents[$hash]['leechers']);\n\t\t\t\tprint(\"<br>\");\n\t\t\t\tprint(\"Seeders: \" . $torrents[$hash]['seeders']);\n\t\t\t\tprint(\"<br>\");\n\t\t\t\tprint(\"Infohash :\" . $hash);\n\t\t\t\tprint(\"<br>\");\n\t\t\t\tprint(\"Tracker: \" . $scrape_url);\n\t\t\t}\n\t\t\t\n\t\t\telse{\n\t\t\t\t//return($torrents);\n\t\t\t\t\n\t\t\t\t$torrent_information = array($torrents[$hash]['leechers'], $torrents[$hash]['seeders']);\n\t\t\t\t\t\t\n\t\t\t\treturn $torrent_information;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t}catch(Exception $e){\n\t\t// lets log the error\n\t\t// and save it to the server\n\t\tprint(\"<br>Error: \" . $e->getMessage());\n\t\tfile_put_contents(\"log.txt\", $e->getMessage() . \"\\r\\n\", FILE_APPEND | LOCK_EX);\n\t\t\n}\n\t}",
"public function getServerProtocol();",
"static function getHttp10Response($uri)\r\n {\r\n//echo(\"getHttp10Response($uri): Entered<br />\");\r\n \t// Split the gateway URI into protocol, host, port, and path\r\n $arrMatch = array();\r\n// '/^\r\n// (?:\r\n// (\\w+) # (http)\r\n// \\:\\/\\/ # ://\r\n// ){0,1}\r\n// ([^\\:\\/]+) # (my.domain.com)\r\n// (?:\r\n// \\: # :\r\n// (\\d+) # (80)\r\n// ){0,1}\r\n// (.*?) # (/path/to?your=resource)\r\n// $/ix',\r\n if (!preg_match(\r\n '/^(?:(\\w+)\\:\\/\\/){0,1}([^\\:\\/]+)(?:\\:(\\d+)){0,1}(.*?)$/i',\r\n $uri, $arrMatch\r\n )) return false;\r\n list($match, $proto, $host, $port, $path) = $arrMatch;\r\n//echo(\"match $match: proto $proto, host $host, port $port, path $path<br />\");\r\n // Check: Cannot connect without host name!\r\n if (empty($host)) return false;\r\n\r\n // Fix a few missing values\r\n if (empty($proto)) $proto = 'https';\r\n // This is mandatory for https connects.\r\n // Also, your PHP needs to be comiled with SSL support built in.\r\n if ($proto == 'https' || $proto == 'ssl')\r\n $host = 'ssl://'.$host;\r\n if (empty($port)) {\r\n switch (strtolower($proto)) {\r\n case 'https':\r\n $port = '443'; break;\r\n case 'http':\r\n default:\r\n $port = '80';\r\n }\r\n }\r\n if (empty($path)) $path = '/';\r\n//echo(\"fixed: proto $proto, host $host, port $port, path $path<br />\");\r\n\r\n // Open socket connection\r\n $method = 'GET';\r\n// POST only\r\n// $contenttype = \"text/plain\";\r\n $errno = 0;\r\n $errstr = '';\r\n $fp = fsockopen($host, intval($port), $errno, $errstr, self::$timeout_connect);\r\n if (!$fp) {\r\n//echo(\"ERROR $errno: $errstr<br />\");\r\n \treturn false;\r\n }\r\n stream_set_timeout($fp, self::$timeout_response, 0);\r\n\r\n // Send request\r\n fputs(\r\n $fp,\r\n \"$method $path HTTP/1.0\\r\\n\".\r\n \"Connection: close\\r\\n\\r\\n\"\r\n// POST only\r\n// \"Host: $host\\r\\n\".\r\n// \"Content-type: $contenttype\\r\\n\".\r\n// \"Content-length: \".strlen($data).\"\\r\\n\".\r\n );\r\n\r\n // Get response\r\n $response = false;\r\n while(!feof($fp))\r\n $response .= fgets($fp, 128);\r\n fclose($fp);\r\n if ($response === false) return false;\r\n $arrResponse = explode(\"\\r\\n\\r\\n\", $response);\r\n if (empty($arrResponse[1])) return false;\r\n return $arrResponse[1];\r\n }",
"function socket_get_status ($fp) {}"
] | [
"0.56284636",
"0.532532",
"0.53166175",
"0.52866554",
"0.5279815",
"0.5278381",
"0.52628934",
"0.52342963",
"0.52253586",
"0.51661456",
"0.51580757",
"0.51537424",
"0.51443076",
"0.50556314",
"0.50424814",
"0.49993512",
"0.4997627",
"0.49629903",
"0.495883",
"0.49452528",
"0.49134573",
"0.4881046",
"0.48768726",
"0.48422912",
"0.48215532",
"0.4794469",
"0.47781643",
"0.47761637",
"0.47741786",
"0.47725448"
] | 0.67421734 | 0 |
Return uid of currently logged in user. WARNING: This method is legacy, use with caution. | private function getCurrentUserUID() : string {
$user = \OC::$server->getUserSession()->getUser();
$uid = $user === null ? '' : $user->getUID();
return $uid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUserUid() {\n\t\tif ($this->hasLoggedInUser() && !empty($GLOBALS['TSFE']->fe_user->user['uid'])) {\n\t\t\treturn intval($GLOBALS['TSFE']->fe_user->user['uid']);\n\t\t}\n\t\treturn NULL;\n\t}",
"public function currentUserId()\n\t{\n\t\treturn (isset($_SESSION['uid']) ? $_SESSION['uid'] : -1);\n\t}",
"public function getUserUID() {\n\t\treturn $this->getSessionuserUID();\n\t}",
"public function get_uid() {\n return $this->uid;\n }",
"public static function current_user_id()\n\t{\n\t\treturn Session::has(Config::get('sentry::sentry.session.user'))\n\t\t\t? Session::get(Config::get('sentry::sentry.session.user'))\n\t\t\t: 0;\n\t}",
"public function getUid()\n {\n return $this->uid;\n }",
"public function getUid()\n {\n return $this->uid;\n }",
"public function getUid() {\n\t\treturn $this->uid;\n\t}",
"public function getUid() {\n\t\treturn $this->uid;\n\t}",
"public function getUid()\n\t{\n\t\treturn $this->uid;\n\t}",
"public function getUid()\n\t{\n\t\treturn $this->uid;\n\t}",
"protected function userid() {\n\t\tif ($this->Session->loggedin()) return $this->Session->getUser()->User_id;\n\t\treturn NULL;\n\t}",
"public function get_current_UserID()\n\t{\n\t\t$userDetails = $this->_return_current_user_details();\n\n\t\treturn $userDetails['result']['user']['0']['id'];\n\t}",
"function getCurrentUserId()\n {\n if (isset($_SESSION['CURRENT_USER_ID'])) {\n return $_SESSION['CURRENT_USER_ID'];\n }\n\n return null;\n }",
"function uid() {\n\t\treturn ($this->profil['userid'] != '') ? $this->profil['userid'] : false;\n\t}",
"function get_uid()\n{\n\tif (logged_in())\n\t\treturn safe($_COOKIE[\"Plink_uid\"], 'sql');\n\treturn 0;\n}",
"public function getUid()\n {\n return $this->_uid;\n }",
"public function getCurrentUserId() {\n\t\t$token = $this->app['security.token_storage']->getToken();\n\t\tif ($token === null) {\n\t\t\treturn -1;\n\t\t}\n\t\t$user = $token->getUser();\n\t\tif ($user === 'anon.') {\n\t\t\treturn -1;\n\t\t}\n\t\treturn $user->getId();\n\t}",
"public function getUid() {\n return $this->get('uid');\n }",
"public static function get_current_user_id(){\n\n $id = null;\n if(isset($_SESSION) && isset($_SESSION['user_id'])){\n $id = $_SESSION['user_id'];\n }\n\n return $id;\n }",
"public function get_user_id()\n {\n //check logged in\n if (!$this->is_logged_in()) {\n return false;\n }\n\n return user()->id;\n }",
"protected function _getUserID() {\n\t\treturn $this->_getLoggedInMemberId();\n\t}",
"public static function getUserId()\n {\n // Use static::loggedIn() if use PHP 5.3 >=\n return self::loggedIn() ? $_SESSION['user_id'] : null;\n }",
"public function getUserID() {\r\n\t\treturn($this->sUserID);\r\n\t}",
"public function getUserId(): int\n {\n return (int) $this->currentUserApi->get('uid');\n }",
"public function get_user_id()\n\t{\n\t\treturn $this->get_session_data('id');\n\t}",
"public function uid() { return $this->_m_uid; }",
"public function getuserId(): Uuid\n {\n return ($this->userId);\n }",
"public function getUserID() {\n return($this->userID);\n }",
"public function getUserID() {\n\t\treturn $this->getSessionuserID();\n\t}"
] | [
"0.8434253",
"0.82304645",
"0.80437416",
"0.7912217",
"0.7803808",
"0.77833587",
"0.77833587",
"0.77602506",
"0.77602506",
"0.7745742",
"0.7745742",
"0.77235615",
"0.7718592",
"0.7678665",
"0.7676381",
"0.7663578",
"0.7656924",
"0.76237595",
"0.7620611",
"0.7611342",
"0.75899553",
"0.7557314",
"0.75497824",
"0.7542313",
"0.7529052",
"0.7517967",
"0.7496739",
"0.7490319",
"0.74818003",
"0.7454382"
] | 0.8307806 | 1 |
Adds a range filter Values can be integer or float | public function addRangeFilter($attribute, $min, $max, $exclude = false, $key = null)
{
if (empty($attribute) || !is_string($attribute) || !is_numeric($min) || !is_numeric($max)) {
throw new ESphinxException('Check input data');
}
$float = is_float($min) || is_float($max);
if ($float) {
$min = (float)$min;
$max = (float)$max;
} else {
$min = (int)$min;
$max = (int)$max;
}
if ($key) {
$this->_rangeFilters[$key] = array(
'attribute' => $attribute,
'min' => $min,
'max' => $max,
'exclude' => $exclude,
'float' => $float,
);
} else {
$this->_rangeFilters[] = array(
'attribute' => $attribute,
'min' => $min,
'max' => $max,
'exclude' => $exclude,
'float' => $float,
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function range()\n {\n return new ValueRangeFilter();\n }",
"private function addConditionForRange() {\n $this->addWhere('tx_newspaper_article.tstamp>=' . tx_newspaper_UtilMod::calculateTimestamp($this->input['range']));\n }",
"public function hasValueRangeFilter(){\n return $this->_has(15);\n }",
"public function setRangeFilters($rangeFilters) {\n $this->cleanRangeFilters();\n $this->addRangeFilters($rangeFilters);\n }",
"public function addRange($range)\n {\n return parent::addRange($range);\n }",
"public function setRange($filterName, $from=null, $to=null){\n if(!$this->optionExists('filter')){\n $this->search_options['filter'] = array($filterName=>array());\n }\n if(!isset($this->search_options['filter'][$filterName]))\n {\n $this->search_options['filter'][$filterName] = array();\n }\n if($from)\n {\n $this->search_options['filter'][$filterName]['from'] = $from;\n }\n if($to)\n {\n $this->search_options['filter'][$filterName]['to'] = $from;\n }\n }",
"public function addRangeFilters($rangeFilters)\n {\n if (empty($rangeFilters)) {\n throw new ESphinxException('Filters must be a non empty array');\n }\n\n foreach ($rangeFilters as $rangeFilter) {\n if (empty($rangeFilter) || count($rangeFilter) < 3\n || !isset($rangeFilter[0], $rangeFilter['min'], $rangeFilter['max'])) {\n throw new ESphinxException('Check input data');\n }\n $attribute = $rangeFilter[0];\n $exclude = !empty($rangeFilter['exclude']);\n $key = !empty($rangeFilter['key']) ? $rangeFilter['key'] : null;\n\n $this->addRangeFilter($attribute, $rangeFilter['min'], $rangeFilter['max'], $exclude, $key);\n }\n }",
"public function addFqRangeFilter($params)\n {\n if (is_array($params)) {\n foreach ($params as $field => $value) {\n $this->_searchQueryRangeFilters[$field] = $value;\n }\n }\n\n return $this;\n }",
"public function addRange($value) {\n return $this->add('ranges', func_get_args());\n }",
"protected function getLexikFormFilter_Type_FilterNumberRangeService()\n {\n return $this->services['lexik_form_filter.type.filter_number_range'] = new \\Lexik\\Bundle\\FormFilterBundle\\Filter\\Form\\Type\\NumberRangeFilterType();\n }",
"public function add_range( $name, $label, $options = array() ) {\n\n\t\t$defaults = array(\n\t\t\t'validate_callback' => 'sh_validate_number',\n\t\t\t'sanitize_callback' => 'sh_sanitize_number',\n\t\t\t'range' => array(\n\t\t\t\t'', #min\n\t\t\t\t'', #max\n\t\t\t\t'' #step\n\t\t\t)\n\t\t);\n\t\t$options = wp_parse_args( $options, $defaults );\n\t\t$this->add_field( $name, $label, 'range', $options );\n\t}",
"public function addPriceFilter ($index, $range, $rate)\n {\n $from = $range * ($index - 1);\n $to = $range * $index;\n $this->getSelect()->where('price:[' . $from . ' TO ' . $to . ']');\n }",
"public function validate($value) {\n if (!is_numeric($value)) {\n throw new PapayaFilterExceptionNotFloat($value);\n }\n if (!is_null($this->_min) && $value < $this->_min) {\n throw new PapayaFilterExceptionRangeMinimum($this->_min, $value);\n }\n if (!is_null($this->_max) && $value > $this->_max) {\n throw new PapayaFilterExceptionRangeMaximum($this->_max, $value);\n }\n return TRUE;\n }",
"function fr_dataset_field_filter_value_range_number_element($default_value = NULL) {\n return array(\n '#type' => 'item',\n '#tree' => true,\n 'value1' => array(\n '#title' => t('Min'),\n '#type' => 'numberfield',\n '#size' => 20,\n '#default_value' => $default_value['value1'],\n ),\n 'value2' => array(\n '#title' => t('Max'),\n '#type' => 'numberfield',\n '#size' => 20,\n '#default_value' => $default_value['value2'],\n ),\n\n );\n}",
"public function addFieldRange($field, $from = '*', $to = '*')\n {\n if (empty($from))\n $from = '*';\n\n if (empty($to))\n $to = '*';\n\n $this->params['fq'][] = \"{$field}:[{$from} TO {$to}]\";\n return $this;\n }",
"function applyFilterRange($conn, $dbkey, $postkey, $filterlist) {\n if (isset($_POST[$postkey])) {\n $intervals = json_decode($_POST[$postkey], true);\n if (!$intervals) {\n return $filterlist;\n }\n if (!is_array($intervals)) {\n return $filterlist;\n }\n $fragment = generateFilterQueryFragmentRange($conn, $dbkey, $intervals);\n if ($fragment != \"\") {\n array_push($filterlist, $fragment);\n }\n }\n return $filterlist;\n}",
"public function addFilters(\\google\\bigtable\\v1\\RowFilter $value){\n return $this->_add(1, $value);\n }",
"public function addFilters(\\google\\bigtable\\v1\\RowFilter $value){\n return $this->_add(1, $value);\n }",
"function createFilter($lowerBound)\r\n{\r\n return function($x) use ($lowerBound)\r\n {\r\n return ($x > $lowerBound) ? true : false;\r\n };\r\n}",
"public function range()\n {\n return parent::addRange(func_get_args());\n }",
"public function whereRange($fieldName, $start, $end)\n {\n return $this->addWhere($fieldName, array('$gt' => $start, '$lt' => $end));\n }",
"public function handle_filter_range_requests( $comment_query ) {\n\t\tif ( isset( $_REQUEST['cpac_filter-min'] ) ) {\n\t\t\t$comment_query->meta_query->queries[] = $this->get_meta_query_range( $_REQUEST['cpac_filter-min'], $_REQUEST['cpac_filter-max'] );\n\t\t}\n\n\t\treturn $comment_query;\n\t}",
"public function testRangeFloats() {\n $values = [11, 13, 4.3, 15.5, 14];\n $result = Stats::range($values);\n $expected = 11.2;\n ok($expected, $result);\n }",
"private function getRangeFilterValue(\n AttributeInterface $attribute,\n $filterValue\n ): ?SearchFilter\\FilterValueInterface {\n if ($attribute instanceof RangeFacetField) {\n if (!is_array($filterValue) || empty($filterValue)) {\n throw new \\RuntimeException('Cannot provide range filter value given the passed filter values');\n }\n\n if (isset($filterValue['min'], $filterValue['max'])) {\n return new SearchFilter\\RangeFilterValue(\n floatval($filterValue['min']),\n floatval($filterValue['max'])\n );\n }\n\n $ranges = [];\n foreach ($filterValue as $min) {\n $min = floatval($min);\n $max = $min + $attribute->getRangeSize() - 0.01;\n $ranges[] = new SearchFilter\\RangeFilterValue($min, $max);\n }\n if (count($ranges) === 1) {\n return $ranges[0];\n }\n return new SearchFilter\\UnionFilterValue($ranges);\n }\n\n if (!$attribute instanceof FloatAttributeInterface) {\n return null;\n }\n\n if (!is_array($filterValue)) {\n return null;\n }\n\n if (count($filterValue) > 2) {\n return null;\n }\n\n if (count($filterValue) === 1 && array_key_exists('min', $filterValue)) {\n $filterValue['max'] = 1000000000;\n }\n\n if (count($filterValue) === 1 && array_key_exists('max', $filterValue)) {\n $filterValue['min'] = 0;\n }\n\n if (!isset($filterValue['min'], $filterValue['max'])) {\n return null;\n }\n\n if (!is_numeric($filterValue['min']) && !is_numeric($filterValue['max'])) {\n return null;\n }\n\n return new SearchFilter\\RangeFilterValue(\n floatval($filterValue['min']),\n floatval($filterValue['max'])\n );\n }",
"public function isRangeFilter($attrName){\n\t\t$attrInfo = $this->getAttrInfo($attrName);\n\t\treturn null == $attrInfo ? -1 : $attrInfo->getIsRangeFilter();\n\t}",
"public function apply(\\Magento\\Framework\\App\\RequestInterface $request)\n {\n $attribute = $this->getAttributeModel();\n if ($this->advLayNavHelper->isAdvLayNavRangeSliderAttribute($attribute)) {\n $filter = $request->getParam($this->getRequestVar());\n if (!$filter || is_array($filter)) {\n return $this;\n }\n\n $explode = explode('-', $filter);\n $this->fromValue = isset($explode[0]) ? $explode[0] : null;\n $this->toValue = isset($explode[1]) ? $explode[1] : null;\n\n $this->getLayer()\n ->getProductCollection()\n ->addFieldToFilter(\n $this->getAttributeModel()->getAttributeCode(),\n ['from' => $this->fromValue, 'to' => $this->toValue]\n );\n\n $this->getLayer()->getState()->addFilter(\n $this->_createItem(\n $this->renderRangeLabel(empty($this->fromValue) ? 0 : $this->fromValue, $this->toValue),\n $filter\n )\n );\n\n return $this;\n }\n return parent::apply($request);\n }",
"public function range( $args=[] )\n {\n\n $a = wp_parse_args( $args, array(\n 'type' => 'range',\n 'name' => '',\n 'id' => '',\n 'class' => 'slider',\n 'value' => '',\n 'attributes' => '',\n 'placeholder' => '',\n 'min' => 0,\n 'max' => 99999,\n 'step' => 1\n ) );\n\n\t return $this->input( $a );\n }",
"final function range_in($col = 'price', $from = 0, $to = 0)\n\t{\n\t\t$id = uniqid();\n\t\t$add = \"WHERE\";\n\t\t$this->model_params[':from_'.$id] = $from;\n\t\t$this->model_params[':to_'.$id] = $to;\n\t\tif(!empty($this->model_sql_search)) { $add = \"AND\"; }\n\t\t$this->model_sql_search .= \"$add $col >= :from_$id AND $col <= :to_$id \";\n\t\treturn $this;\n\t}",
"public function addFilter(callable $filter);",
"public function addFilter(string $name, $value): void;"
] | [
"0.7044055",
"0.66373247",
"0.6559421",
"0.6449431",
"0.6289387",
"0.6213775",
"0.6130571",
"0.61147827",
"0.60958993",
"0.59857213",
"0.58577406",
"0.578595",
"0.57796425",
"0.5760243",
"0.57147664",
"0.5653981",
"0.56347084",
"0.56347084",
"0.5620262",
"0.559514",
"0.5569418",
"0.55276865",
"0.55175245",
"0.54841346",
"0.542688",
"0.5414233",
"0.5395412",
"0.53763384",
"0.5364934",
"0.536363"
] | 0.7066482 | 0 |
Adds group range filters example: array( array('attribute', 'min' => 0, 'max' => 100, 'exclude' => true, 'key' => 'attr') array('attribute', 'min' => 0, 'max' => 100, 'exclude' => true) array('attribute', 'min' => 0, 'max' => 100) ) | public function addRangeFilters($rangeFilters)
{
if (empty($rangeFilters)) {
throw new ESphinxException('Filters must be a non empty array');
}
foreach ($rangeFilters as $rangeFilter) {
if (empty($rangeFilter) || count($rangeFilter) < 3
|| !isset($rangeFilter[0], $rangeFilter['min'], $rangeFilter['max'])) {
throw new ESphinxException('Check input data');
}
$attribute = $rangeFilter[0];
$exclude = !empty($rangeFilter['exclude']);
$key = !empty($rangeFilter['key']) ? $rangeFilter['key'] : null;
$this->addRangeFilter($attribute, $rangeFilter['min'], $rangeFilter['max'], $exclude, $key);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addRangeFilter($attribute, $min, $max, $exclude = false, $key = null)\n {\n if (empty($attribute) || !is_string($attribute) || !is_numeric($min) || !is_numeric($max)) {\n throw new ESphinxException('Check input data');\n }\n\n $float = is_float($min) || is_float($max);\n if ($float) {\n $min = (float)$min;\n $max = (float)$max;\n } else {\n $min = (int)$min;\n $max = (int)$max;\n }\n\n if ($key) {\n $this->_rangeFilters[$key] = array(\n 'attribute' => $attribute,\n 'min' => $min,\n 'max' => $max,\n 'exclude' => $exclude,\n 'float' => $float,\n );\n } else {\n $this->_rangeFilters[] = array(\n 'attribute' => $attribute,\n 'min' => $min,\n 'max' => $max,\n 'exclude' => $exclude,\n 'float' => $float,\n );\n }\n }",
"public function setRangeFilters($rangeFilters) {\n $this->cleanRangeFilters();\n $this->addRangeFilters($rangeFilters);\n }",
"function applyFilterRange($conn, $dbkey, $postkey, $filterlist) {\n if (isset($_POST[$postkey])) {\n $intervals = json_decode($_POST[$postkey], true);\n if (!$intervals) {\n return $filterlist;\n }\n if (!is_array($intervals)) {\n return $filterlist;\n }\n $fragment = generateFilterQueryFragmentRange($conn, $dbkey, $intervals);\n if ($fragment != \"\") {\n array_push($filterlist, $fragment);\n }\n }\n return $filterlist;\n}",
"public function range()\n {\n return new ValueRangeFilter();\n }",
"public function setRange($filterName, $from=null, $to=null){\n if(!$this->optionExists('filter')){\n $this->search_options['filter'] = array($filterName=>array());\n }\n if(!isset($this->search_options['filter'][$filterName]))\n {\n $this->search_options['filter'][$filterName] = array();\n }\n if($from)\n {\n $this->search_options['filter'][$filterName]['from'] = $from;\n }\n if($to)\n {\n $this->search_options['filter'][$filterName]['to'] = $from;\n }\n }",
"static function get_map_filter_array ($group = 'Filter') {\r\n\t\treturn array(\r\n array(\r\n \"param_name\" => \"post_ids\",\r\n \"type\" => \"textfield\",\r\n \"value\" => '',\r\n \"heading\" => 'Post ID filter:',\r\n \"description\" => \"Filter multiple posts by ID. Enter here the post IDs separated by commas (ex: 10,27,233). To exclude posts from this block add them with '-' (ex: -7, -16)\",\r\n \"holder\" => \"div\",\r\n \"class\" => \"\",\r\n 'group' => $group\r\n ),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"category_id\",\r\n\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\"value\" => td_util::get_category2id_array(),\r\n\t\t\t\t\"heading\" => 'Category filter:',\r\n\t\t\t\t\"description\" => \"A single category filter. If you want to filter multiple categories, use the 'Multiple categories filter' and leave this to default\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\",\r\n 'group' => $group\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"category_ids\",\r\n\t\t\t\t\"type\" => \"textfield\",\r\n\t\t\t\t\"value\" => '',\r\n\t\t\t\t\"heading\" => 'Multiple categories filter:',\r\n\t\t\t\t\"description\" => \"Filter multiple categories by ID. Enter here the category IDs separated by commas (ex: 13,23,18). To exclude categories from this block add them with '-' (ex: -9, -10)\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\",\r\n 'group' => $group\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"tag_slug\",\r\n\t\t\t\t\"type\" => \"textfield\",\r\n\t\t\t\t\"value\" => '',\r\n\t\t\t\t\"heading\" => 'Filter by tag slug:',\r\n\t\t\t\t\"description\" => \"To filter multiple tag slugs, enter here the tag slugs separated by commas (ex: tag1,tag2,tag3)\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\",\r\n 'group' => $group\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"autors_id\",\r\n\t\t\t\t\"type\" => \"textfield\",\r\n\t\t\t\t\"value\" => '',\r\n\t\t\t\t\"heading\" => \"Multiple authors filter:\",\r\n\t\t\t\t\"description\" => \"Filter multiple authors by ID. Enter here the author IDs separated by commas (ex: 13,23,18).\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\",\r\n 'group' => $group\r\n\t\t\t),\r\n array(\r\n \"param_name\" => \"installed_post_types\",\r\n \"type\" => \"textfield\",\r\n \"value\" => '',//tdUtil::create_array_installed_post_types(),\r\n \"heading\" => 'Post Type:',\r\n \"description\" => \"Filter by post types. Usage: post, page, event - Write 1 or more post types delimited by commas\",\r\n \"holder\" => \"div\",\r\n \"class\" => \"\",\r\n 'group' => $group\r\n ),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"sort\",\r\n\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\"value\" => array (\r\n\t\t\t\t\t'- Latest -' => '',\r\n 'Oldest posts' => 'oldest_posts',\r\n\t\t\t\t\t'Alphabetical A -> Z' => 'alphabetical_order',\r\n\t\t\t\t\t'Popular (all time)' => 'popular',\r\n\t\t\t\t\t'Popular (jetpack + stats module requiered) Does not work with other settings/pagination' => 'jetpack_popular_2',\r\n\t\t\t\t\t'Popular (last 7 days) - theme counter (enable from panel)' => 'popular7',\r\n\t\t\t\t\t'Featured' => 'featured',\r\n\t\t\t\t\t'Highest rated (reviews)' => 'review_high',\r\n\t\t\t\t\t'Random Posts' => 'random_posts',\r\n 'Random posts Today' => 'random_today' ,\r\n 'Random posts from last 7 Day' => 'random_7_day' ,\r\n\t\t\t\t\t'Most Commented' => 'comment_count'\r\n\t\t\t\t),\r\n\t\t\t\t\"heading\" => 'Sort order:',\r\n\t\t\t\t\"description\" => \"How to sort the posts. Notice that Popular (last 7 days) option is affected by caching plugins and CDNs. For popular posts we recommend the jetpack (24-48hrs) method\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\",\r\n 'group' => $group\r\n\t\t\t),\r\n array(\r\n\t\t\t\t\"param_name\" => \"limit\",\r\n\t\t\t\t\"type\" => \"textfield\",\r\n\t\t\t\t\"value\" => '5',\r\n\t\t\t\t\"heading\" => 'Limit post number:',\r\n\t\t\t\t\"description\" => \"If the field is empty the limit post number will be the number from Wordpress settings -> Reading\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\"\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"offset\",\r\n\t\t\t\t\"type\" => \"textfield\",\r\n\t\t\t\t\"value\" => '',\r\n\t\t\t\t\"heading\" => 'Offset posts:',\r\n\t\t\t\t\"description\" => \"Start the count with an offset. If you have a block that shows 5 posts before this one, you can make this one start from the 6'th post (by using offset 5)\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\"\r\n\t\t\t)\r\n\t\t);//end generic array\r\n\t}",
"function fr_dataset_field_filter_value_range_number_element($default_value = NULL) {\n return array(\n '#type' => 'item',\n '#tree' => true,\n 'value1' => array(\n '#title' => t('Min'),\n '#type' => 'numberfield',\n '#size' => 20,\n '#default_value' => $default_value['value1'],\n ),\n 'value2' => array(\n '#title' => t('Max'),\n '#type' => 'numberfield',\n '#size' => 20,\n '#default_value' => $default_value['value2'],\n ),\n\n );\n}",
"protected function setLimits() {\n\n $feature_groups = FeatureGroup::orderBy('percentage','DESC')->get();\n\n foreach ($feature_groups as $key=>&$value) {\n $value->lower_limit = isset ($feature_groups[$key-1]) ? $feature_groups[$key-1]->lower_limit + $value->percentage : $value->percentage;\n $this->limits[$value->id] = $value->lower_limit;\n }\n\n }",
"private function addConditionForRange() {\n $this->addWhere('tx_newspaper_article.tstamp>=' . tx_newspaper_UtilMod::calculateTimestamp($this->input['range']));\n }",
"public function addUserGroupFilter($args, $request)\n {\n if ($groupId = $request->get_param('group-id')) {\n $args['meta_key'] = 'user_groups';\n $args['meta_value'] = intval($groupId);\n }\n\n return $args;\n }",
"public function defineFilters();",
"protected function mergeFilters(): array\n {\n $new_grups_filters = $this->_GROUP_FILTER;\n // menambahkan filter group yg sudah ada, dengan filter\n if (empty($this->_FILTERS) == false) {\n $new_grups_filters[] = [\n 'filters' => $this->_FILTERS,\n 'strict' => $this->_STRICT_SEARCH,\n ];\n }\n\n // membuat group filter baru tanpa merubah grups filter dr classs\n return $new_grups_filters;\n }",
"function get_age_groups( bool $filter = false ) : array {\n $ohjelma_json = get_field( 'ohjelma-json', 'option' );\n $program = \\POF\\Api::get( $ohjelma_json, true )['program'];\n $program = $filter ? array_reduce( $program, 'filter_api_items', [] ) : $program;\n $age_groups = $program[0]['agegroups'];\n\n usort( $age_groups, 'sort_by_order' );\n sort_results( $age_groups );\n\n return $age_groups;\n}",
"function gmw_ps_filter_bp_groups_query( $query_args, $gmw ) {\n\n /****** keywords ******/\n if ( ! empty( $gmw['form_values']['keywords'] ) ) {\n $query_args['search_terms'] = $gmw['form_values']['keywords'];\n }\n\n /****** Orderby ******/\n $orderby = gmw_ps_get_orderby_value( $gmw );\n\n // abort if no value found\n if ( '' != $orderby ) {\n $query_args['type'] = $orderby;\n }\n\n /****** Group Types *****/\n $output = gmw_ps_bp_get_object_types_query( $gmw, 'group', 'bpgt' );\n\t\n\tif ( false != $output['usage'] ) {\n\t\t$query_args[ $output['usage'] ] = $output['types'];\n\t}\n\n return $query_args;\n}",
"public function filters();",
"public function addGroupFunction($value) {}",
"function rangeGroup($array, $max, &$groups) {\n\t\t\n\t\tif ($groups == null)\n\t\t\t$groups = [];\n\n\t\tif (empty($array)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (count($array) == 1) {\n\t\t\t// Last array, just add it to the splits\n\t\t\t$groups[] = [$array[0]];\n\t\t\treturn;\n\t\t}\n\n\t\tif ($array[1] > $array[0] + $max) {\n\t\t\t// If this number isn't in a group with the number above it, add it to the splits and move on\n\t\t\t$groups[] = [$array[0]];\n\t\t\t$this->rangeGroup(array_slice($array, 1), $max, $groups);\n\t\t\treturn;\n\t\t}\n\n\t\t$bestCount = 0; \t\n\n\t\tfor($i=0; $i<count($array); $i++) {\n\n\t\t\t$count = 0; // How many numbers we can include\n\t\t\t$current = $array[$i];\n\n\t\t\tfor($j=$i; $j<count($array); $j++) {\n\t\t\t\tif ($array[$j] > ($current + $max)) {\n\t\t\t\t\t// If it isn't in range, break out\n\t\t\t\t\t break;\n\t\t\t\t}\n\t\t\t\t// If it is in the range, incease the count, and save this top idx\n\t\t\t\t$count++;\n\t\t\t}\n\n\t\t\tif($count < $bestCount) {\n\t\t\t\t// We've had a better grouping before, so use it\n\t\t\t\t$bestIdx = $i - 1;\n\t\t\t\t$adding = array_slice($array, $bestIdx, $bestCount);\n\t\t\t\t$below = array_slice($array, 0, $bestIdx);\n\t\t\t\t$above = array_slice($array, $bestIdx + $bestCount);\n\t\t\t\t\n\t\t\t\t// Add to the current splits\n\t\t\t\t$groups[] = $adding;\n\n\t\t\t\t// Add the ranges for the numbers above and below\n\t\t\t\t$this->rangeGroup($above, $max, $groups);\n\t\t\t\t$this->rangeGroup($below, $max, $groups);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// This is the best count we've had so far, so store it\n\t\t\t$bestCount = $count;\n\t\t\t$bestIdx = $i;\n\t\t}\n\t}",
"public function addGroupFilter($groupName)\n\t{\n\t\t$gid = GRP_getIdByName($groupName);\n\n\t\tif (is_numeric($gid))\n\t\t{\n\t\t\t$this->groupWHERE = \"clients.id=clientgroups.clientid AND clientgroups.groupid=$gid\";\n\t\t\t$this->groupFROM = ', clientgroups';\n\t\t}\n\t}",
"public function deleteRangeFilter($key)\n {\n unset($this->_rangeFilters[$key]);\n }",
"public function handle_filter_range_requests( $comment_query ) {\n\t\tif ( isset( $_REQUEST['cpac_filter-min'] ) ) {\n\t\t\t$comment_query->meta_query->queries[] = $this->get_meta_query_range( $_REQUEST['cpac_filter-min'], $_REQUEST['cpac_filter-max'] );\n\t\t}\n\n\t\treturn $comment_query;\n\t}",
"public function hasValueRangeFilter(){\n return $this->_has(15);\n }",
"function cacsp_filter_query_for_bp_group( $query ) {\n\t// Only modify 'event' queries.\n\t$post_types = $query->get( 'post_type' );\n\tif ( ! in_array( 'cacsp_paper', (array) $post_types ) ) {\n\t\treturn;\n\t}\n\n\t$bp_group = $query->get( 'bp_group', null );\n\tif ( null === $bp_group ) {\n\t\treturn;\n\t}\n\n\tif ( ! is_array( $bp_group ) ) {\n\t\t$group_ids = array( $bp_group );\n\t} else {\n\t\t$group_ids = $bp_group;\n\t}\n\n\t// Empty array will always return no results.\n\tif ( empty( $group_ids ) ) {\n\t\t$query->set( 'post__in', array( 0 ) );\n\t\treturn;\n\t}\n\n\t// Convert group IDs to a tax query.\n\t$tq = $query->get( 'tax_query' );\n\t$group_terms = array();\n\tforeach ( $group_ids as $group_id ) {\n\t\t$group_terms[] = 'group_' . $group_id;\n\t}\n\n\t$tq[] = array(\n\t\t'taxonomy' => 'cacsp_paper_group',\n\t\t'terms' => $group_terms,\n\t\t'field' => 'name',\n\t\t'operator' => 'IN',\n\t);\n\n\t$query->set( 'tax_query', $tq );\n}",
"function createFilter($lowerBound)\r\n{\r\n return function($x) use ($lowerBound)\r\n {\r\n return ($x > $lowerBound) ? true : false;\r\n };\r\n}",
"public function groups();",
"public function _add_simple_group_filter()\n\t{\n\t\t//check for the \"sgid\" get parameter\n\t\tif (isset($_GET['sgid']) AND !is_array($_GET['sgid']) AND intval($_GET['sgid']) >= 0)\n\t\t{\n\t\t\t//get the table prefix\n\t\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\t\n\t\t\t//get the params\n\t\t\t$sg_id = intval($_GET['sgid']);\n\t\t\t$params = Event::$data;\n\t\t\tarray_push($params,\t'i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_groups_incident WHERE simplegroups_groups_id = '. $sg_id. ')');\n\t\t\t\n\t\t\t//figure out if we're on the backend or not, and if we're not hide private categories\n\t\t\t$only_public = (strpos(url::current(), \"admin/\") === 0) ? \"\" : \" AND sgc.category_visible = 1 \"; \n\t\t\t\n\t\t\t$category_ids = $this->_get_group_categories();\t\t\t\n\t\t\t// Check if there are any category ids\n\t\t\tif (count($category_ids) > 0)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//what's the logical operator:\n\t\t\t\tif($this->_get_logical_operator() == \"or\")\n\t\t\t\t{\n\t\t\t\t\t//first we need to find out what the original SQL for categories looked like:\n\t\t\t\t\t$category_sql = $this->_create_default_category_sql();\n\t\t\t\t\t$i = 0;\n\t\t\t\t\t$found_it = false;\n\t\t\t\t\tforeach($params as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(strcmp($value, $category_sql) == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$i = $key;\n\t\t\t\t\t\t\t$found_it = true;\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t//if we found it, lets remove it.\n\t\t\t\t\tif($found_it)\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($params[$i]);\n\t\t\t\t\t}\n\t\t\t\t\tif(strlen($category_sql) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$category_sql = ' OR ('.$category_sql.')' ;\n\t\t\t\t\t}\n\t\t\t\t\t$category_ids = implode(\",\", $category_ids);\n\t\t\t\t\tarray_push($params,\n\t\t\t\t\t\t'(i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_incident_category sgic '.\n\t\t\t\t\t\t\t'INNER JOIN '.$table_prefix.'simplegroups_category sgc ON (sgc.id = sgic.simplegroups_category_id) '.\n\t\t\t\t\t\t\t'WHERE (sgc.id IN ('. $category_ids . ') OR sgc.parent_id IN ('.$category_ids.'))'.$only_public.' ) '.$category_sql. ')');\n\t\t\t\t\t\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\tforeach($category_ids as $c)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($params,\n\t\t\t\t\t\t'i.id IN (SELECT DISTINCT incident_id FROM '.$table_prefix.'simplegroups_incident_category sgic '.\n\t\t\t\t\t\t\t'INNER JOIN '.$table_prefix.'simplegroups_category sgc ON (sgc.id = sgic.simplegroups_category_id) '.\n\t\t\t\t\t\t\t'WHERE ((sgc.id = '. $c . ') OR sgc.parent_id = (' . $c . '))'.$only_public.' ) ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tEvent::$data = $params;\n\t\t}\n\t}",
"public function determineStartingFilters()\n {\n foreach (collect($this->filter)->except(self::EXCLUDED_FILTERS) as $key => $value) {\n $this->filter[$key] = [Trade::min($key), Trade::max($key)];\n }\n\n // Determine bounds for calculated fields\n $this->filter['total_volume'] = [\n Trade::min('units_per_hour') * Trade::min('duration'),\n Trade::max('units_per_hour') * Trade::max('duration'),\n ];\n }",
"public function addRange($range)\n {\n return parent::addRange($range);\n }",
"function agnosia_apply_filters() {\r\n\r\n $filters = agnosia_get_filters();\r\n\r\n foreach ( $filters as $tag => $function ) :\r\n \r\n add_filter( $tag , $function );\r\n\r\n endforeach;\r\n\r\n}",
"#[\\PHPUnit\\Framework\\Attributes\\Depends('testBuildQueryBuilderDefault')]\n public function testBuildQueryBuilderRangeFilter(): void\n {\n $query = new Query('author_audit', $this->createConnection());\n $reflectedMethod = $this->reflectMethod($query, 'buildQueryBuilder');\n\n $expectedQuery = 'SELECT * FROM author_audit at WHERE object_id >= :min_object_id';\n $query->addFilter(new RangeFilter(Query::OBJECT_ID, 5));\n $queryBuilder = $reflectedMethod->invokeArgs($query, []);\n self::assertSame($expectedQuery, $queryBuilder->getSQL(), 'SQL query is OK with a range filter with min bound only.');\n\n // test SQL query with a range filter, max bound only\n $query = new Query('author_audit', $this->createConnection());\n $reflectedMethod = $this->reflectMethod($query, 'buildQueryBuilder');\n\n $expectedQuery = 'SELECT * FROM author_audit at WHERE object_id <= :max_object_id';\n $query->addFilter(new RangeFilter(Query::OBJECT_ID, null, 25));\n $queryBuilder = $reflectedMethod->invokeArgs($query, []);\n self::assertSame($expectedQuery, $queryBuilder->getSQL(), 'SQL query is OK with a range filter with max bound only.');\n\n // test SQL query with a range filter with both bounds\n $query = new Query('author_audit', $this->createConnection());\n $reflectedMethod = $this->reflectMethod($query, 'buildQueryBuilder');\n\n $expectedQuery = 'SELECT * FROM author_audit at WHERE object_id >= :min_object_id AND object_id <= :max_object_id';\n $query->addFilter(new RangeFilter(Query::OBJECT_ID, 5, 25));\n $queryBuilder = $reflectedMethod->invokeArgs($query, []);\n self::assertSame($expectedQuery, $queryBuilder->getSQL(), 'SQL query is OK with a range filter with max bound only.');\n }",
"public function whereRange($fieldName, $start, $end)\n {\n return $this->addWhere($fieldName, array('$gt' => $start, '$lt' => $end));\n }"
] | [
"0.6814596",
"0.583167",
"0.5633651",
"0.5616794",
"0.55636126",
"0.5538654",
"0.54372036",
"0.5413376",
"0.5390176",
"0.5372542",
"0.5358848",
"0.5336583",
"0.5309255",
"0.53088176",
"0.51997507",
"0.51484895",
"0.5125346",
"0.51027226",
"0.50966907",
"0.5075448",
"0.5072669",
"0.50701016",
"0.50696754",
"0.5048871",
"0.504592",
"0.50436896",
"0.5039105",
"0.50385594",
"0.50355333",
"0.5027405"
] | 0.597836 | 1 |
Sets new range filters, old filters will be removed | public function setRangeFilters($rangeFilters) {
$this->cleanRangeFilters();
$this->addRangeFilters($rangeFilters);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function setFilters($aFilter);",
"public function setFilters()\n\t{\n\t\t$filters =& $this->conf('filters');\n\t\t$filters = (array) @func_get_args();\n\t}",
"public function setRange($filterName, $from=null, $to=null){\n if(!$this->optionExists('filter')){\n $this->search_options['filter'] = array($filterName=>array());\n }\n if(!isset($this->search_options['filter'][$filterName]))\n {\n $this->search_options['filter'][$filterName] = array();\n }\n if($from)\n {\n $this->search_options['filter'][$filterName]['from'] = $from;\n }\n if($to)\n {\n $this->search_options['filter'][$filterName]['to'] = $from;\n }\n }",
"public function setFilters($filters)\n {\n $this->cleanFilters();\n $this->addFilters($filters);\n }",
"public function setFilters()\n {\n $this->activeQueryLog()\n ->setFields()\n ->setCriteriaByQueryString()\n ->setCriteria()\n ->setIncludes()\n ->setLimit()\n ->setOrder()\n ->setGroup();\n }",
"public function setFilters($filters) {\n if (is_array($filters)) {\n $safeFilters = $this->getFiltersFromArray($filters);\n $this->filters = $safeFilters;\n }\n }",
"private function setFilter(): void\n {\n // start date is set\n if ($this->getRequest()->query->has('start_date') && $this->getRequest()->query->get('start_date', '') !== '') {\n // redefine\n $startDate = $this->getRequest()->query->get('start_date', '');\n\n // explode date parts\n $chunks = explode('/', $startDate);\n\n // valid date\n if (count($chunks) == 3 && checkdate((int) $chunks[1], (int) $chunks[0], (int) $chunks[2])) {\n $this->filter['start_date'] = $startDate;\n } else {\n // invalid date\n $this->filter['start_date'] = '';\n }\n } else {\n // not set\n $this->filter['start_date'] = '';\n }\n\n // end date is set\n if ($this->getRequest()->query->has('end_date') && $this->getRequest()->query->get('end_date', '') !== '') {\n // redefine\n $endDate = $this->getRequest()->query->get('end_date', '');\n\n // explode date parts\n $chunks = explode('/', $endDate);\n\n // valid date\n if (count($chunks) == 3 && checkdate((int) $chunks[1], (int) $chunks[0], (int) $chunks[2])) {\n $this->filter['end_date'] = $endDate;\n } else {\n // invalid date\n $this->filter['end_date'] = '';\n }\n } else {\n // not set\n $this->filter['end_date'] = '';\n }\n }",
"function filters( $filters = array() ) {\n\n\t\t$this->filters = $filters;\n\t}",
"public function defineFilters();",
"public function determineStartingFilters()\n {\n foreach (collect($this->filter)->except(self::EXCLUDED_FILTERS) as $key => $value) {\n $this->filter[$key] = [Trade::min($key), Trade::max($key)];\n }\n\n // Determine bounds for calculated fields\n $this->filter['total_volume'] = [\n Trade::min('units_per_hour') * Trade::min('duration'),\n Trade::max('units_per_hour') * Trade::max('duration'),\n ];\n }",
"function clearFilters()\n {\n // override \n }",
"public function filter (){\n\n $this->filter = array();\n\n }",
"function addFilter($newFilter)\n {\n // override \n }",
"public function setFilterSet(FilterSet $filterSet);",
"protected function adjustFilters(){\n\t\t$filtersArr = array();\n\t\tif(!empty($this->filters))\n\t\t{\n\t\t\tforeach($this->filters as $filter){\n\t\t\t\t$filtersArr[] = $this->adjustFilter($filter);\n\t\t\t}\n\t\t}\n\t\treturn $filtersArr;\n\t}",
"public function setFilter($filter = NULL);",
"public function SetDateFilters($filters)\n {\n $current = Carbon::now();\n if (empty($filters)) {\n //$tuition_start_date = date('Y-m-d',strtotime($current->subDays(7)));\n $tuition_start_date = date('Y-m-d', strtotime(Carbon::now()));\n $tuition_end_date = date('Y-m-d', strtotime(Carbon::now()));\n\n } elseif (isset($filters['start_date']) && isset($filters['end_date'])) {\n\n $tuition_start_date = $filters['start_date'];\n $tuition_end_date = $filters['start_date'];\n\n } elseif ($filters == 7) {\n\n $tuition_start_date = date('Y-m-d', strtotime($current->subDays(7)));\n $tuition_end_date = date('Y-m-d', strtotime(Carbon::now()));\n\n } elseif ($filters == 14) {\n\n $tuition_start_date = date('Y-m-d', strtotime($current->subDays(14)));\n $tuition_end_date = date('Y-m-d', strtotime(Carbon::now()));\n\n } elseif ($filters == 30) {\n\n $tuition_start_date = date('Y-m-d', strtotime($current->subDays(30)));\n $tuition_end_date = date('Y-m-d', strtotime(Carbon::now()));\n\n } elseif ($filters == 90) {\n\n $tuition_start_date = date('Y-m-d', strtotime($current->subDays(90)));\n $tuition_end_date = date('Y-m-d', strtotime(Carbon::now()));\n } elseif ($filters == 0) {\n\n $tuition_start_date = date('Y-m-d', strtotime(Carbon::now()));\n $tuition_end_date = date('Y-m-d', strtotime(Carbon::now()));\n\n } else {\n $tuition_start_date = \"\";\n $tuition_end_date = \"\";\n }\n\n return array(\n 'tuition_start_date' => $tuition_start_date,\n 'tuition_end_date' => $tuition_end_date,\n 'tuition_filter' => $filters\n );\n\n }",
"public function filters($filters) {\r\n $this->query['filters'] = $filters;\r\n return $this;\r\n }",
"private function setFilter()\n\t{\n\t\t$this->filter['month'] = $this->URL->getParameter('month');\n\t\t$this->filter['year'] = $this->URL->getParameter('year');\n\t}",
"public function clearFilters()\n {\n $this->filters = array();\n }",
"public function admin_add_filters() {\n\t\t\n\t}",
"public static function setFilters($filters)\n {\n /** @var \\Bugsnag\\Client $instance */\n return $instance->setFilters($filters);\n }",
"protected function defineFilters()\n {\n\n /*if (isset($this->request['filters'])) {\n\n foreach ($this->request['filters'] as $name => $value) {\n if ($value === null) {\n continue;\n }\n $method = 'processFilter' . ucfirst($name);\n if (!method_exists($this, $method)) {\n throw new \\Exception('invalid query filter: '\n . $name. ' (method: '.$method.')');\n }\n $this->$method($value);\n }\n }*/\n }",
"public function setFilters($filters)\n {\n $this->filters = $filters;\n return $this;\n }",
"public function resetFilter() {\r\n\t\t$gui = new ilRoomSharingBookingsGUI($this);\r\n\t\t$gui->resetFilterObject();\r\n\t}",
"public function filters();",
"public function initFilters() \r\n { \r\n if ($this->config == null) {\r\n return ;\r\n }\r\n \r\n $filters = $this->config->getAsList('filter');\r\n \r\n foreach ($filters as $filter) {\r\n\t\t\t$this->configureFilter($filter);\r\n }\r\n \r\n //$this->out($this->config);\r\n }",
"protected function register_filters() {}",
"function add_filters($filter) {\r\n\t\t$this->filterbank->add_filter($filter);\r\n\t\t\r\n\t\t\r\n\t}",
"public function registerFilters();"
] | [
"0.6747589",
"0.67275435",
"0.66308755",
"0.6455255",
"0.6436479",
"0.6318605",
"0.62561274",
"0.62529635",
"0.6215822",
"0.6123774",
"0.60880685",
"0.60162824",
"0.6006171",
"0.5987228",
"0.5982461",
"0.5951429",
"0.5950934",
"0.59206337",
"0.59187067",
"0.5892576",
"0.58289623",
"0.58180314",
"0.58143276",
"0.57810456",
"0.57396156",
"0.573853",
"0.5730864",
"0.572472",
"0.57242846",
"0.57232857"
] | 0.7488 | 0 |
Remove range filter by key | public function deleteRangeFilter($key)
{
unset($this->_rangeFilters[$key]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteFilter($key)\n {\n unset($this->_filters[$key]);\n }",
"public function removeRangeByKey($key)\n {\n if ($this->keyed) {\n foreach ($this->ranges as $rangeKey => $range) {\n if (array_key_exists('key', $range) && $range['key'] === $key) {\n unset($this->ranges[$rangeKey]);\n\n return true;\n }\n }\n }\n\n return false;\n }",
"public function zRemRangeByScore($key, $start, $end) {}",
"public function removeAll($key);",
"public function zDeleteRangeByScore($key, $start=0, $end=-1)\n {\n $key = $this->keyEncode($key);\n return $this->connection->zDeleteRangeByScore($key, $start, $end);\n }",
"public function without($key): Collection;",
"public static function removeFilterSet($setKey) {\n if (val($setKey, self::$allowedFilters)) {\n unset(self::$allowedFilters[$setKey]);\n }\n }",
"public function removeExact($key, $value);",
"public function zRemRangeByRank($key, $start, $end) {}",
"public function zRemRangeByLex(string $key, string $min, string $max) {}",
"function remove_from_filter_key($key, $oldValues, $value)\n {\n $newValues = array_diff(\n array_values(\n explode(\"&\", $oldValues)\n ), [\n $value, 'page'\n ]);\n\n if (count($newValues) == 0) {\n array_except(request()->query(), [$key, 'page']);\n\n return null;\n }\n\n return collect($newValues)->implode('&');\n }",
"function arrayDeleteAfterKey($mykey){\n //advance the internal pointed until it reaches the key\n reset($this->dateRange); \n // echo \"<br>KEY:\" . $mykey;\n $count = 0;\n $size=count($this->dateRange);\n while (key($this->dateRange) !== $mykey){\n next($this->dateRange);\n if ($size==$count){\n break;\n }\n $count++;\n }\n next($this->dateRange);\n //delete everything after the $key as the internal pointer should be pointing at it.\n //cannot use a FOREACH statement as foreach will reset the internal pointer\n while (list($key, $value) = each($this->dateRange)) {\n $datePart = explode('-', $this->dateRange[$key]);\n if ( trim($datePart[1])!=\"\" ){\n //echo \"<br>deleting-\".$this->dateRange[$key].\"<br>\";\n unset($this->dateRange[$key]);\n }\n \n }\n }",
"public function removeItemByKey($key);",
"public function eliminate(string $key): void;",
"function filter($st_results, $param, $minVal, $maxVal)\n{\n\tforeach ($st_results as $key=>$row)\n\t{\n\t\t$col = $row[$param];\t\n\t\tif ($col < $minVal || $col > $maxVal)\n\t\t\tunset($st_results[$key]); \t// delete row from array\n\t}\n\n\treturn $st_results;\n}",
"public function keyFiltered($key) {\n\t\t$this->keysFiltered[] = $key;\n\t}",
"public function eliminate($key)\n\t{\n\t\t# does nothing\n\t}",
"public function zDeleteRangeByRank($key, $start=0, $end=-1)\n {\n $key = $this->keyEncode($key);\n return $this->connection->zDeleteRangeByRank($key, $start, $end);\n }",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);"
] | [
"0.6244496",
"0.62237394",
"0.6192465",
"0.59957933",
"0.5925421",
"0.59142023",
"0.5798613",
"0.57882077",
"0.57392013",
"0.57389224",
"0.5727052",
"0.5697273",
"0.56947035",
"0.5687337",
"0.5643797",
"0.5580805",
"0.5517244",
"0.54957527",
"0.5488593",
"0.5488593",
"0.5488593",
"0.5488593",
"0.5488593",
"0.5488593",
"0.5488593",
"0.5488593",
"0.5488593",
"0.5488593",
"0.5488593",
"0.5488593"
] | 0.80783504 | 0 |
Sets new field weights values, old values will be removed | public function setFieldWeights($weights)
{
$this->cleanFieldWeights();
$this->addFieldWeights($weights);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setWeight($weight);",
"public function setWeight($weight) {\n $this->weight = $weight;\n }",
"public function setWeight(?float $value): void {\n $this->getBackingStore()->set('weight', $value);\n }",
"public function setWeight(?int $weight){\n $this->weight = $weight;\n }",
"protected function _setWeight($val)\n {\n if ((is_integer($val) || is_float($val)) && $val >= 0) {\n $this->setDpProperty('weight', $val);\n }\n }",
"private function initWeights()\n {\n array_walk(\n $this->weights,\n function (&$val, $key) {\n $val = $this->state[$key] === '1' ? 0 : $val;\n }\n );\n }",
"public function setWeight(int $weight): self;",
"public function setWeightAttribute($input)\n {\n if ($input != '') {\n $this->attributes['weight'] = $input;\n } else {\n $this->attributes['weight'] = null;\n }\n }",
"function grade_set_grade_weights() {\n global $CFG;\n global $course;\n global $USER;\n \n if (!empty($USER->id)) {\n if (!confirm_sesskey()) {\n error(get_string('confirmsesskeybad', 'error'));\n }\n }\n \n // get list of all categories\n $categories = get_records('grade_category', 'courseid', $course->id);\n if ($categories) {\n foreach ($categories as $category) {\n $form_catname = preg_replace('/[.| ]/', '_', $category->name);\n\n $submitted_category = optional_param($form_catname); \n if (is_numeric($submitted_category)) {\n // see if there is a weight if so see if it needs to be updated\n $weight = grade_get_category_weight($course->id, addslashes($category->name));\n if ($weight) {\n if ($weight->weight != $submitted_category)\n { \n set_field('grade_category', 'weight', $submitted_category, 'id', $weight->id);\n }\n \n $cur_drop = optional_param(\"drop_x_lowest$form_catname\");\n $cur_bonus_points = optional_param(\"bonus_points$form_catname\");\n $cur_hidden = optional_param(\"hidden$form_catname\");\n if ($cur_hidden) {\n $cur_hidden = true;\n }\n else {\n $cur_hidden = false;\n }\n \n if ($weight->drop_x_lowest != $cur_drop) {\n set_field('grade_category', 'drop_x_lowest', $cur_drop, 'id', $weight->cat_id);\n }\n if ($weight->bonus_points != $cur_bonus_points) {\n set_field('grade_category', 'bonus_points', $cur_bonus_points, 'id', $weight->cat_id);\n }\n if ($cur_hidden) {\n set_field('grade_category', 'hidden', 1, 'id', $weight->cat_id);\n }\n else {\n set_field('grade_category', 'hidden', 0, 'id', $weight->cat_id);\n }\n }\n else {\n // insert the new record... we shouldn't reach this point anymore\n //$new_weight->course = $course->id;\n //$new_weight->category = $category->id;\n //$new_weight->weight = $submitted_category;\n //insert_record('grade_weight', $new_weight);\n }\n }\n else {\n echo '<center><font color=\"red\">'.get_string('nonumericweight','grades').\n format_string($category->name) .': \"'.$submitted_category.'\"</font></center><br />';\n }\n }\n }\n}",
"function updateTaskWeight() {\r\n if (isset($this->request->params['form']['id'])) {\r\n $taskIdArray = explode(\"_\", $this->request->params['form']['id']);\r\n $taskId = $taskIdArray[1];\r\n $value['weight'] = trim($this->request->params['form']['value']);\r\n\r\n $this->projectTask->id = $taskId;\r\n $this->projectTask->Save($value);\r\n echo trim($value['weight']);\r\n die;\r\n }\r\n }",
"private function collectCurrentProductAttributesWeights(): void\n {\n if (empty($this->collectedAttributesWeight)) {\n $attributeCodes = [\n 'sku',\n 'name',\n 'description',\n 'test_searchable_attribute'\n ];\n foreach ($attributeCodes as $attributeCode) {\n $attribute = $this->productAttributeRepository->get($attributeCode);\n $this->collectedAttributesWeight[$attribute->getAttributeCode()] = $attribute->getSearchWeight();\n }\n }\n }",
"public function addFieldWeights($weights)\n {\n if (empty($weights) || !is_array($weights)) {\n throw new ESphinxException('Weights must be a non empty array');\n }\n\n foreach ($weights as $field => $value) {\n $this->addFieldWeight($field, $value);\n }\n }",
"function updateWeight() {\r\n if (isset($this->post['weight']) && isset($this->post['unit'])) {\r\n $weight = $this->post['weight'];\r\n $unit = $this->post['unit'];\r\n\r\n //validation\r\n $weight = floatval($weight);\r\n if (!($weight > 0 && $weight < 1000)) {\r\n throw new Exception('输入的重量范围不在0到1000之间!');\r\n }\r\n \r\n $this->load->model('healthy', 'm');\r\n if (false === array_key_exists($unit, $this->m->weightUnitOpt)) {\r\n throw new Exception('输入的重量单位错误!');\r\n }\r\n $this->session = &load_class('session');\r\n if ($this->m->updateWeight($weight, $unit) === true) {\r\n echo json_encode(array('status' => 0));\r\n }\r\n }\r\n }",
"public function Z_gatherWeightedFieldArray() {\n\t\tif(count($this->field_bundle_settings) == 0) {\n\t\t\t$this->gatherFieldBundleSettings();\n\t\t}\n\t\tif(count($this->error_array) > 0) {\n\t\t\t$this->view_string = print_r($this->error_array, TRUE);\n\t\t\treturn;\n\t}\n\t\t$instances = $this->field_bundle_settings;\n\t\tforeach ($instances as $fieldname_this => $instance_this) {\n\t\t\t// $instance_weights[$fieldname_this] = $instance_this['display']['default']['weight']; //NOT widget-weight, pretty sure\n\t\t\t$instance_weights[$fieldname_this] = $instance_this->instance->data->display['default']['weight'] + 0;\n\t\t\t// $show = $instance_this->instance->data->display->default;\n\t\t\t// $show = $instance_this->instance->data->display['default']['weight'];\n\t\t\t// dpm($show, '$show');\n\t\t\t// die();\n\t\t}\n\t\tasort($instance_weights);\n\t\t/* </Loop through $instaces to get Weights where fieldname is key> */\n\n\t\t/* <Loop through $fields to get fieldnames> */\n\t\t// foreach ($fields as $index => $field_array) {\n\t\t// \t$field_name = $field_array['field_name'];\n\t\t// \t$field_index_array[$field_name] = $index;\n\t\t// }\n\t\t/* </Loop through $fields to get fieldnames> */\n\t\t/* <Loop through $instance_weights to Construct final Element> */\n\t\t$i = 0;\n\t\tforeach ($instance_weights as $fieldname_this => $weight_this) {\n\t\t\t$weighted_field_array[$fieldname_this]['index'] = $i;\n\t\t\t$weighted_field_array[$fieldname_this]['weight'] = $weight_this;\n\t\t\t$i++;\n\t\t}\n\t\t/* </Loop through $instance_weights to Construct final Element> */\n\t\t$this->weighted_field_array = $weighted_field_array;\n\t\t$this->field_object_array_count = count($weighted_field_array);\n\t}",
"function RecalculateWeighting($table,$id) {\r\n $w = CalculateWeighting($table,$id);\r\n UpdateWeighting($table,$id,$w);\r\n return;\r\n }",
"public function setIndexWeights($weights)\n {\n $this->cleanIndexWeights();\n $this->addIndexWeights($weights);\n }",
"public function setWeight(&$form, FormStateInterface $form_state) {\n $submitted = $form_state->getValue('tabledrag');\n foreach ($submitted as $item) {\n // @todo call specif function.\n // @todo rename this tabledrag/bulkaction to compoentn type.\n \\Drupal::service('track_progress.data')->addNewComponent(\n $this->options['tabledrag'],\n [\n $this->idLabel('table_primary_id') => $item['id'],\n 'weight' => $item['weight']\n ]\n );\n }\n\n return;\n }",
"public function setWeightLimit($weight)\n\t{\n\t\t$this->data[self::KEY_DIMENSIONS][self::KEY_WEIGHT] = (double) $weight;\n\t\treturn $this;\n\t}",
"function _update_totalweight()\n\t\t{\n\t\t$this->itemcount = 0;\n\t\t$this->totalweight = 0;\n\t\tif(sizeof($this->items > 0))\n\t\t\t{\n\t\t\tforeach($this->items as $item)\n\t\t\t\t{\n\t\t\t\t$this->totalweight = $this->totalweight + ($this->itemweights[$item] * $this->itemqtys[$item]);\n\n\t\t\t\t// TOTAL ITEMS IN CART (ORIGINAL wfCart COUNTED TOTAL NUMBER OF LINE ITEMS)\n\t\t\t\t$this->itemcount += $this->itemqtys[$item];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function SetWeight($Weight, $AlternateWeight = NULL) {\n\t$workWeight = preg_replace('/[^0-9\\.]/', '', $Weight);\n\t$workAlternateWeight = trim($AlternateWeight);\n\t$workAlternateWeight = str_replace(\",\", \"\", $workAlternateWeight);\n\t$useWeight = NULL;\n\tif (is_numeric($workWeight)) {\n\t\tif (is_numeric($workAlternateWeight)) {\n\t\t\tif ($workAlternateWeight > $workWeight) $useWeight = $workAlternateWeight;\n\t\t\t\telse $useWeight = $workWeight;\n\t\t} else $useWeight = $workWeight;\n\t} else if (is_numeric($workAlternateWeight)) $useWeight = $workAlternateWeight;\n\tif (is_numeric($useWeight) && (float) $useWeight != 0) $this->Weight = $useWeight;\n}",
"public function setWeight(int $weight) {\n $this->weight = $weight;\n return $this;\n }",
"protected function updateHandlerWeights(array $handlers) {\n foreach ($handlers as $handler_id => $handler_data) {\n if ($this->entity->getHandlers()->has($handler_id)) {\n $this->entity->getHandler($handler_id)->setWeight($handler_data['weight']);\n }\n }\n }",
"public function setWeight($value) {\n if (!is_numeric($value))\n throw new Exception('Weight must be numeric');\n if ($value > 100)\n throw new Exception('A fruit cannot weigh more than 1kg');\n $this->weight = $value;\n return $this;\n }",
"public function setWeight($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->weight !== $v) {\n\t\t\t$this->weight = $v;\n\t\t\t$this->modifiedColumns[] = VpoRequestPassengerPeer::WEIGHT;\n\t\t}\n\n\t\treturn $this;\n\t}",
"function assignWeightHalf($eventid, $username)\n\t{\n\t\t$q = \"UPDATE `\" . TBL_SIGNUPS . \"` SET `weight` = 0.5 WHERE `username` = '$username' AND `eventid` = $eventid\";\n\t\treturn mysql_query($q, $this->connection);\n\t}",
"public function setFontWeight ($font_weight) {}",
"public function freeze()\n {\n parent::freeze();\n\n foreach ($this->fields as $field) {\n $field->freeze();\n }\n }",
"public function set_weight_kg($value) {\n $this->weight_kg = floatval($value);\n }",
"public function setWeight($weight)\n {\n $this->weight = $weight;\n return $this;\n }",
"public function setWeight($weight)\n {\n $this->weight = $weight;\n return $this;\n }"
] | [
"0.67397815",
"0.6461009",
"0.64476705",
"0.6383588",
"0.6213415",
"0.61490715",
"0.614135",
"0.6137214",
"0.5904821",
"0.5863787",
"0.57911277",
"0.57731277",
"0.57088464",
"0.5707311",
"0.57068235",
"0.5694809",
"0.56338745",
"0.5630615",
"0.56184477",
"0.55909747",
"0.55840385",
"0.5570712",
"0.5567497",
"0.5497401",
"0.5447435",
"0.54282117",
"0.54119134",
"0.5363612",
"0.53519994",
"0.53519994"
] | 0.7773538 | 0 |
Check is limit setted. | public function getIsLimited()
{
return (int)$this->limit > 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasLimit();",
"public function hasLimit()\n {\n return (null !== $this->offset && null !== $this->amount);\n }",
"function pip_shop_checklimitation($username=\"\", $category=\"\", $id=\"\", $limit=\"\") {\n\t\t$ok = true;\n\t\tif (!empty($username) && !empty($category) && !empty($id) && !empty($limit)) {\n\t\t\tif ($limit > 0) {\n\t\t\t\t$amount = pip_object_getamount($username, $category, $id);\n\t\t\t\tif ($amount >= $limit) {\n\t\t\t\t\t$ok = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ok;\n\t}",
"function isMaxReached() {\n\t\treturn ($this->find('count') >= $this->limit);\n\t}",
"public function isLimitReached()\n {\n return $this->limitReached;\n }",
"public static function isValidLimit($limit)\n {\n return ( is_int($limit) && $limit >=static::MIN_LIMIT && $limit<=static::MAX_LIMIT );\n }",
"public function checkTotalLimit()\r\n {\r\n if ($this->total_limit === $this::ON) {\r\n\r\n $startTime = TimeHelper::startTime($this->total_limit_period);\r\n\r\n $submissions = FormSubmission::find()->select('id')->asArray()\r\n ->where(['form_id' => $this->id])\r\n ->andWhere(['between','created_at', $startTime, time()])->count();\r\n\r\n if ($this->total_limit_number <= $submissions) {\r\n /** @var \\yii\\web\\Response $response */\r\n $response = Yii::$app->getResponse();\r\n $response->format = Response::FORMAT_JSON;\r\n $response->data = array(\r\n 'action' => 'submit',\r\n 'success' => false,\r\n 'id' => 0,\r\n 'message' => Yii::t(\"app\", \"Sorry, the form does not accept more submissions per {period}.\", [\r\n 'period' => TimeHelper::getPeriodByCode($this->total_limit_period)]),\r\n );\r\n $response->send();\r\n\r\n exit;\r\n }\r\n }\r\n }",
"public function checkRequestLimit()\n {\n $isLimitReached = false;\n $client = $this->getClient();\n \n if ( ! is_null($client)) {\n $currentTotalRequest = 1;\n $currentTime = time();\n $requestLimitUntil = $currentTime;\n \n $requestLimitUntil = strtotime($client->request_limit_until);\n if ($requestLimitUntil < 0) {\n $requestLimitUntil = $currentTime;\n }\n\n if ($currentTime <= $requestLimitUntil) {\n $currentTotalRequest = $client->current_total_request + 1;\n\n if ($currentTotalRequest > $client->request_limit) {\n $isLimitReached = true;\n }\n }\n\n if ($currentTime > $requestLimitUntil) {\n $dateTime = new DateTime('+1 hour');\n\n $requestLimitUntil = $dateTime->getTimestamp();\n\n unset($dateTime);\n }\n\n if ( ! $isLimitReached) {\n $dateTime = new DateTime();\n\n $client->current_total_request = $currentTotalRequest;\n $client->request_limit_until = $dateTime->setTimestamp($requestLimitUntil)->format('Y-m-d H:i:s');\n $client->last_request_at = $dateTime->setTimestamp($currentTime)->format('Y-m-d H:i:s');\n\n $client->save();\n\n unset($dateTime);\n }\n }\n\n unset($client);\n\n return $isLimitReached;\n }",
"protected function hasLimit(mixed $limit): bool\n {\n /** In MySQL limit argument must be a non-negative integer constant */\n return ctype_digit((string) $limit);\n }",
"private function checkLimitations()\n {\n// @todo : build this out into a service\n if ($this->checkLocomotion()) {\n return true;\n }\n return false;\n }",
"private function limit_check( $input = FALSE )\n {\n if ( $input != FALSE )\n {\n list( $this->config['API_Limit_current'], $this->config['API_Limit'] ) = explode( '/', $input );\n }\n else\n {\n // no input given, lets call the limit uri and get our current\n $data = curl('https://xboxapi.com/v1/limit/');\n\n if(strpos($data, '/') != FALSE)\n {\n list( $this->config['API_Limit_current'], $this->config['API_Limit'] ) = explode( '/', $data );\n }\n else\n {\n // set the error\n $this->config['error'] = 'Error retrieveing current limit from XboxAPI...';\n }\n }\n\n // lets do a check against the current data to see if we are over or under the limit\n if ( $this->config['API_Limit_current'] < $this->config['API_Limit'] )\n return TRUE;\n\n return FALSE;\n }",
"private function verify_limit($page_param) {\n return ($this->get_pages() >= $page_param) ? true : false;\n }",
"public function checkUserLimit()\n {\n // returns User object or null if not authenticated\n $user = $this->security->getUser();\n\n if( $_ENV['APP_DEBUG'])\n $this->logger->debug('Checking submission limit for '. $user->getEmail());\n\n\tif( !$this->security->isGranted('ROLE_USER')) {\n\n\t if( $_ENV['APP_DEBUG'])\n $this->logger->debug('Access denied');\n\n\t return false;\n\t}\n\n\t// Queue manager is allowed to override the limit\n if ($this->security->isGranted('ROLE_QUEUE_MANAGER')) {\n\n $this->logger->debug(\n\t\t'User posesses a queue manager privileges.');\n\n\t return true;\n\t}\n\n // get user limit from the DB\n $limit = $user->getQueueLimit();\n\tif( $limit == null)\n\t $limit = $_ENV['USER_QUEUE_SUBMISSION_LIMIT'];\n\n\tif( $_ENV['APP_DEBUG'])\n $this->logger->debug('User queue submission limit '.$limit);\n\n\t// Fetch user items currently in the queue, Pending (by default)\n\t$items = $this->getUserQueueItems();\n\n\treturn $items < $limit;\n }",
"public function checkIntervalLimit()\n {\n if (strtotime('- '.$this->config->getIntervalLimit(). ' second') >= $this->data['period']['lastDate']) {\n return true;\n }\n if ($this->data['intervalMaxRequest'] < 1) {\n $this->execBan('Interval');\n return false;\n }\n return true;\n }",
"protected function validateLimit($limit)\n {\n \n if (is_integer($limit)) {\n return $limit;\n } else {\n return false;\n }\n \n }",
"private function SMSVerificationAttemptLimitEnabled()\n {\n return !empty($this->sms_verification_attmpt_limit);\n }",
"public function hasReachedLimit($identifier);",
"function hasSlot() {\n\t\tif($this->limit === null) return true;\n\t\treturn ($this->size() < $this->limit);\n\t}",
"public function hasQuota(){\n return $this->_has(9);\n }",
"function check_bulk_limit( $reset = false, $key = 'bulk_sent_count' ) {\n\n\t\t\t$transient_name = WP_SMUSH_PREFIX . $key;\n\n\t\t\t$bulk_sent_count = get_transient( $transient_name );\n\n\t\t\t//Check if bulk smush limit is less than limit\n\t\t\tif ( ! $bulk_sent_count || $bulk_sent_count < $this->max_free_bulk ) {\n\t\t\t\t$continue = true;\n\t\t\t} elseif ( $bulk_sent_count == $this->max_free_bulk ) {\n\t\t\t\t//If user has reached the limit, reset the transient\n\t\t\t\t$continue = false;\n\t\t\t\t$reset = true;\n\t\t\t} else {\n\t\t\t\t$continue = false;\n\t\t\t}\n\n\t\t\t//If we need to reset the transient\n\t\t\tif ( $reset ) {\n\t\t\t\tset_transient( $transient_name, 0, 60 );\n\t\t\t}\n\n\t\t\treturn $continue;\n\t\t}",
"function isReachLimit() {\r\n\t\t$unwhiteDomainsCount = count($this->unwhiteDomains);\r\n\t\treturn $this->linkNumberLimit ? $unwhiteDomainsCount >= $this->linkNumberLimit : false;\r\n\t}",
"public function hasQuota(){\n return $this->_has(16);\n }",
"public function hasReachedThrottle()\n {\n $attempt_key = $this->getAttemptCacheName();\n $attempts = Cache::get($attempt_key, 0);\n\n return $attempts > $this->getCredential('throttle_limit', 15);\n }",
"public function checkHourlyLimit()\n {\n if (strtotime('- '.$this->config->getHourlyLimit().' second') >= $this->data['period']['lastDate']) {\n return true;\n }\n if ($this->data['hourlyMaxRequest'] < 1) {\n $this->execBan('Hourly');\n return false;\n }\n return true;\n }",
"function checkLimits($conn, $limitStat) {\n if (isset($_POST['limit_min'])) {\n $limit_min = (string) mysqli_real_escape_string($conn, $_POST['limit_min']);\n $limitStat = 'LIMIT ' . $limit_min . ', 6';\n $isAJAX = true;\n return [$limitStat, $isAJAX];\n }\n return [$limitStat, false];\n }",
"public function getLimit() : int;",
"abstract public function getLimit();",
"public function testHasLimit() {\n $this->assertEquals(2, $this->lists->limit());\n }",
"public function limit();",
"public function isUnderLimitTicket()\n {\n $actualDate = new \\DateTime();\n\n if ((1000 - count($this->em->getRepository(Ticket::class)->getTicketsByDay($actualDate))) < 100) {\n $this->session->getFlashBag()->add(\n 'alert',\n 'Alert ! Il reste moins de 100 billets sur la journée en cours, ne perdez pas de temps'\n );\n }\n }"
] | [
"0.86616296",
"0.76858354",
"0.76586527",
"0.74752253",
"0.7285073",
"0.719617",
"0.7152735",
"0.712905",
"0.7082182",
"0.705856",
"0.7042623",
"0.7038807",
"0.70323807",
"0.70315516",
"0.69444",
"0.6930156",
"0.6918529",
"0.69044447",
"0.689314",
"0.6879946",
"0.6809141",
"0.67731446",
"0.67127484",
"0.6709724",
"0.67040485",
"0.6700587",
"0.6692934",
"0.6674602",
"0.66735524",
"0.66384023"
] | 0.83028173 | 1 |
Get maximum id in range | public function getMaxId()
{
return $this->_maxId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function max_id ($request) {\n $dosql = \"SELECT * FROM \".$GLOBALS['prefix'] . $request;\n $result = $GLOBALS['lbdata']->GetArray($dosql);\n $max = 0;\n foreach ($result as $row) {\n if ($row['id'] > $max) $max = $row['id'];\n }\n return $max;\n}",
"private function getMaximumId()\n {\n return $this->db->fetchColumn( 'SELECT MAX(id) FROM metrics' );\n }",
"public function getMaxId() {\n \t$max_id = Transfer::max('id');\n \treturn compact('max_id');\n }",
"function getMaxIdBoletos(){\n\t\t\t$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` ORDER BY id DESC LIMIT 0,1\");\n\t\t\t\n\t\t\t// Pega o ultimo id do boleto.\n\t\t\t$id = mysql_fetch_array($consulta);\n\t\t\t\n\t\t\t// Retorna o proximo numero para gerar o boleto.\n\t\t\treturn $id['id'] + 1;\n\t\t}",
"public function getMax(): int;",
"public function getMax(): int;",
"static public function find_max_id() {\n // find max id\n $sql = \"SELECT MAX(\" . static::$idName . \") FROM \" . static::$tableName;\n \n $result = self::$database->query($sql);\n // error handling\n self::db_error_check($result);\n // get row, only one there\n $row = $result->fetch_array();\n // return count \n return array_shift($row);\n }",
"public function jidlaMaxId() {\n\t\treturn max($this->vratJidlaIds());\n\t}",
"public function get_max_id()\n {\n \t$client = new Client();\n \t$url_string = $this->base_api.\"maxitem\".$this->after_item;\n \t$response = $client->get($url_string);\n \t$response = $response->json();\n \treturn $response;\n }",
"function get_id_max_ins()\n\t{\n\t\t$kode = 'INS';\n\t\t$sql = \"SELECT MAX(id_instansi) as max_id FROM tb_instansi\";\n\t\t$row = $this->db->query($sql)->row_array();\n\t\t$max_id = $row['max_id'];\n\t\t$max_no = (int) substr($max_id,4,8);\n\t\t$new_no = $max_no + 1;\n\t\t$new_id_instansi = $kode.sprintf(\"%05s\",$new_no);\n\t\treturn $new_id_instansi;\n\t}",
"function getMaxIdBoletosCertificados(){\n\t\t\t$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` ORDER BY id DESC LIMIT 0,1\");\n\t\t\t\n\t\t\t// Pega o ultimo id do boleto.\n\t\t\t$id = mysql_fetch_array($consulta);\n\t\t\t\n\t\t\t// Retorna o proximo numero para gerar o boleto.\n\t\t\treturn $id['id'] + 1;\n\t\t}",
"public function setMaxId($max)\n {\n $this->_maxId = intval($max);\n }",
"public function surovinyMaxId() {\n\t\treturn max($this->vratSurovinyIds());\n\t}",
"function getMaxIdBoletosAvulsos(){\n\t\t\t// Monta a query\n\t\t\t$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` ORDER BY id DESC LIMIT 0,1\");\n\t\t\t\n\t\t\t// Pega o ultimo id do boleto.\n\t\t\t$id = mysql_fetch_array($consulta);\n\t\t\t\n\t\t\t// Retorna o proximo numero para gerar o boleto.\n\t\t\treturn $id['id'] + 1;\t\t\t\n\t\t\t\n\t\t\t// Este código foi comentado para evitar erro que excluir o boleto e ele sobre escrever o ultimo boleto avulso. \n\t\t\t//$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` \");\n\t\t\t//return mysql_num_rows($consulta) + 1;\n\t\t}",
"public function obtenerUltimoId();",
"public function getMaxId(): int\n {\n $sql = 'SELECT max(id) FROM src_table';\n return $this->dbFactory->getSingleNumber('src', $sql);\n }",
"public static function idUsersMax() {\n \t$query = 'SELECT MAX(strdt(?uid, xsd:integer)) as ?max WHERE{ ?user a sioc:UserAccount ; sioc:id ?uid . }';\n $results = SPARQL::runSPARQLQuery($query);\n $jsnResults = json_decode($results);\n\tif (!empty($jsnResults) && sizeof($jsnResults->results->bindings) > 0 && property_exists($jsnResults->results->bindings[0],\"max\")) {\n return $jsnResults->results->bindings[0]->max->value;\n\t} else {\n\t return 0;\n\t}\n }",
"function maxSlip() {\n $maxid = 0;\n $row = $this->db->query('SELECT MAX(slip_number) AS `maxid` FROM `slip_number`')->row();\n if ($row) {\n $maxid = $row->maxid;\n }return $maxid + 1;\n }",
"public function getMaximumRange() {\n\t\treturn $this->maximumRange;\n\t}",
"public function getMaxExternalId()\n {\n $externalIdColumnName = 'externalId';\n\n return (int) $this->model->max($externalIdColumnName);\n }",
"public function maxIdPelicula(){\n $consulta =\"SELECT MAX(idPelicula) FROM pelicula\";\n return DataBase::getConsultasPDO($consulta);\n }",
"public function setMaxGrid() {\n\n // set the query\n $query = 'select MAX(distinct `gridId`) as `gridID`\n from `userReg`';\n\n // prepare and execute the query.\n $stmt = $this->mDb->prepare($query);\n $stmt->execute();\n\n // return the last grid DI\n return $stmt->fetch(PDO::FETCH_ASSOC)['gridID'];\n }",
"public function max()\n {\n if (!isset($this->meta['max'])) {\n $this->meta['max'] = (int) @max($this->get());\n }\n return $this->meta['max'];\n }",
"private function prossimoIdAppelli(&$appelli) {\n $max = -1;\n foreach ($appelli as $a) {\n if ($a->getId() > $max) {\n $max = $a->getId();\n }\n }\n return $max + 1;\n }",
"abstract protected function maxUnsignedValue();",
"function GetMax() {\n return $this->iMax;\n }",
"public function getMaxId(){\n\t\t$result = mysql_query(\"Select MAX(did) from driver\");\n\t\tif($row = mysql_fetch_array($result)){\n\t\t\treturn $row[0];\n\t\t}\n\t\treturn NULL;\n\t}",
"function getrandmax () {}",
"public function getMax() : int {\n\t\treturn $this->max;\n\t}",
"public function getMax() : int {\n\t\treturn $this->max;\n\t}"
] | [
"0.7159304",
"0.69215745",
"0.68780756",
"0.6849805",
"0.66900945",
"0.66900945",
"0.6649196",
"0.6647611",
"0.6605865",
"0.6567754",
"0.6560183",
"0.655644",
"0.65532964",
"0.64915323",
"0.6424526",
"0.6364733",
"0.6351286",
"0.6326982",
"0.63170147",
"0.62851304",
"0.6281315",
"0.6220847",
"0.6220312",
"0.6191535",
"0.61378556",
"0.60879916",
"0.60784453",
"0.60734457",
"0.60706633",
"0.60706633"
] | 0.72124094 | 0 |
Set max id value | public function setMaxId($max)
{
$this->_maxId = intval($max);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMaxId()\n {\n return $this->_maxId;\n }",
"function setMax($max) {\n $this->max = $max;\n }",
"public function getMaxId() {\n \t$max_id = Transfer::max('id');\n \treturn compact('max_id');\n }",
"function setMaximum($max) {\n\t\t$this->max = $max;\n\t}",
"function system_twitter_jobSetMaxId($max_id, $id, $type) {\n\t\t\n\t\t$query = \"UPDATE $type SET since_id = :since_id WHERE id = :id\";\n\t\t$query_params = array(\n\t\t\t':since_id' => $max_id,\n\t\t\t':id' => $id\n\t\t);\n\t\t\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare($query);\n\t\t\t$result = $stmt->execute($query_params);\n\t\t} catch(PDOException $ex) {\n\t\t\t$this->error_message($ex);\n\t\t}\n\t\t\n\t\tif ($stmt->rowCount() == 1) {\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn false;\n\t\t\n\t}",
"public function setMax(int $max): self;",
"function getUniqueID(){\n\n\t\t$maxID = $this->Model->maxFrom('id_kampanye','infokampanye');\n\n\t\treturn (int) $maxID;\n}",
"private function getMaximumId()\n {\n return $this->db->fetchColumn( 'SELECT MAX(id) FROM metrics' );\n }",
"function getUniqueID(){\n\n $maxID = $this->Model->maxFrom('id','tbl_sukarelawan');\n\n return (int) $maxID;\n }",
"function School_userapi_AssignID($args)\n{\n // Not recomended, but what can we do ?\n $results = DBUtil::executeSQL(\"select max(cast(oba_value as unsigned)) from zk_objectdata_attributes where oba_attribute_name='FamilyID'\");\n $familyid = $results->fields[0] + 1;\n if ($familyid < 910000) $familyid = 910000;\n pnUserSetVar('FamilyID', $familyid);\n return $familyid;\n}",
"static function new_campaign_id()\n {\n global $wpdb;\n $max_id = $wpdb->get_var('SELECT MAX(id) FROM ' . self::campaigns_table() . ' WHERE id is not null;');\n if ($max_id === NULL) {\n return 1;\n }\n $new_id = (int)$max_id + 1;\n return $new_id;\n }",
"public function obtenerUltimoId();",
"function max_id ($request) {\n $dosql = \"SELECT * FROM \".$GLOBALS['prefix'] . $request;\n $result = $GLOBALS['lbdata']->GetArray($dosql);\n $max = 0;\n foreach ($result as $row) {\n if ($row['id'] > $max) $max = $row['id'];\n }\n return $max;\n}",
"function getMaxIdBoletos(){\n\t\t\t$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` ORDER BY id DESC LIMIT 0,1\");\n\t\t\t\n\t\t\t// Pega o ultimo id do boleto.\n\t\t\t$id = mysql_fetch_array($consulta);\n\t\t\t\n\t\t\t// Retorna o proximo numero para gerar o boleto.\n\t\t\treturn $id['id'] + 1;\n\t\t}",
"public static function resetCounter()\n {\n \t$result = static::find()->select('MAX(id) as maxId')->asArray()->one();\n \t$lastId = intval($result['maxId']);\n \t$resetAutoIncrement = Yii::$app->db->createCommand('ALTER TABLE {{' . static::tableName() . '}} AUTO_INCREMENT=:nextId;', [\n \t\t':nextId' => $lastId + 1\n \t]);\n \t$resetAutoIncrement->execute();\n }",
"public function getMaxId(): int\n {\n $sql = 'SELECT max(id) FROM src_table';\n return $this->dbFactory->getSingleNumber('src', $sql);\n }",
"public function getMaxID(){\n\t\t try{\n\t\t\t$conn = DBConnection::GetConnection();\t\n\t\t\t$queryForGetMaxId=\"SELECT MAX(song_id) AS max_value FROM release_song\";\n\t\t\t$max_result=$conn->prepare($queryForGetMaxId);\n\t\t\t$max_result->execute();\n\t\t\t$maxId = $max_result->fetch(PDO::FETCH_ASSOC); \n\t\t\t$pId=$maxId['max_value']; \n\t\t\t$incrementPid=$pId+1;\n\t\t\treturn $incrementPid;\n\t\t}catch(PDOException $e){\n\t\t\techo 'Fail to connect';\n\t\t\techo $e->getMessage();\n\t\t}\t\n }",
"public function jidlaMaxId() {\n\t\treturn max($this->vratJidlaIds());\n\t}",
"function get_id_max_ins()\n\t{\n\t\t$kode = 'INS';\n\t\t$sql = \"SELECT MAX(id_instansi) as max_id FROM tb_instansi\";\n\t\t$row = $this->db->query($sql)->row_array();\n\t\t$max_id = $row['max_id'];\n\t\t$max_no = (int) substr($max_id,4,8);\n\t\t$new_no = $max_no + 1;\n\t\t$new_id_instansi = $kode.sprintf(\"%05s\",$new_no);\n\t\treturn $new_id_instansi;\n\t}",
"static function new_ad_id()\n {\n global $wpdb;\n $max_id = $wpdb->get_var('SELECT MAX(id) FROM ' . self::ads_table() . ' WHERE id is not null;');\n if ($max_id === NULL) {\n return 1;\n }\n $new_id = (int)$max_id + 1;\n return $new_id;\n }",
"function getMaxIdBoletosCertificados(){\n\t\t\t$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` ORDER BY id DESC LIMIT 0,1\");\n\t\t\t\n\t\t\t// Pega o ultimo id do boleto.\n\t\t\t$id = mysql_fetch_array($consulta);\n\t\t\t\n\t\t\t// Retorna o proximo numero para gerar o boleto.\n\t\t\treturn $id['id'] + 1;\n\t\t}",
"public function setMax($max)\r\n {\r\n $this->max = $max;\r\n return $this;\r\n }",
"public function surovinyMaxId() {\n\t\treturn max($this->vratSurovinyIds());\n\t}",
"public function get_max_id()\n {\n \t$client = new Client();\n \t$url_string = $this->base_api.\"maxitem\".$this->after_item;\n \t$response = $client->get($url_string);\n \t$response = $response->json();\n \treturn $response;\n }",
"function auto_id(){\n\t\t$query = $this->db->query(\"SELECT max(id_pinjam) as id_new FROM pinjam\");\n\t\t$data =$query->row_array();\n\t\t$id_pinjam = $data['id_new'];\n\n\t\t// mengambil angka dari kode barang terbesar, menggunakan fungsi substr\n\t\t// dan diubah ke integer dengan (int)\n\t\t$urutan = (int) substr($id_pinjam, 3, 3);\n\n\t\t// bilangan yang diambil ini ditambah 1 untuk menentukan nomor urut berikutnya\n\t\t$urutan++;\n\n\t\t// membentuk kode barang baru\n\t\t// perintah sprintf(\"%03s\", $urutan); berguna untuk membuat string menjadi 3 karakter\n\t\t// misalnya perintah sprintf(\"%03s\", 15); maka akan menghasilkan '015'\n\t\t// angka yang diambil tadi digabungkan dengan kode huruf yang kita inginkan, misalnya BRG \n\t\t$huruf = \"S-\";\n\t\t$id_pinjam = $huruf . sprintf(\"%03s\", $urutan);\n\t\treturn $id_pinjam;\n\t}",
"function circulum_get_maxtitle($maxid=9999) {\n\t\t$sql = \"SELECT max(objid) as titleid FROM \".db_prefix(\"module_objprefs\").\" WHERE modulename='circulum' AND objtype='circulum_title' AND objid<=$maxid;\"; //(titleid,dk,ref,male,female) VALUES ($id,$dk,'$ref','$male','$female')\";\n\t\t$result=db_query($sql);\n\t\t$row=db_fetch_assoc($result);\n\t\treturn $row['titleid'];\n\t}",
"protected function setId($value)\n {\n $this->_id = (int)$value;\n }",
"public function setMax($max)\n {\n $this->max = $max;\n return $this;\n }",
"function maxSlip() {\n $maxid = 0;\n $row = $this->db->query('SELECT MAX(slip_number) AS `maxid` FROM `slip_number`')->row();\n if ($row) {\n $maxid = $row->maxid;\n }return $maxid + 1;\n }",
"public function setMaxMsgId($max_msg_id)\n {\n $this->vkarg_max_msg_id = $max_msg_id;\n\n return $this;\n }"
] | [
"0.7368489",
"0.6728753",
"0.6727467",
"0.67181003",
"0.65671355",
"0.652165",
"0.6381731",
"0.6381454",
"0.63609004",
"0.6353021",
"0.6331361",
"0.63282585",
"0.632152",
"0.63119745",
"0.6276113",
"0.6261312",
"0.62335104",
"0.62259674",
"0.61969537",
"0.61797243",
"0.6163288",
"0.6153889",
"0.6134767",
"0.6106181",
"0.6095049",
"0.6086492",
"0.60782665",
"0.60564506",
"0.6032519",
"0.60314524"
] | 0.8358068 | 0 |
Get minimum id in range | public function getMinId()
{
return $this->_minId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMinimumId() {\n return $this->minimumId;\n }",
"public function getMin(): int;",
"public function getMin(): int;",
"public function setMinId($min)\n {\n $this->_minId = intval($min);\n }",
"public function getMinimum();",
"function min_id()\n\t{\n\t\t$this->openDb();\n\t\t$query = \"SELECT min_id FROM persistEntries;\";\n\t\t$result = mysql_query($query);\n\t\t$tbl = mysql_fetch_array($result);\n\t\t$min_id = $tbl['min_id'];\n\t\t$this->closeDb();\n\t\treturn $min_id;\n\t}",
"public function getFirstInRange()\n {\n $start = $this->getCurrentPage() - $this->range;\n $start = ($start > 1) ? $start : 1;\n\n return $start;\n }",
"public function minMin(): int\n {\n return 1;\n }",
"public function getAgeMin() {\n\t\t$ageMinResults = $this->getInt('age_range_minimum');\n\t\treturn $ageMinResults;\n\t}",
"function getFirstID() {\n\tglobal $conn;\n\t$query = \"SELECT MIN(word_bg_id) AS min_id FROM words_bg\";\n\t$result = mysqli_query($conn,$query) or die(\"Query error: \" . mysqli_error($conn));\n\t$row = mysqli_fetch_assoc($result);\n\n\treturn $row['min_id'];\n}",
"public function min()\n {\n if (!isset($this->meta['min'])) {\n $this->meta['min'] = (int) @min($this->get());\n }\n return $this->meta['min'];\n }",
"public function setMinimumId($minimumId) {\n $this->minimumId = $minimumId;\n return $this;\n }",
"function return_next_empty_id($input_array,$min_id=NULL)\n {\n\n// 20.07.10\n\n$max_id = 10000;\n\n$min_id = ($min_id > 0) ? $min_id : 1;\n\n for($i=$min_id;$i<($max_id + 1);$i++)\n {\n\n$used = 0;\n\n $line_count = count($input_array);\n for($ii=0;$ii<$line_count;$ii++)\n {\n if($input_array[$ii]['channel_number'] == $i) $used = 1;\n }\n\nif($used === 0) return $i;\n\n }\n\n }",
"public function meetsMinimum($id, Attribute $attribute);",
"function getPositionMin(){\n $select = $this->createQueryBuilder('s');\n $select\n ->select('MIN(s.position)');\n return $select->getQuery()->getSingleScalarResult();\n }",
"public function getMin(): int\n {\n return (int)$this->getData(self::MIN);\n }",
"public static function min(int $min, bool $inclusive = true): self\n {\n return self::make($min, null, $inclusive);\n }",
"public function retrieveMin() {\n $min_value = 1000;\n $min_position = 0;\n \n\n $images = $this->retrieve();\n foreach($images as $image) {\n if($min_value > $image[\"occurences\"]) {\n $min_value = $image[\"occurences\"];\n $min_position = $image[\"id\"];\n }\n }\n return array(\"id\" => $min_position,\n \"occurences\" => $min_value);\n }",
"function trouver_min($tableau) {\n $min = $tableau[0];\n\n foreach ($tableau as $element) {\n if ($element < $min) {\n $min = $element;\n }\n }\n\n return $min;\n}",
"function trouver_min($tableau) {\n $min = $tableau[0];\n\n foreach ($tableau as $element) {\n if ($element < $min) {\n $min = $element;\n }\n }\n\n return $min;\n}",
"public function getMin(): int {\n\t\treturn $this->date->getMin();\n\t}",
"public function min($field);",
"public function setMin(int $min): self;",
"function MINid($path, $tabla){\n \n // Inclusion de archivos necesarios\n require_once $path.'core/db.class.core.php';\n require_once $path.'includes/config.inc.php';\n \n $debug = DEBUG;\n \n // Crear la instancia y conectar a la BD\n $conec = new db();\n $conec->dbConexion(); \n \n $sql_minid = \"SELECT MIN(id) AS id FROM \".$tabla;\n $query_minid = $conec->dbQuery($sql_minid, $debug);\n $datos_minid = $conec->dbFetchArray($query_minid);\n $minid = $datos_minid['id'];\n \n return $minid;\n }",
"public function testMinIntegers() {\n $values = [1, 2, 3, 4, 4];\n $result = Stats::min($values);\n $expected = 1;\n ok($expected, $result);\n }",
"public function getMin()\n\t{\n\t\treturn $this->min;\n\t}",
"public function setIdRange($min, $max)\n {\n $this->_minId = (int)$min;\n $this->_maxId = (int)$max;\n }",
"abstract protected function minUnSignedValue();",
"public function getMin()\n {\n return $this->min;\n }",
"public function getMin()\n {\n return $this->min;\n }"
] | [
"0.7107776",
"0.67051667",
"0.67051667",
"0.6538189",
"0.63762015",
"0.63315415",
"0.6133519",
"0.59739244",
"0.5954989",
"0.59331346",
"0.5930886",
"0.5901635",
"0.582949",
"0.5784673",
"0.5755449",
"0.5745182",
"0.56774735",
"0.5656557",
"0.5644471",
"0.5644471",
"0.5642027",
"0.56369907",
"0.56271183",
"0.5603793",
"0.5569575",
"0.55620825",
"0.55514944",
"0.5547085",
"0.5542029",
"0.5542029"
] | 0.69081235 | 1 |
Subsets and Splits