query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Finds a portlet by the given portlet ID. | public function findById($id)
{
$model = $this->createModel();
if ( ! $portlet = $model->newQuery()->find($id))
{
throw new PortletNotFoundException("A portlet could not be found with ID [$id].");
}
return $portlet;
} | [
"public function find(string $id): Outlet\n {\n return $this->single(Outlet::class, \"2.0/outlets/$id\");\n }",
"public function get($id) {\n $droplet = $this->droplets->one($id);\n if (!$droplet) return $this->send(404);\n $this->send(['droplet' => $droplet]);\n }",
"public function planFind($id);",
"public static function find($id){\n $conn = static::connection();\n\t$sql = \"SELECT *\"\n . \" FROM Planning\"\n . \" WHERE ID = \" . $conn->real_escape_string($id)\n . \" LIMIT 1\";\n\n // Perform query\n\t$result = $conn->query($sql);\n \n // Fetch the associative array\n\twhile($obj = $result->fetch_object()){\n return new Planning($obj);\n\t}\n }",
"public function find($id) {\n\t\treturn $this->department->find($id);\n\t}",
"public function selectById($id) {\n foreach ($this->selectAll() as $portalEntry) {\n if ($portalEntry->getId() == $id)\n return $portalEntry;\n }\n return null;\n }",
"public function find($id)\n {\n return $this->certificate_template->find($id);\n }",
"public function find($id)\n {\n return $this->fortune->find($id);\n }",
"protected function findRoute($id)\n {\n $partials = explode('.', $id);\n $collection = array_shift($partials);\n $id = implode('.', $partials);\n\n try {\n return RouteCollection::resolve($collection)->findRoute($id);\n } catch (InvalidArgumentException $e) {\n return;\n }\n }",
"public function find($id)\n {\n $poolData = $this->db->fetchAssoc('SELECT * FROM pools WHERE pool_id = ?', array($id));\n return $poolData ? $this->buildPool($poolData) : FALSE;\n }",
"public function findModule($id)\n\t{\n\t\tif(($controller=$this->getController())!==null && ($module=$controller->getModule())!==null)\n\t\t{\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(($m=$module->getModule($id))!==null)\n\t\t\t\treturn $m;\n\t\t\t} while(($module=$module->getParentModule())!==null);\n\t\t}\n\t\tif(($m=$this->getModule($id))!==null)\n\t\treturn $m;\n\t}",
"public function findElementById($id);",
"public static function find($id) {\n if ($id != null) {\n $rows = DB::query('SELECT * FROM Department WHERE id = :id LIMIT 1', array('id' => $id));\n\n if (count($rows) > 0) {\n $row = $rows[0];\n\n $department = self::create_department($row);\n }\n\n return $department;\n } else {\n return null;\n }\n }",
"public function findTemplate($id);",
"public static function findPlan($id)\n {\n return static::plans()->where('id', $id)->first();\n }",
"public function find($identifier);",
"public static function find($id, $columns = array()) {\n \tif(Auth::user()->isAdmin())\n \t\treturn parent::find($id); \n\n \t$job = Job::whereId($id)->first(); \n\n \tif(isset($job->id) && $job->object->spot->basestation->user_id == Auth::user()->id)\n \t\treturn $job; \n \telse\n \t\treturn false; \n }",
"function wp_api_v2_find_object_by_id( $array, $id ) {\n\tforeach ( $array as $element ) {\n\t\tif ( $id == $element->ID ) {\n\t\t\t\treturn $element;\n\t\t}\n\t}\n\n\treturn false;\n}",
"public function find($id)\n {\n return Box::find($id);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the body of the request as multipart/formdata. | public function getMultipartBody()
{
$params = $this->getPostParams();
return new RequestBodyMultipart($params, $this->files);
} | [
"public function getMultipartBody()\n {\n $params = $this->getPostParams();\n\n return new RequestBodyMultipart($params, $this->files);\n }",
"protected function getRequestBodyOfMultipart() {\n\t\t$body = null;\n\t\tif($this->method == 'POST') {\n\t\t\t$body = '';\n\t\t\tif(is_array($_POST) && count($_POST) > 1) {\n\t\t\t\tforeach($_POST as $k => $v) {\n\t\t\t\t\t$body .= $k . '=' . Rfc3986::urlEncode($v) . '&';\n\t\t\t\t}\n\n\t\t\t\tif(substr($body, - 1) == '&') {\n\t\t\t\t\t$body = substr($body, 0, strlen($body) - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $body;\n\t}",
"protected function getRequestBody() {\n\t\t$body = null;\n\t\tif($this->method == 'POST' || $this->method == 'PUT') {\n\t\t\t$body = '';\n\t\t\t$fh = @fopen('php://input', 'r');\n\t\t\tif($fh) {\n\t\t\t\twhile(! feof($fh)) {\n\t\t\t\t\t$chunk = fread($fh, 1024);\n\t\t\t\t\tif(is_string($chunk)) {\n\t\t\t\t\t\t$body .= $chunk;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfclose($fh);\n\t\t\t}\n\t\t}\n\n\t\treturn $body;\n\t}",
"protected function _prepare_body()\n {\n // According to RFC2616, a TRACE request should not have a body.\n if ($this->method == self::METHOD_TRACE) {\n return '';\n }\n \n // If we have raw_post_data set, just use it as the body.\n if (isset($this->raw_post_data)) {\n $this->setHeaders('content-length', strlen($this->raw_post_data));\n return $this->raw_post_data;\n }\n \n $body = '';\n \n // If we have files to upload, force enctype to multipart/form-data\n if (count ($this->files) > 0) $this->setEncType(self::ENC_FORMDATA);\n\n // If we have POST parameters or files, encode and add them to the body\n if (count($this->paramsPost) > 0 || count($this->files) > 0) {\n switch($this->enctype) {\n case self::ENC_FORMDATA:\n // Encode body as multipart/form-data\n $boundary = '---ZENDHTTPCLIENT-' . md5(microtime());\n $this->setHeaders('Content-type', self::ENC_FORMDATA . \"; boundary={$boundary}\");\n \n // Get POST parameters and encode them\n $params = $this->_getParametersRecursive($this->paramsPost);\n foreach ($params as $pp) {\n $body .= self::encodeFormData($boundary, $pp[0], $pp[1]);\n }\n \n // Encode files\n foreach ($this->files as $name => $file) {\n $fhead = array('Content-type' => $file[1]);\n $body .= self::encodeFormData($boundary, $name, $file[2], $file[0], $fhead);\n }\n \n $body .= \"--{$boundary}--\\r\\n\";\n break;\n \n case self::ENC_URLENCODED:\n // Encode body as application/x-www-form-urlencoded\n $this->setHeaders('Content-type', self::ENC_URLENCODED);\n // $body = http_build_query($this->paramsPost);\n $param_list = array();\n while (list($param, $value) = each($this->paramsPost)) {\n array_push($param_list, urlencode($param) . \"=\" . urlencode($value));\n }\n $body = implode(\"&\", $param_list);\n break;\n \n default:\n return false;//commented by selvaraj//throw new Zend_Http_Exception(\"Cannot handle content type '{$this->enctype} automaically.\" .\n // \" Please use Zend_Http_Client::setRawData to send this kind of content.\");\n break;\n }\n }\n \n if ($body) $this->setHeaders('content-length', strlen($body));\n return $body;\n }",
"protected function getRequestBody()\n\t{\n\t\treturn $this->request->getContent();\n\t}",
"private static function getFormData()\n {\n $dados = array();\n $raw_data = file_get_contents('php://input');\n $boundary = substr($raw_data, 0, strpos($raw_data, \"\\r\\n\"));\n if (!$boundary) return $dados;\n\n $parts = array_slice(explode($boundary, $raw_data), 1);\n\n foreach ($parts as $part) {\n if ($part == \"--\\r\\n\") break;\n\n $part = ltrim($part, \"\\r\\n\");\n list($raw_headers, $body) = explode(\"\\r\\n\\r\\n\", $part, 2);\n\n $raw_headers = explode(\"\\r\\n\", $raw_headers);\n $headers = array();\n foreach ($raw_headers as $header) {\n list($name, $value) = explode(':', $header);\n $headers[strtolower($name)] = ltrim($value, ' ');\n }\n\n if (isset($headers['content-disposition'])) {\n $filename = null;\n preg_match(\n '/^(.+); *name=\"([^\"]+)\"(; *filename=\"([^\"]+)\")?/',\n $headers['content-disposition'],\n $matches\n );\n list(, $type, $name) = $matches;\n isset($matches[4]) and $filename = $matches[4];\n\n switch ($name) {\n case 'userfile':\n file_put_contents($filename, $body);\n break;\n default:\n $dados[$name] = substr($body, 0, strlen($body) - 2);\n break;\n }\n }\n }\n return $dados;\n }",
"protected function extractMultipartBody(Request $request)\n {\n if ($request->request->get('plain', FALSE)) {\n // Normalize new-lines.\n return $this->normalizePlainBody($request->request->get('plain'));\n } else {\n if ($request->request->get('html', FALSE)) {\n $html = $request->request->get('html');\n\n return $this->normalizeHTMLBody($html);\n } else {\n // We treat this as an empty body.\n return '';\n }\n }\n }",
"public function body()\n {\n if($this->request['body'] === null)\n {\n $this->request['body'] = file_get_contents('php://input');\n }\n \n return $this->request['body'];\n }",
"function request_body() {\n\n $content_type = isset($_SERVER['HTTP_CONTENT_TYPE']) ?\n $_SERVER['HTTP_CONTENT_TYPE'] :\n $_SERVER['CONTENT_TYPE'];\n\n $content = file_get_contents('php://input');\n\n if ($content_type[0] == 'application/json')\n $content = json_decode($content);\n else if ($content_type[0] == 'application/x-www-form-urlencoded')\n parse_str($content, $content);\n\n return $content;\n}",
"public function getRequestBody() {\n return $this->data['request_body'];\n }",
"public function getRawBody()\n {\n if ($this->_rawBody === null) {\n $this->_rawBody = file_get_contents('php://input');\n }\n return $this->_rawBody;\n }",
"public function getRawBody()\n {\n if ($this->_rawBody === null) {\n $this->_rawBody = file_get_contents('php://input');\n }\n\n return $this->_rawBody;\n }",
"public function getRawBody()\n {\n static $rawBody;\n if ($rawBody === null) {\n $rawBody = file_get_contents('php://input');\n }\n return $rawBody;\n }",
"public function getBody()\n\t{\n // If $rawBody is set then we will return it instead of php://input\n $data = ($this->rawBody) ? $this->rawBody : file_get_contents(\"php://input\");\n\n return $data;\n\t}",
"public function getRawBody()\n {\n return file_get_contents('php://input');\n }",
"public function getRawBody()\n {\n if (null === $this->rawBody) {\n $body = file_get_contents('php://input');\n\n if (strlen(trim($body)) > 0) {\n $this->rawBody = $body;\n } else {\n $this->rawBody = false;\n }\n }\n return $this->rawBody;\n }",
"public function getBody()\n {\n $body = $this->body;\n if ($this->isBase64()) {\n $body = base64_decode($body);\n }\n\n return $body;\n }",
"public function getRequestMultipartOptions()\n {\n if (empty($this->requestOptions['multipart'])) {\n return [];\n }\n\n return array_reduce(\n $this->requestOptions['multipart'],\n static function ($options, $item) {\n $options[$item['name']] = $item['contents'] instanceof Stream\n ? $item['contents']->getContents()\n : $item['contents'];\n return $options;\n }\n );\n }",
"public function getMultipartRaw()\n {\n $output = $this->_rawoutput;\n $output .= '--' . $this->_boundary . '--' . \"\\r\\n\";\n return $output;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert smiley code to the icon graphic file equivalent. You can turn off smilies, by going to the write setting screen and unchecking the box, or by setting 'use_smilies' option to false or removing the option. Plugins may override the default smiley list by setting the $wpsmiliestrans to an array, with the key the code the blogger types in and the value the image file. The $wp_smiliessearch global is for the regular expression and is set each time the function is called. The full list of smilies can be found in the function and won't be listed in the description. Probably should create a Codex page for it, so that it is available. | public static function smilies_init()
{
$wpsmiliestrans = array(
':mrgreen:' => 'icon_mrgreen.gif',
':neutral:' => 'icon_neutral.gif',
':twisted:' => 'icon_twisted.gif',
':arrow:' => 'icon_arrow.gif',
':shock:' => 'icon_eek.gif',
':smile:' => 'icon_smile.gif',
':???:' => 'icon_confused.gif',
':cool:' => 'icon_cool.gif',
':evil:' => 'icon_evil.gif',
':grin:' => 'icon_biggrin.gif',
':idea:' => 'icon_idea.gif',
':oops:' => 'icon_redface.gif',
':razz:' => 'icon_razz.gif',
':roll:' => 'icon_rolleyes.gif',
':wink:' => 'icon_wink.gif',
':cry:' => 'icon_cry.gif',
':eek:' => 'icon_surprised.gif',
':lol:' => 'icon_lol.gif',
':mad:' => 'icon_mad.gif',
':sad:' => 'icon_sad.gif',
'8-)' => 'icon_cool.gif',
'8-O' => 'icon_eek.gif',
':-(' => 'icon_sad.gif',
':-)' => 'icon_smile.gif',
':-?' => 'icon_confused.gif',
':-D' => 'icon_biggrin.gif',
':-P' => 'icon_razz.gif',
':-o' => 'icon_surprised.gif',
':-x' => 'icon_mad.gif',
':-|' => 'icon_neutral.gif',
';-)' => 'icon_wink.gif',
'8)' => 'icon_cool.gif',
'8O' => 'icon_eek.gif',
':(' => 'icon_sad.gif',
':)' => 'icon_smile.gif',
':?' => 'icon_confused.gif',
':D' => 'icon_biggrin.gif',
':P' => 'icon_razz.gif',
':o' => 'icon_surprised.gif',
':x' => 'icon_mad.gif',
':|' => 'icon_neutral.gif',
';)' => 'icon_wink.gif',
':!:' => 'icon_exclaim.gif',
':?:' => 'icon_question.gif',
);
if (count($wpsmiliestrans) == 0) {
return;
}
/*
* NOTE: we sort the smilies in reverse key order. This is to make sure
* we match the longest possible smilie (:???: vs :?) as the regular
* expression used below is first-match
*/
krsort($wpsmiliestrans);
$wp_smiliessearch = '/(?:\s|^)';
$subchar = '';
foreach ( (array) $wpsmiliestrans as $smiley => $img ) {
$firstchar = substr($smiley, 0, 1);
$rest = substr($smiley, 1);
// new subpattern?
if ($firstchar != $subchar) {
if ($subchar != '') {
$wp_smiliessearch .= ')|(?:\s|^)';
}
$subchar = $firstchar;
$wp_smiliessearch .= preg_quote($firstchar, '/') . '(?:';
} else {
$wp_smiliessearch .= '|';
}
$wp_smiliessearch .= preg_quote($rest, '/');
}
$wp_smiliessearch .= ')(?:\s|$)/m';
} | [
"function rocket_translate_smiley( $matches ) {\r\n\tglobal $wpsmiliestrans;\r\n\r\n\tif ( count( $matches ) == 0 )\r\n\t\treturn '';\r\n\r\n\t$smiley = trim( reset( $matches ) );\r\n\t$img = $wpsmiliestrans[ $smiley ];\r\n\r\n\t$matches = array();\r\n\t$ext = preg_match( '/\\.([^.]+)$/', $img, $matches ) ? strtolower( $matches[1] ) : false;\r\n\t$image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );\r\n\r\n\t// Don't convert smilies that aren't images - they're probably emoji.\r\n\tif ( ! in_array( $ext, $image_exts ) ) {\r\n\t\treturn $img;\r\n\t}\r\n\r\n\t/**\r\n\t * Filter the Smiley image URL before it's used in the image element.\r\n\t *\r\n\t * @since 2.9.0\r\n\t *\r\n\t * @param string $smiley_url URL for the smiley image.\r\n\t * @param string $img Filename for the smiley image.\r\n\t * @param string $site_url Site URL, as returned by site_url().\r\n\t */\r\n\t$src_url = apply_filters( 'smilies_src', includes_url( \"images/smilies/$img\" ), $img, site_url() );\r\n\r\n\t// Don't LazyLoad if process is stopped for these reasons\r\n\tif ( ! is_feed() && ! is_preview() ) {\r\n\t\t\r\n\t\t/** This filter is documented in inc/front/lazyload.php */\r\n\t\t$placeholder = apply_filters( 'rocket_lazyload_placeholder', 'data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=' );\r\n\t\t\r\n\t\treturn sprintf( ' <img src=\"%s\" data-lazy-src=\"%s\" alt=\"%s\" class=\"wp-smiley\" /> ', $placeholder, esc_url( $src_url ), esc_attr( $smiley ) );\r\n\r\n\t} else {\r\n\r\n\t\treturn sprintf( ' <img src=\"%s\" alt=\"%s\" class=\"wp-smiley\" /> ', esc_url( $src_url ), esc_attr( $smiley ) );\r\n\r\n\t}\r\n}",
"function translate_smiley($smiley) {\n\tglobal $wpsmiliestrans;\n\n\tif (count($smiley) == 0) {\n\t\treturn '';\n\t}\n\n\t$siteurl = get_option( 'siteurl' );\n\n\t$smiley = trim(reset($smiley));\n\t$img = $wpsmiliestrans[$smiley];\n\t$smiley_masked = esc_attr($smiley);\n\n\treturn \" <img src='$siteurl/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> \";\n}",
"function translate_smiley($smiley) {\n\tglobal $smiliestrans;\n\n\tif (count($smiley) == 0) {\n\t\treturn '';\n\t}\n\n\t$smiley = trim(reset($smiley));\n\t$img = $wpsmiliestrans[$smiley];\n\t$smiley_masked = esc_attr($smiley);\n\n\t$srcurl = apply_filters('smilies_src', includes_url(\"img/smilies/$img\"), $img, site_url());\n\n\treturn \" <img src='$srcurl' alt='$smiley_masked' class='wp-smiley' /> \";\n}",
"function convert_smilies($text) {\n\tglobal $smiliessearch;\n\t$output = '';\n\tif ( get_option('use_smilies') && !empty($smiliessearch) ) {\n\t\t// HTML loop taken from texturize function, could possible be consolidated\n\t\t$textarr = preg_split(\"/(<.*>)/U\", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between\n\t\t$stop = count($textarr);// loop stuff\n\t\tfor ($i = 0; $i < $stop; $i++) {\n\t\t\t$content = $textarr[$i];\n\t\t\tif ((strlen($content) > 0) && ('<' != $content[0])) { // If it's not a tag\n\t\t\t\t$content = preg_replace_callback($smiliessearch, 'translate_smiley', $content);\n\t\t\t}\n\t\t\t$output .= $content;\n\t\t}\n\t} else {\n\t\t// return default text.\n\t\t$output = $text;\n\t}\n\treturn $output;\n}",
"protected function smilies($text)\n {\n $smile = array(\n ':mrgreen:' => 'icon_mrgreen.gif',\n ':neutral:' => 'icon_neutral.gif',\n ':twisted:' => 'icon_twisted.gif',\n ':arrow:' => 'icon_arrow.gif',\n ':shock:' => 'icon_eek.gif',\n ':smile:' => 'icon_smile.gif',\n ':???:' => 'icon_confused.gif',\n ':cool:' => 'icon_cool.gif',\n ':evil:' => 'icon_evil.gif',\n ':grin:' => 'icon_biggrin.gif',\n ':idea:' => 'icon_idea.gif',\n ':oops:' => 'icon_redface.gif',\n ':razz:' => 'icon_razz.gif',\n ':roll:' => 'icon_rolleyes.gif',\n ':wink:' => 'icon_wink.gif',\n ':cry:' => 'icon_cry.gif',\n ':eek:' => 'icon_surprised.gif',\n ':lol:' => 'icon_lol.gif',\n ':mad:' => 'icon_mad.gif',\n ':sad:' => 'icon_sad.gif',\n '8-)' => 'icon_cool.gif',\n '8-O' => 'icon_eek.gif',\n ':-(' => 'icon_sad.gif',\n ':-)' => 'icon_smile.gif',\n ':-?' => 'icon_confused.gif',\n ':-D' => 'icon_biggrin.gif',\n ':-P' => 'icon_razz.gif',\n ':-o' => 'icon_surprised.gif',\n ':-x' => 'icon_mad.gif',\n ':-|' => 'icon_neutral.gif',\n ';-)' => 'icon_wink.gif',\n '8)' => 'icon_cool.gif',\n '8O' => 'icon_eek.gif',\n ':(' => 'icon_sad.gif',\n ':)' => 'icon_smile.gif',\n ':?' => 'icon_confused.gif',\n ':D' => 'icon_biggrin.gif',\n ':P' => 'icon_razz.gif',\n ':o' => 'icon_surprised.gif',\n ':x' => 'icon_mad.gif',\n ':|' => 'icon_neutral.gif',\n ';)' => 'icon_wink.gif',\n ':!:' => 'icon_exclaim.gif',\n ':?:' => 'icon_question.gif',\n );\n\n if (count($smile) > 0) {\n\n foreach ($smile as $replace_this => $value) {\n $path = '/Media/smilies/';\n $path .= $value;\n $with_this = '<span><img src=\"' . $path . '\" alt=\"' . $value . '\" class=\"smiley-class\" /></span>';\n $text = str_ireplace($replace_this, $with_this, $text);\n }\n }\n\n return $text;\n }",
"function convert_smilies($text) {\n\tglobal $wp_smiliessearch;\n\t$output = '';\n\tif ( get_option('use_smilies') && !empty($wp_smiliessearch) ) {\n\t\t// HTML loop taken from texturize function, could possible be consolidated\n\t\t$textarr = preg_split(\"/(<.*>)/U\", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between\n\t\t$stop = count($textarr);// loop stuff\n\t\tfor ($i = 0; $i < $stop; $i++) {\n\t\t\t$content = $textarr[$i];\n\t\t\tif ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag\n\t\t\t\t$content = preg_replace_callback($wp_smiliessearch, 'translate_smiley', $content);\n\t\t\t}\n\t\t\t$output .= $content;\n\t\t}\n\t} else {\n\t\t// return default text.\n\t\t$output = $text;\n\t}\n\treturn $output;\n}",
"function getSmilie($bbcode)\n{\n if (isset($GLOBALS['Smilie_Search'])) {\n $search = &$GLOBALS['Smilie_Search']['code'];\n $replace = &$GLOBALS['Smilie_Search']['img'];\n } else {\n $results = trim(file_get_contents(PHPWS_SOURCE_DIR . '/core/conf/smiles.pak'));\n if (empty($results)) {\n return $bbcode;\n }\n $smiles = explode(\"\\n\", $results);\n foreach ($smiles as $row) {\n $icon = explode('=+:', $row);\n\n if (count($icon) < 3) {\n continue;\n }\n $search[] = '@(?!<.*?)' . preg_quote($icon[2]) . '(?![^<>]*?>)@si';\n $replace[] = sprintf('<img src=\"images/core/smilies/%s\" title=\"%s\" alt=\"%s\" />',\n $icon[0], $icon[1], $icon[1]);\n\n }\n\n $GLOBALS['Smilie_Search']['code'] = $search;\n $GLOBALS['Smilie_Search']['img'] = $replace;\n }\n\n $bbcode = preg_replace($search, $replace, $bbcode);\n return $bbcode;\n}",
"function bbcode_to_smilies($bbcode){\n\n \t\t\t\t$searchFor = array(\n\t\t\t\t\t\t\t\t\t\t'/<img src=\"images/smilies/smile.gif\" alt=\"\" \\/\\>/is',\n\t\t\t\t\t\t\t\t\t\t'/<i\\>(.*?)<\\/i\\>/is',\n\t\t\t\t\t\t\t\t\t\t'/<a href=\"(.*?)\"\\\\>(.*?)<\\/a\\>/is',\n\t\t\t\t\t\t\t\t\t\t'/<img src=\"(.*?)\" \\/\\>/is',\n\t\t\t\t\t\t\t\t\t\t'/<div align=\"center\"\\>(.*?)<\\/div\\>/is',\n\t\t\t\t\t\t\t\t\t\t'/<u\\>(.*?)<\\/u\\>/is',\n\t\t\t\t\t\t\t\t\t\t'/<div align=\"left\"\\>(.*?)<\\/div\\>/is',\n\t\t\t\t\t\t\t\t\t\t'/<div align=\"right\"\\>(.*?)<\\/div\\>/is'\n\t\t\t\t\t\t\t\t\t\t);\n \t\t\t\t$replaceWith = array(\n\t\t\t\t\t\t\t\t\t\t':)',\n\t\t\t\t\t\t\t\t\t\t'[i]$1[/i]',\n\t\t\t\t\t\t\t\t\t\t'[url=$1]$1[/url]',\n\t\t\t\t\t\t\t\t\t\t'[img]$1[/img]',\n\t\t\t\t\t\t\t\t\t\t'[center]$1[/center]',\n\t\t\t\t\t\t\t\t\t\t'[u]$1[/u]',\n\t\t\t\t\t\t\t\t\t\t'[left]$1[/left]',\n\t\t\t\t\t\t\t\t\t\t'[right]$1[/right]'\n\t\t\t\t\t\t\t\t\t\t);\n \t\t\t\t$html = preg_replace($searchFor, $replaceWith, $bbcode);\n\t\t\t\t\treturn $html;\n\t\t\t\t\t}",
"function sf_convert_custom_smileys($postcontent)\n{\n\tglobal $sfglobals;\n\n\tif($sfglobals['smileyoptions']['sfsmallow'] && $sfglobals['smileyoptions']['sfsmtype']==1)\n\t{\n\t\tif($sfglobals['smileys'])\n\t\t{\n\t\t\tforeach ($sfglobals['smileys'] as $sname => $sinfo)\n\t\t\t{\n\t\t\t\t$postcontent = str_replace($sinfo[1], '<img src=\"'.SFSMILEYS.$sinfo[0].'\" title=\"'.$sname.'\" alt=\"'.$sname.'\" />', $postcontent);\n\t\t\t}\n\t\t}\n\t}\n\treturn $postcontent;\n}",
"function convert_smilies( $text ) {\n\tglobal $wp_smiliessearch;\n\t$output = '';\n\tif ( get_option( 'use_smilies' ) && ! empty( $wp_smiliessearch ) ) {\n\t\t// HTML loop taken from texturize function, could possible be consolidated\n\t\t$textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // capture the tags as well as in between\n\t\t$stop = count( $textarr );// loop stuff\n\n\t\t// Ignore proessing of specific tags\n\t\t$tags_to_ignore = 'code|pre|style|script|textarea';\n\t\t$ignore_block_element = '';\n\n\t\tfor ( $i = 0; $i < $stop; $i++ ) {\n\t\t\t$content = $textarr[$i];\n\n\t\t\t// If we're in an ignore block, wait until we find its closing tag\n\t\t\tif ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) {\n\t\t\t\t$ignore_block_element = $matches[1];\n\t\t\t}\n\n\t\t\t// If it's not a tag and not in ignore block\n\t\t\tif ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) {\n\t\t\t\t$content = preg_replace_callback( $wp_smiliessearch, 'translate_smiley', $content );\n\t\t\t}\n\n\t\t\t// did we exit ignore block\n\t\t\tif ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) {\n\t\t\t\t$ignore_block_element = '';\n\t\t\t}\n\n\t\t\t$output .= $content;\n\t\t}\n\t} else {\n\t\t// return default text.\n\t\t$output = $text;\n\t}\n\treturn $output;\n}",
"public function generate_smilies() { \n\t\tglobal $phpbbForum;\n\t\tif ($this->get_setting('phpbbSmilies')) {\n\t\t\techo $phpbbForum->get_smilies();\n\t\t}\n\t}",
"function simple_add_smilies_to_comment_form($post_ID) {\r\n\techo('<div id=\"wp-smileyblock\">');\r\n\tglobal $wpsmiliestrans; /* use global array $wpsmiliestrans which contains the defined smilies and their codes */\r\n\t$newsmilies = array_unique($wpsmiliestrans); /* get rid of any dupes */\r\n\t/* iterate over the list of unique smilies to show all as images, with each anchor getting an id from the numeric index */\r\n\tforeach ($newsmilies as $smileyname => $filename) {\r\n\t\t$srcurl = apply_filters('smilies_src', includes_url(\"images/smilies/$filename\"), $filename, site_url());\r\n\t\techo('<a id=\"s-'.array_search($smileyname,array_keys($newsmilies)).'\"><img src=\"'.$srcurl.'\" class=\"wp-smileylink\" title=\"'.htmlspecialchars($smileyname).'\" /></a> ');\r\n\t\t}\r\n\techo('</div>');\r\n\t}",
"function rocket_lazyload_smilies() {\n\tif ( ! rocket_lazyload_get_option( 'images' ) || ! apply_filters( 'do_rocket_lazyload', true ) ) {\n\t\treturn;\n\t}\n\n\tremove_filter( 'the_content', 'convert_smilies' );\n\tremove_filter( 'the_excerpt', 'convert_smilies' );\n\tremove_filter( 'comment_text', 'convert_smilies', 20 );\n\n\tadd_filter( 'the_content', 'rocket_convert_smilies' );\n\tadd_filter( 'the_excerpt', 'rocket_convert_smilies' );\n\tadd_filter( 'comment_text', 'rocket_convert_smilies', 20 );\n}",
"function SmileyConvert($content, $directory) {\r\n\t$content = eregi_replace(quotemeta(\":)\"), '<img src=\"/smileys/smile.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\":(\"), '<img src=\"/smileys/sad.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\":D\"), '<img src=\"/smileys/biggrin.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\":'(\"), '<img src=\"/smileys/cry.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\":o\"), '<img src=\"/smileys/bigeek.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\";)\"), '<img src=\"/smileys/wink.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\"(y)\"), '<img src=\"/smileys/yes.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\"(n)\"), '<img src=\"/smileys/no.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\":p\"), '<img src=\"/smileys/bigrazz.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\":@\"), '<img src=\"/smileys/mad.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\":s\"), '<img src=\"/smileys/none.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\":x\"), '<img src=\"/smileys/dead.gif\" valign=\"middle\">', $content);\r\n\t// $content = eregi_replace(quotemeta(\":b\"), '<img src=\"/smileys/cool.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\":h\"), '<img src=\"/smileys/laugh.gif\" valign=\"middle\">', $content);\r\n\t$content = eregi_replace(quotemeta(\":r\"), '<img src=\"/smileys/rolleyes.gif\" valign=\"middle\">', $content);\r\n\treturn $content;\r\n}",
"function add_smilies($text) {\n\t$text = str_replace(':)', '<img src=\"/img/smilies/happy.png\" />', $text);\n\t$text = str_replace(':(', '<img src=\"/img/smilies/sad.png\" />', $text);\n\t$text = str_replace(':P', '<img src=\"/img/smilies/tongue.png\" />', $text);\n\t$text = str_replace(':D', '<img src=\"/img/smilies/laugh.png\" />', $text);\n\t$text = str_replace(':/', '<img src=\"/img/smilies/confused.png\" />', $text);\n\treturn $text;\n}",
"function parseSmiley($string) {\n\t// Here you can add more smiley definitions if you want\n\t$smilies=array(\":)\",\":D\",\":P\",\":(\",\";)\",\":lol:\",\":roll:\",\":evil:\",\":twisted:\",\":o\",\"8)\",\":shock:\",\":?\",\":x\",\":oops:\",\":cry:\");\n\t$replace=array(\"<img src=\\\"images/smilies/icon_smile.gif\\\" />\",\"<img src=\\\"images/smilies/icon_biggrin.gif\\\" />\",\"<img src=\\\"images/smilies/icon_razz.gif\\\" />\",\"<img src=\\\"images/smilies/icon_sad.gif\\\" />\",\"<img src=\\\"images/smilies/icon_wink.gif\\\" />\",\"<img src=\\\"images/smilies/icon_lol.gif\\\" />\",\"<img src=\\\"images/smilies/icon_rolleyes.gif\\\" />\",\"<img src=\\\"images/smilies/icon_evil.gif\\\" />\",\"<img src=\\\"images/smilies/icon_twisted.gif\\\" />\",\"<img src=\\\"images/smilies/icon_surprised.gif\\\" />\",\"<img src=\\\"images/smilies/icon_cool.gif\\\" />\",\"<img src=\\\"images/smilies/icon_eek.gif\\\" />\",\"<img src=\\\"images/smilies/icon_confused.gif\",\"<img src=\\\"images/smilies/icon_mad.gif\\\" />\",\"<img src=\\\"images/smilies/icon_redface.gif\\\" />\",\"<img src=\\\"images/smilies/icon_cry.gif\\\" />\");\n\t//$newstring = str_replace($smilies, \"<img src=\\\"images/smilies/$replace\\\" />\", $string);\n\t$newstring = str_replace($smilies, $replace, $string);\n\treturn $newstring;\n}",
"private function parseSmiles() {\n preg_match_all(\"#\\[(.*?)\\]#is\", $this->text, $matches);\n if (!empty($matches)) {\n foreach ($matches[1] as $i => $smile) {\n if (file_exists(SMILES.$smile.'.gif')) {\n $this->text = str_replace($matches[0][$i], '<img src=\"'.SMILES.$smile.'.gif\" alt=\"'.$smile.'\" />', $this->text);\n }\n }\n }\n $smiles = [\n ' :)' => ' <img src=\"'.SMILES.'smile.gif\" alt=\"smile\" /> ',\n ' ;)' => ' <img src=\"'.SMILES.'wink.gif\" alt=\"wink\" /> ',\n ' :(' => ' <img src=\"'.SMILES.'sad.gif\" alt=\"sad\" /> ',\n ' :D' => ' <img src=\"'.SMILES.'rofl.gif\" alt=\"rofl\" /> ',\n ' :-D' => ' <img src=\"'.SMILES.'yahoo.gif\" alt=\"yahoo\" /> ',\n ' :S' => ' <img src=\"'.SMILES.'suicide.gif\" alt=\"confused\" /> ',\n ' =)' => ' <img src=\"'.SMILES.'yow.gif\" alt=\"yow\" /> '\n ];\n foreach ($smiles as $search => $replace) {\n $this->text = str_replace($search, $replace, $this->text);\n }\n }",
"function smiley($smiley) {\n if(array_key_exists($smiley, $this->smileys)) {\n $this->doc .= '<img src=\"'.DOKU_BASE.'lib/images/smileys/'.$this->smileys[$smiley].\n '\" class=\"icon\" alt=\"'.\n $this->_xmlEntities($smiley).'\" />';\n } else {\n $this->doc .= $this->_xmlEntities($smiley);\n }\n }",
"function cache_smilies()\n\n {\n\n global $cache;\n\n $this->smilies_cache = array();\n\n\n\n $smilies = $cache->read(\"smilies\");\n\n if(is_array($smilies))\n\n {\n\n foreach($smilies as $sid => $smilie)\n\n {\n\n $this->smilies_cache[$smilie['find']] = \"<img src=\\\"{$this->base_url}{$smilie['image']}\\\" style=\\\"vertical-align: middle;\\\" border=\\\"0\\\" alt=\\\"{$smilie['name']}\\\" title=\\\"{$smilie['name']}\\\" />\";\n\n }\n\n }\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the settings read from the info plist. | public function getSettingsFromInfoPlist() {
static $applicationSettings = NULL;
if (!$applicationSettings) {
$keys = array();
$values = array();
$plistPath = self::getBasePath() . '../../Info.plist';
$xmlData = simplexml_load_file($plistPath);
foreach ($xmlData->dict->key as $key) {
$keys[] = '' . $key;
}
foreach ($xmlData->dict->string as $value) {
$values[] = '' . $value;
}
self::pd($keys);
$applicationSettings = array_combine($keys, $values);
self::pd($applicationSettings);
}
return $applicationSettings;
} | [
"public function getSettings();",
"protected function readSettingsFile(){\r\n\t\t$fileContents = file_get_contents(APPLICATION_SETTINGS_FILE);\r\n\t\treturn json_decode($fileContents, true);\r\n\t}",
"public function get_settings() {\n\t\treturn ITSEC_Modules::get_settings( $this->id );\n\t}",
"public function getSettings() {\n $file = SETTINGS_PATH.'/'.$this->domain.'.json';\n $siteSettings = file_get_contents($file);\n return json_decode($siteSettings);\n }",
"private static function readSettings()\n\t\t{\n\n\t\t\tif (FileSystem::exists(self::fileLocation() ) == false )\n\t\t\t\tself::makeUserSettings();\n\n\t\t\treturn( FileSystem::readJson( self::fileLocation() ) );\n\t\t}",
"public function getSettings()\n {\n return $this->get('settings');\n }",
"public function getSettings()\n {\n return Initiatives::getInstance()->getSettings();\n }",
"abstract public function getSettings();",
"private function get_settings()\r\n {\r\n if($this->user->has_access('Settings', 'Manage', FALSE))\r\n {\r\n // If they can manage the settings, show all\r\n return $this->setting_model->get_all();\r\n }\r\n else\r\n {\r\n // If they can't manage them, only show GUI settings\r\n return $this->setting_model->get_all_gui();\r\n }\r\n }",
"public function get_settings(){\n return $this->_rpc->get_settings($this->_index_uid);\n }",
"static function admin_site_info_get_settings () {\n\t\t$Config = Config::instance();\n\t\treturn [\n\t\t\t'site_name' => get_core_ml_text('name'),\n\t\t\t'url' => implode(\"\\n\", $Config->core['url']),\n\t\t\t'cookie_domain' => implode(\"\\n\", $Config->core['cookie_domain']),\n\t\t\t'cookie_prefix' => $Config->core['cookie_prefix'],\n\t\t\t'timezone' => $Config->core['timezone'],\n\t\t\t'admin_email' => $Config->core['admin_email'],\n\t\t\t'applied' => $Config->cancel_available()\n\t\t];\n\t}",
"function settings_list(){\n\n return $this->Settings;\n }",
"public function getSettings()\t{\n\t\t\treturn $this->m_settings;\n\t\t}",
"public static function getSettings()\n\t{\n\n\t\treturn self::$settings;\n\t}",
"function get_settings() {\r\n $user_settings = user_settings::retrieve_user_settings($this->id);\r\n return $user_settings;\r\n }",
"public function getSettings() {\n\t\treturn $this->_executeGetRequest('user/settings');\n\t}",
"function get_settings()\n\t{\n\t\tstatic $settings = NULL;\n\n\t\tif (is_array($settings) || ! $this->module_is_installed()) {\n\t\t\treturn $settings;\n\t\t}\n\n\t\t$site_id = '0,'.$this->site_id;\n\n\t\t$sql = \"SELECT var_value, var FROM exp_structure_settings WHERE site_id IN ({$site_id})\";\n\t\t$result = $this->EE->db->query($sql);\n\n\t\t$settings = array(\n\t\t\t'show_picker' => 'y',\n\t\t\t'show_view_page' => 'y',\n\t\t\t'show_status' => 'y',\n\t\t\t'show_page_type' => 'y',\n\t\t\t'show_global_add_page' => 'y',\n\t\t\t'redirect_on_login' => 'n',\n\t\t\t'redirect_on_publish' => 'n',\n\t\t\t'add_trailing_slash' => 'y'\n\t\t);\n\n\t\tif ($result->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($result->result_array() as $row)\n\t\t\t{\n\t\t\t\tif ($row['var_value'] != '')\n\t\t\t\t{\n\t\t\t\t\t$settings[$row['var']] = $row['var_value'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $settings;\n\t}",
"function _get_settings()\r\n\t{\r\n\t\tglobal $DB, $REGX;\r\n\r\n\t\t// check the db for extension settings\r\n\t\t$query = $DB->query('SELECT settings\r\n\t\t\t\t\t\t\t FROM '. $this->db_prefix . '_extensions\r\n\t\t\t\t\t\t\t WHERE enabled = \"y\"\r\n\t\t\t\t\t\t\t AND class = \"' . Seesaw_extension_class . '\"\r\n\t\t\t\t\t\t\t LIMIT 1');\r\n\r\n\t\treturn ($query->num_rows > 0 && $query->row['settings'] != '')\r\n\t\t\t? $REGX->array_stripslashes(unserialize($query->row['settings']))\r\n\t\t\t: array();\r\n\t}",
"function getSettings() {\n return $this->getProject()->getSettings();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The id of the schema with schema type content. | public function getContentSchemaId() : string
{
return $this->contentSchemaId;
} | [
"public function getSchemaId();",
"public function getSchemaId()\n {\n return $this->get(self::SCHEMA_ID);\n }",
"public function getSchemaId()\n {\n return $this->schema_id;\n }",
"public function getSchemaId() : string\n {\n return $this->schemaId;\n }",
"public function getIdSchemaKey()\n {\n return $this->id_schema_key;\n }",
"function papi_get_content_type_id() {\n\t$content_type_id = papi_get_qs( 'content_type' );\n\n\t/**\n\t * Change content type id.\n\t *\n\t * @param string $content_type_id\n\t */\n\treturn apply_filters( 'papi/content_type_id', $content_type_id );\n}",
"public function getContentTypeID() {\n\t\treturn ( int ) $this->getOption ( 'type_id' );\n\t}",
"public function generate_main_schema_id()\n {\n }",
"function getDatosId_schema()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_schema'));\n $oDatosCampo->setEtiqueta(_(\"id_schema\"));\n return $oDatosCampo;\n }",
"private function _get_primary_key_from_schema()\n\t{\t\t\n\t\tforeach($this->schema as $name => $definition)\n\t\t{\n\t\t\tif ($definition[2] & PK)\n\t\t\t{\n\t\t\t\treturn $name;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Primary key not defined, try the default\n\t\treturn 'id';\n\t}",
"public function getContentTypeId() : int\n {\n $rtn = $this->data['content_type_id'];\n\n return $rtn;\n }",
"public function typeId()\n {\n return config('entities.ids.' . $this->type);\n }",
"public function getSchemaId( IDatabase $db, $name ) {\n\t\t$name = trim( $name );\n\t\t$fname = __METHOD__;\n\t\treturn self::$cache->getWithSetCallback(\n\t\t\t$name,\n\t\t\tstatic function () use ( $name, $db, $fname ) {\n\t\t\t\t// Note: will not cache if no results\n\t\t\t\t$id = $db->selectField(\n\t\t\t\t\t'sofa_schema',\n\t\t\t\t\t'sms_id',\n\t\t\t\t\t[ 'sms_name' => $name ],\n\t\t\t\t\t$fname\n\t\t\t\t);\n\t\t\t\treturn $id ? (int)$id : false;\n\t\t\t}\n\t\t);\n\t}",
"function setId_schema($iid_schema = '')\n {\n $this->iid_schema = $iid_schema;\n }",
"public function schemaForId(int $schemaId);",
"public function getId() : TypeId\n\t{\n\t\treturn $this->id;\n\t}",
"public function get_id() {\n return str_replace('forumngtype_', '', get_class($this));\n }",
"public function getSchemaType();",
"function get_doc_type_id($doc_name)\n {\n return \\App\\DocType::where('name', $doc_name)->first()->id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation teamBuilderConfigsIdProductSizeMaterialsFkGet Find a related item by id for productSizeMaterials. | public function teamBuilderConfigsIdProductSizeMaterialsFkGet($id, $fk)
{
list($response) = $this->teamBuilderConfigsIdProductSizeMaterialsFkGetWithHttpInfo($id, $fk);
return $response;
} | [
"public function teamBuilderConfigsIdProductSizeMaterialsGet($id, $filter = null)\n {\n list($response) = $this->teamBuilderConfigsIdProductSizeMaterialsGetWithHttpInfo($id, $filter);\n return $response;\n }",
"public function teamMembersIdTeamProductSizeMaterialsFkGet($id, $fk)\n {\n list($response) = $this->teamMembersIdTeamProductSizeMaterialsFkGetWithHttpInfo($id, $fk);\n return $response;\n }",
"public function teamBuilderConfigsIdProductSizeMaterialsRelFkGet($id, $fk)\n {\n list($response) = $this->teamBuilderConfigsIdProductSizeMaterialsRelFkGetWithHttpInfo($id, $fk);\n return $response;\n }",
"public function teamBuilderConfigsIdProductSizeMaterialsFkGetWithHttpInfo($id, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductSizeMaterialsFkGet');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamBuilderConfigsIdProductSizeMaterialsFkGet');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productSizeMaterials/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductSizeMaterial',\n '/TeamBuilderConfigs/{id}/productSizeMaterials/{fk}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductSizeMaterial', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductSizeMaterial', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function productSizesIdMaterialsFkGet($id, $fk)\n {\n list($response) = $this->productSizesIdMaterialsFkGetWithHttpInfo($id, $fk);\n return $response;\n }",
"public function teamBuilderConfigsIdProductSizesNkMaterialsGet($id, $nk, $filter = null)\n {\n list($response) = $this->teamBuilderConfigsIdProductSizesNkMaterialsGetWithHttpInfo($id, $nk, $filter);\n return $response;\n }",
"public function teamBuilderConfigsIdProductSizeMaterialsPost($id, $data = null)\n {\n list($response) = $this->teamBuilderConfigsIdProductSizeMaterialsPostWithHttpInfo($id, $data);\n return $response;\n }",
"public function teamBuilderConfigsIdProductSizesNkSizeMaterialsFkGet($id, $nk, $fk)\n {\n list($response) = $this->teamBuilderConfigsIdProductSizesNkSizeMaterialsFkGetWithHttpInfo($id, $nk, $fk);\n return $response;\n }",
"public function teamMembersIdTeamBuilderConfigsDefaultProductSizeMaterialGetWithHttpInfo($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamMembersIdTeamBuilderConfigsDefaultProductSizeMaterialGet');\n }\n // parse inputs\n $resourcePath = \"/TeamMembers/{id}/team/builderConfigs/default/productSizeMaterial\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductSizeMaterial[]',\n '/TeamMembers/{id}/team/builderConfigs/default/productSizeMaterial'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductSizeMaterial[]', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductSizeMaterial[]', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function productSizesIdSizeMaterialsFkGetWithHttpInfo($id, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling productSizesIdSizeMaterialsFkGet');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling productSizesIdSizeMaterialsFkGet');\n }\n // parse inputs\n $resourcePath = \"/ProductSizes/{id}/sizeMaterials/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductSizeMaterial',\n '/ProductSizes/{id}/sizeMaterials/{fk}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductSizeMaterial', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductSizeMaterial', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function customersIdTeamsNkProductSizeMaterialsGet($id, $nk, $filter = null)\n {\n list($response) = $this->customersIdTeamsNkProductSizeMaterialsGetWithHttpInfo($id, $nk, $filter);\n return $response;\n }",
"public function teamBuilderConfigsIdProductSizeMaterialsRelFkGetWithHttpInfo($id, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductSizeMaterialsRelFkGet');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamBuilderConfigsIdProductSizeMaterialsRelFkGet');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productSizeMaterialsRel/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\TeamBuilderConfigProductSizeMaterial',\n '/TeamBuilderConfigs/{id}/productSizeMaterialsRel/{fk}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\TeamBuilderConfigProductSizeMaterial', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\TeamBuilderConfigProductSizeMaterial', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function teamBuilderConfigsIdProductSizesNkSizeMaterialsFkGetWithHttpInfo($id, $nk, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductSizesNkSizeMaterialsFkGet');\n }\n // verify the required parameter 'nk' is set\n if ($nk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $nk when calling teamBuilderConfigsIdProductSizesNkSizeMaterialsFkGet');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamBuilderConfigsIdProductSizesNkSizeMaterialsFkGet');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productSizes/{nk}/sizeMaterials/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($nk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"nk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($nk),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductSizeMaterial',\n '/TeamBuilderConfigs/{id}/productSizes/{nk}/sizeMaterials/{fk}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductSizeMaterial', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductSizeMaterial', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function teamBuilderConfigsIdProductSizeMaterialsRelNkProductSizeMaterialGet($id, $nk, $refresh = null)\n {\n list($response) = $this->teamBuilderConfigsIdProductSizeMaterialsRelNkProductSizeMaterialGetWithHttpInfo($id, $nk, $refresh);\n return $response;\n }",
"public function teamMembersIdTeamBuilderConfigsDefaultProductSizeMaterialGet($id)\n {\n list($response) = $this->teamMembersIdTeamBuilderConfigsDefaultProductSizeMaterialGetWithHttpInfo($id);\n return $response;\n }",
"public function teamMembersIdTeamProductSizeMaterialsGetWithHttpInfo($id, $filter = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamMembersIdTeamProductSizeMaterialsGet');\n }\n // parse inputs\n $resourcePath = \"/TeamMembers/{id}/team/productSizeMaterials\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // query params\n if ($filter !== null) {\n $queryParams['filter'] = $this->apiClient->getSerializer()->toQueryValue($filter);\n }\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductSizeMaterial[]',\n '/TeamMembers/{id}/team/productSizeMaterials'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductSizeMaterial[]', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductSizeMaterial[]', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function teamBuilderConfigsIdProductSizesNkMaterialsFkGetWithHttpInfo($id, $nk, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductSizesNkMaterialsFkGet');\n }\n // verify the required parameter 'nk' is set\n if ($nk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $nk when calling teamBuilderConfigsIdProductSizesNkMaterialsFkGet');\n }\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling teamBuilderConfigsIdProductSizesNkMaterialsFkGet');\n }\n // parse inputs\n $resourcePath = \"/TeamBuilderConfigs/{id}/productSizes/{nk}/materials/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($nk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"nk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($nk),\n $resourcePath\n );\n }\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\ProductMaterial',\n '/TeamBuilderConfigs/{id}/productSizes/{nk}/materials/{fk}'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\ProductMaterial', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ProductMaterial', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function teamMembersIdTeamProductSizeMaterialsDelete($id)\n {\n list($response) = $this->teamMembersIdTeamProductSizeMaterialsDeleteWithHttpInfo($id);\n return $response;\n }",
"public function productSizesIdSizeMaterialsFkPut($id, $fk, $data = null)\n {\n list($response) = $this->productSizesIdSizeMaterialsFkPutWithHttpInfo($id, $fk, $data);\n return $response;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if the given user can destroy the given restaurant. | public function destroy(User $user, Restaurant $restaurant){
return $user->id === $restaurant->user_id;
} | [
"public function delete(User $user)\n {\n return $user->hasPermissionTo('vacation_delete');\n }",
"public function destroy(User $user, Review $review)\n {\n if ($user->canDo('review.review.delete') && $user->is('admin')) {\n return true;\n }\n\n if ($user->canDo('blocks.block.delete') \n && $user->is('manager')\n && $block->user->parent_id == $user->id) {\n return true;\n }\n\n return $user->id === $review->user_id;\n }",
"function canDelete(User $user) {\n return $user->canManageTrash();\n }",
"public function delete(User $user, Review $review)\n {\n if($user->role==\"admin\" || $user->id == $review->user_id){\n return true;\n }\n return false;\n }",
"public function deleteImage(User $user, Restaurant $restaurant)\n {\n return $user->userable_id === $restaurant->id;\n }",
"public function delete(User $user, Region $region)\n {\n return $user->isAdmin() || $user->isSupervisor();\n }",
"public function delete(User $user)\n {\n if ($user->can('delete_menu') || $user->can('manage_menus')) {\n return true;\n }\n\n return false;\n }",
"public function delete(User $user)\n {\n if ($user->can('delete_user') || $user->can('manage_users')) {\n return true;\n }\n\n return false;\n }",
"public function delete(User $user) {\n return $user->can('delete-category');\n }",
"public function delete(User $user): bool\n {\n return $user->can('Delete App User');\n }",
"public function delete(User $user, ConsumeCategory $consumeCategory)\n {\n //\n return $user->restaurant_id == $consumeCategory->restaurant_id;\n }",
"public function canDelete(IdentityInterface $user, Script $script)\n {\n return $user->role_id=='1';\n }",
"function canUntrash(User $user) {\n if ($this->object->getState() != STATE_TRASHED) {\n return false;\n } // if\n\n return $user->canManageTrash();\n }",
"function canTrash(User $user) {\n if ($this->object->getState() == STATE_TRASHED) {\n return false;\n } // if\n\n\t $user_id = $user->getId();\n\n\t if(!array_key_exists($user_id, $this->can_delete)) {\n\t\t if($this->object->isOwner() || $user->getCompanyId() == $this->object->getId()) {\n\t\t\t $this->can_delete[$user_id] = false;\n\t\t } else {\n\t\t\t $has_last_admin = false;\n\n\t\t\t $users = $this->object->users()->get($user);\n\t\t\t if(is_foreachable($users)) {\n\t\t\t\t foreach($users as $v) {\n\t\t\t\t\t if($v->isLastAdministrator()) {\n\t\t\t\t\t\t $this->can_delete[$user_id] = false;\n\n\t\t\t\t\t\t $has_last_admin = true;\n\t\t\t\t\t\t break;\n\t\t\t\t\t } // if\n\t\t\t\t } // foreach\n\t\t\t } // if\n\n\t\t\t if(!$has_last_admin) {\n\t\t\t\t $this->can_delete[$user_id] = $user->isPeopleManager();\n\t\t\t } // if\n\t\t } // if\n\t } // if\n\n\t return $this->can_delete[$user_id];\n }",
"public function canDelete(IdentityInterface $user, Book $book)\n {\n }",
"public function delete(User $user, TimeSheet $timeSheet)\n { \n return $user->hasRole('admin');\n }",
"public function delete(User $user, Airport $airport)\n {\n return $user->can('airport:delete');\n }",
"public function delete(User $user)\n {\n return $user->hasPermissionTo('delete post category') || $user->hasPermissionWithRole('delete post category');\n }",
"function user_deletion_allowed($user)\r\n {\r\n //A check to not delete a user when he's an active teacher\r\n $courses = WeblcmsDataManager :: get_instance()->count_courses(new EqualityCondition(Course :: PROPERTY_TITULAR, $user->get_id()));\r\n if ($courses > 0)\r\n {\r\n return false;\r\n }\r\n return true;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Remove live search ajax CSS | function my_remove_searchwp_live_search_theme_css() {
wp_dequeue_style( 'searchwp-live-search' );
} | [
"function wp_ajax_ajax_tag_search() {}",
"function cleanyeti_above_searchloop() {\n do_action('cleanyeti_above_searchloop');\n}",
"function autoparts_trx_addons_action_search($style, $class, $ajax) {\n\t\tdo_action( 'trx_addons_action_search', $style, $class, $ajax );\n\t}",
"function unhook_thematic_functions() {\n\tremove_filter( 'get_search_form', 'sparkling_wpsearch' );\n}",
"function chocorocco_trx_addons_action_search($style, $class, $ajax) {\n\t\tdo_action( 'trx_addons_action_search', $style, $class, $ajax );\n\t}",
"function wp_ajax_ajax_tag_search()\n{\n}",
"function wp_ajax_ajax_tag_search()\n {\n }",
"function minti_remove_bbpsearch_widget() {\n\t\tunregister_widget('BBP_Search_Widget');\n\t}",
"function theme_search_result() {\n // This function is never used; see the corresponding template file instead.\n}",
"function zaxu_disable_search_function($obj) {\n if ( $obj->is_search && $obj->is_main_query() ) {\n unset( $_GET['s'] );\n unset( $_POST['s'] );\n unset( $_REQUEST['s'] );\n unset( $obj->query['s'] );\n $obj->set('s', '');\n $obj->is_search = false;\n $obj->set_404();\n status_header(404);\n nocache_headers();\n }\n }",
"public function removeSearch()\n {\n $this->search = null;\n }",
"function theme_search_results() {\n // This function is never used; see the corresponding template file instead.\n}",
"public function removeCSS();",
"public static function disableSearchQuery()\n {\n add_action('parse_query', function ($query, $error = true) {\n if (is_search()) {\n $query->is_search = false;\n $query->query_vars['s'] = false;\n $query->query['s'] = false;\n\n if ($error == true) {\n $query->is_404 = true;\n }\n }\n });\n }",
"function AjaxSearch() {\n }",
"function hide_admin_bar_search () { ?>\n\t\t<style type=\"text/css\">\n\t\t#wpadminbar #adminbarsearch {\n\t\t\tdisplay: none;\n\t\t}\n\t\t</style>\n\t\t<?php\n\t}",
"function caringmedic_remove_pagenavi_css(){\n wp_dequeue_style( 'wp-pagenavi' );\n}",
"function csl_ajax_search() {\n $this->find_locations( 'search' );\n }",
"function remove_query_strings() {\n\t\tadd_filter( 'script_loader_src', 'remove_query_strings_splitter', 15);\n\t\tadd_filter( 'style_loader_src', 'remove_query_strings_splitter', 15);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store a new page. | public function store()
{
$this->validate($this->request, $this->rules, $this->messages);
$this->dispatch(
new CreatePage(
$this->request->get('title'),
$this->request->get('text'),
$this->request->get('online')
)
);
Flash::success(trans('flash.page-created'));
return Redirect::route('admin.page');
} | [
"function storePage(\\models\\WikiPage $page);",
"public function savePage(Page $page);",
"abstract public function addPage(Page $page);",
"public function store(CreatePageRequest $request)\n {\n $input = $request->all();\n if ($input['parent_id'] == 0) {\n $input['parent_id'] = null;\n }\n $page = $this->pageRepository->create($input);\n if ($page->parent_id == '') {\n $page->parent_id = $page->id;\n }\n\n $page->user_id = Auth::user()->id;\n $page->content = $request->page_content;\n $page->save();\n\n Flash::success('Page saved successfully.');\n\n if ($input['save'] === 'SAVE_EDIT') {\n return redirect(route('admin.pages.edit', $page->id));\n } elseif ($input['save'] === 'SAVE_NEW') {\n return redirect(route('admin.pages.create'));\n } else {\n return redirect(route('admin.pages.index'));\n }\n }",
"function createOrUpdatePage(PopulatedPage $page);",
"function addPage(){}",
"private function SaveNew()\n {\n $treeBuilder = new TreeBuilder(new PageTreeProvider($this->site));\n $treeBuilder->Insert($this->page, $this->parent, $this->previous);\n }",
"public function write(Page $page);",
"public function saved(Page $Page)\n {\n //code...\n }",
"public function _add_page()\n {\n check_submit_permission('cat_low');\n\n require_code('content2');\n $metadata = actual_metadata_get_fields('wiki_page', null);\n\n $id = wiki_add_page(post_param_string('title'), post_param_string('post'), post_param_string('notes', ''), (get_option('wiki_enable_content_posts') == '1') ? post_param_integer('hide_posts', 0) : 1, $metadata['submitter'], $metadata['add_time'], $metadata['views'], post_param_string('meta_keywords', ''), post_param_string('meta_description', ''), null, false);\n\n set_url_moniker('wiki_page', strval($id));\n\n require_code('permissions2');\n set_category_permissions_from_environment('wiki_page', strval($id), 'cms_wiki');\n\n require_code('fields');\n if (has_tied_catalogue('wiki_page')) {\n save_form_custom_fields('wiki_page', strval($id));\n }\n\n if (addon_installed('awards')) {\n require_code('awards');\n handle_award_setting('wiki_page', strval($id));\n }\n\n if (addon_installed('content_reviews')) {\n require_code('content_reviews2');\n content_review_set('wiki_page', strval($id));\n }\n\n // Show it worked / Refresh\n $url = get_param_string('redirect', null);\n if (is_null($url)) {\n $_url = build_url(array('page' => 'wiki', 'type' => 'browse', 'id' => ($id == db_get_first_id()) ? null : $id), get_module_zone('wiki'));\n $url = $_url->evaluate();\n }\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }",
"public function save()\n {\n $project = $this->getProject();\n\n $values = $this->request->getValues();\n list($valid, $errors) = $this->wiki->validatePageCreation($values);\n\n if ($valid) {\n\n $newDate = date('Y-m-d');\n\n $wiki_id = $this->wiki->createpage($values['project_id'], $values['title'], $values['content'], $newDate);\n if ($wiki_id > 0) {\n\n $this->wiki->createEdition($values, $wiki_id, 1, $newDate);\n // don't really care if edition was successful\n\n $this->flash->success(t('The wikipage has been created successfully.'));\n $this->response->redirect($this->helper->url->to('WikiController', 'create', array('plugin' => 'wiki', 'project_id' => $project['id'])), true);\n return;\n } else {\n $this->flash->failure(t('Unable to create the wikipage.'));\n }\n }\n\n $this->create($values, $errors);\n }",
"function insertPage($page){}",
"private function handleAddPage()\n {\n $post = $this->getRequest()->getPost();\n\n if ($this->form->isValid($post)) {\n $model = new Dlayer_Model_Admin_Page();\n $page_id = $model->savePage($this->site_id, $post['name'], $post['title'], $post['description']);\n\n if ($page_id !== false) {\n $this->session->clearAll(true);\n $this->session->setPageId($page_id);\n $this->redirect('/content');\n }\n }\n }",
"function save_page($params) {\n $params = (object) str_replace('@wp_', '{prefix}', $params);\n\n // Add new page\n if (empty($params->id)) {\n if (empty($params->uri)) {\n return $this->oh_snap('<e>Enter a page URI');\n }\n // normalize URI (remove outside /\n $params->uri = trim($params->uri,'/');\n $sql = \"SELECT id FROM @wp_pod_pages WHERE uri = '$params->uri' LIMIT 1\";\n pod_query($sql, 'Cannot get Pod Pages', 'Page by this URI already exists');\n $page_id = pod_query(\"INSERT INTO @wp_pod_pages (uri) VALUES ('$params->uri')\", 'Cannot add new page');\n return $page_id; // return\n }\n // Edit existing page\n else {\n pod_query(\"UPDATE @wp_pod_pages SET title = '$params->page_title', page_template = '$params->page_template', phpcode = '$params->phpcode', precode = '$params->precode' WHERE id = $params->id LIMIT 1\");\n }\n }",
"private function savePages()\n\t{\n\t\tif ( $this->validates() ){\n\t\t\t$this->data['new_pages'] = $this->factory->createChildPosts($this->data);\n\t\t\t$this->setResponse();\n\t\t\treturn;\n\t\t}\n\t\t$this->sendErrorResponse();\n\t}",
"public function addPage() {\n $this->_documentXMLFINAL .= $this->_documentXML;\n $this->_documentXML = $this->_documentXMLSEQ;\n }",
"public function addPage()\n {\n }",
"function save_page() {\n \t$forceXHR = setXHRDebug($this, 0);\n $this->layout = null;\n $ret = 0;\n\t\tif ($this->data) {\n /*\n\t\t\t * COPIED FROM /pagemaker/save_page !!!\n * POST - save/append/delete PageGallery file\n */ \t\n // allow guest users to save\n $dest = $this->data['dest'];\t// dest\tfile, book\n if (isset($this->data['key']) && $this->data['key']!=='undefined') $secretKeyDest = $this->data['key'];\n\t\t\tif (empty($secretKeyDest)) {\n\t\t\t\t// NOTE: to save different stories for the same dest/filename, make sure key is empty\n\t\t\t\t$uuid = AppController::$userid ? AppController::$userid : String::uuid();\n\t\t\t\t$secretKeyDest = $this->__getSecretKey($uuid, $this->__getSeed($dest));\n\t\t\t}\n \tif ($secretKeyDest) {\t\n\t $content = $this->data['content'];\t\t// page content\n\t /*\n\t * read content from page\n\t */\n\t \t\tif (empty($content)) {\n\t \t\t\t$src = $this->data['src'];\t\t// source file, stored in /svc/pages\n\t \t\t\t$secretKeySrc = $this->__getSecretKey($uuid, $this->__getSeed($src));\n\t\t $File = Configure::read('path.svcroot').Configure::read('path.pageGalleryPrefix').DS.$src.'_'.$secretKeySrc.'.div';\n\t\t $content = @file_get_contents($File);\n\t \t\t}\n\t /*\n\t * append or write content to book\n\t */\n\t $File = Configure::read('path.svcroot').Configure::read('path.pageGalleryPrefix').DS.$dest.'_'.$secretKeyDest.'.div';\n\t // append page to book\n\t $mode = isset($this->data['reset']) ? 'w' : 'a';\n\t $Handle = fopen($File, $mode);\n\t fwrite($Handle, $content);\n\t fclose($Handle);\n\t // don't unlink\n\t $ret = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$ret = false;\n\t\t}\n\t\t$this->autoRender = false;\n\t\theader('Content-type: application/json');\n\t\theader('Pragma: no-cache');\n\t\theader('Cache-control: no-cache');\n\t\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\"); \t\t\n\t\t$success = $ret ? true : false;\n\t\tif ($success) {\n\t\t\theader(\"HTTP/1.1 201 CREATED\");\n\t\t\t$message = \"Your Story was saved.\";\n\t\t\t$response = array(\n\t\t\t\t'key'=>$secretKeyDest, \n\t\t\t\t'link'=>\"/gallery/story/{$dest}_{$secretKeyDest}\",\n\t\t\t);\n\t\t} else {\n\t\t\t$message = \"There was an error saving your Story. Please try again.\";\n\t\t\t$response = array();\n\t\t}\n\t\techo json_encode(compact('success', 'message', 'response'));\n\t\treturn;\n }",
"public function newPage(array $pagedata) {\n\t\tif ($this->db->tableInsert(TBL_PAGES, $pagedata)) {\t//Call the database\n\t\t\t$this->pagedata['id'] = intval($this->db->insertedId());\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insert if second name detected | public function secondinsert($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid){
$msg = "Select _nID_ FROM _name_ WHERE _name_ = ?"; # check if name exists
$stmnt1 = $con->prepare($msg);
$stmnt1->bind_param("s",$sname);
$stmnt1->execute();
$stmnt1->bind_result($nid1);
if($stmnt1->fetch()){ # proceed if name exists
$stmnt1->close();
$msg = "UPDATE _staff_ SET _s_name_id_ = ? WHERE _sID_ = ?";
$stmnt2 = $con->prepare($msg);
$stmnt2 -> bind_param("is", $nid1, $userid);
$stmnt2 -> execute();
$stmnt2->close();
}else{ # insert new name
$stmnt1->close();
$this -> ifnotsecondname($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid);
}
} | [
"public function ifnotsecondname($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid){\n $msg = \"INSERT INTO _name_ (_name_) VALUES (?)\"; # insert new name\n $stmnt = $con->prepare($msg);\n $stmnt -> bind_param(\"s\", $sname);\n if($stmnt->execute()){ # proceed secondary update from beginning\n $stmnt->close();\n $this -> secondinsert($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid);\n }\n }",
"public function with_two_names()\n{\n for($i=0 ;$i<count($this->users);$i++){\n\n $data3 = $this->users[$i];\n $name_data = $data3['name'];\n\n if ($name_data == trim($name_data) && strpos($name_data, ' ') !== false) {\n\n echo 'name : '.$name_data.'</br>';\n }\n}\n}",
"private function _validateFirstAndLastName(){\n\n\n if(!$this->data->getFirstname() || !preg_match('/^[a-zA-Z -]+$/', $this->data->getFirstname())){\n throw new \\Exception(\"Il nome inserito non è valido\");\n }else{ \n $this->data->setFirstname($this->_capitalizeFirst($this->data->getFirstname())); \n }\n \n if($this->data->getLastname() !== Null){\n if(!preg_match('/^[a-zA-Z -]+$/', $this->data->getLastname())){\n throw new \\Exception(\"Il cognome inserito non è valido\");\n }else{\n $this->data->setLastname($this->_capitalizeFirst($this->data->getLastname())); \n }\n }\n \n }",
"function addDisplayName(&$person) {\n\t\tif (!checkCache('people.names')) {\n\t\t\t$people = $this->getPeople();\n\t\t\tforeach($people as $key => $prsn) {\n\t\t\t\tif ($prsn['Person']['display_name']) unset($people[$key]);\n\t\t\t}\n\t\t\twriteCache('people.names',\n\t\t\t\tSet::combine($people,'{n}.Person.id','{n}.Person.last','{n}.Person.first'));\n\t\t}\n\n\t\tif ($person['display_name']) {\n\t\t\t$person['name'] = $person['display_name'];\n\t\t\treturn;\n\t\t}\n\t\t$person['name'] = $person['first'];\n\n\t\t// now find out how many letters of the last name we need for each first name\n\t\t$lastNames = readCache(\"people.names.{$person['first']}\");\n\t\tif (!isset($lastNames['numLetters']) && $lastNames) {\n\t\t\t$others = $lastNames;\n\t\t\tunset($others[$person['id']]); // don't compare with itself\n\t\t\t$numLetters = 0;\n\t\t\tif (count($others) != 0) {\t\n\t\t\t\t$numLetters++; // there's another with this first name, so at least use 1 letter of last\n\t\t\t}\n\t\t\tforeach ($others as $id => $other) {\n\t\t\t\tif ($person['last']) {\n\t\t\t\t\twhile (substr($person['last'], 0, $numLetters) == substr($other, 0, $numLetters)) {\n\t\t\t\t\t\t$numLetters++; // up to this letter the lasts are the same, so use one more\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t$lastNames['numLetters'] = $numLetters;\n\t\t\t}\n\t\t}\n\t\t$lastNames['numLetters'] = isset($lastNames['numLetters']) ? $lastNames['numLetters'] : 0;\n\t\t$shortLast = substr($person['last'], 0, $lastNames['numLetters']);\n\t\t$person['name'] .= ($lastNames['numLetters'] > 0) ? \" {$shortLast}\" : '';\n\t\twriteCache(\"people.names.{$person['first']}\",$lastNames);\n\t}",
"public function test_sanitise_multiple_surname() {\n $this->assertEquals(\"La Canna\", handle_sanitise_name(\" la canna \", true));\n }",
"public function testSpecialFirstNameAndLastName()\n {\n $this->vcard->addName(\n $this->lastName2,\n $this->firstName2\n );\n\n $this->assertEquals('ali-ozsut', $this->vcard->getFilename());\n }",
"function secondlastname_civicrm_tokens(&$tokens) {\n\t// Define the contact.second_last_name token\n $tokens['contact'] = array(\n 'contact.second_last_name' => 'Second Last Name',\n );\n}",
"function parseName($value){\n $name=explode(' ',$value);\n $genName=\"\";\n $len= count($name);\n if($len > 0){\n for($i=0;$i<$len;$i++){\n if(trim($name[$i])!=\"\"){\n if($genName!=\"\"){\n $genName =$genName .\" \".$name[$i];\n }\n else{\n $genName =$name[$i];\n } \n }\n }\n }\n if($genName!=\"\"){\n $genName=\" OR CONCAT(TRIM(s.firstName),' ',TRIM(s.lastName)) LIKE '\".add_slashes($genName).\"%'\";\n }\n \n return $genName;\n}",
"function splitName($name, &$title, &$firstName, &$middleName, &$lastName) {\n // social titles:\n $socialTitles = ['mr', 'mrs', 'miss', 'ms', 'dr', 'prof'];\n\n // words that belong in the surname:\n $nobiliaryParticles = [\n 'a',\n 'bat',\n 'ben',\n 'bin',\n 'da',\n 'das',\n 'de',\n 'del',\n 'della',\n 'dem',\n 'den',\n 'der',\n 'des',\n 'di',\n 'do',\n 'dos',\n 'du',\n 'ibn',\n 'la',\n 'las',\n 'le',\n 'li',\n 'lo',\n 'mac',\n 'mc',\n 'op',\n \"'t\",\n 'te',\n 'ten',\n 'ter',\n 'van',\n 'ver',\n 'von',\n 'y',\n 'z',\n 'zu',\n 'zum',\n 'zur',\n ];\n\n // first parse into words:\n $names = explode(' ', $name);\n $nNames = count($names);\n\n // look for title:\n $title = '';\n foreach ($socialTitles as $st) {\n if (strtolower($names[0]) == $st || strtolower($names[0]) == $st . '.') {\n $title = array_shift($names);\n $nNames--;\n // remove the full-stop if present:\n if (endsWith($title, '.')) {\n $title = substr($title, 0, strlen($title) - 1);\n }\n break;\n }\n }\n\n if ($nNames == 1) {\n // only one word, assume this is the first name:\n // @todo if there's a title, we should assume this is the last name\n $firstName = $names[0];\n $lastName = '';\n }\n else {\n // go through names from right to left building the surname:\n $firstNames = [];\n $lastName = $names[$nNames - 1];\n for ($i = $nNames - 2; $i >= 0; $i--) {\n if (in_array(strtolower($names[$i]), $nobiliaryParticles)) {\n $lastName = $names[$i] . ' ' . $lastName;\n }\n else {\n if ($names[$i] != '') {\n // found a name that is not a nobiliary particle, so just append the rest of\n // the middle names (or initials) to the first name:\n for ($j = 0; $j <= $i; $j++) {\n $firstNames[] = $names[$j];\n }\n break;\n }\n }\n }\n $firstName = implode(' ', $firstNames);\n }\n}",
"private function _saveName()\n\t {\n\t\tif (isset($this->_advert->phone) === true && isset($this->_advert->name) === true)\n\t\t {\n\t\t\t$hash = sha1(mb_strtoupper($this->_advert->name) . $this->_advert->phone);\n\n\t\t\tif ($this->_exists(\"names\", $hash) === false && mb_strtoupper($this->_advert->name) !== \"НЕ УКАЗАНО\")\n\t\t\t {\n\t\t\t\t$this->_db->exec(\"INSERT INTO `names` SET \" .\n\t\t\t\t \"`hash` = '\" . $hash . \"', \" .\n\t\t\t\t \"`name` = '\" . mb_strtoupper($this->_advert->name) . \"', \" .\n\t\t\t\t \"`phone` = '\" . $this->_advert->phone . \"'\"\n\t\t\t\t);\n\t\t\t } //end if\n\n\t\t } //end if\n\n\t }",
"function checkName() {\n\t\tglobal $NET_ID, $FULL_NAME;\n\t\t$db = new Database();\n\t\t$studentsDAO = &$db->getStudentsDAO();\n\t\t$success = true;\n\n\t\t$result = $studentsDAO->getStudentName($NET_ID);\n\t\tif(Database::getNextRow($result)['full_name'] == '')\n\t\t\t$success = $studentsDAO->addStudentName($NET_ID, $FULL_NAME);\n\n\t\t$db->close($success);\n\t}",
"public function getSecondName(): string\n {\n return $this->secondName;\n }",
"function save($new_first_name, $new_last_name)\n {\n $query = $GLOBALS['DB']->query(\"SELECT * FROM authors WHERE first_name = '{$new_first_name}' AND last_name = '{$new_last_name}';\");\n $name_match = $query->fetchAll(PDO::FETCH_ASSOC);\n $found_author = null;\n\n foreach ($name_match as $author) {\n $first_name = $author['first_name'];\n $last_name = $author['last_name'];\n $author_id = $author['id'];\n $found_author = Author::find($author_id);\n }\n\n if ($found_author != null) {\n return $found_author;\n }\n else {\n $GLOBALS['DB']->exec(\"INSERT INTO authors (first_name, last_name) VALUES ('{$this->getFirstName()}', '{$this->getLastName()}');\");\n $this->id = $GLOBALS['DB']->lastInsertId();\n }\n }",
"public function getSecondName()\n {\n return $this->secondName;\n }",
"function formatName($last, $first) {\n\t$last = trim($last);\n\tif (strtoupper($last) === $last) { // no lowercase letters? Then title-case.\n // Title-case the name\n $last = ucwords(strtolower($last));\n \n // Special cases for common prefixes (Mc and Mac): uppercase the next char.\n // don't try to fix single words starting with \"St\";\n // the rule would fire for names like \"Stevens\"\n if (strlen($last) >= 3 && substr($last, 0, 2) == 'Mc') {\n $last{2} = strtoupper($last{2});\n }\n elseif (strlen($last) >= 4 && substr($last, 0, 3) == 'Mac') {\n $last{3} = strtoupper($last{3});\n }\n elseif (substr($last, 0, 3) == 'De ') {\n $last{0} = 'd';\n }\n }\n\t\n\t$first = trim($first);\n\tif (strtoupper($first) === $first) { // no lowercase letters? Then title-case.\n // Title-case the name\n $first = ucwords(strtolower($first));\n }\n \n\tif (strlen($last) > 0 && strlen($first) > 0) {\n\t\t$text = $last . ', ' . $first;\t// have both names; use comma\n\t}\n\telse {\n\t\t$text = $last . $first;\t\t\t// only have one of them; no comma\n\t}\n\t\n\treturn $text; \n}",
"function formatName(array $name)\r\n {\r\n return $name['last_name'] . ' ' . preg_replace('/\\b([A-Z]).*?(?:\\s|$)+/','$1',$name['first_name']);\r\n }",
"public function setName2($name2) {\n\t\t$this->name2 = $name2;\n\t}",
"public function setMiddleName2($middleName2)\n {\n $this->middleName2 = $middleName2;\n }",
"protected function fixNameByType(): void\n {\n if (\n $this->type === self::TYPE_GROUP &&\n !isset($this->attributes['name']) &&\n isset($this->attributes['firstName'], $this->attributes['lastName'])\n ) {\n $this->attributes['name'] = $this->attributes['firstName'] . ' ' . $this->attributes['lastName'];\n return;\n }\n\n if (\n $this->type === self::TYPE_USER &&\n empty($this->attributes['firstName']) &&\n empty($this->attributes['lastName']) &&\n isset($this->attributes['name'])\n ) {\n $names = explode(' ', $this->name, 2);\n\n if (count($names) !== 2) {\n $this->first_name = $names[0];\n\n return;\n }\n\n [$this->attributes['firstName'], $this->attributes['lastName']] = $names;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Forward to another page on this site using Output Buffering $uripath to forward to $status (optional) STRING for status code (eg: 301 Moved Permanently) | public static function forward($uri='',$status=false)
{
ob_start();
if($status)
{
header("HTTP/1.1 ".$status);
}
header("Location: ".rtrim(_app_path,"/") . "/" . ltrim($uri,"/"));
ob_flush();
exit();
} | [
"static function redirect( $path, $parameters = array(), $status = false, $encodeURL = true )\n {\n $url = eZEnhancedHTTPTool::createRedirectUrl( $path, $parameters );\n if ( strlen( $status ) > 0 )\n {\n header( $_SERVER['SERVER_PROTOCOL'] . \" \" . $status );\n eZEnhancedHTTPTool::headerVariable( \"Status\", $status );\n }\n\n if ( $encodeURL )\n {\n $url = eZURI::encodeURL( $url );\n }\n\n eZEnhancedHTTPTool::headerVariable( 'Location', $url );\n\n /* Fix for redirecting using workflows and apache 2 */\n echo '<HTML><HEAD>';\n echo '<META HTTP-EQUIV=\"Refresh\" Content=\"0;URL='. htmlspecialchars( $url ) .'\">';\n echo '<META HTTP-EQUIV=\"Location\" Content=\"'. htmlspecialchars( $url ) .'\">';\n echo '</HEAD><BODY></BODY></HTML>';\n }",
"public function forward ($url = '')\r\n\t{\r\n\t\tHush_Util::headerRedirect($url);\r\n\t\texit;\r\n\t}",
"function bp_core_redirect( $location, $status = 302 ) {\r\n\tglobal $bp_no_status_set;\r\n\r\n\t// Make sure we don't call status_header() in bp_core_do_catch_uri()\r\n\t// as this conflicts with wp_redirect()\r\n\t$bp_no_status_set = true;\r\n\r\n\twp_redirect( $location, $status );\r\n\tdie;\r\n}",
"function forward($location = \"\", $code = 302) {\n global $CONFIG;\n\n if (!headers_sent()) {\n if ((substr_count($location, 'http://') == 0) && (substr_count($location, 'https://') == 0))\n $location = $CONFIG->wwwroot . $location;\n\n header(\"Location: {$location}\", true, $code);\n exit;\n }\n\n return false;\n}",
"function forward($location = \"\", $reason = 'system') {\n\tglobal $CONFIG;\n\n\tif (!headers_sent()) {\n\t\tif ($location === REFERER) {\n\t\t\t$location = $_SERVER['HTTP_REFERER'];\n\t\t}\n\n\t\t$location = elgg_normalize_url($location);\n\n\t\t// return new forward location or false to stop the forward or empty string to exit\n\t\t$current_page = current_page_url();\n\t\t$params = array('current_url' => $current_page, 'forward_url' => $location);\n\t\t$location = elgg_trigger_plugin_hook('forward', $reason, $params, $location);\n\n\t\tif ($location) {\n\t\t\theader(\"Location: {$location}\");\n\t\t\texit;\n\t\t} else if ($location === '') {\n\t\t\texit;\n\t\t}\n\t}\n\n\treturn false;\n}",
"function forward($location = \"\", $reason = 'system') {\n\tif (!headers_sent($file, $line)) {\n\t\tif ($location === REFERER) {\n\t\t\t$location = _elgg_services()->request->headers->get('Referer');\n\t\t}\n\n\t\t$location = elgg_normalize_url($location);\n\n\t\t// return new forward location or false to stop the forward or empty string to exit\n\t\t$current_page = current_page_url();\n\t\t$params = array('current_url' => $current_page, 'forward_url' => $location);\n\t\t$location = elgg_trigger_plugin_hook('forward', $reason, $params, $location);\n\n\t\tif ($location) {\n\t\t\theader(\"Location: {$location}\");\n\t\t\texit;\n\t\t} else if ($location === '') {\n\t\t\texit;\n\t\t}\n\t} else {\n\t\tthrow new \\SecurityException(\"Redirect could not be issued due to headers already being sent. Halting execution for security. \"\n\t\t\t. \"Output started in file $file at line $line. Search http://learn.elgg.org/ for more information.\");\n\t}\n}",
"function render_url()\n{\n global $uri;\n if(strpos($uri,'.'))return;\n if($_SERVER['QUERY_STRING'])return;\n if(substr($uri,-1)=='/')return;\n if($uri =='')return;\n header(\"HTTP/1.1 301 Moved Permanently\");\n header ('Location:'.$_SERVER['REQUEST_URI'].'/');\n exit(0);\n}",
"public function fcpoTriggerForwardRedirects()\n {\n $sStatusmessageId = $this->_oFcpoHelper->fcpoGetRequestParameter(\"oxid\");\n if (!$sStatusmessageId || $sStatusmessageId == -1) {\n return;\n }\n $oConfig = $this->_oFcpoHelper->fcpoGetConfig();\n $sPortalKey = $oConfig->getConfigParam('sFCPOPortalKey');\n $sKey = md5($sPortalKey);\n\n $oConfig = $this->getConfig();\n $sShopUrl = $oConfig->getShopUrl();\n $sSslShopUrl = $oConfig->getSslShopUrl();\n\n $sParams = '';\n $sParams .= $this->_addParam('key', $sKey);\n $sParams .= $this->_addParam('statusmessageid', $sStatusmessageId);\n $sParams = substr($sParams,1);\n $sBaseUrl = (empty($sSslShopUrl)) ? $sShopUrl : $sSslShopUrl;\n\n $sForwarderUrl = $sBaseUrl . 'modules/fc/fcpayone/statusforward.php';\n\n $oCurl = curl_init($sForwarderUrl);\n curl_setopt($oCurl, CURLOPT_POST, 1);\n curl_setopt($oCurl, CURLOPT_POSTFIELDS, $sParams);\n\n curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false);\n\n curl_exec($oCurl);\n curl_close($oCurl);\n $this->render();\n }",
"public static function redirect($psUrl, $pnStatus=0)\r\n\t{\r\n if ($pnStatus == 301)\r\n header(\"Status: 301 Moved Permanently\", false, 301);\r\n \r\n\t header('Location: '.$psUrl);\r\n\t die();\r\n\t}",
"public function redirect(string $path, int $status = 302): void\n {\n $this->location($path);\n\n $this->sendHeaders();\n $this->status($status);\n $this->end();\n }",
"function redirect( $path=NULL ) {\n $url = $this->getBaseUrl( $path );\n header( \"Location: {$url}\" );\n exit;\n }",
"public function redirect()\n\t{\n\t\t$url = Piwik_Common::getRequestVar('url', '', 'string', $_GET);\n\n\t\t// validate referrer\n\t\t$referrer = Piwik_Url::getReferer();\n\t\tif(!empty($referrer) && !Piwik_Url::isLocalUrl($referrer))\n\t\t{\n\t\t\tdie('Invalid Referer detected - check that your browser sends the Referer header. <br/>The link you would have been redirected to is: '.$url);\n\t\t\texit;\n\t\t}\n\n\t\t// mask visits to *.piwik.org\n\t\tif(self::isPiwikUrl($url))\n\t\t{\n\t\t\techo\n'<html><head>\n<meta http-equiv=\"refresh\" content=\"0;url=' . $url . '\" />\n</head></html>';\n\t\t}\n\t\texit;\n\t}",
"public function redirect( string $url );",
"static function ErrorHandler301($url)\n {\n // TODO 0 -o JoMorg -c task: Clean $url\n // TODO 0 -o JoMorg -c task: Localize... maybe?\n @ob_end_clean();\n #header($_SERVER[\"SERVER_PROTOCOL\"] . ' 301 Moved Permanently'); # maybe????\n header('HTTP/1.1 301 Moved Permanently');\n header(\"Status: 301 Moved Permanently\");\n # make sure browsers don't cache \n header(\"Cache-Control: no-cache, must-revalidate\"); // HTTP/1.1\n header(\"Expires: Sat, 26 Jul 1997 05:00:00 GMT\"); // Date in the past\n header('Location: ' . $url );\n $html = \"<!DOCTYPE HTML PUBLIC \\\"-//IETF//DTD HTML 2.0//EN\\\">\\n\"; \n $html .= \"<html>\\n\"; \n $html .= \"<head>\\n\"; \n $html .= \"<title>Moved</title>\\n\"; \n $html .= \"</head>\\n\"; \n $html .= \"<body>\\n\"; \n $html .= \"<h1>Moved</h1>\\n\"; \n $html .= \"<p>This page has moved to <a href=\\\"\" . $url . \"\\\">\" . $url . \"</a>.</p>\\n\"; \n $html .= \"</body>\\n\"; \n $html .= \"</html>\\n\"; \n echo $html;\n exit();\n }",
"private function apply_301(){\n\t\t\n\t\theader(\"HTTP/1.1 301 Moved Permanently\");\n\t\theader(\"Location: \".$this->destination);\n\n\t\t\n\t}",
"public function forward()\n {\n $this->server->evalJS(\"browser.window.history.forward(); browser.wait(function() { stream.end(); })\");\n }",
"public function forwardIfExists()\n {\n /** @var \\PatrickBroens\\UrlForwarding\\Domain\\Model\\Redirect $redirect */\n $redirect = false;\n\n $request = parse_url(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));\n\n $path = trim($request['path'], '/');\n $host = $request['host'];\n\n if ($path != '') {\n $redirect = $this->redirectRepository->findByPathAndDomain($host, $path);\n }\n\n if ($redirect) {\n header($redirect->getHttpStatus());\n header('Location: ' . $redirect->getUrl());\n exit();\n }\n }",
"function redirect($url = NULL, $code = 302, $method = 'location')\n{\n if(strpos($url, '://') === FALSE)\n {\n $url = site_url($url);\n }\n\n //print dump($url);\n\n header($method == 'refresh' ? \"Refresh:0;url = $url\" : \"Location: $url\", TRUE, $code);\n}",
"function forward($location)\n{\n echo \"<Forward >$location</Forward>\";\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if table is a tree | function isTree() {
return $this->table->isTree();
} | [
"protected function isTree() {\n\t\ttry {\n\t\t\t$className\t= get_class($this);\n\t\t\tif (array_key_exists($className, self::$isTree) && is_bool(self::$isTree[$className])) {\n\t\t\t\treturn self::$isTree[$className];\n\t\t\t}\n\t\t\t$itemType\t\t= $this->getClassVar(\"itemType\");\n\t\t\t$tableName\t\t= eval(\"return $itemType::\\$tableName;\");\n\t\t\t$columns \t\t= eval(\"return $itemType::\\$treeColNames;\");\n\t\t\tforeach ($columns as $column) {\n\t\t\t\ttry {\n\t\t\t\t\t$sql = $this->getQueryBuilder()->getSelectColumns($tableName, (array)$column, NULL, array(1));\n\t\t\t\t\t$this->getDb()->initiateQuery($sql);\n\t\t\t\t}\n\t\t\t\tcatch (DbControlException $e) {\n\t\t\t\t\t// throw $e;\n\t\t\t\t\t// column does not found - table is not tree\n\t\t\t\t\tself::$isTree[$className] = false;\n\t\t\t\t\treturn self::$isTree[$className];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tself::$isTree[$className] = true;\n\t\t\treturn self::$isTree[$className];\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}",
"function isTree() {\n\t\t\n\t}",
"function isTree() {\n\t\treturn $this->_driver->isTree();\n\t}",
"public function __isMainTree()\n\t{\n\t\treturn $this->table_tree === 'tree';\n\t}",
"public static function isTree();",
"abstract public function isTree();",
"public function isTree()\n {\n return ( ! is_null($this->_options['treeImpl'])) ? true : false;\n }",
"public function isTreeRelation()\n\t{\n\t\tif (\\in_array($this->getRelationModuleModel()->getName(), ['OutsourcedProducts', 'Products', 'Services', 'OSSOutsourcedServices'])) {\n\t\t\tforeach ($this->getRelationModuleModel()->getFieldsByType('tree') as $field) {\n\t\t\t\tif ($field->isActiveField()) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function getHasTree(){\n\t\treturn $this->_entity1->getIsTree() || $this->_entity2->getIsTree();\n\t}",
"function in_nested_table()\n {\n return $this->_in_table > 1;\n }",
"function treeExists() {\n $ret=false;\n foreach($this->element as $k=>$v) {\n if (strtolower(get_class($this->element[$k]))==\"syntree\")\n $ret=true;\n }\n return $ret;\n }",
"public function entityIsLtree(object $object): bool;",
"public function canRenderTrees();",
"public function isHierarchical(): bool;",
"public function hasParent() {\r\n\t\ttry {\r\n\t\t\tif (!$isTree = $this->isTree()) {\r\n\t\t\t\tthrow new LBoxException(\"Table '$tableName' seems not to be tree!\");\r\n\t\t\t}\r\n\t\t\t$this->load();\r\n\t\t\t$treeColNames\t= $this->getClassVar(\"treeColNames\");\r\n\t\t\t$pidColName\t\t= $treeColNames[2];\r\n\t\t\treturn ($this->get($pidColName) > 0);\r\n\t\t}\r\n\t\tcatch (Exception $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}",
"public function getNotIsTree(){\n return !$this->getIsTree();\n }",
"public function canRenderTrees()\n {\n return $this->__renderTrees;\n }",
"public function canRenderTrees()\n {\n return $this->canRenderTrees;\n }",
"public function isLeafNode() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ajax load Award form in CV page | public function loadAwardForm(Request $request)
{
$key = str_replace('award-ref', '', $request->get('key'));
if(!empty($key))
{
$user = Auth::guard('web')->user();
$award = $user->awards()->findOrFail((int)$key);
}
else
{
$award = new Award;
}
return response()->json(array('content'=>mb_convert_encoding(View::make('component.frontend.cv.forms.user-award',compact('award'))->render(), 'UTF-8', 'UTF-8')));
} | [
"public function ajaxAttendencePreview()\n {\n $classTitle = $this->input->get('q',TRUE);\n $query = $this->common->getWhere('class', 'class_title', $classTitle);\n foreach ($query as $row) {\n $data = $row;\n }\n echo '<input type=\"hidden\" name=\"class\" value=\"' . $classTitle . '\">';\n if (!empty($data['section'])) {\n $section = $data['section'];\n $sectionArray = explode(\",\", $section);\n echo '<div class=\"form-group\">\n <label class=\"col-md-3 control-label\"></label>\n <div class=\"col-md-4\">\n <select name=\"section\" class=\"form-control\">\n <option value=\"all\">All Section</option>';\n foreach ($sectionArray as $sec) {\n echo '<option value=\"' . $sec . '\">' . $sec . '</option>';\n }\n echo '</select></div>\n </div>';\n } else {\n $section = 'This class has no section.';\n echo '<div class=\"form-group\">\n <label class=\"col-md-3 control-label\"></label>\n <div class=\"col-md-6\">\n <div class=\"alert alert-warning\">\n <strong>Info!</strong> ' . $section . '\n </div></div></div>';\n }\n }",
"function acf_verify_ajax() {}",
"public static function process_enquiry_form_ajax()\n\t{\n\t\t$result = self::process_enquiry_form();\n\t\techo ($result)? 1: 0;\n\t\tdie();\n\t}",
"public function getClaimForm() {\n Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n $view = Zend_Registry::isRegistered('Zend_View') ? Zend_Registry::get('Zend_View') : null;\n $url = $view->url(array('action' => 'terms'), 'sitepage_claimpages', true);\n $response = array();\n $response['info'] = array();\n $response['info']['title'] = Engine_Api::_()->getApi('Core', 'siteapi')->translate('Claim a Page');\n $response['info']['description'] = Engine_Api::_()->getApi('Core', 'siteapi')->translate('Below, you can file a claim for a page on this community that you believe should be owned by you. Your request will be sent to the administration.');\n $response['form'] = array();\n\n // claimer name\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'nickname',\n 'label' => $this->translate('Your Name'),\n 'has Validator' => 'true'\n );\n\n // claimer email\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'email',\n 'label' => $this->translate('Your Email'),\n 'has Validator' => 'true'\n );\n\n // claimer about\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'about',\n 'label' => $this->translate('About you and the page'),\n 'has Validator' => 'true'\n );\n\n // claimer contactno\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'contactno',\n 'label' => $this->translate('Your Contact number.'),\n 'has Validator' => 'true'\n );\n\n // claimer comments\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'usercomments',\n 'label' => $this->translate('Comments'),\n );\n\n\n $description = $description = sprintf(Zend_Registry::get('Zend_Translate')->_(\"I have read and agree to the <a href='javascript:void(0);' onclick=window.open('%s','mywindow','width=500,height=500')>terms of service</a>.\"), $url);\n\n\n $response['form'][] = array(\n 'type' => 'checkbox',\n 'name' => 'terms',\n 'label' => $this->translate('Terms of Service'),\n 'description' => $description,\n 'hasValidator' => true,\n );\n\n $response['form'][] = array(\n 'type' => 'Submit',\n 'name' => 'send',\n 'label' => $this->translate('Send'),\n );\n\n return $response;\n }",
"function acf_verify_ajax() { }",
"function load_exam_form()\n\n\t{\n\n\t\taccess_control($this);\n\n\t\t\n\n\t\t# Get the passed details into the url data array if any\n\n\t\t$urldata = $this->uri->uri_to_assoc(3, array('m', 'i','a'));\n\n\t\t# Pick all assigned data\n\n\t\t$data = assign_to_data($urldata);\n\n\t\t\n\n\t\t$data['classes'] = $this->classobj->get_classes();\n\n\t\t\n\n\t\t$data['terms'] = $this->terms->get_terms();\n\n \n\n #user is editing\n\n\t\tif(!empty($data['i']))\n\n\t\t{\n\n\t\t\t$examid = decryptValue($data['i']);\n\n\t\t\t\n\n\t\t\t$data['formdata'] = $examdetails = $this->Query_reader->get_row_as_array('search_exams', array('limittext'=>'', 'searchstring' => ' AND isactive = \"Y\" AND id = '.$examid));\n\n\t\t\t\n\n\t\t\t#Check if the exam belongs to the current user's school\n\n\t\t\tif($examdetails['school'] != $this->myschool['id']){\n\n\t\t\t\t$data['msg'] = \"ERROR: The exam details could not be loaded.\";\n\n\t\t\t\t$data['formdata'] = $examdetails = array ();\t\n\n\t\t\t}\n\n\t\t\t \n\n #Check if the user is simply viewing\n\n if(!empty($data['a']) && decryptValue($data['a']) == 'view')\n\n {\n\n $data['isview'] = \"Y\";\n\n }\n\n\t\t}\n\n\t\t\n\n\t\t$this->load->view('exams/exam_form_view', $data);\n\n\t}",
"function bookingForm()\n\t{\n\t\t$this->isAjax = true;\n\t\t\n\t\tif ($this->isXHR())\n\t\t{\n\t\t\tif (in_array($this->option_arr['bf_include_country'], array(2, 3)))\n\t\t\t{\n\t\t\t\tObject::import('Model', 'Country');\n\t\t\t\t$CountryModel = new CountryModel();\n\t\t\t\t$this->tpl['country_arr'] = $CountryModel->getAll(array('t1.status' => 'T', 'col_name' => 't1.country_title', 'direction' => 'asc'));\n\t\t\t}\n\t\t\t$this->tpl['amount'] = AppController::getCartTotal($_GET['cid'], $this->cartName, $this->option_arr);\n\t\t}\n\t}",
"protected function _process_ajax() {}",
"public function register_advertiser_form()\n\t{\n\t\tlogged_in();\n\t\t$subdata['result'] = '';\n\t\t$campaign_array[''] = 'Select';\n\t\t$campaigns = $this->modeladclicks->get_all_campaigns();\n\t\tforeach($campaigns as $data)\n\t\t{\n\t\t\t$campaign_array[$data['campaign_id']] = $data['campaign_name'];\n\t\t}\t\t\t\n\n\t\t$subdata['campaigns'] = $campaign_array;\n\t\t$data['content'] = $this->load->view('adclick_register_advertiser',$subdata,TRUE);\n\t\t$this->load->view('adclick_index', $data);\n\t}",
"function loadparticipationAction()\n\t{\n\t\tif($this->_request->isPost() && $_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest')\n\t\t{\n\t\t\t$request = $this->_request->getParams();\n\t\t\t$survey_id = $request['sid'];\n\t\t\t$checked_values = $request['checked_types'];\n\t\t\t$where = \"\";\n\t\t\tif($checked_values)\n\t\t\t{\n\t\t\t//\t$where = \" ( \";\n\t\t\t\t$explode = explode(',',$checked_values);\n\t\t\t\tif(in_array('sc',$explode))\n\t\t\t\t$where .= \" OR us.profile_type='senior'\";\n\t\t\t\tif(in_array('jc',$explode))\n\t\t\t\t$where .= \" OR us.profile_type='junior'\";\n\t\t\t\tif(in_array('jco',$explode))\n\t\t\t\t$where .= \" OR us.profile_type='sub-junior'\";\n\t\t\t\t//$where .= \" )\";\n\t\t\t}\n\t\t\t$surveyObj=new Ep_Quote_Survey();\t\n\t\t\t$surveyParticipants = $surveyObj->getSurveyPartcipants($survey_id,$where);\n\t\t\tif($surveyParticipants)\n\t\t\t{\n\t\t\t\t$SMICvalue=$surveyObj->getSMICvalue($survey_id);\n\t\t\t\tforeach($surveyParticipants as $key=>$participate)\n\t\t\t\t{\n\t\t\t\t\t$surveyResponses=$surveyObj->getUserResponses($participate['poll_id'],$participate['user_id']);\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($surveyResponses)\t\n\t\t\t\t\t\t$surveyParticipants[$key]['response_details']=$surveyResponses;\n\t\t\t\t\t\n\t\t\t\t\t//user profile image\n\t\t\t\t\t$surveyParticipants[$key]['image'] = $this->getProfilePic($participate['user_id']);\n\t\t\t\t\t\n\t\t\t\t\tif($participate['price_user']<$SMICvalue)\n\t\t\t\t\t\t$surveyParticipants[$key]['under_smic']='yes';\n\t\t\t\t\telse\t\n\t\t\t\t\t\t$surveyParticipants[$key]['under_smic']='no';\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_view->surveyParticipants = $surveyParticipants;\t\t\n\t\t\t\n\t\t\t$this->_view->avg_price = $surveyObj->getAvgPriceSurvey($survey_id);\n\t\t\t$this->_view->avg_bulk_price = $surveyObj->getAvgBulkPriceSurvey($survey_id);\n\t\t\t$this->_view->currency = $request['currency'];\n\t\t\t$this->render('load-survey-participation');\n\t\t}\n\t}",
"function load_grading_form()\n\n\t{\n\n\t\taccess_control($this);\n\n\t\t\n\n\t\t# Get the passed details into the url data array if any\n\n\t\t$urldata = $this->uri->uri_to_assoc(3, array('m', 'i','a'));\n\n\t\t\n\n\t\t# Pick all assigned data\n\n\t\t$data = assign_to_data($urldata);\n\n\t\t\n\n\t\t$data['classes'] = $this->classobj->get_classes();\n\n\t\t\n\n\t\t$data['terms'] = $this->terms->get_terms();\n\n \n\n #user is editing\n\n\t\tif(!empty($data['i']))\n\n\t\t{\n\n\t\t\t$gradingid = decryptValue($data['i']);\n\n\t\t\t\n\n\t\t\t$data['formdata'] = $gradingdetails = $this->Query_reader->get_row_as_array('search_grading', array('limittext'=>'', 'isactive' => 'Y', 'searchstring' => ' AND id = '.$gradingid));\n\n\t\t\t\n\n\t\t\t//get the grading details\n\n\t\t\t$data['grading_details'] = $this->db->query($this->Query_reader->get_query_by_code('search_grading_details', array('limittext'=>'', 'isactive' => 'Y', 'searchstring' => ' AND gradingscale = '.$gradingid)))\n\n\t\t\t\t\t\t\t\t\t\t->result_array();\t\t\t\n\n\t\t\t\n\n\t\t\t#Check if the exam belongs to the current user's school\n\n\t\t\tif($gradingdetails['school'] != $this->myschool['id']){\n\n\t\t\t\t$data['msg'] = \"ERROR: The grading scale details could not be loaded.\";\n\n\t\t\t\t$data['formdata'] = $examdetails = array ();\t\n\n\t\t\t}\n\n\t\t\t \n\n #Check if the user is simply viewing\n\n if(!empty($data['a']) && decryptValue($data['a']) == 'view')\n\n {\n\n $data['isview'] = \"Y\";\n\n }\n\n\t\t}\n\n\t\t\n\n\t\t$this->load->view('grading/grading_form_view', $data);\n\n\t}",
"function acf_verify_ajax()\n{\n}",
"public function ajaxGuion() {\n\t\t\tAppSesion::validar('ESCRITURA');\n\t\t\t\n\t\t\tif(AppValidar::PeticionAjax() == true):\n\t\t\t\t$this->ajaxExistencia();\n\t\t\telse:\n\t\t\t\theader(\"Location: \".NeuralRutasApp::RutaUrlAppModulo('Plataforma', 'Diagnosticador'));\n\t\t\t\texit();\n\t\t\tendif;\n\t\t}",
"public function executeUpdateAjax(sfWebRequest $request)\n {\n #security\n if( !$this->getUser()->hasCredential(array('Administrator','Staff','Coordinator','Volunteer'), false)){\n $this->getUser()->setFlash(\"warning\", 'You don\\'t have permission to access this url '.$request->getReferer());\n $this->redirect('dashboard/index');\n }\n\n $this->setLayout(false);\n\n $agency = new Agency();\n\n $this->form = new AgencyForm($agency);\n\n $this->back = $request->getReferer();\n\n $this->backurl = \"\";\n $this->is_camp = 0;\n $this->person_ids = 1;\n if($request->getParameter('camp')==1){\n $this->backurl = '/camp/create';\n $this->is_camp = 1;\n }elseif($request->getParameter('req')==1){\n $this->backurl = '/requester/create?person_id='.$request->getParameter('person_id');\n $this->person_ids = $request->getParameter('person_id');\n }\n\n if ($request->isMethod('post'))\n {\n $this->referer = $request->getReferer();\n $this->form->bind($request->getParameter('agency'));\n\n if ($this->form->isValid())\n {\n $agency->setName($this->form->getValue('name'));\n $agency->setAddress1($this->form->getValue('address1'));\n $agency->setAddress2($this->form->getValue('address2'));\n $agency->setCity($this->form->getValue('city'));\n $agency->setCounty($this->form->getValue('county'));\n $agency->setState($this->form->getValue('state'));\n $agency->setCountry($this->form->getValue('country'));\n $agency->setZipcode($this->form->getValue('zipcode'));\n $agency->setPhone($this->form->getValue('phone'));\n $agency->setComment($this->form->getValue('comment'));\n $agency->setFaxPhone($this->form->getValue('fax_phone'));\n $agency->setFaxComment($this->form->getValue('fax_comment'));\n $agency->setEmail($this->form->getValue('email'));\n\n if ($agency->isNew()) {\n $content = $this->getUser()->getName().' added new Agency: '.$agency->getName();\n ActivityPeer::log($content);\n }\n\n $agency->save();\n\n $this->getUser()->setFlash('new_agency', $this->form->getValue('name'));\n\n $b_u = $request->getParameter('backurl');\n // if($request->getReferer()){\n // $back = $request->getReferer();\n // if(isset($back)){\n // if(strstr($back,'requester/edit')){\n // $req =1;\n // }elseif(strstr($back,'camp/create')){\n // $camp =1;\n // }\n // }\n // }\n $id = $agency->getId();\n $str = <<<XYZ\n <script type=\"text/javascript\">\n var a = $id;\n if(window.jQuery('#back_agency_id')){\n window.jQuery('#back_agency_id').val('');\n }\n if(window.jQuery('#back_agency_id')){\n window.jQuery('#back_agency_id').val(a);\n }\n if(window.jQuery('#pre_agency_id')){\n window.jQuery('#pre_agency_id').val('');\n }\n if(window.jQuery('#pre_agency_id')){\n window.jQuery('#pre_agency_id').val(a);\n }\n location.href='$b_u?agency_id=$id';\n </script>\nXYZ;\n $this->getUser()->setFlash('success','New Agency has added!');\n return $this->renderText($str);\n }\n }else{\n # Set referer URL\n $this->referer = $request->getReferer() ? $request->getReferer() : '@agency';\n }\n $this->agency = $agency;\n }",
"public function ajaxCrearFormaPago(){\n\t\t$respuesta = ControladorFormaPago::ctrCrearFormaPago();\n\t\techo $respuesta;\n\t}",
"public function ajaxPostAttendanceForm()\n\t{\n\t\t$validator = Validator::make(\n\t\t\t\t\t\t\t\t\t\tarray('date' => Input::get('date')),\n\t\t\t\t\t\t\t\t\t\tarray('date' => array('required', 'regex:#^[\\d]{1,2}/[\\d]{2}/[\\d]{4}$#'))\n\t\t\t\t\t\t\t\t\t);\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn '<h3>' . 'Invalid date' . '</h3>';\n\t\t}\n\n\t\tif (CALENDAR == 'BS')\n\t\t{\n\t\t\t// checking if the BS date actually exists\n\t\t\t$date_array = explode('/', Input::get('date'));\n\t\t\t$date = $date_array[2] . '-' . $date_array[1] . '-' . $date_array[0];\n\t\t\t$date = (new DateConverter)->bs2ad($date);\n\t\t\tif (!$date)\n\t\t\t{\n\t\t\t\treturn '<h3>' . 'Invalid date' . '</h3>';\n\t\t\t}\n\t\t}\n\n\t\t$students = AttendanceHelperController::getStudents();\n\t\t\n\t\t// TODO: make this better\n\t\t$student_ids = array();\n\t\tforeach($students as $student)\n\t\t{\n\t\t\t$student_ids[] = $student['student_id'];\n\t\t}\n\n\t\t// echo '<pre>';\n\t\t// return json_encode($students, JSON_PRETTY_PRINT);\n\n\t\treturn View::make($this->view.'js-template.attendance-form')\n\t\t\t\t\t->with('students', $students)\n\t\t\t\t\t->with('class_id', Input::get('class_id'))\n\t\t\t\t\t->with('section_id', Input::get('section_id'))\n\t\t\t\t\t->with('student_ids', implode(',', $student_ids));\n\t}",
"function iphorm_show_form_ajax()\n{\n $id = isset($_REQUEST['id']) ? absint($_REQUEST['id']) : 0;\n $_GET['iphorm_display_form_ajax'] = $id;\n iphorm_display_form_ajax();\n}",
"public function getWebform();",
"function getcourseajax() {\n\n $sectorId = $this->data['sectorId'];\n\n //pr($sectorId);die;\n\n $course = $this->Course->find('all', array('conditions' => array('Course.sector_id' => $sectorId)));\n\n $this->set(compact('course'));\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
send RSET command to server | public function rset()
{
fwrite($this->server, 'RSET' . "\r\n");
$this->response = trim(fgets($this->server, 512));
return $this->isOk();
} | [
"public function rset()\n {\n $this->_send('RSET');\n // MS ESMTP doesn't follow RFC, see [ZF-1377]\n $this->_expect([250, 220]);\n\n $this->_mail = false;\n $this->_rcpt = false;\n $this->_data = false;\n }",
"public function resetCmd()\n {\n $this->login();\n\n // See RFC 5321 [4.1.1.5].\n // RSET only useful if we are already authenticated.\n if (!is_null($this->_extensions)) {\n $this->_connection->write('RSET');\n $this->_getResponse(250);\n }\n }",
"public function reset()\n {\n return $this->sendCommand('RSET', 'RSET', 250);\n }",
"private function setRedis_set($gid, $object){\n $client = new Predis\\Client([\n 'scheme' => 'tcp',\n 'host' => '127.0.0.1',\n 'port' => 6379,\n ]);\n\t\t$object = json_encode($object);\n $client->set($gid, $object);\n }",
"public function setR($r) {}",
"public function rset()\n {\n $this->mail = null;\n $this->rcpt = array();\n $this->data = null;\n }",
"function testLSet() {\n\t\t\t$client = $this->connect();\n\t\t\t$client->DEL('key1');\n\t\t\t$this->assertFalse($client->EXISTS('key1'));\n\t\t\t$client->LPUSH('key1', 'a');\n\t\t\t$client->LPUSH('key1', 'b');\n\t\t\t$client->LPUSH('key1', 'c');\n\t\t\t$this->assertEquals(3, $client->LLEN('key1'));\n\t\t\t$client->LSET('key1', 1, 'd');\n\t\t\t$this->assertEquals('d', $client->LINDEX('key1', 1));\n\t\t}",
"function testLREM() {\n\t\t\t$client = $this->connect();\n\t\t\t$client->DEL('key1');\n\t\t\t$this->assertFalse($client->EXISTS('key1'));\n\t\t\t$client->LPUSH('key1', 'a');\n\t\t\t$client->LPUSH('key1', 'b');\n\t\t\t$client->LPUSH('key1', 'c');\n\t\t\t$client->LREM('key1', 1, 'c');\n\t\t\t$res = $client->LRANGE('key1', 0, 1);\n\t\t\t$this->assertEquals('b', $res[0]);\n\t\t\t$this->assertEquals('a', $res[1]);\n\t\t}",
"function batch_set() {\n }",
"public function sendCmd($cmd);",
"public function setRecommand($value) {\n return $this->set(self::RECOMMAND, $value);\n }",
"function snmpset($host, $community, $object_id, $type, $value, $timeout = null, $retries = null) {}",
"protected function _sendcmd() {\n $a= func_get_args();\n $cmd= vsprintf(array_shift($a), $a);\n $this->cat && $this->cat->debug('>>>', $cmd);\n return $this->_sock->write($cmd.\"\\r\\n\");\n }",
"function ResetCmd() {\n\t\tglobal $contadores;\n\n\t\t// Get reset command\n\t\tif (@$_GET[\"cmd\"] <> \"\") {\n\t\t\t$sCmd = $_GET[\"cmd\"];\n\n\t\t\t// Reset search criteria\n\t\t\tif (strtolower($sCmd) == \"reset\" || strtolower($sCmd) == \"resetall\")\n\t\t\t\t$this->ResetSearchParms();\n\n\t\t\t// Reset sorting order\n\t\t\tif (strtolower($sCmd) == \"resetsort\") {\n\t\t\t\t$sOrderBy = \"\";\n\t\t\t\t$contadores->setSessionOrderBy($sOrderBy);\n\t\t\t\t$contadores->id->setSort(\"\");\n\t\t\t\t$contadores->op->setSort(\"\");\n\t\t\t\t$contadores->zona->setSort(\"\");\n\t\t\t\t$contadores->descripcion->setSort(\"\");\n\t\t\t\t$contadores->programa->setSort(\"\");\n\t\t\t\t$contadores->diahasta->setSort(\"\");\n\t\t\t\t$contadores->objetivo->setSort(\"\");\n\t\t\t\t$contadores->op2->setSort(\"\");\n\t\t\t\t$contadores->horahasta->setSort(\"\");\n\t\t\t\t$contadores->material->setSort(\"\");\n\t\t\t\t$contadores->orden->setSort(\"\");\n\t\t\t}\n\n\t\t\t// Reset start position\n\t\t\t$this->lStartRec = 1;\n\t\t\t$contadores->setStartRecordNumber($this->lStartRec);\n\t\t}\n\t}",
"function ResetCmd() {\n\t\tglobal $acc_setting_coa;\n\n\t\t// Get reset cmd\n\t\tif (@$_GET[\"cmd\"] <> \"\") {\n\t\t\t$sCmd = $_GET[\"cmd\"];\n\n\t\t\t// Reset sort criteria\n\t\t\tif (strtolower($sCmd) == \"resetsort\") {\n\t\t\t\t$sOrderBy = \"\";\n\t\t\t\t$acc_setting_coa->setSessionOrderBy($sOrderBy);\n\t\t\t\t$acc_setting_coa->id->setSort(\"\");\n\t\t\t\t$acc_setting_coa->description->setSort(\"\");\n\t\t\t\t$acc_setting_coa->coa->setSort(\"\");\n\t\t\t}\n\n\t\t\t// Reset start position\n\t\t\t$this->lStartRec = 1;\n\t\t\t$acc_setting_coa->setStartRecordNumber($this->lStartRec);\n\t\t}\n\t}",
"function ResetCmd() {\n\t\tglobal $trx_pos;\n\n\t\t// Get reset cmd\n\t\tif (@$_GET[\"cmd\"] <> \"\") {\n\t\t\t$sCmd = $_GET[\"cmd\"];\n\n\t\t\t// Reset search criteria\n\t\t\tif (strtolower($sCmd) == \"reset\" || strtolower($sCmd) == \"resetall\")\n\t\t\t\t$this->ResetSearchParms();\n\n\t\t\t// Reset sort criteria\n\t\t\tif (strtolower($sCmd) == \"resetsort\") {\n\t\t\t\t$sOrderBy = \"\";\n\t\t\t\t$trx_pos->setSessionOrderBy($sOrderBy);\n\t\t\t\t$trx_pos->kode->setSort(\"\");\n\t\t\t\t$trx_pos->tanggal->setSort(\"\");\n\t\t\t\t$trx_pos->kodebooking->setSort(\"\");\n\t\t\t\t$trx_pos->room->setSort(\"\");\n\t\t\t\t$trx_pos->nama->setSort(\"\");\n\t\t\t\t$trx_pos->total_amount->setSort(\"\");\n\t\t\t\t$trx_pos->jenis_bayar->setSort(\"\");\n\t\t\t\t$trx_pos->cardno->setSort(\"\");\n\t\t\t\t$trx_pos->paid->setSort(\"\");\n\t\t\t\t$trx_pos->updateby->setSort(\"\");\n\t\t\t}\n\n\t\t\t// Reset start position\n\t\t\t$this->lStartRec = 1;\n\t\t\t$trx_pos->setStartRecordNumber($this->lStartRec);\n\t\t}\n\t}",
"function snmpset ($hostname, $community, $object_id, $type, $value, $timeout = null, $retries = null) {}",
"function ResetCmd() {\n\t\tglobal $t_ghichu_lich;\n\n\t\t// Get reset command\n\t\tif (@$_GET[\"cmd\"] <> \"\") {\n\t\t\t$sCmd = $_GET[\"cmd\"];\n\n\t\t\t// Reset search criteria\n\t\t\tif (strtolower($sCmd) == \"reset\" || strtolower($sCmd) == \"resetall\")\n\t\t\t\t$this->ResetSearchParms();\n\n\t\t\t// Reset sorting order\n\t\t\tif (strtolower($sCmd) == \"resetsort\") {\n\t\t\t\t$sOrderBy = \"\";\n\t\t\t\t$t_ghichu_lich->setSessionOrderBy($sOrderBy);\n\t\t\t\t$t_ghichu_lich->FK_CONG_TY->setSort(\"\");\n\t\t\t\t$t_ghichu_lich->C_YEAR->setSort(\"\");\n\t\t\t\t$t_ghichu_lich->C_WEEK->setSort(\"\");\n\t\t\t\t$t_ghichu_lich->C_CONTENT->setSort(\"\");\n\t\t\t}\n\n\t\t\t// Reset start position\n\t\t\t$this->lStartRec = 1;\n\t\t\t$t_ghichu_lich->setStartRecordNumber($this->lStartRec);\n\t\t}\n\t}",
"public static function SetRemotePermissions(){\n\t\t$command1 = 'chmod -R 775 '.REMOTE_INBOX;\n\t\t$command2 = 'chmod -R 775 '.REMOTE_OUTBOX;\n\t\t$ssh = new Ssh2(REMOTE_SERVER_IP);\n\t\tif ($ssh->auth(REMOTE_SERVER_USER, REMOTE_SERVER_PASS)) {\n\t\t\t$output = $ssh->exec($command1, $command2);\n\t\t\t$lines = explode(\"\\n\", $output['output']);\n\t\t} else {\n\t\t\tthrow new Exception('An error has ocurred during the authentication. ITunesTransporter::Upload().');\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
////////////////////////////////////////////////////////FUNCTIONS ////////////////////////////////////////////////////////////////// Remove the temp directory based on upload id | function deleteTempUploadDir($temp_dir, $upload_id){
$temp_upload_dir = $temp_dir . $upload_id . '.dir';
if($handle = @opendir($temp_upload_dir)){
while(($file_name = readdir($handle)) !== false){
if($file_name != "." && $file_name != ".."){ @unlink($temp_upload_dir . '/' . $file_name); }
}
closedir($handle);
}
@rmdir($temp_upload_dir);
} | [
"public function removeTempDirectoryAction()\n {\n \t$id=Auth_UserAdapter::getIdentity()->getId();\n \t$dir=REL_IMAGE_PATH.'/albums/temp/user_'.$id.'/';\n \t$result=Helper_common::deleteDir($dir);\n \t$resultArr=array(\"msg\"=>$result);\n \tdie;\n }",
"public function removeTempFiles()\n {\n $this->removeDir($this->context['temp_dir']);\n }",
"public function removeTempFolderOfVideos()\n {\n $user_id = Auth::Id();\n \\Helper_common::deleteDir(Config::get('constants.SERVER_PUBLIC_PATH').'/frontend/videos/gallery/temp_storage_for_gallery/user_'.$user_id.'/');\n }",
"public function removeUserUploadDir() {\n\t\tFM_Tools::removeDir($this->tmpDir . '/upload/' . $this->container . session_id());\n\t}",
"public function clearUploadDir()\n {\n $dir = '/'.$this->uploadTempDir;\n $this->clearDirectory($dir);\n// if (!is_dir($dir)){\n// return;\n// }\n// $it = new \\RecursiveDirectoryIterator($dir);\n// $files = new \\RecursiveIteratorIterator($it,\n// RecursiveIteratorIterator::CHILD_FIRST);\n// foreach($files as $file) {\n// if ($file->getFilename() === '.' || $file->getFilename() === '..') {\n// continue;\n// }\n// if ($file->isDir()){\n// rmdir($file->getRealPath());\n// } else {\n// unlink($file->getRealPath());\n// }\n// }\n// rmdir($dir);\n }",
"private function deleteTmpDir()\n {\n $dir = $this->getTempDir();\n $this->exec(\"rm -rfv {$dir}\");\n }",
"protected function _deleteTempRootFolder(){\n\t\t$tempBaseFolderPath = $this->_getTempRootFolder();\n\n\t\t//if dir empty - remove\n\t\tif(count(scandir($tempBaseFolderPath)) == 2){\n\t\t\t$this->_deleteDirectory($tempBaseFolderPath);\n\t\t}\n }",
"protected function deleteTempDirectory()\n {\n $this->deleteDirectory($this->testPath . '/temp');\n }",
"protected function cleanUpTempDir()\t{\n\t\t$dh = opendir(PATH_site.'typo3temp/kb_imageedit');\n\t\twhile ($file = readdir($dh))\t{\n\t\t\tif (strpos($file, 'tmp_'.$GLOBALS['BE_USER']->user['uid'].'_')===0)\t{\n\t\t\t\tunlink(PATH_site.'typo3temp/kb_imageedit/'.$file);\n\t\t\t}\n\t\t}\n\t}",
"function cleanTemporaryDirectory() {\n $term=array('tex','aux','log','depth','dvi','ps','png');\n foreach ($term as $i) {\n $fn=$this->_tmp_dir.'/'.$this->_tmp_filename.$i;\n if (is_file($fn)) {\n unlink($fn);\n }\n }\n }",
"public function cleanupTemp() {\n $files = scandir(TEMP_FOLDER);\n foreach($files as $file) {\n $file = TEMP_FOLDER.$file;\n if(is_file($file)) {\n unlink($file);\n }\n }\n }",
"private function clearTempFiles()\n {\n if(file_exists($this->tmpArchive)) {\n unlink($this->tmpArchive);\n }\n if(file_exists($this->tmpBouquets) && is_dir($this->tmpBouquets)) {\n $this->unlinkDirectory($this->tmpBouquets);\n }\n }",
"protected function deleteTempStorage()\r\n {\r\n $directory = $this->getTempStoragePath() . $this->getUserDirectoryName();\r\n\r\n if (Storage::exists($directory)) {\r\n Storage::deleteDirectory($directory);\r\n }\r\n }",
"private function deleteTempFile() {\n\t\tif (strlen($this->tempFileName) > 0 && file_exists($this->tempFileName) && is_writable($this->tempFileName)){\n\t\t\tunlink($this->tempFileName);\n\t\t}\n\t}",
"public function removeUpload()\n {\n // En PostRemove, on n'a pas accès à l'id, on utilise notre nom sauvegardé\n if (file_exists($this->tempFilename)) {\n // On supprime le fichier\n unlink($this->tempFilename);\n }\n }",
"function cleanupTmp() {\n // try to delete all the tmp files we know about.\n foreach($this->tmpFilesCreated as $file) {\n if(file_exists($file)) {\n $status = unlink($file);\n }\n }\n $this->tmpFilesCreated = array();\n // try to completely delete each directory we created.\n $dirs = array_reverse($this->tmpDirsCreated);\n foreach($dirs as $dir) {\n if(file_exists($dir)) {\n $this->recursiveRmdir($dir);\n }\n }\n $this->tmpDirsCreated = array();\n }",
"public function cleanupUploadsFolder()\n {\n $upload_folder = $this->getTempFolder();\n if ( is_dir( $upload_folder ) ) {\n $this->cleanupFolder( $upload_folder );\n }\n }",
"public function cleanUpTmp()\n {\n $dir = Yii::getAlias(self::TMP_DIR);\n if (!is_dir($dir)) {\n mkdir($dir, 0755, true);\n }\n\n if ($files = glob($dir . '/*.zip')) {\n foreach ($files as $file) {\n @unlink($file);\n }\n }\n if ($files = glob($dir . '/*.csv')) {\n foreach ($files as $file) {\n @unlink($file);\n }\n }\n }",
"public function removeTempFolderNDataAction()\n {\n $user_id = Auth_UserAdapter::getIdentity()->getId();\n Helper_common::deleteDir(SERVER_PUBLIC_PATH.'/images/albums/temp_storage_for_socialize_wall_photos_post/user_'.$user_id.'/');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lista todos os chamados | public function listar(){
$query = 'SELECT * FROM chamados';
$pdo = PDOFactory::getConexao();
$comando = $pdo->prepare($query);
$comando->execute();
$chamados=array();
while($row = $comando->fetch(PDO::FETCH_OBJ)){
$chamados[] = new Chamados($row->id_chamado,$row->patri_equipamento,
$row->nome_usuario, $row->desc_problema, $row->solucao_problema,
$row->id_status, $row->id_usuario);
}
return $chamados;
} | [
"public function listarContato(){}",
"public function listChapitres()\n {\n $chapitreManager = new ChapitreManager();\n $chapitres = $chapitreManager->read(null);\n\n include 'view/frontEnd/accueil.php';\n }",
"function MuestraCoches($lista){\n\n\t\t\t\techo \"<div>Mostrando lista de coches... \";\n\t\t\t\tfor($i = 0; $i < count($lista); $i++){\n\t\t\t\t\t\n\t\t\t\t\t$lista[$i]->MuestraUnCoche($i);\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\techo \"</div>\";\n\t\t\t}",
"public function getChocolatiers()\r\n {\r\n $sql = 'select CHT_ID as id, CHT_NOM as nom,'\r\n . ' CHT_ADRESSE as adresse, CHT_TEL as tel,'\r\n . ' CHT_EMAIL as email'\r\n . ' from T_CHOCOLATIER'\r\n . ' order by nom asc';\r\n \r\n $chocolatiers = $this->executerRequete($sql);\r\n return $chocolatiers;\r\n }",
"function listarPinchosSinAceptar(){\n\t\t$concurso = new Concurso();\n\t\t$con = $concurso->recuperarUltimoConcurso();\n\t\t$ed = mysqli_fetch_assoc($con);\n\t\t$edicion = $ed['edicion'];\n\t\t$pincho = new Pincho();\n\t\t$lista = $pincho->listarSinGestionar($edicion);\n\t\treturn $lista;\n\t}",
"public function listar() {\n $this->sql = \"SELECT * FROM categoria WHERE idSupCategoria is null AND ativo=1\";\n $categorias = $this->fetch(\"Categoria\");\n foreach($categorias as $categoria) {\n $categoria->subCategorias = $this->listarSubCategorias($categoria->id);\n }\n\n return $categorias;\n }",
"public function _listarTodo()\n {\n $this->_listarDirectorios();\n $this->_listarArchivos();\n ksort($this->_resultados);\n }",
"public function getListaCarreras() {\n $cacheId = $this->_prefix . __FUNCTION__;\n if ($this->_cache->test($cacheId)) {\n return $this->_cache->load($cacheId);\n }\n $sql = $this->select()\n ->from($this->_name, array('id', 'nombre'))\n ->order('nombre');\n $rs = $this->getAdapter()->fetchPairs($sql);\n $this->_cache->save(\n $rs, $cacheId, array(), $this->_config->cache->Carrera->getCarreras\n );\n return $rs;\n }",
"public function horsCobas() \r\n {\r\n return $this->liste(\"HorsCOBAS=1\");\r\n }",
"public function listar(){\n $clientes = Cliente::get();\n\n return ($clientes);\n }",
"public function listar() {\n\n\t\t$sql = 'select id, nome, descricao from categorias';\n\t\treturn $this->database->select($sql);\n\t\n\t}",
"public function cochesList(){\n $coches = Coche::orderBy('modelo')->simplePaginate(6);\n\n return view('admin.coches.coches', compact('coches'));\n }",
"public function getAllAdminChapters()\n {\n $db = $this->dbConnect();\n $req = $db->prepare('SELECT id, title, DATE_FORMAT(creation_date, \"%d/%m/%Y\") AS creation_date_fr FROM chapters WHERE chapter_id > 0 ORDER BY chapter_id DESC ');\n $req->execute();\n $allChapters = $req->fetchAll();\n $req->closeCursor();\n return $allChapters;\n }",
"public function mostrarCarreras() {\r\n\t\t\t require \"conexion.php\";\r\n\t\t\t \r\n\t\t\t $conjunto = $this->mostrarConjunto();\r\n\t\t\t \r\n\t\t\t $query = \"SELECT DISTINCT m.carrera, c.nombre, m.plan\r\n\t\t\t\t\t\tFROM materia AS m\r\n\t\t\t\t\t\tLEFT JOIN carrera AS c ON c.id = m.carrera\r\n\t\t\t\t\t\tWHERE m.cod IN {$conjunto}\r\n\t\t\t\t\t\tORDER BY m.plan DESC;\";\r\n\t\t\t\r\n\t\t\t$result = $mysqli->query($query);\r\n\t\t\t$carreras = array();\r\n\t\t\twhile ($row = $result->fetch_array(MYSQLI_ASSOC)) {\r\n\t\t\t\t$carreras[] = $row['nombre'] . \" (plan \" . $row['plan'] .\")\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$result->free();\r\n\t\t\t$mysqli->close();\r\n\t\t\t\r\n\t\t\treturn $carreras;\r\n\t\t}",
"public function listarcajas() {\r\n //mismo proceso que para listar estanterias\r\n\r\n global $conexion;\r\n $listarcajas=array();\r\n $sql=\"SELECT * FROM caja\";\r\n $resultado=$conexion->query($sql);\r\n if($resultado->num_rows>0){\r\n $dimension=$resultado->num_rows;\r\n \r\n for($i=0;$i<$dimension;$i++) {\r\n $fila[]=$resultado->fetch_array(); \r\n $listarcajas[]=new caja($fila[$i]['codigo'], $fila[$i][\"color\"], $fila[$i][\"altura\"], $fila[$i][\"anchura\"], $fila[$i][\"profundidad\"],$fila[$i][\"material\"],$fila[$i][\"contenido\"],$fila[$i][\"fecha_alta\"]);\r\n }\r\n return $listarcajas;\r\n }\r\n }",
"public function allChapters()\n {\n $chapters = $this->_chapterDAO->getChapters();\n return $this->_view->render(\n 'allChapters', \n ['chapters' => $chapters], \n \"Les chapitres\"\n );//Generate view with dynamics datas\n }",
"public function listDahdiChannels(){\n\t\t$sql = \"SELECT * FROM dahdichandids ORDER BY channel\";\n\t\t$stmt = $this->database->prepare($sql);\n\t\t$stmt->execute();\n\t\t$results = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\t\treturn $results;\n\t}",
"public function listarClasificaciones(){\n $sql = \"SELECT * FROM clasificacion\";\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }",
"function cargarCarreras() {\r\n\t$carreras = consulta(\"SELECT ID_CARRERA, CARRERA_NOMBRE FROM CARRERAS\");\r\n\tforeach($carreras as $registro=>$campo) {\r\n\t\techo \"<li role='presentation'><a role='menuitem' tabindex='-1' href='clases.php?idcarrera=\".$campo['ID_CARRERA'].\"'>\".$campo['CARRERA_NOMBRE'].\"</a></li>\";\r\n\t}\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a group of emails from the mail queue. Allows a batch of emails to be released every 5 to 10 seconds (based on per period limits) If batch size is not set, will determine a size such that it sends in 1/2 the period (buffer) | function reduceMailQueue($batch_size = false, $override_limit = false, $force_send = false)
{
global $modSettings, $webmaster_email, $scripturl;
// Do we have another script to send out the queue?
if (!empty($modSettings['mail_queue_use_cron']) && empty($force_send))
{
return false;
}
// How many emails can we send each time we are called in a period
if (!$batch_size)
{
// Batch size has been set in the ACP, use it
if (!empty($modSettings['mail_batch_size']))
{
$batch_size = $modSettings['mail_batch_size'];
}
// No per period setting or batch size, set to send 5 every 5 seconds, or 60 per minute
elseif (empty($modSettings['mail_period_limit']))
{
$batch_size = 5;
}
// A per period limit but no defined batch size, set a batch size
else
{
// Based on the number of times we will potentially be called each minute
$delay = !empty($modSettings['mail_queue_delay']) ? $modSettings['mail_queue_delay'] : (!empty($modSettings['mail_period_limit']) && $modSettings['mail_period_limit'] <= 5 ? 10 : 5);
$batch_size = ceil($modSettings['mail_period_limit'] / ceil(60 / $delay));
$batch_size = ($batch_size == 1 && $modSettings['mail_period_limit'] > 1) ? 2 : $batch_size;
}
}
// If we came with a timestamp, and that doesn't match the next event, then someone else has beaten us.
if (isset($_GET['ts']) && $_GET['ts'] != $modSettings['mail_next_send'] && empty($force_send))
{
return false;
}
// Prepare to send each email, and log that for future proof.
require_once(SUBSDIR . '/Maillist.subs.php');
// Set the delay for the next sending
$delay = 0;
if (!$override_limit)
{
// Update next send time for our mail queue, if there was something to update. Otherwise bail out :P
$delay = updateNextSendTime();
if ($delay === false)
{
return false;
}
$modSettings['mail_next_send'] = time() + $delay;
}
// If we're not overriding, do we have quota left in this mail period limit?
if (!$override_limit && !empty($modSettings['mail_period_limit']))
{
// See if we have quota left to send another batch_size this minute or if we have to wait
list ($mail_time, $mail_number) = isset($modSettings['mail_recent']) ? explode('|', $modSettings['mail_recent']) : array(0, 0);
// Nothing worth noting...
if (empty($mail_number) || $mail_time < time() - 60)
{
$mail_time = time();
$mail_number = $batch_size;
}
// Otherwise we may still have quota to send a few more?
elseif ($mail_number < $modSettings['mail_period_limit'])
{
// If this is likely one of the last cycles for this period, then send any remaining quota
if (($mail_time - (time() - 60)) < $delay * 2)
{
$batch_size = $modSettings['mail_period_limit'] - $mail_number;
}
// Some batch sizes may need to be adjusted to fit as we approach the end
elseif ($mail_number + $batch_size > $modSettings['mail_period_limit'])
{
$batch_size = $modSettings['mail_period_limit'] - $mail_number;
}
$mail_number += $batch_size;
}
// No more I'm afraid, return!
else
{
return false;
}
// Reflect that we're about to send some, do it now to be safe.
updateSettings(array('mail_recent' => $mail_time . '|' . $mail_number));
}
// Now we know how many we're sending, let's send them.
list ($ids, $emails) = emailsInfo($batch_size);
// Delete, delete, delete!!!
if (!empty($ids))
{
deleteMailQueueItems($ids);
}
// Don't believe we have any left after this batch?
if (count($ids) < $batch_size)
{
resetNextSendTime();
}
if (empty($ids))
{
return false;
}
// We have some to send, lets send them!
$sent = array();
$failed_emails = array();
// Use sendmail or SMTP
$use_sendmail = empty($modSettings['mail_type']) || $modSettings['smtp_host'] == '';
// Line breaks need to be \r\n only in windows or for SMTP.
$line_break = detectServer()->is('windows') || !$use_sendmail ? "\r\n" : "\n";
foreach ($emails as $key => $email)
{
// So that we have it, just in case it's really needed - see #2245
$email['body_fail'] = $email['body'];
if ($email['message_id'] !== null && isset($email['message_id'][0]) && in_array($email['message_id'][0], array('m', 'p', 't')))
{
$email['message_type'] = $email['message_id'][0];
$email['message_id'] = substr($email['message_id'], 1);
}
else
{
$email['message_type'] = 'm';
}
// Use the right mail resource
if ($use_sendmail)
{
$email['subject'] = strtr($email['subject'], array("\r" => '', "\n" => ''));
$email['body_fail'] = $email['body'];
if (!empty($modSettings['mail_strip_carriage']))
{
$email['body'] = strtr($email['body'], array("\r" => ''));
$email['headers'] = strtr($email['headers'], array("\r" => ''));
}
// See the assignment 10 lines before this and #2245 - repeated here for the strtr
$email['body_fail'] = $email['body'];
$need_break = substr($email['headers'], -1) === "\n" || substr($email['headers'], -1) === "\r" ? false : true;
// Create our unique reply to email header if this message needs one
$unq_id = '';
$unq_head = '';
$unq_head_array = array();
if (!empty($modSettings['maillist_enabled']) && $email['message_id'] !== null && strpos($email['headers'], 'List-Id: <') !== false)
{
$unq_head_array[0] = md5($scripturl . microtime() . rand());
$unq_head_array[1] = $email['message_type'];
$unq_head_array[2] = $email['message_id'];
$unq_head = $unq_head_array[0] . '-' . $unq_head_array[1] . $unq_head_array[2];
$unq_id = ($need_break ? $line_break : '') . 'Message-ID: <' . $unq_head . strstr(empty($modSettings['maillist_mail_from']) ? $webmaster_email : $modSettings['maillist_mail_from'], '@') . '>';
$email['body'] = mail_insert_key($email['body'], $unq_head, $line_break);
}
elseif ($email['message_id'] !== null && empty($modSettings['mail_no_message_id']))
{
$unq_id = ($need_break ? $line_break : '') . 'Message-ID: <' . md5($scripturl . microtime()) . '-' . $email['message_id'] . strstr(empty($modSettings['maillist_mail_from']) ? $webmaster_email : $modSettings['maillist_mail_from'], '@') . '>';
}
// No point logging a specific error here, as we have no language. PHP error is helpful anyway...
$result = mail(strtr($email['to'], array("\r" => '', "\n" => '')), $email['subject'], $email['body'], $email['headers'] . $unq_id);
// If it sent, keep a record so we can save it in our allowed to reply log
if (!empty($unq_head) && $result)
{
$sent[] = array_merge($unq_head_array, array(time(), $email['to']));
}
// Track total emails sent
if ($result && !empty($modSettings['trackStats']))
{
trackStats(array('email' => '+'));
}
// Try to stop a timeout, this would be bad...
detectServer()->setTimeLimit(300);
}
else
{
$result = smtp_mail(array($email['to']), $email['subject'], $email['body'], $email['headers'], $email['priority'], $email['message_type'] . $email['message_id']);
}
// Hopefully it sent?
if (!$result)
{
$failed_emails[] = array(time(), $email['to'], $email['body_fail'], $email['subject'], $email['headers'], $email['send_html'], $email['priority'], $email['private'], $email['message_id']);
}
}
// Clear out the stat cache.
trackStats();
// Log each of the sent emails.
if (!empty($sent))
{
log_email($sent);
}
// Any emails that didn't send?
if (!empty($failed_emails))
{
// If it failed, add it back to the queue
updateFailedQueue($failed_emails);
return false;
}
// We were able to send the email, clear our failed attempts.
elseif (!empty($modSettings['mail_failed_attempts']))
{
updateSuccessQueue();
}
// Had something to send...
return true;
} | [
"public static function send_batch_emails() {\n global $wpdb;\n\n /* Get results for singular email id */\n $query = \"select * from \". self::$table_name .\" WHERE `status` != 'processed' && `type` = 'batch' && email_id = email_id order by email_id ASC LIMIT \" .self::$send_limit;\n self::$results = $wpdb->get_results( $query );\n\n if (!self::$results) {\n return;\n }\n\n /* get first row of result set for determining email_id */\n self::$row = self::$results[0];\n\n /* Get email title */\n self::$email['email_title'] = get_the_title( self::$row->email_id );\n\n /* Get email settings if they have not been loaded yet */\n self::$email_settings = Inbound_Email_Meta::get_settings( self::$row->email_id );\n\n /* Build array of html content for variations */\n self::get_templates();\n\n /* Get tags for this email */\n self::get_tags();\n\n /* Make sure we send emails as html */\n self::toggle_email_type();\n\n /* load dom parser class object */\n self::toggle_dom_parser();\n\n $send_count = 1;\n foreach( self::$results as $row ) {\n\n self::$row = $row;\n\n /* make sure not to try and send more than wp can handle */\n if ( $send_count > self::$send_limit ){\n return;\n }\n\n self::get_email();\n\n /* send email */\n if (!self::$email['send_address']) {\n self::delete_from_queue();\n continue;\n }\n\n\n switch (self::$email_service) {\n case \"mandrill\":\n Inbound_Mailer_Mandrill::send_email();\n break;\n case \"sparkpost\":\n Inbound_Mailer_SparkPost::send_email();\n break;\n }\n\n /* check response for errors */\n self::check_response();\n\n /* if error in batch then bail on processing job */\n if (self::$error_mode) {\n return;\n }\n\n self::delete_from_queue();\n\n $send_count++;\n }\n\n /* mark batch email as sent if no more emails with this email id exists */\n $count = $wpdb->get_var( \"SELECT COUNT(*) FROM \". self::$table_name .\" where email_id = '\". self::$row->email_id .\"'\");\n if ($count<1) {\n self::mark_email_sent();\n }\n }",
"public function sendBatch()\n {\n foreach ($this->queuedNotifications as $queuedNotification) {\n if ($queuedNotification['toClients']) {\n $this->sendToClients(\n $queuedNotification['entity'],\n $queuedNotification['force'],\n $queuedNotification['changeSet'],\n $queuedNotification['HTTPMethod'],\n $queuedNotification['options']\n );\n } else {\n $this->sendToServer(\n $queuedNotification['entity'],\n $queuedNotification['force'],\n $queuedNotification['changeSet'],\n $queuedNotification['HTTPMethod'],\n $queuedNotification['options']\n );\n }\n }\n\n $this->batchManager->sendAll();\n $this->clear();\n }",
"private function batchEmail()\n\t{\n\t\t$crlf = \"\\r\\n\";\n\t\t$total = 0;\n\t\t$success = 0;\n\t\t\n\t\t$rawHeaders = array (\n\t\t\t\"From: Swedish Club of WA <mail@svenskaklubben.org.au>\",\n\t\t\t\"Reply-To: mail@svenskaklubben.org.au\",\n\t\t\t\"MIME-Version: 1.0\",\n\t\t\t\"Content-Type: text/html; charset=iso-8859-1\"\n\t\t);\n\t\t$headers = implode($crlf, $rawHeaders);\n\t\t\n\t\tforeach($this->emailList as $record)\n\t\t{\n\t\t\tif (!empty($record->emailAddress) && mail($record->emailAddress, $this->emailSubject, $this->emailContent, $headers))\n\t\t\t\t$success++;\n\t\t\telse if (!empty($record->alternateEmail) && mail($record->alternateEmail, $this->emailSubject, $this->emailContent, $headers))\n\t\t\t\t$success++;\n\t\t\t$total++;\n\t\t}\n\t}",
"public function batch($id)\n\t{\n\t\tee()->load->library('email');\n\n\t\tif (ee()->config->item('email_batchmode') != 'y')\n\t\t{\n\t\t\tshow_error(lang('batchmode_disabled'));\n\t\t}\n\n\t\tif ( ! ctype_digit($id))\n\t\t{\n\t\t\tshow_error(lang('problem_with_id'));\n\t\t}\n\n\t\t$email = ee('Model')->get('EmailCache', $id)->first();\n\n\t\tif (is_null($email))\n\t\t{\n\t\t\tshow_error(lang('cache_data_missing'));\n\t\t}\n\n\t\t$start = $email->total_sent;\n\n\t\t$this->deliverManyEmails($email);\n\n\t\tif ($email->total_sent == count($email->recipient_array))\n\t\t{\n\t\t\t$debug_msg = ee()->email->print_debugger(array());\n\n\t\t\t$this->deleteAttachments($email); // Remove attachments now\n\n\t\t\tee()->view->set_message('success', lang('total_emails_sent') . ' ' . $email->total_sent, $debug_msg, TRUE);\n\t\t\tee()->functions->redirect(ee('CP/URL')->make('utilities/communicate'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$stats = str_replace(\"%x\", ($start + 1), lang('currently_sending_batch'));\n\t\t\t$stats = str_replace(\"%y\", ($email->total_sent), $stats);\n\n\t\t\t$message = $stats.BR.BR.lang('emails_remaining').NBS.NBS.(count($email->recipient_array)-$email->total_sent);\n\n\t\t\tee()->view->set_refresh(ee('CP/URL')->make('utilities/communicate/batch/' . $email->cache_id)->compile(), 6, TRUE);\n\n\t\t\tee('CP/Alert')->makeStandard('batchmode')\n\t\t\t\t->asWarning()\n\t\t\t\t->withTitle($message)\n\t\t\t\t->addToBody(lang('batchmode_warning'))\n\t\t\t\t->defer();\n\n\t\t\tee()->functions->redirect(ee('CP/URL')->make('utilities/communicate'));\n\t\t}\n\t}",
"function send_queue() {\n $batchSize = variable_get('campaignion_logcrm_batch_size', 50);\n $items = QueueItem::claimOldest($batchSize);\n $client = Container::get()->loadService('campaignion_logcrm.client');\n\n foreach ($items as $item) {\n try {\n $client->sendEvent($item->event);\n $item->delete();\n }\n catch (HttpError $e) {\n $variables['%item_id'] = $item->id;\n \\watchdog_exception('campaignion_logcrm', $e, '%type: !message (item: %item_id)', $variables);\n }\n }\n}",
"public function processQueue() {\n $sendLimit = $this->modx->getOption('eletters.batchSize', '', 15);\n $delay = $this->modx->getOption('eletters.delay', '', 5);// delay in seconds between each send\n // 1. select all newsletters that are ready to be sent out \n $newsletters = $this->modx->getCollection('EletterNewsletters', array(\n 'status' => 'approved',\n 'add_date:<=' => date('Y-m-d H:i:a'),\n 'finish_date' => NULL// if there is an end date then it is complete\n ));\n if ( $this->config['debug'] ) {\n $this->modx->log(modX::LOG_LEVEL_ERROR,'Eletters->processQueue() - Run date: '.date('Y-m-d H:i:a'));\n }\n foreach ($newsletters as $newsletter ) {\n if ( $this->config['debug'] ) {\n $this->modx->log(modX::LOG_LEVEL_ERROR,'Eletters->processQueue() -> newsletter->sendList() for '.$newsletter->get('id').' newsletter');\n $newsletter->setDebug();\n }\n $sendLimit -= $newsletter->sendList($sendLimit, $delay);\n if ( $sendLimit <= 0 ) {\n break;\n }\n }\n return true;\n }",
"public function sendQueuedMessages()\n {\n // get lock\n if ($this->_getLock(self::SEND_MESSAGE_PROCESS_ID)) {\n //load queued message list\n $queuedMessages = Mage::getModel('dolist/dolistemt_message_queued')\n ->getCollection()\n ->setOrder('id', 'ASC');\n //prepare collection by template\n $messagesByTemplates = array();\n foreach ($queuedMessages as $message) {\n $messagesByTemplates[$message->getTemplateId()][] = $message;\n }\n \n foreach ($messagesByTemplates as $templateId => $templateMessages) {\n foreach($templateMessages as $message) {\n try {\n //prepare message\n $messageContent = unserialize($message->getSerializedMessage());\n // try to send message\n Mage::getSingleton('dolist/service')->callDolistEmtSendmail($messageContent, $templateId, $message->getStoreId());\n //remove from queue\n $message->delete();\n \n } catch (SoapFault $fault) {\n $queue = Mage::helper('dolist/queue');\n /// All temporary errors (including \"limit reached\") should be requeued\n if ($queue->isTemporaryError($fault)) {\n Mage::log($fault);\n $newQueuedMessage = clone $message;\n //remove from queue and re-queue it\n $message->delete();\n $newQueuedMessage->setId(null)->save();\n //else log & remove\n } else {\n $message->delete();\n Mage::helper('dolist/log')->logError($message, $fault, 'SendMessage');\n }\n //if the error is a \"limit reached\" break to the next template\n if ($queue->isLimitReachedError($fault)) {\n break;\n } \n }\n }\n }\n \n //release the lock\n $this->_releaseLock(self::SEND_MESSAGE_PROCESS_ID);\n }\n }",
"public function run_email_queue()\n {\n \n set_time_limit(0);\n $cycle_time = 0.25;//4 emails a second\n \n //100 emails every 5 minutes\n $emaillist = $this->system->pushnotification->pop_email_priority( 100 , True , $this->_shop['shop_id'] );\n \n if( empty($emaillist ) )\n die('[=] Email queue is empty');\n \n $sender_id = $this->contact['sms_sender_id'];\n \n echo '[=] Starting Email Queue at ' . date('r') . \"\\n\";\n echo \"[=] Found \". count($emaillist) . \" emails to send. \\n\";\n\n \n\n $shop_admin = $this->shop->user->get( $this->data['shop']['admin_id'] );\n $shop = $this->data['shop'];\n\n\t$set_reply_to = (!filter_var($shop['contact_email'], FILTER_VALIDATE_EMAIL) === false) ? $shop['contact_email'] : Null;\n\n foreach ($emaillist as $email) \n {\n if( $email['email'] == '*' or empty($email['email'] ) )\n {\n $email['email'] = $shop_admin['email'];\n }\n \n if(! $this->system->is_valid_email( $email['email'] ) )\n {\n echo \"[!] Target email is not valid\\n\"; \n continue;\n }\n echo '[+] Notification ID: ' . $email['notification_id'] . \"\\n\" ;\n echo '[+] Receipient: ' . $email['fullname'] . ' - ' . $email['email'] . '( '. count( $email['message'] )/1024 . ' Kbytes ) :: ' . \"\\n\" ;\n \n $this->email->clear();\n\n $this->email->to( $email['email'] );\n $this->email->from('no-reply@' . OS_DOMAIN , $shop['name'] );\n\t if( ! is_null($set_reply_to ) )\n\t\t$this->email->reply_to( $set_reply_to );\n\t\n $this->email->subject( $email['title'] );\n $this->email->message( $email['message'] );\n // You need to pass FALSE while sending in order for the email data\n // to not be cleared - if that happens, print_debugger() would have\n // nothing to output.\n if( ! $this->email->send(FALSE) )\n {\n echo \"[!] Failed to send email to receipient. \\n \";\n $email['status'] = 'failed';\n $email['is_sent'] = True;\n }\n else\n {\n echo \"[=] Sent email at \" . date('r') . \"\\n \";\n $email['status'] = 'sent'; \n $email['is_sent'] = True; \n }\n\n $email['log'] = $this->email->print_debugger();\n\n $this->system->pushnotification->update($email['notification_id'] , $email );\n sleep($cycle_time);\n }\n echo \"[-] Run email queue completed at \" . date('r') . \"\\n\";\n }",
"public function queueEmailsAction()\n {\n if (!isConsoleRequest()) {\n throw new \\Core\\Exception\\RuntimeException('Invalid access. Must be CLI request');\n }\n\n $cronAction = 'communication newsletters queueEmails';\n $cronjob = $this->getEntityRepository(CronJob::class)->findObjectByCronAction($cronAction);\n if (is_object($cronjob)) {\n $cronjob->startRunning();\n $this->getEntityManager()->flush($cronjob);\n }\n\n $this->_stackTrace = '';\n $success = true;\n $errorMsg = '';\n\n try {\n $this->_stackTrace.= sprintf('Started to queue newsletter email notifications') . PHP_EOL;\n\n $total = 0;\n $repo = $this->getNewsletterRepo();\n $newsletters = $repo->getQueuedNewslettersQuery(new \\DateTime('now'), 1)->iterate();\n foreach ($newsletters as $row) {\n $newsletter = $row[0];\n /* @var $newsletter Newsletter */\n\n// $newsletter->startProcessing();\n// $this->getEntityManager()->flush($newsletter);\n\n // Create main notification body\n $htmlBody = '';\n try {\n if ($newsletter->isTypeCustom()) {\n $htmlBody = $this->getNewsletterService()->bodyCustom($newsletter->getBody());\n } elseif ($newsletter->isTypeWeekly()) {\n $htmlBody = $this->getNewsletterService()->bodyArticles($newsletter->getSubject(), $newsletter->getArtilesIdsAsString());\n }\n } catch (\\Exception $ex) {\n// $newsletter->stopProcessing(false, 0, $ex->getMessage());\n// $this->getEntityManager()->flush($newsletter);\n }\n\n // Get receivers\n $receivers = [];\n $receiversType = isset($newsletter->getReceiverCriterias()['type']) ? $newsletter->getReceiverCriterias()['type'] : '';\n if ($receiversType === 'members') {\n $receivers = $this->getMemberService()->getNewsletterReceiversByCriterias(isset($newsletter->getReceiverCriterias()[$receiversType]) ? $newsletter->getReceiverCriterias()[$receiversType] : []);\n }\n echo '<pre>'.print_r($receivers,1).'</pre>';\n die();\n\n // Queue emails\n if ($htmlBody !== '') {\n $html = NewsletterContent::full($htmlBody);\n \n\n $notificationsCount = 0;\n \n $unsubscribeUrl = 'Lga32SG24sJ412';\n $placeholders = [ '{{ tpl_footer }}' => NewsletterContent::getFooter($unsubscribeUrl)];\n $memberEmailBody = strtr($html, $placeholders);\n //echo PHP_EOL . $memberEmailBody;\n //die();\n }\n\n $this->getEntityManager()->refresh($newsletter);\n if ($notificationsCount > 0) {\n $newsletter->stopProcessing(true, $notificationsCount);\n } else {\n $newsletter->stopProcessing(false, 0, 'No messages queued by newsletter criteria');\n }\n $this->getEntityManager()->flush($newsletter);\n\n ++$total;\n }\n\n $this->_stackTrace.= sprintf('%d newsletters processed', $total) . PHP_EOL;\n\n } catch (ORMInvalidArgumentException $exc) {\n $success = false;\n $errorMsg = (string)$exc;\n } catch (\\Exception $exc) {\n $success = false;\n $errorMsg = (string)$exc;\n }\n\n $cronjob = $this->getEntityRepository(CronJob::class)->findObjectByCronAction($cronAction);\n if (is_object($cronjob)) {\n $cronjob->stopRunning($this->_stackTrace, $success, $errorMsg);\n $this->getEntityManager()->flush();\n }\n\n echo $this->_stackTrace;\n }",
"function send(){\n\t\tglobal $database;\n\t\tglobal $mosConfig_mailfrom, $mosConfig_fromname;\n\t\t\n\t\t$sql = \"SELECT * FROM #__$this->_tablename WHERE status='0' LIMIT 0 , $this->_maxburst\";\n\t\t$database->setQuery($sql);\n\t\t$rows = $database->loadObjectList();\n\t\t\n\t\tif($rows)\n\t\tforeach($rows as $row){\n\t\t\t$this->_mark_as_read();\t\t\t\n\t\t\tmosMail($mosConfig_mailfrom, $mosConfig_fromname, $row->email, $row-subject, $row->body); \n\t\t}\n\t\t\n\t\t# Purge data older than 7-days\n\t}",
"function bbp_chunk_emails($args = array())\n{\n}",
"public function sendAllFromQueue();",
"public function sendMail()\n {\n $mail_queue =& new Mail_Queue(\n $this->db_options,\n $this->mail_options\n );\n \n $mail_queue->sendMailsInQueue($this->max_PearMails);\n }",
"public function processEmailQueue() {\n\t\tScriptLockComponent::lock(__FUNCTION__);\n\t\t\n\t\t$emails = $this->Email->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t 'Email.status' => Email::STATUS_NOT_SEND,\n\t\t\t 'Email.instance_id' => ''\n\t\t\t),\n\t\t\t'recursive' => 1,\n\t\t\t'order' => array('Email.priority DESC'),\n\t\t\t'limit' => self::BATCH_LIMIT\n\t\t\t\t)\n\t\t);\t\t\n\t\t// creating new email object\n\t\t$cakeEmail = new CakeEmail();\n\n\t\t$date = new DateTime();\n\n\t\tforeach ($emails as $emailData) {\n\n\t\t\t$cakeEmail->reset();\n\n\t\t\t$priorityValue = intval($emailData[\"Email\"][\"priority\"]) + 1;\n\t\t\t//Getting email template from database\n\t\t\t$emailManagement = $this->EmailTemplate->getEmailTemplate($emailData[\"Email\"][\"email_template_id\"], json_decode($emailData[\"Email\"][\"content\"], TRUE));\n\t\t\t// setting email configurations, and sending email\n\t\t\t\n\t\t\t// setting unsubscribe url in the mail footer\n\t\t\t$templateId = $emailData[\"Email\"][\"email_template_id\"];\n\t\t\tif (in_array($templateId, $this->emailTemplateIds)) {\n\t\t\t\t$autoLoginToken = $this->Otp->createOTP(array(\n\t\t\t\t\t'email' => $emailData[\"Email\"][\"to_email\"]\n\t\t\t\t));\n\t\t\t\t$email = base64_encode($emailData[\"Email\"][\"to_email\"]);\n\t\t\t\t$unsubscribeUrl = Router::Url('/', TRUE) . 'unsubscribe?setting=' .$templateId. '&auto_login_token=' . $autoLoginToken .'&email=' . $email ;\n\t\t\t} else {\n\t\t\t\t$unsubscribeUrl = '';\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\t$cakeEmail->config('smtp')\n\t\t\t\t\t\t->template('default')\n\t\t\t\t\t\t->viewVars(array('unsubscribe' => $unsubscribeUrl ))\n\t\t\t\t\t\t->emailFormat('html')\n\t\t\t\t\t\t->to($emailData[\"Email\"][\"to_email\"])\n\t\t\t\t\t\t->subject($emailManagement['EmailTemplate']['template_subject'])\n\t\t\t\t\t\t->setHeaders(array('List-Unsubscribe' => $unsubscribeUrl))\n\t\t\t\t\t\t->send($emailManagement['EmailTemplate']['template_body']);\n\t\t\t\t$this->Email->set(array(\n\t\t\t\t\t'id' => $emailData[\"Email\"][\"id\"],\n\t\t\t\t\t'sent_date' => $date->format('Y-m-d h:i:s'),\n\t\t\t\t\t'status' => Email::STATUS_SEND\n\t\t\t\t));\n\t\t\t\t$this->Email->save();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->Email->set(array(\n\t\t\t\t\t'id' => $emailData[\"Email\"][\"id\"],\n\t\t\t\t\t'priority' => $priorityValue,\n\t\t\t\t\t'status' => Email::STATUS_NOT_SEND\n\t\t\t\t));\n\t\t\t\t$this->Email->save();\n\t\t\t}\n\t\t}\n\t\t$this->_moveMailsToHistory();\n\t}",
"function vals_soc_send_emails_cron($items) {\n // put them on the queue...\n $queue = DrupalQueue::get('vals_soc_cron_email');\n foreach ($items as $item) {\n $queue->createItem($item);\n }\n}",
"public function sendQueued()\n {\n $queuedEmailMessages = EmailMessage::getAllByFolderType(EmailFolder::TYPE_OUTBOX);\n foreach ($queuedEmailMessages as $emailMessage)\n {\n $this->sendImmediately($emailMessage);\n }\n $queuedEmailMessages = EmailMessage::getAllByFolderType(EmailFolder::TYPE_OUTBOX_ERROR);\n foreach ($queuedEmailMessages as $emailMessage)\n {\n if ($emailMessage->sendAttempts < 3)\n {\n $this->sendImmediately($emailMessage);\n }\n else\n {\n $this->processMessageAsFailure($emailMessage);\n }\n }\n return true;\n }",
"public function send_batch_emails( $emails ) {\n\n\t\t\t$args = array(\n\t\t\t\t\t'method' => 'POST',\n\t\t\t\t\t'timeout' => 45,\n\t\t\t\t\t'redirection' => 5,\n\t\t\t\t\t'httpversion' => '1.0',\n\t\t\t\t\t'blocking' => true,\n\t\t\t\t\t'body' => $emails,\n\t\t\t);\n\n\t\t\treturn $this->build_request( $args )->fetch( '/email/batch' );\n\n\t\t}",
"public function processNewsletterQueue() {\n\t\tScriptLockComponent::lock(__FUNCTION__);\n\t\t\n\t\t$emails = $this->Email->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t 'Email.status' => Email::STATUS_NOT_SEND,\n\t\t\t 'Email.instance_id !=' => ''\n\t\t\t),\n\t\t\t'recursive' => 1,\n\t\t\t'order' => array('Email.priority DESC'),\n\t\t\t'limit' => self::BATCH_LIMIT\n\t\t\t\t)\n\t\t);\t\t\n\n\t\t\n\t\t// creating new email object\n\t\t$cakeEmail = new CakeEmail();\n\n\t\t$date = new DateTime();\n\n\t\tforeach ($emails as $emailData) {\n\n\t\t\t$cakeEmail->reset();\n\n\t\t\t$priorityValue = intval($emailData[\"Email\"][\"priority\"]) + 1;\n\n\t\t\t$emailContent = json_decode($emailData[\"Email\"][\"content\"], TRUE);\n\n\t\t\t// setting email configurations, and sending email\n\t\t\ttry {\n\t\t\t\t$cakeEmail->config('smtp')\n//\t\t\t\t\t\t->template('default')\n\t\t\t\t\t\t->emailFormat('html')\n\t\t\t\t\t\t->to($emailData[\"Email\"][\"to_email\"])\n\t\t\t\t\t\t->subject($emailData[\"Email\"]['subject'])\n\t\t\t\t\t\t->send($emailContent[\"content\"]);\n\t\t\t\t$this->Email->set(array(\n\t\t\t\t\t'id' => $emailData[\"Email\"][\"id\"],\n\t\t\t\t\t'sent_date' => $date->format('Y-m-d h:i:s'),\n\t\t\t\t\t'status' => Email::STATUS_SEND\n\t\t\t\t));\n\t\t\t\t$this->Email->save();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->Email->set(array(\n\t\t\t\t\t'id' => $emailData[\"Email\"][\"id\"],\n\t\t\t\t\t'priority' => $priorityValue,\n\t\t\t\t\t'status' => Email::STATUS_NOT_SEND\n\t\t\t\t));\n\t\t\t\t$this->Email->save();\n\t\t\t}\n\t\t}\n\t\t$this->_moveMailsToHistory();\n\t}",
"private function sendDailyPubEmail()\n {\n foreach(Publisher::all() as $publisher) {\n $message = (new PublisherDaily($publisher->id))->onQueue('platform-processing');\n Mail::to($publisher->email,$publisher->name)->send($message);\n Log::info(\"Sent Daily Email To: \" . $publisher->email);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'deleteGs1128Template' | protected function deleteGs1128TemplateRequest($gs1128_template_id)
{
// verify the required parameter 'gs1128_template_id' is set
if ($gs1128_template_id === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $gs1128_template_id when calling deleteGs1128Template'
);
}
$resourcePath = '/beta/gs1128Template/{gs1128TemplateId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($gs1128_template_id !== null) {
$resourcePath = str_replace(
'{' . 'gs1128TemplateId' . '}',
ObjectSerializer::toPathValue($gs1128_template_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('API-Key');
if ($apiKey !== null) {
$headers['API-Key'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'DELETE',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"function delete_template($template_id)\n {\n $parameter_array = array();\n \n array_push($parameter_array, array(\n 'and',\n 'id',\n '=',\n $template_id\n ));\n \n parent::delete('i', $parameter_array);\n }",
"public function deleteById($templateId);",
"public function testDeleteGs1128TemplateFile()\n {\n }",
"protected function deleteGs1128TemplateFileRequest($gs1128_template_id, $file_id)\n {\n // verify the required parameter 'gs1128_template_id' is set\n if ($gs1128_template_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $gs1128_template_id when calling deleteGs1128TemplateFile'\n );\n }\n // verify the required parameter 'file_id' is set\n if ($file_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_id when calling deleteGs1128TemplateFile'\n );\n }\n\n $resourcePath = '/beta/gs1128Template/{gs1128TemplateId}/file/{fileId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($gs1128_template_id !== null) {\n $resourcePath = str_replace(\n '{' . 'gs1128TemplateId' . '}',\n ObjectSerializer::toPathValue($gs1128_template_id),\n $resourcePath\n );\n }\n // path params\n if ($file_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fileId' . '}',\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 $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deleteGs1128TemplateWithHttpInfo($gs1128_template_id)\n {\n $returnType = '';\n $request = $this->deleteGs1128TemplateRequest($gs1128_template_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function deleteTemplate()\n {\n $this->page->setTemplate('generic/json');\n $this->page->layout_template = 'contentonly.phtml';\n\n if (empty($this->vars['id'])) {\n $this->page->setStatus(400, 'Lacking id of template to delete');\n return;\n }\n\n if (!$this->model->deleteTemplate(intval($this->vars['id']))) {\n $this->page->setStatus(500, 'Failed to delete template');\n return;\n }\n }",
"public function delete()\n {\n $this->forge->deleteNginxTemplate($this->serverId, $this->id);\n }",
"public function delete_template(Template $template) {\n\t\tswitch(get_class($template)) {\n\t\tcase 'SOATemplate':\n\t\t\t$stmt = $this->database->prepare('DELETE FROM soa_template WHERE id = ?');\n\t\t\tbreak;\n\t\tcase 'NSTemplate':\n\t\t\t$stmt = $this->database->prepare('DELETE FROM ns_template WHERE id = ?');\n\t\t\tbreak;\n\t\t}\n\t\t$stmt->bindParam(1, $template->id, PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t}",
"public function delete($project, $instanceTemplate, $optParams = array())\n {\n $params = array('project' => $project, 'instanceTemplate' => $instanceTemplate);\n $params = array_merge($params, $optParams);\n return $this->call('delete', array($params), \"Forminator_Google_Service_Compute_Operation\");\n }",
"public function deleteTemplateRequest($template_id)\n {\n // verify the required parameter 'template_id' is set\n if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $template_id when calling deleteTemplate'\n );\n }\n\n $resourcePath = '/v1/email-template/{template_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($template_id !== null) {\n $resourcePath = str_replace(\n '{' . 'template_id' . '}',\n ObjectSerializer::toPathValue($template_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api_key');\n if ($apiKey !== null) {\n $queryParams['api_key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function zenci_digitalocean_template_remove_submit($form, &$form_state) {\n $template = $form_state['template'];\n db_delete('zenci_digitalocean_templates')\n ->condition('id', $template->id)\n ->execute();\n backdrop_set_message(t('Template deleted!'));\n backdrop_goto('admin/config/system/digitalocean/list');\n}",
"public function delete(int $hostTemplateId): void;",
"private function testtemplateDelete() {\n\n self::writeInfo(\"Testing templateDelete()...\");\n try {\n\n self::writeInfo(\"Sleeping for 3s to allow Nessus to do 'things'...\");\n sleep(3);\n\n // Do the call\n $test = $this->templateDelete($this->scheduled_scan_template_uuid);\n\n self::writeInfo(\n \"Paused scan \" . $this->running_scan_uuid\n . \". Nessus response was (name, policy_id, readableName, owner, target, rRules, startTime) (\"\n . $test['response']['name'] . \", \"\n . $test['response']['policy_id'] . \", \"\n . $test['response']['readableName'] . \", \"\n . $test['response']['owner'] . \", \"\n . $test['response']['target'] . \", \"\n . $test['response']['rRules'] . \", \"\n . $test['response']['startTime'] . \", \"\n . \")\"\n );\n\n self::writeOk(\"templateDelete() testing passed.\");\n $this->success_count++;\n\n } catch (\\Exception $e) {\n\n self::writeError(\"templateDelete() test failed. Error: \" . $e->getMessage());\n $this->failure_count++;\n }\n }",
"public function deleteMailTemplate(MailTemplate $mailTemplate);",
"function deleteTemplate($template_key) {\r\n\t\r\n\t\tglobal $CONN, $CONFIG;\r\n\t\t\r\n\t\t$CONN->Execute(\"DELETE FROM {$CONFIG['DB_PREFIX']}kb_templates WHERE template_key='$template_key'\");\r\n\t\t\r\n\t\t$CONN->Execute(\"DELETE FROM {$CONFIG['DB_PREFIX']}kb_module_template_links WHERE template_key='$template_key'\");\r\n\t\t\r\n\t\t$CONN->Execute(\"DELETE FROM {$CONFIG['DB_PREFIX']}kb_fields WHERE template_key='$template_key'\");\t\t\r\n\r\n\t\t$rs = $CONN->Execute(\"SELECT entry_key FROM {$CONFIG['DB_PREFIX']}kb_entries WHERE template_key='$template_key'\");\r\n\t\t\r\n\t\twhile (!$rs->EOF) {\r\n\t\t\t\r\n\t\t\t$entry_key = $rs->fields[0];\r\n\t\t\t$this->deleteEntry($entry_key);\r\n\t\t\t$rs->MoveNext();\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\t$rs->Close();\r\n\t\treturn true ;\r\n\t\t\r\n\t}",
"function culturefeed_templates_delete_form($form, &$form_state, $template) {\n\n $form['#template'] = $template;\n\n // Always provide entity id in the same form key as in the entity edit form.\n $form['template_id'] = array('#type' => 'value', '#value' => $template->id);\n\n return confirm_form($form,\n t('Are you sure you want to delete %title?', array('%title' => $template->name)),\n '',\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n\n}",
"public function delete_template($data){\n $this->db->where('id', $data);\n $this->db->delete('email_template');\n return true;\n }",
"public function actionRemoveTemplate()\n {\n \t$template_id = Yii::$app->request->post('template_id',0);\n \t$pricingtemp = PricingTemplates::findOne($template_id);\n\n \tif(!empty($pricingtemp)){\n \t\t$pricingtempid = $pricingtemp->id;\n\t \t$template_type = $pricingtemp->template_type;\n\t \t$client_id = $pricingtemp->client_id;\n\t \t$client_case_id = $pricingtemp->client_case_id;\n\t \t$pricingtempids = PricingTemplatesIds::find()->select(['pricing_id'])->where(['template_id'=>$pricingtempid]);\n\t \tif($pricingtempids->count() > 0){\n \t\t\tif($template_type==1){\n\t \t\t\t$pricingclients = PricingClients::find()->select(['id'])->where(['in','pricing_id',$pricingtempids])->andWhere(['client_id'=>$client_id]);\n\t \t\t\tPricingClientsRates::deleteAll(['in', 'pricing_clients_id', $pricingclients]);\n\t \t\t\tPricingClients::deleteAll(['and','client_id=:client_id',['in','pricing_id',$pricingtempids]],[':client_id'=>$client_id]);\n\t \t\t}\n\t \t\tif($template_type==2) {\n\t\t \t\tif($pricingtempids->count() > 0){\n\t\t \t\t\t$pricingclientscases = PricingClientscases::find()->select(['id'])->where(['in','pricing_id',$pricingtempids])->andWhere(['client_case_id'=>$client_case_id]);\n\t\t \t\t\tPricingClientscasesRates::deleteAll(['in', 'pricing_clientscases_id', $pricingclientscases]);\n\t\t \t\t\tPricingClientscases::deleteAll(['and','client_case_id=:client_case_id',['in','pricing_id',$pricingtempids]],[':client_case_id'=>$client_case_id]);\n\t\t \t\t}\n\t \t\t}\n\t \t\tPricingTemplatesIds::deleteAll(['template_id'=>$pricingtempid]);\n\t \t}\n\t \t$pricingtemp->delete();\n \t\treturn \"OK\";\n \t} else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function deleteTemplateNoDb(ServerTemplate $template)\n {\n $cmd = \"DeleteTemplate -i \". $template->getId();\n $this->runCMD($cmd);\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the user can create jobs. | public function create(User $user)
{
return $user->can('create-sub-job');
} | [
"function canCreateUsers(){\n\n $create = FALSE;\n\n if(isset($_SESSION['user']['permissions']) && in_array('CREATE_USERS',\n $_SESSION['user']['permissions']))\n $create = TRUE;\n\n return $create;\n\n }",
"public function canCreate()\n {\n return $this->permission('create');\n }",
"public function isUserCreationAllowed()\n {\n return $this->allowUserCreation;\n }",
"public function canCreate()\n {\n return $this->securityContext->isGranted($this->createRole);\n }",
"public function isAccountCreationAllowed()\n {\n if ($this->configModel->get('gitlab_account_creation', 0) == 1) {\n return true;\n }\n\n return false;\n }",
"static function canCreate() {\n return (Session::haveRight('document', CREATE)\n || Session::haveRight('followup', ITILFollowup::ADDMYTICKET));\n }",
"public function hasAccessCreate() : bool\n {\n return (user() and user()->hasAccess(strtolower($this->moduleName), PERM_CREATE));\n }",
"final protected function CanCreateIn()\n {\n return $this->AllowChildren() && \n BackendModule::Guard()->Allow(BackendAction::Create(), $this->content);\n }",
"public function user_can_post() {\n\t\treturn rcp_is_active() && ! $this->is_at_jobs_limit();\n\t}",
"public function create()\n {\n // Everybody can create projects\n return true;\n }",
"public function create(User $user)\n {\n return $user->can('create-meeting');\n }",
"public function isUserAssignable(): bool;",
"public function create(User $user)\n {\n return $user->permissions()->whereSlug('can_create_skill')->exists();\n }",
"public function create(User $user)\n {\n return $user->hasPermissionTo('create usermeetingrooms');\n }",
"public function create(User $user): bool\n {\n // Any manager can create a new Assessment, but only for criteria they own.\n return $user->isManager();\n }",
"public function create()\n {\n return \\Auth::user()->hasRight('create-tempo');\n }",
"public function isAllowedToReview() {\n return $this->isTranscribeJob() ||\n $this->isConformJob() ||\n $this->isTimingJob() ||\n $this->isStandaloneQa() ||\n $this->isStandaloneAcceptance();\n }",
"protected function checkPermission()\n\t\t{\n\t\t\t// no anonymous team creation\n\t\t\t// user must have allow_create_teams permission\n\t\t\t// user must be teamless\n\t\t\treturn \\user::getCurrentUserLoggedIn() &&\n\t\t\t\t \\user::getCurrentUser()->getPermission('allow_create_teams') &&\n\t\t\t\t \\user::getCurrentUser()->getIsTeamless();\n\t\t}",
"protected function CanCreate()\n {\n return self::Guard()->Allow(BackendAction::Create(), new Container())\n && self::Guard()->Allow(BackendAction::UseIt(), new ContainerForm());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get or set e | public function e($e = null)
{
if(null === $e)
{
return $this->property('e');
}
return $this->property('e', (int) $e);
} | [
"public function _setEia($eia) {\n\t\t$this->_eia = $eia;\n\t}",
"public function get_eau()\n {\n return $this->_eau;\n }",
"public function _getEia() {\n\t\treturn $this->_eia;\n\t}",
"private static function _get_EE()\n\t{\n\t\treturn get_instance();\n\t}",
"function set_next ($e)\n {\n if (is_string ($e))\n $e = new event ($e);\n if (!is_a ($e, 'event'))\n die_traced ('event::set_next(): Argument is not an event object.');\n $this->next = $e;\n return $e;\n }",
"public function getEdgeElem($e);",
"public function setETag($eTag)\n {\n $this->eTag = $eTag;\n }",
"public static function setValidationError($e);",
"function set_caller ($e)\n {\n type ($e, 'event');\n\n # Call subsession function.\n $c = new event ('__call_sub', array ('caller' => $e));\n $t = $this;\n $c->set_next ($t);\n return $e;\n }",
"public function getAEmettre() {\n return $this->aEmettre;\n }",
"public function setException(\\Exception $e) {\n $this->exception = $e;\n }",
"public function setETag(string $eTag)\n {\n $this->eTag = $eTag;\n\n return $this;\n }",
"public function getEvent() : ?string \n {\n if ( ! $this->hasEvent()) {\n $this->setEvent($this->getDefaultEvent());\n }\n return $this->event;\n }",
"public function getEtunimi(){\n return $this->etunimi;\n }",
"public function getDistanciaEje() {\r\n\t\treturn $this->eje;\r\n\t}",
"public function setEbs($value) \n {\n $this->_fields['Ebs']['FieldValue'] = $value;\n return;\n }",
"public function getEcheck(): Model\\EcheckSetting\n {\n return $this->echeck;\n }",
"public function setSelectedEntry(MenuEntry $e) {\n\n\t\t$this->selectedEntry = $e;\n\t\treturn $this;\n\n\t}",
"public function getETag()\n {\n return $this->eTag;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Total number of Pending Service Provider requests on the system | public function pendingRequests(){
$pendingServiceProviders = Service_Provider::where('status', '0')->count();
if (!$pendingServiceProviders){
$res['status'] = false;
$res['message'] = 'No pending Requests found';
return response()->json($res, 404);
}else {
$res['status'] = true;
$res['message'] = 'Total Number of Pending Service providers ';
$res['Service Providers'] = $pendingServiceProviders;
return response()->json($res, 200);
}
} | [
"public function countRequests()\n {\n // Spawn a query and find unapproved accounts\n $query = $this->parent->db->query();\n $query->select('`id`', 'bf_users')\n ->where('`requires_review` = 1')\n ->execute();\n \n // Return the total\n return $query->count;\n }",
"function getTotalPending() {\n\t\treturn $this->getOption(self::STAT_TOTAL_PENDING, 0);\n\t}",
"public function getTotalRequests()\n {\n return $this->getSuccessfulRequests() + $this->getFailedRequests();\n }",
"public function getRequestsCount()\n {\n return $this->count(self::REQUESTS);\n }",
"public function getTotalSupplyRequests() {\n\t\t$query = $this->db->query(\"SELECT COUNT(*) AS total FROM \" . DB_PREFIX . \"wkpos_supplier_request\");\n\n\t\treturn $query->row['total'];\n\t}",
"private function requests_fetch_num () {\n \treturn $this->count_database_objects (\"requests\", \"processed\", 0);\n\t}",
"public function count()\n\t{\n\t\treturn count($this->requests);\n\t}",
"public function getRequestCount() {\n $this->load->helper('globals');\n if (!isAJAX() || ($organization_id = $this->organization->getOrganization()) === FALSE)\n return;\n echo count($this->waiter_model->getWaiter($organization_id));\n }",
"function getPendingRequestsAndReceivedReferencesCountAction()\n {\n \techo Zend_Json::encode( \\Extended\\reference_request::countReceivedReferenceAndPendingRequests(Auth_UserAdapter::getIdentity()->getId()) );\n \tdie;\n }",
"public function num_of_buying_req()\n {\n $condition = array('is_deleted'=>0);\n $num_buying_req = $this->db->where($condition)->count_all_results(\"device_buy_requests\");\n if ($num_buying_req) { return $num_buying_req; }\n else {\n return 0;\n }\n }",
"function _GetAPIRequestsCount()\n{\n\tglobal $IP, $CONFIG, $DBOBJ;\n\t\n\t$Status = $DBOBJ->GetStatus();\n\tif ($Status === true)\n\t{\t\t\n\t\t$SQL = 'SELECT COUNT(*) as \"total\" FROM `'.$CONFIG['LOG_DB'].'`.`'.$CONFIG['LogTable'].'` WHERE (`IP` = \"'.$IP.'\" AND `TimeStamp` > \"'.date('Y-m-d H:i:s',time()-(60*60)).'\") ;';\n\t\t$DBOBJ->Query($SQL);\n\t\t$Status = $DBOBJ->GetStatus();\n\t\tif ($Status === true){\n\t\t\t$Results = $DBOBJ->GetResults();\n\t\t\treturn (int)$Results[0]['total'];\n\t\t}\n\t\telse{ return $Status; }\n\t}\n\telse { return $Status; }\n}",
"private function getNumberOfRequests()\n {\n return $this->configuration['requests'];\n }",
"public function getTotalCalls()\n {\n $totalCalls = 0;\n foreach ($this->data['requests'] as $services) {\n $totalCalls += $services['calls'];\n }\n\n return $totalCalls;\n }",
"public function countInactiveServices(): int\n {\n return count($this->getInactiveServices());\n }",
"public function getPendingqueryCount() //for all assigned quires\n\t\t{\n\t\t\t\n\t\t\t\t$this->load->model('admin/Users_model', 'users');\n\t\t\t\t$data['queryCount'] = $this->users->getQueryPendingCount();\n\t\t\t\techo $data['queryCount'];\n\t\t\t\n\t\t}",
"public function getTotalCalls() {\n\t\treturn self::$wsCalls;\n\t}",
"public function num_of_selling_req()\n {\n $condition = array('is_deleted'=>0);\n $num_selling_req = $this->db->where($condition)->count_all_results(\"device_sell_requests\");\n if ($num_selling_req) { return $num_selling_req; }\n else {\n return 0;\n }\n }",
"public function getPendingCount()\n {\n return $this->pending_count;\n }",
"public function getRequestCount(): int;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Output image gallery using Instagram photos | private function output_gallery( $atts ) {
$data = self::get_data( $atts['username'] );
$loop = 0;
$content = '';
foreach( $data->medias as $photo ) {
$caption = esc_attr( preg_replace( '/\s#\w+/', '', $photo->caption ) );
$src = $photo->thumbnails[3]->src;
$content .= "<a href='{$photo->displaySrc}' title='{$caption}'>
<img src='{$src}'>
</a>";
$loop++;
if( $loop >= $atts['items'] ) { break; }
}
echo "<div class='h-instafeed-gallery' data-count='{$atts['items']}'>
{$content}
</div>";
} | [
"public function instagram_galleries() {\n require_once(BWG()->plugin_dir . '/framework/WDWLibraryEmbed.php');\n /* Array of IDs of instagram galleries.*/\n $response = array();\n $instagram_galleries = WDWLibraryEmbed::check_instagram_galleries();\n if ( !empty($instagram_galleries[0]) ) {\n foreach ( $instagram_galleries as $gallery ) {\n array_push($response, WDWLibraryEmbed::refresh_social_gallery($gallery));\n }\n }\n }",
"function display_image_gallery($image_array, $directory) {\n foreach ($image_array as $image) {\n $out = '<div>';\n $out .= '<a href=\"#\">';\n $out .= '<img src=\"' . $directory.$image . '\" data-jslghtbx>';\n $out .= '</a>';\n $out .= '</div>';\n echo $out;\n }\n }",
"function getFlickrInstagramPhotos(){\n \t$f = new phpFlickr(FLICKR_API_KEY,FLICKR_SECRET);\n\n\t$photos = $f->photos_search (array(\n 'user_id'=>FLICKR_USER,\n 'machine_tags'=>'uploaded:by=instagram',\n 'extras'=>'url_o'\n ));\n\n\treturn $photos;\n}",
"private function displayImages() {\n\t\tglobal $settings;\n\n\t\techo '<ul class=\"' . $settings['display_mode'] . '\">';\n\t\tforeach ($this->images as $file) {\n\t\t\techo '<li>';\n\t\t\techo '<a href=\"' . $file . '\" rel=\"lightbox[' . $this->getFolder() . ']\">';\n\t\t\techo '<img src=\"' . $file . '\" />';\n\t\t\techo '</a>';\n\t\t\techo '</li>';\n\t\t}\t\t\n\t\techo '</ul>';\n\t}",
"private function get_instagram_photos(){\n\n if($this->get_request_method() != \"POST\"){\n $this->response('',406);\n }\n $r = json_decode(file_get_contents(\"php://input\"),true);\n //$r = $r['name'];\n $response = array();\n $db = new DbHandler();\n $session = $db->getSession();\n\n if(isset($r['uid']) && $r['uid']=='session_id'){\n $uid = $session['uid'];\n }else{\n $uid = $r['uid'];\n }\n $response['uid'] = $uid;\n $sql = \"SELECT instagram_username, instagram_userid FROM users WHERE uid = $uid\"; // WHERE username LIKE '%\".$r.\"%'\n $in = $db->getRecords($sql);\n\n /*--Instagra Photos Start---*/\n\n if(isset($in[0]['instagram_userid']) && $in[0]['instagram_userid']!=0 && $in[0]['instagram_username']!=''){\n $instagramDetails = $db->getInstagramDetails();\n //$url = 'https://api.instagram.com/v1/users/search?q='.$instagram_username.'&client_id='.$instagramDetails['instagram_client_id'];\n $url = 'https://api.instagram.com/v1/users/'.$response[0]['instagram_userid'].'/media/recent/?access_token='.$instagramDetails['instagram_access_token'];\n $instagram= $db->processInstagramURL($url);\n //$response['id'] = $instagram;\n $instagram_json = json_decode($instagram, true);\n $instagram_photos = [];\n $response['data'] = $instagram_json;\n foreach($instagram_json['data'] as $item){\n $thumb_link = $item['images']['low_resolution']['url'];\n $large_link = $item['images']['standard_resolution']['url'];\n $instagram_photos[] = array('thumb' => $thumb_link, 'url'=>$large_link );\n }\n $response = $instagram_photos;\n }\n\n /*--Instagra Photos End---*/\n\n if ($response != NULL) {\n $this->response($this->json($response), 200); // send user details\n }\n\n }",
"function ciniki_web_processGalleryImage(&$ciniki, $settings, $tnid, $args) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'processURL');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'processContent');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'getScaledImageURL');\n\n $content = '';\n $quality = 60;\n if( isset($block['quality']) && $block['quality'] == 'high' ) {\n $quality = 90;\n }\n $height = 600;\n if( isset($block['size']) && $block['size'] == 'large' ) {\n $height = 1200;\n }\n if( isset($settings['default-image-height']) && $settings['default-image-height'] > $height ) {\n $height = $settings['default-image-height'];\n }\n\n if( !isset($args['item']['images']) || count($args['item']['images']) < 1 ) {\n return array('stat'=>'404', 'err'=>array('code'=>'ciniki.web.121', 'msg'=>\"I'm sorry, but we don't seem to have the image your requested.\"));\n }\n\n $first = NULL;\n $last = NULL;\n $img = NULL;\n $next = NULL;\n $prev = NULL;\n foreach($args['item']['images'] as $iid => $image) {\n if( $first == NULL ) {\n $first = $image;\n }\n if( $image['permalink'] == $args['image_permalink'] ) {\n $img = $image;\n } elseif( $next == NULL && $img != NULL ) {\n $next = $image;\n } elseif( $img == NULL ) {\n $prev = $image;\n }\n $last = $image;\n }\n\n if( count($args['item']['images']) == 1 ) {\n $prev = NULL;\n $next = NULL;\n } elseif( $prev == NULL ) {\n // The requested image was the first in the list, set previous to last\n $prev = $last;\n } elseif( $next == NULL ) {\n // The requested image was the last in the list, set previous to last\n $next = $first;\n }\n\n if( $img == NULL ) {\n return array('stat'=>'404', 'err'=>array('code'=>'ciniki.web.122', 'msg'=>\"I'm sorry, but we don't seem to have the image your requested.\"));\n }\n\n if( $img['title'] != '' ) {\n $args['article_title'] .= ' - ' . $img['title'];\n }\n\n //\n // Load the image\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'getScaledImageURL');\n $rc = ciniki_web_getScaledImageURL($ciniki, $img['image_id'], 'original', 0, $height, $quality);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $img_url = $rc['url'];\n\n // Setup the og image\n $ciniki['response']['head']['og']['image'] = $rc['domain_url'];\n\n //\n // Set the page to wide if possible\n //\n $ciniki['request']['page-container-class'] = 'page-container-wide';\n\n $svg_prev = '';\n $svg_next = '';\n if( isset($settings['site-layout']) && $settings['site-layout'] == 'twentyone' ) {\n $ciniki['request']['inline_javascript'] = '';\n $ciniki['request']['onresize'] = \"\";\n $ciniki['request']['onload'] = \"\";\n $svg_prev = '<svg viewbox=\"0 0 80 80\" stroke=\"#fff\" fill=\"none\"><polyline stroke-width=\"5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" points=\"50,70 20,40 50,10\"></polyline></svg>';\n $svg_next = '<svg viewbox=\"0 0 80 80\" stroke=\"#fff\" fill=\"none\"><polyline stroke-width=\"5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" points=\"30,70 60,40 30,10\"></polyline></svg>';\n } else {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'generateGalleryJavascript');\n $rc = ciniki_web_generateGalleryJavascript($ciniki, isset($block['next'])?$block['next']:NULL, isset($block['prev'])?$block['prev']:NULL);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $ciniki['request']['inline_javascript'] = $rc['javascript'];\n $ciniki['request']['onresize'] = \"gallery_resize_arrows();\";\n $ciniki['request']['onload'] = \"scrollto_header();\";\n }\n\n $content .= \"<article class='page'>\\n\"\n . \"<header class='entry-title'><h1 id='entry-title' class='entry-title'>\" \n . $args['article_title'] . \"</h1></header>\\n\"\n . \"<div class='entry-content'>\\n\"\n . \"\";\n $content .= \"<div id='gallery-image' class='gallery-image'>\";\n $content .= \"<div id='gallery-image-wrap' class='gallery-image-wrap'>\";\n if( $prev != null ) {\n $content .= \"<a id='gallery-image-prev' class='gallery-image-prev' href='\" . (isset($args['gallery_url'])?$args['gallery_url'].'/':'') . $prev['permalink'] . \"'><div id='gallery-image-prev-img'>{$svg_prev}</div></a>\";\n }\n if( $next != null ) {\n $content .= \"<a id='gallery-image-next' class='gallery-image-next' href='\" . (isset($args['gallery_url'])?$args['gallery_url'].'/':'') . $next['permalink'] . \"'><div id='gallery-image-next-img'>{$svg_next}</div></a>\";\n }\n $content .= \"<img id='gallery-image-img' title='\" . $img['title'] . \"' alt='\" . $img['title'] . \"' src='\" . $img_url . \"' onload='javascript: gallery_resize_arrows();' />\";\n $content .= \"</div><br/>\"\n . \"<div id='gallery-image-details' class='gallery-image-details'>\"\n . \"<span class='image-title'>\" . $img['title'] . '</span>'\n . \"<span class='image-details'></span>\";\n if( $img['description'] != '' ) {\n $content .= \"<span class='image-description'>\" . preg_replace('/\\n/', '<br/>', $img['description']) . \"</span>\";\n }\n $content .= \"</div></div>\";\n $content .= \"</div></article>\";\n\n return array('stat'=>'ok', 'content'=>$content);\n}",
"private function generatePhotos() {\n \n $this->count = $this->option('count'); \n $photo_asset = new PhotoAsset();\n $photo_asset->setType( $this->argument('type') );\n $photo_asset->setSizes( $this->option('width-sizes') );\n $photo_asset->setOutputJsonDoc( $this->option('output-json-doc') );\n $photo_asset->setS3Upload( $this->option('s3-upload') );\n \n $asset = new Photo( $photo_asset ); \n \n $bar = $this->output->createProgressBar( $this->count ); \n for ($n=0; $n<$this->option('count'); $n++) {\n $bar->advance();\n if (is_file($asset->getFirstFile())) {\n $asset->save();\n }\n }\n \n $bar->finish(); \n \n }",
"function printImageGallery($searchQuery, $max) {\n $count = 0;\n $i = 1;\n while (true) {\n $i += 5;\n if ($count > $max-1) break;\n $json = get_url_contents(\"http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q={$searchQuery}&start={$i}&imgsz=medium\");\n $data = json_decode($json);\n foreach ($data->responseData->results as $result) {\n if (@getimagesize($result->url) != false) {\n $count++;\n echo '<img style=\"margin:5px; background:#eeeeee;\" height=\"200\" src=\"'. $result->url . '\"> ';\n }\n if ($count > $max-1) break;\n }\n }\n}",
"function load_images($page, $items_per_page, $items_total_count, $photos){\n\n for($i = ($page-1)*$items_per_page; $i<=(($items_per_page*$page)-1) && $i <=$items_total_count-1; $i++){\n echo \"\n <div class='col-xs-6 col-md-3'>\n <a class='thumbnail' href='gallery.php?id={$photos[$i]->id}'>\n <img src='admin/{$photos[$i]->picture_path()}' class='img-responsive home_page_photo'>\n </a>\n </div>\n \";\n }\n}",
"public function displayThumbnails() {\n\t\t$output = \"\";\n\t\tforeach ($this->photos as $I=>$V) {\n\t\t\t$output .= '<div class=\"photo\">';\n\t\t\t$output .= '<a href=\"'.$V['url'].'\"';\n\t\t\tif ($this->lightbox === TRUE) {\n\t\t\t\tif ($this->groupImages === TRUE) {\n\t\t\t\t\t$output .= ' rel=\"lightbox['.$this->dir.']\"';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$output .= ' rel=\"lightbox\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$output .= '><img src=\"'.$V['thumbURL'].'\" /></a>';\n\t\t\t$output .= \"</div>\";\n\t\t}\n\t\treturn($output);\n\t}",
"function pivot_field__field_gallery_images($variables) {\n\n $output = '';\n\n $output .= '<div id=\"gallery-content\"' . $variables['attributes'] . '>';\n $output .= '<ul class=\"' . $variables['classes'] . '\"' . $variables['content_attributes'] . '>';\n\n foreach ($variables['items'] as $delta => $item) {\n $item['file']['#alt'] = $variables['element']['#object']->field_gallery_images[LANGUAGE_NONE][$delta]['alt'];\n $output .= '<li class=\"slide' . $delta . ' gallery-slide\"' . $variables['item_attributes'][$delta] . '>';\n $output .= '<figure>';\n $output .= '<div class=\"image-content-wrapper\"><div class=\"image\">'. drupal_render($item['file']) . '</div></div>';\n $output .= '<figcaption class=\"photo-caption\">';\n $output .= drupal_render($item);\n $output .= '</figcaption>';\n $output .= '</figure>';\n $output .= '</li>';\n }\n\n $output .= '</ul></div>';\n\n return $output;\n}",
"function get_post_galleries_images($post = 0)\n {\n }",
"function display_images()\n{\n\tglobal $config;\n\tglobal $couch;\n\t\n\tdisplay_html_start('Images');\n\n\tdisplay_navbar();\n\t\n\techo '<div class=\"container-fluid\">' . \"\\n\";\n\t\n\techo '<h1>Images from BioStor</h1>';\n\techo '<p>These images are from the <a href=\"https://www.pinterest.com/rdmpage/biostor/\">BioStor board on Pintrest</a>.</p>';\n\t\n\t$url = $config['web_server'] . $config['web_root'] . 'api.php?images';\n\t\n\t$json = get($url);\n\t$obj = null;\n\tif ($json != '')\n\t{\n\t\t$obj = json_decode($json);\n\t}\n\t\n\t//echo $json;\n\t//print_r($obj);\n\t\n\techo '<div class=\"container\">' . \"\\n\";\t\n\techo '<div class=\"row\">' . \"\\n\";\n\n\tif ($obj)\n\t{\n\t\tforeach ($obj->images as $image)\n\t\t{\n\t\t\techo '<div style=\"position:relative;display:inline-block;padding:20px;\">';\t\t\t\n\t\t\techo '<a href=\"reference/' . $image->biostor . '\" >';\n\t\t\techo '<img style=\"width:100px;box-shadow:2px 2px 2px #ccc;border:1px solid #ccc;\" src=\"' . $image->src . '\"/>';\n\t\t\techo '</a>';\n\t\t\techo '</div>';\n\t\t}\n\t}\t\t\t\t\n\techo '</div>'; \n\techo '</div>'; // <div class=\"col-md-8\">\n\n\t\n\tdisplay_html_end();\n}",
"function get_post_galleries_images($post = 0)\n{\n}",
"public function mosaicImages () {}",
"function showImage_FrndGallery($id,$name){\n\tglobal $con;\n\tglobal $user_id;\n\tglobal $photo_id;\n\t\n\n\t//Selecting photo\n\t$select_image = \"SELECT * FROM PHOTO_SN WHERE user_id='$id' ORDER BY photo_id DESC;\";\n\t$res = pg_query($con, $select_image);\n\t$image_count = pg_num_rows($res);\n\t\n\techo\"<h3 style='color:brown' id='gallery_header'>$name has uploaded $image_count images:</h3><br/>\";\n\twhile($row=pg_fetch_assoc($res)){\n\t\t$data = pg_fetch_result($res,'image_name');\n\t\t$unes_image = pg_unescape_bytea($data);\n\t\t\n\t\t$image_name = $row['image_name'];\n\t\t\n\t\techo\"\n\t\t<img id='showImage' src='../social_network/user/user_images/$image_name' title='$image_name' height='150' width='150'/>\n\t\t\";\n\t\n\t\n\t}echo \"<br/><br/><br/>\";\n}",
"public function showInstagramMedia(Application $app)\n {\n $instagram = $app['instagram'];\n /**\n * check whether an error occurred\n */\n if (isset($_GET['error'])) {\n return 'An error occurred: '.$_GET['error_description'];\n }\n /**\n * check whether the user has granted access\n */\n if (isset($_GET['code'])) {\n try {\n $t = $instagram->getOAuthToken($_GET['code'], true);\n $app['session']->set('token', $t);\n return $app->redirect('/profile');\n } catch (Exception $e) {\n return $app->redirect('/profile?error='.$e->getMessage());\n }\n }\n try {\n $token = $app['session']->get('token');\n $instagram->setAccessToken($token);\n $user = $instagram->getUser();\n if ($user->meta->code != 200) {\n throw new Exception(\"OAuth error.\");\n }\n $result = $instagram->getUserMedia();\n } catch (Exception $e) {\n return $app->redirect('/');\n }\n /**\n * build user media array\n */\n $media_data = [];\n foreach ($result->data as $media) {\n $m = [];\n if ($media->type === 'video') {\n $m['video'] = [\n 'poster'=> $media->images->low_resolution->url,\n 'source'=> $media->videos->standard_resolution->url\n ];\n } else {\n $m['image'] = ['source' => $media->images->low_resolution->url];\n }\n $m['meta'] = [\n 'id' => $media->id,\n 'avatar' => $media->user->profile_picture,\n 'username' => $media->user->username,\n 'comment' => $media->caption->text\n ];\n $media_data[] = $m;\n //echo \"<xmp>\".print_r($media,true).\"</xmp>\";\n }\n\n return $app['mustache']->render('media_gallery', array(\n 'username' => $user->data->username,\n 'media' => $media_data,\n ));\n }",
"function exhibit_builder_thumbnail_gallery($start, $end, $props = array(),\n $thumbnailType = 'square_thumbnail', $linkOptions = array()) {\n\n $html = '';\n for ($i = (int)$start; $i <= (int)$end; $i++) {\n if ($attachment = exhibit_builder_page_attachment($i)) {\n $html .= \"\\n\" . '<div class=\"exhibit-item\">';\n if ($attachment['file']) {\n $file = $attachment['file'];\n // Grandgeorg Websolutions\n $myTitle = metadata($attachment['item'], array('Item Type Metadata', 'Titel'));\n if (empty($myTitle)) {\n $myTitle = metadata($attachment['item'], array('Dublin Core', 'Title'));\n }\n $props = array_merge($props, array('title' => $myTitle));\n // Grandgeorg Websolutions end\n $thumbnail = file_image($thumbnailType, $props, $attachment['file']);\n $html .= exhibit_builder_link_to_exhibit_item($thumbnail, $linkOptions, $attachment['item']);\n }\n // Grandgeorg Websolutions\n $html .= exhibit_builder_attachment_caption($attachment);\n // Grandgeorg Websolutions end\n $html .= '</div>' . \"\\n\";\n }\n }\n\n return apply_filters('exhibit_builder_thumbnail_gallery', $html,\n array('start' => $start, 'end' => $end, 'props' => $props, 'thumbnail_type' => $thumbnailType));\n}",
"function photos_flickr_hello() {\n\t\t// Bring in our flickr object and NSID\n\t\t$f = $GLOBALS['f'];\n\t\t$nsid = $GLOBALS['nsid'];\n if( $debug ) { print \"nsid: $nsid<br />\\n\"; }\n\t\n\t // Get the friendly URL of the user's photos\n\t $photos_url = $f->urls_getUserPhotos($nsid);\n if( $debug ) { print \"photos_url: $photos_url<br />\\n\"; }\n \n\t // Get the user's first 36 public photos\n\t\t$photos = $f->people_getPublicPhotos($nsid, NULL, 36);\n \n\t // Loop through the photos and output the html\n\t foreach ((array)$photos['photo'] as $photo) {\n\t\t\tprint \"<a href=$photos_url$photo[id]>\";\n\t //print \"<img border='0' \". // alt='$photo[title]' \".\n\t\t\t//\t\"src=\" . $f->buildPhotoURL($photo, \"Square\") . \">\";\n print photos_private_img($photo, 'square');\n\t print \"</a>\";\n\t\t\t$i++;\n\t\t\t// If it reaches the sixth photo, insert a line break\n\t\t\tif ($i % 6 == 0) {\n\t\t\t\techo \"<br>\\n\";\n\t \t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search for related slugs on this model, default to Uuid to avoid duplicate slugs. | protected static function processRelatedSlugs(Model $model, string $slug): string
{
if ($model->where('slug', '=', $slug)->exists()) {
return $model->getAttributeValue('uid');
}
return $slug;
} | [
"public function getUniqueSlug()\n {\n $slug = $this->getSlug($this->Owner->{$this->title_col});\n $this->pk_col = $this->Owner->getMetaData()->tableSchema->primaryKey;\n $this->Owner->{$this->slug_col} = $slug;\n\n $matches = $this->getMatches($this->Owner->slug);\n\n if($matches){\n\t\t\t$ar_matches = array();\n\t\t\tforeach ($matches as $match){\n\t\t\t\tif($match->{$this->pk_col} == $this->Owner->{$this->pk_col} && $match->{$this->slug_col} == $this->Owner->{$this->slug_col}){\n\t\t\t\t} else {\n\t\t\t\t\t$ar_matches[] = $match->slug;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$new_slug = $slug;\n\t\t\t$index = 1;\n\t\t\twhile ($index > 0) {\n\t\t\t\tif (in_array($new_slug, $ar_matches)){\n\t\t\t\t\t$new_slug = $slug.'-'.$index;\n\t\t\t\t\t$index++;\n\t\t\t\t} else {\n\t\t\t\t\t$slug = $new_slug;\n\t\t\t\t\t$index = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n return $slug;\n }",
"public function slugs();",
"public function generateSlug()\n {\n if ( $this->getRegenerateSlugOnUpdate() || empty( $this->slug ) ) {\n $fields = $this->getSluggableFields();\n $values = [];\n\n foreach ($fields as $field) {\n if (property_exists($this, $field)) {\n $val = $this->{$field};\n } else {\n $methodName = 'get' . ucfirst($field);\n if (method_exists($this, $methodName)) {\n $val = $this->{$methodName}();\n } else {\n $val = null;\n }\n }\n\n $values[] = $val;\n }\n\n $this->slug = $this->generateSlugValue($values);\n }\n }",
"public function getCanonicalSlug()\n {\n return $this\n ->hasOne(Slug::class, ['id' => 'canonicalSlugId']);\n }",
"abstract public function getTaxonomySlug();",
"public function getSlug();",
"public function getUniqueSlug()\n {\n return $this->slug;\n }",
"private function getUniqueSlug()\n\t{\n\t\tglobal $wpdb;\n \t\t\n\t\t// WP function -- formatting class\n\t\t$slug = sanitize_title( $this->getName( array( 'format' => '%first%-%last%' ) ) );\n\t\t\n\t\t$query = $wpdb->prepare( 'SELECT slug FROM ' . CN_ENTRY_TABLE . ' WHERE slug = %s', $slug );\n\t\t\n\t\tif ( $wpdb->get_var( $query ) )\n\t\t{\n\t\t\t$num = 2;\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$alt_slug = $slug . \"-$num\";\n\t\t\t\t$num++;\n\t\t\t\t$slug_check = $wpdb->get_var( $wpdb->prepare( 'SELECT slug FROM ' . CN_ENTRY_TABLE . ' WHERE slug = %s', $alt_slug ) );\n\t\t\t}\n\t\t\twhile ( $slug_check );\n\t\t\t\n\t\t\t$slug = $alt_slug;\n\t\t}\n\t\t\n\t\treturn $slug;\n\t}",
"public function makeUnique($slug)\n {\n switch (strtolower($this->getConfig('unique')))\n {\n case 'parent':\n $total = count($this->model->newQuery()->parentSimilarSlugs($this->model, $this->getConfig(), $slug)->get());\n return $this->appendIfNeeded($slug, $total);\n break;\n case 'all':\n $total = count($this->model->newQuery()->similarSlugs($this->getConfig(), $slug)->get());\n return $this->appendIfNeeded($slug, $total);\n break;\n }\n return $slug;\n }",
"public function getAllSlugs()\n {\n return $this->slugs;\n }",
"public function getSlug()\n {\n if (!isset($this->data['fields']['slug'])) {\n if ($this->isNew()) {\n $this->data['fields']['slug'] = null;\n } elseif (!isset($this->data['fields']) || !array_key_exists('slug', $this->data['fields'])) {\n $this->addFieldCache('slug');\n $data = $this->getRepository()->getCollection()->findOne(array('_id' => $this->id), array('slug' => 1));\n if (isset($data['slug'])) {\n $this->data['fields']['slug'] = (string) $data['slug'];\n } else {\n $this->data['fields']['slug'] = null;\n }\n }\n }\n\n return $this->data['fields']['slug'];\n }",
"protected function generateNonUniqueSlug()\n {\n if ($this->hasCustomSlugBeenUsed()) {\n\n return $this->getAttribute($this->slugOptions['slug_field']);\n }\n\n return str_slug($this->getSlugSourceString());\n }",
"public function generateSlug()\n {\n $value = $this->generateRawSlug();\n $value = Inflector::urlize($value);\n\n /** @var \\Tx\\CzSimpleCal\\Domain\\Repository\\EventIndexRepository $eventIndexRepository */\n $eventIndexRepository = $this->objectManager->get('Tx\\\\CzSimpleCal\\\\Domain\\\\Repository\\\\EventIndexRepository');\n\n $slug = $eventIndexRepository->makeSlugUnique($value, $this->uid);\n $this->setSlug($slug);\n }",
"public function get_slugs() {\r\n\t\t$this->load->model('search');\r\n\t\t$strains = $this->search->get_all();\r\n\t\t$slugs = array();\r\n\t\tforeach ($strains as $strain) {\r\n\t\t\t$slug = $strain['name'];\r\n\t\t\t$slug = str_replace(' ', '-', $slug);\r\n\t\t\t$slug = strtolower($slug);\r\n\t\t\t$slugs[] = $slug;\r\n\t\t}\r\n\t\t// return $slugs;\r\n\t\t// var_dump($slugs);\r\n\t\t$string = '';\r\n\t\tforeach ($slugs as $slug) {\r\n\t\t\t$string .= \"'\" . $slug . \"'\" . ',';\r\n\t\t}\r\n\t\tvar_dump($string);\r\n\t}",
"public function getSlugAttribute()\n {\n return new Slug($this->attributes[$this->slugField()]);\n }",
"public function urlSlug()\n {\n $class_name = get_class($this);\n $self = $this;\n $values = array_map(function($prop) use($self) {\n return $self->$prop;\n }, $class_name::$_slug_fields);\n \n return \\CMF::slug(implode(' ', $values), true, true);\n }",
"private function makeSureSlugsAreUnique()\n {\n $duplicates = DB::table('teams')->select('slug')\n ->groupBy('slug')\n ->havingRaw('COUNT(*) > 1')\n ->pluck('slug');\n\n Groid\\Team::whereIn('slug', $duplicates->toArray())->each(function($team, $key){\n $team->update([\n 'slug' => $team->slug.$key\n ]);\n });\n\n Schema::table('teams', function (Blueprint $table) {\n $table->unique('slug');\n });\n }",
"public function getProductSlug();",
"public function getSlugKey();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display a listing of the resource. GET /topsku | public function index()
{
$skus = Sku::searchTop();
return View::make('topsku.index', compact('skus'));
} | [
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager('db2');\n $skuStocks = $em->getRepository('BaseSynchronizeBundle:SkuStock')->findAll();\n\n return $this->render('BaseSynchronizeBundle:Db2:Skustock/index.html.twig', array(\n 'skuStocks' => $skuStocks,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager('db2');\n\n $skus = $em->getRepository('BaseSynchronizeBundle:Sku')->findAll();\n\n return $this->render('BaseSynchronizeBundle:Db2:Sku/index.html.twig', array(\n 'skus' => $skus,\n ));\n }",
"public function top(){\r\n $this->model->getTopProducts();\r\n $this->extra();\r\n $this->model->setPageHeader('Top 5');\r\n include_once 'views/productTopDoc.php';\r\n $view = new productTopDoc($this->model);\r\n $view->show();\r\n }",
"public function showTop()\n {\n // Obteniendo los productos mas vendidos.\n \t$tops = DB::select('SELECT productos.titulo,\n \t\t\t\t\t\t\tproductos.precio,\n \t\t\t\t\t\t\tproductos.supermercado,\n \t\t\t\t\t\t\tproductos.categoria, \n \t\t\t\t\t\t\tdetalle_pedidos.product_id, \n \t\t\t\t\t\t\tSUM(detalle_pedidos.cantidad) AS totalventas\n\t\t\t\t\t\t\t\tFROM detalle_pedidos JOIN productos \n\t\t\t\t\t\t\t\tON detalle_pedidos.product_id = productos.id\n\t\t\t\t\t\t\t\tGROUP BY productos.titulo,\n\t\t\t\t\t\t\t\t\t\tproductos.precio,\n\t\t\t\t\t\t\t\t\t\tproductos.supermercado,\n\t\t\t\t\t\t\t\t\t\tproductos.categoria, \n\t\t\t\t\t\t\t\t\t\tdetalle_pedidos.product_id\n\t\t\t\t\t\t\t\tORDER BY totalventas DESC;');\n \treturn view('home.top', compact('tops'));\n }",
"public static function bestsellerAction()\n {\n $storeId = Mage::app()->getStore()->getId();\n $products = Mage::getResourceModel('reports/product_collection')\n ->addOrderedQty()\n ->addAttributeToSelect('*')\n ->addAttributeToSelect(array('name', 'price', 'small_image'))\n ->setStoreId($storeId)\n ->addStoreFilter($storeId)\n ->setOrder('ordered_qty', 'desc'); // most bestsellers on top\n Mage::getSingleton('catalog/product_status')\n ->addVisibleFilterToCollection($products);\n\n Mage::getSingleton('catalog/product_visibility')\n ->addVisibleInCatalogFilterToCollection($products);\n\n $products->setPageSize(4)->setCurPage(1);\n $data = \"\";\n foreach ($products as $product) {\n $data .= \",\".$product->getSku();\n }\n $data = trim($data, \",\");\n $product_sku = explode(\",\", $data);\n foreach ($product_sku as $sku) {\n $_product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);\n }\n// return $data;\n Zend_Debug::dump($data);\n exit;\n }",
"public function actionGoodsBySku()\n {\n $code = 1000;\n\n $sku = (int)Yii::$app->request->get('sku', '');\n\n if (!$sku) {\n return Json::encode([\n 'code' => $code,\n 'msg' => Yii::$app->params['errorCodes'][$code],\n ]);\n }\n\n $ret = [\n 'code' => 200,\n 'msg' => 'OK',\n 'data' => [\n 'detail' => [],\n ],\n ];\n\n $goods = Goods::findBySku($sku, ['id', 'title', 'subtitle', 'platform_price']);\n if ($goods) {\n $ret['data'] = [\n 'detail' => [\n 'title' => $goods->title,\n 'subtitle' => $goods->subtitle,\n 'platform_price' => StringService::formatPrice($goods->platform_price / 100),\n// 'url' => Url::to([Goods::GOODS_DETAIL_URL_PREFIX . $goods->id], true),\n 'url' => $goods->id,\n ],\n ];\n }\n\n return Json::encode($ret);\n }",
"public function mostrar_Sku(){\n $conexion = Conexion();\n $sql=\"SELECT * from tbl_productos\"; \n foreach ($conexion->query($sql) as $row){\n echo \"<option value='{$row ['sku']}'>{$row ['sku']}</option>\"; \n }\n }",
"public function actionProduct_all_stockage(){\r\n \t$result = array();\r\n \tif (!isset($_GET['sku']) || trim($_GET['sku'])=='') {\r\n \t\texit( json_encode($result) );\r\n \t}\r\n\r\n \t$stockage = InventoryHelper::getProductAllInventory(trim($_GET['sku']));\r\n \tif ($stockage <> null){\r\n \t\t\t$result = $stockage;\r\n \t}\r\n \texit( json_encode($result) );\r\n }",
"public function get(string $sku)\n {\n return $this->request(\n 'getInventoryItem',\n 'GET',\n \"inventory_item/$sku\",\n null,\n [],\n []\n );\n }",
"public function actionWalmartproductinventoryinfo()\n {\n $sku = false;\n $productdata = \"add sku on url like ?sku=product_sku\";\n if (isset($_GET['sku'])) {\n $sku = $_GET['sku'];\n }\n $merchant_id = MERCHANT_ID;\n $config = Data::getConfiguration($merchant_id);\n $walmartHelper = new Walmartapi($config['consumer_id'], $config['secret_key']);\n if ($sku) {\n $productdata = $walmartHelper->getInventory($sku);\n }\n\n print_r($productdata);\n die;\n }",
"public function index()\n {\n return view('vendor\\backpack\\base\\products\\sold\\list')\n ->with('products', SoldProduct::orderBy('id','desc')->paginate($this->perPage));\n }",
"function kodkskim_listing(){\n $data['title'] = \"Senarai Kod Klasifikasi Skim\";\n $this->authentication->check();\n $this->_render_page($data);\n }",
"public function show(){\n\t\treturn array('supplier' => $this->_mSupplier->getName(), 'product_sku' => $this->_mProductSKU);\n\t}",
"public function top_sell(){\n $conection = \\DB::connection('sqlsrvtop');\n $datas = $conection->table('TopSales_USA')->select('No', 'ItemCode', 'Description')->orderBy('No')->get();\n \\DB::disconnect('sqlsrvtop');\n //Retornamos la vista con los datos iniciales de la tabla.\n return view('topSelling', ['datas'=>$datas]); \n }",
"public function actionIndex()\n {\n $searchModel = new SpuSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function sunglasses() {\n\t\t$this->load->model('SunglassesModel');\n\t\t$basket = $this->Basket->getInstance();\n\t\t\n\t\t$viewData['sunglasses'] = $this->SunglassesModel->selectAll();\t\n\t\t$viewData['cart']['items'] = $basket->getItems();\n\t\t$viewData['cart']['totalPrice'] = $basket->getTotalPrice();\n\t\t$viewData['pageName'] = \"shop\";\n\n\t\t$this->load->view('mobile/templates/main', $viewData);\n\t}",
"protected function listSurl()\n {\n return $this->getJson(route('surl.list'));\n }",
"public function index()\n {\n $products = $this->productRepo->getVendorProducts(auth()->user());\n\n return ProductResource::collection($products);\n }",
"public function topCatAppsAction() {\n\n //$userId = $this->__validateToken($this->_getParam('token', 0));\n\n $limit = $this->_getParam('limit', 10);\n $offset = $this->_getParam('offset', 0);\n $categoryId = $this->_getParam('category', 0);\n $grade = $this->_getParam('grade');\n $userType = $this->_getParam('user_type');\n\n if ($categoryId == 0) {\n $this->__dataNotFound();\n }\n\n $headersParams = $this->validateHeaderParams();\n $userAgent = $headersParams['userAgent'];\n $chapId = $headersParams['chapId'];\n $langCode = $headersParams['langCode'];\n\n //check if grade has been provided\n /*if($grade === null || empty($grade)){\n $this->__echoError(\"11000\",$this->getTranslatedText($langCode, '11000') ? $this->getTranslatedText($langCode, '11000') : \"Grade Id Empty\", self::BAD_REQUEST_CODE);\n }*/\n\n $deviceId = $this->deviceAction($userAgent);\n\n $chapProduct = new Api_Model_ChapProducts();\n $topProducts = $chapProduct->getQeasyTopCategoryProducts($chapId, $deviceId, $categoryId, $limit, $offset, $grade, $userType);\n\n if ($topProducts) {\n //$nexApi = new Nexva_Api_NexApi();\n $nexApi = new Nexva_Api_QelasyApi();\n\n $productInfo = $nexApi->getProductDetails($topProducts, $deviceId, true);\n\n if (count($productInfo) > 0) {\n\n $this->__printArrayOfDataJson($productInfo);\n }\n } else {\n\n $this->__dataNotFound();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns categories submodule Id. | protected function getCatSubmodId($modId){
return $this->owner . '_cat';
} | [
"public function getParentForCatModule($modId){\n if(mb_substr($modId, -4) == '_cat'){\n $res = mb_substr($modId, 0, -4);###\n }else{\n $res = $modId;\n }\n return $res;\n }",
"public function getCatId()\n\t{\n\t\treturn $this->categoria_id;\n\t}",
"public function getCategories_id()\n {\n return $this->categories_id;\n }",
"public function getId()\n {\n return isset($this->source['base_category_id']) ? $this->source['base_category_id'] : -1;\n }",
"public function getIdCategory()\n {\n return $this->idCategory;\n }",
"public function getIdCategory()\r\n {\r\n return $this->idCategory;\r\n }",
"public function getId()\n {\n return $this->source['category_id'];\n }",
"public function getIdCategory()\n {\n return $this->id_category;\n }",
"public function id()\n\t{\n\t\treturn $this->category;\n\t}",
"public function get_module_category(){\n\t\treturn (int) $this->v_module_category;\n\t}",
"public function getRootCategoryID()\n {\n return $this->rootCategoryID;\n }",
"public function getId_category()\n {\n return $this->id_category;\n }",
"public function getCatId()\n {\n return $this->cat_id;\n }",
"public function getCategoryid()\n {\n return $this->categoryid;\n }",
"public function getModuleId();",
"public function getCategory_id()\n {\n return $this->category_id;\n }",
"public function getIdSubCat()\n {\n return $this->id_sub_cat;\n }",
"public function getId_cat()\n {\n return $this->id_cat;\n }",
"public function getId_category(){\n return $this->id_category;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialise la variable de log | static function initLog() {
LibTools::set('msg_error', array());
} | [
"public function init(){\n $this->log = new Logger();\n }",
"public static function initLog()\n\t{\n\t\tif(is_null(self::$log))\n\t\t\tself::$log=array( \"Exception\"=>array(), \"Info\"=>array(), \"Depends\"=>array() );\n\t}",
"public function __construct() {\n\t\n\t\t$this->logger = Logger::getLogger();\n\t}",
"function __construct() {\n $this->log_file_location = (substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],'/')) !== ''?substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],'/')):'.') . '/logs/';\n if (Config\\LoggerConfig::LOGFILENAME === null) {\n $this->log_file = date(\"Ymd\", strtotime('now')) . pathinfo(__FILE__, PATHINFO_FILENAME) . '.log';\n } else {\n $this->log_file = Config\\LoggerConfig::LOGFILENAME;\n }\n $this->openLogFile();\n }",
"static private function _initialiseLogging () {\n Log::setLogWriter(new Cmf_Startup_Log_Writer);\n }",
"function logfile_init() {\n\t\tif ($this->LOGGING) {\n\t\t\t$this->FILE_HANDLER = fopen($this->LOGFILE,'a') ;\n\t\t\t$this->debug();\n\t\t}\n\t}",
"public function __construct()\n {\n // The __CLASS__ constant holds the class name, in our case \"Foo\".\n // Therefore this creates a logger named \"Foo\" (which we configured in the config file)\n $this->log = Logger::getLogger(__CLASS__);\n // var_dump($this->log);\n }",
"public static function initSysLog() {}",
"public function init()\n\t{\n\t\t$this->mainModel = new Administracion_Model_DbTable_Log();\n\t\t$this->namefilter = \"parametersfilterlog\";\n\t\t$this->route = \"/administracion/log\";\n\t\t$this->namepages =\"pages_log\";\n\t\t$this->namepageactual =\"page_actual_log\";\n\t\t$this->_view->route = $this->route;\n\t\tif(Session::getInstance()->get($this->namepages)){\n\t\t\t$this->pages = Session::getInstance()->get($this->namepages);\n\t\t} else {\n\t\t\t$this->pages = 20;\n\t\t}\n\t\tparent::init();\n\t}",
"function setLog( $value )\r\n {\r\n $this->Log = $value;\r\n }",
"private function __construct()\n {\n $levels = Conf::inst()->get('log.levels');\n $this->levels = $this->levelNames = array();\n foreach ($levels as $key => $name) {\n $this->levels[$name] = $key;\n $this->levelNames[] = $name;\n }\n\n $loggingLevel = Conf::inst()->get('log.level');\n $this->loggingLevel = $this->levels[$loggingLevel];\n $this->file = fopen(__DIR__ . \"/../log/\" . Conf::inst()->get('log.file'), \"a\");\n }",
"function __construct() {\n $this->log = new Logger('ClaseConexionSap');\n $this->log->pushHandler(new StreamHandler(dirname(dirname(__FILE__)).'/logs/info.log', Logger::DEBUG));\n $this->log->pushHandler(new BrowserConsoleHandler());\n }",
"protected function _initLog(){\n if( ! file_exists(realpath(ROOT_PATH . '/data/logs/' . CURRENT_MODULE . '/general.log')) ){\n $fh = fopen(ROOT_PATH . '/data/logs/' . CURRENT_MODULE . '/general.log', 'w');\n fclose($fh);\n }\n $path = realpath( ROOT_PATH . '/data/logs/' . CURRENT_MODULE . '/general.log');\n $writer = new Zend_Log_Writer_Stream($path);\n $logger = new Zend_Log($writer);\n if( ! Zend_Registry::get('IS_PRODUCTION') ){\n $firebug_writer = new Zend_Log_Writer_Firebug();\n $logger->addWriter($firebug_writer);\n }\n Zend_Registry::set('Zend_Log', $logger);\n }",
"function setLog($log){\n $this->log = $log;\n }",
"public function initLogger()\n {\n if (Cemes::isCli()) {\n $logger = new Fci_Log_CliLogger();\n } else {\n $logger = new Fci_Log_HtmlLogger();\n }\n\n Cemes_Registry::register('logger', $logger);\n }",
"protected function _initLogging ( )\n {\n $this->bootstrap('log');\n $log = $this->getResource('log');\n $this->getRegistry()->set('log', $log);\n\n }",
"function _autoConfig() {\n\t\tif (! class_exists ( 'FileLog' )) {\n\t\t\tApp::import ( 'Core', 'log/FileLog' );\n\t\t}\n\t\t$this->_streams ['default'] = & new FileLog ( array (\n\t\t\t\t'path' => LOGS \n\t\t) );\n\t}",
"function __construct() {\n\n $this->log = new Logger('RamSource');\n //Start the file stream. @TODO Need to get this in config so we can use on server.\n $this->stream = new StreamHandler($_SERVER['DOCUMENT_ROOT'] . '/logs/RamLogs.log', Logger::WARNING);\n $this->log->pushHandler($this->stream);\n }",
"public function __construct()\n\t\t{\n\t\t\t// The __CLASS__ constant holds the class name, in our case \"Foo\".\n\t\t\t// Therefore this creates a logger named \"Foo\" (which we configured in the config file)\n\t\t\t$this->log = Logger::getLogger(__CLASS__);\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field .cerbos.policy.v1.TestResults.Result overall_result = 1 [json_name = "overallResult"]; | public function getOverallResult()
{
return $this->overall_result;
} | [
"public function getOverall()\n\t{\n\t\treturn $this->overall;\n\t}",
"public function calculateFinalResult()\n {\n if (!isset($this->student->average)) {\n $this->calculateAverage();\n }\n\n // Calculate if the student is passed or not\n $pass = $this->student->average >= 7;\n $this->student->final_result = $pass ? 'passed' : 'failed';\n }",
"public function getAnalysisResult()\n {\n return $this->result;\n }",
"public function get_Expected_Results() {\n return $this->expected_results;\n }",
"public function getAdResult()\n {\n return $this->readOneof(49);\n }",
"public function getTestResult()\n {\n return $this->result;\n }",
"public function testUpdateResultOK()\n {\n $serializedUser = array();\n $serializedUser[Result::USER_ID_ATTRIBUTE] = ResultRoutesProviderTest::USER_ID_FOR_TESTS;\n $serializedUser[Result::RESULT_ATTRIBUTE] = ResultRoutesProviderTest::SECOND_RESULT_FOR_TESTS;\n $response = $this->runApp(ResultRoutesProviderTest::PUT_HTTP_METHOD, '/results/1', $serializedUser);\n\n self::assertJson(strval($response->getBody()));\n\n $responseBody = json_decode(strval($response->getBody()), true);\n\n self::assertInternalType('array', $responseBody);\n self::assertEquals(ResultRoutesProvider::OK_RESPONSE_CODE, $response->getStatusCode());\n\n self::assertArrayHasKey(Result::ID_ATTRIBUTE, $responseBody);\n self::assertArrayHasKey(Result::USER_ATTRIBUTE, $responseBody);\n self::assertArrayHasKey(Result::RESULT_ATTRIBUTE, $responseBody);\n self::assertArrayHasKey(Result::TIME_ATTRIBUTE, $responseBody);\n\n self::assertInternalType('int', $responseBody[Result::ID_ATTRIBUTE]);\n self::assertEquals(ResultRoutesProviderTest::SECOND_RESULT_FOR_TESTS, $responseBody[Result::RESULT_ATTRIBUTE]);\n self::assertInternalType('array', $responseBody[Result::USER_ATTRIBUTE]);\n\n $user = $responseBody[Result::USER_ATTRIBUTE];\n\n self::assertEquals(ResultRoutesProviderTest::USER_ID_FOR_TESTS, $user[User::ID_ATTRIBUTE]);\n self::assertEquals(UserRoutesProviderTest::FIRST_USER_NAME_FOR_TESTS, $user[User::USERNAME_ATTRIBUTE]);\n self::assertEquals(UserRoutesProviderTest::FIRST_USER_MAIL_FOR_TESTS, $user[User::EMAIL_ATTRIBUTE]);\n self::assertEquals(UserRoutesProviderTest::FIRST_ENABLED_USER_FOR_TESTS, $user[User::ENABLED_ATTRIBUTE]);\n self::assertEquals(UserRoutesProviderTest::FIRST_USER_TOKEN_FOR_TESTS, $user[User::TOKEN_ATTRIBUTE]);\n }",
"private function render_subtest_result($testresult) {\n $passed = (string) $testresult->result->score === '1.0';\n $result = '';\n foreach ($testresult->{'feedback-list'} as $feedbacklist) {\n $count = 0;\n foreach ($feedbacklist->{'student-feedback'} as $feedback) {\n $result .= $this->render_single_feedback($feedback, false, true,\n $count === 0, $passed);\n $count++;\n }\n // Print further teacher feedback if any.\n if (qtype_proforma\\lib\\is_teacher() && count($feedbacklist->{'teacher-feedback'})) {\n foreach ($feedbacklist->{'teacher-feedback'} as $feedback) {\n $result .= $this->render_single_feedback($feedback, true, true);\n }\n\n }\n }\n\n return $result;\n }",
"public function getNextResult() : Result\n {\n }",
"public function setResult($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Any::class);\n $this->result = $var;\n\n return $this;\n }",
"public function setResult($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Dialogflow\\Cx\\V3\\ContinuousTestResult\\AggregatedTestResult::class);\n $this->result = $var;\n\n return $this;\n }",
"public function _getTestResult1() {\n\t\treturn $this->_testResult1;\n\t}",
"public function computeScore($scoreConfig, array $testResults): float;",
"public function getTestResult()\n {\n return $this->_testResult;\n }",
"public function testCombineResults(){\n\t\t$result = new ValidationResult();\n\t\t$anotherresult = new ValidationResult();\n\t\t$yetanotherresult = new ValidationResult();\n\t\t$anotherresult->error(\"Eat with your mouth closed\", \"EATING101\");\n\t\t$yetanotherresult->error(\"You didn't wash your hands\", \"BECLEAN\");\n\n\t\t$this->assertTrue($result->valid());\n\t\t$this->assertFalse($anotherresult->valid());\n\t\t$this->assertFalse($yetanotherresult->valid());\n\n\t\t$result->combineAnd($anotherresult)\n\t\t\t\t->combineAnd($yetanotherresult);\n\t\t$this->assertFalse($result->valid());\n\t\t$this->assertEquals(array(\n\t\t\t\"EATING101\" => \"Eat with your mouth closed\",\n\t\t\t\"BECLEAN\" => \"You didn't wash your hands\"\n\t\t),$result->messageList());\n\t}",
"function addResult($testName, $status, $od1, $od2, $odav, $pp1, $pp2, $var, $ppav, $visitId){\n //check that this disease is not yet assigned a result and if it is the result is the same\n $tempArray = array('status' => $status, 'od1' => $od1, 'od2' => $od2, 'odav' => $odav, 'pp1' => $pp1,\n 'pp2' => $pp2, 'var' => $var, 'ppav' => $ppav);\n if(in_array($tempArray, $this->results[$testName])) return 1;\n $this->results[$testName] = $tempArray;\n return 0;\n }",
"public function setSummary($var)\n {\n GPBUtil::checkMessage($var, \\Grpc\\Testing\\ScenarioResultSummary::class);\n $this->summary = $var;\n\n return $this;\n }",
"public function getPsychometricTestResultAttribute()\n {\n $application = Application::find($this->id);\n if(!$application->psychometricTest->isEmpty()){\n if($application->psychometricTest()->where('test_url','!=','')->count()>0){\n $psychometric_test_result = $application->psychometricTest()->where('test_url','!=','')->latest()->first()->result;\n \n } else {\n $psychometric_test_result = \"Pending\";\n } \n } else {\n $psychometric_test_result = \"Pending\";\n } \n\n return $psychometric_test_result; \n }",
"public function calcResult()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of idEntregable. | public function setIdEntregable($idEntregable)
{
$this->idEntregable = $idEntregable;
return $this;
} | [
"function set_idObjeto( $idObjeto ) {\n // sets the value of idObjeto\n $this->idObjeto = $idObjeto;\n }",
"public function setId($value) { $this->_id = $value; }",
"public function setId($value) { $this->id = $value;}",
"function set_id($id){\n $this->id->value = $id;\n }",
"public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }",
"public function setHolderableIdAttribute($value)\n {\n return;\n }",
"public function setObjectID($id){\n\t\tparent::setObjectID($id);\n\t\t$this->setAttribute('id',$id);\n\t}",
"public function setID($_id){\n\t\t\t$this->id = $_id;\n\t\t\t\n\t\t\t// Set the chemical\n\t\t\t$this->equipment = new Equipment($this->dbi);\n\t\t\t$this->equipment->setByID($this->id);\n\t\t}",
"function setID($id) {\r\n $this->id = $id;\r\n }",
"public function set($id, $value);",
"abstract public function set($id, $value);",
"public function set_id($value){\n $this->set_info('player_id', intval($value));\n }",
"public function setIdentifier($entity, $value) : void\n {\n $entity->setId($value);\n }",
"public function setID($id){\r\r\n\t\t$this->edit_id = $id;\r\r\n\t}",
"public function set_id_equipo($id_equipo){\n\t\t$this->id_equipo=$id_equipo;\n\t}",
"function setEmpleado_id($empleado_id) {\r\n\t\t$this->empleado_id = $empleado_id;\r\n }",
"public function setID($id) {\n $this->ID = $id;\n }",
"final function setArticle_id($value) {\n\t\treturn $this->setArticleId($value);\n\t}",
"public function testSetId() {\n\t\techo (\"\\n********************Test SetId()*********************************************************\\n\");\n\t\t\n\t\t$this->chromosome->setId ( 2 );\n\t\t$this->assertEquals ( 2, $this->chromosome->getId () );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Close terms stream Should be used for resources clean up if stream is not read up to the end | public function closeTermsStream(); | [
"public function closeTermsStream()\n {\n $this->_termsStream->closeTermsStream();\n $this->_termsStream = null;\n }",
"public function closeTermsStream() {\n\t\t$this->_tisFile = null;\n\t\t$this->_frqFile = null;\n\t\t$this->_prxFile = null;\n\t\t\n\t\t$this->_lastTerm = null;\n\t\t$this->_lastTermInfo = null;\n\t\t$this->_lastTermPositions = null;\n\t\t\n\t\t$this->_docMap = null;\n\t}",
"public function closeTermsStream()\n {\n while (($termStream = $this->_termsStreamQueue->pop()) !== null) {\n $termStream->closeTermsStream();\n }\n\n $this->_termsStreamQueue = null;\n $this->_lastTerm = null;\n }",
"public function close(): void\n {\n fclose($this->stream);\n }",
"public function stream_close() {}",
"function close()\n {\n if (fclose($this->stream)) {\n $this->closed = true;\n }\n }",
"public function close()\n {\n $this->stream->close();\n }",
"function close(){\n\t\tif ( ! is_resource($this->stream) )\n\t\t\treturn;\n\t\t\n\t\t$this->command('logout');\n\t\tfclose($this->stream);\n\t\t$this->stream = null;\n\t}",
"public function __destruct() {\n if (is_resource($this->stream)) {\n $this->close();\n }\n }",
"private function close()\n {\n $this->read->close();\n $this->write->close();\n }",
"protected function close()\n {\n if (isset($this->_stream)) {\n fwrite($this->_stream, ob_get_clean());\n }\n }",
"public function __destruct()\n {\n $this->stream->close();\n }",
"public function close()\n {\n fclose($this->in);\n fclose($this->out);\n }",
"public function close()\n {\n if ($this->closed)\n {\n return;\n }\n \n $this->closed = true;\n \n if ($this->inited)\n {\n $this->stream->close();\n }\n else\n {\n $this->emit('close');\n }\n }",
"public function streamClosed();",
"public function close()\n {\n foreach ($this->getFileStream() as $fp) {\n fclose($fp);\n }\n }",
"private function close()\n {\n if (is_resource($this->curl)) {\n curl_close($this->curl);\n }\n }",
"public function close()\n {\n if ($this->shared_strings_reader && $this->shared_strings_reader instanceof OoxmlReader) {\n $this->shared_strings_reader->close();\n $this->shared_strings_reader = null;\n }\n /** @var SharedStringsOptimizedFile $file_data */\n foreach ($this->prepared_shared_string_files as $file_data) {\n $file_data->closeHandle();\n }\n\n $this->shared_strings_directory = null;\n $this->shared_strings_filename = null;\n }",
"private function _close() {\n\t\tif ($this->_closed) {\n\t\t\t// index is already closed and resources are cleaned up\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$this->commit ();\n\t\t\n\t\t// Release \"under processing\" flag\n\t\t\\Core\\Search\\Lucene\\LockManager::releaseReadLock ( $this->_directory );\n\t\t\n\t\tif ($this->_closeDirOnExit) {\n\t\t\t$this->_directory->close ();\n\t\t}\n\t\t\n\t\t$this->_directory = null;\n\t\t$this->_writer = null;\n\t\t$this->_segmentInfos = null;\n\t\t\n\t\t$this->_closed = true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the kioskModeScreenSaverStartDelayInSeconds property value. The number of seconds the device needs to be inactive for before the screen saver is shown in Kiosk Mode. Valid values 1 to 9999999 | public function setKioskModeScreenSaverStartDelayInSeconds(?int $value): void {
$this->getBackingStore()->set('kioskModeScreenSaverStartDelayInSeconds', $value);
} | [
"public function setKioskModeManagedHomeScreenInactiveSignOutDelayInSeconds($val)\n {\n $this->_propDict[\"kioskModeManagedHomeScreenInactiveSignOutDelayInSeconds\"] = intval($val);\n return $this;\n }",
"public function setKioskModeManagedHomeScreenInactiveSignOutDelayInSeconds(?int $value): void {\n $this->getBackingStore()->set('kioskModeManagedHomeScreenInactiveSignOutDelayInSeconds', $value);\n }",
"public function setScreensaverTimeout($val)\n {\n $this->_propDict[\"screensaverTimeout\"] = $val;\n return $this;\n }",
"public function setIdleTimeBeforeSleepInSeconds($val)\n {\n $this->_propDict[\"idleTimeBeforeSleepInSeconds\"] = intval($val);\n return $this;\n }",
"public function setKioskModeScreenSaverConfigurationEnabled($val)\n {\n $this->_propDict[\"kioskModeScreenSaverConfigurationEnabled\"] = boolval($val);\n return $this;\n }",
"public function getKioskModeManagedHomeScreenInactiveSignOutDelayInSeconds()\n {\n if (array_key_exists(\"kioskModeManagedHomeScreenInactiveSignOutDelayInSeconds\", $this->_propDict)) {\n return $this->_propDict[\"kioskModeManagedHomeScreenInactiveSignOutDelayInSeconds\"];\n } else {\n return null;\n }\n }",
"public function setAuthenticationRetryDelayPeriodInSeconds(?int $value): void {\n $this->getBackingStore()->set('authenticationRetryDelayPeriodInSeconds', $value);\n }",
"public function setForegroundDownloadFromHttpDelayInSeconds(?int $value): void {\n $this->getBackingStore()->set('foregroundDownloadFromHttpDelayInSeconds', $value);\n }",
"public function getKioskModeScreenSaverStartDelayInSeconds(): ?int {\n $val = $this->getBackingStore()->get('kioskModeScreenSaverStartDelayInSeconds');\n if (is_null($val) || is_int($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'kioskModeScreenSaverStartDelayInSeconds'\");\n }",
"public function setAuthenticationRetryDelayPeriodInSeconds($val)\n {\n $this->_propDict[\"authenticationRetryDelayPeriodInSeconds\"] = intval($val);\n return $this;\n }",
"public function setWorkProfilePasswordMinutesOfInactivityBeforeScreenTimeout(?int $value): void {\n $this->getBackingStore()->set('workProfilePasswordMinutesOfInactivityBeforeScreenTimeout', $value);\n }",
"public function setPasscodeMinutesOfInactivityBeforeScreenTimeout(?int $value): void {\n $this->getBackingStore()->set('passcodeMinutesOfInactivityBeforeScreenTimeout', $value);\n }",
"public function setInitialSilenceTimeoutInSeconds(?int $value): void {\n $this->getBackingStore()->set('initialSilenceTimeoutInSeconds', $value);\n }",
"public function setDefenderCloudExtendedTimeoutInSeconds(?int $value): void {\n $this->getBackingStore()->set('defenderCloudExtendedTimeoutInSeconds', $value);\n }",
"public function setUserSessionTimeoutInSeconds($val)\n {\n $this->_propDict[\"userSessionTimeoutInSeconds\"] = intval($val);\n return $this;\n }",
"public function setPasswordMinutesOfInactivityBeforeScreenTimeout(?int $value): void {\n $this->getBackingStore()->set('passwordMinutesOfInactivityBeforeScreenTimeout', $value);\n }",
"public function setScreenTimeScreenDisabled($val)\n {\n $this->_propDict[\"screenTimeScreenDisabled\"] = boolval($val);\n return $this;\n }",
"public function setCacheServerBackgroundDownloadFallbackToHttpDelayInSeconds(?int $value): void {\n $this->getBackingStore()->set('cacheServerBackgroundDownloadFallbackToHttpDelayInSeconds', $value);\n }",
"public function set_delay($sec)\n\t{\n\t\t$this->delay = [\n\t\t\t'delay' => $sec,\n\t\t\t'last'\t=> 0, //time of last request\n\t\t];\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
merge PHP code with prefix code and return parse tree tag object | public function mergePrefixCode($code)
{
$tmp = '';
foreach ($this->compiler->prefix_code as $preCode) {
$tmp .= $preCode;
}
$this->compiler->prefix_code = array();
$tmp .= $code;
return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true));
} | [
"public function mergePrefixCode ( $code ) {\n $tmp = '';\n foreach ( $this->compiler->prefix_code as $preCode ) {\n $tmp .= $preCode;\n }\n $this->compiler->prefix_code = array ();\n $tmp .= $code;\n return new Smarty_Internal_ParseTree_Tag ( $this , $this->compiler->processNocacheCode ( $tmp , true ) );\n }",
"public function mergePrefixCode ( $code ) {\n\t\t\t$tmp = '';\n\t\t\tforeach ( $this->compiler->prefix_code as $preCode ) {\n\t\t\t\t$tmp = empty( $tmp ) ? $preCode : $this->compiler->appendCode ( $tmp, $preCode );\n\t\t\t}\n\t\t\t$this->compiler->prefix_code = [ ];\n\t\t\t$tmp = empty( $tmp ) ? $code : $this->compiler->appendCode ( $tmp, $code );\n\n\t\t\treturn new Smarty_Internal_ParseTree_Tag( $this, $this->compiler->processNocacheCode ( $tmp, TRUE ) );\n\t\t}",
"public function insertPhpCode ( $code ) {\n $this->current_buffer->append_subtree ( $this , new Smarty_Internal_ParseTree_Tag ( $this , $code ) );\n }",
"public function insertPhpCode($code)\n {\n $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code));\n }",
"public function insertPhpCode($code)\n {\n $this->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($this, $code));\n }",
"function parse_php_tag($convoArr, $element, $parentName, $level)\n{\n runDebug(__FILE__, __FUNCTION__, __LINE__, 'Parsing custom PHP tag.', 2);\n $response = array();\n $children = $element->children();\n if (!empty ($children))\n {\n $response = parseTemplateRecursive($convoArr, $children, $level + 1);\n }\n else\n {\n $response[] = (string) $element;\n }\n $response_string = implode_recursive(' ', $response);\n // do something here\n return $response_string;\n}",
"private function open_php( &$src ){\n\t\tif( ! $this->inphp ){\n\t\t\t$this->inphp = true;\n\t\t\t\n\t\t\t// this may result in back to back tags, which we can avoid with a bit of string manipulation.\n\t\t\t$makenice = $this->opt(COMPILER_OPTION_NICE_TAGS);\n\t\t\t\n\t\t\tif( $makenice && substr( $src, -2 ) === '?>' ){\n\t\t\t\t// trim trailing close tag, so no need to open one\n\t\t\t\t$src = substr_replace( $src, '', -2 );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$ws = $this->opt(COMPILER_OPTION_WHITESPACE) ? \"\\n\" : ' ';\n\t\t\t\t$src .= '<?php'.$ws;\n\t\t\t}\n\t\t}\n\t\treturn $src;\t\n\t}",
"function _process_raw_php_tags($text) {\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t$php = \"\";\n\t\t//-----------------------------------------\n\t\t// Allow PHP code in templates?\n\t\t//-----------------------------------------\n\t\tif (! $this->allow_php_code)\n\t\t\treturn '';\n\t\t\n\t\t//-----------------------------------------\n\t\t// EXTRACT!\n\t\t//-----------------------------------------\n\t\tpreg_match_all ( \"#<php>(.+?)</php>#si\", $text, $match );\n\t\tfor($i = 0; $i < count ( $match [0] ); $i ++) {\n\t\t\t$php_code = trim ( $match [1] [$i] );\n\t\t\t$complete_tag = $match [0] [$i];\n\t\t\t$str_find = array ('\\\\\"', '\\\\\\\\' );\n\t\t\t$str_replace = array ('\"', '\\\\' );\n\t\t\t$str_find [] = \"\\\\'\";\n\t\t\t$str_replace [] = \"'\";\n\t\t\t$php_code = str_replace ( $str_find, $str_replace, $php_code );\n\t\t\t$php .= $php_code;\n\t\t}\n\t\treturn $php;\n\t}",
"public function parse_shortcode( $source_code )\n\t\t{\n\t\t\tif ( $shortcodes = $this->shortcode->fetch( $source_code ) )\n\t\t\t{\n\t\t\t\t$source_code = $this->shortcode->parse( $source_code );\n\t\t\t}\n\n\t\t\t// Fixed Output\n\t\t\t$source_code = str_replace( array( '_shortcode', '[?php', '?]' ), array( 'shortcode', '<?php', '?>' ),\n\t\t\t $source_code );\n\n\t\t\treturn $source_code;\n\t\t}",
"public function testCode() {\n $expected = '<pre class=\"decoda-code\"><code>$variable = \"Code Block\";</code></pre>';\n $this->assertEquals($expected, $this->object->reset('[code]$variable = \"Code Block\";[/code]')->parse());\n\n $expected = '<pre class=\"decoda-code lang-php\"><code>$variable = \"Code Block\";</code></pre>';\n $this->assertEquals($expected, $this->object->reset('[code=\"php\"]$variable = \"Code Block\";[/code]')->parse());\n\n $expected = '<pre class=\"decoda-code\" data-line=\"10,20\"><code>$variable = \"Code Block\";</code></pre>';\n $this->assertEquals($expected, $this->object->reset('[code hl=\"10,20\"]$variable = \"Code Block\";[/code]')->parse());\n\n $expected = '<pre class=\"decoda-code lang-php\" data-line=\"10,20\"><code>$variable = \"Code Block\";</code></pre>';\n $this->assertEquals($expected, $this->object->reset('[code=\"php\" hl=\"10,20\"]$variable = \"Code Block\";[/code]')->parse());\n\n $expected = '<pre class=\"decoda-code\"><code>Code block [b]with Decoda[/b] tags.</code></pre>';\n $this->assertEquals($expected, $this->object->reset('[code]Code block [b]with Decoda[/b] tags.[/code]')->parse());\n\n $expected = '<pre class=\"decoda-code\"><code>Code block <strong>with HTML</strong> tags.</code></pre>';\n $this->assertEquals($expected, $this->object->reset('[code]Code block <strong>with HTML</strong> tags.[/code]')->parse());\n\n $string = <<<'CODE'\n[code hl=\"1,15\"]<?php\nabstract class FilterAbstract implements Filter {\n\n /**\n * Return a tag if it exists, and merge with defaults.\n *\n * @param string $tag\n * @return array\n */\n public function tag($tag) {\n $defaults = $this->_defaults;\n $defaults[\\'key\\'] = $tag;\n\n if (isset($this->_tags[$tag])) {\n return $this->_tags[$tag] + $defaults;\n }\n\n return $defaults;\n }\n\n} ?>[/code]\nCODE;\n\n $expected = <<<'CODE'\n<pre class=\"decoda-code\" data-line=\"1,15\"><code><?php\nabstract class FilterAbstract implements Filter {\n\n /**\n * Return a tag if it exists, and merge with defaults.\n *\n * @param string $tag\n * @return array\n */\n public function tag($tag) {\n $defaults = $this->_defaults;\n $defaults[\\'key\\'] = $tag;\n\n if (isset($this->_tags[$tag])) {\n return $this->_tags[$tag] + $defaults;\n }\n\n return $defaults;\n }\n\n} ?></code></pre>\nCODE;\n\n $this->assertEquals($this->nl($expected), $this->object->reset($string)->parse());\n }",
"function doTransform($src)\n {\n $tokens = token_get_all(trim($src));\n $f = new T_Filter_Xhtml();\n $is_even = true; /* next line is even */\n $in_quotes = false; /* tracks if in *parsed* quoted string */\n\n $out = '<ol class=\"php\">'.EOL.' '.'<li><code>';\n foreach ($tokens as $t) {\n\n /* standardize token (maybe array, or just plain content). */\n if (is_array($t)) {\n list($t_type,$t_content) = $t;\n $t_class = $this->getClassFromToken($t_type);\n } else {\n $t_type = false;\n $t_class = false;\n $t_content = $t;\n }\n\n /* If there is a double quoted string that contains embedded\n variables, the string is tokenized as components, and within\n this string is the only time we want to label T_STRING types as\n actual strings. The double quotes in this case always appear in\n on their own,and we use the $in_quotes to track this status */\n if ($t_type === false && $t_content === '\"') {\n $t_class = $this->getClassFromToken(T_CONSTANT_ENCAPSED_STRING);\n $in_quotes = !$in_quotes;\n } elseif ($in_quotes && $t_type === T_STRING) {\n $t_class = $this->getClassFromToken(T_CONSTANT_ENCAPSED_STRING);\n }\n\n /* act on token. This is complicated by the fact that a token\n content can contain EOL markers, and in this case the token\n content must be separated at these lines. */\n $t_content = explode(\"\\n\",$t_content);\n for ($i=0,$max=count($t_content)-1; $i<=$max; $i++) {\n\n /* add new line (only from 2nd iteration onwards) */\n if ($i>0) {\n $e_class = $is_even ? ' class=\"even\"' : '';\n $is_even = !$is_even;\n $out .= '</code></li>'.EOL.' '.'<li'.$e_class.'><code>';\n }\n\n /* right trim token content if it is at end of a line */\n $line = $t_content[$i];\n if ($i<$max) {\n $line = rtrim($line);\n }\n\n /* wrap content in spans */\n if ($t_class !== false && strlen($line)>0) {\n $out .= '<span class=\"'.$t_class.'\">'.\n _transform($line,$f).\n '</span>';\n } else {\n $out .= _transform($line,$f);\n }\n\n }\n }\n $out .= '</code></li>'.EOL.'</ol>';\n\n return $out;\n }",
"function pre_parser($text)\n{\n// line breaks. To achieve this, and still have code-sections, code-sections\n// need to be parsed in this section as well\n\n\t// Parse the code sections, to escape them from the line control\n\t$text = preg_replace_callback(\"/(?:^|\\n)\\s*<((?:php)?code)>\\s*\\n(.*\\n)\\s*<\\\\/\\\\1>\\s*(?=\\n|$)/Usi\", function($matches)\n\t{\n\t\treturn q1(\"\\n\").code_token($matches[1], q1($matches[2]));\n\t}, $text);\n\n\t// Insert page breaks to lines ending in a double \\\n\t$text = preg_replace_callback(\"/\\\\\\\\\\\\\\\\\\n\\s*/s\", function($matches)\n\t{\n\t\treturn new_entity(array('newline'));\n\t}, $text);\n\n\t// Concatenate lines ending in a single \\\n\t$text = preg_replace(\"/\\\\\\\\\\n[ \\t]*/s\", \" \", $text);\n\n\treturn $text;\n}",
"public function expandTaglib();",
"private function parseCode($str) \n\t{\n\t\tpreg_match_all(\"/{(.*?)}/\",$str,$args);\n\t\tforeach($args[1] as $code) \n\t\t{\n\t\t\t// Document data\n\t\t\tif(strlen($code) && $code{0}=='$') \n\t\t\t{\n\t\t\t\t$str = str_replace('{'.\"$code\".'}',$this->get(substr($code,1)),$str);\n\t\t\t}\n\t\t\t// Functions and global variables\n\t\t\telseif(substr($code,0,5) == 'exec:') \n\t\t\t{\n\t\t\t\t$code = substr($code,5);\n\t\t\t\tif(strlen($code) && $code{0} == '$')\n\t\t\t\t{\n\t\t\t\t\teval(\"global $code;\");\n\t\t\t\t}\n\t\t\t\tif(strlen($code) && $code{0} != '$') \n\t\t\t\t{\n\t\t\t\t\tif(!defined($code) && !preg_match(\"/^(.*)\\((.*)\\)$/\",$code))\n\t\t\t\t\t{\n\t\t\t\t\t\t$code = \"null\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\teval(\"\\$replace = $code;\");\n\t\t\t\t$str = str_replace('{'.\"exec:$code\".'}',$this->parseCode($replace),$str);\n\t\t\t}\n\t\t\telseif(substr($code,0,8) == 'include:') \n\t\t\t{\n\t\t\t\t$code = substr($code,8);\n\t\t\t\teval(\"\\$file = $code;\");\n\t\t\t\tif(file_exists( $this->getPath($file) )) \n\t\t\t\t{\n\t\t\t\t\t$this->parseTemplate(file( $this->getPath($file)));\n\t\t\t\t}\n\t\t\t\t$str = str_replace('{'.\"include:$code\".'}','',$str);\n\t\t\t}\n\t\t}\n\t\treturn $str;\n\t}",
"public function parseShortcode( $source_code )\n\t{\n\t\tif ( $shortcodes = $this->shortcode->fetch( $source_code ) )\n\t\t{\n\t\t\t$source_code = $this->shortcode->parse( $source_code );\n\t\t}\n\n\t\t// Fixed Output\n\t\t$source_code = str_replace(\n\t\t\t[ '_shortcode', '[?php', '?]' ], [ 'shortcode', '<?php', '?>' ],\n\t\t\t$source_code );\n\n\t\treturn $source_code;\n\t}",
"private function openPhpTag()\n {\n $result = '';\n if (!$this->isPhpTagOpen)\n {\n $this->isPhpTagOpen = true;\n $result = '<?php ';\n }\n return $result;\n }",
"public function php_to_syntax($str)\n\t{\n\t\t$delimiters = (isset($this->delimiters['tag_variable'])) ? $this->delimiters['tag_variable'] : $this->delimiters;\n\t\t$l_delim = $delimiters[0];\n\t\t$r_delim = $delimiters[1];\n\n\t\t$find = array('$CI->', '$this->', '<?php endforeach', '<?php endif', '<?php echo ', '<?php ', '<?=');\n\t\t$replace = array('$', '$', $l_delim.'/foreach', $l_delim.'/if', $l_delim, $l_delim, $l_delim);\n\n\t\t// translate HTML comments NOT! Javascript\n\t\t\n\t\t// close ending php\n\t\t$str = preg_replace('#([:|;])?\\s*\\?>#U', $r_delim.'$3', $str);\n\n\t\t$str = str_replace($find, $replace, $str);\n\t\t\n\t\t// TODO javascript escape... commented out because it's problematic... will need to revisit if it makes sense'\n\t\t//$str = preg_replace('#((?<!\\{literal\\}).*)<script(.+)>(.+)<\\/script>.*(?!\\{\\\\\\literal\\})#Us', \"$1\\n{literal}\\n<script$2>$3</script>\\n{\\literal}\\n\", $str);\n\t\t\n\t\t// foreach cleanup\n\t\t$str = preg_replace('#'.$l_delim.'\\s*foreach\\s*\\((\\$\\w+)\\s+as\\s+\\$(\\w+)\\s*(=>\\s*\\$(\\w+))?\\)\\s*'.$r_delim.'#U', $l_delim.'foreach $1 $2 $4'.$r_delim, $str); // with and without keys\n\n\t\t// remove !empty\n\t\t$callback = function($matches) use ($l_delim) {\n\t\t\tif (!empty($matches[2]))\n\t\t\t{\n\t\t\t\treturn $l_delim.$matches[1].$matches[3];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $l_delim.$matches[1].\"!\".$matches[3];\n\t\t\t}\n\t\t};\n\t\t\n\t\t$str = preg_replace_callback('#'.$l_delim.'(.+)(!)\\s*?empty\\((.+)\\)#U', $callback, $str);\n\t\t\n\t\t// remove parenthesis from within if conditional\n\t\t$callback2 = function($matches) {\n\t\t\t$CI =& get_instance();\n\t\t\t$allowed_funcs = $CI->fuel->config(\"parser_allowed_functions\");\n\t\t\t$str = $matches[0];\n\t\t\t$ldlim = \"___<\";\n\t\t\t$rdlim = \">___\";\n\n\t\t\t// loop through all allowed function and escape any parenthesis\n\t\t\tforeach($allowed_funcs as $func)\n\t\t\t{\n\t\t\t\t$regex = \"#(.*)\".preg_quote($func).\"\\((.*)\\)(.*)#U\";\n\t\t\t\t$str = preg_replace($regex, \"$1\".$func.$ldlim.\"$2\".$rdlim.\"$3\", $str);\n\t\t\t}\n\n\t\t\t// now replace any other parenthesis\n\t\t\t$str = str_replace(array(\"(\", \")\"), array(\" \", \"\"), $str);\n\t\t\t$str = str_replace(array($ldlim, $rdlim), array(\"(\", \")\"), $str);\n\t\t\treturn $str;\n\t\t};\n\t\t\n\t\t$str = preg_replace_callback('#'.$l_delim.'if.+'.$r_delim.'#U', $callback2, $str);\n\t\t// fix arrays\n\t\t$callback = function($matches){\n\t\t\tif (strstr($matches[0], \"=>\"))\n\t\t\t{\n\t\t\t\t$key_vals = explode(\",\", $matches[0]);\n\t\t\t\t$return_arr = array();\n\t\t\t\tforeach($key_vals as $val)\n\t\t\t\t{\n\t\t\t\t\t@list($k, $v) = explode(\"=>\", $val);\n\t\t\t\t\t$k = str_replace(array(\"\\\"\", \"\\'\"), \"\", $k);\n\t\t\t\t\t$return_arr[] = trim($k).\"=\".trim($v);\n\t\t\t\t}\n\t\t\t\t$return = implode(\" \", $return_arr);\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t\treturn $matches[0];\n\t\t\t};\n\t\t\n\t\t$str = preg_replace_callback('#(array\\()(.+)(\\))#U', $callback, $str);\n\t\treturn $str;\n\t}",
"private function strip_tags_php(&$code){\n\t\t$code = preg_replace(array(\"#<([\\?%])=?.*?\\1>#s\", \"#<\\?php(?:\\r\\n?|[ \\n\\t]).*?\\?>#s\"), '', $code);\n\t}",
"public function prependCode($code)\n {\n return $this->prependOutput($this->closePhpCode($this->openPhpCode($code)));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To check the user is exsist or not by number | public function checkUserByNumber($number){
if(!isset($number)){
die("RegisterController::checkUserByNumber The user number must be exsist!!");
}
$user = new User();
$datas = array('number' => $number);
$row = $this->_databaseutils->fetchData($user, $this->db, $datas);
$flag = isset($row);
parent::unsetAll(array($user,$datas,$row));
return $flag;
} | [
"private function validateUserID(){\n if(is_numeric($this->user_id)){\n return true;\n }else{\n return false;\n }\n }",
"function check_student_number()\n {\n $this->form_validation->set_rules('studentNumber', 'Student Number', 'trim|required|xss_clean|exact_length[6]|integer');\n\n if ($this->form_validation->run() == FALSE)\n {\n print('Student Number must be 6 digits long i.e. 123456.');\n }\n else\n {\n $student_number = $this->input->post('studentNumber');\n $user_id = $this->input->post('userID');\n\n $result = $this->users_model->is_student_number_unique($user_id, $student_number);\n if ($result)\n {\n print('This Student Number is already being used.');\n }\n else\n {\n return true;\n }\n }\n }",
"function esNum($numero){\r\n if(intval($numero) && is_numeric($numero)){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }",
"public function checkUserAgreement($int)\n {\n\n if (isset($int) && $int !== 0) {\n return true;\n }\n return false;\n }",
"function validarnumero($numero){ \n\tif($numero=='0'){\n\t\t\n\t}else{\n\t\tif(is_numeric($numero)) {\n\t\t //si es un numero no dice nada\n\t\t} else {\n\t\t\treturn TRUE;\n\t\t}\n\t}\n \n}",
"private function checkNumbersOnly(): void\n {\n $this->passwordScore['calculatedData']['numbersOnly']['value'] = 0;\n $this->passwordScore['calculatedData']['numbersOnly']['count'] = 'no';\n $this->passwordScore['calculatedData']['numbersOnly']['displayName'] = 'Numbers Only';\n\n if (is_numeric($this->password)) {\n $this->passwordScore['calculatedData']['numbersOnly']['value'] = -10;\n $this->passwordScore['calculatedData']['numbersOnly']['count'] = 'yes';\n }\n }",
"function validNumberInput($value){\n return is_numeric($value);\n }",
"function verifyValidationNum($validation_num) {\n\n\t//Check if user already requested ID\n\t$query = sprintf(\"SELECT valid_num FROM cla_valid_nums WHERE valid_num = '%s'\",\n\t\t\t\tmysql_real_escape_string($validation_num));\n\t$result = mysql_query($query);\n\tif(mysql_num_rows($result) != 0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n\n}",
"function validaNumero ($numero){\n\treturn is_numeric($numero);\n}",
"function checkPersonalNumberIfUsed($personalNumber){\n $personalNumberError=\"\";\n if(!empty($personalNumber)){\n $pdo = $this->pdo;\n $stmt = $pdo->prepare('SELECT peronalNumber FROM tblBasicInformation WHERE peronalNumber = ? limit 1');\n $stmt->execute([$personalNumber]);\n if($stmt->rowCount() > 0){\n $personalNumberError=\"This personal number is used by other\";\n }\n }\n return $personalNumberError;\n }",
"public function mobile_number($num) {\n \t$id = $this->uri->segment(4);\n \t$number = $this->admin_model->getMobileNumber($this->users,$id,$num);\n if ($number == $num) {\n $this->form_validation->set_message('mobile_number', 'The {field} field exists for one of the user.');\n return FALSE;\n }\n else {\n return TRUE;\n }\n }",
"private function validateNumber()\n\t{\n\t\tif(!is_numeric($this->testValue))\n\t\t{\n\t\t\t$this->returnData['type']='error';\n\t\t\t$this->returnData['message'] = 'The field does not consist of all numbers.';\n\t\t\t$this->returnData['valid'] = false;\n\t\t}\n\t}",
"function IsImportantNumber($n)\n\t{\n\t\tif($n == 10 || $n == 25 || $n % 50 == 0)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}",
"function twilio_rules_condition_number_belongs_to_user($number) {\n return twilio_verify_number($number);\n}",
"function numberOrCallback(){\n\t\tif(isset($this->data[$this->alias]['roll'])){\n\t\t\t$roll = $this->data[$this->alias]['roll'];\n\t\t\tif(is_int($roll) || preg_match('/^\\d+$/', $roll)) {\n\t\t\t\tif($roll > 0 && $roll <= 100){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} elseif (strpos($roll,'::')) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"function validar($num){\r\n if(is_numeric($num)) {\r\n echo \"El caracter introducido es número\";\r\n }\r\n else{\r\n echo \"El caracter introducido no es número\";\r\n }\r\n}",
"public function isValid($number);",
"function checkNumeroIntero($numero){\n if(empty($numero)){ return false;}\n if (!preg_match('/^[0-9]+$/', $numero)) {\n return false;\n } else {return true;}\n }",
"function validCaptchaNumber($number) {\n // $number = number entered by user for validation (example: $_POST['captchaNumber'])\n $result = (isset ($_SESSION['captchaNumber']) && $_SESSION['captchaNumber'] == $number) ? true : false;\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CKO admin order management settings fields | public static function order_settings()
{
$settings = array(
'order_setting' => array(
'title' => __( 'Order Management settings', 'checkoutcom-cards-settings' ),
'type' => 'title',
'description' => '',
),
'ckocom_order_authorised' => array(
'id' => 'ckocom_order_authorised',
'title' => __('Authorised Order Status', 'checkoutcom-cards-settings'),
'type' => 'select',
'desc_tip' => true,
'options' => wc_get_order_statuses(),
'default' => 'wc-on-hold',
'desc' => __('Select the status that should be used for orders with successful payment authorisation', 'checkoutcom-cards-settings'),
),
'ckocom_order_captured' => array(
'id' => 'ckocom_order_captured',
'title' => __('Captured Order Status', 'checkoutcom-cards-settings'),
'type' => 'select',
'desc_tip' => true,
'options' => wc_get_order_statuses(),
'default' => 'wc-processing',
'desc' => __('Select the status that should be used for orders with successful payment capture', 'checkoutcom-cards-settings'),
),
'ckocom_order_void' => array(
'id' => 'ckocom_order_void',
'title' => __('Void Order Status', 'checkoutcom-cards-settings'),
'type' => 'select',
'desc_tip' => true,
'options' => wc_get_order_statuses(),
'default' => 'wc-cancelled',
'desc' => __('Select the status that should be used for orders that have been voided', 'checkoutcom-cards-settings'),
),
'ckocom_order_flagged' => array(
'id' => 'ckocom_order_flagged',
'title' => __('Flagged Order Status', 'checkoutcom-cards-settings'),
'type' => 'select',
'desc_tip' => true,
'options' => wc_get_order_statuses(),
'default' => 'wc-flagged',
'desc' => __('Select the status that should be used for flagged orders', 'checkoutcom-cards-settings'),
),
'ckocom_order_refunded' => array(
'id' => 'ckocom_order_refunded',
'title' => __('Refunded Order Status', 'checkoutcom-cards-settings'),
'type' => 'select',
'desc_tip' => true,
'options' => wc_get_order_statuses(),
'default' => 'wc-refunded',
'desc' => __('Select the status that should be used for new orders with successful payment refund', 'checkoutcom-cards-settings'),
),
);
return apply_filters( 'wc_checkout_com_cards', $settings );
} | [
"function admin_edit_order() {\n\t\t//\n\t}",
"function wc_display_custom_billing_fields_admin_order( $order ) {\r\n\twc_get_custom_fields_for_admin_order( $order, array( 'billing' ) );\r\n}",
"public function settings_tab() {\n\t\twoocommerce_admin_fields( self::get_settings() );\n\t}",
"function settings_tab() {\n\twoocommerce_admin_fields( get_settings() );\n}",
"function show_settings_tab(){\n woocommerce_admin_fields($this->get_settings());\t\t\n }",
"public function add_settings(){\n woocommerce_admin_fields( self::get_settings() );\n }",
"function uc_econt_admin_settings() {\n $form = array();\n $pickup_addr_uc = (array) variable_get('uc_quote_store_default_address', new stdClass());\n// $pickup_addr_econt = _uc_econt_get_address($pickup_addr_uc);\n $url_options = array(t('Demo mode'), t('Live mode'));\n $instruction_returns = array(0 => t('Disabled'), 'shipping_returns' => t('Shipping and returns'), 'returns' => t('Returns'));\n $receipt = array('none' => t('Disabled'), 'dc' => t('Acknowledgment - DC'), 'dc_cp' => t('Acknowledgment + stock receipt - DC-CP'));\n $extra_declared_value = array(0 => t('Disabled'), 1 => t('Always On'), 2 => t('Users choose'));\n \n $country_name = db_result(db_query(\"SELECT country_name FROM {uc_countries} WHERE country_id = '%s'\", $pickup_addr_uc['country']));\n \n $form['econt'] = array(\n '#type' => 'fieldset',\n '#title' => t('Econt shipping options'),\n// '#description' => 'fieldset description',\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#weight' => '-1',\n );\n $form['econt']['pickup'] = array(\n '#type' => 'item',\n '#title' => t('Pickup address status'),\n '#value' => _econt_check_default_store_address(),\n '#description' => t('Econt shipping will be active only if default pickup address\n was filled on <a href=\"@url\">Shipping quote settings</a> page and it is located in Bulgaria, !!! Current country is @country',\n array('@url' => url('admin/store/settings/quotes/edit'), '@country' => $country_name)),\n '#weight' => '1',\n );\n \n $form['econt']['uc_econt_eecont_url'] = array(\n '#type' => 'select',\n '#title' => t('Calculate delivery mode'),\n '#options' => $url_options,\n '#default_value' => variable_get('uc_econt_eecont_url', 'Demo mode'),\n '#description' => t(\"To test calculating delivery use Demo mode.\"),\n );\n /*\n $form['econt']['uc_econt_insurance'] = array(\n '#type' => 'checkbox',\n '#title' => t('Insurance'),\n '#default_value' => variable_get('uc_econt_insurance', '1'),\n '#description' => t('Insurance consignment'),\n '#weight' => '2',\n );*/\n $form['econt']['uc_econt_send_delivery_from'] = array(\n '#type' => 'radios',\n '#title' => t('Send delivery from'),\n '#default_value' => variable_get('uc_econt_send_delivery_from', '0'),\n '#options' => array(t('door'), t('Econt office')),\n '#description' => t('Send a consignment of Еcont office, or from your store door.'),\n '#weight' => '3',\n );\n $form['econt']['uc_econt_shop_pay_delivery'] = array(\n '#type' => 'textfield',\n '#title' => t('The Delivery is on behalf of the shop'),\n '#default_value' => variable_get('uc_econt_shop_pay_delivery', ''),\n '#description' => t('Delivery is charged to the store when the contract value is greater than this value, where less is paid by the customer. Value zero /0/ = always at the expense of Store. Blank field = always on behalf of Client.'),\n '#size' => 5,\n '#field_suffix' => variable_get('uc_currency_sign', ''),\n '#weight' => '4',\n );\n $form['econt']['uc_econt_fixed_price'] = array(\n '#type' => 'textfield',\n '#title' => t('Fixed delivery price'),\n '#default_value' => variable_get('uc_econt_fixed_price', '0'),\n '#description' => t('If ECONT website is unreachable to generate the price of delivery, this price is used as a ECONT delivery price.'),\n '#size' => 5,\n '#field_suffix' => variable_get('uc_currency_sign', ''),\n '#weight' => '5',\n );\n $form['econt']['uc_econt_sms_notification'] = array(\n '#type' => 'checkbox',\n '#title' => t('Sms notification of shipment'),\n '#default_value' => variable_get('uc_econt_sms_notification', '1'),\n '#description' => t('Sms notification of the store for a shipment.'),\n '#weight' => '6',\n );\n \n $form['econt']['uc_econt_invoice_before_pay'] = array(\n '#type' => 'checkbox',\n '#title' => t('Invoice before pay CD'),\n '#default_value' => variable_get('uc_econt_invoice_before_pay', '1'),\n '#description' => t('Enable uc_econt_invoice_before_pay.'),\n '#weight' => '7',\n );\n $form['econt']['uc_econt_pay_after_accept'] = array(\n '#type' => 'checkbox',\n '#title' => t('Pay after accept'),\n '#default_value' => variable_get('uc_econt_pay_after_accept', '1'),\n '#description' => t('Orders consignment to be inspected by the recipient and pay cash on delivery only if you ACCEPT my product.'),\n '#weight' => '8',\n );\n $form['econt']['uc_econt_pay_after_test'] = array(\n '#type' => 'checkbox',\n '#title' => t('Pay after test'),\n '#default_value' => variable_get('uc_econt_pay_after_test', '1'),\n '#description' => t('Orders consignment to be Inspected and Tested by recipient and to pay cash on delivery only if\nI accept the goods.'),\n '#weight' => '9',\n );\n \n $form['econt']['uc_econt_instruction_returns'] = array(\n '#type' => 'select',\n '#title' => t('Pay for a canceled item'),\n '#options' => $instruction_returns,\n '#default_value' => variable_get('uc_econt_instruction_returns', 'returns'),\n '#description' => t('When refused shipment on account of the sender is the cost of selected activities. When Disabled, all expenses are charged to the customer.'),\n '#weight' => '10',\n );\n $form['econt']['uc_econt_receipt'] = array(\n '#type' => 'select',\n '#title' => t('Receipts'),\n '#options' => $receipt,\n '#default_value' => variable_get('uc_econt_receipt', '0'),\n '#description' => t('Acknowledgment DC / Acknowledgment + stock receipt DC-CP for shipping product.'),\n '#weight' => '10',\n );\n $form['econt']['uc_econt_dp'] = array(\n '#type' => 'checkbox',\n '#title' => t('Two-way shipment - DP'),\n '#default_value' => variable_get('uc_econt_dp', '1'),\n '#description' => t('Two-way shipment.'),\n '#weight' => '13',\n );\n \n $form['econt']['uc_econt_credit_customer_number'] = array(\n '#type' => 'textfield',\n '#title' => t('Econt customer number of credit payment'),\n '#default_value' => variable_get('uc_econt_credit_customer_number', ''),\n '#description' => t('Customer number for payment of the supply of credit by the sender. <a href=\"@url\">Agreement.</a>', array('@url' => url('http://www.econt.com/dogovoreni_usloviq/'))),\n '#size' => 10,\n //'#field_suffix' => variable_get('uc_currency_sign', ''),\n '#weight' => '14',\n );\n $form['econt']['uc_econt_cod_agreement_number'] = array(\n '#type' => 'textfield',\n '#title' => t('Agreement number for COD'),\n '#default_value' => variable_get('uc_econt_cod_agreement_number', ''),\n '#description' => t('Number of payment for COD.'),\n '#size' => 10,\n //'#field_suffix' => variable_get('uc_currency_sign', ''),\n '#weight' => '15',\n );\n //Econt shipping Extra customer fields\n $form['customer_extra'] = array(\n '#type' => 'fieldset',\n '#title' => t('Econt Extra customer options'),\n '#description' => t('On the next fields, if enabled here customer will choose or set these options on checkout pane.'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n $form['customer_extra']['uc_econt_extra_date_priority'] = array(\n '#type' => 'checkbox',\n '#title' => t('Date priority'),\n '#default_value' => variable_get('uc_econt_extra_date_priority', '1'),\n '#description' => t('Enable the date priority.'),\n '#weight' => '1',\n );\n $form['customer_extra']['uc_econt_extra_time_priority'] = array(\n '#type' => 'checkbox',\n '#title' => t('Time priority'),\n '#default_value' => variable_get('uc_econt_extra_time_priority', '1'),\n '#description' => t('Enable the time priority.'),\n '#weight' => '2',\n );\n $form['customer_extra']['uc_econt_extra_declared_value'] = array(\n '#type' => 'select',\n '#title' => t('Declared value'),\n '#options' => $extra_declared_value,\n '#default_value' => variable_get('uc_econt_extra_declared_value', '0'),\n '#description' => t('Enable the field for declared value.'),\n '#weight' => '3',\n );\n $form['customer_extra']['uc_econt_auto_declared_value'] = array(\n '#type' => 'textfield',\n '#title' => t('Auto declared value'),\n '#default_value' => variable_get('uc_econt_auto_declared_value', '0'),\n '#description' => t('Automatically enable option \"declared value\" for orders over that amount.'),\n '#size' => 5,\n '#field_suffix' => variable_get('uc_currency_sign', ''),\n '#weight' => '4',\n );\n $form['customer_extra']['uc_econt_extra_city_express'] = array(\n '#type' => 'checkbox',\n '#title' => t('Express services'),\n '#default_value' => variable_get('uc_econt_extra_city_express', '1'),\n '#description' => t('Enable city express / intercity express courier.'),\n '#weight' => '5',\n );\n //eEcont profile user\n $form['e_econt_client'] = array(\n '#type' => 'fieldset',\n '#title' => t('e-Econt client login data'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n $form['e_econt_client']['uc_econt_e_econt_client_username'] = array(\n '#type' => 'textfield',\n '#title' => t('e-Econt username'),\n '#default_value' => variable_get('uc_econt_e_econt_client_username', 'demo'),\n '#description' => t('Client username on e-Econt profile'),\n '#size' => 15,\n );\n $form['e_econt_client']['uc_econt_e_econt_client_passwd'] = array(\n '#type' => 'password',\n '#title' => t('e-Econt password'),\n '#default_value' => variable_get('uc_econt_e_econt_client_passwd', 'demo'),\n '#description' => t('Client password on e-Econt profile, leave blank to not change current if it has been introduced.'),\n '#size' => 15,\n );\n \n $form['#submit'][] = 'uc_econt_admin_settings_form_submit';\n \n return system_settings_form($form);\n}",
"function show_settings_tab(){\n woocommerce_admin_fields($this->get_settings());\n }",
"function display_settings_tab() {\n\twoocommerce_admin_fields( get_settings() );\n}",
"public function admin_options()\n {\n echo '<h3>' . __('Oplata.com', 'kdc') . '</h3>';\n echo '<p>' . __('Payment gateway') . '</p>';\n echo '<table class=\"form-table\">';\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n echo '</table>';\n }",
"public function admin_options() {\n\t\t?>\n\t\t<h3>Custom Payment 1 <?php _e( 'Settings', 'woocommerce' ); ?></h3>\n <div id=\"poststuff\">\n\t\t\t\t<div id=\"post-body\" class=\"metabox-holder columns-2\">\n\t\t\t\t\t<div id=\"post-body-content\">\n\t\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t\t<?php $this->generate_settings_html();?>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n </div>\n <div class=\"clear\"></div>\n </div>\n<?php\n\t}",
"public function feed_settings_fields() {\n $default_settings = parent::feed_settings_fields();\n $form = $this->get_current_form();\n // Prepare customer information fields.\n $billing_info = parent::get_field( 'billingInformation', $default_settings );\n\n $billing_fields = $billing_info['field_map'];\n $add_first_name = true;\n $add_last_name = true;\n foreach ( $billing_fields as $mapping ) {\n //add first/last name if it does not already exist in billing fields\n if ( $mapping['name'] == 'firstName' ) {\n $add_first_name = false;\n } else if ( $mapping['name'] == 'lastName' ) {\n $add_last_name = false;\n }\n }\n\n if ( $add_last_name ) {\n //add last name\n array_unshift( $billing_info['field_map'], array( 'name' => 'lastName', 'label' => __( 'Last Name', 'gravityformspayxpert' ), 'required' => false ) );\n }\n if ( $add_first_name ) {\n array_unshift( $billing_info['field_map'], array( 'name' => 'firstName', 'label' => __( 'First Name', 'gravityformspayxpert' ), 'required' => false ) );\n }\n\n $billing_info['field_map'][] = array( 'name' => 'phone', 'label' => __( 'Phone', 'gravityformspayxpert' ), 'required' => false );\n\n $default_settings = parent::replace_field( 'billingInformation', $billing_info, $default_settings );\n\n return $default_settings;\n }",
"public function getStandardCheckoutFormFields ()\n {\n $order = $this->getOrder();\n if (!($order instanceof Mage_Sales_Model_Order)) {\n Mage::throwException($this->_getHelper()->__('Cannot retrieve order object'));\n }\n\n $billingAddress = $order->getBillingAddress();\n\n $streets = $billingAddress->getStreet();\n $street = isset($streets[0]) && $streets[0] != ''\n ? $streets[0]\n : (isset($streets[1]) && $streets[1] != '' ? $streets[1] : '');\n\n if ($this->getConfig()->getDescription()) {\n $transDescription = $this->getConfig()->getDescription();\n } else {\n $transDescription = Mage::helper('cashu')->__('Order #%s', $order->getRealOrderId());\n }\n\n if ($order->getCustomerEmail()) {\n $email = $order->getCustomerEmail();\n } elseif ($billingAddress->getEmail()) {\n $email = $billingAddress->getEmail();\n } else {\n $email = '';\n }\n\n $currency = Mage::app()->getStore()-> getCurrentCurrencyCode();\n if($currency != 'EGP'){\n $currencyrate = Mage::app()->getStore()->getCurrentCurrencyRate();\n $amount = round($order->getBaseGrandTotal()*(1/$currencyrate),2);\n }else{\n $amount = round($order->getBaseGrandTotal(),2);\n }\n \n\t\t// fields to send to cashu\n $fields = array(\n\t\t\t\t\t\t'merchant_id'\t => Mage::getSingleton('cashu/config')->getMerchantId(),\n\t\t\t\t\t\t//'currency'\t\t => Mage::app()->getStore()-> getCurrentCurrencyCode(), \n 'currency' => 'EGP', \n\t\t\t\t\t//\t'account_id' => Mage::getSingleton('cashu/config')->getAccountId(),\n 'product_name' => $transDescription,\n 'amount' \t => $amount,\n 'language' => $this->getConfig()->getLanguage(),\n 'f_name' => $billingAddress->getFirstname(),\n 's_name' => $billingAddress->getLastname(),\n 'street' => $street,\n 'city' => $billingAddress->getCity(),\n 'state' => $billingAddress->getRegionModel()->getCode(),\n 'decline_url' => $this->getFailureURL(),\n \t);\n\n if ($this->getConfig()->getDebug()) {\n $debug = Mage::getModel('cashu/api_debug')\n ->setRequestBody($this->getCashuUrl().\"\\n\".print_r($fields,1))\n ->save();\n $fields['cs2'] = $debug->getId();\n }\n\n return $fields;\n }",
"public function testUpdateOmsOrderCustomFields()\n {\n }",
"function init_form_fields() { \n // We will add our settings here\n $this->form_fields = array(\n \n 'enabled' => array(\n 'title' => __( 'Enable'),\n 'type' => 'checkbox',\n 'description' => __( 'Enable this shipping.'),\n 'default' => 'yes'\n ),\n \n 'title' => array(\n 'title' => __( 'Title'),\n 'type' => 'text',\n 'description' => __( 'Title to be display on site'),\n 'default' => __( 'Delivery')\n ),\n 'coast' => array(\n 'title' => __( 'Coast'),\n 'type' => 'text',\n 'description' => __( 'Coast'),\n 'default' => 1000\n ),\n \n );\n }",
"private function SetupOrderManagementForm($order=array())\n\t\t{\n\t\t\t$GLOBLS['CurrentTab'] = 0;\n\n\t\t\tif($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t\t$postData = $_POST;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$postData = $order;\n\t\t\t}\n\n\t\t\t$orderFields = array(\n\t\t\t\t'OrderBillFirstName'\t=> 'ordbillfirstname',\n\t\t\t\t'OrderBillLastName'\t\t=> 'ordbilllastname',\n\t\t\t\t'OrderBillCompany'\t\t=> 'ordbillcompany',\n\t\t\t\t'OrderBillPhone'\t\t=> 'ordbillphone',\n\t\t\t\t'OrderBillStreet1'\t\t=> 'ordbillstreet1',\n\t\t\t\t'OrderBillStreet2'\t\t=> 'ordbillstreet2',\n\t\t\t\t'OrderBillSuburb'\t\t=> 'ordbillsuburb',\n\t\t\t\t'OrderBillZip'\t\t\t=> 'ordbillzip',\n\t\t\t\t'OrderShipFirstName'\t=> 'ordshipfirstname',\n\t\t\t\t'OrderShipLastName'\t\t=> 'ordshiplastname',\n\t\t\t\t'OrderShipCompany'\t\t=> 'ordshipcompany',\n\t\t\t\t'OrderShipPhone'\t\t=> 'ordshipphone',\n\t\t\t\t'OrderShipStreet1'\t\t=> 'ordshipstreet1',\n\t\t\t\t'OrderShipStreet2'\t\t=> 'ordshipstreet2',\n\t\t\t\t'OrderShipSuburb'\t\t=> 'ordshipsuburb',\n\t\t\t\t'OrderShipZip'\t\t\t=> 'ordshipzip',\n\t\t\t\t'CustomerEmail'\t\t\t=> 'custconemail',\n\t\t\t\t'CustomerPassword'\t\t=> 'custpassword',\n\t\t\t\t'CustomerPassword2'\t\t=> 'custpassword2',\n\t\t\t\t'CustomerStoreCredit'\t=> 'custstorecredit',\n\t\t\t\t'CustomerGroup'\t\t\t=> 'custgroupid',\n\t\t\t\t'CustomerType'\t\t\t=> 'customerType',\n\t\t\t\t'OrderComments'\t\t\t=> 'ordcustmessage',\n\t\t\t\t'OrderNotes'\t\t\t=> 'ordnotes',\n\t\t\t\t'OrderId'\t\t\t\t=> 'orderid',\n\t\t\t\t'OrderTrackingNo'\t\t=> 'ordtrackingno',\n\t\t\t\t'AnonymousEmail'\t\t=> 'anonymousemail',\n\t\t\t);\n\n\t\t\t$GLOBALS['HideSelectedCustomer'] = 'display: none';\n\t\t\t$GLOBALS['HideCustomerSearch'] = '';\n\t\t\t$GLOBALS['HideAddressSelects'] = 'display: none';\n\n\t\t\tif(isset($postData['ordcustid']) && $postData['ordcustid'] > 0) {\n\t\t\t\t$GLOBALS['CurrentTab'] = 1;\n\t\t\t\t$GLOBALS['CustomerType'] = 'existing';\n\t\t\t\t$query = \"\n\t\t\t\t\tSELECT *\n\t\t\t\t\tFROM [|PREFIX|]customers WHERE customerid='\".(int)$postData['ordcustid'].\"'\n\t\t\t\t\";\n\t\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\t\t$existingCustomer = $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\t\t\t\tif($existingCustomer['customerid']) {\n\t\t\t\t\t$GLOBALS['HideSelectedCustomer'] = '';\n\t\t\t\t\t$GLOBALS['HideCustomerSearch'] = 'display: none';\n\t\t\t\t\t$GLOBALS['HideHistoryLink'] = 'display: none';\n\n\t\t\t\t\t$GLOBALS['CustomerId'] = $existingCustomer['customerid'];\n\t\t\t\t\t$GLOBALS['CustomerFirstName'] = isc_html_escape($existingCustomer['custconfirstname']);\n\t\t\t\t\t$GLOBALS['CustomerLastName'] = isc_html_escape($existingCustomer['custconlastname']);\n\n\t\t\t\t\t$GLOBALS['CustomerPhone'] = '';\n\t\t\t\t\tif($existingCustomer['custconphone']) {\n\t\t\t\t\t\t$GLOBALS['CustomerPhone'] = isc_html_escape($existingCustomer['custconphone']) . '<br />';\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['CustomerEmail'] = '';\n\t\t\t\t\tif($existingCustomer['custconemail']) {\n\t\t\t\t\t\t$GLOBALS['CustomerEmail'] = '<a href=\"mailto:'.isc_html_escape($existingCustomer['custconemail']).'\">'.isc_html_escape($existingCustomer['custconemail']).'</a><br />';\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['CustomerCompany'] = '';\n\t\t\t\t\tif($existingCustomer['custconcompany']) {\n\t\t\t\t\t\t$GLOBALS['CustomerCompany'] = isc_html_escape($existingCustomer['custconcompany']).'<br />';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Grab the addresses\n\t\t\t\t\t$addresses = $this->LoadCustomerAddresses($existingCustomer['customerid']);\n\t\t\t\t\t$GLOBALS['AddressJson'] = 'OrderManager.LoadInAddresses('.isc_json_encode($addresses).');';\n\t\t\t\t\tif(!empty($addresses)) {\n\t\t\t\t\t\t$GLOBALS['HideAddressSelects'] = '';\n\t\t\t\t\t\t$GLOBALS['DisableAddressSelects'] = 'disabled=\"disabled\"';\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['SelectedCustomer'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('OrdersCustomerSearchResult');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(isset($postData['ordcustid']) && $postData['ordcustid'] == 0) {\n\t\t\t\tif(!isset($postData['customerType'])) {\n\t\t\t\t\t$GLOBALS['CurrentTab'] = 2;\n\t\t\t\t}\n\t\t\t\telse if($postData['customerType'] == 'anonymous') {\n\t\t\t\t\t$GLOBALS['CurrentTab'] = 2;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS['CurrenTab'] = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Customer and order custom fields\n\t\t\t */\n\t\t\t$GLOBALS['OrderCustomFormFieldsAccountFormId'] = FORMFIELDS_FORM_ACCOUNT;\n\t\t\t$GLOBALS['OrderCustomFormFieldsBillingFormId'] = FORMFIELDS_FORM_BILLING;\n\t\t\t$GLOBALS['OrderCustomFormFieldsShippingFormId'] = FORMFIELDS_FORM_SHIPPING;\n\t\t\t$GLOBALS['CustomFieldsAccountLeftColumn'] = '';\n\t\t\t$GLOBALS['CustomFieldsAccountRightColumn'] = '';\n\t\t\t$GLOBALS['CustomFieldsBillingColumn'] = '';\n\t\t\t$GLOBALS['CustomFieldsShippingColumn'] = '';\n\n\t\t\t$formIdx = array(FORMFIELDS_FORM_ACCOUNT, FORMFIELDS_FORM_BILLING, FORMFIELDS_FORM_SHIPPING);\n\n\t\t\t$fieldMap = array(\n\t\t\t\t'FirstName'\t\t=> 'firstname',\n\t\t\t\t'LastName'\t\t=> 'lastname',\n\t\t\t\t'Company'\t\t=> 'company',\n\t\t\t\t'Phone'\t\t\t=> 'phone',\n\t\t\t\t'AddressLine1'\t=> 'street1',\n\t\t\t\t'AddressLine2'\t=> 'street2',\n\t\t\t\t'City'\t\t\t=> 'suburb',\n\t\t\t\t'Zip'\t\t\t=> 'zip',\n\t\t\t\t'Country'\t\t=> 'country',\n\t\t\t\t'State'\t\t\t=> 'state'\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Now process the forms\n\t\t\t */\n\t\t\tforeach ($formIdx as $formId) {\n\t\t\t\t$formSessionId = 0;\n\t\t\t\tif ($formId == FORMFIELDS_FORM_ACCOUNT) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * We are only using the real custom fields for the account section, so check here\n\t\t\t\t\t */\n\t\t\t\t\tif (!gzte11(ISC_MEDIUMPRINT)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($existingCustomer['custformsessionid'])) {\n\t\t\t\t\t\t$formSessionId = $existingCustomer['custformsessionid'];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (isset($postData['ordformsessionid'])) {\n\t\t\t\t\t\t$formSessionId = $postData['ordformsessionid'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * This part here gets all the existing fields\n\t\t\t\t */\n\t\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t\t\t$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields($formId, true);\n\t\t\t\t} else if (isId($formSessionId)) {\n\t\t\t\t\t$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields($formId, false, $formSessionId);\n\t\t\t\t} else {\n\t\t\t\t\t$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields($formId);\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Get any selected country and state. This needs to be separate as we physically\n\t\t\t\t * print out each form field at a time so we need this information before hand\n\t\t\t\t */\n\t\t\t\tif ($formId !== FORMFIELDS_FORM_ACCOUNT) {\n\t\t\t\t\t$countryId = GetCountryIdByName(GetConfig('CompanyCountry'));\n\t\t\t\t\t$stateFieldId = 0;\n\t\t\t\t\tforeach (array_keys($fields) as $fieldId) {\n\t\t\t\t\t\tif (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'state') {\n\t\t\t\t\t\t\t$stateFieldId = $fieldId;\n\t\t\t\t\t\t} else if (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'country') {\n\t\t\t\t\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t\t\t\t\t\t$country = $fields[$fieldId]->getValue();\n\t\t\t\t\t\t\t} if ($formId == FORMFIELDS_FORM_BILLING) {\n\t\t\t\t\t\t\t\t$country = @$order['ordbillcountry'];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$country = @$order['ordshipcountry'];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (trim($country) !== '') {\n\t\t\t\t\t\t\t\t$countryId = GetCountryIdByName($country);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Now we construct and build each form field\n\t\t\t\t */\n\t\t\t\t$column = 0;\n\t\t\t\tforeach (array_keys($fields) as $fieldId) {\n\n\t\t\t\t\tif ($formId == FORMFIELDS_FORM_ACCOUNT) {\n\n\t\t\t\t\t\tif ($fields[$fieldId]->record['formfieldprivateid'] !== '' || !gzte11(ISC_MEDIUMPRINT)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$fieldHTML = $fields[$fieldId]->loadForFrontend();\n\n\t\t\t\t\t\tif (($column%2) > 0) {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsAccountLeftColumn';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsAccountRightColumn';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * We are using all the custom fields for the billing/shipping are, so check here\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (!gzte11(ISC_MEDIUMPRINT) && $fields[$fieldId]->record['formfieldprivateid'] == '') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($formId == FORMFIELDS_FORM_BILLING) {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsBillingColumn';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsShippingColumn';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Set the value for the private fields if this is NOT a post\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif ($_SERVER['REQUEST_METHOD'] !== 'POST' && $fields[$fieldId]->record['formfieldprivateid'] !== '') {\n\n\t\t\t\t\t\t\t$key = @$fieldMap[$fields[$fieldId]->record['formfieldprivateid']];\n\t\t\t\t\t\t\tif (trim($key) !== '') {\n\t\t\t\t\t\t\t\tif ($formId == FORMFIELDS_FORM_BILLING) {\n\t\t\t\t\t\t\t\t\t$key = 'ordbill' . $key;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$key = 'ordship' . $key;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (array_key_exists($key, $order)) {\n\t\t\t\t\t\t\t\t\t$fields[$fieldId]->setValue($order[$key]);\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\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add in any of the country/state lists if needed\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'country') {\n\t\t\t\t\t\t\t$fields[$fieldId]->setOptions(array_values(GetCountryListAsIdValuePairs()));\n\n\t\t\t\t\t\t\tif ($fields[$fieldId]->getValue() == '') {\n\t\t\t\t\t\t\t\t$fields[$fieldId]->setValue(GetConfig('CompanyCountry'));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$fields[$fieldId]->addEventHandler('change', 'FormFieldEvent.SingleSelectPopulateStates', array('countryId' => $fieldId, 'stateId' => $stateFieldId, 'inOrdersAdmin' => true));\n\n\t\t\t\t\t\t} else if (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'state' && isId($countryId)) {\n\t\t\t\t\t\t\t$stateOptions = GetStateListAsIdValuePairs($countryId);\n\t\t\t\t\t\t\tif (is_array($stateOptions) && !empty($stateOptions)) {\n\t\t\t\t\t\t\t\t$fields[$fieldId]->setOptions($stateOptions);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * We also do not what these fields\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'savethisaddress' || isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'shiptoaddress') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS[$varname] .= $fields[$fieldId]->loadForFrontend() . \"\\n\";\n\t\t\t\t\t$column++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Add this to generate our JS event script\n\t\t\t */\n\t\t\t$GLOBALS['FormFieldEventData'] = $GLOBALS['ISC_CLASS_FORM']->buildRequiredJS();\n\n\t\t\t/**\n\t\t\t * Do we display the customer custom fields?\n\t\t\t */\n\t\t\tif (!gzte11(ISC_MEDIUMPRINT)) {\n\t\t\t\t$GLOBALS['HideCustomFieldsAccountLeftColumn'] = 'none';\n\t\t\t\t$GLOBALS['HideCustomFieldsAccountRightColumn'] = 'none';\n\t\t\t} else {\n\t\t\t\tif ($GLOBALS['CustomFieldsAccountLeftColumn'] == '') {\n\t\t\t\t\t$GLOBALS['HideCustomFieldsAccountLeftColumn'] = 'none';\n\t\t\t\t}\n\n\t\t\t\tif ($GLOBALS['CustomFieldsAccountRightColumn'] == '') {\n\t\t\t\t\t$GLOBALS['HideCustomFieldsAccountRightColumn'] = 'none';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$defaultValues = array(\n\t\t\t\t'custgroupid' => 0,\n\t\t\t\t'ordstatus' => 7\n\t\t\t);\n\n\t\t\tforeach($defaultValues as $postField => $default) {\n\t\t\t\tif(!isset($postData[$postField])) {\n\t\t\t\t\t$postData[$postField] = $default;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($orderFields as $templateField => $orderField) {\n\t\t\t\tif(!isset($postData[$orderField])) {\n\t\t\t\t\t$GLOBALS[$templateField] = '';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS[$templateField] = isc_html_escape($postData[$orderField]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(isset($postData['ordbillsaveAddress'])) {\n\t\t\t\t$GLOBALS['OrderBillSaveAddress'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\tif(isset($postData['ordshipsaveAddress'])) {\n\t\t\t\t$GLOBALS['OrderShipSaveAddress'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\tif(isset($postData['shippingUseBilling'])) {\n\t\t\t\t$GLOBALS['ShippingUseBillingChecked'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\tif(isset($postData['billingUseShipping'])) {\n\t\t\t\t$GLOBALS['BillingUseShippingChecked'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\t$GLOBALS['OrderStatusOptions'] = $this->GetOrderStatusOptions($postData['ordstatus']);\n\n\t\t\t$customerClass = GetClass('ISC_ADMIN_CUSTOMERS');\n\t\t\t$GLOBALS['CustomerGroupOptions'] = $customerClass->GetCustomerGroupsAsOptions($postData['custgroupid']);\n\n\t\t\t$GLOBALS['PaymentMethodsList'] = $this->GetPaymentProviderList($postData);\n\n\t\t\tif(!empty($order)) {\n\t\t\t\t$GLOBALS['HideEmailInvoice'] = 'display: none';\n\t\t\t}\n\t\t\telse if(isset($postData['emailinvoice'])) {\n\t\t\t\t$GLOBALS['EmailInvoiceChecked'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\t$GLOBALS['Message'] = GetFlashMessageBoxes();\n\t\t}",
"function editable_order_custom_field($order)\n\t\t{\n\n\t\t\t// Get custom post meta data from post_metadata\n\t\t\t$updated_delivery_type = $order->get_meta('_delivery_type');\n\t\t\t$updated_advance_payment = $order->get_meta('_advance_payment');\n\t\t\t$updated_call_status = $order->get_meta('_call_status');\n\n\t\t\t// Replace or update if data exist\n\t\t\t$deliveryType = $updated_delivery_type ? $updated_delivery_type : (isset($item_value) ? $item_value : '');\n\t\t\t$advancePayment = $updated_advance_payment ? $updated_advance_payment : (isset($item_value) ? $item_value : '');\n\t\t\t$CallStatus = $updated_call_status ? $updated_call_status : (isset($item_value) ? $item_value : '');\n\n\t\t\t// Display the custom editable field\n\t\t\twoocommerce_wp_select(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => 'delivery_type',\n\t\t\t\t\t'label' => __(\"Delivery Type:\", \"woocommerce\"),\n\t\t\t\t\t'value' => $deliveryType,\n\t\t\t\t\t'wrapper_class' => 'form-field-wide',\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'' => __('Select One', 'woocommerce'),\n\t\t\t\t\t\t'sundarban' => __('Sundarban', 'woocommerce'),\n\t\t\t\t\t\t'pathao' => __('Pathao', 'woocommerce'),\n\t\t\t\t\t\t'redx' => __('Redx', 'woocommerce')\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\twoocommerce_wp_select(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => 'call_status',\n\t\t\t\t\t'label' => __(\"Call Status:\", \"woocommerce\"),\n\t\t\t\t\t'value' => $CallStatus,\n\t\t\t\t\t'wrapper_class' => 'form-field-wide',\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'' => __('Select One', 'woocommerce'),\n\t\t\t\t\t\t'yes' => __('Yes', 'woocommerce'),\n\t\t\t\t\t\t'no' => __('No', 'woocommerce'),\n\t\t\t\t\t\t'wfc' => __('Waiting for Confirmation', 'woocommerce')\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t\n\t\t\t);\n\n\t\t\twoocommerce_wp_text_input(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => 'advance_payment',\n\t\t\t\t\t'label' => __(\"Advance Payment:\", \"woocommerce\"),\n\t\t\t\t\t'value' => $advancePayment,\n\t\t\t\t\t'wrapper_class' => 'form-field-wide',\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'min'\t\t=> '0'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// //get order status\n\t\t\t// $orderStatus = $order->get_status();\n\t\t\t// //readonly option\n\t\t\t// $readonly = array('readonly' => 'readonly');\n\n\t\t\t// //echo $orderStatus;\n\t\t\t// //if order not on hold advance payment \n\t\t\t// if($orderStatus == 'on-hold'){\n\t\t\t// \twoocommerce_wp_text_input(\n\t\t\t// \t\tarray(\n\t\t\t// \t\t\t'id' => 'advance_payment',\n\t\t\t// \t\t\t'label' => __(\"Advance Payment:\", \"woocommerce\"),\n\t\t\t// \t\t\t'value' => $advancePayment,\n\t\t\t// \t\t\t'wrapper_class' => 'form-field-wide',\n\t\t\t// \t\t\t'type' => 'number',\n\t\t\t// \t\t\t'min'\t\t\t=> 0\n\t\t\t// \t\t)\n\t\t\t// \t);\n\t\t\t// }else{\n\t\t\t// \twoocommerce_wp_text_input(\n\t\t\t// \t\tarray(\n\t\t\t// \t\t\t'id' => 'advance_payment',\n\t\t\t// \t\t\t'label' => __(\"Advance Payment:\", \"woocommerce\"),\n\t\t\t// \t\t\t'value' => $advancePayment,\n\t\t\t// \t\t\t'wrapper_class' => 'form-field-wide',\n\t\t\t// \t\t\t'type' => 'number',\n\t\t\t// \t\t\t'custom_attributes' => $readonly,\n\t\t\t// \t\t)\n\t\t\t// \t);\n\t\t\t// }\n\n\t\t\t\n\t\t}",
"function ground_woocommerce_admin_order_billing_fields( $fields ) {\n\n\tglobal $post;\n\t$order = wc_get_order( $post->ID );\n\t$order_data = $order->get_meta( '_billing_invoice' );\n\n\tif ( '1' === $order_data ) {\n\n\t\t// Remove fields.\n\t\tunset( $fields['billing_first_name'] );\n\t\tunset( $fields['billing_last_name'] );\n\t\tunset( $fields['billing_address_1'] );\n\t\tunset( $fields['billing_address_2'] );\n\t\tunset( $fields['billing_city'] );\n\t\tunset( $fields['billing_postcode'] );\n\t\tunset( $fields['billing_country'] );\n\t\tunset( $fields['billing_state'] );\n\n\t\t$fields['customer_type'] = array(\n\t\t\t'label' => __( 'Tipologia cliente', 'ground' ),\n\t\t\t'show' => true,\n\t\t\t'type' => 'select',\n\t\t\t'options' => array(\n\t\t\t\t'azienda' => __( 'Società', 'ground' ),\n\t\t\t\t'individuale' => __( 'Ditta individuale/Professionista', 'ground' ),\n\t\t\t\t'pubblico' => __( 'Pubblica amministrazione', 'ground' ),\n\t\t\t\t'privato' => __( 'Cliente privato', 'ground' ),\n\t\t\t),\n\t\t);\n\n\t\t$fields['vat'] = array(\n\t\t\t'label' => __( 'P.IVA', 'ground' ),\n\t\t\t'show' => true,\n\t\t);\n\n\t\t$fields['fiscal_code'] = array(\n\t\t\t'label' => __( 'Codice fiscale', 'ground' ),\n\t\t\t'show' => true,\n\t\t);\n\n\t\t$fields['sdi'] = array(\n\t\t\t'label' => __( 'Codice destinatario (SDI)', 'ground' ),\n\t\t\t'show' => true,\n\t\t);\n\n\t\t$fields['pec'] = array(\n\t\t\t'label' => __( 'Pec', 'ground' ),\n\t\t\t'show' => true,\n\t\t);\n\t} else {\n\t\t$fields = array();\n\t}\n\n\treturn $fields;\n}",
"function domica_custom_checkout_fields( $fields ) {\n $fields['billing']['billing_first_name']['placeholder'] = 'FIRST NAME';\n $fields['billing']['billing_first_name']['label'] = '';\n $fields['billing']['billing_last_name']['placeholder'] = 'LAST NAME';\n $fields['billing']['billing_last_name']['label'] = '';\n $fields['billing']['billing_phone']['placeholder'] = 'PHONE NUMBER';\n $fields['billing']['billing_phone']['label'] = '';\n $fields['billing']['billing_email']['placeholder'] = 'EMAIL ID';\n $fields['billing']['billing_email']['label'] = '';\n $fields['billing']['billing_country']['placeholder'] = 'COUNTRY';\n $fields['billing']['billing_country']['label'] = '';\n $fields['billing']['billing_state']['placeholder'] = 'STATE';\n $fields['billing']['billing_state']['label'] = '';\n $fields['billing']['billing_address_1']['placeholder'] = 'STREET';\n $fields['billing']['billing_address_1']['label'] = '';\n $fields['billing']['billing_address_2']['placeholder'] = 'APARTMENT';\n $fields['billing']['billing_address_2']['label'] = '';\n $fields['billing']['billing_city']['placeholder'] = 'CITY';\n $fields['billing']['billing_city']['label'] = '';\n $fields['billing']['billing_postcode']['placeholder'] = 'POSTAL CODE';\n $fields['billing']['billing_postcode']['label'] = '';\n $fields['billing']['billing_company']['placeholder'] = 'COMPANY NAME';\n $fields['billing']['billing_company']['label'] = '';\n $fields['order']['order_comments']['label'] = 'ORDER NOTE';\n return $fields;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if user search client reports by visit_reason | function search_by_visit_reason($rep_data, $visit){
// print_r($rep_data);
$content = array();
foreach($rep_data as $k => $data ){
$temp = json_decode($data['visit_reasons'], true);
if ($temp != false) {
$temp = implode(",", $temp);
if($temp!=","){
$visit_reason = explode(",", $temp);
for ($i=0; $i < count($visit_reason) ; $i++) {
if($visit_reason[$i] == $visit){
$content[] = array(
'record_number' => $data['record_number'],
'date_birth' => $data['date_birth'],
'client_type' => $data['client_type'],
'fullname' => $data['fullname'],
'province' => $data['province'],
'district' => $data['district'],
'office' => $data['office'],
'clinic_name' => $data['clinic_name'],
'date' => $data['date'],
'visit_reasons' => $data['visit_reasons'],
'ctr_consultation' => $data['ctr_consultation'],
'current_age' => $data['current_age'],
'age' => $data['age'],
"ID"=>$data['ID'] ?? null,
"client_id"=>$data['client_id'] ?? null,
"clinic_id"=>$data['clinic_id'] ?? null,
"date"=>$data['date'] ?? null,
"feeding_type"=>$data['feeding_type'] ?? null,
"visit_reasons"=>$visit ?? null,
"followup_type"=>$data['followup_type'] ?? null,
"record_type"=>$data['record_type'] ?? null,
"office_id"=>$data['office_id'] ?? null,
"record_number"=>$data['record_number'] ?? null,
"fname"=>$data['fname'] ?? null,
"lname"=>$data['lname'] ?? null,
"date_birth"=>$data['date_birth'] ?? null,
"date_death"=>$data['date_death'] ?? null,
"client_type"=>$data['client_type'] ?? null,
"phone"=>$data['phone'] ?? null,
"place_of_birth"=>$data['place_of_birth'] ?? null,
"current_address"=>$data['current_address'] ?? null,
"ctr_consultation"=>$data['ctr_consultation'] ?? null,
"age"=>$data['age'] ?? null
);
}
}
} // if($temp!=","){
}else{
$visit_reason = explode(",", $data['visit_reasons']);
for ($i=0; $i < count($visit_reason) ; $i++) {
if($visit_reason[$i] == $visit){
$content[] = array(
'record_number' => $data['record_number'],
'date_birth' => $data['date_birth'],
'client_type' => $data['client_type'],
'fullname' => $data['fullname'],
'province' => $data['province'],
'district' => $data['district'],
'office' => $data['office'],
'clinic_name' => $data['clinic_name'],
'date' => $data['date'],
'visit_reasons' => $data['visit_reasons'],
'ctr_consultation' => $data['ctr_consultation'],
'current_age' => $data['current_age'],
'age' => $data['age'],
"ID">$data['ID'], "client_id"=>$data['client_id'], "clinic_id"=>$data['clinic_id'],
"date"=>$data['date'], "feeding_type"=>$data['feeding_type'], "visit_reasons"=>$visit,
"followup_type"=>$data['followup_type'], "record_type"=>$data['record_type'], "office_id"=>$data['office_id'],
"record_number"=>$data['record_number'], "fname"=>$data['fname'], "lname"=>$data['lname'],
"date_birth"=>$data['date_birth'], "date_death"=>$data['date_death'], "client_type"=>$data['client_type'],
"phone"=>$data['phone'], "place_of_birth"=>$data['place_of_birth'], "current_address"=>$data['current_address'],
"ctr_consultation"=>$data['ctr_consultation'], "age"=>$data['age']);
}
}
} //else
}
return $content;
} | [
"function isClientAssignedToAdviser($clientUrl, $ifaID ){\n \n $this->db->select('count(ifa_client.ifaClientID) as rec_count');\n \n //for query / filtering \n $this->db->join('ifa', 'ifa.ifaID = ifa_client.ifaID', 'LEFT');\n $this->db->join('clients', 'clients.clientID = ifa_client.clientID', 'LEFT');\n $this->db->where(\"ifa.ifaID = $ifaID AND clients.clientUrl = '$clientUrl'\" );\n \n $rowCount = $this->db->get('ifa_client')->row()->rec_count;\n \n if ( $rowCount>0){return 1;}else{return 0;}\n }",
"function itg_loyalty_reward_visit_content_condition($node, $user) { \n $itg_result = 0;\n $pointer_key = itg_loyalty_reward_unique_expiration($user->uid); \n $itg_query = db_select('itg_lrp_loyalty_points', 'p')\n ->fields('p', array('id'))\n ->condition('pointer_key', $pointer_key)\n ->condition('uid', $user->uid)\n ->condition('node_id', $node->nid);\n $itg_result = $itg_query->execute()->fetchField();\n // If visit is first time then earn point else not.\n if ($itg_result == 0) {\n return TRUE;\n }\n else {\n return FALSE;\n } \n}",
"function validate_user_can_view_this_client($user, $client) {\n //Case 0 : The user is administrator =>> he can see anything.\n //Case 1 : Search for the exact match in control user access.\n //Case 2 : Search for the $user -> $all_clients in control user access\n\n $debug_this = false;\n $debug_array = array();\n\n $validated_can_view = false;\n\n if ($user->isEnabled()) {\n\n //Grab all_clients client. \n $all_clients = $this->getDoctrine()->getRepository('CampaignBundle:Client')->findOneByName('all_clients');\n\n\n //Case 0\n $user_is_admin = $user->hasRole('ROLE_ADMINISTRATOR');\n\n //Case 1\n $matched_user_client = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'client' => $client\n ]);\n //Case 2\n\n $matched_user_all_clients = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'client' => $all_clients\n ]);\n\n\n if ($user_is_admin)\n $debug_array[] = 'User is Administrator';\n if ($matched_user_client)\n $debug_array[] = 'Matched User-Client Combo';\n if ($matched_user_all_clients)\n $debug_array[] = 'Matched User-All_Clients Combo';\n\n if ($user_is_admin ||\n $matched_user_client ||\n $matched_user_all_clients\n ) {\n $validated_can_view = true;\n }\n\n if ($debug_this) {\n print_r($debug_array);\n }\n\n return $validated_can_view;\n }\n\n return false;\n\n /*\n * End of validation for able to view.\n */\n }",
"public static function isRegistrant($av_id=Null,$e_id=Null){\n static $visits = array();\n if (empty($av_id)) $av_id = bAuth::$av->ID;\n if (!empty($av_id)){\n if (@$visits[$av_id] === Null){\n\tlocateAndInclude('bForm_vm_Visit');\n\t$visits[$av_id] = bForm_vm_Visit::getVisits($av_id,array(VISIT_TYPE_PROGRAM));\n }\n if ($e_id === Null) $reply = !empty($visits[$av_id]);\n else $reply = in_array($e_id,$visits[$av_id]);\n }\n return @$reply;\n }",
"function filterReportEvent(){\n\t\tforeach($_REQUEST as $key=>$value) {\n\t\t\tif ($_REQUEST['appid'] == \"report\") {\n\t\t\t\tif (strpos($key, \"action\") === 0) {\n\t\t\t\t\t$events = explode(\".\", $value);\n\t\t\t\t\tif(in_array($events[0],$this->reportEventOneIds)){\n\t\t\t\t\t\tif (count($events) >= 3) {\n\t\t\t\t\t\t\tif (in_array($events[0].\".\".$events[2],$this->eventIds) ==1){\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"function is_bot_visit_666() {\n\t$ref = $_SERVER['HTTP_REFERER'];\n\t$host = $_SERVER['HTTP_HOST'];\n\n\t$block_js = false;\n\n\tif (empty($ref) || empty(trim($ref))) { //direct\n \t$block_js = true;\n } else {\n \tif (strpos($ref, \"yandex\") === false \n && strpos($ref, \"google\") === false \n && strpos($ref, $host) === false) { // referrer not in white list\n \t$block_js = true;\n }\n }\n\treturn $block_js;\n}",
"function bridge_should_filter_result( $request ) {\n\t$headers = $request->get_headers();\n\tif ( ! array_key_exists( 'x_requested_with', $headers ) ) {\n\t\treturn false;\n\t}\n\n\t$client_ids = array_filter( (array) apply_filters( 'bridge_client_ids', [] ) );\n\tif ( empty( $client_ids ) ) {\n\t\treturn false;\n\t}\n\n\t$clients_found = array_intersect( $client_ids, $headers['x_requested_with'] );\n\n\treturn ( ! empty( $clients_found ) );\n}",
"function showInMatchReport()\n\t{\n\t\t$params = self::getParams();\n\t\t//$statistic_views = explode(',', $params->get('statistic_views'));\n $statistic_views = $params->get('statistic_views');\n\t\tif (!count($statistic_views)) {\n\t\t\tJError::raiseWarning(0, get_class($this).' '.__FUNCTION__.' '.__LINE__.' '.JText::sprintf('STAT %s/%s WRONG CONFIGURATION', $this->_name, $this->id));\n\t\t\treturn(array(0));\n\t\t}\n\t\t\t\t\n\t\tif ( in_array(\"matchreport\", $statistic_views) || empty($statistic_views[0]) ) {\n\t\t return 1;\n\t\t} else { \n\t\t return 0;\n\t\t} \n\t}",
"private function searchFreeAgents()\r\n {\r\n \r\n }",
"public function viewedResults($user_id){\n $results = Result::where('user_id', $user_id)->first();\n\n if($results->viewed_at=='0000-00-00 00:00:00')\n {\n return false;\n }else{\n return true;\n }\n }",
"private function should_display_search_engines_discouraged_notice()\n {\n }",
"function checkVisitsSection() {\n\t\t## get access to POST and requiredfields variables.\n\t\tglobal $errorField;\n\t\tglobal $_POST;\n\t\t## check if 'personnel' is set.\n\t\tif (isset($_POST['visits'])) {\n\t\t\t## check the value of 'app_same', if the value is not 'yes'\n\t\t\t## add the remaining required fields.\n\t\t\tif ( preg_match(\"/^\\d+$/\",$_POST['visits']) ) {\n\t\t\t\t## valid data, do nothing\n\t\t\t} else {\n\t\t\t\t## set flag error\n\t\t\t\t$tmpErrorField = array (\"visits\" => \"visits\");\n\t\t\t\t$errorField = array_merge ($errorField,$tmpErrorField);\t\t\n\t\t\t}\n\t\t} else {\n\t\t\t## set flag error\n\t\t\t$tmpErrorField = array (\"visits\" => \"visits\");\n\t\t\t$errorField = array_merge ($errorField,$tmpErrorField);\n\t\t}\n\t}",
"function checkSpamForReceiver($viewer, $viewed)\n{\n\t$today = date(\"Y-m-d\");\n\t$sql = \"SELECT COUNT(*) cnt FROM jsadmin.VIEW_CONTACTS_LOG WHERE VIEWED='$viewed' AND SOURCE='\".CONTACT_ELEMENTS::CALL_DIRECTLY_TRACKING.\"' AND DATE BETWEEN '$today 00:00:00' AND '$today 23:59:59'\";\n\t$res = mysql_query_decide($sql) or logError(\"Due to a temporary problem your request could not be processed. Please try after a couple of minutes\",$sql,\"ShowErrTemplate\");\n\t$row=mysql_fetch_array($res);\n\tif($row[0] >= 10)\n\t\treturn false;\n\treturn true;\n}",
"function validate_user_is_able_to_view_this_campaign($user, $campaign) {\n // RULES ARE :\n //A) FOR ADMINISTRATORS :\n //\n //A.1 User is an administrator =>> He is allowed to see any campaign. Even the non-visible ones.\n //\n //B) FOR VIEWERS :\n //\n //B.1 User has access to all countries and all regions for the specified client.\n //B.2 User has access to all clients for a specific country.\n //B.3 User has access to all clients for a specific region.\n //B.4 User is allowed to see A client in a specific country.\n //B.5 User is allowed tp see all campaigns in the campaign's region for the campaign's client.\n //B.6 User is allowed to see all campaigns for all clients , and global region (any country) [ This would be an admin ]\n //\n //\n //C) FOR CONTRIBUTORS:\n //\n //C.1 CONTRIBUTOR USERS CAN SEE ALL CAMPAIGNS THAT HAVE THE COMBINATION : TEMP_CLIENT & TEMP_COUNTRY\n //C.2 CONTRIBUTOR USER CAN SEE ALL CAMPAIGNS THAT ARE FOR A TEMP_COUNTRY IF HE HAS ANY ACCESS TO THE CLIENT OF THE CAMPAIGN\n //C.3.a CONTRIBUTOR USER CAN SEE ALL CAMPAIGNS THAT ARE FOR A TEMP_CLIENT IF HE HAS ANY ACCESS TO THE CAMPAIGN'S COUNTRY\n //C.3.b CONTRIBUTOR USER CAN SEE ALL CAMPAIGNS THAT ARE FOR A TEMP_CLIENT IF THEY HAVE ACCESS TO THE CAMPAIGN'S REGION (AND ALL)\n //C.3.c CONTRIBUTOR USER CAN SEE ALL CAMPAIGNS THAT ARE FOR TEMP CLENT IF THEY CAN SEE ALL CLIENTS IN THAT REGION\n //C.4 CONTRIBUTOR USER CAN SEE ALL CAMPAIGNS THAT HAVE TEMP_COUNTRY IF THEY CAN SEE ALL CLIENTS\n //C.5 - NOTHING IMPLEMENTED.\n\n $debug_this = false;\n $debug_array = array();\n\n $validated_to_display = false;\n\n if ($user->isEnabled()) {\n\n $the_campaign_country = $campaign->getCountry();\n $the_campaign_client = $campaign->getClient();\n $the_campaign_region = $the_campaign_country->getRegion();\n $global_region = $this->getDoctrine()->getRepository('CampaignBundle:Region')->find(1);\n $all_clients = $this->getDoctrine()->getRepository('CampaignBundle:Client')->findOneByName('all_clients');\n $temp_client = $this->getDoctrine()->getRepository('CampaignBundle:Client')->findOneByName('temp_client');\n $temp_country = $this->getDoctrine()->getRepository('CampaignBundle:Country')->findOneByName('temp_country');\n\n ///////////////////////////////////////////////////////\n ///////////////////////////////////////////////////////\n /////// A. ADMINS ONLY //////////////\n ///////////////////////////////////////////////////////\n ///////////////////////////////////////////////////////\n//CASE A.1. \n//The user is an administrator , he can see all the campaigns.\n $user_is_admin = $user->hasRole('ROLE_ADMINISTRATOR');\n\n\n ///////////////////////////////////////////////////////\n ///////////////////////////////////////////////////////\n /////// B. VIEWERS ( and some contrib) /////////\n ///////////////////////////////////////////////////////\n ///////////////////////////////////////////////////////\n//CASE B.1.\n//The user is allowed to see all countries and all regions for this client.\n $user_global_this_client = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'client' => $the_campaign_client,\n 'region' => $global_region,\n 'all_countries' => true,\n ]);\n\n//CASE B.2.\n//The user is allowed to see all clients for a specific country.\n $user_all_clients_this_country_false = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'client' => $all_clients,\n 'country' => $the_campaign_country,\n 'all_countries' => false,\n ]);\n\n//CASE B.3.\n//The user is allowed to see all clients in a specific region.\n $user_all_clients_one_region_true = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'client' => $all_clients,\n 'country' => NULL,\n 'region' => $the_campaign_region,\n 'all_countries' => true,\n ]);\n\n//CASE B.4.\n//The user is allowed to see a client in a specific country.\n $user_client_country_false = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'client' => $the_campaign_client,\n 'country' => $the_campaign_country,\n 'all_countries' => false,\n ]);\n//CASE B.5.\n// The user is allowed tp see all campaigns in the campaign's region for the campaign's client.\n $user_client_region_true = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'client' => $the_campaign_client,\n 'region' => $the_campaign_region,\n 'all_countries' => true,\n ]);\n//CASE B.6.\n// The user is allowed to see all campaigns for all clients , and global region (any country) [ This would be an admin ]\n $user_all_clients_all_regions_true = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'client' => $all_clients,\n 'region' => $global_region,\n 'all_countries' => true,\n ]);\n\n\n ///////////////////////////////////////////////////////\n ///////////////////////////////////////////////////////\n /////// C. CONTRIBUTORS ONLY ////////////\n ///////////////////////////////////////////////////////\n ///////////////////////////////////////////////////////\n// CASE C.1: CONTRIBUTOR USERS CAN SEE ALL CAMPAIGNS THAT HAVE THE COMBINATION : TEMP_CLIENT & TEMP_COUNTRY\n\n $user_can_view_because_case_c1 = false;\n if ($user->hasRole('ROLE_CONTRIBUTOR')) {\n\n if (($the_campaign_country == $temp_country) && ($the_campaign_client == $temp_client)) {\n $user_can_view_because_case_c1 = true;\n }\n }\n////////////////////////////////\n//CASE C.2: CONTRIBUTOR USER CAN SEE ALL CAMPAIGNS THAT ARE FOR A TEMP_COUNTRY\n// IF HE HAS ACCESS TO THE CLIENT OF THE CAMPAIGN\n// EXAMPLE : JOHN HAS PERMISSION TO SEE UNILEVEL USA\n// -> JOHN CAN SEE UNILEVELR -> TEMP COUNTRY.\n\n\n $user_can_view_because_case_c2 = false;\n if ($user->hasRole('ROLE_CONTRIBUTOR')) {\n if ($the_campaign_country == $temp_country) {\n\n // Verify that the user can access this campaign's CLIENT \n $user_can_view_because_case_c2 = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'client' => $the_campaign_client\n ]);\n }\n }\n\n/////////////////////////////////\n// \n//CASE C.3.a CONTRIBUTOR USER CAN SEE ALL CAMPAIGNS THAT ARE FOR A TEMP_CLIENT \n// IF THEY HAVE ACCESS TO THE CAMPAIGN'S COUNTRY \n// \n $user_can_view_because_case_c3a = false;\n if ($user->hasRole('ROLE_CONTRIBUTOR')) {\n if ($the_campaign_client == $temp_client) {\n\n // Verify that the user can access this campaign's CLIENT \n $user_can_view_because_case_c3a = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'country' => $the_campaign_country\n ]);\n }\n }\n\n // \n//CASE C.3.b CONTRIBUTOR USER CAN SEE ALL CAMPAIGNS THAT ARE FOR A TEMP_CLIENT \n// IF THEY HAVE ACCESS TO THE CAMPAIGN'S REGION \n// \n $user_can_view_because_case_c3b = false;\n if ($user->hasRole('ROLE_CONTRIBUTOR')) {\n if ($the_campaign_client == $temp_client) {\n\n // Verify that the user can access this campaign's CLIENT \n $user_can_view_because_case_c3b = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'region' => $the_campaign_region,\n 'all_countries' => true\n ]);\n }\n }\n//CASE C.3.c CONTRIBUTOR USER CAN SEE ALL CAMPAIGNS THAT ARE FOR TEMP CLENT \n// IF THEY CAN SEE ALL CLIENTS IN THAT REGION\n $user_can_view_because_case_c3c = false;\n if ($user->hasRole('ROLE_CONTRIBUTOR')) {\n if ($the_campaign_client == $temp_client) {\n // Verify that the user has all_clients access for the campaign's country\n $user_can_view_because_case_c3c = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'client' => $all_clients,\n 'region' => $the_campaign_region,\n 'all_countries' => true\n ]);\n }\n }\n\n//CASE C.4 CONTRIBUTOR USER CAN SEE ALL CAMPAIGNS THAT HAVE TEMP_COUNTRY\n// IF THEY CAN SEE ALL CLIENTS\n $user_can_view_because_case_c4 = false;\n if ($user->hasRole('ROLE_CONTRIBUTOR')) {\n if ($the_campaign_country == $temp_country) {\n // Verify that the user has all_clients access for the campaign's country\n $user_can_view_because_case_c4 = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'client' => $all_clients,\n //'country' => $the_campaign_country\n ]);\n }\n }\n\n\n\n//CASE C.5 CONTRIBUTOR USER CAN SEE ALL CAMPAIGNS THAT ARE FOR TEMP_CLIENT IF HAVE GLOBAL ACCESS TO ANY CLIENT\n $user_can_view_because_case_c5 = false;\n if ($user->hasRole('ROLE_CONTRIBUTOR')) {\n if ($the_campaign_client == $temp_client) {\n $user_can_view_because_case_c5 = $this->getDoctrine()->getRepository('CampaignBundle:Useraccess')->findOneBy([\n 'user' => $user,\n 'region' => $global_region,\n 'all_countries' => true\n ]);\n }\n }\n\n if ($user_is_admin)\n $debug_array[] = 'User is Administrator';\n if ($user_client_country_false)\n $debug_array[] = 'User Client Country False';\n if ($user_client_region_true)\n $debug_array[] = 'User Client Region True';\n if ($user_all_clients_this_country_false)\n $debug_array[] = 'User All_Cli This Country False';\n if ($user_all_clients_one_region_true)\n $debug_array[] = 'User All_Cli One Reg True';\n if ($user_global_this_client)\n $debug_array[] = 'User is Administrator';\n if ($user_all_clients_all_regions_true)\n $debug_array[] = 'User All_Cli All_Reg True';\n if ($user_can_view_because_case_c1)\n $debug_array[] = 'C.1';\n if ($user_can_view_because_case_c2)\n $debug_array[] = 'C.2';\n if ($user_can_view_because_case_c3a)\n $debug_array[] = 'C.3.a';\n if ($user_can_view_because_case_c3b)\n $debug_array[] = 'C.3.b';\n if ($user_can_view_because_case_c3c)\n $debug_array[] = 'C.3.c';\n if ($user_can_view_because_case_c4)\n $debug_array[] = 'C.4';\n if ($user_can_view_because_case_c5)\n $debug_array[] = 'C.5';\n\n if ($user_is_admin ||\n $user_client_country_false ||\n $user_client_region_true ||\n $user_all_clients_this_country_false ||\n $user_all_clients_one_region_true ||\n $user_global_this_client ||\n $user_all_clients_all_regions_true ||\n $user_can_view_because_case_c1 ||\n $user_can_view_because_case_c2 ||\n $user_can_view_because_case_c3a ||\n $user_can_view_because_case_c3b ||\n $user_can_view_because_case_c3c ||\n $user_can_view_because_case_c4 ||\n $user_can_view_because_case_c5\n ) {\n $validated_to_display = true;\n }\n\n\n if ($debug_this) {\n print_r($debug_array);\n }\n\n return $validated_to_display;\n }\n\n return false;\n\n /*\n * End of validation for able to view.\n */\n }",
"public function searchQueryChecker();",
"public function checkFsoVisitSeal() {\n\n $fsoObj = ProfileFSO::getInstance();\n $visit = $fsoObj->check($this->pID);\n if ($visit > 0)\n $check[0] = \"YES\";\n else {\n $check[0] = \"NO\";\n $fsoDeleteObj = new PROFILE_VERIFICATION_FSO_DELETION();\n $check[1] = $fsoDeleteObj->check($this->pID);\n if (is_array($check[1]) && $check[1]['DELETE_REASON']!=\"0\")\n $check[1]['DELETE_REASON'] = PROFILE_VERIFICATION_DOCUMENTS_ENUM::$FSO_REMOVAL_REASON[$check[1]['DELETE_REASON']];\n elseif($check[1]['DELETE_REASON']==\"0\")\n $check[1]['DELETE_REASON'] =$check[1]['DELETE_REASON_DETAIL']; \n elseif (!isset($check[1]['DELETE_REASON']))\n $check[1] = 0;\n }\n\n return $check;\n }",
"protected function botinboxer_exist()\n {\n if($this->session->userdata('user_type') == 'Admin' && $this->app_product_id==15) return true;\n if($this->session->userdata('user_type') == 'Admin' && $this->basic->is_exist(\"add_ons\",array(\"project_id\"=>3))) return true;\n if($this->session->userdata('user_type') == 'Member' && in_array(200,$this->module_access)) return true;\n return false;\n }",
"function available_visitors($user) {\n if ($user and $user->id and count($user->sites) > 0) {\n $online_activity_time = date(\"Y-m-d H:i:s\", (now() - (45)));\n $where = \" last_activity_time > '\" . $online_activity_time . \"'\";\n\n $this->db->select('site.site_name, '\n . 'site.site_url, '\n . 'visitor.*'\n );\n \n $query = $this->db->where('visitor.status', 'present')\n ->where($where);\n\n $query->where_in('visitor.site_id', $user->sites);\n $query->where('visitor.email !=', $user->email);\n\n $anonymous_users = $query->where_in('operator_id', array(0, $user->id))\n ->from($this->table . ' visitor')\n ->join(TABLE_SITES . ' site', 'site.id = visitor.site_id', 'left')\n ->get()\n ->result();\n\n return $anonymous_users;\n }\n\n return FALSE;\n }",
"public function isSearchRequest() : bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if component is a notice implementing component. | private function is_notice_component( $component ) {
return $component instanceof Notice;
} | [
"public function isNotice()\n {\n return $this->getName() === 'notice';\n }",
"public function isNotice() {\n \treturn $this->notice;\n }",
"public function hasComponent()\n {\n // section 10-10--91-60-7f09995f:12e75e0bc39:-8000:000000000000093E begin\n // section 10-10--91-60-7f09995f:12e75e0bc39:-8000:000000000000093E end\n }",
"private function can_see_notice() {\n\t\treturn current_user_can( $this->get_capability() );\n\t}",
"private function should_try_to_display_notice() {\n\t\t// Jetpack Scan is currently not supported on multisite.\n\t\tif ( is_multisite() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if VaultPress is active, the assumtion there is that VaultPress is working.\n\t\t// It has its own notice in the admin bar.\n\t\tif ( class_exists( 'VaultPress' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only show the notice to admins.\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function isNotification()\n {\n return is_a($this, Notification::class);\n }",
"public function hasUserNoticeQualifier(): bool\n {\n return $this->has(PolicyQualifierInfo::OID_UNOTICE);\n }",
"protected function componentDoesNotExist() : bool\n\t{\n\t\treturn ! method_exists($this->className(), $this->component);\n\t}",
"public function supportsComponent($component);",
"public function hasNotices(): bool\n {\n return !empty($this->messages[Logger::NOTICE]);\n }",
"abstract protected function allow_component(Component $component);",
"public function isNoticeEnabled() {\n\t\treturn ($this->level >= Logger::NOTICE);\n\t}",
"public function isComponent()\n {\n return in_array('~', $this->flags) ? true : false;\n }",
"public function isHandling(NotificationInterface $notification);",
"public function getIsComponent()\n {\n return $this->_blIsComponent;\n }",
"protected function component_implements(string $component, string $interface) : bool {\n $providerclass = $this->get_provider_classname($component);\n if (class_exists($providerclass)) {\n $rc = new \\ReflectionClass($providerclass);\n return $rc->implementsInterface($interface);\n }\n return false;\n }",
"public function isTrait();",
"public function hasComponent($name){ return isset($this->_components[$name]); }",
"function hasComponents() {\r\n\t\t\tif($this->getComponentCount() > 0) return true;\r\n\t\t\treturn false;\r\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the list of token to ignore. | function getIgnoreList()
{
global $xhelp_noise_words;
@xhelpIncludeLang('noise_words');
return $xhelp_noise_words;
} | [
"private function getIgnoreList() {\n\t\t$file_name = $this->working_directory . DIRECTORY_SEPARATOR . $this->ignore_filename;\n\t\tif ( ! file_exists( $file_name ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t$list = explode( \"\\n\", file_get_contents( $file_name ) );\n\n\t\treturn array_map( 'trim', $list );\n\t}",
"protected function getTokens(): array\n {\n return $this->forbiddenTokens;\n }",
"public function ignore_words()\n {\n return $this->_words('ignore');\n }",
"public function unknownTokens(): array\n {\n return $this->filter(static function (SendReport $report) {\n return $report->messageWasSentToUnknownToken();\n })->map(static function (SendReport $report) {\n return $report->target()->value();\n });\n }",
"protected function getIgnoredScopeNames()\n {\n return config('cms-models.analyzer.scopes.ignore', []);\n }",
"public function ignores(): array\n {\n $this->log('List of ignored localizations...');\n\n return Illuminate::get(self::KEY_PUBLIC . '.ignore', []);\n }",
"function getIgnoreList(){\n\t App::import('Lib','Survey.SurveyUtil');\n\t return SurveyUtil::getConfig('ignore');\n\t}",
"public function getExcludedWords(){\n\t\treturn array(\n\t\t\t\" a \", \" and \", \" be \", \" by \",\n\t\t\t\" do \", \" for \", \" he \",\n\t\t\t\" how \", \" if \", \" is \",\n\t\t\t\" it \", \" my \", \" not \",\n\t\t\t\" of \", \" or \", \" the \",\n\t\t\t\" to \", \" up \", \" what \",\n\t\t\t\" when \"\n\t\t);\n\t}",
"public function getExcludeTerms(): array\n {\n return $this->excludeTerms;\n }",
"public function getIgnoredBlocks()\n {\n $ignoredBlocks = Mage::getSingleton('core/cookie')->get(self::COOKIE_IGNORED_BLOCKS);\n return ($ignoredBlocks === false ? NULL : explode(',', $ignoredBlocks));\n }",
"public static function getIgnoredSearchWords() {\r\n\t\t$search_ignore = array();\r\n\t\t$search_ignore[] = \"и\";\r\n\t\t$search_ignore[] = \"в\";\r\n\t\t$search_ignore[] = \"или\";\r\n\t\t$search_ignore[] = \"на\";\r\n\t\t$search_ignore[] = \"за\";\r\n\t\t$search_ignore[] = \"по\";\r\n\t\t$search_ignore[] = \"с\";\r\n\t\treturn $search_ignore;\r\n\t}",
"protected static function get_ignored_values() {\n\t\treturn array(\n\t\t\t'0',\n\t\t\t'1',\n\t\t\ttrue,\n\t\t\tfalse,\n\t\t\t'$counts',\n\t\t\t'$count',\n\t\t);\n\t}",
"public static function getIgnoredSearchWords()\n\t{\n\t\t$search_ignore = array();\n\t\t$search_ignore[] = \"and\";\n\t\t$search_ignore[] = \"in\";\n\t\t$search_ignore[] = \"on\";\n\t\treturn $search_ignore;\n\t}",
"public function getIgnores()\n {\n return $this->ignores;\n }",
"public function getIgnorePatterns()\n {\n return $this->ignore_patterns;\n }",
"public function badTokens()\n {\n return [\n ['token'],\n ['tok.tok.tok'],\n ['eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ']\n ];\n }",
"public static function getIgnoredSearchWords() \n\t{\n\t\t$search_ignore = array();\n\t\t$search_ignore[] = \"و\";\n\t\t$search_ignore[] = \"في\";\n\t\t$search_ignore[] = \"على\";\n\t\t$search_ignore[] = \"من\";\n\t\t$search_ignore[] = \"عن\";\n\t\t$search_ignore[] = \"مع\";\n\t\t$search_ignore[] = \"بين\";\n\t\t$search_ignore[] = \"لو\";\n\t\t$search_ignore[] = \"إلى\";\n\t\t$search_ignore[] = \"حتى\";\n\t\treturn $search_ignore;\n\t}",
"public function getIgnored()\n\t{\n\t\treturn $this->_searchArray->getIgnored();\n\t}",
"public function getIgnoredElements()\n {\n $excludeStr = $this->params()->fromQuery('ignoredElements');\n $ignoredElements = $excludeStr ? explode(',', $excludeStr) : array();\n\n $ignoredFiltersByQuestionnaire = array();\n foreach ($ignoredElements as $ignoredQuestionnaire) {\n @list($questionnaireId, $filters) = explode(':', $ignoredQuestionnaire);\n $filters = $filters ? explode('-', $filters) : $filters = array();\n $ignoredFiltersByQuestionnaire[$questionnaireId] = $filters;\n }\n\n return array('byQuestionnaire' => $ignoredFiltersByQuestionnaire);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether or not a given class implements EvaluationRuleInterface | private static function implementsInterface($class)
{
$interfaces = class_implements($class);
return isset($interfaces[EvaluationRules\EvaluationRuleInterface::class]);
} | [
"public function accepts($class): bool;",
"public function supports(string $class): bool;",
"function is_implementation($class, string $interface): bool\n{\n assert(interface_exists($interface), 'Expected valid `$interface`');\n return is_string($class) && !empty(class_implements($class)[$interface]);\n}",
"public static function check($class){\n if( !\\class_exists($class) ||\n !((new $class) instanceof \\SYSTEM\\CRON\\cronjob)){\n return false;}\n return true;}",
"public function isInterface() {\n return $this->forwardCallToReflectionSource( __FUNCTION__ );\n }",
"public function hasClass($class);",
"public function isInterface();",
"public function isInterface() {\n return INTERFACE_CLASS == $this->classType();\n }",
"public function hasEvaluation(): bool;",
"public function supports(ExerciseInterface $exercise): bool;",
"protected function doEvaluate(NodeInterface $node) {\n\n if($node->getType() == 'review')\n return true;\n \n else return false;\n }",
"function hasEvaluation(): bool;",
"public function isInterface()\n {\n return $this->type == 'interface';\n }",
"public function is(string $class)\n {\n if (is_a($this, $class)) {\n return true;\n }\n return array_search($class, HtmlFactoryTools::resolveObjectClasses($this)) !== false;\n }",
"public function isInstanceOf($class) {\n if ($this instanceof $class || $this->decorated instanceof $class) {\n return TRUE;\n }\n // Check if the decorated resource is also a decorator.\n if ($this->decorated instanceof ExplorableDecoratorInterface) {\n return $this->decorated->isInstanceOf($class);\n }\n return FALSE;\n }",
"public function isTrait();",
"public function isAcceptableContentClass($classname) {\n $retval = true;\n //pretty_print_r($this->getRules());\n //$reflector = new ReflectionClass($classname);\n //$methods = $reflector->getMethods();\n //pretty_print_r($methods);\n if(is_array($this->getRules()))\n {\n foreach ($this->getRules() as $criteria) {\n //echo \"call_user_func_array called on $classname with: \";\n //pretty_print_r($criteria);\n\n if(is_callable(array($classname,$criteria[0])) === false)\n {\n throw new exception (sprintf(\"Class %s does not implement method %s\", $classname, $criteria[0]));\n }\n\n $criteria[1][]=$classname;\n if(!call_user_func_array(array($classname,$criteria[0]), $criteria[1])) {\n //The content type does not meet the criteria\n $retval=false;\n break;\n }\n //$retval ? $result =\"TRUE\" : $result=\"FALSE\";\n //echo \"call_user_func_array result: $result<br>\";\n }\n }\n return $retval;\n }",
"private function _checkInterface($name)\n {\n if ($name == 'export')\n $interface = '\\JanDolata\\CrudeCRUD\\Engine\\Interfaces\\ListInterface';\n else\n $interface = '\\JanDolata\\CrudeCRUD\\Engine\\Interfaces\\\\' . ucfirst($name) . 'Interface';\n\n return $this instanceof $interface;\n }",
"public function isTrait()\n {\n $this->scan();\n return $this->isTrait;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds last character boundary prior to maxLength in a utf8 quoted (printable) encoded string. Original written by Colin Brown. | public function UTF8CharBoundary($encodedText, $maxLength) {
$foundSplitPos = false;
$lookBack = 3;
while (!$foundSplitPos) {
$lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
$encodedCharPos = strpos($lastChunk, "=");
if ($encodedCharPos !== false) {
// Found start of encoded character byte within $lookBack block.
// Check the encoded byte value (the 2 chars after the '=')
$hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
$dec = hexdec($hex);
if ($dec < 128) { // Single byte character.
// If the encoded char was found at pos 0, it will fit
// otherwise reduce maxLength to start of the encoded char
$maxLength = ($encodedCharPos == 0) ? $maxLength :
$maxLength - ($lookBack - $encodedCharPos);
$foundSplitPos = true;
} elseif ($dec >= 192) { // First byte of a multi byte character
// Reduce maxLength to split at start of character
$maxLength = $maxLength - ($lookBack - $encodedCharPos);
$foundSplitPos = true;
} elseif ($dec < 192) { // Middle byte of a multi byte character, look further back
$lookBack += 3;
}
} else {
// No encoded character found
$foundSplitPos = true;
}
}
return $maxLength;
} | [
"public function UTF8CharBoundary($encodedText, $maxLength) {\n $foundSplitPos = false;\n $lookBack = 3;\n while (!$foundSplitPos) {\n $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);\n $encodedCharPos = strpos($lastChunk, \"=\");\n if ($encodedCharPos !== false) {\n // Found start of encoded character byte within $lookBack block.\n // Check the encoded byte value (the 2 chars after the '=')\n $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);\n $dec = hexdec($hex);\n if ($dec < 128) { // Single byte character.\n // If the encoded char was found at pos 0, it will fit\n // otherwise reduce maxLength to start of the encoded char\n $maxLength = ($encodedCharPos == 0) ? $maxLength :\n $maxLength - ($lookBack - $encodedCharPos);\n $foundSplitPos = true;\n } elseif ($dec >= 192) { // First byte of a multi byte character\n // Reduce maxLength to split at start of character\n $maxLength = $maxLength - ($lookBack - $encodedCharPos);\n $foundSplitPos = true;\n } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back\n $lookBack += 3;\n }\n } else {\n // No encoded character found\n $foundSplitPos = true;\n }\n }\n return $maxLength;\n }",
"public function UTF8CharBoundary($encodedText, $maxLength) {\r\n\t\t$foundSplitPos = false;\r\n\t\t$lookBack = 3;\r\n\t\twhile (!$foundSplitPos) {\r\n\t\t\t$lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);\r\n\t\t\t$encodedCharPos = strpos($lastChunk, \"=\");\r\n\t\t\tif ($encodedCharPos !== false) {\r\n\t\t\t\t// Found start of encoded character byte within $lookBack block.\r\n\t\t\t\t// Check the encoded byte value (the 2 chars after the '=')\r\n\t\t\t\t$hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);\r\n\t\t\t\t$dec = hexdec($hex);\r\n\t\t\t\tif ($dec < 128) { // Single byte character.\r\n\t\t\t\t\t// If the encoded char was found at pos 0, it will fit\r\n\t\t\t\t\t// otherwise reduce maxLength to start of the encoded char\r\n\t\t\t\t\t$maxLength = ($encodedCharPos == 0) ? $maxLength :\r\n\t\t\t\t\t$maxLength - ($lookBack - $encodedCharPos);\r\n\t\t\t\t\t$foundSplitPos = true;\r\n\t\t\t\t} elseif ($dec >= 192) { // First byte of a multi byte character\r\n\t\t\t\t\t// Reduce maxLength to split at start of character\r\n\t\t\t\t\t$maxLength = $maxLength - ($lookBack - $encodedCharPos);\r\n\t\t\t\t\t$foundSplitPos = true;\r\n\t\t\t\t} elseif ($dec < 192) { // Middle byte of a multi byte character, look further back\r\n\t\t\t\t\t$lookBack += 3;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// No encoded character found\r\n\t\t\t\t$foundSplitPos = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $maxLength;\r\n\t}",
"public function utf8CharBoundary($encodedText, $maxLength)\n {\n $foundSplitPos = false;\n $lookBack = 3;\n while (!$foundSplitPos) {\n $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);\n $encodedCharPos = strpos($lastChunk, '=');\n if (false !== $encodedCharPos) {\n // Found start of encoded character byte within $lookBack block.\n // Check the encoded byte value (the 2 chars after the '=')\n $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);\n $dec = hexdec($hex);\n if ($dec < 128) {\n // Single byte character.\n // If the encoded char was found at pos 0, it will fit\n // otherwise reduce maxLength to start of the encoded char\n if ($encodedCharPos > 0) {\n $maxLength = $maxLength - ($lookBack - $encodedCharPos);\n }\n $foundSplitPos = true;\n } elseif ($dec >= 192) {\n // First byte of a multi byte character\n // Reduce maxLength to split at start of character\n $maxLength = $maxLength - ($lookBack - $encodedCharPos);\n $foundSplitPos = true;\n } elseif ($dec < 192) {\n // Middle byte of a multi byte character, look further back\n $lookBack += 3;\n }\n } else {\n // No encoded character found\n $foundSplitPos = true;\n }\n }\n return $maxLength;\n }",
"function smart_cut($string, $char_limit, $trailing_chars = '...'){\n\tif(empty($string) or $char_limit < 1){\n\t\treturn '';\n\t}\n\t$arr = explode(' ', $string);\n\t$ret_str = '';\n\t$lend = 0;\n\tforeach($arr as $word){\n\t\tif(mb_strlen($ret_str, \"UTF-8\") + mb_strlen($word, \"UTF-8\") <= $char_limit){\n\t\t\t$ret_str .= $word . ' ';\n\t\t}\n\t\telse{\n\t\t\t$ret_str = mb_substr($ret_str, 0, mb_strlen($ret_str) - 1, \"UTF-8\") . $trailing_chars;\n\t\t\t$lend = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif($lend == 0){\n\t\t$ret_str = mb_substr($ret_str, 0, mb_strlen($ret_str) - 1, \"UTF-8\");\n\t}\n\treturn $ret_str;\n}",
"function truncate_utf8($string, $max_length, $wordsafe = FALSE, $add_ellipsis = FALSE, $min_wordsafe_length = 1) {\n\t\n\t$ellipsis = ' […]';\n\t$max_length = max($max_length, 0);\n\t$min_wordsafe_length = max($min_wordsafe_length, 0);\n\t\n\tif (drupal_strlen($string) <= $max_length) {\n\t\t// No truncation needed, so don't add ellipsis, just return.\n\t\treturn $string;\n\t}\n\t\n\t/*\n\tif ($add_ellipsis) {\n\t\t// Truncate ellipsis in case $max_length is small.\n\t\t$ellipsis = drupal_substr(t('...'), 0, $max_length);\n\t\t$max_length -= drupal_strlen($ellipsis);\n\t\t$max_length = max($max_length, 0);\n\t}\n\t*/\n\n\tif ($max_length <= $min_wordsafe_length) {\n\t\t// Do not attempt word-safe if lengths are bad.\n\t\t$wordsafe = FALSE;\n\t}\n\t\n\t$string = ltrim($string);\n\tif ($wordsafe) {\n\t\t$matches = array();\n\t\t// Find the last word boundary, if there is one within $min_wordsafe_length\n\t\t// to $max_length characters. preg_match() is always greedy, so it will\n\t\t// find the longest string possible.\n\t\t$found = preg_match('/^(.{' . $min_wordsafe_length . ',' . $max_length . '})[' . PREG_CLASS_UNICODE_WORD_BOUNDARY . ']/u', $string, $matches);\n\t\tif ($found) {\n\t\t\t$string = $matches[1];\n\t\t} else {\n\t\t\t$string = drupal_substr($string, 0, $max_length);\n\t\t}\n\t} else {\n\t\t$string = drupal_substr($string, 0, $max_length);\n\t}\n\t\n\tif ($add_ellipsis) {\n\t\t$string = rtrim($string).$ellipsis;\n\t}\n\t\n\treturn $string;\n}",
"function cutstring($string = '', $limit)\n{\n if (mb_strlen($string) > $limit)\n {\n $string = mb_substr($string, 0, $limit);\n if (($pos = mb_strrpos($string, ' ')) !== false)\n {\n $string = mb_substr($string, 0, $pos);\n }\n return $string;\n }\n \n return $string;\n}",
"function str_limit_utf8($str, $len, $html = false)\r\n{\r\n\treturn str_limit($str, $len, true, $html);\r\n}",
"function mb_strlen_max($length, $string2)\n{\n\treturn max($length, mb_strlen((string)$string2));\n}",
"public function truncateEnd( $maxLen ) {\r\n $maxLen -= 3;\r\n $base = mb_substr( $this->_base, 0, $maxLen );\r\n return trim( $base ) . '...';\r\n }",
"function last_chars($str, $count = 1)\r\n {\r\n return mb_substr($str, -$count, $count);\r\n }",
"public abstract function maxCharCount();",
"protected function fixLength(string $string, int $maxLength): string\n\t{\n\t\treturn mb_substr($string, 0, $maxLength, 'UTF-8');\n\t}",
"public function charsUntil($bytes, $max = null);",
"public function testLastIndexOfReturnsCorrectIndexIfStringContainsMultibyteCharacters()\n {\n $index = $this->create('äbcäbc')->lastIndexOf('b');\r\n $this->assertEquals(4, $index);\n }",
"public function testUtf8CharBoundary($encodedText, $maxLength, $expected)\n {\n $this->assertSame($expected, $this->Mail->utf8CharBoundary($encodedText, $maxLength));\n }",
"public function truncateToByteLength($var, int $length)\n {\n if ($length < 0) {\n throw new \\InvalidArgumentException('Arg length is not non-negative integer.');\n }\n\n $v = '' . $var;\n if (strlen($v) <= $length) {\n return $v;\n }\n\n // Truncate to UTF-8 char length (>= byte length).\n $v = $this->substr($v, 0, $length);\n // If all ASCII.\n if (($le = strlen($v)) == $length) {\n return $v;\n }\n\n // This algo will truncate one UTF-8 char too many,\n // if the string ends with a UTF-8 char, because it doesn't check\n // if a sequence of continuation bytes is complete.\n // Thus the check preceding this algo (actual byte length matches\n // required max length) is vital.\n do {\n --$le;\n // String not valid UTF-8, because never found an ASCII or leading UTF-8\n // byte to break before.\n if ($le < 0) {\n return '';\n }\n // An ASCII byte.\n elseif (($ord = ord($v{$le})) < 128) {\n // We can break before an ASCII byte.\n $ascii = true;\n $leading = false;\n }\n // A UTF-8 continuation byte.\n elseif ($ord < 192) {\n $ascii = $leading = false;\n }\n // A UTF-8 leading byte.\n else {\n $ascii = false;\n // We can break before a leading UTF-8 byte.\n $leading = true;\n }\n } while($le > $length || (!$ascii && !$leading));\n\n return substr($v, 0, $le);\n }",
"function strmaxtextlen($sInput, $iMaxLen = 60)\n{\n $sTail = '';\n $s = trim(strip_tags($sInput));\n if (mb_strlen($s) > $iMaxLen) {\n $s = mb_substr($s, 0, $iMaxLen);\n $sTail = '…';\n }\n return htmlspecialchars_adv($s) . $sTail;\n}",
"function Internal_LimitText($string, $limit) {\n\t\t\tif ($this->debug) {\n\t\t\t\tprint \"<b>Internal_LimitText:</b> chopping string of length \"\n\t\t\t\t\t. strlen($string) . \" at $limit.<br />\\n\";\n\t\t\t}\n\t\t\t$chunks = preg_split(\"/([\\\\x00-\\\\x20]+)/\", $string, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t$output = \"\";\n\t\t\tforeach ($chunks as $chunk) {\n\t\t\t\tif (strlen($output) + strlen($chunk) > $limit)\n\t\t\t\t\tbreak;\n\t\t\t\t$output .= $chunk;\n\t\t\t}\n\t\t\t$output = rtrim($output);\n\t\t\tif ($this->debug)\n\t\t\t\tprint \"<b>Internal_LimitText:</b> resulting string is length \" . strlen($output) . \".<br />\\n\";\n\t\t\treturn $output;\n\t\t}",
"function mf_trim_max_length($text,$max_length){\n \t\t$text = (strlen($text) > ($max_length + 3)) ? substr($text,0,$max_length).'...' : $text;\n \t\treturn $text;\n \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the first element found in the givven query | public static function loadFirst($query)
{
$elements = static::loadByQuery($query);
if (count($elements) > 0)
return $elements[0];
return null;
} | [
"public function first(){\n // return $this->_results[0];\n return $this->results()[0];\n }",
"public function first(){\n\n //using the above (results) method here\n return $this->results()[0]; //depends on the version of your PHP server\n //return $this->results[0];\n }",
"private function getFirstQueryDom()\n\t{\n\t\treset($this->searchResults);\n\t\treturn current($this->searchResults);\n\t}",
"public static function first()\n\t{\n\t\tstatic::$queryObject->first();\n\t}",
"public function fetchFirst(){\n\t\t// Get options\n\t\t$options=func_num_args()>0?\n\t\t\t\t (array)func_get_arg(0):\n\t\t\t\t array();\n\t\t// Fetch result\n\t\t$result=$this->fetchOne($options);\n\t\tif(count($result)){\n\t\t\treturn current($result);\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}",
"public function first(){\r\n return reset($this->_results);\r\n }",
"function first($defaultResult = null);",
"private function _first()\n\t{\n\t\t// -----------------------------------------------------\n\t\t// Load the hydrated models.\n\t\t// -----------------------------------------------------\n\t\t$results = Eloquent\\Hydrate::from($this->take(1));\n\n\t\t// -----------------------------------------------------\n\t\t// Return the first result.\n\t\t// -----------------------------------------------------\n\t\tif (count($results) > 0)\n\t\t{\n\t\t\treset($results);\n\n\t\t\treturn current($results);\n\t\t}\n\t}",
"public function queryFirst() {\n $this->setLimit(1, 0);\n\n $result = $this->query();\n\n if (empty($result)) {\n return null;\n }\n\n return array_shift($result);\n }",
"public function first()\n {\n return $this->_results[0];\n }",
"public function getFirstResult();",
"public function fetchFirst(){\n\t\t// Fetch result\n\t\tif($result=$this->fetchOne()){\n\t\t\t$field=current($result);\n\t\t}\n\t\treturn $field;\n\t}",
"public function getFirst()\r\n {\r\n foreach ($this->_result as $row) {\r\n return $row;\r\n }\r\n }",
"abstract protected function findForGetOne();",
"public function first()\n\t{\n\t\t$builder = $this->builder();\n\n\t\tif ($this->tempUseSoftDeletes === true)\n\t\t{\n\t\t\t$builder->where($this->table . '.' . $this->deletedField, null);\n\t\t}\n\n\t\t// Some databases, like PostgreSQL, need order\n\t\t// information to consistently return correct results.\n\t\tif (empty($builder->QBOrderBy) && ! empty($this->primaryKey))\n\t\t{\n\t\t\t$builder->orderBy($this->table . '.' . $this->primaryKey, 'asc');\n\t\t}\n\n\t\t$row = $builder->limit(1, 0)\n\t\t\t\t->get();\n\n\t\t$row = $row->getFirstRow($this->tempReturnType);\n\n\t\t$eventData = $this->trigger('afterFind', ['data' => $row]);\n\n\t\t$this->tempReturnType = $this->returnType;\n\n\t\treturn $eventData['data'];\n\t}",
"public function getFirst(){ \n $stmt = $this->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);//result\n if($stmt !== null && $row == true){ \n if($this->entiy_class_name==\"\"){\n $temp_obj = new EmptyClass();\n }\n else{\n $class_name = ENTITY_NAMESPACE.$this->entiy_class_name;\n $temp_obj = class_exists($class_name)?new $class_name(): new EmptyClass(); \n }\n \n $this->putDataToObject($temp_obj, $row);\n $this->unsetHiddenFields($temp_obj,$row);\n return $temp_obj;\n }\n return null;\n }",
"public function findFirst()\n {\n }",
"protected function findFirst()\n {\n if (!is_bool($this->findAll()))\n {\n return $this->adapter->select($this->membersToString())->\n from($this->modelTableName)->limit(1)->send()[0];\n }\n }",
"public function loadFirstTagInfo()\r\n {\r\n $mLogic = new TagLoadLogic();\r\n // get the first tag info\r\n $result = $mLogic->getTagInfo(1);\r\n\r\n return ($result);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
comprueba si existe el equipo | function comprobarExisteEquipo($nombre)
{
$mysqli=$this->conexionBD();
$query="SELECT * FROM equipo where `nombre` ='$nombre'";
$resultado=$mysqli->query($query);
if(mysqli_num_rows($resultado)){
$mysqli->close();
return TRUE;
}else{
$mysqli->close();
return FALSE;
}
} | [
"public function insertEquipoCompleto()\n\t\t{\n\t\t\t//insertamos el equipo\n\t\t\t$rs = mysql_query(\"\n\t\t\t\tINSERT INTO equipo (nom_equ,mail_equ,tel_equ,pag_equ)VALUES('\".\n\t\t\t\t\tmysql_real_escape_string($this->nombreEquipo).\"','\"\n\t\t\t\t\t.mysql_real_escape_string($this->email).\"','\"\n\t\t\t\t\t.mysql_real_escape_string($this->tel).\"',0)\n\t\t\t\t\");\n\n\t\t\tif(!$rs){\n\t\t\t\tprint(\"No se realizo la insercion de equipo =(\".mysql_error());\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t//sacamos la cve del mysql\n\t\t\t\t$cve_equ = mysql_insert_id();\n\t\t\t\t//fijamos las cve de las categorias\n\t\t\t\t$this->setArrayCve_cat($this->llenarArrayCve_cat());\n\t\t\t\t//arreglo de sentencias sql para insertar robots\n\t\t\t\t$arraySQL=$this->prepareSqlRobots($cve_equ);\n\t\t\t\t//insertamos los robots\n\t\t\t\tif(!$this->insertarArraySql($arraySQL)){\n\t\t\t\t\tprint(\"Ocurrio un error insertando los robots\".mysql_error());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t//insertamos los competidores\n\t\t\t\t$arraySQL = $this->prepareSqlCompetidores($cve_equ);\n\t\t\t\tif(!$this->insertarArraySql($arraySQL)){\n\t\t\t\t\tprint(\"Ocurrio un error insertando los competidores\".mysql_error());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}",
"public function addequipo($nombre, $idu) {\n $queryexiste=mysql_query(\"SELECT ide FROM equipo WHERE nombree='$nombre' \");\n if(mysql_num_rows($queryexiste)==0){\n $result = mysql_query(\"INSERT INTO equipo(nombree,idusuario) VALUES('$nombre', '$idu')\");\n if ($result) {\n $result1=mysql_query(\"SELECT ide FROM equipo WHERE nombree='$nombre' AND idusuario='$idu' \");\n $result3=mysql_query(\"SELECT nombre FROM usuario WHERE idu='$idu' \");\n if(($result1)&&($result3)){\n $row1= mysql_fetch_array($result3);\n $row = mysql_fetch_array($result1);\n $ide=$row['ide'];\n $nom=$row1['nombre'];\n $result2 = mysql_query(\"INSERT INTO jugador(idu,nombrej,ide) VALUES('$idu','$nom', '$ide')\"); \n if ($result) {\n return true;\n }\n return false;\n } \n return false;\n } else {\n return false;\n }\n }else{\n return false;\n }\n }",
"public function nuevoEquipo()\n {\n \n $eqp = new equipo();\n\n //Llamado de las vistas.\n require_once '../vista/header.php';\n require_once '../vista/equipo/equipo-nuevo.php';\n require_once '../vista/footer.php';\n }",
"function existe_proyecto() {\n\n $this->seek_existe_proyecto();\n if ($this->feedback['code'] === '40011'){\n $this->feedback['ok'] = true;\n return true;\n }\n return false;\n }",
"function existe_proyecto() {\n\n $this->seek_existe_proyecto();\n if ($this->feedback['code'] === '40011'){\n $this->feedback['ok'] = true;\n $this->feedback['code'] = '20034';\n return true;\n }\n return false;\n }",
"public function verificar_equipos2($cod)\n\t\t{ \n\t\t\t$this->load->database();\n\t\t\t$sql = 'select id from equipos where id_proveedor= '.$cod;\n\t\t\t$consulta=$this->db->query($sql);\n\t\t\t if ($consulta->num_rows() > 0) {\n\t\t\t$nombresx=true;\n\t\t\t}\n\t\t\telse\n\t\t\t{$nombresx = false;}\n\t\t\treturn $nombresx;\n\t\t}",
"public function produitNonExiste()\n {\n //si le produit n'est plus disponible est qu'il est déjà ajouté au panier \n if ($this->checkIfNotAvailable()) {\n //On renvoie une erreur on return true c a d ce qui es en bd est inferieur ace que l'user a selectioner\n flashy()->error('Un produit dans votre panier n\\'est plus disponible.');\n return back();\n }\n\n //Eviter d'acheter un produit dont la couleur n'existe plus\n //si la couleur n'est plus disponible est qu'il est déjà ajouté au panier \n elseif ($this->checkIfNotAvailableCouleur()) {\n //On renvoie une erreur on return true c a d ce qui es en bd est inferieur ace que l'user a selectioner\n flashy()->error('Une couleur pour un produit dans votre panier n\\'est plus disponible.');\n return back();\n }\n\n //Eviter d'acheter un produit dont la taille n'existe plus\n //si la taille n'est plus disponible est qu'il est déjà ajouté au panier \n elseif ($this->checkIfNotAvailableTaille()) {\n //On renvoie une erreur on return true c a d ce qui es en bd est inferieur ace que l'user a selectioner\n flashy()->error('Une taille pour un produit dans votre panier n\\'est plus disponible.');\n return back();\n }\n /*End*/ \n }",
"function comprobarProductoDuplicado() {\n\t\tif($this->id_nombre_producto == NULL) {\n\t\t\t$consulta = sprintf(\"select id_nombre_producto from nombre_producto where nombre=%s and version=%s and activo=1\",\n\t\t\t\t$this->makeValue($this->nombre, \"text\"),\n\t\t\t\t$this->makeValue($this->version, \"double\"));\n\t\t} else {\t\n\t\t\t$consulta = sprintf(\"select id_nombre_producto from nombre_producto where nombre=%s and version=%s and id_nombre_producto<>%s and activo=1\",\n\t\t\t\t$this->makeValue($this->nombre, \"text\"),\n\t\t\t\t$this->makeValue($this->version, \"double\"),\n\t\t\t\t$this->makeValue($this->id_nombre_producto, \"int\"));\n\t\t}\n\t\t$this->setConsulta($consulta);\n\t\t$this->ejecutarConsulta();\n\t\tif($this->getNumeroFilas() == 0) {\n\t\t\treturn false;\t\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"function existeArchivo_Pregunta($file_name){\n \t\t$estadoTMP = false;\n \t\t//verificar existencia\n\t\t\t\t\tif (file_exists($file_name)){\n\t\t\t\t\t\t\t$estadoTMP = true;\n\t\t\t\t }\n\t\t\t\t return $estadoTMP;\t\t\n }",
"public function nuevo($campos)\n {\n //VERIFICAR SI EL NOMBRE DE EQUIPO ESTÁ REPETIDO\n if ($this->buscar(['equipo_nombre' => $campos['equipo_nombre']])) {\n\n $this->mensaje = \"El Equipo se encuentra repetida\";\n return false;\n\n } else {\n\n if (!$this->app['empresa']->buscarNombreTraerId('NINGUNA')) {\n $this->mensaje = $this->app['empresa']->getMensaje();\n return false;\n } elseif (!$this->app['gerencia']->buscarNombreTraerId('NINGUNA')) {\n $this->mensaje = $this->app['gerencia']->getMensaje();\n return false;\n } elseif (!$this->app['ubicacion']->buscarNombreTraerId('NINGUNA')) {\n $this->mensaje = $this->app['ubicacion']->getMensaje();\n return false;\n } else {\n\n //GUARDAR NUEVO REGISTRO EN TABLA mantenimientos_equipos\n $registrosAfectados = $this->app['db']->insert(\n 'mantenimientos_equipos', [\n 'equipo_nombre' => $campos['equipo_nombre'],\n 'empresa_id' => $this->app['empresa']->getId(),\n 'gerencia_id' => $this->app['gerencia']->getId(),\n 'ubicacion_id' => $this->app['ubicacion']->getId(),\n ]\n );\n\n //VERIFICAR QUE SE GUARDÓ EL EQUIPO\n if ($registrosAfectados > 0) {\n\n //BUSCAR ID DE EQUIPO AGREGADO\n if ($this->buscar(['equipo_nombre' => $campos['equipo_nombre']])) {\n\n if ($this->app['checklist']->agregarTodasActividades($this->registros['equipo_id'], $campos['checklist_so'])) {\n $this->mensaje = \"Las actividades fueron agregadas\";\n return true;\n } else {\n $this->mensaje = \"Error al guardar las actividades\";\n return false;\n\n }\n\n } else {\n $this->mensaje = \"Error al buscar el Id\";\n return false;\n }\n\n }\n\n }\n\n\n }\n }",
"function plantillas_equipos_club($equipo){\n\t\tglobal $query;\n\t\t$datos=$query->personal_equipo($equipo);\n\t\tformatea_envia($datos);\n\t}",
"public function checkExiste() {\n\t\t$sql = \"SELECT object_name, procedure_name FROM user_procedures WHERE object_name = UPPER(:v_function_name) AND object_type = :v_object_type\";\n\t\t$stmt = oci_parse($this->getConnection(), $sql);\n\t\toci_bind_by_name($stmt, \":v_function_name\", $this->objectName);\n\t\toci_bind_by_name($stmt, \":v_object_type\", $this->objectType);\n\n\t\tif (!@oci_execute($stmt)) {\n\t\t\t$e = oci_error($stmt);\n\t\t\t$this->setMensaje(\"Error al verificar la existencia del objeto {$this->objectType} '{$this->objectName}' - {$e['message']}\");\n\t\t\tfalse;\n\t\t}\n\n\t\t$row = @oci_fetch_array($stmt, OCI_ASSOC | OCI_RETURN_NULLS);\n\n\t\tif (empty($row)) {\n\t\t\t// Si el objeto se accede mediante un sinonimo, lo busca en all_objects\n\t\t\tif ($this->remote) {\n\t\t\t\t$sql2 = \"SELECT object_name, procedure_name FROM all_procedures WHERE object_name = UPPER(:v_function_name) AND object_type = :v_object_type\";\n\t\t\t\t$stmt2 = oci_parse($this->getConnection(), $sql2);\n\t\t\t\toci_bind_by_name($stmt2, \":v_function_name\", $this->objectName);\n\t\t\t\toci_bind_by_name($stmt2, \":v_object_type\", $this->objectType);\n\n\t\t\t\tif (!@oci_execute($stmt2)) {\n\t\t\t\t\t$e = oci_error($stmt2);\n\t\t\t\t\t$this->setMensaje(\"Error al verificar la existencia del objeto externo {$this->objectType} '{$this->objectName}' - {$e['message']}\");\n\t\t\t\t\tfalse;\n\t\t\t\t}\n\n\t\t\t\t$row = @oci_fetch_array($stmt2, OCI_ASSOC | OCI_RETURN_NULLS);\n\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->setMensaje(\"No se encontró el objeto {$this->objectType} '{$this->objectName}'\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"function verificarItem($cadena) {\n global $sql;\n \n $respuesta = array();\n $consulta = $sql->existeItem('articulos', 'nombre', $cadena);\n\n $respuesta['verificaExistenciaArticulo'] = true; //determina que lo que se consulta es la existencia del item\n $respuesta['consultaExistenciaArticulo'] = $consulta; //determina si se encontro o no el item\n\n Servidor::enviarJSON($respuesta);\n}",
"function consultarEquipaje(){\n $resultado = false;\n $query = \"SELECT descripcion, tipo, peso\n FROM EQUIPAJE\";\n $resultado = $this->transaccion->realizarTransaccion($query);\n return $resultado;\n }",
"function comExiste($nombre) {\r\n\t\tglobal $tsCore, $tsUser;\r\n\t\t$dato = db_exec('fetch_assoc', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT c_id, c_nombre FROM c_comunidades LEFT JOIN u_miembros ON user_id = c_autor WHERE c_nombre_corto = \\''.$tsCore->setSecure($nombre).'\\' '.($tsUser->is_admod == 1 ? '' : 'AND user_activo = \\'1\\' AND user_baneado = \\'0\\' AND c_estado = \\'0\\'').' LIMIT 1'));\r\n\t\tif($dato['c_nombre']) {\r\n\t\t\treturn $dato['c_id'];\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function setVendedor($nome,$comissao){\n try{\n $x = 1;\n $Conexao = Conexao::getConnection();\n $query = $Conexao->prepare(\"INSERT INTO vendedor (nome,comissao) VALUES ('$nome',$comissao)\"); \n $query->execute(); \n // $query = $Conexao->query(\"DELETE FROM vendedor WHERE id_vendedor = (SELECT top 1 id_vendedor from vendedor order by id_vendedor desc)\"); \n // $query->execute();\n return 1;\n\n }catch(Exception $e){\n echo $e->getMessage();\n return 2;\n exit;\n } \n }",
"function consularEquipo($name){\n\n $mysqli=$this->conexionBD();\n\n\t\t\t$toret=array();\n\n\t\t\t\t$sql = \"SELECT e.nombre as nom, e.capital as capi, c.login as logi, c.pwd as pw, c.tipo as tip from equipo e, cuenta c where c.nombre_eq=e.nombre and e.nombre='$name'\";\n\n\t\t\t\tif (!($resultado = $mysqli->query($sql))){\n\t\t\t\t\treturn 'ERR_CONS_BD';\n\t\t\t\t}\n\t\t\t else{\n\t\t\t if ($resultado->num_rows >= 1){\n\t\t\t\t\t\twhile($aux = mysqli_fetch_array($resultado, MYSQLI_ASSOC)){\n\t\t\t \t array_push($toret, $aux['nom']);\n array_push($toret, $aux['capi']);\n array_push($toret, $aux['logi']);\n array_push($toret, $aux['pw']);\n array_push($toret, $aux['tip']);\n\t\t\t \t}\n\t\t\t\t\t return $toret;\n\t\t\t \t }\n\t\t\t\t}\n }",
"public function existeregistromaestrocajachica() {\n \n }",
"function registrar_equipo_de_catedra ($secuencia){\n //Agregamos el equipo de catedra si existe.\n if(count($this->s__docentes_seleccionados)>0){\n foreach($this->s__docentes_seleccionados as $clave=>$docente){\n \n $docente['id_asignacion']=$secuencia;\n \n $this->dep('datos')->tabla('catedra')->nueva_fila($docente);\n $this->dep('datos')->tabla('catedra')->sincronizar();\n $this->dep('datos')->tabla('catedra')->resetear();\n }\n \n //Limpiamos el arreglo para no acumular resultados en busquedas sucesivas.\n $this->s__docentes_seleccionados=array();\n \n //Limpiamos el arreglo para no cargar datos por defecto en el formulario despues de seleccionar\n //un equipo de catedra y registrar la asignacion correspondiente en el sistema.\n $this->s__datos_form_asignacion=array();\n }\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get global discounts list. | public function getGlobalDiscounts()
{
if (\App\Cache::has('Inventory', 'Discounts')) {
return \App\Cache::get('Inventory', 'Discounts');
}
$discounts = (new App\Db\Query())->from('a_#__discounts_global')->where(['status' => 0])
->createCommand(App\Db::getInstance('admin'))->queryAllByGroup(1);
\App\Cache::save('Inventory', 'Discounts', $discounts, \App\Cache::LONG);
return $discounts;
} | [
"public function getDiscounts(): array\n {\n return $this->discounts;\n }",
"public function getDiscounts()\n {\n if (!empty($this->shop_list_discounts))\n {\n $discounts = [];\n foreach ($this->shop_list_discounts as $relationship)\n {\n $discounts[] = $relationship->getDiscount();\n }\n }\n else\n {\n $discounts = [];\n }\n\n return $discounts;\n }",
"public function getCartDiscounts();",
"public function getDiscountList()\n {\n return $this->discount_list;\n }",
"public function clientDiscounts(){\n\n return ClientDiscount::ClientServiceRequestsDiscounts()->get();\n }",
"function dscGetAllOrderPriceDiscounts()\r\n{\r\n return _dscGetAllDiscounts('A');\r\n}",
"function getDiscounts() {\n if (!empty($this->code)) {\n $this->filterDiscountByCode();\n }\n $this->filterDiscountByEntity();\n if (!$this->is_display_field_mode) {\n $this->filterDiscountsByContact();\n }\n return $this->entity_discounts;\n }",
"public function getDiscountsData()\n {\n $discounts = [];\n if ($this->hasDiscounts()) {\n foreach($this->getDiscounts() as $discount) {\n $discounts[] = $discount->toArray();\n }\n }\n return $discounts;\n }",
"protected function currentDiscounts()\n\t{\n\t\treturn collect($this->asBraintreeSubscription()->discounts)->map(function ($discount) {\n\t\t\treturn $discount->id;\n\t\t})->all();\n\t}",
"public function getDiscounts() {\n\n $discounts = array();\n $collection = new GeneralActivityHasRelationProductDiscountCollection();\n $attribute = array(\"activity_id\" => $this->getId());\n $result = $collection->getRecords($attribute, 1, 10000);\n\n foreach($result[\"records\"] as $key => $record) {\n array_push($discounts, new GeneralActivityHasRelationProductDiscount($record[\"id\"]));\n }\n\n return $discounts;\n }",
"protected function GetActiveDiscounts()\n {\n if (is_null($this->oActiveDiscounts)) {\n $this->oActiveDiscounts = new TShopBasketDiscountList();\n }\n\n return $this->oActiveDiscounts;\n }",
"public function getCartDiscounts()\n {\n if (is_null($this->cartDiscounts)) {\n /** @psalm-var ?list<stdClass> $data */\n $data = $this->raw(self::FIELD_CART_DISCOUNTS);\n if (is_null($data)) {\n return null;\n }\n $this->cartDiscounts = CartDiscountReferenceCollection::fromArray($data);\n }\n\n return $this->cartDiscounts;\n }",
"function get_price_discounts(){\n\t\treturn apply_filters('em_booking_get_price_discounts', $this->get_price_adjustments('discounts'), $this);\n\t}",
"public function getDiscs(): DiscList\n {\n return $this->discs;\n }",
"public function getOrderDiscounts()\n {\n return $this->formatNumberForGoogle( $this->order->getDiscountAmount() );\n }",
"public function get_discounts_from_woo_cart() {\n\n\t\t$discounts = array();\n\n\t\tglobal $woocommerce;\n\n\t\t$applied_coupons = $woocommerce->cart->applied_coupons;\n\n\t\tif ( empty( $applied_coupons ) ) {\n\t\t\treturn $discounts;\n\t\t}\n\n\t\tforeach ( $applied_coupons as $coupon_code ) {\n\n\t\t\t$discount\t\t= array();\n\t\t\t$coupon \t\t= new WC_Coupon( $coupon_code );\n\t\t\t$discount_type \t= $coupon->get_discount_type();\n\n\t\t\tif ( 'fixed_product' == $discount_type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$discount['name'] = strtoupper( $coupon_code );\n\n\t\t\tif ( 'percent' == $discount_type ) {\n\t\t\t\t$discount['percentage'] = $coupon->get_amount();\n\t\t\t} else {\n\t\t\t\t$discount['amount_money'] = array(\n\t\t\t\t\t'amount'\t=> $this->format_amount( $coupon->get_amount() ),\n\t\t\t\t\t'currency'\t=> 'USD',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$discounts[] = $discount;\n\n\t\t}\n\n\t\treturn $discounts;\n\t}",
"function listDiscountreferral()\n {\n $apiUrl=$this->source.'/api/web/referral/listdatas/discount';\n $curl = new curl\\Curl();\n $list = $curl->get($apiUrl);\n\n //$data = ArrayHelper::map(json_decode($list), 'discount_id', 'type');\n \n return $list;\n }",
"public function getdiscountsAction() {\n $mdl_combos = new Application_Model_Combos();\n $this->view->discount = $mdl_combos->getComboDiscount();\n }",
"public function get_group_discounts()\r\n\t{\r\n\t\t// Check the discount tables exist in the config file and are enabled.\r\n\t\tif ($this->get_enabled_status('discounts'))\r\n\t\t{\r\n\t\t\t// Set aliases of discount table data.\r\n\t\t\t$tbl_cols_discounts = $this->flexi->cart_database['discounts']['columns'];\r\n\t\t\t$tbl_cols_group_discounts = $this->flexi->cart_database['discount_groups']['columns'];\r\n\t\t\t$tbl_cols_group_item_discounts = $this->flexi->cart_database['discount_group_items']['columns'];\r\n\t\t\r\n\t\t\t$sql_select = array(\r\n\t\t\t\t$tbl_cols_group_item_discounts['item'].' AS item_id',\r\n\t\t\t\t$tbl_cols_discounts['group'].' AS group_id'\r\n\t\t\t);\r\n\r\n\t\t\t// Lookup item id from item data array and add to SQL WHERE string\r\n\t\t\t$sql_where = ' AND ('.$tbl_cols_group_item_discounts['item'].' IN (';\r\n\t\t\tforeach($this->flexi->cart_contents['items'] as $item)\r\n\t\t\t{\r\n\t\t\t\t$sql_where .= $item[$this->flexi->cart_columns['item_id']].',';\r\n\t\t\t}\r\n\t\t\t$sql_where = rtrim($sql_where,',').') AND '.$tbl_cols_group_discounts['status'].' = 1)';\r\n\t\t\t\r\n\t\t\tif ($group_item_discount_data = $this->get_database_discount_data($sql_select, $sql_where, 'group_discounts'))\r\n\t\t\t{\r\n\t\t\t\treturn $this->sort_discount_data($group_item_discount_data);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows the input field for the 'default to' box | public function settings_default_to() {
$options = get_option( 'clockwork_formidable' );
echo '<input id="formidable_sms_username" name="clockwork_formidable[default_to]" size="40" type="text" value="' . $options['default_to'] . '" style="padding: 3px;" />';
} | [
"function showDefaultEntry() {\n\t\t$this->pl->setBlankWorkingEntry();\n\t}",
"public function display_default() {\n $this->display_edit();\n }",
"function show_default_value()\n\t{\n\t\t// Check to see if we have a type\n\t\t\n\t\tif( !$this->EE->input->get_post('type') ):\n\t\t\n\t\t\tshow_error(\"Invalid Input\");\n\t\t\n\t\tendif;\n\n\t\t$type = $this->EE->input->get_post('type');\n\t\t\n\t\t$value = '';\n\t\t\n\t\t// Get the value if we have the setting ID\n\t\t\n\t\tif( $this->EE->input->get_post('setting_id') ):\n\t\t\n\t\t\t$setting = $this->EE->settings_mdl->get_setting( $this->EE->input->get_post('setting_id') );\n\t\n\t\t\t$value = $setting->default_value;\n\t\t\t\n\t\tendif;\n\t\t\n\t\t$this->EE->load->helper('panel');\n\n\t\tif( method_exists($this->types->$type, 'default_value') ):\n\t\t\n\t\t\tajax_output( $this->types->$type->default_value( $value ) );\n\t\t\n\t\telse:\n\t\t\n\t\t\tajax_output( form_input(array('id'=>'default_value','name'=>'default_value','class'=>'fullfield','value'=>$value)) );\n\t\t\n\t\tendif;\n\t}",
"function upstream_print_project_permalink_field()\n{\n $value = esc_attr(get_option('upstream_projects_base', ''));\n\n /**\n * @var string $default\n */\n $default = apply_filters('upstream_projects_base', 'projects');\n\n echo '<input name=\"upstream_projects_base\" id=\"upstream_projects_base\" type=\"text\" class=\"regular-text code\" value=\"' . $value . '\" placeholder=\"' . $default . '\">';\n}",
"protected function hide_default() {\n\t\t?>\n\t\t<label>\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t'<input name=\"hide_default\" type=\"checkbox\" value=\"1\" %s /> %s',\n\t\t\t\tchecked( $this->options['hide_default'], 1, false ),\n\t\t\t\tesc_html__( 'Hide URL language information for default language', 'polylang' )\n\t\t\t);\n\t\t\t?>\n\t\t</label>\n\t\t<?php\n\t}",
"function do_default() {\n $form = $this->get_engine_form();\n if (!$this->can_do_edit()) {\n $form->freeze();\n }\n $this->_form = $form;\n $this->display('default');\n }",
"function setShow()\n {\n $this->default = $this->getFieldFromDB();\n }",
"public function get_hidden_control_input() {\n\t\t\t$value = wp_parse_args( $this->value(), $this->default );\n\t\t\t?>\n\t\t\t<input type=\"hidden\" id=\"<?php echo $this->id; ?>-settings\" name=\"<?php echo $this->id; ?>\" value=\"<?php $this->value(); ?>\" data-customize-setting-link=\"<?php echo $this->option_name; ?>\"/>\n\t\t\t<?php\n\t\t}",
"private function Textfield() {\n return '<input type=\"text\" size=\"' . $this->TEXTLENGTH . '\" name=\"' . $this->name . '\" value=\"' . $this->default_value . '\" />' . \"\\n\";\n }",
"public function display_product_quantity_input( $default ){\n\t\tif( $this->min_purchase_quantity > 0 ){ $default = $this->min_purchase_quantity; }\n\t\t\n\t\techo \"<input type=\\\"number\\\" value=\\\"\" . $default . \"\\\" name=\\\"product_quantity\\\" id=\\\"product_quantity_\" . $this->model_number . \"\\\" class=\\\"product_quantity_input\\\" />\";\n\t}",
"public function setDefaultValue()\n\t\t\t{\n\t\t\t\t$this->setFormField('block', '');\n\t\t\t\t$this->setFormField('about', '');\n\t\t\t\t$this->setFormField('source', '');\n\t\t\t\t$this->setFormField('start_date', '');\n\t\t\t\t$this->setFormField('end_date', '');\n\t\t\t\t$this->setFormField('status', 'toactivate');\n\t\t\t}",
"public function property_status_slug_input() {\n\t\t$permalinks = get_option( 'foxestate_permalinks' );\n\t\t?>\n\t\t<input name=\"property_status_slug_input\" type=\"text\" class=\"regular-text code\" value=\"<?php if ( isset( $permalinks['status_base'] ) ) echo esc_attr( $permalinks['status_base'] ); ?>\" placeholder=\"<?php echo _x('property-status', 'slug', 'colabsthemes') ?>\"/>\n\t\t<?php\n\t}",
"function selectDefault($input, $actual) {\n if ($input == $actual) {\n $selected = ' selected';\n }\n else {\n $selected = '';\n }\n echo \"<option value = '\" . $input . \"'>\" . $input . \"</option>\";\n }",
"function keyboard_shortcut_modal_form() {\n return $this->template->view('team_members/keyboard_shortcut_modal_form');\n }",
"public function show_field_email() {\n $value = get_option('bitcointips_email');\n if (!strlen($value)) {\n $current_user = wp_get_current_user();\n $value = $current_user->user_email;\n }\n echo \n '<input name=\"bitcointips_email\" type=\"text\" value=\"' . $value . '\" size=\"34\" /><br />',\n '<p class=\"description bitcointips-width\">',\n 'Address to use for email notifications',\n '</p>'\n ;\n }",
"public function _settings_field_contact_form_summary() {\n global $zendesk_support;\n $value = $zendesk_support->_is_default( 'contact_form_summary' ) ? '' : $zendesk_support->settings['contact_form_summary'];\n ?>\n <input type=\"text\" class=\"regular-text\" name=\"zendesk-settings[contact_form_summary]\" value=\"<?php echo $value; ?>\"\n placeholder=\"<?php echo $zendesk_support->default_settings['contact_form_summary']; ?>\"/>\n <?php\n }",
"function optinforms_form3_default_button_text() {\r\n\tglobal $optinforms_form3_button_text;\r\n\tif(empty($optinforms_form3_button_text)) {\r\n\t\t$optinforms_form3_button_text = __('Sign Up Today!', 'optinforms');\r\n\t}\r\n\treturn $optinforms_form3_button_text;\r\n}",
"function draw_input($s_type, $s_name_prefix, $s_name, $wt_default_value) {\n\tif ($s_type == 'textbox') {\n\t\t\treturn '<input type=\\'textbox\\' size=\\'20\\' name=\\''.$s_name_prefix.$s_name.'\\' value=\\''.$wt_default_value.'\\' />';\n\t} else if ($s_type == 'checkbox') {\n\t\t\treturn '<input type=\\'checkbox\\' name=\\''.$s_name_prefix.$s_name.'\\' '.($wt_default_value ? 'CHECKED' : '').'/>';\n\t}\n}",
"function signupScreenEmailPlaceholder()\n {\n return \"Email Address\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets an array of Task objects which contain a foreign key that references this object. If the $criteria is not null, it is used to always fetch the results from the database. Otherwise the results are fetched from the database the first time, then cached. Next time the same method is called without $criteria, the cached collection is returned. If this Project is new, it will return an empty collection or the current collection; the criteria is ignored on a new object. | public function getTasks($criteria = null, PropelPDO $con = null)
{
$partial = $this->collTasksPartial && !$this->isNew();
if (null === $this->collTasks || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collTasks) {
// return empty collection
$this->initTasks();
} else {
$collTasks = TaskQuery::create(null, $criteria)
->filterByProject($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collTasksPartial && count($collTasks)) {
$this->initTasks(false);
foreach ($collTasks as $obj) {
if (false == $this->collTasks->contains($obj)) {
$this->collTasks->append($obj);
}
}
$this->collTasksPartial = true;
}
$collTasks->getInternalIterator()->rewind();
return $collTasks;
}
if ($partial && $this->collTasks) {
foreach ($this->collTasks as $obj) {
if ($obj->isNew()) {
$collTasks[] = $obj;
}
}
}
$this->collTasks = $collTasks;
$this->collTasksPartial = false;
}
}
return $this->collTasks;
} | [
"public function getOperationTaskss($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collOperationTaskssPartial && !$this->isNew();\n if (null === $this->collOperationTaskss || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collOperationTaskss) {\n // return empty collection\n $this->initOperationTaskss();\n } else {\n $collOperationTaskss = OperationTasksQuery::create(null, $criteria)\n ->filterByOperations($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collOperationTaskssPartial && count($collOperationTaskss)) {\n $this->initOperationTaskss(false);\n\n foreach ($collOperationTaskss as $obj) {\n if (false == $this->collOperationTaskss->contains($obj)) {\n $this->collOperationTaskss->append($obj);\n }\n }\n\n $this->collOperationTaskssPartial = true;\n }\n\n $collOperationTaskss->getInternalIterator()->rewind();\n\n return $collOperationTaskss;\n }\n\n if ($partial && $this->collOperationTaskss) {\n foreach ($this->collOperationTaskss as $obj) {\n if ($obj->isNew()) {\n $collOperationTaskss[] = $obj;\n }\n }\n }\n\n $this->collOperationTaskss = $collOperationTaskss;\n $this->collOperationTaskssPartial = false;\n }\n }\n\n return $this->collOperationTaskss;\n }",
"public function getProjectEntrys($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif(null === $this->collProjectEntrys || null !== $criteria) {\n\t\t\tif ($this->isNew() && null === $this->collProjectEntrys) {\n\t\t\t\t// return empty collection\n\t\t\t\t$this->initProjectEntrys();\n\t\t\t} else {\n\t\t\t\t$collProjectEntrys = ProjectEntryQuery::create(null, $criteria)\n\t\t\t\t\t->filterByTeam($this)\n\t\t\t\t\t->find($con);\n\t\t\t\tif (null !== $criteria) {\n\t\t\t\t\treturn $collProjectEntrys;\n\t\t\t\t}\n\t\t\t\t$this->collProjectEntrys = $collProjectEntrys;\n\t\t\t}\n\t\t}\n\t\treturn $this->collProjectEntrys;\n\t}",
"public function getTasksObjects()\n {\n return $this->hasMany(TasksObjects::className(), ['task_id' => 'id']);\n }",
"public function getTasksRelatedByUserid($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UsrPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collTasksRelatedByUserid === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collTasksRelatedByUserid = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(TaskPeer::USERID, $this->id);\n\n\t\t\t\tTaskPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collTasksRelatedByUserid = TaskPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(TaskPeer::USERID, $this->id);\n\n\t\t\t\tTaskPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastTaskRelatedByUseridCriteria) || !$this->lastTaskRelatedByUseridCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collTasksRelatedByUserid = TaskPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastTaskRelatedByUseridCriteria = $criteria;\n\t\treturn $this->collTasksRelatedByUserid;\n\t}",
"public function tasks()\n\t{\n\t\treturn $this->has_many('Client\\\\Project\\\\Task');\n\t}",
"public function listCostObjects($criteria)\n {\n $tasks = Nag::listTasks(array(\n 'completed' => Nag::VIEW_ALL,\n 'include_history' => false)\n );\n $result = array();\n $tasks->reset();\n $last_week = $_SERVER['REQUEST_TIME'] - 7 * 86400;\n while ($task = $tasks->each()) {\n if (($task->completed && $task->completed_date < $last_week) ||\n ($task->start && $task->start > $_SERVER['REQUEST_TIME'])) {\n continue;\n }\n $result[$task->id] = array(\n 'id' => $task->id,\n 'active' => !$task->completed,\n 'name' => $task->name\n );\n for ($parent = $task->parent; $parent->parent; $parent = $parent->parent) {\n $result[$task->id]['name'] = $parent->name . ': '\n . $result[$task->id]['name'];\n }\n if (!empty($task->estimate)) {\n $result[$task->id]['estimate'] = $task->estimate;\n }\n }\n\n if (count($result) == 0) {\n return array();\n } else {\n return array(array('category' => _(\"Tasks\"),\n 'objects' => array_values($result)));\n }\n }",
"function getTasks()\n {\n $query = $GLOBALS['DB']->query(\"SELECT task_id FROM categories_tasks WHERE category_id = {$this->getId()};\");\n\n //We then turn them into a PDO object that we then parse out all of the task id's using the fetchAll method.\n $task_ids = $query->fetchAll(PDO::FETCH_ASSOC);\n\n //Create an array to hold all of the new task objects\n $tasks = array();\n\n //Make a foreach loop to cylce through each task id from our join table. (This foreach loop is cycling a nested array) *fetchAll returns a nested array*\n foreach($task_ids as $id)\n {\n //Extract the current id from the join table data (Wich is a an array) and place it in variable\n $task_id = $id['task_id'];\n\n //Call the DB PDO to query and extract all the tasks with the same ID as that of the join table.\n $result = $GLOBALS['DB']->query(\"SELECT * FROM tasks WHERE id = {$task_id};\");\n\n //Extract all results as a nested array (fetchAll results are always nested arrays)\n $returned_task = $result->fetchAll(PDO::FETCH_ASSOC);\n\n //Since returned task is a nested array we go to the first array and grab the data in the key description. and store that description in a variable.\n $description = $returned_task[0]['description'];\n\n //Same thing as before but with the id\n $id = $returned_task[0]['id'];\n\n $completed = $returned_task[0]['completed'];\n\n $due_date = $returned_task[0]['due_date'];\n //We then make objects out of them shove those objects in an array and send them out.\n $new_task = new Task($description, $id, $completed, $due_date);\n array_push($tasks, $new_task);\n }\n\n return $tasks;\n\n }",
"public function getSchoolprojects($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collSchoolprojects === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collSchoolprojects = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(SchoolprojectPeer::USER_ID, $this->id);\n\n\t\t\t\tSchoolprojectPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collSchoolprojects = SchoolprojectPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(SchoolprojectPeer::USER_ID, $this->id);\n\n\t\t\t\tSchoolprojectPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastSchoolprojectCriteria) || !$this->lastSchoolprojectCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collSchoolprojects = SchoolprojectPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastSchoolprojectCriteria = $criteria;\n\t\treturn $this->collSchoolprojects;\n\t}",
"public function getActiveTasks()\n {\n return TaskQuery::create()\n ->setComment(sprintf('%s l:%s', __METHOD__, __LINE__))\n ->filterByAssignedTo($this->getId())\n ->useNodeQuery()\n ->filterByCurrent(true)\n ->endUse()\n ->find();\n }",
"public function getProjects($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif(null === $this->collProjects || null !== $criteria) {\n\t\t\tif ($this->isNew() && null === $this->collProjects) {\n\t\t\t\t// return empty collection\n\t\t\t\t$this->initProjects();\n\t\t\t} else {\n\t\t\t\t$collProjects = ProjectQuery::create(null, $criteria)\n\t\t\t\t\t->filterByUser($this)\n\t\t\t\t\t->find($con);\n\t\t\t\tif (null !== $criteria) {\n\t\t\t\t\treturn $collProjects;\n\t\t\t\t}\n\t\t\t\t$this->collProjects = $collProjects;\n\t\t\t}\n\t\t}\n\t\treturn $this->collProjects;\n\t}",
"public function projectTasks() {\n\t\t$tasks = array();\n\t\t$tasks_q = mysql_query(\"SELECT * FROM \".$this->getTablePrefix().\"tasks WHERE project='{$this->projectID()}'\");\n\t\twhile($task = mysql_fetch_assoc($tasks_q)) {\n\t\t\t$task[\"actual\"] = $this->taskActual(array($task[\"ID\"]));\n\t\t\t$tasks[] = $task;\n\t\t}\n\t\t\n\t\treturn $tasks;\n\t}",
"public function getThreads(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collThreadsPartial && !$this->isNew();\n if (null === $this->collThreads || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collThreads) {\n // return empty collection\n $this->initThreads();\n } else {\n $collThreads = ChildThreadQuery::create(null, $criteria)\n ->filterByUser($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collThreadsPartial && count($collThreads)) {\n $this->initThreads(false);\n\n foreach ($collThreads as $obj) {\n if (false == $this->collThreads->contains($obj)) {\n $this->collThreads->append($obj);\n }\n }\n\n $this->collThreadsPartial = true;\n }\n\n return $collThreads;\n }\n\n if ($partial && $this->collThreads) {\n foreach ($this->collThreads as $obj) {\n if ($obj->isNew()) {\n $collThreads[] = $obj;\n }\n }\n }\n\n $this->collThreads = $collThreads;\n $this->collThreadsPartial = false;\n }\n }\n\n return $this->collThreads;\n }",
"public function tasks() {\n return $this->hasMany('App\\Task', 'task_collection_id');\n }",
"public function tasks() {\n return $this->hasMany(Task::class,'project_id');\n }",
"public function load()\n {\n $tasks = array();\n $tasksData = $this->db->fetchCol(\"SELECT id FROM schedule_tasks\" . $this->getCondition() . $this->getOrder() . $this->getOffsetLimit(), $this->model->getConditionVariables());\n\n foreach ($tasksData as $taskData) {\n $tasks[] = Model\\Schedule\\Task::getById($taskData);\n }\n\n $this->model->setTasks($tasks);\n return $tasks;\n }",
"public function tasks()\n {\n return $this->hasMany(Task::class)->orderBy('position');\n }",
"public function getWorkItems(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collWorkItemsPartial && !$this->isNew();\n if (null === $this->collWorkItems || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collWorkItems) {\n // return empty collection\n $this->initWorkItems();\n } else {\n $collWorkItems = ChildWorkItemQuery::create(null, $criteria)\n ->filterByTransition($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collWorkItemsPartial && count($collWorkItems)) {\n $this->initWorkItems(false);\n\n foreach ($collWorkItems as $obj) {\n if (false == $this->collWorkItems->contains($obj)) {\n $this->collWorkItems->append($obj);\n }\n }\n\n $this->collWorkItemsPartial = true;\n }\n\n return $collWorkItems;\n }\n\n if ($partial && $this->collWorkItems) {\n foreach ($this->collWorkItems as $obj) {\n if ($obj->isNew()) {\n $collWorkItems[] = $obj;\n }\n }\n }\n\n $this->collWorkItems = $collWorkItems;\n $this->collWorkItemsPartial = false;\n }\n }\n\n return $this->collWorkItems;\n }",
"private function getTasks()\n {\n $user = Auth::user();\n\n $projectIdsOwn = $user->projects()->pluck('id');\n $projectIdsShared = $user->shared_projects()->wherePivot('accepted', true)->pluck('id');\n $projectIds = array_merge($projectIdsOwn->toArray(), $projectIdsShared->toArray());\n\n return $user->tasks()->whereIn('project_id', $projectIds);\n }",
"public function getTickets($criteria = null, $con = null)\n\t{\n\t\t// include the Peer class\n\t\tinclude_once 'lib/model/om/BaseTicketPeer.php';\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria();\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collTickets === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collTickets = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(TicketPeer::FILE_ID, $this->getId());\n\n\t\t\t\tTicketPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collTickets = TicketPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(TicketPeer::FILE_ID, $this->getId());\n\n\t\t\t\tTicketPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastTicketCriteria) || !$this->lastTicketCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collTickets = TicketPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastTicketCriteria = $criteria;\n\t\treturn $this->collTickets;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get if language of items is initialized properly | function getItemsNoLang()
{
static $return;
if ($return !== NULL) return $return;
$return = false;
$cparams = JComponentHelper::getParams( 'com_flexicontent' );
$enable_translation_groups = $cparams->get("enable_translation_groups") && ( FLEXI_J16GE || FLEXI_FISH );
$query = "SELECT COUNT(*)"
." FROM #__flexicontent_items_ext as ie"
." WHERE ie.language='' " . ($enable_translation_groups ? " OR (ie.lang_parent_id=0 AND ie.item_id<>0) " : "")
." LIMIT 1";
$this->_db->setQuery($query);
$cnt = $this->_db->loadResult();
if ($cnt) return $return = true;
if (!FLEXI_J16GE) return $return;
$query = "SELECT COUNT(*)"
." FROM #__content as i"
." WHERE i.language=''"
." LIMIT 1";
$this->_db->setQuery($query);
$cnt = $this->_db->loadResult();
if ($cnt) return $return = true;
return $return;
} | [
"public function hasLanguage() : bool;",
"public function hasLanguage(): bool;",
"public function testItemLanguage()\n {\n // items[1] === language tag on root node\n // items[2] === fallback to feed language\n $parser = new Atom(file_get_contents('tests/fixtures/atom.xml'));\n $feed = $parser->execute();\n $this->assertEquals('bg', $feed->items[0]->getLanguage());\n $this->assertEquals('bg', $feed->items[1]->getLanguage());\n $this->assertEquals('ru', $feed->items[2]->getLanguage());\n\n $parser = new Atom(file_get_contents('tests/fixtures/atom_no_default_namespace.xml'));\n $feed = $parser->execute();\n $this->assertEquals('bg', $feed->items[0]->getLanguage());\n $this->assertEquals('bg', $feed->items[1]->getLanguage());\n $this->assertEquals('ru', $feed->items[2]->getLanguage());\n\n $parser = new Atom(file_get_contents('tests/fixtures/atom_prefixed.xml'));\n $feed = $parser->execute();\n $this->assertEquals('bg', $feed->items[0]->getLanguage());\n $this->assertEquals('bg', $feed->items[1]->getLanguage());\n $this->assertEquals('ru', $feed->items[2]->getLanguage());\n\n $parser = new Atom(file_get_contents('tests/fixtures/atom_empty_item.xml'));\n $feed = $parser->execute();\n $this->assertEquals('', $feed->items[0]->getLanguage());\n }",
"public static function get_language_is_all() {\n\t\treturn self::$language_is_all;\n\t}",
"public function isConstructedLanguage() {\n\t\treturn $this->getConstructedLanguage();\n\t}",
"public function getInLanguage();",
"protected function lang() {\n // language attribute is only allowed when lang support is activated\n return (!empty($this->data['lang']) && c::get('lang.support')) ? $this->data['lang'] : false;\n }",
"public function getDefaultLangOnEmpty(): bool\n {\n return $this->defaultLangOnEmpty ?? true;\n }",
"public function hasLanguage()\n {\n return $this->get(self::LANGUAGE) !== null;\n }",
"protected function checkLanguage()\n\t{\n\t\t$objDataProvider = $this->getDC()->getDataProvider();\n\n\t\t// Check if DP is multilanguage\n\t\tif ($this->getDC()->getDataProvider() instanceof InterfaceGeneralDataMultiLanguage)\n\t\t{\n\t\t\t$this->blnMLSupport = true;\n\t\t\t$this->objLanguagesSupported = $objDataProvider->getLanguages($this->getDC()->getId());\n\t\t\t$this->strCurrentLanguage = $objDataProvider->getCurrentLanguage();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->blnMLSupport = false;\n\t\t\t$this->objLanguagesSupported = null;\n\t\t\t$this->strCurrentLanguage = null;\n\t\t}\n\t}",
"public function testInfoAvailableLanguages()\n {\n }",
"private function get_language()\n {\n // For user implementation\n }",
"public function isTranslated()\n {\n return $this->_LOCALIZED_UID > 0;\n }",
"public function getAvailableLanguages ();",
"public function testLang()\n\t{\n\t\t$lang_available = Lang::get_lang_available();\n\t\t$keys = array_keys(Lang::get_lang());\n\n\t\tforeach ($lang_available as $code) {\n\t\t\t$lang_test = Lang::factory()->make($code);\n\t\t\t$locale = $lang_test->get_locale();\n\n\t\t\tforeach ($keys as $key) {\n\t\t\t\t$this->assertArrayHasKey($key, $locale, 'Language ' . $lang_test->code() . ' is incomplete.');\n\t\t\t}\n\t\t}\n\t}",
"function is_multilingual()\n {\n return count(supported_locales()) > 1;\n }",
"public function isLocalized()\n {\n return !is_null(Strata::config(\"i18n.locales\"));\n }",
"public function getIsMultilingual()\n {\n return $this->getProperty(\"IsMultilingual\");\n }",
"function init_locale() {\n \n // Used when application is initialized from command line (we don't have\n // all the classes available)\n if(!class_exists('ConfigOptions') || !class_exists('UserConfigOptions')) {\n return true;\n } // if\n \n $logged_user =& get_logged_user();\n \n $language_id = null;\n if(instance_of($logged_user, 'User')) {\n if(LOCALIZATION_ENABLED) {\n $language_id = UserConfigOptions::getValue('language', $logged_user);\n } // if\n \n $format_date = UserConfigOptions::getValue('format_date', $logged_user);\n $format_time = UserConfigOptions::getValue('format_time', $logged_user);\n } else {\n if(LOCALIZATION_ENABLED) {\n $language_id = ConfigOptions::getValue('language');\n } // if\n \n $format_date = ConfigOptions::getValue('format_date');\n $format_time = ConfigOptions::getValue('format_time');\n } // if\n \n $language = new Language();\n \n // Now load languages\n if(LOCALIZATION_ENABLED && $language_id) {\n $language = Languages::findById($language_id);\n if(instance_of($language, 'Language')) {\n $current_locale = $language->getLocale();\n \n $GLOBALS['current_locale'] = $current_locale;\n $GLOBALS['current_locale_translations'] = array();\n \n if($current_locale != BUILT_IN_LOCALE) {\n setlocale(LC_ALL, $current_locale); // Set locale\n $GLOBALS['current_locale_translations'][$current_locale] = array();\n \n $language->loadTranslations($current_locale);\n } // if\n } // if\n } // if\n \n $this->smarty->assign('current_language', $language);\n \n define('USER_FORMAT_DATETIME', \"$format_date $format_time\");\n define('USER_FORMAT_DATE', $format_date);\n define('USER_FORMAT_TIME', $format_time);\n \n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refresh a tag's last discussion details. | public function refreshLastDiscussion()
{
if ($lastDiscussion = $this->discussions()->latest('last_time')->first()) {
$this->setLastDiscussion($lastDiscussion);
}
return $this;
} | [
"public function updateMainDiscussion();",
"public function refreshLastViewedAt() : void\n {\n $this->lastViewedAt = new \\DateTime();\n }",
"public function getLatestTag();",
"public function refresh()\n {\n $this->data = Diffy::request('GET', 'diffs/'.$this->diffId);\n }",
"public function updateTagCountDiscussions($tagID) {\n $px = $this->Database->DatabasePrefix;\n // Update the counts.\n $sql = \"update {$px}Tag t\n set CountDiscussions = (\n select count(DiscussionID)\n from {$px}TagDiscussion td\n where td.TagID = t.TagID)\n where t.TagID = :TagID\";\n $this->Database->query($sql, [':TagID' => $tagID]);\n }",
"public function updateLastPost()\r\n {\r\n $lastPost = $this->getModelFromCache('XenForo_Model_Thread')->getLastUpdatedThreadInSocialForum(\r\n $this->get('social_forum_id'));\r\n if ($lastPost) {\r\n $this->set('last_post_id', $lastPost['last_post_id']);\r\n $this->set('last_post_date', $lastPost['last_post_date']);\r\n $this->set('last_post_user_id', $lastPost['last_post_user_id']);\r\n $this->set('last_post_username', $lastPost['last_post_username']);\r\n $this->set('last_thread_title', $lastPost['title']);\r\n } else {\r\n $this->set('last_post_id', 0);\r\n $this->set('last_post_date', 0);\r\n $this->set('last_post_user_id', 0);\r\n $this->set('last_post_username', '');\r\n $this->set('last_thread_title', '');\r\n }\r\n }",
"public function refresh() {\n $logged_user = $_SESSION['logged_user'];\n\n if ($logged_user) {\n $this->load->model(\"topic_model\", \"topics\");\n\n $this->topics->update_user_topics($logged_user);\n }\n }",
"public function getLastPost() {\n $this->lastPost = $this->thread->getOne('LastPost');\n $lastPostArray = $this->lastPost->toArray('lastPost.');\n $this->setPlaceholders($lastPostArray);\n }",
"public function refreshAggregateRecentPost($categoryID, $updateAncestors = false) {\n $categories = CategoryModel::getSubtree($categoryID, true);\n $categoryIDs = array_column($categories, 'CategoryID');\n\n $discussion = $this->SQL->getWhere(\n 'Discussion',\n ['CategoryID' => $categoryIDs],\n 'DateLastComment',\n 'desc',\n 1)->firstRow(DATASET_TYPE_ARRAY);\n $comment = null;\n\n if (is_array($discussion)) {\n $comment = CommentModel::instance()->getID($discussion['LastCommentID']);\n $this->setField($categoryID, 'LastCategoryID', $discussion['CategoryID']);\n }\n\n $db = static::postDBFields($discussion, $comment);\n $cache = static::postCacheFields($discussion, $comment);\n $this->setField($categoryID, $db);\n static::setCache($categoryID, $cache);\n\n if ($updateAncestors) {\n // Grab this category's ancestors, pop this category off the end and reverse order for traversal.\n $ancestors = self::instance()->collection->getAncestors($categoryID, true);\n array_pop($ancestors);\n $ancestors = array_reverse($ancestors);\n $lastInserted = strtotime($db['LastDateInserted']) ?: 0;\n if (is_array($discussion) && array_key_exists('CategoryID', $discussion)) {\n $lastCategoryID = $discussion['CategoryID'];\n } else {\n $lastCategoryID = false;\n }\n\n foreach ($ancestors as $row) {\n // If this ancestor already has a newer discussion, stop.\n if ($lastInserted < strtotime($row['LastDateInserted'])) {\n // Make sure this latest discussion is even valid.\n $lastDiscussion = DiscussionModel::instance()->getID($row['LastDiscussionID']);\n if ($lastDiscussion) {\n break;\n }\n }\n $currentCategoryID = val('CategoryID', $row);\n self::instance()->setField($currentCategoryID, $db);\n CategoryModel::setCache($currentCategoryID, $cache);\n\n if ($lastCategoryID) {\n self::instance()->setField($currentCategoryID, 'LastCategoryID', $lastCategoryID);\n }\n }\n }\n }",
"public function resetTagDetail() {\n\t\t$this->content_tag_detail = null;\n\t}",
"public function getRecent($tag)\n {\n return $this->adapter->get(sprintf('%s/v1/tags/%s/media/recent', self::ENDPOINT, $tag));\n }",
"private function resetLastPost() { \n\t\t$forum = YBoardForum::find()->where(['last_post_id'=>$this->id])->one();\n\t\t$topic = YBoardTopic::find()->where(['last_post_id'=>$this->id])->one();\n\n\t\tif($forum !== null) { \n\t\t\t$post = YBoardPost::find()\n ->where(['forum_id'=>$forum->id, 'approved'=>1])\n ->orderBy('id DESC')\n ->limit(1) \n ->one();\n \n\t\t\tif($post === null) {\n\t\t\t\t$forum->last_post_id = null;\n\t\t\t} else {\n\t\t\t\t$forum->last_post_id = $post->id;\n\t\t\t}\n\t\t\t$forum->update();\n\t\t}\n \n\t\tif($topic !== null) {\n\t\t\t$post = YBoardPost::find()\n ->where(['topic_id'=>$topic->id, 'approved'=>1])\n ->orderBy('id DESC')\n ->limit(1) \n ->one();\n \n\t\t\tif($post === null) {\n\t\t\t\t$topic->last_post_id = null;\n\t\t\t} else {\n\t\t\t\t$topic->last_post_id = $post->id;\n\t\t\t}\n\t\t\t$topic->update();\n\t\t}\n\t}",
"public function updated(Discussion $discussion)\n {\n }",
"public function updateLastMessage() {\n\t\t$sql = \"SELECT\t\ttime, userID, username\n\t\t\tFROM\t\twcf\".WCF_N.\"_conversation_message\n\t\t\tWHERE\t\tconversationID = ?\n\t\t\tORDER BY\ttime DESC\";\n\t\t$statement = WCF::getDB()->prepareStatement($sql, 1);\n\t\t$statement->execute([\n\t\t\t$this->conversationID\n\t\t]);\n\t\t$row = $statement->fetchArray();\n\t\t\n\t\t$this->update([\n\t\t\t'lastPostTime' => $row['time'],\n\t\t\t'lastPosterID' => $row['userID'],\n\t\t\t'lastPoster' => $row['username']\n\t\t]);\n\t}",
"public function refreshLastContentChangedAt() : void\n {\n $this->lastContentChangeAt = new \\DateTime();\n }",
"public function getLastVisitedThread() {\n $this->setPlaceholder('last_reading','');\n $lastThread = $this->user->getLastVisitedThread();\n if ($lastThread) {\n /** @var disPost $firstPost */\n $firstPost = $this->modx->getObject('disPost',$lastThread->get('post_first'));\n $placeholders = $lastThread->toArray('lastThread.');\n if ($firstPost) {\n $placeholders = array_merge($placeholders,$firstPost->toArray('lastThread.'));\n $placeholders['last_post_url'] = $firstPost->getUrl();\n }\n $this->setPlaceholders($placeholders);\n }\n }",
"public function refresh() {\r\n\t\tif ($this->id)\r\n\t\t\t$this->load($this->id);\r\n\t}",
"public function updated($tag)\n {\n parent::updated($tag);\n\n Log::Info(\"Updated tag\", ['tag' => $tag->id]);\n }",
"public function refresh()\n\t{\n\t\t//use retrieve to implement it.\n\t\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build the attributes for the form. | public function buildAttributes() {
// Start with the element attributes (e.g., type of text)
$attributes = $this->elementAttributes();
// The form attributes.
$attributes += array(
'action' => $this->action,
'method' => $this->method,
);
// The attributes that have been set.
$attributes += $this->attributes;
return $attributes;
} | [
"public function buildAttributes()\n {\n $classes = new ClassFactory();\n $classes->add($this->default_class);\n\n if ($this->class) {\n foreach (explode(' ', $this->class) as $c) {\n $classes->add($c);\n }\n }\n\n $attr = new AttributeFactory();\n $attr->add('class', $classes->get());\n\n if ($this->role) {\n $attr->add('role', $this->role);\n }\n\n if ($this->id) {\n $attr->add('id', $this->id);\n }\n\n if ($this->aria_label) {\n $attr->add('aria-label', $this->aria_label);\n }\n\n if ($this->attributes) {\n foreach ($this->attributes as $key => $attribute) {\n $attr->add($key, $attribute);\n }\n }\n\n $this->data['attr'] = $attr->get();\n }",
"protected function initFormAttributes()\n {\n $this->attributes = [\n 'method' => 'POST',\n 'action' => '',\n 'class' => 'layui-form-auto layui-form layui-form-sm',\n 'accept-charset' => 'UTF-8',\n 'pjax-container' => true,\n 'id' => 'j_form_' . Str::random(4),\n ];\n }",
"private function makeAttributes(){\n\n foreach ($this->fields as $key => $field) {\n\n $key = strtolower($key);\n\n if (is_array($field)) {\n $this->{$key} = new Field($key);\n if (isset($field['validates'])) {\n\n $validates = $field['validates'];\n //correção para forçar um array de validades\n if (!isset($validates[0])) {\n $validates = [$validates];\n }\n\n foreach ($validates as $key1 => $validate) {\n if (isset($validate['require'])) {\n $this->{$key}->setRequired((bool)$validate['require']);\n break;\n }\n }\n }\n if (isset($field['type'])) {\n $this->{$key}->setType($field['type']);\n }\n if( isset($field['ignore']) ){\n $this->{$key}->setIgnore($field['ignore']);\n }\n if( isset($field['date_format']) ){\n $this->{$key}->setDateFormat($field['date_format']);\n }\n if( isset($field['empty_value']) ){\n $this->{$key}->setEmptyValue($field['empty_value']);\n }\n } else {\n $this->{strtolower($field)} = new Field(strtolower($field));\n }\n }\n\n $this->created_at = new Field('created_at', date('Y-m-d H:i:s'));\n $this->created_at->setValue(date('Y-m-d H:i:s'));\n $this->id = new Field('id');\n\n }",
"protected function attributes() {\n\t\tif ( empty($this->form_attr) ) {\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t$attr = '';\n\t\tforeach ($this->form_attr as $name => $value) {\n\t\t\t$name = strtolower($name);\n\t\t\tif ($name === 'class' || $name === 'id') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$attr .= ' '.$name.'=\"'.htmlspecialchars($value, ENT_QUOTES, 'UTF-8').'\"';\n\t\t}\n\t\treturn $attr;\n\t}",
"protected function inputAttributes()\n {\n $this->input_attributes['name'] = $this->name;\n $this->input_attributes['id'] = $this->id;\n $this->input_attributes['type'] = $this->params['type'];\n\n if (array_key_exists('enabled', $this->params)\n && $this->params['enabled'] == false\n ) {\n $this->input_attributes['disabled'] = 'disabled';\n $this->input_attributes['class'][] = 'disabled';\n }\n\n if (array_key_exists('writable', $this->params)\n && $this->params['writable'] == false\n ) {\n $this->input_attributes['readonly'] = 'readonly';\n $this->input_attributes['class'][] = 'readonly';\n }\n\n if (array_key_exists('onchange', $this->params)) {\n $this->input_attributes['onchange'] = $this->params['onchange'];\n }\n\n if (array_key_exists('placeholder', $this->params)) {\n $this->input_attributes['placeholder'] = $this->params['placeholder'];\n }\n }",
"protected function _setAttribsForm()\n {\n $this->_attribs_form = array_merge(\n (array) $this->_default_attribs,\n (array) $this->_config['attribs'],\n (array) $this->_attribs_auto,\n (array) $this->_attribs_view\n );\n }",
"public function build()\n {\n // build each field in the form definition\n foreach ($this->config->getFields() as $name => $field) {\n if ($fieldObj = FieldFactory::make($name, $field, $this->getValue($name))) {\n $this->fields[] = $fieldObj;\n }\n }\n }",
"private function buildAttributes()\n {\n $attributeString = new String();\n $end = end(array_keys($this->attributes));\n\n foreach($this->attributes as $name => $value)\n {\n if(!$this->selfClosing && $name == 'value') continue;\n\n $attributeString->append(' ')\n ->append($name)\n ->append('=\"')\n ->append($value)\n ->append('\"');\n\n if($name != $end) {\n $attributeString->append(' ');\n }\n }\n\n return $attributeString;\n }",
"public function buildForm() {\n\t\t$this->openForm();\n\t\tforeach ( $this->fields as $field ) {\n\t\t\t$this->html .= $field->render();\n\t\t}\n\t\t$this->closeForm();\n\t}",
"public function buildForm()\n {\n $this\n ->addSelect(\n 'organization_role',\n $this->getCodeList('OrganisationRole', 'Activity'),\n trans('elementForm.organisation_role'),\n $this->addHelpText('Activity_ParticipatingOrg-role'),\n null,\n true\n )\n ->add('identifier', 'text', ['label' => trans('elementForm.identifier'), 'help_block' => $this->addHelpText('Activity_ParticipatingOrg-ref')])\n ->addSelect('organization_type', $this->getCodeList('OrganisationType', 'Activity'), trans('elementForm.organisation_type'), $this->addHelpText('Activity_ParticipatingOrg-type'))\n ->add('activity_id', 'text', ['label' => trans('elementForm.activity_id')])\n ->add('crs_channel_code','text',['label' => 'Crs Channel Code'])\n ->addNarrative('narrative', trans('elementForm.organisation_name'))\n ->addAddMoreButton('add', 'narrative')\n ->addRemoveThisButton('remove_narrative');\n }",
"private function setupFieldsAttributes() {\n\n\t\tforeach ( $this->form as $field ) {\n\n\t\t\tif ( ! $field->hasAttribute( 'id' ) ) {\n\t\t\t\t$field->setAttribute( 'id', esc_attr( sanitize_title( $field->getName() ) ) );\n\t\t\t}\n\t\t}\n\n\t}",
"protected function create_attributes()\n {\n $attr = '';\n if (!empty($this->attr)) {\n foreach ($this->attr as $name => $value) {\n $attr .= ' ' . $name . '=\"' . $value . '\"';\n }\n }\n\n return $attr;\n }",
"function create() {\n\t\t$LegalAttributes = $this->getLegalAttributes();\n\n\t\t$Html = '<input ';\n\n\t\tforeach($LegalAttributes AS $k => $v) {\n\t\t\t$Html .= \"$k=\\\"$v\\\" \";\n\t\t}\n\n\t\t$Html .= '/>';\n\n\t\treturn $Html;\n\t}",
"protected function initAttributes()\n\t{\n\t\t// Determine the names of the attributes that have already been defined to avoid defining the again in the next step\n\t\t$definedAttributes = array();\n\t\tif(isset($this->attributes))\n\t\t{\n\t\t\tforeach($this->attributes as $attr)\n\t\t\t{\n\t\t\t\tif(is_string($attr))\n\t\t\t\t{\n\t\t\t\t\t$i = strpos($attr, ':');\n\t\t\t\t\t$definedAttributes[$i === false ? $attr : substr($attr, 0, $i)] = true;\n\t\t\t\t}\n\t\t\t\telse if(isset($attr['name']))\n\t\t\t\t{\n\t\t\t\t\t$definedAttributes[$attr['name']] = true;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Configure renderable attribute attributes if it has not already been defined manually.\n\t\tforeach($this->data->getAllAttributeNames() as $name)\n\t\t{\n\t\t\tif(!isset($definedAttributes[$name]))\n\t\t\t{\n\t\t\t\t$attr = array(\n\t\t\t\t\t'name' => $name,\n\t\t\t\t\t'type' => $this->data->getAttributeType($name),\n\t\t\t\t);\n\n\t\t\t\tif($attr['type'] === 'text')\n\t\t\t\t{\n\t\t\t\t\t$attr['template'] = \"<tr class=\\\"{class}\\\"><th>{label}</th><td style=\\\"word-wrap:break-word;word-break:break-all;\\\">{value}</td></tr>\\n\";\n\t\t\t\t}\n\t\t\t\t$this->attributes[] = $attr;\n\t\t\t}\n\t\t}\n\t}",
"public function buildForm()\n {\n $this\n ->add('value', 'text', ['label' => trans('elementForm.value')])\n ->addCollection('location', 'Activity\\TargetLocation', 'target_location', [], trans('elementForm.location'))\n ->addAddMoreButton('add_target_location', 'target_location')\n ->addCollection('dimension', 'Activity\\TargetDimension', 'target_dimension', [], trans('elementForm.dimension'))\n ->addAddMoreButton('add_target_dimension', 'target_dimension')\n ->addComments();\n }",
"public function renderAttributes()\n {\n $sAttributes = '';\n $aAttributes = $this->getAttributes();\n\n // if FormElement::bIsRequired || bIsDisabled || bIsReadOnly and no attribute related\n if (isset($this->bIsRequired, $this->bIsDisabled, $this->bIsReadOnly)) {\n if (\n $this->isRequired() === true &&\n (isset($aAttributes['required']) === false || $aAttributes['required'] === 'false')\n ) {\n $this->setAttribute('required', 'true');\n }\n\n if ($this->isDisabled() === true && isset($aAttributes['disabled']) === false) {\n $this->setAttribute('disabled', '');\n }\n\n if ($this->isReadOnly() === true && isset($aAttributes['readonly']) === false) {\n $this->setAttribute('readonly', '');\n }\n }\n\n foreach ($aAttributes as $sAttrName => $mAttrValue) {\n $sAttributes .= $this->renderAttribute($sAttrName, $mAttrValue);\n }\n return $sAttributes;\n }",
"protected function createComponentNewAttributeForm(){\n $form = new Form();\n $presenter=$this;\n $form->setTranslator($this->translator);\n $supportLongNamesInput=$form->addHidden('supportLongNames','0');\n $form->addHidden('miner');\n $form->addHidden('column');\n $form->addHidden('preprocessing');\n $attributeNameInput=$form->addText('attributeName','Attribute name:');\n $attributeNameInput\n ->setRequired('Input attribute name!')\n ->addRule(function(TextInput $input){\n //check, if there is an attribute with the given name\n $values=$input->getForm(true)->getValues();\n $miner=$this->findMinerWithCheckAccess($values->miner);\n $attributes=$miner->metasource->attributes;\n if (!empty($attributes)){\n foreach ($attributes as $attribute){\n if ($attribute->active && $attribute->name==$input->value){\n return false;\n }\n }\n }\n return true;\n },'Attribute with this name already exists!');\n $attributeNameInput\n ->addConditionOn($supportLongNamesInput,Form::NOT_EQUAL,'1')\n ->addRule(Form::PATTERN,'Attribute name can contain only letters, numbers and _ and has start with a letter.','[a-zA-Z]{1}\\w*')\n ->addRule(Form::MAX_LENGTH,'Max length of the column name is %s characters.',MetasourcesFacade::SHORT_NAMES_MAX_LENGTH)\n ->elseCondition()\n ->addRule(Form::MAX_LENGTH,'Max length of the column name is %s characters.',MetasourcesFacade::LONG_NAMES_MAX_LENGTH)\n ->endCondition();\n $form->addSubmit('submit','Create attribute')->onClick[]=function(SubmitButton $button){\n $values=$button->form->values;\n $miner=$this->findMinerWithCheckAccess($values->miner);\n $this->minersFacade->checkMinerMetasource($miner);\n $attribute=new Attribute();\n $attribute->metasource=$miner->metasource;\n $attribute->datasourceColumn=$this->datasourcesFacade->findDatasourceColumn($miner->datasource,$values->column);\n $attribute->name=$values->attributeName;\n $attribute->type=$attribute->datasourceColumn->type;\n $attribute->preprocessing=$this->metaAttributesFacade->findPreprocessing($values->preprocessing);\n $attribute->active=false;\n $this->metasourcesFacade->saveAttribute($attribute);\n\n $metasourceTask=$this->metasourcesFacade->startAttributesPreprocessing($miner->metasource,[$attribute]);\n $this->redirect('preprocessingTask',['id'=>$metasourceTask->metasourceTaskId]);\n };\n $storno=$form->addSubmit('storno','storno');\n $storno->setValidationScope(array());\n $storno->onClick[]=function(SubmitButton $button)use($presenter){\n //redirect to the preprocessing selection\n $values=$button->form->getValues();\n $presenter->redirect('addAttribute',array('column'=>$values->column,'miner'=>$values->miner));\n };\n return $form;\n }",
"public function buildForm() {\n\t\t$form = '';\n\n\t\tforeach ($this->_properties as $row) {\n\t\t\tif (!in_array($row['Field'],$this->_ignore)) {\n\t\t\t\t$elem = $this->buildElement($row);\n\t\t\t\t$row['Comment'] != '' ? $comment = $row['Comment'].\"<br />\": $comment = '';\n\t\t\t\t$this->_properties[$row['Field']]['HTMLElement']=$elem;\n\t\t\t\tif ($row['ElementType']=='hidden')\n\t\t\t\t\t$form .= $elem;\n\t\t\t\telse \n\t\t\t\t\t$form .= sprintf(\"<div class='formElem'>\\n%s<br />\\n%s\\n%s</div>\\n\",ucwords (str_replace (\"_\",\" \",$row['Field'])),$comment,$elem);\n\t\t\t}\n\t\t}\n\t\treturn $form;\n\t}",
"function form_attrs($attr): string\n{\n $attributes = '';\n foreach ($attr as $key => $value) {\n $attributes .= \"$key =\\\"$value\\\"\";\n }\n return $attributes;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation postQualitySurveysScoring Score survey | public function postQualitySurveysScoring($body)
{
list($response) = $this->postQualitySurveysScoringWithHttpInfo($body);
return $response;
} | [
"public function submit_survey_post()\n\t\t{\n\t\t\t$testId = $this->post('testId');\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($testId) &&\n\t\t\t\t!empty($uuid) &&\n\t\t\t\t!empty($weekSend)\n\t\t\t)\n\t\t\t{\n\t\t\t\t$insertData = array(\n\t\t\t\t\t'ts_uuid' => $uuid,\n\t\t\t\t\t'ts_test_id' => $testId,\n\t\t\t\t\t'ts_week' => $weekSend,\n\t\t\t\t\t'ts_submitted_on' => date('Y-m-d H:i:s')\n\t\t\t\t);\n\t\t\t\t$tempStatus = $this->Student_survey_model->insertSurvey($insertData);\n\t\t\t\tif($tempStatus)\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t\t$data['message'] = $this->lang->line('unable_save_answer');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}",
"public function store_survey_post()\n\t\t{\n\t\t\t$clickValue = $this->post('clickValue');\n\t\t\t$optionId = $this->post('optionId');\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($clickValue) &&\n\t\t\t\t!empty($optionId) &&\n\t\t\t\t!empty($uuid) &&\n\t\t\t\t!empty($weekSend)\n\t\t\t)\n\t\t\t{\n\t\t\t\t$insertData = array(\n\t\t\t\t\t'tans_opt_id' => $optionId,\n\t\t\t\t\t'tans_uuid' => $uuid,\n\t\t\t\t\t'tans_week' => $weekSend,\n\t\t\t\t\t'trans_survey_value' => $clickValue\n\t\t\t\t);\n\t\t\t\t$tempStatus = $this->Student_survey_model->storeStudentSurvey($insertData);\n\t\t\t\tif($tempStatus)\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t\t$data['message'] = $this->lang->line('unable_save_answer');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}",
"public static function submitSurvey()\n\t{\n\t\tif(isset($_POST['survey']))\n\t\t{\n\t\t\tif(self::surveyExists($_POST['survey']))\n\t\t\t{\n\t\t\t\tif(!self::userAnswered(self::getSurveyUser(), $_POST['survey']))\n\t\t\t\t{\n\t\t\t\t\tif(isset($_POST['question']))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Validate if all questions were answered.\n\t\t\t\t\t\tforeach(self::getSurveyQuestions($_POST['survey']) as $qId)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(!isset($_POST['question'][$qId])) { return 2; }\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($_POST['question'] as $questionId => $value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$userId = self::getSurveyUser();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Radio submit\n\t\t\t\t\t\t\tif(!is_array($value))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!self::setAnswer($userId, $_POST['survey'], $value)){ return 5; }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t// Checkbox submit\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( count($value) > self::getQuestionOptionLimit($questionId) ){ return 4; }\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach($value as $oId)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(!self::setAnswer($userId, $_POST['survey'], $oId)){ return 5; }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 2;\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\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 5;\n\t\t}\n\t\t\n\t\treturn 0;\n\t}",
"public function submitQuiz()\n\t{\n\n\t\t//get the values from the post\n\t\t$thepost = $_POST;\n\t\t$answerText = $thepost['totalScore'];\n\t\t\n\t\t//submit to DL\n\t\t$this->submitToDigitalLocker($thepost, $answerText);\n\t\t\n\t\t\n\t\t//$this->displayquestion($answerText);\n\t}",
"protected function saveSurvey() {\n $this->versionnumber = $this->versionnumber + 1;\n $this->createdate = time();\n $this->skilldata = $this->compress($this->skilldata);\n\t$this->matrix = $this->compress($this->matrix);\n\n $success = coresurvey_save_skill_survey($this);\n\n // ok final step is to decompress the skilldata, just in case any other\n // functions are using the data\n\n $this->skilldata = $this->deCompress($this->skilldata);\n\t$this->matrix = $this->deCompress($this->matrix);\n return $success;\n }",
"function assessment_question_score_form_submit($form, &$form_state) {\n $result = db_query('SELECT nid, vid FROM {quiz_node_results} WHERE result_id = :result_id', array(':result_id' => $form_state['values']['result_id']))->fetch();\n\n $result = assessment_question_score_an_answer(array(\n 'quiz' => node_load($result->nid, $result->vid),\n 'nid' => $form_state['values']['question_nid'],\n 'vid' => $form_state['values']['question_vid'],\n 'rid' => $form_state['values']['result_id'],\n 'score' => $form_state['values']['score'],\n 'max_score' => $form_state['values']['rel_max_score'],\n 'answer_feedback' => $form_state['values']['answer_feedback']\n ));\n\n if ($result == 1) {\n drupal_set_message(t('The score has been saved.'));\n $form_state['redirect'] = 'admin/quiz/reports/score-assessment question';\n }\n else {\n drupal_set_message(t('Error saving the score. The selected answer was not scored.'), 'error');\n }\n}",
"public function addSurveyResult()\n\t{\n\t\t$date = date('Y-m-d H:i:s');\n\t\t$Q1 = $this->getValQ1();\n\t\t$Q2 = $this->getValQ2();\n\t\t$Q3 = $this->getValQ3();\n\t\t$Q4 = $this->getValQ4();\n\t\t$Q5 = $this->getValQ5();\n\t\t$Q6 = $this->getValQ6();\n\t\t$Q7 = $this->getValQ7();\n\t\t$Q8 = $this->getValQ8();\n\t\t$Q9 = $this->getValQ9();\n\t\t$Q10 = $this->getValQ10();\n\t\t$Q11 = $this->getValQ11();\n\t\t$comment = $this->getComment();\n\t\t$fkTraining = $this->getFormationID();\n\t\t\n\n\t\t//Query to create a new survey\n\t\t$query = \"INSERT INTO t_survey(\n\t\t\t\t\tsurDate,\n\t\t\t\t\tsurQuestion1Note,\n\t\t\t\t\tsurQuestion2Note,\n\t\t\t\t\tsurQuestion3Note,\n\t\t\t\t\tsurQuestion4Note,\n\t\t\t\t\tsurQuestion5Note,\n\t\t\t\t\tsurQuestion6Note,\n\t\t\t\t\tsurComment,\n\t\t\t\t\tfkTraining,\n\t\t\t\t\tsurQuestion7Note,\n\t\t\t\t\tsurQuestion8Note,\n\t\t\t\t\tsurQuestion9Note,\n\t\t\t\t\tsurQuestion10Note,\n\t\t\t\t\tsurQuestion11Note,\n\t\t\t\t\tsurComment,\n\t\t\t\t\tfkTraining\n\t\t\t\t\t) \n\t\t\t\t\tVALUES \n\t\t\t\t\t(\n\t\t\t\t\t:surDate,\n\t\t\t\t\t:surQuestion1Note,\n\t\t\t\t\t:surQuestion2Note,\n\t\t\t\t\t:surQuestion3Note,\n\t\t\t\t\t:surQuestion4Note,\n\t\t\t\t\t:surQuestion5Note,\n\t\t\t\t\t:surQuestion6Note,\n\t\t\t\t\t:surQuestion7Note,\n\t\t\t\t\t:surQuestion8Note,\n\t\t\t\t\t:surQuestion9Note,\n\t\t\t\t\t:surQuestion10Note,\n\t\t\t\t\t:surQuestion11Note,\n\t\t\t\t\t:surComment,\n\t\t\t\t\t:fkTraining\n\t\t\t\t\t)\";\n\n\t\t\t//Prepare the query $newSurvey\n\t\t\t$stmt = $this->dbh->prepare($query);\n\n\n\t\t\t//Bind the parameters\n\t\t\t$stmt->bindParam(':surDate',$date,PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(':surQuestion1Note',$Q1, PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':surQuestion2Note',$Q2, PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':surQuestion3Note',$Q3, PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':surQuestion4Note',$Q4, PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':surQuestion5Note',$Q5, PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':surQuestion6Note',$Q6, PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':surQuestion7Note',$Q7, PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':surQuestion8Note',$Q8, PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':surQuestion9Note',$Q9, PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':surQuestion10Note',$Q10, PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':surQuestion11Note',$Q11, PDO::PARAM_INT);\n\t\t\t$stmt->bindParam(':surComment', $comment, PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(':fkTraining', $fkTraining, PDO::PARAM_INT);\n\n\t\t\t//Execute the query\n\t\t\t$stmt->execute();\n\n\n\t\t\theader(\"location: ./index.php?success_survey\");\n\t\t\n\t\t\t\n\t}",
"public function surveyAction ()\n {\n $this->_pageTitle = ['Assessment', 'Survey'];\n $this->_navigation->setActiveStep(AssessmentStepsModel::STEP_SURVEY);\n\n /**\n * Get data to populate\n */\n $survey = $this->getAssessment()->getClient()->getSurvey();\n\n if (!$survey instanceof SurveyEntity)\n {\n $survey = new SurveyEntity();\n }\n\n\n $assessmentSurveyService = new AssessmentSurveyService($survey);\n $form = $assessmentSurveyService->getForm();\n\n\n /**\n * Handle our post\n */\n if ($this->getRequest()->isPost())\n {\n $postData = $this->getRequest()->getPost();\n if (isset($postData [\"goBack\"]))\n {\n $this->gotoPreviousNavigationStep($this->_navigation);\n }\n else\n {\n\n $db = Zend_Db_Table::getDefaultAdapter();\n try\n {\n $db->beginTransaction();\n $postData = $this->getRequest()->getPost();\n\n // Every time we save anything related to a report, we should save it (updates the modification date)\n $this->updateAssessmentStepName();\n $this->saveAssessment();\n\n if ($assessmentSurveyService->save($postData, $this->getAssessment()->clientId))\n {\n $db->commit();\n\n if (isset($postData [\"saveAndContinue\"]))\n {\n // Call the base controller to send us to the next logical step in the proposal.\n $this->gotoNextNavigationStep($this->_navigation);\n }\n else\n {\n $this->_flashMessenger->addMessage(['success' => \"Your changes were saved successfully.\"]);\n }\n }\n else\n {\n $db->rollBack();\n $this->_flashMessenger->addMessage(['danger' => 'Please correct the errors below before continuing.']);\n }\n }\n catch (Exception $e)\n {\n $db->rollBack();\n \\Tangent\\Logger\\Logger::logException($e);\n }\n }\n }\n\n\n $this->view->form = $form;\n }",
"function proccessanswer(){\n\t\t\tif (isset($_POST['studentID'])) {\n\t\t\t\t//print_r($_POST);\n\t\t\t\t$submittedanswer = $this->input->post('answer');\n\t\t\t\t$studentID = $this->input->post('studentID');\n\t\t\t\t$questionID = $this->input->post('questionID');\n\t\t\t\t$questionNumber = $this->input->post('questionNumber');\n\n\n\t\t\t\t//print_r($this->getQuestionData($questionID,$questionNumber));\n\t\t\t\tif ($submittedanswer == $this->getQuestionData($questionID,$questionNumber)) {\n\t\t\t\t\t//Question answered correctly\n\t\t\t\t\t//FOR NOW 50 points if correct answer\n\t\t\t\t\t$score[$questionID] = 50;\n\t\t\t\t\t$this->GameModel->updateScore($studentID,$score);\n\t\t\t\t\t$this->score(1,50);\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//false\n\t\t\t\t\t//5 points for failed answer\n\n\t\t\t\t\t$score[$questionID]= 5;\n\t\t\t\t\t$this->GameModel->updateScore($studentID,$score);\n\t\t\t\t\t$this->score(0,5);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}",
"public function next(Request $request, $id){\n if ((Auth::user()->role)=='student'){ \n $inputs=$request->all();\n $qn=$inputs['qn'];\n //get all questions for the test\n $questions = quiz::where('testid', $id)->lists('qtest');\n if ($qn<sizeof($questions)){\n //select the current question entry to get correct answer\n $question=quiz::where('qtest', $questions[$qn])->get(); \n //check if input is correct and save it\n if ($inputs['qchoice']==$question[0]['correct']){\n $pass=1; \n }\n if ($inputs['qchoice']!==$question[0]['correct']){\n $pass=0;\n }\n //saves the student answer\n $detailed_score=new detailed_score;\n $detailed_score->testid=$id;\n $detailed_score->sid=Auth::user()->sid;\n $detailed_score->qnumber=$qn+1;\n $detailed_score->pass=$pass;\n $detailed_score->save();\n $qn=$qn+1;\n //set next question\n if ($qn<sizeof($questions)){\n $question=quiz::where('qtest', $questions[$qn])->get();\n }\n if ($qn==sizeof($questions)){\n //get all answers for the test\n $answers = detailed_score::where('testid', $id)->where('sid', Auth::user()->sid)->get();\n $canswers = detailed_score::where('testid', $id)->where('sid', Auth::user()->sid)->where('pass', 1)->get();\n $final_score=(sizeof($canswers)/sizeof($answers))*100;\n //echo $final_score;\n //save marks to the final score table\n $finalscore=new finalscore;\n $finalscore->testid=$id;\n $finalscore->sid=Auth::user()->sid;\n $finalscore->mark=$final_score;\n $finalscore->save();\n //create chart to view correct answers\n $scores = detailed_score::where('testid', $id)->where('sid', Auth::user()->sid)->get();\n $marksTable = \\Lava::DataTable(); \n $marksTable ->addStringColumn('QuestionNumber')\n ->addNumberColumn('PassorFail');\n foreach ($scores as $row)\n {\n $rowData = array($row['qnumber'], $row['pass']);\n $marksTable->addRow($rowData);\n }\n $linechart = \\Lava::LineChart('lookatmarks'); \n $linechart->datatable($marksTable)\n ->setOptions(array(\n 'title' => 'Correct or not',\n 'vAxis' => \\Lava::VerticalAxis(array(\n 'title' => 'Correct(1) Incorrect(0)'\n )),\n 'hAxis' => \\Lava::HorizontalAxis(array(\n 'title' => 'Question number',\n )) \n )); \n return view('quiz.finished')->with('finalmark',$final_score)->with('quizn',$id);\n }\n }\n return view('quiz.index')->with('question',$question)->with('qn',$qn)->with('quizn',$id);\n }\n }",
"private function submitRating() {\n $ratingData = array(\n 'answerID' => $this->input->post('answerID'),\n 'surveyRecordID' => $this->input->post('surveyRecordID'),\n 'answerRecordID' => $this->input->post('answerRecordID'),\n 'contentRecordID' => $this->input->post('contentRecordID'),\n 'localeRecordID' => $this->input->post('localeRecordID'),\n 'ratingPercentage' => $this->input->post('ratingPercentage')\n );\n $response = $this->model('Okcs')->submitRating($ratingData);\n echo json_encode($response->results);\n }",
"public static function UpdateScore() {\n\t\t$postLike = new PostLike($_POST['post_id']);\n\t\t$postLike->updateScore($_POST['score']);\n\n\t\tstatic::respond(array(\n\t\t\t'total_score'\t=> $postLike->getTotalScore()\n\t\t));\n\t}",
"private function submitRating() {\n if(IS_DEVELOPMENT){\n $startTime = microtime(true);\n }\n AbuseDetection::check();\n $ratingData = array(\n 'answerID' => $this->input->post('answerID'),\n 'surveyRecordID' => $this->input->post('surveyRecordID'),\n 'answerRecordID' => $this->input->post('answerRecordID'),\n 'contentRecordID' => $this->input->post('contentRecordID'),\n 'localeRecordID' => $this->input->post('localeRecordID'),\n 'ratingPercentage' => $this->input->post('ratingPercentage'),\n 'answerComment' => $this->input->post('answerComment')\n );\n $response = $this->model('Okcs')->submitRating($ratingData);\n if(IS_DEVELOPMENT){\n $timingArray = $this->calculateTimeDifference($startTime, 'submitRating | OkcsAjaxRequestController');\n $response->ajaxTimings = $timingArray;\n }\n if($response->errors) {\n $response = $this->getResponseObject($response);\n $response['result'] = array('failure' => Config::getMessage(ERROR_PLEASE_TRY_AGAIN_LATER_MSG));\n }\n $this->_renderJSON($response);\n }",
"public function savequestionsAction()\n {\n $this->_helper->viewRenderer->setNoRender();\n $this->_helper->layout->disableLayout();\n\n $filter = new Zend_Filter_StripTags();\n //Zend_Registry::get('logdebug')->info('RAW POST: ' . print_r($_POST,true));\n\n $modelQA = new Default_Model_QAData;\n\n $questionID = $filter->filter($this->_request->getParam('reconqamngr-id'));\n $questionData = array();\n $questionData['reconqamngr_Status_enum'] = 'Enabled';\n $questionData['reconqamngr_Question_char'] = $filter->filter($this->_request->getParam('questiontxt'));\n $questionData['reconqamngr_AppliesToBPO_enum'] = 'Yes';\n $questionData['reconqamngr_AppliesToRMV_enum'] = 'Yes';\n\n if (false === $this->_request->getParam('isenabled', false)) {\n $questionData['reconqamngr_Status_enum'] = 'Disabled';\n }\n\n if (false === $this->_request->getParam('applytobpo', false)) {\n $questionData['reconqamngr_AppliesToBPO_enum'] = 'No';\n }\n\n if (false === $this->_request->getParam('applytormv', false)) {\n $questionData['reconqamngr_AppliesToRMV_enum'] = 'No';\n }\n\n // if new, create question, get id, else update\n if ($questionID > 0 AND is_numeric($questionID)) {\n // update\n $modelQA->updateQuestionData($questionData, $questionID);\n } else {\n // insert\n $questionID = $modelQA->insert($questionData);\n }\n\n $answers = $this->_request->getParam('answer');\n $values = $this->_request->getParam('value');\n //Zend_Registry::get('logdebug')->info('answers: ' . print_r($answers,true));\n //Zend_Registry::get('logdebug')->info('values: ' . print_r($values,true));\n if (is_array($answers) AND is_array($values) AND (count($answers) === count($values))) {\n // delete values/answers\n $modelQA->deleteAnswerData($questionID);\n foreach ($answers as $optID => $status) {\n $modelQA->insertAnswerData($questionID, $optID, $values[$optID]);\n }\n }\n\n //Zend_Registry::get('logdebug')->info('questionData: ' . print_r($questionData,true));\n\n $response = array('success' => true, 'message' => 'Your data has been saved.');\n $this->getResponse()->setHeader('Content-Type', 'text/javascript');\n $this->getResponse()->setBody(Zend_Json::encode($response));\n }",
"public function submit()\n\t{\n\t\t$choices \t\t= Request::input('choices');\n\n\t\t$questionaire\t= $this->prepareQuestionaire();\n\t\t$participant \t= $this->prepareParticipant();\t\t\n\n\t\t// Retain only one copy of question answers of each participant\n\t\tParticipantAnswer::where('participantID', $participant->id)\n\t\t\t\t\t\t ->where('questionaireID', $questionaire->id)\n\t\t\t\t\t\t ->delete();\n\n\t\tQuestionaireResult::where('participantID', $participant->id)\n\t\t\t\t\t\t ->where('questionaireID', $questionaire->id)\n\t\t\t\t\t\t ->delete();\n\n\t\t$answers\t\t= ParticipantAnswer::createWith($questionaire, $participant, $choices);\n\t\t$summation\t\t= Choice::summationFromChoices($choices);\n\n\t\t$qr\t\t\t\t\t= new QuestionaireResult();\n\t\t$qr->participantID \t= $participant->id;\n\t\t$qr->questionaireID = $questionaire->id;\n\t\t$qr->value\t\t\t= $summation;\n\t\t$qr->academicYear \t= Cache::get('settings.current_academic_year');\n\n\t\tif (!$qr->academicYear) {\n\t\t\t$qr->academicYear = $participant->academicYear;\n\t\t}\n\n\t\t$qr->save(); \n\n\t\treturn response()->json([\n\t\t\t'success' => true,\n\t\t\t'message' => 'บันทึกข้อมูลแบบฟอร์มเสร็จสมบูรณ์'\n\t\t]);\n\t}",
"public function submitScores($auditID,$scoreArray)\n {\n foreach($scoreArray as $score) //for each score submitted\n {\n $this->insertScore($auditID,$score['questionID'],$score['score'],$score['comment']); //inserts score into database\n }\n\n $this->database->update(\"INSERT INTO ScoredAudits VALUES(\\\"$auditID\\\",NOW())\");\n }",
"public function submitSample($data);",
"public function saveAnswer(){\n \n // init needed libs\n $nedded_libs = array('libs' => array(),\n 'help' => array('form', 'validate', 'array', 'date'),\n 'models' => array(array('gtrwebsite_answers_model', 'gtrwebsite_answers_model')));\n \n SHIN_Core::postInit($nedded_libs);\n \n SHIN_Core::$_models['gtrwebsite_answers_model']->read_form();\n SHIN_Core::$_models['gtrwebsite_answers_model']->save();\n \n echo json_encode(array('result' => true, 'errors' => null)); exit(); \n }",
"function saveDiagnosticCoreQuestionsAction() {\n\t\tif (! in_array ( \"manage_diagnostic\", $this->user ['capabilities'] )) {\n\t\t\t\n\t\t\t$this->apiResult [\"message\"] = \"You are not authorized to perform this task.\\n\";\n\t\t} else if (empty ( $_POST ['type'] )) {\n\t\t\t\n\t\t\t$this->apiResult [\"message\"] = \"Diagnostic type can not be empty\\n\";\n\t\t} else if (empty ( $_POST ['assessmentId'] )) {\n\t\t\t\n\t\t\t$this->apiResult [\"message\"] = \"Diagnostic review type can not be empty\\n\";\n\t\t} else if (empty ( $_POST ['diagnosticName'] )) {\n\t\t\t\n\t\t\t$this->apiResult [\"message\"] = \"Diagnostic Name can not be empty\\n\";\n\t\t} else if (empty ( $_POST ['diagnostic_questions'] )) {\n\t\t\t\n\t\t\t$this->apiResult [\"message\"] = \"Diagnostic questions can not be empty\\n\";\n\t\t} else if (empty ( $_POST ['diagnosticId'] )) {\n\t\t\t\n\t\t\t$this->apiResult [\"message\"] = \"diagnosticId can not be empty\\n\";\n\t\t} else if (empty ( $_POST ['kpaId'] )) {\n\t\t\t\n\t\t\t$this->apiResult [\"message\"] = \"kpaId can not be empty\\n\";\n\t\t} else if (empty ( $_POST ['kqId'] )) {\n\t\t\t\n\t\t\t$this->apiResult [\"message\"] = \"kqId can not be empty\\n\";\n\t\t} else {\n\t\t\t\n\t\t\t$diagnosticModel = new diagnosticModel ();\n\t\t\t\n\t\t\t$assessmentId = $_POST ['assessmentId'];\n\t\t\t\n\t\t\t$diagnosticName = trim ( $_POST ['diagnosticName'] );\n\t\t\t// assessor recommendations\n\t\t\t$is_kpa_recommendations = empty ( $_POST ['kpa_recommendations'] ) ? 0 : $_POST ['kpa_recommendations'];\n\t\t\t$is_kq_recommendations = empty ( $_POST ['kq_recommendations'] ) ? 0 : $_POST ['kq_recommendations'];\n\t\t\t$is_cq_recommendations = empty ( $_POST ['cq_recommendations'] ) ? 0 : $_POST ['cq_recommendations'];\n\t\t\t$is_js_recommendations = empty ( $_POST ['js_recommendations'] ) ? 0 : $_POST ['js_recommendations'];\n\t\t\t\n\t\t\t// $diagnosticId = empty($_GET['diagnosticId'])?0:$_GET['diagnosticId'];\n\t\t\t\n\t\t\t$diagnosticId = empty ( $_POST ['diagnosticId'] ) ? 0 : $_POST ['diagnosticId'];\n\t\t\t\n\t\t\t$image_name = '';\n\t\t\t$imageId = NULL;\n\t\t\tif ($diagnosticId != 0) {\n\t\t\t\tif ($image_name == '') {\n\t\t\t\t\t$dig_image = $diagnosticModel->getDiagnosticImage ( $diagnosticId );\n\t\t\t\t\t$image_name = $dig_image [0] ['file_name'];\n\t\t\t\t\t$imageId = $dig_image [0] ['diagnostic_image_id'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$kpaId = empty ( $_POST ['kpaId'] ) ? 0 : $_POST ['kpaId'];\n\t\t\t\n\t\t\t$kqId = empty ( $_POST ['kqId'] ) ? 0 : $_POST ['kqId'];\n\t\t\t\n\t\t\t$isPublished = 0;\n\t\t\t\n\t\t\t// $diagnosticId = 18;\n\t\t\t\n\t\t\t$flagNewKpas = 0; // flag set to 1 if any new kpas exist\n\t\t\t\n\t\t\t$row = $diagnosticModel->getMinMaxLimitForDiagnosticQuestions ( 'cq', $assessmentId );\n\t\t\t\n\t\t\tif (! $row) \n\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$this->apiResult [\"message\"] = \"Unable to process your request\";\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t} \n\n\t\t\telse if ((count ( $_POST ['diagnostic_questions'] ) > $row [0] ['limit_max'])) {\n\t\t\t\t\n\t\t\t\t$this->apiResult [\"message\"] = \"Number of Sub Questions can't be more than \" . $row [0] ['limit_max'];\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$this->db->start_transaction ();\n\t\t\t\n\t\t\t$queryFailed = 0;\n\t\t\t\n\t\t\tif (! ($diagnosticModel->updateDiagnostic ( $diagnosticId, $diagnosticName, $isPublished, $imageId, $is_kpa_recommendations, $is_kq_recommendations, $is_cq_recommendations, $is_js_recommendations )))\n\t\t\t\t\n\t\t\t\t$queryFailed = 1;\n\t\t\t\n\t\t\t$existingKpas = array ();\n\t\t\t\n\t\t\tif (! empty ( $_POST ['diagnostic_questions_update'] )) \n\n\t\t\t{\n\t\t\t\t\n\t\t\t\tforeach ( $_POST ['diagnostic_questions_update'] as $q ) :\n\t\t\t\t\t\n\t\t\t\t\t$q = explode ( '_', $q );\n\t\t\t\t\t\n\t\t\t\t\t$index = $q [0];\n\t\t\t\t\t\n\t\t\t\t\t$val = $q [1];\n\t\t\t\t\t\n\t\t\t\t\t$existingKpas [$index] = $val;\n\t\t\t\tendforeach\n\t\t\t\t;\n\t\t\t}\n\t\t\t\n\t\t\t// add new kpas\n\t\t\t\n\t\t\t// print_r($_POST['diagnostic_questions_new']);\n\t\t\t\n\t\t\t$kpas = empty ( $_POST ['diagnostic_questions_new'] ) ? NULL : $_POST ['diagnostic_questions_new'];\n\t\t\t\n\t\t\t// print_r($kpas);\n\t\t\t\n\t\t\tif ($kpas) \n\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$kpasCreated = $diagnosticModel->createCoreQuestions ( $kpas );\n\t\t\t\t\n\t\t\t\tif (! $kpasCreated)\n\t\t\t\t\t\n\t\t\t\t\t$queryFailed = 20;\n\t\t\t\t\n\t\t\t\t$flagNewKpas = 1;\n\t\t\t}\n\t\t\t\n\t\t\t// print_r($kpasCreated);\n\t\t\t\n\t\t\t// save kpa instances for diagnostic\n\t\t\t\n\t\t\t$kpaOrder = array ();\n\t\t\t\n\t\t\t$order = 0;\n\t\t\t\n\t\t\t$selKpaIndex = array ();\n\t\t\t\n\t\t\tforeach ( $_POST ['diagnostic_questions'] as $kpa => $val ) :\n\t\t\t\t\n\t\t\t\t$val = explode ( '_', $val );\n\t\t\t\t\n\t\t\t\t$index = $val [0];\n\t\t\t\t\n\t\t\t\t$value = $val [1];\n\t\t\t\t\n\t\t\t\tif (in_array ( $value, $existingKpas )) \n\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$order ++;\n\t\t\t\t\t\n\t\t\t\t\tarray_push ( $kpaOrder, array (\n\t\t\t\t\t\t\t'id' => $index,\n\t\t\t\t\t\t\t'name' => $value,\n\t\t\t\t\t\t\t'order' => $order \n\t\t\t\t\t) );\n\t\t\t\t\t\n\t\t\t\t\tarray_push ( $selKpaIndex, $index );\n\t\t\t\t} \n\n\t\t\t\telseif (in_array ( $value, $kpasCreated )) \n\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$order ++;\n\t\t\t\t\t\n\t\t\t\t\tarray_push ( $kpaOrder, array (\n\t\t\t\t\t\t\t'id' => array_search ( $value, $kpasCreated ),\n\t\t\t\t\t\t\t'name' => $value,\n\t\t\t\t\t\t\t'order' => $order \n\t\t\t\t\t) );\n\t\t\t\t\t\n\t\t\t\t\tarray_push ( $selKpaIndex, $index );\n\t\t\t\t}\n\t\t\tendforeach\n\t\t\t;\n\t\t\t\n\t\t\t// if kq exists in kpaOrder but not in kq instance, insert it\n\t\t\t\n\t\t\t// if kq exists in kpaOrder as well as kq instance, update it\n\t\t\t\n\t\t\t// if kq doesnot exist in kpaOrder but exists in kq instance, delete it\n\t\t\t\n\t\t\t$kpaInstanceDiagnostic = array ();\n\t\t\t\n\t\t\t$kpaInstanceDiagnostic = $diagnosticModel->getCoreQuestionIdsPerKqForDiagnostic ( $diagnosticId, $kpaId, $kqId );\n\t\t\t\n\t\t\t$instanceKpa = array ();\n\t\t\t\n\t\t\tforeach ( $kpaInstanceDiagnostic as $kpa ) :\n\t\t\t\t\n\t\t\t\tarray_push ( $instanceKpa, $kpa ['core_question_id'] );\n\t\t\tendforeach\n\t\t\t;\n\t\t\t\n\t\t\tforeach ( $kpaOrder as $kpa ) :\n\t\t\t\t\n\t\t\t\t$id = $kpa ['id'];\n\t\t\t\t\n\t\t\t\t// if kpa instance exists in database as well as kpaorder -> update instance\n\t\t\t\t\n\t\t\t\tif (in_array ( $kpa ['id'], ($instanceKpa) )) {\n\t\t\t\t\t\n\t\t\t\t\t$diagnosticModel->updateSingleCoreQuestionDiagnosticInstance ( array (\n\t\t\t\t\t\t\t\"core_question_id\" => $kpa ['id'],\n\t\t\t\t\t\t\t\"order\" => $kpa ['order'] \n\t\t\t\t\t), $kqId );\n\t\t\t\t} else \n\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t// if kpa instance does nt exist in database but exists in kpaorder -> insert instance\n\t\t\t\t\t\n\t\t\t\t\t$diagnosticModel->createSingleCoreQuestionDiagnosticInstance ( array (\n\t\t\t\t\t\t\t\"core_question_id\" => $kpa ['id'],\n\t\t\t\t\t\t\t\"order\" => $kpa ['order'] \n\t\t\t\t\t), $kqId );\n\t\t\t\t\t\n\t\t\t\t\t// if kpa instance exists neither in database nor in kpaorder - not possible\n\t\t\t\t}\n\t\t\tendforeach\n\t\t\t;\n\t\t\t\n\t\t\t// if kpa instance exists in database but not in kpaorder -> delete instance\n\t\t\t\n\t\t\t// delete kpa instances that are in the kpainstance(h_kpa_diagnostic) but not in kpaOrder array for the diagnostic\n\t\t\t\n\t\t\tforeach ( $instanceKpa as $kpa_id ) :\n\t\t\t\t\n\t\t\t\tif (! in_array ( $kpa_id, $selKpaIndex )) {\n\t\t\t\t\t\n\t\t\t\t\t// delete Judgement Statement if any for the CQ instance\n\t\t\t\t\t\n\t\t\t\t\tif (! $diagnosticModel->deleteCoreQuestionDiagnosticInstance ( $kpa_id, $kqId )) \n\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$queryFailed = 45;\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tendforeach\n\t\t\t;\n\t\t\t\n\t\t\tif ($queryFailed == 0 && $this->db->commit ()) \n\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$kpas = $this->db->array_col_to_key ( $diagnosticModel->getKpasForDiagnostic ( $diagnosticId ), \"kpa_instance_id\" );\n\t\t\t\t\n\t\t\t\t$kqs = $this->db->array_grouping ( $diagnosticModel->getKeyQuestionsForDiagnostic ( $diagnosticId ), \"kpa_instance_id\", \"key_question_instance_id\" );\n\t\t\t\t\n\t\t\t\t$cqs = $this->db->array_grouping ( $diagnosticModel->getCoreQuestionsForDiagnostic ( $diagnosticId ), \"key_question_instance_id\", \"core_question_instance_id\" );\n\t\t\t\t\n\t\t\t\t$jss = $this->db->array_grouping ( $diagnosticModel->getJudgementalStatementsForDiagnostic ( $diagnosticId ), \"core_question_instance_id\", \"judgement_statement_instance_id\" );\n\t\t\t\t\n\t\t\t\t$this->apiResult [\"status\"] = 1;\n\t\t\t\t\n\t\t\t\t$this->apiResult [\"diagnosticId\"] = $diagnosticId;\n\t\t\t\t\n\t\t\t\t$this->apiResult [\"message\"] = \"CQs saved successfully\";\n\t\t\t\t\n\t\t\t\tob_start ();\n\t\t\t\t\n\t\t\t\tinclude (ROOT . 'application' . DS . 'views' . DS . \"diagnostic\" . DS . 'diagnostickpatabs.php');\n\t\t\t\t\n\t\t\t\t$this->apiResult [\"content\"] = ob_get_contents ();\n\t\t\t\t\n\t\t\t\tob_end_clean ();\n\t\t\t} \n\n\t\t\telse \n\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$this->apiResult [\"message\"] = \"Unable to process your request\";\n\t\t\t\t\n\t\t\t\t$this->db->rollback ();\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the locked column Example usage: $query>filterByLocked(true); // WHERE locked = true $query>filterByLocked('yes'); // WHERE locked = true | public function filterByLocked($locked = null, $comparison = null)
{
if (is_string($locked)) {
$locked = in_array(strtolower($locked), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(UserPeer::LOCKED, $locked, $comparison);
} | [
"public function whereDisabled(): static\n {\n return $this->rawFilter('(pwdAccountLockedTime=*)');\n }",
"public function filterByLocked($locked = null, $comparison = null)\n {\n if (is_string($locked)) {\n $locked = in_array(strtolower($locked), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n }\n\n return $this->addUsingAlias(MenuTableMap::COL_LOCKED, $locked, $comparison);\n }",
"public function whereDisabled()\n {\n return $this->rawFilter($this->schema->filterDisabled());\n }",
"public function columnLock($value) {\n if (is_string($value)) {\n $value = new \\Kendo\\JavaScriptFunction($value);\n }\n\n return $this->setProperty('columnLock', $value);\n }",
"public static function isLockedByUser($table, $row_key, $column) {\n\t\t$row_key = self::normalizeKey($row_key);\n\t\t$db = SQLQuery::getDataBaseAccessWithoutSecurity();\n\t\t$res = $db->execute(\"SELECT * FROM DataLocks WHERE `table`='\".$db->escapeString($table).\"' AND `locker_domain`='\".SQLQuery::escape(PNApplication::$instance->user_management->domain).\"' AND `locker_username`='\".SQLQuery::escape(PNApplication::$instance->user_management->username).\"'\");\n\t\twhile (($row = $db->nextRow($res)) <> null) {\n\t\t\tif ($row[\"row_key\"] == null) {\n\t\t\t\tif ($row[\"column\"] == null)\n\t\t\t\t\treturn true; // full table is locked\n\t\t\t\telse {\n\t\t\t\t\t// a column is locked\n\t\t\t\t\tif ($column == $row[\"column\"])\n\t\t\t\t\t\treturn true; // same column is locked\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (json_encode($row_key) == $row[\"row_key\"]) {\n\t\t\t\t\t// same row\n\t\t\t\t\tif ($row[\"column\"] == null)\n\t\t\t\t\t\treturn true; // full row is locked\n\t\t\t\t\tif ($row[\"column\"] == $column)\n\t\t\t\t\t\treturn true; // same cell is locked\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function getWhereClauseForEnabledFields() {}",
"private function filteredMeetingRoom() {\n\t\treturn $this->center\n\t\t ->where('active_flag', 'Y')\n\t\t ->where('city_id', '!=', 0)\n\t\t ->where(function ($q) {\n\t\t\t\t$q->whereHas('center_filter', function ($q) {\n\t\t\t\t\t\t$q->where('meeting_room', 1);})->orWhere(function ($q) {\n\t\t\t\t\t\t$q->has('center_filter', '<', 1);\n\t\t\t\t\t});\n\t\t\t});\n\t}",
"public function locked()\n {\n return $this->filter(\n function (FormBuilder $form) {\n return $form->isLocked();\n }\n );\n }",
"public function getLocked()\n {\n $lockedUsers = $this->search\n ->fromUsers()\n ->select(['samaccountname', 'name', 'lockedDate', 'lockouttime'])\n ->where(['locked' => true])\n ->getLdapQuery()->getArrayResult();\n if (count($lockedUsers)) {\n $result = array();\n $actual_lot = $this->getActualLockouttime();\n foreach ($lockedUsers as $lockedUser) {\n if ($lockedUser['lockouttime'] > $actual_lot) {\n $result[] = $lockedUser;\n }\n }\n $users = array();\n foreach ($result as $key => $user) {\n $users[$key]['title'] = $user['name'];\n $users[$key]['key'] = $user['samaccountname'];\n $user['lockedDate']->setTimezone(new \\DateTimeZone('Europe/Moscow'));\n $users[$key][\"data\"]['locktime'] = $user['lockedDate']->format('H:i:s');\n $users[$key][\"selected\"] = true;\n }\n return $users;\n } else {\n return \"0\";\n }\n }",
"function getLockedBy() {\n\t\treturn $this->data_array['locked_by'];\n\t}",
"public function apply_active_filter()\n\t{\n\t\tif (isset($this->_table_columns[$this->_active_column]))\r\n\t\t{\r\n\t\t\t// Filter only active records\r\n\t\t\t$this->where($this->_object_name.'.'.$this->_active_column, '>', 0);\r\n\t\t}\n\t}",
"public static function getLockedAccounts() {\n return self::where('locked', '>', 0)->get(['id', 'locked']);\n }",
"public function isLocked();",
"public function apply_active_filter()\n\t{\n\t\tif (isset($this->_table_columns[$this->_active_column]))\n\t\t{\n\t\t\t// Filter only active records\n\t\t\t$this->where($this->_object_name.'.'.$this->_active_column, '>', 0);\n\t\t}\n\t}",
"public function getLockedBy()\n {\n return $this->lockedBy;\n }",
"function pmprolml_pmpro_members_list_sql($sql) {\r\n\t//only if the level param is passed in and set to locked\r\n\tif(!empty($_REQUEST['l']) && $_REQUEST['l'] == 'locked') {\r\n\t\tglobal $wpdb;\r\n\t\t\r\n\t\t//tweak SQL to only show locked members\r\n\t\t$sql = str_replace(\"FROM $wpdb->users u\", \"FROM $wpdb->users u LEFT JOIN $wpdb->usermeta umlml ON u.ID = umlml.user_id AND umlml.meta_key='pmprolml'\", $sql);\r\n\t\t$sql = str_replace(\"AND mu.membership_id = 'locked'\", \"AND umlml.meta_value='1'\", $sql);\t\t\r\n\t}\r\n\t\r\n\treturn $sql;\r\n}",
"public function filterByIpLock($ipLock = null, $comparison = null)\n {\n if (is_string($ipLock)) {\n $ipLock = in_array(strtolower($ipLock), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n }\n\n return $this->addUsingAlias(LicensePeer::IP_LOCK, $ipLock, $comparison);\n }",
"public function lockFiltering()\n {\n $this->lockFiltering = true;\n return $this;\n }",
"public function whereBlocked()\n {\n return $this->filter(function (Spammer $spammer) {\n return $spammer->isBlocked();\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the application ajaxImageUpload. | public function ajaxImageUpload() {
return view('ajaxImageUpload');
} | [
"public function ajaxImageUpload()\n {\n \treturn view('ajaxImageUpload');\n }",
"function showUploadPhoto() {\n\t\t$this->setCacheLevelNone();\n\t\t$event = $this->getModel()->getEvent();\n\t\t$source = $this->getModel()->getSource();\n\t\t\n\t\tif ( $event->getID() == $source->getEventID() ) {\n\t\t\t$this->getEngine()->assign('event', utilityOutputWrapper::wrap($event));\n\t\t\t$this->getEngine()->assign('source', utilityOutputWrapper::wrap($source));\n\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('multifile', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/jquery.MultiFile.js'));\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('photoupload', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/mofilmphotoupload.js'));\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('blockui', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/jquery.blockUI.js'));\n\t\t\t$this->getEngine()->assign('error', FALSE);\n\t\t} else {\n\t\t\t$this->getEngine()->assign('error', TRUE);\n\t\t}\n\t\t\n\t\t$this->render($this->getTpl('uploadPhoto', '/account'));\n\t}",
"public function actionUploadAjax() {\n $this->Uploads(true);\n }",
"public function actionUploadAjax() {\n\t\t$this->Uploads ( true );\n\t}",
"public function actionUploadAjax(){\n $this->Uploads(true);\n }",
"function ajax_preview_photo () {\r\n\t\t$dir = BPFB_PLUGIN_BASE_DIR . '/img/';\r\n\t\tif (!class_exists('qqFileUploader')) require_once(BPFB_PLUGIN_BASE_DIR . '/lib/external/file_uploader.php');\r\n\t\t$uploader = new qqFileUploader(array('jpg', 'jpeg', 'png', 'gif'));\r\n\t\t$result = $uploader->handleUpload(BPFB_TEMP_IMAGE_DIR);\r\n\t\t//header('Content-type: application/json'); // For some reason, IE doesn't like this. Skip.\r\n\t\techo htmlspecialchars(json_encode($result), ENT_NOQUOTES);\r\n\t\texit();\r\n\t}",
"public function actionUploadAjax(){\n $this->Uploads(true);\n }",
"public function actionUploadAjax(){\n $this->Uploads(true);\n }",
"public function actionAjaxImg()\n\t{\n\t\t\n\t\t$path = \"uploads/\";\n\n\t$valid_formats = array(\"jpg\", \"png\", \"gif\", \"bmp\");\n\tif(isset($_POST) and $_SERVER['REQUEST_METHOD'] == \"POST\")\n\t\t{\n\t\t\t$name = $_FILES['photoimg']['name'];\n\t\t\t$size = $_FILES['photoimg']['size'];\n\t\t\t\n\t\t\tif(strlen($name))\n\t\t\t\t{\n\t\t\t\t\tlist($txt, $ext) = explode(\".\", $name);\n\t\t\t\t\tif(in_array($ext,$valid_formats))\n\t\t\t\t\t{\n\t\t\t\t\tif($size<(1024*1024))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$actual_image_name = md5(time()).\".\".$ext;\n\t\t\t\t\t\t\t$tmp = $_FILES['photoimg']['tmp_name'];\n\t\t\t\t\t\t\tif(move_uploaded_file($tmp, $path.$actual_image_name))\n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$Src = $path.$actual_image_name;\n\t\t\t\t\t\t\t\t\t//Insert into the DB the image itself\n\t\t\t\t\t\t\t\t\t$connection=Yii::app()->db;\n\t\t\t\t\t\t\t\t\t$sql=\"INSERT INTO `doron`.`images` (`Id`, `Src`) VALUES (NULL, '\".$Src.\"');\";\n\t\t\t\t\t\t\t\t\t$dataInsert =$connection->createCommand($sql)->query();\n\t\t\t\t\t\t\t\t\t//var_dump($dataInsert);\n\t\t\t\t\t\t\t\t\t//Showing the Client the image that he uploaded\n\t\t\t\t\t\t\t\t\techo '<script>alert(\"'.$Src.'\");</script>';\n\t\t\t\t\t\t\t\t\techo \"<img src='uploads/\".$actual_image_name.\"' class='preview'>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\techo \"failed\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\techo \"Image file size max 1 MB\";\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\techo \"Invalid file format..\";\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\telse\n\t\t\t\techo \"Please select image..!\";\n\t\t\t\t\n\t\t\texit;\n\t\t}\n\t}",
"public function getImageUploadAjaxUrl() {\n return $this->getUrl ( 'booking/listing/imageupload' );\n }",
"function showUpload()\r\n\t{\r\n\t\tif ($_GET['action'] == 'upload')\r\n\t\t{\r\n\t\t\t$this->timer();\r\n\t\t\t$this->showCSS();\r\n\t\t\t$this->showTitle();\r\n\t\t\t$this->upload();\r\n\t\t\t$this->usedTime();\r\n\t\t\t$this->showConfigState();\r\n\r\n\t\t\texit;\r\n\t\t}\r\n\t}",
"public function showImagePage(){\n return view('pages.image_upload');\n }",
"function imagepicker_upload() {\n variable_del('imagepicker_advanced_browser_pagestart');\n if (variable_get('imagepicker_upload_progress_enabled', 1)) {\n $content = imagepicker_upload_progress_get_script(variable_get('imagepicker_upload_progress_delay', 0));\n }\n $content .= imagepicker_quota_ok('iframe', FALSE, '', t('Upload images. You can give them a title and description'));\n theme('imagepicker', $content);\n}",
"public function run() {\n if (!$this->url || $this->url == '')\n $this->url = Yii::app()->createUrl('site/upload');\n\n echo CHtml::openTag('div', array('class' => 'dropzone', 'id' => 'fileup'));\n echo CHtml::closeTag('div');\n\n if (!$this->name && ($this->model && $this->attribute) && $this->model instanceof CModel)\n $this->name = CHtml::activeName($this->model, $this->attribute);\n\n $this->mimeTypes = CJavaScript::encode($this->mimeTypes);\n\n $options = CMap::mergeArray(array(\n 'url' => $this->url,\n 'parallelUploads' => 1,\n 'paramName' => $this->name,\n 'accept' => \"js:function(file, done){if(jQuery.inArray(file.type,{$this->mimeTypes}) == -1){done('Dit bestands formaat wordt niet ondersteund.');}else{done();}}\",\n 'init' => \"js:function(){this.on('success',function(file){{$this->onSuccess}});}\"\n ), $this->options);\n\n $options = CJavaScript::encode($options);\n\n $script = \"Dropzone.options.fileup = {$options}\";\n\n $this->registerAssets();\n Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $this->getId(), $script, CClientScript::POS_END);\n }",
"protected function tinymceImageDialog() {\n return view(\"/system/tinymce/upload_image_dialog\");\n }",
"public function upload_size_chart_images_ajax() {\r\r check_ajax_referer('upload_size_chart_images_allow', 'nonce');\r\r $file = array(\r\r 'name' => $_FILES['size_chart_image_file']['name'],\r\r 'type' => $_FILES['size_chart_image_file']['type'],\r\r 'tmp_name' => $_FILES['size_chart_image_file']['tmp_name'],\r\r 'error' => $_FILES['size_chart_image_file']['error'],\r\r 'size' => $_FILES['size_chart_image_file']['size']\r\r );\r\r $file = $this->sizechart_upload_process($file);\r\r die(0);\r\r }",
"public function product_images_upload_ajax() {\r\r check_ajax_referer('product_images_upload_allow', 'nonce');\r\r $file = array(\r\r 'name' => $_FILES['product_images_file']['name'],\r\r 'type' => $_FILES['product_images_file']['type'],\r\r 'tmp_name' => $_FILES['product_images_file']['tmp_name'],\r\r 'error' => $_FILES['product_images_file']['error'],\r\r 'size' => $_FILES['product_images_file']['size']\r\r );\r\r $file = $this->fileupload_process($file);\r\r die(0);\r\r }",
"private function showImage() {\r\n return '<img src=\"'.$this->getFilePath().'\" class=\"imgPreview\">';\r\n }",
"public function offerUpload() {\n\t\treturn view(\"sprite/upload\");\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes all errors and messages (from the object and from any storage) | public function clear() {
$this->errors=array();
$this->messages=array();
} | [
"public function clearMessages() {\n\t\t$this->errors = [];\n\t\t$this->debug_errors = [];\n\t}",
"public function clearErrors()\n {\n $this->errorMessages = [];\n }",
"protected function clearErrors() {\n $this->errors = [];\n }",
"public function clearErrors()\n {\n $this->errors = [];\n }",
"public function clear(): void\n {\n $this->errors = [];\n }",
"public function clearErrors() {\n $this->_errors = array();\n $this->_valid = true;\n }",
"public function clearErrors () {\r\n \r\n $this->errors = array();\r\n \r\n }",
"public final function cleanErrorStore()\n {\n $this->collection = NULL;\n }",
"public function clearErrors() {\n\t\t$this->_errorList\t= array();\n\t}",
"public function removeErrors();",
"private function clearError()\n {\n $this->error = array();\n }",
"public function resetErrors()\n {\n $this->messages = [];\n $this->errorData = [];\n }",
"private function clearErrors(){\n\t\t$this->validationErrors = array();\n\t}",
"public function clearErrors()\n {\n $this->errorOutput->clear();\n }",
"private function clearErrors()\n {\n $this->returnErrors = array();\n $this->success = true;\n }",
"function clear_messages() {\n\t\t\t$this->errors = $this->messages = array();\n\t\t\tunset($_SESSION['messages']);\n\t\t\tunset($_SESSION['errors']);\n\t\t}",
"public function\n\tclearMessages()\n\t{\n\t\t$this -> m_aStorage = [];\n\t}",
"public function reset()\n {\n $this->errorMessages = array();\n }",
"function clearErrors () {\n $this->errFlag = 0;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logs the given message if the message is not a string it will export it first. If $this>fp is NULL then it will try to log to the $GLOBALS['log'] if it is available | protected function log($message){
if(!is_string($message)){
$message = var_export($message, true);
}
if(!empty($this->fp)){
fwrite($this->fp, $message. "\n");
}else{
if(!empty($GLOBALS['log'])){
$GLOBALS['log']->debug($message . "\n");
}
}
} | [
"function write_log( $message ) {\n\t\tglobal $jr_options;\n\n\t\tif ( $jr_options->jr_enable_log ) {\n\t\t\t// if file pointer doesn't exist, then open log file\n\t\t\tif ( ! $this->fp ) {\n\t\t\t\t$this->open_log();\n\t\t\t}\n\t\t\t// define script name\n\t\t\t$script_name = basename( $_SERVER['PHP_SELF'] );\n\t\t\t$script_name = substr( $script_name, 0, -4 );\n\t\t\t// define current time\n\t\t\t$time = date_i18n( 'H:i:s' );\n\t\t\t// write current time, script name and message to the log file\n\t\t\tfwrite( $this->fp, \"$time ($script_name) $message\\n\" );\n\t\t}\n\t}",
"public function logwrite($message) \n\t\t{\n\t\t\t#### if file pointer doesn't exist, then open log file\n\t\t\tif (!is_resource($this->fp)) \n\t\t\t{\n\t\t\t\t$this->logopen();\n\t\t\t}\n\t\t\t#### define script name\n\t\t\t$script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n\t\t\t#### define current time and suppress E_WARNING if using the system TZ settings\n\t\t\t#### (don't forget to set the INI setting date.timezone)\n\t\t\t$time = @date('[d/M/Y:H:i:s e]');\n\t\t\t#### write current time, script name and message to the log file\n\t\t\tfwrite($this->fp, \"$time ($script_name) $message\\n\");\n\t\t}",
"public function write($message){\r\n // if file pointer doesn't exist, then open log file \r\n // define script name\r\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\r\n // define current time\r\n $time = date('H:i:s');\r\n // write current time, script name and message to the log file\r\n fwrite($this->getFp(), \"$time ($script_name) \\n,$message\");\r\n }",
"protected function write( $message ) {\n\t\tforminator_addon_maybe_log( $message );\n\t}",
"public function write($message)\n {\n // if file pointer doesn't exist, then open log file\n if (!is_resource($this->fp)) {\n $this->open();\n }\n\n $script_name = $_SERVER[\"SCRIPT_NAME\"]; // pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time and suppress E_WARNING if using the system TZ settings\n // (don't forget to set the INI setting date.timezone)\n $time = @date('[d/M/Y:H:i:s]');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\" . PHP_EOL);\n }",
"public function export()\n {\n $firephp = \\FirePHP::getInstance(true);\n\n try {\n foreach ($this->messages as $message) {\n\n switch ($message[1]) {\n case Logger::LEVEL_ERROR:\n $firephp->error($message[0], $message[2]);\n break;\n case Logger::LEVEL_WARNING:\n $firephp->warn($message[0], $message[2]);\n break;\n case Logger::LEVEL_INFO:\n $firephp->info($message[0], $message[2]);\n break;\n// case Logger::LEVEL_TRACE:\n// $firephp->log($message[0]);\n// break;\n default:\n $firephp->log($message[0], $message[2]);\n break;\n// case Logger::LEVEL_PROFILE:\n// $firephp->log($message[0], $message[2]);\n// break;\n// case Logger::LEVEL_PROFILE_BEGIN:\n// $firephp->log($message[0], $message[2]);\n// break;\n// case Logger::LEVEL_PROFILE_END:\n// $firephp->log($message[0], $message[2]);\n// break;\n }\n }\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n }",
"function logIf($message)\n\t{\n\t\tif ($this->logger) {\n\t\t\t$this->logger->debug($message);\n\t\t}\n\t}",
"function logger($message) {\n $now_time = date(\"Ymd G:i:s\");\n\n $message = \"[IMPORT] $now_time - $message\";\n\n $fh = fopen(\"./store_server.log\", 'a') or die(\"can't open file\");\n fwrite($fh, \"$message\\n\");\n fclose($fh);\n\n print \"$message\\n\";\n\n}",
"public function export()\n {\n openlog($this->identity, LOG_ODELAY | LOG_PID, $this->facility);\n foreach ($this->messages as $message) {\n syslog($this->_syslogLevels[$message[1]], $this->formatMessage($message));\n }\n closelog();\n }",
"private function log($message)\n {\n if (null === $this->output) {\n return;\n }\n\n $this->output->writeln($message);\n }",
"public function export()\n {\n $monolog = new Logger('Logentries');\n $monolog->pushHandler(new LogEntriesHandler($this->logToken));\n\n foreach ($this->messages as $message) {\n if (array_key_exists($message[1], $this->_monologLevels)) {\n $monolog->addRecord(\n $this->_monologLevels[$message[1]],\n $this->formatMessage($message),\n isset($message[4]) && is_array($message[4]) ? $message[4] : []\n );\n }\n }\n }",
"protected function _write() {\n $message = self::getMessage();\n $priority = $this->priorityList[$this->_logData['severity']];\n syslog($priority, $message);\n }",
"protected function fileLog ()\n {\n $report = str_replace('%time%', date($this->cfg['timeformat']), $this->fileFormat);\n if (isset(self::$webId)) {\n $report = str_replace('%id%', self::$webId, $report);\n }\n $report = str_replace('%name%', self::$webName, $report);\n $report = str_replace('%severity%', self::severityToName($this->recNotice['severity']), $report);\n $report = str_replace('%msg%', $this->recNotice['message'], $report);\n if (isset($this->recSource['file'])) {\n $report = str_replace('%file%', $this->recSource['file'], $report);\n }\n if (isset($this->recSource['line'])) {\n $report = str_replace('%line%', $this->recSource['line'], $report);\n }\n if (isset($this->recSource['trace'])) {\n $report = str_replace('%trace%', $this->recSource['trace'], $report);\n }\n $report = str_replace('%ip%', $this->recClient['ip_addr'], $report);\n $report = str_replace('%agent%', $this->recClient['user_agent'], $report);\n\n //ulozeni zaznamu do souboru - zalogovani udalosti\n $file = fopen($this->target, 'a');\n $canWrite = flock($file, LOCK_EX);\n while (!$canWrite) {\n usleep(round(rand(0, 20)*100000));\n $canWrite = flock($file, LOCK_EX);\n }\n fwrite($file, $report . \"\\n\");\n flock($file, LOCK_UN); //uvolneni zamku\n fclose($file);\n }",
"private static function _write( $message, $level = self::INFO, $logName = null, $dir = null )\n {\n \tif (!isset($logName)) $logName = self::getOption(self::INFO_LOGFILE);\n \tif (!isset($dir)) $dir = self::getOption(self::LOG_DIR);\n $fileName = $dir . '/' . $logName;\n $oldumask = @umask( 0 );\n $fileExisted = @file_exists( $fileName );\n if ( $fileExisted && filesize( $fileName ) > self::getOption(self::MAX_LOGFILE_SIZE) )\n {\n if ( self::rotateLog( $fileName ) )\n $fileExisted = false;\n }\n $logFile = @fopen( $fileName, \"a\" );\n if ( $logFile )\n {\n \t$now = new DateTime();\n $logMessage = self::$LEVELS[$level] .\" [\" . $now->format( self::getOption(self::TIMESTAMP_FORMAT) ) . \"] [\" . getmypid() .\"] $message\\n\";\n @fwrite( $logFile, $logMessage );\n @fclose( $logFile );\n if ( !$fileExisted )\n {\n $permissions = octdec( '0666' );\n @chmod( $fileName, $permissions );\n }\n @umask( $oldumask );\n }\n else\n {\n error_log( 'Couldn\\'t create the log file \"' . $fileName . '\"' );\n }\n }",
"function logger($class,$message)\n\t{\t\n\t\tswitch(LOG_TYPE)\n\t\t{\n\t\t\tcase \"file\":\n\t\t\t\tfileLog($class,$message);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"db\":\n\t\t\t\tdbLog($class,$message);\n\t\t\t\n\t\t\tdefault:\n\t\t\t\techo \"config.php is incorrect for logging type\";\n\t\t\t\techo \"<br /> Please correct it and try again\";\n\t\t\t\texit();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"private function _log($message)\n {\n if ($message) {\n $this->_logs[] = $message;\n }\n\n $this->_logs;\n }",
"function _log($text,$level=10) {\n if($this->logger) call_user_func($this->logger, $text, $level);\n }",
"private function error_log( $msg ) {\n\t \tif( self::LOGGING )\n\t \t\terror_log( $msg . \"\\n\", 3, $this->logFilePath );\n\t }",
"public function log($message, $priority = Zend_Log::INFO);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
images resize according to the module name | function get_image_resizes($module="default" , $type='default'){
$userFilesFolder=$this->userFilesFolder;
switch ($module){
case "Shop":
$thumbWidth = "227";
$thumbHeight = "151";
$previewWidth = "730";
$previewHeight = "532";
$resizes = array(
array('folder'=>WWW_ROOT."/files/images/thumb","width"=>$thumbWidth,"height"=>$thumbHeight,'force'=>false),
array('folder'=>WWW_ROOT."/files/images/preview","width"=>$previewWidth,"height"=>$previewHeight,'force'=>false),
);
break;
case "Section":
$thumbWidth = "227";
$thumbHeight = "151";
$previewWidth = "730";
$previewHeight = "532";
$resizes = array(
array('folder'=>WWW_ROOT."/files/images/thumb","width"=>$thumbWidth,"height"=>$thumbHeight,'force'=>false),
array('folder'=>WWW_ROOT."/files/images/preview","width"=>$previewWidth,"height"=>$previewHeight,'force'=>false),
);
break;
}
return $resizes;
} | [
"function image_size() {\n //Resources\n add_image_size('sample_pack', 720, 337, true);\n add_image_size( 'slider', 1920, 500, true);\n}",
"private function registerImagesSizes(): void\n {\n add_image_size('our-works', 328, 272, true);\n add_image_size('cards', 326, 454, true);\n add_image_size('slider', 178, 252, true);\n }",
"function _do_resize()\n {\n require( ROOT_PATH . 'modules/gallery/lib/image.php' );\n \n if( is_array( $this->ipsclass->input['cats'] ) )\n {\n $cats = implode( \",\", $this->ipsclass->input['cats'] );\n }\n else\n {\n $cats = $this->ipsclass->input['cats'];\n }\n\n $start = ( $this->ipsclass->input['start'] ) ? $this->ipsclass->input['start'] : 0;\n\n if( $this->ipsclass->input['album'] )\n {\n $album = \" OR album_id > 0 \";\n }\n\n $this->ipsclass->DB->simple_construct( array( 'select' => 'id, masked_file_name, medium_file_name, directory, media',\n 'from' => 'gallery_images',\n 'where' => \"category_id IN ( {$cats} ) {$album}\",\n 'limit' => array( $start, $this->ipsclass->input['num'] ) ) );\n $q = $this->ipsclass->DB->simple_exec();\n\n if( $this->ipsclass->DB->get_num_rows( $q ) )\n {\n while( $i = $this->ipsclass->DB->fetch_row( $q ) )\n { \n if( $i['media'] )\n {\n \tcontinue;\n }\n\n $total++;\n \n $dir = ( $i['directory'] ) ? \"{$i['directory']}/\" : \"\";\n \n // Image Info\n $img_load = array( 'out_dir' => $this->ipsclass->vars['gallery_images_path'].'/'.$dir,\n 'in_dir' => $this->ipsclass->vars['gallery_images_path'].'/'.$dir,\n 'in_file' => $i['masked_file_name'],\n 'out_file' => $i['masked_file_name'],\n );\n \n // Create the image\n $img = new Image( $img_load );\n $img->ipsclass = &$this->ipsclass;\n $img->glib = &$this->glib;\n $img->lib_setup();\n if( $img->resize_proportional( $this->ipsclass->vars['gallery_max_img_width'], $this->ipsclass->vars['gallery_max_img_height'], 1 ) )\n {\n $img->write_to_file();\n }\n unset( $img );\n \n /**\n * Does the image have a medium sized file?\n **/\n\t\t\t if( $this->ipsclass->vars['gallery_medium_width'] || $this->ipsclass->vars['gallery_medium_height'] )\n \t \t {\n \t \t\t$img_load['out_file'] = 'med_' . $i[ 'masked_file_name' ];\n \t \t\t$img = new Image( $img_load );\n \t$img->ipsclass =& $this->ipsclass;\n \t$img->glib =& $this->glib;\n \t$img->lib_setup();\n \t \t\n \t \t\tif( $img->resize_proportional( $this->ipsclass->vars['gallery_medium_width'], $this->ipsclass->vars['gallery_medium_height'] ) )\n \t \t\t{\n \t \t\t\t$img->write_to_file();\t\n \t \t\t}\n \t \t\t\n \t \t\t/**\n \t \t\t* Did the picture already have one? If not, update DB record\n \t \t\t**/\n \t \t\tif( empty( $i['medium_file_name'] ) )\n \t \t\t{\n \t \t\t\t$this->ipsclass->DB->do_update( \"gallery_images\", array( 'medium_file_name' => $img_load['out_file'] ), \"id = {$i['id']}\" );\n \t \t\t\t$q2 = $this->ipsclass->DB->exec_query();\n \t \t\t}\n \t \t\tunset( $img );\n \t \t}\n } \n }\n else\n {\n $this->ipsclass->admin->error( \"No images match the options you specified, so no images were resized\" );\n }\n\n // Now we need to see if there are more images to do, or if we are done\n $this->ipsclass->DB->simple_construct( array( 'select' => 'count(id) AS images',\n 'from' => 'gallery_images',\n 'where' => \"category_id IN ( {$cats} ) {$album}\" ) );\n $this->ipsclass->DB->simple_exec();\n\n $count = $this->ipsclass->DB->fetch_row();\n\n $processed = $start + $this->ipsclass->input['num'];\n if( $processed >= $count['images'] )\n {\n $this->ipsclass->admin->save_log( \"Resized Images\" );\n $this->ipsclass->admin->done_screen(\"Images have been resized\", \"Gallery Manager\", \"section=components&act=gallery\" );\n }\n else\n {\n $start = $start + $total;\n $this->ipsclass->admin->redirect( \"cats={$cats}&num={$this->ipsclass->input['num']}§ion=components&act=gallery&code=tools&tool=resize&op=do&album={$this->ipsclass->input['album']}&start={$start}\", \"<b>{$processed} images processed, moving on to the next batch...</b><BR>DO NOT exit the browser or press the stop button, or your images will not be finished resizing\" );\n $this->ipsclass->admin->output();\n }\n }",
"public function testResizingImages()\n {\n }",
"function resizeImage ( ) {/* Contructor */}",
"public function resize()\n {\n foreach ($this->getList() as $image) {\n if (!$image instanceof mtmdImage) {\n continue;\n }\n\n mtmdUtils::output(\n sprintf(\n '\"%s\": Resizing to %dx%d (was %dx%d)...',\n $image->getFileName(),\n $this->getThumbWidth(),\n $this->getThumbHeight(),\n $image->getWidth(),\n $image->getHeight()\n )\n );\n\n $targetPath = $this->getCachedFilePath(dirname($image->getFileName()));\n\n // Prepare target dirs.\n mtmdUtils::mkDir($targetPath, 0755, true);\n // Resize image.\n $image->resizeImage($targetPath, $this->thumbWidth, $this->thumbHeight);\n\n }\n\n }",
"function resize()\n {\n if( $this->ipsclass->input['op'] == 'do' )\n {\n $this->_do_resize();\n return;\n }\n\n // Thanks Mark!\n require( ROOT_PATH . 'modules/gallery/categories.php' );\n $this->category = new Categories;\n $this->category->ipsclass =& $this->ipsclass;\n $this->category->glib =& $this->gallery_lib;\n\n $this->category->read_data( false, 'Choose from the categories below:' );\n\n $options = $this->category->build_dropdown();\n\n $cat_select = \"<select name='cats[]' class='dropdown' multiple='multiple' size='10'>{$options}</select>\";\n\n $this->ipsclass->admin->page_title = \"Resize Images\";\n $this->ipsclass->admin->page_detail = \"This tool will allow you to resize the images in your gallery\";\n\n $this->ipsclass->adskin->td_header[] = array( \"Option\" , \"35%\" );\n $this->ipsclass->adskin->td_header[] = array( \"Value\" , \"65%\" );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'tools' ),\n 2 => array( 'act' , 'gallery' ),\n 3 => array( 'tool' , 'resize' ),\n 4 => array( 'op' , 'do' ),\n 5 => array( 'section', 'components' ),\n ) );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Resize Options\" );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n '<b>Choose which categories to resize images in</b>',\n $cat_select,\n ) );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n '<b>Resize album images as well?</b>',\n $this->ipsclass->adskin->form_yes_no( 'album', 1 ),\n ) );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n '<b>Number to resize per cycle</b>',\n $this->ipsclass->adskin->form_input( 'num', 100 ),\n ) );\n\n $this->ipsclass->html .= $this->ipsclass->adskin->end_form( \"Begin Image Resizing\" );\n $this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n $this->ipsclass->admin->output(); \n }",
"function resize($maxWidth = 0, $maxHeight = 0)\n\n\t{\n\n\t\tif(eregi('\\.png$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$img = ImageCreateFromPNG($this->userFullName);\n\n\t\t}\n\n\t\n\n\t\tif(eregi('\\.(jpg|jpeg)$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$img = ImageCreateFromJPEG($this->userFullName);\n\n\t\t}\n\n\t\n\n\t\tif(eregi('\\.gif$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$img = ImageCreateFromGif($this->userFullName);\n\n\t\t}\n\n\n\n \t$FullImageWidth = imagesx($img); \n\n \t$FullImageHeight = imagesy($img); \n\n\n\n\t\tif(isset($maxWidth) && isset($maxHeight) && $maxWidth != 0 && $maxHeight != 0)\n\n\t\t{\n\n\t\t\t$newWidth = $maxWidth;\n\n\t\t\t$newHeight = $maxHeight;\n\n\t\t}\n\n\t\telse if(isset($maxWidth) && $maxWidth != 0)\n\n\t\t{\n\n\t\t\t$newWidth = $maxWidth;\n\n\t\t\t$newHeight = ((int)($newWidth * $FullImageHeight) / $FullImageWidth);\n\n\t\t}\n\n\t\telse if(isset($maxHeight) && $maxHeight != 0)\n\n\t\t{\n\n\t\t\t$newHeight = $maxHeight;\n\n\t\t\t$newWidth = ((int)($newHeight * $FullImageWidth) / $FullImageHeight);\n\n\t\t}\t\t\n\n\t\telse\n\n\t\t{\n\n\t\t\t$newHeight = $FullImageHeight;\n\n\t\t\t$newWidth = $FullImageWidth;\n\n\t\t}\t\n\n\n\n \t$fullId = ImageCreateTrueColor($newWidth , $newHeight);\n\n\t\tImageCopyResampled($fullId, $img, 0,0,0,0, $newWidth, $newHeight, $FullImageWidth, $FullImageHeight);\n\n\t\t\n\n\t\tif(eregi('\\.(jpg|jpeg)$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$full = ImageJPEG($fullId, $this->userFullName,100);\n\n\t\t}\n\n\t\t\n\n\t\tif(eregi('\\.png$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$full = ImagePNG($fullId, $this->userFullName);\n\n\t\t}\n\n\t\t\n\n\t\tif(eregi('\\.gif$', $this->userFullName))\n\n\t\t{\n\n\t\t\t$full = ImageGIF($fullId, $this->userFullName);\n\n\t\t}\n\n\t\tImageDestroy($fullId);\n\n\t\tunset($maxWidth);\n\n\t\tunset($maxHeight);\n\n\t}",
"function path_add_image_sizes() {\n\n\tadd_image_size( 'path-thumbnail', 300, 170, true );\n\tadd_image_size( 'path-smaller-thumbnail', 80, 80, true );\n\tadd_image_size( 'path-slider-thumbnail', 660, 300, true );\n\t\n}",
"public function maybe_resize_images() {\n\t\tif ( class_exists( 'WC_Regenerate_Images' ) ) {\n\t\t\tadd_filter( 'wp_get_attachment_image_src', [ 'WC_Regenerate_Images', 'maybe_resize_image' ], 10, 4 );\n\t\t}\n\t}",
"public function register_image_sizes() {\n\n }",
"public static function metadata_image_sizes() {\n\t\tif ( function_exists( 'fly_add_image_size' ) ) {\n\t\t\tfly_add_image_size( 'wprm-metadata-1_1', 500, 500, true );\n\t\t\tfly_add_image_size( 'wprm-metadata-4_3', 500, 375, true );\n\t\t\tfly_add_image_size( 'wprm-metadata-16_9', 480, 270, true );\n\t\t} else {\n\t\t\tadd_image_size( 'wprm-metadata-1_1', 500, 500, true );\n\t\t\tadd_image_size( 'wprm-metadata-4_3', 500, 375, true );\n\t\t\tadd_image_size( 'wprm-metadata-16_9', 480, 270, true );\n\t\t}\n\t}",
"public function mosaicImages () {}",
"function nm_woocommerce_add_image_sizes() {\n\t\t\tadd_image_size( 'nm_quick_view', 680, '', true );\n\t\t}",
"function _jjamerson_update_image(&$variables) {\n // if the image has been resized by an image style to a smaller size, leave it alone:\n if ( ($variables['width'] < 950) && isset($variables['attributes']['small-src']) ) {\n unset($variables['attributes']['small-src']);\n return false;\n }\n\n $image_uri = drupal_realpath($variables['path']);\n $image_size = getimagesize ( $image_uri );\n if ($image_size) {\n if ($image_size[0] > 1000) {\n $variables['attributes']['medium-src'] = image_style_url('scale_to_970px_width', $variables['path']); \n }\n if ($image_size[0] > 500) {\n $variables['attributes']['small-src'] = image_style_url('scale_to_480px_width', $variables['path']); \n }\n } \n}",
"public function resizeImage()\n\t{\n\t\tif ($this->imageFile) {\n\t\t\t$fileName = $this->imageFile->name;\n\t\t\t$this->imageFile->saveAs(Yii::getAlias($this->filePath).'/'.$this->originFolder.'/'.$fileName);\n\n\t\t\t$image_src = Image::getImagine()->open(Yii::getAlias($this->filePath).'/'.$this->originFolder.'/'.$fileName);\n\n\t\t\t$w_src = $image_src->getSize()->getWidth();\n\t\t\t$h_src = $image_src->getSize()->getHeight();\n\t\t\t$this->img['width'] = $w_src;\n\t\t\t$this->img['height'] = $h_src;\n\n\t\t\tif ($h_src > 200) {\n\t\t\t\t$h = 200;\n\t\t\t\t$w = ceil($h * $w_src / $h_src);\n\n\t\t\t\t//Resize\n\t\t\t\t$image_src->thumbnail(new Box($w, $h), ManipulatorInterface::THUMBNAIL_OUTBOUND)\n\t\t\t\t\t->save(Yii::getAlias(Yii::getAlias($this->filePath).'/'.$fileName), ['quality' => 94]);\n\t\t\t\t//Small thumb\n\t\t\t\t$image_src->thumbnail(new Box(13, 10), ManipulatorInterface::THUMBNAIL_OUTBOUND)\n\t\t\t\t\t->save(Yii::getAlias(Yii::getAlias($this->filePath).'/thumb/'.$fileName), ['quality' => 90]);\n\n\t\t\t\t$this->img['width'] = $w;\n\t\t\t\t$this->img['height'] = $h;\n\t\t\t}\n\t\t}\n\t}",
"protected function manageGeneralImages()\n {\n }",
"function image_auto_resize($file_name){\t\n\t\t$config['image_library'] = 'gd2'; \n\t\t$config['source_image'] = './assets/img/profiles/'.$file_name; \n $config['create_thumb'] = FALSE; \n $config['maintain_ratio'] = FALSE; \n $config['quality'] = '60%'; \n $config['width'] = 250; \n $config['height'] = 250; \n $config['new_image'] = './assets/img/profiles/'.$file_name; \n $this->load->library('image_lib', $config); \n\t\t$this->image_lib->resize();\n\t\t$this->image_lib->clear();\n\t}",
"public function image_resize() {\n\t\treturn $this->image_process('resize');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get extention by the specified separater | function getExt($name,$sep='.')
{
$ext = substr(strtolower(strrchr($name,$sep)),1);
#if($ext==''&&strpos($name,$sep)!==false) return ' ';
return $ext;
} | [
"function fetch_extension(){\n\t\t//$x = explode('.', $this->file_name);\n\t\t//return strtolower(end($x));\n\t\treturn $this->extension;\n\t}",
"function ju_file_ext(string $f):string {return pathinfo($f, PATHINFO_EXTENSION);}",
"public function getFileNameExtension();",
"function extensionFromPath ( $path ){\n\t\t\t\t$extension = explode ( '.', $path );\n\t\t\t\t$extension = end( $extension );\n\t\t\t\treturn $extension;\n\t\t\t}",
"function extensionFromPath ( $path ){\n\t\t\t$extension = explode ( '.', $path );\n\t\t\t$extension = end( $extension );\n\t\t\treturn $extension;\n\t\t}",
"public function getFileExtension();",
"protected function extractExtension() {\n\t\t$matches = $this->getExtensionMatches();\n\n\t\treturn ! empty( $matches ) ? substr( $matches[0], - 3 ) : 'mp4';\n\t}",
"public function getExtension($mime_type);",
"public function getExtensionSuffix();",
"private function extractExtension()\n {\n\n $nameParts = explode('.', $this->fileName);\n $this->extension = strtolower(array_pop($nameParts));\n\n }",
"function getExt(){\n\t\tif($this->path == \"\")\n\t\t\treturn \"\";\n\t\treturn fileutil::getExt($this->path);\n\t}",
"static function getExt($type)\n {\n /*switch($type) {\n case \"image/jpeg\":\n return \"jpg\";\n break;\n case \"image/png\":\n return \"png\";\n break;\n case \"video/mp4\":\n return \"mp4\";\n break;\n }*/\n return basename($type);\n }",
"public function getExt()\n {\n $filename = $this->getPath(); \n return pathinfo($filename, PATHINFO_EXTENSION);\n }",
"function extfile ($nf) \n{\n\t$nf = strtolower(chop($nf));\n\t$extdot = strrchr($nf, \".\");\n\t$lungh = strlen($extdot);\n\t\n\tif($lungh>3) \n\t{\n\t\t$ext = strtolower(substr($extdot, 1));\n\t} else \n\t{\n\t\t//errore dev'essere almeno 3 caratteri + 1\n\t\t$ext = \"\";\n\t}\n\n\treturn $ext;\n}",
"public function getExtension() {\n\t\t\n\t\t$filename = $this->file['name'];\n\t\t\n\t\t$parts = explode('.', $filename);\n\t\t$extension = end($parts);\n\t\t\n\t\treturn strtolower($extension);\n\t\t\n\t}",
"function extensionFromPath ($path) {\n\t\t\t$extension = explode ( '.', $path );\n\t\t\t$extension = end( $extension );\n\t\t\treturn $extension;\n\t\t}",
"public function getExt() {\n return $this->get(self::EXT);\n }",
"public function getExt()\n {\n $filename = $this->getPath();\n return pathinfo($filename, PATHINFO_EXTENSION);\n }",
"public function extension() {\n\t\t\treturn pathinfo( $this->_path, PATHINFO_EXTENSION );\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================+ url_for returns the url for a file ARGS $for the file or path/file ============================================================+ | public function url_for($for)
{
return $this->url_dir() . $for;
} | [
"function url_for($for)\n{\n return url_dir() . $for; \n}",
"function file_url( $file ) {\n\t\t$url = false;\n\t\tif ( isset( $this->files[$file] ) ) {\n\t\t\t$url = $this->files[$file];\n\t\t}\n\t\treturn $url;\n\t}",
"function _urlFor($controller, $action = null, $params = null, $anchor = null) {\n\techo urlFor($controller, $action, $params, $anchor);\n}",
"function balise_URL_FICHIER($p)\r\n{\r\n\t// Récupérer l'argument\r\n\t$filePath = interprete_argument_balise(1, $p);\r\n\t\r\n\t// Retour\r\n\tif (!$filePath)\r\n\t\t$p->code = \"\";\r\n\telse\r\n\t\t$p->code = \"find_in_path(\".$filePath.\")\";\r\n\t$p->interdire_scripts = false;\r\n\treturn $p;\r\n}",
"public function url() {\r\n return $this->pathUrl() . ($this->filename ? '/' . $this->filename : '');\r\n }",
"public function getUrl(File $file);",
"abstract public function getFileViewUrl();",
"function url_for($route = null, $params = array(), $append_qs = true)\n{\n if (($num_args = func_num_args()) < 3 && is_array($route)) {\n $append_qs = $num_args > 1 ? $params : $append_qs;\n $params = $route;\n $route = request_route();\n } else {\n $route = isset($route) ? route_for($route) : request_path();\n }\n\n $qs = $params;\n\n $replace = function($match) use (&$params, &$qs) {\n\n if (array_key_exists($match['name'], $params)) {\n switch ($match['rule']) {\n case '' : $rule = '[^\\/]+'; break;\n case '#': $rule = '\\d+'; break;\n case '$': $rule = '[a-zA-Z0-9-_]+'; break;\n case '*': $rule = '.+'; break;\n default : $rule = $match['rule']; break;\n }\n $param = $params[$match['name']];\n if (preg_match('#^' . $rule . '$#', $param)) {\n unset($qs[$match['name']]);\n return $param;\n } else {\n throw new \\Exception($param . ' does not match ' . $rule);\n }\n } else {\n throw new \\Exception('missing route parameter ' . $match['name']);\n }\n };\n\n static $pattern = '/<(?:(?P<rule>.+?):)?(?P<name>[a-z_][a-z0-9_]+)>/i';\n\n $path = preg_replace_callback($pattern, $replace, $route);\n\n $schema = is_https() ? 'https://' : 'http://';\n\n $host = $_SERVER['HTTP_HOST'];\n\n $parts = parse_url($schema . $host . base_path($path));\n\n if (!$append_qs || empty($qs)) goto url;\n\n if (isset($parts['query'])) {\n parse_str($parts['query'], $query);\n $query = array_merge($query, $qs);\n } else {\n $query = $qs;\n }\n\n if ($query) {\n $parts['query'] = http_build_query($query);\n }\n\n url:\n return $schema . $host . $parts['path'] .\n (isset($parts['query']) ? '?' . $parts['query'] : null) .\n (isset($parts['fragment']) ? '#' . $parts['fragment'] : null);\n}",
"function file_create_url($path) {\n // Strip file_directory_path from $path. We only include relative paths in urls.\n if (strpos($path, file_directory_path() .'/') === 0) {\n $path = trim(substr($path, strlen(file_directory_path())), '\\\\/');\n }\n switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {\n case FILE_DOWNLOADS_PUBLIC:\n return $GLOBALS['base_url'] .'/'. file_directory_path() .'/'. str_replace('\\\\', '/', $path);\n case FILE_DOWNLOADS_PRIVATE:\n return url('system/files/'. $path, array('absolute' => TRUE));\n }\n}",
"function _drupal_get_url_by_fid($fid){\n $query = \\Drupal::database()->select('file_managed', 'f');\n $query->addField('f', 'uri');\n $query->condition('f.fid', $fid);\n $result = $query->execute()->fetchAll();\n return !empty($result) ? file_create_url($result[0]->uri) : '';\n}",
"function _url($path){\n echo getFullUrl($path);\n}",
"private static function getUrlFile()\n {\n $url = $_SERVER['REQUEST_URI'];\n $first_slash = self::getFirstSlashIndex($url);\n $question = strpos($url, \"?\");\n if($question === false)\n return substr($url, $first_slash + 1);\n else\n return substr($url, $first_slash + 1, $question - $first_slash - 1);\n }",
"function generateUrl($nomefile){\n return 'http://'.$_SERVER['HTTP_HOST'].'/foto/'.$nomefile;\n}",
"public function test_get_url_for_file() {\n $io = new maintenance_static_page_io();\n self::assertStringContainsString(\n 'www.example.com/moodle/auth/outage/file.php?file=img.png',\n $io->get_url_for_file('img.png')\n );\n }",
"function df_url(string $path = '', array $p = []):string {return df_url_o()->getUrl($path, df_nosid() + $p);}",
"function file_uri($file_name = NULL)\n\t{\n\t\treturn $this->path($file_name);\n\t}",
"public function getFileUrl ($path);",
"function get_url_for($url_route) {\n $url_route = PHPEasyTemplate::correct_url($url_route);\n if(isset($GLOBALS[\"PHP_EASY_TEMPLATE\"])) {\n global $PHP_EASY_TEMPLATE;\n foreach ($PHP_EASY_TEMPLATE->get_routes()[\"route\"] as $route => $template) {\n if(PHPEasyTemplate::matching_urls($url_route, $route)) {\n return $PHP_EASY_TEMPLATE->get_website_url().substr($url_route, 1, strlen($url_route));\n }\n }\n return $PHP_EASY_TEMPLATE->get_website_url().\"404/\";\n } else {\n return $PHP_EASY_TEMPLATE->get_website_url().\"404/\";\n }\n }",
"function url_for($options)\n{\n if ($options instanceof \\Misago\\ActiveRecord\\Record)\n {\n $named_route = 'show_'.\\Misago\\ActiveSupport\\String::underscore(get_class($options)).'_url';\n return $named_route($options);\n }\n \n $default_options = array(\n 'anchor' => null,\n 'path_only' => true,\n 'protocol' => cfg_get('current_protocol'),\n 'host' => cfg_get('current_host'),\n 'port' => cfg_get('current_port'),\n 'user' => null,\n 'password' => null,\n );\n $mapping = array_diff_key($options, $default_options);\n $options = array_merge($default_options, $options);\n \n $map = \\Misago\\ActionController\\Routing\\Routes::draw();\n $path = $map->reverse($mapping);\n \n $query_string = array();\n foreach($mapping as $k => $v)\n {\n if (strpos($k, ':') !== 0) {\n $query_string[] = \"$k=\".urlencode($v);\n }\n }\n sort($query_string);\n \n $path .= (empty($query_string) ? '' : '?'.implode('&', $query_string)).\n (empty($options['anchor']) ? '' : \"#{$options['anchor']}\");\n \n if ($options['path_only']) {\n return $path;\n }\n return cfg_get('base_url').$path;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a form to delete a pack entity. | private function createDeleteForm(Pack $pack)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('pack_delete', array('idPack' => $pack->getIdpack())))
->setMethod('DELETE')
->getForm()
;
} | [
"private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('box_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(PackDecoration $packDecoration)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('back_paysagiste_delete', array('id' => $packDecoration->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(PackDecoration $packDecoration)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('_delete', array('id' => $packDecoration->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(BatteryPack $batteryPack)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('batterypack_delete', array('id' => $batteryPack->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addHidden('id_produkt');\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}",
"protected function createComponentDeleteTypo()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteTypoSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}",
"protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}",
"private function createDeleteForm(Environnement $environnement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('environnement_delete', array('id' => $environnement->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection('Please submit this form again (security token has expired).');\r\n\t\treturn $form;\r\n\t}",
"public function deleteForm()\n\t{\n\t\t$form = new \\IPS\\Helpers\\Form( 'form', 'delete' );\n\t\t$form->addMessage( 'node_delete_blurb_no_content' );\n\t\t\n\t\treturn $form;\n\t}",
"private function createDeleteForm(anneCompet $anneCompet)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('annecompet_delete', array('id' => $anneCompet->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Compagnie $compagnie)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('compagnie_delete', array('id' => $compagnie->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Stagiaiarebtp $stagiaiarebtp)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('stagiaiarebtp_delete', array('id' => $stagiaiarebtp->getIdstagiaiarebtp())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Plateformes $plateforme)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('administration_plateformes_delete', array('id' => $plateforme->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(Gouvernorat $gouvernorat)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('Gouvernorat_delete', array('id' => $gouvernorat->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Prods $prods)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('prods_delete', array('idpro' => $prods->getIdpro())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(pacjent $pacjent)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('pacjent_delete', array('id' => $pacjent->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }",
"function paragraphs_admin_bundle_delete_form($form, &$form_state, $bundle) {\n if (!$bundle) {\n drupal_set_message(t('Could not load bundle'), 'error');\n drupal_goto('admin/structure/paragraphs');\n }\n\n $form['type'] = array('#type' => 'value', '#value' => $bundle->bundle);\n $form['name'] = array('#type' => 'value', '#value' => $bundle->name);\n\n $message = t('Are you sure you want to delete the paragraph bundle %bundle?', array('%bundle' => $bundle->name));\n $caption = '<p>' . t('This action cannot be undone. Content using the bundle will be broken.') . '</p>';\n\n return confirm_form($form, filter_xss_admin($message), 'admin/structure/paragraphs', filter_xss_admin($caption), t('Delete'));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the simplePinBlocked Indicates whether simplePin is blocked. | public function setSimplePinBlocked($val)
{
$this->_propDict["simplePinBlocked"] = boolval($val);
return $this;
} | [
"public function setBlocked($blocked)\n {\n $this->setValue('blocked', $blocked);\n }",
"public function setPinRequired(?bool $pinRequired): void\n {\n $this->pinRequired = $pinRequired;\n }",
"public function setBlocked(?bool $value): void {\n $this->getBackingStore()->set('blocked', $value);\n }",
"public function set_pin($pin = 'unused') {\n $this->pin = $pin ? $pin : 'unused';\n }",
"public function set_pin($pin = 'unused') {\n\t\t$this->pin = $pin ? $pin : 'unused';\n\t}",
"public function setInternetSharingBlocked(?bool $value): void {\n $this->getBackingStore()->set('internetSharingBlocked', $value);\n }",
"public function setBluetoothBlocked(?bool $value): void {\n $this->getBackingStore()->set('bluetoothBlocked', $value);\n }",
"public function setContactSyncBlocked(?bool $value): void {\n $this->getBackingStore()->set('contactSyncBlocked', $value);\n }",
"public function setIsBlocked(?bool $value): void {\n $this->getBackingStore()->set('isBlocked', $value);\n }",
"public function setNfcBlocked(?bool $value): void {\n $this->getBackingStore()->set('nfcBlocked', $value);\n }",
"public function setOutboundConnectionsBlocked(?bool $value): void {\n $this->getBackingStore()->set('outboundConnectionsBlocked', $value);\n }",
"public function setPasswordBlockSimple($val)\n {\n $this->_propDict[\"passwordBlockSimple\"] = boolval($val);\n return $this;\n }",
"public function setBlocked(?string $value): void {\n $this->getBackingStore()->set('blocked', $value);\n }",
"public function setMiracastBlocked(?bool $value): void {\n $this->getBackingStore()->set('miracastBlocked', $value);\n }",
"public function setSiriBlockedWhenLocked($val)\n {\n $this->_propDict[\"siriBlockedWhenLocked\"] = boolval($val);\n return $this;\n }",
"public function setUnicastResponsesToMulticastBroadcastsBlocked(?bool $value): void {\n $this->getBackingStore()->set('unicastResponsesToMulticastBroadcastsBlocked', $value);\n }",
"public function setWindowsHelloForBusinessBlocked(?bool $value): void {\n $this->getBackingStore()->set('windowsHelloForBusinessBlocked', $value);\n }",
"function set_pin($new_pin) {\n $this->pin = $new_pin;\n \t}",
"public function setWiFiBlocked($val)\n {\n $this->_propDict[\"wiFiBlocked\"] = boolval($val);\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To add new relation | public function addNewRelation()
{
$currentUserId = $this->CFG['user']['user_id'];
$newRelation = $this->fields_arr['new_relation'];
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['friends_relation_name'].
' SET user_id = '.$this->dbObj->Param($currentUserId).
', relation_name = '.$this->dbObj->Param($newRelation);
// prepare sql
$stmt = $this->dbObj->Prepare($sql);
// execute sql
$rs = $this->dbObj->Execute($stmt, array($currentUserId, $newRelation));
//raise user error... fatal
if (!$rs)
trigger_db_error($this->dbObj);
return $this->dbObj->Insert_ID();
} | [
"protected function addRelation()\n {\n $fromTable = $this->ask('Enter the name of the parent table');\n $this->checkInput($fromTable);\n $toTable = $this->ask('Enter the name of the child table');\n $this->checkInput($toTable);\n $relationColumn = $this->ask('Enter the column which is going to be referenced (default is \\'id\\')', 'id');\n $action = $this->choice('Action to be taken for column (default is \\'cascade\\')', ['cascade', 'restrict', 'set null'], 'cascade');\n $this->service->addRelation($fromTable, $toTable, $relationColumn, $action);\n }",
"public function addRelation(RelationInterface $relation): void;",
"public function addRelation(ModelRelationInterface $relation);",
"public function addRelation(RelationInterface $relation);",
"public function addRelation(string $fromTable, string $toTable, string $relationColumn = 'id', string $action = 'cascade');",
"private function createRelation()\n {\n $this->actingAs($this->company, 'api')\n ->withHeaders(['Accept' => 'Application/json'])\n ->json('POST', 'api/addFidelityPoint', ['scanned_user_id' => $this->user->id])\n ->assertStatus(201)\n ->assertJson([\n \"status\" => \"The relation between user and company is created.\",\n \"number_of_points\" => 1\n ]);\n }",
"public function addPartyRelation() {\r\n $this->addRelation('party');\r\n }",
"public function addRelation(Model $relation)\n {\n $this->relations[] = $relation;\n }",
"private function setCreateRelation(): void\n {\n $this->openComment();\n\n $this->setStarredComment(DocumentationInterface::OA_POST . PhpInterface::OPEN_PARENTHESES);\n\n $this->setStarredComment('path=\"' . PhpInterface::SLASH . $this->generator->version . PhpInterface::SLASH\n . MigrationsHelper::getTableName($this->generator->objectName) . PhpInterface::SLASH . '{id}/relationships/{relations}\",', 1, 1);\n\n $this->setStarredComment('summary=\"Create ' . Classes::getClassName($this->generator->objectName) . ' relation object\",', 1, 1);\n\n $this->setStarredComment('tags={\"' . Classes::getClassName($this->generator->objectName) . DefaultInterface::CONTROLLER_POSTFIX\n . '\"},', 1, 1);\n\n $this->setParameter([\n 'in' => '\"path\"',\n 'name' => '\"id\"',\n 'required' => 'true',\n ]);\n\n $this->setParameter([\n 'in' => '\"path\"',\n 'name' => '\"relations\"',\n 'required' => 'true',\n ]);\n\n $this->setResponse([\n 'response' => '\"' . JSONApiInterface::HTTP_RESPONSE_CODE_CREATED . '\"',\n 'description' => '\"' . self::SUCCESSFUL_OPERATION . '\"',\n ]);\n\n $this->setStarredComment(PhpInterface::CLOSE_PARENTHESES);\n\n $this->closeComment();\n $this->setNewLines();\n }",
"public function createRelatedLinearRelation()\n {\n $linearRelated = TreeLinear::create(['user_id'=>$this->id]);\n }",
"public function add_relation($source_id, $destination_id, $type_id, $author_id) {\r\n \r\n $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' */';\r\n $time = $this->db->db_now();\r\n $sql = \" $debugMsg INSERT INTO \".$this->db->get_table('req_relations').\" \" . \r\n \" (source_id, destination_id, relation_type, author_id, creation_ts) \" .\r\n \" values ($source_id, $destination_id, $type_id, $author_id, $time)\";\r\n $this->db->exec_query($sql);\r\n }",
"protected function _addRelationFieldInLocalModel() {\n if (!$this->isSingular()) {\n return;\n }\n\n //$column = Garp_Spawn_Relation_Set::getRelationColumn($this->name);\n $column = $this->column;\n $fieldParams = array(\n 'model' => $this->model,\n 'type' => 'numeric',\n 'editable' => true,\n 'visible' => true,\n 'primary' => $this->primary,\n 'required' => $this->required,\n 'relationAlias' => $this->name,\n 'relationType' => $this->type\n );\n if ($this->multilingual && $this->_localModel->isMultilingual()) {\n // The relation is added to the i18n model by Garp_Spawn_Config_Model_I18n\n return;\n }\n $this->_localModel->fields->add('relation', $column, $fieldParams);\n }",
"public function addRelation($name,$config)\n\t{\n\t\tif(isset($config[0],$config[1],$config[2])) // relation class, AR class, FK\n\t\t\t$this->relations[$name]=new $config[0]($name,$config[1],$config[2],array_slice($config,3));\n\t\telse\n\t\t\tthrow new DbException(Benben::t('benben','Active record \"{class}\" has an invalid configuration for relation \"{relation}\". It must specify the relation type, the related active record class and the foreign key.', array('{class}'=>get_class($this->_model),'{relation}'=>$name)));\n\t}",
"public function addForeignKeys()\n {\n }",
"public function addRelation($name,$config)\n\t{\n\t\tif(isset($config[0],$config[1],$config[2])) // relation class, AR class, FK\n\t\t\t$this->relations[$name]=new $config[0]($name,$config[1],$config[2],array_slice($config,3));\n\t\telse\n\t\t\tthrow new CDbException(Yii::t('yii','Active record \"{class}\" has an invalid configuration for relation \"{relation}\". It must specify the relation type, the related active record class and the foreign key.', array('{class}'=>$this->_modelClassName,'{relation}'=>$name)));\n\t}",
"public function addToParent()\n {\n $this->builder->addRelationshipsCollection(\n $this->factory->createRelationshipsCollection(\n $this->relationships\n )\n );\n }",
"public function addRelationship(string $name, $relationship);",
"public function addRelation($name, $config) {\n if (isset($config[0], $config[1], $config[2])) // relation class, AR class, FK\n $this->relations[$name] = new $config[0]($name, $config[1], $config[2], array_slice($config, 3));\n else\n throw new CDbException(Yii::t('yii', 'Active record \"{class}\" has an invalid configuration for relation \"{relation}\". It must specify the relation type, the related active record class and the foreign key.', array('{class}' => get_class($this->_model), '{relation}' => $name)));\n }",
"public function addRelationship(RelationshipInterface $relationship);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Authentication of API via openssl public key. | function openssl_api_auth_connection($namespace, $hook, $parameters, $return_value)
{
// Get key id
$key_guid = $_SERVER['HTTP_OPENSSL_KEY_ID'];
$key = getObject($key_guid);
if ($key)
{
if (($key instanceof OpenSSLKeypair) || ($key instanceof OpenSSLPublicKey))
{
// Get key
$pubkey = $key->getPublic();
// Get header components
$time = $_SERVER['HTTP_OPENSSL_API_TIMESTAMP']; // Unix timestamp
$hash = $_SERVER['HTTP_OPENSSL_API_HASH']; // Sha1 Hash of all names&variables, URL encoded IN ORDER as it appears on the url line, eg method=foo&var1=bar + timestamp
$signature = $_SERVER['HTTP_OPENSSL_API_SIGNATURE']; // base64 encoded RSA signature of above
// Verify timestamp (you have 10 minutes either side to allow for clock drift)
$minute = 60;
$now = time();
if (($time < $now-($minute*10)) || ($time > $now+($minute*10)))
{
log_echo(_echo('openssl:api:timeout'));
return false;
}
// Verify hash
if (!$hash) {
log_echo(_echo('openssl:api:noshash'));
return false;
}
$qs_array = call_plugin_function('api_get_parameters_for_method', input_get('method'));
$qs = array();
foreach ($qs_array as $k => $v)
$qs[] = urlencode($k)."=".urlencode($v);
if ($hash != sha1(
implode('&', $qs).
$time
))
{
log_echo(_echo('openssl:api:hashinvalid'));
return false;
}
// Verify signature on hash
openssl_public_decrypt($signature, $decrypted, openssl_pkey_get_public($pubkey));
if ($decrypted != $hash)
{
log_echo('openssl:api:signatureinvalid');
return false;
}
// Got this far, so signature and hash are both valid, connection is authentic
return true;
}
return false;
}
// Possibly authenticated elsewhere, so leave it for the default return.
} | [
"function openssl_pkey_get_public($public_key): \\OpenSSLAsymmetricKey\n{\n error_clear_last();\n $safeResult = \\openssl_pkey_get_public($public_key);\n if ($safeResult === false) {\n throw OpensslException::createFromPhpError();\n }\n return $safeResult;\n}",
"public function setAuthKey();",
"function ssh2_publickey_init($session) {}",
"public function getAuthKey()\n {\n }",
"function openssl_pkey_get_public($certificate)\n{\n}",
"private function authenticate()\n {\n $HttpSocket = new HttpSocket();\n\n $data = array(\n 'email'=>'marketing@payscape.com',\n 'password'=>'0ow337!D0g',\n 'user_key'=>self::user_key\n );\n\n $response = $HttpSocket->post(self::pardot_url . 'login/version/3', $data);\n $response_array = Xml::toArray(Xml::build($response->body));\n if(!$response->isOk())\n {\n //Todo send email to dev\n error_log(json_encode($response_array));\n }\n\n return $response_array['rsp']['api_key'];\n }",
"public static function enrol_spay_get_public_key()\n {\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => Spay::$url . \"GetPublicKey/\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => json_encode([\n 'providerKey' => Spay::$providerkey\n ]),\n CURLOPT_HTTPHEADER => array(\n \"Content-Type: application/json\",\n \"cache-control: no-cache\"\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n if ($err) {\n return null;\n } else {\n return json_decode($response);\n }\n }",
"private function _login_keys()\n {\n if ($this->passphrse != '') \n {\n return @ssh2_auth_pubkey_file($this->conn_id, $this->username, $this->pubkeyfile, $this->prikeyfile, $this->passphrse);\n }\n return @ssh2_auth_pubkey_file($this->conn_id, $this->username, $this->pubkeyfile, $this->prikeyfile);\n }",
"function api_auth_key() {\n\tglobal $CONFIG;\n\n\t// check that an API key is present\n\t$api_key = get_input('api_key');\n\tif ($api_key == \"\") {\n\t\tthrow new APIException(elgg_echo('APIException:MissingAPIKey'));\n\t}\n\n\t// check that it is active\n\t$api_user = get_api_user($CONFIG->site_id, $api_key);\n\tif (!$api_user) {\n\t\t// key is not active or does not exist\n\t\tthrow new APIException(elgg_echo('APIException:BadAPIKey'));\n\t}\n\n\t// can be used for keeping stats\n\t// plugin can also return false to fail this authentication method\n\treturn elgg_trigger_plugin_hook('api_key', 'use', $api_key, true);\n}",
"private function authenticate()\n {\n $this->client = new VisionClient(['keyFile' => json_decode($this->getKey(), true)]);\n }",
"function rsa_encrypt($string, $public_key) {\n //Create an instance of the RSA cypher and load the key into it\n $cipher = new Crypt_RSA();\n $cipher->loadKey($public_key);\n //Set the encryption mode\n $cipher->setEncryptionMode(CRYPT_RSA_ENCRYPTION_PKCS1);\n //Return the encrypted version\n return $cipher->encrypt($string);\n}",
"function rsa_encrypt($string, $public_key)\n{\n //Create an instance of the RSA cypher and load the key into it\n $cipher = new Crypt_RSA();\n $cipher->loadKey($public_key);\n //Set the encryption mode\n $cipher->setEncryptionMode(CRYPT_RSA_ENCRYPTION_PKCS1);\n //Return the encrypted version\n return $cipher->encrypt($string);\n}",
"public function loadUserByPublicKey($publicApiKey);",
"function encrypt($data, $publicKey)\n{\n // Encrypt the data using the public key\n openssl_public_encrypt($data, $encryptedData, $publicKey);\n\n // Return encrypted data\n return $encryptedData;\n}",
"public function fetchPublicKey();",
"public function getAuthKey()\n {\n }",
"protected function getPublicKeysRequest()\n {\n\n $resourcePath = '/v1/account/pubkey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\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 $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function __construct() {\r\n\tif(! function_exists(\"openssl_pkey_get_public\"))\r\n\t\tdie(\"php doit etre installé avec le module openssl\");\r\n}",
"function sodium_crypto_box_publickey(string $key_pair): string {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061; | public function getCircuitBreakers()
{
return $this->circuit_breakers;
} | [
"public function getCircuitBreakers(): array\n {\n return [\n 'simple' => [$this->createSimpleCircuitBreaker()],\n 'symfony' => [$this->createSymfonyCircuitBreaker()],\n 'advanced' => [$this->createAdvancedCircuitBreaker()],\n ];\n }",
"public function setCircuitBreaker(CircuitBreaker $circuitBreaker): self;",
"public function getCircuitBreaker();",
"public function getCircuitBreaker(): CircuitBreaker|null;",
"public function setCircuitBreaker(CircuitBreakerService $circuitBreaker)\n {\n $this->circuitBreaker = $circuitBreaker;\n }",
"public function setCircuits( $circuits );",
"public function setChainBreaker($break);",
"public static function setCircuitBreaker(CircuitBreakerInterface $circuitBreaker)\n {\n static::$circuitBreaker = $circuitBreaker;\n }",
"public function setCircuits($circuits)\n {\n \t$this->circuits = $circuits;\n }",
"public function getBreakBlockData()\n {\n return $this->readOneof(4);\n }",
"public function setTieBreaker($tieBreaker)\n {\n }",
"public function &getCircuit();",
"public function setTieBreaker($tieBreaker) {}",
"public function breakBarrier()\n {\n $this->generation->broken = true;\n $this->count = $this->parties;\n Cond::broadcast($this->cond);\n }",
"public function setTieBreaker($tieBreaker){}",
"public function getCircuitId()\n {\n return $this->circuit_id;\n }",
"public function setAdBreaks($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Video\\Transcoder\\V1beta1\\AdBreak::class);\n $this->ad_breaks = $arr;\n\n return $this;\n }",
"public function getBreaks(): ?array {\n $val = $this->getBackingStore()->get('breaks');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, TimeCardBreak::class);\n /** @var array<TimeCardBreak>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'breaks'\");\n }",
"public function getCapHourSwitch()\n {\n return $this->capHourSwitch;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the collection of tagged dataobjects | public function testTaggedObjectsCollectionMechanism()
{
$tag = $this->objFromFixture(TaxonomyTerm::class, 'tagForTaggedObjects');
$object5 = $this->objFromFixture(OwnerObject::class, 'object5');
// expect 2 dataobjects tagged
$this->assertEquals(
2,
$tag->getTaggedDataObjects()->count(),
'tagForTaggedObjects should show two tagged objects'
);
// remove one tag and expect 1 dataobject tagged only
$object5->Tags()->remove($tag);
$this->assertEquals(
1,
$tag->getTaggedDataObjects()->count(),
'tagForTaggedObjects should show one tagged objects after a tag removal'
);
} | [
"public function testGetTags()\n {\n $result = $this->api->get_tags();\n $this->assertIsArray($result);\n\n // Convert to array to check for keys, as assertObjectHasAttribute() will be deprecated in PHPUnit 10.\n $tag = get_object_vars($result[0]);\n $this->assertArrayHasKey('id', $tag);\n $this->assertArrayHasKey('name', $tag);\n $this->assertArrayHasKey('created_at', $tag);\n }",
"public function testTagsList()\n {\n }",
"public function testTagList()\n {\n }",
"public function testListTags()\n {\n }",
"public function testGetItemTags()\n {\n }",
"public function testTags()\n {\n $project = new Project();\n $this->assertEquals(0, count($project->getTags()));\n\n // but we can add one\n $tag = new Tag();\n $project->addTag($tag);\n $this->assertEquals(1, count($project->getTags()));\n\n // and remove it\n $project->removeTag($tag);\n $this->assertEquals(0, count($project->getTags()));\n\n // and it's also possible to pass an Array\n $project->setTags(new ArrayCollection([$tag]));\n $this->assertEquals(1, count($project->getTags()));\n }",
"public function testGetTags()\n {\n $objects = $this->loadTestFixtures(['@AppBundle/DataFixtures/ORM/Test/Tag/CrudData.yml']);\n\n // Test scope\n $this->restScopeTestCase('/api/tags', [\n 'list' => $this->getScopeConfig('tag/list.yml')\n ], true);\n\n // Test filters\n $listFilterCaseHandler = new ListFilterCaseHandler([\n 'tag-1' => $objects['tag-1']\n ]);\n \n $listFilterCaseHandler->addCase('name', '=Some name', 'tag-1', true);\n\n $this->restListFilterTestCase('/api/tags', $listFilterCaseHandler->getCases());\n }",
"public function hasAnyTag();",
"public function hasAllTags();",
"public function testTagSearch() {\n\n // Create some tags.\n foreach ($this->tests['tags']['values'] as $values) {\n Term::create($values)->save();\n }\n\n // Create some articles using those tags.\n foreach ($this->tests['tags']['articles'] as $id => $tag) {\n $article = Article::create(['id' => $id]);\n $article->addState('published', 1);\n $topic = $tag['topic-specific'] ? 1 : 0;\n $article->addTag($tag['name'], $topic, 0, $tag['date']);\n $article->save();\n }\n\n // Try some tag searches.\n $this->trySearches('tags');\n }",
"abstract protected function getID3TagsAdded(): bool;",
"private function checkTags()\n {\n $tags = Tag::has('activeTracks')->\n where('name', 'like', '%' . $this->search . '%')\n ->limit(5)\n ->select(['id', 'slug', 'name'])->get();\n\n if ($tags) {\n $tags = $tags->map(function ($item) {\n return [\n 'title' => $item->name,\n 'slug' => $item->slug,\n 'id' => $item->id,\n 'linkName' => 'tags',\n ];\n });\n if(!$tags->isEmpty()){\n $tags = collect(['tags' => $tags]);\n $this->setSearchResult($tags, 'filterResult');\n $this->setSearchResult($tags);\n }\n\n }\n }",
"public function testTagging() {\n\n\t\t// Instantiate a page to use.\n\n\t\t$page = SiteTree::create();\n\n\t\t// Determine whether consolidated tags are found in the existing relationships.\n\n\t\t$types = array();\n\t\t$existing = singleton('FusionService')->getFusionTagTypes();\n\t\tforeach($existing as $type => $field) {\n\t\t\t$types[$type] = $type;\n\t\t}\n\t\t$types = array_intersect($page->many_many(), $types);\n\t\tif(empty($types)) {\n\n\t\t\t// Instantiate a tag to use, adding it against the page.\n\n\t\t\t$tag = FusionTag::create();\n\t\t\t$field = 'Title';\n\t\t\t$tag->$field = 'new';\n\t\t\t$tag->write();\n\t\t\t$page->FusionTags()->add($tag->ID);\n\t\t}\n\t\telse {\n\n\t\t\t// There are consolidated tags found.\n\n\t\t\tforeach($types as $relationship => $type) {\n\n\t\t\t\t// Instantiate a tag to use, adding it against the page.\n\n\t\t\t\t$tag = $type::create();\n\t\t\t\t$field = $existing[$type];\n\t\t\t\t$tag->$field = 'new';\n\t\t\t\t$tag->write();\n\t\t\t\t$page->$relationship()->add($tag->ID);\n\n\t\t\t\t// The consolidated tags are automatically combined, so this only needs to exist against one.\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$page->writeToStage('Stage');\n\t\t$page->writeToStage('Live');\n\n\t\t// Determine whether the page tagging reflects this.\n\n\t\t$this->assertContains($tag->$field, $page->Tagging);\n\n\t\t// Update the tag.\n\n\t\t$tag->$field = 'changed';\n\t\t$tag->write();\n\n\t\t// Determine whether the page tagging reflects this.\n\n\t\t$page = SiteTree::get()->byID($page->ID);\n\t\t$this->assertContains($tag->$field, $page->Tagging);\n\n\t\t// The database needs to be emptied to prevent further testing conflict.\n\n\t\tself::empty_temp_db();\n\t}",
"public function test_get_posts_by_tag()\n\t{\n\t\t$this->mark_test_incomplete();\n//\t\ttags:term_display\n//\t\ttags:term\n//\t\ttags:all:term_display\n//\t\ttags:all:term\n//\t\ttags:not:term_display\n//\t\ttags:not:term\n\t}",
"public function testCountable()\n {\n $objects = new Objects;\n $objects[] = 'test';\n $this->assertCount(1, $objects);\n }",
"public function testQueryWithMultiObject(){\n $result = $this->graphQL->queryAndReturnResult($this->queries['multiObject'],null,\\Yii::$app);\n $this->assertObjectHasAttribute('data', $result);\n $this->assertCount(0, $result->errors);\n }",
"public function testGetCustomFieldTags()\n {\n }",
"public function testTagsIdDesignsPost()\n {\n\n }",
"public function testPosTaggerTagAdjectives()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Can delete thread likes for own threads or all threads | public function canDeleteThreadLikes(array $thread, &$errorPhraseKey = '', array $nodePermissions = null, array $viewingUser = null)
{
$this->standardizeViewingUserReferenceForNode($thread['node_id'], $viewingUser, $nodePermissions);
//For all threads
if (XenForo_Permission::hasContentPermission($nodePermissions, 'deleteAnyThreadLikes'))
{
return true;
}
//For own threads only
if (XenForo_Permission::hasContentPermission($nodePermissions, 'deleteOwnThreadLikes') && $thread['user_id'] == $viewingUser['user_id'])
{
return true;
}
return false;
} | [
"public function toggleLike(){\n if(DB::table(self::$likes_table)->where('thread_id', $this->id)->where('user_id', Auth::user()->id)->count() > 0){\n return $this->unlike();\n }else{\n return $this->like();\n }\n }",
"function delete_like($username, $post_id)\n{\n\n delete_data('tb_likes', array('username' => $username, 'posts' => $post_id));\n\n return true;\n}",
"function deleteThread()\n\t\t{\n\t\t\tdeleteThread($this->dataobject->thread_id);\n\t\t}",
"function trashThread() {\n\t\t$this->getThread();\n\t\tforeach ($this->replies as $x=>$v) {\n\t\t\t$v->trash();\n\t\t}\n\t\t//the post itself is included in the replies array\n\t\t//get thread is the entire thread\n\t}",
"public function deleteAll() {\n\t\tif (!empty($this->threadIDs)) {\n\t\t\tlist($boards, $boardIDs) = ThreadEditor::getBoards($this->threadIDs);\n\t\t\t\n\t\t\t// check permissions\n\t\t\t$sql = \"SELECT \tthreadID, isDeleted, boardID\n\t\t\t\tFROM \twbb\".WBB_N.\"_thread\n\t\t\t\tWHERE \tthreadID IN (\".$this->threadIDs.\")\";\n\t\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\tif ($row['isDeleted'] || !THREAD_ENABLE_RECYCLE_BIN) {\n\t\t\t\t\t$boards[$row['boardID']]->checkModeratorPermission('canDeleteThreadCompletely');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$boards[$row['boardID']]->checkModeratorPermission('canDeleteThread');\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tThreadEditor::deleteAll($this->threadIDs, true, $this->reason);\n\t\t\tThreadEditor::unmarkAll();\n\t\t\t\n\t\t\t// refresh counts\n\t\t\tBoardEditor::refreshAll($boardIDs);\n\t\t\t\n\t\t\t// set last post\n\t\t\tforeach ($boards as $board) {\n\t\t\t\t$board->setLastPosts();\n\t\t\t}\n\t\t\t\n\t\t\tself::resetCache();\n\t\t}\n\t\tHeaderUtil::redirect($this->url);\n\t\texit;\n\t}",
"function delete_like($entry_id) {\r\r\r\r\n\t$this->fetch(\"/api/like/delete\", null, array(\r\r\r\r\n \"entry\" => $entry_id,\r\r\r\r\n\t));\r\r\r\r\n }",
"public function removeLikes()\n {\n foreach ($this->likes as $like) {\n $like->delete();\n }\n }",
"public function forceDeleted(Like $likes)\n {\n //\n }",
"public function createLikeUnlikeForThread($testimonial_thread_id,$testimonial_thread_customers_like){\n\t\t\n\t\t$thread_like_js = '';\n\t\t$thread_like_html = '';\n\t\t\n\t\tif($this->isProductFaqLikeEnable() && Mage::helper('customer')->isLoggedIn()):\n\t\t\n\t\t\t$t_session = Mage::getSingleton('customer/session');\n\t\t\t$customer = $t_session->getCustomer();\n\t\t\t$customer_name = $customer->getFirstname();\n\t\t\t$customer_id = $customer->getId();\n\t\t\t$customer_thumb_path = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS).'prodfaqs/like/dman.png'; \n\t\t\t$customer_thumb = \"<img src='$customer_thumb_path' style='width:15px; height:15px; margin:0 5px;'>\";\n \n\t\t\t$thread_like_js = \"<script type='text/javascript'>\";\t\t\t\t\n\t\t\t$thread_like_js .= \"Event.observe(window, 'load', function() {\";\t\t\t\t\t\n\t\t\t$thread_like_js .= \"var customer_name = '\".$customer_name.\"';\";\n\t\t\t$thread_like_js .= \"var customer_id = '\".$customer_id.\"';\";\n\t\t\t$thread_like_js .= \"if($('thread_like_faq_id_\".$testimonial_thread_id.\"') != undefined){\";\t\t\t\t\t\t\n\t\t\t$thread_like_js .= \"thread_like = new Control.Like($('thread_like_container_\".$testimonial_thread_id.\"'),$('thread_like_element_\".$testimonial_thread_id.\"'),$('thread_like_result_\".$testimonial_thread_id.\"'),$('thread_likeby_text_\".$testimonial_thread_id.\"'),$('thread_count_elements_\".$testimonial_thread_id.\"'),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t likeby_name\t\t: customer_name,\n\t\t\t\t\t\t\t likeby_id \t\t: customer_id,\n\t\t\t\t\t\t\t liked_obj_id \t: parseInt($('thread_like_faq_id_\".$testimonial_thread_id.\"').readAttribute('title')),\n\t\t\t\t\t\t\t likeby_avatar \t: '\".$customer_thumb_path.\"',\n\t\t\t\t\t\t\t updateUrl\t\t: '\".Mage::getUrl('prodfaqs/index/like').\"',\n\t\t\t\t\t\t\t updateOptions \t: {\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t method:'post',\n\t\t\t\t\t\t\t\t\t\t onSuccess: function(transport) {}\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t});\";\t\t\t\t\t\t\n\t\t\t$thread_like_js .= \"}\";\t\t\t\n\t\t\t$thread_like_js .= \"});\";\t\t\t\n\t\t\t$thread_like_js .= \"</script>\";\n\t\t\n\t\t\n\n\t\t\n\t\t\t$like_customer_ids = $testimonial_thread_customers_like;\n\t\t\t$like_customer_ids_arr = explode(',',$like_customer_ids);\n\t\t\t\n\t\t\t\n\t\t\t$thread_like_html = \"<div class='like_dv' id='thread_like_container_\".$testimonial_thread_id.\"'>\";\n\t\t\t\n\t\t\t\n\t\t\tif(in_array($customer_id,$like_customer_ids_arr)){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$thread_like_html .= \"<a href='javascript:' id='thread_like_element_\".$testimonial_thread_id.\"'>Unlike</a>\";\n\t\t\t\t\n\t\t\t\tif(Mage::getStoreConfig('prodfaqs/product_page/reply') && Mage::helper('customer')->isLoggedIn()):\n\t\t\t\t\n\t\t\t\t\t$thread_like_html .= \"<a class='js-plugin-reply-button' href='javascript: showJsCommentForm(null,\".$testimonial_thread_id.\")' id='thread_reply_element_\".$testimonial_thread_id.\"'>Reply</a>\";\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t$thread_like_html .= \"<br /><div style='float:left;' id='thread_likeby_text_\".$testimonial_thread_id.\"'>Liked by</div>\";\n\t\t\t\t$thread_like_html .= \"<div id='thread_like_result_\".$testimonial_thread_id.\"' class='like_on'>\".$customer_thumb.\"You</div>\";\t\t\t \n\t\t\t\t$thread_like_html .= \"<span id='thread_like_faq_id_\".$testimonial_thread_id.\"' style='display:none;' title='\".$testimonial_thread_id.\"'></span>\";\n\t\t\t\t$thread_like_html .= \"<span id='thread_count_elements_\".$testimonial_thread_id.\"' title='\";\n\t\t\t\t\tif($like_customer_ids!= ''){\n\t\t\t\t\t\t$thread_like_html .= count($like_customer_ids_arr);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$thread_like_html .= 0;\n\t\t\t\t\t}\n\t\t\t\t$thread_like_html .= \"' style='display:none;'>\".count($like_customer_ids_arr).\"</span>\";\n\t\t\t\t\n\t\t\t}else{\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t$thread_like_html .= \"<a href='javascript:' id='thread_like_element_\".$testimonial_thread_id.\"'>Like</a>\";\n\t\t\t\t\n\t\t\t\tif(Mage::getStoreConfig('prodfaqs/product_page/reply') && Mage::helper('customer')->isLoggedIn()):\n\t\t\t\t\n\t\t\t\t\t$thread_like_html .= \"<a class='js-plugin-reply-button' href='javascript: showJsCommentForm(null,\".$testimonial_thread_id.\")' id='thread_reply_element_\".$testimonial_thread_id.\"'>Reply</a>\";\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t$thread_like_html .= \"<br /><div style='float:left;'>\";\n\t\t\t\t$thread_like_html .= \"<div style='float:left;' id='thread_likeby_text_\".$testimonial_thread_id.\"'>\";\n\t\t\t\t\tif($like_customer_ids != ''){\t$thread_like_html .=\"Liked by\"; }\n\t\t\t\t$thread_like_html .= \"</div>\";\n\t\t\t\t\t\n\t\t\t\t$thread_like_html .= \"<div id='thread_like_result_\".$testimonial_thread_id.\"'></div>\";\n\t\t\t\t$thread_like_html .= \"</div>\";\n\t\t\t\t\n\t\t\t\t$thread_like_html .= \"<span id='thread_like_faq_id_\".$testimonial_thread_id.\"' style='display:none;' title='\".$testimonial_thread_id.\"'></span>\";\n\t\t\t\t$thread_like_html .= \"<span id='thread_count_elements_\".$testimonial_thread_id.\"' title='\";\n\t\t\t\t\tif($like_customer_ids!= ''){\n\t\t\t\t\t\t$thread_like_html .= count($like_customer_ids_arr);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$thread_like_html .= 0;\n\t\t\t\t\t}\n\t\t\t\t$thread_like_html .= \"'></span>\";\n\t\t\t\t\t\t\t \n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\tforeach($like_customer_ids_arr as $c_id):\n\t\t\t\t\t\t\t \n\t\t\t\t$customer_data = Mage::getModel('customer/customer')->load($c_id);\n\t\t\t\tif($c_id != '' && $c_id != $customer_id) { \n\t\t\t\t\t\t\t\n\t\t\t\t\t$thread_like_html .=\"<div class='like-customers-view'>\".$customer_thumb.$customer_data->getFirstname().\"</div>\";\n\t\t\t\t\t\t\t \n\t\t\t\t} \t\t\t\n\t\t\t\t\t\t\t \n\t\t\tendforeach;\n\t\t\t\t\t\t\t\n\t\t\t$thread_like_html .=\"<div class='clear'></div>\";\t\t\n\t\t\t$thread_like_html .=\"</div>\";\n\t\t\n\t\tendif; \n\t\t\n\t\t\n\t\t\n\t\tif(Mage::getStoreConfig('prodfaqs/product_page/reply') && !$this->isProductFaqLikeEnable() && Mage::helper('customer')->isLoggedIn()):\n\t\t\t\t\n\t\t\t\t\t$thread_like_html .= \"<div class='like_dv'><a class='js-plugin-reply-button' href='javascript: showJsCommentForm(null,\".$testimonial_thread_id.\")' id='thread_reply_element_\".$testimonial_thread_id.\"' style='padding-left:0;'>Reply</a><br/></div>\";\n\t\tendif;\n\t\t\t\t\n\t\t\t\t\n\t\t\n\t\t\n\t\treturn $thread_like_js.$thread_like_html;\n\t\n\t}",
"private function deleteLikeTableRow() {\n $db = $this->getDb();\n $getLike = $db->query('SELECT `like_id`, `poster_id` FROM `engine4_communityad_likes`;')->fetchAll();\n foreach ($getLike as $getLikeValue) {\n $getName = $db->query('SELECT `user_id` FROM `engine4_users` WHERE `user_id` = ' . $getLikeValue['poster_id'] . ' LIMIT 1')->fetchAll();\n if (empty($getName)) {\n $db->query('DELETE FROM `engine4_communityad_likes` WHERE `engine4_communityad_likes`.`like_id` = ' . $getLikeValue['like_id'] . ' LIMIT 1');\n }\n }\n }",
"function unlikePost(){\n $pdo = Database::connect();\n $unlike = new Likes($pdo);\n $unlike->deleteLikes($_POST['postId'],$_COOKIE['userId']);\n $blogpost = new Blogpost($pdo);\n $blogpost->removeLike($_POST['postId']);\n\n}",
"public function unlike()\n {\n $attributes = ['user_id' => auth()->id()];\n\n $this->likes()->where($attributes)->get()->each->delete();\n }",
"public function deleted(Thread $thread)\n {\n //\n }",
"public function removeLikes()\n {\n if($this->likes()->count()){\n $this->likes()->delete();\n }\n }",
"function post_like_remove($post_data)\n\t{\n\t\tglobal $db, $cache, $config, $user, $lang;\n\n\t\tif (empty($post_data) || empty($post_data['topic_id']) || empty($post_data['post_id']) || empty($post_data['user_id']))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$sql = \"UPDATE \" . TOPICS_TABLE . \" SET topic_likes = topic_likes - 1 WHERE topic_id = \" . $post_data['topic_id'];\n\t\t$db->sql_query($sql);\n\n\t\t$sql = \"UPDATE \" . POSTS_TABLE . \" SET post_likes = post_likes - 1 WHERE post_id = \" . $post_data['post_id'];\n\t\t$db->sql_query($sql);\n\n\t\t$sql = \"DELETE FROM \" . POSTS_LIKES_TABLE . \" WHERE post_id = \" . $post_data['post_id'] . \" AND user_id = \" . $post_data['user_id'];\n\t\t$db->sql_query($sql);\n\n\t\treturn true;\n\t}",
"public function getLikedThreads($limit = 0)\n {\n $visitor = XenForo_Visitor::getInstance();\n\n $exclforums = XenForo_Application::get('options')->exluded_liked_threads_fids;\n\t\t\n $conditions = array(\n 'deleted' => false,\n 'moderated' => false\n );\n\n $fetchOptions = array(\n 'join' => XenForo_Model_Thread::FETCH_USER,\n 'permissionCombinationId' => $visitor['permission_combination_id'],\n 'readUserId' => $visitor['user_id'],\n 'watchUserId' => $visitor['user_id'],\n 'postCountUserId' => $visitor['user_id'],\n 'order' => 'like_count',\n 'orderDirection' => 'desc',\n 'limit' => $limit,\n );\n\n\n $whereConditions = $this->getModelFromCache('XenForo_Model_Thread')->prepareThreadConditions($conditions, $fetchOptions);\n $sqlClauses = $this->getModelFromCache('XenForo_Model_Thread')->prepareThreadFetchOptions($fetchOptions);\n $limitOptions = $this->getModelFromCache('XenForo_Model_Thread')->prepareLimitFetchOptions($fetchOptions);\n\n if (!empty($exclforums))\n {\n $whereConditions .= ' AND thread.node_id NOT IN (' . $this->_getDb()->quote($exclforums) . ')';\n }\n\t\t\n\t\t$whereConditions .= ' AND thread.like_count > 0';\n\n $sqlClauses['joinTables'] = str_replace('(user.user_id = thread.user_id)', '(user.user_id = thread.user_id)', $sqlClauses['joinTables']);\n\n $threads = $this->fetchAllKeyed($this->limitQueryResults('\n\t\t\t\tSELECT thread.*\n\t\t\t\t\t' . $sqlClauses['selectFields'] . '\n\t\t\t\tFROM kmk_thread AS thread\n\t\t\t\t' . $sqlClauses['joinTables'] . '\n\t\t\t\tWHERE ' . $whereConditions . '\n\t\t\t\t' . $sqlClauses['orderClause'] . '\n\t\t\t', $limitOptions['limit'], $limitOptions['offset']\n ), 'thread_id');\n\n foreach($threads AS $threadId => &$thread)\n {\n if ($this->getModelFromCache('XenForo_Model_Thread')->canViewThreadAndContainer($thread, $thread))\n {\n $thread = $this->getModelFromCache('XenForo_Model_Thread')->prepareThread($thread, $thread);\n $thread['canInlineMod'] = false;\n }\n else\n {\n unset($threads[$threadId]);\n }\n }\n\n return $threads;\n }",
"public function deleteThread()\r\n {\r\n $deleteThread = new DeleteThreadController($this->token, $this->userToken , $this->threadId, $this->userId );\r\n $req_result = $deleteThread->deleteThread();\r\n print(json_encode($req_result));\r\n }",
"public function unauthorizedUsersMayNotDeleteThreads()\n {\n $this->withExceptionHandling();\n\n $thread = create(Thread::class);\n\n $this->delete($thread->path())\n ->assertRedirect(route('login'));\n\n $this->signIn();\n\n $this->delete($thread->path())\n ->assertStatus(403);\n }",
"public function delete(){\n $db = DB::conn();\n $thread_query = \"DELETE FROM \" . self::THREAD_TABLE . \" WHERE id = ?\";\n $comment_query = \"DELETE FROM \" . Comment::COMMENT_TABLE . \" WHERE thread_id = ?\";\n $where_params = array($this->id);\n $db->query($thread_query, $where_params); \n $db->query($comment_query, $where_params); \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Arranges any iconized (minimized) MDI child windows. | function ArrangeIcons(){} | [
"function MinimizeWindow(): void { }",
"public function maximize()\n {\n $command = $this->commandFactory->createCommand(Commands::SET_WINDOW_MAXIMIZED);\n $this->executor->execute($command);\n }",
"public function getChildWidgets();",
"function initializeFilesLayout() {\n $this->loadFilesMenubar();\n // navigation stuff\n $this->layout->add($this->getSearchPanel());\n $this->layout->add($this->getTagsPanel());\n $this->layout->add($this->getFolderPanel());\n // file list\n $this->layout->add($this->getClipboardPanel());\n $this->layout->add($this->getFilesPanel());\n // dialog\n $this->layout->setParam('COLUMNWIDTH_CENTER', '50%');\n $this->layout->setParam('COLUMNWIDTH_RIGHT', '50%');\n }",
"static function positioning_the_meta_boxes(){\n\t\t// Get the globals:\n\t\tglobal $post, $wp_meta_boxes;\n\t\t\n\t\t// Output the \"advanced\" meta boxes:\n\t\tdo_meta_boxes(get_current_screen(), 'advanced', $post);\n\t\t\n\t\t// Remove the initial \"advanced\" meta boxes:\n\t\tunset($wp_meta_boxes['post']['advanced']);\n\t}",
"protected function _prepareLayout()\n {\n parent::_prepareLayout();\n\n }",
"function CentreOnScreen($direction=wxBOTH){}",
"function wxBoxSizer($orient){}",
"private function microsoftLandscape(): void {\n foreach ($this->microsoftLandscapeSizes as $size) {\n $image = $this->imageManager->make(self::BUILD_FAVICON_PATH);\n $image->resize($size[1], $size[1]);\n $base_image = $this->imageManager->canvas($size[0], $size[1]);\n $base_image->insert($image, 'center')->save($this->iconPath() . 'mstile-' . $size[0] . 'x' . $size[1] . '.png', 100, 'png');\n }\n }",
"function SetItemMinSize($index, wxSize $size, $index, $width, $height, wxSizer &$sizer, wxSize $size, wxSizer &$sizer, $width, $height, wxWindow &$window, wxSize $size, wxWindow &$window, $width, $height){}",
"protected function buildWidgetsLayout(): void\n {\n $this->addFullWidthWidget(\"capacities\")\n ->addRow(function(DashboardLayoutRow $row) {\n $row->addWidget(6, \"activeSpaceships\")\n ->addWidget(6, \"inactiveSpaceships\");\n });\n }",
"function sortguielems() {\n\t\tif ( is_array($this->_guielems_top) )\n\t\t\tksort($this->_guielems_top);\n\t\t\n\t\t// sort middle gui elements\n\t\tif ( is_array($this->_guielems_middle) ) {\n\t\t\tforeach ( array_keys($this->_guielems_middle) as $section ) {\n\t\t\t\tksort($this->_guielems_middle[$section]);\n\t\t\t}\n\t\t\tksort($this->_guielems_middle);\n\t\t}\n\t\t\t\t\n\t\t// sort bottom gui elements\n\t\tif ( is_array($this->_guielems_top) )\n\t\t\tksort($this->_guielems_top);\n\t\t\n\t\t\n\t\t$this->_sorted_guielems = true;\n\t}",
"function MoveAfterInTabOrder(wxWindow &$win){}",
"function IsAlwaysMaximized(){}",
"function wxWrapSizer($orient=wxHORIZONTAL, $flags=wxWRAPSIZER_DEFAULT_FLAGS){}",
"function updateChildrenShowHints()\r\n {\r\n //Iterates through all child controls and assigns the new showhint\r\n //to all that have ParentShowHint=true.\r\n reset($this->controls->items);\r\n while (list($k,$v) = each($this->controls->items))\r\n {\r\n if ($v->ParentShowHint)\r\n {\r\n $v->updateParentShowHint();\r\n }\r\n }\r\n }",
"public function createChildControls()\n\t{\n\t\tif ($event = $this->getBroadcastEvent()) {\n\t\t\t$this->raiseEvent($event, $this, new TEventParameter($this->getControls()));\n\t\t}\n\t}",
"function CentrePane(){}",
"function SetSizerAndFit(wxSizer &$sizer, $deleteOld=true){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getSourceColumnName() Returns the friendly name of the source column | public function getSourceColumnName()
{
if($this->sourceColumnName)
{
return $this->sourceColumnName;
}
else
{
return $this->getSourceColumn();
}
} | [
"public function getSourceColumnName()\n {\n return $this->sourceColumnName;\n }",
"protected function getColumnName($source) {\n return str_replace($this->getFieldName() . '__', '', $source);\n }",
"public function getSourceColumn()\n\t{\n\t\treturn $this->sourceColumn;\n\t}",
"public function getSourceName() {\n return $this->get(self::SOURCE_NAME);\n }",
"public function getSourceName()\n {\n return $this->sourceName;\n }",
"public function getQualifiedIdSourceColumn()\n {\n $translation = new Translation;\n\n return $translation->getTable().'.'.$translation->getIdSourceColumn();\n }",
"public function getSourceName()\n\t{\n\t\treturn ($this->sourceName);\n\t}",
"function getSourceName(&$source) {\n\t\t$_this =& ConnectionManager::getInstance();\n\t\tforeach ($_this->_dataSources as $name => $ds) {\n\t\t\tif ($ds == $source) {\n\t\t\t\treturn $name;\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t}",
"function getSourceColumnID() {\n\t\treturn $this->data_array['source_taskboard_column_id'];\n\t}",
"public function getSourceName()\n {\n $this->enforceIsLoaded();\n\n return $this->data['sourcename'];\n }",
"public function getSourceTypeName()\n {\n return $this->source_type_name;\n }",
"public function column_name();",
"public function getColumnName()\n {\n return $this->columnName;\n }",
"private function getColumn(): string\n {\n return $this->getUsernameColumnName();\n }",
"public static function getColumnName()\n {\n return static::getConfig()['column_name'];\n }",
"public function getColumnReferencingSourceTable()\n {\n return $this->columnReferencingSourceTable;\n }",
"public function getSourceTypeName();",
"final public function getLocalRefColumnName()\n {\n\t return $this->definition['refTable']->getColumnName($this->definition['local']);\n }",
"public function getNameColumn()\n {\n return $this->nameColumn;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function fvNeighbors class initializer | function fvNeighbors($inittype = '') {
list($userId, $flashRevision, $token, $sequence, $flashSessionKey, $xp, $energy) = explode(';', file_get_contents(F('params.txt')));
$this->userId = $userId;
$this->_token = $token;
$this->_sequence = $sequence;
$this->flashRevision = $flashRevision;
$this->_flashSessionKey = $flashSessionKey;
$this->xp = $xp;
$this->energy = $energy;
$this->error = '';
$this->haveWorld = false;
$this->fndebug = false;
if (!is_numeric($this->userId)) {
$this->error = "Farmville Bot Not Initialized/User Unknown";
return;
}
//Open Databases
////
$this->_DB = new SQLiteDatabase(fvNeighbors_Path . PluginF(fvNeighbors_Main));
$this->_DB2 = new SQLiteDatabase(fvNeighbors_Path . PluginF(fvNeighbors_name));
if (!$this->_DB || !$this->_DB2) {
$this->error = 'fvNeighbors - Database Error';
return;
}
$this->CheckDB(); //Database doesn't exist, create
////
//Get Settings
$this->settings = $this->LoadSettings();
if ($this->settings !== false && (!isset($this->settings['version']) || $this->settings['version'] != fvNeighbors_version)) {
if ($this->TableExists('neighborsn')) $q = $this->_DB->query("DROP TABLE neighborsn;");
$this->CheckDB(); //Database doesn't exist, create
$this->settings['version'] = fvNeighbors_version;
$this->SaveSettings();
}
if ($this->settings === false) {
$this->CheckDB(); //Database doesn't exist, create
$this->SaveSettings(); //Insert initial settings
}
if ($inittype == 'formload') return;
//Load the world from Z*
$this->RefreshWorld();
if ($this->haveWorld === true) {
$this->SaveSettings(); //Update the settings
$this->ProcessEverything(); //Update the World
}
} | [
"public function neighbours();",
"function fvNeighbors($inittype = '')\n\t{\n\t\tlist($this->level, $this->gold, $cash, $this->wsizeX, $this->wsizeY, $firstname, $locale, $tileset, $wither, $this->xp, $this->energy) = explode(';', fBGetDataStore('playerinfo'));\t\t$this->userId = $_SESSION['userId'];\n\t\t$this->flashRevision = $_SESSION['flashRevision'];\n\t\t$this->error = '';\n\t\t$this->haveWorld = false;\n\t\t$this->fndebug = false;\n\n\t\tif(!is_numeric($this->userId))\n\t\t{\n\t\t\t$this->error = \"Farmville Bot Not Initialized/User Unknown\";\n\t\t\treturn;\n\t\t}\n\n\t\t//Open Databases\n\t\t$this->_fnNeighborsDBM = new SQLiteDatabase(fvNeighbors_Path . PluginF(fvNeighbors_Main));\n\t\tif(!$this->_fnNeighborsDBM)\n\t\t{\n\t\t\t$this->error = 'fvNeighbors - Database Error';\n\t\t\treturn;\n\t\t}\n\t\t$this->_fnNeighborsDBM->queryExec('PRAGMA cache_size=20000');\n\t\t$this->_fnNeighborsDBM->queryExec('PRAGMA synchronous=OFF');\n\t\t$this->_fnNeighborsDBM->queryExec('PRAGMA count_changes=OFF');\n\t\t$this->_fnNeighborsDBM->queryExec('PRAGMA journal_mode=MEMORY');\n\t\t$this->_fnNeighborsDBM->queryExec('PRAGMA temp_store=MEMORY');\n\t\t$this->_fnNeighbors_checkDB();\n\t\t//Get Settings\n\t\t$this->settings = $this->fnGetSettings();\n\t\tif($inittype == 'formload')\n\t\t{\n\t\t\tif(empty($this->settings))\n\t\t\t{\n\t\t\t\t$this->error = 'Please allow fvNeighbors to run a cycle';\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif($this->settings !== false && (!isset($this->settings['version']) || $this->settings['version'] != fvNeighbors_version))\n\t\t{\n\t\t\t$fbSQL = \"DROP TABLE neighborsn;\";\n\t\t\t$q = $this->_fnNeighborsDBM->query($fbSQL);\n\t\t\t$this->_fnNeighbors_checkDB();//Database doesn't exist, create\n\t\t\t/*$this->_fnUpdateSettings();//Insert initial settings\n\t\t\tAddLog2('fvNeighbors upgrade finished');*/\n\t\t}\n\t\t//Load the world from Z*\n\t\t$this->_refreshWorld();\n\t\tif($this->haveWorld === true)\n\t\t{\n\t\t\tif($this->settings === false)\n\t\t\t{\n\t\t\t\t$this->_fnNeighbors_checkDB();//Database doesn't exist, create\n\t\t\t\t$this->_fnUpdateSettings();//Insert initial settings\n\t\t\t\t$this->error = 'Please allow fvNeighbors to run a cycle to update all settings';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$this->_fnUpdateSettings();//Update the settings\n\t\t\t$this->_fnUpdateWorldDB();//Update the World\n\t\t}\n\t}",
"private function calculateNeighbors(){\r\n\t\t\tglobal $object_structure_primary_id;\r\n\t\t\tglobal $object_structure_name;\r\n\t\t\tglobal $attribute_structure_name;\r\n\t\t\tglobal $relationship_structure_reference_fk;\r\n\t\t\t$node_id = $this->idDatabase;\r\n\t\t\t//echo $this->getNodeName().\"<br />\";\r\n\t\t\t$return_up \t\t= null;\r\n\t\t\t$return_down \t= null;\r\n\t\t\tif($this->flag_up){\r\n\t\t\t\t$results_up = $this->getUpNeighbors();\r\n\t\t\t\tif($results_up != null){\r\n\t\t\t\t\t$return_up = $this->structureUpNeighbors();\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($this->flag_down){\r\n\t\t\t\t$results_down = $this->getDownNeighbors();\r\n\t\t\t\tif($results_down != null){\r\n\t\t\t\t\t$return_down = $this->structureDownNeighbors();\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->constructNeighborArray($return_up,$return_down);\t\r\n\t\t}",
"protected function populate(): Floydwarshall\n {\n for ($i = 0; $i < $this->nodeCount; $i++) {\n for ($j = 0; $j < $this->nodeCount; $j++) {\n if ($i == $j) {\n $this->dist[$i][$j] = 0;\n } elseif (isset($this->weights[$i][$j]) && $this->weights[$i][$j] > 0) {\n $this->dist[$i][$j] = $this->weights[$i][$j];\n } else {\n $this->dist[$i][$j] = self::INFINITE;\n }\n $this->pred[$i][$j] = $i;\n }\n }\n return $this;\n }",
"public function getNeighbors()\n {\n return $this->neighbors;\n }",
"public function init(){\n\t\tfor($x=0; $x<=$this->_intDim + 1; $x++){\n\t\t\tfor($y=0; $y<=$this->_intDim + 1; $y++){\n\t\t\t\t$this->_arrVisited[$x][$y] = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// initialize border cells as already visited\n\t\tfor($x=0; $x<=$this->_intDim + 1; $x++){\n\t\t\t$this->_arrVisited[$x][0] = true;\n\t\t\t$this->_arrVisited[$x][$this->_intDim + 1] = true;\n\t\t}\n\t\tfor($y=0; $y<=$this->_intDim + 1; $y++){\n\t\t\t$this->_arrVisited[0][$y] = true;\n\t\t\t$this->_arrVisited[$this->_intDim + 1][$y] = true;\n\t\t}\n\t\t\n\t\t// initialize all walls as present\n\t\tfor($x=0; $x<=$this->_intDim + 1; $x++){\n\t\t\tfor($y=0; $y<=$this->_intDim + 1; $y++){\n\t\t\t\t$this->_arrNorth[$x][$y] = true;\n\t\t\t\t$this->_arrEast[$x][$y] = true;\n\t\t\t\t$this->_arrSouth[$x][$y] = true;\n\t\t\t\t$this->_arrWest[$x][$y] = true;\n\t\t\t}\n\t\t}\n\t}",
"public function __construct($id, $estimated, $neighbors)\n\t\t{\n\t\t\t$this->id = $id;\n\t\t\t$this->estimated = $estimated;\n\t\t\t$this->neighbors = $neighbors;\n\t\t}",
"public function __construct() {\n $this->finalPoint = array_fill(1, 3, 0); //syntax array_fill(index,number,value); \n }",
"public function __construct() {\n $this->_len = count($this->_g);\n // finds the vertices with no predecessors\n $sum = 0;\n for ($i = 0; $i < $this->_len; $i++) {\n for ($j = 0; $j < $this->_len; $j++) {\n $sum += $this->_g[$j][$i];\n }\n\n if (!$sum) {\n // append to list\n array_push($this->_list, $i);\n }\n $sum = 0;\n }\n }",
"public function getInstanceNeighbors($inst)\r\n {\r\n $this->checkInstanceId($inst);\r\n return $this->api->makeAPICall('GET', $this->api::INSTANCES_URL . \"/\" . $inst . \"/neighbors\");\r\n }",
"public function epsilonNeighborhood(){\n\t\tforeach($this->_optics->getUnprocessedPoints() as $q){\n\t\t\tif($this->index === $q->index){\n\t\t\t\tcontinue; //You are not your own neighbor\n\t\t\t}\n\t\t\tif(($dist = $this->distanceTo($q)) <= $this->_optics->epsilonMaxRadius){\n\t\t\t\t$this->addNeighbor($q, $dist);\n\t\t\t}\n\t\t}\n\t\t//Sort neighbors by distance\n\t\tusort($this->_epsilonNeighbors, array('OpticsPoint', 'uSortPoint'));\n\t}",
"function GetAllNeighbors(){\n\t\t\treturn $this->neighborDAL->GetAllNeighborsDB();\n\t\t}",
"function init_features() {\n\t\tforeach ( array_filter( $this->_features, 'is_callable' ) as $name => $feature )\n\t\t\t$this->_features[$name] = call_user_func( $feature );\n\t}",
"public function setNeighbours($value)\n {\n $this->neighbours = $value;\n }",
"function __construct($dimension)\n {\n $this->x = $dimension;\n $this->y = $dimension;\n $this->z = $dimension;\n $this->logOperations = array();\n\n for ($x = 1; $x <= $this->x; $x ++) {\n for ($y = 1; $y <= $this->y; $y ++) {\n for ($z = 1; $z <= $this->z; $z ++) {\n $this->matrix[$x][$y][$z] = 0;\n }\n }\n }\n }",
"public function __construct(){\n $this->a = null;\n $this->b = null;\n $this->overlapV = new Vector();\n $this->overlapN = new Vector();\n $this->clear();\n }",
"public function __construct(){\r\n\t\t\t$this->recommenders = array();\t\r\n\t\t\t$this->weights = array();\t\r\n\t\t}",
"private function ProcessEverything() {\n if ($this->TableExists(\"neighbors\")) {\n //Insert Missing Neighbors\n foreach($this->neighbors as $neigh) {\n @$this->_DB->queryExec(\"INSERT OR IGNORE INTO neighbors(fbid) VALUES('$neigh')\");\n }\n //Delete Neighbors\n $q = $this->_DB->query(\"SELECT fbid FROM neighbors WHERE _delete=1\")->fetchAll(SQLITE_ASSOC);\n foreach($q as $result) {\n $this->RemoveNeighbor($result['fbid']);\n }\n////\n $this->MyFvFunction();\n////\n\n }\n //Cancel Pending Neighbor Requests\n if (@$this->settings['delpending'] == 1) {\n $cnt = 0;\n AddLog2('Pending Count: ' . count($this->pneighbors));\n foreach($this->pneighbors as $pendn) {\n $this->CancelNeighbor($pendn);\n $cnt++;\n if ($cnt == $this->settings['helpcycle']) break;\n }\n }\n //Clear Neighbor Actions\n if (@$this->settings['accepthelp'] == 1) $this->DoNeighborHelp();\n $iguser = load_array('ignores.txt');\n //Update Neighbors\n if ($this->TableExists(\"neighbors\")) {\n $cfgtime = time() - (3600 * $this->settings['helptime']);\n $fvSQL = \"SELECT * FROM neighbors WHERE timestamp <= '$cfgtime' LIMIT \" . $this->settings['helpcycle'];\n $results = $this->_DB->query($fvSQL)->fetchAll(SQLITE_ASSOC);\n AddLog2(sprintf('Updating %d Neighbors', count($results)));\n foreach($results as $result) {\n if (isset($iguser[$result['fbid']])) continue;\n $this->UpdateNeighbor($result, 'neighbor');\n }\n AddLog2('Finished Updating Neighbors');\n }\n //Update Neighbor Neighbors\n if ($this->settings['vneighborsn'] == 1 && $this->TableExists(\"neighborsn\")) {\n $cfgtime = time() - (3600 * $this->settings['helptime']);\n $FifteenDays = time() - (3600 * 24 * 15);\n $fvSQL = \"SELECT * FROM neighborsn WHERE timestamp <= '$cfgtime' AND (lastseen >= '$FifteenDays' OR lastseen = 0) LIMIT \" . $this->settings['helpcycle'];\n @$results = $this->_DB->query($fvSQL)->fetchAll(SQLITE_ASSOC);\n AddLog2(sprintf('Updating %d Neighbors Neighbors', count($results)));\n foreach($results as $result) {\n if (isset($iguser[$result['fbid']])) continue;\n $this->UpdateNeighbor($result, 'NN');\n }\n AddLog2('Finished Updating Neighbors Neighbors');\n }\n }",
"public function __construct() {\n if(!plugin_load('helper', 'geophp')) {\n $message = 'helper_plugin_spatialhelper_index::spatialhelper_index: required geophp plugin is not available.';\n msg($message, -1);\n }\n\n global $conf;\n $this->idx_dir = $conf ['indexdir'];\n // test if there is a spatialindex, if not build one for the wiki\n if(!@file_exists($this->idx_dir . '/spatial.idx')) {\n // creates and stores the index\n $this->generateSpatialIndex();\n } else {\n $this->spatial_idx = unserialize(\n io_readFile($this->idx_dir . '/spatial.idx', false),\n ['allowed_classes' => false]\n );\n dbglog($this->spatial_idx, 'done loading spatial index');\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserisce un nuovo paziente nel database con i dati contenuti dell'array associativo passato alla funzione | public function insertNewPatient($array){
$query1="INSERT INTO `clinica`.`pazienti`(`Nome`, `Cognome`, `Sesso`, `DataNascita`, `Codice Fiscale`)";
$query2="VALUES ('".$array['name']."','".$array['surname']."','".$array['gender']."','".$array['dateBirth']."','".$array['CF']."')";
$query=$query1." ".$query2;
$this->query($query);
} | [
"function insert(){\n // $sql \"INSERT INTO grupos ('desc_grupo) VALUES ('desc_grupo')\";\n //$sql=\"INSERT INTO grupos (id_grupo,dec_grupos) VALUES ('$id_grupo[0]','$desc_grupo[0]')\";\n $sql=\"INSERT INTO grupos (id_grupo,desc_grupo) VALUES ('.$id_grupo.','.$desc_grupo.')\";\n $this->conexion->QuerySimple($sql);\n\n }",
"public function insert($peticiones_analisis);",
"public function insert($puesto);",
"public function save()\n\t{\n\t\t$db = Database::getInstance();\n\t\t$sql = \"INSERT INTO pedido(CodUsu, fecPedido, numeroPedido) values (:idu, :fec, :tok)\";\n\n\t\t$data = [\n\t\t\t\":idu\" => \"{$this->CodUsu}\",\n\t\t\t\":fec\" => \"{$this->fecPedido}\",\n\t\t\t\":tok\" => \"{$this->numeroPedido}\"\n\t\t];\n\n\t\techo \"<pre>\" . print_r($data, true) . \"</pre>\";\n\t\t//die() ;\n\n\t\t$db->bindAll($sql, $data);\n\t}",
"public function _insertar($objeto);",
"public function insert($convenio);",
"public function insert($uso_equipos);",
"abstract public function sqlInsertar();",
"public function insert($tipo_proyecto);",
"function addCapteurInDb($db,$typeTrames, $type) {\n $numberType = 0;\n if ($type == 'temperature') {\n $numberType = 3;\n }\n else if ($type == 'humidite') {\n $numberType = 4;\n }\n for ($number = 0; $number < count($typeTrames); $number++ ) {\n $tableau = array(\n 'ID_maison'=> $_SESSION['IDmaison'],\n 'type'=> $type,\n 'number_capteur'=>$typeTrames[$number]['number_capteur'],\n\n );\n if (!alreadyInCapteurs($db,$tableau)) {\n $tableau = array('typeDeRequete'=>'insert','table'=>'capteurs','param'=>array(\n 'type'=>$type,\n 'number_capteur'=>$typeTrames[$number]['number_capteur'],\n 'ID_maison'=>$_SESSION['IDmaison'],\n 'serial_key'=>$numberType.$typeTrames[$number]['number_capteur']\n ));\n requeteDansTable($db,$tableau);\n }\n }\n}",
"function aggiungiPratica($data,$stato,$codice_cliente,$testo)\n {\n //setta la variabile contenente il database\n $database=$this->database;\n // chiamata alla funzione di connessione\n $database->connetti();\n //nome della tabella\n $t = \"pratica\"; \n //valori da inserire\n $v = array (\"$stato\",\"$data\",\"$codice_cliente\",\"$testo\"); \n //campi da popolare\n $r = \"stato, data,codice_cliente, testo\"; \n // chiamata alla funzione per l’inserimento dei dati\n $database->inserisci($t,$v,$r); \n // chiusura della connessione a MySQL\n $database->disconnetti(); \n }",
"public function insert($otros_votos);",
"public function insertArray($tabla,$data_array) {\n\t\t$this->db->insert($tabla, $data_array);\n\t}",
"public function addObjetivo($datas)\n {\n foreach($datas as $key=>$value)\n {\n $data = array(\n filter_var($value['descripcion'], FILTER_SANITIZE_STRING), $value['resultado'], $value['unidad'],\n $value['relacion'], $value['ponderacion'], $value['fecha_entrega'],\n $value['balanced'], $value['objetivo'],$value['id_empleado'], $value['referencia'], filter_var($value['comentario'], FILTER_SANITIZE_STRING),0);\n }\n\n $place_holders = implode(',', array_fill(0, count($data), '?')); //Marcador de posicion\n \n $conn = $this->conn->conexion();\n \n $sql = \"INSERT INTO objetivo(descripcion, resultado_esperado,\n id_unidad, id_relacion, ponderacion, fecha_entrega, id_balance,\n id_alineacion, id_empleado, valor_referencia, comentario_supervisor, evaluado)\n VALUES($place_holders)\";\n $stmt = $conn->prepare($sql);\n return $stmt->execute($data);\n\n }",
"public function insert($data){\n\t\t$contenido_seccion = $data['contenido_seccion'];\n\t\t$contenido_tipo = $data['contenido_tipo'];\n\t\t$contenido_padre = $data['contenido_padre'];\n\t\t$contenido_columna = $data['contenido_columna'];\n\t\t$contenido_columna_espacios = $data['contenido_columna_espacios'];\n\t\t$contenido_columna_alineacion = $data['contenido_columna_alineacion'];\n\t\t$contenido_disenio = $data['contenido_disenio'];\n\t\t$contenido_borde = $data['contenido_borde'];\n\t\t$contenido_estado = $data['contenido_estado'];\n\t\t$contenido_fecha = $data['contenido_fecha'];\n\t\t$contenido_titulo = $data['contenido_titulo'];\n\t\t$contenido_titulo_ver = $data['contenido_titulo_ver'];\n\t\t$contenido_imagen = $data['contenido_imagen'];\n\t\t$contenido_fondo_imagen = $data['contenido_fondo_imagen'];\n\t\t$contenido_fondo_imagen_tipo = $data['contenido_fondo_imagen_tipo'];\n\t\t$contenido_fondo_color = $data['contenido_fondo_color'];\n\t\t$contenido_introduccion = $data['contenido_introduccion'];\n\t\t$contenido_descripcion = $data['contenido_descripcion'];\n\t\t$contenido_enlace = $data['contenido_enlace'];\n\t\t$contenido_enlace_abrir = $data['contenido_enlace_abrir'];\n\t\t$contenido_vermas = $data['contenido_vermas'];\n\t\t$query = \"INSERT INTO contenido( contenido_seccion, contenido_tipo, contenido_padre, contenido_columna, contenido_columna_espacios, contenido_disenio, contenido_borde, contenido_estado, contenido_fecha, contenido_titulo, contenido_titulo_ver, contenido_imagen, contenido_fondo_imagen, contenido_fondo_imagen_tipo, contenido_fondo_color, contenido_introduccion, contenido_descripcion, contenido_enlace, contenido_vermas,contenido_columna_alineacion,contenido_enlace_abrir) VALUES ( '$contenido_seccion', '$contenido_tipo', '$contenido_padre', '$contenido_columna', '$contenido_columna_espacios', '$contenido_disenio', '$contenido_borde', '$contenido_estado', '$contenido_fecha', '$contenido_titulo', '$contenido_titulo_ver', '$contenido_imagen', '$contenido_fondo_imagen', '$contenido_fondo_imagen_tipo', '$contenido_fondo_color', '$contenido_introduccion', '$contenido_descripcion', '$contenido_enlace', '$contenido_vermas','$contenido_columna_alineacion','$contenido_enlace_abrir')\";\n\t\t$res = $this->_conn->query($query);\n return mysqli_insert_id($this->_conn->getConnection());\n\t}",
"public function insert(){\n $sql = \"insert into discipina (codigo,nome,carga,ementa,semestre,id_curso) values (:codigo,:nome,:carga,:ementa,:semestre,:id_curso)\";\n\n $stmt = $this->conexao->prepare($sql);\n\n $stmt->bindValue(':codigo',$this->codigo);\n $stmt->bindValue(':nome',$this->nome);\n $stmt->bindValue(':carga',$this->carga);\n $stmt->bindValue(':ementa',$this->ementa);\n $stmt->bindValue(':semestre',$this->semestre);\n $stmt->bindValue(':id_curso',$this->idCurso);\n\n try{\n $stmt->execute();\n } catch(PDOException $e){\n throw $e;\n }\n }",
"function saveArray($tablename, $data)\r\n{\r\n\r\n $fields=array_keys($data);\r\n $values=array_values($data);\r\n\r\n $fieldlist = implode(',',$fields);\r\n $qs=str_repeat(\"?,\",count($fields)-1);\r\n $sql='insert into '.$this->table_prefix . $tablename.\" ($fieldlist) values(${qs}?)\";\r\n\r\n\tdebug(\"[DEBUG] Insert new array '$sql'\",4);\r\n\r\n $this->executeQueryCache($sql,$values);\r\n\r\n return $this->handler->lastInsertId();\r\n}",
"function testeInsercaoPorAtributo() {\n $oPaciente = new lPaciente();\n $oPaciente->createTablePaciente();\n\n $oPaciente->nome = \"Teste Insercao por Atributo\";\n $oPaciente->senha = \"7777777\";\n $oPaciente->cpf = \"777.777.777-77\";\n $oPaciente->planoDeSaude = \"Unimed\";\n $oPaciente->genero = \"F\";\n $oPaciente->tipoSanguineo = \"A-\";\n $oPaciente->dtNascimento = \"2999-12-31\";\n $oPaciente->endereco = \"Rua Teste Insercao por Atributo\";\n $oPaciente->telefone = \"777777777\";\n $oPaciente->email = \"moc.liame@email.com\";\n\n print_r($oPaciente);\n print_r($oPaciente->insertPaciente());\n print_r($oPaciente);\n}",
"public function guardarDocenteBD($data){\n $plataforma = $data['plataforma'];\n $datos_materias;\n foreach($data['materias'] as $materia){\n $id_course = $materia['id_course'];\n $datos;\n $URL = \"https://\".$plataforma.\".seuatvirtual.mx/API/Docente/user_list_course.php?id=\".$id_course;\n $json = file_get_contents($URL);\n $request = json_decode($json, TRUE);\n if($request[0]['category_course'] != NULL){\n $datos['id_user'] = $request[0]['id_user'];\n $datos['username'] = $request[0]['teacher_username'];\n $datos['nombre'] = $request[0]['teacher_firstname'];\n $datos['apellidos'] = $request[0]['teacher_lastname'];\n $id_user = $datos['id_user'];\n $username = $datos['username'];\n $nombre = $datos['nombre'];\n $apellidos = $datos['apellidos']; \n $datos_materias[$id_course] = $datos; \n /*Guardar Datos del Docente en la BD */\n \n $sql_docente= \"INSERT INTO t_docente (id_usuario_plataforma,usuario_docente,nombre_docente,apellidos_docente) SELECT * FROM (SELECT $id_user,'$username','$nombre','$apellidos')\n AS doc WHERE NOT EXISTS (SELECT usuario_docente FROM t_docente WHERE usuario_docente = '$username') LIMIT 1\";\n $request_docente = $this->insert($sql_docente,array($id_user,$username,$nombre,$apellidos)); \n } \n }\n return $datos_materias;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve plugin data, given the plugin name. Loops through the registered plugins looking for $name. If it finds it, it returns the $data from that plugin. Otherwise, returns false. | protected function _get_plugin_data_from_name( $name, $data = 'slug' )
{
foreach ($this->plugins as $plugin => $values) {
if ( $name == $values['name'] && isset( $values[$data] ) )
return $values[$data];
}
return false;
} | [
"function _find_plugin($name)\n {\n // validate the plugin name\n if (!$name)\n {\n return FALSE;\n }\n $key = strtolower($name);\n\n // plugins implement Minim_Plugin interface, so search for that\n $pat = '/class\\s+([^\\s]+)\\s+implements\\s+Minim_Plugin/m';\n\n // list files already checked, so we can skip them\n $already_checked = array();\n foreach ($this->_plugins as $plugin)\n {\n // don't care about duplicates\n $already_checked[] = $plugin['file'];\n }\n\n foreach ($this->plugin_paths as $path)\n {\n $dir = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($path));\n foreach ($dir as $file)\n {\n $filename = $file->getPathname();\n if (substr($filename, -4) == '.php'\n and basename($filename, '.php') == $key\n // don't waste time opening files we already checked\n and !in_array($filename, $already_checked)\n and preg_match($pat, file_get_contents($filename), $m))\n {\n // store details of the plugin as we will only instantiate\n // on demand\n $this->_plugins[$key] = array(\n 'file' => $filename,\n 'class' => $m[1]\n );\n\n // don't waste time checking any more files\n return TRUE;\n }\n }\n }\n return FALSE;\n }",
"public function find(string $name): mixed\n {\n return $this->plugins->where('name', $name)->firstOrFail();\n }",
"protected function get_plugin_data() {\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\treturn get_plugin_data( $this->get_file(), false, false );\n\t}",
"function plugin_find($plugin_name,$return_key=false){\n\t$plugin_data = get_plugins();\n\t\t\n\t$plugin_names_files = array();\n\tarray_walk(get_plugins(), create_function('$val, $key, $obj', '$obj[$val[\"Name\"]] = $key;'), &$plugin_names_files);\n\t\n\t$plugin_names = array_keys($plugin_names_files);\n\n\t$find_result = array_search_partial_needle($plugin_name,array_map('strtolower',$plugin_names),0,true);\t\t\n\t\n\tif(is_bool($find_result)){\n\t\treturn false;\n\t}else{\n\t\tif($return_key){\n\t\t\treturn $plugin_names_files[$plugin_names[$find_result]];\n\t\t}else{\n\t\t\treturn $plugin_data[$plugin_names_files[$plugin_names[$find_result]]];\n\t\t}\n\t}\n}",
"public function getData($name)\n {\n if (substr($name, 0, 5) === 'data-') {\n $name = substr($name, 5);\n }\n return isset($this->data[$name]) ? $this->data[$name] : null;\n }",
"public function getResponsePlugin($sName)\r\n\t{\r\n\t\t$aKeys = array_keys($this->aResponsePlugins);\r\n\t\tsort($aKeys);\r\n\t\tforeach ($aKeys as $sKey)\r\n\t\t\tif ( $this->aResponsePlugins[$sKey] instanceof $sName )\r\n\t\t\t\treturn $this->aResponsePlugins[$sKey];\r\n\t\t$bFailure = false;\r\n\t\treturn $bFailure;\r\n\t}",
"protected function findPluginData() {\n\t\tif ( ! empty( $this->pluginData ) ) {\n\t\t\tthrow new RuntimeException( 'Plugin data already set. You cannot set this data twice.' );\n\t\t}\n\n\t\t$pluginData = ( new PluginFinder( $this->files ) )->find();\n\n\t\tif ( $pluginData instanceof NullPlugin ) {\n\t\t\tthrow new RuntimeException( 'No plugin data could be found. Are you parsing the correct directory?' );\n\t\t}\n\n\t\treturn $pluginData;\n\t}",
"function pluginExists($pluginname){\n\t\tif(isset($this->plugindata[ $pluginname ])){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function plugins( $name = false ){\n\t\tif( $name ){\n\t\t\tif( isset( $this->plugins{ $name } ) )\n\t\t\t\treturn $this->plugins{ $name };\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->plugins;\n\t}",
"public static function checkPlugin($name) {\n\t \tif (isset(self::$plugins[$name])) {\n\t \t\treturn true;\n\t\t}\n\t\treturn false;\n\t }",
"public function getData($name);",
"public function getConfig($name)\n {\n $item = $this->Storage()->plugins->$name;\n if (!isset($item->config)) {\n $item->config = [];\n }\n\n return $item->config;\n }",
"function vikinger_plugin_installed_get_data($plugin) {\r\n $required_plugins = vikinger_plugin_get_required_plugins();\r\n $installed_plugins = get_plugins();\r\n\r\n $plugin_slug = $required_plugins[$plugin]['slug'];\r\n\r\n $plugin_data = $installed_plugins[$plugin_slug];\r\n\r\n return $plugin_data;\r\n}",
"private function get_data_plugin( $slug ) {\n\t\tif ( empty( $slug ) ) {//Make sure $slug not empty.\n\t\t\treturn false;\n\t\t}\n\n\t\t$plugins = $this->get_data_plugins();\n\n\t\tforeach ( $plugins as $index => $plugin ) {\n\t\t\t$slug_plugin = isset( $plugin->slug ) ? $plugin->slug : false;\n\n\t\t\tif ( $slug_plugin === $slug ) {\n\t\t\t\t$data = (array) $plugin;\n\n\t\t\t\t$data = wp_parse_args( $data, array(\n\t\t\t\t\t'homepage' => '',\n\t\t\t\t\t'author' => '',\n\t\t\t\t\t'download_link' => false,\n\t\t\t\t\t'version' => false,\n\t\t\t\t\t'short_description' => '',\n\t\t\t\t\t'banners' => '',\n\t\t\t\t\t'tested' => false,\n\t\t\t\t) );\n\n\t\t\t\treturn $data;\n\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public static function find($name = '')\n {\n foreach (Grav::instance()['plugins'] as $plugin) {\n if ($plugin->name === $name) {\n return $plugin;\n }\n }\n\n return null;\n }",
"static function fetchPlugin( $pluginName )\n {\n $pluginSlug = strtolower( str_replace( \" \", \"_\", $pluginName ) );\n \n if( isset( self::$instances[ $pluginSlug ] ) )\n {\n return self::$instances[ $pluginSlug ];\n }\n \n return false;\n }",
"protected function loadPlugin($name)\n {\n $pluginDir = dirname(__FILE__) . '/Plugins/';\n\n require_once $pluginDir . 'Abstract.php';\n \n if (file_exists($file = $pluginDir . $name . '.php')) {\n require_once $file;\n } else {\n foreach (glob($pluginDir . '*.php') as $file) {\n require_once $file;\n }\n }\n }",
"public function plugin($sName)\n {\n return $this->getPluginManager()->getResponsePlugin($sName);\n }",
"protected function get_plugin_data() {\n\t\t_deprecated_function( __METHOD__, '3.2', 'AC\\Plugin::get_data()' );\n\n\t\treturn $this->get_data();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a random set of gallery images. | public function randomGalleryImages(int $page = 0): array
{
return $this->requestGet("gallery/random/random/{$page}");
} | [
"function get_random_images($number = 1, $gallery_id = 0)\n {\n $mapper = C_Image_Mapper::get_instance();\n $mapper->select();\n $mapper->where_and(array('exclude != 1'));\n if ($gallery_id !== 0)\n $mapper->where_and(array('galleryid = %d', $gallery_id));\n $mapper->order_by('rand()');\n $mapper->limit($number, 0);\n foreach ($mapper->run_query() as $dbimage) {\n $image = new C_Image_Wrapper($dbimage);\n $retval[] = $image;\n }\n return $retval;\n }",
"function randomPhotos() {\r\n $photos[0] = 'photo1';\r\n $photos[1] = 'photo2';\r\n $photos[2] = 'photo3';\r\n $photos[3] = 'photo4';\r\n $photos[4] = 'photo5';\r\n\r\n echo '<br>';\r\n $i = rand(0,4);\r\n $selectedImage = 'images/' .$photos[$i]. '.jpg';\r\n\r\n echo '<img class=\"index_photos\" src=\"' .$selectedImage. ' \" alt=\"' .$photos[$i]. '\">';\r\n}",
"public function gallery()\n {\n $this->_build_image_array();\n \n return $this->images;\n }",
"public function getRandom(): array\n {\n return $this->get('photos/random');\n }",
"public function getRandomImg()\n {\n $data_img = UserGallery::orderBy('created_at', 'desc')->limit(5000)->get(['id'])->toArray();\n $random_img_ids = $data_img?array_rand($data_img,(count($data_img)>4?4:count($data_img))):[];\n $random_img = [];\n foreach ($random_img_ids as $item){\n $data = $data_img[$item]['id'];\n $random_img[] = $data;\n }\n $random_img = UserGallery::whereIn('id', $random_img)->with('file')->get()->toArray();\n\n return $random_img;\n }",
"public function getRandomImages($count=4) {\n\t\treturn $this->getImagesFromGET(\"https://dog.ceo/api/breeds/image/random/\".$count);\n\t}",
"function get_random_thumbnails(){\n\n\t$list_params = [\n\t\t'path' => PHOTOS_FOLDER,\n\t\t'recursive' => true,\n\t\t'include_media_info' => false,\n\t\t'include_deleted' => false,\n\t\t'include_has_explicit_shared_members' => false,\n\t];\n\n\t$photos = array();\n\n\t$folders = get_from_dropbox( $list_params, '/files/list_folder', DROPBOX_TOKEN );\n\n\tif(!empty($folders))\n\t{\n\n\t\tforeach($folders->entries as $item)\n\t\t{\n\n\t\t\t$file_as_array = (array) $item;\n\n\t\t\tif($file_as_array['.tag'] === 'file' && endsWith($file_as_array['path_lower'], '.jpg'))\n\t\t\t{\n\t\t\t\tarray_push($photos, $file_as_array['id']);\n\t\t\t}\n\n\t\t}\n\n\t\t$photos_count = count($photos);\n\t\tif($photos_count !== 0)\n\t\t{\n\n\t\t\t$rand_array_key = array_rand($photos, NUMBER_OF_PHOTOS);\n\t\t\t$new_photos = random_photo_select($photos, $rand_array_key);\n\n\t\t\t// Create file for each random photo\n\t\t\t$random_photos = array();\n\t\t\tforeach ($new_photos as $new_photo_id)\n\t\t\t{\n\t\t\t\t$fileName = 'dist/images/' . md5($new_photo_id) . '.jpeg'; // Hash filename to prevent caching\n\n\t\t\t\t$url = download_thumbnail_dropbox($new_photo_id, DROPBOX_TOKEN);\n\n\t\t\t\t// Write final string to file\n\t\t\t\tfile_put_contents($fileName, $url);\n\n\t\t\t\tarray_push($random_photos, $fileName);\n\t\t\t}\n\n\t\t\t// Return all the photo urls\n\t\t\treturn $random_photos;\n\n\t\t}\n\t}\n\n\treturn false;\n}",
"function random_pic($imagesDir){\r\n\r\n$images = glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);\r\n\r\nreturn $images[array_rand($images)];\r\n\r\n}",
"function _get_rand5()\n\t{\n\t\t// ------------------------------------------------\n\t\t// Show 5 random images?\n\t\t// ------------------------------------------------\n\t\tif( $this->ipsclass->vars['gallery_random_images'] )\n\t\t{\n\t\t\tif( $this->ipsclass->vars['gallery_stats_where'] == 'both' || $this->ipsclass->vars['gallery_stats_where'] == 'cat' )\n\t\t\t{\n\t\t\t\t$allow_cats = ( $allow_cats ) ? $allow_cats : $this->glib->get_allowed_cats( 1, $this->category->data );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$show_cats = 'no';\n\t\t\t}\n\n\t\t\tif( $this->ipsclass->vars['gallery_stats_where'] == 'both' || $this->ipsclass->vars['gallery_stats_where'] == 'album' )\n\t\t\t{\n\t\t\t\t$allow_albums = ( $allow_albums ) ? $allow_albums : $this->glib->get_allowed_albums();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$show_albums = 'no';\n\t\t\t}\n\n\t\t\tif( ! $this->img_list )\n\t\t\t{\n\t\t\t\trequire( $this->ipsclass->gallery_root . 'lib/imagelisting.php' );\n\t\t\t\t$this->img_list = new ImageListing();\n $this->img_list->ipsclass =& $this->ipsclass;\n $this->img_list->glib =& $this->glib;\n $this->img_list->init();\n\t\t\t}\n\t\t\t\n\t\t\t$total = $this->ipsclass->vars['gallery_idx_num_row'] * $this->ipsclass->vars['gallery_idx_num_col'];\t\t\t\n\n\t\t\t$this->img_list->get_listing_data( array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'st' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'show' => $total,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'approve' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'sort_key' => 'RAND()',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'album' => $show_albums,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category' => $show_cats,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'allow_cats' => $allow_cats,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'allow_albums' => $allow_albums,\n\t\t\t\t\t\t\t\t\t\t\t) );\n\n\t\t\t$rand5 .= $this->html->index_list_top( str_replace( \"<#NUM#>\", $total, $this->ipsclass->lang['random5'] ) );\n\t\t\t$rand5 .= $this->img_list->get_html_listing( array( 'imgs_per_col' => $this->ipsclass->vars['gallery_idx_num_col'],\n\t\t\t 'imgs_per_row' => $this->ipsclass->vars['gallery_idx_num_row'] ) );\n\t\t\t$rand5 .= $this->html->index_list_end();\n\n\t\t\treturn $rand5;\n\t\t}\n\t}",
"function fetchGalleryImages() {\r\n $grid = new EventGrid(\"past\");\r\n $galleryArray = $grid -> get_gallery_array();\r\n return $galleryArray;\r\n }",
"abstract public function getRandomPhoto();",
"function getRandomImages($url = \"./\", $n = 0)\n{\n $images = getImages($url);\n\n if (count($images) == 0)\n return [];\n\n if ($n > count($images))\n $n = count($images);\n\n $keys = array_keys($images);\n shuffle($keys);\n\n $new = [];\n for ($i = 0; $i < $n; $i++) \n $new[] = $images[$keys[$i]];\n\n return $new;\n}",
"function randomImg(){\n $imagesDir = 'images/';\n $images = glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);\n $randomImage = '/'.$images[array_rand($images)];\n echo $randomImage;\n}",
"public function getFeaturedPics(){\n\t\tshuffle($this->feat_pics_filenames);\n\t\treturn $this->feat_pics_filenames;\n\t}",
"public function breedAllRandomImage()\n {\n $breedDirs = $this->getBreedDirs();\n\n // pick a random dir\n $randomBreedDir = $breedDirs[array_rand($breedDirs)];\n\n // pick a random image from that dir\n $image = $this->getRandomImage($randomBreedDir);\n\n $directory = $this->breedFolderFromUrl($image);\n\n if (!$this->alt) {\n $responseArray = (object) ['status' => 'success', 'message' => $this->imageUrl.$directory.'/'.basename($image)];\n } else {\n $responseArray = (object) [\n 'status' => 'success',\n 'message' => [\n 'url' => $this->imageUrl.$directory.'/'.basename($image),\n 'altText' => $this->niceBreedAltFromFolder($directory),\n ],\n ];\n }\n\n return $this->response($responseArray);\n }",
"function get_random_images() {\n $site_url = 'http://www.greenpag.es';\n $random_images = array(\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random116.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random115.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random114.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random113.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random112.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random111.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random110.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random109.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random108.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random107.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random106.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random105.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random104.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random103.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random102.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random99.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random98.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random97.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random96.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random95.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random94.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random92.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random91.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random90.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random89.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random88.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random87.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random86.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random85.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random84.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random83.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random81.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random80.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random79.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random78.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random77.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random76.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random75.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random74.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random73.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random72.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random71.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random70.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random69.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random68.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random67.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random66.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random65.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random64.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random63.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random62.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random61.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random60.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random59.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random58.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random57.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random56.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random55.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random54.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random53.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random52.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random51.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random50.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random49.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random48.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random47.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random46.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random45.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random44.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random43.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random41.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random40.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random39.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random38.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random37.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random36.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random35.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random34.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random33.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random31.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random30.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random29.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random28.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random27.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random26.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random25.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random23.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random22.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random21.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random20.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random19.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random18.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random17.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random16.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random15.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random14.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random13.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random12.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random11.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random10.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random9.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random8.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random7.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random6.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random5.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random4.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random3.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random2.jpg',\n\t\t\t $site_url .'/wp-content/uploads/2013/06/random1.jpg'\n );\n return $random_images;\n}",
"function timber_lite_get_random_projects_images( $maxnum = 5 ) {\n $projects = get_posts( array(\n 'post_type' => 'jetpack-portfolio',\n 'posts_per_page' => -1,\n 'fields' => 'ids'\n ) );\n\n if ( ! empty($projects) ) {\n $args = array(\n 'post_parent__in' => $projects,\n 'post_type' => 'attachment',\n 'numberposts' => $maxnum,\n 'post_status' => 'any',\n 'post_mime_type' => 'image',\n 'orderby' => 'rand',\n );\n $images = get_posts( $args );\n\n return $images;\n }\n\n return array();\n}",
"private function images()\n {\n return File::allFiles(public_path('img/gallery'));\n }",
"public function getRandomPhoto(){\n return $randPhoto = DB::select('SELECT * FROM photos ORDER BY RAND() LIMIT 0,1');\n\n /*return $randPhoto = DB::select('SELECT * FROM photos\n WHERE photo_id >= (SELECT FLOOR( MAX(photo_id) * RAND()) FROM photos )\n ORDER BY photo_id LIMIT 1');*/\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a sort link for the given $name element using the $label if provided or the label from the model when null | public function createSortLink($name, $label = null)
{
$label = $this->_checkLabel($label, $name);
if ($this->model->get($name, 'noSort')) {
return $label;
}
$class = $this->sortAscClass;
$sortParam = $this->sortAscParam;
$nsortParam = $this->sortDescParam;
if ($this->sortKey == $name) {
if ($this->sortAsc) {
$class = $this->sortAscClassSel;
$sortParam = $this->sortDescParam;
$nsortParam = $this->sortAscParam;
} else {
$class = $this->sortDescClassSel;
}
}
$sortUrl[$sortParam] = $name;
$sortUrl[$nsortParam] = null; // Fix: no need for RouteReset if the link sets the other sort param to null
// $sortUrl['RouteReset'] = false; // Prevents tabs from being communicated
$sortUrl = $sortUrl + $this->baseUrl;
return \MUtil_Html::create()->a($sortUrl, array('class' => $class, 'title' => $this->model->get($name, 'description')), $label);
} | [
"public function addSortable($label, $column = '', $class = '', $desc = FALSE, $input_name = 'sort') {\n\t\tif (!$column) $column = $label;\n\t\tif ($_REQUEST[$input_name] == $column && ($_REQUEST['desc'] == $desc)) $mydesc = !$desc;\n\t\telse $mydesc = $desc;\n\t\t$cell = new cell($this, $class);\n\t\t$lnk = new link($cell, '', $label, array($input_name=>$column, 'desc'=>$mydesc) + doc::create_mimic());\n\t\treturn $cell;\n\t}",
"public function orderLabel();",
"function htmlCaptionSortLink($orderbyname, $filename, $caption) {\n $orderby = $GLOBALS['orderby'];\n $sorted = $GLOBALS['sorted'];\n \n $to_sort = ($orderby == $orderbyname && $sorted == 'ASC') ? 'DESC' : 'ASC';\n\n $link = tep_href_link( $filename , 'orderby=' . $orderbyname . '&sorted=' . $to_sort);\n \n $t = sprintf( '<a href=\"%s\" class=\"headerLink\">%s</a>', $link, $caption);\n\n return $t;\n }",
"function link_to_sort_route_by_name($route_name, $column, $body)\n{\n\t$input_sort_by = Request::get('sortBy');\n\t$input_sort_dir = Request::get('sortDirection');\n\n\t$direction = 'asc';\n\t$caret = '';\n\n\tif ($column == $input_sort_by)\n\t{\n\t\t$direction = ($input_sort_dir == 'asc') ? 'desc' : 'asc';\n\n\t\t$caret_direction = ($input_sort_dir == 'asc') ? 'up' : 'down';\n\n\t\t$caret = ' <span class=\"glyphicon glyphicon-chevron-'.$caret_direction.'\"></span>';\n\t}\n\n\t$link = link_to_route($route_name, $body, array('sortBy' => $column, 'sortDirection' => $direction));\n\n\treturn $link.''.$caret;\n}",
"function _heading($label, $field)\n\t{\n\t\tif ( ! $field) //Only make column sortable if field is given\n\t\t{\n\t\t\treturn $label;\n\t\t}\n\n\t\tif($field !== self::$order) //If not sorted by this field then show non-sorted graphic\n\t\t{\n\t\t\treturn anchor(self::$base_url.$this->router->get_string(['o' => $field, 'd' => 'desc']), $label.html::image('table/bg.gif','border=0'), ['class' => 'main_color']);\n\t\t}\n\n\t\tif (self::$dir == 'asc') //If ascending, sort by descending and show descending graphic\n\t\t{\n\t\t\treturn anchor(self::$base_url.$this->router->get_string(['d' => 'desc']), $label.html::image('table/desc.gif','border=0'), ['class' => 'main_color']);\n\t\t}\n\n\t\t//Otherwise, sort by ascending and show ascending graphic\n\t\treturn anchor(self::$base_url.$this->router->get_string(['d' => 'asc']), $label.html::image('table/asc.gif','border=0'), ['class' => 'main_color']);\n\t}",
"function html_header_sort($cursort, $sortname, $label, $class=null)\n{\n if (is_null($class))\n {\n $class = 'sortheader';\n }\n else\n {\n $class .= ' sortheader';\n }\n\n // Some visual indication of this header being the one that's being used to sort\n if ($cursort == $sortname . '_up' or $cursort == $sortname . '_down')\n {\n $class .= ' current_sort';\n }\n \n print '<td class=\"' . $class. '\">';\n if ($cursort == $sortname . '_up')\n {\n print '↑';\n }\n else\n {\n print '<a href=\"index.php?' . modify_querystring('sort', $sortname . '_up') .'\">↑</a>';\n }\n print ' ' . htmlentities($label) . ' ';\n if ($cursort == $sortname . '_down')\n {\n print '↓';\n }\n else\n {\n print '<a href=\"index.php?' . modify_querystring('sort', $sortname . '_down') .'\">↓</a>';\n }\n print \"</td>\\n\";\n}",
"public function getDefaultSortField(): string\n {\n return self::ALIAS.'.label';\n }",
"public function setSortName($sort_name);",
"public static function generateSort($data) { \n $sort = ($data['field'] === $data['field_vs']) ? (($data['sort'] == 'desc' || $data['sort'] == null) ? 'asc' : 'desc') : 'asc'; \n $url = URL::action($data['link'], array('field' => $data['field'], 'sort' => $sort)); \n $link = '<a href=\"'. $url .'\"><i class=\"fa fa-sort-amount-'.$sort.'\"></i></a>';\n \n return $link; \n }",
"function SortLinks(){\n\t\tif(count($this->get_sort_options()) <= 0) return null;\n\n\t\t$sort = (isset($_GET['sortby'])) ? Convert::raw2sql($_GET['sortby']) : \"Title\";\n\t\t$dos = new ArrayList();\n\t\tforeach($this->get_sort_options() as $field => $name){\n\t\t\t$current = ($field == $sort) ? 'current' : false;\n\t\t\t$dos->add(new ArrayData(array(\n\t\t\t\t'Name' => $name,\n\t\t\t\t'Link' => $this->Link().\"?sortby=$field\",\n\t\t\t\t'Current' => $current\n\t\t\t)));\n\t\t}\n\t\treturn $dos;\n\t}",
"public function sort( $operator, $name );",
"function sortLinksGenerator($userSearchTerm, $sort)\n\t{\n\t\t$sortLinks = '';\n\t\tswitch($sort)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\t$sortLinks .= ' <td><a href = \"' . $_SERVER['PHP_SELF'] . '?s=' . $userSearchTerm . '&t=2\" class=\"btn\">Order Published (Oldest First)</a></td>' . \"\\n\";\n\t\t\t\t$sortLinks .= ' <td><a href = \"' . $_SERVER['PHP_SELF'] . '?s=' . $userSearchTerm . '&t=4\" class=\"btn\">Title (A...Z)</a></td>' . \"\\n\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$sortLinks .= ' <td><a href = \"' . $_SERVER['PHP_SELF'] . '?s=' . $userSearchTerm . '&t=1\" class=\"btn\">Order Published (Newest First)</a></td>' . \"\\n\";\n\t\t\t\t$sortLinks .= ' <td><a href = \"' . $_SERVER['PHP_SELF'] . '?s=' . $userSearchTerm . '&t=4\" class=\"btn\">Title (Z...A)</a></td>' . \"\\n\";\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$sortLinks .= ' <td><a href = \"' . $_SERVER['PHP_SELF'] . '?s=' . $userSearchTerm . '&t=2\" class=\"btn\">Order Published (Newest First)</a></td>' . \"\\n\";\n\t\t\t\t$sortLinks .= ' <td><a href = \"' . $_SERVER['PHP_SELF'] . '?s=' . $userSearchTerm . '&t=4\" class=\"btn\">Title (A...Z)</a></td>' . \"\\n\";\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$sortLinks .= ' <td><a href = \"' . $_SERVER['PHP_SELF'] . '?s=' . $userSearchTerm . '&t=2\" class=\"btn\">Order Published (Newest First)</a></td>' . \"\\n\";\n\t\t\t\t$sortLinks .= ' <td><a href = \"' . $_SERVER['PHP_SELF'] . '?s=' . $userSearchTerm . '&t=3\" class=\"btn\">Title (Z...A)</a></td>' . \"\\n\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$sortLinks .= ' <td><a href = \"' . $_SERVER['PHP_SELF'] . '?s=' . $userSearchTerm . '&t=1\" class=\"btn\">Order Published (Newest First)</a></td>' . \"\\n\";\n\t\t\t\t$sortLinks .= ' <td><a href = \"' . $_SERVER['PHP_SELF'] . '?s=' . $userSearchTerm . '&t=4\" class=\"btn\">Title (A...Z)</a></td>' . \"\\n\";\n\t\t\t\tbreak;\n\t\t}\t\n\t\treturn $sortLinks;\n\t}",
"function sort_link($column, $caption = null, $options)\n {\n if ($caption == null) {\n $caption = __($column);\n }\n $html = $this->sort($column, $caption, $options);\n\n if($this->request->params['named']['sort'] == $column) {\n if($this->request->params['named']['direction'] == 'asc') {\n $icon = 'sort_asc.png';\n } else {\n $icon = 'sort_desc.png';\n }\n $html.= \" \".$this->Html->image($icon);\n }\n return $html;\n }",
"function _scratchpads_backend_views_sort_by_label($array_to_sort){\n $label_keyed = array();\n $other = array();\n foreach($array_to_sort as $key => $filter){\n if(isset($filter['expose'])){\n $label_keyed[$filter['expose']['label']] = array(\n $key => $filter\n );\n }else{\n $other[$key] = $filter;\n }\n }\n ksort($label_keyed);\n $final = array();\n foreach($label_keyed as $key => $element){\n $array_values = array_values($element);\n $final[key($element)] = array_shift($array_values);\n }\n return array_merge($final, $other);\n}",
"private function CreateSortLink()\r {\r \r $text = (Get('action') == 'sort') ? \"COMPLETE SORT\" : \"ENABLE SORT\";\r $link = (Get('action') == 'sort') ? \"\" : \";action=sort\";\r \r if (Get('action') == 'sort') {\r $text = \"DISABLE SORT\";\r $link_use = \"link_sort_off\";\r } else {\r $text = \"ENABLE SORT\";\r $link_use = \"link_sort_on\";\r }\r \r $output = \"<span id='pipeline_sort_link' style='cursor:pointer; color:blue;'>{$text}</span>\";\r \r // ----- jquery for handling drop-down change\r AddScriptOnReady(\"\r $('#pipeline_sort_link').click(function() {\r var value = $('#pipeline_status').attr('value');\r var link = $('option:selected', '#pipeline_status').attr('{$link_use}');\r window.location = link;\r });\r \");\r \r return $output;\r }",
"function bib_sort_links($search = \"\", $extra = NULL, $default = \"date\")\n{\n\t// get sort index (default is date - see arg list above)\n\t$sort = extract_var_from_post_get(\"sort\");\n\tif ($sort === NULL || $sort == \"\") $sort = $default;\n\t\n\t// display links\n\techo \"<p class=\\\"biblist-sort-links\\\">\\n\";\n\techo \"<b>Sort by: </b>\";\n\t$sort_list = array(\"date\", \"type\", \"title\");\n\tif ($extra) $sort_list = array_merge($sort_list, $extra);\n\t$first = true;\n\tforeach ($sort_list as $sort_type) {\n\t\tif ($first) $first = false; else echo \", \";\n\t\tif ($sort_type == $sort) echo \"<span class=\\\"bib-highlight\\\">\";\n\t\techo \"<a href=\\\"\".htmlspecialchars($_SERVER[\"PHP_SELF\"]).\"?\";\n\t\tif ($search) echo \"search=\".htmlentities($search).\"&\";\n\t\techo \"sort=$sort_type\\\">$sort_type</a>\";\n\t\tif ($sort_type == $sort) echo \"</span>\";\n\t}\n\techo \"</p>\\n\";\n\n\treturn $sort;\n}",
"function generate_sort_links($user_search, $sort) {\r\n $sort_links = '';\r\n\r\n switch ($sort) {\r\n case 1:\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=2\">User</a></td><td>Last Name</td>';\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=3\">City</a></td>';\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=5\">Joined</a></td>';\r\n break;\r\n case 3:\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=1\">User</a></td><td>Last Name</td>';\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=4\">City</a></td>';\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=3\">Joined</a></td>';\r\n break;\r\n case 5:\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=1\">User</a></td><td>Last Name</td>';\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=3\">City</a></td>';\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=6\">Joined</a></td>';\r\n break;\r\n default:\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=1\">User</a></td><td>Last Name</td>';\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=3\">City</a></td>';\r\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=5\">Joined</a></td>';\r\n }\r\n\r\n return $sort_links;\r\n }",
"function generate_sort_links($user_search, $sort) {\n $sort_links = '';\n\n switch ($sort) {\n case 1:\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=2\">Job Title</a></td><td>Description</td>';\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=3\">State</a></td>';\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=5\">Date Posted</a></td>';\n break;\n case 3:\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=1\">Job Title</a></td><td>Description</td>';\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=4\">State</a></td>';\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=3\">Date Posted</a></td>';\n break;\n case 5:\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=1\">Job Title</a></td><td>Description</td>';\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=3\">State</a></td>';\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=6\">Date Posted</a></td>';\n break;\n default:\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=1\">Job Title</a></td><td>Description</td>';\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=3\">State</a></td>';\n $sort_links .= '<td><a href = \"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=5\">Date Posted</a></td>';\n }\n\n return $sort_links;\n }",
"public function withFieldAs(string $name, string $label);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the desired contact login already existst. Optionally exclude the given contact id from the check | public function existsLogin($contact_login, $exclude_contact_id=null)
{
return $this->ContactData->existsLogin($contact_login, $exclude_contact_id);
} | [
"public function contactAlreadyExists($id)\r\n\t{\r\n\t\t$sql = \"SELECT * FROM cabinete_marketing WHERE `cabinet_id`='$id'\";\r\n\t\t$this->db->query($sql);\r\n\t\tif($this->db->num_rows()>0)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"protected function checkUniqueFields(Connect\\Contact $contact) {\n $emailList = $errors = array();\n $emailString = '';\n if ($emails = $contact->Emails) {\n foreach (range(0, 2) as $index) {\n if ($address = strtolower(ConnectUtil::fetchFromArray($emails, $index, 'Address'))) {\n $emailList[] = $address;\n $emailString .= \"'\" . Connect\\ROQL::escapeString($address) . \"', \";\n }\n }\n }\n $emailString = rtrim($emailString, ', ');\n\n $login = Connect\\ROQL::escapeString($contact->Login);\n if($login === '' && count($emailList) === 0){\n return false;\n }\n\n //Validate that all email values provided are unique\n if(count($emailList) !== count(array_unique($emailList))){\n $errors['duplicates_within_email_fields'] = Config::getMessage(EMAIL_ADDRESSES_MUST_BE_UNIQUE_MSG);\n }\n $query = '';\n $existingContactID = $contact->ID;\n if($login !== ''){\n $query = \"SELECT ID FROM Contact WHERE Login = '$login'\" . (($existingContactID) ? \" AND ID != $existingContactID;\" : \";\");\n }\n if($emailString !== ''){\n $query .= \"SELECT ID, Emails.Address, Emails.AddressType FROM Contact WHERE Emails.Address IN ($emailString)\" . (($existingContactID) ? \" AND ID != $existingContactID\" : \"\");\n }\n try{\n $queryResult = Connect\\ROQL::query($query);\n }\n catch(Connect\\ConnectAPIErrorBase $e){\n return $errors ?: false;\n }\n if($login !== ''){\n $loginResult = $queryResult->next();\n }\n if($emailString !== ''){\n $emailsResult = $queryResult->next();\n }\n\n $accountAssistPage = '/app/' . Config::getConfig(CP_ACCOUNT_ASSIST_URL) . Url::sessionParameter();\n\n if($loginResult && $duplicateLogin = $loginResult->next()){\n $errors['login'] = Config::getMessage(EXISTING_ACCT_USERNAME_PLS_ENTER_MSG);\n if(!Framework::isLoggedIn()){\n $errors['login'] .= '<br/>' . sprintf(Config::getMessage(EMAIL_ADDR_SEUNAME_RESET_MSG), $accountAssistPage, Config::getMessage(GET_ACCOUNT_ASSISTANCE_HERE_LBL));\n }\n }\n\n while($emailsResult && $duplicateEmails = $emailsResult->next()){\n $isEmailSharingEnabled = Api::site_config_int_get(CFG_OPT_DUPLICATE_EMAIL);\n $errorMessage = sprintf(Config::getMessage(EXING_ACCT_EMAIL_ADDR_PCT_S_PLS_MSG), $duplicateEmails['Address']);\n if(!Framework::isLoggedIn()){\n $errorMessage .= '<br/>' . (($isEmailSharingEnabled)\n ? sprintf(Config::getMessage(EMAIL_ADDR_OBTAIN_CRDENTIALS_MSG), $accountAssistPage, Config::getMessage(GET_ACCOUNT_ASSISTANCE_HERE_LBL))\n : sprintf(Config::getMessage(EMAIL_ADDR_SEUNAME_RESET_MSG), $accountAssistPage, Config::getMessage(GET_ACCOUNT_ASSISTANCE_HERE_LBL)));\n }\n\n if(intval($duplicateEmails['AddressType']) === CONNECT_EMAIL_PRIMARY){\n $errors['email'] = $errorMessage;\n }\n else if(intval($duplicateEmails['AddressType']) === CONNECT_EMAIL_ALT1){\n $errors['email_alt1'] = $errorMessage;\n }\n else{\n $errors['email_alt2'] = $errorMessage;\n }\n }\n return count($errors) ? $errors : false;\n }",
"public function _check_unique_contact($contactNumber){\n $user_id = $this->authData->id; //current user ID\n $contact_exist = $this->common_model->is_data_exists(USERS, array('contactNumber'=>$contactNumber, 'id !='=>$user_id));\n \n if($contact_exist){\n $this->form_validation->set_message('_check_unique_contact','This contact already exist');\n return FALSE;\n }else{\n return TRUE;\n }\n }",
"function is_primary_contact($contact_id = '')\n{\n if (!is_numeric($contact_id)) {\n $contact_id = get_contact_user_id();\n }\n\n if (total_rows('tblcontacts', [\n 'id' => $contact_id,\n 'is_primary' => 1,\n ]) > 0) {\n return true;\n }\n\n return false;\n}",
"function validateSiebelContactID(RNCPHP\\Contact $contact = null) {\r\n $contactPartyID = ($contact !== null) ? $contact->CustomFields->Accelerator->siebel_contact_party_id : null;\r\n $contactOrgID = ($contact !== null) ? $contact->CustomFields->Accelerator->siebel_contact_org_id : null;\r\n if ($contactPartyID === null || $contactOrgID === null) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }",
"function is_primary_contact($contact_id = '')\n{\n if (!is_numeric($contact_id)) {\n $contact_id = get_contact_user_id();\n }\n\n if (total_rows('tblcontacts', array(\n 'id' => $contact_id,\n 'is_primary' => 1\n )) > 0) {\n return true;\n }\n\n return false;\n}",
"function isPrimaryContact($id = '')\n {\n\n //profiling::\n $this->debug_methods_trail[] = __function__;\n\n //declare\n $conditional_sql = '';\n\n //if no valie client id, return false\n if (!is_numeric($id)) {\n return false;\n }\n\n //escape data\n $id = $this->db->escape($id);\n\n //----------sql & benchmarking start----------\n $this->benchmark->mark('code_start');\n\n //----------monitor transaction start----------\n $this->db->trans_start();\n\n //_____SQL QUERY_______\n $query = $this->db->query(\"SELECT *\n FROM client_users \n WHERE client_users_id = $id\n AND client_users_main_contact = 'yes'\");\n $results = $query->num_rows(); //count rows\n\n //----------monitor transaction end----------\n $this->db->trans_complete();\n $transaction_result = $this->db->trans_status();\n if ($transaction_result === false) {\n\n //log this error\n $db_error = $this->db->_error_message();\n log_message('error', '[FILE: ' . __file__ . '] [FUNCTION: ' . __function__ . '] [LINE: ' . __line__ . \"] [MESSAGE: Database Error - $db_error]\");\n\n return false;\n }\n\n //benchmark/debug\n $this->benchmark->mark('code_end');\n $execution_time = $this->benchmark->elapsed_time('code_start', 'code_end');\n\n //debugging data\n $this->__debugging(__line__, __function__, $execution_time, __class__, $results);\n //----------sql & benchmarking end----------\n\n //return results\n if ($results === 1) {\n return true;\n } else {\n return false;\n }\n\n }",
"function checkIfContactAlreadyAsignedToStudent($type,$student_id,$contact_id){\n if($type ==\"contact\"){\n $sql =\"select * from contact_linker where contact_id = $contact_id AND student_id = $student_id\";\n }\n if($type ==\"teacher\"){\n $sql =\"select * from contact_linker where teacher_id = $contact_id AND student_id = $student_id\";\n }\n\n $result = $this->db_connection->query($sql);\n if($result){\n if(mysqli_num_rows($result) > 0 ){ \n return true;\n }else{\n return false;\n }\n}else{\n return false;\n \n}\n\n\n }",
"public function checkDuplicate()\n\t{\n\t\t$person = People::model()->findByAttributes(array('firstName'=>$this->firstName,'lastName'=>$this->lastName));\n\t\t$number = Phoneinfo::model()->findByAttributes(array('phoneNumber'=>$this->phoneNumber));\n\t\tif ($person && $number) {\n\t\t\t$pId = $person->getPrimaryKey();\n\t\t\t$phoneId = $number->getPrimaryKey();\n\t\t\t$contact = self::model()->findByAttributes(array('pId'=>$pId,'phoneId'=>$phoneId));\n\t\t\tif($contact){\n\t\t\t\t$this->addError('phoneType', 'This contact already exists.');\n\t\t\t}\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"public function LeadExists()\n {\n $this->Db->PrepareQuery(\n \"SELECT `LeadID` FROM `GA_Lead` WHERE `Phone` = '%s' AND `Email` = '%s' LIMIT 1;\",\n array (\n $this->phone->formatted_number,\n $this->UserData['Email'],\n )\n );\n \n $result = $this->Db->Query();\n \n if (isset($result->LeadID)) {\n $this->Id = $result->LeadID;\n $this->error = sprintf(\n \"Lead with phone number '%s' and email '%s' already exist\\n\",\n $this->phone->formatted_number,\n $this->UserData['Email']\n );\n return true;\n }\n return false;\n }",
"function check_addressbook_id_exist($id){\n\t\n\t\tglobal $connection;\n\t\treturn (AppModel::grab_db_function_class()->return_num_of_rows_in_result(AppModel::grab_db_function_class()->execute_query(\"SELECT id FROM pfa__address_book WHERE id = {$id}\")) != \"\") ? true : false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t}",
"function isAllowedSupportContact($customer_contact_id)\n {\n }",
"function EnterNewContact( $bForce = FALSE )\n{\n $contactContactType = $_REQUEST['EditContactType'];\n $teamId = $_REQUEST['EditTeamId'];\n $contactFirstName = $_REQUEST['EditContactFirstName'];\n $contactLastName = $_REQUEST['EditContactLastName'];\n $contactPhoneHome = $_REQUEST['EditPhoneHome'];\n $contactPhoneWork = $_REQUEST['EditPhoneWork'];\n $contactPhoneCell = $_REQUEST['EditPhoneCell'];\n $contactEmail = $_REQUEST['EditEmail'];\n $pn_uid = $_REQUEST['pn_uid'];\n $bMainContact = 0;\n \n if (isset($_REQUEST['MainContact'])) \n {\n\t //if this is set then it must be checked\n\t\t$value = $_REQUEST['MainContact'];\n\t\t$bMainContact = 1;\n }\n\n //First check and see if person is already in contact list\n $sql = \"SELECT *\n FROM ContactInfo\n WHERE FirstName = '$contactFirstName' AND\n LastName = '$contactLastName'\";\n\n $result = @mysql_query($sql);\n if (!$result)\n {\n die('<p>Error performing contact search query: ' .\n mysql_error() . '</p>');\n }\n $row = mysql_fetch_array($result);\n if( $row == 0 || $bForce == TRUE )\n {\n AddNewContact($contactContactType,\n $teamId,\n $contactFirstName,\n $contactLastName,\n $contactPhoneHome,\n $contactPhoneWork,\n $contactPhoneCell,\n $contactEmail,\n\t\t\t\t\t$bMainContact,\n\t\t $pn_uid);\n }\n else\n {\n echo('<p><B>We found a name or names matching the contact you entered. It is possbile that your contact shares the same name with some already in the database. Please review the choices below and select the proper option. </B> </p>');\n\n //reset pointer so we can use it again\n mysql_data_seek($result, 0);\n\n\t echo('<p> test main in add: '.$bMainContact.'</p>');\n\n echo('<p>List of contacts found mathing the name you entered: </p>');\n echo('<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n <TR>\n <TD></TD>\n <TD></TD>\n <TD></TD>\n <TD></TD>\n </TR>');\n ShowContact($row,MATCH,$teamId,$pn_uid);\n echo('</TABLE>');\n\n echo('<p><B>Option 1:</B> MATCH - The contact you entered DOES match a name in the contact list above. Click the \"Match\" link next to the name that your entry matches.</p>');\n echo('<p><B>Option 2:</B> <a href=\"'.$_SERVER['PHP_SELF'].'?page=ForceNewContact&pn_uid='.$pn_uid.'&EditContactType='.$contactContactType.'&EditTeamId='.$teamId.'&EditContactFirstName='.$contactFirstName.'&EditContactLastName='.$contactLastName.'&EditPhoneHome='.$contactPhoneHome.'&EditPhoneWork='.$contactPhoneWork.'&EditPhoneCell='.$contactPhoneCell.'&EditEmail='.$contactEmail.'&MainContact='.$bMainContact.'\"> ADD </a> - The name does not match any of the names in the list. Your contact just happens to share the same name. Click the \"Add\" link to add your contact.</p>');\n echo('<p><B>Option 3:</B> <a href=\"'.$_SERVER['PHP_SELF'].'?EditTeamId='.$teamId.'\">CANCEL </a> - You made a mistake and want to start over.</p>');\n }\n}",
"function valid_login_id_duplicate($login_id)\n {\n\n // Load model\n $this->base->load->model('user_model');\n\n $user = $this->base->user_model\n ->where('login_id', $login_id)\n ->first([\n 'with_deleted' => TRUE\n ]);\n\n if ($user) {\n $this->set_message('valid_login_id_duplicate', 'このログインIDはすでに使用されています');\n return FALSE;\n }\n\n return TRUE;\n }",
"private function recordExistEdit($field, $value, $id) {\n $account = $this->identity()->getFkaccountid();\n //Hent udvalgt i db\n $user = $this->getUsermapper()->findOneBy(array($field => $value, 'fkaccountid' => $account));\n if ($user === NULL) {\n return false;\n } else {\n if ($user->getId() === $id) {\n return false;\n } if ($user->getId() != $id) {\n return true;\n }\n }\n }",
"public function check_login_id($request) {\n\t\tif ($request->login_id) {\n\t\t\tif ($request->id) {\n\t\t\t\t$user_details = DB::table('tabUser')\n\t\t\t\t\t->select('login_id', 'email')\n\t\t\t\t\t->where('id', '!=', $request->id);\n\n\t\t\t\t$user_details = $user_details->where(function($query) use ($request) {\n\t\t\t\t\t$query->where('login_id', $request->login_id)\n\t\t\t\t\t\t->orWhere('email', $request->email);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$user_details = DB::table('tabUser')\n\t\t\t\t\t->select('login_id', 'email');\n\n\t\t\t\t$user_details = $user_details->where(function($query) use ($request) {\n\t\t\t\t\t$query->where('login_id', $request->login_id)\n\t\t\t\t\t\t->orWhere('email', $request->email);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t$user_details = $user_details->first();\n\n\t\t\tif ($user_details) {\n\t\t\t\tSession::put('success', 'false');\n\t\t\t\tif ($user_details->login_id == $request->login_id) {\n\t\t\t\t\t$msg = 'Login ID: \"' . $user_details->login_id . '\" is already registered.';\n\t\t\t\t}\n\t\t\t\telseif ($user_details->email == $request->email) {\n\t\t\t\t\t$msg = 'Email ID: \"' . $user_details->email . '\" is already registered.';\n\t\t\t\t}\n\n\t\t\t\tthrow new Exception($msg);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSession::put('success', 'true');\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new Exception(\"Login ID is not provided\");\n\t\t}\n\t}",
"private function checkContacts()\n {\n $contacts = DB::table('client_contacts')\n ->whereNull('contact_key')\n ->orderBy('id')\n ->get(['id']);\n $this->logMessage($contacts->count().' contacts without a contact_key');\n\n if ($contacts->count() > 0) {\n $this->isValid = false;\n }\n\n if ($this->option('fix') == 'true') {\n foreach ($contacts as $contact) {\n DB::table('client_contacts')\n ->where('id', '=', $contact->id)\n ->whereNull('contact_key')\n ->update([\n 'contact_key' => str_random(config('ninja.key_length')),\n ]);\n }\n }\n\n // check for missing contacts\n $clients = DB::table('clients')\n ->leftJoin('client_contacts', function ($join) {\n $join->on('client_contacts.client_id', '=', 'clients.id')\n ->whereNull('client_contacts.deleted_at');\n })\n ->groupBy('clients.id', 'clients.user_id', 'clients.company_id')\n ->havingRaw('count(client_contacts.id) = 0');\n\n if ($this->option('client_id')) {\n $clients->where('clients.id', '=', $this->option('client_id'));\n }\n\n $clients = $clients->get(['clients.id', 'clients.user_id', 'clients.company_id']);\n $this->logMessage($clients->count().' clients without any contacts');\n\n if ($clients->count() > 0) {\n $this->isValid = false;\n }\n\n if ($this->option('fix') == 'true') {\n foreach ($clients as $client) {\n $contact = new ClientContact();\n $contact->company_id = $client->company_id;\n $contact->user_id = $client->user_id;\n $contact->client_id = $client->id;\n $contact->is_primary = true;\n $contact->send_invoice = true;\n $contact->contact_key = str_random(config('ninja.key_length'));\n $contact->save();\n }\n }\n\n // check for more than one primary contact\n $clients = DB::table('clients')\n ->leftJoin('client_contacts', function ($join) {\n $join->on('client_contacts.client_id', '=', 'clients.id')\n ->where('client_contacts.is_primary', '=', true)\n ->whereNull('client_contacts.deleted_at');\n })\n ->groupBy('clients.id')\n ->havingRaw('count(client_contacts.id) != 1');\n\n if ($this->option('client_id')) {\n $clients->where('clients.id', '=', $this->option('client_id'));\n }\n\n $clients = $clients->get(['clients.id', DB::raw('count(client_contacts.id)')]);\n $this->logMessage($clients->count().' clients without a single primary contact');\n\n if ($clients->count() > 0) {\n $this->isValid = false;\n }\n }",
"public function test_does_contact_request_exist() {\n $user1 = self::getDataGenerator()->create_user();\n $user2 = self::getDataGenerator()->create_user();\n\n $this->assertFalse(\\core_message\\api::does_contact_request_exist($user1->id, $user2->id));\n $this->assertFalse(\\core_message\\api::does_contact_request_exist($user2->id, $user1->id));\n\n \\core_message\\api::create_contact_request($user1->id, $user2->id);\n\n $this->assertTrue(\\core_message\\api::does_contact_request_exist($user1->id, $user2->id));\n $this->assertTrue(\\core_message\\api::does_contact_request_exist($user2->id, $user1->id));\n }",
"public function checkduplicateuserid(){\n\t\t$this->load->model(\"portalmodel\");\n \t\n\t\t$userid = $this->input->post('userid');\n\t\t$existing_id = $this->portalmodel->select_name(\"user\",\"id\",\"TRIM(LOWER(username))='\".trim(strtolower($userid)).\"'\");\n\n\t\tif(!empty($existing_id) && $existing_id!='N/A'){\n\t\t\techo 1;\n\t\t}else{\n\t\t\techo 0;\n\t\t}\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculate the hash from a salt and a password | function getPasswordHash( $salt, $password )
{
return $salt . ( hash('sha256', $salt . $password ) );
} | [
"private function hashPassword($password, $salt) {\n return hash('sha256', $password.$salt);\n }",
"private function hash($salt, $password) {\r\n\t\treturn bin2hex ( hash ( \"sha512\", $password . $salt, true ) ^ hash ( \"whirlpool\", $salt . $password, true ) );\r\n\t}",
"public static function hashPassword($salt, $password){\n\treturn 'sha1$'.$salt.'$'.sha1($salt.$password);\n }",
"abstract public function hash($password);",
"public static function getPasswordHash($salt, $password) {\n\t\treturn sha1($salt . $password);\n\t}",
"function hashPassword($username, $pass, $salt) {\n global $conn;\n\n $halfsaltsize = strlen($salt)/2;\n $halfsizeinc = $halfsaltsize;\n $halfsizedec = $halfsaltsize - 1;\n \n $hashed = $pass;\n\n for ($i = 0; $i < $halfsaltsize; $i++) {\n $hashed = $salt[$halfsizedec].$hashed.$salt[$halfsizeinc];\n $halfsizeinc++;\n $halfsizedec--;\n }\n\n $encrypted = sha1($hashed);\n\n return $encrypted;\n }",
"function create_hash_with_salt($password, $salt) {\n // format: algorithm:iterations:salt:hash\n return PBKDF2_HASH_ALGORITHM . \":\" . PBKDF2_ITERATIONS . \":\" . $salt . \":\" .\n base64_encode(pbkdf2(\n PBKDF2_HASH_ALGORITHM,\n $password,\n $salt,\n PBKDF2_ITERATIONS,\n PBKDF2_HASH_BYTE_SIZE,\n true\n ));\n }",
"public static function hash(string $password): string;",
"function qa_db_calc_passcheck($password, $salt)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn sha1(substr($salt, 0, 8) . $password . substr($salt, 8));\n}",
"static public function hash_password($password, $salt = FALSE){\n\t\tif ($salt === FALSE){\n\t\t\t// Create a salt seed, same length as the number of offsets in the pattern\n\t\t\t//$salt = substr($this->hash(uniqid(NULL, TRUE)), 0, count($this->config['salt_pattern']));\n\t\t\t$salt = Model_Auth_local::find_salt(Model_Auth_local::hash($password));\n\t\t}\n\n\t\t$config = Kohana::config('auth');\n\t\tif(! is_array($config['salt_pattern'])){\n\t\t\t$config['salt_pattern'] = preg_split('/,\\s*/', $config['salt_pattern']);\n\t\t}\n\t\t// Password hash that the salt will be inserted into\n\t\t$hash = Model_Auth_local::hash($salt.$password);\n\n\t\t// Change salt to an array\n\t\t$salt = str_split($salt, 1);\n\n\t\t// Returned password\n\t\t$password = '';\n\n\t\t// Used to calculate the length of splits\n\t\t$last_offset = 0;\n\n\t\tforeach ($config['salt_pattern'] as $offset){\n\t\t\t// Split a new part of the hash off\n\t\t\t$part = substr($hash, 0, $offset - $last_offset);\n\n\t\t\t// Cut the current part out of the hash\n\t\t\t$hash = substr($hash, $offset - $last_offset);\n\n\t\t\t// Add the part to the password, appending the salt character\n\t\t\t$password .= $part.array_shift($salt);\n\n\t\t\t// Set the last offset to the current offset\n\t\t\t$last_offset = $offset;\n\t\t}\n\n\t\t// Return the password, with the remaining hash appended\n\t\treturn $password.$hash;\n\t}",
"public static function GenerateHash($password, $salt) {\n $hash = $password . hash('sha1', $salt);\n for ($i=0; $i < HASHTIMES; $i++) { \n $hash = hash('sha1', $hash);\n }\n \n return $hash;\n }",
"public function hash($password, $hash_with = self::HASHED_WITH_PHP);",
"public function hash_password($password, $salt = FALSE)\n {\n\tif ($salt === FALSE)\n\t{\n // Create a salt seed, same length as the number of offsets in the pattern\n $salt = substr($this->hash(uniqid(NULL, TRUE)), 0, count($this->config['salt_pattern']));\n\t}\n\n\t// Password hash that the salt will be inserted into\n\t$hash = $this->hash($salt.$password);\n\n\t// Change salt to an array\n\t$salt = str_split($salt, 1);\n\n\t// Returned password\n\t$password = '';\n\n\t// Used to calculate the length of splits\n\t$last_offset = 0;\n\n\tforeach ($this->config['salt_pattern'] as $offset)\n\t{\n // Split a new part of the hash off\n $part = substr($hash, 0, $offset - $last_offset);\n\n // Cut the current part out of the hash\n $hash = substr($hash, $offset - $last_offset);\n\n // Add the part to the password, appending the salt character\n $password .= $part.array_shift($salt);\n\n // Set the last offset to the current offset\n $last_offset = $offset;\n\t}\n\n\t// Return the password, with the remaining hash appended\n\treturn $password.$hash;\n }",
"public function hash_password($password, $salt = FALSE)\n\t{\n\t\tif ($salt == FALSE)\n\t\t{\n\t\t\t// Create a salt string, same length as the number of offsets in the pattern\n\t\t\t$salt = substr($this->hash(uniqid(NULL, TRUE)), 0, count($this->config['salt_pattern']));\n\t\t}\n\n\t\t// Password hash that the salt will be inserted into\n\t\t$hash = $this->hash($salt.$password);\n\n\t\t// Change salt to an array\n\t\t$salt = str_split($salt, 1);\n\n\t\t// Returned password\n\t\t$password = '';\n\n\t\t// Used to calculate the length of splits\n\t\t$last_offset = 0;\n\n\t\tforeach($this->config['salt_pattern'] as $offset)\n\t\t{\n\t\t\t// Split a new part of the hash off\n\t\t\t$part = substr($hash, 0, $offset - $last_offset);\n\n\t\t\t// Cut the current part out of the hash\n\t\t\t$hash = substr($hash, $offset - $last_offset);\n\n\t\t\t// Add the part to the password, appending the salt character\n\t\t\t$password .= $part.array_shift($salt);\n\n\t\t\t// Set the last offset to the current offset\n\t\t\t$last_offset = $offset;\n\t\t}\n\n\t\t// Return the password, with the remaining hash appended\n\t\treturn $password.$hash;\n\t}",
"protected function hashPassword($password, $salt, $rounds = 10000)\r\n {\r\n for ($i = 0; $i < $rounds; $i++)\r\n {\r\n $hash = sha1($salt . $password . $salt);\r\n }\r\n return $hash;\r\n }",
"function hashpass($password)\n {\n global $sys;\n\n $password = hash(\"SHA512\", base64_encode(str_rot13(hash(\"SHA512\", str_rot13($sys->auth_conf['salt_1'] . $password . $sys->auth_conf['salt_2'])))));\n return $password;\n }",
"function doHashing($aPassword, $salt = null)\n{\n\tif ($salt == null)\n\t{\n\t\t// generate salt \n\t\t$lengthSalt = 10;\n\t\t$salt = generateRandomString($lengthSalt);\n\t\t// echo \"salt generated: \" . $salt . \"\\n\";\t\t\n\t}\n\t\n\t// generate hash value\n\t$hashValue = hash('md5', $aPassword . $salt);\n\t// echo \"hashValue generated: \" . $hashValue . \"\\n\";\t\n\t\n\t$hashingArray = array($salt, $hashValue);\n\t\n\treturn $hashingArray;\t\n}",
"public function calculateHash($password)\n {\n return hash(self::ALGORITHM, $password);\n }",
"public function hashPassword($password, $salt = FALSE) {\n\n $this->generateSalt();\n\n if ($salt === FALSE) {\n // Create a salt seed, same length as the number of offsets in the pattern\n $salt = substr($this->hash(uniqid(NULL, TRUE)), 0, count($this->salt_pattern));\n }\n\n // Password hash that the salt will be inserted into\n $hash = $this->hash($salt . $password);\n\n // Change salt to an array\n $salt = str_split($salt, 1);\n\n\n // Returned password\n $password = '';\n\n // Used to calculate the length of splits\n $last_offset = 0;\n\n foreach ($this->salt_pattern as $i => $offset) {\n // Split a new part of the hash off\n $part = substr($hash, 0, $offset - $last_offset);\n\n // Cut the current part out of the hash\n $hash = substr($hash, $offset - $last_offset);\n\n // Add the part to the password, appending the salt character\n $password .= $part . array_shift($salt);\n\n // Set the last offset to the current offset\n $last_offset = $offset;\n }\n // Return the password, with the remaining hash appended\n return $password . $hash;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Method: assert_is_type() Checks if the assertion is a type of class. Parameters: $base The value to test. $type The type name to compare against. $message An optional message to be used. Returns: true/false | protected function assert_is_type($base, $type, $message=null)
{
$this->message = 'Expected type '. ucfirst($type) .', was ['. $this->get_type($base) .'] '. $message;
if (strtolower($this->get_type($base)) == strtolower($type))
{
return true;
}
else
{
$this->asserts = false;
return false;
}
} | [
"protected function assert_not_is_type($base, $type, $message='') \n\t{\n\t\t$this->message = 'Expected not type '. ucfirst($type) .', was ['. $this->get_type($base) .'], '. $message;\n\t\n\t\tif (strtolower($this->get_type($base)) != strtolower($type))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->asserts = false;\n\t\t\treturn false;\n\t\t}\n\t}",
"public function testIsBaseType()\n {\n $this->assertInstanceOf(BaseType::class, $this->type);\n }",
"public function assertIsA($object, $type, $message='')\n\t{\n\t\t$this->assertTrue(is_a($object, $type), $message);\n\t}",
"public function iShouldSeeATypeOfMessage($type, $message = null)\n {\n $expected_message = \"[$type]\";\n if (!empty($message)) {\n $expected_message .= \" {$message}\";\n }\n\n $compressed_output = preg_replace('/\\s+/', ' ', $this->output);\n if (strpos($compressed_output, $expected_message) === false) {\n throw new \\Exception(\"Expected $expected_message in message: $this->output\");\n }\n\n return true;\n }",
"public function isType($type){\n \n // canary...\n if(!$this->hasType()){ return false; }//if\n \n return ($this->field_map['type'] === $type);\n \n }",
"public function isInstanceOf($type)\n {\n $class = 'PDepend\\Source\\AST\\AST' . $type;\n\n return ($this->node instanceof $class);\n }",
"public function checkType($value, $type) {\n\t\tswitch ($type) {\n\t\t\tcase \"int2\":\n\t\t\tcase \"int4\":\n\t\t\tcase \"int8\":\n\t\t\t\tif ($value != null && !is_numeric($value))\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\tcase \"float4\":\n\t\t\tcase \"float8\":\n\t\t\t\tif ($value != null && !is_numeric($value))\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\n\t\t}\n\t\t// TODO: MySQL Types, date types.\n\t\treturn true;\n\t}",
"public function isClass();",
"public function isKindOf($type) {\n return $this->object instanceof $type;\n }",
"public abstract function isSubclassOf(Types $t);",
"public function getIsClass() : bool\n {\n return ($this->phpType instanceof \\ReflectionClass) && (!$this->phpType->isInterface() && !$this->phpType->isTrait()) && !$this->getIsEnum();\n }",
"protected function _isClassOf($class, $base) {\n if ($class == $base) {\n return true;\n }\n return is_subclass_of($class, $base);\n }",
"public function isOfType($value) : bool;",
"protected function checkType(string $type, $value): bool\n {\n switch ($type) {\n case 'array':\n return \\is_array($value);\n\n case 'bool':\n case 'boolean':\n return \\is_bool($value);\n\n case 'callable':\n return \\is_callable($value);\n\n case 'float':\n case 'double':\n return \\is_float($value);\n\n case 'int':\n case 'integer':\n return \\is_int($value);\n\n case 'null':\n return $value === null;\n\n case 'numeric':\n return \\is_numeric($value);\n\n case 'object':\n return \\is_object($value);\n\n case 'resource':\n return \\is_resource($value);\n\n case 'scalar':\n return \\is_scalar($value);\n\n case 'string':\n return \\is_string($value);\n\n case 'mixed':\n return true;\n\n default:\n return ($value instanceof $type);\n }\n }",
"public function assertElementType(NodeElement $element, $type) {\n if ($element->getTagName() !== $type) {\n throw new ExpectationException(\"The element is not a '$type'' field.\", $this->getSession());\n }\n }",
"public function isType($value) {\n if ($this->type != null) {\n switch (strtolower($this->type)) {\n case 'string':\n return is_string($value);\n case 'array':\n return is_array($value);\n case 'resource':\n return is_resource($value);\n case 'float':\n case 'double':\n case 'real':\n return is_float($value);\n case 'int':\n case 'int':\n case 'long':\n return is_int($value);\n case 'bool':\n case 'boolean':\n return is_bool($value);\n }\n } else {\n return $this->class->isInstance($value);\n }\n }",
"protected function isValidMessageType(string $type): bool\n {\n return $this->getValidMessageTypes()->contains($type);\n }",
"public function validType ($type) {\r\n return in_array($type, static::$types);\r\n }",
"function isType($value, $type)\n{\n\tif (!$type) {\n\t\treturn false;\n\t}\n\n\t$types = (array)$type;\n\t$match = false;\n\n\tforeach ($types as $type) {\n\t\tif (\\function_exists(\"is_$type\")) {\n\t\t\tif (\\call_user_func(\"is_$type\", $value)) {\n\t\t\t\t$match = true;\n\t\t\t}\n\t\t} elseif ($type === 'function') {\n\t\t\tif ($value instanceof \\Closure || $value instanceof Func) {\n\t\t\t\t$match = true;\n\t\t\t}\n\t\t} elseif ($type === 'countable') { // polyfill for PHP <7.3\n\t\t\tif ((\\is_array($value) || $value instanceof \\Countable)) {\n\t\t\t\t$match = true;\n\t\t\t}\n\t\t} elseif ($value instanceof $type) {\n\t\t\t$match = true;\n\t\t}\n\n\t\tif ($match) {\n\t\t\treturn $type;\n\t\t}\n\t}\n\n\treturn false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Grab a POST param value by name. | public function param($name) {
if (isset($_POST[$name])) {
return $_POST[$name];
}
else {
return null;
}
} | [
"public function getPostValue($name)\n {\n if (empty($_GET[$name]))\n throw new ToolsExceptions(\"POST['\".$name.\"'] parameter do not exist\");\n\n return $_POST[$name];\n }",
"public function getPostVariable($name);",
"public function getPostParameter($name)\n {\n if (isset($this->postParameters[$name])) {\n return $this->postParameters[$name];\n } else {\n return null;\n }\n }",
"function getPost($name){\n return $_POST[$name];\n }",
"public function getParameter($name) {\n if (isset($_REQUEST[$name])) {\n $value = $_REQUEST[$name];\n if (!is_array($value))\n return $value;\n }\n return null;\n }",
"function getParam_POST($paramName)\r\n {\r\n if(isset($_POST[\"$paramName\"]))\r\n return $_POST[\"$paramName\"];\r\n else\r\n return false;\r\n }",
"static function getFormValue($name)\n {\n if (isset($_POST[$name]))\n {\n return $_POST[$name];\n } else {\n if (isset($_GET[$name]))\n {\n return $_GET[$name];\n } else {\n return '';\n }\n }\n }",
"public function getPostParameter($key = null);",
"function param_value($param_name){\n $qs = self::query_string();\n if(!empty($qs)){\n parse_str($qs, $params);\n $param_value = $params[$param_name];\n } else {\n $param_value = NULL;\n }\n \n return($param_value);\n }",
"public function getParam($name);",
"public function param($name) {\n return Request::instance()->param($name);\n }",
"function postvalue($name) {\n\tif (isset ( $_POST [$name] ))\n\t\t$value = $_POST [$name];\n\telse if (isset ( $_GET [$name] ))\n\t\t$value = $_GET [$name];\n\telse\n\t\treturn \"\";\n\tif (! is_array ( $value ))\n\t\treturn refine ( $value );\n\t$ret = array ();\n\tforeach ( $value as $key => $val )\n\t\t$ret [$key] = refine ( $val );\n\treturn $ret;\n}",
"public function getParam(string $name);",
"function postvalue($name)\n{\n\tif(array_key_exists($name,$_POST))\n\t\t$value=$_POST[$name];\n\telse if(array_key_exists($name,$_GET))\n\t\t$value=$_GET[$name];\n\telse\n\t\treturn \"\";\n\tif(!is_array($value))\n\t\treturn refine($value);\n\t$ret=array();\n\tforeach($value as $key=>$val)\n\t\t$ret[$key]=refine($val);\n\treturn $ret;\n}",
"public function ByName(string $name) {\n\t\tforeach ($this->params as $param) {\n\t\t\tif $param->key == $name {\n\t\t\t\treturn $param->value;\n\t\t\t}\n\t\t}",
"protected function getParameter($name)\n\t{\n\t\treturn $this->container->getParameter($name);\n\t}",
"function getVar( $name ) {\n //Planning ahead for GET & POST support in one ambiguous class\n if( $this->method == 'post' ) {\n\t return $_POST[$name];\n } else {\n\t return $_GET[$name];\n }\n }",
"public static function getParameter($name)\n {\n return self::getInstance()->getContainer()->getParameter($name);\n }",
"function GetPost($name, $default = null)\r\n{\r\n\tglobal $HTTP_POST_VARS;\r\n\r\n\tif (!empty($_POST[$name]))\r\n\t{\r\n\t\tTrace(\"GetVar(): $name (Post) -> {$_POST[$name]}<br/>\\n\");\r\n\t\treturn $_POST[$name];\r\n\t}\r\n\r\n\tif (isset($HTTP_POST_VARS[$name]) && strlen($HTTP_POST_VARS[$name]) > 0)\r\n\t\treturn $HTTP_POST_VARS[$name];\r\n\r\n\treturn $default;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add an already opened AtomicTempFileObject file. | public function addFile($file): AtomicTempFileObjects
{
$realPath = $file->getDestinationRealPath();
if ($this->isFileOpen($realPath)) {
throw new \RuntimeException("File: " . $realPath . " already opened!");
}
$this->files[$realPath] = $file;
return $this;
} | [
"function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options)\n {\n }",
"private function createNewTempFile()\n {\n $this->currentFileLines = 0;\n $this->timestamp = $this->getTimestamp();\n\n $this->filename = $this->filePrefix . '-' . $this->timestamp . self::TEMPORARY_FILE_EXTENSION;\n $absolutePath = $this->filePath . $this->filename;\n\n if (file_exists($absolutePath)) {\n $this->logger->debug(\n MappIntelligenceMessages::$USE_EXISTING_LOG_FILE,\n $this->filename,\n $absolutePath\n );\n } else {\n $this->logger->debug(\n MappIntelligenceMessages::$CREATE_NEW_LOG_FILE,\n $this->filename,\n $absolutePath,\n 'true'\n );\n }\n\n $this->file = $this->getFileResource($absolutePath);\n }",
"private function _registerTempFile(\\Xi\\Filelib\\File\\FileObject $fo)\n {\n $this->_tempFiles[] = $fo;\n }",
"public function add(){\n\t\t\n\t\t// Open or create file\n\t\t$f = fopen($this->file, 'wb');\n\t\tfclose($f);\n\t}",
"function addFileToStorage($filePath)\r\n{\r\n $fileObject = TYPO3\\CMS\\Core\\Resource\\ResourceFactory::getInstance()->retrieveFileOrFolderObject($filePath);\r\n}",
"public function addFile($file);",
"function addFile(FileUpload $file)\n\t{\n\t\t$file->move($this->getUniqueFilePath());\n\t\t$this->query('INSERT INTO files (queueID, created, data, name) VALUES (\"' . sqlite_escape_string($this->getQueueID()) . '\",' . time() . ',\\'' . sqlite_escape_string(serialize($file)) . '\\', \\'' . sqlite_escape_string($file->getName()) . '\\')');\n\t}",
"public function createTempFile() {\n $this->temp_file = 'temporary:///rdfimporter_batch_' . md5(serialize($this->uri_list)) . '.tmp';\n if (!file_unmanaged_save_data(serialize($this->arc), $this->temp_file, FILE_EXISTS_REPLACE)) {\n drupal_set_message(t('RDFimporter: Could not write temporary files to the Drupal temp directory. Make sure the temp directory set at /admin/settings/file-system is writable.'), 'warning', FALSE);\n }\n }",
"public function addFile($file) { }",
"public function addToTrash($file)\n {\n if ($this->exists($file)) {\n self::$trash[] = $file;\n }\n }",
"public function addTemporaryFileUploaded($fileInfo, $context) {\n $keyState = \"files-$context\";\n $files = $this->hasState($keyState) ? $this->getState($keyState) : array();\n $files[$fileInfo['path']] = $fileInfo;\n $this->setState($keyState, $files);\n }",
"function tmpfile () {}",
"function add_file_obj($path = null, $media_type = null, $size = null, $duration = null, \n $container = null, $bitrate = null, $width = null, $height = null, \n $frames = null, $framerate = null, $samplerate = null)\n {\n array_push($this->file_objs, new FileObj($path, $media_type, $size, $duration, $container, $bitrate, $width, $height, $frames, $framerate, $samplerate));\n $this->update_files = 1;\n }",
"public function add_file(\\PodioFile $file){\n $this->files[] = $file;\n }",
"public function testTemp()\r\n\t{\r\n\t\t// Create and write, could also import file\r\n\t\t$file = $this->antfs->createTempFile();\r\n\t\t$fid = $file->id;\r\n\t\t$size = $file->write(\"test contents\");\r\n\t\t$this->assertNotEquals($size, -1);\r\n\r\n\t\t// Make sure there is content in this file\r\n\t\t$buf = $file->read();\r\n\t\t$this->assertEquals($buf, \"test contents\");\r\n\t\t$file->close();\r\n\r\n\t\t// Purge and make sure it is not touched\r\n\t\t$this->antfs->purgeTemp();\r\n\t\t$file = $this->antfs->openFileById($fid);\r\n\t\t$this->assertNotNull($file);\r\n\r\n\t\t// Now backdate so it will be purged\r\n\t\t$file->setValue(\"ts_entered\", date(\"m/d/Y\", strtotime(\"-2 months\")));\r\n\t\t$file->save();\r\n\t\tunset($file);\r\n $this->antfs->debug = true;\r\n\t\t$purged = $this->antfs->purgeTemp();\r\n\t\t$this->assertTrue($purged > 0);\r\n\t\t$file = $this->antfs->openFileById($fid);\r\n\t\t$this->assertNull($file);\r\n\t}",
"public function createTempFile()\r\n\t{\r\n\t\t$file = null;\r\n\r\n\t\t$fldr = $this->openFolder(\"%tmp%\", true);\r\n\t\tif ($fldr)\r\n\t\t{\r\n\t\t\t$file = $fldr->openFile(\"tempfilename\", true);\r\n\t\t}\r\n\r\n\t\treturn $file;\r\n\t}",
"public function addFile($pathToFile, $pathInArchive)\n {\n $this->entries[$pathInArchive] = $pathInArchive;\n }",
"public function addFile($file)\n {\n return $file->copy($this->getCacheDirectory() . '/' . $file->getHash(), true);\n }",
"public function newFromTempFile( $tmpfile, $filename, $stat = array(), $mime = \"application/octet-stream\" ) {\n\t\t$this->newFile( $filename, $stat, $mime );\n\t\t$this->writeFile( $tmpfile );\n\t\tunlink( $tmpfile );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the OehhCntrNbr column Example usage: $query>filterByOehhcntrnbr(1234); // WHERE OehhCntrNbr = 1234 $query>filterByOehhcntrnbr(array(12, 34)); // WHERE OehhCntrNbr IN (12, 34) $query>filterByOehhcntrnbr(array('min' => 12)); // WHERE OehhCntrNbr > 12 | public function filterByOehhcntrnbr($oehhcntrnbr = null, $comparison = null)
{
if (is_array($oehhcntrnbr)) {
$useMinMax = false;
if (isset($oehhcntrnbr['min'])) {
$this->addUsingAlias(SalesHistoryTableMap::COL_OEHHCNTRNBR, $oehhcntrnbr['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($oehhcntrnbr['max'])) {
$this->addUsingAlias(SalesHistoryTableMap::COL_OEHHCNTRNBR, $oehhcntrnbr['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SalesHistoryTableMap::COL_OEHHCNTRNBR, $oehhcntrnbr, $comparison);
} | [
"public function filterByOehhnbr($oehhnbr = null, $comparison = null)\n {\n if (is_array($oehhnbr)) {\n $useMinMax = false;\n if (isset($oehhnbr['min'])) {\n $this->addUsingAlias(SalesHistoryLotserialTableMap::COL_OEHHNBR, $oehhnbr['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($oehhnbr['max'])) {\n $this->addUsingAlias(SalesHistoryLotserialTableMap::COL_OEHHNBR, $oehhnbr['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SalesHistoryLotserialTableMap::COL_OEHHNBR, $oehhnbr, $comparison);\n }",
"protected function buildFilterCriteria() {\r\n\t\t\r\n\t\t$ticketScanner = Tx_PtConference_Domain_Model_Scanner_TicketScannerFactory::createInstance($this->scannerIdentifier);\r\n\t\t\r\n\t\t$criteria = NULL;\r\n\t\t$columnName = $this->fieldIdentifier->getTableFieldCombined();\r\n\t\t$filterValues = array_filter($ticketScanner->getTicketCodes());\r\n\t\t\r\n\t\tif (!is_array($filterValues) || count($filterValues) == 0) {\r\n\t\t\t$criteria = Tx_PtExtlist_Domain_QueryObject_Criteria::equals($columnName, '-');\r\n\t\t} elseif (is_array($filterValues) && count($filterValues) > 0) {\r\n\t\t\t$criteria = Tx_PtExtlist_Domain_QueryObject_Criteria::in($columnName, $filterValues);\r\n\t\t}\r\n\r\n\t\treturn $criteria;\r\n\t}",
"function filterByCatalogNbr($course, $catalogNbr)\n {\n\n if (!isset($catalogNbr) || $catalogNbr == \"\" || stripos($catalogNbr, \"all\") !== false)\n return true;\n\n // course number input is like min'-'max\n $values = explode(\"-\", $catalogNbr);\n if ($values[1] == \"above\") {\n\n if ($course[\"course_catalog_nbr\"] >= $values[0])\n return true;\n } else {\n\n if ($course[\"course_catalog_nbr\"] >= $values[0] &&\n $course[\"course_catalog_nbr\"] < $values[1]\n )\n return true;\n }\n\n return false;\n }",
"public function filterByOehhnbr($oehhnbr = null, $comparison = null)\n {\n if (is_array($oehhnbr)) {\n $useMinMax = false;\n if (isset($oehhnbr['min'])) {\n $this->addUsingAlias(SalesHistoryDetailTableMap::COL_OEHHNBR, $oehhnbr['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($oehhnbr['max'])) {\n $this->addUsingAlias(SalesHistoryDetailTableMap::COL_OEHHNBR, $oehhnbr['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SalesHistoryDetailTableMap::COL_OEHHNBR, $oehhnbr, $comparison);\n }",
"public function actionFilterTable()\n {\n //get all params from post(or get)\n $client_name = Yii::app()->request->getParam('cli_name', '');\n $client_type_id = Yii::app()->request->getParam('cli_type_id',null);\n $invoice_code = Yii::app()->request->getParam('in_code','');\n $operation_status_id = Yii::app()->request->getParam('in_status_id','');\n $stock_city_id = Yii::app()->request->getParam('stock_city_id','');\n $date_from_str = Yii::app()->request->getParam('date_from_str','');\n $date_to_str = Yii::app()->request->getParam('date_to_str','');\n $page = Yii::app()->request->getParam('page',1);\n $on_page = Yii::app()->request->getParam('on_page',3);\n\n //date range by default\n $time_from = 0;\n $time_to = time() + (60 * 60 * 24);\n\n //criteria\n $c = new CDbCriteria();\n\n //if client name not empty\n if(!empty($client_name))\n {\n if(!empty($client_type_id))\n {\n //if not company (physical person)\n if($client_type_id != 1)\n {\n $names = explode(\" \",$client_name,2);\n if(count($names) > 1)\n {\n $c -> addCondition('client.name LIKE \"%'.$names[0].'%\" AND client.surname LIKE \"%'.$names[1].'%\"');\n }\n else\n {\n $c -> addCondition('client.name LIKE \"%'.$client_name.'%\"');\n }\n }\n\n //if company\n else\n {\n $c -> addCondition('client.company_name LIKE \"%'.$client_name.'%\"');\n }\n }\n else\n {\n $names = explode(\" \",$client_name,2);\n if(count($names) > 1)\n {\n $c -> addCondition('client.name LIKE \"%'.$names[0].'%\" AND client.surname LIKE \"%'.$names[1].'%\" OR client.company_name LIKE \"%'.$client_name.'%\"');\n }\n else\n {\n $c -> addCondition('client.name LIKE \"%'.$client_name.'%\" OR client.company_name LIKE \"%'.$client_name.'%\"');\n }\n }\n }\n elseif(!empty($client_type_id))\n {\n $c -> addCondition('client.type = '.$client_type_id.'');\n }\n\n if(!empty($stock_city_id))\n {\n $c -> addCondition('stock.location_id = '.$stock_city_id.'');\n }\n\n //if given dates\n if(!empty($date_from_str))\n {\n $dt = DateTime::createFromFormat('m/d/Y',$date_from_str);\n $time_from = $dt->getTimestamp();\n }\n if(!empty($date_to_str))\n {\n $dt = DateTime::createFromFormat('m/d/Y',$date_to_str);\n $time_to = $dt->getTimestamp();\n $time_to += (60*60*24); //add one day\n }\n\n //if invoice code set\n if(!empty($invoice_code))\n {\n $c -> addInCondition('invoice_code',array($invoice_code));\n }\n\n //if operation status set\n if(!empty($operation_status_id))\n {\n $c -> addInCondition('status_id',array($operation_status_id));\n }\n\n //search between times\n $c -> addBetweenCondition('date_created_ops',$time_from,$time_to);\n\n //get all items by conditions and limit them by criteria\n $operations = OperationsOut::model()->with(array('client','stock.location'))->findAll($c);\n\n $pagination = new CPagerComponent($operations,$on_page,$page);\n\n //render partial\n $this->renderPartial('_ajax_table_filtering',array('pager' => $pagination));\n\n }",
"public function filterByNumber($number = null, $comparison = null)\r\n\t{\r\n\t\tif (is_array($number)) {\r\n\t\t\t$useMinMax = false;\r\n\t\t\tif (isset($number['min'])) {\r\n\t\t\t\t$this->addUsingAlias(ClientAddressPeer::NUMBER, $number['min'], Criteria::GREATER_EQUAL);\r\n\t\t\t\t$useMinMax = true;\r\n\t\t\t}\r\n\t\t\tif (isset($number['max'])) {\r\n\t\t\t\t$this->addUsingAlias(ClientAddressPeer::NUMBER, $number['max'], Criteria::LESS_EQUAL);\r\n\t\t\t\t$useMinMax = true;\r\n\t\t\t}\r\n\t\t\tif ($useMinMax) {\r\n\t\t\t\treturn $this;\r\n\t\t\t}\r\n\t\t\tif (null === $comparison) {\r\n\t\t\t\t$comparison = Criteria::IN;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->addUsingAlias(ClientAddressPeer::NUMBER, $number, $comparison);\r\n\t}",
"public function filterByOehhnbr($oehhnbr = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($oehhnbr)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SalesHistoryNotesTableMap::COL_OEHHNBR, $oehhnbr, $comparison);\n }",
"public function filterByOehdnbr($oehdnbr = null, $comparison = null)\n {\n if (is_array($oehdnbr)) {\n $useMinMax = false;\n if (isset($oehdnbr['min'])) {\n $this->addUsingAlias(SalesOrderDetailTableMap::COL_OEHDNBR, $oehdnbr['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($oehdnbr['max'])) {\n $this->addUsingAlias(SalesOrderDetailTableMap::COL_OEHDNBR, $oehdnbr['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SalesOrderDetailTableMap::COL_OEHDNBR, $oehdnbr, $comparison);\n }",
"public function filterByNBROh($nBROh = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($nBROh)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $nBROh)) {\n $nBROh = str_replace('*', '%', $nBROh);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(FournisseurTableMap::COL_NBR_OH, $nBROh, $comparison);\n }",
"public function filterByNumrue($numrue = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($numrue)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $numrue)) {\n $numrue = str_replace('*', '%', $numrue);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(InfosTableMap::COL_NUM_RUE, $numrue, $comparison);\n }",
"public function filterByPonbr($ponbr, $comparison = null) {\n\t\treturn $this->filterByPothnbr($ponbr, $comparison);\n\t}",
"public function filterByDni($dni = null, $comparison = null)\n {\n if (is_array($dni)) {\n $useMinMax = false;\n if (isset($dni['min'])) {\n $this->addUsingAlias(ClientePeer::DNI, $dni['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($dni['max'])) {\n $this->addUsingAlias(ClientePeer::DNI, $dni['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientePeer::DNI, $dni, $comparison);\n }",
"public function filterByOrdernbr($ordernbr = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($ordernbr)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(WmpickdetTableMap::COL_ORDERNBR, $ordernbr, $comparison);\n }",
"public function filterByOehhcrntuser($oehhcrntuser = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($oehhcrntuser)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SalesHistoryTableMap::COL_OEHHCRNTUSER, $oehhcrntuser, $comparison);\n }",
"public function filterBySecuNumber($secuNumber = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($secuNumber)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $secuNumber)) {\n $secuNumber = str_replace('*', '%', $secuNumber);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::SECU_NUMBER, $secuNumber, $comparison);\n }",
"public function searchCustoemrWithTelno($telno) {\n //return $customerModel;\n return 0;\n }",
"public function searchPoItemNumberAction($poNum, $minDate, $maxDate)\n {\n\t$filterDate = PoManagerControllerUtility::convertDateFilter($minDate, $maxDate);\n\t$repository = $this->getDoctrine()\n\t ->getManager()\n\t\t\t ->getRepository('AchPoManagerBundle:PoItem');\n\t\n\t$request = $this->getRequest();\n\n\t$poItems = $repository->findPoNum($poNum, $filterDate, ($request->query->get('match') == 'exact') );\n\t\n\treturn $this->generateResponse($request, $poItems);\n }",
"public function filterByOrdernbr($ordernbr = null, $comparison = null)\n {\n if (is_array($ordernbr)) {\n $useMinMax = false;\n if (isset($ordernbr['min'])) {\n $this->addUsingAlias(BoatInventoryTableMap::COL_ORDERNBR, $ordernbr['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($ordernbr['max'])) {\n $this->addUsingAlias(BoatInventoryTableMap::COL_ORDERNBR, $ordernbr['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(BoatInventoryTableMap::COL_ORDERNBR, $ordernbr, $comparison);\n }",
"public function filterByValor($valor = null, $comparison = null)\n\t{\n\t\tif (is_array($valor)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($valor['min'])) {\n\t\t\t\t$this->addUsingAlias(TicketPeer::VALOR, $valor['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($valor['max'])) {\n\t\t\t\t$this->addUsingAlias(TicketPeer::VALOR, $valor['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(TicketPeer::VALOR, $valor, $comparison);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the center for the set markers | public function getMarkersCenter() {
if (!$this->arrMapMarkers || sizeof($this->arrMapMarkers) <= 0) return;
if (sizeof($this->arrMapMarkers) == 1) {
return explode(',',$this->arrMapMarkers[0]['coords']);
}
$arrCoordinates = array(
'lat' => array(),
'lng' => array()
);
foreach ($this->arrMapMarkers as $mapMarker) {
$arrCoords = explode(',',$mapMarker['coords']);
array_push($arrCoordinates['lat'], $arrCoords[0]);
array_push($arrCoordinates['lng'], $arrCoords[1]);
}
sort($arrCoordinates['lat'], SORT_NUMERIC);
sort($arrCoordinates['lng'], SORT_NUMERIC);
// calc center
$arrRet = array(
( // latitude
floatval(end($arrCoordinates['lat'])) -
(
(
floatval(end($arrCoordinates['lat'])) - floatval($arrCoordinates['lat'][0])
)
/2
)
),
( // longtitude
floatval(end($arrCoordinates['lng'])) -
(
(
floatval(end($arrCoordinates['lng'])) - floatval($arrCoordinates['lng'][0])
)
/2
)
),
);
return $arrRet;
} | [
"private function setCenter() {\n $count = count($this->path);\n if($count > 0) {\n $lastIndex = $count-1;\n $latitude = ($this->path[0]->getLatitude() + $this->path[$lastIndex]->getLatitude()) / 2;\n $longitude = ($this->path[0]->getLongitude() + $this->path[$lastIndex]->getLongitude()) / 2;\n $this->centerLatitude = $latitude;\n $this->centerLongitude = $longitude;\n }\n }",
"private function calculateCenter()\n {\n $center = new \\Math_Vector3(array(0, 0, 0));\n foreach ($this->vertexes as $vertex) {\n $center = new \\Math_Vector3(\\Math_VectorOp::add($center, $vertex)->getTuple());\n }\n $center = new \\Math_Vector3(\\Math_VectorOp::scale(1 / count($this->vertexes), $center)->getTuple());\n return $center;\n }",
"public function center()\n {\n return $this->sw->midpointTo($this->ne);\n }",
"function calcCenter($CMap) {\r\n\t\t$x = 0;\r\n\t\t$topLat = $btmLat = $CMap->location[$x]->getLat();\r\n\t\t$topLng = $btmLng = $CMap->location[$x]->getLng();\r\n\t\twhile ($x < count($CMap->location)) {\r\n\t\t\tif ($topLat < $CMap->location[$x]->getLat()) {$topLat = $CMap->location[$x]->getLat();}\r\n\t\t\tif ($topLng < $CMap->location[$x]->getLng()) {$topLng = $CMap->location[$x]->getLng();}\r\n\t\t\tif ($btmLat > $CMap->location[$x]->getLat()) {$btmLat = $CMap->location[$x]->getLat();}\r\n\t\t\tif ($btmLng > $CMap->location[$x]->getLng()) {$btmLng = $CMap->location[$x]->getLng();}\t\t\r\n\t\t\t$x += 1;\r\n\t\t}\r\n\t\treturn new Location( (($topLat + $btmLat) / 2), (($topLng + $btmLng) / 2), '' );\r\n\t}",
"public function getGeomCenter()\n {\n return $this->geom_center;\n }",
"public function center() {\n return new geopoint(($this->north + $this->south) / 2, ($this->east + $this->west) / 2);\n }",
"public function center()\n {\n return new Point(($this->north + $this->south) / 2, ($this->east + $this->west) / 2);\n }",
"public function getCenter()\n {\n return $this->center;\n }",
"public function center()\n {\n $a = new Point(new Vector([7, 9]));\n $b = new Point(new Vector([13, 17]));\n $line = new LineSegment($a, $b);\n $centerTerms = $line->center()->terms();\n\n $this->assertEquals(10.0, $centerTerms[0], '', 1e-10);\n $this->assertEquals(13.0, $centerTerms[1], '', 1e-10);\n }",
"protected function calculateCenter()\n {\n $this->centerX = intval(($this->sourceImageWidth / 2) - ($this->postMergeImageWidth / 2));\n $this->centerY = intval(($this->sourceImageHeight / 2) - ($this->postMergeImageHeight / 2));\n }",
"public function setCenter()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof Coordinate)) {\n $this->center = $args[0];\n } elseif ((isset($args[0]) && is_numeric($args[0])) && (isset($args[1]) && is_numeric($args[1]))) {\n $this->center->setLatitude($args[0]);\n $this->center->setLongitude($args[1]);\n\n if (isset($args[2]) && is_bool($args[2])) {\n $this->center->setNoWrap($args[2]);\n }\n } else {\n throw OverlayException::invalidCircleCenter();\n }\n }",
"public function getCenterOfBounds()\n\t{\n\t\treturn EGMapBounds::getBoundsContainingPolygons(array($this))->getCenterCoord();\n\t}",
"public function getCenterX()\n {\n return $this->getX() + $this->getWidth() / 2.0;\n }",
"public function getCenterOfArea();",
"public function getCenter() {\n return S2LatLng::fromRadians($this->lat->getCenter(), $this->lng->getCenter());\n }",
"public function getCenter()\n {\n return $this->person->getCenter();\n }",
"private function _calculateCenter($cluster)\n {\n // Calculate average lat and lon of clustered items\n $south = 0;\n $west = 0;\n $north = 0;\n $east = 0;\n\n $lat_sum = $lon_sum = 0;\n foreach ($cluster as $marker)\n {\n if (!$south)\n {\n $south = $marker->location->latitude;\n }\n elseif ($marker->location->latitude < $south)\n {\n $south = $marker->location->latitude;\n }\n\n if (!$west)\n {\n $west = $marker->location->longitude;\n }\n elseif ($marker->location->longitude < $west)\n {\n $west = $marker->location->longitude;\n }\n\n if (!$north)\n {\n $north = $marker->location->latitude;\n }\n elseif ($marker->location->latitude > $north)\n {\n $north = $marker->location->latitude;\n }\n\n if (!$east)\n {\n $east = $marker->location->longitude;\n }\n elseif ($marker->location->longitude > $east)\n {\n $east = $marker->location->longitude;\n }\n\n $lat_sum += $marker->location->latitude;\n $lon_sum += $marker->location->longitude;\n }\n $lat_avg = $lat_sum / count($cluster);\n $lon_avg = $lon_sum / count($cluster);\n\n $center = $lon_avg.\",\".$lat_avg;\n $sw = $west.\",\".$south;\n $ne = $east.\",\".$north;\n\n return array(\n \"center\"=>$center,\n \"sw\"=>$sw,\n \"ne\"=>$ne\n );\n }",
"public function getCenter()\n {\n return $this->addMethod('getCenter');\n }",
"public function getCenterLng()\n {\n return (is_null($this->getSouthWest()) || is_null($this->getNorthEast()))\n ? null\n : floatval(($this->getSouthWest()->getLng() + $this->getNorthEast()->getLng()) / 2);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chacks if there is an error for the given attribute | public function hasError($attribute)
{
return $this->errors[$attribute] ? true :false;
} | [
"public function hasError($attribute)\n {\n return $this->hasErrorSession($attribute);\n }",
"public function addError(string $attribute, string $error): void;",
"public function hasError(string $attr): bool\n {\n return !empty($this->errors[$attr]);\n }",
"public function addError($attribute, $error = '');",
"public function error(string $attribute): array;",
"public function addError($attribute, $error = '')\n {\n if ($attribute == 'instid') {\n $this->_errors = CommFun::renderFormat('105',[],$error);\n }elseif($attribute == 'uid'){\n $this->_errors = CommFun::renderFormat('106',[],$error);\n }else{\n $this->_errors[$attribute][] = $error;\n }\n }",
"public function isError($field);",
"public function addError($attribute, $error = '')\n {\n if ($attribute == 'id' || $attribute == 'category') {\n $this->_errors = CommFun::renderFormat('204',[],$error);\n }else{\n $this->_errors[$attribute][] = $error;\n }\n }",
"public function isError()\n {\n if (strcasecmp($this->attributes['type'], self::ERROR) == 0) {\n return true;\n }\n return false;\n }",
"abstract protected function validateAttribute($object, $attribute);",
"public static function hasErrorSession($attribute)\n {\n if (isset($_SESSION['FORM_ERRORS'][$attribute])) {\n $data = $_SESSION['FORM_ERRORS']; // tmp\n if (isset($data[$attribute]['error'])) {\n $_SESSION['FORM_ERRORS'][$attribute]['error'] = null; // Kill it\n return true;\n }\n }\n return false;\n }",
"abstract protected function validateAttribute(AttributeMetadata $attribute);",
"public function testMagicInvalidAttribute()\n {\n $this->expectException(AttributeNotFoundException::class);\n $this->product->getNonExistingAttribute();\n }",
"public function testMagicInvalidAttribute()\n {\n $this->expectException(AttributeNotFoundException::class);\n $this->book->getNonExistingAttribute();\n }",
"public function addError($attribute, $error = '')\n {\n if ($attribute == 'FundCode') {\n $this->_errors = CommFun::renderFormat('202',[],$error);\n }else{\n $this->_errors[$attribute][] = $error;\n }\n }",
"public function fieldHasError($field);",
"public function getError($attribute)\n\t{\n\t\treturn isset($this->_errors[$attribute]) ? reset($this->_errors[$attribute]) : null;\n\t}",
"abstract public function isFailed();",
"public function validateAttribute($attribute)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getReportDataSetPageWithHttpInfo Get a report data set page | public function getReportDataSetPageWithHttpInfo($dataset_uuid, $page_number)
{
return $this->getReportDataSetPageWithHttpInfoRetry(true , $dataset_uuid, $page_number);
} | [
"public function getPageData();",
"public function getReportsWithHttpInfo()\n {\n return $this->getReportsWithHttpInfoRetry(true );\n }",
"public function getReports()\n\t\t{\n\t\t\t$ch = curl_init();\n\t\t\t$timeout = 10;\n\t\t\t$uri = 'http://localhost:8080/birt-viewer/frameset?__report=test.rptdesign&sample=my+parameter';\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\n\t\t\t//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\t\t$data = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\treturn $data;\n\t\t}",
"protected function getReportDataSetPageRequest($dataset_uuid, $page_number)\n {\n // verify the required parameter 'dataset_uuid' is set\n if ($dataset_uuid === null || (is_array($dataset_uuid) && count($dataset_uuid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $dataset_uuid when calling getReportDataSetPage'\n );\n }\n // verify the required parameter 'page_number' is set\n if ($page_number === null || (is_array($page_number) && count($page_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $page_number when calling getReportDataSetPage'\n );\n }\n\n $resourcePath = '/datawarehouse/reports/dataset/{dataset_uuid}/pages/{page_number}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($dataset_uuid !== null) {\n $resourcePath = str_replace(\n '{' . 'dataset_uuid' . '}',\n ObjectSerializer::toPathValue($dataset_uuid),\n $resourcePath\n );\n }\n // path params\n if ($page_number !== null) {\n $resourcePath = str_replace(\n '{' . 'page_number' . '}',\n ObjectSerializer::toPathValue($page_number),\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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-ultracart-simple-key');\n if ($apiKey !== null) {\n $headers['x-ultracart-simple-key'] = $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 }",
"abstract protected function get_page_data($page_number);",
"public function getPageInfo()\n\t{\n\t\t$limit = (int)$this->getLimit();\n $this->_collection->setPageSize($limit);\n\t}",
"public function getPageData(): PageData\n {\n return $this->pageData;\n }",
"public function getPageData()\r\n {\r\n if ($this->data === null)\r\n {\r\n $data = array(\r\n 'page' => $this->getConfig(),\r\n 'asset'=> $this->getAssetor(),\r\n 'pagination' => $this->getPaginator(),\r\n 'link' => $this->getLinker()\r\n );\r\n \r\n $data['page']['url'] = $this->pieCrust->formatUri($this->getUri());\r\n $data['page']['slug'] = $this->getUri();\r\n \r\n if ($this->getConfigValue('date'))\r\n $timestamp = strtotime($this->getConfigValue('date'));\r\n else\r\n $timestamp = $this->getDate();\r\n if ($this->getConfigValue('time'))\r\n $timestamp = strtotime($this->getConfigValue('time'), $timestamp);\r\n $data['page']['timestamp'] = $timestamp;\r\n $dateFormat = $this->getConfigValue('date_format', ($this->blogKey != null ? $this->blogKey : 'site'));\r\n $data['page']['date'] = date($dateFormat, $timestamp);\r\n \r\n switch ($this->type)\r\n {\r\n case Page::TYPE_TAG:\r\n if (is_array($this->key))\r\n {\r\n $data['tag'] = implode(' + ', $this->key);\r\n }\r\n else\r\n {\r\n $data['tag'] = $this->key;\r\n }\r\n break;\r\n case Page::TYPE_CATEGORY:\r\n $data['category'] = $this->key;\r\n break;\r\n }\r\n \r\n if ($this->extraData != null)\r\n {\r\n $data = array_merge($data, $this->extraData);\r\n }\r\n \r\n $this->data = $data;\r\n }\r\n return $this->data;\r\n }",
"public function get_page_info() {\n\t\t$sr = $this->get_signed_request();\n\t\t$pageId = $sr['page']['id'];\n\t\t$url = 'https://graph.facebook.com/'. $pageId;\n\t\t$params = array();\t\t\t\n\t\t$result = $this->doCurl($url,$params);\t\t\n\t\t$data = json_decode($result['content']);\n\t\treturn $data;\n\t}",
"public function getPages();",
"static public function getReportInfo(){\r\n\t\t$details = self::_getReportDetail();\r\n\t\treturn $details;\r\n\t}",
"public function get_pages($survey_id, $page = NULL)\n\t{\n\t\t$data = array();\n\n\t\t// If we are attempting to get a specific page\n\t\tif ( isset($page) )\n\t\t{\n\t\t\t$this->db->where('page', $page);\n\t\t}\n\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->get('vwm_surveys_pages');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($query->result() as $row)\n\t\t\t{\n\t\t\t\t$data[ (int)$row->page ] = array(\n\t\t\t\t\t'page' => $row->page,\n\t\t\t\t\t'title' => $row->title,\n\t\t\t\t\t'description' => $row->description\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}",
"public function paginationData(){\n\n $total = $this->getTotal();\n\n $limit = explode(\" \", $this->paginate); \n\n $perpage = intval($limit[count($limit)-1]);\n\n $page = isset($_GET[\"page\"]) ? intval($_GET[\"page\"]) : 1;\n\n $totalPages = ceil($total / $perpage);\n\n return array('page' => $page, 'totalPages' => $totalPages);\n \n }",
"public function getResultPage()\n {\n if (is_null($this->_resultPage)) \n\t\t{\n $this->_resultPage = $this->_resultPageFactory->create();\n }\n\t\t\n return $this->_resultPage;\n }",
"public function getReport();",
"public function getReportPaginated($request, $per_page, $agent_id, $status = 1);",
"public function getAllPages()\n {\n $sql = \"SELECT * FROM pagedata\";\n $query = $this->db->prepare($sql);\n $query->executce();\n\n return $query->fetch();\n }",
"public function getDataManagerCollectionWithHttpInfo($page = '1')\n {\n $returnType = '\\Swagger\\Client\\Model\\InlineResponse2001';\n $request = $this->getDataManagerCollectionRequest($page);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\InlineResponse2001',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function Info()\n {\n return new PagedRequest($this->api_domain, 'info', 'info');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the content with 'namespace' by stubifying the provided content. | private function getContentByStub($stub_content, $folder = null)
{
return stubify(
$stub_content,
[
'namespace' => path_to_namespace(
# here, we must trim the $namespace by
# getting the base path to be our matching trimmer
str_replace($this->getBasePath(), '', $this->getNamespace().'/'.$folder)
),
]
);
} | [
"public function /*string*/get(/*SfStub*/$stub) {\n $content = $this->ns->get($stub->name);\n return $content;\n }",
"protected function getStubContent(){\n\t\tif($this->stubContent != NULL){\n\t\t\treturn $this->stubContent;\n\t\t}\n\t\treturn $this->fileSystem->get($this->getStubPath());\n\t}",
"public function getByNamespace($namespace);",
"public function getPageContentByNamespace($ns)\r\n {\r\n // max number of pages to load in one http request\r\n $pidlimit = Zend_Registry::get('config')->dbpedia->api->synchronous->pageload->limit;\r\n \r\n // fetch a list of all pages of given namespace\r\n $templateList = $this->getPagesByNamespace($ns);\r\n\r\n // temporaray page id collection for the next http call\r\n $pids = array();\r\n\r\n // instantiate list/data holder for MediaWiki page represantations\r\n $list = new Tht_MediaWiki_DocumentList();\r\n\r\n // walk through the source list of pages of namespace\r\n for($i = 0; $i < count($templateList); $i++){\r\n\r\n // collect the pid of the current page of namespace\r\n $pids[] = intval($templateList[$i]['pageid']);\r\n\r\n // every $pidlimit walks make a http call to the MediaWiki for retrieving content\r\n if((($i+1) % $pidlimit == 0) OR ($i == count($templateList)-1)){\r\n\r\n // prepare paramters for http call\r\n $getParameters = array(\r\n 'action' => 'query',\r\n 'prop' => 'revisions',\r\n 'indexpageids' => true,\r\n 'pageids' => implode('|', $pids),\r\n 'rvprop' => 'timestamp|content',\r\n 'format' => 'json'\r\n );\r\n\r\n // execute http call\r\n $this->client->resetParameters();\r\n $this->client->setParameterGet($getParameters);\r\n $response = $this->client->request(Zend_Http_Client::GET);\r\n \r\n // decode json of http response\r\n $array = json_decode($response->getBody(), true);\r\n\r\n // add each listed page to page list\r\n foreach($array['query']['pages'] as $page){\r\n\r\n // create document from MediaWiki page\r\n $document = new Tht_MediaWiki_Document();\r\n $document->setTitle($page['title']);\r\n $document->setNamespace($page['ns']);\r\n $document->setPageid($page['pageid']);\r\n $document->setBasetimestamp($page['revisions'][0]['timestamp']);\r\n $document->setText($page['revisions'][0]['*']);\r\n\r\n // add document to documentList\r\n $list->offsetSet(null, $document);\r\n }\r\n\r\n // reset pid list for next http call\r\n $pids = array();\r\n }\r\n }\r\n\r\n // return the <Tht_MediaWiki_DocumentList> documentList of <Tht_MediaWiki_Document> documents\r\n return $list;\r\n }",
"public function ContentFilter_stub ($content)\n {\n $content = preg_replace ('|\\[stocktwits([^\\]]*)\\]|i', '', $content);\n return ($content);\n }",
"public static function searchNamespace()\n\t{\n\t\t$searchNamespace = 'content';\n\t\treturn $searchNamespace;\n\t}",
"public function getStubContent($type) {\n if (!array_key_exists($type, $this->contentPaths)) {\n throw new Exception(\"Unsupported stub content type '{$type}'\");\n }\n\n $filename = $this->contentPaths[$type];\n $filepath = $this->getResource($filename);\n if (!file_exists($filepath)) {\n throw new Exception(\"Missing stub content data file for '{$type}': {$filepath}\");\n }\n\n $contents = file_get_contents($filepath);\n if (empty($contents)) {\n throw new Exception(\"Empty stub content data file for '{$type}': {$filepath}\");\n }\n\n $parsed = Yaml::parse($contents);\n if (empty($parsed) || empty($parsed[$type])) {\n throw new Exception(\"Corrupt stub content data file for '{$type}': {$filepath}\");\n }\n\n foreach ($parsed[$type] as &$content) {\n $content['type'] = $type;\n }\n return $parsed[$type];\n }",
"public function replaceNamespace(&$stub, $name);",
"protected function getManagerStubContent()\n {\n return file_get_contents($this->getManagerStubFilePath());\n }",
"function fetchBorder(&$content){\r\n global $theme;\r\n unset($template);\r\n $template = new template();\r\n $template->set(\"content\",$content);\r\n $template->set(\"title\",$this->title);\r\n $template->set(\"border\",$this->border);\r\n $template->directory = $theme->getDirectory().\"borders/\";\r\n $template->setFile(\"border\".$this->border.\".tmpl.php\");\r\n $template->depth = 1;\r\n if(!$template->exists()) {\r\n $template->setFile(\"border0.tmpl.php\");\r\n }\r\n $content = $template->fetch();\r\n }",
"function get_content($content_name, $variables=null){\n\tglobal $subdir, $root, $cms, $account, $account_id;\n\t$content_parts = pathinfo($content_name);\n\t$file_name = (array_key_exists(\"extension\", $content_parts) and $content_parts[\"extension\"] == \"php\") ? $content_name : ($root . CMS_NAME . \"/components/\" . $content_name . \".php\");\n\tif($variables){\n\t\tforeach($variables as $variable=>$value){\n\t\t\t${$variable} = $value;\n\t\t}\n\t}\n\tob_start();\n\tinclude($file_name);\n\treturn ob_get_clean();\n}",
"public function __contentfilename($content) {\n\t\t\t// format content filename\n\t\t\t$cn = sprintf(CONTENT_FILENAME, $content);\n\t\t\t// get paths\n\t\t\tif($this->ismobile()) {\n\t\t\t\t$paths = array($this->personality->localizedmobilepath, $this->personality->mobilepath);\n\t\t\t} else {\n\t\t\t\t$paths = array($this->personality->localizedcontentpath, $this->personality->contentpath);\n\t\t\t}\n\t\t\t// check if file exists in localized content path\n\t\t\tforeach($paths as $path) {\n\t\t\t\tif(file_exists($path.$cn)) {\n\t\t\t\t\treturn mgContent($path.$cn);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// try to resolve as personality content\n\t\t\tif($c = $this->personality->GetContent($content)) {\n\t\t\t\t// set template\n\t\t\t\t$this->option(TEMPLATE, (string)$c->template);\n\t\t\t\t// get localized source\n\t\t\t\t$content = mgLocalizedArray($c->source, $this->localized, \"source\");\n\t\t\t}\n\t\t\t// return content\n\t\t\treturn $content;\n\t\t}",
"protected function process_content_from_storage( $content ) {\n\t\treturn $content;\n\t}",
"public function getStub()\n {\n $stub = file_get_contents(dirname(__DIR__).'/Stubs/handler.txt');\n foreach($this->getVars() as $key => $value) {\n $stub = preg_replace(\"/\\{$key\\}/i\", $value, $stub);\n }\n return $stub;\n }",
"function parseContent($content) {\n\t\t\t$rslt = $content;\n\t\t\t$rslt = $this->executeParse($rslt,\"[dojocontent]\",\"[/dojocontent]\");\n\t\t\treturn $rslt;\n\t\t}",
"public function getContentService();",
"public function testLookupNamespaceReturnsStringWhenAddedToRedefineElementAndParentPrefixBoundToNamespace(): void\n {\n $parent = new RedefineElement();\n $parent->addComplexTypeElement($this->sut);\n $parent->bindNamespace('foo', 'http://example.org/foo');\n self::assertSame('http://example.org/foo', $this->sut->lookupNamespace('foo'));\n }",
"public function loadNamespace($namespace);",
"public function testReadNamespace()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$cur_page current page $pages_count total pages count $max_set_width maximal width or set widht (initial, midle and final): 1 2 3 4 5 ..... 10 11 12 13 14 ..... 20 30 31 32 33 for 5 | function PreparePagingArray($cur_page, $pages_count, $max_set_width)
{
$res_array = array();
if ($pages_count <= $max_set_width*2)
{
for ($i = 1; $i <= $pages_count; $i++) $res_array[] = $i;
}
else
{
for ($i = 1; $i <= $max_set_width; $i++) $res_array[] = $i;
$res_array[] = null;
for ($i = $pages_count-$max_set_width+1; $i <= $pages_count; $i++) $res_array[] = $i;
}
return $res_array;
} | [
"function createPages($page, $num_wines, $per_page) {\n $num_pages = ceil($num_wines / $per_page);\n if ($num_pages > 1) {\n $html = \"<div class='pages'>\";\n\n if ($num_pages <= 3) {\n for ($i = 1; $i < 4 && $i <= $num_pages; $i++) {\n if ($i == $page) {\n $html .= \"<a class='page-num' id='selected'>$i</a>\";\n } else {\n $html .= \"<a class='page-num' href='?\"\n .http_build_query(array_merge($_GET, array(\"p\" => $i)))\n .\"'>$i</a>\";\n }\n }\n } else {\n if ($page < 3) {\n $sp = 1;\n } else if ($page == $num_pages) {\n $sp = $num_pages - 2;\n } else if ($page >= 3) {\n $sp = $page - 1;\n }\n if ($page >= 3) {\n $html .= \"<a class='page-num' href='?\"\n .http_build_query(array_merge($_GET, array(\"p\" => 1)))\n .\"'>1</a>\";\n }\n if ($page > 3) {\n $html .= \"<div class='page-dots'>...</div>\";\n }\n for ($i = $sp; $i <= ($sp + 2); $i++) {\n if ($i == $page) {\n $html .= \"<a class='page-num' id='selected'>$i</a>\";\n } else {\n $html .= \"<a class='page-num' href='?\"\n .http_build_query(array_merge($_GET, array(\"p\" => $i)))\n .\"'>$i</a>\";\n }\n }\n if ($page < $num_pages - 2) {\n $html .= \"<div class='page-dots'>...</div>\";\n }\n if ($page < $num_pages - 1) {\n $html .= \"<a class='page-num' href='?\"\n .http_build_query(array_merge($_GET, array(\"p\" => $num_pages)))\n .\"'>$num_pages</a>\";\n }\n }\n\n $html .= \"</div>\";\n return $html;\n } else {\n return \"\";\n }\n}",
"function constructPageIndex($base_url, &$start, $max_value, $num_per_page, $flexible_start = false)\n{\n\tglobal $modSettings;\n\n\t// Save whether $start was less than 0 or not.\n\t$start = (int) $start;\n\t$start_invalid = $start < 0;\n\n\t// Make sure $start is a proper variable - not less than 0.\n\tif ($start_invalid)\n\t\t$start = 0;\n\t// Not greater than the upper bound.\n\telseif ($start >= $max_value)\n\t\t$start = max(0, (int) $max_value - (((int) $max_value % (int) $num_per_page) == 0 ? $num_per_page : ((int) $max_value % (int) $num_per_page)));\n\t// And it has to be a multiple of $num_per_page!\n\telse\n\t\t$start = max(0, (int) $start - ((int) $start % (int) $num_per_page));\n\n\t// Wireless will need the protocol on the URL somewhere.\n\tif (WIRELESS)\n\t\t$base_url .= ';' . WIRELESS_PROTOCOL;\n\n\t$base_link = '<a class=\"navPages\" href=\"' . ($flexible_start ? $base_url : strtr($base_url, array('%' => '%%')) . ';start=%1$d') . '\">%2$s</a> ';\n\n\t// Compact pages is off or on?\n\tif (empty($modSettings['compactTopicPagesEnable']))\n\t{\n\t\t// Show the left arrow.\n\t\t$pageindex = $start == 0 ? ' ' : sprintf($base_link, $start - $num_per_page, '«');\n\n\t\t// Show all the pages.\n\t\t$display_page = 1;\n\t\tfor ($counter = 0; $counter < $max_value; $counter += $num_per_page)\n\t\t\t$pageindex .= $start == $counter && !$start_invalid ? '<strong>' . $display_page++ . '</strong> ' : sprintf($base_link, $counter, $display_page++);\n\n\t\t// Show the right arrow.\n\t\t$display_page = ($start + $num_per_page) > $max_value ? $max_value : ($start + $num_per_page);\n\t\tif ($start != $counter - $max_value && !$start_invalid)\n\t\t\t$pageindex .= $display_page > $counter - $num_per_page ? ' ' : sprintf($base_link, $display_page, '»');\n\t}\n\telse\n\t{\n\t\t// If they didn't enter an odd value, pretend they did.\n\t\t$PageContiguous = (int) ($modSettings['compactTopicPagesContiguous'] - ($modSettings['compactTopicPagesContiguous'] % 2)) / 2;\n\n\t\t// Show the first page. (>1< ... 6 7 [8] 9 10 ... 15)\n\t\tif ($start > $num_per_page * $PageContiguous)\n\t\t\t$pageindex = sprintf($base_link, 0, '1');\n\t\telse\n\t\t\t$pageindex = '';\n\n\t\t// Show the ... after the first page. (1 >...< 6 7 [8] 9 10 ... 15)\n\t\tif ($start > $num_per_page * ($PageContiguous + 1))\n\t\t\t$pageindex .= '<span style=\"font-weight: bold;\" onclick=\"' . htmlspecialchars('expandPages(this, ' . JavaScriptEscape(($flexible_start ? $base_url : strtr($base_url, array('%' => '%%')) . ';start=%1$d')) . ', ' . $num_per_page . ', ' . ($start - $num_per_page * $PageContiguous) . ', ' . $num_per_page . ');') . '\" onmouseover=\"this.style.cursor = \\'pointer\\';\"> ... </span>';\n\n\t\t// Show the pages before the current one. (1 ... >6 7< [8] 9 10 ... 15)\n\t\tfor ($nCont = $PageContiguous; $nCont >= 1; $nCont--)\n\t\t\tif ($start >= $num_per_page * $nCont)\n\t\t\t{\n\t\t\t\t$tmpStart = $start - $num_per_page * $nCont;\n\t\t\t\t$pageindex.= sprintf($base_link, $tmpStart, $tmpStart / $num_per_page + 1);\n\t\t\t}\n\n\t\t// Show the current page. (1 ... 6 7 >[8]< 9 10 ... 15)\n\t\tif (!$start_invalid)\n\t\t\t$pageindex .= '[<strong>' . ($start / $num_per_page + 1) . '</strong>] ';\n\t\telse\n\t\t\t$pageindex .= sprintf($base_link, $start, $start / $num_per_page + 1);\n\n\t\t// Show the pages after the current one... (1 ... 6 7 [8] >9 10< ... 15)\n\t\t$tmpMaxPages = (int) (($max_value - 1) / $num_per_page) * $num_per_page;\n\t\tfor ($nCont = 1; $nCont <= $PageContiguous; $nCont++)\n\t\t\tif ($start + $num_per_page * $nCont <= $tmpMaxPages)\n\t\t\t{\n\t\t\t\t$tmpStart = $start + $num_per_page * $nCont;\n\t\t\t\t$pageindex .= sprintf($base_link, $tmpStart, $tmpStart / $num_per_page + 1);\n\t\t\t}\n\n\t\t// Show the '...' part near the end. (1 ... 6 7 [8] 9 10 >...< 15)\n\t\tif ($start + $num_per_page * ($PageContiguous + 1) < $tmpMaxPages)\n\t\t\t$pageindex .= '<span style=\"font-weight: bold;\" onclick=\"expandPages(this, \\'' . ($flexible_start ? strtr($base_url, array('\\'' => '\\\\\\'')) : strtr($base_url, array('%' => '%%', '\\'' => '\\\\\\'')) . ';start=%1$d') . '\\', ' . ($start + $num_per_page * ($PageContiguous + 1)) . ', ' . $tmpMaxPages . ', ' . $num_per_page . ');\" onmouseover=\"this.style.cursor=\\'pointer\\';\"> ... </span>';\n\n\t\t// Show the last number in the list. (1 ... 6 7 [8] 9 10 ... >15<)\n\t\tif ($start + $num_per_page * $PageContiguous < $tmpMaxPages)\n\t\t\t$pageindex .= sprintf($base_link, $tmpMaxPages, $tmpMaxPages / $num_per_page + 1);\n\t}\n\n\treturn $pageindex;\n}",
"function pagewise($numrows,$limit,$currenthit,$offset,$lnkScr,$lnkParam=\"\")\r\r\n {\r\r\n global $action,$cr,$lnkscr;\r\r\n $pages=intval($numrows/$limit);\r\r\n if ($numrows % $limit)\r\r\n { \r\r\n $pages++;\r\r\n }\r\r\n \r\r\n print \"<table width=70% border=0 cellpadding=1 cellspacing=1>\";\r\r\n print \"<tr><td width=60% valign=top align=center class=normalgrey_12><B>Page:</B> \";\r\r\n \r\r\n \r\r\n if ($offset == 1) { $currenthit = $offset; }\r\r\n else { $currenthit = $offset + 1; }\r\r\n \r\r\n if (($numrows - $currenthit) >= $limit ) { $lasthit = $currenthit + ($limit - 1); }\r\r\n else { $lasthit = $numrows; }\r\r\n \r\r\n $selectedPg = sprintf(\"%.0f\", (($currenthit/$limit) + 1));\r\r\n $j= 1;\r\r\n for ($i=1; $i<=$pages; $i++)\r\r\n {\r\r\n $newoffset = $limit * ($i - 1);\r\r\n \r\r\n if($selectedPg == $i) \r\r\n {\r\r\n print \"<FONT class=white_txt>$i</FONT>|\"; \r\r\n }\r\r\n else \r\r\n {\r\r\n print \"<a href=\".$lnkScr.\"?offset=$newoffset\".$lnkParam.\" class=linkblue_12>$i</a>|\"; \r\r\n }\r\r\n $j++;\r\r\n if ($j == 30)\r\r\n {\r\r\n echo \"<br>\";\r\r\n $j = 1;\r\r\n }\r\r\n }\r\r\n \r\r\n \r\r\n echo \"</td><td class=midtxt width=40% align=right>\";\r\r\n \r\r\n if($offset!=0)\r\r\n {\r\r\n $cr=$offset-$limit;\r\r\n \r\r\n echo \"<a href=\".$lnkscr.\"?offset=$cr\".$lnkParam.\" class=linkblue_12>Previous</a>\";\r\r\n \r\r\n if ($offset+($offset) >= $numrows)\r\r\n {\r\r\n echo \" \";\r\r\n }\r\r\n else\r\r\n {\r\r\n echo \" \";\r\r\n }\r\r\n }\r\r\n \r\r\n if($offset<$numrows && (($numrows-$offset)>$limit))\r\r\n {\r\r\n \r\r\n echo \"<a href=\".$lnkscr.\"?offset=$lasthit\".$lnkParam.\" class=linkblue_12>Next</a>\";\r\r\n \r\r\n }\r\r\n \r\r\n \r\r\n print \"</td></tr>\";\r\r\n \r\r\n print \"</table>\";\r\r\n }",
"function show_paging($limit, $listsize, $fulllistsize, $page) {\n\n\tglobal $langNextPage, $langBeforePage;\n\n\t$retString = \"\";\n\t// Page numbers of navigation\n\t$pn = 15;\n\t$retString .= \"<br><table width=\\\"99%\\\"><tbody><tr><td> </td><td align=\\\"center\\\">\";\n\t// Deal with previous page\n\tif ($limit!=0) {\n\t\t$newlimit = $limit - $listsize;\n\t\t$retString .= \"<a href=\\\"\".$page.\"?limit=\".$newlimit.\"\\\"><b>$langBeforePage</b></a> | \";\n\t} else {\n\t\t$retString .= \"<b>$langBeforePage</b> | \";\n\t}\n\t// Deal with pages\n\tif (ceil($fulllistsize / $listsize) <= $pn/3)\n\t{\n\t\t// Show all\n\t\t$counter = 0;\n\t\twhile ($counter * $listsize < $fulllistsize) {\n\t\t\t$aa = $counter + 1;\n\t\t\tif ($counter * $listsize == $limit) {\n\t\t\t\t$retString .= \"<b>\".$aa.\"</b> \";\n\t\t\t} else {\n\t\t\t\t$newlimit = $counter * $listsize;\n\t\t\t\t$retString .= \"<b><a href=\\\"\".$page.\"?limit=\".$newlimit.\"\\\">\".$aa.\"</a></b> \";\n\t\t\t}\n\t\t\t$counter++;\n\t\t}\n\t} elseif ($limit / $listsize < ($pn/3)+3) {\n\t\t// Show first 10\n\t\t$counter = 0;\n\t\twhile ($counter * $listsize < $fulllistsize && $counter < $pn/3*2) {\n\t\t\t$aa = $counter + 1;\n\t\t\tif ($counter * $listsize == $limit) {\n\t\t\t\t$retString .= \"<b>\".$aa.\"</b> \";\n\t\t\t} else {\n\t\t\t\t$newlimit = $counter * $listsize;\n\t\t\t\t$retString .= \"<b><a href=\\\"\".$page.\"?limit=\".$newlimit.\"\\\">\".$aa.\"</a></b> \";\n\t\t\t}\n\t\t\t$counter++;\n\t\t}\n\t\t$retString .= \"<b>...</b> \";\n\t\t// Show last 5\n\t\t$counter = ceil($fulllistsize / $listsize) - ($pn/3);\n\t\twhile ($counter * $listsize < $fulllistsize) {\n\t\t\t$aa = $counter + 1;\n\t\t\tif ($counter * $listsize == $limit) {\n\t\t\t\t$retString .= \"<b>\".$aa.\"</b> \";\n\t\t\t} else {\n\t\t\t\t$newlimit = $counter * $listsize;\n\t\t\t\t$retString .= \"<b><a href=\\\"\".$page.\"?limit=\".$newlimit.\"\\\">\".$aa.\"</a></b> \";\n\t\t\t}\n\t\t\t$counter++;\n\t\t}\n\t} elseif ($limit / $listsize >= ceil($fulllistsize / $listsize) - ($pn/3)-3) {\n\t\t// Show first 5\n\t\t$counter = 0;\n\t\twhile ($counter * $listsize < $fulllistsize && $counter < ($pn/3)) {\n\t\t\t$aa = $counter + 1;\n\t\t\tif ($counter * $listsize == $limit) {\n\t\t\t\t$retString .= \"<b>\".$aa.\"</b> \";\n\t\t\t} else {\n\t\t\t\t$newlimit = $counter * $listsize;\n\t\t\t\t$retString .= \"<b><a href=\\\"\".$page.\"?limit=\".$newlimit.\"\\\">\".$aa.\"</a></b> \";\n\t\t\t}\n\t\t\t$counter++;\n\t\t}\n\t\t$retString .= \"<b>...</b> \";\n\t\t// Show last 10\n\t\t$counter = ceil($fulllistsize / $listsize) - ($pn/3*2);\n\t\twhile ($counter * $listsize < $fulllistsize) {\n\t\t\t$aa = $counter + 1;\n\t\t\tif ($counter * $listsize == $limit) {\n\t\t\t\t$retString .= \"<b>\".$aa.\"</b> \";\n\t\t\t} else {\n\t\t\t\t$newlimit = $counter * $listsize;\n\t\t\t\t$retString .= \"<b><a href=\\\"\".$page.\"?limit=\".$newlimit.\"\\\">\".$aa.\"</a></b> \";\n\t\t\t}\n\t\t\t$counter++;\n\t\t}\n\t} else {\n\t\t// Show first 5\n\t\t$counter = 0;\n\t\twhile ($counter * $listsize < $fulllistsize && $counter < ($pn/3)) {\n\t\t\t$aa = $counter + 1;\n\t\t\tif ($counter * $listsize == $limit) {\n\t\t\t\t$retString .= \"<b>\".$aa.\"</b> \";\n\t\t\t} else {\n\t\t\t\t$newlimit = $counter * $listsize;\n\t\t\t\t$retString .= \"<b><a href=\\\"\".$page.\"?limit=\".$newlimit.\"\\\">\".$aa.\"</a></b> \";\n\t\t\t}\n\t\t\t$counter++;\n\t\t}\n\t\t$retString .= \"<b>...</b> \";\n\t\t// Show middle 5\n\t\t$counter = ($limit / $listsize) - 2;\n\t\t$top = $counter + 5;\n\t\twhile ($counter * $listsize < $fulllistsize && $counter < $top) {\n\t\t\t$aa = $counter + 1;\n\t\t\tif ($counter * $listsize == $limit) {\n\t\t\t\t$retString .= \"<b>\".$aa.\"</b> \";\n\t\t\t} else {\n\t\t\t\t$newlimit = $counter * $listsize;\n\t\t\t\t$retString .= \"<b><a href=\\\"\".$page.\"?limit=\".$newlimit.\"\\\">\".$aa.\"</a></b> \";\n\t\t\t}\n\t\t\t$counter++;\n\t\t}\n\t\t$retString .= \"<b>...</b> \";\n\t\t// Show last 5\n\t\t$counter = ceil($fulllistsize / $listsize) - ($pn/3);\n\t\twhile ($counter * $listsize < $fulllistsize) {\n\t\t\t$aa = $counter + 1;\n\t\t\tif ($counter * $listsize == $limit) {\n\t\t\t\t$retString .= \"<b>\".$aa.\"</b> \";\n\t\t\t} else {\n\t\t\t\t$newlimit = $counter * $listsize;\n\t\t\t\t$retString .= \"<b><a href=\\\"\".$page.\"?limit=\".$newlimit.\"\\\">\".$aa.\"</a></b> \";\n\t\t\t}\n\t\t\t$counter++;\n\t\t}\n\t}\n\t// Deal with next page\n\tif ($limit + $listsize >= $fulllistsize) {\n\t\t$retString .= \"| <b>$langNextPage</b>\";\n\t} else {\n\t\t$newlimit = $limit + $listsize;\n\t\t$retString .= \"| <a href=\\\"\".$page.\"?limit=\".$newlimit.\"\\\"><b>$langNextPage</b></a>\";\n\t}\n\t$retString .= \"</td></tr></tbody></table>\";\n\n\treturn $retString;\n}",
"function create_page_numbers ( $num_pages, $current_page, $url, $page_variable )\n{\n\tstatic $page_reduction_limit = 15;\n\t$pagination_text = '';\n\n\t// Replace intitial ampersand just in case we have a query string created by clean_query_string().\n\t$url = str_replace ('?&', '?', $url);\n\n\t$i = 1;\n\n\t$should_reduce = ($num_pages >= $page_reduction_limit);\n\t$prev_page_no = $current_page - 1;\n\t$next_page_no = $current_page + 1;\n\t$two_from_last = $num_pages - 2;\n\twhile ( $i <= $num_pages )\n\t{\n\t\tif ( !$should_reduce ||\n\t\t\t$i <= 3 ||\n\t\t\t($i >= $prev_page_no && $i <= $next_page_no) ||\n\t\t\t$i >= $two_from_last )\n\t\t{\n\t\t\tif ( $current_page == $i )\n\t\t\t{\n\t\t\t\t$pagination_text .= ' <b>' . $i . '</b>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pagination_text .= ' <a href=\"' . $url . '&' . $page_variable . '=' . $i . '\">' . $i . '</a>';\n\t\t\t}\n\n\t\t\t++$i;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pagination_text .= ' …';\n\n\t\t\tif ( $i < $prev_page_no && $prev_page_no < $two_from_last )\n\t\t\t{\n\t\t\t\t$i = $prev_page_no;\n\t\t\t}\n\t\t\telse if ( $i < $two_from_last )\n\t\t\t{\n\t\t\t\t$i = $two_from_last;\n\t\t\t}\n\t\t}\n\t}\n\n\t// substr to remove leading space.\n\treturn substr ($pagination_text, 1);\n}",
"function pagination($all, $lim, $prev, $curr_link, $curr_css, $link2){\n // Check that the displayed first and last pages do not exceed the numbering limits.\n $first = $curr_link - $prev;\n if ($first < 1) {\n $first = 1;\n }\n $last = $curr_link + $prev;\n if ($last > ceil($all / $lim)) {\n $last = ceil($all / $lim);\n }\n // first page\n $pervaya = \"<a href='{$link2}?page=1'>-первая-</a> \";\n print $pervaya;\n if ($curr_link <= 1) {\n $i_pred = $curr_link = 1;\n }\n else {\n $i_pred = $curr_link - 1;\n $pred = \"<a href='{$link2}?page={$i_pred}'> -предыдущая- </a> \";\n print $pred;\n }\n $y = 1;\n if ($first > 1) print \"<a href='{$link2}?page={$y}'>1</a> \";\n // if there are a lot of pages, then the ellipsis.\n $y = $first - 1;\n if ($first > 10) {\n print \"<a href='{$link2}?page={$y}'>...</a> \";\n }\n else {\n for($i = 2; $i < $first; $i++) {\n print \"<a href='{$link2}?page={$i}'>$i</a> \";\n }\n }\n // Display the specified range: current page + - $ prev.\n for($i = $first; $i < $last + 1; $i++) {\n //If the current page is displayed, then it is assigned a special style css\n if($i == $curr_link) {\n ?>\n <span><?php print $i; ?></span>\n <?php\n }\n else {\n $alink = \"<a href='{$link2}?page={$i}'>$i</a> \";\n print $alink;\n }\n }\n $y = $last + 1;\n //Ellipsis.\n if ($last < ceil($all / $lim) && ceil($all / $lim) - $last > 2) print \"<a href='{$link2}?page={$y}'>...</a> \";\n //Show last page.\n $e = ceil($all / $lim);\n if ($last < ceil($all / $lim)) {\n print \"<a href='{$link2}?page={$e}'>$e</a>\";\n }\n $pos_page = ceil($all/$lim);\n if ($curr_link >= $pos_page) {\n $i_sled=$curr_link;\n }\n else {\n $i_sled = $curr_link + 1;\n $sled = \"<a href='{$link2}?page={$i_sled}'> -следующая- </a> \";\n print $sled;\n }\n $pos_page = ceil($all/$lim);\n $posled = \"<a href='{$link2}?page={$pos_page}'> -последняя- </a> \";\n print $posled;\n}",
"function RecSplitter($rec_count, $recs_pp, $recs_max, $act_pagenumber = 1) {\r\n\r\n\t\t// Get language dependend variables.\r\n\t\t$ll_pagename = htmlspecialchars($this->pi_getLL('browsePage'));\r\n\t\t$ll_pageseparator = htmlspecialchars($this->pi_getLL('browseSeperator'));\r\n\t\t$ll_pageactwrap = htmlspecialchars($this->pi_getLL('browseActPageWrap'));\r\n\t\t$ll_pagefromto = htmlspecialchars($this->pi_getLL('browseFromTo'));\r\n\r\n\t\t// Split the recordset into blocks of $recs_pp.\r\n\t\t$page_count = $rec_count / $recs_pp;\r\n\t\t// Non-integer results have to converted to integer. (The modulo-value represents a package of less than $recs_pp datalines.)\r\n\t\tif (!is_int($page_count)) $page_count = intval($page_count) + 1;\r\n\r\n\t\t// There could be less records than maximum records.\r\n\t\tif ($rec_count < $recs_max) $recs_max = $rec_count;\r\n\t\t// Get the from/to values and redefine the LIMIT part of the sql query.\r\n\t\t$recs_from = $recs_pp * ($act_pagenumber - 1) + 1;\r\n\t\t$recs_to = $recs_pp * $act_pagenumber;\r\n\t\t// The record count of the last page sometimes has to be recalculated.\r\n\t\tif ($recs_to > $recs_max) {\r\n\t\t\t$recs_pp = $recs_pp - ($recs_to - $recs_max);\r\n\t\t\t$recs_to = $recs_max;\r\n\t\t} // end if\r\n\t\t$startindex = ($recs_from - 1) + $this->config['offsetRecs'];\r\n\t\t$this->sqlLimitString = 'LIMIT ' . $startindex . ',' . $recs_pp;\r\n\r\n\t\t// Format the from/to part of the HTML output.\r\n\t\t$this->browseFromTo = str_replace('###FROM###', $recs_from, str_replace('###TO###', $recs_to, str_replace('###COUNT###', $recs_max, $ll_pagefromto)));\r\n\r\n\t\t// Go through all split pages.\r\n\t\t$this->browseLinks = '';\r\n\t\tfor ($i = 0; $i < $page_count; $i++) {\r\n\t\t\t// Build the raw link text.\r\n\t\t\t$page_number = $i + 1;\r\n\t\t\t$linktext = $ll_pagename . $page_number;\r\n\t\t\t// Start generating link.\r\n\t\t\t$linkto = 'index.php?';\r\n\t\t\t// Get link arguments that are actually used.\r\n\t\t\t$requesturl = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL');\r\n\t\t\t// If a query part can be found, this part is saved here.\r\n\t\t\tif (stristr($requesturl, '?')) {\r\n\t\t\t\t$requesturl = substr($requesturl, strpos($requesturl, '?') + 1);\r\n\t\t\t} else {\r\n\t\t\t\t$requesturl = '';\r\n\t\t\t} // end if\r\n\t\t\t// If plugins actual link is already present in the REQUEST_URL, do remove this part.\r\n\t\t\tif ($requesturl) {\r\n\t\t\t\t// The plugins string is always the last within the query parameters.\r\n\t\t\t\t$regsearchstring = '/pp' . $this->extKey . '.+/';\r\n\t\t\t\t$requesturl = preg_replace($regsearchstring, \"\", $requesturl);\r\n\t\t\t} // end if\r\n\t\t\t// If still arguments left (from other plugins or Typo3), add them to the link.\r\n\t\t\tif ($requesturl) $linkto .= $requesturl . '&';\r\n\t\t\t// Add link arguments required for the plugin.\r\n\t\t\t$linkto .= 'pp' . $this->extKey . $this->cObj->data['uid'] . '=' . $page_number . '&id=' . $this->cObj->data['pid'] . '#' . $this->cObj->data['uid'];\r\n\t\t\t// Generate link.\r\n\t\t\t$linkto = str_replace(\"&&\", \"&\", $linkto);\r\n\t\t\t$linktext = $this->pi_linkToPage($linktext, $linkto);\r\n\t\t\t// If the page is the actual page, it can be wrapped with some other text (e.g. >>link<<).\r\n\t\t\tif ($page_number == $act_pagenumber) $linktext = str_replace('|', $linktext, $ll_pageactwrap);\r\n\t\t\t// Add the separator.\r\n\t\t\t$this->browseLinks .= $linktext . $ll_pageseparator;\r\n\t\t} // end for\r\n\r\n\t\t// The last separator has to be cropped.\r\n\t\t$this->browseLinks = substr($this->browseLinks, 0, strlen($this->browseLinks) - strlen($ll_pageseparator));\r\n\t\t// Return the startindex.\r\n\t\treturn $startindex;\r\n\r\n\t}",
"function make_pagination($pmode,$totalnum, $ppage='5', $cpage='1',$eachsidenum='3', $link,$econd=''){\n\t///--- $totalnum : total pages we have in our pagination\n\t///--- ppage : pages per page , shows the number of links in our pagintaion\n\t///--- cpage : specifies the current page to highlight the current page to the user\n\t///--- eachsidenum : how many links should be in each side of the current page\n\t//---- link: what's the link for a page in the pagintion\n\t///--- econd : is there any more we haven't thought of yet ?\n\t\n\t//$pagination_content =\"<span dir='ltr'>$pmode,$totalnum,$ppage,$cpage,$eachsidenum,$link,$econd</span>\";\n\t$pagination_content =\"\";\n\t\t\t\n\t$totalp = ceil($totalnum / $ppage);\n\t$getpage = (strpos($link, \"?\") === false) ? \"?pagenum\" : \"&pagenum\";\n\t$lpage = $cpage-$eachsidenum;\n\t$upper =$cpage+$eachsidenum;\n\t\n\tif ($totalp > 1) {\n\n\t\n\t//NO LINK has been provided ???!! ok we do it on our own\n\tif (empty($link)) {\n\t\t\tif ($pmode==5) {\n\t\t\t\t$link = \"modules.php?name=News&file=categories&category=$econd&pagenum\";\n\t\t\t}elseif ($pmode==6){\n\t\t\t\t$link = \"modules.php?name=News&file=tags&tag=$econd&pagenum\";\n\t\t\t}elseif ($pmode==7){\n\t\t\t\t$link = \"modules.php?name=News&file=article&sid=$econd&pagenum\";\n\t\t\t}else {\n\t\t\t\t$link =\"modules.php?name=News&new_topic=$new_topic&pagenum\";\n\t\t\t}\n\t}\n\t\n\t\n\t\t$pagination_content .= \"<center><div style=\\\"text-align: center;\\\">\";\n\n\t\tif ($pmode==2 or $pmode==3 ){\n\n\t\t\t$prevpage = $cpage - 1 ;\n\t\t\t$leftarrow = \"images/right.gif\" ;\n\t\t\tif(isset($new_topic)) {\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$prevpage\\\">\";\n\t\t\t\t$pagination_content .= \"<img src=\\\"$leftarrow\\\" align=\\\"absmiddle\\\" border=\\\"0\\\" hspace=\\\"10\\\"></a>\";\n\t\t\t} else {\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$prevpage\\\">\";\n\t\t\t\t$pagination_content .= \"<img src=\\\"$leftarrow\\\" align=\\\"absmiddle\\\" border=\\\"0\\\" hspace=\\\"10\\\"></a>\";\n\t\t\t}\n\t\t}\n\n\t\tif ($pmode==1 or $pmode==3 ){\n\t\t\t$pagination_content .= \"<select name='$i' onChange='top.location.href=this.options[this.selectedIndex].value'> \";\n\t\t\tfor ($i=1; $i < $totalp+1; $i++) {\n\t\t\t\tif ($i > $min){\n\t\t\t\t\tif(isset($new_topic)) {\n\t\t\t\t\t\t$pagination_content .= \"<option value=\\\"$link=$i\\\">$i</option>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$pagination_content .= \"<option value=\\\"$link=$i\\\">$i</option>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$pagination_content .= \"</select>\" ;\n\t\t}\n\n\n\t\tif ($pmode==2 or $pmode==3){\n\t\t\tif ($cpage < $totalp) {\n\t\t\t\t$nextpage = $cpage + 1 ;\n\t\t\t\t$rightarrow = \"images/left.gif\" ;\n\t\t\t\tif(isset($new_topic)) {\n\t\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$nextpage\\\">\";\n\t\t\t\t\t$pagination_content .= \"<img src=\\\"$rightarrow\\\" align=\\\"absmiddle\\\" border=\\\"0\\\" hspace=\\\"10\\\"></a>\";\n\t\t\t\t} else {\n\t\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$nextpage\\\">\";\n\t\t\t\t\t$pagination_content .= \"<img src=\\\"$rightarrow\\\" align=\\\"absmiddle\\\" border=\\\"0\\\" hspace=\\\"10\\\"></a>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($pmode==4 OR $pmode==5 OR $pmode==6 OR $pmode==7 OR $pmode==10 ){\n\t\t\t$prevpage = $cpage - 1 ;\n\t\t\t$nextpage = $cpage + 1 ;\n\n\n\t\t\t$pagination_content .= \"<div id='pagination-digg' >\";\n\t\t\tif ($prevpage ==0 ) {\n\t\t\t\t$pagination_content .= '<a class=\"off\">'._PREV_PAGE.'</a>';\n\t\t\t}else {\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$prevpage\\\">\"._NEXT_PAGE.\"</a>\";\n\t\t\t}\n\n\n\t\t\tif ($totalp < 7 + ($eachsidenum * 2))\t//not enough pages to bother breaking it up\n\t\t\t{\n\t\t\t\tfor ($counter = 1; $counter <= $totalp; $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $cpage)\n\t\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$counter\\\" class=\\\"active\\\" title='\"._C_PAGE.\"'> $counter </a>\";\n\t\t\t\t\telse\n\t\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$counter\\\" > $counter </a>\";\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telseif($totalp > 5 + ($eachsidenum * 2))\t//enough pages to hide some\n\t\t\t{\t\t\tif($cpage < 1 + ($eachsidenum * 2))\n\t\t\t{\n\t\t\t\tfor ($counter = 1; $counter < 4 + ($eachsidenum * 2); $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $cpage)\n\t\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$counter\\\" class=\\\"active\\\" title='\"._C_PAGE.\"'> $counter </a>\";\n\t\t\t\t\telse\n\t\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$counter\\\"> $counter </a>\";\n\t\t\t\t}\n\t\t\t\t$pagination_content .= \" <a href=\\\"\\\"> ... </a> \";\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$lpm1\\\" > $lpm1 </a>\";\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$totalp\\\" > $totalp </a>\";\n\t\t\t}\n\t\t\telseif($totalp - ($eachsidenum * 2) > $cpage && $cpage > ($eachsidenum * 2))\n\t\t\t{\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=1\\\" > 1 </a>\";\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=2\\\" > 2 </a>\";\n\t\t\t\t$pagination_content .= \" <a href=\\\"\\\"> ... </a> \";\n\t\t\t\tfor ($counter = $cpage - $eachsidenum; $counter <= $cpage + $eachsidenum; $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $cpage)\n\t\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$counter\\\" class=\\\"active\\\" title='\"._C_PAGE.\"'> $counter </a>\";\n\t\t\t\t\telse\n\t\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$counter\\\" > $counter </a>\";\n\t\t\t\t}\n\t\t\t\t$pagination_content .= \" <a href=\\\"\\\"> ... </a> \";\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$lpm1\\\" > $lpm1 </a>\";\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$totalp\\\" > $totalp </a>\";\n\t\t\t}\n\t\t\t//close to end; only hide early pages\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=1\\\" > 1 </a>\";\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=2\\\" > 2 </a>\";\n\t\t\t\t$pagination_content .= \" <a href=\\\"\\\"> ... </a> \";\n\t\t\t\tfor ($counter = $totalp - (2 + ($eachsidenum * 2)); $counter <= $totalp; $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $cpage)\n\t\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$counter\\\" class=\\\"active\\\"> $counter </a>\";\n\t\t\t\t\telse\n\t\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$counter\\\" > $counter </a>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\n\t\t\tif ($nextpage > $totalp ) {\n\t\t\t\t$pagination_content .= '<a class=\"off\">'._NEXT_PAGE.'</a>';\n\t\t\t}else {\n\t\t\t\t$pagination_content .= \"<a href=\\\"$link=$nextpage\\\">\"._NEXT_PAGE.\"</a>\";\n\t\t\t}\n\t\t\t$pagination_content .= \"</div>\";\n\t\t}\n\t\t$pagination_content .= \"<br>\"._TOTALPAGE.\" $totalnum ($totalp \"._PAGES.\" | \"._PERPAGE.\" $ppage)\";\n\t\t$pagination_content .= \"</div></center>\";\n\n\n\t}\n\t//$pagination_content ='بدون صفحه بندی';\n\treturn $pagination_content;\n}",
"function page($count,$page_size,$num_btn=10,$page='page'){\n //no thread\n if($count==0){\n $data=array(\n 'limit'=>'',\n 'html'=>''\n );\n return $data;\n }\n //check\n if(!isset($_GET[$page]) || !is_numeric($_GET[$page]) || $_GET[$page]<1){\n $_GET[$page]=1;\n }\n //max page\n $page_num_all=ceil($count/$page_size);\n if($_GET[$page]>$page_num_all){\n $_GET[$page]=$page_num_all;\n }\n //=skip().take()\n $start=($_GET[$page]-1)*$page_size;\n $limit=\"limit {$start},{$page_size}\";\n //url address\n $current_url=$_SERVER['REQUEST_URI'];//get url address\n $arr_current=parse_url($current_url);//seperate url\n $current_path=$arr_current['path'];///file path: xxx.php\n $url='';\n if(isset($arr_current['query'])){\n parse_str($arr_current['query'],$arr_query);\n unset($arr_query[$page]);\n if(empty($arr_query)){\n //xxx.php?page=\n $url=\"{$current_path}?{$page}=\";\n }else{\n $other=http_build_query($arr_query);\n //xxx.php?id=1&a=1&page=\n $url=\"{$current_path}?{$other}&{$page}=\";\n }\n }else{\n $url=\"{$current_path}?{$page}=\";\n }\n $html=array();\n //# of btn > total page\n if($num_btn>=$page_num_all){\n //show all pages\n for($i=1;$i<=$page_num_all;$i++){\n //current page <span></span>\n if($_GET[$page]==$i){\n $html[$i]=\"<span>{$i}</span>\";\n }\n //other pages <a></a>\n else{\n $html[$i]=\"<a href='{$url}{$i}'>{$i}</a>\";\n }\n }\n }\n //# of btn <= total page\n else{\n $num_left=floor(($num_btn-1)/2);\n //first page\n $start=$_GET[$page]-$num_left;\n //last page\n $end=$start+($num_btn-1);\n //first page >=1\n if($start<1){\n $start=1;\n }\n //last page <= total page\n if($end>$page_num_all){\n $start=$page_num_all-($num_btn-1);\n }\n //show pages\n for($i=0;$i<$num_btn;$i++){\n if($_GET[$page]==$start){\n $html[$start]=\"<span>{$start}</span>\";\n }else{\n $html[$start]=\"<a href='{$url}{$start}'>{$start}</a>\";\n }\n $start++;\n }\n //ellipsis... if # of btn >=3\n if(count($html)>=3){\n reset($html);\n $key_first=key($html);\n end($html);\n $key_end=key($html);\n if($key_first!=1){\n array_shift($html);\n array_unshift($html,\"<a href='{$url}=1'>1...</a>\");\n }\n if($key_end!=$page_num_all){\n array_pop($html);\n array_push($html,\"<a href='{$url}={$page_num_all}'>...{$page_num_all}</a>\");\n }\n }\n }\n //prev.\n if($_GET[$page]!=1){\n $prev=$_GET[$page]-1;\n array_unshift($html,\"<a href='{$url}{$prev}'>« Prev.</a>\");\n }\n //next\n if($_GET[$page]!=$page_num_all){\n $next=$_GET[$page]+1;\n array_push($html,\"<a href='{$url}{$next}'>Next »</a>\");\n }\n //output\n $html=implode(' ',$html);\n $data=array(\n 'limit'=>$limit,\n 'html'=>$html\n );\n return $data;\n}",
"function setMaxPerPage($maxPerPage);",
"public function setPageWidth($value)\n\t{\n\t\t$this->width = $value;\n\t}",
"public function setMaxPages($value)\n {\n\t$this->max_index = $value;\n }",
"function _wha_link_pages()\n{\n global $numpages, $page, $post;\n if (1 != $numpages):\n $input_width = strlen((string)$numpages) + 3;\n ?>\n <div class=\"text-center\">\n <nav>\n <ul class=\"pagination\">\n <li class=\"disabled hidden-xs\">\n <span>\n <span aria-hidden=\"true\"><?php _e('Page', '_wha'); ?><?php echo $page; ?><?php _e('of', '_wha'); ?><?php echo $numpages; ?></span>\n </span>\n </li>\n <li><?php echo _wha_link_page(1, 'First'); ?>«<span class=\"hidden-xs\"> <?php _e('First', '_wha'); ?></span></a></li>\n <?php if ($page == 1): ?>\n <li class=\"disabled\"><span>‹<span class=\"hidden-xs aria-hidden\"> <?php _e('Previous', '_wha'); ?></span></span></li>\n <?php else: ?>\n <li><?php echo _wha_link_page($page - 1, 'Previous'); ?>‹<span class=\"hidden-xs\"> <?php _e('Previous', '_wha'); ?></span></a></li>\n <?php endif; ?>\n\n <?php $start_page = min(max($page - 2, 1), max($numpages - 4, 1)); ?>\n <?php $end_page = min(max($page + 2, 5), $numpages); ?>\n\n <?php for ($i = $start_page; $i <= $end_page; $i++): ?>\n <?php if ($page == $i): ?>\n <li class=\"active\">\n <span><?php echo $i; ?><span class=\"sr-only\">(current)</span></span>\n </li>\n <?php else: ?>\n <li><?php echo _wha_link_page($i) . $i . '</a>'; ?></li>\n <?php endif; ?>\n <?php endfor; ?>\n\n <?php if ($page == $numpages): ?>\n <li class=\"disabled\"><span><span class=\"hidden-xs aria-hidden\"><?php _e('Next', '_wha'); ?> </span>›</span></li>\n <?php else: ?>\n <li><?php echo _wha_link_page($page + 1, 'Next'); ?><span class=\"hidden-xs\"><?php _e('Next', '_wha'); ?> </span>›</a></li>\n <?php endif; ?>\n <li><?php echo _wha_link_page($numpages, 'Last'); ?><span class=\"hidden-xs\"><?php _e('Last', '_wha'); ?> </span>»</a></li>\n <li>\n <form action=\"<?php echo get_permalink($post->ID); ?>\" method=\"get\" class=\"tk-page-nav\" id=\"tk-paging-<?php echo $post->ID; ?>\">\n <div class=\"input-group\">\n <input oninput=\"if(!jQuery(this)[0].checkValidity()) {jQuery('#tk-paging-<?php echo $post->ID; ?>').find(':submit').click();};\" type=\"number\" name=\"page\" min=\"1\" max=\"<?php echo $numpages; ?>\" value=\"<?php echo $page; ?>\" class=\"form-control text-right\" style=\"width: <?php echo $input_width; ?>em;\">\n <span class=\"input-group-btn\">\n <input type=\"submit\" value=\"<?php _e('Go to', '_wha'); ?>\" class=\"btn btn-success\">\n </span>\n </div>\n </form>\n </li>\n </ul>\n </nav>\n </div>\n <?php\n endif;\n}",
"function show_pages($amount, $rowamount, $id = '') {\n if ($amount > $rowamount) {\n $num = 8;\n $poutput = '';\n $lastpage = ceil($amount / $rowamount);\n $startpage = 1;\n\n if (!isset($_GET[\"start\"]))\n $_GET[\"start\"] = 1;\n $start = $_GET[\"start\"];\n\n if ($lastpage > $num & $start > ($num / 2)) {\n $startpage = ($start - ($num / 2));\n }\n\n echo _('Show page') . \":<br>\";\n\n if ($lastpage > $num & $start > 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start - 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ < ]';\n $poutput .= '</a>';\n }\n if ($start != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=1';\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ 1 ]';\n $poutput .= '</a>';\n if ($startpage > 2)\n $poutput .= ' .. ';\n }\n\n for ($i = $startpage; $i <= min(($startpage + $num), $lastpage); $i++) {\n if ($start == $i) {\n $poutput .= '[ <b>' . $i . '</b> ]';\n } elseif ($i != $lastpage & $i != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $i;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $i . ' ]';\n $poutput .= '</a>';\n }\n }\n\n if ($start != $lastpage) {\n if (min(($startpage + $num), $lastpage) < ($lastpage - 1))\n $poutput .= ' .. ';\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $lastpage;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $lastpage . ' ]';\n $poutput .= '</a>';\n }\n\n if ($lastpage > $num & $start < $lastpage) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start + 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ > ]';\n $poutput .= '</a>';\n }\n\n echo $poutput;\n }\n}",
"function gridSize($tablename,$condition=\"\"){\n\t\t$output = array();\n\t\t$this_page = \"\";\n\t\t//parse_str($_SERVER['QUERY_STRING'], $url);\n\t\t$url = $_GET;\n\t\t// number of rows to show per page\n\t\t$rowsperpage = $this -> setting('rows_per_page');\n\t\t$rowsperpage = ((int)$rowsperpage > 0) ? (int)$rowsperpage : 10;\n\t\t// range of num links to show\n\t\t$range = 4;\n\t\t//add where to the condition if a condition has been set\n\t\tif(!empty($condition)) $condition = (stripos($condition,\"WHERE \") === false) ? \"WHERE $condition\" : $condition;\n\t\t$countsql = \"select count(*) as cnt from $tablename $condition\";\n\t\t$numrows = $this -> dbrow($countsql);\n\t\t$numrows = $numrows['cnt'];\n\t\t// find out total pages\n\t\t$totalpages = $this->mceil($numrows / $rowsperpage);\n\t\t\n\t\t// get the current page or set a default\n\t\t$currentpage = @$_GET['currentpage'];\n\t\t$currentpage = ((int)$currentpage > 0) ? (int) $_GET['currentpage'] : 1 ;\n\t\t\n\t\t// if current page is greater than total pages...\n\t\t$currentpage = ($currentpage > $totalpages) ? $totalpages : $currentpage;\n\t\t\n\t\t// if current page is less than first page...\n\t\t$currentpage = ($currentpage < 1) ? 1 : $currentpage;\n\t\t// the offset of the list, based on current page \n\t\t$offset = ($currentpage - 1) * $rowsperpage;\n\t\t$output['start'] = $offset+1;\n\t\t$output['size'] = $rowsperpage;\t\n\t\t$output['total'] = $numrows;\t\t\t\n\t\t$output['size'] = (($output['start']+$output['size'])>$output['total'])? ($output['total'] - $output['start']) + 1:$output['size'] ;\n\t\t/****** build the pagination links ******/\t\n\t\t// if not on page 1, don't show back links\n\t\t$pagination = \"\";\n\t\tif ($currentpage > 1) {\n\t\t // show << link to go back to page 1\n\t\t\t$url['currentpage'] = 1;//$currentpage;\n\t\t $pagination .= \" <a href='\".$this->makeSefUrl($this_page.\"?\".http_build_query($url)).\"'>[first]</a> \";\n\t\t // get previous page num\n\t\t $prevpage = $currentpage - 1;\n\t\t // show < link to go back to 1 page\n\t\t\t$url['currentpage'] = $prevpage;\n\t\t $pagination .= \" <a href='\".$this->makeSefUrl($this_page.\"?\".http_build_query($url)).\"'>[prev]</a> \";\n\t\t} // end if \n\t\t\n\t\t// loop to show links to range of pages around current page\n\t\tfor ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) {\n\t\t // if it's a valid page number...\n\t\t if (($x > 0) && ($x <= $totalpages)) {\n\t\t\t // if we're on current page...\n\t\t\t$url['currentpage'] = $x;\n\t\t\t $pagination .= ($x == $currentpage) ? \" [<b>$x</b>] \" : \" <a href='\".$this->makeSefUrl($this_page.\"?\".http_build_query($url)).\"'>$x</a> \";\n\t\t } // end if \n\t\t} // end for\n\t\t\t\t\t\t \n\t\t// if not on last page, show forward and last page links \n\t\tif ($currentpage != $totalpages) {\n\t\t // get next page\n\t\t $nextpage = $currentpage + 1;\n\t\t\t// echo forward link for next page \n\t\t\t$url['currentpage'] = $nextpage;\n\t\t $pagination .= \" <a href='\".$this->makeSefUrl($this_page.\"?\".http_build_query($url)).\"'>[Next]</a> \";\n\t\t // echo forward link for lastpage\n\t\t\t$url['currentpage'] = $totalpages;\n\t\t $pagination .= \" <a href='\".$this->makeSefUrl($this_page.\"?\".http_build_query($url)).\"'>[Last]</a> \";\n\t\t} // end if\n\t\t/****** end build pagination links ******/\n\t\t$output['links'] = $pagination;\n\t\treturn $output;\n\t}",
"public function getMaxPagesToShow(): int {\n return $this->max_pages_to_show;\n }",
"function get_page_params($count) {\n\n\tglobal $ROWS_PER_PAGE;\n\t\n\tif ($ROWS_PER_PAGE == '') $ROWS_PER_PAGE=10;\n\n\t$page_arr=array();\n\n\t$firstpage = 1;\n\t$lastpage = intval($count / $ROWS_PER_PAGE);\n\t$page=(int)get_arg($_GET,\"page\");\n\n\n\tif ( $page == \"\" || $page < $firstpage ) { $page = 1; }\t// no page no\n\tif ( $page > $lastpage ) {$page = $lastpage+1;}\t\t\t// page greater than last page\n\t//echo \"<pre>first=$firstpage last=$lastpage current=$page</pre>\";\n\n\tif ($count % $ROWS_PER_PAGE != 0) {\n\t\t$pagecount = intval($count / $ROWS_PER_PAGE) + 1;\n\t} else {\n\t\t$pagecount = intval($count / $ROWS_PER_PAGE);\n\t}\n\t$startrec = $ROWS_PER_PAGE * ($page - 1);\n\t$reccount = min($ROWS_PER_PAGE * $page, $count);\n\n\t$currpage = ($startrec/$ROWS_PER_PAGE) + 1;\n\n\n\tif($lastpage==0) {\n\t\t$lastpage=null;\n\t} else {\n\t\t$lastpage=$lastpage+1;\n\t}\n\n\tif($startrec == 0) {\n\t\t$prevpage=null;\n\t\t$firstpage=null;\n\t\tif($count == 0) {$startrec=0;}\n\t} else {\n\t\t$prevpage=$currpage-1;\n\t}\n\t\n\tif($reccount < $count) {\n\t\t$nextpage=$currpage+1;\n\t} else {\n\t\t$nextpage=null;\n\t\t$lastpage=null;\n\t}\n\n\t$appstr=\"&page=\"; \n\n\t// Link to PREVIOUS page (and FIRST)\n\tif($prevpage == null) {\n\t\t$prev_href=\"#\";\n\t\t$first_href=\"#\";\n\t\t$prev_disabled=\"disabled\";\n\t} else {\n\t\t$prev_disabled=\"\";\n\t\t$prev_href=$appstr.$prevpage; \n\t\t$first_href=$appstr.$firstpage; \n\t}\n\n\t// Link to NEXT page\n\tif($nextpage == null) {\n\t\t$next_href = \"#\";\n\t\t$last_href = \"#\";\n\t\t$next_disabled=\"disabled\";\n\t} else {\n\t\t$next_disabled=\"\";\n\t\t$next_href=$appstr.$nextpage; \n\t\t$last_href=$appstr.$lastpage; \n\t}\n\n\tif ( $lastpage == null ) $lastpage=$currpage;\n\n\t$page_arr['page_start_row']=$startrec;\n\t$page_arr['page_row_count']=$reccount;\n\n\t$page_arr['page']=$page;\n\t$page_arr['no_of_pages']=$pagecount;\n\n\t$page_arr['curr_page']=$currpage;\n\t$page_arr['last_page']=$lastpage;\n\n\t$page_arr['prev_disabled']=$prev_disabled;\n\t$page_arr['next_disabled']=$next_disabled;\n\n\t$page_arr['first_href']=$first_href;\n\t$page_arr['prev_href']=$prev_href;\n\t$page_arr['next_href']=$next_href;\n\t$page_arr['last_href']=$last_href;\n\n\t//LOG_MSG('INFO',\"Page Array=\".print_r($page_arr,true));\n\treturn $page_arr;\n}",
"function make_page($total_items, $items_per_page, $p) {\n\n\tif(($total_items % $items_per_page) != 0) { $maxpage = ($total_items) / $items_per_page + 1; } else { $maxpage = ($total_items) / $items_per_page; }\n\t$maxpage = (int) $maxpage;\n\tif($maxpage <= 0) { $maxpage = 1; }\n\tif($p > $maxpage) { $p = $maxpage; } elseif($p < 1) { $p = 1; }\n\t$start = ($p - 1) * $items_per_page;\n\n\treturn Array($start, $p, $maxpage);\n\n}",
"private function getMaxPages()\n {\n return (int) ceil($this->totalResources / $this->perPage );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the foreground color. | public function setForegroundColor(BCGColor $foregroundColor): void
{
$this->foregroundColor = $foregroundColor;
} | [
"public function setForeground($color = null) {\n\t\tif (null === $color) {\n\t\t\t$this->foreground = null;\n\t\t\treturn;\n\t\t}\n\n\t\t$this->foreground = $color;\n\t}",
"public function setForeground($color = null): void;",
"public function setForeground(string $color = null): void;",
"public function foregroundColor();",
"public function set_base_foreground($value){\n $this->set_info('field_base_foreground', $value);\n }",
"public function setForegroundColor($code): void\n {\n if ($code instanceof BCGColor) {\n $this->colorFg = $code;\n } else {\n $this->colorFg = new BCGColor($code);\n }\n }",
"public function foreground(\\Malenki\\Aleavatar\\Primitive\\Color $color)\n {\n $this->arr_colors[1] = $color;\n }",
"public function setForeground($color = null) {\n if (null === $color) {\n $this->foreground = null;\n\n return;\n }\n\n if (!isset(static::$availableColors[$color])) {\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid foreground color specified: \"%s\". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableColors))\n ));\n }\n\n $this->foreground = static::$availableColors[$color];\n }",
"public function setForegroundColor($code) {\r\n if ($code instanceof CINColor) {\r\n $this->colorFg = $code;\r\n } else {\r\n $this->colorFg = new CINColor($code);\r\n }\r\n }",
"public function setColorBlue() {\n\t\t$this->sendEscape(self::ESC_COLOR_BLUE);\n\t}",
"function setFgColors() {\n\t\t\t$fgColors = func_get_args();\n\t\t\t$this->fgColors = $fgColors;\n\t\t}",
"public function SetDefaultForegroundColor($fgColor) : void\n {\n $this->defaults['foreground'] = $fgColor;\n }",
"function SetTextForeground(wxColour $colour){}",
"public function setBlueBackground()\n {\n $this->SetFillColor($this->colorBlueDark['red'], $this->colorBlueDark['green'], $this->colorBlueDark['blue']);\n }",
"public function setEndColor($value) {\r\n $this->endColor = $this->setStringProperty($this->endColor, $value);\r\n }",
"public function renderForeground()\n {\n $foreground = $this->component;\n $attribute = $this->getColorAttribute($foreground);\n $this->setRender(\" color:{$attribute};\");\n return $this->render;\n }",
"public function fgMagenta()\n {\n $this->fgColor = self::MAGENTA;\n\n return $this;\n }",
"public function setBlueLine()\n {\n $this->SetDrawColor($this->colorBlueLight['red'], $this->colorBlueLight['green'], $this->colorBlueLight['blue']);\n }",
"public function fgDefault()\n {\n $this->fgColor = null;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns value of 'ParentEntityId' property | public function getParentEntityId()
{
$value = $this->get(self::PARENTENTITYID);
return $value === null ? (string)$value : $value;
} | [
"function getParentId() {\n return $this->getFieldValue('parent_id');\n }",
"public function getParentIdFieldName();",
"public function getIdParent()\n {\n return $this->idParent;\n }",
"public function getParentId()\n {\n return $this->parentId;\n }",
"public function getParentId()\n {\n return $this->parent;\n }",
"public function get_parent_id()\n {\n if ( ! isset($this->_properties['parent_id']))\n {\n $parent = $this->mapper()->find_parent($this, array('columns' => array('id')));\n $this->_properties['parent_id'] = $parent->id;\n }\n return $this->_properties['parent_id'];\n }",
"public function getParentEntityTypeId() {\n return $this->parentEntityTypeId;\n }",
"public function parentEntity();",
"public function get_parent_property()\n {\n return CourseGroup::PROPERTY_PARENT_ID;\n }",
"public function parent_uid(){\n return $this->getValue(\"parent_uid\");\n }",
"public function getParentPrimaryKey()\n {\n return $this->getParentEntityDescriptor()\n ->getPrimaryKey()\n ->getField();\n }",
"public function get_id_parent()\r\n {\r\n return $this->id_parent;\r\n }",
"public function getParentInvoiceId()\n {\n return $this->getParameter('parentInvoiceId');\n }",
"public function getParentValue(): mixed;",
"public function getParentId()\n {\n return $this->getWrappedObject()->parent_id;\n }",
"public function getParentIdName();",
"public function getParentId()\n\t{\n\t\tif( isset( $this->values['order.status.parentid'] ) ) {\n\t\t\treturn (string) $this->values['order.status.parentid'];\n\t\t}\n\t}",
"public function getParentEntityTypeId(): int\n\t{\n\t\treturn $this->parentEntityTypeId;\n\t}",
"function getParentID() {\n\t\treturn $this->_ParentID;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the child elements | public function getChildElements() {} | [
"public function getChildElements()\n {\n return $this->childElements;\n }",
"public function getChildNodes();",
"public function children() : htmldoc {\n\t\treturn $this->find('*>*');\n\t}",
"public function children()\n\t{\n\t\t$a = array();\n\t\tif($this->node->childNodes->length)\n\t\t{\n\t\t\tforeach($this->node->childNodes as $node)\n\t\t\t{\n\t\t\t\tif($node->nodeType == 1)\n\t\t\t\t\t$a[] = new html_dom_node($node, $this->dom);\n\t\t\t}\n\t\t}\n\t\treturn $a;\n\t}",
"public function getChildren()\n {\n $children = array();\n \n if ($this->isSingletag() || \\count($this->childs) < 1)\n return $children;\n \n while(($child = $this->eachChild()) != NULL)\n {\n $children[]= $child['element'];\n }\n \n return $children;\n }",
"public function GetInnerElements() {\n\t\treturn $this->element->Children->Get();\n\t}",
"public function getChildNodes()\n {\n return $this->childNodes;\n }",
"public function children() {\n\t\n\t\t// make a new array\n\t\t$children = array();\n\t\t\n\t\t// get children as simplexmlelements\n\t\t\n\t\tforeach ( $this->xml->children() as $name => $value )\n\t\t\tarray_push( $children , new RealXML( $value ) );\n\t\t\t\n\t\treturn $children;\n\t}",
"public function getAllChildElements()\n {\n $list = [];\n\n foreach ($this->getChildren() as $child) {\n $list[] = $child;\n if (count($child->getChildren()) > 0) {\n $children = $child->getAllChildElements();\n $list = array_merge($list, $children);\n }\n }\n\n return $list;\n }",
"protected function getChildren() {\n $children = \"\";\n foreach($this->children as $key=>$val) {\n $children .= $val->getXML();\n }\n return $children;\n\n }",
"public function getChildNodes() : array\n {\n return $this->childNodes;\n }",
"public function get_children()\n {\n return $this->get_descendants(1);\n }",
"public function getChildNodes()\n {\n return $this->children;\n }",
"public function getDescendants();",
"public function getter_children();",
"public function get_children() {\n return $this->get_filtered_children('*', false, true);\n }",
"final protected function getChildren($tag_name = null) {\n\t\tif (!$tag_name) {\n\t\t\treturn $this->children;\n\t\t}\n\t\t\n\t\tthrow new PXHPException($this, '$tag_name arg is not net implemented!');\n\t\t\n\t\t//TODO: Allow returning only certain children.\n\t\t// $tag_name = PXHP_Base::element2class($tag_name);\n\t\t// $ret = array();\n\t\t// foreach ($this->children as $child) {\n\t\t// \tif ($child instanceof $tag_name) {\n\t\t// \t\t$ret[] = $child;\n\t\t// \t}\n\t\t// }\n\t\t// return $ret;\n\t\t\n\t}",
"public function getAllElements()\r\n {\r\n }",
"protected function getBodyChildrenElements() : \\Symfony\\Component\\DomCrawler\\Crawler\n {\n return $this->getCrawler()->filter($this->rootSelector)->children();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the next endpoint from the list of endpoints As a sideeffect this function switches to a new endpoint | public function nextEndpoint()
{
assert(is_array($this->values[self::OPTION_ENDPOINT]));
$endpoints = $this->values[self::OPTION_ENDPOINT];
$numberOfEndpoints = count($endpoints);
$this->_currentEndpointIndex++;
if ($this->_currentEndpointIndex >= $numberOfEndpoints) {
$this->_currentEndpointIndex = 0;
}
$endpoint = $endpoints[$this->_currentEndpointIndex];
if ($numberOfEndpoints > 1) {
$this->storeOptionsInCache();
}
return $endpoint;
} | [
"public function getForcedEndpointForNextQuery(): ?string\n {\n return $this->nextEndpoint;\n }",
"private function next()\r\n {\r\n $url = $this->urlsLeftToScan[0]; \r\n unset($this->urlsLeftToScan[0]);\r\n\r\n $this->urlsScanned[] = $url;\r\n $this->urlsLeftToScan = array_values($this->urlsLeftToScan);\r\n\r\n return $url;\r\n }",
"public function next(): void\n {\n next($this->routes);\n\n --$this->count;\n }",
"public function next(): UriInterface\n {\n return array_shift($this->queue);\n }",
"public function next() {\n\t\treturn next($this->segments);\n\t}",
"function nextService()\n{\nif ($this->services) {\n$this->_current = array_shift($this->services);\n} else {\n$this->_current = null;\n}\nreturn $this->_current;\n}",
"public function next() {\n if (count($this->matchedRoutes) > 0) {\n $this->currentRoute = array_shift($this->matchedRoutes);\n foreach ($this->currentRoute->keys as $param) {\n $this->currentRoute->params[$param[\"name\"]] = $param[\"value\"];\n }\n\n // Trigger event\n $this->app->dispatcher()->fire('router.next', array('route' => $this->currentRoute, 'sender' => $this));\n return $this->currentRoute;\n }\n // Trigger event\n $this->app->dispatcher()->fire('router.next', array('route' => false, 'sender' => $this));\n return false;\n }",
"public function getNextUrls();",
"public function findNextLink();",
"public static function getDefaultEndpoint(array $endpoints, array $bindings = NULL) {\n\n\t\t$firstNotFalse = NULL;\n\t\t$firstAllowed = NULL;\n\n\t\t/* Look through the endpoint list for acceptable endpoints. */\n\t\tforeach ($endpoints as $i => $ep) {\n\t\t\tif ($bindings !== NULL && !in_array($ep['Binding'], $bindings, TRUE)) {\n\t\t\t\t/* Unsupported binding. Skip it. */\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (array_key_exists('isDefault', $ep)) {\n\t\t\t\tif ($ep['isDefault'] === TRUE) {\n\t\t\t\t\t/* This is the first endpoitn with isDefault set to TRUE. */\n\t\t\t\t\treturn $ep;\n\t\t\t\t}\n\t\t\t\t/* isDefault is set to FALSE, but the endpoint is still useable as a last resort. */\n\t\t\t\tif ($firstAllowed === NULL) {\n\t\t\t\t\t/* This is the first endpoint that we can use. */\n\t\t\t\t\t$firstAllowed = $ep;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($firstNotFalse === NULL) {\n\t\t\t\t\t/* This is the first endpoint without isDefault set. */\n\t\t\t\t\t$firstNotFalse = $ep;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($firstNotFalse !== NULL) {\n\t\t\t/* We have an endpoint without isDefault set to FALSE. */\n\t\t\treturn $firstNotFalse;\n\t\t}\n\n\t\t/*\n\t\t * $firstAllowed either contains the first endpoint we can use, or it\n\t\t * contains NULL if we cannot use any of the endpoints. Either way we\n\t\t * return the value of it.\n\t\t */\n\t\treturn $firstAllowed;\n\t}",
"public static function next(): void\n {\n throw new Exceptions\\NextRouteException('next');\n }",
"public function get_next() {\n\t\treturn $this->url;\n\t}",
"public function setNext($next) {\n $this->next = $next;\n }",
"protected function getEndPoint()\n {\n foreach ($this->destinations as $destination) {\n if (!in_array($destination, $this->sources)) {\n return $destination;\n }\n }\n\n }",
"public function next($index){}",
"public function getNextRestPair()\n {\n $this->rest->next();\n if($this->rest->valid())\n return [$this->rest->key() => $this->rest->current()];\n else {\n return FALSE;\n }\n \n }",
"public function getNext() {\n return $this->get(self::NEXT);\n }",
"protected function getNext() {\n\t\t$this->index++;\n\t\tif($this->index < count($this->chain)) {\n\t\t\treturn $this->chain[$this->index];\n\t\t}\n\t}",
"public function next(): ServantInterface\n {\n if ( $this->nextServant instanceof ServantInterface ) {\n return $this->nextServant;\n }\n\n throw new ServantException('No more servants');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a form to delete a ResultType entity by id. | private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('admin_resulttype_delete', array('id' => $id)))
->setMethod('DELETE')
->add('submit', 'submit', array('label' => 'Delete'))
->getForm()
;
} | [
"private function createDeleteForm(Result $result)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_result_delete', array('id' => $result->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('crud_spendings_type_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm(CrmParamTypeResultat $crmParamTypeResultat)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('crmparamtyperesultat_delete', array('id' => $crmParamTypeResultat->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('resultados_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('zimzim_opinion_typebutchery_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'button.delete'))\n ->getForm();\n }",
"private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('statistiques_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm($id) {\r\n\t\treturn $this->createFormBuilder ()->setAction($this->generateUrl('signalisationstatut_delete', array ('id' => $id)))\r\n\t\t\t\t->setMethod('DELETE' )->add('submit', 'submit', array('label' => 'Delete'))\r\n\t\t\t\t->getForm();\r\n\t}",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('physicians_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'attr' => array('class' => 'submit btnAdm lila')))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('prospectos_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personne_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tipoactividad_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm()\n ;\n }",
"private function createDeleteForm( $id ) {\n\t\treturn $this->createFormBuilder()\n\t\t ->setAction( $this->generateUrl( 'persona_delete', array( 'id' => $id ) ) )\n\t\t ->setMethod( 'DELETE' )\n\t\t ->add( 'submit', 'submit', array( 'label' => 'Delete' ) )\n\t\t ->getForm();\n\t}",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('prephysicians_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('contact-form-type_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('file_type_delete', ['id' => $id]))\n ->setMethod('DELETE')\n ->add(\n 'submit',\n 'submit',\n [\n 'label' => $this->get('translator')->trans('navigation.delete'),\n 'attr' => [\n 'submit_class' => 'btn-danger',\n 'submit_glyph' => 'fa-exclamation-circle',\n ],\n ]\n )\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('valorfiltro_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('manu_statistique_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('box_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return if a preference exists or not. | public function has($key)
{
return $this->preferences->has($key);
} | [
"function checkPreference($preference) {\n\n if($preference != null) {\n return true;\n } else {\n return false;\n }\n }",
"protected function isPreferenceLoaded() : bool {\n if(empty($this->getPreference(self::PREFERENCE_ENDPOINT))) return false;\n if(empty($this->getPreference('X-Appwrite-Project'))) return false;\n if(empty($this->getPreference('X-Appwrite-Key'))) return false;\n if(empty($this->getPreference('X-Appwrite-Locale'))) return false;\n return true;\n }",
"function user_pref_exists( $p_user_id, $p_project_id = ALL_PROJECTS ) {\n\tif( false === user_pref_cache_row( $p_user_id, $p_project_id, false ) ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}",
"public static function existsUserPrefs() {\n if (isset($_SESSION['nocc_user_prefs'])) {\n if ($_SESSION['nocc_user_prefs'] instanceof NOCCUserPrefs) {\n return true;\n }\n }\n return false;\n }",
"function has_setting( $name ) {\n\t\treturn isset($this->settings[ $name ]);\n\t}",
"public function exists($name) {\n\t\treturn array_key_exists($name, $this->settings);\n\t}",
"public function hasSettings();",
"public function setting_exists( $name ) {\n\n\t\treturn isset( $this->settings[ $name ] );\n\t}",
"public function setting_exists($key)\n\t{\n\t\treturn $this->get($key) === NULL;\n\t}",
"public function exists()\n\t{\n\t\tif (!isset($_COOKIE[$this->name])) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$cookie = $this->cookie->find($_COOKIE[$this->name]);\n\t\treturn isset($cookie['id']);\n\t}",
"public function has_preferences($site_id=FALSE)\n {\n if(!$site_id)\n {\n $site_id = $this->EE->config->item('site_id');\n }\n $q = $this->EE->db->get_where($this->table_name, array('site_id' => $site_id));\n return $q->num_rows() > 0;\n }",
"public function hasSetting($name);",
"public function has($key)\n {\n return array_key_exists($key, $this->settings);\n }",
"function learn_press_has_profile_method() {\r\n\t$lpr_profile = get_option( '_lpr_settings_general', array() );\r\n\tif ( isset( $lpr_profile['set_page'] ) && $lpr_profile['set_page'] == 'lpr_profile' ) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}",
"public function has_setting( string $name ): bool {\n\t\treturn isset( $this->settings[ $name ] );\n\t}",
"static function exists($setting) {\n global $_MYSQLI;\n \n // get the setting\n $query = \"SELECT `id`\n FROM `\".DB_PREF.\"settings`\n WHERE `setting`='\".mysqli_real_escape_string($_MYSQLI,$setting).\"'\n LIMIT 1\";\n \n $result = run_query($query);\n \n if ($row = mysqli_fetch_assoc($result)) {\n $ret = true;\n } else {\n $ret = false;\n }\n \n // free the result\n mysqli_free_result($result);\n \n // and return\n return $ret;\n }",
"function hasSetting($settingName) {\n\t\treturn isset($this->_settings[$settingName]);\n\t}",
"public function isFavorite()\n {\n if (!empty($this->settings)) {\n if (@RevsliderPrestashop::getIsset($this->settings['favorite']) && $this->settings['favorite'] == 'true') {\n return true;\n }\n }\n\n return false;\n }",
"public function hasStoredPph()\n {\n return $this->stored_pph !== null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the template is cached. | public function isCached()
{
return $this->tplObj->isCached();
} | [
"public static function isReCachingTemplate()\n {\n return self::$_isReCaching;\n\n }",
"public function isCached() {}",
"public function isCached() \n {\n $modified = (file_exists($this->cache_file)) ? filemtime($this->cache_file) : 0;\n return ((time() - $this->cache_expires) < $modified);\n }",
"public function isCached();",
"protected function isViewCached() {\n\n if(file_exists($this->cacheFile) === true) {\n\n return $this->isCacheActual();\n }\n return false;\n }",
"function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }",
"function is_cached($template, $cache_id=null, $compile_id=null)\n {\n // insert the condition to check the cache here!\n // if (functioncheckdb($this -> module)) {\n // return parent :: clear_cache($template, $this -> cache_id);\n //}\n $this->_setup_template($template);\n\n if ($cache_id) {\n $cache_id = $this->module . '|' . $cache_id;\n } else {\n $cache_id = $this->module . '|' . $this->cache_id;\n }\n\n if (!isset($compile_id)) {\n $compile_id = $this->compile_id;\n }\n\n return parent::is_cached($template, $cache_id, $compile_id);\n }",
"public static function cacheExists($template)\n {\n if (file_exists(__DIR__ . '/../cache/' . $template . '.php')) {\n return true;\n } else {\n return false;\n }\n }",
"private function checkIfCached($ttl) {\n\t\tif ($ttl == 0) return false;\n\t\tif (file_exists(TEMPLATE_DIR.$this->output_file. HTML_EXTENSION)) // Output file already present\n\t\t\tif ((filemtime(TEMPLATE_DIR.$this->output_file. HTML_EXTENSION) + $ttl) > time()) // it is recent\n\t\t\t\treturn true;\n\t\treturn false;\n\t}",
"public function cache_exists() {\n return file_exists($this->cache_path);\n }",
"public function hasCaching(): bool;",
"public function hasCache(): bool\n {\n return isset($this->contents);\n }",
"public function isCached()\n {\n $cache_lifetime = Helper::getOption('cache_lifetime', 0);\n if ($cache_lifetime>0) {\n return (@file_exists($this->getCacheKey()) && (filemtime($this->getCacheKey())+$cache_lifetime) > time());\n } else {\n return (@file_exists($this->getCacheKey()));\n }\n }",
"public function cache_valid() {\n return $this->cache_exists();\n }",
"public function isCached()\n\t{\n\t\treturn $this->statusCode == 304;\n\t}",
"public function hasCachedView()\n {\n if (config('sitemap.cache_enabled')) {\n $key = $this->getCacheKey();\n\n return $this->cache->has($key);\n }\n\n return false;\n }",
"protected function should_cache() {\n\t\tinclude_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\treturn ! is_plugin_active( 'wp-rest-cache/wp-rest-cache.php' );\n\t}",
"public function shouldCache(): bool;",
"function cacheExists() {\n return $this->fs->exists($this->tmp . $this->onDisk);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bildung eines 1dimensionalen nummerischen Array aus einer Datenbankabfrage | function array_bildung_simpel($abfrage){
$i=0;
while($wert=$abfrage->fetch_array(patDBC_TYPENUM)){
foreach($wert as $inhalt){
$ausgabe[$i]=$inhalt;
$i++;
}
}
return $ausgabe;
} | [
"function array_bildung($abfrage){ // Bildung eines Array 2-dimensional aus einer Datenbankabfrage\n\t$i=0;\n\twhile($wert=$abfrage->fetch_array(patDBC_TYPEASSOC)){\n\t\tforeach($wert as $name => $inhalt){\n\t\t\t$ausgabe[$name][$i]=$inhalt;\n\t\t}\n\t$i++;\n\t}\n\treturn $ausgabe;\n}",
"function get_data()\n {\n for($i = 0; $i < $this->numRows; $i++)\n {\n for($j = 0; $j < $this->numColumns; $j++)\n {\n if(empty($this->numbers[$i][$j]) == false)\n {\n $the_numbers[$i][$j] = $this->numbers[$i][$j];\n }\n else\n {\n $the_numbers[$i][$j] = 0;\n }\n }\n }\n return $the_numbers;\n }",
"function array_bildung($abfrage){ // Bildung eines Array aus einer Datenbankabfrage\n$i=0;\n\twhile($wert=$abfrage->fetch_array(patDBC_TYPEASSOC)){\n\t\tforeach($wert as $name => $inhalt){\n\t\t\t$ausgabe[$name][$i]=$inhalt;\n\t\t}\n\t$i++;\n\t}\n\treturn $ausgabe;\n}",
"public static function archNumbers () {\n $results = self::orderBy('nomgaz', 'desc')->get();\n $numbers = array(); //array of numbers (1028,1027,1026,1025)\n foreach ($results as $r)\n {\n $numbers[$r->id] = [$r->nomgaz, $r->nomgod];\n }\n\n // check if new(not published) number exist\n $delLast = Settings::find(1);\n if ($delLast->currnom != $delLast->newnom) {\n unset($numbers[key($numbers)]);\n }\n\n return $numbers;\n }",
"function array_bildung($abfrage){\n$i=0;\n\twhile($wert=$abfrage->fetch_array(patDBC_TYPEASSOC)){\n\t\tforeach($wert as $name => $inhalt){\n\t\t\t$ausgabe[$name][$i]=$inhalt;\n\t\t}\n\t$i++;\n\t}\n\treturn $ausgabe;\n}",
"function nb_dim( array $Tableau ) : int\n {\n $Reset = reset($Tableau);\n if (is_array($Reset))\n $Nombre = nb_dim($Reset) + 1;\n else\n $Nombre = 1;\n\n return $Nombre;\n }",
"protected function getArrayOfRecordNumbers()\n {\n $result = array();\n\n if (($this->ControlState & csDesigning) != csDesigning)\n {\n // check if DS is set and active\n //TODO: Check if DS is active\n if ($this->_datasource!=null && $this->_datasource->Dataset!=null && $this->_datasource->Dataset->Active)\n {\n $ds = $this->_datasource->DataSet;\n $currentRecord = $this->_currentpos; //$ds->RecNo;\n $recordCount = $ds->RecordCount;\n\n // we want to have the current record number in the center (if possible)\n $centeroffset = round($this->_shownrecordscount/2);\n\n // Calculate the range to show (0 = first; $recordCount-1 = last).\n // The first few records (till $centeroffset) are treated differently ($end is $this->_shownrecordscount-1).\n if ($currentRecord < $centeroffset)\n {\n // check if record count is lower than $this->_shownrecordscount\n // if yes, then $end is $recordCount-1, otherwise $this->_shownrecordscount-1\n $end = min($recordCount, $this->_shownrecordscount)-1;\n }\n else\n {\n // $end is either $recordCount-1 or the current record plus the offset ($centeroffset floored is case _shownrecordscount is odd)\n $end = min($recordCount-1, $currentRecord + floor($this->_shownrecordscount/2));\n }\n // go no lower than 0 (first) and always show as many numbers as possible\n $start = max(0,\n $currentRecord - max($centeroffset - 1,\n $this->_shownrecordscount - ($end - $currentRecord) - 1\n )\n );\n\n // add the record numbers to the result array\n for ($x = $start; $x <= $end; $x++)\n {\n // use the real record number as key\n $result[$x] = array(\"recordnumber\" => ($x+1), // record index starts at 0, so add 1 to the number to print\n \"currentrecord\" => ($x == $currentRecord),\n \"first\" => ($x == 0), // record index starts at 0\n \"last\" => ($x == $recordCount-1)\n );\n }\n }\n }\n // only return dummy values when at design-time\n else if (($this->ControlState & csDesigning) == csDesigning)\n {\n // let's add some dummy values for design-time\n for ($x = 1; $x <= $this->_shownrecordscount; $x++)\n {\n // use the real record number (starting at 0) as key\n $result[$x-1] = array(\"recordnumber\" => $x,\n \"currentrecord\" => ($x == 1), // first is current record\n \"first\" => ($x == 1),\n \"last\" => false // last not reached\n );\n }\n }\n\n return $result;\n }",
"function bladeNums(): array {\n //echo \"Fabrication du cycle bladeNums\\n\";\n $bladeNums = [];\n $bladeNum = $this->bladeNum;\n //echo \" bladeNum=$bladeNum\\n\";\n for ($counter=0; $counter<100000; $counter++) {\n $bladeNums[] = $bladeNum;\n $bladeNum = Blade::get($bladeNum)->fiNum();\n //echo \" bladeNum=$bladeNum\\n\";\n if ($bladeNum == $this->bladeNum) {\n //echo Yaml::dump(['bladeNums()'=> $bladeNums]);\n return $bladeNums;\n }\n }\n throw new Exception(\"Nbre d'itérations max atteint pour bladeNum = $this->bladeNum\");\n }",
"public function __toString()\n {\n return \"NumArray(\".StringHelper::toString($this->data).\")\\n\";\n }",
"function jugadores(){\n\n $numjugadores=4;\n $jugadores=array();\n\n for($i=1;$i<=$numjugadores;$i++){\n \n $jugadores['jugador'.$i]=array();\n }\n\n return $jugadores;\n\n}",
"function tentukan_deret_geometri($arr) {\n // kode di sini\n}",
"function createArrayType1()\n {\n for ($floors = 0; $floors < 10; $floors++) {\n $rooms[$floors] = ($floors+1) . \"13\";\n }\n return $rooms;\n }",
"public function dataPartition()\n\t{\n\t\treturn [\n\t\t\t[new FractionNumber(1, 2), new FractionNumber(1, 4), new FractionNumber(2, 1)],\n\t\t\t[new FractionNumber(0, 8), new FractionNumber(1, 4), new FractionNumber(0, 1)],\n\t\t\t[new FractionNumber(8, -8), new FractionNumber(1, 4), new FractionNumber(-4, 1)],\n\t\t\t[new FractionNumber(7, 5), new FractionNumber(4, 10), new FractionNumber(7, 2)],\n\t\t\t[new FractionNumber(1, 8), new FractionNumber(1, -4), new FractionNumber(-1, 2)],\n\t\t\t[new FractionNumber(-2, 8), new FractionNumber(1, -4), new FractionNumber(1, 1)],\n\t\t\t[new FractionNumber(2, -8), new FractionNumber(-1, -4), new FractionNumber(-1, 1)],\n\t\t];\n\t}",
"private function segment_barchart_data($data, $num, $doctypes) {\n $max = 0;\n $all_data = array();\n for ($i = 0; $i < $num; $i++) {\n $bar_data = array();\n foreach ($doctypes as $doc_type) {\n // don't add zeroes (messes up the tool tips)\n if ($data[$doc_type][$i]) $bar_data[$doc_type] = $data[$doc_type][$i];\n }\n $current_total = array_sum(array_values($bar_data));\n if ($current_total > $max) $max = $current_total;\n $all_data[] = $bar_data; \n }\n return array($all_data, $max);\n }",
"public function data_modulo() {\n\t\t\t$data = array(\n\t\t\t\tarray(array(10.0, 2.0), array(0.0)),\n\t\t\t\tarray(array(-1.0, 2.0), array(-1.0)),\n\t\t\t\tarray(array(-1.0, 1.0), array(0.0)),\n\t\t\t\tarray(array(0.0, -1.0), array(0.0)),\n\t\t\t\tarray(array(1.0, -1.0), array(0.0)),\n\t\t\t\tarray(array(-1.0, -1.0), array(0.0)),\n\t\t\t\tarray(array(-10.0, 2.0), array(0.0)),\n\t\t\t\tarray(array(10.0, 3.0), array(1.0)),\n\t\t\t\tarray(array(-10.0, 3.0), array(-1.0)),\n\t\t\t\tarray(array(-10.0, -3.0), array(-1.0)),\n\t\t\t\tarray(array(10.0, -3.0), array(1.0)),\n\t\t\t);\n\t\t\treturn $data;\n\t\t}",
"public function data_modulo() {\n\t\t\t$data = array(\n\t\t\t\tarray(array(10, 2), array(0)),\n\t\t\t\tarray(array(-1, 2), array(-1)),\n\t\t\t\tarray(array(-1, 1), array(0)),\n\t\t\t\tarray(array(0, -1), array(0)),\n\t\t\t\tarray(array(1, -1), array(0)),\n\t\t\t\tarray(array(-1, -1), array(0)),\n\t\t\t\tarray(array(-10, 2), array(0)),\n\t\t\t\tarray(array(10, 3), array(1)),\n\t\t\t\tarray(array(-10, 3), array(-1)),\n\t\t\t\tarray(array(-10, -3), array(-1)),\n\t\t\t\tarray(array(10, -3), array(1)),\n\t\t\t);\n\t\t\treturn $data;\n\t\t}",
"function matrix()\n {\n //See which information is passed as arguments.\n $nArgs = func_num_args();\n $numbers = func_get_arg(0);\n\n if($nArgs > 2) //If the three arguments version, set the values.\n {\n $this->numRows = func_get_arg(1);\n $this->numColumns = func_get_arg(2);\n }\n \n //Routine to initialise the array of numbers.\n $numberColumns = 0;\n $numberRows = 0;\n\n if(empty($numbers) == false) //If the array is not empty\n { \n foreach($numbers as $i => $rows) //Check every row...\n {\n foreach($rows as $j => $number) //...and column to remove zeros.\n {\n if($number != 0)\n {\n $this->numbers[$i][$j] = $number; \n }\n //Find the biggest width of the array. \n if($j >= $numberColumns) \n {\n $numberColumns = $j;\n }\n }\n //Find the biggest depth of the array.\n if($i >= $numberRows)\n {\n $numberRows = $i;\n }\n }\n //Arrays starts at zero (so we add one)\n $numberRows++;\n $numberColumns++;\n }\n \n //If the user misspecified the number of rows/columns by a lower value. \n if($numberRows > $this->numRows) \n {\n $this->numRows = $numberRows;\n }\n \n if($numberColumns > $this->numColumns)\n {\n $this->numColumns = $numberColumns;\n }\n }",
"function toArrayNumerico($query) {\n $array = array();\n $fila = $col = 0;\n\n foreach ($query->result() as $row) {\n $col = 0;\n foreach ($row as $key => $value) {\n $array[$fila][$col] = $value;\n $col++;\n }\n $fila++;\n }\n return $array;\n}",
"public function useNumberProvider(){\n\n return [\n [1,[1,0,0,0,0,0,0,0,0]],\n [2,[0,2,0,0,0,0,0,0,0]],\n [3,[0,0,3,0,0,0,0,0,0]],\n [4,[0,0,0,4,0,0,0,0,0]],\n [5,[0,0,0,0,5,0,0,0,0]],\n [6,[0,0,0,0,0,6,0,0,0]],\n [7,[0,0,0,0,0,0,7,0,0]],\n [8,[0,0,0,0,0,0,0,8,0]],\n [9,[0,0,0,0,0,0,0,0,9]],\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Group By Field Break Footer ... | function getGroupByFooterSums(&$conf,$prefix,&$GBMarkerArray,$fN,&$sql,&$row,$end,&$DEBUG) {
if ($conf['list.']['sumFields']) {
$sumFields = '';
$sumSQLFields = '';
$somme = 0;
$sumFields = explode(',', $conf['list.']['sumFields']);
foreach($sumFields as $fieldName) {
if ($conf['list.']['sqlcalcfields.'][$fieldName]) {
$calcField=$conf['list.']['sqlcalcfields.'][$fieldName]; // TO BE IMPROVED
if ($calcField) {
if (preg_match("/min\(|max\(|count\(|sum\(|avg\(/i",$calcField)) {
// we test for group by functions
$sumSQLFields.=$sumSQLFields?",$calcField as sum_$fieldName":"$calcField as sum_$fieldName";
} else {
$sumSQLFields.=$sumSQLFields?",sum($calcField) as sum_$fieldName":"sum($calcField) as sum_$fieldName";
}
}
}
else
{
$sumSQLFields.=$sumSQLFields?",sum($fieldName) as sum_$fieldName":"sum($fieldName) as sum_$fieldName";
}
}
$sumSQLFields.=', count(*) as metafeeditnbelts';
if ($sql['groupBy']) $sumSQLFields.=','.$conf['table'].'.*';
$WHERE=$sql['where'];
$fNA=t3lib_div::trimexplode(',',$conf['list.']['groupByFieldBreaks']);
$i=0;
$GBA=t3lib_div::trimexplode(',',$sql['gbFields']);
$GROUPBY=$sql['groupBy'];
$endgb=0;
foreach($fNA as $fNe) {
$fN2=t3lib_div::trimexplode(':',$fNe);
$fNi=$fN2[0];
if($fN2[2] || $endgb) {
//$WHERE.=" and $fN2[0]=".$row[$fNi];
/* See below
$calcField=$conf['list.']['sqlcalcfields.'][$fNi]; // TO BE IMPROVED
if ($calcField) {
$sumSQLFields.=$sumSQLFields?",$calcField as $fNi":"$calcField as $fNi";
}
*/
if (!$endgb) {
$GROUPBY=$GROUPBY?$GROUPBY.','.$fN2[0]:$fN2[0];
$HAVING=$HAVING?$HAVING." and $fN2[0]=".$row[$fNi]:" HAVING $fN2[0]=".$row[$fNi];
}
} else {
if (strpos($fNi,'.')===false && $row[$fNi]) {
//$table = $this->getForeignTableFromField($fNi, $conf);
$WHERE.=" and $conf[table].$fNi=".$row[$fNi];
$GROUPBY=$GROUPBY?$GROUPBY.','.$conf[table].'.'.$fNi:$conf[table].'.'.$fNi;
} else {
$WHERE.=$this->makeSQLJoinWhere($conf['table'],$fNi,$conf,$row[$fNi]);
}
}
// We stop at our depth level ...
if ($fNi==$fN) {
$endgb=1;
}
}
$GROUPBY=strpos($GROUPBY,"GROUP BY")?$GROUPBY:($GROUPBY?" GROUP BY ".$GROUPBY:'');
if ($conf['list.']['havingString']) $HAVING=$HAVING?$HAVING.' AND '.$conf['list.']['havingString']:' HAVING '.$conf['list.']['havingString'];
// Check group by fields for calculated fields ..
/*if (is_array($conf['list.']['sqlcalcfields.'])) foreach ($conf['list.']['sqlcalcfields.'] as $fn=>$calcField) {
$sumSQLFields.=$sumSQLFields?",$calcField as $fn":"$calcField as $fn";
}*/
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($sumSQLFields, $sql['fromTables'], '1 '.$WHERE.$GROUPBY.$HAVING);
if ($conf['debug.']['sql']) $this->debug('Group by footer',$GLOBALS['TYPO3_DB']->SELECTquery($sumSQLFields, $sql['fromTables'], '1 '.$WHERE.$GROUPBY.$HAVING),$DEBUG);
$value=array();
while($valueelt = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
foreach($valueelt as $key=>$val) {
$value[$key]+=$val;
if ($key=='metafeeditnbelts') break;
}
}
foreach ($sumFields as $fieldName){
// we handle a stdWrap on the Data..
$std=$conf[$conf['cmdmode'].'.']['stdWrap.']?$conf[$conf['cmdmode'].'.']['stdWrap.']:$conf['stdWrap.'];
if ($std[$fieldName.'.'] || $std[$table.'.'][$fieldName.'.']) {
if ($std[$fieldName.'.']) $stdConf = $std[$fieldName.'.'];
if ($std[$table.'.'][$fieldName.'.']) $stdConf = $std[$table.'.'][$fieldName.'.'];
//$dataArr['EVAL_'.$_fN] =
$value['sum_'.$fieldName]=$this->cObj->stdWrap($value['sum_'.$fieldName], $stdConf);
}
$GBMarkerArray["###".$prefix."_".$fN."_FIELD_$fieldName###"]= $value['sum_'.$fieldName];
//$i++;
}
$GBMarkerArray["###".$prefix."_".$fN."_FIELD_metafeeditnbelts###"]= $value['metafeeditnbelts'];
//$sumcontent=$this->cObj->stdWrap(trim($this->cObj->substituteMarkerArray($itemSumCode, $this->markerArray)),$conf['list.']['sumWrap.']);
//$content=$this->cObj->substituteSubpart($content,'###SUM_FIELDS###',$sumcontent);
}
return true;
} | [
"private function buildGroupBySection()\n {\n if (count($this->groupBy)) {\n $this->sqlQuery .= \"\\n\" . static::QB_GROUPBY . ' ' . implode(', ', $this->groupBy);\n }\n }",
"public function processGroupby(){\n\t \tif($this->groupbyQuery!=false){\n\t \t\t$groupby_ini = \"GROUP BY \";\n\t \t\t$count_cont = 0;\n\t \t\tforeach ($this->groupbyQuery as $value) {\n\t \t\t\tif($count_cont>0){\n\t \t\t\t\t$groupby_ini .= ', ';\n\t \t\t\t}\n\t \t\t\t$groupby_ini .= $value[0].' ';\n\t \t\t\t$count_cont++;\n\t \t\t}\n\t \t\t$this->groupbyProcess = $groupby_ini;\n\t \t}else{\n\t \t\t$this->groupbyProcess = false;\n\t \t}\n\t }",
"private function _prepareWPGroupByBlock()\n {\n if (!$this->_has_groups) {\n return;\n }\n\n foreach ($this->_table_data['groupingRules'] AS $grouping_rule) {\n if (empty($grouping_rule)) {\n continue;\n }\n $this->_group_arr[] = $this->_column_aliases[$grouping_rule];\n }\n\n }",
"function acf_prepare_field_group_for_export($field_group = array())\n{\n}",
"function layout_table_footer($aField)\n{\n\t$html = \"\";\n\t$html .= \"<tfoot>\\n\";\n/*\n\t$html .= \"<tr>\\n\";\n\tforeach ( $aField as $fld => $fld_value )\n\t\t{\n\t\t\tif( layout_view_field_table($fld_value) )\n\t\t\t\t$html .= \"<td><input type='text' name='$fld' id='dbmng_$fld' placeholder='\" . t(\"Search\") . \" \" . t($fld_value['label']) . \"' /></td>\\n\";\n\t\t}\n\t$html .= \"<td>\" . t(\"Clear filtering\") . \"</td>\";\n\t$html .= \"</tr>\\n\";\n*/\n\t$html .= \"</tfoot>\\n\";\n\treturn $html;\n}",
"public function VisitGroupFooter( ART_Group &$component, $tab = \"\" ) {}",
"public static function group_content() {\n\n\t\tself::group_output( 'Boilerplate Group', self::$group_items );\n\t}",
"function acf_prepare_field_group_for_export( $field_group = array() ) {\n}",
"function join_group_by($tablename=\"\",$fieldname=\"\",$whereCon=\"\", $groupby=\"\",$findline='')\r\n {\r\n $arguments = array($tablename,$fieldname,$whereCon, $groupby);\r\n $this->debug_obj->WriteDebug($class=\"templates.class\", $function=\"join_group_by\", $file=$findline['file'], $this->debug_obj->FindFunctionCalledline('join_group_by', $findline['file'], $findline['line']), $arguments);\r\n\r\n $get_all_styles = $this->db_connect->querySelect(\"CALL uspGet_join_group_by(\\\"$tablename\\\", \\\"$fieldname\\\", \\\"$whereCon\\\", \\\"$groupby\\\")\");\r\n $this->db_connect->closedb();\r\n return $get_all_styles;\r\n }",
"function print_field_group($group,$group_values) { \r\n \r\n \r\n if (isset($group['heading'])) { print '<div class=\"field-group-heading\">' . $group['heading'] . '</div>'; }\r\n\r\n // Print any user defined HTML above the field\r\n if (isset($group['header'])) { print '<div class=\"field-group-header\">' . $group['header'] . \"</div>\"; }\r\n \r\n // if there are more than one field turn individual field titles on\r\n if (count( $group['fields']) > 1) {$is_group = true;} else {$is_group = false;}\r\n print '<div class=\"field-group-wrapper ' . ( ( $group['max'] > 1 ) ? 'field-group-multi' : '') . ' ' . ( $group['sortable'] ? 'field-group-sortable' : '') . '\" data-max=\"' . $group['max'] . '\">';\r\n\r\n // find out how many sets of data are stored for this group\r\n if (count($group_values) > 1) {$sets = count($group_values); } else { $sets = 1;}\r\n\r\n // Setup a counter to loop through the sets\r\n $counter = 0;\r\n\r\n while ($counter < $sets) {\r\n print '<ul class=\"field-group\" data-set=\"' . $counter . '\">';\r\n foreach( $group['fields'] as $field_name => $field) {\r\n\r\n print '<li class=\"field-' . $field_name . '\">';\r\n if ($is_group) { print \"<label class='' style='\" . $field['label_style'] . \"'>\" . $field['title'] . \"</label>\";}\r\n\r\n // Set the name attribute of the field\r\n $field['name'] = \"\" . $group['group'] . \"[\" . $counter . \"][\" . $field_name . \"]\";\r\n $field['id'] = $group['group'] . \"-\" . $counter . \"-\" . $field_name;\r\n\r\n $field['group'] = $group['group'];\r\n $field['field'] = $field_name;\r\n\r\n\r\n // Set the current value of the field\r\n if ($group_values != false && isset($group_values[$counter][$field_name])) {\r\n\r\n $field['value'] = $group_values[$counter][$field_name];\r\n } else {\r\n $field['value'] = \"\";\r\n }\r\n\r\n\r\n\r\n //print var_export($group_values,true);\r\n\r\n // generate the form field\r\n print $this->{$field['type']}($field);\r\n print '</li>';\t\r\n\r\n } // end foreach\r\n\r\n // for all but the first entry add a delete button\r\n if ($counter > 0) {\r\n print '<li><a href=\"#\" class=\"delete-group button\">Delete</a></li>';\r\n }\r\n\r\n print '</ul>';\r\n\r\n $counter++;\r\n } // end while\r\n\r\n\r\n if (($group['max'] > 1) && ($sets != $group['max'])) {print \"<a href='#' class='another-group button-primary'>Add Another</a>\"; }\r\n\r\n print '<div style=\"clear:both;\"></div></div>';\r\n if (isset($group['footer'])) { print $group['footer']; }\r\n }",
"function custom_posts_groupby( $groupby, $query ) {\n global $wpdb;\n if ( is_main_query() && is_search() ) {\n $groupby = \"{$wpdb->posts}.ID\";\n }\n return $groupby;\n}",
"function get_grouping_fields() {\n //field that is used to compare one record from the next\n $compare_field = sql_concat('user.lastname', \"'_'\", 'user.firstname', \"'_'\", 'user.id');\n\n //field used to order for groupings\n $order_field = sql_concat('lastname', \"'_'\", 'firstname', \"'_'\", 'userid');\n\n $cluster_label = get_string('grouping_cluster', 'rlreport_course_completion_by_cluster');\n $cluster_grouping = new table_report_grouping('cluster', 'cluster.id', $cluster_label, 'ASC',\n array('cluster.name'), 'above', 'path');\n \n $user_grouping_fields = array(\n 'user.idnumber AS useridnumber', 'user.firstname');\n $user_grouping = new table_report_grouping('groupuseridnumber', $compare_field, '', 'ASC', \n $user_grouping_fields, 'below', $order_field);\n\n //these groupings will always be used\n $result = array(\n $cluster_grouping, $user_grouping);\n\n //determine whether or not we should use the curriculum grouping\n $preferences = php_report_filtering_get_active_filter_values($this->get_report_shortname(),\n 'columns'.'_curriculum', $this->filter);\n\n $show_curriculum = true;\n if (isset($preferences['0']['value'])) {\n $show_curriculum = $preferences['0']['value'];\n }\n\n if ($show_curriculum) {\n $curriculum_label = get_string('grouping_curriculum', 'rlreport_course_completion_by_cluster');\n $result[] = new table_report_grouping('groupcurriculumid', 'curriculum.id', $curriculum_label, 'ASC', array(),\n 'below', 'curriculumname, curriculumid');\n }\n\n return $result;\n }",
"public function getGroupByPage() {}",
"function custom_posts_groupby( $groupby, $query ) {\n\n global $wpdb;\n\n if ( is_main_query() && is_search() ) {\n $groupby = \"{$wpdb->posts}.ID\";\n }\n\n return $groupby;\n\n}",
"abstract public function getGroupingField(): string;",
"function accessforall_custom_posts_groupby( $groupby, $query ) {\n\n global $wpdb;\n\n $groupby = \"{$wpdb->posts}.ID\";\n\n return $groupby;\n\n}",
"public function GroupBy($fields)\n {\n }",
"protected function makeFooter()\n {\n }",
"protected function pushGroup()\n {\n if( $this->group ) {\n $this->parts[] = 'GROUP BY';\n $this->parts[] = $this->quoteIdentifierIfNotExpression($this->group);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Destroy any session with the name 'session_token' | function destroySessionToken() {
unset( $_SESSION[ 'session_token' ] );
} | [
"public function destroy()\n {\n unset($_SESSION['token']);\n }",
"public function destroySessionToken()\n {\n unset($_SESSION['csrf']);\n }",
"public function destroy_session() {\n $this->session->unset_userdata('fb_access_token'); \n }",
"public function deleteSession(): void {\n\t\tunset($_SESSION[self::SESSION_NAME]);\n\t}",
"public function forgetToken()\n {\n session()->forget(self::SSO_SESSION);\n session()->save();\n }",
"public static function loginSessionDestroy(){\n Session::destroy('user_id');\n Session::destroy('user_name');\n Session::regenerate();\n }",
"protected function sessionDestroy()\n {\n session_unset();\n session_destroy();\n }",
"public function destroy()\n {\n $sid = Core::cookie()->get($this->session_name);\n if ($sid)\n {\n $this->driver()->delete($sid);\n }\n\n $_SESSION = array();\n\n Core::cookie()->delete($this->session_name, '/');\n }",
"private function clearSession() {\n\t\t$this->session->delete(\"fb_\".FB_APP_ID.\"_code\");\n\t\t$this->session->delete(\"fb_\".FB_APP_ID.\"_access_token\");\n\t\t$this->session->delete(\"fb_\".FB_APP_ID.\"_user_id\");\n\t\t$this->session->delete(\"ot\");\n\t\t$this->session->delete(\"ots\");\n\t\t$this->session->delete(\"oauth.linkedin\");\n\t\t$this->session->delete(\"fs_access_token\");\n\t\t$this->session->delete(\"G_token\");\n\t}",
"public function deleteSession()\n {\n $this->httpSession()->delete('webiny_website_analytics');\n }",
"public function removeSessionTokenFromRegistry() {}",
"public function destroySession() {\n\t\t$this->SID = null;\n\t\tsetcookie($this->sessid.\"_SID\",$this->SID);\n\t\t\n\t\t$this->content = array();\n\t\tunset($_SESSION);\n\t\tsession_destroy();\n\t}",
"public static function destroy()\n {\n session_unset();\n session_destroy();\n }",
"public static function destroy()\n {\n session_unset(); //destroys variables\n session_destroy(); //destroys session;\n }",
"private function _clear_session() {\n Session::instance()->delete(\"twitter_oauth_token\");\n Session::instance()->delete(\"twitter_oauth_token_secret\");\n Session::instance()->delete(\"twitter_access_token\");\n }",
"public function destroy( $token )\n\t{\n\t\t$result = new \\stdClass();\n\n\t\tif ( $this->_model->remove( $token ) )\n\t\t{\n\t\t\t$result->error \t= \"ERROR_REMOVING_SESSION\";\n\t\t\t$result->status = 403;\n\t\t}\n\n\t\treturn $this->_response( $result );\n\t}",
"public function delete(){\n session_destroy();\n }",
"public function destroySession(){\n if ($this->getStatus() == 2){\n session_destroy();\n }\n }",
"public static function destroy(){\n session_destroy();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates the request's contents against the relevant JSON Schema. | protected function validateAgainstSchema(): void
{
if ( ! $this->schemaValidation
|| ! $this->schemaValidationType
|| ! in_array($this->getMethod(), ['PATCH', 'POST', 'PUT'])
) {
return;
}
$validator = $this->getSchemaValidator();
if ( ! $validator->validateSchema(json_decode($this->getContent()), $this->schemaValidationType)) {
throw (new JsonApiValidationException('JSON-API Schema validation error'))
->setErrors($validator->getErrors()->toArray());
}
} | [
"protected function validateRequest()\n {\n return request()->validate([\n 'id' => 'string|required',\n 'storageId' => 'nullable',\n 'title' => 'string|required',\n 'description' => 'nullable',\n 'content' => 'nullable|array',\n ]);\n }",
"public function validateJson(string $data, string $schema): void;",
"protected function validateRequest()\n {\n return request()->validate([\n 'uuid' => 'sometimes|nullable',\n 'route_hash' => 'required|string',\n 'title' => 'required|string',\n 'description' => 'nullable',\n 'content' => 'required|array',\n ]);\n }",
"public function validateBody();",
"function validate_input($request)\n\t{\n\t\t$request = json_decode($request);\n\n\t\t// Request must be successfully decoded.\n\t\tif ($request === NULL)\n\t\t\treturn NULL;\n\t\t// Request must contain certain entities.\n\t\tif (!(array_key_exists(\"format\", $request)\n\t\t\t&& array_key_exists(\"version\", $request)\n\t\t\t&& array_key_exists(\"build\", $request)\n\t\t\t&& array_key_exists(\"files\", $request)\n\t\t\t&& is_object($request->build)\n\t\t\t&& array_key_exists(\"libraries\", $request)\n\t\t\t&& array_key_exists(\"mcu\", $request->build)\n\t\t\t&& array_key_exists(\"f_cpu\", $request->build)\n\t\t\t&& array_key_exists(\"core\", $request->build)\n\t\t\t&& array_key_exists(\"variant\", $request->build)\n\t\t\t&& is_array($request->files))\n\t\t)\n\t\t\treturn NULL;\n\n\t\t// Leonardo-specific flags.\n\t\tif ($request->build->variant == \"leonardo\")\n\t\t\tif (!(array_key_exists(\"vid\", $request->build)\n\t\t\t\t&& array_key_exists(\"pid\", $request->build))\n\t\t\t)\n\t\t\t\treturn NULL;\n\n\t\t// Values used as command-line arguments may not contain any special\n\t\t// characters. This is a serious security risk.\n\t\tforeach (array(\"version\", \"mcu\", \"f_cpu\", \"core\", \"variant\", \"vid\", \"pid\") as $i)\n\t\t\tif (isset($request->build->$i) && escapeshellcmd($request->build->$i) != $request->build->$i)\n\t\t\t\treturn NULL;\n\n\t\t// Request is valid.\n\t\treturn $request;\n\t}",
"public function validateSchema()\n {\n $meta_schema_validator = new SchemaValidator();\n $json_loader = new JsonLoader();\n\n // we have to check if we use a prefix\n $meta_json = file_get_contents(__DIR__.'/../../../data/MetaSchema.json');\n $meta_json = str_replace('#', $this->prefix, $meta_json);\n\n // we validate the schema using the meta schema, defining the structure of our schema\n $meta_schema_validator->validate($json_loader->load($meta_json), $this->schema);\n\n return true;\n }",
"public function checkData()\n {\n if (!$this->page->request->isPost()) {\n header('HTTP/1.1 400 Not post request');\n exit;\n }\n\n $post = $this->page->request->post;\n if (empty($post->data)) {\n if (!($data = file_get_contents('php://input'))) {\n header('HTTP/1.1 400 Bad data');\n exit;\n }\n } else {\n $data = $post->data;\n }\n\n if (!($json = json_decode($data, true))) {\n header('HTTP/1.1 400 Bad data');\n exit;\n }\n\n if (isset($json['nameValuePairs'])) {\n $json = $json['nameValuePairs'];\n }\n\n $this->json = $json;\n }",
"private function validateRequestForCreateOrUpdate()\n {\n return request()->validate([\n 'name' => 'required|string|max:180',\n 'description' => 'required|string|max:180',\n 'image_url' => 'required|string|max:180',\n ]);\n }",
"public function validate()\n {\n return new Validator($this->requestBody, $this->schema());\n }",
"private function checkFormat($request) {\n\t\t if($request->header('Content-Type')!=='application/json') {\n\t\t\treturn false;\n\t\t}\n\t\t$validator = Validator::make($request->all(), [\n 'amount' => 'required|numeric|min:0'\n ]);\n return (!$validator->fails());\n\t}",
"public function validateConfig()\n\t{\n\t\t$schemaContent = @file_get_contents(Config::$schemaFile);\n\t\tif($schemaContent === FALSE) {\n\t\t\t$this->errors['File not found'][] = [\n\t\t\t\t'property' => Config::$schemaFile,\n\t\t\t\t'message' => 'Schema file not found.'\n\t\t\t];\n\t\t\treturn;\n\t\t}\n\n\t\t$schema = Json::decode($schemaContent);\n\n\t\t$this->schemaValidator->check($this->config, $schema);\n\n\t\tif (!$this->schemaValidator->isValid()) {\n\t\t\t$this->errors['schema'] = $this->schemaValidator->getErrors();\n\t\t}\n\t}",
"abstract protected function validateRequest($Request);",
"private function checkJSONValidity($object) {\r\n \r\n /*\r\n * Input $object should be JSON\r\n */\r\n if (!isset($object) || !is_array($object)) {\r\n RestoLogUtil::httpError(500, 'Invalid input JSON');\r\n }\r\n \r\n /*\r\n * Check that input file is for the current collection\r\n */\r\n if (!isset($object['name']) ||$this->name !== $object['name']) {\r\n RestoLogUtil::httpError(500, 'Property \"name\" and collection name differ');\r\n }\r\n \r\n /*\r\n * Model name must be set in JSON file\r\n */\r\n if (!isset($object['model'])) {\r\n RestoLogUtil::httpError(500, 'Property \"model\" is mandatory');\r\n }\r\n \r\n /*\r\n * At least an english OpenSearch Description object is mandatory\r\n */\r\n if (!isset($object['osDescription']) || !is_array($object['osDescription']) || !isset($object['osDescription']['en']) || !is_array($object['osDescription']['en'])) {\r\n RestoLogUtil::httpError(500, 'English OpenSearch description is mandatory');\r\n }\r\n \r\n }",
"public function hasBodySchema(): bool;",
"function json_validate($data, $schema, &$errors = NULL) {\r\n\t$result = FALSE;\r\n\ttry {\r\n\t\t$jsonSchema = new \\OMV\\Json\\Schema($schema);\r\n\t\t$jsonSchema->validate($data);\r\n\t\t$result = TRUE;\r\n\t} catch(\\Exception $e) {\r\n\t\t$errors = array($e->getMessage());\r\n\t}\r\n\treturn $result;\r\n}",
"private function validateBatchJson($request)\n {\n $check = array_filter($request, 'is_string');\n\n if (!empty($check)) {\n throw new JsonRpcInvalidJsonException();\n }\n }",
"public function validateStaticTablesData($request)\n {\n $pattern1 = \"/^([a-zA-Z_])+$/\";\n $pattern2 = \"/^([0-9 :-])+$/\";\n $param = json_decode($request->getParameter(\"json\"),true);\n if($param && is_array($param))\n {\n foreach($param as $k=>$v)\n {\n if(!preg_match($pattern1,$k) || !$v || !preg_match($pattern2,$v))\n {\n $errorString = \"register/lib/RegisterModuleInputValidate.class.php(1) :Reason($k->$v)\";\n ValidationHandler::getValidationHandler(\"\",$errorString);\n $resp = ResponseHandlerConfig::$POST_PARAM_INVALID;\n break;\n }\n }\n }\n else\n {\n\t\t\t$errorString = \"register/lib/RegisterModuleInputValidate.class.php(2): Reason(no json params)\";\n\t\t\tValidationHandler::getValidationHandler(\"\",$errorString);\n $resp = ResponseHandlerConfig::$POST_PARAM_INVALID;\n }\n if(!$resp)\n $this->response = ResponseHandlerConfig::$SUCCESS;\n else\n $this->response = $resp;\n }",
"protected function validateDefinitions($schema, $json, $context)\n {\n }",
"public function validateIncoming(\\CFX\\JsonApi\\ResourceInterface $r);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns count of 'stCdkRecords' list | public function getStCdkRecordsCount()
{
return $this->count(self::STCDKRECORDS);
} | [
"public function getStRecordsCount()\n {\n return $this->count(self::STRECORDS);\n }",
"public function recordsCount();",
"public function getRecordCount();",
"public function getNumberOfRecords() {}",
"function RecordCount() {}",
"public function client_record_count() {\n\t\treturn $this->db->count_all(\"ss_client\");\n\t}",
"function record_count() {\r\n\t\t$this->db->from('incoming_materials');\r\n\t\t$this->db->where('is_deleted <>', '1');\r\n\t\t\r\n return $this->db->count_all_results();\r\n }",
"public function getSourceRecordsCount(array $data, DataContainer $dc): int;",
"function ListRecordCount() {\n\t\t$filter = $this->getSessionWhere();\n\t\tew_AddFilter($filter, $this->CurrentFilter);\n\t\t$filter = $this->ApplyUserIDFilters($filter);\n\t\t$this->Recordset_Selecting($filter);\n\t\t$select = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlSelect() : \"SELECT * FROM \" . $this->getSqlFrom();\n\t\t$groupBy = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlGroupBy() : \"\";\n\t\t$having = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlHaving() : \"\";\n\t\t$sql = ew_BuildSelectSql($select, $this->getSqlWhere(), $groupBy, $having, \"\", $filter, \"\");\n\t\t$cnt = $this->TryGetRecordCount($sql);\n\t\tif ($cnt == -1) {\n\t\t\t$conn = &$this->Connection();\n\t\t\tif ($rs = $conn->Execute($sql)) {\n\t\t\t\t$cnt = $rs->RecordCount();\n\t\t\t\t$rs->Close();\n\t\t\t}\n\t\t}\n\t\treturn intval($cnt);\n\t}",
"public static function getCountOfRecords($table);",
"public function getRecordCount() {\n \n $connection = &$this->connection;\n if (empty($connection))\n return 0;\n\n // return Connection::getRecordCount($this->recordset);\n return $connection->getRecordCount($this->recordset);\n }",
"private function totalRecords() {\n return count($this->report);\n }",
"public function getRecordsCount()\n {\n $value = $this->get(self::records_count);\n return $value === null ? (integer)$value : $value;\n }",
"function record_count()\n {\n return $this->db->count_all(\"tbl_car_type\");\n }",
"public function record_count() {\n return $this->db->count_all(\"product\");\n }",
"public function listRecordCount()\n\t{\n\t\t$filter = $this->getSessionWhere();\n\t\tAddFilter($filter, $this->CurrentFilter);\n\t\t$filter = $this->applyUserIDFilters($filter);\n\t\t$this->Recordset_Selecting($filter);\n\t\t$select = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlSelect() : \"SELECT * FROM \" . $this->getSqlFrom();\n\t\t$groupBy = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlGroupBy() : \"\";\n\t\t$having = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlHaving() : \"\";\n\t\t$sql = BuildSelectSql($select, $this->getSqlWhere(), $groupBy, $having, \"\", $filter, \"\");\n\t\t$cnt = $this->getRecordCount($sql);\n\t\treturn $cnt;\n\t}",
"public function getCurrentNumberOfRecords()\n {\n return count($this->data);\n }",
"public function getTotalRecords(){\n return $this->_raw->total_records;\n }",
"public function getTotalRecords()\n {\n return $this->totalRecords;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Strips HTML and shortens content to given length. | public function shortContent($length = 100)
{
return substr(strip_tags($this->content), 0, $length) . '...';
} | [
"static function truncate($text, $length = 200)\n {\n $ending = '...';\n if(mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length)\n {\n return $text;\n }\n $totalLength = mb_strlen(strip_tags($ending));\n $openTags = array();\n $truncate = '';\n\n preg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n foreach($tags as $tag)\n {\n if(!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2]))\n {\n if(preg_match('/<[\\w]+[^>]*>/s', $tag[0]))\n {\n array_unshift($openTags, $tag[2]);\n }\n else if (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag))\n {\n $pos = array_search($closeTag[1], $openTags);\n if($pos !== false)\n {\n array_splice($openTags, $pos, 1);\n }\n }\n }\n $truncate .= $tag[1];\n\n $contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n if($contentLength + $totalLength > $length)\n {\n $left = $length - $totalLength;\n $entitiesLength = 0;\n if(preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE))\n {\n foreach($entities[0] as $entity)\n {\n if($entity[1] + 1 - $entitiesLength <= $left)\n {\n $left--;\n $entitiesLength += mb_strlen($entity[0]);\n }\n else\n {\n break;\n }\n }\n }\n\n $truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n break;\n }\n else\n {\n $truncate .= $tag[3];\n $totalLength += $contentLength;\n }\n if($totalLength >= $length)\n {\n break;\n }\n }\n\n $truncate .= $ending;\n\n foreach($openTags as $tag)\n {\n $truncate .= '</'.$tag.'>';\n }\n return $truncate;\n }",
"function lib_shorten_html($string, $length){\n $temp = unhtmlentities($string);\n if (strlen($temp) > $length)\n return htmlentities(substr($temp, 0, $length)) . \"..\";\n return $string;\n}",
"function publisher_truncateTagSafe($string, $length = 80, $etc = '...', $break_words = false)\r\n{\r\n if ($length == 0) return '';\r\n\r\n if (strlen($string) > $length) {\r\n $length -= strlen($etc);\r\n if (!$break_words) {\r\n $string = preg_replace('/\\s+?(\\S+)?$/', '', substr($string, 0, $length + 1));\r\n $string = preg_replace('/<[^>]*$/', '', $string);\r\n $string = publisher_closeTags($string);\r\n }\r\n return $string . $etc;\r\n } else {\r\n return $string;\r\n }\r\n}",
"function truncate($text, $length = 100, $options = []) {\n $default = ['ellipsis' => '...', 'exact' => true, 'html' => false];\n\n $options += $default;\n\n $prefix = '';\n $suffix = $options['ellipsis'];\n\n if($options['html']) {\n $ellipsisLength = mb_strlen(strip_tags($options['ellipsis']));\n\n $truncateLength = 0;\n $totalLength = 0;\n $openTags = [];\n $truncate = '';\n\n preg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n foreach($tags as $tag) {\n $contentLength = 0;\n $defaultHtmlNoCount = ['style', 'script'];\n if (!in_array($tag[2], $defaultHtmlNoCount, true)) {\n $contentLength = mb_strlen($tag[3]);\n }\n\n if($truncate === '') {\n if(!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/i', $tag[2])) {\n if(preg_match('/<[\\w]+[^>]*>/', $tag[0])) {\n array_unshift($openTags, $tag[2]);\n } elseif(preg_match('/<\\/([\\w]+)[^>]*>/', $tag[0], $closeTag)) {\n $pos = array_search($closeTag[1], $openTags);\n if($pos !== false) {\n array_splice($openTags, $pos, 1);\n }\n }\n }\n\n $prefix .= $tag[1];\n\n if($totalLength + $contentLength + $ellipsisLength > $length) {\n $truncate = $tag[3];\n $truncateLength = $length - $totalLength;\n } else {\n $prefix .= $tag[3];\n }\n }\n\n $totalLength += $contentLength;\n if($totalLength > $length) {\n break;\n }\n }\n\n if($totalLength <= $length) {\n return $text;\n }\n\n $text = $truncate;\n $length = $truncateLength;\n\n foreach($openTags as $tag) {\n $suffix .= '</'.$tag.'>';\n }\n } else {\n if(mb_strlen($text) <= $length) {\n return $text;\n }\n $ellipsisLength = mb_strlen($options['ellipsis']);\n }\n\n $result = mb_substr($text, 0, $length - $ellipsisLength);\n\n if(!$options['exact']) {\n if(mb_substr($text, $length - $ellipsisLength, 1) !== ' ') {\n $result = removeLastWord($result);\n }\n\n // If result is empty, then we don't need to count ellipsis in the cut.\n if(!strlen($result)) {\n $result = mb_substr($text, 0, $length);\n }\n }\n\n return $prefix.$result.$suffix;\n}",
"function ts_truncate_trim($input, $length)\n{\n $allow_html = (ts_option_vs_default('allow_html_excerpts', 0) == 1) ? true : false;\n\n $output = ($allow_html) ? ts_truncate($input, $length, '…', true) : ts_trim_text($input, $length);\n\n return $output;\n}",
"function excerpt($string,$length)\n{\n \n $str_len = strlen($string); // misura la lunghezza della stringa (cercate strlen nel manuale di php.net)\n $string = strip_tags($string); // rimuove i tag html che trova, \n //per evitare che la troncatura spezzi a metà un tag (cercate strip_tags su php.net)\n\n if ($str_len > $length) {\n\n // substr preleva una parte della string $string, da 0 al numero inserito come $lenght -15\n $stringCut = substr($string, 0, $length-15);\n $string = $stringCut.'...'; // concateniamo i tre puntini (in inglese si chiamano ellipses) alla fine della stringa tagliata\n }\n return $string;\n}",
"function truncate_html_str ($s, $MAX_LENGTH, &$trunc_str_len) {\n\n\t$trunc_str_len=0;\n\n\tif (func_num_args()>3) {\n\t\t$add_ellipsis = func_get_arg(3);\n\n\t} else {\n\t\t$add_ellipsis = true;\n\t}\n\n\tif (func_num_args()>4) {\n\t\t$with_tags = func_get_arg(4);\n\n\t} else {\n\t\t$with_tags = false;\n\t}\n\n\tif ($with_tags){\n\t\t$tag_expr = \"|<[^>]+>\";\n\n\t}\n\n\t$offset = 0; $character_count=0;\n\t# match a character, or characters encoded as html entity\n\t# treat each match as a single character\n\t#\n\twhile ((preg_match ('/(&#?[0-9A-z]+;'.$tag_expr.'|.|\\n)/', $s, $maches, PREG_OFFSET_CAPTURE, $offset) && ($character_count < $MAX_LENGTH))) {\n\t\t$offset += strlen($maches[0][0]);\n\t\t$character_count++;\n\t\t$str .= $maches[0][0];\n\t\t\n\t\n\t}\n\tif (($character_count == $MAX_LENGTH)&&($add_ellipsis)) {\n\t\t$str = $str.\"...\";\n\t}\n\t$trunc_str_len = $character_count;\n\treturn $str;\n\n \n}",
"function trim_content($text, $max_length){\n if ( strlen($text) > $max_length ) {\n //$text = apply_filters('the_content', $text);\n //$text = strip_shortcodes($text);\n $text = preg_replace('/\\[download(.*?)\\]/s','',$text );\n $text = strip_tags($text);\n $excerpt_length = $max_length;\n if (strlen($text) > $max_length){\n $text = substr($text, 0, $max_length);\n $pos = strrpos($text, \" \");\n if($pos === false) { \n return force_balance_tags( substr($text, 0, $max_length).'...');\n } \n return force_balance_tags( substr($text, 0, $pos).'...');\n }\n }\n force_balance_tags( $text );\n return $text; \n}",
"function ts_truncate($s, $l, $e = '…', $allow_html = false, $allowed_tags = 'simple', $allow_shortcodes = true)\n{\n // account for WordPress shortcodes...\n $s = ($allow_shortcodes && function_exists('do_shortcode')) ? do_shortcode($s) : $s;\n // shortcut to only output a few inline tags\n $allowed_tags = ($allowed_tags == 'simple') ? '<strong><b><i><br><em><a><u><strike><del><acronym><abbr><sup><sub>' : $allowed_tags;\n // allow html? if so, anything specific?\n $s = ($allow_html) ? (($allowed_tags) ? strip_tags($s, $allowed_tags) : $s) : strip_tags($s);\n // remove line breaks, and merge multiple spaces into one (so that we don't count them)...\n $s = trim(preg_replace('/\\s{2,}/', ' ', preg_replace('/\\r?\\n|\\r/', ' ', $s)));\n $e = (mb_strlen(strip_tags($s)) > $l) ? $e : '';\n $i = 0;\n $tags = array();\n\n // account for html/utf8 entities\n $temp_s = strip_tags($s);\n preg_match_all(\"/&#?[a-zA-Z0-9]{1,7};|[\\x80-\\xFF][\\x80-\\xBF]*/\", $temp_s, $entities, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);\n if(is_array($entities) && count($entities))\n {\n foreach($entities AS $entity)\n {\n if($entity[0][1] - $i >= $l)\n {\n break;\n }\n $i = $i + mb_strlen($entity[0][0]) - 1;\n }\n }\n\n if($allow_html)\n {\n preg_match_all('/<[^>]+>([^<]*)/', $s, $m, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);\n foreach($m as $o)\n {\n if($o[0][1] - $i >= $l)\n {\n break;\n }\n $t = mb_substr(strtok($o[0][0], \" \\t\\n\\r\\0\\x0B>\"), 1);\n // don't add the following to tags that will need to be closed:\n // already closed tags, self-closing tags (with ending slash), comment tags\n if($t[0] != '/' && mb_substr($t, -1) != '/' && mb_substr($t, 0, 3) != '!--')\n {\n // and then for self-closing tags *without* ending slashes...\n $self_closing = array('area','base','br','col','embed','hr','img','input','keygen','link','menuitem','meta','param','source','track','wbr');\n if(!in_array($t, $self_closing))\n $tags[] = $t;\n }\n elseif(end($tags) == mb_substr($t, 1))\n {\n array_pop($tags);\n }\n $i += $o[1][1] - $o[0][1];\n }\n }\n\n $output = trim(mb_substr($s, 0, $l = min(mb_strlen($s), $l + $i))) . (count($tags = array_reverse($tags)) ? $e . '</' . implode('></', $tags) . '>' : $e);\n\n //uncomment next line to debug\n //$output .= \"\\n\". (isset($m) ? '<pre>'.print_r($m, true).'</pre><br/>'.\"\\n\" : '').'HTML/Entity characters: '.$i.\"<br/>\\n\".'Total characters kept: '.$l;\n\n return $output;\n}",
"function get_short_content($contents, $length){\n $short = \"\";\n $contents = strip_tags($contents);\n if (strlen(removeBBCode($contents)) >= $length) {\n $text = explode(\" \", substr(removeBBCode($contents), 0, $length));\n for ($i = 0; $i < count($text) - 1; $i++) {\n if($i == count($text) - 2){\n $short .= $text[$i];\n }else{\n $short .= $text[$i] . \" \";\n }\n }\n $short .= \"...\";\n } else {\n $short = removeBBCode($contents) . \"...\";\n }\n return $short;\n}",
"function Texttruncate($text, $length = 100, $options = array()) {\n\t\t$default = array(\n\t\t\t'ending' => '...', 'exact' => true, 'html' => false\n\t\t);\n\t\t$options = array_merge($default, $options);\n\t\textract($options);\n\t\tif (!function_exists('mb_strlen')) {\n\t\t\tclass_exists('Multibyte');\n\t\t}\n\t\tif ($html) {\n\t\t\tif (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n\t\t\t\treturn $text;\n\t\t\t}\n\t\t\t$totalLength = mb_strlen(strip_tags($ending));\n\t\t\t$openTags = array();\n\t\t\t$truncate = '';\n\t\t\tpreg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n\t\t\tforeach ($tags as $tag) {\n\t\t\t\tif (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {\n\t\t\t\t\tif (preg_match('/<[\\w]+[^>]*>/s', $tag[0])) {\n\t\t\t\t\t\tarray_unshift($openTags, $tag[2]);\n\t\t\t\t\t} elseif (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag)) {\n\t\t\t\t\t\t$pos = array_search($closeTag[1], $openTags);\n\t\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\t\tarray_splice($openTags, $pos, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$truncate .= $tag[1];\n\t\t\t\t$contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n\t\t\t\tif ($contentLength + $totalLength > $length) {\n\t\t\t\t\t$left = $length - $totalLength;\n\t\t\t\t\t$entitiesLength = 0;\n\t\t\t\t\tif (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {\n\t\t\t\t\t\tforeach ($entities[0] as $entity) {\n\t\t\t\t\t\t\tif ($entity[1] + 1 - $entitiesLength <= $left) {\n\t\t\t\t\t\t\t\t$left--;\n\t\t\t\t\t\t\t\t$entitiesLength += mb_strlen($entity[0]);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t$truncate .= $tag[3];\n\t\t\t\t\t$totalLength += $contentLength;\n\t\t\t\t}\n\t\t\t\tif ($totalLength >= $length) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (mb_strlen($text) <= $length) {\n\t\t\t\treturn $text;\n\t\t\t} else {\n\t\t\t\t$truncate = mb_substr($text, 0, $length - mb_strlen($ending));\n\t\t\t}\n\t\t}\n\t\tif (!$exact) {\n\t\t\t$spacepos = mb_strrpos($truncate, ' ');\n\t\t\tif ($html) {\n\t\t\t\t$truncateCheck = mb_substr($truncate, 0, $spacepos);\n\t\t\t\t$lastOpenTag = mb_strrpos($truncateCheck, '<');\n\t\t\t\t$lastCloseTag = mb_strrpos($truncateCheck, '>');\n\t\t\t\tif ($lastOpenTag > $lastCloseTag) {\n\t\t\t\t\tpreg_match_all('/<[\\w]+[^>]*>/s', $truncate, $lastTagMatches);\n\t\t\t\t\t$lastTag = array_pop($lastTagMatches[0]);\n\t\t\t\t\t$spacepos = mb_strrpos($truncate, $lastTag) + mb_strlen($lastTag);\n\t\t\t\t}\n\t\t\t\t$bits = mb_substr($truncate, $spacepos);\n\t\t\t\tpreg_match_all('/<\\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);\n\t\t\t\tif (!empty($droppedTags)) {\n\t\t\t\t\tif (!empty($openTags)) {\n\t\t\t\t\t\tforeach ($droppedTags as $closingTag) {\n\t\t\t\t\t\t\tif (!in_array($closingTag[1], $openTags)) {\n\t\t\t\t\t\t\t\tarray_unshift($openTags, $closingTag[1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach ($droppedTags as $closingTag) {\n\t\t\t\t\t\t\tarray_push($openTags, $closingTag[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$truncate = mb_substr($truncate, 0, $spacepos);\n\t\t}\n\t\t$truncate .= $ending;\n\t\tif ($html) {\n\t\t\tforeach ($openTags as $tag) {\n\t\t\t\t$truncate .= '</' . $tag . '>';\n\t\t\t}\n\t\t}\n\t\treturn $truncate;\n\t}",
"function truncate_string_excluding_html($str, $len = 150) {\r\n $wordlen = 0; // Total text length.\r\n $resultlen = 0; // Total length of html and text.\r\n $len_exceeded = false;\r\n $cnt = 0;\r\n $splitstr = array (); // String split by html tags including delimiter.\r\n $open_tags = array(); // Assoc. Array for Simple html Tags\r\n $str = str_replace(array(\"\\n\",\"\\r\",\"\\t\"), array (\" \",\" \",\" \"), $str); // Replace returns/tabs with spaces\r\n $splitstr = preg_split('/(<[^>]*>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE );\r\n //var_dump($splitstr);\r\n if (count($splitstr) > 0 && strlen($str) > $len) { // split\r\n while ($wordlen <= $len && $cnt <= 200 &&!$len_exceeded) {\r\n $part = $splitstr[$cnt];\r\n if (preg_match('/^<[A-Za-z]{1,}/', $part)) {\r\n $open_tags[strtolower(substr($match[0],1))]++;\r\n } else if (preg_match('/^<\\/[A-Za-z]{1,}/', $part)) {\r\n $open_tags[strtolower(substr($match[0],2))]--;\r\n } else if (strlen($part) > $len-$wordlen) { // truncate remaining length\r\n $tmpsplit = explode(\"\\n\", wordwrap($part, $len-$wordlen));\r\n $part = $tmpsplit[0]; // Define the truncated part.\r\n $len_exceeded = true;\r\n $wordlen += strlen($part);\r\n } else {\r\n $wordlen += strlen($part);\r\n }\r\n $result .= $part; // Add the part to the $result\r\n $resultlen = strlen($result);\r\n $cnt++;\r\n }\r\n //echo \"wordlen: $wordlen, resultlen: $resultlen<br />\";\r\n //var_dump($open_tags);\r\n // Close the open html Tags (Simple Tags Only!). This excludes IMG and LI tags.\r\n foreach ($open_tags as $key=>$value) {\r\n if ($value > 0 && $key!= \"\" && $key!= null && $key!= \"img\" && $key!= \"li\") {\r\n for ($i=0; $i<$value; $i++) { $result .= \"</\".$key.\">\"; }\r\n }\r\n }\r\n } else {\r\n $result = $str;\r\n }\r\n return $result;\r\n}",
"function truncate_post_body($text, $count)\n{\n $dom = new simple_html_dom;\n $dom->load($text, true);\n $nodes = $dom->childNodes();\n $countNodes = count($dom->childNodes());\n if ($countNodes > 0) {\n $str = '';\n for($i=0;$i<=$count-1;$i++) {\n if (isset($nodes[$i])) {\n $str .= $nodes[$i]->outertext();\n } \n }\n return $str;\n } else {\n return $text;\n }\n}",
"public function getSlimContent($length = 30)\r\n {\r\n $cont = $this->content;\r\n if (mb_strlen($cont) > $length) {\r\n $cont = substr($cont, 0, $length) . '...';\r\n }\r\n if (is_null($cont) || $cont === '')\r\n $cont = 'empty';\r\n return $cont;\r\n }",
"public function cut($content, $length)\n\t{\n\t\tif (mb_strlen($content) > $length)\n\t\t{\n\t\t\t$content = mb_substr($content, 0, $length - 4);\n\t\t\t$content = \"{$content} ...\";\n\t\t}\n\t\t\n\t\treturn $content;\n\t}",
"function acf_get_truncated($text, $length = 64) {}",
"function custom_trim_excerpt($text, $length) {\n\n\t$text = strip_shortcodes( $text ); // optional\n\t$text = strip_tags($text);\n\n\t$words = explode(' ', $text, $length + 1);\n\tif ( count($words) > $length) {\n\t\tarray_pop($words);\n\t\t$text = implode(' ', $words);\n\t\t$hellip = ' <span class=\"hellip\">[…]</span>';\n\t} else {\n\t\t$hellip = '';\n\t}\n\treturn ($text != '') ? $text.$hellip : '';\n}",
"function mbt_filter_excerpt_length($length) {\n return 20;\n}",
"function iwf_truncate( $text, $length = 200, $ellipsis = '...' ) {\n\t$text = strip_tags( strip_shortcodes( iwf_convert_eol( $text, \"\" ) ) );\n\n\tif ( mb_strlen( $text ) > $length ) {\n\t\t$text = mb_substr( $text, 0, $length ) . $ellipsis;\n\t}\n\n\treturn $text;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if the response is a redirect (3XX) | public function isRedirect() {
$ret_code = floor($this->info['http_code'] / 100);
return ($ret_code == 3);
} | [
"public function isRedirect() {\n return substr($this->responseCode, 0, 1) == '3';\n }",
"public function isRedirect(): bool\n {\n return in_array($this->response->getStatusCode(), [301, 302, 303, 307, 308]);\n }",
"public function isRedirect()\n\t{\n\t\treturn ($this->headers->has('Location') && ($this->statusCode >= 300 && $this->statusCode < 400));\n\t}",
"protected function isRedirect() {\r\n\t\treturn $this->response_type === self::RESPONSE_REDIR;\r\n\t}",
"public function hasRedirectHTTPStatus() { return ($this->status == 301 || $this->status == 302 || $this->status == 303); }",
"public function isRedirect(): bool;",
"public function isRedirection()\n {\n return $this->statusCode >= 300 && $this->statusCode < 400;\n }",
"public function isRedirect();",
"public function isRedirected( )\n {\n return $this->hasHttpHeader('location');\n }",
"public function mustRedirect();",
"public function hasRedirect()\n {\n return false;\n }",
"public function shouldRedirect(): bool;",
"public function isTemporaryRedirect(): bool;",
"public function redirected() {\r\n return (!empty($this->_redirectLocation));\r\n }",
"public function testIsRedirectIfStatusCodeIs302()\n {\n $data = array(\n 'status' => 302\n );\n\n $response = $this->getResponse();\n $response->import($data);\n\n $this->assertTrue($response->isRedirect());\n }",
"public function checkForRedirect() {\n $url = $this->formit->postHooks->getRedirectUrl();\n if (!empty($url) && !$this->formit->inTestMode) {\n $this->modx->sendRedirect($url);\n }\n }",
"public function isRedirect() {\n return $this->redirect;\n }",
"public function hasRedirect()\n {\n return !empty($this->redirectUrl);\n }",
"public function isSuccessfulAndRedirect()\n {\n $this->isSuccessful(true);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the array with all available scanners. | public function getScanners()
{
return $this->scanners;
} | [
"public function listScans() {\n return array(\n 'info',\n 'content',\n 'loc',\n 'sniff',\n 'hacked',\n );\n }",
"public static function all(): array\n {\n return AppConfig::get('scorch');\n }",
"public function getScans() {\n\n return $this->retry(function() {\n return $this->get('https://screenlab.io/api/scans');\n });\n\n }",
"protected function _scan_providers () {\r\n\t\treturn $this->_scan_klasses('providers');\r\n\t}",
"public function scan()\n {\n // If no interface is provided we will scan all.\n $command = $this->interface ? sprintf(\n 'arp-scan --interface=%s -l',\n $this->interface\n ) : 'arp-scan -l';\n\n $arp_scan = shell_exec(\n $command\n\n );\n $arp_scan = explode(\"\\n\", $arp_scan);\n\n $matches = $records = [];\n foreach ($arp_scan as $scan) {\n $matches = [];\n\n // Matching the arp-scan output\n if (preg_match(\n '/^([0-9\\.]+)[[:space:]]+([0-9a-f:]+)[[:space:]]+(.+)$/',\n $scan,\n $matches\n ) !== 1\n ) {\n continue;\n }\n\n $record = new ScanRecord();\n $record->ip = $matches[1];\n $record->mac = $matches[2];\n $record->description = $matches[3];\n\n $records[] = $record;\n }\n\n return $records;\n }",
"public function getBanners()\n {\n return $this->banners;\n }",
"protected function _listAvailableShells() {\n\t\t$shellList = $this->Command->getShellList();\n\t\t$plugins = Plugin::loaded();\n\t\t$shells = [];\n\t\tforeach ($shellList as $plugin => $commands) {\n\t\t\tforeach ($commands as $command) {\n\t\t\t\t$callable = $command;\n\t\t\t\tif (in_array($plugin, $plugins)) {\n\t\t\t\t\t$callable = Inflector::camelize($plugin) . '.' . $command;\n\t\t\t\t}\n\n\t\t\t\t$shells[] = [\n\t\t\t\t\t'name' => $command,\n\t\t\t\t\t'call_as' => $callable,\n\t\t\t\t\t'provider' => $plugin,\n\t\t\t\t\t'help' => $callable . ' -h'\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn $shells;\n\t}",
"public static function listRegistry(): array {}",
"public function getAvailablePlugins();",
"public function scanPlugins () {\r\n\t$this->ensureLoggedIn();\r\n\r\n\treturn $this->request(array('req' => 'scanplugins'));\r\n\t}",
"public static function getAvailableDrivers()\n {\n return array_keys(self::$_driverMap);\n }",
"protected function allInstruments()\n\t{\n\t\t$all = [];\n\n\t\tarray_walk_recursive(static::$instruments, function ($group) use (&$all) {\n\t\t\t$all[] = $group;\n\t\t});\n\n\t\treturn $all;\n\t}",
"public function getBanners()\n {\n return $this->post_model->getHomePageBanners();\n }",
"private function _getPrinters()\n {\n $connector = Mage::helper('scgooglecloudprint/connector');\n $printers = $connector->search();\n return (!empty($printers)) ? $printers : array();\n }",
"public function get_all_registered() {\n\t\treturn array_values( $this->registered_patterns );\n\t}",
"public function malware_get_scan_results() {\n\n /** @global string $mainwp_itsec_modules_path MainWP itsec modules path. */\n\t\tglobal $mainwp_itsec_modules_path;\n\n\t\tif ( ! class_exists( '\\ITSEC_Malware_Scanner' ) ) {\n\t\t\trequire_once $mainwp_itsec_modules_path . 'malware/class-itsec-malware-scanner.php';\n\t\t\trequire_once $mainwp_itsec_modules_path . 'malware/class-itsec-malware-scan-results-template.php';\n\t\t}\n\t\t$response = array();\n\t\t$results = \\ITSEC_Malware_Scanner::scan();\n\t\t$response['html'] = \\ITSEC_Malware_Scan_Results_Template::get_html( $results, true );\n\t\treturn $response;\n\t}",
"public function getAllAvailableDevices ()\n {\n return DeviceMapper::getInstance()->fetchAll();\n }",
"public function getAll()\n {\n return $this->drivers;\n }",
"public function all()\n\t{\n\t\treturn $this->plugins;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find thumbnail image from HTML page at given URL | public function findThumbnail($url)
{
$ctx = stream_context_create(array (
'http' => array (
'user_agent' => $this->useragent,
),
));
$html = file_get_contents($url, false, $ctx);
return $this->findThumbnailFromHtml($html, $url);
} | [
"private function extract_thumbnail( $xml ) {\n\t\t// look for <itunes:image> and use this if available\n\t\t$thumbnail_node = xpath( $xml, './itunes:image[1]');\n\t\tif ( $thumbnail_node )\n\t\t\treturn (string) $thumbnail_node->attributes()->href;\n\t\t\n\t\t// otherwise look for the first available <img>\n\t\t$doc = new \\DOMDocument();\n\t\t$encoded_content = (string) xpath( $xml, './content:encoded');\n\t\t\n\t\tif ( ! $encoded_content )\n\t\t\treturn NULL;\n\t\t\n\t\t$success = $doc->loadHTML( $encoded_content );\n\t\t\n\t\tif ( ! $success )\n\t\t\treturn NULL;\n\t\t\n\t\t$xml2 = simplexml_import_dom( $doc );\n\t\t$images = $xml2->xpath('//img');\n\t\t\n\t\tforeach ( $images as $image )\n\t\t\tif ( $image[ 'height' ] > 1 && $image[ 'width' ] > 1 )\n\t\t\t\treturn (string) $image[ 'src' ];\n\t\t\n\t\treturn NULL;\n\t}",
"public function getThumbnail();",
"public function getThumbnail()\n {\n $cache = CacheManager::getCacheFilePath(\n $this->url,\n $this->finder->getDomain(),\n CacheManager::TYPE_FINDER,\n $this->options[WebThumbnailer::MAX_WIDTH],\n $this->options[WebThumbnailer::MAX_HEIGHT]\n );\n // Loading Finder result from cache if enabled and valid to prevent useless requests.\n if (\n empty($this->options[WebThumbnailer::NOCACHE])\n && CacheManager::isCacheValid($cache, $this->finder->getDomain(), CacheManager::TYPE_FINDER)\n ) {\n $thumbUrl = file_get_contents($cache);\n } else {\n $thumbUrl = $this->finder->find();\n $thumbUrl = $thumbUrl !== false ? html_entity_decode($thumbUrl) : $thumbUrl;\n file_put_contents($cache, $thumbUrl);\n }\n\n if (empty($thumbUrl)) {\n $error = 'No thumbnail could be found using ' . $this->finder->getName() . ' finder: ' . $this->url;\n throw new ThumbnailNotFoundException($error);\n }\n\n // Only hotlink, find() is enough.\n if ($this->options[static::DL_OPTION] === WebThumbnailer::HOTLINK_STRICT) {\n return $this->thumbnailStrictHotlink($thumbUrl);\n }\n // Hotlink if available, download otherwise.\n if ($this->options[static::DL_OPTION] === WebThumbnailer::HOTLINK) {\n return $this->thumbnailHotlink($thumbUrl);\n } else { // Download\n return $this->thumbnailDownload($thumbUrl);\n }\n }",
"function getPhotoThumbnail($_url) {\n\t\treturn str_replace(\"disp\", \"thumb\", $_url);\n\t}",
"function computeThumbnail($url,$href=false)\n{\n if (!$GLOBALS['config']['ENABLE_THUMBNAILS']) return array();\n if ($href==false) $href=$url;\n\n // For most hosts, the URL of the thumbnail can be easily deduced from the URL of the link.\n // (eg. http://www.youtube.com/watch?v=spVypYk4kto ---> http://img.youtube.com/vi/spVypYk4kto/default.jpg )\n // ^^^^^^^^^^^ ^^^^^^^^^^^\n $domain = parse_url($url,PHP_URL_HOST);\n if ($domain=='youtube.com' || $domain=='www.youtube.com')\n {\n parse_str(parse_url($url,PHP_URL_QUERY), $params); // Extract video ID and get thumbnail\n if (!empty($params['v'])) return array('src'=>'http://img.youtube.com/vi/'.$params['v'].'/default.jpg',\n 'href'=>$href,'width'=>'120','height'=>'90','alt'=>'YouTube thumbnail');\n }\n if ($domain=='youtu.be') // Youtube short links\n {\n $path = parse_url($url,PHP_URL_PATH);\n return array('src'=>'http://img.youtube.com/vi'.$path.'/default.jpg',\n 'href'=>$href,'width'=>'120','height'=>'90','alt'=>'YouTube thumbnail');\n }\n if ($domain=='pix.toile-libre.org') // pix.toile-libre.org image hosting\n {\n parse_str(parse_url($url,PHP_URL_QUERY), $params); // Extract image filename.\n if (!empty($params) && !empty($params['img'])) return array('src'=>'http://pix.toile-libre.org/upload/thumb/'.urlencode($params['img']),\n 'href'=>$href,'style'=>'max-width:120px; max-height:150px','alt'=>'pix.toile-libre.org thumbnail');\n }\n\n if ($domain=='imgur.com')\n {\n $path = parse_url($url,PHP_URL_PATH);\n if (startsWith($path,'/a/')) return array(); // Thumbnails for albums are not available.\n if (startsWith($path,'/r/')) return array('src'=>'http://i.imgur.com/'.basename($path).'s.jpg',\n 'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');\n if (startsWith($path,'/gallery/')) return array('src'=>'http://i.imgur.com'.substr($path,8).'s.jpg',\n 'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');\n\n if (substr_count($path,'/')==1) return array('src'=>'http://i.imgur.com/'.substr($path,1).'s.jpg',\n 'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');\n }\n if ($domain=='i.imgur.com')\n {\n $pi = pathinfo(parse_url($url,PHP_URL_PATH));\n if (!empty($pi['filename'])) return array('src'=>'http://i.imgur.com/'.$pi['filename'].'s.jpg',\n 'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');\n }\n if ($domain=='dailymotion.com' || $domain=='www.dailymotion.com')\n {\n if (strpos($url,'dailymotion.com/video/')!==false)\n {\n $thumburl=str_replace('dailymotion.com/video/','dailymotion.com/thumbnail/video/',$url);\n return array('src'=>$thumburl,\n 'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'DailyMotion thumbnail');\n }\n }\n if (endsWith($domain,'.imageshack.us'))\n {\n $ext=strtolower(pathinfo($url,PATHINFO_EXTENSION));\n if ($ext=='jpg' || $ext=='jpeg' || $ext=='png' || $ext=='gif')\n {\n $thumburl = substr($url,0,strlen($url)-strlen($ext)).'th.'.$ext;\n return array('src'=>$thumburl,\n 'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'imageshack.us thumbnail');\n }\n }\n\n // Some other hosts are SLOW AS HELL and usually require an extra HTTP request to get the thumbnail URL.\n // So we deport the thumbnail generation in order not to slow down page generation\n // (and we also cache the thumbnail)\n\n if (!$GLOBALS['config']['ENABLE_LOCALCACHE']) return array(); // If local cache is disabled, no thumbnails for services which require the use a local cache.\n\n if ($domain=='flickr.com' || endsWith($domain,'.flickr.com')\n || $domain=='vimeo.com'\n || $domain=='ted.com' || endsWith($domain,'.ted.com')\n || $domain=='xkcd.com' || endsWith($domain,'.xkcd.com')\n )\n {\n if ($domain=='vimeo.com')\n { // Make sure this vimeo url points to a video (/xxx... where xxx is numeric)\n $path = parse_url($url,PHP_URL_PATH);\n if (!preg_match('!/\\d+.+?!',$path)) return array(); // This is not a single video URL.\n }\n if ($domain=='xkcd.com' || endsWith($domain,'.xkcd.com'))\n { // Make sure this url points to a single comic (/xxx... where xxx is numeric)\n $path = parse_url($url,PHP_URL_PATH);\n if (!preg_match('!/\\d+.+?!',$path)) return array();\n }\n if ($domain=='ted.com' || endsWith($domain,'.ted.com'))\n { // Make sure this TED url points to a video (/talks/...)\n $path = parse_url($url,PHP_URL_PATH);\n if (\"/talks/\" !== substr($path,0,7)) return array(); // This is not a single video URL.\n }\n $sign = hash_hmac('sha256', $url, $GLOBALS['salt']); // We use the salt to sign data (it's random, secret, and specific to each installation)\n return array('src'=>indexUrl().'?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url),\n 'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'thumbnail');\n }\n\n // For all other, we try to make a thumbnail of links ending with .jpg/jpeg/png/gif\n // Technically speaking, we should download ALL links and check their Content-Type to see if they are images.\n // But using the extension will do.\n $ext=strtolower(pathinfo($url,PATHINFO_EXTENSION));\n if ($ext=='jpg' || $ext=='jpeg' || $ext=='png' || $ext=='gif')\n {\n $sign = hash_hmac('sha256', $url, $GLOBALS['salt']); // We use the salt to sign data (it's random, secret, and specific to each installation)\n return array('src'=>indexUrl().'?do=genthumbnail&hmac='.htmlspecialchars($sign).'&url='.urlencode($url),\n 'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'thumbnail');\n }\n\n\n return array(); // No thumbnail.\n\n}",
"function pin_url_parse($html_url) {\n\n $html = file_get_contents($html_url);\n\n $doc = new DOMDocument();\n @$doc->loadHTML($html);\n\n $tags = $doc->getElementsByTagName('img');\n\n $image_urls = array();\n\n foreach ($tags as $tag) {\n $image = $tag->getAttribute('src');\n $check = parse_url($image);\n if (empty($check['host']) && empty($check['scheme'])) {\n $image = $html_url . $image;\n }\n\n // Check if it's an image.\n $valid = FALSE;\n $url_headers = get_headers($image, 1);\n if (!empty($url_headers['Content-Type'])) {\n $type = strtolower($url_headers['Content-Type']);\n // Does the media type start with 'image/'.\n $valid = !empty($type) || strrpos($type, 'image/', -strlen($type)) !== FALSE;\n }\n\n // Keep it, if valid.\n if ($valid) {\n $image_urls[] = $image;\n }\n }\n return $image_urls;\n}",
"public function getImage($key) {\n\t\t//\n\t\t// scraping content from picsearch\n\t\t$temp = file_get_contents(\"http://www.picsearch.com/index.cgi?q=\".urlencode($key));\n\t\tpreg_match_all(\"/<img class=\\\"thumbnail\\\" src=\\\"([^\\\"]*)\\\"/\",$temp,$ar);\n\t\tif(is_array($ar[1])) return $ar[1];\n\t\treturn false;\n\t}",
"public function getThumbnail()\n\t{\n if( !$this->_thumbnail )\n\t\t{\n jimport( 'joomla.filter.filterinput' );\n JLoader::register('JHtmlString', JPATH_LIBRARIES.'/joomla/html/html/string.php');\n\n // We will apply the most strict filter to the variable\n $noHtmlFilter = JFilterInput::getInstance();\n\n $thumbnail = false;\n\n // Check Open Graph tag\n preg_match('/<meta property=\"og:image\" content=\"([^\"]+)/', $this->_buffer, $match);\n if (!empty($match[1]))\n {\n $thumbnail = $match[1];\n $thumbnail = (string)str_replace(array(\"\\r\", \"\\r\\n\", \"\\n\"), '', $thumbnail);\n $thumbnail = $noHtmlFilter->clean($thumbnail);\n $thumbnail = JHtmlString::truncate($thumbnail, 5120);\n $thumbnail = trim($thumbnail);\n }\n }\n hwdMediaShareFactory::load('utilities');\n $utilities = hwdMediaShareUtilities::getInstance();\n $isValid = $utilities->validateUrl( $thumbnail );\n\n if ($isValid)\n {\n $this->_thumbnail = $thumbnail;\n return $this->_thumbnail;\n }\n }",
"function thumbnail($url,$href=false)\n{\n $t = computeThumbnail($url,$href);\n if (count($t)==0) return ''; // Empty array = no thumbnail for this URL.\n \n $html='<a href=\"'.htmlspecialchars($t['href']).'\"><img src=\"'.htmlspecialchars($t['src']).'\"';\n if (!empty($t['width'])) $html.=' width=\"'.htmlspecialchars($t['width']).'\"';\n if (!empty($t['height'])) $html.=' height=\"'.htmlspecialchars($t['height']).'\"';\n if (!empty($t['style'])) $html.=' style=\"'.htmlspecialchars($t['style']).'\"';\n if (!empty($t['alt'])) $html.=' alt=\"'.htmlspecialchars($t['alt']).'\"';\n $html.='></a>';\n return $html;\n}",
"public function getThumbnailUrl();",
"function lazyThumbnail($url,$href=false)\n{\n $t = computeThumbnail($url,$href); \n if (count($t)==0) return ''; // Empty array = no thumbnail for this URL.\n\n $html='<a href=\"'.htmlspecialchars($t['href']).'\">';\n \n $html.='<img src=\"'.htmlspecialchars($t['src']).'\"';\n if (!empty($t['width'])) $html.=' width=\"'.htmlspecialchars($t['width']).'\"';\n if (!empty($t['height'])) $html.=' height=\"'.htmlspecialchars($t['height']).'\"';\n if (!empty($t['style'])) $html.=' style=\"'.htmlspecialchars($t['style']).'\"';\n if (!empty($t['alt'])) $html.=' alt=\"'.htmlspecialchars($t['alt']).'\"';\n $html.='></a>';\n \n return $html;\n}",
"function getImg($postUrl){\n $url = explode(\"/\", $postUrl);\n $data = file_get_contents(\"htt\".\"p://\".$url[2].\"/mobile/post/\".$url[4]);\n preg_match_all('<a href=\"(.*?)\">',$data,$matches,PREG_PATTERN_ORDER);\n return $matches[1][0];\n}",
"function getThumbnail()\n {\n if ($this->version == 'APIFRONT')\n {\n return $this->getMeta('thumbnail')->getValue();\n }\n else if ($this->version == '4.6')\n {\n return $this->baseApiUrl\n . '?action=getthumbnail'\n . '&documentid=' . urlencode($this->infos['uri'])\n . '&documentmime=' . urlencode($this->infos['mime'])\n . '&documentextension=' . urlencode($this->infos['ext'])\n . '&documentsource=' . urlencode($this->infos['source'])\n . '&documentdetectedext=' . urlencode($this->infos['detectedExt']);\n }\n else if ($this->version == '5.0')\n {\n return $this->baseApiUrl . '/search-api/fetch/thumbnail'\n . '?source=' . urlencode($this->infos['source'])\n . '&uri=' . urlencode($this->infos['uri']);\n }\n return null;\n }",
"function get_first_image($html){\n if (!empty($html)) {\n\t\t\n\trequire_once('simple_html_dom.php');\n $post_dom = str_get_html($html);\n $first_img = $post_dom->find('img', 0);\n if($first_img !== null) {\n\t$image = $first_img->src;\n\tif (strtok($image, '?') != '') {\n\t$image = strtok($image, '?');\n\t} else {\n\t$image = $image;\n\t}\n return $image;\n }\n return null;\n\t} else {\n\treturn null;\n\t}\n}",
"public function getFirstImageUrl();",
"public static function findMainImage(string $html): string\n {\n $doc = new DOMDocument();\n @$doc->loadHTML($html);\n\n $metas = $doc->getElementsByTagName('meta');\n\n for ($i = 0; $i < $metas->length; $i++)\n {\n $meta = $metas->item($i);\n if ($meta->getAttribute('property') == 'og:image')\n {\n return $meta->getAttribute('content');\n }\n }\n return null;\n }",
"private function parseImageUrl($html) {\n\n // Only when an image exists can we start parsing.\n if($html->find('div#contentWrapper div#content table div a img.ac', 0)) {\n\n $imageSource = $html->find('div#contentWrapper div#content table div a img.ac', 0)->src;\n\n // Contains two with ?s=\n if(strpos($imageSource, ' 1x,') !== false) {\n $imageSource = explode(' 1x,', $imageSource)[0];\n }\n\n // URL is /r/ and contains ?s=\n if(strpos($imageSource, '/r/') !== false) {\n $imageSource = str_replace('/r/50x70', '', explode('?s=', $imageSource)[0]);\n }\n\n // URL has a modifier\n if(strpos($imageSource, 't.jpg') !== false || strpos($imageSource, 'l.jpg') !== false) {\n $imageSource = str_replace('l.jpg', '.jpg', str_replace('t.jpg', '.jpg', $imageSource));\n }\n\n return $imageSource;\n\n }\n \n }",
"function WPPortfolio_checkWebsiteThumbnailCaptured($url, $args = null, $fetchMethod = \"curl\")\n{\n\t$args = is_array($args) ? $args : array();\t\n\t\n\t// Don't try something if not enough arguements.\n\tif (!$args || !$url)\n\t\treturn false;\t\n\t\t\n\t// Don't need the filetype argument here\n\tunset($args['filetype']);\n\t\t\t\n\t$request_url = urldecode(\"http://images.shrinktheweb.com/xino.php?\".http_build_query($args,'','&'));\t// avoid &\n\t\n\t// Check that the thumbnail exists, from the STW server\n\t// Use cURL if possible\n\tif ($fetchMethod == \"curl\" && function_exists('curl_init')) \n\t{\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $request_url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable\n\t\t$remotedata = curl_exec($ch);\n\t\tcurl_close($ch);\t\t\n\t}\n\t// This may be disabled as a security measure\n\telse\n\t{\n\t\t$remotedata = file_get_contents($request_url);\n\t}\n\t\n\t// WPPT_debug_showArray(htmlentities($remotedata));\n\t$resultData = WPPortfolio_xml_processReturnData($remotedata);\n\t\n\t// Extract image URL to download - Legacy code\n\t//$regex = '/<[^:]*:Thumbnail\\\\s*(?:Exists=\\\"((?:true)|(?:false))\\\")?[^>]*>([^<]*)<\\//';\n\t//if (preg_match($regex, $remotedata, $matches) == 1 && $matches[1] == \"true\") {\n\t//\t\t$imageURL = $matches[2];\n\t//}\n\t\n\t$imageURL = $resultData['thumbnail'];\n\t\n\t\n\t// Param 1: Requested thumbnail URL\n\t// Param 2: Type - request or cache\n\t// Param 3: Did the operation succeed?\n\t// Param 4: Further Information\t\t\n\t$detail = sprintf('<span class=\"wpp-debug-detail-header\">Error Summary</span>\n\t\t\t\t\t <span class=\"wpp-debug-detail-info\">%s - %s</span>\n\t\t\t\t\t <span class=\"wpp-debug-detail-header\">Request URL</span>\n\t\t\t\t\t <span class=\"wpp-debug-detail-info\">%s</span>\n\t\t\t\t\t <span class=\"wpp-debug-detail-header\">Raw Response</span>\n\t\t\t\t\t <span class=\"wpp-debug-detail-info\">%s</span>', $resultData['status'], $resultData['msg'], $request_url, $remotedata);\n\t\n\t// Success - if a thumbnail or queued\n\t$wasSuccessful = ($imageURL != false || 'queued' == $resultData['status']);\n\t\t\n\tWPPortfolio_debugLogThumbnailRequest($url, 'web', $wasSuccessful, $detail, $args, $resultData['status']);\n\t\t\n\t// Return image URL and all remote data.\n\treturn $resultData;\n}",
"function get_video_thumbnail($url) {\n $is_youtube = (strpos($url, \"youtu\") !== FALSE);\n $is_vimeo = (strpos($url, \"vimeo\") !== FALSE);\n if ($is_youtube) {\n $youtube_id = get_youtube_id($url);\n $thumbnail = \"http://i3.ytimg.com/vi/\".$youtube_id.\"/hqdefault.jpg\";\n }\n else if ($is_vimeo) {\n $vimeo_id = get_vimeo_id($url);\n $data = file_get_contents(\"http://vimeo.com/api/v2/video/$vimeo_id.json\");\n $data = json_decode($data);\n $thumbnail = $data[0]->thumbnail_large;\n }\n return $thumbnail;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GRANT USAGE ON . TO ... WITH MAX_QUERIES_PER_HOUR 500 MAX_UPDATES_PER_HOUR 100; | public function testGrantWithGrantOptions()
{
$q = new GrantQuery;
$q->grant('USAGE')
->on('*.*')
->to('someuser@somehost')
->with('MAX_QUERIES_PER_HOUR', 100)
->with('MAX_CONNECTIONS_PER_HOUR', 100)
;
$this->assertSql('GRANT USAGE ON *.* TO `someuser`@`somehost` WITH MAX_QUERIES_PER_HOUR 100 MAX_CONNECTIONS_PER_HOUR 100', $q);
} | [
"function trailsforthepeople_db_update_2001() {\n\t$db = db_connect();\n\n\t$sql='\n\t\tCREATE TABLE IF NOT EXISTS jobs (\n\t\t id serial,\n\t\t title varchar(100),\n\t\t start_time timestamp DEFAULT current_timestamp,\n\t\t end_time timestamp,\n\t\t creator_email varchar(100),\n\t\t percent_complete integer DEFAULT 0,\n\t\t status varchar(30),\n\t\t status_msg varchar(255),\n\t\t PRIMARY KEY(id)\n\t\t);\n\t\tGRANT ALL PRIVILEGES ON TABLE jobs TO trails;\n\t\tGRANT ALL PRIVILEGES ON SEQUENCE jobs_id_seq TO trails;\n\t';\n\n\t$result = pg_query($db, $sql) or exit(\"Error running query.\");\n}",
"function upgrade_968_pgsql() {\n $table_domain = table_by_key ('domain');\n $table_mailbox = table_by_key('mailbox');\n db_query_parsed(\"ALTER TABLE $table_domain ALTER COLUMN quota type bigint\");\n db_query_parsed(\"ALTER TABLE $table_domain ALTER COLUMN maxquota type bigint\");\n db_query_parsed(\"ALTER TABLE $table_mailbox ALTER COLUMN quota type bigint\");\n}",
"public function main() {\n $this->execute('grant SPARQL_UPDATE to \"SPARQL\";')\n ->execute('GRANT execute ON SPARQL_INSERT_DICT_CONTENT TO \"SPARQL\";')\n ->execute('GRANT execute ON SPARQL_INSERT_DICT_CONTENT TO SPARQL_UPDATE;')\n ->execute('GRANT execute ON DB.DBA.SPARQL_MODIFY_BY_DICT_CONTENTS TO \"SPARQL\";')\n ->execute('GRANT execute ON DB.DBA.SPARQL_MODIFY_BY_DICT_CONTENTS TO SPARQL_UPDATE;');\n }",
"function manage_quota()\n\t{\n\t\t$this->output('/consent/ev_quota/v_manage_quota');\n\t}",
"private function defaultQuota(){\r\n\t\treturn 150;\r\n\t}",
"function trailsforthepeople_db_update_2002() {\n\t$db = db_connect();\n\n\t$sql = 'ALTER TABLE contributors ADD COLUMN allow_trails bool NOT NULL DEFAULT false;';\n\t$result = pg_query($db, $sql)\n\t\tor exit(\"Error running query.\");\n\n\t$sql = 'UPDATE contributors SET allow_trails=TRUE WHERE admin=true;';\n\n\t$result = pg_query($db, $sql) or exit(\"Error running query.\");\n}",
"function multisite_over_quota_message()\n{\n}",
"function getQuotaByUser($_username, $_what='QMAX');",
"function add_quota()\n\t{\n\t\t$this->output('/consent/ev_quota/v_add_quota');\n\t}",
"function trailsforthepeople_db_update_2004() {\n\t$db = db_connect();\n\n\t$sql='\n\t\tCREATE TABLE IF NOT EXISTS hint_maps (\n\t\t id serial,\n\t\t title varchar(100),\n\t\t image_filename_local varchar(255),\n\t\t last_edited TIMESTAMP DEFAULT current_timestamp,\n\t\t last_refreshed TIMESTAMP DEFAULT current_timestamp,\n\t\t url_external VARCHAR(2083),\n\t\t PRIMARY KEY(id)\n\t\t);\n\t\tGRANT ALL PRIVILEGES ON TABLE hint_maps TO trails;\n\t\tGRANT ALL PRIVILEGES ON SEQUENCE hint_maps_id_seq TO trails;\n\t';\n\n\t$result = pg_query($db, $sql) or exit(\"Error running query.\");\n}",
"function multisite_over_quota_message()\n {\n }",
"function efRaiseThrottleForUEM() {\n\tglobal $wgAccountCreationThrottle;\n\tif ( wfGetIP() == '193.147.239.254' &&\n\t\ttime() > strtotime( '2009-11-30T08:00 +1:00' ) &&\n\t\ttime() < strtotime( '2009-12-06T23:00 +1:00' ) )\n\t{\n\t\t$wgAccountCreationThrottle = 300;\n\t}\n}",
"function table_create_hourly (\n $readCapacity = 5,\n $writeCapacity = 5\n ) {\n global $db;\n\n $table = $db->prefixTable . 'Hourly';\n $db->client->createTable(array(\n 'TableName' => $table,\n 'AttributeDefinitions' => array(\n array(\n 'AttributeName' => 'name',\n 'AttributeType' => Type::STRING\n ),\n array(\n 'AttributeName' => 'epoch',\n 'AttributeType' => Type::NUMBER\n )\n ),\n 'KeySchema' => array(\n array(\n 'AttributeName' => 'name',\n 'KeyType' => 'HASH'\n ),\n array(\n 'AttributeName' => 'epoch',\n 'KeyType' => 'RANGE'\n )\n ),\n 'ProvisionedThroughput' => array(\n 'ReadCapacityUnits' => $readCapacity,\n 'WriteCapacityUnits' => $writeCapacity\n )\n ));\n \n // wait until the table is created and active\n $db->client->waitUntil('TableExists', array(\n 'TableName' => $table\n ));\n\n return true;\n }",
"function executeLimitedQuery($from, $count) {}",
"public function testSetQuotaButSizeIsBiggerThanVariable()\n {\n $user = $this->initAdmin(str_random(5) . \"@imac.com\", str_random(10));\n $token = \\JWTAuth::fromUser($user);\n $email = str_random(5) . \"@imac.com\";\n $password = str_random(10);\n $this->initUser($email, $password);\n $this->post(\"/api/v1/admin/setQuota?token={$token}\", [\n \"email\" => $email,\n \"maxSizeKB\" => 99999999999999999999999999999999999999999,\n \"enabled\" => true\n ], [])\n ->seeStatusCode(403)\n ->seeJsonContains([\n \"message\" => \"Max size is bigger than variable capacity\"\n ]);\n }",
"abstract public function shouldCountQuota();",
"function give_tech($amount)\n{\n\tglobal $db_name,$user;\n\tif ($user['login_id'] != ADMIN_ID) {\n\t\tdbn(\"update ${db_name}_users set tech = tech + '$amount' where login_id = '$user[login_id]'\");\n\t\t$user['tech'] += $amount;\n\t}\n}",
"public function testUpdatePrivilege3()\n {\n }",
"public function increase_limits() {\n\t\tset_time_limit( 300 );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getAutoOrdersBatchAsync Retrieve auto order batch | public function getAutoOrdersBatchAsync($auto_order_batch, $_expand = null)
{
return $this->getAutoOrdersBatchAsyncWithHttpInfo($auto_order_batch, $_expand)
->then(
function ($response) {
return $response[0];
}
);
} | [
"private function getBatchOrders()\n {\n return array_slice($this->ordersToSync, 0, $this->batchSize);\n }",
"protected function getAutoOrdersBatchRequest($auto_order_batch, $_expand = null)\n {\n // verify the required parameter 'auto_order_batch' is set\n if ($auto_order_batch === null || (is_array($auto_order_batch) && count($auto_order_batch) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $auto_order_batch when calling getAutoOrdersBatch'\n );\n }\n\n $resourcePath = '/auto_order/auto_orders/batch';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($_expand !== null) {\n $queryParams['_expand'] = ObjectSerializer::toQueryValue($_expand);\n }\n\n\n // body params\n $_tempBody = null;\n if (isset($auto_order_batch)) {\n $_tempBody = $auto_order_batch;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-ultracart-simple-key');\n if ($apiKey !== null) {\n $headers['x-ultracart-simple-key'] = $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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function orders_lookup_batch_init() {\n\t\t$batch_size = self::get_batch_size( self::ORDERS_BATCH_ACTION );\n\t\t$order_query = new WC_Order_Query(\n\t\t\tarray(\n\t\t\t\t'return' => 'ids',\n\t\t\t\t'limit' => 1,\n\t\t\t\t'paginate' => true,\n\t\t\t)\n\t\t);\n\t\t$result = $order_query->get_orders();\n\n\t\tif ( 0 === $result->total ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$num_batches = ceil( $result->total / $batch_size );\n\n\t\tself::queue_batches( 1, $num_batches, self::ORDERS_BATCH_ACTION );\n\t}",
"public function getBatches(){\n\t\treturn $this->get(\"/batch\");\n\t}",
"public function getAutoOrdersBatchWithHttpInfoRetry($retry , $auto_order_batch, $_expand = null)\n {\n $returnType = '\\ultracart\\v2\\models\\AutoOrdersResponse';\n $request = $this->getAutoOrdersBatchRequest($auto_order_batch, $_expand);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n\n if($e->getResponse()) {\n $response = $e->getResponse();\n $statusCode = $response->getStatusCode();\n $retryAfter = 0;\n $headers = $response->getHeaders();\n if (array_key_exists('Retry-After', $headers)) {\n $retryAfter = intval($headers['Retry-After'][0]);\n }\n\n if ($statusCode == 429 && $retry && $retryAfter > 0 && $retryAfter <= $this->config->getMaxRetrySeconds()) {\n sleep($retryAfter);\n return $this->getAutoOrdersBatchWithHttpInfoRetry(false , $auto_order_batch, $_expand);\n }\n }\n\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\AutoOrdersResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 410:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updateAutoOrdersBatchAsync($auto_orders_request, $_expand = null, $_placeholders = null, $_async = null)\n {\n return $this->updateAutoOrdersBatchAsyncWithHttpInfo($auto_orders_request, $_expand, $_placeholders, $_async)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getBatch(array $ids){\n if(count($ids) > self::BATCH_PROCESS_THRESHOLD)\n $ids = array_slice ($ids, 0, self::BATCH_PROCESS_THRESHOLD);\n\n $params = array(\n 'ItemId' => implode(',', $ids),\n );\n return $this->getDetails($params);\n }",
"public function getBatches()\n {\n $batches = $this->db->query(\"SELECT * FROM batch\")->fetchAll();\n return $batches;\n }",
"public function orderAmendBulkAsync($orders = null)\n {\n return $this->orderAmendBulkAsyncWithHttpInfo($orders)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getBatch() {\n return [\n 'oid' => $this->oid,\n 'status' => $this->status,\n 'date_last' => $this->date_last,\n 'date_scheduled' => $this->date_scheduled,\n 'active' => $this->active\n ];\n }",
"protected function createBatchOrdersRequest($order)\n {\n // verify the required parameter 'order' is set\n if ($order === null || (is_array($order) && count($order) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $order when calling createBatchOrders'\n );\n }\n\n $resourcePath = '/spot/batch_orders';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($order)) {\n $_tempBody = $order;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $signHeaders = $this->buildSignHeaders('POST', $resourcePath, $query, $httpBody);\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $signHeaders,\n $headers\n );\n\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getCustomerOrders();",
"public function getBatchs()\n {\n return $this->batchs;\n }",
"public function getOrdersBatchAsyncWithHttpInfo($order_batch, $_expand = null)\n {\n $returnType = '\\ultracart\\v2\\models\\OrdersResponse';\n $request = $this->getOrdersBatchRequest($order_batch, $_expand);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function executeAsync(): BatchInterface;",
"function isOrderBatchable($orderId);",
"protected function fetchRecords(): array\n {\n // Ascending update date is the ONLY way we can be sure to get all payments.\n\n $order = 'UpdatedDateUTC';\n\n return $this->accountingApi->getBatchPayments(\n $this->ifModifiedSince,\n $this->where,\n $order\n )->batchPayments;\n }",
"public function findAllBatches()\n {\n return Doctrine_Query::create()\n ->from('AlcheckBatch b')\n ->orderBy('b.id desc')\n ->where('b.description != ?', 'Dummy batch')\n ->execute();\n }",
"public function getBatch()\n {\n return $this->batch;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds and displays a reservationbook entity. | public function showAction(Reservationbook $reservationbook)
{
$deleteForm = $this->createDeleteForm($reservationbook);
return $this->render('reservationbook/show.html.twig', array(
'reservationbook' => $reservationbook,
'delete_form' => $deleteForm->createView(),
));
} | [
"public function showAction()\n {\n try {\n /**\n * @var \\DDD\\Service\\Booking\\ReservationIssues $reservationIssuesService\n */\n $reservationIssuesService = $this->getServiceLocator()->get('service_booking_reservation_issues');\n\n if ($this->id) {\n $issues = $reservationIssuesService->getReservationIssues($this->id);\n\n echo PHP_EOL . 'Reservation Id: ' . $this->id . PHP_EOL;\n\n if (count($issues)) {\n foreach ($issues as $issue) {\n echo \" Issue Id: \" . $issue->getId() . PHP_EOL;\n echo \" # \\e[1;33m\" . $issue->getReservationNumber() . \"\\e[0m\" . PHP_EOL;\n echo \" ! \\e[0;36m\" . $issue->getTitle() . \"\\e[0m\" . PHP_EOL;\n echo ' @ ' . $issue->getDateOfDetection() . PHP_EOL;\n echo PHP_EOL;\n }\n } else {\n echo ' has no issues' . PHP_EOL . PHP_EOL;\n }\n\n } else {\n $allIssues = $reservationIssuesService->getIssuesGrouppedByReservationId();\n\n foreach ($allIssues as $reservationId => $issues) {\n echo PHP_EOL . 'Reservation Id: ' . $reservationId . PHP_EOL;\n foreach ($issues as $issues) {\n echo \" Issue Id: \" . $issues['id'] . PHP_EOL;\n echo \" # \\e[1;33m\" . $issues['reservation_number'] . \"\\e[0m\" . PHP_EOL;\n echo \" ! \\e[0;36m\" . $issues['issue_title'] . \"\\e[0m\" . PHP_EOL;\n echo \" @ \" . $issues['date_of_detection'] . PHP_EOL;\n echo PHP_EOL;\n }\n }\n }\n\n echo \"\\e[2;33m -=#=- Done -=#=-\\e[0m\".PHP_EOL.PHP_EOL;\n\n } catch (\\Exception $e) {\n\n }\n }",
"public function listAction(){\r\n $em = $this->container->get('doctrine')->getEntityManager();\r\n\r\n $reservations = $em->getRepository('HotelBundle:Reservation')->findAll();\r\n\r\n return $this->render('@Hotel/Reservation/list.html.twig',\r\n array('reservations' => $reservations));\r\n }",
"public function showReservationAction(): Response\n {\n $reservationManager = $this->get('ah.reservation_manager');\n $reservations = $reservationManager->getUserReservations();\n\n return $this->render(\n 'UserBundle:profile:reservations.html.twig',\n [\n 'reservations' => $reservations\n ]\n );\n }",
"public function ShowEditBooking()\n {\n $id_booking = $_GET[\"booking\"];\n $model = new Booking();\n $booking = $model->CallBookingById($id_booking);\n $model = new Room();\n $room = $model->CallRoombyId($booking[\"id_room\"]);\n //loading template\n $title = \"Edit-Booking\";\n $template = 'Edit_booking.phtml';\n include 'views/LayoutFrontend.phtml';\n }",
"public static function book() {\n $view = self::generateView('member/book', 'Book Details');\n $response = self::bookDetail();\n self::loadResponseToView($view, $response);\n $view->render();\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $detailreservations = $em->getRepository('DefaultBundle:Detailreservation')->findAll();\n\n return $this->render('detailreservation/index.html.twig', array(\n 'detailreservations' => $detailreservations,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $reservations = $em->getRepository('MainBundle:Reservation')->findAll();\n $events = $em->getRepository('MainBundle:Events')->findAll();\n return $this->render('reservation/index.html.twig', array(\n 'reservations' => $reservations,\n 'events'=>$events,\n ));\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BrainstrapBundlesFrontBundle:Object\\Object')->find($id);\n $booked = $em->getRepository('BrainstrapBundlesFrontBundle:Object\\ObjectBooking')->findBy(array(\n 'object' => $id,\n 'approved' => 1\n ));\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Object\\Object entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BrainstrapBundlesFrontBundle:Object/Object:show.html.twig', array(\n 'entity' => $entity,\n 'booked' => $booked,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"function viewBooking($booking) {\n global $DB, $Controller, $USER;\n $res = $DB->booking_bookings->get(array('b_id' => $booking));\n $booking = false;\n $booked_items = array();\n $nr = 0;\n while(false !== ($r = Database::fetchAssoc($res))) {\n $booking = $r;\n $nr++;\n if($Controller->{$r['id']}) $booked_items[] = array('obj' => $Controller->{$r['id']}, 'id' => $r['id'], 'parent' => $Controller->{$r['id']}->parentBookID());\n }\n if(!$booking) return __('An error occured. Cannot find booking');\n $nav = '<div class=\"nav\">';\n\n $nav .= ($_REQUEST['js']\n ?'<a href=\"javascript:window.close();\">'.icon('small/cancel').__('Close').'</a>'\n :'<a href=\"'.url(null, array('viewDate', 'id')).'\">'.icon('small/arrow_left').__('Back').'</a>'\n )\n .($this->mayI(EDIT) || $booking['booked_by'] == $USER->ID || ($booking['booked_for'] && $Controller->{$booking['booked_for']}('Group') && $Controller->{$booking['booked_for']}->isMember($USER))\n ?'<a href=\"'.url(array('delbooking' => $booking['b_id']), array('viewDate', 'id', 'js')).'\">'.icon('small/delete').__('Delete booking').'</a>'\n .($nr>1\n ?'<a href=\"'.url(array('rembooking' => $booking['b_id']), array('viewDate', 'id', 'js')).'\">'.icon('small/cross').__('Remove from booking').'</a>'\n :'')\n :'')\n .(!$booking['cleared_by'] && $this->mayI(EDIT)\n ?'<a href=\"'.url(array('confirm' => $booking['b_id']), true).'\">'.icon('small/tick').__('Confirm').'</a>'\n :'');\n $nav .= '</div>';\n return $nav.new Set(\n ($booked_items\n ? new FormText(__('What'), listify(inflate($booked_items), false, true, 'obj', 'children'))\n : null\n ),\n ($Controller->{$booking['booked_by']}\n ?new FormText(__('Booked by'), $Controller->{$booking['booked_by']})\n :null\n ),\n ($booking['booked_for'] && $Controller->{$booking['booked_for']}\n ?new FormText(__('Booked for'), $Controller->{$booking['booked_for']})\n :null\n ),\n new FormText(__('Booked from'), date('Y-m-d, H:i', $booking['starttime'])),\n new FormText(__('Booked until'), date('Y-m-d, H:i', $booking['starttime'] + $booking['duration'])),\n ($booking['comment']\n ?new FormText(__('Comment'), $booking['comment'])\n :null\n )\n );\n }",
"public function findBookingById($id);",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BackendBundle:Recibo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Recibo entity.');\n }\n\n return $this->render('BackendBundle:Recibo:show.html.twig', array(\n 'entity' => $entity,\n ));\n }",
"public function bookView(string $uid): BookEntity\n {\n return $this->bookRepository->findUserBook(\\Auth::user()->getUid(), $uid);\n }",
"public function showBookings()\n {\n return $this->render('account/bookings.html.twig');\n }",
"public function reservationsAction($slug)\n {\n $em = $this->get('doctrine.orm.entity_manager');\n $reservationService = $this->container->get('reservation');\n\n $book = $em->getRepository('DropTableLibraryBundle:Book')->findOneBySlug($slug);\n $reservations = $reservationService->getReservationsByBook($book);\n\n return [\n 'reservations' => $reservations,\n ];\n }",
"public function getReservationById($reservation_id);",
"public function get($book_id);",
"public function getReservationById($id);",
"public function show()\n\t{\n\t\t# Rubric ID\n\t\t$ID\t\t\t\t= $this->uri->segment(2);\n\t\t\n\t\t# Get book data\n\t\t$data['books']\t= $this->M_rubric->show( $ID );\n\t\t\n\t\t# If book does not exist\n\t\tif ( ! $data['books'] )\n\t\t{\n\t\t\tshow_404('page');\n\t\t}\n\t\t\n\t\t# Load view\n\t\t$this->parser->parse('V_rubric_show_article' , $data );\n\t\t\n\t}",
"public function showBookingBusinessAction($id) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('SkaphandrusAppBundle:SkBooking')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find SkBooking entity.');\n }\n\n return $this->render('SkaphandrusAppBundle:SkBookingBusiness:show.html.twig', array(\n 'entity' => $entity,\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get for the Verb | function getVerb() {
return $this->verb;
} | [
"public function verbs(): array;",
"public function getVerb()\n {\n return $this->verb;\n }",
"public function getVerb() { return $this->data['verb']; }",
"protected function verbs()\n {\n\n return [\n 'index' => ['GET', 'HEAD'],\n 'view' => ['GET', 'HEAD'],\n 'save' => ['POST', 'PUT', 'PATCH'],\n 'delete' => ['DELETE'],\n ];\n }",
"public static function getVerbs(): array\n {\n return static::$verbs;\n }",
"static public function getVerb()\n {\n // Check $_SERVER\n if (! isset($_SERVER['REQUEST_METHOD'])) {\n Error::throwInternalException('Invalid runtime environment. No request type defined.');\n }\n /* GET */\n if (static::isGet()) {\n return v_get;\n /* POST */\n } elseif (static::isPost()) {\n return v_post;\n /* PUT */\n } elseif (static::isPut()) {\n return v_put;\n /* DELETE */\n } elseif (static::isDelete()) {\n return v_delete;\n /* UNKNOWN */\n } else {\n Error::throwInternalException('Unable to determine verb', i_emergency);\n }\n }",
"protected function verbs()\n {\n return [\n 'OPTIONS' => 'options',\n ];\n }",
"public function getHttpVerb()\n {\n return $this->_http_verb;\n }",
"public function getHTTPVerb(): string\n {\n return $this->HTTPVerb;\n }",
"protected function verbs()\n {\n return [\n 'support' => ['POST'],\n 'comment' => ['GET', 'POST'],\n 'collection' => ['GET', 'POST', 'DELETE'],\n ];\n }",
"public function getAccessVerb() {\n $verb = isset($this->access_verb) ? $this->access_verb : $this->path;\n return $verb;\n }",
"public static function isGET(){return self::$method==='GET';}",
"public function getSpecialVerbs() {\n\t\treturn $this->specialVerbs;\n\t}",
"public function getVerb()\n {\n return $this->serverVariables['REQUEST_METHOD'];\n }",
"function getManagementVerbs() {\n\t\t$verbs = array();\n\t\tif ($this->getEnabled()) {\n\t\t\t$verbs[] = array('generate', 'Generate Front Matters');\n $verbs[] = array('settings', 'Settings');\n $verbs[] = array('systemcheck', 'System Check');\n\t\t}\n\t\treturn parent::getManagementVerbs($verbs);\n\t}",
"static function method($_asStr=False){\n\t\tself::init();\n\n\t\tif ($_asStr)\n\t\t\treturn self::$vMethod;\n\t\t\t\n\t\tswitch (self::$vMethod){\n\t\t\tcase 'GET':\n\t\t\t\treturn self::GET;\n\t\t\tcase 'POST':\n\t\t\t\treturn self::POST;\n\t\t\tcase 'PUT':\n\t\t\t\treturn self::PUT;\n\t\t\tcase 'DELETE':\n\t\t\t\treturn self::DELETE;\n\t\t}\n\t}",
"public function method($verb);",
"public function setVerb()\n {\n $this->_verb = in_array($_SERVER['REQUEST_METHOD'], array('PUT', 'GET', 'POST', 'DELETE', 'OPTIONS', 'HEAD')) ? $_SERVER['REQUEST_METHOD'] : null;\n }",
"protected function getHttpMethod()\n {\n return 'GET';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deserialize a message body from the input stream | public function readBody()
{
$targetURI = $this->_inputStream->readUTF();
$responseURI = $this->_inputStream->readUTF();
$length = $this->_inputStream->readLong();
try {
$data = $this->_deserializer->readTypeMarker();
} catch (Exception $e) {
require_once SHLIB_PATH_TO_ZEND . 'Zendshl/Amf/Exception.php';
throw new Zendshl_Amf_Exception('Unable to parse ' . $targetURI . ' body data ' . $e->getMessage(), 0, $e);
}
// Check for AMF3 objectEncoding
if ($this->_deserializer->getObjectEncoding() == Zendshl_Amf_Constants::AMF3_OBJECT_ENCODING) {
/*
* When and AMF3 message is sent to the server it is nested inside
* an AMF0 array called Content. The following code gets the object
* out of the content array and sets it as the message data.
*/
if(is_array($data) && $data[0] instanceof Zendshl_Amf_Value_Messaging_AbstractMessage){
$data = $data[0];
}
// set the encoding so we return our message in AMF3
$this->_objectEncoding = Zendshl_Amf_Constants::AMF3_OBJECT_ENCODING;
}
$body = new Zendshl_Amf_Value_MessageBody($targetURI, $responseURI, $data);
return $body;
} | [
"public abstract function deserialize($stream);",
"public function withBody(ReadableStream $stream): Message;",
"public function readBody()\n {\n $targetURI = $this->_inputStream->readUtf();\n $responseURI = $this->_inputStream->readUtf();\n $length = $this->_inputStream->readLong();\n\n try {\n $data = $this->_deserializer->readTypeMarker();\n } catch (Exception $e) {\n require_once 'Zend/Amf/Exception.php';\n throw new Zend_Amf_Exception('Unable to parse ' . $targetURI . ' body data ' . $e->getMessage(), 0, $e);\n }\n\n // Check for AMF3 objectEncoding\n if ($this->_deserializer->getObjectEncoding() == Zend_Amf_Constants::AMF3_OBJECT_ENCODING) {\n /*\n * When and AMF3 message is sent to the server it is nested inside\n * an AMF0 array called Content. The following code gets the object\n * out of the content array and sets it as the message data.\n */\n if(is_array($data) && $data[0] instanceof Zend_Amf_Value_Messaging_AbstractMessage){\n $data = $data[0];\n }\n\n // set the encoding so we return our message in AMF3\n $this->_objectEncoding = Zend_Amf_Constants::AMF3_OBJECT_ENCODING;\n }\n\n return new Zend_Amf_Value_MessageBody($targetURI, $responseURI, $data);\n }",
"public function deserialize($stream) {\n return (new StreamInput($stream))->read();\n }",
"public function readMessage($stream)\n {\n fseek($stream, 0);\n $contents = stream_get_contents($stream);\n return json_decode($contents);\n }",
"public function decode($stream);",
"public function readBody();",
"public function getBodyStream();",
"public function decodeBody(){\n\t\t$this->decodedBody = json_decode($this->body);\n\t\tif ($this->decodedBody === null) {\n\t\t\t$this->decodedBody = [];\n\t\t\tparse_str($this->body, $this->decodedBody);\n\t\t}\n\t\tif (!is_object($this->decodedBody)) {\n\t\t\t$this->decodedBody = [];\n\t\t}\n\n\t\tif ($this->isError()) {\n\t\t\t$this->makeException();\n\t\t}\n\t}",
"public function Deserialize($message)\n\t {\n\t }",
"function decode_message_body()\n\t{\n\t\t$this->body = decode_string($this->body, $this->headers['content-transfer-encoding'], $this->headers['__other_hdr__']['content-type']['charset']);\n\t}",
"public function decode(&$buffer)\n {\n // try to read a complete message\n if (strpos($buffer, self::HEADER_END) !== false)\n {\n // extract the header and parse it\n $requestHeaders = substr(\n $buffer, \n 0, \n strpos($buffer, self::HEADER_END) + strlen(self::HEADER_END)\n );\n\n // try to extract the headers into an array \n try\n {\n $headers = $this->parseRawHeaders($requestHeaders);\n }\n catch (UnexpectedValueException $e)\n {\n // if there was a problem with invalid headers, return a message to the client\n // telling them the message was invalid. Remove the message from the read buffer,\n // including any message body\n// implement this\n return false;\n }\n \n if ($headers)\n {\n // remove the raw headers from the read buffer\n $buffer = substr($buffer, strlen($requestHeaders));\n\n // check whether there is a content-length header\n if (isset($headers[self::CONTENT_LENGTH_HEADER]))\n {\n // try to read that many bytes from the buffer as the message body\n $message = substr($buffer, 0, $headers[self::CONTENT_LENGTH_HEADER]);\n\n if (strlen($message) != $headers[self::CONTENT_LENGTH_HEADER])\n {\n // if we failed to read the full message body, reconstruct the buffer, and \n // return false\n $buffer = $requestHeaders . $buffer;\n return false;\n }\n \n // otherwise remove the message from the buffer\n $buffer = substr($buffer, $headers[self::CONTENT_LENGTH_HEADER]);\n \n // save the message body\n $this->messageBody = $message;\n }\n \n $this->headers = $headers;\n \n // update class variables with the contents of the received headers\n $this->saveHeadersToProperties();\n }\n \n return true;\n }\n \n return false;\n }",
"function AMFDeserializer(&$is) {\r\n $this->inputStream = &$is; // save the input stream in this object\r\n }",
"protected function parseRawData()\n {\n $encoding = mb_detect_encoding($this->rawBody, 'auto');\n if ($encoding != 'UTF-8') {\n $this->rawBody = iconv($encoding, 'UTF-8', $this->rawBody);\n }\n\n $request = json_decode($this->rawBody);\n\n return $request;\n }",
"public function getRawBody()\n {\n return $this->inputStream;\n }",
"public function decodeMessageBody(AbiType $abi, string $body, bool $isInternal = false): DecodedMessageBody\n {\n return new DecodedMessageBody(\n $this->tonClient->request(\n 'abi.decode_message_body',\n [\n 'abi' => $abi,\n 'body' => $body,\n 'is_internal' => $isInternal,\n ]\n )->wait()\n );\n }",
"public static function body($message)\n {\n if (!isset($message['body'])) {\n return null;\n }\n\n if ($message['body'] instanceof StreamInterface) {\n return (string) $message['body'];\n }\n\n switch (gettype($message['body'])) {\n case 'string':\n return $message['body'];\n case 'resource':\n return stream_get_contents($message['body']);\n case 'object':\n if ($message['body'] instanceof \\Iterator) {\n return implode('', iterator_to_array($message['body']));\n } elseif (method_exists($message['body'], '__toString')) {\n return (string) $message['body'];\n }\n default:\n throw new \\InvalidArgumentException('Invalid request body: '\n . gettype($message['body']));\n }\n }",
"public function deserialize()\n {\n do {\n $lengthString = stream_get_line($this->_inputStream, 100, \"\\n\");\n } while (\n empty($lengthString) || $lengthString == \"\\n\" || $lengthString == \"\\r\"\n );\n\n $intLengthString = hexdec(trim($lengthString));\n\n $chunkData = stream_get_contents($this->_inputStream, $intLengthString);\n $goalState = $this->_deserializer->deserialize($chunkData);\n\n return $goalState;\n }",
"public function createBodyStream(): InputStream;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.