query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Returns Education status from model. | private function educationStatus() {
$education_status_temp = EducationStatus::where('active', 'yes')
->orderBy('sort_key')
->get(['label'])
->toArray();
$education_status[1] = '-- Select Education Status --';
foreach($education_status_temp as $data) {
$education_status[$data['label']] = $data['label'];
}
return $education_status;
} | [
"public function education() {\n return CommonSenseApiEducation::instance($this, 'CommonSenseApiEducation');\n }",
"public function getEducation() {\r\n return $this->education;\r\n }",
"public function getEducation()\n\t{\n\t\treturn $this->education;\n\t}",
"public function getEducation()\n {\n return $this->_db->select(\"SELECT * FROM `education`\");\n }",
"public function getEducation() {\n if ($this->db == null) {\n return false;\n }\n\n return $this->db->query(\"SELECT * FROM education ORDER BY education_start_year DESC, education_id DESC\")->fetch_all(MYSQLI_ASSOC);\n }",
"public function getEnrollmentStatus(): int;",
"public function educationLevel()\n\t{\n\t\treturn $this->hasOne('App\\EducationLevel', 'id', 'education_level');\n\t}",
"public function getEducationDetails() {\n $sql = \"SELECT * FROM education_tab\";\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return false;\n } else {\n return $result->result_array();\n }\n }",
"public function getEducationByCounty() {\n\n // Create the education level needed\n\n }",
"public function education()\n {\n return $this->hasOne('App\\Models\\Education','education_level_id','id');\n }",
"public function getStatus()\n {\n// $data['school'] = ResumeschoolModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['company'] = ResumecompanyModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['project'] = ResumeprojectModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['train'] = ResumetrainModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['language'] = ResumelanguageModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['honor'] = ResumehonorModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['certificate'] = ResumecertificateModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['wxb_job_resume_practice'] = ResumepracticeModel::find($this->user_user_id) ? 1 : 0 ;\n }",
"public function getDecoratedEducation(){\n $educationLabel = $this->nullValueMarker;\n if($this->EDU_LEVEL_NEW){\n $educationLabel = FieldMap::getFieldLabel(\"education\",$this->EDU_LEVEL_NEW);\n }\n else\n {\n\t\t\t\t\tif(!in_array(\"EDU_LEVEL_NEW\",$this->fieldsArray))\n\t\t\t\t\tProfileFieldsLogging::callFieldStack(1);\n\t\t\t\t}\n return $educationLabel;\n }",
"public function getModelStatus()\n {\n return $this->_model_status;\n }",
"public function education()\n {\n return $this->hasOne('App\\Models\\Education','user_id','id');\n }",
"function getEmployeeStatus() \n {\n return $this->getValueByFieldName( 'ren_employeestatus' );\n }",
"function getEducations(){\n\t\n\t\t$educations = $this->attributes['Education'];\n\t\treturn $educations;\n\t}",
"public function education(){\n return $this->hasOne(UserEducation::class, 'user_id', 'id');\n }",
"public function education()\n {\n return $this->hasOne('App\\TableModels\\Education', 'username');\n }",
"public function getEstatus()\r\n {\r\n return $this->estatus;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turn left when the bot is facing north | protected function northToLeft()
{
$this->direction = 'w';
} | [
"public function turnLeft() {\n if (!empty($this->currentDirection)) {\n $index = array_search($this->currentDirection, $this->directions);\n $newDirectionIndex = $index === 0 ? count($this->directions)-1 : $index-1;\n $this->setCurrentDirection($this->directions[$newDirectionIndex]);\n }\n }",
"public function turnLeft()\n {\n $this->direction += 3;\n $this->direction %= 4;\n }",
"public function changeDirectionLeft()\n {\n switch ($this->getDirection()) {\n case 'west':\n $this->setDirection(\"south\");\n break;\n\n case 'east':\n $this->setDirection(\"north\");\n break;\n case \"north\":\n $this->setDirection(\"west\");\n break;\n default:\n $this->setDirection(\"east\");\n break;\n }\n }",
"protected function left($deg) {\r\n //make sure engine is on\r\n if (!$this->engine_on) {\r\n echo PHP_EOL;\r\n $this->action(\"LEFT TURN ERROR: Engine not on! Start vehicle first!\");\r\n return;\r\n }\r\n\r\n //it is, go\r\n $this->direction -= $deg;\r\n\r\n //keep the direction ranging between 0 and 360 so it's easy to figure out where we're\r\n // facing\r\n if ($this->direction < 0) {\r\n $this->direction += 360;\r\n }\r\n }",
"public function turnLeft(): RobotPosition\r\n {\r\n $index = array_search($this->facing, static::FACINGS);\r\n $index = $index - 1;\r\n if ($index < 0) {\r\n $index = count(static::FACINGS) - 1;\r\n }\r\n $this->facing = static::FACINGS[$index];\r\n return $this;\r\n }",
"protected function northToRight()\n {\n $this->direction = 'e';\n }",
"public function left()\n {\n if (!$this->isOnBoard()) {\n $this->error = 'The robot has not yet been placed on the board.';\n return false;\n }\n\n $directions = ['N' => 'W', \n 'W' => 'S', \n 'S' => 'E',\n 'E' => 'N'\n ];\n\n $this->current_f = $directions[$this->current_f];\n\n return true;\n }",
"function rotate_left() { $this->rotate(90); }",
"public function switchDirection() {\n if ($this->totalRequestedFloors() > 0) {\n LogUtils::write(\"Switch direction from \" . $this->direction . \" to \");\n $this->setDirection($this->getDirection() == \"up\" ? \"down\" : \"up\");\n } else {\n $this->isMoving = false;\n $this->direction = \"stand\";\n }\n }",
"public function testShouldRotateFromNorthToWestWhenTurnedLeft()\n {\n $direction = new Direction('NORTH');\n $this->assertEquals('WEST', $direction->leftDirection());\n }",
"public function rotateLeft();",
"public function right(){\n switch($this->dir) {\n case 'NORTH':\n $this->dir = 'EAST';\n break;\n case 'EAST':\n $this->dir = 'SOUTH';\n break;\n case 'SOUTH':\n $this->dir = 'WEST';\n break;\n case 'WEST':\n $this->dir = 'NORTH';\n break;\n }\n $this->updateRobotPosition( $this->x, $this->y, $this->dir );\n }",
"protected function westToRight()\n {\n $this->direction = 'n';\n }",
"protected function forward()\n {\n if ($this->getHeading() == self::NORTH) {\n // x, y+1\n $this->setY($this->getY() + 1);\n } else if ($this->getHeading() == self::EAST) {\n // x+1, y\n $this->setX($this->getX() + 1);\n } else if ($this->getHeading() == self::SOUTH) {\n // x, y-1\n $this->setY($this->getY() - 1);\n } else if ($this->getHeading() == self::WEST) {\n // x-1, y\n $this->setX($this->getX() - 1);\n }\n\n // make sure the moves are within boundaries\n // only applies if boundaries are set\n if ($this->getBoundaryX() > 0 && $this->getBoundaryY() > 0) {\n if ($this->getX() < 0) {\n $this->setX(0);\n } else if ($this->getX() > $this->getBoundaryX()) {\n $this->setX($this->getBoundaryX());\n } else if ($this->getY() < 0) {\n $this->setY(0);\n } else if ($this->getY() > $this->getBoundaryY()) {\n $this->setY($this->getBoundaryY());\n }\n }\n }",
"private function setHorizontalDirection()\n {\n if(!$this->canMoveRight()) {\n $this->direction = 'Left';\n } elseif(!$this->canMoveLeft()) {\n $this->direction = 'Right';\n } else {\n $this->direction = (mt_rand(0, 1)) ? 'Left' : 'Right';\n }\n }",
"public function goWest(): void\n {\n $this->x--;\n }",
"protected function moveLeft()\n {\n if (!$this->keyExists($this->row, $this->column - 1)) {\n return;\n }\n\n $this->column--;\n }",
"public function move_left()\n {\n $snake_head = $this->_get_snake_head();\n\n if($this->_going_forward()) {\n $next_step = [\n $snake_head[0], ++$snake_head[1]\n ];\n } else if($this->_going_down()) {\n $next_step = [\n ++$snake_head[0], $snake_head[1]\n ];\n } else if($this->_going_up()) {\n $next_step = [\n --$snake_head[0], $snake_head[1]\n ];\n } else if($this->_going_back()) {\n $next_step = [\n $snake_head[0], --$snake_head[1]\n ];\n }\n\n return $this->_move_snake_to($next_step, 'L');\n }",
"public function moveForward();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserts $substring into the string at the $index provided. | public function insert($substring, $index)
{
$string = static::create($this->text, $this->encoding);
if ($index > $string->length()) {
return $string;
}
$start = \mb_substr($string->text, 0, $index, $string->encoding);
$end = \mb_substr($string->text, $index, $string->length(),
$string->encoding);
$string->text = $start . $substring . $end;
return static::create($string);
} | [
"public static function insert(string $str, string $substring, int $index): string\n {\n return (string)BaseStringy::create($str)->insert($substring, $index);\n }",
"public function insert(string $substring, int $index): self\n {\n $stringy = static::create($this->str, $this->encoding);\n if ($index > $stringy->length()) {\n return $stringy;\n }\n\n $start = UTF8::substr($stringy->str, 0, $index, $stringy->encoding);\n $end = UTF8::substr($stringy->str, $index, $stringy->length(), $stringy->encoding);\n\n $stringy->str = $start . $substring . $end;\n\n return $stringy;\n }",
"public static function str_insert(\n string $str,\n string $substring,\n int $index,\n string $encoding = 'UTF-8'\n ): string {\n if ($encoding === 'UTF-8') {\n $len = (int) \\mb_strlen($str);\n if ($index > $len) {\n return $str;\n }\n\n /** @noinspection UnnecessaryCastingInspection */\n return (string) \\mb_substr($str, 0, $index) .\n $substring .\n (string) \\mb_substr($str, $index, $len);\n }\n\n $encoding = self::normalize_encoding($encoding, 'UTF-8');\n\n $len = (int) self::strlen($str, $encoding);\n if ($index > $len) {\n return $str;\n }\n\n return ((string) self::substr($str, 0, $index, $encoding)) .\n $substring .\n ((string) self::substr($str, $index, $len, $encoding));\n }",
"public function insert($substring, $idx, $encoding = null)\n {\n return $this->addModifier('insert', array($substring, $idx, $encoding));\n }",
"public static function insert($string, $insert, $index, $encoding = null) {\n return self::substr($string, 0, $index, $encoding) . $insert . self::substr($string, $index, strlen($string) - $index, $encoding);\n }",
"public function insert($index, self $str){\n\t\t\n\t\tif(!$this->offsetExists($index)){\n\t\t\tthrow new \\OutOfRangeException('$index is invalid');\n\t\t}\n\t\t\n\t\treturn new static(\n\t\t\t\t$this->substring(0, $index) .\n\t\t\t\t$str->_Value .\n\t\t\t\t$this->substring($index),\n\t\t\t$this->_Encoding);\n\t\t\n\t}",
"public static function insert(string $string, string $insert, int $index = 0, $encoding = null) : string\n {\n $encoding = $encoding ?? static::getEncoding();\n if ($index > static::length($string, $encoding)) {\n return $string . $insert;\n }\n $start = mb_substr($string, 0, $index, $encoding);\n $end = mb_substr($string, $index, static::length($string, $encoding), $encoding);\n return $start . $insert . $end;\n }",
"private function doInsertStringBeforePosition(string $string, string $insertStr, int $position): string\n {\n return substr($string, 0, $position) . $insertStr . substr($string, $position);\n }",
"public function insert(string $string, int $position)\n {\n $this->data = substr_replace($this->data, $string, $position, 0);\n }",
"function str_insert($insertstring, $intostring, $offset) {\n $part1 = substr($intostring, 0, $offset);\n $part2 = substr($intostring, $offset);\n \n $part1 = $part1 . $insertstring;\n $whole = $part1 . $part2;\n return $whole;\n}",
"public static function insert($string, $pos, $char) {\n $string= substr($string, 0, $pos).$char.substr($string, $pos);\n return $string;\n }",
"public function substringAt($index);",
"function _string_shift(&$string, $index = 1)\n {\n $substr = substr($string, 0, $index);\n $string = substr($string, $index);\n return $substr;\n }",
"public function insert($string, $position)\n {\n if (!empty($string)) {\n $position = (int)$position > mb_strlen($this->string) ? mb_strlen($this->string) : $position - 1;\n $this->string = str_concat(mb_substr($this->string, 0, $position), $string, mb_substr($this->string, $position));\n }\n return $this;\n }",
"public function insertAt($index, $data);",
"public static function insertString($parentString,$childString,$start)\n\t{\n\t\t$beg = substr($parentString,0,$start);\n\t\t$mid = $childString;\n\t\t$end = substr($parentString,$start+strlen($mid));\n\t\treturn $beg.$mid.$end;\n\t}",
"protected function insertSnippet($string, $snippet, $position)\n {\n return substr_replace($string, $snippet, $position, 0);\n }",
"public function insert( String $string, Integer $offset ) {\n\t\t$this->replace($string, $offset, new Integer(0));\n\t\treturn $this;\n\t}",
"function insertSymbol($string, $position, $symbol) {\r\n $length=strlen($string);\r\n $temp1=substr($string,0,$position); //yyyy\r\n\t$temp2=substr($string,$position,$length);\r\n $rest=$temp1.$symbol.$temp2; \r\n\treturn $rest;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of orderID field from reponse data. | public function getOrderID()
{
return $this->data['orderID'] ?? null;
} | [
"public function orderId()\n {\n return $this->body()[\"order_id\"];\n }",
"public function getRequestOrderID()\n {\n return $this->data['request']['orderID'] ?? null;\n }",
"public function getOrderItemId() \n {\n return $this->_fields['OrderItemId']['FieldValue'];\n }",
"public function getOrderID()\n {\n return $this->orderID;\n }",
"public function getOrderItemId()\n {\n return $this->_fields['OrderItemId']['FieldValue'];\n }",
"public function getOrderid()\n {\n return $this->orderid;\n }",
"public function getOrderid() {\n\t\treturn $this->orderid;\n\t}",
"public function getOrder_id()\n {\n return $this->order_id;\n }",
"public function getOrderid()\n\t{\n\n\t\treturn $this->orderid;\n\t}",
"private function parseOrderId(\\Zend_Http_Response $response)\n {\n $content = $this->jsonDecoder->decode($response->getBody());\n return isset($content['orderId']) ? $content['orderId'] : null;\n }",
"public function getOrderItemId()\n {\n return $this->getData(self::ORDER_ITEM_ID);\n }",
"public function getResponseID() {\n return $this->getObjectID();\n }",
"public static function get_order_id($order)\n {\n }",
"function bosa_reservation_action_order_id($order) {\n error_log(basename(__FILE__) . ':' . __LINE__ . ' Var: $order = ' . print_r($order->order_id, 1));\n return $order;\n}",
"public function getReturnOrderID()\n {\n return $this->returnOrderID;\n }",
"public function getOrderReference()\n {\n if (!isset($this->data['error']) ) {\n return $this->data['transactionResponse']['orderId'];\n }\n\n return null;\n }",
"private function getOrderIncrementId(): string\n {\n return $this->getResponse()->getXInvoiceNum();\n }",
"public function get_order_id_by_order_key($order_key);",
"public function getOrderItemId();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if "uncertainty" has a value | public function hasUncertainty()
{
return isset($this->uncertainty);
} | [
"public function isUnconscious()\n {\n if ($this->msa_alertness->id == 4) {\n return true;\n }\n\n return false;\n }",
"public function hasAccuracyChance()\n {\n return $this->accuracy_chance !== null;\n }",
"public function shouldReportValue(): bool;",
"public function hasHealScalar()\n {\n return $this->heal_scalar !== null;\n }",
"private function isSuppressed($prevOccurance = null)\n {\n if ($prevOccurance && !$prevOccurance['isSuppressed']) {\n // if any instance of this error was not supprssed, reflect that\n return false;\n }\n $errType = $this->values['type'];\n if (($this->subject->getCfg('suppressNever') & $errType) === $errType) {\n // never suppress tyis type\n return false;\n }\n return \\error_reporting() === 0;\n }",
"public function isRequiresValue(): bool;",
"public function testIfInproperReturnsFalse() : void\n {\n\n $this->assertFalse(GeoProgression::has(2, 129));\n }",
"public function isFraudRiskDetected() {\r\n return $this->root->getAttribute('score') == 'negatif';\r\n }",
"public function isCautioned(): bool;",
"public function isRisky(): bool;",
"public function checkValuesAreAllPresent() {\n return empty($this->expectedNotExisting());\n }",
"public function isSexUndefined();",
"function testEvaluateAnyNotEmpty() {\n $warnings = findWarnings($this->warnings, \"1.7\");\n\n $result = evaluateWarning($warnings[0], array('field1' => \"set\", 'field2' => '', 'field3' => ''));\n $this->assertTrue($result);\n }",
"public function isFraudRiskDetected()\r\n\t{\r\n\t\treturn $this->root->getAttribute('score') == 'negatif';\r\n\t}",
"public function hasPercentage(): bool;",
"public function getErroneous()\n {\n return $this->isErroneous;\n }",
"public function getIsFailingAttribute() {\n return $this->grade < 75;\n }",
"public function doesntHaveAlerts()\n {\n return ! $this->hasAlerts();\n }",
"public function isQualityDetectionRequiredButFailing()\n {\n $this->processQualityOptionIfNotAlready();\n return $this->qualityCouldNotBeDetected;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is invoked by the start() method and is responsible for making sure the service mainloop is properly invoked. It will also break when the service is asked to stop. | protected function runservice() {
$this->state = self::STA_STARTED;
// We break this loop manually
$flags = $this->getFlags();
if (is_callable([$this,"serviceinit"])) {
$this->debug("Calling serviceinit()");
$this->serviceinit();
}
while(true) {
$this->servicemain();
pcntl_signal_dispatch();
if ($this->state == self::STA_STOPPING) break;
if (!($flags & self::SVC_RESTART)) break;
if (!($flags & self::SVC_NO_DELAY)) sleep(1);
}
$this->state = self::STA_STOPPED;
} | [
"public function handle_stop() {\n\t\t$this->flag_stop = true;\n\t}",
"private function start()\n\t{\n\t\t$this->serv->start();\n\t}",
"public function stop()\r\n {\r\n $this->logMessage('Stoping daemon');\r\n $this->_isRunning = false;\r\n }",
"private function service__event_loop() {\n\t\t$this->event_base = event_base_new();\n\t\t// Signal handlers\n\t\t$this->event_add( 'SIGCHLD', SIGCHLD, EV_SIGNAL | EV_PERSIST,\n\t\t\t'service__SIGCHLD' );\n\t\t$this->event_add( 'SIGHUP', SIGHUP, EV_SIGNAL | EV_PERSIST,\n\t\t\t'service__SIGHUP' );\n\t\t$this->event_add( 'SIGINT', SIGINT, EV_SIGNAL | EV_PERSIST,\n\t\t\t'service__SIGINT' );\n\t\t$this->event_add( 'SIGTERM', SIGTERM, EV_SIGNAL | EV_PERSIST,\n\t\t\t'service__SIGTERM' );\n\t\t// Socket handlers\n\t\t$this->event_add( 'request', $this->request_socket,\n\t\t\tEV_READ | EV_PERSIST, 'service__accept_request' );\n\t\t$this->event_add( 'offer', $this->offer_socket,\n\t\t\tEV_READ | EV_PERSIST, 'service__accept_offer' );\n\t\t$this->event_add( 'response', $this->response_socket,\n\t\t\tEV_READ | EV_PERSIST, 'service__accept_response' );\n\t\t// Heartbeat\n\t\t$timeout_microseconds = intval( 60e6 / $this->heartbeat_bpm );\n\t\t$this->event_add( 'heartbeat', 0, EV_TIMEOUT | EV_PERSIST,\n\t\t\t'service__heartbeat', $timeout_microseconds );\n\t\t// Initial worker start (run only once)\n\t\t$this->event_add( 'start', 0, EV_TIMEOUT,\n\t\t\t'service__supervise_workers', 1 );\n\t\tevent_base_loop( $this->event_base );\n\t\tif ( ! $this->is_worker ) {\n\t\t\t// Only workers should reach this code.\n\t\t\terror_log( \"Prefork service left event loop\" );\n\t\t\texit(1);\n\t\t}\n\t}",
"public function startService() {\n\t\t$this->updateUnitFiles(\"enable\");\n\t}",
"public function run()\n {\n $concierge = $this->getTelegram();\n\n foreach ($this->instagram as $instagramInstance) {\n $instagramInstance->startService();\n }\n\n $concierge->startService();\n\n $this->loop->run();\n }",
"public function run_service()\n\t{\n\t\t// Check the request is allowed\n\t\tif ($this->_is_api_request_allowed())\n\t\t{\n\t\t\t// Route the API task\n\t\t\t$this->_route_api_task();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Set the response to \"ACCESS DENIED\"\n\t\t\t$this->set_response($this->get_error_msg(006));\n\n\t\t\t// Terminate execution\n\t\t\treturn;\n\t\t}\n\t}",
"abstract public function daemon_loop();",
"public function onKernelTerminate()\n {\n if ($this->container['stopwatch']->isStarted('controllerHandling')) {\n $this->container['stopwatch']->stop('controllerHandling');\n }\n }",
"public static function stop()\n\t{\n\t\tself::$_application->stop();\n\t\tself::$_started = false;\n\t}",
"protected function beforeStop(): void\n {\n }",
"private function _serviceLoop()\n {\n while (true) {\n if (!isset($nextrun)) {\n $first = true;\n $nextrun = self::niceDate()\n ->modify(\n sprintf(\n '+%s second%s',\n self::$zzz,\n self::$zzz != 1 ? '' : 's'\n )\n );\n }\n if (self::niceDate() < $nextrun && $first === false) {\n usleep(100000);\n continue;\n }\n $nextrun = self::niceDate()\n ->modify(\n sprintf(\n '+%s second%s',\n self::$zzz,\n self::$zzz != 1 ? '' : 's'\n )\n );\n $this->waitDbReady();\n $queuedStates = self::fastmerge(\n self::getQueuedStates(),\n (array)self::getProgressState()\n );\n $doneStates = array(\n self::getCompleteState(),\n self::getCancelledState()\n );\n try {\n // Check if status changed.\n self::$_mcOn = self::getSetting('MULTICASTGLOBALENABLED');\n if (self::$_mcOn < 1) {\n throw new Exception(\n _(' * Multicast service is globally disabled')\n );\n }\n $StorageNodes = $this->checkIfNodeMaster();\n foreach ((array)$this->checkIfNodeMaster() as &$StorageNode) {\n $myroot = $StorageNode->get('path');\n $RMTasks = array();\n foreach ((array)$KnownTasks as &$mcTask) {\n $activeCount = self::getClass('TaskManager')\n ->count(\n array(\n 'id' => $mcTask->getTaskIDs(),\n 'stateID' => $queuedStates\n )\n );\n $MultiSess = $mcTask->getSess();\n if ($activeCount < 1\n && ($mcTask->getSessClients() == 0\n || in_array($MultiSess->get('stateID'), $doneStates))\n ) {\n $RMTasks[] = $mcTask;\n }\n unset($mcTask);\n }\n $jobcancelled = false;\n $RMCount = count($RMTasks);\n if ($RMCount > 0) {\n self::outall(\n sprintf(\n \" | %s %d %s%s %s\",\n _('Cleaning'),\n $RMCount,\n _('task'),\n (\n $RMCount != 1 ?\n 's' :\n ''\n ),\n _('as they have been removed')\n )\n );\n foreach ((array)$RMTasks as &$RMTask) {\n $RTask = $this->_getMCExistingTask(\n $KnownTasks,\n $RMTask->getID()\n );\n self::outall(\n sprintf(\n \" | %s (%s) %s %s.\",\n _('Task'),\n $RTask->getID(),\n $RTask->getName(),\n _('is being cleaned')\n )\n );\n $taskIDs = $RMTask->getTaskIDs();\n $inTaskIDs = self::getSubObjectIDs(\n 'Task',\n array(\n 'id' => $taskIDs,\n 'stateID' => self::getCancelledState()\n )\n );\n $MultiSess = $RMTask->getSess();\n $SessCancelled = $MultiSess->get('stateID')\n ==\n self::getCancelledState();\n if ($SessCancelled\n || count($inTaskIDs) > 0\n ) {\n $jobcancelled = true;\n }\n if ($jobcancelled) {\n self::getClass('TaskManager')\n ->update(\n array('id' => $taskIDs),\n '',\n array(\n 'stateID' => self::getCancelledState()\n )\n );\n $MultiSess\n ->set(\n 'stateID',\n self::getCancelledState()\n )->set('name', '')\n ->save();\n self::outall(\n sprintf(\n \" | %s (%s) %s %s.\",\n _('Task'),\n $RMTask->getID(),\n $RMTask->getName(),\n _('has been cancelled')\n )\n );\n } else {\n self::getClass('TaskManager')\n ->update(\n array('id' => $taskIDs),\n '',\n array(\n 'stateID' => self::getCompleteState()\n )\n );\n $MultiSess\n ->set('stateID', self::getCompleteState())\n ->save();\n self::outall(\n sprintf(\n \" | %s (%s) %s %s.\",\n _('Task'),\n $RMTask->getID(),\n $RMTask->getName(),\n _('has been completed')\n )\n );\n }\n $RTask->killTask();\n $KnownTasks = $this->_removeFromKnownList(\n $KnownTasks,\n $RTask->getID()\n );\n self::getClass('MulticastSessionAssociationManager')\n ->destroy(\n array('msID' => $RTask->getID())\n );\n unset($RMTask, $RTask);\n }\n }\n $allTasks = self::getClass('MulticastTask')\n ->getAllMulticastTasks(\n $myroot,\n $StorageNode->get('id')\n );\n $taskCount = count($allTasks);\n if ($taskCount < 1\n || !$taskCount\n ) {\n self::outall(\n sprintf(\n ' * %s!',\n _('No tasks found')\n )\n );\n }\n foreach ((array)$allTasks as &$curTask) {\n $new = $this->_isMCTaskNew(\n $KnownTasks,\n $curTask->getID()\n );\n if ($new) {\n self::outall(\n sprintf(\n \" | %s (%s) %s %s!\",\n _('Task'),\n $curTask->getID(),\n $curTask->getName(),\n _('is new')\n )\n );\n if (!file_exists($curTask->getImagePath())) {\n self::outall(\n sprintf(\n '%s (%s) %s %s, %s: %s %s!',\n _('Task'),\n $curTask->getID(),\n $curTask->getName(),\n _('failed to execute'),\n _('image file'),\n $curTask->getImagePath(),\n _('not found on this node')\n )\n );\n continue;\n }\n if (!$curTask->getClientCount()) {\n self::outall(\n sprintf(\n '%s (%s) %s %s, %s!',\n _('Task'),\n $curTask->getID(),\n $curTask->getName(),\n _('failed to execute'),\n _('no clients are included')\n )\n );\n continue;\n }\n if (!is_numeric($curTask->getPortBase())\n || !($curTask->getPortBase() % 2 == 0)\n ) {\n self::outall(\n sprintf(\n '%s (%s) %s %s, %s!',\n _('Task'),\n $curTask->getID(),\n $curTask->getName(),\n _('failed to execute'),\n _('port must be even and numeric')\n )\n );\n continue;\n }\n if (!$curTask->startTask()) {\n self::outall(\n sprintf(\n \" | %s (%s) %s %s!\",\n _('Task'),\n $curTask->getID(),\n $curTask->getName(),\n _('failed to start')\n )\n );\n $curTask->killTask();\n self::outall(\n sprintf(\n \" %s (%s) %s %s.\",\n _('Task'),\n $curTask->getID(),\n $curTask->getName(),\n _('has been cleaned')\n )\n );\n continue;\n }\n $curTask\n ->getSess()\n ->set('stateID', self::getProgressState())\n ->save();\n self::outall(\n sprintf(\n \" | %s (%s) %s %s.\",\n _('Task'),\n $curTask->getID(),\n $curTask->getImagePath(),\n _('image file found')\n )\n );\n self::outall(\n sprintf(\n \" | %s (%s) %s %d %s%s %s.\",\n _('Task'),\n $curTask->getID(),\n $curTask->getName(),\n $curTask->getClientCount(),\n _('client'),\n (\n $curTask->getClientCount() != 1 ?\n 's' :\n ''\n ),\n _('found')\n )\n );\n self::outall(\n sprintf(\n \" | %s (%s) %s %s: %d.\",\n _('Task'),\n $curTask->getID(),\n $curTask->getName(),\n _('sending on base port'),\n $curTask->getPortBase()\n )\n );\n self::outall(\n sprintf(\n \" | %s: %s\",\n _('Command'),\n $curTask->getCMD()\n )\n );\n self::outall(\n sprintf(\n ' | %s (%s) %s %s!',\n _('Task'),\n $curTask->getID(),\n $curTask->getName(),\n _('has started')\n )\n );\n $KnownTasks[] = $curTask;\n } else {\n $jobcancelled = $jobcompleted = false;\n $runningTask = $this->_getMCExistingTask(\n $KnownTasks,\n $curTask->getID()\n );\n $taskIDs = $runningTask->getTaskIDs();\n $inTaskCancelledIDs = self::getSubObjectIDs(\n 'Task',\n array(\n 'id' => $taskIDs,\n 'stateID' => self::getCancelledState()\n )\n );\n $inTaskIDs = self::getSubObjectIDs(\n 'Task',\n array(\n 'id' => $taskIDs,\n 'stateID' => self::getCompleteState()\n )\n );\n if (count($inTaskIDs) > 0) {\n $jobcompleted = true;\n }\n $MultiSess = $runningTask->getSess();\n $SessCancelled = $MultiSess->get('stateID')\n ==\n self::getCancelledState();\n if ($SessCancelled\n || count($inTaskCancelledIDs) > 0\n ) {\n $jobcancelled = true;\n }\n if ($runningTask->isNamedSession\n && $runningTask->getSessClients() == 0\n ) {\n $jobcompleted = true;\n }\n if (!$jobcompleted\n && !$jobcancelled\n && $runningTask->isRunning($runningTask->procRef)\n ) {\n self::outall(\n sprintf(\n ' | %s (%s) %s %s: %s.',\n _('Task'),\n $runningTask->getID(),\n $runningTask->getName(),\n _('is already running with pid'),\n $runningTask->getPID($runningTask->procRef)\n )\n );\n $runningTask->updateStats();\n } else {\n self::outall(\n sprintf(\n ' | %s (%s) %s %s.',\n _('Task'),\n $runningTask->getID(),\n $runningTask->getName(),\n _('is no longer running')\n )\n );\n if ($jobcancelled) {\n $KnownTasks = $this->_removeFromKnownList(\n $KnownTasks,\n $runningTask->getID()\n );\n if (!$runningTask->killTask()) {\n continue;\n }\n self::outall(\n sprintf(\n ' | %s (%s) %s %s.',\n _('Task'),\n $runningTask->getID(),\n $runningTask->getName(),\n _('has been cancelled')\n )\n );\n $MultiSess->cancel();\n } else {\n $MultiSess\n ->set('clients', 0)\n ->set(\n 'completetime',\n self::niceDate()->format('Y-m-d H:i:s')\n )->set('name', '')\n ->set('stateID', self::getCompleteState())\n ->save();\n $KnownTasks = $this->_removeFromKnownList(\n $KnownTasks,\n $runningTask->getID()\n );\n self::outall(\n sprintf(\n \" | %s (%s) %s %s.\",\n _('Task'),\n $runningTask->getID(),\n $runningTask->getName(),\n _('has been completed')\n )\n );\n }\n }\n }\n unset($curTask);\n }\n unset($StorageNode);\n }\n unset($StorageNodes);\n } catch (Exception $e) {\n self::outall($e->getMessage());\n }\n if ($first) {\n $first = false;\n }\n $tmpTime = self::getSetting(self::$sleeptime);\n if (static::$zzz != $tmpTime) {\n static::$zzz = $tmpTime ? $tmpTime : 10;\n self::outall(\n sprintf(\n ' | %s %s %s.',\n _('Wait time has changed to'),\n static::$zzz,\n (\n static::$zzz != 1 ?\n _('seconds') :\n _('second')\n )\n )\n );\n }\n $oldCount = $taskCount;\n }\n }",
"public function start()\n {\n Loop::run(\\Closure::fromCallable([$this, 'server']));\n }",
"function boot_start($daemon)\n {\n clearos_profile(__METHOD__, __LINE__);\n $this->load->library('base/Daemon', $daemon);\n\n try {\n $this->daemon->set_boot_state(TRUE);\n redirect('/services/');\n } catch (Exception $e) {\n $this->page->view_exception($e);\n return;\n }\n }",
"protected function exitedLoop(): void\n {\n $this->started = false;\n }",
"public function stop()\n {\n $this->loop->stop();\n }",
"public function run()\n {\n if ($this->state !== KernelState::STOPPED) {\n return;\n } elseif (\n $this->panicExceptions !== null &&\n !$this->panicExceptions->isEmpty()\n ) {\n throw $this->panicExceptions->dequeue();\n }\n\n try {\n $this->state = KernelState::RUNNING;\n $this->loop();\n } catch (Throwable $e) {\n $this->throw($e);\n } finally {\n $this->state = KernelState::STOPPED;\n }\n\n if (\n $this->panicExceptions !== null &&\n !$this->panicExceptions->isEmpty()\n ) {\n throw $this->panicExceptions->dequeue();\n }\n }",
"public function stopService() {\n\t\t$this->execTasks(\"delete\");\n\t}",
"public function stop() {\n\n $this->logger->notice(\"Stopping daemon...\");\n\n $this->events->removeAllListeners('daemon.posix.'.SIGCHLD);\n\n $this->socket->close();\n\n $this->workers->stop();\n\n $this->pidlock->release();\n\n $this->is_active = false;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete a single organization by id | public function deleteOrganization($id) {
if (!is_int($id)) {
throw new CakeException(__('Org ID must be an integer. %s was given', gettype($id)));
}
$this->request = array(
'uri' => array(
'path' => $id . '.json'
),
'method' => 'DELETE'
);
return $this->delete($id);
} | [
"public function delete($organization);",
"public function deleteOrgById($id)\n {\n \t$id = (int)$id;\n $this->tableGateway->delete(array('id' => $id));\n }",
"public function deleteOrganizationByID($organization_id)\n { //run the DELETE query from our model(returns true or false)\n $result = $this->OrganizationModel->deleteOrganization($organization_id);\n if ($result) {\n $table_body_data = $this->getAllOrganizationsTable();//return an updated table body\n return $table_body_data;\n } else return NULL;\n }",
"public function delete() {\n\n \t\tif (!$this->user)\n \t\tRouter::redirect('/organizations/index');\n\t\n\t\t# Delete this organization\n\t\t$organization = new Organization();\n \t\t$row = $organization->findInDb($_POST['organization_id']);\n\n \t\t$error = 0;\n\n\t if (isset($row)) {\t\t\n\t \tif ($organization->deleteFromDb ($this->user->user_id)) {\n\t\t\t\t# Send them to the index\n\t\t\t\tRouter::redirect(\"/organizations/index/2\");\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$error = 3;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$error = 3;\n\t\t}\n\n\t\t# Send them back to index\n\t\tRouter::redirect(\"/organizations/index/\".$error);\n\n\t}",
"function delete() {\n\t\t\t global $dbw;\n \n if ($this->organization_id) {\n return $dbw->q(\"DELETE FROM core_organizations WHERE organization_id = \".$this->organization_id); \n } else {\n return false;\n } \n\t\t}",
"public function actionDelete($id){\n //$id=getOrganisationID();\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }",
"public function deleting(Organisation $organisation)\n {\n }",
"public static function deleteForCompany($organisation_id) {\n\t\t$db = DB::Instance();\n\t\t$query = 'DELETE FROM organisation_roles WHERE organisation_id = '.$db->qstr($organisation_id);\n\t\t$db->Execute($query);\n\t}",
"public function testOrganizationIdDelete()\n {\n }",
"public function deleteOrganizationAction(Request $request, Application $app){\n\n }",
"function DeleteOrganiser( $organiser_id ){\n\t}",
"public function testDeleteInvalidOrganization() {\n\t\t//create organization and delete without actually inserting it\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->delete($this->getPDO());\n\t}",
"public function deleteCorporate($id)\n\t{\n try\n {\n $corporate = Corporate::find($id);\n\n if ($corporate)\n $corporate->delete();\n else\n return $this->respHandler->requestError('Corporate not found.');\n\n return $this->respHandler->success('Corporate has been deleted.');\n }\n catch(\\Exception $e)\n {\n return $this->respHandler->requestError($e->getMessage());\n }\n\t}",
"public function deleteMemberAsOrgAdmin(ApiTester $I)\n {\n $id = 2;\n $user_id = 3;\n $I->wantTo('Delete member as an org admin');\n $I->amAuthenticatedAsOrgAdmin();\n $I->haveHttpHeader('Content-Type', 'application/json');\n $I->sendDelete($this->endpoint.\"/$id/people/$user_id\");\n $I->seeResponseCodeIs(200);\n $I->seeResponseIsJson();\n $I->seeResponseContainsJson([\n 'person' => [\n 'id' => 3,\n 'name' => 'Org member'\n ]\n ]);\n }",
"public function deleteById($id) {}",
"static function deleteOrg($org_id) {\n\n // Delete all org files.\n ttOrgHelper::deleteOrgFiles($org_id);\n\n // Go one table at a time and remove all records with matching org_id.\n // The order is backwards to import (see ttOrgImportHelper). Remove groups last.\n // This leaves us with something partially working if an error occurs.\n $mdb2 = getConnection();\n\n $tables = array(\n 'tt_config',\n 'tt_cron',\n 'tt_fav_reports',\n 'tt_templates',\n 'tt_monthly_quotas',\n 'tt_predefined_expenses',\n 'tt_expense_items',\n 'tt_custom_field_log',\n 'tt_custom_field_options',\n 'tt_custom_fields',\n 'tt_log',\n 'tt_invoices',\n 'tt_timesheets',\n 'tt_user_project_binds',\n 'tt_users',\n 'tt_client_project_binds',\n 'tt_clients',\n 'tt_project_task_binds',\n 'tt_projects',\n 'tt_tasks',\n 'tt_roles',\n 'tt_groups'\n );\n foreach($tables as $table) {\n $sql = \"delete from $table where org_id = $org_id\";\n $affected = $mdb2->exec($sql);\n if (is_a($affected, 'PEAR_Error')) return false;\n }\n return true; }",
"public function delete_opportunity($organization_id, $opp_id){\n $x = CHController::getModel('organization')->add('DELETE FROM volunteer_opportunities WHERE organization_id = :organization_id AND id = :opp_id', array(':organization_id' => $organization_id, ':opp_id' => $opp_id));\n }",
"public function testValidDelete() {\n\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//perform the actual delete\n\t\t$response = $this->guzzle->delete('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . $organization->getOrgId(),\n\t\t\t\t['headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t// grab the data from guzzle and enforce that the status codes are correct\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//try retrieving entry from database and ensuring it was deleted\n\t\t$deletedOrg = Organization::getOrganizationByOrgId($this->getPDO(), $organization->getOrgId());\n\t\t$this->assertNull($deletedOrg);\n\n\t}",
"function _forschungsatlas_delete_orgtype($otid) {\n db_delete('forschungsatlas__organization_type')\n ->condition('otid', $otid)\n ->execute();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if footer reveal is enabled | function wpex_footer_has_reveal( $post_id = '' ) {
// Disable here always
if ( ! wpex_has_footer()
|| 'boxed' == wpex_site_layout()
|| 'six' == wpex_header_style()
|| wpex_vc_is_inline()
) {
return false;
}
// Check customizer setting
$bool = wpex_get_mod( 'footer_reveal', false );
// Get current post id if not set
$post_id = $post_id ? $post_id : wpex_get_current_post_id();
// Check page settings
if ( $post_id && $meta = get_post_meta( $post_id, 'wpex_footer_reveal', true ) ) {
if ( 'on' == $meta ) {
$bool = true;
} elseif ( 'off' == $meta ) {
$bool = false;
}
}
// Apply filters and return
return apply_filters( 'wpex_has_footer_reveal', $bool );
} | [
"public function hasFooter();",
"function zuhaus_mikado_show_footer_bottom() {\n\t\t$footer_bottom_flag = false;\n\t\t\n\t\t//check value from options and meta field on current page\n\t\t$option_flag = ( zuhaus_mikado_get_meta_field_intersect( 'show_footer_bottom' ) === 'yes' ) ? true : false;\n\t\t\n\t\t//check footer columns.If they are empty, disable footer bottom\n\t\t$columns_flag = false;\n\t\tfor ( $i = 1; $i <= 3; $i ++ ) {\n\t\t\t$footer_columns_id = 'footer_bottom_column_' . $i;\n\t\t\tif ( is_active_sidebar( $footer_columns_id ) ) {\n\t\t\t\t$columns_flag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $option_flag && $columns_flag ) {\n\t\t\t$footer_bottom_flag = true;\n\t\t}\n\t\t\n\t\treturn $footer_bottom_flag;\n\t}",
"public function showFooter()\n {\n // Overridden by permissions\n if (!$this->checkPermission('footer')) {\n return false;\n }\n\n // Overridden by conditionals\n if (!$this->isObjDeletable() && !$this->isObjResettable() &&!$this->isObjRevisionable()) {\n return false;\n }\n\n return $this->showFooter;\n }",
"function pintsandcrafts_edge_show_footer_bottom() {\n\t\t$footer_bottom_flag = false;\n\t\t\n\t\t//check value from options and meta field on current page\n\t\t$option_flag = ( pintsandcrafts_edge_get_meta_field_intersect( 'show_footer_bottom' ) === 'yes' ) ? true : false;\n\t\t\n\t\t//check footer columns.If they are empty, disable footer bottom\n\t\t$columns_flag = false;\n\t\tfor ( $i = 1; $i <= 2; $i ++ ) {\n\t\t\t$footer_columns_id = 'footer_bottom_column_' . $i;\n\t\t\tif ( is_active_sidebar( $footer_columns_id ) ) {\n\t\t\t\t$columns_flag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $option_flag && $columns_flag ) {\n\t\t\t$footer_bottom_flag = true;\n\t\t}\n\t\t\n\t\treturn $footer_bottom_flag;\n\t}",
"public function is_in_footer()\n {\n }",
"public function isFooterEnable()\r\n\t{\r\n\t\treturn $this->footerEnable;\r\n\t}",
"public function isFooter()\n {\n return false;\n }",
"function highend_is_pre_footer_displayed() {\n\n\t\t// Default setting from options panel.\n\t\t$displayed = hb_options( 'hb_enable_pre_footer_area' );\n\n\t\t// Individual post/page setting.\n\t\tif ( is_singular() ) {\n\t\t\tif ( 'show' === vp_metabox( 'layout_settings.hb_pre_footer_callout' ) ) {\n\t\t\t\t$displayed = true;\n\t\t\t} elseif ( 'hide' === vp_metabox( 'layout_settings.hb_pre_footer_callout' ) ) {\n\t\t\t\t$displayed = false;\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'highend_is_pre_footer_displayed', $displayed );\n\t}",
"public function isInFooter()\n {\n return $this->inFooter;\n }",
"public function showFooter() {\n\t\t$this->_showFooter = true;\n }",
"function ForBlogs_is_post_card_body_footer() {\n\t$setting = get_theme_mod( 'post_card_show_body_footer' );\n\tif ( ! ForBlogs_toggle_check( $setting ) ) {\n\t\treturn false;\n\t}\n\treturn true;\n}",
"function overlap_show_footer_bar(){\r\n\r\n $page_id = overlap_get_current_page();\r\n\r\n $footer_bar = get_post_meta( overlap_get_current_page(), '_w_page_footer', true ) != 'hide'; \r\n\r\n if( $footer_bar ) $footer_bar = overlap_get_option('footer_bar'); \r\n\r\n return $footer_bar;\r\n}",
"public function hasFooterInfo(): bool\n {\n return vscf_message_info_has_footer_info_php($this->ctx);\n }",
"public function isFooterFourActive()\n {\n return is_active_sidebar('footer-four');\n }",
"public function hasFooterHtml()\n {\n return !empty($this->footerHtml);\n }",
"function codeless_show_footer(){ \n ?>\n <div id=\"footer-wrapper\" class=\"<?php echo esc_attr( codeless_extra_classes( 'footer_wrapper' ) ) ?>\"> \n <?php\n if( codeless_get_mod( 'show_footer', true ) )\n get_template_part( 'template-parts/footer/main' );\n if( codeless_get_mod( 'show_copyright', true ) )\n get_template_part( 'template-parts/footer/copyright' );\n ?>\n </div><!-- #footer-wrapper -->\n <?php\n}",
"public function footerHidden()\n\t\t{\n\t\t\treturn $this->_footer;\n\t\t}",
"function zuhaus_mikado_show_footer_top() {\n\t\t$footer_top_flag = false;\n\t\t\n\t\t//check value from options and meta field on current page\n\t\t$option_flag = ( zuhaus_mikado_get_meta_field_intersect( 'show_footer_top' ) === 'yes' ) ? true : false;\n\t\t\n\t\t//check footer columns.If they are empty, disable footer top\n\t\t$columns_flag = false;\n\t\tfor ( $i = 1; $i <= 4; $i ++ ) {\n\t\t\t$footer_columns_id = 'footer_top_column_' . $i;\n\t\t\tif ( is_active_sidebar( $footer_columns_id ) ) {\n\t\t\t\t$columns_flag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $option_flag && $columns_flag ) {\n\t\t\t$footer_top_flag = true;\n\t\t}\n\t\t\n\t\treturn $footer_top_flag;\n\t}",
"public function hasFooter() : bool\n {\n return strlen($this->footer)>0;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the cache object used by this instance. On first call will initialize and configure it. | public function get_cache() {
if ( is_null( $this->_cache ) ) {
$this->_cache = new Caching\ImageCache();
$this->_cache->set_ttl( $this->get_cache_ttl() );
$this->_cache->set_download_request_timeout( $this->get_cache_download_request_timeout() );
$this->_cache->set_cache_orig_filename_length( $this->get_cache_orig_filename_length() );
}
return $this->_cache;
} | [
"public function getCacheInstance(){\n return $this->cacheInstance;\n }",
"public static function getInstance() {\r\n\t\treturn parent::getInstance(Cache::CACHE_TYPE);\r\n\t}",
"public function getCacheObject()\n {\n return $this->cacheObject;\n }",
"public static function instance()\n {\n if ( !is_subclass_of(self::$_cacheInstance,'SugarCacheAbstract') )\n self::_init();\n\n return self::$_cacheInstance;\n }",
"public function cache()\n {\n if ($this->cache) {\n return $this->cache;\n }\n\n // If the developer has requested a particular store, we'll use it.\n // If the config value is null, the default cache will be used.\n return Cache::store($this->config('cache'));\n }",
"public static function cache()\r\n {\r\n return \\Cache::getInstance();\r\n }",
"protected function _getCache() {\n if($this->_cache === null) {\n $this->_cache = false;\n $options = Mage::getConfig()->getNode('global/cache');\n $options = $options ? $options->asArray() : [];\n\n\n if (isset($options['backend'])) {\n switch($options['backend']) {\n case 'Cm_Cache_Backend_Redis':\n $this->_cache = new Uaudio_Storage_Model_Storage_Cache_Redis();\n $this->_cache->setAutosave(false);\n }\n }\n }\n return $this->_cache;\n }",
"private function _get_cache() {\n\t\treturn $this->_cache;\n\t}",
"protected function getCache() {\n if ($this->cache === NULL) {\n $this->cache = new DiskCache($this->cacheFolder(), $this->cacheLifetime, TRUE);\n $this->cache->setSuffix('.cache');\n $this->cache->preserveFormat();\n }\n \n return $this->cache;\n }",
"public static function getInstance()\n\t\t{\n\t\t\tif ( NULL === self::$instance )\n\t\t\t{\n\t\t\t\tself::$instance = new Cache;\n\t\t\t}\n\t\t\treturn self::$instance;\n\t\t}",
"private function createObjectCache() {\n\t\treturn new Drivers\\Object_Cache;\n\t}",
"public function _cache() {\n list($type, $host, $port, $compress) = @explode(':', SQ_TEMPLATE_CACHE_TYPE) + array(null, null, null, null);\n $cache = new DALMP_Cache($type);\n return $cache->host($host)->port($port)->compress($compress);\n }",
"public function select()\n {\n if (extension_loaded('apc') && ini_get(\"apc.enabled\") && @apc_cache_info()) {\n return new APCCache;\n }\n\n return new MemoryCache;\n }",
"public static function instance() {\n if (self::$instance === null)\n self::$instance = new CacheManager();\n return self::$instance;\n }",
"protected function getCache(): CacheInterface\n {\n return $this->t3faCache;\n }",
"static function getCache() {\n\t\tglobal $wgSessionCacheType;\n\t\treturn ObjectCache::getInstance( $wgSessionCacheType );\n\t}",
"public static function getCache()\n {\n return self::getComponent('cache');\n }",
"protected static function getCache(){\n\t\t$cname = get_called_class();\n\t\tif(!isset(self::$_CACHE->{$cname})){\n\t\t\t$obj = self::$_CACHE->{$cname} = new stdClass;\n\t\t\t$obj->OBJ = array();\n\t\t\t$obj->SQL = array();\n\t\t}\n\t\treturn self::$_CACHE->{$cname};\n\t}",
"function getCache()\n {\n return $cache = $this->_settings( false )->getCache( $this->who );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Includes the templates specified in base template. | protected static function includeTemplates() : self
{
$matches = [];
preg_match_all('/\{\@(.*?)\}/', self::$content, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$path = self::$directoryPath . "/{$match[1]}";
if (is_file($path)) {
$template = self::minify(file_get_contents($path));
self::$content = preg_replace('/' . preg_quote($match[0], '/') . '/', $template, self::$content);
}
}
return self::$instance;
} | [
"protected function load_templates ()\n {\n // @TODO\n }",
"public function extend($template);",
"protected function add_extends_locations()\n {\n $CI = get_instance();\n $CI->load->helper('directory');\n\n // The views path\n $base_path = APPPATH.\"views/\";\n\n $map = directory_map(APPPATH.\"views\", 1);\n\n // Blank array for our found folders\n $folders = array();\n\n if ($map !== false)\n { \n foreach ($map AS $key => $name)\n { \n $name = strtolower(trim($name));\n \n // Ignore files\n if ( !stripos($name, \".\") )\n { \n $folders[] = $base_path.$name;\n }\n }\n\n // Yarr, we got a map lets find the treasure\n if (!empty($folders))\n {\n $this->addTemplateDir($folders);\n }\n\n }\n }",
"public function append_templates() {\r\n\r\n\t\t\tadd_action( 'admin_footer', [ $this, 'filters' ] );\r\n\r\n\t\t\tforeach ( $this->templates() as $t ) {\r\n\t\t\t\t\r\n\t\t\t\t$data = [];\r\n\t\t\t\t$data['name'] = $t['f'];\r\n\t\t\t\t$data['custom_class'] = $t['f'];\r\n\t\t\t\t$data['content'] = $t['c'] . '[vc_row][vc_column][cz_gap height=\"100px\"][/vc_column][/vc_row]';\r\n\r\n\t\t\t\tvc_add_default_templates( $data );\r\n\t\t\t}\r\n\r\n\t\t}",
"function bp_template_include( $template = '' ) {\n\treturn apply_filters( 'bp_template_include', $template );\n}",
"public function include_template_functions() {\n\t\tinclude_once( 'includes/class-gmw-ps-template-functions-helper.php' );\n\t\tinclude_once( 'includes/gmw-ps-search-form-template-functions.php' );\n\t\tinclude_once( 'includes/gmw-ps-search-results-template-functions.php' );\n\t}",
"public function _include($template_name, $global_vars=array()) // include\n {}",
"private function includeAtTemplateBase($file)\n {\n $data = $this->data;\n\n $filename = $this->findTemplatePath($file);\n\n include($filename);\n }",
"public function custom_template($templates){\n\t\t$templates = array_merge($templates, $this->templates);\n\n\t\treturn $templates;\n\t}",
"public function add_template_vars( )\n\t{\n\t\t$user_formcontrols = glob( dirname( __FILE__ ) . '/*.formcontrol.php' );\n\t\tforeach ( $user_formcontrols as $file ) {\n\t\t\t$name = substr( $file, strrpos( $file, '/' ) + 1, -1 * strlen( '.formcontrol.php' ) );\n\t\t\t$this->add_template( $this->name . '_' . $name, $file );\n\t\t}\n\t\tparent::add_template_vars( );\n\t}",
"public function inject_autocomplete_templates() {\n\n\t\t$templates = array(\n\t\t\t'header' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-header.php',\n\t\t\t'post-suggestion' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-post-suggestion.php',\n\t\t\t'term-suggestion' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-term-suggestion.php',\n\t\t\t'user-suggestion' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-user-suggestion.php',\n\t\t\t'footer' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-footer.php',\n\t\t\t'empty' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-empty.php',\n\t\t);\n\n\t\t$templates = (array) apply_filters( 'algolia_autocomplete_templates', $templates );\n\n\t\tforeach ( $templates as $name => $file ) {\n\t\t\trequire_once $file;\n\t\t}\n\t}",
"public function init_templates() {\n //Load templates file\n require_once ( PREMIUM_ADDONS_PATH . 'includes/templates/templates.php');\n }",
"public function get_base_template_file() {\n\t\t// Print the lookup folders as relative paths.\n\t\t$this->set(\n\t\t\t'lookup_folders',\n\t\t\tarray_map(\n\t\t\t\tstatic function ( array $folder ) {\n\t\t\t\t\t$folder['path'] = str_replace( WP_CONTENT_DIR, '', $folder['path'] );\n\t\t\t\t\t$folder['path'] = str_replace( WP_PLUGIN_DIR, '/plugins', $folder['path'] );\n\t\t\t\t\treturn $folder;\n\t\t\t\t},\n\t\t\t\t$this->get_template_path_list()\n\t\t\t),\n\t\t\tfalse\n\t\t);\n\n\t\tif ( $this->view instanceof View_Interface ) {\n\t\t\t$this->set( 'view_slug', $this->view->get_slug(), false );\n\t\t\t$this->set( 'view_label', $this->view->get_label(), false );\n\t\t\t$this->set( 'view_class', get_class( $this->view ), false );\n\t\t}\n\n\t\treturn parent::get_template_file( 'base' );\n\t}",
"function _include( $template, $format=false, $dir=false )\n{\n // nu_debug( 'Particle Template Include', array( 'dir'=>$dir, 'format'=>$format ) );\n\n $template = apply_filters( 'particle_template_include', $template );\n\n // if not specificed set to the partials directory (relative to the theme top dir level)\n if( false === $dir )\n $dir = 'app/includes/';\n\n $templates = array();\n if( $format )\n $templates[] = trailingslashit( $dir ) . \"$template-$format.inc\";\n\n $templates[] = trailingslashit( $dir ) . \"$template.inc\";\n\n $located = locate_template( $templates, true, false );\n\n if( !$located ) {\n $msg = implode( ', ', $templates );\n echo \"Failed to load the following template(s): $msg\";\n }\n\n return $located;\n}",
"public function inheritance()\n {\n // Some example data\n $data['title'] = \"The Smarty parser works with template inheritance!\";\n $data['body'] = \"This is body text to show that Smarty 3 template inheritance works with Smarty Parser.\";\n \n // Load the template from the views directory\n $this->parser->parse(\"inheritancetest.tpl\", $data);\n \n }",
"public function template_include($template) {\n\t\tglobal $wp_query;\n\n\t\t// Empty for now\n\t\t$new_template = '';\n\n\t\t// if ( array_key_exists('listingdetails', $wp_query->query_vars) ) {\n\t\t// \tvar_dump($wp_query->query_vars);\n\t\t// }\n\n\t\t// If we are on http://site.com/listings/\n\t\tif ( array_key_exists('bcoreidx', $wp_query->query_vars) ) {\n\t\t\tswitch ($wp_query->query_vars['bcoreidx']) {\n\n\t\t\t\tcase 'listings' :\n\t\t\t\t\t$new_template = BCORE_IDX_PLUGIN_DIRECTORY . '/templates/listings.php';\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif ($new_template != '') {\n\t\t\t\treturn $new_template;\n\t\t\t\t\n\t\t\t} else {\n\n\t\t\t\t// This is not a valid bcoreidx value, so set the header and template\n\t\t\t\t// for a 404 page.\n\t\t\t\t$wp_query->set_404();\n\t\t\t\tstatus_header(404);\n\t\t\t\treturn get_404_template();\n\t\t\t}\n\t\t}\n\n\t\treturn $template;\n\t}",
"public function filter_template_include( string $template ) {\n\n\t\t\t/**\n\t\t\t * Filter for determining which template to use when a Nomad\n\t\t\t * Virtual Page is being loaded.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t *\n\t\t\t * @param string $template The template to be used.\n\t\t\t */\n\t\t\t$template = apply_filters( 'nomad/virtual_pages/template', $template );\n\n\t\t\treturn $template;\n\n\t\t}",
"private function _fillAdditionalTemplateData()\n {\n $this->data(\n 'templates',\n get_templates(base_path('resources/themes/'.config('app.theme').'/widgets/banner/templates'))\n );\n }",
"function headers_include($default_path=true){\n\t\tif($default_path==true){\n\t\t\t$path = TEMPLATE_PATH;\n\t\t} else {\n\t\t\t$path = ROOT_PATH;\n\t\t}\t\n\t\tforeach($this->headers as $header){\n\t\t\techo $header;\n\t\t}\n\t\t/*foreach($this->headers as $header){\n\t\t\tinclude $path.'/'.$header;\n\t\t}*/\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assigns the user with $user_id to every orgunit where theres a supervisor with the lastname $last_name | protected function assignUserToLastName($last_name, $user_id) {
foreach($this->getUserIdsByLastName($last_name) as $superior_id) {
$this->assignUserToSupervisor($superior_id, $user_id);
}
} | [
"function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }",
"public static function assign_user($targetitemid, $assigneeid, $assignerid) {}",
"function add_users_to_team() {\n\t\t$this->_team->retrieve(\"West\");\n\t\t$this->_team->add_user_to_team($this->guids['sarah']);\n\t\t$this->_team->add_user_to_team($this->guids['sally']);\n\t\t$this->_team->add_user_to_team($this->guids[\"max\"]);\n\n\t\t// Create the east team memberships\n\t\t$this->_team->retrieve(\"East\");\n\t\t$this->_team->add_user_to_team($this->guids[\"will\"]);\n\t\t$this->_team->add_user_to_team($this->guids['chris']);\n\t}",
"private function setCreatedBy($user_id) {\n if ($this->err->yes()) return false; // There are errors, do not proceed.\n\n global $i18n;\n $mdb2 = getConnection();\n\n // Update group.\n $sql = \"update tt_groups set created_by = $user_id where id = $this->group_id and org_id = $this->org_id\";\n $affected = $mdb2->exec($sql);\n if (is_a($affected, 'PEAR_Error')) {\n $this->err->add($i18n->get('error.db'));\n return false;\n }\n\n // Update top manager.\n $sql = \"update tt_users set created_by = $user_id where id = $this->user_id and group_id = $this->group_id and org_id = $this->org_id\";\n $affected = $mdb2->exec($sql);\n if (is_a($affected, 'PEAR_Error')) {\n $this->err->add($i18n->get('error.db'));\n return false;\n }\n\n return true;\n }",
"function userorg_assign_to_user( & $User )\r\n\t{\r\n\t\tif( empty( $User->ID ) || empty( $this->userorgs ) )\r\n\t\t{\t// User must be created and organizations should be added\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Get current user organization to don't lose them:\r\n\t\t$curr_orgs = $User->get_organizations_data();\r\n\t\t$orgs = array();\r\n\t\tforeach( $curr_orgs as $curr_org_ID => $curr_org )\r\n\t\t{\t// Keep current organizations:\r\n\t\t\t$orgs[ $curr_org_ID ] = $curr_org['role'];\r\n\t\t}\r\n\t\tforeach( $this->userorgs as $org_ID => $org_role )\r\n\t\t{\t// Update current organizations with new:\r\n\t\t\t// NOTE: Role will be updated to new value ONLY when organization is NOT accepted yet because of perm restriction\r\n\t\t\t$orgs[ $org_ID ] = $org_role;\r\n\t\t}\r\n\t\t$org_IDs = array();\r\n\t\t$org_roles = array();\r\n\t\tforeach( $orgs as $org_ID => $org_role )\r\n\t\t{\t// Initialize arrays to update the organizations:\r\n\t\t\t$org_IDs[] = $org_ID;\r\n\t\t\t$org_roles[] = $org_role;\r\n\t\t}\r\n\r\n\t\t// Update user's organizations in DB:\r\n\t\t$User->update_organizations( $org_IDs, $org_roles, true );\r\n\r\n\t\t// Unset this array after updating:\r\n\t\tunset( $this->userorgs );\r\n\t}",
"function assign_user()\n\t{\n\t\tglobal $current_user;\n\t\t$ass_user = $this->column_fields[\"assigned_user_id\"];\t\t\n\t\tif( $ass_user != $current_user->id)\n\t\t{\n\t\t\t$result = $this->db->query(\"select id from ec_users where user_name = '\".$ass_user.\"'\");\n\t\t\tif($this->db->num_rows($result)!=1)\n\t\t\t{\n\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\n\t\t\t\t$row = $this->db->fetchByAssoc($result, -1, false);\n\t\t\t\tif (isset($row['id']) && $row['id'] != -1)\n \t {\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $row['id'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function modify_user( $str_user_id, $str_first_name, $str_last_name, $int_student_number )\n\t{\n\t\t$str_sql_query = null;\n\t\t$res_check_if_exists = null;\n\t\t$str_this_user = $this->m_obj_user->str_username;\n\t\t$bln_success = true;\n\n\t\tswitch ( $this->m_obj_user->int_privilege )\n\t\t{\t\t\t\t \n\t\t\tcase UP_TA:\n\t\t\tcase UP_PROFESSOR:\n\t\t\tcase UP_ADMINISTRATOR:\n \t\t\t{\n\t\t\t\t$str_sql_query = \"BEGIN\";\n\n\t\t\t\tif ( !$this->m_obj_db->query_commit( $str_sql_query ) )\n\t\t\t\t{\n\t\t\t\t\t$bln_success = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$res_check_if_exists = $this->view_user( $str_user_id );\n\n\t\t\t\tif ( $res_check_if_exists == null )\n\t\t\t\t{\n\t\t\t\t\t$str_sql_query = null;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( $res_check_if_exists == false )\n\t\t\t\t{\n\t\t\t\t\t$bln_success = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( $this->m_obj_db->get_number_of_rows( $res_check_if_exists ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$str_sql_query = \"UPDATE User \"\n\t\t\t\t\t\t\t\t . \"SET FirstName = '\". $this->m_obj_db->format_sql_string( $str_first_name ) .\"', \"\n\t\t\t\t\t\t\t\t . \"LastName = '\". $this->m_obj_db->format_sql_string( $str_last_name ) . \"', \"\n\t\t\t\t\t\t\t\t . \"StudentNum = \". $this->m_obj_db->format_sql_string( $int_student_number ) . \" \"\n\t\t\t\t\t\t\t\t . \"WHERE UserId = '\" . $this->m_obj_db->format_sql_string( $str_user_id ) . \"'\";\n\n\t\t\t\t\tif ( !$this->m_obj_db->query_commit( $str_sql_query ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$bln_success = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$str_sql_query = \"COMMIT\";\n\n\t\t\t\t\tif ( !$this->m_obj_db->query_commit( $str_sql_query ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$bln_success = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$str_sql_query = \"ROLLBACK\";\n\n\t\t\t\t\tif ( !$this->m_obj_db->query_commit( $str_sql_query ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$bln_success = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tLog::write_log_with_ip( LOG_TRANSACTION, $str_this_user . \" does not have permission to modify \" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_user_id ) . \" with \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_first_name ) . \" \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_last_name ) . \" \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $int_student_number ) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . \" or user \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_user_id ) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . \" does not exist\" ); \n\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( $str_this_user == null )\n\t\t{\n\t\t\t$str_this_user = \"<user did not login>\";\n\t\t}\n\n\t\tif ( $str_sql_query == null )\n\t\t{\n\t\t\t$this->m_obj_db->query_commit( \"ROLLBACK\" );\n\t\t\tLog::write_log_with_ip( LOG_TRANSACTION, $str_this_user . \" attempted to modify user \" \n\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_user_id ) . \" with \"\n\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_first_name ) . \" \"\n\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_last_name ) . \" \"\n\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $int_student_number ) );\n\t\t\treturn false;\n\t\t}\n \n\t\tif ( !$bln_success )\n\t\t{\n\t\t\t$this->m_obj_db->query_commit( \"ROLLBACK\" );\n\t\t\tLog::write_log_with_ip( LOG_TRANSACTION, $str_this_user . \" failed to modify user \" \n\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_user_id ) . \" with \"\n\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_first_name ) . \" \"\n\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_last_name ) . \" \"\n\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $int_student_number ) \n\t\t\t\t\t\t\t\t\t\t\t\t . \" due to database error\" );\n\t\t\treturn false;\n\t\t}\n\n\t\tLog::write_log_with_ip( LOG_TRANSACTION, $str_this_user . \" modified user \" \n\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_user_id ) . \" with \"\n\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_first_name ) . \" \"\n\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_last_name ) . \" \"\n\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $int_student_number ) );\n\t\treturn true;\n\t}",
"function assign_user()\n\t{\n\t\tglobal $current_user;\n\t\t$ass_user = $this->column_fields[\"assigned_user_id\"];\n\n\t\tif( $ass_user != $current_user->id)\n\t\t{\n\t\t\t$result = $this->db->query(\"select id from ec_users where user_name = '\".$ass_user.\"'\");\n\t\t\tif($this->db->num_rows($result)!=1)\n\t\t\t{\n\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n\t\t\t\t$row = $this->db->fetchByAssoc($result, -1, false);\n\t\t\t\tif (isset($row['id']) && $row['id'] != -1)\n \t {\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $row['id'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function jx_save_assign_user() {\n $user=$this->erpm->auth(ADMINISTRATOR_ROLE,true);\n $this->erpm->do_save_assign_user($user);\n }",
"public function setLastName($user_lname) {\n\t\t$this->_userLname = $user_lname;\n\t}",
"function assign_user()\n\t{\n\t\tglobal $current_user;\n\t\t$ass_user = $this->column_fields[\"assigned_user_id\"];\n\t\t$this->db->println(\"assign_user \".$ass_user.\" cur_user=\".$current_user->id);\n\t\t\n\t\tif( $ass_user != $current_user->id)\n\t\t{\n\t\t\t$this->db->println(\"searching and assigning \".$ass_user);\n\n\t\t\t//$result = $this->db->query(\"select id from ec_users where user_name = '\".$ass_user.\"'\");\n\t\t\t$result = $this->db->query(\"select id from ec_users where id = '\".$ass_user.\"'\");\n\t\t\tif($this->db->num_rows($result)!=1)\n\t\t\t{\n\t\t\t\t$this->db->println(\"not exact records setting current userid\");\n\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\n\t\t\t\t$row = $this->db->fetchByAssoc($result, -1, false);\n\t\t\t\tif (isset($row['id']) && $row['id'] != -1)\n \t \t{\n\t\t\t\t\t$this->db->println(\"setting id as \".$row['id']);\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $row['id'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->db->println(\"setting current userid\");\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function assignUser(int $taskId, int $userId): void;",
"function os2intra_user_import_add_managers_to_departments($form, &$form_state) {\n if (is_array($form['#term'])) {\n $department = entity_metadata_wrapper('taxonomy_term', $form['#term']['tid']);\n\n // Get department children\n $department_children = taxonomy_get_tree(16, $department->tid->value());\n\n // Get department managers\n foreach ($department->field_os2intra_manager_id->getIterator() as $user) {\n $manager_uids[] = $user->uid->value();\n }\n\n // Add user to their primary department and give them the 'manager' role\n if (!empty($manager_uids)) {\n foreach ($manager_uids as $manager_uid) {\n if (!in_array($manager_uid, $department->field_os2intra_manager_id->raw())) {\n $department->field_os2intra_manager_id[] = $manager_uid;\n }\n $account = user_load($manager_uid);\n // Add user to their primary department and give them the 'manager' role\n $values = array(\n 'entity' => $account,\n 'field_name' => variable_get('os2intra_user_department_field'),\n );\n if (!empty($department->field_os2intra_department_id->value())) {\n $department_nid = _os2intra_user_import_get_department_nid($department->field_os2intra_department_id->value());\n if ($department_nid) {\n og_group('node', $department_nid, $values);\n og_role_grant('node', $department_nid, $account->uid, variable_get('os2intra_user_import_og_role_id_manager', 15));\n }\n }\n }\n }\n\n $department->save();\n\n // Do the same thing for children departments\n foreach ($department_children as $child) {\n $child = entity_metadata_wrapper('taxonomy_term', $child->tid);\n\n if (!empty($manager_uids)) {\n foreach ($manager_uids as $manager_uid) {\n if (!in_array($manager_uid, $child->field_os2intra_manager_id->raw())) {\n $child->field_os2intra_manager_id[] = $manager_uid;\n }\n $account = user_load($manager_uid);\n // Add user to their primary department and give them the 'manager' role\n $values = array(\n 'entity' => $account,\n 'field_name' => variable_get('os2intra_user_department_field'),\n );\n if (!empty($child->field_os2intra_department_id->value())) {\n $department_nid = _os2intra_user_import_get_department_nid($child->field_os2intra_department_id->value());\n if ($department_nid) {\n og_group('node', $department_nid, $values);\n og_role_grant('node', $department_nid, $account->uid, variable_get('os2intra_user_import_og_role_id_manager', 15));\n }\n }\n }\n }\n\n $child->save();\n }\n }\n}",
"public function setLastname($lastname) {\n $this->userdetails['lastname'] = $lastname;\n // update into database\n }",
"function assignAllToNewUser($user_id){\n \n $surveys = $this->db->get('survey');\n \n if($surveys->num_rows()>0){\n \n foreach($surveys->result() as $survey){\n $this->db->insert('user_survey',array(\n 'user_id'=>$user_id,\n 'survey_id'=>$survey->id,\n 'status'=>'PENDING',\n 'created_on'=>date(\"Y-m-d H:i:s\")\n ));\n \n }\n \n }\n \n }",
"protected function assignUser() {\n if($this->error) { return; }\n\n $_SESSION[SESS]['user'] = $this->user['id'];\n }",
"public function assignLandlordRole($user)\n {\n $role = $this->auth->findRoleById(3);\n $role->users()->attach($user);\n }",
"public function saveUserFirstSecondLastNames($user_id,$firstname, $secondname, $lastname) {\n try {\n $stm=$this->uFunc->pdo('uAuth')->prepare('UPDATE \n u235_users\n SET\n firstname=:firstname,\n secondname=:secondname,\n lastname=:lastname\n WHERE\n user_id=:user_id\n ');\n $stm->bindParam(':firstname', $firstname,PDO::PARAM_STR);\n $stm->bindParam(':secondname', $secondname,PDO::PARAM_STR);\n $stm->bindParam(':lastname', $lastname,PDO::PARAM_STR);\n $stm->bindParam(':user_id', $user_id,PDO::PARAM_INT);\n $stm->execute();\n }\n catch(PDOException $e) {$this->uFunc->error('1587216107'/*.$e->getMessage()*/,1);}\n }",
"public function addMember($data) {\n $orgId = loginOrg();\n //check first if this user has already have account in system\n $check = $this->cimongo\n ->select(array('_id', 'organization'))\n ->get_where(self::USERS_TABLE, array('username' => $data['username']))\n ->row_array();\n\n //main organization\n $newOrganization = array(\n 'id' => $orgId,\n 'role' => $data['role'],\n 'main' => 0\n );\n\n //if empty, means not yet created\n if(empty($check)) {\n //pass this, we need it later\n $role = $data['role'];\n //now we need to create user first\n $data = array(\n 'username' => $data['username'],\n 'password' => md5('password'), //default\n 'first_name' => $data['first_name'],\n 'last_name' => $data['last_name'],\n 'name' => $data['first_name'].' '.$data['last_name'],\n 'date_created' => strtotime('now'),\n 'date_updated' => strtotime('now'),\n 'status' => 1,\n //mark as pending user, need confirmation\n 'active' => 0,\n //organization listing\n 'organization' => array($newOrganization)\n );\n\n //add user\n $this->cimongo->insert(self::USERS_TABLE, $data);\n\n //get insert id\n $object = $this->cimongo->insert_id();\n $userId = $object->{'$id'};\n \n //send email as create account\n $this->sendInvitation($data, $orgId, $userId, 1);\n\n //else user alread have account\n } else {\n //get user id\n $userId = $check['_id']->{'$id'};\n //and update the user for the current organization\n $check['organization'][] = $newOrganization;\n //unset\n unset($check['_id']);\n\n $this->cimongo\n ->where(array('_id' => new MongoId($userId)))\n ->update(self::USERS_TABLE, $check);\n //send email as invitation \n $this->sendInvitation($data, $orgId,$userId, 2);\n }\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" > "Shoes"] and ["Sports & Fitness" > "Athletic Clothing" > "Shoes"], it could be represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > Athletic Clothing > Shoes" ] Must be set for [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product] otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per [Product][google.cloud.retail.v2.Product]. Empty values are not allowed. Each value must be a UTF8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [google_product_category][mc_google_product_category]. Schema.org property [Product.category] ( [mc_google_product_category]: Generated from protobuf field repeated string categories = 7; | public function setCategories($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->categories = $arr;
return $this;
} | [
"public function product_categories()\n\t{\n\t\treturn AutoModeler_ORM::factory('vendo_product_category')->full_tree(\n\t\t\tNULL, TRUE, $this->product\n\t\t);\n\t}",
"function add_products_google_category($p_product_id, $p_products_google_categories_array)\n\t{\n\t\tforeach($p_products_google_categories_array as $t_google_categorie) {\n\t\t\tforeach($t_google_categorie as $t_key => $t_value) {\n\t\t\t\t$coo_taxonomy_control = MainFactory::create_object('GoogleTaxonomyControl');\n\t\t\t\t$coo_taxonomy_control->create_product_google_category();\n\n\t\t\t\t$coo_taxonomy_control->coo_product_google_category->set_products_google_categories_id($t_key);\n\t\t\t\t$coo_taxonomy_control->coo_product_google_category->set_products_id($p_product_id);\n\t\t\t\t$coo_taxonomy_control->coo_product_google_category->set_google_category($t_value);\n\t\t\t\t$coo_taxonomy_control->coo_product_google_category->save();\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"protected function mapCategories($product_ps)\n {\n $list = null;\n\n $id_category = (int)$product_ps['id_category_default'];\n $uuid = ReverbMapping::getReverbCode($id_category);\n\n if ($uuid) {\n $list = array();\n $category = new Reverb\\Mapper\\Models\\Category($uuid);\n $list[] = $category;\n } else {\n $psCategory = new Category($id_category);\n throw new Exception('Category \"' . $psCategory->getName((int)$product_ps['id_lang']) . '\" is not mapped with a Reverb category', 1);\n }\n return $list;\n }",
"private function _populateProductCategory()\n {\n return $this->productCategory->create(\n $this->productCategoryData['name']\n );\n }",
"public function getProductCategory()\n {\n return $this->_fields['ProductCategory']['FieldValue'];\n }",
"public function htheme_get_product_category_autocomplete() {\r\n\r\n\t\t#ARGUMENTS\r\n\t\t$args = array(\r\n\t\t\t'taxonomy' => 'product_cat',\r\n\t\t\t'orderby' => 'name',\r\n\t\t\t'show_count' => 1,\r\n\t\t\t'pad_counts' => 1,\r\n\t\t\t'hierarchical' => 0,\r\n\t\t\t'hide_empty' => 1\r\n\t\t);\r\n\r\n\t\t#GET CATEGORIES\r\n\t\t$the_categories = get_categories($args);\r\n\r\n\t\t#ARRAY\r\n\t\t$result = array();\r\n\r\n\t\t#SETUP RESULTS\r\n\t\tforeach ( $the_categories as $term )\t{\r\n\t\t\t$result[] = array(\r\n\t\t\t\t'value' => $term->term_id,\r\n\t\t\t\t'label' => $term->name,\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t#RETURN RESULTS\r\n\t\treturn $result;\r\n\r\n\t}",
"private function getCategoryAttribute($product){\n \t\t$cats = $product->getCategoryIds();\n \t\t$categoryId=array();\n \t\t$category=array();\n\t\t$content = \"\";\n\t\tforeach ($cats as $category_id) {\n\t\t\t\n \t\t\t$_cat = $this->getCategory($category_id);\n \t\t\t$categoryId[]=$category_id;\n \t\t\t$category[]=$_cat->getName();\n\t\t} \n\t\t\n\t\t$content=$content.$this->getArrayAttributesInXML(\"categoryIds\",$categoryId);\n\t\t$content=$content.$this->getArrayAttributesInXML(\"unbxdTaxonomyId\",$categoryId);\n\t\t$content=$content.$this->getArrayAttributesInXML(\"category\",$category);\n\t\treturn $content;\n \t}",
"public function setCategories($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::INT32);\n $this->categories = $arr;\n\n return $this;\n }",
"public function getCategoryNameByProduct()\n {\n $virtuemartModelProduct = VmModel::getModel('product');\n $virtuemartModelCategory = VmModel::getModel('category');\n $categoryIds = $virtuemartModelProduct->getProductCategories($this->productId, true);\n if (empty($categoryIds)) {\n $virtuemartModelProduct->setId($this->productId);\n $product = $virtuemartModelProduct->getData();\n $categoryIds = $virtuemartModelProduct->getProductCategories($product->product_parent_id, true);\n }\n\n $categoryNames = array();\n foreach ($categoryIds as $categoryId) {\n $virtuemartModelCategory->setId($categoryId);\n $category = $virtuemartModelCategory->getData();\n if (empty($category)) {\n continue;\n }\n if (is_array($category)) {\n $category = array_shift($category);\n }\n $categoryNames[] = $category->category_name;\n }\n\n return implode(\",\",$categoryNames);\n }",
"protected function addProductToCategory($product, Mage_Catalog_Model_Category $category, array $categoryProducts)\n\t{\n\t\tif (is_numeric($product))\n\t\t{\n\t\t\t$productId = $product;\n\t\t\t$productName = 'Product '.$productId;\n\t\t}\n\t\telseif ($product instanceof Mage_Catalog_Model_Product)\n\t\t{\n\t\t\t$productId = $product->getId();\n\t\t\t$productName = $product->getName();\n\t\t}\n\n\t\t$categoryId = $category->getId();\n\t\t\n\t\tif (array_key_exists($categoryId, $categoryProducts))\n\t\t{\n\t\t\tif (!array_key_exists($productId, $categoryProducts[$categoryId]))\n\t\t\t{\n\t\t\t\t$categoryProducts[$categoryId][$productId] = 1;\n\t\t\t\tMage::log(' Added '.$productName.' to category '.$categoryId.' ('.$category->getName().')', Zend_Log::DEBUG, 'gareth.log');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tMage::log(' '.$productName.' already in category '.$categoryId.' ('.$category->getName().')', Zend_Log::DEBUG, 'gareth.log');\n\t\t\t}\n\t\t}\n\t\telse \n\t\t{\n\t\t\tMage::log(' No such mapped category '.$categoryId.' ('.$category->getName().') when trying to add product: '.$productName, Zend_Log::DEBUG, 'gareth.log');\n\t\t}\n\t\treturn $categoryProducts;\n\t}",
"public function getProductCategory()\n {\n return $this->product_category;\n }",
"public function getProduct_category () {\n\t$preValue = $this->preGetValue(\"product_category\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_category\")->preGetData($this);\n\treturn $data;\n}",
"public static function groupByCategories(array $products): array\r\n {\r\n $categoryList = [];\r\n foreach ($products as $product) {\r\n if (!( $product instanceof Product )) {\r\n throw new InvalidParamException('$products must be array of ' . Product::className());\r\n }\r\n foreach ($product->categories as $category) {\r\n /**\r\n * @var Category|null $parentCategory\r\n */\r\n $parentCategory = $category->parentAR;\r\n /* If category has parent add current category to parents children array,\r\n else create current category as root category */\r\n if ($parentCategory) {\r\n /* If parent category already in $categoryList search current category in its array,\r\n else create it in $categoryList and add current category to it */\r\n if (array_key_exists($parentCategory->id, $categoryList)) {\r\n /* If current category already in parent category array increament count by 1,\r\n else add current category to parent category children array */\r\n if (array_key_exists($category->id, $categoryList[ $parentCategory->id ][ 'children' ])) {\r\n $categoryList[ $parentCategory->id ][ 'children' ][ $category->id ][ 'count' ] += 1;\r\n } else {\r\n $categoryList[ $parentCategory->id ][ 'children' ][ $category->id ] = [\r\n 'id' => $category->id,\r\n 'name' => $category->lang->title,\r\n 'alias' => $category->lang->alias,\r\n 'count' => 1,\r\n ];\r\n }\r\n } else {\r\n $categoryList[ $parentCategory->id ] = [\r\n 'id' => $parentCategory->id,\r\n 'name' => $parentCategory->lang->title,\r\n 'alias' => $parentCategory->lang->alias,\r\n 'children' => [\r\n $category->id => [\r\n 'id' => $category->id,\r\n 'name' => $category->lang->title,\r\n 'alias' => $category->lang->alias,\r\n 'count' => 1,\r\n ],\r\n ],\r\n 'count' => 0,\r\n ];\r\n }\r\n } else {\r\n /* If current category already in $categoryList increment its count by 1,\r\n else add it to $categoryList */\r\n if (array_key_exists($category->id, $categoryList)) {\r\n $categoryList[ $category->id ][ 'count' ] += 1;\r\n } else {\r\n $categoryList[ $category->id ] = [\r\n 'id' => $category->id,\r\n 'name' => $category->lang->title,\r\n 'alias' => $category->lang->alias,\r\n 'count' => 1,\r\n 'children' => [],\r\n ];\r\n }\r\n }\r\n }\r\n }\r\n return $categoryList;\r\n }",
"public static function product_category( $atts ) {\n\t\tif ( empty( $atts['category'] ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$atts = array_merge( array(\n\t\t\t'limit' => '12',\n\t\t\t'columns' => '4',\n\t\t\t'orderby' => 'menu_order title',\n\t\t\t'order' => 'ASC',\n\t\t\t'category' => '',\n\t\t\t'cat_operator' => 'IN',\n\t\t), (array) $atts );\n\n\t\t$shortcode = new WC_Shortcode_Products( $atts, 'product_category' );\n\n\t\treturn $shortcode->get_content();\n\t}",
"public function getProductCategory()\n { \n return $this->productCategory;\n }",
"public function setCategory($var)\n {\n GPBUtil::checkString($var, True);\n $this->category = $var;\n\n return $this;\n }",
"function fill_product_category(){\n\t\t$data = array();\n\t\t$i = 0;\n\t\tforeach($this->product_categories as $cat){\n\t\t\t$i++;\n\t\t\t$row = array();\n\t\t\t$row['id'] = $i;\n\t\t\t$row['name'] = $cat;\n\t\t\t$row['slug'] = strtolower($cat);\n\t\t\t$row['parent_id'] = 0;\n\t\t\t$row['created_at'] = $this->mysql_time_now();\n\t\t\t$data[] = $row;\n\t\t}\n\t\t$this->pcm->add_batch($data);\n\t}",
"private function appendProductCategories(Product &$product) {\n $productCategories = $product->productCategories()->get();\n $categories = [];\n foreach ($productCategories as $pc) {\n $c = Category::select('id','name','slug','ord')->find($pc->category_id);\n if ($c) {\n $c->product_category_id = $pc->id;\n }\n $categories[] = $c;\n }\n $product->categories = $categories;\n }",
"public function category(string $googleProductCategory)\n {\n $this->attributes[ 'googleProductCategory' ] = $googleProductCategory;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the actual (user selected) answer. | public function setActualAnswer(SingleChoiceAnswerInterface $answer); | [
"public function setUserAnswer($value) {\n $this->_userAnswer = $value;\n }",
"public function setAnswer($answer) {\n\t\t$this->answer = $answer;\n\t}",
"public function set_answer(){\n\t\t$this->answer = $this->dictionary[array_rand($this->dictionary)];\n\t}",
"private function chooseQuestionToAnswer() : void\n {\n $questionId = $this->console->choice(__('Please select question to answer:'), $this->options);\n $this->handleAnswer($questionId ? array_search($questionId, $this->options) : null);\n }",
"public function setAnswer($answer)\n\t\t{\n\t\t\treturn $this->answer = (strlen($answer) > 0) ? $answer : $this->getDefault();\n\t\t}",
"final function setAnswer_choice($value) {\n\t\treturn $this->setAnswerChoice($value);\n\t}",
"public function answerPrompt($answer)\n {\n $this->sessionPost('/alert_text', array('text' => $answer));\n $this->sessionPost('/accept_alert');\n }",
"function setAnswer($question) {\n\t\t$student_id = $this->student->getID();\n\t\t$this->query(\"INSERT INTO student_test_answer student_test_id = '\" . (int)$question['student_test_id'] . \"', question_id = '\" . (int)$question['question_id'] . \", question_option_id = '\" . (int)$question['question_option_id'] . \"', date_add=NOW()\");\n\t}",
"function setAnswerTwo($answerTwo)\r\n {\r\n $this->answerTwo = $answerTwo;\r\n }",
"function setAnswerChoice($value) {\n\t\treturn $this->setColumnValue('answer_choice', $value, Model::COLUMN_TYPE_INTEGER);\n\t}",
"public function setAnswer()\n\t{\n\t\tswitch ($this->type) {\n\t\t\tcase MCUA:\n\t\t\t\t$this->answer = new ScormAnswerMultipleChoice($this->id);\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t\tcase MCMA:\n\t\t\tcase GLOBAL_MULTIPLE_ANSWER:\n\t\t\t\t$this->answer = new ScormAnswerMultipleChoice($this->id);\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t\tcase TF:\n\t\t\t\t$this->answer = new ScormAnswerTrueFalse($this->id);\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t\tcase FIB:\n\t\t\t\t$this->answer = new ScormAnswerFillInBlanks($this->id);\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t\tcase MATCHING:\n\t\t\tcase MATCHING_DRAGGABLE:\n\t\t\tcase DRAGGABLE:\n\t\t\t\t$this->answer = new ScormAnswerMatching($this->id);\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t\tcase ORAL_EXPRESSION:\n\t\t\tcase FREE_ANSWER:\n\t\t\t\t$this->answer = new ScormAnswerFree($this->id);\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t\tcase HOT_SPOT:\n\t\t\t\t$this->answer = new ScormAnswerHotspot($this->id);\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t\tcase MULTIPLE_ANSWER_COMBINATION:\n\t\t\t\t$this->answer = new ScormAnswerMultipleChoice($this->id);\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t\tcase HOT_SPOT_ORDER:\n\t\t\t\t$this->answer = new ScormAnswerHotspot($this->id);\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t\tcase HOT_SPOT_DELINEATION:\n\t\t\t\t$this->answer = new ScormAnswerHotspot($this->id);\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t\t// not supported\n\t\t\tcase UNIQUE_ANSWER_NO_OPTION:\n\t\t\tcase MULTIPLE_ANSWER_TRUE_FALSE:\n\t\t\tcase MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE:\n\t\t\tcase UNIQUE_ANSWER_IMAGE:\n\t\t\tcase CALCULATED_ANSWER:\n\t\t\t\t$this->answer = new ScormAnswerMultipleChoice($this->id);\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->answer = new stdClass();\n\t\t\t\t$this->answer->questionJSId = $this->js_id;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function update_answer()\n {\n $answer = Answer::findOrFail($this->selected_answer_id);\n if ($answer->user_id == Auth::id() || $this->question->user_id == Auth::id() || Auth::user()->is_teacher())\n {\n $this->validate();\n\n $answer->answer_text = $this->answer_text;\n\n $answer->save();\n\n $this->answer_text = '';\n $this->selected_answer_id = null;\n $this->display_edit_answer_form = false;\n \n $this->emit('answer-updated');\n }\n }",
"function correctAnswer() {\n\t}",
"public function setSecretAnswer($answer){\n $this->secretAnswer = $answer;\n }",
"public function setAnswered($answered)\n {\n $this->answered = $answered;\n }",
"function getAnswerChoice() {\n\t\treturn $this->answer_choice;\n\t}",
"final function setAnswer_text($value) {\n\t\treturn $this->setAnswerText($value);\n\t}",
"public function markAsCorrect() {\n\t\t// first set the mark\n\t\t$this->correct_answer = true;\n\t\t\n\t\t// trigger event for notifications\n\t\telgg_trigger_event('correct', 'object', $this);\n\t\t\n\t\t// depending of the plugin settings, we also need to close the question\n\t\tif (questions_close_on_marked_answer()) {\n\t\t\t$question = $this->getContainerEntity();\n\t\t\t\n\t\t\t$question->close();\n\t\t}\n\t}",
"public function answer()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n if (!isset($_POST['result'])) {\n $question = getQuestions()[$_SESSION['test_question_count']];\n // Get question options from DataBase\n $options = $this->testsModel->getOptions($question->id);\n\n $data = [\n 'question' => $question,\n 'options' => $options,\n 'select_err' => 'Please select one answer',\n 'progress_bar' => ($_SESSION['test_question_count']) / $_SESSION['question_count'] * 100,\n ];\n\n // Save at session which question we are\n $this->view('tests/test', $data);\n\n } else {\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n $option_id = trim($_POST['result']);\n $data = [\n 'user_id' => $_SESSION['user_id'],\n 'test_id' => $_SESSION['test_id'],\n 'question_id' => getQuestions()[$_SESSION['test_question_count']]->id,\n 'option_id' => $option_id,\n 'attemp_count' => 1,\n 'correct' => $this->testsModel->getOptionAnswer($option_id)->answer_bool,\n 'session_id' => $_SESSION['sessionIdForTest'],\n ];\n $this->testsModel->addAnswer($data);\n\n $_SESSION['test_question_count']++;\n\n redirect('tests/test');\n }\n\n }\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts entity to array for json_encode() | protected static function convertEntity(Model\Entity $entity) {
$jsonEntity = array();
$jsonEntity['uuid'] = (string) $entity->getUuid();
$jsonEntity['type'] = $entity->getType();
foreach ($entity->getProperties() as $key => $value) {
$jsonEntity[$key] = $value;
}
return $jsonEntity;
} | [
"public function toArray(Entity $entity) {}",
"public function toArray($entity) {\n\t\treturn $this->_serializeEntity ( $entity );\n\t}",
"public function jsonSerialize (): array {\n $array = get_object_vars($this);\n foreach ($array as &$value) {\n if ($value instanceof Entity) {\n $value = $value->jsonSerialize();\n }\n }\n\n return $array;\n }",
"public function toJson($entity);",
"private function entityToArray($entityObj) {\n\n \tif (!isset(self::$serializer)) {\n \t\tthrow new HttpException(500, 'Serializer has to be set if injected data is an object.');\n \t}\n \t\n \t$this->setGroupsForSerialization($entityObj);\n \t\n \t$dataArr = $this->keysFromSnakeToCamel(json_decode(self::$serializer->serialize($entityObj, 'json'), true));\n \t \n \treturn $dataArr;\n }",
"public function transform($entity)\n {\n if (method_exists($entity, 'toArray')) {\n return $entity->toArray();\n }\n\n return (array) $entity;\n }",
"public function toJson($entity)\n {\n return json_encode($this->toArray($entity));\n }",
"public static function entityArrayToArray(array $entity);",
"public function toMap($entity): array;",
"public function getElasticArray($entity): array\n {\n $entityArray = [];\n $entityArray[self::METADATA_FIELD] = [];\n\n //just a shorthand\n $entityMetadata = &$entityArray[self::METADATA_FIELD];\n\n $entityMetadata[self::METADATA_ENTITIES_TO_DECODE_FIELDS] = [];\n $entityMetadata[self::METADATA_DATETIME_FIELDS] = [];\n $entityMetadata[self::METADATA_SOURCE_ENTITY_CLASS_FIELD] = \\get_class($entity);\n\n foreach ((array)$entity as $key => $value) {\n $keyParts = \\explode(\"\\x00\", $key);\n $key = \\array_pop($keyParts);\n\n if (\\is_object($value)) {\n //elastic can work with DateTime, not with ours entities\n if ($value instanceof \\DateTimeInterface) {\n $entityMetadata[self::METADATA_DATETIME_FIELDS][] = $key;\n $entityArray[$key] = $value->getTimestamp() * 1000; //convert seconds to milliseconds\n\n continue; //the conversion is done, continue with the next property\n }\n\n if (\\get_class($value) === Request::class) {\n $entityArray[$key] = (string)$value;\n }\n\n if (\\method_exists($value, 'getId')) {\n $class = \\get_class($value);\n if (\\strpos($class, self::DOCTRINE_PROXY_NAMESPACE_PART) === 0) {\n $class = \\substr($class, \\strlen(self::DOCTRINE_PROXY_NAMESPACE_PART));\n }\n $id = $value->getId();\n if ($id) {\n $entityArray[$key] = \"$class\\x00$id\";\n $entityMetadata[self::METADATA_ENTITIES_TO_DECODE_FIELDS][] = $key;\n } else {\n unset($entityArray[$key]);\n }\n }\n } else {\n $entityArray[$key] = $value ?? '';\n }\n }\n\n if (\\array_key_exists('id', $entityArray) && !$entityArray['id']) {\n unset($entityArray['id']);\n }\n\n return $entityArray;\n }",
"protected function entityToArray($entity) {\n if (is_array($entity)) {\n return $entity; // cut down on duplicate code\n } elseif (is_object($entity)) {\n if (!$this->hydrator) {\n $this->hydrator = $this->getHydrator();\n }\n return $this->hydrator->extract($entity);\n }\n throw new InvalidArgumentException('Entity passed to db mapper should be an array or object.');\n }",
"public function toJsonEncodable() {\n\t\treturn $this->getRawEntities( TRUE );\n\t}",
"public function serialize(Entity $entity);",
"public function entityToArray($data)\n {\n if (is_subclass_of($data, Model::class)) {\n $data = $data->toArray();\n } else if (!is_array($data)) {\n $data = (array)$data;\n }\n return $data;\n }",
"public function pack(Entity $entity)\n {\n $data = $entity->getData();\n return json_encode($data);\n }",
"public function toJSON(Entity $entity, $depth=0) {\n\t\treturn json_encode($entity->toArray($depth));\n\t}",
"function to_entity()\n {\n }",
"public function getWholeEntity(): array\n {\n $fields = get_object_vars($this);\n $fieldsWithValues = [];\n\n foreach ($fields as $field => $value) {\n $fieldsWithValues[$field] = $value;\n }\n\n return $fieldsWithValues;\n }",
"public function Serialize($entity)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks that loopbacks can be performed. | public function test_loopback_requests()
{
} | [
"public function isLoopback() {\n return $this->addr >> 8 == 0x7F0000;\n }",
"public function isLoopback() {\n return \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\" == $this->addr;\n }",
"private function isLoopback(): bool\n {\n if ($this->isIPv6) {\n return $this->compact()->address == '::1';\n }\n\n return (ip2long($this->address) & 0xff000000) == 0x7f000000;\n }",
"public function isLoopback()\n {\n return $this->isLocal;\n }",
"public function get_test_loopback_requests()\n {\n }",
"#[@test]\n public function loopbackAddress() {\n $this->assertTrue(create(new Inet4Address('127.0.0.1'))->isLoopback());\n }",
"private function checkEvilPortalRunning()\n {\n return exec(\"iptables -t nat -L PREROUTING | grep 172.16.42.1\") != '';\n }",
"private function should_run_fingerprint_checks_for_request() {\n\n\t\tif ( ITSEC_Lib::is_loopback_request() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"private function init_checks() {\n\n\t\t$is_proxy_running = EE::launch( \"docker inspect -f '{{.State.Running}}' $this->proxy_type\", false, true );\n\n\t\tif ( ! $is_proxy_running->return_code ) {\n\t\t\tif ( preg_match( '/false/', $is_proxy_running->stdout ) ) {\n\t\t\t\t$this->start_proxy_server();\n\t\t\t}\n\t\t} else {\n\t\t\t/**\n\t\t\t * Checking ports.\n\t\t\t */\n\t\t\t@fsockopen( 'localhost', 80, $port_80_exit_status );\n\t\t\t@fsockopen( 'localhost', 443, $port_443_exit_status );\n\n\t\t\t// if any/both the port/s is/are occupied.\n\t\t\tif ( ! ( $port_80_exit_status && $port_443_exit_status ) ) {\n\t\t\t\tEE::error( 'Cannot create proxy container. Please make sure port 80 and 443 are free.' );\n\t\t\t}\n\t\t\t$this->create_proxy_server();\n\t\t}\n\t}",
"public static function check_network() {\n return strlen(get_option('livefyre_apps-livefyre_domain_name')) > 0; \n }",
"public function checkConnection();",
"protected function checkServerAddress()\n\t{\n\t\t// ip address is missing (e.g. cli mode)\n\t\tif (empty($_SERVER['SERVER_ADDR'])) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"private function isRemoteServerValid()\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $remote = $objectManager->get(RemoteAddress::class);\n $IpAddress = $remote->getRemoteAddress();\n\n if (in_array($IpAddress, WebHookIP::AUTHORIZED_IP) === false) {\n $this->logger->info(sprintf(\n 'Access not allowed with this IP Address: %s',\n $IpAddress\n ));\n return false;\n }\n\n return true;\n }",
"function eventarc_server_connectivity_ok() {\n\t// skip the check on WPMU because the status page is hidden\n\tglobal $eventarc_u_name;\n\tif ( $eventarc_u_name )\n\t\treturn true;\n\t$servers = eventarc_get_server_connectivity();\n\treturn true;//!( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );\n}",
"protected function checkTrustedHostPattern() {}",
"public function checkConnection()\n {\n return true;\n }",
"function eventarc_check_server_connectivity() {\n\treturn true;\n}",
"#[@test]\n public function loopbackAddress() {\n $this->assertEquals('::1', create(new Inet6Address('::1'))->asString());\n }",
"public function testIPAddressRule()\n {\n $this->assertSame($this->rules, $this->rules->ipAddress());\n $this->assertTrue($this->rules->pass('127.0.0.1'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolves parent references in the selector | private function resolveParentReferences($selector, $context)
{
$resolvedReferences = array();
if (!count($this->parentSelectors)) {
throw new SassRuleNodeException('Can not use parent selector (' . self::PARENT_REFERENCE . ') when no parent selectors', $this);
}
foreach ($this->getParentSelectors($context) as $parentSelector) {
$resolvedReferences[] = str_replace(self::PARENT_REFERENCE, $parentSelector, $selector);
}
return $resolvedReferences;
} | [
"abstract function resolve($parent, $child);",
"function getParentSelectorName()\n {\n return $this->parentSelectorName;\n }",
"public static function getParentReferenceFieldName();",
"public function getAncestorSelectorName();",
"public function resolveParents()\n {\n foreach ($this->resources as $resource) {\n $this->resolveResourceParent($resource);\n }\n }",
"public function getParent()\n {\n return $this->tryFind('..', 'xpath');\n }",
"public function getGrandParent();",
"public function scopeParentName($query,$parent){\n $code = $query->where('name','=',$parent)->first();\n\n if( $code )\n return $code->children()->get();\n else\n return $code;\n }",
"private function parentReferencePos($selector) {\n\t\t$inString = false;\n\t\tfor ($i = 0, $l = strlen($selector); $i < $l; $i++) {\n\t\t\t$c = $selector[$i];\n\t\t\tif ($c === self::PARENT && !$inString) {\n\t\t\t\treturn $i;\n\t\t\t}\n\t\t\telseif ($c == '\"') {\n\t\t\t\t$inString = !$inString;\n\t\t\t}\n\t\t}\n\t return false;\n\t}",
"public static function parent($selector = NULL) {\n return '.parent('.$selector.')';\n }",
"public function testSelectorElementWithParentThrowsExceptionWhenKeyRefElementSetSelectorElement(): void\n {\n $parent1 = new KeyRefElement();\n $parent1->setSelectorElement($this->sut);\n \n $parent2 = new KeyRefElement();\n $this->expectInvalidOperationExceptionChildOfAnotherElement($this->sut, $parent2);\n $parent2->setSelectorElement($this->sut);\n }",
"public function parents ($selector = null) { \r\n\t\t\r\n\t\t$list = new XDTNodeList();\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t\twhile (!$node->isSameNode($node->ownerDocument)) {\r\n\t\t\t\t$node = $node->parentNode;\r\n\t\t\t\t\r\n\t\t\t\tif (!($node instanceof DOMElement)) continue;\r\n\t\t\t\t\r\n\t\t\t\t$list->add($node);\r\n\t\t\t}\r\n\t\t\t\r\n\t\tif (!isset($selector)) return $list;\r\n\t\t\r\n\t\t$this->xml_query = $list;\r\n\t\treturn $this->select($selector, null, XDT::SELECT_FILTER);\r\n\t}",
"public function getParents();",
"public function getChildSelectorName();",
"public function getParent(){\n $pointer =& $this->parentTag;\n return $pointer;\n}",
"public function getParentValue(): mixed;",
"protected function updateParent()\n {\n $this->each(function ($item) {\n if (method_exists($item, 'parent')) {\n $item->parent($this);\n }\n });\n }",
"private static function get_parents($parent)\r\n {\r\n $result = parent::$sql->getArray(\"\r\n SELECT * FROM \" . parent::$prefix . \"488_categories\r\n WHERE category_id = \" . $parent . \"\r\n AND status = '1'\r\n ORDER BY priority ASC\r\n \");\r\n\r\n self::$category_url[$result[0]['id']] = $result[0]['title'];\r\n\r\n if ($result[0]['parent_id'] > 0)\r\n self::get_parents($result[0]['parent_id']);\r\n }",
"public function children($selector){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display single financial account setting | public function viewfinancialaccountsettingAction(){
$id = $this->getRequest()->getParam('id');
if ( !empty ($id) ) {
$model = new Financial_Model_FinancialAccountSetting();
$data = $model->findById($id);
if ( $data!==null )
$this->view->record = $data;
}
} | [
"public function showAccountSettings()\n {\n $page_title = 'Account Settings';\n $user =& $this->user;\n\n // Populate the form fields with the user information\n Former::populate($user);\n\n return View::make('user.account-settings', compact('user', 'page_title'));\n }",
"public function showAccountSettings()\n {\n return view('users/accountsettings');\n }",
"function account_settings(){\n\t\t$profile_data=$this->accounts_model->profile($this->session->userdata('username'));\n\t\t$this->view->render(array(\n\t\t\t'profile_data'=>$profile_data));\n\t}",
"public function accountSettings()\n {\n return view('account_settings')->with('constants', $this->constants);\n }",
"public function getAccountSetting()\n {\n return View::make('dashboard.moderator.Account.accountsetting');\n }",
"public function account()\n {\n $data['title'] = 'Account Settings';\n $data['welcomeMessage'] = 'Welcome to your account settings. Enjoy!';\n\n /** Check to see if user is logged in **/\n $data['isLoggedIn'] = $this->auth->isLogged();\n\n /** Setup Breadcrumbs **/\n \t\t$data['breadcrumbs'] = \"\n \t\t\t<li class='active'>\".$data['title'].\"</li>\n \";\n\n View::renderTemplate('header', $data);\n View::render('Members/Member-Account-Sidebar', $data);\n View::render('Members/Account-Settings', $data);\n View::renderTemplate('footer', $data);\n }",
"public function account_view()\n {\n $user = $_SESSION[LOGGED_IN];\n $userId = $user[USER_ID];\n $userData[RESULTS] = $this->Dashboardmodel->getUserBankInfo($userId);\n $this->_tpl('Account_view', $userData);\n }",
"function account_settings()\n {\n $data = array();\n $data['title'] = 'Account Settings';\n return view('backend/dynamic/account_settings')->with($data);\n }",
"public function showCompany(){\r\n\t return Mage::helper('vendorsquote')->getConfig('account_detail_company');\r\n\t}",
"public function accountFinancialsAction()\n {\n return $this->render('SuluContactExtensionBundle:Template:account.financials.html.twig');\n }",
"public function accntsttngs()\n {\n $data['title'] = 'Account settings - Shaadi Baraati';\n $admin = $this->session->userdata('admin_id');\n $data['setting'] = $this->m_account->account($admin);\n $this->load->view('account/profile.php', $data, false);\n }",
"public function action_paidSettings_display()\n\t{\n\t\tglobal $context, $txt, $modSettings;\n\n\t\trequire_once(SUBSDIR . '/PaidSubscriptions.subs.php');\n\n\t\t// Initialize the form\n\t\t$settingsForm = new SettingsForm(SettingsForm::DB_ADAPTER);\n\n\t\t// Initialize it with our settings\n\t\t$config_vars = $this->_settings();\n\t\t$settingsForm->setConfigVars($config_vars);\n\n\t\t// Some important context stuff\n\t\t$context['page_title'] = $txt['settings'];\n\t\t$context['sub_template'] = 'show_settings';\n\t\t$context['settings_message'] = replaceBasicActionUrl($txt['paid_note']);\n\t\t$context[$context['admin_menu_name']]['current_subsection'] = 'settings';\n\n\t\t// Get the final touches in place.\n\t\t$context['post_url'] = getUrl('admin', ['action' => 'admin', 'area' => 'paidsubscribe', 'save', 'sa' => 'settings']);\n\t\t$context['settings_title'] = $txt['settings'];\n\n\t\t// We want javascript for our currency options.\n\t\ttheme()->addInlineJavascript('\n\t\ttoggleCurrencyOther();', true);\n\n\t\t// Saving the settings?\n\t\tif (isset($this->_req->query->save))\n\t\t{\n\t\t\tcheckSession();\n\n\t\t\tcall_integration_hook('integrate_save_subscription_settings');\n\n\t\t\t// Check that the entered email addresses are valid\n\t\t\tif (!empty($this->_req->post->paid_email_to))\n\t\t\t{\n\t\t\t\t$validator = new DataValidator();\n\n\t\t\t\t// Some cleaning and some rules\n\t\t\t\t$validator->sanitation_rules(array('paid_email_to' => 'trim'));\n\t\t\t\t$validator->validation_rules(array('paid_email_to' => 'valid_email'));\n\t\t\t\t$validator->input_processing(array('paid_email_to' => 'csv'));\n\t\t\t\t$validator->text_replacements(array('paid_email_to' => $txt['paid_email_to']));\n\n\t\t\t\tif ($validator->validate($this->_req->post))\n\t\t\t\t{\n\t\t\t\t\t$this->_req->post->paid_email_to = $validator->validation_data('paid_email_to');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// That's not an email, lets set it back in the form to be fixed and let them know its wrong\n\t\t\t\t\t$modSettings['paid_email_to'] = $this->_req->post->paid_email_to;\n\t\t\t\t\t$context['error_type'] = 'minor';\n\t\t\t\t\t$context['settings_message'] = array();\n\t\t\t\t\tforeach ($validator->validation_errors() as $id => $error)\n\t\t\t\t\t{\n\t\t\t\t\t\t$context['settings_message'][] = $error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// No errors, then save away\n\t\t\tif (empty($context['error_type']))\n\t\t\t{\n\t\t\t\t// Sort out the currency stuff.\n\t\t\t\tif ($this->_req->post->paid_currency !== 'other')\n\t\t\t\t{\n\t\t\t\t\t$this->_req->post->paid_currency_code = $this->_req->post->paid_currency;\n\t\t\t\t\t$this->_req->post->paid_currency_symbol = $txt[$this->_req->post->paid_currency . '_symbol'];\n\t\t\t\t}\n\t\t\t\t$this->_req->post->paid_currency_code = trim($this->_req->post->paid_currency_code);\n\n\t\t\t\tunset($config_vars['dummy_currency']);\n\t\t\t\t$settingsForm->setConfigVars($config_vars);\n\t\t\t\t$settingsForm->setConfigValues((array) $this->_req->post);\n\t\t\t\t$settingsForm->save();\n\t\t\t\tredirectexit('action=admin;area=paidsubscribe;sa=settings');\n\t\t\t}\n\t\t}\n\n\t\t// Prepare the settings...\n\t\t$settingsForm->prepare();\n\t}",
"private function accountSettings() {\n $this->_registry->getModel('authenticate')->redirectInvalidUser();\n $this->_template->title = 'Settings';\n $this->_template->userInfo = $this->_model->getUserInfo($this->_session->get('authSessionUid'));\n $this->_template->countries = $this->_registry->getModel('register')->selectCountries();\n $this->_template->states = $this->_registry->getModel('register')->selectStates();\n if (filter_has_var(INPUT_POST, 'save')) {\n $token = filter_var($_POST['token'], FILTER_SANITIZE_STRING);\n $this->_security->checkCsrfToken($token);\n $response = $this->_model->updateUserChanges($this->_userId);\n if ($response == 'success') {\n $this->_session->flash('message', '<p class=\"stock success\">Your account has been updated.</p>');\n $this->_registry->redirectTo('account/info');\n } elseif ($response == 'failure') {\n $this->_template->token = $this->_security->generateToken();\n $this->_template->settingsError = '<p class=\"error\">Your account could not be updated.</p>';\n $this->_template->errors = $this->_model->getErrors();\n $this->_template->buildFromTemplates('header.php', 'sidebar.php', 'account_nav.php', 'account.settings.php', 'footer.php');\n }\n } else {\n $this->_template->token = $this->_security->generateToken();\n $this->_template->buildFromTemplates('header.php', 'sidebar.php', 'account_nav.php', 'account.settings.php', 'footer.php');\n }\n }",
"function show_settings() {\n\t\tinclude PM_CORE.\"/settings.php\";\n\t\t$this->settings = $settings;\n\t}",
"public function show_settings() {\n\t\twoocommerce_admin_fields( $this->get_settings() );\n\t}",
"public function profile_setting() {\n if ($this->checkLogin('C') == '') {\n $this->setErrorMessage('error', 'You must login first','company_must_login');\n redirect(COMPANY_NAME);\n }else{\n\t\t\tif ($this->lang->line('dash_operator_edit_profile_settings') != '') \n\t\t\t\t\t$this->data['heading']= stripslashes($this->lang->line('dash_operator_edit_profile_settings')); \n\t\t\telse \n\t\t\t\t$this->data['heading'] = 'Edit profile setting';\n\t\t\t$company_id = $this->session->userdata(APP_NAME.'_session_company_id'); \n $condition = array('_id' => MongoID($company_id));\n $this->data['companydetail'] = $this->company_model->get_all_details(COMPANY, $condition);\n $form_mode = TRUE;\n $this->data['form_mode'] = $form_mode;\n $this->load->view(COMPANY_NAME.'/settings/edit_profile', $this->data);\n }\n\t}",
"public function FinancialStatement() {\n $Sunrise = new Sunrise;\n $FeeDisplay = $Sunrise->Mini('form-areas/custom/FamilyFees', '..', []);\n echo ($FeeDisplay);\n }",
"public function showAccountUpdate()\n {\n $twoFactor = $this->currentUser->getTwoFactor();\n $countries = Country::findAll()->pluck('name.common', 'iso_3166_1_alpha2');\n\n return view('rinvex.fort::account.page', compact('twoFactor', 'countries'));\n }",
"public function actionAccount()\n {\n /** @var SettingsForm $model */\n $model = \\Yii::createObject(SettingsForm::className());\n $event = $this->getFormEvent($model);\n\n $this->performAjaxValidation($model);\n\n $this->trigger(self::EVENT_BEFORE_ACCOUNT_UPDATE, $event);\n if ($model->load(\\Yii::$app->request->post()) && $model->save()) {\n \\Yii::$app->session->setFlash('success', \\Yii::t('app', 'Your account details have been updated'));\n $this->trigger(self::EVENT_AFTER_ACCOUNT_UPDATE, $event);\n return $this->refresh();\n }\n\n return $this->render('profile_layout', [\n 'section' => 'account',\n 'model' => $model,\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the type and language mapping as well as the container of the specified term. The result will be in the form | private function getTermDefinition($term, $activectx)
{
$def = array('@type' => null,
'@language' => (isset($activectx['@language']))
? $activectx['@language']
: null,
'@container' => null,
'isKeyword' => false);
if (in_array($term, self::$keywords))
{
$def['@language'] = null;
$def['isKeyword'] = true;
if (('@id' == $term) || ('@type' == $term) || ('@graph' == $term))
{
$def['@type'] = '@id';
}
return $def;
}
elseif (false == isset($activectx[$term]))
{
return $def;
}
if (isset($activectx[$term]['@type']))
{
$def['@type'] = $activectx[$term]['@type'];
$def['@language'] = null;
}
elseif (array_key_exists('@language', $activectx[$term])) // could be null
{
$def['@language'] = $activectx[$term]['@language'];
}
if (isset($activectx[$term]['@container']))
{
$def['@container'] = $activectx[$term]['@container'];
}
return $def;
} | [
"public function describeTermTypes();",
"function i18n_taxonomy_term_translation_page($type, $term) {\n module_load_include('admin.inc', 'i18n_taxonomy');\n $vocabulary = taxonomy_vocabulary_load($term->vid);\n $translation_set = !empty($term->i18n_tsid) ? i18n_translation_set_load($term->i18n_tsid) : NULL;\n\n $translation_overview = i18n_taxonomy_translation_term_overview($term);\n\n $translation_term_form = drupal_get_form('i18n_taxonomy_translation_term_form', $vocabulary, $translation_set, $term);\n\n return $translation_overview + $translation_term_form;\n}",
"function itis_term_fields_per_vocabulary(){\n return array(\n array(\n 'field_config' => array(\n 'active' => '1',\n 'cardinality' => '1',\n 'deleted' => '0',\n 'entity_types' => array(),\n 'field_name' => 'field_aan',\n 'foreign keys' => array(\n 'tid' => array(\n 'columns' => array(\n 'tid' => 'tid'\n ),\n 'table' => 'taxonomy_term_data'\n )\n ),\n 'indexes' => array(\n 'tid' => array(\n 0 => 'tid'\n )\n ),\n 'module' => 'taxonomy',\n 'settings' => array(\n 'allowed_values' => array(\n 0 => array(\n 'parent' => '0',\n 'vocabulary' => 'tags'\n )\n )\n ),\n 'translatable' => '1',\n 'type' => 'taxonomy_term_reference'\n ),\n 'field_instance' => array(\n 'bundle' => 'tags',\n 'default_value' => NULL,\n 'deleted' => '0',\n 'description' => t('The scientific name of the valid or accepted taxon identified as the currently accepted name used for a given invalid or not accepted name. Each name that is in synonymy (junior synonyms, obsolete combinations, etc.) must be connected to one accepted or valid name.'),\n 'display' => array(\n 'default' => array(\n 'label' => 'inline',\n 'module' => 'taxonomy',\n 'settings' => array(),\n 'type' => 'hidden',\n 'weight' => -10\n )\n ),\n 'entity_type' => 'taxonomy_term',\n 'field_name' => 'field_aan',\n 'label' => 'Associated accepted name',\n 'required' => 0,\n 'settings' => array(\n 'user_register_form' => FALSE\n ),\n 'widget' => array(\n 'active' => 0,\n 'module' => 'taxonomy',\n 'settings' => array(\n 'autocomplete_path' => 'taxonomy/autocomplete'\n ),\n 'type' => 'taxonomy_autocomplete',\n 'weight' => '11'\n )\n )\n )\n );\n}",
"function rdfx_term_types($reset = FALSE) {\n static $types;\n if ($reset || !isset($types)) {\n $types['classes']['term_types'] = array();\n $types['properties']['term_types'] = array();\n\n $term_details = '';\n\n // @todo Should the inference consider subProp and subClass relationships\n // as well. ie. should all OWL classes also have the type RDFS Class\n\n // @todo Switch to drupal cache\n $types['classes']['term_types'] = array(\n 'rdfs_class' => array(\n 'uri' => 'http://www.w3.org/2000/01/rdf-schema#Class',\n 'inference' => array(\n 'http://www.w3.org/2000/01/rdf-schema#subClassOf' => array(\n 'subject',\n 'object',\n ),\n 'http://www.w3.org/2000/01/rdf-schema#domain' => array(\n 'object',\n ),\n 'http://www.w3.org/2000/01/rdf-schema#range' => array(\n 'object',\n ),\n ),\n ),\n 'owl_class' => array(\n 'uri' => 'http://www.w3.org/2002/07/owl#Class',\n 'inference' => array(\n 'http://www.w3.org/2002/07/owl#equivalentClass' => array(\n 'subject',\n 'object',\n ),\n 'http://www.w3.org/2002/07/owl#disjointWith' => array(\n 'subject',\n 'object',\n ),\n ),\n ),\n );\n\n $types['properties']['term_types'] = array (\n 'rdf_property' => array(\n 'uri' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#Property',\n 'inference' => array(\n 'http://www.w3.org/2000/01/rdf-schema#domain' => array(\n 'subject',\n ),\n 'http://www.w3.org/2000/01/rdf-schema#range' => array(\n 'subject',\n ),\n 'http://www.w3.org/2000/01/rdf-schema#subPropertyOf' => array(\n 'subject',\n 'object',\n ),\n 'http://www.w3.org/2002/07/owl#equivalentProperty' => array(\n 'subject',\n 'object',\n ),\n 'http://www.w3.org/2002/07/owl#inverseOf' => array(\n 'subject',\n 'object',\n ),\n ),\n ),\n 'owl_property_datatype' => array(\n 'uri' => 'http://www.w3.org/2002/07/owl#DatatypeProperty',\n 'inference' => array(\n ),\n ),\n 'owl_property_object' => array(\n 'uri' => 'http://www.w3.org/2002/07/owl#ObjectProperty',\n 'inference' => array(\n ),\n ),\n 'owl_property_functional' => array(\n 'uri' => 'http://www.w3.org/2002/07/owl#FunctionalProperty',\n 'inference' => array(\n ),\n ),\n 'owl_property_inverse_functional' => array(\n 'uri' => 'http://www.w3.org/2002/07/owl#InverseFunctionalProperty',\n 'inference' => array(\n ),\n ),\n 'owl_property_symmetric' => array(\n 'uri' => 'http://www.w3.org/2002/07/owl#SymmetricProperty',\n 'inference' => array(\n ),\n ),\n 'owl_property_asymmetric' => array(\n 'uri' => 'http://www.w3.org/2002/07/owl#AsymmetricProperty',\n 'inference' => array(\n ),\n ),\n 'owl_property_annotation' => array(\n 'uri' => 'http://www.w3.org/2002/07/owl#AnnotationProperty',\n 'inference' => array(\n ),\n ),\n 'owl_property_reflexive' => array(\n 'uri' => 'http://www.w3.org/2002/07/owl#ReflexiveProperty',\n 'inference' => array(\n ),\n ),\n 'owl_property_irreflexive' => array(\n 'uri' => 'http://www.w3.org/2002/07/owl#IrreflexiveProperty',\n 'inference' => array(\n ),\n ),\n 'owl_property_transitive' => array(\n 'uri' => 'http://www.w3.org/2002/07/owl#TransitiveProperty',\n 'inference' => array(\n ),\n ),\n );\n\n $types['classes']['description'] = array(\n 'superclass' => array(\n 'http://www.w3.org/2000/01/rdf-schema#subClassOf' => array(\n 'object',\n ),\n ),\n 'disjoint' => array(\n 'http://www.w3.org/2002/07/owl#disjointWith' => array(\n 'object',\n ),\n ),\n );\n\n $types['properties']['description'] = array(\n 'domain' => array(\n 'http://www.w3.org/2000/01/rdf-schema#domain' => array(\n 'object',\n ),\n ),\n 'range' => array(\n 'http://www.w3.org/2000/01/rdf-schema#range' => array(\n 'object',\n ),\n ),\n 'superproperty' => array(\n 'http://www.w3.org/2000/01/rdf-schema#subPropertyOf' => array(\n 'object',\n ),\n ),\n 'inverse' => array(\n 'http://www.w3.org/2002/07/owl#inverseOf' => array(\n 'object',\n ),\n ),\n );\n drupal_alter('rdfx_term_types', $types);\n }\n\n return $types;\n}",
"function _cals_importer_build_term_map() {\n $genre_machine_name = 'genre';\n $genre_harmonized_machine_name = 'genre_harmonized';\n\n // Look up vid's.\n $genre_vid = db_select('taxonomy_vocabulary', 'v')\n ->fields('v', ['vid'])\n ->condition('v.machine_name', $genre_machine_name)\n ->execute()\n ->fetchField();\n $genre_harmonized_vid = db_select('taxonomy_vocabulary', 'v')\n ->fields('v', ['vid'])\n ->condition('v.machine_name', $genre_harmonized_machine_name)\n ->execute()\n ->fetchField();\n\n // Fetch terms from the database for Genre and Genre Harmonized\n // vocabularies.\n $terms = db_select('taxonomy_term_data', 't')\n ->fields('t', ['tid', 'vid', 'name'])\n ->condition('t.vid', [$genre_vid, $genre_harmonized_vid], 'IN')\n ->execute()\n ->fetchAll();\n\n // Organize terms by vid.\n $terms_by_vid = [];\n foreach ($terms as $term) {\n $terms_by_vid[$term->vid][strtolower($term->name)] = $term->tid;\n }\n\n // Map terms from Genre vocabulary to Genre Harmonized vocabulary only if the\n // terms exist in both (by name).\n foreach ($terms_by_vid[$genre_vid] as $name => $tid) {\n if (isset($terms_by_vid[$genre_harmonized_vid][$name])) {\n $term_mapping[$tid] = $terms_by_vid[$genre_harmonized_vid][$name];\n }\n }\n\n // Fetch term mapping from the map table.\n $terms = db_select('field_data_field_genre_harmonized_map', 'm')\n ->fields('m', ['entity_id', 'field_genre_harmonized_map_tid'])\n ->execute()\n ->fetchAll();\n foreach ($terms as $term) {\n $term_mapping[$term->entity_id] = $term->field_genre_harmonized_map_tid;\n }\n\n return $term_mapping;\n}",
"abstract protected function getTermForAllResources();",
"private function get_term_data() {\n\t\tglobal $taxnow, $wp_rewrite;\n\n\t\t$term_id = Param::request( 'tag_ID', 0, FILTER_VALIDATE_INT );\n\t\t$term = get_term( $term_id, $taxnow, OBJECT, 'edit' );\n\t\t$taxonomy = get_taxonomy( $term->taxonomy );\n\n\t\t$title_format = Helper::get_settings( \"titles.tax_{$term->taxonomy}_title\" );\n\t\t$desc_format = Helper::get_settings( \"titles.tax_{$term->taxonomy}_description\" );\n\t\t$title_format = $title_format ? $title_format : '%term%';\n\n\t\t// Get the permalink.\n\t\t$permalink = untrailingslashit( esc_url( get_term_link( $term_id, $term->taxonomy ) ) );\n\t\t$termlink = $wp_rewrite->get_extra_permastruct( $term->taxonomy );\n\n\t\t// Pretty permalinks disabled.\n\t\tif ( empty( $termlink ) ) {\n\t\t\t$permalink_format = $permalink;\n\t\t} else {\n\t\t\tSitepress::get()->remove_home_url_filter();\n\t\t\t$termlink = str_replace( $this->get_home_url(), '', $permalink );\n\t\t\t$termlink = str_replace( $term->slug, '%postname%', $termlink );\n\t\t\t$permalink_format = $this->get_home_url( user_trailingslashit( $termlink, 'category' ) );\n\t\t\tSitepress::get()->restore_home_url_filter();\n\t\t}\n\n\t\t$url = untrailingslashit( esc_url( $permalink ) );\n\n\t\treturn compact( 'title_format', 'desc_format', 'url', 'permalink', 'permalink_format' );\n\t}",
"public function getWpTerm(): WP_Term;",
"function map_term_types() {\n\tglobal $wpdb;\n\n\t$values = $wpdb->get_results( \"\n\t\tSELECT term_id, meta_value FROM {$wpdb->termmeta}\n\t\tWHERE meta_key = '__demo_import_types'\n\t\", ARRAY_A );\n\n\tif ( empty( $values ) || ! is_array( $values ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( $values as $value ) {\n\t\t$term_id = absint( $value['term_id'] );\n\t\t$type_slugs = unserialize( $value['meta_value'] );\n\t\t$type_ids = [];\n\n\t\tforeach ( (array) $type_slugs as $slug ) {\n\t\t\tif ( $type = \\MyListing\\Src\\Listing_Type::get_by_name( $slug ) ) {\n\t\t\t\t$type_ids[] = (string) $type->get_id();\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $type_ids ) ) {\n\t\t\tupdate_term_meta( $term_id, 'listing_type', $type_ids );\n\t\t}\n\t}\n}",
"function acf_decode_taxonomy_term($value) {}",
"public abstract function addToDictionary($term);",
"abstract function readTaxonomyTerm( $_term ): ITaxonomyTermEntity;",
"protected function termContainer(): TermContainer\n {\n if ($this->termContainer === null) {\n $this->termContainer = (new TermContainer($this))\n ->setAttribute('id', $this->getName() . '-terms');\n }\n\n return $this->termContainer;\n }",
"public function get ($term, $lang = null) {\n\n // If we don't receive a language key, use the default\n $lang = isset($lang)? $lang : $this->lang;\n\n // Load the language terms\n if (!isset($this->languages[$lang])) {\n $this->load($lang);\n }\n\n // Return the translated term\n return isset($this->languages[$lang][$term])? $this->languages[$lang][$term] : $term;\n }",
"function humus_map_view_terms($terms) {\n\t$tape = get_term_by('slug', 'tape', 'section');\n\tif($tape)\n\t\t$terms[] = $tape;\n\treturn $terms;\n}",
"public function term( $term ) {\n\t\t$breadcrumbs = [];\n\t\tdo {\n\t\t\tarray_unshift(\n\t\t\t\t$breadcrumbs,\n\t\t\t\t[\n\t\t\t\t\t'name' => $term->name,\n\t\t\t\t\t'description' => aioseo()->meta->description->getDescription(),\n\t\t\t\t\t'url' => get_term_link( $term, $term->taxonomy ),\n\t\t\t\t\t'type' => 'CollectionPage'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\tif ( $term->parent ) {\n\t\t\t\t$term = get_term( $term->parent );\n\t\t\t} else {\n\t\t\t\t$term = false;\n\t\t\t}\n\t\t} while ( $term );\n\t\treturn $this->setPositions( $breadcrumbs );\n\t}",
"private function retrieve_term_description()\n {\n }",
"public function getLanguageMapping();",
"public function entryTaxonomyCollection($term)\n\t{\n\t\tProfiler::start('FINDER - ENTRY TAXONOMY COLLECTION');\n\n\t\t// First get taxonomy\n\t\t$taxonomy = app('krustr.taxonomies')->findBySlug(Request::segment(2));\n\n\t\tif ($taxonomy)\n\t\t{\n\t\t\t$term = $this->termRepository->findBySlug($term);\n\n\t\t\tif ($term)\n\t\t\t{\n\t\t\t\t$entries = $this->entryRepository->allPublishedByTerm($term->id, $this->channel->resource);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn App::abort(404);\n\t\t\t}\n\n\t\t\tView::share('term', $term);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn App::abort(404);\n\t\t}\n\n\t\t// Share content\n\t\tView::share('entries', $entries);\n\t\tView::share('pagination', $this->entryRepository->pagination());\n\t\tView::share('taxonomy', $taxonomy);\n\n\t\t// Views that we need to search for\n\t\t$views = array(\n\t\t\t$this->channel->name.'_'.$taxonomy->name_singular,\n\t\t\t$this->channel->name.'_taxonomy',\n\t\t\t$taxonomy->name_singular,\n\t\t\t'taxonomy_'.$taxonomy->name_singular,\n\t\t\t$this->channel->resource_singular.'_collection',\n\t\t\t$this->channel->resource,\n\t\t\t$this->channel->resource.'_collection',\n\t\t\t'taxonomy',\n\t\t\t'collection',\n\t\t\t'index',\n\t\t);\n\n\t\tProfiler::end('FINDER - ENTRY TAXONOMY COLLECTION');\n\n\t\t// The view\n\t\treturn $this->render($views);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an alter table sql template | public function alterTable()
{
return new StandardDialect\AlterTableSqlTemplate();
} | [
"public function prepareAlter() {\n\t\t$q = 'ALTER TABLE ' . $this->quote_db ( $this->_table_prefix . $this->create_table ) . ' ';\n\t\tif (isset ( $this->create_definition )) {\n\t\t\tif (is_array ( $this->create_definition )) {\n\t\t\t\t$first = true;\n\t\t\t\tforeach ( $this->create_definition as $def ) {\n\t\t\t\t\tif ($first) {\n\t\t\t\t\t\t$first = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$q .= ', ';\n\t\t\t\t\t}\n\t\t\t\t\t$q .= $def ['action'] . ' ' . $def ['type'] . ' ' . $def ['spec'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$q .= 'ADD ' . $this->create_definition;\n\t\t\t}\n\t\t}\n\t\treturn $q;\n\t}",
"private function compileAlterTable() {\n\t\t$query = array('ALTER TABLE', Grammar::compileName($this->schema->prefix($this->table)));\n\t\t$specifications = array();\n\n\t\t// Add commands\n\t\tforeach ($this->commands as $command) {\n\t\t\t$specifications[] = (string)$command;\n\t\t}\n\n\t\t// Add columns\n\t\tforeach ($this->columns as $column) {\n\t\t\t$specifications[] = (string)$column;\n\t\t}\n\n\t\t// Delimit the specifications by commas\n\t\t$query[] = implode(', ', $specifications);\n\n\t\treturn str_join($query);\n\t}",
"public function compile_create()\n\t{\n\t\tif (count($this->_columns) === 0)\n\t\t{\n\t\t\t// Add increments to empty tables\n\t\t\t$this->increments('id');\n\t\t}\n\n\t\t// Get columns\n\t\t$columns = implode(', ', $this->get_columns());\n\n\t\t// Get constraints\n\t\t$constraints = $this->compile_constraints();\n\n\t\t//\n\t\t$sql = 'create table '.$this->_db->quote_table($this->_table).' ('.$columns.')';\n\n\t\tif (count($constraints) > 0)\n\t\t{\n\t\t\t$sql .= ' '.join(', ', $constraints);\n\t\t}\n\n\t\treturn $sql;\n\t}",
"public function toSql()\n\t\t{\n\t\t\t// TODO: @DG Improve TableDefinition::toSql\n\t\t\t$fieldsSql = array();\n\t\t\tforeach ($this->fields as $field)\n\t\t\t{\n\t\t\t\t/* @var $field FieldDefinition */\n\t\t\t\t$fieldsSql[] = $field->toSql();\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($this->indexes as $index)\n\t\t\t{\n\t\t\t\t/* @var $index IndexDefinition */\n\t\t\t\t$fieldsSql[] = $index->toSql();\n\t\t\t}\n\t\t\t\n\t\t\treturn \"CREATE TABLE \".($this->allowExisting ? \"IF NOT EXISTS \" : \"\").\"`\".\n\t\t\t\tDBM::escape(DBM::$tablePrefix.$this->name).\"` (\\n \".\n\t\t\t\timplode(\",\\n \", $fieldsSql).\"\\n)\";\n\t\t}",
"public function getCreationSQL()\n {\n return 'ALTER TABLE '.$this->tablename.' ADD CONSTRAINT '\n .$this->indexname.' FOREIGN KEY (' . $this->basecolumns . ') '\n . ' REFERENCES '.$this->reference.' (' . $this->referencecolumns . ') '\n . ' on delete cascade on update restrict ;';\n }",
"public function createSQL() {\n\t\treturn <<<SQL\nCREATE TABLE if not exists $this->tablename (\n id int(11) NOT NULL AUTO_INCREMENT, \n userid int(11) NOT NULL, \n semester char(4) NOT NULL, \n section char(3) NOT NULL, \n role char(1) NOT NULL, \n metadata mediumtext, \n created datetime NOT NULL, \n PRIMARY KEY (id), \n INDEX (semester), \n INDEX (section), \n INDEX (role));\nSQL;\n\n\t}",
"function create_table()\n {\n }",
"private function generateCreateTableSQL_Oracle() {\n\t\t$content = \"\";\n\t\t$endLineChar = ($this->exportTarget == \"newTab\") ? \"<br />\\n\" : \"\\n\";\n\t\t$prefix = ($this->exportTarget == \"newTab\") ? \" \" : \" \";\n\n\t\tif ($this->isFirstBatch) {\n\t\t\tif ($this->includeDropTable) {\n\t\t\t\t$dropTableEndLine = ($this->exportTarget == \"newTab\") ? \"<br /><br /><hr size=\\\"1\\\" />\\n\" : \"\\n\\n\";\n\t\t\t\t$content .= \"DROP TABLE {$this->backquote}{$this->tableName}{$this->backquote};{$dropTableEndLine}\";\n\t\t\t}\n\n\t\t\tif ($this->createTable) {\n\t\t\t\t$content .= \"CREATE TABLE {$this->backquote}{$this->tableName}{$this->backquote} ($endLineChar\";\n\t\t\t\tif ($this->primaryKey == \"default\") {\n\t\t\t\t\t$content .= \"{$prefix}{$this->backquote}id{$this->backquote} number primary key,$endLineChar\";\n\t\t\t\t}\n\n\t\t\t\t$cols = array();\n\t\t\t\tforeach ($this->template as $dataType) {\n\t\t\t\t\t// figure out the content type. Default to MEDIUMTEXT, then use the specific SQLField_MySQL, then the SQLField\n\t\t\t\t\t$columnTypeInfo = \"MEDIUMTEXT\";\n\t\t\t\t\tif (isset($dataType[\"columnMetadata\"][\"SQLField_Oracle\"])) {\n\t\t\t\t\t\t$columnTypeInfo = $dataType[\"columnMetadata\"][\"SQLField_Oracle\"];\n\t\t\t\t\t} else if (isset($dataType[\"columnMetadata\"][\"SQLField\"])) {\n\t\t\t\t\t\t$columnTypeInfo = $dataType[\"columnMetadata\"][\"SQLField\"];\n\t\t\t\t\t}\n\t\t\t\t\t$cols[] = \"{$prefix}{$this->backquote}{$dataType[\"title\"]}{$this->backquote} $columnTypeInfo\";\n\t\t\t\t}\n\n\t\t\t\t$content .= implode(\",$endLineChar\", $cols);\n\n\t\t\t\tif ($this->primaryKey == \"default\") {\n\t\t\t\t\t$content .= \",$endLineChar{$prefix}PRIMARY KEY ({$this->backquote}id{$this->backquote})$endLineChar) AUTO_INCREMENT=1;{$endLineChar}{$endLineChar}\";\n\t\t\t\t} else if ($this->primaryKey == \"none\") {\n\t\t\t\t\t$content .= \"$endLineChar);{$endLineChar}{$endLineChar}\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$colNamesStr = \"\";\n\t\tif ($this->backquote) {\n\t\t\t$quoted = Utils::enquoteArray($this->data[\"colData\"], \"`\");\n\t\t\t$colNamesStr = implode(\",\", $quoted);\n\t\t} else {\n\t\t\t$colNamesStr = implode(\",\", $this->data[\"colData\"]);\n\t\t}\n\n\t\t$numRows = count($this->data[\"rowData\"]);\n\t\t$numCols = count($this->data[\"colData\"]);\n\t\tfor ($i=0; $i<$numRows; $i++) {\n\t\t\tif ($this->sqlStatementType == \"insert\") {\n\t\t\t\t$quoted = Utils::enquoteArray($this->data[\"rowData\"][$i], \"'\");\n\t\t\t\t$rowDataStr = implode(\",\", $quoted);\n\t\t\t\t$content .= \"INSERT INTO {$this->backquote}{$this->tableName}{$this->backquote} ($colNamesStr) VALUES ($rowDataStr);$endLineChar\";\n\t\t\t} else {\n\n\t\t\t\t$pairs = array();\n\t\t\t\tfor ($j=0; $j<$numCols; $j++) {\n\t\t\t\t\t$colName = $this->data[\"colData\"][$j];\n\t\t\t\t\t$colValue = \"\\\"\" . $this->data[\"rowData\"][$i][$j] . \"\\\"\";\n\t\t\t\t\t$pairs[] = \"{$this->backquote}{$colName}{$this->backquote} = $colValue\";\n\t\t\t\t}\n\n\t\t\t\t$pairsStr = implode(\", \", $pairs);\n\t\t\t\t$rowNum = $this->currentBatchFirstRow + $i;\n\t\t\t\t$content .= \"UPDATE {$this->backquote}{$this->tableName}{$this->backquote} SET $pairsStr WHERE {$this->backquote}id{$this->backquote} = $rowNum;$endLineChar\";\n\t\t\t}\n\t\t}\n\n\t\treturn $content;\n\t}",
"public function compileTableAlterFields()\n\t{\n\t\treturn 'ALTER TABLE '.\n\t\t\t$this->quoteIdentifier($this->query['table']).' '.\n\t\t\t$this->compilePartFields('alter');\n\t}",
"public function compileTableCreate()\n\t{\n\t\t$sql = 'CREATE TABLE ';\n\t\t$this->query['ifNotExists'] and $sql .= 'IF NOT EXISTS ';\n\t\t$sql .= $this->quoteIdentifier($this->query['table']).' ( ';\n\t\t$sql .= $this->compilePartFields('create');\n\t\t$sql .= $this->compilePartIndexes();\n\t\t$sql .= ' ) '.$this->compilePartEngine();\n\t\t$sql .= $this->compilePartCharset($this->query['charset']);\n\t\treturn $sql;\n\t}",
"function create_table(){\n global $wpdb;\n\n require_once(ABSPATH . \"wp-admin\" . '/includes/upgrade.php');\n\n $table_name = $wpdb->base_prefix . $this->table;\n\n $sql = \"CREATE TABLE IF NOT EXISTS $table_name (\n id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n post_id bigint(20) unsigned,\n blog_id mediumint(9) NOT NULL,\n post_author bigint(20) unsigned,\n post_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_date_gmt datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_content longtext,\n post_title text,\n post_excerpt text,\n post_status varchar(20) DEFAULT 'post_status',\n post_type varchar(20) DEFAULT 'post',\n post_modified_gmt datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_modified datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n guid varchar(255),\n UNIQUE KEY id (id)\n );\";\n\n dbDelta( $sql );\n }",
"private function getSchemaSQL(): string\n {\n return <<<EOF\ncreate table if not exists companies\n(\n id integer not null\n constraint companies_pk\n primary key autoincrement,\n name text not null,\n registration_code text not null,\n email text not null,\n phone text not null,\n comment text\n) \nEOF;\n }",
"function generateDDL()\n\t{\n\t\t$out[] = 'CREATE TABLE ' . $this->_ro_tableName;\n\t\t$out[] = '(';\n\t\tforeach ( $this->_fields as &$field )\n\t\t{\n\t\t\t$int[] = tab(1) . $field->generateDDL();\n\t\t}\n\t\tif ( count( $this->_primaryKey ) > 0 )\n\t\t{\n\t\t\tforeach ( $this->_primaryKey as &$field )\n\t\t\t{\n\t\t\t\t$pk[] = $field->name;\n\t\t\t}\n\n\t\t\t$int[] = tab(1) . 'PRIMARY KEY(' . implode( ',', $pk ) . ')';\n\t\t}\n\n\t\t$out[] = implode( \",\\n\", $int );\n\n\t\tif ( $this->_engine != '' )\n\t\t{\n\t\t\t$out[] = \") ENGINE={$this->_engine};\\n\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$out[] = \");\\n\";\n\t\t}\n\n\t\t$tableDDL = implode( \"\\n\", $out );\n\n\t\t$out = array(); // recycle this variable now that we're done with it\n\n\t\tforeach ( $this->_foreignKey as &$fk )\n\t\t{\n\t\t\t$out[] = $fk->generateDDL();\n\t\t}\n\t\t$tableDDL .= implode( \"\\n\", $out ) . \"\\n\";\n\n\t\t$out = array();\n\t\tforeach ( $this->_idxDefs as &$idx )\n\t\t{\n\t\t\t$out[] = $idx->generateDDL();\n\t\t}\n\n\t\t$tableDDL .= implode( \"\\n\", $out ) . \"\\n\";\n\n\t\treturn $tableDDL;\n\t}",
"function create_table($table=\"\",$opt=array(),$fields=array()) {\n global $config;\n $glue=array();\n if (!empty($opt['force'])) {\n $glue[]=\"DROP\";\n $glue[]=!empty($opt['temporary']) ? \"TEMPORARY\" :\"\";\n $glue[]=\"TABLE IF EXISTS \"._wrap($table).\";\\n\";\n execute(trim(join(\" \",$glue)));\n $glue=array();\n }\n $glue[]=\"CREATE\";\n $glue[]=!empty($opt['temporary']) ? \"TEMPORARY\":\"\";\n $glue[]=\"TABLE IF NOT EXISTS \"._wrap($table);\n if (!(isset($opt['id']) && !$opt['id']) ) //no primary key option\n {\n $pkey=!empty($opt['primary_key']) ? _wrap($opt['primary_key']) : 'id';\n if (!isset($config['fields'][$pkey]))\n $config['fields']=array_merge(array($pkey=>\"\"),$config['fields']);\n t_column($pkey,'integer',array('unsigned'=>true,'autoincrement'=>true,'primary_key'=>true));\n }\n if (!empty($config['indexes']))\n foreach($config['indexes'] as $key=>$val)\n $config['fields'][]=$val;\n $glue[]=\"\\n(\\n\".join(\",\\n\",$config['fields']).\"\\n)\";\n $glue[]=!empty($opt['comment']) ? 'COMMENT=\"'.$opt['comment'].'\"' : \"\";\n $glue[]=!empty($opt['options']) ? $opt['options'] : \"ENGINE = InnoDB /*!40100 DEFAULT CHARSET utf8 COLLATE utf8_general_ci */\";\n array_walk($glue,'trim');\n $glue[]=\";\";\n execute(trim(join(\" \",$glue)));\n if (!empty($config['trigger'])) {\n $name=array_keys($config['trigger']);\n foreach($config['trigger'] as $field=>$value)\n $config['trigger'][$field]=\"NEW.\"._wrap($field).\"=\"._escape($value);\n execute(\"CREATE TRIGGER `\".$table.\"_insert_\".implode('_',$name).\"` BEFORE INSERT ON \"._wrap($table).\n \"\\nFOR EACH ROW SET\\n\\t\".implode(\",\\n\\t\",$config['trigger']));\n }\n _clear_options();\n}",
"private function generate_create_table_query(){\n \n $update_values=$this->update_values;\n \n $create_values=str_replace('=',' ', str_replace(\"'\",\"\",$this->update_values));\n \n // generate the query string.\n $this->generated_query=\"CREATE TABLE IF NOT EXISTS \".$this->table_name.\" (\".$create_values.\")\";\n \n return $this->generated_query;\n \n }",
"protected function createOldTable()\n {\n $this->setUpNewTable();\n $this->getSchemaManager()->createTable($this->getOldTable());\n }",
"protected function createMigrationTable()\n {\n $migration_table = $this->config_file->getMigrationTable();\n\n $resource = $this->db_adapter->query(\"\n CREATE TABLE $this->migration_table (\n file VARCHAR PRIMARY KEY,\n ran_at TIMESTAMP DEFAULT NOW()\n );\n \");\n }",
"public function createMigrationsTable (): void {\n $this->pdo->exec(createTableMigrationSql());\n }",
"public function setTableDefinition()\n {\n if (!$this->_options['created']['disabled'])\n {\n $this->hasColumn(\n $this->_options['created']['name'],\n $this->_options['created']['type'],\n null,\n $this->_options['created']['options']\n );\n }\n if (!$this->_options['updated']['disabled'])\n {\n $this->hasColumn(\n $this->_options['updated']['name'],\n $this->_options['updated']['type'],\n null,\n $this->_options['updated']['options']\n );\n }\n $this->addListener(new Doctrine_Template_Listener_Signable($this->_options));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the filename of the corresponding GeoIP Database | function geoip_db_filename($database)
{
} | [
"public function getDatabasePath()\n {\n $cityPath = $this->getLibDir() . DS . 'GeoLiteCity.dat';\n $countryPath = $this->getLibDir() . DS . 'GeoIP.dat';\n\n if ($this->isCityDbType()) {\n return $cityPath;\n } else {\n return $countryPath;\n }\n\n return $path;\n }",
"#[Pure]\nfunction geoip_db_filename($database)\n{\n}",
"protected function getDatabaseFile() : string\n\t{\n\t\t$path = \"{$this->getRoot()}/{$this->global->path->db}\";\n\t\treturn Stringify::formatPath($path, true);\n\t}",
"public function getGeoIPDatabase()\n {\n return $this->geoIPDatabase;\n }",
"function GET_DATABASE_FILE_PATH()\n\t{\n\t\treturn SITE_URL().\"database_backup.php\";\n\t}",
"public function getDatabaseFilename() {\n return $this->filename;\n }",
"private function _get_dbd_cache_filename()\n {\n return $this->datapath . \".\" . $this->database_name\n . $this->db_fileextension . \".php\";\n }",
"public function getDatabaseFile()\n {\n\t\t$r = null;\n\n\t\tif (!isset($this->_configuration[CFG_PATH_TO_SQLITE_DATABASE])) {\n\t\t\t$r = dirname(__FILE__) . \"/svn2db.sqlite\";\n\t\t} else {\n\t\t\t$r = $this->_configuration[CFG_PATH_TO_SQLITE_DATABASE];\n\t\t}\n\n\t\treturn $r;\n }",
"protected function getDbFile(): string\n {\n $src = $this->input->getOption('db-source') ?: $this->guessSource();\n if ($src != 'lando' && $src != 'drush' && $src != 'file') {\n throw new InvalidOptionException(\"db-source can only be 'lando', 'drush', or 'file'\");\n }\n\n $this->output->writeln(\"<info>Getting SQL file from source '{$src}'</info>\");\n\n if ($src == 'file') {\n if (!$this->input->getOption('db-file')) {\n throw new InvalidOptionException(\"db-file is required if db-source is set to 'file'\");\n }\n return realpath($this->input->getOption('db-file'));\n }\n\n // Get SQL from Lando or Drush.\n $sqlFileName = tempnam(sys_get_temp_dir(), 'axldb');\n $drushCmd = 'drush sql:dump > ' . $sqlFileName;\n if ($src == 'lando') {\n $drushCmd = 'lando ' . $drushCmd;\n }\n\n $this->execCmd($drushCmd);\n return $sqlFileName;\n }",
"protected function getCityFilename()\n {\n return __DIR__.'/../../database/data/brazilian-cities.csv';\n }",
"public static function getGeoIPDatabaseTypeFromFilename($filename)\n {\n foreach (self::$dbNames as $key => $names) {\n foreach ($names as $name) {\n if ($name === $filename) {\n return $key;\n }\n }\n }\n return false;\n }",
"protected function getDbFile(): string\n {\n $src = $this->options->getDbSource() ?: $this->guessSource();\n $validOptions = ['lando', 'ddev', 'drush', 'file'];\n if (!in_array($src, $validOptions)) {\n throw new InvalidOptionException(\"db-source can only be one of 'lando', 'ddev', 'drush', or 'file'\");\n }\n\n $this->output->writeln(\"<info>Getting SQL file from source '{$src}'</info>\");\n\n if ($src == 'file') {\n if (!$this->input->getOption('db-file')) {\n throw new InvalidOptionException(\"db-file is required if db-source is set to 'file'\");\n }\n return realpath($this->input->getOption('db-file'));\n }\n\n // Get SQL from Lando or Drush.\n $sqlFileName = tempnam(sys_get_temp_dir(), 'axldb');\n $drushCmd = 'drush sql:dump > ' . $sqlFileName;\n if ($src == 'lando') {\n $drushCmd = 'lando ' . $drushCmd;\n }\n if ($src == 'ddev') {\n $drushCmd = 'ddev ' . $drushCmd;\n }\n\n $this->execCmd($drushCmd);\n return $sqlFileName;\n }",
"private function filename() {\n\t\t\t$now = $this -> now();\n\t\t\t$now = str_replace(' ', '_', $now);\n\t\t\t$now = str_replace(':', '-', $now);\n\t\t\t$backup_file = WWW_ROOT . 'bakap_databeis' . DS . $now . '.sql';\n\t\t\treturn $backup_file;\n\t\t}",
"public function GetSQLFile() {\n\t\treturn realpath(__DIR__.\"/database.sql\");\n\t}",
"public function get_database_dump_filename() {\n\n\t\tif ( empty( $this->database_dump_filename ) )\n\t\t\t$this->set_database_dump_filename( 'database_' . $this->database . date('m') . '.sql' );\n\n\t\treturn $this->database_dump_filename;\n\n\t}",
"function getDbURI($db_name)\n\t{\n\t\treturn $this->splCharReplace($this->zoho_url.urlencode($this->userEmail).\"/\".urlencode($db_name));\n\t}",
"function get_db() {\n backup_migrate_include('destinations', 'files', 'filters', 'profiles');\n\n $file = new backup_file();\n // Clone the default settings so we can make changes without them leaking out of this function.\n $settings = clone _backup_migrate_profile_saved_default_profile();\n $settings->source_id = 'db';\n $settings->filters['compression'] = 'none';\n\n // Execute the backup on the db with the default settings.\n $file = backup_migrate_filters_backup($file, $settings);\n\n // Generate a tmp file with the correct final title (because ArchiveTar doesn't seem to allow renaming).\n $tmpdir = backup_migrate_temp_directory();\n $filepath = $tmpdir . '/database.sql';\n rename($file->filepath(), $filepath);\n\n return $filepath;\n }",
"public function getGeoIp(){\n $reader = new Reader(dirname(__FILE__) . '/../data/GeoLite2-City.mmdb');\n // $ipaddress = $_SERVER['REMOTE_ADDR'];\n // $record = $reader->city($ipaddress);\n $record = $reader->city('192.199.248.75');\n return $record->country->isoCode;\n }",
"public function pathToSQLFile();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default presenter set for the application. | public function setDefaultPresenter() {
$this->presenter = DEFAULT_PRESENTER . 'Presenter';
} | [
"public function presenter()\n {\n return \"App\\\\Presenters\\\\PostPresenter\";\n }",
"public function getPresenter();",
"public function setPresenter($presenter);",
"public function presenter()\n {\n return PageFractalPresenter::class;\n }",
"protected function presenter()\n {\n return UserPresenter::class;\n }",
"public function presenter()\n {\n return ActivityFractalPresenter::class;\n }",
"public function getPresenterName(): string\n {\n return 'PagePresenter';\n }",
"public static function setPresenter($presenter)\n {\n static::$presenter = $presenter;\n }",
"public function presenter()\n {\n return MediaFractalPresenter::class;\n }",
"public function setPresenter($presenter)\n\t{\n\t\t$this->presenter = $presenter;\n\t}",
"public function setPresenter($presenter)\n {\n $this->presenter = $presenter;\n }",
"public function getPresenterClass()\n {\n return UserPresenter::class;\n }",
"public function presenter()\n {\n \treturn DetalleEscuelaPresenter::class;\n }",
"public function presenter()\n {\n //return RolePresenter::class;\n }",
"public function presenter()\n {\n return ContactFractalPresenter::class;\n }",
"public static function getPresenterDirectory()\n\t{\n\t\treturn app_path('Http/Presenters/');\n\t}",
"public function getPresenter()\n {\n if (! $this->__presenter) {\n if ($class = $this->getPresenterClass()) {\n $presenter = App::make($class);\n } else {\n $presenter = new Presenter;\n }\n\n $presenter->setModel($this);\n\n $this->__presenter = $presenter;\n }\n\n return $this->__presenter;\n }",
"public function getDefaultRevisionPresenter()\n {\n return 'Sofa\\Revisionable\\Lumen\\Presenter';\n }",
"public function present()\n {\n if (! isset($this->presenterInstance)) {\n $this->presenterInstance = (new ReflectionClass($this->presenter))\n ->newInstanceArgs([$this]);\n }\n\n return $this->presenterInstance;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the config class for the incremental snapshot processor | public function getConfigClass() {
return TabularDatasetIncrementalSnapshotProcessorConfiguration::class;
} | [
"public function getConfigClass() {\n return TabularDatasetSnapshotProcessorConfiguration::class;\n }",
"public function getConfigClass();",
"public function getConfigClass() {\n return null;\n }",
"public function getConfigClass() {\n return TabularDatasourceImportProcessorConfiguration::class;\n }",
"protected function getContainerClass()\n {\n // In order to avoid collisions between kernels use a dedicated name\n return parent::getContainerClass().Container::camelize($this->getConfigDirectory());\n }",
"public function getExportableClass()\n {\n return $this->config->getGroupeClass();\n }",
"public function getDataProcessorClass(): string\n {\n return get_class($this->dataProcessor);\n }",
"public function getServiceConfigClass()\n {\n $serviceName = $this->config->getActiveService();\n\n if (!isset($this->serviceData[$serviceName]['service_config'])) {\n throw new \\Exception('Service config not defined.');\n }\n\n return $this->serviceData[$serviceName]['service_config'];\n }",
"protected function _getGridTypeConfig()\n {\n return Mage::getSingleton('customgrid/grid_type_config');\n }",
"abstract public function getConfigType();",
"public function forClass($class) {\n\t\tif (isset(self::$for_class_instances[$class])) {\n\t\t\treturn self::$for_class_instances[$class];\n\t\t}\n\t\telse {\n\t\t\treturn self::$for_class_instances[$class] = new Config_ForClass($class);\n\t\t}\n\t}",
"protected function getCollectorClasses()\n {\n if (is_null($this->collectorClasses)) {\n $config = config('sule.bank-statements.collector');\n $type = $config['type'];\n\n if ( ! isset($config[$type])) {\n throw new RuntimeException('No collector type available');\n }\n\n if (empty($config[$type])) {\n throw new RuntimeException('No collectors available');\n }\n\n $this->collectorClasses = $config[$type];\n }\n\n return $this->collectorClasses;\n }",
"public function get_config_factory_class() {\n\t\treturn __NAMESPACE__ . '\\ConfigFactory';\n\t}",
"protected static function get_class() {\n\t\tif ( ! did_action( 'plugins_loaded' ) ) {\n\t\t\twc_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before plugins_loaded.', 'woocommerce' ), '3.5.0' );\n\t\t}\n\n\t\treturn apply_filters( 'woocommerce_queue_class', self::$default_cass );\n\t}",
"public function getAutoConfig()\n {\n return $this->config;\n }",
"private function getModuleClass()\n {\n return $this->aModuleConfiguration[$this->sModuleName]['object'];\n }",
"public function getInstanceClass()\n {\n return $this->instance_class;\n }",
"protected function getClass(): string\n {\n return $this->config->className(\n static::ELEMENT,\n $this->argument('name')\n );\n }",
"protected function getClass(): string\n {\n return $this->config->className(\n static::ELEMENT,\n (string)$this->argument('name')\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display files changed between 'config_old' and 'config_new' directories. | public function configChanges($opts = ['show|s' => FALSE]) {
$this->yell('This command is deprecated, you should use config:export-plus and config:import-plus instead', 40, 'red');
$output_style = '-qbr';
$config_old_path = $this->application_root . '/' . $this->config_old_directory;
$config_new_path = $this->application_root . '/' . $this->config_new_directory;
if (isset($opts['show']) && $opts['show']) {
$output_style = '-ubr';
}
$results = $this->taskExec("diff -N -I \" - 'file:.*\" $output_style $config_old_path $config_new_path")
->run()
->getMessage();
$results_array = explode("\n", $results);
return $results_array;
} | [
"function dir_diffs($dir1, $dir2) {\n\n\t// dir1 should be old, dir2 new\n\n if (!is_dir($dir1) || !is_dir($dir2))\n {\n return \"Not a folder\\n\";\n }\n\n $differences = array();\n\n $d1 = dir($dir1);\n $d2 = dir($dir2);\n\n while (false !== ($entry = $d1->read()))\n {\n if ($entry != '.' && $entry != '..' && $entry != \".DS_Store\")\n {\n \tif (!file_exists($dir2.'/'.$entry)) {\n \t$differences[] = $dir1.'/'.$entry.echoc(' no longer exists', \"RED\", true);\n }\n else if (is_dir($dir1.'/'.$entry)) {\n \t$differences = array_merge($differences, dir_diffs($dir1.\"/\".$entry, $dir2.\"/\".$entry));\n \t}\n else {\n\t\t\t\tif (md5_file($dir1.'/'.$entry) != md5_file($dir2.'/'.$entry)) {\n \t$differences[] = $dir1.'/'.$entry.echoc(' updated', 'MAGENTA', true);\n }\n }\n }\n }\n $d1->close();\n\n while (false !== ($entry = $d2->read()))\n {\n if ($entry != '.' && $entry != '..' && $entry != \".DS_Store\")\n {\n if (!file_exists($dir1.'/'.$entry)) {\n \t$differences[] = $dir1.'/'.$entry.\" is \".echoc('new', \"GREEN\", true);\n }\n }\n }\n $d2->close();\n\n return $differences;\n\n}",
"function dir() {\n // get list of config files from config folder\n $file_filter = \"/db/\";\n helper(['config_db']);\n $config_files = get_model_config_db_list($file_filter);\n asort($config_files);\n echo \"<h3>Config DB Files</h3>\\n\";\n echo \"| <a href='\" . config('App')->pwiki . \"DMS_Config_DB_Help'>Help</a> | \";\n echo \"<ul>\\n\";\n foreach ($config_files as $config_db) {\n $linkHtml = $this->_make_page_family_contents_link($config_db, $config_db);\n echo \"<li>$linkHtml</li>\";\n }\n echo \"</ul>\\n\";\n }",
"function drush_drupal8_common_check_config_changes() {\n $sync_storage = \\Drupal::service('config.storage.sync');\n $active_storage = \\Drupal::service('config.storage');\n $config_manager = \\Drupal::service('config.manager');\n\n $storage_comparer = new StorageComparer($sync_storage, $active_storage, $config_manager);\n\n $source_list = $sync_storage->listAll();\n $change_list = $storage_comparer->createChangelist();\n if (empty($source_list) || !$change_list->hasChanges()) {\n drush_print('No configuration changes.');\n return;\n }\n\n // We have configuration changes.\n exit(1);\n}",
"function _ding2_utils_changed() {\n $modules = array();\n $files=`ls`;\n foreach (explode(\"\\n\", $files) as $dir) {\n if ($dir == 'ding2' || $dir == 'ting-client') {\n // Ignore the profile and client.\n continue;\n }\n if (is_dir($dir . '/.git')) {\n chdir($dir);\n // Look for 7.x-X tags.\n $tags = explode(\"\\n\", `git tag -l 7.x-*| sort -r -V`);\n if (!$tags[0]) {\n // Only fall back to oldstyle vX tags if no 7.x-X style tags exists.\n $tags = explode(\"\\n\", `git tag -l v* | sort -r`);\n }\n if (!$tags[0]) {\n drush_log(dt(\"No tags found in @module, ignoring.\", array('@module' => $dir)), 'warning');\n chdir('..');\n continue;\n }\n $tag = $tags[0];\n $latest = preg_replace('/^[^\\d]+/', '', $tag);\n $log = `git log --oneline $tag..HEAD`;\n\n $modules[$dir] = array(\n 'tag' => $tag,\n 'version' => $latest,\n 'changed' => FALSE,\n );\n if ($log) {\n $modules[$dir]['changed'] = TRUE;\n $modules[$dir]['log'] = $log;\n }\n chdir('..');\n }\n }\n\n return $modules;\n}",
"public function getOldFiles();",
"public static function legacyConfigFiles( Event $event )\n {\n $io = $event->getIO();\n $io->write( \"\\n\" . __METHOD__ . \"\\nSymlinking config.php file(s) to legacy folder\" );\n\n $baseDir = getcwd();\n\n $legacyPath = $baseDir . \"/\" . self::getLegacyPath( $event );\n $legacyTargetDir = $legacyPath;\n $legacyConfigDir = self::getSetting( 'legacy-configfiles-dir', $event, 'legacy' );\n\n $i = 0;\n $configs = glob( $legacyConfigDir . \"/config*\" );\n foreach( $configs as $c )\n {\n if ( is_dir( $c ) )\n continue;\n $i++;\n\n $symlink = $legacyTargetDir . \"/\" . basename( $c );\n\n if ( file_exists( $symlink ) && !self::is_link( $symlink ) )\n {\n if ( !rename( $symlink, $symlink . \".bak\" ) )\n throw new \\Exception( \"Config file \". basename($c) . \" in ezpublish_legacy folder exists and is not a symlink\" );\n }\n\n if (!self::is_link( $symlink ) )\n {\n $io->write( \"Symlinking config file: \" . basename( $c ) );\n symlink($c, $symlink);\n }\n else\n {\n $io->write( \"Config file: \" . basename( $c ) . \" is already a symlink\" );\n }\n }\n\n $io->write( \"Symlink config.php done ($i files found)\\n\" );\n }",
"public function show_changes($new,$browser=false) {\n if ($browser) {\n if (!function_exists('wikidiff2_do_diff')) { \n dl('php_wikidiff2.so');\n }\n if (!function_exists('wikidiff2_do_diff')) {\n $route = 'diff';\n } else {\n $route = 'browser';\n }\n } else {\n $route = 'browser';\n }\n \n if (!$browser) {\n $type = shell_exec('type colordiff');\n if (false !== strpos($type,'colordiff is')) {\n $command = 'colordiff';\n } else {\n shell_exec('type diff');\n if (false !== strpos($type,'diff is')) {\n $command = 'diff';\n }\n }\n \n if ($command) {\n file_put_contents('.pillardiffold',$this->text . \"\\n\");\n file_put_contents('.pillardiffnew',$new . \"\\n\");\n\n Pillar::report (str_pad(\" {$this->title} \",60,'#',STR_PAD_BOTH) . \"\\n\\n\" . exec(\"$command -u .pillardiffold .pillardiffnew --label Old --label New\") . \"\\n\" . str_pad(\"\",60,'#',STR_PAD_BOTH),PILLAR_ACTION);\n \n unlink('.pillardiffold');\n unlink('.pillardiffnew');\n return;\n } else {\n $route = 'browser';\n }\n }\n \n if ($route == 'browser') { //it must, but checking anyway for sanity's sake...\n if (!function_exists('wikidiff2_do_diff')) {\n Pillar::report(\"No preview software (wikidiff2/colordiff/diff) available\",PILLAR_ERROR); //we only get here if the colordiff/diff checking has failed above as well\n return;\n }\n file_put_contents('.pillarpreview.htm',str_replace('COMPLETETEXT',$new,str_replace('REPLACETITLE',$this->title,str_replace('REPLACETHISPLEASE',wikidiff2_do_diff($this->text,$new,2),file_get_contents('template.htm'))))); //sorry, Anomie\n \n system (($browser ? 'firefox' : $browser) . \" .pillarpreview.htm &\");\n return;\n } else {\n throw new PillarException();\n }\n }",
"public function detectChanges() {\n\t\t$changedDirectories = array();\n\t\t$changedFiles = $this->detectChangedFiles($this->monitoredFiles);\n\n\t\tforeach ($this->monitoredDirectories as $path) {\n\t\t\tif (!isset($this->directoriesAndFiles[$path])) {\n\t\t\t\t$this->directoriesAndFiles[$path] = \\TYPO3\\Flow\\Utility\\Files::readDirectoryRecursively($path);\n\t\t\t\t$this->directoriesChanged = TRUE;\n\t\t\t\t$changedDirectories[$path] = \\TYPO3\\Flow\\Monitor\\ChangeDetectionStrategy\\ChangeDetectionStrategyInterface::STATUS_CREATED;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->directoriesAndFiles as $path => $pathAndFilenames) {\n\t\t\tif (!is_dir($path)) {\n\t\t\t\tunset($this->directoriesAndFiles[$path]);\n\t\t\t\t$this->directoriesChanged = TRUE;\n\t\t\t\t$changedDirectories[$path] = \\TYPO3\\Flow\\Monitor\\ChangeDetectionStrategy\\ChangeDetectionStrategyInterface::STATUS_DELETED;\n\t\t\t} else {\n\t\t\t\t$currentSubDirectoriesAndFiles = \\TYPO3\\Flow\\Utility\\Files::readDirectoryRecursively($path);\n\t\t\t\tif ($currentSubDirectoriesAndFiles != $pathAndFilenames) {\n\t\t\t\t\t$pathAndFilenames = array_unique(array_merge($currentSubDirectoriesAndFiles, $pathAndFilenames));\n\t\t\t\t}\n\t\t\t\t$changedFiles = array_merge($changedFiles, $this->detectChangedFiles($pathAndFilenames));\n\t\t\t}\n\t\t}\n\n\t\tif (count($changedFiles) > 0) {\n\t\t\t$this->emitFilesHaveChanged($this->identifier, $changedFiles);\n\t\t}\n\t\tif (count($changedDirectories) > 0) {\n\t\t\t$this->emitDirectoriesHaveChanged($this->identifier, $changedDirectories);\n\t\t}\n\t\tif (count($changedFiles) > 0 || count($changedDirectories) > 0) $this->systemLogger->log(sprintf('File Monitor \"%s\" detected %s changed files and %s changed directories.', $this->identifier, count($changedFiles), count($changedDirectories)), LOG_INFO);\n\t}",
"function diff_diffs_show($node, $old_vid, $new_vid, $state = NULL) {\n // Attaches the CSS.\n $build['#attached'] = diff_build_attachments();\n\n $default_state = variable_get('diff_default_state_node', 'raw');\n if (empty($state)) {\n \t$state = $default_state;\n }\n $state = str_replace('-', '_', $state);\n if (!array_key_exists($state, diff_available_states())) {\n $state = $default_state;\n }\n\n // Same title as the 'Revisions' tab. Blocked by non-page requests.\n if (node_is_page($node)) {\n drupal_set_title(t('Revisions for %title', array('%title' => $node->title)), PASS_THROUGH);\n }\n $node_revisions = node_revision_list($node);\n\n $old_node = node_load($node->nid, $old_vid);\n $new_node = node_load($node->nid, $new_vid);\n\n // Generate table header (date, username, log message).\n $old_header = t('!date by !username', array(\n '!date' => l(format_date($old_node->revision_timestamp), \"node/$node->nid/revisions/$old_node->vid/view\", array('absolute' => 1)),\n '!username' => theme('username', array('account' => $node_revisions[$old_vid])),\n ));\n $new_header = t('!date by !username', array(\n '!date' => l(format_date($new_node->revision_timestamp), \"node/$node->nid/revisions/$new_node->vid/view\", array('absolute' => 1)),\n '!username' => theme('username', array('account' => $node_revisions[$new_vid])),\n ));\n\n $old_log = $old_node->log != '' ? '<p class=\"revision-log\">' . filter_xss($old_node->log) . '</p>' : '';\n $new_log = $new_node->log != '' ? '<p class=\"revision-log\">' . filter_xss($new_node->log) . '</p>' : '';\n\n // Generate previous diff/next diff links.\n $nav_suffix = ($default_state != $state) ? '/' . str_replace('_', '-', $state) : '';\n $next_vid = _diff_get_next_vid($node_revisions, $new_vid);\n if ($next_vid) {\n $next_link = l(t('Next difference >'), 'node/' . $node->nid . '/revisions/view/' . $new_vid . '/' . $next_vid . $nav_suffix, array('absolute' => 1));\n }\n else {\n $next_link = '';\n }\n $prev_vid = _diff_get_previous_vid($node_revisions, $old_vid);\n if ($prev_vid) {\n $prev_link = l(t('< Previous difference'), 'node/' . $node->nid . '/revisions/view/' . $prev_vid . '/' . $old_vid . $nav_suffix, array('absolute' => 1));\n }\n else {\n $prev_link = '';\n }\n\n $header = _diff_default_header($old_header, $new_header);\n $rows = array();\n if ($old_log || $new_log) {\n $rows['logs'] = array(\n array(\n 'data' => $old_log,\n 'colspan' => 2,\n ),\n array(\n 'data' => $new_log,\n 'colspan' => 2,\n ),\n );\n }\n $rows['navigation'] = array(\n array(\n 'data' => $prev_link,\n 'class' => array('diff-prevlink'),\n 'colspan' => 2,\n ),\n array(\n 'data' => $next_link,\n 'class' => array('diff-nextlink'),\n 'colspan' => 2,\n ),\n );\n\n $links = array();\n foreach (diff_available_states('node') as $alternative_state => $label) {\n if ($alternative_state == $state) {\n // @todo: Should we show both or just alternatives?\n }\n $links[$alternative_state] = array(\n 'title' => $label,\n 'href' => \"node/{$node->nid}/revisions/view/{$old_vid}/{$new_vid}\" . ($alternative_state == $default_state ? '' : '/' . str_replace('_', '-', $alternative_state)),\n );\n }\n if (count($links) > 1) {\n $state_links = theme('links', array(\n 'links' => $links,\n 'attributes' => array('class' => array('links', 'inline')),\n ));\n $rows['states'] = array(\n array(\n 'data' => $state_links,\n 'class' => 'diff-links',\n 'colspan' => 4,\n ),\n );\n }\n $rows = array_merge($rows, _diff_body_rows($old_node, $new_node, $state));\n\n $build['diff_table'] = array(\n '#theme' => 'table__diff__standard',\n '#header' => $header,\n '#rows' => $rows,\n '#attributes' => array('class' => array('diff')),\n '#colgroups' => _diff_default_cols(),\n '#sticky' => FALSE,\n );\n\n // Allow users to hide or set the display mode of the preview.\n if (node_is_page($node) && $view_mode = variable_get('diff_view_mode_preview_node_' . $new_node->type, 'full')) {\n $header = '';\n if ($node->vid == $new_vid) {\n $header .= '<div class=\"diff-section-title\">' . t('Current revision:') . '</div>';\n }\n else {\n $header .= '<div class=\"diff-section-title\">' . t('Revision of @new_date:', array('@new_date' => format_date($new_node->revision_timestamp))) . '</div>';\n }\n $build['diff_preview']['header']['#markup'] = $header;\n // Don't include node links or comments when viewing the diff.\n $build['diff_preview']['content'] = node_view($new_node, $view_mode);\n if (isset($build['diff_preview']['content']['links'])) {\n unset($build['diff_preview']['content']['links']);\n }\n if (isset($build['diff_preview']['content']['comments'])) {\n unset($build['diff_preview']['content']['comments']);\n }\n }\n return $build;\n}",
"protected function _getDiff($old, $new)\n {\n $changes = array();\n\n // Sort both arrays in the same way by ID\n usort($old, array(__CLASS__, 'RowCmp'));\n usort($new, array(__CLASS__, 'RowCmp'));\n $inew = 0;\n $iold = 0;\n\n // Get changes by comparing our list of folders with\n // our previous state\n while (1) {\n $change = array();\n if ($iold >= count($old) || $inew >= count($new)) {\n break;\n }\n // If ids are the same, but mod is different, a folder was\n // renamed on the client, but the server keeps it's id.\n if ($old[$iold]['id'] == $new[$inew]['id']) {\n // Both folders are still available compare mod\n if ($old[$iold]['mod'] != $new[$inew]['mod']) {\n $change['type'] = Horde_ActiveSync::CHANGE_TYPE_CHANGE;\n $change['id'] = $new[$inew]['id'];\n $change['serverid'] = $new[$inew]['serverid'];\n $changes[] = $change;\n }\n $inew++;\n $iold++;\n } else {\n if ($old[$iold]['id'] > $new[$inew]['id']) {\n // Messesge in device state has disappeared\n $change['type'] = Horde_ActiveSync::CHANGE_TYPE_DELETE;\n $change['id'] = $old[$iold]['id'];\n $change['serverid'] = $old[$iold]['serverid'];\n $changes[] = $change;\n $iold++;\n } else {\n // Message in $new is new\n $change['type'] = Horde_ActiveSync::CHANGE_TYPE_CHANGE;\n $change['id'] = $new[$inew]['id'];\n $change['serverid'] = $new[$inew]['serverid'];\n $changes[] = $change;\n $inew++;\n }\n }\n }\n while ($iold < count($old)) {\n // All data left in _syncstate have been deleted\n $change['type'] = Horde_ActiveSync::CHANGE_TYPE_DELETE;\n $change['id'] = $old[$iold]['id'];\n $change['serverid'] = $old[$iold]['serverid'];\n $changes[] = $change;\n $iold++;\n }\n\n // New folders added on server.\n while ($inew < count($new)) {\n // All data left in new have been added\n $change['type'] = Horde_ActiveSync::CHANGE_TYPE_CHANGE;\n $change['flags'] = Horde_ActiveSync::FLAG_NEWMESSAGE;\n $change['id'] = $new[$inew]['id'];\n $change['serverid'] = $new[$inew]['serverid'];\n $changes[] = $change;\n $inew++;\n }\n\n return $changes;\n }",
"public function getChanges()\n {\n $this->lastError = false;\n\n $hashFile = $this->hashDirectory . DIRECTORY_SEPARATOR . sprintf(self::$hashfile, md5($this->directory)).($this->useCompression ? '.gz' : '');\n $changesFile = $this->hashDirectory . DIRECTORY_SEPARATOR . sprintf(self::$changesfile, md5($this->directory).'-'.date('Ymd-His')).($this->useCompression ? '.gz' : '');\n $hashes = array();\n $changes = array();\n\n if (file_exists($hashFile)) {\n try {\n $data = file_get_contents($hashFile);\n $hashes = unserialize($this->useCompression ? gzdecode($data) : $data);\n unset($data);\n } catch (\\Exception $e) {\n $this->lastError = $e;\n $hashes = array();\n }\n }\n\n $newHashes = $this->getHashes($this->directory);\n\n foreach ($newHashes as $filename => $info) {\n if (!isset($hashes[$filename])) {\n $info['status'] = 'added';\n $changes[$filename] = $info;\n } elseif ($hashes[$filename] !== $info) {\n $info['status'] = 'changed: ' . join(', ', array_keys(array_diff_assoc($info, $hashes[$filename])));\n $changes[$filename] = $info;\n unset($hashes[$filename]);\n } else {\n unset($hashes[$filename]);\n }\n }\n\n foreach ($hashes as $filename => $info) {\n $info['status'] = 'deleted';\n $changes[$filename] = $info;\n }\n unset($hashes);\n\n file_put_contents(\n $hashFile,\n $this->useCompression ? gzencode(serialize($newHashes), 9) : serialize($newHashes)\n );\n \n if (count($changes)) {\n file_put_contents(\n $changesFile,\n $this->useCompression ? gzencode(serialize($changes), 9) : serialize($changes)\n );\n }\n\n return $changes;\n }",
"private function changedFiles()\n {\n $changedFiles = [];\n\n exec(\"git diff --name-only\", $changedFiles);\n\n return array_filter($changedFiles, function ($changedFile) {\n return pathinfo($changedFile)['extension'] === 'php';\n });\n }",
"private function _getPendingChanges(array $configData = null): array\n {\n $newItems = [];\n $changedItems = [];\n\n if ($configData === null) {\n $configData = $this->_getConfigurationFromYaml();\n }\n\n $currentConfig = $this->_getLoadedConfig();\n\n $flatConfig = [];\n $flatCurrent = [];\n\n unset($configData['dateModified'], $currentConfig['dateModified'], $configData['imports'], $currentConfig['imports']);\n\n // flatten both configs so we can compare them.\n\n $flatten = function($array, $path, &$result) use (&$flatten) {\n foreach ($array as $key => $value) {\n $thisPath = ltrim($path . '.' . $key, '.');\n\n if (is_array($value)) {\n $flatten($value, $thisPath, $result);\n } else {\n $result[$thisPath] = $value;\n }\n }\n };\n\n $flatten($configData, '', $flatConfig);\n $flatten($currentConfig, '', $flatCurrent);\n\n // Compare and if something is different, mark the immediate parent as changed.\n foreach ($flatConfig as $key => $value) {\n // Drop the last part of path\n $immediateParent = pathinfo($key, PATHINFO_FILENAME);\n\n if (!array_key_exists($key, $flatCurrent)) {\n $newItems[] = $immediateParent;\n } elseif ($flatCurrent[$key] !== $value) {\n $changedItems[] = $immediateParent;\n }\n\n unset($flatCurrent[$key]);\n }\n\n $removedItems = array_keys($flatCurrent);\n\n foreach ($removedItems as &$removedItem) {\n // Drop the last part of path\n $removedItem = pathinfo($removedItem, PATHINFO_FILENAME);\n }\n\n // Sort by number of dots to ensure deepest paths listed first\n $sorter = function($a, $b) {\n $aDepth = substr_count($a, '.');\n $bDepth = substr_count($b, '.');\n\n if ($aDepth === $bDepth) {\n return 0;\n }\n\n return $aDepth > $bDepth ? -1 : 1;\n };\n\n $newItems = array_unique($newItems);\n $removedItems = array_unique($removedItems);\n $changedItems = array_unique($changedItems);\n\n uasort($newItems, $sorter);\n uasort($removedItems, $sorter);\n uasort($changedItems, $sorter);\n\n return compact('newItems', 'removedItems', 'changedItems');\n }",
"public function alert()\r\n {\r\n if ($this->lastState === false) {\r\n $this->end(\"CHANGES COULD NOT BE CHECKED - State file was not found - might be first run ($this->cfgfile)\\n\", 0);\r\n }\r\n\r\n $diff = array_diff($this->filesFound, $this->lastState);\r\n $delta = count($diff);\r\n\r\n $this->log(\"Files differences \" . date('Y-m-d H:i:s') . \":\\n\" . implode(\"\\n\", $diff));\r\n\r\n if ($delta >= $this->critical_threshold) {\r\n $this->end(\"CRITICAL CHANGES - $delta changed files/directories ($this->cfgfile) | changes=$delta\\n\", 2);\r\n }\r\n \r\n if ($delta >= $this->warning_threshold) {\r\n $this->end(\"WARNING CHANGES - $delta changed files/directories ($this->cfgfile) | changes=$delta\\n\", 1);\r\n }\r\n\r\n // Else ..\r\n $this->end(\"NO SIGNIFICANT CHANGES - $delta changed files/directories ($this->cfgfile) | changes=$delta\\n\", 0);\r\n }",
"protected function processChangedAndNewFiles() {}",
"function _checkNewFilesPage() {\r\n\t \t\t// TODO: make it configurable\r\n\t \t\t$uploadPath = './data/upload/';\r\n\t \t\t// basicly we think: \"there are no changes\" ;-)\r\n\t \t\t$changes = false;\r\n\t \t\t\r\n\t \t\t$md5s = array();\r\n\t\t\t\r\n\t \t\t$out = '';\r\n\t\t\t// get all files\r\n\t\t\t$sql = \"SELECT file_path, file_md5, file_name\r\n\t\t\t\tFROM \" . DB_PREFIX . \"files\";\r\n\t\t\t$files_result = $this->_SqlConnection->SqlQuery($sql);\r\n\t\t\t\r\n\t\t\twhile($file = mysql_fetch_object($files_result)) {\r\n\t\t\t\t// the file still exists \r\n\t\t\t\tif(file_exists($file->file_path))\r\n\t\t\t\t\t$md5s[$file->file_path] = $file->file_md5;\r\n\t\t\t\t// the file doesn't exist\r\n\t\t\t\telse {\r\n\t\t\t\t\t$out .= \"<div class=\\\"row\\\"><label><strong>{$this->_AdminLang['remove_database_entry']}:</strong> <span class=\\\"info\\\">{$this->_AdminLang['this_file_doesnt_exist_any_longer']}</span></label><input type=\\\"checkbox\\\" name=\\\"change[]\\\" value=\\\"\" . rawurlencode(utf8_encode($file->file_path)) .\"\\\" checked=\\\"checked\\\" /> "\" . utf8_encode($file->file_name) .\""</div>\\r\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// get all files in the upload-directory\r\n\t\t\t$files = dir($uploadPath);\r\n\t\t\twhile($entry = $files->read()) {\r\n \t\t\t\tif(is_file($uploadPath . $entry))\r\n \t\t\t\t\t// exitsts this file in the database?\r\n \t\t\t\t\tif(array_key_exists($uploadPath . $entry, $md5s)) {\r\n \t\t\t\t\t\t// is it the same file we found?\r\n \t\t\t\t\t\tif(md5_file($uploadPath . $entry) != $md5s[$uploadPath . $entry])\r\n \t\t\t\t\t\t\t$out .= \"<div class=\\\"row\\\"><label><strong>{$this->_AdminLang['refresh_database_entry']}:</strong> <span class=\\\"info\\\">{$this->_AdminLang['this_insnt_the_file_which_is_registered_as_a_database_entry_under_this_name']}</span></label><input type=\\\"checkbox\\\" name=\\\"change[]\\\" value=\\\"\" . rawurlencode(utf8_encode($uploadPath . $entry)) .\"\\\" checked=\\\"checked\\\" /> "\" . utf8_encode($entry) . \""</div>\\r\\n\";\r\n \t\t\t\t\t}\r\n \t\t\t\t\t// the file doesn't exist in the database\r\n \t\t\t\t\telse\r\n \t\t\t\t\t\t$out .= \"<div class=\\\"row\\\"><label><strong>{$this->_AdminLang['add_to_database']}:</strong> <span class=\\\"info\\\">{$this->_AdminLang['this_file_isnt_registered_in_the_database']}</span></label><input type=\\\"checkbox\\\" name=\\\"change[]\\\" value=\\\"\" . rawurlencode(utf8_encode($uploadPath . $entry)) .\"\\\" checked=\\\"checked\\\" /> "\" . utf8_encode($entry) . \""</div>\\r\\n\";\r\n \t\t\t\r\n \t\t\t\t\t\t\r\n\r\n\t\t\t}\r\n\t\t\t$files->close();\r\n\t\t\t// is the output not empty? then there are some changes\r\n\t\t\tif($out != '')\r\n\t\t\t\t$changes = true;\r\n\t\t\t\t/*this_page_shows_all_files_which_are_changed_without_the_admin_interface\r\n\t\t\t\tto_apply_these_changes_select_the_files_which_should_be_updated\r\n\t\t\t\twarning:\r\n\t\t\t\tthis_page_cant_recover_deleted_files*/\r\n\t\t\t$out = \"{$this->_AdminLang['this_page_shows_all_files_which_are_changed_without_the_admin_interface']}<br />\r\n\t\t\t\t{$this->_AdminLang['to_apply_these_changes_select_the_files_which_should_be_updated']}\r\n\t\t\t\t<div class=\\\"warning\\\"><strong>{$this->_AdminLang['warning']}:</strong> {$this->_AdminLang['this_page_cant_recover_deleted_files']}</div> \r\n\t\t\t\t<fieldset>\r\n\t\t\t\t\t<legend>{$this->_AdminLang['changes']}</legend>\r\n\t\t\t\t\t<form method=\\\"post\\\" action=\\\"admin.php\\\">\r\n\t\t\t\t\t\t<input type=\\\"hidden\\\" name=\\\"page\\\" value=\\\"files\\\"/>\r\n\t\t\t\t\t\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"update_database\\\"/>\\r\\n\"\r\n\t\t\t\t. $out\r\n\t\t\t\t. \"<div class=\\\"row\\\">\\r\\n\";\r\n\t\t\t// there are no changes : show this result to the user\r\n\t\t\tif(!$changes)\r\n\t\t\t\t$out .= \"{$this->_AdminLang['there_are_no_changes']}</div>\\r\\n<div class=\\\"row\\\">\";\r\n\t\t\t// back button\r\n\t\t\t$out .= \"<a class=\\\"button\\\" href=\\\"admin.php?page=files\\\" title=\\\"{$this->_AdminLang['back']}\\\">{$this->_AdminLang['back']}</a>\\r\\n\";\r\n\r\n\t\t\t// there are changes: add a 'appyl-button'\r\n\t\t\tif($changes)\r\n\t\t\t\t$out .= \"<input type=\\\"submit\\\" class=\\\"button\\\" value=\\\"{$this->_AdminLang['apply']}\\\"/>\\r\\n\";\r\n\t\t\t\t\r\n\t\t\t$out .= \"</div>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t</fieldset>\\n\\r\";\r\n\t\t\treturn $out;\r\n\t \t}",
"function cms_config_upgrade()\n{\n\t#Get my lazy on and just do some regex magic...\n\t$newfiledir = dirname(CONFIG_FILE_LOCATION);\n\t$newfilename = CONFIG_FILE_LOCATION;\n\t$oldconfiglines = array();\n\tif (is_writable($newfilename) || is_writable($newfiledir))\n\t{\n\t\t$handle = fopen($newfilename, \"r\");\n\t\tif ($handle)\n\t\t{\n\t\t\twhile (!feof($handle))\n\t\t\t{\n\t\t\t\tarray_push($oldconfiglines,fgets($handle, 4096));\n\t\t\t}\n\t\t\tfclose($handle);\n\t\t\t$handle = fopen($newfilename, \"w\");\n\t\t\tif ($handle)\n\t\t\t{\n\t\t\t\tforeach ($oldconfiglines as $oneline)\n\t\t\t\t{\n\t\t\t\t\t$newline = trim(preg_replace('/\\$this-\\>(\\S+)/', '$config[\"$1\"]', $oneline));\n\t\t\t\t\tif ($newline != \"?>\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$newline .= \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tfwrite($handle, $newline);\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t}\n\t\t}\n\t}\n}",
"public function diff_configs()\n {\n $viewData = new ViewData();\n $deployment = $this->getDeployment('deployment_error');\n $this->checkGroupAuthByDeployment($deployment);\n $fromrev = $this->getParam('fromrev');\n $torev = $this->getParam('torev');\n if ($fromrev === false) {\n $viewData->header = $this->getErrorHeader('deployment_error');\n $viewData->error = 'Unable to detect revision to diff from...';\n $this->sendError('generic_error', $viewData);\n } elseif ($torev === false) {\n $viewData->header = $this->getErrorHeader('deployment_error');\n $viewData->error = 'Unable to detect revision to diff too...';\n $this->sendError('generic_error', $viewData);\n } elseif ($fromrev == $torev) {\n $viewData->header = $this->getErrorHeader('deployment_error');\n $viewData->error = 'Unable to diff the revisions when they are the same revision...';\n $this->sendError('generic_error', $viewData);\n }\n $shardposition = $this->getParam('shard');\n $islocked = RevDeploy::existsConsumerDeploymentLock($deployment, false, 'diff');\n if ($islocked === false) $viewData->running = false;\n else $viewData->running = true;\n $deploymentResults = RevDeploy::getConsumerDeploymentInfo($deployment, false, 'diff');\n if ((empty($deploymentResults)) && ($islocked !== false)) {\n $viewData->jobadded = false;\n $deploymentResults['timestamp'] = '0000000000';\n $viewData->output = base64_encode('Job is currently processing, this page will reload automatically...');\n } elseif ((empty($deploymentResults)) && ($islocked === false)) {\n NagPhean::init(BEANSTALKD_SERVER, BEANSTALKD_TUBE, true);\n NagPhean::addJob(\n BEANSTALKD_TUBE,\n json_encode(\n array('deployment' => $deployment, 'type' => 'diff',\n 'fromrev' => $fromrev, 'torev' => $torev,\n 'shard' => $shardposition)\n ),\n 1024, 0, 900\n );\n $viewData->jobadded = true;\n $deploymentResults['timestamp'] = '0000000000';\n $viewData->output = base64_encode('Build Process has been initiated, this page will reload automatically...');\n } elseif ((isset($deploymentResults['timestamp'])) && \n ($deploymentResults['timestamp'] < time() - 60) && ($islocked === false)) {\n NagPhean::init(BEANSTALKD_SERVER, BEANSTALKD_TUBE, true);\n NagPhean::addJob(\n BEANSTALKD_TUBE,\n json_encode(\n array('deployment' => $deployment, 'type' => 'diff',\n 'fromrev' => $fromrev, 'torev' => $torev,\n 'shard' => $shardposition)\n ),\n 1024, 0, 900\n );\n $viewData->jobadded = true;\n $viewData->output = base64_encode('Build Process has been initiated, this page will reload automatically...');\n } elseif ((isset($deploymentResults['fromrev'])) &&\n ($deploymentResults['fromrev'] != $fromrev) && ($islocked === false)) { \n NagPhean::init(BEANSTALKD_SERVER, BEANSTALKD_TUBE, true);\n NagPhean::addJob(\n BEANSTALKD_TUBE,\n json_encode(\n array('deployment' => $deployment, 'type' => 'diff',\n 'fromrev' => $fromrev, 'torev' => $torev,\n 'shard' => $shardposition)\n ),\n 1024, 0, 900\n );\n $viewData->jobadded = true;\n $viewData->output = base64_encode('Build Process has been initiated, this page will reload automatically...');\n } elseif ((isset($deploymentResults['torev'])) &&\n ($deploymentResults['torev'] != $torev) && ($islocked === false)) { \n NagPhean::init(BEANSTALKD_SERVER, BEANSTALKD_TUBE, true);\n NagPhean::addJob(\n BEANSTALKD_TUBE,\n json_encode(\n array('deployment' => $deployment, 'type' => 'diff',\n 'fromrev' => $fromrev, 'torev' => $torev,\n 'shard' => $shardposition)\n ),\n 1024, 0, 900\n );\n $viewData->jobadded = true;\n $viewData->output = base64_encode('Build Process has been initiated, this page will reload automatically...');\n } elseif ((!empty($deploymentResults)) && ($islocked !== false)) {\n $viewData->output = base64_encode('Job is currently processing, this page will reload automatically...');\n $viewData->jobadded = false;\n } else {\n $viewData->jobadded = false;\n $configdata = json_decode($deploymentResults['configs'], true);\n $deploymentData = $deploymentResults;\n unset($deploymentData['configs']);\n unset($deploymentData['output']);\n $viewData->meta = $deploymentData;\n $viewData->diff = NagDiff::diff($configdata['nagiosconfs']['from'], $configdata['nagiosconfs']['to']);\n $viewData->nagplugins = NagDiff::diff($configdata['plugins']['nagios']['from'], $configdata['plugins']['nagios']['to']);\n $viewData->cplugins = NagDiff::diff($configdata['plugins']['nrpe']['core']['from'], $configdata['plugins']['nrpe']['core']['to']);\n $viewData->splugins = NagDiff::diff($configdata['plugins']['nrpe']['sup']['from'], $configdata['plugins']['nrpe']['sup']['to']);\n }\n if ((isset($deploymentResults['starttime'])) && ($deploymentResults['timestamp'] != '0000000000')) {\n $viewData->meta['totaltime'] = $deploymentResults['timestamp'] - $deploymentResults['starttime'];\n }\n if (($viewData->jobadded === true) || ($viewData->running === true)) {\n $viewData->refresh = 15;\n }\n $viewData->deployment = $deployment;\n $viewData->action = 'diff_configs';\n $viewData->controller = 'deployment';\n $viewData->fromrev = $fromrev;\n $viewData->torev = $torev;\n $this->sendResponse('deployment_diff_configs', $viewData);\n }",
"function user_diff_diffs_show($user, $old_vid, $new_vid) {\n module_load_include('inc', 'diff', 'diff.pages');\n // Set same title as on the 'Revisions' tab for consistency\n drupal_set_title(t('Revisions for @name', array('@name' => $user->name)));\n\n $user_revisions = user_revision_list($user);\n $old_user = user_revision_load($user->uid, $old_vid);\n $new_user = user_revision_load($user->uid, $new_vid);\n // Generate table header (date, username, logmessage).\n $old_header = t('!date by !username', array(\n '!date' => l(format_date($old_user->revision_timestamp), \"user/$user->uid/revisions/$old_user->vid/view\"),\n '!username' => theme('username', array('account' => $user_revisions[$old_vid])),\n ));\n $new_header = t('!date by !username', array(\n '!date' => l(format_date($new_user->revision_timestamp), \"user/$user->uid/revisions/$new_user->vid/view\"),\n '!username' => theme('username', array('account' => $user_revisions[$new_vid])),\n ));\n\n $old_log = $old_user->log != '' ? '<p class=\"revision-log\">'. filter_xss($old_user->log) .'</p>' : '';\n $new_log = $new_user->log != '' ? '<p class=\"revision-log\">'. filter_xss($new_user->log) .'</p>' : '';\n\n // Generate previous diff/next diff links.\n $next_vid = _diff_get_next_vid($user_revisions, $new_vid);\n if ($next_vid) {\n $next_link = l(t('next diff >'), 'user/'. $user->uid .'/revisions/view/'. $new_vid .'/'. $next_vid);\n }\n else {\n $next_link = '';\n }\n $prev_vid = _diff_get_previous_vid($user_revisions, $old_vid);\n if ($prev_vid) {\n $prev_link = l(t('< previous diff'), 'user/'. $user->uid .'/revisions/view/'. $prev_vid .'/'. $old_vid);\n }\n else {\n $prev_link = '';\n }\n\n $cols = _diff_default_cols();\n $header = _diff_default_header($old_header, $new_header);\n $rows = array();\n if ($old_log || $new_log) {\n $rows[] = array(\n array(\n 'data' => $old_log,\n 'colspan' => 2\n ),\n array(\n 'data' => $new_log,\n 'colspan' => 2\n )\n );\n }\n $rows[] = array(\n array(\n 'data' => $prev_link,\n 'class' => array('diff-prevlink'),\n 'colspan' => 2\n ),\n array(\n 'data' => $next_link,\n 'class' => array('diff-nextlink'),\n 'colspan' => 2\n )\n );\n $rows = array_merge($rows, _user_diff_body_rows($old_user, $new_user));\n $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('class' => array('diff')), 'cols' => $cols));\n\n if ($user->vid == $new_vid) {\n $output .= '<div class=\"diff-section-title\">'. t('Current revision:') .'</div>';\n }\n else {\n $output .= '<div class=\"diff-section-title\">'. t('Revision of !new_date:', array('!new_date' => format_date($new_user->revision_timestamp))) .'</div>';\n }\n // Don't include node links (final argument) when viewing the diff.\n $output .= drupal_render(user_view($new_user, 'full'));\n return $output;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to change the gallery html for wpgreet | function wpgreet_post_gallery( $val, $attr )
{
if ($val == "") {
remove_filter('post_gallery','wpgreet_post_gallery',9999);
$val=gallery_shortcode($attr);
add_filter('post_gallery','wpgreet_post_gallery',9999,2);
}
global $post;
$pid = $post->ID;
// wp-greet optionen aus datenbank lesen
$wpg_options = wpgreet_get_options();
// check if we shall connect wp-greet
// load connected gallery pages
$connectus = in_array((string) $pid,$wpg_options['wp-greet-galarr']);
// add the filter for attachment links:
if ($connectus) {
$dom = new DOMDocument;
libxml_use_internal_errors(true);
$e = $dom->loadHTML($val);
if ($e === true) {
$anchors = $dom->getElementsByTagName('a');
foreach ($anchors as $anchor) {
$anc = $anchor->getAttribute('href');
$ancnew = wpgreet_post_gallery_link($anc,$pid);
$anchor->setAttribute('href', $ancnew);
}
// remove carousel because we want to go to the greet form
$divs = $dom->getElementsByTagName('div');
foreach ($divs as $div) {
$div->removeAttribute('data-carousel-extra');
}
$val = $dom->saveHTML();
}
}
return $val;
} | [
"function ejos_wrap_gallery_tag( $output, $tag, $attr, $m ) {\n \n if ($tag == 'gallery')\n $output = '<div class=\"gallery-container\">' . $output . '</div>';\n\n return $output;\n}",
"function gallery_display($content_to_display)\n {\n \t$pattern_recog = array(\n \t \"left\" => array(\"{\",\"{\"), \n \t \"right\" => array(\"}\",\"}\"), \n \t \"center\" => array(\"{\",\"}\")\n );\n \n \tforeach ($pattern_recog as $float => $direction) {\n \t\t\n \t\t$galleryPattern = \"*\".$direction[0].\"{2}(gallery:[A-Za-z0-9_ \\-]+)\".$direction[1].\"{2}*\";\n \t\t$gallerySlugs = getFilterIds($content_to_display, $galleryPattern);\n \t\t$galleries = Array();\n \t\t\n \t\tif ( count($gallerySlugs)>0 ) {\n \t\t\t$galleriesTagged = Array();\n \t\t\t\n \t\t\tforeach ( $gallerySlugs as $slug ) {\n \t\t\t\t\n \t\t\t\t// check to see if the gallery is followed by a closing 'p' tag\n \t\t\t\t$tag_check = substr($content_to_display, strpos($content_to_display, $slug) + strlen($slug), 6);\n \t\t\t\tif (substr_count($tag_check, \"</p>\")) { $galleriesTagged[] = true; } else { $galleriesTagged[] = false; }\n \t\t\t\t\n \t\t\t\t$sploded = explode(\":\", $slug);\n \t\t\t\t$galleries[] = Galleries::FindBySlug( $sploded[1] );\n \t\t\t}\n \t\t}\n \n foreach ( $galleries as $key => $gallery ) {\n \t\t\t\n \t\t\tif ( is_object($gallery) ) {\n \t\t\t\t$replacement = '<figure id=\"js-gallery_'.$gallery->slug.'\" class=\"hcd-photo hcd-photo__'.$float.' js-gallery\" >';\n \t\t\t\t$first = true;\n \t\t\t\t\n \t\t\t\tforeach ( $gallery->get_photos() as $photo ) {\n \t\t\t\t\t\n \t\t\t\t\tif ($first) { $class=\"hcd-photo--link__show\"; $first = false; } else { $class=\"hcd-photo--link__hide\"; }\n \t\t\t\t\t\n \t\t\t\t\t$url = $photo->getPublicUrl(); \n \t\t\t\t\t$caption = cleanupSpecialChars($photo->caption); \n \t\t\t\t\t\n \t\t\t\t\t$replacement .= '<a class=\"hcd-photo--link '.$class.' js-popup\" href=\"'.$url.'\" title=\"'.$caption.'\"><img src=\"'.$url.'\" alt=\"'.$caption.'\" /></a>';\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t$replacement .= '<figcaption class=\"hcd-photo--caption\">'.$gallery->name.' (Click for more)</figcaption></figure>';\n \t\t\t\t$content_to_display = updateContent( $content_to_display, \"*\".$direction[0].\"{2}gallery:{$gallery->slug}\".$direction[1].\"{2}*\", $replacement );\n \t\t\t\n \t\t\t} else {\n \t\t\t\t$content_to_display = \"<span class=\\\"database_error\\\">HCd>CMS Warning: Gallery “{$sploded[1]}” not found!</span> \".$content_to_display; \n \t\t\t}\n \t\t}\n \t}\n \treturn($content_to_display);\n }",
"public function gallery() {\n\t\t$c = 1;\n\t\t$columns = $this->settings['columns'];\n\t\t$default_button_text = $this->settings['default_button_text'];\n\t\t$blocks = md_post_meta( array( 'gallery_blocks', 'blocks' ) );\n\t\t$title = md_post_meta( array( 'gallery_blocks', 'title' ) );\n\t\t$text = md_post_meta( array( 'gallery_blocks', 'text' ) );\n\t\tinclude( 'template.php' );\n\t}",
"function ipress_loop_content_gallery() {\n\t\tget_template_part( 'templates/loop/content-gallery' );\n\t}",
"function nm_wp_gallery_set_include() {\r\n\t\tnm_add_page_include( 'wp-gallery' );\r\n\t\t\r\n\t\treturn ''; // Returning an empty string will output the default WP gallery\r\n\t}",
"function jig_blank_gallery($output, $attr) {\r\n\t\t\treturn '';\r\n\t\t}",
"function mb_gallery_shortcode_handler($atts, $content = null) {\n\t// Set variable to include JavaScript when the shortcode is on a page\n\tglobal $add_mb_script,$gallery;\n\t$add_mb_script = true;\n \t\t\n \t// Build the HTML for the gallery\n\t$mb_html = $gallery->mb_create_gallery_function();\n \n \treturn $mb_html; //send back text to replace shortcode in post\n \n}",
"function renderGalleries()\n\t{\n\t\tglobal $modx;\n\n\t\t// Retrieve chunks/default templates from disk\n\t\t$tpl = ($this->config['tpl'] == '') ? file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.default.txt') : $modx->getChunk($this->config['tpl']);\n\t\t$item_tpl = ($this->config['itemTpl'] == '') ? file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.default.txt') : $modx->getChunk($this->config['itemTpl']);\n\t\t$item_tpl_first = ($this->config['itemTplFirst'] == '') ? @file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.first.txt') : $modx->getChunk($this->config['itemTplFirst']);\n\t\t$item_tpl_alt = ($this->config['itemTplAlt'] == '') ? @file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.alt.txt') : $modx->getChunk($this->config['itemTplAlt']);\n\t\t$item_tpl_last = ($this->config['itemTplLast'] == '') ? @file_get_contents($this->config['snippetPath'] . $this->config['type'] . '/tpl.item.last.txt') : $modx->getChunk($this->config['itemTplLast']);\n\n\t\t// Hide/show docs based on configuration\n\t\t$docSelect = '';\n\t\tif ($this->config['docId'] != '*' && !empty($this->config['docId']))\n\t\t{\n\t\t\tif (strpos($this->config['docId'], ',') !== false)\n\t\t\t{\n\t\t\t\t$docSelect = '(';\n\t\t\t\tforeach (explode(',', $this->config['docId']) as $docId)\n\t\t\t\t\t$docSelect .= \"parent = '\" . $docId . \"' OR\";\n\t\t\t\t$docSelect = rtrim($docSelect, ' OR ') . ') AND ';\n\t\t\t}\n\t\t\telse\n\t\t\t\t$docSelect = \"parent = '\" . $this->config['docId'] . \"' AND \";\n\t\t}\n\t\tif ($this->config['excludeDocs'] > 0)\n\t\t{\n\t\t\tif (strpos($this->config['excludeDocs'], ',') !== false)\n\t\t\t{\n\t\t\t\tforeach (explode(',', $this->config['excludeDocs']) as $docId)\n\t\t\t\t\t$docSelect .= \"parent != '\" . $docId . \"' AND \";\n\t\t\t}\n\t\t\telse\n\t\t\t\t$docSelect .= \"parent != '\" . $this->config['excludeDocs'] . \"' AND \";\n\t\t}\n\n\t\t$phx = new PHxParser(); // Instantiate PHx\n\n\t\t$items = '';\n\n\t\t// Retrieve list of documents under the requested id\n\t\t$filter = \"published = '1' AND type = 'document' AND \" . $docSelect . \" hidemenu <= '\" . $this->config['ignoreHidden'] . \"'\";\n\t\t$result = $modx->db->select(\"id, pagetitle, longtitle, description, alias, pub_date, introtext, editedby, editedon, publishedon, publishedby, menutitle\", $modx->getFullTableName('site_content'), $filter, $this->config['gallerySortBy'] . ' ' . $this->config['gallerySortDir'],(!empty($this->config['limit']) ? $this->config['limit'] : \"\"));\n $recordCount = $modx->db->getRecordCount($result);\n\t\tif ($recordCount > 0)\n\t\t{\n\t\t $count = 1;\n\t\t\twhile ($row = $modx->fetchRow($result))\n\t\t\t{\n\t\t\t\t$item_phx = new PHxParser();\n\n\t\t\t\t// Get total number of images for total placeholder\n\t\t\t\t$total_result = $modx->db->select(\"filename\", $modx->getFullTableName($this->galleriesTable), \"content_id = '\" . $row['id'] . \"'\");\n $total = $modx->db->getRecordCount($total_result);\n \n\t\t\t\t// Fetch first image for each gallery, using the image sort order/direction\n\t\t\t\t$image_result = $modx->db->select(\"filename\", $modx->getFullTableName($this->galleriesTable), \"content_id = '\" . $row['id'] . \"'\", $this->config['sortBy'] . ' ' . $this->config['sortDir'], '1');\n\t\t\t\tif ($modx->db->getRecordCount($image_result) > 0)\n\t\t\t\t{\n\t\t\t\t\t$image = $modx->fetchRow($image_result);\n\t\t\t\t\tforeach ($image as $name => $value)\n\t\t\t\t\t\t$item_phx->setPHxVariable($name, trim($value));\n\t\t\t\t\t$item_phx->setPHxVariable('images_dir', $this->config['galleriesUrl'] . $row['id'] . '/');\n\t\t\t\t\t$item_phx->setPHxVariable('thumbs_dir', $this->config['galleriesUrl'] . $row['id'] . '/thumbs/');\n\n\t\t\t\t\tforeach ($row as $name => $value)\n\t\t\t\t\t\t$item_phx->setPHxVariable($name, trim($value));\n \n // Get template variable output for row and set variables as needed\n $row_tvs = $modx->getTemplateVarOutput('*',$row['id']);\n\t\t\t\t\tforeach ($row_tvs as $name => $value)\n\t\t\t\t\t\t$item_phx->setPHxVariable($name, trim($value));\n\n\t\t\t\t\t$item_phx->setPHxVariable('total', $total);\n\n \t\t\t\tif(!empty($item_tpl_first) && $count == 1){\n \t\t\t\t$items .= $item_phx->Parse($item_tpl_first);\n \t\t\t\t} else if(!empty($item_tpl_last) && $count == $recordCount){\n \t\t\t\t$items .= $item_phx->Parse($item_tpl_last);\n \t\t\t\t} else if(!empty($item_tpl_alt) && $count % $this->config['itemAltNum'] == 0){\n \t\t\t\t$items .= $item_phx->Parse($item_tpl_alt);\n \t\t\t\t} else {\n \t\t\t\t$items .= $item_phx->Parse($item_tpl);\n \t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\t$phx->setPHxVariable('items', $items);\n\n\t\treturn $phx->Parse($tpl); // Pass through PHx;\n\t}",
"public function media_html() {\n//\t\t\tif($this->get_option($this->prefix.'_show_image', 'on') == 'on') {\n\t\t\t\t$this->get_simple_thumb();\n//\t\t\t}\n\t\t}",
"function _gallery($data){\n global $conf;\n global $lang;\n $ret = '';\n\n $files = $this->_findimages($data);\n\n //anything found?\n if(!count($files)){\n $ret .= '<div class=\"nothing\">'.$lang['nothingfound'].'</div>';\n return $ret;\n }\n\n // prepare alignment\n $align = '';\n $xalign = '';\n if($data['align'] == 1){\n $align = ' gallery_right';\n $xalign = ' align=\"right\"';\n }\n if($data['align'] == 2){\n $align = ' gallery_left';\n $xalign = ' align=\"left\"';\n }\n if($data['align'] == 3){\n $align = ' gallery_center';\n $xalign = ' align=\"center\"';\n }\n if(!$data['_single']){\n if(!$align) $align = ' gallery_center'; // center galleries on default\n if(!$xalign) $xalign = ' align=\"center\"';\n }\n\n $page = 0;\n\n // build gallery\n if($data['_single']){\n $ret .= $this->_image($files[0],$data);\n $ret .= $this->_showname($files[0],$data);\n $ret .= $this->_showtitle($files[0],$data);\n }elseif($data['cols'] > 0){ // format as table\n $close_pg = false;\n\n $i = 0;\n foreach($files as $img){\n\n // new page?\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n $ret .= '<div class=\"gallery_page gallery__'.$data['galid'].'\" id=\"gallery__'.$data['galid'].'_'.(++$page).'\">';\n $close_pg = true;\n }\n\n // new table?\n if($i == 0 || ($data['paginate'] && ($i % $data['paginate'] == 0))){\n $ret .= '<table>';\n\n }\n\n // new row?\n if($i % $data['cols'] == 0){\n $ret .= '<tr>';\n }\n\n // an image cell\n $ret .= '<td>';\n $ret .= $this->_image($img,$data);\n $ret .= $this->_showname($img,$data);\n $ret .= $this->_showtitle($img,$data);\n $ret .= '</td>';\n $i++;\n\n // done with this row? cloase it\n $close_tr = true;\n if($i % $data['cols'] == 0){\n $ret .= '</tr>';\n $close_tr = false;\n }\n\n // close current page and table\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n if ($close_tr){\n // add remaining empty cells\n while($i % $data['cols']){\n $ret .= '<td></td>';\n $i++;\n }\n $ret .= '</tr>';\n }\n $ret .= '</table>';\n $ret .= '</div>';\n $close_pg = false;\n }\n\n }\n\n if ($close_tr){\n // add remaining empty cells\n while($i % $data['cols']){\n $ret .= '<td></td>';\n $i++;\n }\n $ret .= '</tr>';\n }\n\n if(!$data['paginate']){\n $ret .= '</table>';\n }elseif ($close_pg){\n $ret .= '</table>';\n $ret .= '</div>';\n }\n }else{ // format as div sequence\n $i = 0;\n $close_pg = false;\n foreach($files as $img){\n\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n $ret .= '<div class=\"gallery_page gallery__'.$data['galid'].'\" id=\"gallery__'.$data['galid'].'_'.(++$page).'\">';\n $close_pg = true;\n }\n\n $ret .= '<div>';\n $ret .= $this->_image($img,$data);\n $ret .= $this->_showname($img,$data);\n $ret .= $this->_showtitle($img,$data);\n $ret .= '</div> ';\n\n $i++;\n\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n $ret .= '</div>';\n $close_pg = false;\n }\n }\n\n if($close_pg) $ret .= '</div>';\n\n $ret .= '<br style=\"clear:both\" />';\n }\n\n // pagination links\n $pgret = '';\n if($page){\n $pgret .= '<div class=\"gallery_pages\"><span>'.$this->getLang('pages').' </span>';\n for($j=1; $j<=$page; $j++){\n $pgret .= '<a href=\"#gallery__'.$data['galid'].'_'.$j.'\" class=\"gallery_pgsel button\">'.$j.'</a> ';\n }\n $pgret .= '</div>';\n }\n\n return '<div class=\"gallery'.$align.'\"'.$xalign.'>'.$pgret.$ret.'<div class=\"clearer\"></div></div>';\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 video_gallery(){\n \t\tnev_videogallery::render_settings();\n \t}",
"function rudr_custom_html_template($html, $id, $caption, $title, $align, $url, $size, $alt) {\r\n \r\n\t/*\r\n\t * First of all lets operate with image sizes\r\n\t */\r\n\tlist( $img_src, $width, $height ) = image_downsize($id, $size);\r\n\t$hwstring = image_hwstring($width, $height);\r\n \r\n\t/*\r\n \t * Second thing - get the image URL $image_thumb[0]\r\n\t */\r\n\t$image_thumb = wp_get_attachment_image_src( $id, $size );\r\n \r\n\tif($url){ // if user wants to print the link with image\r\n\t\t$out .= '<a href=\"' . $url . '\" data-lightbox=\"frontpage-image-gallery\">';\r\n\t}\r\n\t$out .= '<img src=\"'. $image_thumb[0] .'\" alt=\"'.$alt.'\" '.$hwstring.'/>';\r\n\tif($url){\r\n\t\t$out .= '</a>';\r\n\t}\r\n\treturn $out; // the result HTML\r\n}",
"public function sp_video_gallery_page( )\n {\n require_once SAMPLE_DIR . '/dmc/dm-cloud-video-gallery-html.php';\n }",
"function vntd_post_gallery($type,$thumb_size) {\n\t\t\n\tglobal $post;\n\n\t$gallery_images = get_post_meta($post->ID, 'gallery_images', true);\n\t\n\tif(!$gallery_images && has_post_thumbnail()) { // No Gallery Images\t\n\t\t$url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), $thumb_size);\n\t\treturn '<img src=\"'.$url[0].'\" alt=\"'.get_the_title($post->ID).'\">';\n\t}\n\t\n\techo '<div class=\"vntd-post-gallery vntd-post-gallery-'.$type.'\">';\t\n\t\t\t\t\n\tif($type == \"slider\") { // Slider Gallery\n\t\t\n\t\techo '<div class=\"flexslider vntd-flexslider\"><ul class=\"slides\">';\n\t\t\t\t\t\n\t\t$ids = explode(\",\", $gallery_images);\t\t\t\t\n\t\tforeach($ids as $id){\n\t\t\t$image_url = wp_get_attachment_image_src($id, $thumb_size);\n\t\t\techo '<li><img src=\"'.esc_url($image_url[0]).'\" alt></li>';\n\t\t}\n\t\t\t\t\t\t\t\n\t\techo '</ul></div>';\t\t\t\t\n\t\t\n\t} elseif($type == \"list\" || $type == \"list_lightbox\") {\n\t\t\n\t\t$ids = explode(\",\", $gallery_images);\t\t\t\t\n\t\tforeach($ids as $id){\n\t\t\t//global $post = $post=>$id;\n\t\t\t$image_url = wp_get_attachment_image_src($id, $thumb_size);\n\t\t\t$big_url = wp_get_attachment_image_src($id, 'fullwidth-auto');\n\t\t\techo '<div class=\"vntd-gallery-item\">';\n\t\t\tif($type == \"list_lightbox\") echo '<a href=\"'.esc_url($big_url[0]).'\" class=\"hover-item\" rel=\"gallery[gallery'.$post->ID.']\" title=\"'.get_post($id)->post_excerpt.'\"><span class=\"hover-overlay\"></span><span class=\"hover-icon hover-icon-zoom\"></span>';\t\t\t\n\t\t\techo '<img src=\"'.esc_url($image_url[0]).'\" alt>';\n\t\t\tif($type == \"list_lightbox\") echo '</a>';\n\t\t\techo '</div>';\n\t\t}\t\n\t\n\t} else {\t\n\t\t// If Lightbox Gallery\n\t\techo '<div class=\"featured-image-holder\"><div class=\"gallery clearfix\">';\n\t\t\n\t\t$ids = explode(\",\", $gallery_images);\n\t\tif($gallery_images) $id = array_shift(array_values($ids));\n\t\t$image_url = wp_get_attachment_image_src($id, $thumb_size);\n\t\t$large_url = wp_get_attachment_image_src($id, 'large');\n\t\techo '<a class=\"hover-item\" href=\"'.esc_url($large_url[0]).'\" rel=\"gallery[gallery'.$post->ID.']\"><img src=\"'.esc_url($image_url[0]).'\"><span class=\"hover-overlay\"></span><span class=\"hover-icon hover-icon-zoom\"></span></a>';\n\t\t\t\n\t\t\tif($gallery_images){\n\t\t\t\n\t\t\t\techo '<div class=\"lightbox-hidden\">';\t\t\t\t\t\t\t\t\n\t\t\t\tforeach(array_slice($ids,1) as $id){\n\t\t\t\t\techo '<a href=\"'.wp_get_attachment_url($id).'\" rel=\"gallery[gallery'. $post->ID .']\"></a>';\n\t\t\t\t}\n\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\techo '</div></div>';\n\t\t\n\t}\n\t\n\techo '</div>';\n}",
"function add_gallery()\n{\n}",
"function gallery_prettyPhoto ($content) {\n // add checks if you want to add prettyPhoto on certain places (archives etc).\n return str_replace(\"<a\", \"<a rel='wp-prettyPhoto[gallery]'\", $content);\n }",
"function custom_gallery($atts) {\n\t\tif ( !is_admin() ) {\n\t\t\tinclude('part-gallery.php');\n\t\t}\n\t\treturn $output;\n\t}",
"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 }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders a given template string | public function renderTemplateString(string $template, array $parameters = []) : string; | [
"public function renderTemplate(string $templateString): string;",
"abstract public function renderFromStringTemplate(string $string, array $data) : string;",
"public function render(string $template, array $params = []) : string;",
"public function render( $data, $template );",
"public function render(?string $templateIdent = null): string;",
"public abstract function render($template, $vars = []);",
"public function renderTemplate(string $templateString, $context = null): string\n {\n return $this->engine()->render($templateString, $context);\n }",
"public function render($template, array $vars = array());",
"public function renderString($content, $data);",
"function render_template($template, $settings) {\n $text = file_get_contents($template); \n $text = transform_text($text, $settings);\n return $text;\n }",
"public function render()\r\r\n\t{\r\r\n\t\t$this->display($this->template_name);\r\r\n\t}",
"public function render( $template, array $data = array() );",
"public function render($template, array $data = []);",
"function render($templatePath, array $data);",
"public function render( string $template, array $context = [] ) : string\n {\n return $this->twig->render( $template, $context );\n }",
"public function render($template){\n\t\tself::$smarty->display($template.'.tpl');\n\t}",
"public function render (string $tpl, array $vars = NULL)\n {\n }",
"public function render($template = null, array $variables = []);",
"public function render () {\n\t\textract($this->variables);\n\t\tinclude $this->getTemplate();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print single tray label | public function printTrayLabel($label_text) {
if ($this->getErrStr()) {
return false;
}
$barcode = "*$label_text*";
$l1 = "{^A^H0140^V0025^L0404^S$label_text";
$l2 = "
";
$l3 = "^H0160^V0100^B102102";
$l4 = "$barcode";
$l5 = "^Q1^Z}";
$tray_label = "$l1" . "$l2" . "$l3"."$l4"."$l5";
return $this->printText($tray_label);
} | [
"public function printLabel($label)\n {\n print $label;\n }",
"public function printLabel($id = null) \n {\n if ($id) {\n $shelf = $this->Shelves->get($id);\n $lpr = new PhpNetworkLprPrinter(Configure::read('HOST'), Configure::read('PORT'));\n if ($lpr) {\n $result = $lpr->printShelfLabel($shelf->shelf_barcode);\n if (!$result) {\n $this->Flash->error(__('Error').\": \".$lpr->getErrStr());\n } else {\n $this->Flash->success(__('The label is printed out successfully.'));\n }\n } else {\n $this->Flash->error(__(\"Cannot connect to printer.\"));\n }\n return $this->redirect(['action' => 'view', $shelf->shelf_id]);\n }\n $this->Flash->error('The shelf id is missing');\n return $this->redirect($this->referer());\n }",
"public function get_label(): string {\n\t\treturn self::CONSOLE_LABEL;\n\t}",
"public function getPrintLabelButton()\n {\n $data['shipment_id'] = $this->getShipment()->getId();\n $url = $this->getUrl('adminhtml/order_shipment/printLabel', $data);\n return $this->getLayout()->createBlock(\n \\Magento\\Backend\\Block\\Widget\\Button::class\n )->setData(\n ['label' => __('Print Shipping Label'), 'onclick' => 'setLocation(\\'' . $url . '\\')']\n )->toHtml();\n }",
"public function outputlabel() {return \"\";}",
"public function build_print_label_ui($host_obj, $order)\n {\n }",
"function printLabel() {\n /**\n * <PAGE></PAGE>:\n * Pagination, used to support the printing of multiple different label pages (up to 10 sheets), not using this label means that all elements are only printed on one label page\n *\n * <SIZE>width,height</SIZE>:\n * Set label paper width and height, width label paper width (excluding backing paper), height label paper height (excluding backing paper), unit mm, such as<SIZE>40,30</SIZE>\n *\n * <TEXT x=\"10\" y=\"100\" w=\"1\" h=\"2\" r=\"0\">Text content</TEXT>:\n * Print the text, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute w is the text width magnification ratio 1-10 (default is 1)\n * Attribute h is text height magnification 1-10 (default is 1)\n * The attribute r is the rotation angle of the text (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <BC128 x=\"10\" y=\"100\" h=\"60\" s=\"1\" n=\"1\" w=\"1\" r=\"0\">1234567</BC128>:\n * Print code128 one-dimensional code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute h is the height of the barcode (default is 48)\n * Whether the attribute s can be recognized by human eyes: 0 is not recognized, 1 is recognized (default is 1)\n * The attribute n is the width of the narrow bar, expressed in dots (default is 1)\n * The attribute w is the width of bar, expressed in dots (default is 1)\n * The attribute r is the text rotation angle (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <BC39 x=\"10\" y=\"100\" h=\"60\" s=\"1\" n=\"1\" w=\"1\" r=\"0\">1234567</BC39>:\n * Print code39 one-dimensional code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute h is the height of the barcode (default is 48)\n * Whether the attribute s can be recognized by human eyes: 0 is not recognized, 1 is recognized (default is 1)\n * The attribute n is the width of the narrow bar, expressed in dots (default is 1)\n * The attribute w is the width of bar, expressed in dots (default is 2)\n * The attribute r is the rotation angle of the text (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <QR x=\"20\" y=\"20\" w=\"160\" e=\"H\">QR code content</QR>:\n * Print the QR code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute w is the width of the QR code (default is 160)\n * Attribute e is the error correction level: L 7% M 15% Q 25% H 30% (the default is H)\n * The label content is a QR code value, and the maximum cannot exceed 256 characters\n * Note: A single order can only print one QR code\n */\n\n //Set size of label paper\n$printContent= <<<EOF\n<SIZE>40,30</SIZE>\nEOF;\n\n \n //print the first label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"1/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Golden Fried Rice\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ;\n\n //print the second label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"2/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Cucumber salad\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ; \n\n //print the third label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"3/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Boston Lobster\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ; \n\n //print a barcode\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"print a barcode: \"\n .\"</TEXT>\"\n .\"<BC128 x=\\\"16\\\" y=\\\"32\\\" h=\\\"32\\\" s=\\\"1\\\" n=\\\"2\\\" w=\\\"2\\\" r=\\\"0\\\">\"\n .\"12345678\"\n .\"</BC128>\"\n .\"</PAGE>\"\n ; \n\n //print a QR code. The minimum width is 128, it will not be able to be scanned if lower than 128\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"print a QR code: \"\n .\"</TEXT>\"\n .\"<QR x=\\\"16\\\" y=\\\"32\\\" w=\\\"128\\\">\"\n .\"https://www.xpyun.net\"\n .\"</QR>\"\n .\"</PAGE>\"\n ; \n\n $request = new PrintRequest();\n $request->generateSign();\n\n //*Required*: The serial number of the printer\n $request->sn=OK_PRINTER_SN;\n\n //*Required*: The content to be printed can’t exceed 12288 bytes.\n $request->content=$printContent;\n\n //The number of printed copies is 1 by default.\n $request->copies=1;\n\n $result = xpYunPrintLabel($request);\n print $result->content->code.\"\\n\";\n print $result->content->msg.\"\\n\";\n\n //resp.data: Return to order No. correctly \n print $result->content->data.\"\\n\";\t\n}",
"public final function getBoxActionLabel()\n {\n }",
"public function getDisplayLabel();",
"public function labelPrinterContent()\n {\n $url = str_replace($this->connection->apiUrl(), '', $this->label_printer);\n\n return $this->connection->download($url);\n }",
"public function printLabelAction()\n {\n try {\n $data = Mage::helper('enterprise_rma')->decodeTrackingHash($this->getRequest()->getParam('hash'));\n\n $rmaIncrementId = '';\n if ($data['key'] == 'rma_id') {\n $this->_loadValidRma($data['id']);\n if (Mage::registry('current_rma')) {\n $rmaIncrementId = Mage::registry('current_rma')->getIncrementId();\n }\n }\n $model = Mage::getModel('enterprise_rma/shipping_info')\n ->loadPackage($this->getRequest()->getParam('hash'));\n\n $shipping = Mage::getModel('enterprise_rma/shipping');\n $labelContent = $model->getShippingLabel();\n if ($labelContent) {\n $pdfContent = null;\n if (stripos($labelContent, '%PDF-') !== false) {\n $pdfContent = $labelContent;\n } else {\n $pdf = new Zend_Pdf();\n $page = $shipping->createPdfPageFromImageString($labelContent);\n if (!$page) {\n $this->_getSession()->addError(\n Mage::helper('sales')->__('File extension not known or unsupported type in the following shipment: %s', $shipping->getIncrementId())\n );\n }\n $pdf->pages[] = $page;\n $pdfContent = $pdf->render();\n }\n\n return $this->_prepareDownloadResponse(\n 'ShippingLabel(' . $rmaIncrementId . ').pdf',\n $pdfContent,\n 'application/pdf'\n );\n }\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::logException($e);\n $this->_getSession()\n ->addError(Mage::helper('sales')->__('An error occurred while creating shipping label.'));\n }\n $this->norouteAction();\n return;\n }",
"public function ajaxProcessPrintZprnLabel()\n {\n $id_order = (int)Tools::getValue('id_order');\n $order = new Order($id_order);\n\n if (!Validate::isLoadedObject($order)) {\n exit('Order not exists');\n }\n\n $label_format = SpringXbsHelper::get(Springxbs::LABEL_FORMAT);\n $shipment = \\Db::getInstance()->getRow(\"SELECT * FROM \" . _DB_PREFIX_ . \"springxbs_shipment \n WHERE id_order = '\" . (int)$order->id . \"' AND label_format='\" . pSQL($label_format) . \"'\");\n\n if (!$shipment['label']) {\n exit('Shipment not ordered yet');\n }\n\n $label = SpringXbsHelper::decodeData($shipment['label']);\n echo $label;\n exit();\n }",
"protected function printType()\n {\n return 'Take the ' . $this->type;\n }",
"protected function getActionLabel() {}",
"protected function printTitle()\n {\n $mainTitle = \"GAME OF LIFE\";\n\n echo $this->shellOutputHelper->getCenteredOutputString($mainTitle);\n echo \"\\n\" . $this->shellOutputHelper->getCenteredOutputString($this->outputTitle) . \"\\n\\n\";\n }",
"function print_text()\r\n {\r\n print $this->get_text();\r\n }",
"public function printLabels() {\n \t\t\treturn $this->Index(array('output_format' => 'PDF'));\n\t\t}",
"function ts_print($with_label=true) \n {\n if($with_label)\n {\n if($this->labels == null)\n {\n $this->messages->m(TSLANG,\"TS_LABEL_NOT_DEFINED\", false);\n \n for($i = 0; $i < $this->len; $i++)\n {\n echo $i.\" \".$this->ts[$i].\"<br/>\";\n }\n }\n else\n {\n for($i = 0; $i < $this->len; $i++)\n {\n echo $this->labels[$i].\" - \".$this->ts[$i].\"<br/>\";\n }\n }\n }\n else\n {\n for($i = 0; $i < $this->len; $i++)\n {\n echo $this->ts[$i].\"<br/>\";\n }\n }\n }",
"public static function getLabelingNotice()\n {\n $icon = '<i class=\"icon-minus-circle hasTooltip\" title=\"XXXX\"></i>';\n return str_replace('XXXX', JText::_('COM_THM_GROUPS_NO_LABELING'), $icon);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes this smiley category. | public function delete() {
// delete database entry
$sql = "DELETE FROM wcf".WCF_N."_smiley_category
WHERE smileyCategoryID = ".$this->smileyCategoryID;
WCF::getDB()->sendQuery($sql);
// update smileys
$sql = "UPDATE wcf".WCF_N."_smiley
SET smileyCategoryID = 0
WHERE smileyCategoryID = ".$this->smileyCategoryID;
WCF::getDB()->sendQuery($sql);
} | [
"public function deleteCategory()\n {\n $pdo = DBConfig::openConnection();\n $query = $pdo->prepare('DELETE FROM categories WHERE classID=:classID');\n $query->bindValue(':classID', $this->classID, PDO::PARAM_STR);\n $query->execute();\n $query->CloseCursor();\n DBConfig::closeConnection($pdo);\n }",
"public function delete()\n {\n // Does the Category object have an ID?\n if (is_null($this->id)) {\n trigger_error ( \"Category::delete(): Attempt to delete a Category object that does not have its ID property set.\", E_USER_ERROR);\n }\n \n // Delete the Category\n $conn = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);\n $st = $conn->prepare (\"DELETE FROM category WHERE id = :id LIMIT 1\");\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT);\n $st->execute();\n $conn = null;\n }",
"public function delete()\n {\n $query = 'DELETE FROM categories WHERE id = :id';\n $rowCount = $this->db->delete($query, [':id' => $this->getId()]);\n }",
"public function delete()\n {\n $this->clearAttributeKeyCategoryTypes();\n $this->clearAttributeKeyCategoryColumnHeaders();\n $this->rescanSetDisplayOrder();\n Database::connection()->executeQuery(\n 'DELETE FROM AttributeKeyCategories WHERE akCategoryID = ?',\n array($this->akCategoryID)\n );\n }",
"public function remove() {\r\n $belonging_posts = PecBlogPost::load('category', $this);\r\n foreach ($belonging_posts as $p) {\r\n $p->remove_category($this);\r\n $p->save();\r\n }\r\n \r\n $query = \"DELETE FROM \" . DB_PREFIX . \"blogcategories WHERE cat_id='\" . $this->cat_id . \"'\";\r\n \r\n $this->database->db_connect();\r\n $this->database->db_query($query);\r\n $this->database->db_close_handle();\r\n \r\n $feed_path = CATEGORY_FEED_PATH . $this->cat_id . '.xml';\r\n if (file_exists($feed_path)) {\r\n \tunlink($feed_path);\r\n }\r\n \r\n unset($this); \r\n }",
"public function deleteCategory()\n {\n }",
"public function remove() {\n\t\t$id = $this->id;\n\t\tglobal $action, $db;\n\t\t$user = new User;\n\t\t$uri = new URI;\n\t\tif ( ! $user->can( 'remove_cats' ) ) {\n\t\t\t$uri->redirect( $uri->home() . \"/?action={$action}&id={$id}&message=noperm\" );\n\t\t\treturn;\n\t\t}\n\t\t$where = \"AND category_author = '{$user->_user()}'\";\n\t\tif ( $user->can( 'manage_user_items' ) ) {\n\t\t\t$where = null;\n\t\t}\n\t\t$get = $db->customQuery( \"SELECT * FROM {$db->tablePrefix()}categories WHERE category_id = '$id' $where\" );\n\t\t$object = $get->fetch_object();\n\t\t$remove = $db->customQuery( \"DELETE FROM {$db->tablePrefix()}categories WHERE category_id = '$id' $where\" );\n\t\t$update = $db->customQuery( \"UPDATE {$db->tablePrefix()}categories SET parent_id = '{$object->parent_id}' WHERE parent_id = '$id'\" );\n\t\t$updateLinks = $db->customQuery( \"UPDATE {$db->tablePrefix()}links SET link_category = '{$object->parent_id}' WHERE link_category = '$id'\" );\n\t\tif ( $remove == true && $update == true && $updateLinks == true ) {\n\t\t\t$uri->redirect( $uri->home() . \"/?message=cat_removed\" );\n\t\t\treturn;\n\t\t}\n\t\t$uri->redirect( $uri->home() . \"/?action={$action}&id={$id}&message=errremoving\" );\n\t\treturn;\n\t}",
"function anime_admin_category_delete() {\n}",
"public function delete() {\n \n // Does the MediaCategory object have an ID?\n if ( is_null( $this->mediaCategoryId ) ) trigger_error ( \"MediaCategory::delete(): Attempt to delete a MediaCategory object that does not have its ID property set.\", E_USER_ERROR );\n \n // Delete the MediaCategory\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $st = $conn->prepare ( \"DELETE FROM mediaCategories WHERE mediaCategoryId = :mediaCategoryId LIMIT 1\" );\n $st->bindValue( \":mediaCategoryId\", $this->mediaCategoryId, PDO::PARAM_INT );\n $st->execute();\n $conn = null;\n }",
"public function delete()\n {\n $this->removeImage();\n parent::delete();\n }",
"public function delete() {\n if ( !wp_verify_nonce( $_GET[ '_mm_nonce' ], 'delete_category' ) ) die( __( \"Security check\", MM_TEXTDOMAIN ) );\n if ( isset( $_GET[ 'category_id' ] ) && is_numeric( $_GET[ 'category_id' ] ) ) {\n Goods_Types_Model::delete( $_GET[ 'category_id' ] );\n $this->set_message( __( 'Category deleted', MM_TEXTDOMAIN ) );\n wp_redirect( 'admin.php?page='.$this->categories_page );\n exit;\n }\n else {\n $this->set_message( __( 'Can\\'t delete category', MM_TEXTDOMAIN ) );\n }\n }",
"function delete( $catID=-1 )\r\n {\r\n\r\n if ( $catID == -1 )\r\n $catID = $this->ID;\r\n\r\n $category = new eZImageCategory( $catID );\r\n\r\n $categoryList = $category->getByParent( $category );\r\n\r\n foreach ( $categoryList as $category )\r\n {\r\n $category->delete();\r\n }\r\n\r\n foreach ( $this->images() as $image )\r\n {\r\n $image->delete();\r\n }\r\n\r\n $categoryID = $category->id();\r\n\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->begin( );\r\n\r\n $res1 = $db->query( \"DELETE FROM eZImageCatalogue_Category WHERE ID='$categoryID'\" );\r\n $res2 = $db->query( \"DELETE FROM eZImageCatalogue_CategoryPermission WHERE ObjectID='$this->ID'\" );\r\n\r\n if ( ( $res1 == false ) || ( $res2 == false ) )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n\r\n }",
"public function deleteIconAction()\n {\n\t\t//SET LAYOUT\n\t\t$this->_helper->layout->setLayout('admin-simple');\n\n\t\t//GET CATEGORY ID\n\t\t$this->view->category_id = $category_id = $this->_getParam('category_id');\n\n\t\t//GET CATEGORY ITEM\n\t\t$category = Engine_Api::_()->getItem('sitegroup_category', $category_id);\n\n\t\t$this->view->close_smoothbox = 0;\n\n\t\tif( $this->getRequest()->isPost() && !empty($category->file_id)){\n\n\t\t\t//DELETE CATEGORY ICON\n\t\t\t$file = Engine_Api::_()->getItem('storage_file', $category->file_id);\n\t\t\t$file->delete();\n\n\t\t\t//UPDATE FILE ID IN CATEGORY TABLE\n\t\t\t$category->file_id = 0;\n\t\t\t$category->save();\n\n\t\t\t$this->view->close_smoothbox = 1;\n \t}\n\t\t$this->renderScript('admin-settings/delete-icon.tpl');\n\t}",
"public function deleteCategory() {\n $childCategories = $this->categoriesTable->retrieveRecord('category_id', $this->post['category']['category_id'])[0]->getChildCategories();\n\n foreach($childCategories as $childCategory) {\n $values = [\n 'category_id' => $childCategory->category_id,\n 'parent_id' => null\n ];\n\n $this->categoriesTable->save($values);\n }\n\n $this->categoriesTable->deleteRecordById($this->post['category']['category_id']);\n\n header('Location: /admin/categories');\n }",
"public function remove()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_delete_categories'))\n\t\t{\n\t\t\tshow_error(lang('unauthorized_access'), 403);\n\t\t}\n\n\t\t$group_id = ee()->input->post('content_id');\n\t\t$group = ee('Model')->get('CategoryGroup', $group_id)->first();\n\n\t\tif ( ! empty($group_id) && $group)\n\t\t{\n\t\t\t$group->delete();\n\n\t\t\tee()->logger->log_action(lang('category_groups_removed').':'.NBS.NBS.$group->group_name);\n\n\t\t\tee()->functions->clear_caching('all', '');\n\n\t\t\tee('CP/Alert')->makeInline('channels')\n\t\t\t\t->asSuccess()\n\t\t\t\t->withTitle(lang('category_groups_removed'))\n\t\t\t\t->addToBody(sprintf(\n\t\t\t\t\tlang('category_groups_removed_desc'),\n\t\t\t\t\thtmlentities($group->group_name, ENT_QUOTES, 'UTF-8')\n\t\t\t\t))\n\t\t\t\t->defer();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(lang('unauthorized_access'), 403);\n\t\t}\n\n\t\tee()->functions->redirect(ee('CP/URL')->make('categories', ee()->cp->get_url_state()));\n\t}",
"public function removeExpenceCategory(){\n\t\t$this->user = Auth::getUser();\t\t\n\t\t$user_id = $this->user->id;\t\n\t\tif(isset($_POST['toDelete'])){\n\t\t\t$paymentWayID = $_POST['toDelete'];\n\t\t\tif(Expense::removeCategory($user_id, $paymentWayID)){\n\t\t\techo (\"<p class=\\\"text-success light-input-bg\\\"><b>Usunięto kategorię wydatku</b></p>\");\n\t\t\t} else {\n\t\t\t\techo (\"<p class=\\\"text-success light-input-bg\\\"><b>Wystąpił błąd podczas usuwania kategorii wydatku</b></p>\");\n\t\t\t}\t\n\t\t} else {\n\t\t\techo (\"<p class=\\\"text-info light-input-bg\\\"><b>Wystapił błąd przy przekazywaniu wartości kategorii wydatku</b></p>\");\n\t\t}\n\t }",
"protected function deleteCategories()\n {\n $categories = $this->retailer->webCategories;\n $notFoundCategories = $categories->diff($this->storedCategories);\n $notFoundCategoryIds = $notFoundCategories->pluck('id');\n $this->retailer->webCategories()->whereIn('id', $notFoundCategoryIds)->delete();\n }",
"public function removeIncomeCategory(){\n\n\t\tif(isset($_POST['toDelete'])){\n\t\t\t$paymentWayID = $_POST['toDelete'];\n\t\t\tif(Income::removeCategory($paymentWayID)){\n\t\t\techo (\"<p class=\\\"text-success light-input-bg\\\"><b>Usunięto kategorię dochodu</b></p>\");\n\t\t\t} else {\n\t\t\t\techo (\"<p class=\\\"text-success light-input-bg\\\"><b>Wystąpił błąd podczas usuwania kategorii dochodu</b></p>\");\n\t\t\t}\t\n\t\t} else {\n\t\t\techo (\"<p class=\\\"text-info light-input-bg\\\"><b>Wystapił błąd przy przekazywaniu wartości kategorii dochodu</b></p>\");\n\t\t}\n\t }",
"protected function deleteCategories()\n {\n HelpCategory::query()->forceDelete();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the minimum version of FileMaker Server that this API works with. | public static function getMinServerVersion()
{
return self::$minServerVersion;
} | [
"public function getServerVersion(): string;",
"public function getServerVersion()\n {\n return $this->server_version;\n }",
"public function serverVersion() : string {\n return $this->getClientResponse('/api/v2/app/version');\n }",
"public function getMinimalVersion()\n {\n return $this->minimal_version;\n }",
"protected function get_minimum_supported_version()\n {\n }",
"function server_version()\n\t{\n\t\tif ($this->server_version == FALSE)\n\t\t{\n\t\t\t$this->about();\n\t\t}\n\n\t\treturn $this->server_version;\n\t}",
"function get_version_min() {\n return $this->version_min;\n }",
"function serverPHPVersion() {\n\t\treturn phpversion();\n\t}",
"function minPhpVersion()\n {\n // return by reference only exist in 5.1 and above\n if (isset($this->returns[\"byRef\"])) {\n return \"5.1.0rc1\";\n }\n\n // default: 4.0\n return \"4.0.0\"; // TODO test for real lower bound\n }",
"public function getCompatibleVersion()\n {\n return APP_VERSION;\n }",
"static function serverPHPVersion() {\n\t\treturn phpversion();\n\t}",
"public function get_min_php_version() {\n\n\t\treturn Mlp_Semantic_Version_Number_Factory::create( '5.2.4' );\n\t}",
"public function minimumPhpVersion(): string {\n\t\t\treturn $this->m_minimumPhpVersion;\n\t\t}",
"public function getMinimumSolrVersion();",
"function getPhpVersionMin() {\n\t\treturn $this->_phpVersionMin;\n\t}",
"public function getMinimumRequiredAppVersion()\n {\n if (array_key_exists(\"minimumRequiredAppVersion\", $this->_propDict)) {\n return $this->_propDict[\"minimumRequiredAppVersion\"];\n } else {\n return null;\n }\n }",
"protected function getMinWsdlVersion() {\n return \"0\";\n }",
"public function getMinPHPVersion()\n {\n // If non min set, assume current PHP version\n if (null === $this->min_php) {\n $this->min_php = PHP_VERSION;\n }\n\n return $this->min_php;\n }",
"public function getTlsMinimumVersion()\n {\n if (array_key_exists(\"tlsMinimumVersion\", $this->_propDict)) {\n return $this->_propDict[\"tlsMinimumVersion\"];\n } else {\n return null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return private properties $this>InputNames[$idx] example : $names = $fuzzy>getInputNames($idx); | public function getInputName($idx) {
return $this->InputNames[$idx];
} | [
"public function getInputNames();",
"public function getInputName($idx) {\r\n\t\treturn $this->InputNames[$idx];\r\n\t}",
"public function propertiesGetByName() {\r\n if (!$this->propertiesByNameArray) {\r\n $this->propertiesCalculateByName();\r\n }\r\n return $this->propertiesByNameArray;\r\n }",
"public function nameIdx() { return $this->_m_nameIdx; }",
"public function getIndexNames();",
"protected function createInternalPropertyNameArray(): void\n {\n $class = $this->getReflection();\n $properties = $class->getProperties(ReflectionProperty::IS_PUBLIC);\n $internal = [];\n\n foreach ($properties as $property) {\n $attribute = $property->getAttributes(PropertyName::class);\n if (!empty($attribute)) {\n $internal[$attribute[0]->getArguments()[0]] = $property->getName();\n } else {\n $internal[$property->getName()] = $property->getName();\n }\n }\n\n $this->internalPropertyNames = $internal;\n }",
"public function inputName()\n {\n if ($this->inputName) {\n $name = $this->inputName;\n } else {\n $name = $this->propertyIdent();\n }\n\n if ($this->p()['l10n']) {\n $name .= '['.$this->lang().']';\n }\n\n if ($this->multiple()) {\n $name .= '[]';\n }\n\n return $name;\n }",
"protected function getInputName(){\n if($this->_name===null)\n $this->defineNameId();\n return $this->_name;\n }",
"public function getInputName()\n\t{\n\t\treturn $this->inputName;\n\t}",
"public function getParametersPropertyName();",
"public function getFieldsGettersNames() : array\n {\n\n // Lvd.\n $result = [];\n\n // For each Field.\n foreach ($this->getFieldsNames() as $fieldName) {\n\n // Lvd.\n $fieldNameExploded = explode('_', $fieldName);\n\n // Convert every word.\n array_walk(\n $fieldNameExploded,\n function (&$value) {\n $value = ucfirst($value);\n }\n );\n\n // Save part.\n $result[] = 'get' . implode('', $fieldNameExploded);\n }\n\n return $result;\n }",
"public function getPropertyNames()\n {\n }",
"abstract function getFormFieldNames();",
"public static function property_names() {\n\t\treturn array_map( function ( $p ) { return $p['name']; } , static::properties() );\n\t}",
"public static function _getPropertyNames(): array\n {\n return [\n 'type',\n 'data',\n 'phone_number',\n 'email',\n 'files',\n 'front_side',\n 'reverse_side',\n 'selfie',\n 'translation',\n 'hash',\n ];\n }",
"public static function formInputPropertyMapping()\n\t{\n\t\treturn [\n\t\t\t'username' => 'username',\n\t\t\t'firstName' => 'firstName',\n\t\t\t'middleName' => 'middleName',\n\t\t\t'lastName' => 'lastName',\n\t\t\t'email' => 'email',\n\t\t\t'phone' => 'phone',\n\t\t];\n\t}",
"public function getInputIndex()\n {\n return $this->input_index;\n }",
"public function getProperty2Name() {}",
"public function getInput($name);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
scripts Module class constructor | function __construct()
{
$this->name = "scripts";
$this->title = "<#LANG_MODULE_SCRIPTS#>";
$this->module_category = "<#LANG_SECTION_OBJECTS#>";
$this->checkInstalled();
} | [
"function __construct(){\n // $this->modDomain = new \\App\\mod_domainBase();\n $this->modSys = new \\App\\Models\\mod_sysConfig();\n // $this->modUser = new \\App\\mod_userBase();\n }",
"function __construct(){\n // $this->modDomain = new \\App\\mod_domainBase();\n $this->modSys = new \\App\\Models\\mod_sysConfig();\n // $this->modUser = new \\App\\Models\\mod_userBase();\n }",
"function __construct($str_func)\n {\n //--- (generated code: YModule constructor)\n parent::__construct('Module', $str_func);\n //--- (end of generated code: YModule constructor)\n }",
"function __construct(string $str_func)\n {\n parent::__construct($str_func);\n $this->_className = 'Module';\n\n //--- (end of generated code: YModule constructor)\n }",
"private function __construct (){}",
"protected function _construct()\n {\n $this->setUsedModuleName('Canalweb_Actus');\n }",
"public function __construct()\n {\n $sModuleId = 'wleWallee';\n\n $this->setModuleData(array(\n 'id' => $sModuleId,\n 'title' => 'WLE Wallee',\n 'description' => 'WLE Wallee Module'\n ));\n\n $this->load($sModuleId);\n\n $this->settings = new Settings();\n $this->initLogger();\n \n if(version_compare(\"6.0.0\", $this->getConfig()->getVersion()) <= 0) {\n \t$this->request = \\OxidEsales\\Eshop\\Core\\Registry::get(\\OxidEsales\\Eshop\\Core\\Request::class);\n\t\t}\n \\OxidEsales\\Eshop\\Core\\Registry::set(get_class(), $this);\n }",
"public function __construct() {\n $this->MODULE_ID = 'zk.passrestore';\n\n $arModuleVersion = array();\n include(__DIR__ . \"/version.php\");\n $this->MODULE_VERSION = $arModuleVersion[\"VERSION\"];\n $this->MODULE_VERSION_DATE = $arModuleVersion[\"VERSION_DATE\"];\n $this->MODULE_NAME = Loc::getMessage(\"PSW_RESTORE_MODULE_NAME\");\n $this->MODULE_DESCRIPTION = Loc::getMessage(\"PSW_RESTORE_MODULE_DESC\");\n\n $this->PARTNER_NAME = Loc::getMessage(\"PSW_RESTORE_PARTNER_NAME\");\n $this->PARTNER_URI = \"http://\";\n }",
"public function __construct()\n\t{\n\t\t// Get the plugin name and folder from the class name (it's always plgFolderPluginInstallerScript) if necessary.\n\t\tif (empty($this->moduleName))\n\t\t{\n\t\t\t$class = get_class($this);\n\t\t\t$words = preg_replace('/(\\s)+/', '_', $class);\n\t\t\t$words = strtolower(preg_replace('/(?<=\\\\w)([A-Z])/', '_\\\\1', $words));\n\t\t\t$classParts = explode('_', $words);\n\n\t\t\t$this->moduleName = 'mod_' . $classParts[2];\n\t\t}\n\t}",
"public function __construct(){\n // load the app, module and component name to object params\n $this->app = 'Core';\n $this->module = 'Client';\n $this->componentName = componentName('agency');\n }",
"public function __construct()\n {\n \t// dummy constructor\t\n }",
"protected function _construct(){\n $this->setUsedModuleName('Stableflow_UserManual');\n }",
"function __construct() {\r\n $this->name=\"methods\";\r\n $this->title=\"<#LANG_MODULE_METHODS#>\";\r\n $this->module_category=\"<#LANG_SECTION_OBJECTS#>\";\r\n $this->checkInstalled();\r\n}",
"public function __construct()\n {\n $this->name = 'cm';\n $this->description = 'Create a database model.';\n $this->required = false;\n $this->alias = 'create-model';\n\n $this->exec = function ($name, $table) {\n $name = str_replace('_', '', $name);\n $name = trim($name);\n\n $table = trim($table);\n\n if (! ctype_alpha($name)) {\n sf_error(\n 'Error: Model names must only contain alphabetic characters and no spaces. '.\n 'TitleCase recommended.',\n true\n );\n\n return parameter_result_halt();\n }\n\n if (! file_exists('./src/App/Data/Models/'.$name.'.php')) {\n $template = new Template('Model.tmpl', ['name' => $name, 'table' => $table], true);\n file_put_contents(\n './src/App/Data/Models/'.$name.'.php',\n $template->parse()\n );\n\n sf_info(\n 'Created database Model in \\'src/App/Data/Models\\' with name \\''.$name.'\\'.',\n true\n );\n chmod('./src/App/Data/Models/'.$name.'.php', 0750);\n exec('composer dumpautoload >/dev/null 2>&1');\n } else {\n sf_error('Error: A Model by that name already exists.', true);\n }\n\n return parameter_result_halt();\n };\n }",
"private function generateConstructor() {\n $method = $this->class->addMethod(\"__construct\")\n ->setVisibility(\"public\")\n ->addComment(\"Class Constructor\");\n\n //load config.json file, and input component\n $lines = array(\n 'Language::loadLang(\"'. $this->module_name_underscored .'\", null, dirname(__FILE__) . DS . \"language\" . DS);',\n '$this->loadConfig(dirname(__FILE__) . DS . \"config.json\");',\n 'Loader::loadComponents($this, array(\"Input\"));',\n );\n\n foreach($lines as $l) {\n $method->addBody($l);\n }\n }",
"public function __construct(){\n\t\techo \"Constructor dari class komputer <br>\";\n\t}",
"protected function _construct() \n {\n $this->selectedModule = $this->choice('For Which Module ?',$this->modulesName());\n\t\t$this->className = 'Create'.ucfirst($this->moduleName).'Table';\n }",
"final private function __construct() {}",
"public function __construct() {\n\t\t$astman = FreePBX::create()->astman;\n\t\t$this->astman = $astman;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A list of headers to be used when a table is displayed | public function getTableHeaders()
{
return [
'Usuário', 'Plano', 'Expira em'
];
} | [
"public function getTableHeaders()\n {\n return ['#','Título','Autor','Preço'];\n }",
"public function getTableHeaders()\n {\n return ['#', 'Autor', 'Título', 'Subtítulo', 'Preço', 'Categorias'];\n }",
"public function getTableHeaders()\n {\n return ['ID', 'Nome', 'Preço anterior', 'Preço', 'Destaque', 'Ativo'];\n }",
"public function getTableHeaders()\n {\n return ['ID', 'Start Date', 'End Date', 'Cycle', 'Subdivision', 'Semester', 'Year'];\n }",
"public function indexHeaders()\n {\n $headers = '';\n\n foreach ($this->parseVisibleFields($this->parseFields($this->fields())) as $header => $data) {\n $header = $data['label'] ?? $header;\n $header = ucfirst($header);\n $order = 'desc';\n\n if ($data['sortable']) {\n if (request('order') === 'desc') {\n $order = 'asc';\n }\n\n if (request('order') === 'asc') {\n $order = 'desc';\n }\n\n $sortLink = request()->url() . '?' . http_build_query(array_merge(\n request()->all(),\n [\n 'sort_by' => strtolower($header),\n 'order' => $order,\n ]\n ));\n $icon = config('forms.html.sortable-icon', '↕');\n\n $header = \"<a href=\\\"{$sortLink}\\\">{$header} {$icon}</a>\";\n }\n\n $class = '';\n\n if (! is_null($data['table_class'])) {\n $class = \" class=\\\"{$data['table_class']}\\\"\";\n }\n\n $headers .= \"<th{$class}>{$header}</th>\";\n }\n\n $headers .= config('forms.html.table-actions-header', '<th class=\"text-right\">Actions</th>');\n\n return $headers;\n }",
"function tableHeaders($data) {\n\t\t$headerAr = Set::extract($data, '{n}.label');\n\t\t$result = '<thead>' . $this->Html->tableHeaders($headerAr) . '</thead>';\n\t\treturn $result;\n\t}",
"public function getColumnHeaders();",
"public function headings():array{\n // add headers that match the select method above\n return [\"ID\" ,\"Name\" , \"Address\" , \"City\" , \"State\" ,\"Country\",\"postcode\",\"phonenumber\",\"Email\" ,'created_at'];\n }",
"public static function getTableHeaders() {\r\n\t\t$array = self::getHeadersArray();\r\n\r\n\t\tif( $array == null ) {\r\n\t\t\t$headers = [];\r\n\t\t\treturn $headers;\r\n\t\t}\r\n\r\n\t\t$headers = self::getTableHeaderTitles( $array );\r\n\t\treturn $headers;\r\n\t}",
"public function getTimesheetViewHeaders() {\n $table_headers = array();\n $table_headers[] = t('Description');\n $day_names = array_keys($this->getTimesheetDays());\n foreach ($day_names as $day_name) {\n $table_headers[] = t('@dayname', array('@dayname' => $day_name));\n }\n $table_headers[] = t('Total');\n return $table_headers;\n }",
"public function config_table_headers()\n\t{\n\t\t\n\t}",
"public function headings(): array\n {\n return [\n 'Course ID',\n 'Course Name',\n 'Student ID',\n 'Student Name',\n 'Student Email',\n 'Enrollment Date',\n 'Shift',\n ];\n }",
"function tableHeader($headers, $shiftRight = false) {\n ($shiftRight === true)\n ? $tableHeader = \" <th></th>\\n\"\n : $tableHeader = \"\";\n\n foreach($headers AS $header)\n $tableHeader .= \" <th>$header</th>\\n\";\n\n return \" <tr>\\n$tableHeader </tr>\\n\";\n}",
"public function pi_list_header()\n {\n return '<tr' . $this->pi_classParam('listrow-header') . '><td><p>[dummy header row]</p></td></tr>';\n }",
"function getTableHeaders() {\n\t\treturn $this->Registrator->getTranslatedFieldNames($this->Registrator->listAllRegistrators($this->Session->read('Event.id')));\n\t}",
"function printheader()\n {\n $listheader = $GLOBALS['name_collonne'];\n foreach ($listheader as $key => $nom_collone) {\n echo\"<th>\".$nom_collone.\"</th>\";\n }\n }",
"private function printTableHeader() {\n\t\t$this->displayTableHeadForTimeRange(false, '7%');\n\n\t\tif (!$this->showsAllYears()) {\n\t\t\techo '<th>'.__('In total').'</th>';\n\t\t}\n\t}",
"private function table_header()\n {\n $header = '';\n $row_template = apply_filters( 'pdb-member_payments_table_header_row', '<tr>%s</tr>' );\n $cell_template = apply_filters( 'pdb-member_payments_table_header_cell', '<th class=\"%1$s-column\">%2$s</th>' );\n foreach ( $this->columns as $name => $title ) {\n $header .= sprintf( $cell_template, $name, $title );\n }\n return sprintf( $row_template, $header );\n }",
"protected function _tableHead() {\n\t\tob_start();\n\t\t?>\n\t\t<thead>\n\t<tr>\n\t\t<?php if ( $this->show_order ) : ?>\n\t\t\t<th style=\"width: 1%;\"> </th><?php endif ?>\n\t\t<th style=\"width: 10%; text-align: center\"><?php echo $this->show_display_options ? esc_html__( 'Display', 'thrive-dash' ) : esc_html__( 'Field Number', 'thrive-dash' ); ?></th>\n\t\t<th style=\"width: 17%;\"><?php echo esc_html__( \"Field Properties\", 'thrive-dash' ); ?></th>\n\t\t<th style=\"width: 23%;\"><?php echo esc_html__( \"Field Label / Description\", 'thrive-dash' ); ?></th>\n\t\t<th style=\"width: 16%;\"><?php echo esc_html__( \"Validation\", 'thrive-dash' ) ?></th>\n\t\t<th style=\"width: 10%;\"><?php echo esc_html__( \"Required Field\", 'thrive-dash' ); ?></th>\n\t\t<th><?php echo esc_html__( 'Show Icon', 'thrive-dash' ) ?></th>\n\t</tr></thead><?php\n\t\t$head = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $head;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set a random key for form validation; the key renews after the set timeout period | public static function setFormKey() {
if(!isset($_SESSION['FORMKEY']) ||
$_SESSION['FORMKEY_TIMEOUT'] < date("m/d/Y h:i:s")) {
$_SESSION['FORMKEY_TIMEOUT'] = date("m/d/Y h:i:s", time() + self::FORMKEY_TIMEOUT);
$_SESSION['FORMKEY'] = md5(static::_generateRandomString());
}
} | [
"public function regenerateValidationKey() {\n $this->saveAttributes(array(\n 'secure_key' => md5(mt_rand() . mt_rand() . mt_rand()),\n ));\n }",
"public function regenerateValidationKey() {\n $this->saveAttributes(array(\n 'validation_key' => md5(mt_rand() . mt_rand() . mt_rand()),\n ));\n }",
"public function randomKey() {}",
"function generateSessionKey(){\n\t\t // genereate session and form key\n\t\t$this->formSession['key'] = rand();\n\t\t$GLOBALS[\"TSFE\"]->fe_user->setKey('ses',$this->extKey, $this->formSession);\n\t\t$GLOBALS[\"TSFE\"]->storeSessionData();\n\t}",
"private function generateFormkey()\n {\n $ip = $_SERVER['REMOTE_ADDR'];\n // mt_rand() is better than rand()\n $uniqid = uniqid(mt_rand(), true);\n\n return md5($ip . $uniqid);\n }",
"public function randomkey($len){\n for($i=0;$i<$len;$i++){\n$key.=$this->pattern{rand(0,44)};\n }\n return $key;\n }",
"public function invalidKeyLength()\n {\n $key = new RegisterKey($this->randStr39);\n $key->getKey();\n }",
"public function getFormKey()\n {\n if (!$this->isPresent()) {\n $this->set($this->mathRandom->getRandomString(16));\n }\n return $this->escaper->escapeHtmlAttr($this->session->getData(self::FORM_KEY));\n }",
"function setFormKey($key);",
"function clearFormKey(){\n\t\t // session genereate key\n\t\t$this->formSession['key'] = null;\n\t}",
"public static function generateExpiringRandomKey()\n {\n return Yii::$app->getSecurity()->generateRandomKey() . '_' . time();\n }",
"function createKey($length, $option=0) {\r\n if ($option == 1)\r\n {\r\n $chars = \"cefhklmnrtuvwxyCEFHKLMNRTUVWXY349\";\r\n }\r\n else\r\n {\r\n $chars = \"abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-=[]{}|:><,./?`~\";\r\n }\r\n\t\r\n //srand((double)microtime()*1000000);\r\n $i = 0;\r\n $pass = '' ;\r\n\r\n while ($i < $length)\r\n {\r\n $num = mt_rand() % (strlen($chars) - 1);\r\n $tmp = substr($chars, $num, 1);\r\n $pass = $pass . $tmp;\r\n $i++;\r\n }\r\n return $pass;\r\n}",
"public function genKey(){\n\t\t$this->key = \"\";\n\t\twhile(strlen($this->key)<20){\n\t\t\t$type = chr(rand(0,2));\n\t\t\tswitch($type){\n\t\t\t\tcase 0: $this->key .= chr(rand(48,57));\n\t\t\t\tcase 1: $this->key .= chr(rand(65,90));\n\t\t\t\tdefault: $this->key .= chr(rand(97,122));\n\t\t\t}\n\t\t}\n\t}",
"protected function generateRandomKey()\n\t{\n\t\treturn rand().rand().rand().rand();\n\t}",
"function setFileNameRand($key = 1) {\n\t\t$this->_IsFileNameRand = $key;\n\t}",
"public function setRandomPassword() {\n $this->setUserPassword(rand());\n }",
"public function createKey($name){\n $this->name=$name;\n\t\t\n //in case the form has an already saved key then save it\n if(session_class::exists($this->name))\n\t\t\t$this->old_key = session_class::get($this->name);\n\t\t\n\t\t// generate the key and save it to a session\n $this->current_key=md5($_SERVER['REMOTE_ADDR'].mt_rand());\t\n $_SESSION[$this->name] = $this->current_key;\n }",
"private function generatePasswordResetKey() {\n\t\t$this->load->helper( 'string' );\n\t\treturn sprintf( '%s-%d', random_string( 'alnum', 16 ), time() );\n\t}",
"public static function StartRandomkeySession()\n\t{\n\t if(!isset($_SESSION))\n\t\t{\n\t\t session_start();\n }\n if(!isset($_SESSION[\"randomkey\"]))\n {\n\t\t $_SESSION[\"randomkey\"]=self::GenerateRandomkey();\n }\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gym_pick_module( $mode, $module, $action) pick a given module data | function gym_pick_module( $mode, $mode_module, &$return_array) {
global $phpbb_root_path, $phpEx;
$module_class = $mode . '_' . $mode_module;
$module_file = $phpbb_root_path . 'gym_sitemaps/acp/' . $module_class . '.' . $phpEx;
if ( file_exists($module_file) ) {
if (!class_exists($module_class/*, false*/)) {
include($module_file);
}
if (class_exists($module_class/*, false*/)) {
$gym_module = new $module_class($this);
if ( method_exists($gym_module, 'acp_module')) {
$return_array[$mode][$mode_module] = $gym_module->acp_module();
}
}
}
} | [
"public function selectmodule()\n {\n // Get what I'm supposed to load as a module from the URL \n // Or passed variables\n if($_POST['mid'] !=\"\"){\n $module = db::escapechars(trim($_POST['mid']));\n }\n else{\n $module = db::escapechars(trim($_GET['mid']));\n }\n return $module;\n }",
"function _get_module_()\n\t{\n\t\n\t\tif(isset($_REQUEST['mod']))\n\t\t\t$modulo = clean_get('mod');\n\t\telse\n\t\t\t$modulo = \"\";\n\t\t\t\n\t\t$array_modulos = array(\n\t\t\t'dashboard',\n\t\t\t'gestionar-usuarios',\n\t\t\t'insertar-usuario',\n\t\t\t'editar-datos',\n\t\t\t'cambiar-password'\n\t\t);\t\n\t\t\n\t\t$default_module = $array_modulos[0];\n\t\t\n\t\t$load_module = ( in_array($modulo,$array_modulos) ) ? $modulo : $default_module ;\n\t\t\n\t\tinclude(_PATH_.'admin/modulos/'.$load_module.'.php');\n\t}",
"function get_module($mod)\n{\n\tinclude \"modules/mod_$mod.php\";\n}",
"public function create_module() {\n\t\t$context = [];\n\t\t$this->climate->green()->out( 'Creating new Module…' );\n\n\t\t$context['name'] = null;\n\t\t$filename_module = null;\n\t\twhile ( $context['name'] == null || file_exists( $filename_module ) ) {\n\t\t\t$input = $this->climate->green()->input( \"What will your Module be called?\\r\\n>\" );\n\t\t\t$context['name'] = trim( $input->prompt() );\n\n\t\t\tif ( $context['name'] == null ) {\n\t\t\t\t$this->climate->error( Emoji::pileOfPoo() . ' Please give a name for this Module!' );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$context['name'] = Utility::modulize( $context['name'] );\n\t\t\t$context['id'] = strtolower( Utility::normalize( $context['name'] ) );\n\t\t\t$context['name_view'] = Utility::viewize( $context['name'] );\n\t\t\t$context['name_acf'] = Utility::acfize( $context['name'] );\n\n\t\t\t$filename_module = $GLOBALS['sloth']->container->get( 'path.theme' ) . DS . 'Module' . DS . $context['name'] . '.php';\n\t\t\tif ( file_exists( $filename_module ) ) {\n\t\t\t\t$this->climate->error( Emoji::pileOfPoo() . ' ' . sprintf( 'A module called %s exists!',\n\t\t\t\t\t\t$context['name'] ) );\n\t\t\t}\n\t\t}\n\n\t\t$input = $this->climate->green()->confirm( 'Do you want to use your module with Layotter?' );\n\t\t$context['layotter'] = $input->confirmed() ? [] : false;\n\n\t\tif ( is_array( $context['layotter'] ) ) {\n\t\t\t$input = $this->climate->green()->input( \"Please give a comprehensive title for your module.\\r\\n>\" );\n\t\t\t$context['layotter']['title'] = trim( $input->prompt() );\n\n\t\t\t$input = $this->climate->green()->input( \"Please give a short description of what this module will do.\\r\\n>\" );\n\t\t\t$context['layotter']['description'] = trim( $input->prompt() );\n\n\t\t\t$input = $this->climate->green()->input( \"Please choose an icon for this module.\\r\\n(choose from http://fontawesome.io/icons/)\\r\\n>\" );\n\t\t\t$context['layotter']['icon'] = trim( $input->prompt() );\n\t\t}\n\t\t/*\n\t\t\t\t$input = $this->climate->green()->confirm( 'Do you want me to create a sass file for this module?' );\n\t\t\t\t$context['sass'] = $input->confirmed();\n\n\t\t\t\t$input = $this->climate->green()->confirm( 'Do you want me to create a JavaScript file for this module?' );\n\t\t\t\t$context['js'] = $input->confirmed();\n\t\t*/\n\n\t\t# write it to file\n\t\t$view = View::make( 'Scaffold.Module.Class' );\n\t\tfile_put_contents( $filename_module, $view->with( $context )->render() );\n\n\t\t$filename_view = $GLOBALS['sloth']->container->get( 'path.theme' ) . DS . 'View' . DS . 'Module' . DS . $context['name_view'] . '.twig';\n\t\t$view = View::make( 'Scaffold.Module.View' );\n\t\tfile_put_contents( $filename_view, $view->with( $context )->render() );\n\n\n\t\t$sass_dir = DIR_ROOT . DS . 'src' . DS . 'sass' . DS;\n\t\tif ( ! is_dir( $sass_dir ) ) {\n\t\t\t$sass_dir = DIR_ROOT . DS . 'src' . DS . 'scss' . DS;\n\t\t}\n\n\t\t$filename_sass = $sass_dir . 'modules' . DS . '_' . $context['name_view'] . '.scss';\n\t\tif ( ! is_dir( dirname( $filename_sass ) ) ) {\n\t\t\tmkdir( dirname( $filename_sass ), 0777, true );\n\t\t}\n\t\t$view = View::make( 'Scaffold.Module.Sass' );\n\t\tfile_put_contents( $filename_sass, $view->with( $context )->render() );\n\n\n\t\t$filename_sass_bundle = $sass_dir . 'bundle.scss';\n\t\tfile_put_contents( $filename_sass_bundle,\n\t\t\tsprintf( \"\\n@import 'modules/%s';\", $context['name_view'] ),\n\t\t\tFILE_APPEND );\n\n\t\tif ( $context['layotter'] ) {\n\t\t\t$filename_acf = $GLOBALS['sloth']->container->get( 'path.theme' ) . DS . 'acf-json' . DS . $context['name_acf'] . '.json';\n\t\t\tif ( file_exists( $filename_acf ) ) {\n\t\t\t\t$this->climate->info( Emoji::thinkingFace() . ' ' . sprintf( 'A Field Group %s exists. Skipping scaffolding!',\n\t\t\t\t\t\t$context['name_acf'] ) );\n\t\t\t} else {\n\t\t\t\t$view = View::make( 'Scaffold.Module.Acf' );\n\t\t\t\t$data = json_decode( $view->with( $context + [ 'now' => time() ] )->render() );\n\t\t\t\tif ( json_last_error() != JSON_ERROR_NONE ) {\n\t\t\t\t\tthrow new \\Exception( 'Seems your scaffold is not correct json!' );\n\t\t\t\t}\n\t\t\t\tfile_put_contents( $filename_acf, json_encode( $data ) );\n\t\t\t}\n\t\t}\n\n\t\t$this->climate->info( sprintf( 'Module %s created!', $context['name'] ) );\n\t}",
"public function displayModule($module, $action);",
"function gym_get_modules($mode) {\n\t\tglobal $cache, $phpEx, $phpbb_root_path;\n\t\tif (($this->gym_modules[$mode] = $cache->get('_gym_modules_' . $mode)) === false) {\n\t\t\t$this->gym_modules[$mode] = array();\n\t\t\t$dir = @opendir( $phpbb_root_path . 'gym_sitemaps/acp' );\n\t\t\twhile( ($file = @readdir($dir)) !== FALSE ) {\n\t\t\t\tif(preg_match('`^' . $mode . '_([a-z0-9_-]+)\\.' . $phpEx . '$`i', $file, $matches)) {\n\t\t\t\t\t$module = trim(str_replace( $mode . '_', '' , str_replace('.' . $phpEx , '' ,$file)), \"/\");\n\t\t\t\t\tif ($matches[1] == 'main' || (file_exists($phpbb_root_path . 'gym_sitemaps/modules/' . $file) && !empty($this->gym_config[$mode . '_' . $module . '_installed'])) ) {\n\t\t\t\t\t\t$this->gym_modules[$mode][$module] = $module;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t@closedir($dir);\n\t\t\t// Reorder a bit, put the main panel at the first position, others will keep\n\t\t\t// the file system sorting\n\t\t\tif (!empty($this->gym_modules[$mode]['main'])) {\n\t\t\t\t$main = $this->gym_modules[$mode]['main'];\n\t\t\t\tunset($this->gym_modules[$mode]['main']);\n\t\t\t\t$this->gym_modules[$mode] = array('main' => $main) + $this->gym_modules[$mode];\n\n\t\t\t}\n\t\t\t$cache->put('_gym_modules_' . $mode, $this->gym_modules[$mode]);\n\t\t}\n\t\tif (!is_array($this->gym_modules[$mode]) || empty($this->gym_modules[$mode])) {\n\t\t\t$this->remove_cache('acp', $mode);\n\t\t}\n\t}",
"function gym_module_acp($mode, $module) {\n\t\tglobal $phpbb_root_path, $phpEx, $cache;\n\t\tif (is_array($this->gym_modules[$mode]) && ($this->gym_modules_acp[$mode] = $cache->get('_gym_acp_' . $mode)) === false) {\n\t\t\tforeach ($this->gym_modules[$mode] as $mode_module) {\n\t\t\t\t$this->gym_pick_module($mode, $mode_module, $this->gym_modules_acp);\n\t\t\t}\n\t\t\t$cache->put('_gym_acp_' . $mode, $this->gym_modules_acp[$mode]);\n\t\t}\n\t\tif (!@is_array($this->gym_modules_acp[$mode]) || empty($this->gym_modules_acp[$mode])) {\n\t\t\t$this->remove_cache('acp', $mode);\n\t\t}\n\t}",
"function admin_comModule_selectModule( $form_prefix, $field_name, $selected_mod = false )\n{\n\tglobal $db;\n\t$file_list = $db->select('module_list, file(asc)');\n\n\tif ($file_list)\n\t{\n\t\t$temp = array();\n\t\t$temp['no-filter'] = LANG_SELECT_OPTION_ROOT; # Important: formManager::isFile('no-filter') == false\n\n\t\tfor ($i=0; $i<count($file_list); $i++)\n\t\t{\n\t\t\t/**\n\t\t\t * Careful! The '$file_list' can contain '.' symbol (exemple: my_module.php). After posted into the form, they will be replaced by '_'.\n\t\t\t * Then for the name attribute, we should use our formManager::encodePoint() method.\n\t\t\t */\n\t\t\t$temp[formManager::encodePoint($file_list[$i]['file'])] = $file_list[$i]['file'];\n\t\t}\n\t\t$temp = formManager::selectOption($temp, formManager::encodePoint($selected_mod));\n\t\t$file_list = $temp;\n\n\t\t$form = new formManager();\n\t\t$form->setForm('post', $form_prefix); # Only set the $this->form['method'] and the $this->form['name']. No Html-output of <form></form> tag\n\n\t\treturn $form->select($field_name, $file_list, LANG_ADMIN_COM_MODULE_MODULE_FILTER);\n\t}\n\telse\n\t{\n\t\tadmin_message(LANG_ADMIN_COM_MODULE_NO_MODULE_AVAILABLE, 'error');\n\t\treturn false;\n\t}\n}",
"function parse_moduleid_from_actionurl($actionurl)\n{\n $moduleid = NULL;\n /* breaking activity breakdown.\n if(strpos($actionurl, \"mod\") < 0)\n return NULL;// looking for module accesses */\n if(strpos($actionurl, \"id=\") > -1)\n {\n $id = substr($actionurl, strpos($actionurl, 'id=') + 3);\n if(is_numeric(substr($id,0,1))) // handle urls like view.php?id=6§ionid=15 (whatever that is)\n {\n $moduleid = (int) $id;\n }\n }\n return $moduleid;\n}",
"function fetch_module()\r\n {\r\n return $this->module;\r\n }",
"function exec_ogp_module() \n{\n\tglobal $db;\n\tinclude 'util_config.php';\n\t\n\t$userInfo = $db->getUserById($_SESSION['user_id']);\n\t$userRole = $userInfo['users_role'];\n\t$commands = array();\n\t\n\tforeach($availableCommands as $command){\n\t\tif($userRole == 'admin' && $command['admin'] === true){\n\t\t\t$commands[] = '<option value=\"'.$command['title'].'\">'.get_lang($command['title']).'</option>';\n\t\t}\n\t\t\n\t\tif($userRole == 'user' && $command['user'] === true){\n\t\t\t$commands[] = '<option value=\"'.$command['title'].'\">'.get_lang($command['title']).'</option>';\n\t\t}\n\t\t\n\t\tif($userRole == 'subuser' && $command['subuser'] === true){\n\t\t\t$commands[] = '<option value=\"'.$command['title'].'\">'.get_lang($command['title']).'</option>';\n\t\t}\n\t}\n?>\n<h2><?php echo get_lang('module_name'); ?></h2>\n<div id=\"tabs\">\n\t<ul>\n\t\t<li><a href=\"#tabs-1\"><?php echo get_lang('network_tools'); ?></a></li>\n\t\t<li><a href=\"#tabs-2\"><?php echo get_lang('sourcemod_admins'); ?></a></li>\n\t\t<li><a href=\"#tabs-3\"><?php echo get_lang('steam_converter'); ?></a></li>\n\t</ul>\n\t\n\t<div id=\"tabs-1\">\n\t\t<div>\n\t\t\t<span id=\"loading_agents\" class=\"show\"><?php echo get_lang('loading_agents'); ?></span>\n\t\t\t<span id=\"loading_failed\" class=\"hide\"><?php echo get_lang('loading_failed'); ?></span>\n\t\t\t<span id=\"no_commands\" class=\"hide\"><?php echo get_lang('no_commands'); ?></span>\n\t\t\t<span id=\"agents_offline\" class=\"hide\"><?php echo get_lang('agents_offline'); ?></span>\n\t\t</div>\n\t\t\n\t\t<div id=\"options\" class=\"hide\">\n\t\t\t<div><?php echo get_lang('your_ip'); ?> <span id=\"your-address\"><?php echo getClientIPAddress(); ?></span></div>\n\t\t\t<form action=\"\" method=\"POST\" id=\"network_tools\">\n\t\t\t\t<div id=\"select_agent\"></div>\n\t\t\t\t\n\t\t\t\t<label for=\"command\"><?php echo get_lang('command'); ?></label>\n\t\t\t\t<select id=\"command\" name=\"command\"><?php echo implode('', $commands); ?></select>\n\t\t\t\t\n\t\t\t\t<label for=\"remote_target\"><?php echo get_lang('remote_target'); ?></label>\n\t\t\t\t<input type=\"text\" id=\"remote_target\" name=\"remote_target\" required>\n\t\t\t\t<button type=\"submit\"><?php echo get_lang('submit'); ?></button>\n\t\t\t</form>\n\t\t</div>\n\t\t\n\t\t<div id=\"loading\" class=\"hide\"></div>\n\t\t<div id=\"output\" class=\"hide\"></div>\n\t</div><!--/#tabs-1-->\n\t\n\t<div id=\"tabs-2\">\n\t\t<div>\n\t\t\t<div>\n\t\t\t\t<span id=\"no_servers\" class=\"hide\"><?php echo get_lang('no_servers'); ?></span>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div id=\"add_admin\" class=\"hide\">\n\t\t\t\t<form action=\"\" method=\"POST\" id=\"addadmin_form\">\n\t\t\t\t\t<div id=\"games\"></div>\n\t\t\t\t\t\n\t\t\t\t\t<label for=\"addSteamid\"><?php echo get_lang('steamid'); ?></label>\n\t\t\t\t\t<input type=\"text\" id=\"addSteamid\" name=\"addSteamid\" pattern=\"^STEAM_[01]:[01]:\\d+$\" required>\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<label for=\"immunity\"><?php echo get_lang('immunity'); ?></label>\n\t\t\t\t\t<input type=\"number\" id=\"immunity\" name=\"immunity\" min=\"1\" max=\"99\">\n\t\t\t\t\t\n\t\t\t\t\t<label for=\"sourcemod_perms\"><?php echo get_lang('sourcemod_perms'); ?></label>\n\t\t\t\t\t<select id=\"sourcemod_perms\" name=\"sourcemod_perms\">\n\t\t\t\t\t\t<option value=\"root\"><?php echo get_lang('sourcemod_perm_root'); ?></option>\n\t\t\t\t\t\t<option value=\"custom\"><?php echo get_lang('sourcemod_perm_custom'); ?></option>\n\t\t\t\t\t</select>\n\t\t\t\t\t\n\t\t\t\t\t<div id=\"sourcemod_flagList\" class=\"hide\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach(range('a', 't') as $flag){\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"item\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" id=\"flag_<?php echo $flag; ?>\" name=\"flags[]\" value=\"<?php echo $flag; ?>\">\n\t\t\t\t\t\t\t\t<label for=\"flag_<?php echo $flag; ?>\"><?php echo get_lang('sourcemod_flag_'.$flag); ?></label>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<input type=\"hidden\" name=\"remote_server_id\" id=\"remote_server_id\" value=\"\">\n\t\t\t\t\t<input type=\"hidden\" name=\"gameserver_name\" id=\"gameserver_name\" value=\"\">\n\t\t\t\t\t<input type=\"hidden\" name=\"gameserver_ip\" id=\"gameserver_ip\" value=\"\">\n\t\t\t\t\t<input type=\"hidden\" name=\"gameserver_port\" id=\"gameserver_port\" value=\"\">\n\t\t\t\t\t\n\t\t\t\t\t<button type=\"submit\"><?php echo get_lang('submit'); ?></button>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div id=\"invalid_server\" class=\"hide\"><?php echo get_lang('server_not_selected'); ?></div>\n\t\t\t<div id=\"invalid_steamid_admin\" class=\"hide\"><?php echo get_lang('invalid_steamid'); ?></div>\n\t\t\t<div id=\"invalid_response_admin\" class=\"hide\"><?php echo get_lang('post_failed'); ?></div>\n\t\t\t<div id=\"invalid_immunity\" class=\"hide\"><?php echo get_lang('invalid_immunity'); ?></div>\n\t\t\t\n\t\t\t<div id=\"all_servers_offline\" class=\"hide\"><?php echo get_lang('agents_offline'); ?></div>\n\t\t\t\n\t\t\t<div id=\"addadmin_response\" class=\"hide\"></div>\n\t\t</div>\n\t</div><!--/#tabs-2-->\n\t\n\t<div id=\"tabs-3\">\n\t\t<div>\n\t\t\t<form action=\"\" method=\"POST\" id=\"steam_converter\">\n\t\t\t\t<label for=\"steam_input\">SteamID / SteamID3 / SteamID64 / CustomID:</label>\n\t\t\t\t<input type=\"text\" name=\"steam_input\" id=\"steam_input\" required>\n\t\t\t\t\n\t\t\t\t<button type=\"submit\"><?php echo get_lang('submit'); ?></button>\n\t\t\t</form>\n\t\t</div>\n\t\t\n\t\t<div id=\"invalid_steamid\" class=\"hide\"><?php echo get_lang('invalid_steamid'); ?></div>\n\t\t<div id=\"invalid_response\" class=\"hide\"><?php echo get_lang('post_failed'); ?></div>\n\t\t\n\t\t<div id=\"steam_info\">\n\t\t\t<div id=\"steamLink\"></div>\n\t\t\t<div id=\"steamId\"></div>\n\t\t\t<div id=\"steamId3\"></div>\n\t\t\t<div id=\"steamId64\"></div>\n\t\t</div>\n\t</div><!--/#tabs-3-->\n</div> <!--/#tabs-->\n\n<script>\n\t$(function(){\n\t\t$(\"#tabs\").tabs();\n\t\t$(\"#loading\").removeClass('hide').addClass('show');\n\t\t\n\t\t// Load the agents via an external script so the user isn't waiting an eternity if they have several agents and multiple are offline\n\t\t$.getJSON(\"modules/util/agents.php\", function(data){\n\t\t\tvar agents = \"\";\n\t\t\tvar agentsOnline = 0;\n\t\t\t\n\t\t\t$(\"#loading_agents\").removeClass('show').addClass('hide');\n\t\t\t$(\"#loading\").removeClass('show').addClass('hide');\n\t\t\t$(\"#options\").removeClass('hide').addClass('show');\n\t\t\t\n\t\t\tagents += \"<label for=\\\"agent\\\"><?php echo get_lang('select_agent'); ?></label>\\r\\n\"\n\t\t\tagents += \"<select id=\\\"agent\\\" name=\\\"agent\\\">\\r\\n\"\n\t\t\t\n\t\t\tfor(var i = 0; i<data.length; ++i){\n\t\t\t\tagents += \"\\t<option value=\\\"\" + data[i]['id'] + \"\\\"\" + (data[i]['status']===0?\" disabled\":\"\") + \">\" + data[i]['name'] +\"</option>\\r\\n\";\n\t\t\t\t\n\t\t\t\tif(data[i]['status'] == 1){\n\t\t\t\t\t++agentsOnline;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tagents += \"</select>\";\n\t\t\t\n\t\t\tif(agentsOnline == 0){\n\t\t\t\t$(\"#options\").removeClass('show').addClass('hide');\n\t\t\t\t$(\"#agents_offline\").removeClass('hide').addClass('show');\n\t\t\t\t\n\t\t\t\t// Hide the sourcemod add admin form if all agents are offline.\n\t\t\t\t$(\"#addadmin_form\").addClass('hide');\n\t\t\t\t$(\"#all_servers_offline\").removeClass('hide').addClass('show');\n\t\t\t}else if($(\"#command option\").length == 0){\n\t\t\t\t$(\"#options\").removeClass('show').addClass('hide');\n\t\t\t\t$(\"#no_commands\").removeClass('hide').addClass('show');\n\t\t\t}else{\n\t\t\t\t$(\"#select_agent\").html(agents);\n\t\t\t}\n\t\t}).fail(function(){\n\t\t\t$(\"#loading_agents\").removeClass('show').addClass('hide');\n\t\t\t$(\"#loading\").removeClass('show').addClass('hide');\n\t\t\t$(\"#loading_failed\").removeClass('hide').addClass('show');\n\t\t});\n\t\t\n\t\t// Handle the network_tools form.\n\t\t$(\"#network_tools\").on(\"submit\", function(e){\n\t\t\tvar target = $(\"#remote_target\").val();\n\t\t\tvar agent = $(\"#agent\").val();\n\t\t\tvar command = $(\"#command\").val();\n\t\t\t\n\t\t\t// Some validation browser-side. Still need to do the same server-side.\n\t\t\tif(target.length === 0){\n\t\t\t\t// target input is empty.\n\t\t\t\t$(\"#output\").removeClass('hide').addClass('show').html(\"<pre><?php echo get_lang('target_empty'); ?></pre>\");\n\t\t\t}else if(agent.length === 0){\n\t\t\t\t// We'll only get to this point if there's no agents, or all agents are offline but the form was still submitted.\n\t\t\t\t$(\"#output\").removeClass('hide').addClass('show').html(\"<pre><?php echo get_lang('agent_invalid'); ?></pre>\");\n\t\t\t}else if(command.length === 0){\n\t\t\t\t// We'll only get to this point if there's no command specified.\n\t\t\t\t$(\"#output\").removeClass('hide').addClass('show').html(\"<pre><?php echo get_lang('command_empty'); ?></pre>\");\n\t\t\t}else{\n\t\t\t\t$(\"#loading\").removeClass('hide').addClass('show');\n\t\t\t\t$(\"#output\").removeClass('show').addClass('hide')\n\t\t\t\t\n\t\t\t\t$(\"#network_tools button\").prop({disabled:true}); // Disable the submit button if we're about to post - preventing stuff being ran several times via spamming the button and/or enter.\n\t\t\t\t$.post(\"modules/util/network_tools.php\", $(\"#network_tools\").serialize(), function(postCommand){\n\t\t\t\t\t$(\"#loading\").removeClass('show').addClass('hide');\n\t\t\t\t\t$(\"#output\").removeClass('hide').addClass('show').html(\"<pre>\" + postCommand + \"</pre>\");\n\t\t\t\t\t\n\t\t\t\t\t$(\"#network_tools button\").prop({disabled:false});\n\t\t\t\t}).fail(function(){\n\t\t\t\t\t$(\"#loading\").removeClass('show').addClass('hide');\n\t\t\t\t\t$(\"#output\").removeClass('hide').addClass('show').html(\"<pre><?php echo get_lang('post_failed'); ?></pre>\");\n\t\t\t\t\t\n\t\t\t\t\t$(\"#network_tools button\").prop({disabled:false});\n\t\t\t\t});\n\t\t\t}\n\t\t\te.preventDefault();\n\t\t});// ./end network_tools form handling.\n\t\t\n\t\t// ----- Sourcemod Admins -----\n\t\t$.getJSON(\"modules/util/addadmin_helper.php\", function(gs){\n\t\t\tif(gs.length === 0){\n\t\t\t\t$(\"#no_servers\").removeClass('hide').addClass('show');\n\t\t\t}else{\n\t\t\t\tvar games = \"\";\n\t\t\t\t$(\"#add_admin\").removeClass('hide').addClass('show');\n\t\t\t\t\n\t\t\t\tgames += \"<label for=\\\"gameserver_id\\\"><?php echo get_lang('select_server'); ?></label>\\r\\n\"\n\t\t\t\tgames += \"<select id=\\\"gameserver_id\\\" name=\\\"gameserver_id\\\">\\r\\n\"\n\t\t\t\tgames += \"<option value=\\\"0\\\" selected><?php echo get_lang('select_server_option'); ?></option>\\r\\n\"\n\t\t\t\t\n\t\t\t\tfor(var i = 0; i<gs.length; ++i){\n\t\t\t\t\tgames += \"\\t<option value=\\\"\" + gs[i]['home_id'] + \"\\\">\" + gs[i]['home_name'] +\"</option>\\r\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tgames += \"</select>\";\n\t\t\t\t$(\"#games\").html(games);\n\t\t\t\t\n\t\t\t\t$(\"#gameserver_id\").change(function(){\n\t\t\t\t\tvar home = $(\"#gameserver_id\").val();\n\t\t\t\t\tvar gameserver_id = $(\"#gameserver_id\").val();\n\t\t\t\t\t\n\t\t\t\t\t// although the disabled attribute is put on the option, set all the values to 0 if it's somehow chosen again via the form being edited\n\t\t\t\t\tif(gameserver_id == 0){\n\t\t\t\t\t\t$(\"#remote_server_id\").val(0);\n\t\t\t\t\t\t$(\"#gameserver_name\").val(0);\n\t\t\t\t\t\t$(\"#gameserver_ip\").val(0);\n\t\t\t\t\t\t$(\"#gameserver_port\").val(0);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tfor(var i = 0; i<gs.length; ++i){\n\t\t\t\t\t\t\tif(home === gs[i]['home_id']){\n\t\t\t\t\t\t\t\t$(\"option[value='0']\").attr(\"disabled\", \"disabled\");\n\t\t\t\t\t\t\t\t$(\"#remote_server_id\").val(gs[i]['remote_server_id']);\n\t\t\t\t\t\t\t\t$(\"#gameserver_name\").val(gs[i]['game_name']);\n\t\t\t\t\t\t\t\t$(\"#gameserver_ip\").val(gs[i]['ip']);\n\t\t\t\t\t\t\t\t$(\"#gameserver_port\").val(gs[i]['port']);\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});\n\t\t\t}\n\t\t}); // ./end Sourcemod Admins\n\t\t\n\t\t$(\"#sourcemod_perms\").change(function(){\n\t\t\tvar sourcemod_perms = $(\"#sourcemod_perms\").val();\n\t\t\t\n\t\t\tif(sourcemod_perms === 'root'){\n\t\t\t\t$(\"#sourcemod_flagList\").removeClass('show').addClass('hide');\n\t\t\t\t$('.item input[type=\"checkbox\"]').prop('checked', false);\n\t\t\t}else{\n\t\t\t\t$(\"#sourcemod_flagList\").removeClass('hide').addClass('show');\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Process the sourcemod admin form on submission.\n\t\t$(\"#addadmin_form\").on(\"submit\", function(e){\n\t\t\t$(\"#addadmin_form button\").prop({disabled:true});\n\t\t\t\n\t\t\tvar errors = 0;\n\t\t\tvar remoteId = $(\"#remote_server_id\").val();\n\t\t\tvar gameName = $(\"#gameserver_name\").val();\n\t\t\tvar gameIp = $(\"#gameserver_ip\").val();\n\t\t\tvar gamePort = $(\"#gameserver_port\").val();\n\t\t\tvar addSteamid = $(\"#addSteamid\").val();\n\t\t\tvar immunity = $(\"#immunity\").val();\n\t\t\t\n\t\t\t// Set the message divs back to defaults.\n\t\t\t$(\"#invalid_server\").removeClass('show').addClass('hide');\n\t\t\t$(\"#invalid_steamid_admin\").removeClass('show').addClass('hide');\n\t\t\t$(\"#invalid_response_admin\").removeClass('show').addClass('hide');\n\t\t\t$(\"#invalid_immunity\").removeClass('show').addClass('hide');\n\t\t\t$(\"#addadmin_response\").removeClass('show').addClass('hide');\n\t\t\t\n\t\t\tif(remoteId.length === 0 || gameName.length === 0 || gameIp.length === 0 || gamePort.length === 0){\n\t\t\t\t$(\"#invalid_server\").removeClass('hide').addClass('show');\n\t\t\t\t++errors;\n\t\t\t}\n\t\t\t\n\t\t\tif(!(addSteamid.match(/^STEAM_[01]:[01]:\\d+$/))){\n\t\t\t\t$(\"#invalid_steamid_admin\").removeClass('hide').addClass('show');\n\t\t\t\t++errors;\n\t\t\t}\n\t\t\t\n\t\t\tif(immunity.length > 2 || isNaN(immunity)){\n\t\t\t\t$(\"#invalid_immunity\").removeClass('hide').addClass('show');\n\t\t\t\t++errors;\n\t\t\t}\n\t\t\t\n\t\t\tif(errors === 0){\n\t\t\t\t$.post(\"modules/util/addadmin_helper.php\", $(\"#addadmin_form\").serialize(), function(postCommand){\n\t\t\t\t\t$(\"#addadmin_response\").removeClass('hide').addClass('show').html(postCommand);\n\t\t\t\t\t$(\"#addadmin_form button\").prop({disabled:false});\n\t\t\t\t}).fail(function(){\n\t\t\t\t\t$(\"#invalid_response_admin\").removeClass('hide').addClass('show');\n\t\t\t\t\t$(\"#addadmin_form button\").prop({disabled:false});\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\t$(\"#addadmin_form button\").prop({disabled:false});\n\t\t\t}\n\t\t\t\n\t\t\te.preventDefault();\n\t\t}); // add_admin form handling\n\t\t\n\t\t// ----- Steam Converter -----\n\t\t$(\"#steam_converter\").on(\"submit\", function(e){\n\t\t\t$(\"#steam_converter button\").prop({disabled:true});\n\t\t\t$.post(\"modules/util/steamid_converter.php\", $(\"#steam_converter\").serialize(), function(steam_data){\n\t\t\t\tvar json = $.parseJSON(steam_data);\n\t\t\t\t\n\t\t\t\tif(json.length === 0){\n\t\t\t\t\t$(\"#steam_info\").removeClass('show').addClass('hide');\n\t\t\t\t\t$(\"#invalid_steamid\").removeClass('hide').addClass('show');\n\t\t\t\t\t$(\"#invalid_response\").removeClass('show').addClass('hide');\n\t\t\t\t\t\n\t\t\t\t\t$(\"#steam_converter button\").prop({disabled:false});\n\t\t\t\t}else{\n\t\t\t\t\t$(\"#steam_info\").removeClass('hide').addClass('show');\n\t\t\t\t\t$(\"#invalid_steamid\").removeClass('show').addClass('hide');\n\t\t\t\t\t$(\"#invalid_response\").removeClass('show').addClass('hide');\n\t\t\t\t\t\n\t\t\t\t\t$(\"#steamLink\").html('<b>Profile Link:</b> ' + json.steamProfile);\n\t\t\t\t\t$(\"#steamId\").html('<b>Legacy ID:</b> ' + json.steamId);\n\t\t\t\t\t$(\"#steamId3\").html('<b>SteamID3:</b> ' + json.steamId3);\n\t\t\t\t\t$(\"#steamId64\").html('<b>SteamID64:</b> ' + json.communityId);\n\t\t\t\t\t\n\t\t\t\t\t$(\"#steam_converter button\").prop({disabled:false});\n\t\t\t\t}\n\t\t\t}).fail(function(){\n\t\t\t\t$(\"#invalid_steamid\").removeClass('show').addClass('hide');\n\t\t\t\t$(\"#steam_info\").removeClass('show').addClass('hide');\n\t\t\t\t$(\"#invalid_response\").removeClass('hide').addClass('show');\n\t\t\t});\n\t\t\te.preventDefault();\n\t\t}); // ./end steam_converter form handling.\n\t\t\n\t\t$(\"#your-address\").click(function(){\n\t\t\t$(\"#remote_target\").val($(\"#your-address\").text());\n\t\t});\n\t});\n</script>\n<?php\n}",
"function gym_set_default( $mode, $module, $action, $submit = false, $silent = false, $uninstall = false ) {\n\t\tglobal $user, $phpbb_root_path, $phpEx;\n\t\t$post_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : array();\n\t\t$this->new_config['reset_all'] = $reset_all = isset($post_array['reset_all']) ? $post_array['reset_all'] : false;\n\t\tif ($silent) {\n\t\t\t$reset_all = true;\n\t\t}\n\t\tif ($submit) {\n\t\t\tif ($mode === 'main' ) { // Reset all seting for all output and all modules\n\t\t\t\tforeach ($this->modes as $output_mode) { // List the output modes\n\t\t\t\t\t$this->gym_get_modules($output_mode);\n\t\t\t\t\tforeach ($this->gym_modules[$output_mode] as $type_module) { // List modules from each output mode\n\t\t\t\t\t\tif (!empty($post_array[$output_mode . '_' . $type_module . '_reset']) || $reset_all) {\n\t\t\t\t\t\t\t// Grabb the data\n\t\t\t\t\t\t\t$this->gym_module_acp($output_mode, $type_module);\n\t\t\t\t\t\t\tforeach($this->gym_modules_acp[$output_mode][$type_module]['info']['actions'] as $module_action) {\n\t\t\t\t\t\t\t\tforeach ($this->gym_modules_acp[$output_mode][$type_module][$module_action]['default'] as $module_config => $default_value ) { // In the end list possible options for this module's option set\n\t\t\t\t\t\t\t\t\t// Update config\n\t\t\t\t\t\t\t\t\tif ($uninstall) {\n\t\t\t\t\t\t\t\t\t\trem_gym_config($module_config, $this->gym_config);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tset_gym_config($module_config, $default_value, $output_mode, $this->gym_config);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ($module === 'main') { // Only looking for one output type modules\n\t\t\t\tforeach ($this->gym_modules[$mode] as $type_module) { // add the output types modules\n\t\t\t\t\tif (!empty($post_array[$mode . '_' . $type_module . '_reset']) || $reset_all) {\n\t\t\t\t\t\t// Grabb the data\n\t\t\t\t\t\t$this->gym_module_acp($mode, $type_module);\n\t\t\t\t\t\tforeach($this->gym_modules_acp[$mode][$type_module]['info']['actions'] as $module_action) {\n\t\t\t\t\t\t\tforeach ($this->gym_modules_acp[$mode][$type_module][$module_action]['default'] as $module_config => $default_value ) {\n\t\t\t\t\t\t\t\t// Update config\n\t\t\t\t\t\t\t\tif ($uninstall) {\n\t\t\t\t\t\t\t\t\trem_gym_config($module_config, $this->gym_config);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tset_gym_config($module_config, $default_value, $mode, $this->gym_config);\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}\n\t\t\t} else { // Only reset this module config\n\t\t\t\t$this->gym_module_acp($mode, $module);\n\t\t\t\t// Allow modules with no acp\n\t\t\t\tif (!empty($this->gym_modules_acp[$mode][$module]['info'])) {\n\t\t\t\t\tforeach ($this->gym_modules_acp[$mode][$module]['info']['actions'] as $module_action ) {\n\t\t\t\t\t\tforeach ($this->gym_modules_acp[$mode][$module][$module_action]['default'] as $module_config => $default_value ) {\n\t\t\t\t\t\t\tif (!empty($post_array[$mode . '_' . $module . '_' . $module_action . '_reset']) || $reset_all) {\n\t\t\t\t\t\t\t\t// Update config\n\t\t\t\t\t\t\t\tif ($uninstall) {\n\t\t\t\t\t\t\t\t\trem_gym_config($module_config, $this->gym_config);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tset_gym_config($module_config, $default_value, $mode, $this->gym_config);\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}\n\t\t\t}\n\t\t\t$this->clear_all_cache();\n\t\t\tunset($post_array);\n\t\t\tif (!$silent) {\n\t\t\t\ttrigger_error($user->lang['CONFIG_UPDATED'] . $this->back_to_prev());\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// Adjust language variable a bit\n\t\t$user->lang['GYM_RESET'] = sprintf($user->lang['GYM_RESET'], $user->lang[strtoupper($mode)] );\n\t\t$user->lang['GYM_RESET_EXPLAIN'] = sprintf($user->lang['GYM_RESET_EXPLAIN'], $user->lang[strtoupper($mode)] );\n\t\t$display_vars = array( 'title'\t=> 'GYM_RESET');\n\t\t$i = 1;\n\t\tif ($mode === 'main' ) { // Reset all seting for all output and all modules\n\t\t\tforeach ($this->modes as $output_mode) { // List the output types modules\n\t\t\t\t$this->gym_get_modules($output_mode);\n\t\t\t\t$display_vars['vars']['legend' . $i] = strtoupper($output_mode);\n\t\t\t\t$i++;\n\t\t\t\tforeach ($this->gym_modules[$output_mode] as $type_module) { // Then the modules\n\t\t\t\t\t// Grabb the data\n\t\t\t\t\t$this->gym_module_acp($output_mode, $type_module);\n\t\t\t\t\t// Then the associated language files if any\n\t\t\t\t\tif (!empty($this->gym_modules_acp[$output_mode][$type_module]['info']['lang_file'])) {\n\t\t\t\t\t\t$user->add_lang('gym_sitemaps/acp/' . $this->gym_modules_acp[$output_mode][$type_module]['info']['lang_file']);\n\t\t\t\t\t}\n\t\t\t\t\t$var_key = $output_mode . '_' . $type_module . '_reset';\n\t\t\t\t\t$this->new_config[$var_key] = 0;\n\t\t\t\t\t$display_vars['vars'][$var_key] = array('lang' => strtoupper($var_key), 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true);\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($module === 'main') { // Only looking for one output type modules\n\n\t\t\tforeach ($this->gym_modules[$mode] as $type_module) { // add the output types modules\n\t\t\t\t// Grabb the data\n\t\t\t\t$this->gym_module_acp($mode, $type_module);\n\t\t\t\t$display_vars['vars']['legend' . $i] = strtoupper($mode . '_' . $type_module);\n\t\t\t\t$i++;\n\t\t\t\t$var_key = $mode . '_' . $type_module . '_reset';\n\t\t\t\t$this->new_config[$var_key] = 0;\n\t\t\t\t$display_vars['vars'][$var_key] = array('lang' => strtoupper($var_key), 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true);\n\t\t\t}\n\t\t} else { // Only reset this module config\n\t\t\t$this->gym_module_acp($mode, $module);\n\t\t\t$display_vars['vars']['legend' . $i] = strtoupper($mode . '_' . $module) . '_RESET';\n\t\t\t$i++;\n\t\t\t// Grabb the data\n\t\t\tforeach ($this->gym_modules_acp[$mode][$module]['info']['actions'] as $module_action ) {\n\t\t\t\tif (!empty($this->gym_modules_acp[$mode][$module][$module_action]['display_vars']['vars'])) {\n\t\t\t\t\t$var_key = $mode . '_' . $module . '_' . $module_action . '_reset';\n\t\t\t\t\t$this->new_config[$var_key] = 0;\n\t\t\t\t\t$display_vars['vars'][$var_key] = array('lang' => strtoupper($var_key), 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$display_vars['vars']['legend' . $i] = 'GYM_RESET_ALL';\n\t\t$i++;\n\t\t$display_vars['vars']['reset_all'] = array('lang' => 'GYM_RESET_ALL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true);\n\t\treturn $display_vars;\n\t}",
"public function setRoad($module, $action = '')\n\t{\n\t\t$this->_moduleParam = ucfirst($module);\n\t\t$this->_actionParam = $action;\n\t}",
"function &_build_permit_module( &$module )\n{\n//print_r($module);\n\t$permit = $module['mod']['permit'];\n\t$mod_arr = array();\n\tforeach ( $module['mod'] as $k => $v )\n\t{\n\t\tif ( $this->_check_permit( $k, $permit ) ) {\n\t\t\t$mod_arr[ $k ] = $v;\n\t\t} else {\n\t\t\t$mod_arr[ $k ] = null;\n\t\t}\n\t}\n\t$arr = array(\n\t\t'mod' => $mod_arr,\n\t\t'article_arr' => $this->_build_permit_items( $module['article_arr'] ),\n\t);\n//print_r($arr);\n\treturn $arr;\n}",
"private function _module($params) {\n return $this->_specParam('module', $params);\n }",
"function module_hook($action, $ro = false) {\n\t$modules_directory = REGISTRY_APP_PATH.'/registry_object/modules/';\n\n\t//return empty array if no modules found\n\tif (!file_exists($modules_directory)) return array();\n\n $modules = scandir($modules_directory);\n $result = array();\n foreach ($modules as $module) {\n if ($module !='.' && $module!='..') {\n $conf = parse_ini_file($modules_directory.'/'.$module.'/config.ini');\n $file = REGISTRY_APP_PATH.'/registry_object/modules/'.$module.'/models/'.$conf['module'].'.php';\n require_once($file);\n $class_name = $conf['namespace'].'\\\\'.$conf['module'];\n\n $class = new $class_name();\n if ($ro) $class->injectRo($ro);\n if (method_exists($class, $action)) {\n $result = array_merge($result, $class->$action());\n }\n }\n }\n return $result;\n}",
"function pnModGetIDFromName($module)\n{\n if (empty($module)) {\n return false;\n }\n\n static $modid = array();\n if (isset($modid[$module])) {\n return $modid[$module];\n }\n\n list($dbconn) = pnDBGetConn();\n $pntable = pnDBGetTables();\n\n $modulestable = $pntable['modules'];\n $modulescolumn = &$pntable['modules_column'];\n $query = \"SELECT $modulescolumn[id]\n FROM $modulestable\n WHERE $modulescolumn[name] = '\" . pnVarPrepForStore($module) . \"'\";\n $result = $dbconn->Execute($query);\n\n if($dbconn->ErrorNo() != 0) {\n return;\n }\n\n if ($result->EOF) {\n $modid[$module] = false;\n return false;\n }\n\n list($id) = $result->fields;\n $result->Close();\n\n $modid[$module] = $id;\n return $id;\n}",
"function module_custom_select($value, $key) {\n\t\tglobal $phpbb_root_path, $phpEx;\n\t\t$method = 'select_' . $key;\n\t\t$module_file = $phpbb_root_path . 'gym_sitemaps/acp/modules/' . $this->mode . '_' . $this->module . '.' . $phpEx;\n\t\tif ( file_exists($module_file) ) {\n\t\t\tif (!class_exists($module_class/*, false */)) {\n\t\t\t\tinclude($module_file);\n\t\t\t}\n\t\t\tif (class_exists($module_class/*, false */)) {\n\t\t\t\t$gym_module = new $module_class($this);\n\t\t\t\tif ( method_exists($gym_module, $method)) {\n\t\t\t\t\treturn $gym_module->$method($value, $key);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Error\n\t}",
"function getPickListModules($includeNonRole = false) {\n\tglobal $adb;\n\t$inr = ($includeNonRole ? ',16' : '');\n\t$query = 'select distinct vtiger_tab.tablabel, vtiger_tab.name as tabname\n\t\tfrom vtiger_field\n\t\tinner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid\n\t\twhere uitype IN (15,33'.$inr.') and vtiger_field.tabid != 29 and vtiger_tab.presence != 1 and vtiger_field.presence in (0,2)';\n\t$result = $adb->pquery($query, array());\n\twhile ($row = $adb->fetch_array($result)) {\n\t\t$modules[$row['tablabel']] = $row['tabname'];\n\t}\n\treturn $modules;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getDepositAddressAsyncWithHttpInfo Generate currency deposit address | public function getDepositAddressAsyncWithHttpInfo($currency)
{
$returnType = '\GateApi\Model\DepositAddress';
$request = $this->getDepositAddressRequest($currency);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | [
"public function getBitcoinDepositAddress()\n {\n $result = json_decode($this->getPrivateEndpoint('GetBitcoinDepositAddress'));\n return BitcoinDepositAddress::createFromObject($result);\n }",
"public function getDepositAddressAsyncWithHttpInfo($currency)\n {\n $returnType = '\\com.blockchain.exchange.rest\\com.blockchain.exchange.rest.model\\DepositAddressCrypto';\n $request = $this->getDepositAddressRequest($currency);\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 = (string) $responseBody;\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 }",
"function getNewDepositAddress() {\n\n\tglobal $api;\n\n\treturn $api->apiCall(\"GENMKT/money/new_deposit_address\");\n}",
"function generateDepositAddress($account)\n {\n $this->checkRequired($account, 'You must specify an Account ID');\n\n $result = $this->query(\n $this->pair . '/money/bitcoin/get_address',\n array(\n 'account' => $account\n )\n );\n\n return $result;\n }",
"public function depositAddressAsyncWithHttpInfo($serialized_wallet)\n {\n $returnType = '\\Mainnet\\Model\\DepositAddressResponse';\n $request = $this->depositAddressRequest($serialized_wallet);\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 = (string) $responseBody;\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 getDepositAddressWithHttpInfo($currency)\n {\n $request = $this->getDepositAddressRequest($currency);\n\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null;\n if ($responseBody !== null) {\n $gateError = json_decode($responseBody, true);\n if ($gateError !== null && isset($gateError['label'])) {\n throw new GateApiException(\n $gateError,\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $responseBody\n );\n }\n }\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $responseBody\n );\n }\n\n $returnType = '\\GateApi\\Model\\DepositAddress';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }",
"public function generateDepositAddressWithHttpInfo($blockchain, $network, $wallet_id, $context = null, $generate_deposit_address_rb = null, string $contentType = self::contentTypes['generateDepositAddress'][0])\n {\n $request = $this->generateDepositAddressRequest($blockchain, $network, $wallet_id, $context, $generate_deposit_address_rb, $contentType);\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 (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n 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 (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 201:\n if ('\\kocetestpack\\Model\\GenerateDepositAddressR' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\kocetestpack\\Model\\GenerateDepositAddressR' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\kocetestpack\\Model\\GenerateDepositAddressR', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\kocetestpack\\Model\\GenerateDepositAddress400Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\kocetestpack\\Model\\GenerateDepositAddress400Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\kocetestpack\\Model\\GenerateDepositAddress400Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 401:\n if ('\\kocetestpack\\Model\\GenerateDepositAddress401Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\kocetestpack\\Model\\GenerateDepositAddress401Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\kocetestpack\\Model\\GenerateDepositAddress401Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 402:\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet402Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet402Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\kocetestpack\\Model\\CreateNewMasterWallet402Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 403:\n if ('\\kocetestpack\\Model\\GenerateDepositAddress403Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\kocetestpack\\Model\\GenerateDepositAddress403Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\kocetestpack\\Model\\GenerateDepositAddress403Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 404:\n if ('\\kocetestpack\\Model\\ListDepositAddresses404Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\kocetestpack\\Model\\ListDepositAddresses404Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\kocetestpack\\Model\\ListDepositAddresses404Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 409:\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet409Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet409Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\kocetestpack\\Model\\CreateNewMasterWallet409Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 415:\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet415Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet415Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\kocetestpack\\Model\\CreateNewMasterWallet415Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 422:\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet422Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet422Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\kocetestpack\\Model\\CreateNewMasterWallet422Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 429:\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet429Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet429Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\kocetestpack\\Model\\CreateNewMasterWallet429Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 500:\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet500Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\kocetestpack\\Model\\CreateNewMasterWallet500Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\kocetestpack\\Model\\CreateNewMasterWallet500Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\kocetestpack\\Model\\GenerateDepositAddressR';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\kocetestpack\\Model\\GenerateDepositAddressR',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\kocetestpack\\Model\\GenerateDepositAddress400Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\kocetestpack\\Model\\GenerateDepositAddress401Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 402:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\kocetestpack\\Model\\CreateNewMasterWallet402Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\kocetestpack\\Model\\GenerateDepositAddress403Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\kocetestpack\\Model\\ListDepositAddresses404Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\kocetestpack\\Model\\CreateNewMasterWallet409Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\kocetestpack\\Model\\CreateNewMasterWallet415Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\kocetestpack\\Model\\CreateNewMasterWallet422Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\kocetestpack\\Model\\CreateNewMasterWallet429Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\kocetestpack\\Model\\CreateNewMasterWallet500Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getDepositAddress($currency=null) {\n\n //parse inputs\n $resourcePath = \"/user/depositAddress\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n $headerParams['Accept'] = 'application/json';\n $headerParams['Content-Type'] = 'application/json';\n\n if($currency != null) {\n $queryParams['currency'] = $this->apiClient->toQueryValue($currency);\n }\n // Generate form params\n if (! isset($body)) {\n $body = array();\n }\n if (empty($body)) {\n $body = null;\n }\n\n // Make the API Call\n $response = $this->apiClient->callAPI($resourcePath, $method,\n $queryParams, $body,\n $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n $responseObject = $this->apiClient->deserialize($response,\n 'string');\n return $responseObject;\n\n }",
"function get_deposit_address($currency) {\r\n $command = 'account/getdepositaddress';\r\n $params = '?currency=' . $currency;\r\n $query = $command . $params;\r\n $result = make_private_api_call($query);\r\n \r\n return $result;\r\n}",
"private function GenerateAddress(){\n $callback_url=self::CALLBACK.\"?invoice_id=\".$this->invoiceId;\n $parameters = 'method=create&address=' . self::BITCOIN_ADDRESS .'&callback='. urlencode($callback_url);\n $response = file_get_contents( self::ROOTURL. '?' . $parameters);\n $object = json_decode($response);\n\n //Address to which the bitcoin should be sent by the user\n return $object->input_address;\n}",
"protected function customerAccountManagementV1GetDefaultBillingAddressGetRequest()\n {\n\n $resourcePath = '/V1/customers/me/billingAddress';\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 []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 }",
"public function feeAddress()\n\t{\n\t\t/* Get input variables */\n\t\t$currency = Input::get('currency') ? Input::get('currency') : 'btc';\n\n\t\tif( !in_array($currency, Converter::$allowed_currency) ) {\n\t\t\tthrow new JsonException( trans('error.invalidcurrency') );\n\t\t}\n\n\t\t$fee_address = $this->getFeeAddress();\n\n\t\t$address_model = Mint\\Address::getAddress($fee_address);\n\n\t\t$address_balance = Converter::satoshi( $address_model->balance );\n\t\t$merchant_fee = Converter::btc( Mint\\Settings::getVal('merchant_fee') );\n\n\t\treturn Response::json( ['address' => $address_model->address, 'balance' => $address_balance->$currency, 'merchant_fee' => $merchant_fee->$currency, 'currency' => $currency] );\n\t}",
"public function generateDepositAddressRequest($blockchain, $network, $wallet_id, $context = null, $generate_deposit_address_rb = null, string $contentType = self::contentTypes['generateDepositAddress'][0])\n {\n\n // verify the required parameter 'blockchain' is set\n if ($blockchain === null || (is_array($blockchain) && count($blockchain) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $blockchain when calling generateDepositAddress'\n );\n }\n\n // verify the required parameter 'network' is set\n if ($network === null || (is_array($network) && count($network) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network when calling generateDepositAddress'\n );\n }\n\n // verify the required parameter 'wallet_id' is set\n if ($wallet_id === null || (is_array($wallet_id) && count($wallet_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $wallet_id when calling generateDepositAddress'\n );\n }\n\n\n\n\n $resourcePath = '/wallet-as-a-service/wallets/{walletId}/{blockchain}/{network}/addresses';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $context,\n 'context', // param base name\n 'string', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n\n\n // path params\n if ($blockchain !== null) {\n $resourcePath = str_replace(\n '{' . 'blockchain' . '}',\n ObjectSerializer::toPathValue($blockchain),\n $resourcePath\n );\n }\n // path params\n if ($network !== null) {\n $resourcePath = str_replace(\n '{' . 'network' . '}',\n ObjectSerializer::toPathValue($network),\n $resourcePath\n );\n }\n // path params\n if ($wallet_id !== null) {\n $resourcePath = str_replace(\n '{' . 'walletId' . '}',\n ObjectSerializer::toPathValue($wallet_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (isset($generate_deposit_address_rb)) {\n if (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the body\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_deposit_address_rb));\n } else {\n $httpBody = $generate_deposit_address_rb;\n }\n } elseif (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 (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-sign');\n if ($apiKey !== null) {\n $headers['x-api-sign'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-passphrase');\n if ($apiKey !== null) {\n $headers['x-api-passphrase'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-timestamp');\n if ($apiKey !== null) {\n $headers['x-api-timestamp'] = $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 $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getaccountaddress($account) {\n if (!$account || empty($account))\n throw new BitcoinClientException(\"getaccountaddress requires an account\");\n return $this->query(\"getaccountaddress\", $account);\n }",
"public function addressBalance()\n\t{\n\t\t/* Get input variables */\n\t\t$address = Input::get('address');\n\t\t$currency = Input::get('currency') ? Input::get('currency') : 'btc';\n\n\t\tif ( empty($address) ) {\n\t\t\tthrow new JsonException( trans('error.noaddressinput') );\n\t\t}\n\n\t\tif( !in_array($currency, Converter::$allowed_currency) ) {\n\t\t\tthrow new JsonException( trans('error.invalidcurrency') );\n\t\t}\n\n\t\t$address_model = Mint\\Address::getAddress($address);\n\n\t\tif(!$address_model) {\n\t\t\tthrow new JsonException( trans('error.noaddressdb') );\n\t\t}\n\n\t\treturn Response::json([\n\t\t\t'address' => $address_model->address,\n\t\t\t'balance' => Converter::satoshi($address_model->balance)->$currency,\n\t\t\t'currency' => $currency,\n\t\t]);\n\t}",
"public function getBillingAddress(){\n return $this->getAddressFromResponse(\"billing_address\");\n }",
"public function getAddressInfo()\n {\n return $this->addressInfo;\n }",
"function getAssetAddress($asset) {\n\n $bapi = new BittrexAPI(config(\"bittrex.auth\"), config(\"bittrex.urls\"));\n $bapi->setAPI($this->api_key, $this->api_secret);\n $result = $bapi->depositAddress($asset);\n \n if($result['success']) return $result['result']['Address'];\n else return false;\n\n }",
"public function getAddress(): string\n {\n return $this->address;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Execute the given callback while forcing updates. | protected function whileForcingUpdate(Closure $callback)
{
$this->forceSaving = true;
$result = $callback();
$this->forceSaving = false;
return $result;
} | [
"public function registerUpdateCallback($callback);",
"protected function executeCallback()\n {\n if ($this->muted) {\n $this->executeMutedCallback();\n } else {\n $this->result->setValue(($this->callback)(...$this->params));\n }\n }",
"public function setLastAppliedUpdate($callback);",
"public function callCallback() {\n\t\tcall_user_func_array($this->callback, $this->args);\n\t}",
"public function _get_update_callback()\n {\n }",
"public function _get_update_callback()\n {\n }",
"static public function beforeUpdate($callBackFunction);",
"function registerAccountUpdateCallback($callback);",
"public function schemaUpdate($callback)\n {\n // Begin schema update\n $this->schemaIsUpdating = true;\n\n // Update table list\n $this->tableList = [];\n $tables = $this->tableList();\n foreach ($tables as $table) {\n $this->tableList[strtolower($table)] = $table;\n }\n\n // Clear update list for client code to mess around with\n $this->schemaUpdateTransaction = [];\n\n /** @var Exception $error */\n $error = null;\n try {\n // Yield control to client code\n $callback();\n\n // If the client code has cancelled the update then abort\n if (!$this->isSchemaUpdating()) {\n return;\n }\n\n // End schema update\n foreach ($this->schemaUpdateTransaction as $tableName => $changes) {\n $advancedOptions = isset($changes['advancedOptions']) ? $changes['advancedOptions'] : null;\n switch ($changes['command']) {\n case 'create':\n $this->createTable(\n $tableName,\n $changes['newFields'],\n $changes['newIndexes'],\n $changes['options'],\n $advancedOptions\n );\n break;\n\n case 'alter':\n $this->alterTable(\n $tableName,\n $changes['newFields'],\n $changes['newIndexes'],\n $changes['alteredFields'],\n $changes['alteredIndexes'],\n $changes['alteredOptions'],\n $advancedOptions\n );\n break;\n }\n }\n } finally {\n $this->schemaUpdateTransaction = null;\n $this->schemaIsUpdating = false;\n }\n }",
"protected function executeCallbacks()\n\t{\n\t\tif ($this->callbacks_executed) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$this->callbacks_executed = true;\n\t\t\n\t\tforeach ($this->callbacks as $callback) {\n\t\t\tif ($q = call_user_func($callback, $this->query)) {\n\t\t\t\t$this->query = $q;\n\t\t\t}\n\t\t}\n\t}",
"public function setWorkloadCallback($callback) {}",
"public function execute(): void {\n foreach ($this->callbacks as $callback) {\n $callback();\n }\n }",
"private static function update() {\n\t\t$current_db_version = get_option( 'wootax_version' );\n\t\t$logger = new WC_Logger();\n\t\t$update_queued = false;\n\n\t\tforeach ( self::$update_hooks as $version => $update_callbacks ) {\n\t\t\tif ( version_compare( $current_db_version, $version, '<' ) ) {\n\t\t\t\tforeach ( $update_callbacks as $update_callback ) {\n\t\t\t\t\t$logger->add( 'sst_db_updates', sprintf( 'Queuing %s - %s', $version, $update_callback ) );\n\t\t\t\t\tself::$background_updater->push_to_queue( $update_callback );\n\t\t\t\t\t$update_queued = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $update_queued ) {\n\t\t\tself::$background_updater->save()->dispatch();\n\t\t}\n\t}",
"private function callCallback() {\n\t\tif ($this->callback !== null) {\n\t\t\t$response = $this->buildResponse();\n\t\t\tcall_user_func($this->callback, $response, $this->data);\n\t\t}\n\t}",
"public function setWorkloadCallback($callback){}",
"public static function updated($callback)\n {\n static::registerModelEvent ( 'updated', $callback );\n }",
"public function after_update() {}",
"public function updated()\n {\n // do something after update\n }",
"private static function update() {\n\t\t$current_db_version = get_option( 'user_registration_db_version' );\n\t\t$update_queued = false;\n\n\t\tforeach ( self::get_db_update_callbacks() as $version => $update_callbacks ) {\n\t\t\tif ( version_compare( $current_db_version, $version, '<' ) ) {\n\t\t\t\tforeach ( $update_callbacks as $update_callback ) {\n\t\t\t\t\tself::$background_updater->push_to_queue( $update_callback );\n\t\t\t\t\t$update_queued = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $update_queued ) {\n\t\t\tself::$background_updater->save()->dispatch();\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ajax post submitting theme id. | public function select_theme_submit(Request $request) {
$all = $request->all();
if (array_has($all, 'id')) {
$request->session()->put('theme-id', $all['id']);
return response()->json(['redirect' => url('admin/space/add')]);
} else {
abort(404);
}
} | [
"function wp_ajax_delete_theme()\n {\n }",
"function wp_ajax_press_this_save_post()\n {\n }",
"function wp_ajax_install_theme() {}",
"function wp_ajax_install_theme()\n {\n }",
"public function ajaxThemetyMetaboxUpdate() {\n $pageTemplate = Input::get('page_template');\n $id = Input::get('post_id');\n\n $post = $id ? get_post($id) : (object) [];\n $post->template = $pageTemplate;\n\n set_current_screen($post->post_type);\n do_action('add_meta_boxes', $post->post_type, $post );\n\n $html = $this->view('content/metabox/ajax-update', [\n 'post' => $post,\n 'post_type' => $post->post_type\n ]);\n return Response::json([\n 'html' => $html\n ]);\n }",
"function wp_ajax_install_theme()\n{\n}",
"function wp_ajax_edit_theme_plugin_file()\n {\n }",
"static function save_custom_global_style_ajaxify() {\n\n\t\tcheck_ajax_referer( 'tb_load_nonce', 'nonce' );\n\t\t$data = $response = array();\n\t\tif ( isset( $_POST['form_data'] ) ) {\n\t\t\tparse_str( $_POST['form_data'], $data );\n\t\t\t$insert_post = self::add_new( $data );\n\t\t\tif ( false === $insert_post ) {\n\t\t\t\t$response['status'] = 'failed';\n\t\t\t\t$response['msg'] = __( 'Something went wrong', 'themify' );\n\t\t\t} else {\n\t\t\t\t$response['status'] = 'success';\n\t\t\t\t$response['url'] = $insert_post['url'] . '#builder_active';\n\t\t\t}\n\t\t}\n\t\twp_send_json( $response );\n\t}",
"function ajax_submit_post() {\n\t\t$author = \"DEBUG\";\n\t\t$body = \"DEBUG\";\n\t\t$datetime = \"DEBUG\";\n\n\t\t$response = array(\n\t\t\t'what'\t => 'communicator',\n\t\t\t'action' => 'add_message',\n\t\t\t'id'\t\t => $new_post_id,\n\t\t\t'data'\t => '\n<article>\n\t<span class=\"communicator-message-author\">'.$author.'</span>\n\t<span class=\"communicator-message-body\">'.$body.'</span>\n\t<span class=\"communicator-message-datetime\">'.$datetime.'</span>\n</article>\n\t\t\t\t\t\t\t\t\t'\n\t\t);\n\t\t$xml_response = new WP_Ajax_Response($response);\n\t\t$xml_response->send();\n\t}",
"function wp_ajax_edit_theme_plugin_file()\n{\n}",
"function onsubmit() {\n\n\t\t\t$smarty=&$this->smarty;\n\n\t\t\t@$theme=$_POST['theme'];\n\t\t\tif(!theme_exists($theme) || empty($theme)) {\n\t\t\t\t$smarty->assign('success', -2);\n\t\t\t} else {\n\n\t\t\t\tplugin_addoption('mobile', 'theme', $theme);\n\t\t\t\tplugin_addoption('mobile', 'removejs', isset($_POST['removejs']));\n\t\t\t\tplugin_addoption('mobile', 'admin', isset($_POST['admin']));\n\n\t\t\t\t$smarty->assign('success', plugin_saveoptions('mobile') ? 1 : -1);\n\t\t\t}\n\n\t\t\t$this->main();\n\t\t\treturn 0;\n\n\t\t}",
"public function setThemeModePost()\n {\n checkAdmin();\n $this->settingsModel->setThemeMode();\n exit();\n }",
"function wp_ajax_query_themes() {}",
"public function process_ajax_submit() {\n\t\t$data = null;\n\t\tparse_str( $_POST['data'], $data );\n\n\t\tif ( !array_key_exists( 'fm-unique-name', $data ) || !array_key_exists( 'fm-original-name', $data ) || !array_key_exists( 'fm-zone-post-id', $data ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->unique_name = sanitize_text_field( $data['fm-unique-name'] );\n\n\t\tif ( !wp_verify_nonce( $data['fieldmanager-' . $this->fm->name . '-nonce'], 'fieldmanager-save-' . $this->fm->name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_array( $data[$this->unique_name] ) ) {\n\t\t\t$value = $data[$this->unique_name];\n\t\t\tarray_walk_recursive( $value, 'sanitize_text_field' );\n\t\t} else {\n\t\t\t$value = sanitize_text_field( $data[$this->unique_name] ); \n\t\t}\n\n\t\t$this->save_fields_for_zone_post( intval($data['fm-zone-post-id']), $value );\n\n\t\techo \"0\"; \n\t\tdie();\n\t}",
"public function ajax_config_theme() {\n\t\tif ( ! wp_verify_nonce( $_GET['_wpnonce'], 'soo_demo_import' ) ) {\n\t\t\twp_send_json_error( esc_html__( 'Verifing failed', 'soodi' ) );\n\t\t\teixt;\n\t\t}\n\n\t\t$demo = $_GET['demo'];\n\n\t\t// Setup pages\n\t\t$this->setup_pages( $demo );\n\n\t\t// Setup menu locations\n\t\t$this->setup_menus( $demo );\n\n\t\t// Update options\n\t\t$this->update_options( $demo );\n\n\t\twp_send_json_success( esc_html__( 'Finish setting up front page and blog page.', 'soodi' ) );\n\t}",
"function knbu_ajax_hook() {\n\tif ( isset( $_POST['knbu_ktype_info'] ) ) add_action('wp','knbu_ajax_ktype_provider');\n}",
"public function ajax_create_shadow_post() {\n\t\tcheck_ajax_referer( 'wp_rest', 'nonce' );\n\n\t\t$original_id = self::get_original_id_from_temporary_post_id( $_POST['data']['post'] );\n\t\t$post_id = self::get_or_create_shadow_post_id( $original_id );\n\t\twp_send_json_success( $post_id );\n\t}",
"protected function _process_ajax() {}",
"private function ajaxExistencia() {\n\t\t\tif(isset($_POST) == true):\n\t\t\t\t$this->ajaxPost();\n\t\t\telse:\n\t\t\t\texit('Mensaje de error no hay datos post');\n\t\t\tendif;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the given signature is valid for the given plaintext with the public key identified by the given fingerprint | public function verifySignature($plaintext, $signature, $fingerprint); | [
"public function verifySignature($plaintext, $signature, $fingerprint)\n {\n if ($fingerprint === null || !isset($this->keys[$fingerprint])) {\n throw new InvalidKeyPairIdException('Invalid keypair fingerprint given', 1304959763);\n }\n\n $verifyResult = openssl_verify($plaintext, $signature, $this->getPublicKey($fingerprint)->getKeyString());\n\n return $verifyResult === 1;\n }",
"public function signatureValidForPublicKey($publicKey)\n {\n if (empty($this->signature)) {\n return false;\n }\n return sodium_crypto_sign_verify_detached(\n Util::rawBinary($this->signature, 64),\n $this->contents,\n Util::rawBinary($publicKey, 32)\n );\n }",
"public function sign($plaintext, $fingerprint);",
"function gnupg_verify ($identifier, $signed_text, $signature, &$plaintext = null) {}",
"public function verify($signature);",
"abstract protected function validateSignature(string $signature, string $payload): bool;",
"function verify_signature($data, $public_key_data, $signature) {\n \n $pubkeyid = openssl_get_publickey($public_key_data);\n $status = openssl_verify($data, base64_decode($signature), $pubkeyid, \"sha512\");\n openssl_free_key($pubkeyid);\n\n return $status;\n}",
"public static function verify(\n $message,\n KeyInterface $publicKey,\n $signature,\n $raw = false\n );",
"private function validateSignature()\n {\n\n // Get kid from header\n $kid = getClaim(\"kid\", $this->head);\n\n // Get public key\n $key_data = $this->endpointHandler->getJwksUriData();\n\n // Extract e and n from the public key\n $e_regex = '/\"kid\":\\W*\"' . $kid . '.*\"e\":\\W*\"([^\"]+)/';\n $e_array = array();\n preg_match($e_regex, $key_data, $e_array);\n\n $n_regex = '/\"kid\":\\W*\"' . $kid . '.*\"n\":\\W*\"([^\"]+)/';\n $n_array = array();\n preg_match($n_regex, $key_data, $n_array);\n\n // 'e' and 'n' are base64 URL encoded, change to just base64 encoding\n $e = $this->convert_base64url_to_base64($e_array[1]);\n $n = $this->convert_base64url_to_base64($n_array[1]);\n\n // Convert RSA(e,n) format to PEM format\n $rsa = new Crypt_RSA();\n $rsa->setPublicKey('<RSAKeyValue>\n\t\t\t<Modulus>' . $n . '</Modulus>\n\t\t\t<Exponent>' . $e . '</Exponent>\n\t\t\t</RSAKeyValue>');\n $public_key = $rsa->getPublicKey();\n\n // Verify Signature\n $to_verify_data = $this->id_token_array[0] . \".\" . $this->id_token_array[1];\n $to_verify_sig = base64_decode($this->convert_base64url_to_base64(($this->id_token_array[2])));\n $verified = openssl_verify($to_verify_data, $to_verify_sig, $public_key, OPENSSL_ALGO_SHA256);\n\n\n return $verified;\n }",
"public function verify($message, $signature);",
"public function verify($content, $signature);",
"function gnupg_verify($identifier, $signed_text, $signature, &$plaintext = NULL)\n{\n}",
"public function validateFingerprint($fingerprints) {\n\t\tassert('is_string($fingerprints) || is_array($fingerprints)');\n\n\t\tif($this->x509Certificate === NULL) {\n\t\t\tthrow new Exception('Key used to sign the message was not an X509 certificate.');\n\t\t}\n\n\t\tif(!is_array($fingerprints)) {\n\t\t\t$fingerprints = array($fingerprints);\n\t\t}\n\n\t\t/* Normalize the fingerprints. */\n\t\tforeach($fingerprints as &$fp) {\n\t\t\tassert('is_string($fp)');\n\n\t\t\t/* Make sure that the fingerprint is in the correct format. */\n\t\t\t$fp = strtolower(str_replace(\":\", \"\", $fp));\n\t\t}\n\n\t\tself::validateCertificateFingerprint($this->x509Certificate, $fingerprints);\n\t}",
"public function validateSignature($orig,$key, $sig);",
"abstract public function verify(\n string $data,\n Signature $signature,\n PublicKeyInfo $pubkey_info,\n SignatureAlgorithmIdentifier $algo\n ): bool;",
"abstract public function verify($data, Signature $signature, \n\t\t\tPublicKeyInfo $pubkey_info, SignatureAlgorithmIdentifier $algo);",
"function validateSign($document, $signature, $public_key = null, $hash_func = null)\n {\n // check public key\n if (is_null($public_key)) {\n $public_key = $this->_public_key;\n }\n else if (!Crypt_RSA_Key::isValid($public_key)) {\n $this->pushError('invalid public key. It must be an object of Crypt_RSA_Key class', CRYPT_RSA_ERROR_WRONG_KEY);\n return null;\n }\n if ($public_key->getKeyType() != 'public') {\n $this->pushError('validating key must be public', CRYPT_RSA_ERROR_NEED_PUB_KEY);\n return null;\n }\n\n // check hash_func\n if (is_null($hash_func)) {\n $hash_func = $this->_hash_func;\n }\n if (!function_exists($hash_func)) {\n $this->pushError(\"cannot find hash function with name [$hash_func]\", CRYPT_RSA_ERROR_WRONG_HASH_FUNC);\n return null;\n }\n\n return $hash_func($document) == $this->decrypt($signature, $public_key);\n }",
"public function isSignatureMatch();",
"public static function isFingerprintValid($fingerprint=\"\") \n\t{\n\t\tarray_push(static::$logtext, 'isFingerprintValid');\n\t\tarray_push(static::$logtext, 'fingerprint: ' . $fingerprint);\n\t\t/* Compare the provided browser fingerprint with the actual fingerprint */\n\t\tif ($fingerprint === static::getBrowserFingerprint()) {\n\t\t\tarray_push(static::$logtext, 'Fingerprints match');\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\tarray_push(static::$logtext, 'Fingerprints DONT match');\n\t\t\texit;\n\t\t}\n\t\treturn FALSE;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the page range (see property declaration above). | public function getPageRange ()
{
return $this->_pageRange;
} | [
"public function getPageRange() {\n\t\tif (null === $this->_pageRange) {\n\t\t\t$this->_pageRange = self::getDefaultPageRange();\n\t\t}\n\n\t\treturn $this->_pageRange;\n\t}",
"public function getPageRange()\n {\n return $this->pageRange;\n }",
"protected function getPageRange()\n {\n return $this->driver->tryMethod('getContainerPageRange')\n ?? parent::getPageRange();\n }",
"public function getPageRange();",
"public function getRange()\n {\n return $this->range;\n }",
"public function getRange() {\n return $this->range;\n }",
"public function getRange(): string {\n return $this->range;\n }",
"protected function calculatePagesRange() {\n $current_page = $this->getCurrentPage();\n $last_page = $this->getLastPage();\n $start = $current_page - $this->pagesProximity;\n $end = $current_page + $this->pagesProximity;\n\n if($start < 1) {\n $offset = 1 - $start;\n $start += $offset;\n $end += $offset;\n }\n else if($end > $last_page) {\n $offset = $end - $last_page;\n $start -= $offset;\n $end -= $offset;\n }\n\n if($start < 1) {\n $start = 1;\n }\n\n if($end > $last_page) {\n $end = $last_page;\n }\n\n return range($start, $end);\n }",
"public function getReportRange()\n {\n if (array_key_exists(\"reportRange\", $this->_propDict)) {\n return $this->_propDict[\"reportRange\"];\n } else {\n return null;\n }\n }",
"function range () {\n\n\t\t$offset = 2;\n\n\t\t$low_end = max(1, ($this->_page_num - $offset));\n\n\t\t$offset = 2;\n\n\t\t$high_end = min($this->_page_count, ($this->_page_num + $offset));\n\n\t\t$range = array();\n\t\tfor ( $i = $low_end; $i <= $high_end; $i++ ) {\n\t\t\tarray_push($range, $i);\n\t\t}\n\t\t\n\t\treturn($range);\n\t}",
"public function getIsPageRangeSupported()\n {\n if (array_key_exists(\"isPageRangeSupported\", $this->_propDict)) {\n return $this->_propDict[\"isPageRangeSupported\"];\n } else {\n return null;\n }\n }",
"function &getLastPageRangeInfo() {\n\t\timport('lib.pkp.classes.db.DBResultRange');\n\t\t$returner = new DBResultRange(\n\t\t\t$this->itemsPerPage,\n\t\t\t$this->getPageCount()\n\t\t);\n\t\treturn $returner;\n\t}",
"public function getItemPropertyRange()\n {\n return $this->itemPropertyRange;\n }",
"public function getRangeNumber() {\n\n return $this->range;\n }",
"public function getRangeFrom () {\n\t$data = $this->rangeFrom;\n\t return $data;\n}",
"abstract public function rangeAroundPage();",
"public function getRange()\n\t{\n\t\treturn RangeQuery::make($this->value);\n\t}",
"public static function getDefaultPageRange()\n {\n return self::$_defaultPageRange;\n }",
"public function getRange(): string\n {\n return $this->value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Validates a timecode value. Timecode is considered valid when conforms to the HH:MM:SS:FF format. $tcValue = (string) formatted as HH:MM:SS:FF. $framerate = (decimal) the framerate to compare the timecode against. Returns an array( 'success' => (boolean), 'tcValidateMessage' => (string) ) | protected function tcValidate($tcValue, $framerate)
{
global $debug, $message, $success, $returnThis, $Dbc;
$tcBad = false;
if(empty($framerate)){
if(empty($this->_listInfo['framerate'])){
$debug->add('No framerate was available.');
return array('success' => false, 'tcValidateMessage' => 'No framerate was available.');
}else{
$framerate = $this->_listInfo['framerate'];
}
}
$parts = explode(':', $tcValue);//Outputs array(0 => hours, 1 => minutes, 2 => seconds, 3 => frames).
//$debug->printArray($parts,'$parts before: ');
$parts = array_map("intThis", $parts);//Convert parts to integers.
//$debug->printArray($parts,'$parts after: ');
//PREG expression to check for the format HH:MM:SS:FF.
$pattern = '^\d{1,2}:\d{2}:\d{2}:\d{2}$^';
if(empty($tcValue) || !preg_match($pattern, $tcValue, $matches)){
$debug->add('$tcValue does not match the HH:MM:SS:FF format.', debug_backtrace());
return array('success' => false, 'tcValidateMessage' => 'does not match the HH:MM:SS:FF format.');
}
//Check minutes and seconds.
if($parts[1] > 59){//Check minutes are 59 or less.
$debug->add('Minutes are greater than 59.', debug_backtrace());
return array('success' => false, 'tcValidateMessage' => 'minutes are greater than 59.');
}elseif($parts[2] > 59){//Check seconds are 59 or less.
$debug->add('Seconds are greater than 59.', debug_backtrace());
return array('success' => false, 'tcValidateMessage' => 'seconds are greater than 59.');
}elseif($parts[3] > $framerate){//Check frames are within framerate.
$debug->add('Frames are greater than framerate.', debug_backtrace());
return array('success' => false, 'tcValidateMessage' => 'frames are greater than framerate.');
}else{
return array('success' => true, 'tcValidateMessage' => 'gong');
}
} | [
"function validateTC($tcValue){\n\tglobal $debug, $message;\n\t$tcValue = trim($tcValue);\n\tif(strlen($tcValue) != 11){\n\t\treturn false;\n\t}else{\n\t\t//Add preg expression to check for the format HH:MM:SS:FF.\n\t\t$pattern = '^\\d{2}:\\d{2}:\\d{2}:\\d{2}$';\n\t\tpreg_match($pattern,$tcValue,$matches);\n\t\tif(is_array($matches)){\n\t\t\t$debug->printArray($matches);\n\t\t}\n\t\treturn true;\n\t}\n}",
"function validateTime($value) {\n if (preg_match('`^(\\d\\d?):(\\d\\d)(?::(\\d\\d))?$`', $value, $match)) {\n $h = (int)$match[1];\n $m = (int)$match[2];\n $s = (int)($match[3] ?? 0);\n\n if (0 <= $h && $h < 24 && 0 <= $m && $m < 60 && 0 <= $s && $s < 60) {\n return sprintf('%d:%02d:%02d', $h, $m, $s);\n }\n }\n return \\Vanilla\\Invalid::emptyMessage();\n }",
"public static function isValidTimeCode($code = 0) {\n\t\treturn (boolean) ($code < 0 || $code > 2) ? FALSE : TRUE;\n\t}",
"public static function isTime($value)\n {\n return preg_match('/^[0-9]{2}\\:[0-9]{2}\\:[0-9]{2}$/is', (string) $value);\n }",
"public static function fromString($timecode) : TimeCode\n {\n $days = 0;\n\n if (preg_match('/^[0-9]+:[0-9]+:[0-9]+:[0-9]+\\.[0-9]+$/', $timecode)) {\n [$days, $hours, $minutes, $seconds, $frames] = sscanf($timecode, '%d:%d:%d:%d.%d');\n } elseif (preg_match('/^[0-9]+:[0-9]+:[0-9]+:[0-9]+:[0-9]+$/', $timecode)) {\n [$days, $hours, $minutes, $seconds, $frames] = sscanf($timecode, '%d:%d:%d:%d:%d');\n } elseif (preg_match('/^[0-9]+:[0-9]+:[0-9]+\\.[0-9]+$/', $timecode)) {\n [$hours, $minutes, $seconds, $frames] = sscanf($timecode, '%d:%d:%d.%s');\n } elseif (preg_match('/^[0-9]+:[0-9]+:[0-9]+:[0-9]+$/', $timecode)) {\n [$hours, $minutes, $seconds, $frames] = sscanf($timecode, '%d:%d:%d:%s');\n } else {\n throw new InvalidArgumentException(sprintf('Unable to parse timecode %s', $timecode));\n }\n\n $hours += $days * 24;\n\n return new static($hours, $minutes, $seconds, $frames);\n }",
"function verify_time_format( $time_value ) {\n\t\t$pattern1 = '/^(0?\\d|1\\d|2[0-3]):[0-5]\\d:[0-5]\\d$/';\n\t\t#$pattern2 = '/^(0?\\d|1[0-2]):[0-5]\\d\\s(am|pm)$/i'; # 11:59 am|pm\n\t\t#return preg_match($pattern1, $time_value) || preg_match($pattern2, $time_value);\n\t\treturn preg_match($pattern1, $time_value) ; #|| preg_match($pattern2, $time_value);\n\t}",
"public function validate_time($attribute, $value) {\n\t\treturn preg_match('/^([0-9]){1,2}:([0-9]){1,2}$/i', $value);\n\t}",
"public function testRFC6351ValueTimeWithHourMinuteSecond()\n {\n $this->assertXMLReflexivelyEqualsToMimeDir(\n<<<XML\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<vcards xmlns=\"urn:ietf:params:xml:ns:vcard-4.0\">\n <vcard>\n <bday>\n <date-and-or-time>135301</date-and-or-time>\n </bday>\n </vcard>\n</vcards>\nXML\n,\n 'BEGIN:VCARD'.\"\\n\".\n 'VERSION:4.0'.\"\\n\".\n 'BDAY:135301'.\"\\n\".\n 'END:VCARD'.\"\\n\"\n );\n }",
"function rausbar_validate_time_field( $result, $value, $form, $field ) {\n\t$time = strtotime( implode( ':', $value ) );\n\t$min_time = '19:00';\n\t$max_time = '23:00';\n\n\tif ( $time == false ) {\n\t\t$result['is_valid'] = false;\n\t\t$result['message'] = 'Vennligst fyll inn begge feltene.';\n\t} elseif ( $time < strtotime( $min_time ) || $time > strtotime( $max_time ) ) {\n\t\t$result['is_valid'] = false;\n\t\t$result['message'] = \"Velg et tidspunkt mellom {$min_time} og {$max_time}.\";\n\t}\n\n\treturn $result;\n}",
"public function test_validate_code() {\n global $DB;\n\n $this->resetAfterTest(true);\n $user = $this->getDataGenerator()->create_user();\n $this->setUser($user);\n // Setup test staples.\n $totp = \\OTPHP\\TOTP::create('fakekey');\n $window = 10;\n\n set_config('enabled', 1, 'factor_totp');\n $totpfactor = \\tool_mfa\\plugininfo\\factor::get_factor('totp');\n $totpdata = [\n 'secret' => 'fakekey',\n 'devicename' => 'fakedevice',\n ];\n $factorinstance = $totpfactor->setup_user_factor((object) $totpdata);\n\n // First check that a valid code is actually valid.\n $code = $totp->at(time());\n // Manually set timeverified of factor.\n $DB->set_field('tool_mfa', 'lastverified', time() - WEEKSECS, ['id' => $factorinstance->id]);\n $result = $totpfactor->validate_code($code, $window, $totp, $factorinstance);\n $this->assertEquals($totpfactor::TOTP_VALID, $result);\n\n // Now update timeverified to 2 mins ago, and check codes within window are blocked.\n $code = $totp->at(time() - (2 * MINSECS));\n $DB->set_field('tool_mfa', 'lastverified', time() - (2 * MINSECS), ['id' => $factorinstance->id]);\n $result = $totpfactor->validate_code($code, $window, $totp, $factorinstance);\n $this->assertEquals($totpfactor::TOTP_USED, $result);\n\n // Now update timeverified to 2 mins ago, and check codes within window are blocked.\n $code = $totp->at(time());\n $DB->set_field('tool_mfa', 'lastverified', time() - (2 * MINSECS), ['id' => $factorinstance->id]);\n $result = $totpfactor->validate_code($code, $window, $totp, $factorinstance);\n $this->assertEquals($totpfactor::TOTP_USED, $result);\n\n // Now update timeverified to 2 mins ago, and check codes within window are blocked.\n $code = $totp->at(time() - (4 * MINSECS));\n $DB->set_field('tool_mfa', 'lastverified', time() - (2 * MINSECS), ['id' => $factorinstance->id]);\n $result = $totpfactor->validate_code($code, $window, $totp, $factorinstance);\n $this->assertEquals($totpfactor::TOTP_USED, $result);\n\n // Now check future codes.\n $window = 1;\n $code = $totp->at(time() + (2 * MINSECS));\n $DB->set_field('tool_mfa', 'lastverified', time() - WEEKSECS, ['id' => $factorinstance->id]);\n $result = $totpfactor->validate_code($code, $window, $totp, $factorinstance);\n $this->assertEquals($totpfactor::TOTP_FUTURE, $result);\n\n // Codes in far future are invalid.\n $code = $totp->at(time() + (20 * MINSECS));\n $result = $totpfactor->validate_code($code, $window, $totp, $factorinstance);\n $this->assertEquals($totpfactor::TOTP_INVALID, $result);\n\n // Do the same for past codes.\n $window = 1;\n $code = $totp->at(time() - (2 * MINSECS));\n $result = $totpfactor->validate_code($code, $window, $totp, $factorinstance);\n $this->assertEquals($totpfactor::TOTP_OLD, $result);\n\n // Codes in far future are invalid.\n $code = $totp->at(time() - (20 * MINSECS));\n $result = $totpfactor->validate_code($code, $window, $totp, $factorinstance);\n $this->assertEquals($totpfactor::TOTP_INVALID, $result);\n\n // Check incorrect codes are invalid.\n // Note code has a 1 in 30,000,000 chance of failing.\n $code = '123456';\n $result = $totpfactor->validate_code($code, $window, $totp, $factorinstance);\n $this->assertEquals($totpfactor::TOTP_INVALID, $result);\n }",
"function validTime($inTime) {\r\n$pattern = \"/^((([9])|([0-2])|([0-1][0-2])):?([0-5][0-9]))|(([0-3]):?([0-2][0-9])|([0-3][0]))$/\";\r\n if(preg_match($pattern,$inTime)){\r\n return true;\r\n }\r\n}",
"public function testRFC6351ValueTimeWithSecondTZ()\n {\n $this->assertXMLReflexivelyEqualsToMimeDir(\n<<<XML\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<vcards xmlns=\"urn:ietf:params:xml:ns:vcard-4.0\">\n <vcard>\n <bday>\n <date-and-or-time>--01+1234</date-and-or-time>\n </bday>\n </vcard>\n</vcards>\nXML\n,\n 'BEGIN:VCARD'.\"\\n\".\n 'VERSION:4.0'.\"\\n\".\n 'BDAY:--01+1234'.\"\\n\".\n 'END:VCARD'.\"\\n\"\n );\n }",
"private function isTime($value) {\n\t\t$int = strtotime($value);\n\t\tif($int !== FALSE) { return $int; }\n\t\treturn false;\n\t}",
"public static function validateTime($value, $fieldName, $errors) {\n $parts = explode(':', $value);\n if (count($parts) != 2) {\n $errors[$fieldName] = 'Malformed';\n return '';\n }\n list($hour, $minute) = $parts;\n if (!is_numeric($hour) || !is_numeric($minute)) {\n $errors[$fieldName] = 'Malformed';\n return '';\n }\n $hour = intval($hour);\n $minute = intval($minute);\n if ($hour < 0 || $hour > 24 || $minute < 0 || $minute > 60) {\n $errors[$fieldName] = 'Malformed';\n return '';\n }\n \n $time = str_pad($hour, 2, \"0\", STR_PAD_LEFT).':'.str_pad($minute, 2, \"0\", STR_PAD_LEFT).':00';\n return $time;\n }",
"public static function tc2ms($_timecode);",
"public function validateToken( $value )\n {\n // Initialize\n $bReturn = FALSE;\n $pPatterns = new \\Common\\Filter\\CPattern();\n $pPattern = $pPatterns->getSession();\n\n // Filter input value\n $pInput = new \\Common\\Type\\CString( $value, $pPattern );\n\n // Filter session value\n if( $pInput->isValid() && isset( $this->_pNamespaceCSRF ) )\n {\n try\n {\n $pSession = new \\Common\\Type\\CString( $this->_pNamespaceCSRF->token, $pPattern );\n if( $pSession->isValid() )\n {\n // Validate\n $bReturn = $pInput->isEqual( $pSession );\n }//if(...\n }\n catch( \\Exception $e)\n {\n // @codeCoverageIgnoreStart\n $bReturn = FALSE;\n // @codeCoverageIgnoreEnd\n }//try...\n unset($pSession);\n }//if(...\n unset( $pInput, $pPattern, $pPatterns );\n return $bReturn;\n }",
"function validate_isodatetime ( $sValue )\n{\n return ((strlen($sValue) == 19)\n and validate_isodate(substr($sValue, 0, 10))\n and in_array(substr($sValue, 10, 1), array('T', ' '))\n and validate_isotime(substr($sValue, 11, 8)));\n}",
"public function time_validate($time)\n {\n \treturn preg_match(\"/^(2[0-3]|[01][0-9]):([0-5][0-9])$/\", $time);\n }",
"function is_time_valid($time) {\n return preg_match(\"/^\\d{2}:\\d{2}(?::\\d{2})?$/\", $time) !== 0;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Zone SOA record. | public function getSoaRecord()
{
return $this->soa;
} | [
"public static function getSoaRecord(): pm_Dns_Template_SoaRecord { }",
"function getEvent($zone){\n\t\t$event = new Event();\n\t\t$event->$zone = $zone;\n\t\t$event->account = $this->account;\n\t\tswitch ($zone){\n\t\t\tcase \"1\":\n\t\t\t\t$event->timestamp = $this->at;\n\t\t\t\t$event->status = $this->as;\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\t$event->timestamp = $this->st;\n\t\t\t\t$event->status = $this->ss;\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\t$event->timestamp = $this->tt;\n\t\t\t\t$event->status = $this->ts;\n\t\t\t\tbreak;\n\t\t\tcase \"4\":\n\t\t\t\t$event->timestamp = $this->pt;\n\t\t\t\t$event->status = $this->ps;\n\t\t\t\tbreak;\n\t\t\tcase \"A\":\n\t\t\t\t$event->timestamp = $this->awt;\n\t\t\t\t$event->status = $this->aws;\n\t\t\t\tbreak;\n\t\t\tcase \"B\":\n\t\t\t\t$event->timestamp = $this->swt;\n\t\t\t\t$event->status = $this->sws;\n\t\t\t\tbreak;\n\t\t\tcase \"C\":\n\t\t\t\t$event->timestamp = $this->twt;\n\t\t\t\t$event->status = $this->tws;\n\t\t\t\tbreak;\n\t\t\tcase \"D\":\n\t\t\t\t$event->timestamp = $this->pwt;\n\t\t\t\t$event->status = $this->pws;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$event = null;\n\t\t\t\tbreak;\n\n\t\t}\n\t\t$event->timestamp = date_create($event->timestamp);\n\t\treturn $event;\n\t}",
"private function zone()\n {\n return (new Hexpress())->find(function($hex) { $hex->either([\n (new Hexpress())->has($this->FWS())->either(['+','-'])->limit(Character::digit(), 4, 4),\n $this->obsZone(),\n ]); }, 'zone');\n }",
"public function GetRecord(GeoRecord $record) {\n\t\treturn $this->SendRequest('GET', '0.1/records/' . $record->Layer . '/' . $record->ID . '.json');\n\t}",
"public function getRecord();",
"public function getRecord(): DnsRecord;",
"public function getSOA($domain)\r\n {\r\n $this->validateDomain($domain);\r\n return $this->api->makeAPICall('GET', $this->api::DNS_URL . \"/\" . $domain . \"/soa\");\r\n }",
"protected function getDnsZoneRecords()\n {\n return '{\"page\": 1, \"total_pages\": 1, \"total_results\": 15, \"records\": [\n {\"id\": \"dnsrecord_1\", \"type\": \"NS\", \"ttl_sec\": 0, \"target\": \"\", \"name\": \"ns1.linode.com\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_2\", \"type\": \"NS\", \"ttl_sec\": 0, \"target\": \"\", \"name\": \"ns2.linode.com\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_3\", \"type\": \"NS\", \"ttl_sec\": 0, \"target\": \"admin\", \"name\": \"ns3.linode.com\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_4\", \"type\": \"A\", \"ttl_sec\": 0, \"target\": \"192.168.0.1\", \"name\": \"\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_5\", \"type\": \"A\", \"ttl_sec\": 0, \"target\": \"192.168.0.1\", \"name\": \"*\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_6\", \"type\": \"AAAA\", \"ttl_sec\": 0, \"target\": \"0:0:0:0:0:ffff:c0a8:1\", \"name\": \"admin\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_7\", \"type\": \"CNAME\", \"ttl_sec\": 0, \"target\": \"ghs.google.com\", \"name\": \"mail\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_8\", \"type\": \"MX\", \"ttl_sec\": 0, \"target\": \"aspmx.l.google.com\", \"name\": \"\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 1, \"service\": null}, \n {\"id\": \"dnsrecord_9\", \"type\": \"MX\", \"ttl_sec\": 0, \"target\": \"aspmx2.l.google.com\", \"name\": \"\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 10, \"service\": null}, \n {\"id\": \"dnsrecord_10\", \"type\": \"MX\", \"ttl_sec\": 0, \"target\": \"aspmx3.l.google.com\", \"name\": \"\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 10, \"service\": null}, \n {\"id\": \"dnsrecord_11\", \"type\": \"MX\", \"ttl_sec\": 0, \"target\": \"alt1.aspmx.l.google.com\", \"name\": \"admin\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 5, \"service\": null}, \n {\"id\": \"dnsrecord_12\", \"type\": \"MX\", \"ttl_sec\": 0, \"target\": \"alt2.aspmx.l.google.com\", \"name\": \"admin\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 5, \"service\": null}, \n {\"id\": \"dnsrecord_13\", \"type\": \"TXT\", \"ttl_sec\": 0, \"target\": \"v=spf1 ip4:192.168.0.1 include:_spf.google.com ~all\", \"name\": \"\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_14\", \"type\": \"TXT\", \"ttl_sec\": 0, \"target\": \"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDfl0chtL4siFYCrSPxw43fqc4zOo3N+Il220oK2Cp+NZw9Kuvg8iu2Ua3zfbUnZWvWK4aEeooliRd7SXIhKpXkgkwnAB3DGAQ6+/7UVXf9xOeupr1DqtNwKt/NngC7ZIZyNRPx1HWKleP13UXCD8macUEbbcBhthrnETKoCg8wOwIDAQAB;\", \"name\": \"google._domainkey\", \"protocol\": null, \"weight\": 0, \"port\": 0, \"priority\": 0, \"service\": null}, \n {\"id\": \"dnsrecord_15\", \"type\": \"SRV\", \"ttl_sec\": 0, \"target\": \"admin\", \"name\": \"_sip._tcp\", \"protocol\": \"_tcp\", \"weight\": 0, \"port\": 80, \"priority\": 10, \"service\": \"_sip\"}]}';\n }",
"public function zone()\n {\n return $this->belongsTo(Zone::class);\n }",
"function jget_roshine_record($sid)\n{\n global $DB;\n return $DB->get_record('roshine', array('id' => $sid));\n}",
"abstract function get_record();",
"public function get_record()\n {\n //$this->log(__FUNCTION__ . \" called with type {$this->type} = \" . json_encode($this->db->Record), __LINE__, __FILE__, 'debug');\n if ($this->type == 'function') {\n return $this->queries->Record;\n } else {\n return $this->db->Record;\n }\n }",
"protected function _getDefaultZone() {\n $nsdefault = $this\n ->_getConfigService()\n ->getParameter('dns.default.ns');\n $zone = new ZoneCollection();\n $ns = new NS();\n $soa = new SOA();\n\n $soa\n ->setPrimary($nsdefault)\n ->setMail($this\n ->getUser()\n ->getEmail() . '.');\n\n $ns->setRdata($nsdefault);\n\n $zone\n ->add($soa)\n ->add($ns);\n\n return $zone;\n }",
"function getZoneId() {\t\n\n\t\t// Get service object\n\t\t$service = $this->service;\n\t\t\n\t\t// Connect to API in order to get zone ID value\n\t\t$client = new uber_api_client(UBER_API_URL, UBER_API_USER,UBER_API_TOKEN);\n\t\t\n\t\ttry {\n\t\t\t$hosted_zone_id = $client->call('client.service_metadata_single',array(\n\t\t\t\t'service_id' => $service['packid'],\n\t\t\t\t'variable' => 'amazon_zone_id'\n\t\t\t));\n\t\t\t\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\tprint 'Error: '. $e->getMessage() .' ('. $e->getCode() .')';die();\n\t\t}\t\n\n\t\treturn $hosted_zone_id;\n\t}",
"public function getZone()\n {\n return $this->zone;\n }",
"public static function fromDateTimeZone(\\DateTimeZone $zone) {\n\t\treturn static::parse($zone->getName());\n\t}",
"public function get(Record $record): Record;",
"public function getZoneById($id = null) {\n return $this->Db->selectOne($this->tableZones, $id);\n }",
"public static function new_sector_detail_record()\n\t{\n\t\treturn new squad_record_sector_detail();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Linkedin get comments of update by AJAX | public function linkedin_get_comments(){
$this->load->library('Socializer/socializer');
$linkedin = Socializer::factory('Linkedin', $this->c_user->id);
$comments = $linkedin->getComments($_GET['key']);
$html = '';
if( is_array($comments) && !empty($comments) ) {
foreach ( $comments as $comment ) {
$html .= $this->template->block(
'_comment',
'social/activity/blocks/_one_linkedin_comment',
array('comment' => $comment, 'socializer' => $linkedin)
);
}
}
echo $html;
} | [
"public function ajax_comments()\n\t{\n\t\tUtils::check_request_method( array( 'GET', 'HEAD' ) );\n\n\t\t$this->create_theme();\n\t\t$this->theme->theme = $this->theme;\n\n\t\t$params = $_GET;\n\n\t\t$this->fetch_comments( $params );\n\t\t$items = $this->theme->fetch( 'comments_items' );\n\t\t$timeline = $this->theme->fetch( 'timeline_items' );\n\n\t\t$item_ids = array();\n\n\t\tforeach ( $this->theme->comments as $comment ) {\n\t\t\t$item_ids['p' . $comment->id] = 1;\n\t\t}\n\n\t\t$ar = new AjaxResponse();\n\t\t$ar->data = array(\n\t\t\t'items' => $items,\n\t\t\t'item_ids' => $item_ids,\n\t\t\t'timeline' => $timeline,\n\t\t);\n\t\t$ar->out();\n\t}",
"function wp_ajax_edit_comment() {}",
"function wp_ajax_edit_comment()\n {\n }",
"public function GetAjaxComments()\n {\n $this->viewBuilder()->setLayout('ajax');\n $limit = 10;\n $comments = array();\n $data = $this->request->getData();\n if (isset($data['content_type']) && !empty($data['content_type'])) {\n $conditions = ['content_id' => $data['content_id'],'content_type' =>$data['content_type']];\n $offset = ($data['page_no'] - 1) * $limit;\n $comments = $this->Comments->find('threaded', [\n 'contain' => ['Users'],\n 'conditions' => $conditions,\n 'limit' => $limit,\n 'offset' => $offset\n ]);\n }\n\n\n /* foreach ($comments as $comment){\n pr($comment);\n }\n exit();*/\n $this->set(compact('comments'));\n }",
"function edit(){\n $id = $this->input->post('id');\n if(!acl('comments edit') OR !$id) ajax(FALSE);\n $this->session->set('comm_edit_id',$id);\n ajax(TRUE,$this->db->get_where('comments',array('id'=>$id))->row()->body);\n }",
"public function showComments()\n {\n if (Request::ajax()) {\n $comments = Comments::with(['authorProfile','likes'])\n\t\t\t\t\t\t\t\t->where('article_id','=',ServiceController::getArticleBySlug($_POST['slug']))\n ->orderBy('created_at', 'asc')\n\t\t\t\t\t\t\t\t->get();\n\n return $comments;\n }\n }",
"public function get_step_comment_page() {\n // nonce check\n\t\tcheck_ajax_referer( 'owf_inbox_ajax_nonce', 'security' );\n\t\tob_start();\n\t\tinclude( OASISWF_PATH . \"includes/pages/subpages/action-comments.php\" );\n\t\t$result = ob_get_contents();\n\t\tob_end_clean();\n\n\t\twp_send_json_success( htmlentities( $result ) );\n\t}",
"public function fetchComments();",
"function comments() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['video_id'];\n if ($id > 0) {\n $query = \"select * from comments where video_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n } \n }",
"public static function the_ajax_comment_cache() {\r\n\r\n\t\t$comment_cache = SB_Instagram_Comments::get_comment_cache();\r\n\r\n\t\techo $comment_cache;\r\n\r\n\t\tglobal $sb_instagram_posts_manager;\r\n\r\n\t\t$sb_instagram_posts_manager->update_successful_ajax_test();\r\n\r\n\t\tdie();\r\n\t}",
"function act_entry_comments()\n\t{\n\t\tUtils::check_request_method( array( 'GET', 'HEAD', 'POST' ) );\n\n\t\tif ( isset( $this->handler_vars['slug'] ) ) {\n\t\t\t$this->act_comments( array( 'slug' => $this->handler_vars['slug'] ) );\n\t\t}\n\t\telse {\n\t\t\t$this->act_comments( array( 'id' => $this->handler_vars['id'] ) );\n\t\t}\n\t}",
"public function updatecomment()\n {\n $id_comment = $this->request->getParameter(\"id\");\n $comment = $this->comment->getComment($id_comment);\n $content = $comment['content'];\n $this->comment->changeCommentAdmin($content);\n }",
"function getBlogComments(){\n $blogid = ($_GET['id']);\n $comments = Comments::getComments($blogid);\n return $comments;\n }",
"public function instaLoadMoreComments() {\n $mode = \\Drupal::request()->get('mode');\n if (isset($mode)) {\n $getData = \\Drupal::request()->get('data');\n $option = \\Drupal::request()->get('option');\n if ($option == 'loadComments') {\n $data['single_insta_post']['comments'] = $getData;\n \\Drupal::logger('social media insta load more comments')->warning('<pre><code>' . print_r($getData, TRUE) . '</code></pre>');\n $twigFilePath = drupal_get_path('module', 'social_media') . '/templates/instagram/instagram-comments.html.twig';\n $template = $this->twig->loadTemplate($twigFilePath);\n $markup = $template->render(array('data' => $data));\n\n } else {\n $comment_value['replies'] = $getData;\n // \\Drupal::logger('social media insta')->warning('<pre><code>' . print_r($comment_value , TRUE) . '</code></pre>');\n $twigFilePath = drupal_get_path('module', 'social_media') . '/templates/instagram/instagram-replies.html.twig';\n $template = $this->twig->loadTemplate($twigFilePath);\n $markup = $template->render(array('comment_value' => $comment_value));\n }\n $output = array('response' => array('data' => $markup));\n $json_response = json_encode($output);\n return new Response($json_response);\n }\n }",
"public function getFormUpdateComm() {\n if(isset($_GET['idComm'])) {\n\n try {\n $modelComment = new Comments(Database::instance());\n $data = $modelComment->getFormUpdateComm($_GET['idComm']);\n\n $this->json($data);\n } catch (\\PDOException $ex) {\n $this->errorLog(\"getFormUpdateComm()\", $ex->getMessage());\n\n }\n\n } else {\n $this->json(null, 403);\n }\n }",
"function wp_ajax_dim_comment()\n{\n}",
"public function fseo_tt_update_comment()\n {\n $id = $_POST['commentId'];\n $content = $_POST['commentContent'];\n $comment = get_comment($id, ARRAY_A);\n $comment['comment_content'] = $content;\n\n $res = wp_update_comment($comment);\n\n echo json_encode(['status' => $res ? 'success' : 'fail']);\n die();\n }",
"function wp_ajax_dim_comment()\n {\n }",
"public function getComments(){\n $this->viewBuilder()->setLayout('ajax');\n $limit = 10;\n $comments = array();\n $data = $this->request->getData();\n\n if(isset($data['content_id']) && !empty($data['content_id'])){\n //$conditions = ['content_id' => $data['story_id']];\n $conditions = ['content_id' => $data['content_id'],'content_type' =>$data['content_type']];\n $offset = ($data['page_no']-1)*$limit;\n $comments = $this->Comments->find('all', [\n 'contain' => ['Users'],\n 'conditions' => $conditions,\n 'limit' => $limit,\n 'offset' => $offset,\n 'order' => ['Comments.created' => 'DESC']\n ]);\n }\n //pr($comments);exit();\n $this->set(compact('comments'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Echo the Folder of your great template. | function template_folder() {
global $template, $path;
echo $path . 'template/'.$template.'/';
} | [
"function _templateFolder() {\n return Inflector::underscore(str_replace(\n 'Component', '', $this->toString()\n ));\n }",
"public function templateDirectory(): string;",
"public static function editFolderTpl()\n {\n extract(FeedPage::$var);\n?>\n<?php include(\"tpl/edit_folder.tpl.php\"); ?>\n<?php\n }",
"public function getTemplateDir();",
"public function templateDirectory(): String\n {\n return $this->templateDirectory;\n }",
"private static function getPath()\n {\n return dirname(dirname(__DIR__)).'/templates';\n }",
"public function getTemplatesFolder(): string\n {\n return basePath(self::$templatesFolder);\n }",
"abstract function template_dir();",
"public function showTemplate(){\n\t\techo $this->template;\n\t}",
"public static function getTemplatesFolder(){\r\n return self::$paths[\"templates\"];\r\n }",
"public function getTemplatePath()\n {\n return 'tpl/pages/';\n }",
"public function location()\n {\n $path = $this->getPath();\n\n if (in_array($this->getType(), ['twig', 'html', 'markdown'])) {\n $path = dirname($path) . '/' . basename($path, '.' . $this->extension());\n }\n\n return \"templates::{$path}\";\n }",
"private function getTemplateDir()\n {\n return realpath(dirname(__FILE__).'/../views/webapp');\n }",
"function TemplateLocation() {\n $str = $this->pageString;\n return \"templates/$str.php\";\n }",
"protected function getCmsViewFolder() {\n\t\t// cms/sample-cms-page.blade.php\n\t\treturn \"cms\" . DIRECTORY_SEPARATOR;\n\t}",
"function mountain_template_path() {\n\treturn Mountain_Wrapper::$main_template;\n}",
"public function getTemplateFolder()\n {\n return $this->getThemeFolder().'templates/';\n }",
"public function viewsFolder(): string;",
"public function getExampleTemplatePath()\n {\n return __DIR__.'/template.php';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the module kernel class | protected function getModuleKernel(): string
{
return CompositeKernel::class;
} | [
"private function getModuleClass()\n {\n return $this->aModuleConfiguration[$this->sModuleName]['object'];\n }",
"public function getModuleClass()\n\t{\n\t\t// Use the base controller name for the hook, ie post\n\t\t$module_class = explode('\\\\', trim(get_class($this), '\\\\'));\n\t\t$module_class = end($module_class);\n\n\t\treturn ucfirst($module_class);\n\t}",
"public function kernel()\n {\n return $this->_kernel;\n }",
"public function get_module()\n\t{\n\t\treturn $this->fuel->modules->get(strtolower(get_class($this)), FALSE);\n\t}",
"protected function kernel() {\n return $this->container->get('kernel');\n }",
"public static function kernel() {\n\t\treturn static::$kernel ?: (static::$kernel = new Kernel());\n\t}",
"static public function defaultKernel()\n {\n return DefaultKernel::class;\n }",
"public function getKernel()\n {\n return $this->kernel;\n }",
"protected function getConsoleKernelClass()\n {\n return Kernel::class;\n }",
"public static function get_boot_module()\n {\n return self::$_boot_module;\n }",
"function module_key()\r\n {\r\n return strtolower(get_class($this));\r\n }",
"public function getModuleClassInstance() {\n\t\tif (isset($this->instance)) { return $this->instance; }\n\t\telse {\n\t\t\t$this->instance = $this->reflectClass->newInstance();\n\t\t\treturn $this->instance;\n\t\t}\n\t}",
"public function getModuleClassname()\n {\n $class = new ReflectionClass($this);\n return $class->getNamespaceName() . '\\Module';\n }",
"protected function getContainerClass()\n {\n // In order to avoid collisions between kernels use a dedicated name\n return parent::getContainerClass().Container::camelize($this->getConfigDirectory());\n }",
"public function getControllerModule();",
"public function getPrimaryModule() {}",
"abstract protected function getManagedClass() : string ;",
"public function get_module()\n {\n // try to resolve the function name to a device id without query\n $hwid = $this->_func;\n if(strpos($hwid, '.') === FALSE) {\n $resolve = YAPI::resolveFunction($this->_className, $this->_func);\n if($resolve->errorType == YAPI_SUCCESS) $hwid = $resolve->result;\n }\n $dotidx = strpos($hwid, '.');\n if($dotidx !== FALSE) {\n // resolution worked\n return yFindModule(substr($hwid, 0, $dotidx));\n }\n\n // device not resolved for now, force a communication for a last chance resolution\n if($this->load(YAPI::$defaultCacheValidity) == YAPI_SUCCESS) {\n $resolve = YAPI::resolveFunction($this->_className, $this->_func);\n if($resolve->errorType == YAPI_SUCCESS) $hwid = $resolve->result;\n }\n $dotidx = strpos($hwid, '.');\n if($dotidx !== FALSE) {\n // resolution worked\n return yFindModule(substr($hwid, 0, $dotidx));\n }\n // return a true yFindModule object even if it is not a module valid for communicating\n return yFindModule('module_of_'.$this->_className.'_'.$this->_func);\n }",
"protected static function getKernel()\n {\n if (self::$kernel === null) {\n self::$kernel = new \\Apparat\\Kernel\\Domain\\Model\\Kernel(new DiceAdapter(), new Logger());\n }\n\n return self::$kernel;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set hints related to rules | protected function setRulesHints()
{
$this->hints['closeAncestor'] = 0;
$this->hints['closeParent'] = 0;
$this->hints['createChild'] = 0;
$this->hints['fosterParent'] = 0;
$this->hints['requireAncestor'] = 0;
$flags = 0;
foreach ($this->config['tags'] as $tagConfig)
{
// Test which rules are in use
foreach (array_intersect_key($tagConfig['rules'], $this->hints) as $k => $v)
{
$this->hints[$k] = 1;
}
$flags |= $tagConfig['rules']['flags'];
}
$flags |= $this->config['rootContext']['flags'];
// Iterate over Parser::RULE_* constants and test which flags are set
$parser = new ReflectionClass('s9e\\TextFormatter\\Parser');
foreach ($parser->getConstants() as $constName => $constValue)
{
if (substr($constName, 0, 5) === 'RULE_')
{
// This will set HINT.RULE_AUTO_CLOSE and others
$this->hints[$constName] = ($flags & $constValue) ? 1 : 0;
}
}
} | [
"protected function setRulesHints()\n\t{\n\t\t$this->hints['closeAncestor'] = 0;\n\t\t$this->hints['closeParent'] = 0;\n\t\t$this->hints['fosterParent'] = 0;\n\t\t$this->hints['requireAncestor'] = 0;\n\n\t\t$flags = 0;\n\t\tforeach ($this->config['tags'] as $tagConfig)\n\t\t{\n\t\t\t// Test which rules are in use\n\t\t\tforeach (array_intersect_key($tagConfig['rules'], $this->hints) as $k => $v)\n\t\t\t{\n\t\t\t\t$this->hints[$k] = 1;\n\t\t\t}\n\t\t\t$flags |= $tagConfig['rules']['flags'];\n\t\t}\n\t\t$flags |= $this->config['rootContext']['flags'];\n\n\t\t// Iterate over Parser::RULE_* constants and test which flags are set\n\t\t$parser = new ReflectionClass('s9e\\\\TextFormatter\\\\Parser');\n\t\tforeach ($parser->getConstants() as $constName => $constValue)\n\t\t{\n\t\t\tif (substr($constName, 0, 5) === 'RULE_')\n\t\t\t{\n\t\t\t\t// This will set HINT.RULE_AUTO_CLOSE and others\n\t\t\t\t$this->hints[$constName] = ($flags & $constValue) ? 1 : 0;\n\t\t\t}\n\t\t}\n\t}",
"public function setHints($hints) {\n $this->hints = $hints;\n }",
"function SetHint($hint){}",
"public function setHintMetrics($hint_metrics){}",
"public function enableHints() {\n $this->_showHints = true;\n }",
"protected function setPluginsHints()\n\t{\n\t\tforeach ($this->plugins as $plugin)\n\t\t{\n\t\t\t$this->hints += $plugin->getJSHints();\n\t\t}\n\n\t\t$this->hints['regexp'] = 0;\n\t\t$this->hints['regexpLimit'] = 0;\n\t\tforeach ($this->config['plugins'] as $pluginConfig)\n\t\t{\n\t\t\t$this->hints['regexp'] |= isset($pluginConfig['regexp']);\n\t\t\t$this->hints['regexpLimit'] |= isset($pluginConfig['regexpLimit']);\n\t\t}\n\t}",
"public function setRule() {\n }",
"public function hint($hint) {\n\t\t$this->_hints [] = $hint;\n\t\treturn $this;\n\t}",
"public function setHints(array $hints)\n {\n $this->unitOfWorkHints = $hints;\n }",
"abstract public function hint_description();",
"public function setRulesProvider(): void;",
"abstract protected function setRuleList():void;",
"public function testPropertyHints()\n {\n $this->markTestIncomplete('Not implemented yet');\n }",
"protected function setRenderingHints()\n\t{\n\t\t// Test for post-processing in templates. Theorically allows for false positives and\n\t\t// false negatives, but not in any realistic setting\n\t\t$this->hints['postProcessing'] = (int) (strpos($this->xsl, 'data-s9e-livepreview-postprocess') !== false);\n\t}",
"public function getHints() {\n return $this->hints;\n\t}",
"public function setRules($rules);",
"public function getHints()\n {\n return $this->hints;\n }",
"protected function setTagsHints()\n\t{\n\t\t$this->hints['attributeDefaultValue'] = 0;\n\t\t$this->hints['namespaces'] = 0;\n\t\tforeach ($this->config['tags'] as $tagName => $tagConfig)\n\t\t{\n\t\t\t$this->hints['namespaces'] |= (strpos($tagName, ':') !== false);\n\t\t\t$this->setTagAttributesHints($tagConfig);\n\t\t}\n\t}",
"protected function initHints()\n {\n $hint = ArrayHelper::getValue($this->pluginOptions, 'hint', []);\n if (!empty($this->hintWords)) {\n $hint[] = [\n 'words' => $this->hintWords,\n 'match' => new JsExpression('/\\b(\\w{1,})$/'),\n 'search' => new JsExpression(\n 'function (keyword, callback) {'.\n ' callback($.grep(this.words, function (item) {'.\n ' return item.indexOf(keyword) === 0;'.\n ' }));'.\n '}'\n ),\n ];\n }\n if (!empty($this->hintMentions)) {\n $hint[] = [\n 'mentions' => $this->hintMentions,\n 'match' => new JsExpression('/\\B@(\\w*)$/'),\n 'search' => new JsExpression(\n 'function (keyword, callback) {'.\n ' callback($.grep(this.mentions, function (item) {'.\n ' return item.indexOf(keyword) == 0;'.\n ' }));'.\n '}'\n ),\n 'content' => new JsExpression('function (item) { return \"@\" + item; }'),\n ];\n }\n if ($this->enableHintEmojis) {\n /** @noinspection RequiredAttributes */\n /** @noinspection HtmlRequiredAltAttribute */\n /** @noinspection HtmlUnknownTarget */\n $hint[] = [\n 'match' => new JsExpression('/:([\\-+\\w]+)$/'),\n 'search' => new JsExpression(\n 'function (keyword, callback) {'.\n ' callback($.grep(kvEmojis, function (item) {'.\n ' return item.indexOf(keyword) === 0;'.\n ' }));'.\n '}'\n ),\n 'template' => new JsExpression(\n 'function (item) {'.\n ' var content = kvEmojiUrls[item];'.\n ' return \\'<img src=\"\\' + content + \\'\" width=\"20\" /> :\\' + item + \\':\\''.\n '}'\n ),\n 'content' => new JsExpression(\n 'function (item) {'.\n ' var url = kvEmojiUrls[item];'.\n ' if (url) {'.\n ' return $(\"<img />\").attr(\"src\", url).css(\"width\", 20)[0];'.\n ' }'.\n ' return \"\";'.\n '}'\n ),\n ];\n }\n $this->pluginOptions['hint'] = $hint;\n $this->pluginOptions['customOptions'] = [\n 'enableHintEmojis' => $this->enableHintEmojis,\n 'autoFormatCode' => $this->enableCodeView && $this->autoFormatCode,\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write out bucket info to the headers. | public function writeHeaders()
{
$headers = $this->getStatus();
foreach ($headers as $name => $value) {
$name = str_replace('_', '-', $name);
header("x-bucket-{$name}: {$value}");
}
} | [
"function jbucket_print_section_info_create_bucket() {\n}",
"public function writeHeaders()\n {\n reset($this->headers);\n $this->headerStr = \"\";\n foreach ($this->headers as $key => $val) {\n $val = trim($val);\n if ($val != \"\") {\n $this->headerStr .= $key . \": \" . $val . $this->newline;\n }\n }\n }",
"protected abstract function writeHeader();",
"public function writeHeader();",
"protected function exportBuckets()\n {\n echo 'Starting ' . $this->accountName . ' buckets file generation.' . PHP_EOL;\n\n $time = time();\n $fileName = $this->accountID . \"_buckets.txt\";\n $fullFilePath = self::EXPORT_TMP_DIR . '/' . $time . \"_\" . $fileName;\n\n $dataSet = $this->dataAccessContainer['Table.Ccrs2.Buckets']->getBuckets();\n if (!$this->writeTabSeparatedFileStmt($fullFilePath, $dataSet)) {\n echo $this->accountName . ' buckets tmp file could not be created.' . PHP_EOL;\n\n return false;\n }\n\n // file move operations\n $month = date(\"m\", strtotime($this->monthYear));\n $year = date(\"Y\", strtotime($this->monthYear));\n\n if (filesize(self::EXPORT_TMP_DIR . '/' . $time . \"_\" . $fileName)) {\n rename(self::EXPORT_TMP_DIR . '/' . $time . \"_\" . $fileName,\n $this->metaFileOutPath . '/' . $year . '_' . $month . '_' . $fileName\n );\n chmod($this->metaFileOutPath . '/' . $year . '_' . $month . '_' . $fileName, 0666);\n echo $this->accountName . ' buckets file created successfully.' . PHP_EOL;\n } else {\n echo $this->accountName . ' buckets file could not be created or was empty.' . PHP_EOL;\n }\n\n echo 'Finishing ' . $this->accountName . ' buckets file generation.' . PHP_EOL;\n }",
"public function get_bucket_headers($bucket, $opt = null)\n\t{\n\t\tif (!$opt) $opt = array();\n\t\t$opt['verb'] = 'HEAD';\n\n\t\treturn $this->authenticate($bucket, $opt);\n\t}",
"public function writeHeader()\n {\n }",
"private function output_headers() {\n foreach($this->headers as $key => $value) {\n header($key . ': ' . $value);\n }\n }",
"function putBucketLogging($ossClient, $bucket)\n{\n $option = array();\n // Access logs are stored in the same bucket.\n $targetBucket = $bucket;\n $targetPrefix = \"access.log\";\n\n try {\n $ossClient->putBucketLogging($bucket, $targetBucket, $targetPrefix, $option);\n } catch (OssException $e) {\n printf(__FUNCTION__ . \": FAILED\\n\");\n printf($e->getMessage() . \"\\n\");\n return;\n }\n print(__FUNCTION__ . \": OK\" . \"\\n\");\n}",
"private function writeHeader() {\n $this->write($this->header);\n }",
"public function insertHeaders()\n {\n $this->writer->insertOne(iterator_to_array($this->getHeaders()));\n }",
"protected function outputHeaders() {\n $controlFlags = [];\n if (!$this->cacheable) {\n $controlFlags[] = 'no-store';\n $controlFlags[] = 'no-cache';\n } else {\n if ($this->revalidate) {\n $controlFlags[] = 'no-cache';\n $controlFlags[] = 'must-revalidate';\n }\n $controlFlags[] = $this->private ? 'private' : 'public';\n if ($this->age > 0) {\n $controlFlags[] = 'max-age=' . (int)round($this->age);\n }\n if (!empty($this->ETag)) {\n $this->setHeader('ETag', $this->ETag);\n }\n if (!is_null($this->modifiedDate)) {\n $this->setHeader('Last-Modified', $this->httpUtils->formatDateTime($this->modifiedDate));\n }\n }\n if (!empty($controlFlags)) {\n $this->setHeader('Cache-Control', implode(', ', $controlFlags));\n }\n parent::outputHeaders();\n }",
"private function writeHeader() {\n $this->write(AvroDataIO::magic());\n AvroDataIO::metadataSchema()->write($this->metadata, $this->encoder);\n $this->write($this->syncMarker);\n }",
"public function get_object_headers($bucket, $filename, $opt = null)\n\t{\n\t\t// Add this to our request\n\t\tif (!$opt) $opt = array();\n\t\t$opt['verb'] = 'HEAD';\n\t\t$opt['resource'] = $filename;\n\n\t\t// Authenticate to S3\n\t\treturn $this->authenticate($bucket, $opt);\n\t}",
"public function getBucketMeta($bucket, $options = NULL)\n {\n $this->precheckCommon($bucket, NULL, $options, false);\n $options[self::OSS_BUCKET] = $bucket;\n $options[self::OSS_METHOD] = self::OSS_HTTP_GET;\n $options[self::OSS_OBJECT] = '/';\n $options[self::OSS_FUNCTIONNAME] = __FUNCTION__;\n $response = $this->auth($options);\n $result = new HeaderResult($response);\n return $result->getData();\n }",
"public function putBucket($bucketName){\r\n\r\n\t}",
"function getBucketMeta($ossClient, $bucket)\n{\n\ttry {\n\t\t$metas = $ossClient->getBucketMeta($bucket);\n\t} catch (OssException $e) {\n\t\tprintf(__FUNCTION__ . \": FAILED\\n\");\n\t\tprintf($e->getMessage() . \"\\n\");\n\t\treturn;\n\t}\n\tprint(__FUNCTION__ . \": OK\" . \"\\n\");\n\tprint(\"bucket $bucket meta: \" .print_r($metas,true));\n}",
"public function writeResponseHeader();",
"private function writeHeaders()\n {\n if ($this->protocol == 'mail')\n {\n $this->subject = $this->headers['Subject'];\n unset($this->headers['Subject']);\n }\n\n $this->setHeader('X-Sender', $this->headers['From']);\n $this->setHeader('X-Mailer', $this->useragent);\n $this->setHeader('X-Priority', $this->priorities[$this->priority - 1]);\n $this->setHeader('Mime-Version', '1.0');\n $this->headerStr = \"\";\n\n foreach ($this->headers as $key => $val)\n {\n $val = trim($val);\n\n if ($val != \"\")\n {\n $this->headerStr .= $key.\": \".$val.$this->newline;\n }\n }\n\n if ($this->protocol == 'mail')\n {\n $this->headerStr = rtrim($this->headerStr);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run `./yii files/console/cleancache` to remove all generated images and previews | function actionCleanCache()
{
$module = Yii::$app->getModule('files');
$commands = [];
$commands[] = "find {$module->storageFullPath} -regextype egrep -regex \".+/.{32}_.*\" -exec rm -rf {} \;";
$commands[] = "find {$module->cacheFullPath} -regextype egrep -regex \".+/.{32}_.*\" -exec rm -rf {} \;";
$commands[] = "find {$module->storageFullPath} -regextype egrep -regex \".+/.{32}\..{3,4}\.jpg\" -exec rm -rf {} \;";
$commands[] = "find {$module->cacheFullPath} -regextype egrep -regex \".+/.{32}\..{3,4}\.jpg\" -exec rm -rf {} \;";
array_map(function ($command) {
exec($command);
}, $commands);
} | [
"public function clean()\n {\n $this->cache->flush(); // Flushes the entire cache.\n \n // Remove all folders from the asset folder.\n foreach(scandir($this->assetManager->basePath) as $directory)\n {\n if($directory == '..' || $directory == '.')\n {\n continue;\n }\n \n \\yii\\helpers\\FileHelper::removeDirectory($directory);\n }\n \n if($this->has('imagine'))\n {\n $this->imagine->flush(); // Flush all modified images.\n }\n }",
"function clean() {\n\t\t// Getting all versions and deleting them\n\t\t$this->controller->model->deleteAll(array('Image.id' => 'source1'), true, true);\n\n\t}",
"public function refreshAssetPaths()\n {\n Cache::forget(self::ASSET_PATH_CACHE_KEY);\n }",
"public static function flushAssets(){\n\t\t$ignore = array(Yii::app()->getAssetManager()->basePath.'/.gitignore');\n\t\tNFileHelper::deleteFilesRecursive(Yii::app()->getAssetManager()->basePath,$ignore);\n\t}",
"function clean() {\n\t\tdelete_files('content/cache/upgrade/', TRUE);\n\t}",
"public function purge_all_assets() {\n\t}",
"public static function cleanAssets(){\n $files = glob(DOCROOT . self::ASSETS_CSS_PATH . '*.css');\n foreach($files as $_file)\n unlink($_file);\n $files = glob(DOCROOT . self::ASSETS_JS_PATH . '*.js');\n foreach($files as $_file)\n unlink($_file);\n }",
"function webbusiness_reset_cache_custom_css() {\n\tdelete_transient('webbusiness_custom_css_preview');\n\twebbusiness_cache_custom_css_preview();\n}",
"public function clearCategoryImagesCache()\n {\n Mage::getModel('xmlconnect/catalog_category_image')->clearCache();\n }",
"public static function clear()\n {\n apc_delete('asset-file-map');\n if (is_file(__DIR__ . '/asset-file-map.php')) {\n unlink(__DIR__ . '/asset-file-map.php');\n }\n }",
"public function cleanComponentCache() {\r\n\t\t$cache =& JFactory::getCache('com_hwdphotoshare');\r\n\t\t$cache->clean('com_hwdphotoshare');\r\n }",
"function shifter_clear_plugin_cache() {\n\n /**\n * Autoptomize\n * @link https://wordpress.org/plugins/autoptimize/\n * @since 2.5.1\n */\n if (class_exists('\\autoptimizeCache')) {\n \\autoptimizeCache::clearall();\n }\n\n /**\n * Beaver Builder Plugin\n * @link https://www.wpbeaverbuilder.com\n * @since 2.2.6.1\n */\n if (class_exists('\\FLBuilderModel')) {\n \\FLBuilderModel::delete_asset_cache_for_all_posts();\n }\n \n}",
"protected function __unset_assets()\n\t{\n\t\t$this->js->clear();\n\t\t$this->css->clear();\n\t}",
"public function emptyCacheAction()\n {\n $this->getAssetsBundleToolsService()->emptyCache();\n }",
"public function clearCache() {\n Yii::app()->cache->delete('customurlrules');\n }",
"public function clearAnnotationsCache()\n\t{\n\t\tarray_map( 'unlink', glob( __DIR__ . \"/../annotations/cache/*\" ) );\n\t}",
"function cleanup() {\n $frameList = $this->renderer->getFrames();\n foreach ($frameList as $frames) {\n foreach ($frames as $frame) {\n if (file_exists($frame)) {\n unlink($frame);\n }\n }\n }\n }",
"private function refresh() {\n $this->cacheManager->delete('quickbooks_default_product_cache');\n $this->cacheManager->delete('quickbooks_terms_cache');\n $this->cacheManager->delete('quickbooks_payment_cache');\n $this->cacheManager->delete('quickbooks_account_cache');\n }",
"function clear_assets_cache()\n{\n if (defined('OP3__DIR__')) {\n try {\n $cachePath = OP3__DIR__.'/public/assets/cache';\n $cachedFiles = glob($cachePath.'/*.*');\n\n // Loop through all and delete\n foreach ($cachedFiles as $file) {\n if (is_file($file)) {\n unlink($file);\n }\n }\n } catch(\\Exception $e) {}\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function Inscriptions_Submissions_Inscriptions_Open, Parameter list: Detects if current event has collaborations activated. | function Inscriptions_Submissions_Inscriptions_Open()
{
$event=$this->Event();
return $this->EventsObj()->Event_Submissions_Inscriptions_Open($event);
} | [
"function Inscriptions_Collaborations_Show_Should($inscription=array())\n {\n $res=\n $this->EventsObj()->Event_Collaborations_Inscriptions_Open($this->Event())\n ||\n $this->Friend_Collaborators_Has(array(\"ID\" => $inscription[ \"Friend\" ]));\n\n return $res;\n }",
"function Event_Submissions_Inscriptions_Open($item=array())\n {\n if (empty($item)) { $item=$this->Event(); }\n if (empty($item)) { return FALSE; }\n\n $res=$this->Event_Submissions_Has($item);\n if ($res)\n {\n $today=$this->MyTime_2Sort();\n if (\n $today<$item[ \"Submissions_StartDate\" ]\n ||\n $today>$item[ \"Submissions_EndDate\" ]\n )\n {\n $res=FALSE;\n }\n }\n\n return $res;\n }",
"function Event_Submissions_Open($item=array())\n {\n if (empty($item)) { $item=$this->Event(); }\n if (empty($item)) { return FALSE; }\n\n $res=$this->Event_Submissions_Inscriptions_Has($item);\n\n if ($res)\n {\n $today=$this->MyTime_2Sort();\n if (\n $today<$item[ \"Submissions_StartDate\" ]\n ||\n $today>$item[ \"Submissions_EndDate\" ]\n )\n {\n $res=FALSE;\n }\n }\n\n return $res;\n }",
"function hasCollaboration() {\n\t\tglobal $default;\n\t\t$sql = $default->db;\n\t\t$sql->query(array(\"SELECT id AS count from $default->groups_folders_approval_table WHERE folder_id = ?\", $this->iFolderID));/*ok*/\n\t\tif ($sql->next_record()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n }",
"function MayInscribe($event=array())\n {\n if (empty($event)) { return TRUE; }\n \n $res=$this->Event_Inscriptions_Open($event);\n if ($res)\n {\n $res=!$this->IsInscribed($event);\n }\n if ($res)\n {\n $res=!$this->IsInscribed($event);\n }\n\n return $res;\n }",
"function Event_Collaborations_Has($event=array())\n {\n return $this->EventsObj()->Event_Collaborations_Has($event);\n }",
"public function withinContributions()\n {\n if ( $this->_contrib_creation_date_begin != null\n || $this->_contrib_creation_date_end != null\n || $this->_contrib_begin_date_begin != null\n || $this->_contrib_begin_date_end != null\n || $this->_contrib_end_date_begin != null\n || $this->_contrib_begin_date_end != null\n || $this->_contrib_min_amount != null\n || $this->_contrib_max_amount != null\n || count($this->_contrib_dynamic) > 0\n || count($this->_contributions_types) > 0\n || count($this->_payments_types) > 0\n ) {\n return true;\n } else {\n return false;\n }\n }",
"public function isSubscribedToMailchimpList();",
"protected function listCandidatesToggle()\n\t{\n\t\t$_SESSION[\"adn_cand_cpr\"] = (bool)$_POST[\"ct_cpr\"];\n\t\t$_SESSION[\"adn_cand_pro\"] = (bool)$_POST[\"ct_pro\"];\n\n\t\t$this->listCandidates();\n\t}",
"public function restrictToListInComposeEmailPopup() {\n\t\t//does not restrict the module to be listed in compose email popup\n\t\treturn false;\n\t}",
"protected function course_registration_open() {\n\t\t$username=$this->pageObj->getUser()->username;\n\t\t$training_institution=IHS_PageFormLecturer::fetch_institution($username);\n\t\t$where=array(\t\"operator\"=>\"FIELD_LIMIT\",\n\t\t\t\t\t\t\t\"field\"=>\"training_institution\",\n\t\t\t\t\t\t\t\"style\"=>\"equals\",\n\t\t\t\t\t\t\t\"data\"=>array(\"value\"=>$training_institution));\n\t\t$fields=I2CE_FormStorage::listFields(\"schedule_course_enrollment\",array(\"start_date\",\"end_date\"),false,$where);\n\t\tforeach($fields as $id=>$field) {\n\t\t\t$start_date=$field[\"start_date\"];\n\t\t\t$end_date=$field[\"end_date\"];\n\t\t}\n\t\t\n\t\tif(count($fields)==0) {\n\t\t\treturn false;\t\n\t\t}\n\t\t\n\t\telse {\n\t\t\t$start_date=strtotime($start_date);\n\t\t\t$end_date=strtotime($end_date);\n\t\t\t$today=strtotime(date(\"Y-m-d\"));\n\t\t\tif($today>$end_date) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t\t########### End checking of course enrollment deadline #####################\t\t\n\t\t}",
"function Event_Inscriptions_Public_Is($event=array())\n {\n return TRUE;\n }",
"function Inscription_Handle_Submissions_Show_Should($edit,$friend,$inscription)\n {\n $this->Inscription_Handle_Submissions_Read($friend);\n $res=$this->EventsObj()->Event_Submissions_Open();\n if (!$res)\n {\n if (count($this->Submissions)>0)\n {\n $res=True;\n }\n }\n\n return $res;\n }",
"function _validate_collaborators(&$node){\n\t//d($node, '$node');\n\t$n = entity_metadata_wrapper('node', $node);\n\t$inst = $n->field_er_collab_inst_ref->value();\n\tif ($inst){\n\t\t$status = $n->field_er_collab_user_status ->raw();\n\t\t$i = entity_metadata_wrapper('node', $inst);\n\t\t$participating = $i->field_er_inst_participating->value();\n\t\t//d($participating, '$participating');\n\t\tif ($status == 'Participant' && !$participating){\n\t\t\t$message = t(\"Sorry, '@title' is not currently considered a participating institution. Every participant must belong to a participating institution. This person should therefore be considered a collaborator. If you believe this is incorrect, please contact an administrator and ask them to change the institution's status.\", array('@title'=>$inst->title));\n\t\t\tform_set_error('field_er_collab_user_status', $message);\n\t\t}\n\t}\n}",
"public function informOpenInvitations() {\n if ($this->hasFinalOrStopperStatus())\n return;\n\n foreach($this->invitationDays as $invitationDay) {\n if ($invitationDay->isOpen())\n $invitationDay->sendInvitationEmail();\n }\n }",
"function submissionsOpen($resolutionRow) {\n if ($resolutionRow['status'] == 'pending') {\n return true;\n } else if (($resolutionRow['status'] == 'in_session') && ($resolutionRow['speakers'] < 2)) {\n return true;\n } else {\n return false;\n }\n}",
"function tool_monitor_can_subscribe() {\n if (has_capability('tool/monitor:subscribe', context_system::instance())) {\n return true;\n }\n $courses = get_user_capability_course('tool/monitor:subscribe', null, true, '', '', 1);\n return empty($courses) ? false : true;\n}",
"function com_is_active($comn = '') {\n\t\tglobal $El;\n\t\tif(!empty($comn) && in_array($comn, $El->activeComponents)){\n\t\t\t\treturn true;\t\n\t\t}\n\t\treturn false;\n}",
"public function supportsCourseNotification() {\n \treturn $this->manager->supportsCourseNotification();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value for the DevID input for this FetchToken Choreo. | public function setDevID($value)
{
return $this->set('DevID', $value);
} | [
"public function setWebDevToken($value) {\n $this->devToken = $value;\n }",
"public function setIdToken(?string $idToken): void\n {\n $this->idToken = $idToken;\n }",
"public function setManagedDeviceIdentifier($val)\n {\n $this->_propDict[\"managedDeviceIdentifier\"] = $val;\n return $this;\n }",
"public function setManagedDeviceId($val)\n {\n $this->_propDict[\"managedDeviceId\"] = $val;\n return $this;\n }",
"public function getDevId()\n {\n return $this->dev_id;\n }",
"public function setDNID($value);",
"public function setIdToken($id_token)\n {\n $this->idToken = $id_token;\n return $this;\n }",
"public function setToken()\n\t{\n\t\t $args = phpSmug::processArgs(func_get_args());\n\t\t $this->oauth_token = $args['id'];\n\t\t $this->oauth_token_secret = $args['Secret'];\n\t}",
"public function setManagedDeviceId(?string $value): void {\n $this->getBackingStore()->set('managedDeviceId', $value);\n }",
"public function setDeviceIdentifier()\n {\n //\n $identifier = $this->_getIdentifierFromRequest();\n $this->_setIdentifier($identifier);\n\n //\n $this->_log->debug(__METHOD__ . \"() Device Identifier is set to $identifier\");\n }",
"function getDevId()\n {\n return $this->_props['DevId'];\n }",
"public function setMdeDeviceId(?string $value): void {\n $this->getBackingStore()->set('mdeDeviceId', $value);\n }",
"function setUdid($userId = '', $device_token = '') {\n if ($userId != '' && $device_token != '') {\n $this->controller->loadModel('User');\n\n $this->controller->User->updateAll(array('User.device_token' => \"''\"), array('User.device_token' => $device_token));\n\n $this->controller->User->id = $userId;\n $this->controller->User->saveField('device_token', $device_token);\n }\n }",
"public function setAuthToken($IDorKey) {\n\t\tif ($this->authType == 'sessionID') {\n\t\t\t$this->mySessionID = $IDorKey;\n\t\t}\n\t\telseif ($this->authType == 'apiKey') {\n\t\t\t$this->myApiKey = $IDorKey;\n\t\t}\n\t\t$this->authToken = $IDorKey;\n }",
"function setSyncIdDev()\n {\n }",
"public function setCompanyPortalVppTokenId(?string $value): void {\n $this->getBackingStore()->set('companyPortalVppTokenId', $value);\n }",
"public function setToken($username, $device, $token);",
"public function setManagedDeviceIdentifier(?string $value): void {\n $this->getBackingStore()->set('managedDeviceIdentifier', $value);\n }",
"public function setDeviceId($val)\n {\n $this->_propDict[\"deviceId\"] = $val;\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns request handling attributes | public function getRequestAttributes()
{
return array(
'route' => $this->routeName,
'module' => $this->module,
'action' => $this->getReference()
);
} | [
"public function getAttributes()\n\t{\n\t\treturn $this->request->getAttributes();\n\t}",
"public function getAttributes()\n {\n return $this->getPsr7Request()->getAttributes();\n }",
"public function getRequestProperties() {\n\t\treturn $this->_requestProperties;\n\t}",
"public function getAttributesToGet()\n {\n return $this->get(self::REQUEST_ATTRIBUTES_TO_GET);\n }",
"public function getQueueAttributes($request);",
"abstract protected function validateRequestAttributes();",
"public function analyzeRequest(){\n\t\t$router = new Router($this);\n\t\t$this->controller = $router->getController();\n\t\t$this->action = $router->getAction();\n\t\t$this->is_ajax = $router->isAjax();\n\t}",
"public function getGlobalAttributes();",
"private function analyseRequestAndSetVars() {\n $this->extractControllerName();\n $this->extractControllerPathAndMethod();\n }",
"public function getRequest(){return $this->request;}",
"public function getRequestMetadata()\n {\n return $this->request_metadata;\n }",
"public function formAttributes() {\n\t\treturn $this->formAttributes;\n\t}",
"public function getRequestArgs() {\n\t\treturn $this->_requestArgs;\n\t}",
"private function request_prop() {\n\t\t// HTTP method:\n\t\t$this->http_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t$this->prop[$this->http_method] = true;\n\n\t\t// check if this is an AJAX request:\n\t\t$is_ajax = false;\n\t\tif (!is_null($this->params->ajax)) {\n\t\t\t$is_ajax = true;\n\t\t}\n\t\telseif (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {\n\t\t\tif (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {\n\t\t\t\t$is_ajax = true;\n\t\t\t}\n\t\t}\n\t\t$this->prop['ajax'] = $is_ajax;\n\n\t\t// extract request path:\n\t\tlist($path) = explode('?', $_SERVER['REQUEST_URI'], 2);\n\t\t$script = basename($_SERVER['SCRIPT_NAME']);\n\t\t$path = substr($path, strlen($this->frwk->cfg['BASE_URL']));\n\t\t$path = preg_replace(\"/^\\/$script/\", '', $path);\n\t\t$path = preg_replace('/\\/+/', '/', $path);\n\t\t$this->path = preg_replace('/^\\/|\\/$/', '', $path);\n\t}",
"public function getRequest(){\n\t \treturn $this->info['request']['unencoded'];\n\t }",
"public function requestsAttributes(): bool;",
"public function getAttributes()\n {\n return $this->response_attributes;\n }",
"public function getFormAttributes(): array;",
"public static function getRequestVars(){\r\n\t\t\t\treturn self :: $requestVars;\r\n\t\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getNetworkCameraQualityRetentionProfile Retrieve a single quality retention profile. | public function testGetNetworkCameraQualityRetentionProfile()
{
} | [
"protected function getNetworkCameraQualityRetentionProfileRequest($network_id, $quality_retention_profile_id)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling getNetworkCameraQualityRetentionProfile'\n );\n }\n // verify the required parameter 'quality_retention_profile_id' is set\n if ($quality_retention_profile_id === null || (is_array($quality_retention_profile_id) && count($quality_retention_profile_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $quality_retention_profile_id when calling getNetworkCameraQualityRetentionProfile'\n );\n }\n\n $resourcePath = '/networks/{networkId}/camera/qualityRetentionProfiles/{qualityRetentionProfileId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n // path params\n if ($quality_retention_profile_id !== null) {\n $resourcePath = str_replace(\n '{' . 'qualityRetentionProfileId' . '}',\n ObjectSerializer::toPathValue($quality_retention_profile_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 ['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 API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getNetworkCameraQualityRetentionProfileAsync($network_id, $quality_retention_profile_id)\n {\n return $this->getNetworkCameraQualityRetentionProfileAsyncWithHttpInfo($network_id, $quality_retention_profile_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function testDeleteNetworkCameraQualityRetentionProfile()\n {\n }",
"public function getNetworkCameraQualityRetentionProfile($network_id, $quality_retention_profile_id)\n {\n list($response) = $this->getNetworkCameraQualityRetentionProfileWithHttpInfo($network_id, $quality_retention_profile_id);\n return $response;\n }",
"public function getNetworkCameraQualityRetentionProfileWithHttpInfo($network_id, $quality_retention_profile_id)\n {\n $returnType = 'object';\n $request = $this->getNetworkCameraQualityRetentionProfileRequest($network_id, $quality_retention_profile_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 $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 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"function get_preview_quality($size)\n {\n global $imagemagick_quality,$preview_quality_unique;\n $preview_quality=$imagemagick_quality; // default\n if($preview_quality_unique)\n {\n debug(\"convert: select quality value from preview_size where id='$size'\");\n $quality_val=sql_value(\"select quality value from preview_size where id='{$size}'\",'');\n if($quality_val!='')\n {\n $preview_quality=$quality_val;\n }\n }\n debug(\"convert: preview quality for $size=$preview_quality\");\n return $preview_quality;\n }",
"public function getQuality()\n {\n return $this->quality;\n }",
"public function getQuality()\n\t{\n\t\treturn $this->quality;\n\t}",
"public function getQuality() {\n return $this->quality;\n }",
"public function getQuality()\n {\n if (array_key_exists(\"quality\", $this->_propDict)) {\n if (is_a($this->_propDict[\"quality\"], \"\\Microsoft\\Graph\\Model\\PrintQuality\") || is_null($this->_propDict[\"quality\"])) {\n return $this->_propDict[\"quality\"];\n } else {\n $this->_propDict[\"quality\"] = new PrintQuality($this->_propDict[\"quality\"]);\n return $this->_propDict[\"quality\"];\n }\n }\n return null;\n }",
"public function get_linkQuality(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::LINKQUALITY_INVALID;\n }\n }\n $res = $this->_linkQuality;\n return $res;\n }",
"public function getQualityLevel()\n {\n return $this->qualityLevel;\n }",
"public function getQuality()\n {\n return $this->Quality;\n }",
"private function get_profile() {\n\t\treturn monsterinsights_get_option( 'analytics_profile', false );\n\t}",
"public static function findByQuality($quality) {\n $db = Zend_Registry::get('dbAdapter');\n\n $query = $db->select()\n ->from(array(\"r\" => \"restaurant_ratings\"))\n ->where(\"r.quality = \" . $quality);\n\n return $db->fetchRow($query);\n }",
"public function getPhotoQuality()\n\t{\n\t\treturn $this->photo_quality;\n\t}",
"public function getQualityID()\n {\n return $this->qualityID;\n }",
"static function getQualityThumbnail($key)\n {\n $arrImagetype = self::getArray();\n if ( empty($key)\n || is_array($key)\n || !is_array($arrImagetype)\n || empty($arrImagetype[$key])) {\n return self::DEFAULT_QUALITY_THUMB;\n }\n return $arrImagetype[$key]['quality_thumb'];\n\n }",
"public function getProfile();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transform strings read from fixed width format into other datatypes based on the FixedWidth annotations defined on the property. | public static function transform(FixedWidth $annotation, string $value)
{
$value = trim($value);
switch ($annotation->type) {
case FixedWidth::TYPE_INTEGER:
$value = (int) $value;
break;
case FixedWidth::TYPE_DATE:
$value = DateTime::createFromFormat($annotation->format, $value);
break;
case FixedWidth::TYPE_DECIMAL:
$value = (float) $value;
break;
}
return $value;
} | [
"public function setFixedWidthSize($width) {\r\n if ($this->direction == -1) {\r\n foreach ($this->directions as $direction) {\r\n $this->font_metrics[$direction]->setFixedWidthSize($width);\r\n }\r\n parent::setFixedWidthSize($width);\r\n } else {\r\n $this->font_metrics[$this->direction]->setFixedWidthSize($width);\r\n }\r\n }",
"public function formatStagedData() {\n\t\tforeach ( $this->staged_data as $field => $value ) {\n\t\t\t// Trim all values if they are a string\n\t\t\t$value = is_string( $value ) ? trim( $value ) : $value;\n\n\t\t\tif ( isset( $this->dataConstraints[ $field ] ) && is_string( $value ) ) {\n\t\t\t\t// Truncate the field if it has a length specified\n\t\t\t\tif ( isset( $this->dataConstraints[ $field ]['length'] ) ) {\n\t\t\t\t\t$length = (int)$this->dataConstraints[ $field ]['length'];\n\t\t\t\t} else {\n\t\t\t\t\t$length = false;\n\t\t\t\t}\n\n\t\t\t\tif ( !empty( $length ) && !empty( $value ) ) {\n\t\t\t\t\t// Note: This is the very last resort. This should already have been dealt with thoroughly in staging.\n\t\t\t\t\t$value = mb_substr( $value, 0, $length, 'UTF-8' );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->staged_data[ $field ] = $value;\n\t\t}\n\t}",
"public function isFixedWidth() { \r\n if ($this->direction != -1) {\r\n return $this->font_metrics[$this->direction]->isFixedWidth();\r\n } else {\r\n return parent::isFixedWidth();\r\n }\r\n }",
"public function getColumnsFromShortLine()\n {\n $parser = new StrictColumnWidthsParser([9, 5, 13]);\n $this->assertSame(['Mary', '18', ''], $parser->getColumns('Mary 18'));\n }",
"public function formatRowWithStringsAlignRightByDefault()\n {\n // Given\n $fieldSpecs = array(\n array(\n \"len\" => \"10\",\n \"type\" => \"s\"),\n array(\n \"len\" => \"15\",\n \"type\" => \"s\"),\n );\n $values = array(\"first\", \"second\");\n\n // When\n $result = RowFormatter::format($values, $fieldSpecs, \" \");\n\n // Then\n $this->assertEquals($result, \" first second\");\n }",
"function wpb_translateColumnWidthToFractional($width) {\n switch ( $width ) {\n case \"span3\" :\n $w = \"1/4\";\n break;\n\n case \"span4\" :\n $w = \"1/3\";\n break;\n\n case \"span6\" :\n $w = \"1/2\";\n break;\n\n case \"span8\" :\n $w = \"2/3\";\n break;\n\n case \"span9\" :\n $w = \"3/4\";\n break;\n\n case \"span12\" :\n $w = \"1/1\";\n break;\n\n default :\n $w = $width;\n }\n return $w;\n}",
"private function applyWidth(/*string */$content)/*: string*/\n {\n $content = backport_type_check('string', $content);\n\n $styles = isset($this->properties['styles']) ? $this->properties['styles'] : [];\n $minWidth = isset($styles['minWidth']) ? $styles['minWidth'] : -1;\n $width = max(isset($styles['width']) ? $styles['width'] : -1, $minWidth);\n $maxWidth = isset($styles['maxWidth']) ? $styles['maxWidth'] : 0;\n\n if ($width < 0) {\n return $content;\n }\n\n if ($width === 0) {\n return '';\n }\n\n if (is_string($width)) {\n $width = self::calcWidthFromFraction(\n $width,\n $styles,\n isset($this->properties['parentStyles']) ? $this->properties['parentStyles'] : []\n );\n }\n\n if ($maxWidth > 0) {\n $width = min($styles['maxWidth'], $width);\n }\n\n $width -= (isset($styles['pl']) ? $styles['pl'] : 0) + (isset($styles['pr']) ? $styles['pr'] : 0);\n $length = $this->getLength($content);\n\n preg_match_all(\"/\\n+/\", $content, $matches);\n\n $width *= count(isset($matches[0]) ? $matches[0] : []) + 1;\n $width += mb_strlen(isset($matches[0]) && isset($matches[0][0]) ? $matches[0][0] : '', 'UTF-8');\n\n if ($length <= $width) {\n $space = $width - $length;\n\n switch (isset($styles['text-align']) ? $styles['text-align'] : '') {\n case 'right': return str_repeat(' ', $space).$content;\n case 'center': return str_repeat(' ', (int) floor($space / 2)).$content.str_repeat(' ', (int) ceil($space / 2));\n default: return $content.str_repeat(' ', $space);\n }\n }\n\n return self::trimText($content, $width);\n }",
"public function setReadFormatToShortPrefixedLength ()\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!$this->isReading())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->resetReadFormat();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this->readVariables['format'] = 'shortPrefixedLength';\r\n\t\t\t\t\t}\r\n\t\t\t\t}",
"public function testValidateWidth_StringPredefineValue() {\n\t\t\n\t\t$width = \"sm\";\n\t\t$expected = array(\n\t\t\t\t\"type\" => \"i\",\n\t\t\t\t\"value\" => Config::$RequiredImage['width'][$width]\n\t\t);\n\t\t$this->assertTrue($expected == Validator::validateWidth($width));\n\t\t\n\t}",
"public function setReadFormatToLongPrefixedLength ()\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!$this->isReading())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->resetReadFormat();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this->readVariables['format'] = 'longPrefixedLength';\r\n\t\t\t\t\t}\r\n\t\t\t\t}",
"public function correctTypography(int $flags) : self\n\t{\n\t\t$partsPreCode = preg_split('/(<\\/{0,1}(?:pre|code)(?: [^<>]*|)>)/', $this->_string, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n\t\tforeach ($partsPreCode as $key => &$stringPart) {\n\t\t\tif ($key % 4 != 0) {\n\t\t\t\t// Typography corrections should be applied only to $partsPreCode[0], $partsPreCode[4], $partsPreCode[8],\n\t\t\t\t// $partsPreCode[12], etc. Other $partsPreCode elements contain <pre> or <code> HTML tags and tags contents.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Polish one-letter words at the end of lines. More here: https://pl.wikipedia.org/wiki/Sierotka_(typografia)\n\t\t\tif ($flags & self::TYPOGRAPHY_ORPHANS) {\n\t\t\t\t$stringPart = preg_replace(\n\t\t\t\t\t'/(( |\\()(o|u|w|z|i|a)) /i',\n\t\t\t\t\t'$1' . \"\\u{00A0}\", // \"No break space\" character.\n\t\t\t\t\t$stringPart\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Em-dash character. More here: https://pl.wikipedia.org/wiki/Pauza_(znak_typograficzny)\n\t\t\tif ($flags & self::TYPOGRAPHY_DASHES) {\n\t\t\t\t$stringPart = str_replace(\n\t\t\t\t\t[' - ', ' -<', '>- '],\n\t\t\t\t\t[' — ', ' —<', '>— '],\n\t\t\t\t\t$stringPart\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Ellipsis character. More here: https://pl.wikipedia.org/wiki/Wielokropek\n\t\t\tif ($flags & self::TYPOGRAPHY_OTHER) {\n\t\t\t\t$stringPart = str_replace(\n\t\t\t\t\t['... ', ' ...', \"...\\n\", \"\\n...\", '>...', '...<'],\n\t\t\t\t\t['… ', ' …', \"…\\n\", \"\\n…\", '>…', '…<' ],\n\t\t\t\t\t$stringPart\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ($flags & self::TYPOGRAPHY_OTHER or $flags & self::TYPOGRAPHY_QUOTES) {\n\t\t\t\t// Do not correct apostrophes and quotation marks in HTML open tags.\n\t\t\t\t$partsHTMLOpenTags = preg_split('/(<[^\\/]* [^<>]*>)/', $stringPart, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n\t\t\t\tforeach ($partsHTMLOpenTags as $key => &$nestedStringPart) {\n\t\t\t\t\tif ($key % 2 != 0) {\n\t\t\t\t\t\t// Typography corrections should be applied only to $partsHTMLOpenTags[0], $partsHTMLOpenTags[2], $partsHTMLOpenTags[4], $partsHTMLOpenTags[6], etc. Other $partsHTMLOpenTags elements contain HTML open tags.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Proper Polish apostrophe character. More here: https://pl.wikipedia.org/wiki/Apostrof\n\t\t\t\t\tif ($flags & self::TYPOGRAPHY_OTHER) {\n\t\t\t\t\t\t$nestedStringPart = str_replace(['\\'', ''', '''], '’', $nestedStringPart);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Proper Polish quotation marks. More here: https://pl.wikipedia.org/wiki/Cudzysłów\n\t\t\t\t\tif ($flags & self::TYPOGRAPHY_QUOTES) {\n\t\t\t\t\t\t$nestedStringPart = preg_replace(\n\t\t\t\t\t\t\t'/\"([^\"]*)\"/', '„$1”',\n\t\t\t\t\t\t\tstr_replace('"', '\"', $nestedStringPart)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset($nestedStringPart);\n\n\t\t\t\t$stringPart = join($partsHTMLOpenTags);\n\t\t\t}\n\t\t}\n\n\t\t$this->_string = join($partsPreCode);\n\n\t\treturn $this;\n\t}",
"function tidy_repair_string($data, $config = null, $encoding = null) {}",
"function text_long_wrapper($entity_type, $entity, $bundle, $field_name, $data){\n if(!isset($entity->language)) $entity->language = LANGUAGE_NONE;\n $field_info = field_info_instance($entity_type, $field_name, $bundle);\n $field_read = field_read_field($field_name);\n\n if(!isset($data)){\n if($field_info['required']) return services_error('Missing ' . $field_name . ' attribute');\n else return;\n }\n\n if($field_read['cardinality'] == 0) return;\n else if($field_read['cardinality'] == 1){\n $temp = array();\n if(is_array($data)){\n if(is_array(current($data))){\n $temp['value'] = isset(current($data)['value']) ? current($data)['value'] : $field_info['default_value'];\n $temp['format'] = isset(current($data)['format']) ? current($data['format']) : NULL;\n if($field_info['required'] && !isset($temp['value'])) return services_error('Missing ' . $field_name . '->value attribute');\n }else{\n $temp['value'] = isset($data['value']) ? $data['value'] : $field_info['default_value'];\n $temp['format'] = isset($data['format']) ? $data['format'] : NULL;\n if($field_info['required'] && !isset($temp['value'])) return services_error('Missing ' . $field_name . '->value attribute');\n }\n }else{\n $temp['value'] = isset($data) ? $data : NULL;\n if($field_info['required'] && !isset($temp['value'])) return services_error('Missing ' . $field_name . ' attribute');\n }\n $entity->{$field_name}[$entity->language][0] = $temp;\n }else{\n $count = 0;\n if(!is_array($data)){\n return services_error($field_name . ' should be array');\n }\n foreach($data as $element){\n if($field_read['cardinality'] >1 && $count >= $field_read['cardinality']){\n // return services_error($field_name . ' had cardinality: ' . $field_read['cardinality']);\n break;\n }\n $count++;\n if(is_array($element)){\n $temp = array();\n $temp['value'] = isset($element['value']) ? $element['value'] : $field_info['default_value'];\n $temp['format'] = isset($element['format'])? $element['format'] : NULL;\n if($field_info['required'] && !isset($temp['value'])) return services_error('Missing ' . $field_name . '->value attribute');\n $entity->{$field_name}[$entity->language][] = $temp;\n }else{\n if($field_info['required'] && !isset($element)) return services_error('Missing ' . $field_name . ' attribute');\n $entity->{$field_name}[$entity->language][]['value'] = $element;\n }\n }\n }\n}",
"private function _do_pre_validation_formatting($data)\n\t{\n\t\t// Make sure the title is trimmed.\n\t\tif(isset($data[$this->data['table'] . 'Title']))\n\t\t{\n\t\t\t$data[$this->data['table'] . 'Title'] =\ttrim($data[$this->data['table'] . 'Title']);\t\t\n\t\t}\n\t\t\n\t\t// Loop through the fields and do extra formatting.\n\t\tforeach($data AS $key => $row)\n\t\t{\n\t\t if(isset($data[$key . 'Format']) && ($data[$key . 'Format'] == 'auto'))\n\t\t {\n\t\t \t$this->load->library('typography');\n\t\t \t$data[$key] = $this->typography->auto_typography($data[$key]);\n\t\t }\n\t\t}\n\t\t\n\t\treturn $data;\n\t}",
"function getTextWidth($text){}",
"abstract public function fieldFormatters();",
"public function testFormatterFormatPostal3()\n {\n $values = [\n 'foo' => 'j4y2b4424',\n ];\n $rules = [\n 'foo' => ['postalCode'],\n ];\n $newValues = Formatter::make($values, $rules);\n\n $this->assertEquals($newValues, [\n 'foo' => 'J4Y 2B4',\n ]);\n }",
"function tidy_repair_string ($data, $config_file, $encoding) {}",
"protected function replace_width($message, $attribute, $rule, $parameters)\n\t{\n\t\treturn str_replace(':width', $parameters[0], $message);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter with listing type and price set with offset | public function appFilter8_scroll($listing_sel,$min,$max,$offset)
{
$statement = $this->pdo->prepare("SELECT * FROM `ads` WHERE listing_type='{$listing_sel}' AND value BETWEEN '{$min}' AND '{$max}' AND status='1' ORDER by datetime desc LIMIT 20 OFFSET {$offset}");
$statement->execute();
return $statement->fetchAll(PDO::FETCH_CLASS);
} | [
"public function createBySalePaginator($filter, $type = 1)\n {\n if (isset($filter['price_from'])) {\n $filter['price_from'] = $filter['price_from'] * 100;\n }\n if (isset($filter['price_to'])) {\n if ($filter['price_to'] == 1) {\n $filter['price_to'] = 10000000;\n } else {\n $filter['price_to'] = $filter['price_to'] * 100;\n }\n }\n $queryBuilder = $this->getCollectionQueryBuilder();\n $params = array();\n\n foreach ($filter as $key => $f) {\n if ($f != 'any' && $f != 'asc' && $f != 'desc') {\n $params[$key] = $f;\n }\n }\n\n $queryBuilder\n ->innerJoin('product.variants', 'variant')\n ->innerJoin('variant.images', 'image')\n ->innerJoin('product.taxons', 'taxon')\n ->innerJoin('product.taxons', 'taxon2')\n ->andWhere('variant.onHand > 0')\n ->andWhere('variant.flagSale = 1')\n ->andWhere('product.action = 0 or product.action is NULL');\n if (isset($filter['collection'])) {\n if ($filter['collection'] != 'any') {\n $queryBuilder\n ->andWhere('taxon.slug LIKE :collection');\n }\n }\n if (isset($filter['catalog'])) {\n if ($filter['catalog'] != 'any') {\n $queryBuilder\n ->andWhere('taxon2.slug LIKE :catalog');\n }\n }\n if (isset($filter['material'])) {\n if ($filter['material'] != 'any') {\n $queryBuilder\n ->andWhere('variant.metal LIKE :material');\n }\n }\n if (isset($filter['weight'])) {\n if ($filter['weight'] != 'any') {\n $queryBuilder\n ->andWhere('variant.weight < :weight');\n }\n }\n if (isset($filter['color'])) {\n if ($filter['color'] != 'any') {\n $queryBuilder\n ->leftJoin('product.properties', 'property')\n ->andWhere('property.value LIKE :color');\n }\n }\n if (isset($filter['box'])) {\n if ($filter['box'] != 'any') {\n $queryBuilder\n ->andWhere('variant.box LIKE :box');\n }\n }\n// if (isset($filter['depth'])) {\n// if ($filter['depth'] != 'any') {\n// $queryBuilder\n// ->andWhere('variant.depth < :depth');\n// }\n// }\n// if (isset($filter['box'])) {\n// if ($filter['box'] != 'any') {\n// $queryBuilder\n// ->andWhere('variant.box LIKE :box');\n// }\n// }\n if (isset($filter['size'])) {\n if ($filter['size'] != 'any') {\n $queryBuilder\n ->andWhere('variant.size = :size');\n }\n }\n if (isset($filter['created'])) {\n if ($filter['created'] != 'any') {\n $queryBuilder\n ->orderBy('product.createdAt', $filter['created']);\n }\n }\n\n if (isset($filter['priceSale'])) {\n if ($filter['priceSale'] != 'any') {\n $queryBuilder\n ->orderBy('variant.flagSale', $filter['priceSale']);\n }\n }\n\n $queryBuilder\n ->andWhere('product.enabled = 0 or product.enabled is NULL');\n if (isset($filter['price_from'])) {\n if ($type == 0) {\n $queryBuilder\n ->andWhere('variant.price >= :price_from');\n } else {\n $queryBuilder\n ->andWhere('variant.priceOpt >= :price_from');\n }\n }\n if (isset($filter['price_to'])) {\n if ($type == 0) {\n $queryBuilder\n ->andWhere('variant.price <= :price_to');\n } else {\n $queryBuilder\n ->andWhere('variant.priceOpt <= :price_to');\n }\n }\n\n $queryBuilder\n ->addGroupBy('variant.sku')\n ->setParameters($params);\n\n\n return $this->getPaginator($queryBuilder);\n }",
"function addPriceIndexFilter($collection) {\n\t\t\tif (!$collection) {\n\t\t\t\treturn $collection;\n\t\t\t}\n\n\t\t\t$select = $collection->getSelect( );\n\t\t\t$fromPart = $select->getPart( FROM );\n\n\t\t\tif (isset( $fromPart['price_index'] )) {\n\t\t\t\t$oldJoinCond = $fromPart['price_index']['joinCondition'];\n\n\t\t\t\tif (strpos( $oldJoinCond, 'stock_id' ) === false) {\n\t\t\t\t\t$helper = $this->getWarehouseHelper( );\n\t\t\t\t\t$connection = $collection->getConnection( );\n\n\t\t\t\t\tif (!$collection->getFlag( 'stock_id' )) {\n\t\t\t\t\t\tif ($this->isMultipleMode( )) {\n\t\t\t\t\t\t\t$stockId = $connection->quote( $this->getDefaultStockId( ) );\n\t\t\t\t\t\t} \nelse {\n\t\t\t\t\t\t\t$stockId = $connection->quote( $this->getWarehouseHelper( )->getAssignmentMethodHelper( )->getQuoteStockId( ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} \nelse {\n\t\t\t\t\t\t$stockId = $collection->getFlag( 'stock_id' );\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif (!$collection->getFlag( 'currency' )) {\n\t\t\t\t\t\t$currencyCode = $helper->getCurrencyHelper( )->getCurrentCode( );\n\t\t\t\t\t} \nelse {\n\t\t\t\t\t\t$currencyCode = $collection->getFlag( 'currency' );\n\t\t\t\t\t}\n\n\t\t\t\t\t$currencyCode = $connection->quote( $currencyCode );\n\n\t\t\t\t\tif (!$collection->getFlag( 'store_id' )) {\n\t\t\t\t\t\t$storeId = $helper->getCurrentStoreId( );\n\t\t\t\t\t} \nelse {\n\t\t\t\t\t\t$storeId = $collection->getFlag( 'store_id' );\n\t\t\t\t\t}\n\n\t\t\t\t\t$storeId = $connection->quote( $storeId );\n\t\t\t\t\t$joinCond = $oldJoinCond . ' AND price_index.stock_id = ' . $stockId;\n\t\t\t\t\t$joinCond .= ' AND ((price_index.currency IS NULL) OR (price_index.currency = ' . $currencyCode . '))';\n\n\t\t\t\t\tif ($storeId) {\n\t\t\t\t\t\t$joinCond .= ( ' AND (price_index.store_id = ' . $storeId . ')' );\n\t\t\t\t\t} \nelse {\n\t\t\t\t\t\t$joinCond .= ' AND (price_index.store_id = 0)';\n\t\t\t\t\t}\n\n\t\t\t\t\t$fromPart['price_index']['joinCondition'] = $joinCond;\n\t\t\t\t\t$select->setPart( FROM, $fromPart );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $collection;\n\t\t}",
"function getItemsFiltered($alldata, $cdad, $tipo, $preciobj, $precioat) {\n $priceFilter = array_filter($alldata, function($val, $key) use ($preciobj, $precioat) {\n $priceNum = intval(str_replace(',','',substr($val['Precio'],1)));\n if($priceNum >= $preciobj and $priceNum <= $precioat) {\n return $priceNum;\n }\n }, ARRAY_FILTER_USE_BOTH);\n $cityFilter = $cdad != '' ? array_filter($priceFilter, function($val, $key) use ($cdad) {\n return $val['Ciudad'] == $cdad;\n }, ARRAY_FILTER_USE_BOTH) : $priceFilter;\n $typeFilter = $tipo != '' ? array_filter($cityFilter, function($val, $key) use ($tipo) {\n return $val['Tipo'] == $tipo;\n }, ARRAY_FILTER_USE_BOTH) : $cityFilter;\n return $typeFilter;\n}",
"public function productSearchPriceDataProvider(): array\n {\n return [\n [\n 'price_filter' => 'from: \"0.01\" to: \"9.99\"',\n 'sort' => 'price: ASC',\n 'items' => [\n [\n 'name' => 'Product with price 0.01',\n 'price' => [\n 'minimalPrice' => [\n 'amount' => [\n 'value' => 0.01,\n ],\n ],\n ],\n ],\n [\n 'name' => 'Product with price 5',\n 'price' => [\n 'minimalPrice' => [\n 'amount' => [\n 'value' => 5,\n ],\n ],\n ],\n ],\n [\n 'name' => 'Product with price 9.99',\n 'price' => [\n 'minimalPrice' => [\n 'amount' => [\n 'value' => 9.99,\n ],\n ],\n ],\n ],\n ],\n ],\n [\n 'price_filter' => 'from: \"5.01\" to: \"10\"',\n 'sort' => 'price: DESC',\n 'items' => [\n [\n 'name' => 'Product with price 10',\n 'price' => [\n 'minimalPrice' => [\n 'amount' => [\n 'value' => 10,\n ],\n ],\n ],\n ],\n [\n 'name' => 'Product with price 9.99',\n 'price' => [\n 'minimalPrice' => [\n 'amount' => [\n 'value' => 9.99,\n ],\n ],\n ],\n ],\n ],\n ],\n [\n 'price_filter' => 'from: \"5\"',\n 'sort' => 'price: DESC',\n 'items' => [\n [\n 'name' => 'Product with price 10',\n 'price' => [\n 'minimalPrice' => [\n 'amount' => [\n 'value' => 10,\n ],\n ],\n ],\n ],\n [\n 'name' => 'Product with price 9.99',\n 'price' => [\n 'minimalPrice' => [\n 'amount' => [\n 'value' => 9.99,\n ],\n ],\n ],\n ],\n [\n 'name' => 'Product with price 5',\n 'price' => [\n 'minimalPrice' => [\n 'amount' => [\n 'value' => 5,\n ],\n ],\n ],\n ],\n ],\n ],\n ];\n }",
"public function addPriceIndexFilter($collection)\n {\n if (!$collection) {\n return $collection;\n }\n $select = $collection->getSelect();\n $fromPart = $select->getPart(Zend_Db_Select::FROM);\n if (isset($fromPart['price_index'])) {\n $oldJoinCond = $fromPart['price_index']['joinCondition'];\n if (strpos($oldJoinCond, 'stock_id') === false) {\n $helper = $this->getWarehouseHelper();\n $connection = $collection->getConnection();\n if (!$collection->getFlag('stock_id')) {\n if ($this->isMultipleMode()) {\n $stockId = $connection->quote($this->getDefaultStockId());\n } else {\n $stockId = $connection->quote(\n $this->getWarehouseHelper()\n ->getAssignmentMethodHelper()\n ->getQuoteStockId()\n );\n }\n } else {\n $stockId = $collection->getFlag('stock_id');\n }\n \n if (!$collection->getFlag('currency')) {\n $currencyCode = $helper->getCurrencyHelper()->getCurrentCode();\n } else {\n $currencyCode = $collection->getFlag('currency');\n }\n $currencyCode = $connection->quote($currencyCode);\n \n if (!$collection->getFlag('store_id')) {\n $storeId = $helper->getCurrentStoreId();\n } else {\n $storeId = $collection->getFlag('store_id');\n }\n $storeId = $connection->quote($storeId);\n \n $joinCond = $oldJoinCond.' AND price_index.stock_id = '.$stockId;\n $joinCond .= \" AND ((price_index.currency IS NULL) OR (price_index.currency = {$currencyCode}))\";\n if ($storeId) {\n $joinCond .= \" AND (price_index.store_id = {$storeId})\";\n } else {\n $joinCond .= \" AND (price_index.store_id = 0)\";\n }\n $fromPart['price_index']['joinCondition'] = $joinCond;\n $select->setPart(Zend_Db_Select::FROM, $fromPart);\n }\n }\n return $collection;\n }",
"public function addPriceIndexFilter($collection)\n {\n if (!$collection) {\n return $collection;\n }\n $select = $collection->getSelect();\n $fromPart = $select->getPart(Zend_Db_Select::FROM);\n if (isset($fromPart['price_index'])) {\n $oldJoinCond = $fromPart['price_index']['joinCondition'];\n if (strpos($oldJoinCond, 'stock_id') === false) {\n $connection = $collection->getConnection();\n $stockId = $this\n ->getProductHelper()\n ->getCollectionStockId($collection);\n $joinCond = $oldJoinCond.' AND price_index.stock_id = '.$connection->quote($stockId);\n $fromPart['price_index']['joinCondition'] = $joinCond;\n $select->setPart(Zend_Db_Select::FROM, $fromPart);\n }\n }\n return $collection;\n }",
"function filter_summary($sl) {\r\n\t\t$s_count = 0;\r\n\t\t$filt ['p'] ['max'] = false;\r\n\t\t$filt ['p'] ['min'] = false;\r\n\t\t\r\n\t\t$filt ['star'] = array ();\r\n\t\t$filters = array ();\r\n\t\tforeach ( $sl ['TransferSearchResult'] ['TransferResults'] as $hr => $hd ) {\r\n\t\t\t// filters\r\n\t\t\t$StarRating = intval (@$hd ['StarRating']);\t\t\t\r\n\t\t\t\r\n\t\t\tif (isset ( $filt ['star'] [$StarRating] ) == false) {\r\n\t\t\t\t$filt ['star'] [$StarRating] ['c'] = 1;\r\n\t\t\t\t$filt ['star'] [$StarRating] ['v'] = $StarRating;\r\n\t\t\t} else {\r\n\t\t\t\t$filt ['star'] [$StarRating] ['c'] ++;\r\n\t\t\t}\t\t\t\r\n\t\t\tif (($filt ['p'] ['max'] != false && $filt ['p'] ['max'] < $hd ['Price'] ['TotalDisplayFare']) || $filt ['p'] ['max'] == false) {\r\n\t\t\t\t$filt ['p'] ['max'] = roundoff_number ( $hd ['Price'] ['TotalDisplayFare'] );\r\n\t\t\t}\r\n\t\t\tif (($filt ['p'] ['min'] != false && $filt ['p'] ['min'] > $hd ['Price'] ['TotalDisplayFare']) || $filt ['p'] ['min'] == false) {\r\n\t\t\t\t$filt ['p'] ['min'] = roundoff_number ( $hd ['Price'] ['TotalDisplayFare'] );\r\n\t\t\t}\t\t\t\r\n\t\t\tif (($filt ['p'] ['min'] != false && $filt ['p'] ['min'] > $hd ['Price'] ['TotalDisplayFare']) || $filt ['p'] ['min'] == false) {\r\n\t\t\t\t$filt ['p'] ['min'] = $hd ['Price'] ['TotalDisplayFare'];\r\n\t\t\t}\t\t\r\n\t\t\t\r\n\t\t\t$filters ['data'] = $filt;\r\n\t\t\t$s_count ++;\r\n\t\t}\t\t\r\n\t\t$filters ['sightseeing_count'] = $s_count;\r\n\t\t// debug($filters);\r\n\t\t// exit;\r\n\t\treturn $filters;\r\n\t}",
"public function paginateFilters();",
"function car_list($offset = 0) {\r\n $response['data'] = '';\r\n $response['msg'] = '';\r\n $response['status'] = FAILURE_STATUS;\r\n $search_params = $this->input->get();\r\n $limit = $this->config->item('car_per_page_limit');\r\n \r\n if ($search_params['op'] == 'load' && intval($search_params['search_id']) > 0 && isset($search_params['booking_source']) == true) {\r\n load_car_lib($search_params['booking_source']);\r\n switch ($search_params['booking_source']) {\r\n case PROVAB_CAR_BOOKING_SOURCE :\r\n //getting search params from table\r\n $safe_search_data = $this->car_model->get_safe_search_data($search_params['search_id']);\r\n //Meaning hotels are loaded first time\r\n $raw_car_list = $this->car_lib->get_car_list(abs($search_params['search_id']));\r\n // debug($raw_car_list);exit;\r\n if ($raw_car_list['status']) {\r\n //Converting API currency data to preferred currency\r\n \r\n $currency_obj = new Currency(array('module_type' => 'car', 'from' => get_api_data_currency(), 'to' => get_application_currency_preference()));\r\n $raw_car_list = $this->car_lib->search_data_in_preferred_currency($raw_car_list, $currency_obj, $search_params['search_id']);\r\n \r\n //Display \r\n $currency_obj = new Currency(array('module_type' => 'car', 'from' => get_application_currency_preference(), 'to' => get_application_currency_preference()));\r\n // debug($currency_obj);exit;\r\n //Update currency and filter summary appended\r\n if (isset($search_params['filters']) == true and valid_array($search_params['filters']) == true) {\r\n $filters = $search_params['filters'];\r\n } else {\r\n $filters = array();\r\n }\r\n //debug($raw_hotel_list);exit;\r\n $raw_car_list['data'] = $this->car_lib->format_search_response($raw_car_list['data'], $currency_obj, $search_params['search_id'], 'b2c', $filters);\r\n\r\n $source_result_count = $raw_car_list['data']['source_result_count'];\r\n $filter_result_count = $raw_car_list['data']['filter_result_count'];\r\n //debug($raw_hotel_list);exit;\r\n if (intval($offset) == 0) {\r\n //Need filters only if the data is being loaded first time\r\n $filters = $this->car_lib->filter_summary($raw_car_list['data']);\r\n $response['filters'] = $filters['data'];\r\n }\r\n // debug($raw_car_list['data']);exit;\r\n $raw_car_list['data'] = $this->car_lib->get_page_data($raw_car_list['data'], $offset, $limit);\r\n\r\n $attr['search_id'] = abs($search_params['search_id']);\r\n\r\n \r\n $response['data'] = get_compressed_output(\r\n $this->template->isolated_view('car/car_search_result_page', array('currency_obj' => $currency_obj, 'raw_car_list' => $raw_car_list['data'],\r\n 'search_id' => $search_params['search_id'], 'booking_source' => $search_params['booking_source'],\r\n 'attr' => $attr,\r\n 'search_params' => $safe_search_data\r\n )));\r\n $response['status'] = SUCCESS_STATUS;\r\n $response['total_result_count'] = $source_result_count;\r\n $response['filter_result_count'] = $filter_result_count;\r\n $response['offset'] = $offset + $limit;\r\n }\r\n break;\r\n }\r\n }\r\n $this->output_compressed_data($response);\r\n }",
"function lazy_load_price_filter(){\n\t$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;\t\n $offset = $_POST[\"offset\"]; \n\t$ppp = $_POST[\"ppp\"]; \n\t$cat_id= $_POST[\"cat_id\"];\n\t$min_price = $_POST[\"min_price\"];\t\t\t\n\t$max_price = $_POST[\"max_price\"];\t\t\t\n\theader(\"Content-Type: text/html\");\t\n\t$args = array( \n\t'post_type' => array('product'),\n 'post_status' => 'publish',\n\t'ignore_sticky_posts' => 1, \t\n\t'posts_per_page' => $ppp,\n\t'offset' => $offset,\n\t'paged' => $paged,\n\t'meta_query' => array(\n\t\tarray(\n\t\t\t'key' => '_price',\n\t\t\t'value' => array($min_price, $max_price),\n\t\t\t'compare' => 'BETWEEN', \n\t\t\t'type' => 'NUMERIC'\n\t\t\t),\t\t\n\t\t),\t\n\t'tax_query' => array(\n\t\t\tarray(\n\t\t\t\t'taxonomy' => 'product_cat',\n\t\t\t\t'field' => 'term_id', //This is optional, as it defaults to 'term_id'\n\t\t\t\t'terms' => $cat_id,\n\t\t\t\t'operator' => 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.\n\t\t\t),\n\t\t\t\n\t\t)\n\t);\n\t$pid = $product->id;\n\t$price = $product->price;\n\t$desc = get_post_meta($pid, 'description', true);\n\t\n\t$loop = new WP_Query( $args ); \t\n\t$total_post = $loop->found_posts;\n\tif($loop->have_posts()){ \n\twhile ( $loop->have_posts() ) : $loop->the_post(); \n\tglobal $product; ?> \n\n\n\n\n\n<li class=\"cus_col-sm-3 cat-item1 myproducts\" data-href=\"<?php the_permalink(); ?>\">\n\n <?php if ($flag_first_item == 1) { ?>\n <a href=\"<?php the_permalink(); ?>\"><?php the_post_thumbnail('shop_catalog'); ?></a>\n\n\t\t<div class=\"price_img\">\n\t\t\t\t<p class=\"prce\">\n\t\t\t\t\t<?php echo $product->get_price_html(); ?>\n\t\t\t\t</p>\n\t\t\t</div>\n <div class=\"caption\"><a href=\"<?php the_permalink(); ?>\" style=\"display:block;\"> </a>\n <p class=\"qik_view\"><a href=\"#quick_view_content<?php echo $pid; ?>\"\n class=\"qik_view_btn various\"><?php echo __('QuickView', 'cpt'); ?></a></p>\n <p class=\"title\"><a href=\"<?php the_permalink(); ?>\" style=\"text-decoration:none;\"><?php the_title(); ?></a>\n </p>\n <p class=\"prce\">\n <?php echo $product->get_price_html(); ?>\n </p>\n <p class=\"desc\">\n <a href=\"<?php the_permalink(); ?>\" style=\"text-decoration:none;\">\n <?php echo substr($desc, 0, 140); ?>...\n </a>\n </p>\n <div class=\"bottom\">\n <div class=\"wishlist_cls\">\n <?php\n $add_to_wishlist = do_shortcode('[yith_wcwl_add_to_wishlist]');\n echo $add_to_wishlist;\n ?>\n\n </div>\n <div class=\"add\">\n\n\n <span><?php woocommerce_template_loop_add_to_cart($post, $product); ?></span>\n\n\n </div>\n </div>\n\n </div>\n <div class=\"hide-cls\">\n <div id=\"quick_view_content<?php echo $pid; ?>\"\n class=\"quick_view_cls\"> <?php do_action('woocommerce_single_product_summary'); ?></div>\n </div>\n <?php } else { ?>\n <?php the_post_thumbnail('shop_thumbnail'); ?>\n\n\t\t<div class=\"price_img\">\n\t\t\t\t<p class=\"prce\">\n\t\t\t\t\t<?php echo $product->get_price_html(); ?>\n\t\t\t\t</p>\n\t\t\t</div>\n <div class=\"caption\"><a href=\"<?php the_permalink(); ?>\" style=\"display:block;\"> </a>\n <p class=\"qik_view\"><a href=\"#quick_view_content<?php echo $pid; ?>\"\n class=\"qik_view_btn various\"><?php echo __('QuickView', 'cpt'); ?></a></p>\n <p class=\"title\"><a href=\"<?php the_permalink(); ?>\" style=\"text-decoration:none;\"><?php the_title(); ?></a>\n </p>\n <p class=\"prce\">\n <?php echo $product->get_price_html(); ?>\n </p>\n <p class=\"desc\">\n <a href=\"<?php the_permalink(); ?>\" style=\"text-decoration:none;\">\n <?php echo substr($desc, 0, 140); ?>...\n </a>\n </p>\n <div class=\"bottom\">\n <div class=\"wishlist_cls\">\n <?php\n $add_to_wishlist = do_shortcode('[yith_wcwl_add_to_wishlist]');\n echo $add_to_wishlist;\n ?>\n </div>\n <div class=\"add\">\n <span><?php woocommerce_template_loop_add_to_cart($post, $product); ?></span>\n </div>\n </div>\n\n </div>\n <div class=\"hide-cls\">\n <div id=\"quick_view_content<?php echo $pid; ?>\"\n class=\"quick_view_cls\"><?php do_action('woocommerce_single_product_summary'); ?></div>\n </div>\n <?php } ?>\n\n</li>\n\t<?php endwhile; ?> <?php wp_reset_query();}\n\t}",
"public function getFreshProductsSortedByPrice($filters = [], $limit=20, $page=1) {\r\n //$two_days_ago=Utils::getMongoDate(-60*60*24*2);\r\n \r\n $conditions = ['categories' => $this->name, 'status' => 1];\r\n $conditions = array_merge($filters, $conditions);//var_dump($conditions);die;\r\n \r\n $two_days_ago = -60*60*24*2;\r\n \r\n $products=Products::find([\r\n 'conditions' => $conditions,\r\n 'fields' => ['_id','name','lowest_price','key_features', 'root_category', 'store_count'],\r\n 'order' => ['store_count' => -1, 'added_datetime' => -1,'lowest_price.price' => -1],\r\n 'limit' => $limit,\r\n 'page' => $page\r\n ], $this->connection);\r\n //var_dump($products);\r\n if (count($products) < $limit) {\r\n $fallback_prods = $this->getProductsLastUpdatedIn($filters, $two_days_ago, $limit-count($products),$page);\r\n $products = Utils::mergeProducts($products,$fallback_prods);\r\n }\r\n \r\n if (count($products) < $limit) {\r\n //$four_days_ago=Utils::getMongoDate(-60*60*24*4);\r\n $four_days_ago = -60*60*24*4;\r\n $fallback_prods = $this->getProductsLastUpdatedIn($filters, $four_days_ago, $limit-count($products),$page);\r\n $products = Utils::mergeProducts($products,$fallback_prods);\r\n }\r\n \r\n if (count($products)<$limit) {\r\n $fallback_prods = Products::find([\r\n 'conditions' => $conditions,\r\n 'fields' => ['_id','name','lowest_price','key_features', 'root_category', 'store_count'],\r\n 'order' => ['store_count' => -1, 'last_updated_datetime' => -1,'lowest_price.price' => -1],\r\n 'limit' => $limit-count($products),\r\n 'page' => $page\r\n ], $this->connection);\r\n $products = Utils::mergeProducts($products,$fallback_prods);\r\n }\r\n #foreach ($products as $k => $v)\r\n # $products[$k]['store_count'] = Products::getStoreCount($v);\r\n \r\n return $products;\r\n }",
"function search_by_price_query( $args ) {\n \n if( adverts_request( 'price_min' ) ) {\n \n $args[\"meta_query\"][] = array( \n 'key' => 'adverts_price', \n 'value' => adverts_filter_money( adverts_request( 'price_min' ) ), \n 'compare' => '>=',\n 'type' => 'DECIMAL(12,2)'\n );\n }\n\n if( adverts_request( 'price_max' ) ) {\n $args[\"meta_query\"][] = array( \n 'key' => 'adverts_price', \n 'value' => adverts_filter_money( adverts_request( 'price_max' ) ), \n 'compare' => '<=',\n 'type' => 'DECIMAL(12,2)'\n );\n }\n \n return $args;\n}",
"public function apply(Zend_Controller_Request_Abstract $request, $filterBlock)\n {\n if ($this->getRequestVar() != 'price' && Mage::helper('amshopby')->isVersionLessThan(1, 4)){\n return parent::apply($request, $filterBlock);\n }\n \n if (!$this->calculateRanges()){\n $this->_items = array($this->_createItem('', 0, 0)); \n } \n \n $filterBlock->setValueFrom(Mage::helper('amshopby')->__('From'));\n $filterBlock->setValueTo(Mage::helper('amshopby')->__('To'));\n \n $filter = $request->getParam($this->getRequestVar());\n if (!$filter) {\n return $this;\n }\n \n $isFromTo = false;\n if (Mage::getStoreConfig('amshopby/general/use_custom_ranges')){\n $isFromTo = true;\n }\n \n $prices = array();\n /*\n * Try range\n */\n $prices = explode($this->_rangeSeparator, $filter);\n if (count($prices) != 2) {\n /*\n * Try from to\n */\n $prices = explode($this->_fromToSeparator, $filter); \n if (count($prices) == 2) {\n $isFromTo = true;\n } else {\n return $this;\n }\n } \n\n list ($from, $to) = $prices;\n $from = floatval($from);\n $to = floatval($to);\n\n if ($from || $to) {\n if (!$isFromTo){\n $index = $from;\n $range = $to;\n $from = ($index-1)*$range;\n $to = $index*$range;\n } \n \n $filterBlock->setValueFrom($from > 0.01 ? $from : '');\n $filterBlock->setValueTo($to > 0.01 ? $to : '');\n \n $this->_getResource()->applyFromToFilter($this, $from, $to);\n \n $this->getLayer()->getState()->addFilter(\n $this->_createItem($this->_renderFromToItemLabel($from, $to), $filter)\n );\n if ($this->hideAfterSelection()){\n $this->_items = array();\n } \n elseif ($this->calculateRanges()){\n $this->_items = array($this->_createItem('', 0, 0));\n }\n }\n return $this;\n }",
"function productpagelistwithstar(&$page,&$pagecount,$pagesize=2,$catid=NULL,$ctrl=PRODUCT_CTRL_SHOW,$star=NULL,$hint=NULL,$minprice=NULL,$maxprice=NULL,$exid=NULL,$getcatid=TRUE,$type=NULL){\n\tglobal $sql,$ESNC_ROWCOUNT,$ESNC_ROWSTART,$ESNC_ROWEND;\n\tif(!is_int($ctrl)) return FALSE;\n\t$wh = \" WHERE `a`.`ctrl` & {$ctrl} = {$ctrl}\";\n\tif(is_int($exid)){ $wh .= \" AND `a`.`id` <> {$exid}\";}\n\tif(is_int($type)){ $wh .= \" AND `a`.`type` = {$type}\";}\n\t$tbcat='';\n\tif(is_int($catid)){//filter by cat\n\t\t$tbcat = \" INNER JOIN `\".DB_TABLE_PREFIX.\"catproductproduct` as `b` ON `a`.`id` = `b`.`productid` AND `b`.`catproductid` = {$catid} INNER JOIN `\".DB_TABLE_PREFIX.\"catproduct` as `c` ON `b`.`catproductid` = `c`.`id`\";\n\t}else {$tbcat = \" INNER JOIN `\".DB_TABLE_PREFIX.\"catproductproduct` as `b` ON `a`.`id` = `b`.`productid` INNER JOIN `\".DB_TABLE_PREFIX.\"catproduct` as `c` ON `b`.`catproductid` = `c`.`id`\";}\n\tif($star != NULL){\n\t\t$wh .= \" AND `a`.`manufacturer`={$star}\";\n\t}\n\tif($hint !== NULL){\n\t\t$hint = mysql_escape_string(str_replace(array('*','?'),array('%','_'),$hint));\n\t\tif(strpos($hint,'%') === FALSE && strpos('_',$hint) === FALSE) $hint='%'.$hint.'%';\n\t\t$wh .= \" AND (`a`.`name` LIKE '{$hint}' OR `a`.`keyword` LIKE '{$hint}' OR `a`.`code` LIKE '{$hint}' OR `a`.`summary` LIKE '{$hint}')\";\n\t}\n\t$lm='';\n\tif(is_int($page) && is_int($pagesize) && $pagesize >= 1){//must be number\n\t\t$ESNC_ROWSTART=$pagesize * ($page -1);\n\t\t$lm = ' LIMIT '.$ESNC_ROWSTART.','.$pagesize;\n\t}\n\t$sql = \"SELECT SQL_CALC_FOUND_ROWS DISTINCT a.`id`,a.`name`,a.`code`,a.`unit`,a.`include`,a.`manufacturer`,a.`saleprice`,`a`.`price`,`a`.`class`,a.`ctrl`,a.`view`,`a`.`urlrewrite`, c.`name` catname,c.`id` catnameid,`c`.`urlrewrite` caturlrewrite, a.`summary`, a.`detail`,a.`keyword`,a.`img1`,a.`alt1`,a.`img2`,a.`alt2`,a.`warranty`,a.`type`,a.`country` ,`a`.`model`\".($getcatid ? ',`b`.`catproductid` as `catid`':'').\" FROM `\".DB_TABLE_PREFIX.\"product` as `a` {$tbcat} {$wh} ORDER BY `a`.`view` ASC,`a`.`id` DESC {$lm}\";\n\t//echo $sql;\n\t$rs = mysql_query($sql);\n\t$sql = 'SELECT FOUND_ROWS()';\n\t$rs1 = mysql_query($sql);\n\t$row = mysql_fetch_row($rs1);\n\tmysql_free_result($rs1);\n\t$ESNC_ROWCOUNT=(int)$row[0];\n\t$ESNC_ROWEND = (++$ESNC_ROWSTART) + $pagesize;\n\tif($ESNC_ROWEND > $ESNC_ROWCOUNT) $ESNC_ROWEND = $ESNC_ROWCOUNT;\n\t$pagecount = ceil($ESNC_ROWCOUNT/$pagesize);\n\treturn $rs;\n}",
"public function testFilterWithinSpecificPriceRangeSortedByNameDesc(): void\n {\n $query\n = <<<QUERY\n{\n products(\n filter:\n {\n price:{from: \"5\", to: \"50\"}\n sku:{in:[\"simple1\", \"simple2\"]}\n name:{match:\"Simple\"}\n }\n pageSize:4\n currentPage:1\n sort:\n {\n name:DESC\n }\n )\n {\n items\n {\n sku\n price {\n minimalPrice {\n amount {\n value\n currency\n }\n }\n }\n name\n ... on PhysicalProductInterface {\n weight\n }\n type_id\n }\n total_count\n page_info\n {\n page_size\n current_page\n }\n }\n}\nQUERY;\n $product1 = $this->productRepository->get('simple1');\n $product2 = $this->productRepository->get('simple2');\n $filteredProducts = [$product2, $product1];\n\n $response = $this->graphQlQuery($query);\n $this->assertArrayHasKey('products', $response);\n $this->assertArrayHasKey('total_count', $response['products']);\n $this->assertProductItems($filteredProducts, $response);\n $this->assertEquals(4, $response['products']['page_info']['page_size']);\n }",
"public function testFilterProductsWithinSpecificPriceRangeSortedByNameDesc()\n {\n $query\n = <<<QUERY\n{\n products(\n filter:\n {\n price:{gt: \"5\", lt: \"50\"}\n or:\n {\n sku:{like:\"simple%\"}\n name:{like:\"Simple%\"}\n }\n }\n pageSize:4\n currentPage:1\n sort:\n {\n name:DESC\n }\n )\n {\n items\n {\n sku\n price {\n minimalPrice {\n amount {\n value\n currency\n }\n }\n }\n name\n ... on PhysicalProductInterface {\n weight\n }\n type_id\n attribute_set_id\n }\n total_count\n page_info\n {\n page_size\n current_page\n }\n }\n}\nQUERY;\n /**\n * @var ProductRepositoryInterface $productRepository\n */\n $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class);\n $product1 = $productRepository->get('simple1');\n $product2 = $productRepository->get('simple2');\n $filteredProducts = [$product2, $product1];\n\n $response = $this->graphQlQuery($query);\n $this->assertArrayHasKey('products', $response);\n $this->assertArrayHasKey('total_count', $response['products']);\n $this->assertProductItems($filteredProducts, $response);\n $this->assertEquals(4, $response['products']['page_info']['page_size']);\n }",
"public function findAllListingsActiveRequest($limit = 25, $offset = 0, $keywords = 'null', $sort_on = 'created', $sort_order = 'desc', $min_price = null, $max_price = null, $taxonomy_id = null, $shop_location = 'null')\n {\n if ($limit !== null && $limit > 100) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling ShopListingApi.findAllListingsActive, must be smaller than or equal to 100.');\n }\n if ($limit !== null && $limit < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling ShopListingApi.findAllListingsActive, must be bigger than or equal to 1.');\n }\n\n if ($offset !== null && $offset < 0) {\n throw new \\InvalidArgumentException('invalid value for \"$offset\" when calling ShopListingApi.findAllListingsActive, must be bigger than or equal to 0.');\n }\n\n if ($taxonomy_id !== null && $taxonomy_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$taxonomy_id\" when calling ShopListingApi.findAllListingsActive, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/v3/application/listings/active';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($limit !== null) {\n if('form' === 'form' && is_array($limit)) {\n foreach($limit as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['limit'] = $limit;\n }\n }\n // query params\n if ($offset !== null) {\n if('form' === 'form' && is_array($offset)) {\n foreach($offset as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['offset'] = $offset;\n }\n }\n // query params\n if ($keywords !== null) {\n if('form' === 'form' && is_array($keywords)) {\n foreach($keywords as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['keywords'] = $keywords;\n }\n }\n // query params\n if ($sort_on !== null) {\n if('form' === 'form' && is_array($sort_on)) {\n foreach($sort_on as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['sort_on'] = $sort_on;\n }\n }\n // query params\n if ($sort_order !== null) {\n if('form' === 'form' && is_array($sort_order)) {\n foreach($sort_order as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['sort_order'] = $sort_order;\n }\n }\n // query params\n if ($min_price !== null) {\n if('form' === 'form' && is_array($min_price)) {\n foreach($min_price as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['min_price'] = $min_price;\n }\n }\n // query params\n if ($max_price !== null) {\n if('form' === 'form' && is_array($max_price)) {\n foreach($max_price as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['max_price'] = $max_price;\n }\n }\n // query params\n if ($taxonomy_id !== null) {\n if('form' === 'form' && is_array($taxonomy_id)) {\n foreach($taxonomy_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['taxonomy_id'] = $taxonomy_id;\n }\n }\n // query params\n if ($shop_location !== null) {\n if('form' === 'form' && is_array($shop_location)) {\n foreach($shop_location as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['shop_location'] = $shop_location;\n }\n }\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listItems($filter = [], $fields = null)\n {\n\n // SELECT * FROM products WHERE\n // category_id = 1 AND \n // price < 9999 AND price > 1111 AND \n // id IN (1,2,3,4,5,6,7,8,9) AND \n // name LIKE '%ноут%' \n // LIMIT 0, 5\n if(!$fields) {\n //$fields = ['name', 'price'];\n $fields = ['*'];\n }\n $sql = \" FROM $this->table \";\n if (!empty($filter)) {\n $sql = $sql. 'WHERE ';\n if (key_exists('cat', $filter)) {\n $sql .= 'category_id = ?';\n }\n if (key_exists('priceMin', $filter)) {\n if (key_exists('cat', $filter)) $sql .= ' AND ';\n $sql .= 'price > ?';\n }\n if (key_exists('priceMax', $filter)) {\n if (key_exists('cat', $filter) OR key_exists('priceMin', $filter)) $sql .= ' AND ';\n $sql .= 'price < ?';\n }\n if (key_exists('ids', $filter)) {\n if (key_exists('cat', $filter) OR key_exists('priceMin', $filter) OR key_exists('priceMax', $filter)) $sql .= ' AND ';\n //$sql .= 'id IN (?)';\n //$filter['ids'] = \"(\". join(\",\", $filter['ids']) .\")\";\n $sql .= 'id = ?';\n }\n if (key_exists('like', $filter)) {\n if (key_exists('cat', $filter) OR key_exists('priceMin', $filter) OR key_exists('priceMax', $filter) OR key_exists('ids', $filter)) $sql .= ' AND ';\n //$sql .= 'id IN (?)';\n //$filter['ids'] = \"(\". join(\",\", $filter['ids']) .\")\";\n $sql .= 'name LIKE ?';\n }\n if (key_exists('start', $filter) AND key_exists('limit', $filter)) {\n $sql .= ' LIMIT ?, ?';\n }\n }\n if ($fields) {\n if ($fields == 'count') {\n $sql = 'SELECT COUNT(*) '.$sql;\n } else {\n $sql = 'SELECT ' .join(\",\", $fields) .$sql;\n }\n }\n\n $stmt = $this->connect_PDO->prepare($sql);\n if (!empty($filter)) {\n $i = 1;\n $type = null;\n foreach ($filter as $key => $fl) {\n $type = (in_array($key, ['cat', 'priceMin', 'priceMax', 'ids', 'start', 'limit'])) ? PDO::PARAM_INT : PDO::PARAM_STR;\n $stmt->bindValue($i, $fl, $type);\n $i++;\n }\n }\n $stmt->execute();\n $result = $stmt->fetchAll();\n return $result; \n }",
"function starter_change_price_filter_step() {\n\treturn 1;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation draftCustomerInvoice Create customer invoice draft | public function draftCustomerInvoice($body)
{
list($response) = $this->draftCustomerInvoiceWithHttpInfo($body);
return $response;
} | [
"public function createInvoiceFromDraft($iddraft)\n {\n $result = $this->_sendRequest('/drafts/' . $iddraft . '/createinvoice', null, 'POST');\n return $result;\n }",
"private function savePurchaseInvoiceDraft()\n {\n try {\n $pi = new PurchaseInvoice();\n $pi->supplier_id = 0;\n $pi->ship_to_branch_id = 0;\n $pi->purchase_rep = Auth::user()->staff->id;\n $pi->due_date = date('Y-m-d');\n $pi->currency_id = 1;\n $pi->is_draft = 1;\n $pi->save();\n\n return $pi->id;\n } catch (\\Exception $ex) {\n return false;\n }\n }",
"public function draftCustomerInvoiceAsync($body)\n {\n return $this->draftCustomerInvoiceAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"function createInvoice();",
"private function saveSalesInvoiceDraft()\n {\n try {\n $salesinvoice = new SalesInvoice();\n $salesinvoice->branch_id = Auth::user()->branch->id;\n $salesinvoice->sales_rep_id = Auth::user()->staff->id;\n $salesinvoice->customer_id = 0;\n $salesinvoice->payment_method_id = 0;\n $salesinvoice->is_draft = 1;\n $salesinvoice->save();\n\n return $salesinvoice->id;\n } catch (\\Exception $e) {\n return false;\n }\n }",
"public function add(InvoiceDraft $draft)\n {\n $content = $this->getContent();\n $draft->draftKey = Str::random(10);\n $content->put($draft->draftKey, $draft);\n\n $this->session->put($this->instance, $content);\n\n return $draft;\n }",
"public function createInvoice(Invoice $invoice): Invoice;",
"public function draftSupplierInvoice($body)\n {\n list($response) = $this->draftSupplierInvoiceWithHttpInfo($body);\n return $response;\n }",
"protected function customerInvoiceDraftsV2DeleteRequest($customer_invoice_draft_id)\n {\n // verify the required parameter 'customer_invoice_draft_id' is set\n if ($customer_invoice_draft_id === null || (is_array($customer_invoice_draft_id) && count($customer_invoice_draft_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_invoice_draft_id when calling customerInvoiceDraftsV2Delete'\n );\n }\n\n $resourcePath = '/v2/customerinvoicedrafts/{customerInvoiceDraftId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($customer_invoice_draft_id !== null) {\n $resourcePath = str_replace(\n '{' . 'customerInvoiceDraftId' . '}',\n ObjectSerializer::toPathValue($customer_invoice_draft_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\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\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 }",
"protected function customerInvoiceDraftsV2ConvertToInvoiceRequest($body, $customer_invoice_draft_id, $keep_original_draft_date = null, $override_company_keep_original_draft_date = null)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling customerInvoiceDraftsV2ConvertToInvoice'\n );\n }\n // verify the required parameter 'customer_invoice_draft_id' is set\n if ($customer_invoice_draft_id === null || (is_array($customer_invoice_draft_id) && count($customer_invoice_draft_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $customer_invoice_draft_id when calling customerInvoiceDraftsV2ConvertToInvoice'\n );\n }\n\n $resourcePath = '/v2/customerinvoicedrafts/{customerInvoiceDraftId}/convert';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($keep_original_draft_date !== null) {\n $queryParams['keepOriginalDraftDate'] = ObjectSerializer::toQueryValue($keep_original_draft_date, null);\n }\n // query params\n if ($override_company_keep_original_draft_date !== null) {\n $queryParams['overrideCompanyKeepOriginalDraftDate'] = ObjectSerializer::toQueryValue($override_company_keep_original_draft_date, null);\n }\n\n // path params\n if ($customer_invoice_draft_id !== null) {\n $resourcePath = str_replace(\n '{' . 'customerInvoiceDraftId' . '}',\n ObjectSerializer::toPathValue($customer_invoice_draft_id),\n $resourcePath\n );\n }\n\n // form params\n if ($total_amount_invoice_currency !== null) {\n $formParams['TotalAmountInvoiceCurrency'] = ObjectSerializer::toFormValue($total_amount_invoice_currency);\n }\n // form params\n if ($total_vat_amount_invoice_currency !== null) {\n $formParams['TotalVatAmountInvoiceCurrency'] = ObjectSerializer::toFormValue($total_vat_amount_invoice_currency);\n }\n // form params\n if ($total_roundings_invoice_currency !== null) {\n $formParams['TotalRoundingsInvoiceCurrency'] = ObjectSerializer::toFormValue($total_roundings_invoice_currency);\n }\n // form params\n if ($rows !== null) {\n $formParams['Rows'] = ObjectSerializer::toFormValue($rows);\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\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\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 }",
"protected function draftSupplierInvoiceRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling draftSupplierInvoice'\n );\n }\n\n $resourcePath = '/supplier-invoices/drafts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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 (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\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 function create(): Invoice;",
"public function createInvoice()\n {\n //only create invoice if no pending invoice\n if ($this->invoices()->pending()->count()) {\n throw new Exception(\"Can not create invoice for a transaction that has a pending invoice.\");\n }\n\n $this->invoices()->create([\n 'user_id' => $this->payer->id,\n 'currency' => $this->invoiceCurrency,\n 'amount' => $this->invoiceAmount,\n ]);\n }",
"public function createInvoice(InvoiceTransfer $invoiceTransfer);",
"public function create()\n {\n return view('creditCardInvoices.create');\n }",
"public function invoiceAction() {\n /**\n * Get order id.\n */\n $orderId = $this->getRequest ()->getParam ( 'id' );\n /**\n * Check that customer login or not.\n */\n if (Mage::getSingleton ( 'customer/session' )->isLoggedIn () && isset ( $orderId )) {\n /**\n * Load order details.\n */\n $order = Mage::getModel ( \"sales/order\" )->load ( $orderId );\n } else {\n /**\n * Error message for the when unwanted person access these request.\n *\n * Redirect to view order page.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n return;\n }\n \n try {\n /**\n * Check invoice create status.\n */\n if (! $order->canInvoice ()) {\n /**\n * Set error meesage\n *\n * And redirect to view order page.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"Cannot create an invoice.\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n return;\n }\n /**\n * Create Invoice.\n */\n $invoice = Mage::getModel ( 'sales/service_order', $order )->prepareInvoice ();\n $invoice->setRequestedCaptureCase ( Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE );\n /**\n * Register invoice.\n */\n $invoice->register ();\n $transactionSave = Mage::getModel ( 'core/resource_transaction' )->addObject ( $invoice )->addObject ( $invoice->getOrder () );\n $transactionSave->save ();\n /**\n * Send invoice email.\n */\n $invoice->getOrder ()->setCustomerNoteNotify ( true );\n $invoice->getOrder ()->setIsInProcess ( true );\n /**\n * Send invoice email.\n */\n $invoice->sendEmail ();\n /**\n * Set Invoice created success message\n * And product view order page.\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Invoice created sucessfully.\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Set error message.\n * And redirect to view order page.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page.\" ) );\n $this->_redirect ( 'property/product/vieworder/order_id/' . $orderId );\n return;\n }\n }",
"function create_invoice ($invoice) {\n global $sql;\n return $sql->sql_insert('invoice', $invoice);\n }",
"public function salesDocumentAttachmentsV2PostCustomerInvoiceDraft($content_type, $file_name, $dockument_id, $data, $url)\n {\n list($response) = $this->salesDocumentAttachmentsV2PostCustomerInvoiceDraftWithHttpInfo($content_type, $file_name, $dockument_id, $data, $url);\n return $response;\n }",
"protected function customerInvoiceDraftsV2Get_0Request($invoice_draft_id)\n {\n // verify the required parameter 'invoice_draft_id' is set\n if ($invoice_draft_id === null || (is_array($invoice_draft_id) && count($invoice_draft_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $invoice_draft_id when calling customerInvoiceDraftsV2Get_0'\n );\n }\n\n $resourcePath = '/v2/customerinvoicedrafts/{invoiceDraftId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($invoice_draft_id !== null) {\n $resourcePath = str_replace(\n '{' . 'invoiceDraftId' . '}',\n ObjectSerializer::toPathValue($invoice_draft_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\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\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 }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [promoted] column value. | public function getPromoted()
{
return $this->promoted;
} | [
"public function getPromotedBy()\n\t{\n\t\treturn ($this->promoted_by !== null) ? $this->promoted_by : null;\n\t}",
"public function getPromoteStatus()\n {\n return $this->promote_status;\n }",
"public function setPromoted($promoted);",
"public function getPromoTextValue()\n {\n $wrapper = $this->getPromoText();\n return is_null($wrapper) ? null : $wrapper->getValue();\n }",
"public function getPromotional()\n {\n return $this->promotional;\n }",
"public function get_column_value()\n {\n return $this->properties['options'][$this->get_value()];\n }",
"public function get_column_value()\n {\n if ( isset( $this->properties['admin-column']['callback'] ) )\n {\n $id = \"{$this->namespace}-{$this->properties['slug']}\";\n $value = call_user_func( $this->properties['admin-column']['callback'], $id, $this->get_value() );\n }\n else\n {\n $value = $this->get_value();\n }\n return $value;\n }",
"public function getPropertyValue()\n {\n if ($this->isConnected) {\n return $this->connectedProperty->getValue();\n }\n }",
"public function getPromotion()\n {\n return $this->getInfo('promo');\n }",
"public function getPromotionFeedItem()\n {\n return $this->readOneof(12);\n }",
"function _get_promotion_from_db($pid) {\r\n\treturn db_select('cinema_promotions_data', 'p')\r\n\t\t ->fields('p')\r\n\t\t ->condition('pid', $pid, '=')\r\n\t\t ->execute()\r\n\t\t ->fetchAssoc();\r\n}",
"public function getPromotionTarget()\n {\n return $this->promotion_target;\n }",
"public function getQualifiedPublishedByColumn()\n {\n return $this->getTable() . '.' . $this->getPublishedByColumn();\n }",
"public function getIsPromotable()\n {\n return $this->getProduct()->promotable;\n }",
"public function getPromotionCode()\n {\n return $this->promotion_code;\n }",
"public function getSQLValue() {\r\n\t\t\treturn $this->column->valueAsSQL($this->value);\r\n\t\t}",
"public function getPromotionCode()\n {\n return $this->promotionCode;\n }",
"public function getPromo()\n {\n return $this->promo;\n }",
"public function getPrefValue() {\n\t\treturn $this->prefValue;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw dots inside image | public static function DrawDot( $path, $dots, $temp = FALSE, $width = 0, $height = 0 )
{
$image_path = $path;
$temp_dir = $temp;
$is_url = FALSE;
if( filter_var( $path, FILTER_VALIDATE_URL ) ){
if( $temp_dir ){
$temp_dir = "/" . trim( $temp_dir, "/" ) . "/";
}
$url_info = parse_url( $path );
$filename = basename( $url_info[ "path" ] );
$image_path = $temp_dir . $filename;
$image = @file_get_contents( $path );
@file_put_contents( $image_path, $image );
$is_url = TRUE;
}
$new_image_path = $temp_dir . md5( rand(1,19) . time() ) . ".jpg";
if( ! static::ConvertToJPG( $image_path, $new_image_path, $width, $height ) ){
return FALSE;
}
$image = imagecreatefromjpeg( $new_image_path );
$ellipseColor = imagecolorallocate( $image, 255, 0, 0 );
foreach( $dots as $dot ){
imagefilledellipse( $image, $dot->cx, $dot->cy, $dot->r, $dot->r, $ellipseColor );
}
unlink( $new_image_path );
imagejpeg( $image, $new_image_path );
return basename( $new_image_path );
} | [
"function draw_dots(&$im) {\r\n\tglobal $img_width, $img_height;\r\n\t\r\n\t$dot_count = $img_width*$img_height/5;\r\n\tfor($i = 0; $i <= $dot_count; $i++) {\r\n\t\t$color = imagecolorallocate($im, rand(200, 255), rand(200, 255), rand(200, 255));\r\n\t\timagesetpixel($im, rand(0, $img_width), rand(0, $img_height), $color);\r\n\t}\t\r\n}",
"function draw_dots(&$im)\r\n{\r\n\tglobal $img_width, $img_height;\r\n\r\n\t$dot_count = $img_width*$img_height/5;\r\n\tfor($i = 0; $i <= $dot_count; ++$i)\r\n\t{\r\n\t\t$color = imagecolorallocate($im, rand(200, 255), rand(200, 255), rand(200, 255));\r\n\t\timagesetpixel($im, rand(0, $img_width), rand(0, $img_height), $color);\r\n\t}\r\n}",
"function DrawDotSeries() \n {\n $this->DrawDots();\n }",
"function drawdots($a) {\r\n if ($this->fp === false) {\r\n return;\r\n }\r\n foreach ($a as $dot) {\r\n fputs($this->fp, '<circle cx=\"'.($this->scale*$dot[0]).'\" cy=\"'.($this->scale*$dot[1]).'\" r=\"'.($this->scale*$this->circleradius).'\" />'.\"\\r\\n\");\r\n }\r\n }",
"public static function Dots()\r\n {return new LineStyle(\"dots\");}",
"protected function afterDrawDot(YiiImageDrawerEventOnDrawDot $event)\n {\n \n }",
"public function draw()\n {\n\n $this->drawYaxis();\n\n if ($this->connect_points == 1) {\n $this->connectPoints();\n }\n\n foreach ($this->points as $point) {\n\n if ($this->y_axis_hints == 1) {\n imagedashedline($this->im, $point->x, $this->height, $point->x,\n 0, $this->ink['axis']);\n } else {\n\n //add axis line\n imageline($this->im, $point->x, $this->graph_height, $point->x,\n $this->graph_height + 10, $this->ink['axis']);\n }\n\n //add axis label\n imagestring($this->im, 1, $point->x + 5, $this->graph_height + 10,\n $point->label, $this->ink['text']);\n\n //don't plot actual point if it is null\n if (is_null($point->value)) {\n continue;\n }\n\n //plot point\n imagefilledellipse($this->im, $point->x, $point->y, 7, 7,\n $this->ink['point']);\n\n //add point label\n if ($point->y <= 5) {\n $posy = $point->y + 5;\n } elseif ($point->y >= $this->graph_height - 5) {\n $posy = $point->y - 20;\n } else {\n $posy = $point->y - 15;\n }\n\n imagestring($this->im, 3, $point->x + 10, $posy, $point->value,\n $this->ink['point']);\n }\n }",
"protected function render_dots()\n {\n $settings = $this->get_settings_for_display();\n\n if ($settings['dots'] == 'yes') { ?>\n <!-- Add Pagination -->\n <div class=\"swiper-pagination swiper-pagination-<?php echo esc_attr($this->get_id()); ?>\"></div>\n <?php }\n }",
"function drawThickLine ($img, $startX, $startY, $endX, $endY, $colour, $thickness) {\n\n\t\t $angle = (atan2(($startY - $endY), ($endX - $startX)));\n\n\t\t\n\n\t\t $dist_x = $thickness * (sin($angle));\n\n\t\t $dist_y = $thickness * (cos($angle));\n\n\t\t\n\n\t\t $p1x = ceil(($startX + $dist_x));\n\n\t\t $p1y = ceil(($startY + $dist_y));\n\n\t\t $p2x = ceil(($endX + $dist_x));\n\n\t\t $p2y = ceil(($endY + $dist_y));\n\n\t\t $p3x = ceil(($endX - $dist_x));\n\n\t\t $p3y = ceil(($endY - $dist_y));\n\n\t\t $p4x = ceil(($startX - $dist_x));\n\n\t\t $p4y = ceil(($startY - $dist_y));\n\n\t\t\n\n\t\t $array = array(0=>$p1x, $p1y, $p2x, $p2y, $p3x, $p3y, $p4x, $p4y);\n\n\t\t imagefilledpolygon($img, $array, (count($array)/2), $colour);\n\n\t\t}",
"private function drawlines()\n {\n $color1 = rand(150, 185);\n $color2 = rand(185, 225);\n $nextline = 4;\n $w1 = 0;\n $w2 = 0;\n\n for ($x = 0; $x < $this->width; $x += (int) $nextline) {\n if ($x < $this->width) {\n imageline($this->img, $x + $w1, 0, $x + $w2, $this->height - 1, rand($color1, $color2));\n }\n if ($x < $this->height) {\n imageline($this->img, 0, $x - $w2, $this->width - 1, $x - $w1, rand($color1, $color2));\n }\n if (function_exists('imagettftext') && (count($this->fonts) > 0)) {\n $nextline += rand(-5, 7);\n if ($nextline < 1) {\n $nextline = 2;\n }\n } else {\n $nextline += rand(1, 7);\n }\n $w1 += rand(-4, 4);\n $w2 += rand(-4, 4);\n }\n\n return $this->img;\n }",
"public function drawimage($GmagickDraw){}",
"private function connect_points() {\n imagesetthickness($this->im, '2');\n foreach ($this->points as $point) {\n if(is_null($point->value)){\n $last_x = $point->x;\n $last_y = $point->y;\n $last_val = $point->value;\n continue;\n }\n\n if(isset($last_x) && (isset($last_val) && !is_null($last_val))){\n //add axis line\n imageline($this->im, $last_x, $last_y, $point->x, $point->y, $this->ink['line']);\n }\n $last_val = $point->value;\n $last_x = $point->x;\n $last_y = $point->y;\n }\n }",
"public function dashline2($points)\r\n {\r\n// imagedashedline($this->imgHandler, 483.98522628062, 746.5, 437.5, 573.01477371938, $this->color);\r\n// imagedashedline($this->imgHandler, 437.5, 573.01477371938, 483.98522628062, 619.5, $this->color);\r\n// $this->set_color(255, 255, 255, 0);\r\n $length1 = 15;\r\n $length2 = 5;\r\n $w = imagecolorclosestalpha($this->imgHandler, 254, 208, 50, 0);\r\n $red = imagecolorclosestalpha($this->imgHandler, 255, 0, 0, 0);\r\n\r\n $style = array_merge(array_fill(0, $length1, $red), array_fill(0, $length2, $w));\r\n\r\n imagesetthickness($this->imgHandler, 3);\r\n imagesetstyle ($this->imgHandler, $style);\r\n\r\n for ($i = 0; $i < count($points); $i ++) {\r\n $p1 = $points[$i];\r\n $p2 = $points[($i+1)%count($points)];\r\n imageline($this->imgHandler, $p1['x'], $p1['y'], $p2['x'], $p2['y'], IMG_COLOR_STYLED);\r\n// for ($ii = 0; $ii < $thickness; $ii ++) {\r\n// imageline($this->imgHandler, $p1['x'], $p1['y'] + (1 + $ii), $p2['x'], $p2['y'] + (1 + $ii), IMG_COLOR_STYLED);\r\n// imageline($this->imgHandler, $p1['x'], $p1['y'] - (1 - $ii), $p2['x'], $p2['y'] - (1 - $ii), IMG_COLOR_STYLED);\r\n// }\r\n }\r\n }",
"private function plotData() : void\n\t{\n\t\t$n = $this->getSize();\n\t\tif($n === -1) {\n\t\t\texit();\n\t\t}\n\n\t\tfor ($i=0; $i < $n; $i++) { \n\t\t\timagefilledellipse($this->im, $this->xValues[$i]*$this->scaleX+$this->shiftX, $this->yValues[$i]*$this->scaleY*(-1)+$this->shiftY, 10, 10, $this->colorPoints);\n\t\t}\n\n\t}",
"protected function _drawLines()\n {\n \tfor ($line = 0; $line < $this->num_lines; ++ $line) {\n \t\t$x = $this->image_width * (1 + $line) / ($this->num_lines + 1);\n \t\t$x += (0.5 - $this->_frand()) * $this->image_width / $this->num_lines;\n \t\t$y = mt_rand($this->image_height * 0.1, $this->image_height * 0.9);\n \n \t\t$theta = ($this->_frand() - 0.5) * M_PI * 0.7;\n \t\t$w = $this->image_width;\n \t\t$len = mt_rand($w * 0.4, $w * 0.7);\n \t\t$lwid = mt_rand(0, 2);\n \n \t\t$k = $this->_frand() * 0.6 + 0.2;\n \t\t$k = $k * $k * 0.5;\n \t\t$phi = $this->_frand() * 6.28;\n \t\t$step = 0.5;\n \t\t$dx = $step * cos($theta);\n \t\t$dy = $step * sin($theta);\n \t\t$n = $len / $step;\n \t\t$amp = 1.5 * $this->_frand() / ($k + 5.0 / $len);\n \t\t$x0 = $x - 0.5 * $len * cos($theta);\n \t\t$y0 = $y - 0.5 * $len * sin($theta);\n \n \t\t$ldx = round(- $dy * $lwid);\n \t\t$ldy = round($dx * $lwid);\n \n \t\tfor ($i = 0; $i < $n; ++ $i) {\n \t\t\t$x = $x0 + $i * $dx + $amp * $dy * sin($k * $i * $step + $phi);\n \t\t\t$y = $y0 + $i * $dy - $amp * $dx * sin($k * $i * $step + $phi);\n \t\t\timagefilledrectangle($this->im, $x, $y, $x + $lwid, $y + $lwid, $this->gdlinecolor);\n \t\t}\n \t}\n }",
"private function createLine() {\n // Lines\n for ($i=0;$i<6;$i++) {\n $color = imagecolorallocate($this->img,mt_rand(0,156),mt_rand(0,156),mt_rand(0,156));\n imageline($this->img,mt_rand(0,$this->width),mt_rand(0,$this->height),mt_rand(0,$this->width),mt_rand(0,$this->height),$color);\n }\n // Snowflakes\n for ($i=0;$i<100;$i++) {\n $color = imagecolorallocate($this->img,mt_rand(200,255),mt_rand(200,255),mt_rand(200,255));\n imagestring($this->img,mt_rand(1,5),mt_rand(0,$this->width),mt_rand(0,$this->height),'*',$color);\n }\n }",
"private function _drawThickLine($img, $startX, $startY, $endX, $endY, $colour, $thickness) {\r\n $angle = (atan2(($startY - $endY), ($endX - $startX)));\r\n\r\n $dist_x = $thickness * (sin($angle));\r\n $dist_y = $thickness * (cos($angle));\r\n\r\n $p1x = ceil(($startX + $dist_x));\r\n $p1y = ceil(($startY + $dist_y));\r\n $p2x = ceil(($endX + $dist_x));\r\n $p2y = ceil(($endY + $dist_y));\r\n $p3x = ceil(($endX - $dist_x));\r\n $p3y = ceil(($endY - $dist_y));\r\n $p4x = ceil(($startX - $dist_x));\r\n $p4y = ceil(($startY - $dist_y));\r\n\r\n $array = array(0=>$p1x, $p1y, $p2x, $p2y, $p3x, $p3y, $p4x, $p4y);\r\n imagefilledpolygon($img, $array, (count($array)/2), $colour);\r\n }",
"function drawXAxe()\r\n {\r\n // draw lines\r\n $startPos = $this->posXStart;\r\n $step = round(( ($this->posXEnd - $this->posXStart) / $this->countData), 2);\r\n for($i=0; $i<=$this->countData; $i++) \r\n {\r\n ImageLine($this->img, $startPos, $this->posYEnd-5, $startPos, $this->posYEnd+5, $this->colorLines);\r\n \r\n $startPos += $step;\r\n }\r\n \r\n // draw numbers\r\n $startPos = $this->posXStart;\r\n foreach($this->data as $key => $value)\r\n {\r\n if($this->textXOrientation == 'horizontal')\r\n ImageString($this->img, 1, $startPos+((($this->posXEnd-$this->posXStart)/$this->countData)/2)-5, $this->posYEnd+11, $key, $this->colorText);\r\n else\r\n ImageStringUp($this->img, 2, $startPos+((($this->posXEnd-$this->posXStart)/$this->countData)/2)-5, $this->posYEnd+5+strlen($key)*6, $key, $this->colorText);\r\n\r\n $startPos += $step;\r\n }\r\n }",
"function drawLines()\n\t{\n\t\tfor ($line = 0; $line < $this->num_lines; ++$line) {\n\t\t\t$x = $this->image_width * (1 + $line) / ($this->num_lines + 1);\n\t\t\t$x += (0.5 - $this->frand()) * $this->image_width / $this->num_lines;\n\t\t\t$y = rand($this->image_height * 0.1, $this->image_height * 0.9);\n\t\t\t \n\t\t\t$theta = ($this->frand()-0.5) * M_PI * 0.7;\n\t\t\t$w = $this->image_width;\n\t\t\t$len = rand($w * 0.4, $w * 0.7);\n\t\t\t$lwid = rand(0, 2);\n\t\t\t \n\t\t\t$k = $this->frand() * 0.6 + 0.2;\n\t\t\t$k = $k * $k * 0.5;\n\t\t\t$phi = $this->frand() * 6.28;\n\t\t\t$step = 0.5;\n\t\t\t$dx = $step * cos($theta);\n\t\t\t$dy = $step * sin($theta);\n\t\t\t$n = $len / $step;\n\t\t\t$amp = 1.5 * $this->frand() / ($k + 5.0 / $len);\n\t\t\t$x0 = $x - 0.5 * $len * cos($theta);\n\t\t\t$y0 = $y - 0.5 * $len * sin($theta);\n\t\t\t \n\t\t\t$ldx = round(-$dy * $lwid);\n\t\t\t$ldy = round($dx * $lwid);\n\t\t\t \n\t\t\tfor ($i = 0; $i < $n; ++$i) {\n\t\t\t\t$x = $x0 + $i * $dx + $amp * $dy * sin($k * $i * $step + $phi);\n\t\t\t\t$y = $y0 + $i * $dy - $amp * $dx * sin($k * $i * $step + $phi);\n\t\t\t\timagefilledrectangle($this->im, $x, $y, $x + $lwid, $y + $lwid, $this->gdlinecolor);\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the setAdresseSiteClient() method. | public function testSetAdresseSiteClient() {
$obj = new Clients();
$obj->setAdresseSiteClient("adresseSiteClient");
$this->assertEquals("adresseSiteClient", $obj->getAdresseSiteClient());
} | [
"public function testSetAdresseSiteClient() {\n\n $obj = new Intervenants();\n\n $obj->setAdresseSiteClient(\"adresseSiteClient\");\n $this->assertEquals(\"adresseSiteClient\", $obj->getAdresseSiteClient());\n }",
"abstract protected function setClient();",
"public function testSetCodeClient() {\n\n $obj = new SuiviClient();\n\n $obj->setCodeClient(\"codeClient\");\n $this->assertEquals(\"codeClient\", $obj->getCodeClient());\n }",
"public function testGetSetClient()\n\t{\n\t\t$client = new \\stdClass();\n\t\t$client->test = 'foo';\n\n\t\t$this->request->setClient($client);\n\t\t$this->assertEquals(\n\t\t\t$this->request->getClient(),\n\t\t\t$client\n\t\t);\n\t}",
"public function testSetCodeClient() {\n\n $obj = new AppelsEnCours();\n\n $obj->setCodeClient(\"codeClient\");\n $this->assertEquals(\"codeClient\", $obj->getCodeClient());\n }",
"public function testSetCodeClient() {\n\n $obj = new Forfaits();\n\n $obj->setCodeClient(\"codeClient\");\n $this->assertEquals(\"codeClient\", $obj->getCodeClient());\n }",
"public function testSetPrioriteSaisieClient() {\n\n $obj = new Constantes();\n\n $obj->setPrioriteSaisieClient(10);\n $this->assertEquals(10, $obj->getPrioriteSaisieClient());\n }",
"protected function setUpFakeSitePathAndHost() {}",
"public function testClientCanBeSet()\n {\n $client = new Client();\n $this->twitter->setClient($client);\n $this->assertInstanceOf('\\GuzzleHttp\\Client', $client);\n }",
"public function testSetClient()\n {\n $change = new Change($this->p4);\n $change->setDescription('test')->save();\n $oldClient = $change->getClient();\n\n $this->p4->getService('clients')->grab();\n $change->setClient($this->p4->getClient());\n $change->save();\n $this->p4->getService('clients')->release();\n\n $this->assertFalse(\n $oldClient == Change::fetch($change->getId(), $this->p4)->getClient(),\n 'expected client change to have saved.'\n );\n }",
"public function setClient(Client &$client);",
"public function testSetUrlHost()\n {\n $client = Client::make('http://localhost:9998');\n\n $this->assertEquals('localhost', $client->getHost());\n }",
"public function testGetSite()\n {\n $out = $this->model->getSite();\n $this->assertEquals($this->site, $out);\n }",
"public function setUpClient()\n {\n $baseUrl = self::$fn->getLocalBaseUrl();\n $this->client = new Client([\n 'base_uri' => $baseUrl,\n 'http_errors' => false\n ]);\n }",
"public function testCreateSite()\n {\n }",
"public function testIsSite()\n\t{\n\t\t$this->assertFalse($this->class->isSite());\n\t}",
"public function setClient($client);",
"public function testSetAdresseIp() {\n\n $obj = new iSessions();\n\n $obj->setAdresseIp(\"adresseIp\");\n $this->assertEquals(\"adresseIp\", $obj->getAdresseIp());\n }",
"public function testSetUrlHost(): void\n {\n $client = Client::make('http://localhost:9998');\n\n $this->assertEquals('localhost', $client->getHost());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hooks on content display to add Packlink shipping content. | public function hookDisplayAdminOrderContentShip()
{
\Packlink\PrestaShop\Classes\Bootstrap::init();
if (!$this->moduleFullyConfigured()) {
return '';
}
\Packlink\PrestaShop\Classes\Utility\AdminShippingTabDataProvider::prepareShippingTabData(
$this->context,
$this,
Tools::getValue('id_order')
);
return $this->context->smarty->createTemplate(
$this->getLocalPath() . self::PACKLINK_SHIPPING_CONTENT,
$this->context->smarty
)->fetch();
} | [
"function storms_wc_shipping_calculator_in_product_add_shortcode( $atts, $content = '' ) {\n\t\tif( !is_product() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif( 'shortcode' !== get_option('wscip_position') ) {\n\t\t\treturn;\n\t\t}\n\n\t\tob_start();\n\t\tstorms_wc_shipping_calculator_in_product_load_html();\n\t\treturn ob_get_clean();\n\t}",
"public function add_link_to_content( $content ) {\n\n\t\t\tif ( ! $this->processed_listing_id ) {\n\t\t\t\treturn $content;\n\t\t\t}\n\n\t\t\t$document = Elementor\\Plugin::$instance->documents->get_doc_for_frontend( $this->processed_listing_id );\n\n\t\t\tif ( ! $document ) {\n\t\t\t\treturn $content;\n\t\t\t}\n\n\t\t\t$settings = $document->get_settings();\n\n\t\t\tif ( empty( $settings ) || empty( $settings['listing_link'] ) ) {\n\t\t\t\treturn $content;\n\t\t\t}\n\n\t\t\t$url = apply_filters(\n\t\t\t\t'jet-engine/elementor-views/frontend/custom-listing-url',\n\t\t\t\tfalse,\n\t\t\t\t$settings\n\t\t\t);\n\n\t\t\tif ( ! $url ) {\n\t\t\t\t$source = ! empty( $settings['listing_link_source'] ) ? $settings['listing_link_source'] : '_permalink';\n\n\t\t\t\tif ( '_permalink' === $source ) {\n\t\t\t\t\t$url = jet_engine()->listings->data->get_current_object_permalink();\n\t\t\t\t} elseif ( 'open_map_listing_popup' === $source ) {\n\t\t\t\t\t$url = jet_engine()->modules->get_module( 'maps-listings' )->instance->get_action_url();\n\t\t\t\t} elseif ( 'open_map_listing_popup_hover' === $source ) {\n\t\t\t\t\t$url = jet_engine()->modules->get_module( 'maps-listings' )->instance->get_action_url( null, 'hover' );\n\t\t\t\t} elseif ( 'options_page' === $source ) {\n\t\t\t\t\t$option = ! empty( $settings['listing_link_option'] ) ? $settings['listing_link_option'] : false;\n\t\t\t\t\t$url = jet_engine()->listings->data->get_option( $option );\n\t\t\t\t} elseif ( $source ) {\n\t\t\t\t\t$url = jet_engine()->listings->data->get_meta( $source );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$prefix = isset( $settings['listing_link_prefix'] ) ? $settings['listing_link_prefix'] : '';\n\n\t\t\tif ( $prefix ) {\n\t\t\t\t$url = $prefix . $url;\n\t\t\t}\n\n\t\t\t$overlay_attrs = array(\n\t\t\t\t'class' => 'jet-engine-listing-overlay-wrap',\n\t\t\t\t'data-url' => $url,\n\t\t\t);\n\n\t\t\t$link_attrs = array(\n\t\t\t\t'href' => $url,\n\t\t\t\t'class' => 'jet-engine-listing-overlay-link',\n\t\t\t);\n\n\t\t\t$open_in_new = isset( $settings['listing_link_open_in_new'] ) ? $settings['listing_link_open_in_new'] : '';\n\t\t\t$rel_attr = isset( $settings['listing_link_rel_attr'] ) ? $settings['listing_link_rel_attr'] : '';\n\n\t\t\tif ( $open_in_new ) {\n\t\t\t\t$overlay_attrs['data-target'] = '_blank';\n\t\t\t\t$link_attrs['target'] = '_blank';\n\t\t\t}\n\n\t\t\tif ( $rel_attr ) {\n\t\t\t\t$link_attrs['rel'] = $rel_attr;\n\t\t\t}\n\n\t\t\t$link = sprintf( '<a %s></a>', Jet_Engine_Tools::get_attr_string( $link_attrs ) );\n\n\t\t\treturn sprintf(\n\t\t\t\t'<div %3$s>%1$s%2$s</div>',\n\t\t\t\t$content,\n\t\t\t\t$link,\n\t\t\t\tJet_Engine_Tools::get_attr_string( $overlay_attrs )\n\t\t\t);\n\t\t}",
"public function populate_packlink_column( $column, $data ) {\n\t\t$id = class_exists( OrderUtil::class ) && OrderUtil::custom_orders_table_usage_is_enabled() ?\n\t\t\t$data->id : $data;\n\n\t\t$shipment_details = $this->get_order_shipment_details_service()->getDetailsByOrderId( (string) $id );\n\n\t\tif ( null !== $shipment_details ) {\n\t\t\tif ( static::COLUMN_ID === $column ) {\n\t\t\t\t/** @var OrderService $order_service */\n\t\t\t\t$order_service = ServiceRegister::getService( OrderService::CLASS_NAME );\n\t\t\t\t$labels = $shipment_details->getShipmentLabels();\n\n\t\t\t\tif ( ! $order_service->isReadyToFetchShipmentLabels( $shipment_details->getShippingStatus() ) ) {\n\t\t\t\t\techo esc_html( __( 'Label is not yet available.', 'packlink-pro-shipping' ) );\n\t\t\t\t} else {\n\t\t\t\t\t$is_printed = false;\n\n\t\t\t\t\tif ( empty( $labels ) ) {\n\t\t\t\t\t\t$params = array(\n\t\t\t\t\t\t\t'order_id' => $id,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$label_url = Shop_Helper::get_controller_url( 'Order_Overview', 'print_single_label', $params );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( $labels[0]->isPrinted() ) {\n\t\t\t\t\t\t\t$is_printed = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$label_url = $labels[0]->getLink();\n\t\t\t\t\t}\n\n\t\t\t\t\t$class = 'pl-print-label button ' . ( $is_printed ? '' : 'button-primary' );\n\t\t\t\t\t$label = $is_printed\n\t\t\t\t\t\t? __( 'Printed label', 'packlink-pro-shipping' )\n\t\t\t\t\t\t: __( 'Print label', 'packlink-pro-shipping' );\n\n\t\t\t\t\techo '<button data-pl-id=\"' . esc_attr( $id ) . '\" data-pl-label=\"' . esc_url( $label_url )\n\t\t\t\t\t . '\" type=\"button\" class=\"' . esc_attr( $class ) . '\" >' . esc_html( $label ) . '</button>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tstatic::COLUMN_PACKLINK_ID === $column &&\n\t\t\t! empty( $this->get_config_service()->getAuthorizationToken() )\n\t\t) {\n\t\t\tglobal $post;\n\t\t\t$post_data = class_exists( OrderUtil::class ) && OrderUtil::custom_orders_table_usage_is_enabled() ?\n\t\t\t\t$data : $post;\n\n\t\t\techo $this->get_packlink_shipping_button( $post_data );\n\t\t}\n\t}",
"function ShowContent()\n {\n $name = stripslashes($this->page_txt['pname']);\n\n ?><div class=\"subBody\"><?\n //if( !$this->IsPublish($this->page) AND !$this->preview ){\n if( $this->treePageData[$this->page]['publish']!=1 AND !$this->preview ){\n echo $this->multi['_MSG_CONTENT_NOT_PUBLISH'];\n }\n else{\n $body = stripslashes($this->page_txt['content']);\n echo $body;\n }\n $this->ShowUploadFileList($this->page);\n $this->ShowUploadImagesList($this->page);\n\n if( $this->is_tags==1 ){\n $Tags = new FrontTags();\n if( count($Tags->GetSimilarItems($this->module, $this->page))>0){\n ?><div><?\n ?><br/><?=$this->multi['TXT_THEMATIC_LINKS'];?>:<br/><?\n $Tags->ShowSimilarItems($this->module, $this->page);\n ?></div><?\n }\n }\n if($this->is_comments==1){\n $this->Comments = new CommentsLayout($this->module, $this->page);\n $this->Comments->ShowComments();\n \n ?>\n\n <!-- AddThis Button BEGIN -->\n <div class=\"addthis_toolbox addthis_default_style\">\n <a href=\"http://addthis.com/bookmark.php?v=250&username=xa-4c559bfc5d7d23e8\" class=\"addthis_button_compact\">Share</a>\n <span class=\"addthis_separator\">|</span>\n <a class=\"addthis_button_facebook\"></a>\n <a class=\"addthis_button_myspace\"></a>\n <a class=\"addthis_button_google\"></a>\n <a class=\"addthis_button_twitter\"></a>\n </div>\n <script type=\"text/javascript\" src=\"http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4c559bfc5d7d23e8\"></script>\n <!-- AddThis Button END -->\n <?}?>\n </div>\n <?\n }",
"function viewPackingSlip() {\n\t\trequire_once 'html2fpdf/html2fpdf.php';\n\t\t$order = new order(getRequest('orderID'));\n\t\tif ($order->exists()) {\n\t\t\t$shippingAddress = new address($order->get('shippingID'));\n\t\t\t$shippingMethod = new shippingOption($order->get('shippingArrangement'));\n\t\t\t$template = new template;\n\t\t\t$template->assignClean('order', $order->fetchArray());\n\t\t\t$template->assignClean('subOrder', array('subOrderID' => false));\n\t\t\t$template->assignClean('shippingMethod', $shippingMethod->get('name'));\n\t\t\t$template->assignClean('shippingAddress', $shippingAddress->fetchArray());\n\t\t\t$template->assign('items', ordersController::getOrderItems($order->get('orderID')));\n\t\t\tob_end_clean();\n\t\t\tob_start();\n\t\t\t$template->display('site/packingSlip.htm');\n\t\t\t$html = ob_get_contents();\n\t\t\tob_end_clean();\n\t\t\t$html2pdf = new HTML2FPDF();\n\t\t\t$html2pdf->AddPage();\n\t\t\t$html2pdf->WriteHTML($html);\n\t\t\t$html2pdf->Output('doc.pdf', 'I');\n\t\t} else {\n\t\t\taddError('The sub order was not found');\n\t\t\tsubOrdersAdmin();\n\t\t}\n\t}",
"public function add_layer() {\n\t\tENDA_Woocommerce_Bundle_Shipping::display_layer();\n\t\texit();\n\t}",
"function bn_add_garage_sale_data_to_content( $content ) {\n\tif ( is_admin() ) return $content;\n\tif ( get_post_type() != 'garage_sale' ) return $content;\n\t\n\t$post_id = get_the_ID();\n\t\n\t$fields = array(\n\t\t'address' => bn_get_location_street_address( $post_id ), // Used as title\n\t\t'full_address' => bn_get_location_address( $post_id ), // Used for map\n\t\t'latlng' => bn_get_location_latlng( $post_id ), // Used for map\n\t\t'start_date' => get_field( 'start_date', $post_id ),\n\t\t'end_date' => get_field( 'end_date', $post_id ),\n\t\t'description' => get_field( 'description', $post_id ),\n\t\t'featured_image' => get_field( 'featured_image', $post_id, false ),\n\t\t'photo_gallery' => get_field( 'photo_gallery', $post_id ),\n\t);\n\t\n\tob_start();\n\t?>\n\t\n\t<?php\n\t// --------------\n\t// Address\n\tif ( $fields['address'] ) {\n\t\t?>\n\t\t<h1><?php echo esc_html($fields['address']); ?></h1>\n\t\t<?php\n\t}\n\t?>\n\t\n\t\n\t\n\t<?php\n\t// ---------------\n\t// Featured Image\n\tif ( $fields['featured_image'] && get_post_type( $fields['featured_image'] ) == 'attachment' ) {\n\t\t$full_size = wp_get_attachment_image_src( $fields['featured_image'], 'full' );\n\t\t\n\t\techo '<p>';\n\t\techo '<a href=\"'. esc_attr($full_size[0]) . '\" target=\"_blank\" title=\"View full image\">';\n\t\techo wp_get_attachment_image( $fields['featured_image'], 'medium' );\n\t\techo '</a>';\n\t\techo '</p>';\n\t\t\n\t\t$fields['photo_gallery'] = array_filter( $fields['photo_gallery'] );\n\t\t\n\t\tif ( count($fields['photo_gallery']) > 1 ) {\n\t\t\techo '<p><em>More pictures available at the bottom of the page.</em></p>';\n\t\t}\n\t}\n\t?>\n\t\n\t<?php\n\t// --------------\n\t// Garage sale Dates\n\techo '<p>';\n\tif ( $fields['start_date'][0]['date'] && $fields['start_date'][0]['time'] ) echo '<strong>Starts:</strong> ', esc_html($fields['start_date'][0]['date'] . ' at ' . $fields['start_date'][0]['time']) . '<br>';\n\tif ( $fields['end_date'][0]['date'] && $fields['end_date'][0]['time'] ) echo '<strong>Ends:</strong> ', esc_html($fields['end_date'][0]['date'] . ' at ' . $fields['end_date'][0]['time']) . '<br>';\n\techo '<strong>Posted on:</strong> ', date( 'M jS, Y \\a\\t g:ia', get_the_date('U') );\n\techo '</p>';\n\t?>\n\t\n\t<?php\n\t// ---------------\n\t// Description\n\tif ( $fields['description'] ) {\n\t\techo wpautop($fields['description']);\n\t}\n\t?>\n\t\n\t<?php\n\t// ---------------\n\t// Google Map Location\n\tif ( $fields['full_address'] && $fields['latlng'] ) {\n\t\techo bn_generate_map( $fields['full_address'], $fields['latlng'][0], $fields['latlng'][1] );\n\t}\n\t?>\n\t\n\t<?php\n\t// ---------------\n\t// Photo gallery\n\tif ( count($fields['photo_gallery']) > 1 ) {\n\t\techo '<p>';\n\t\t\n\t\tforeach( $fields['photo_gallery'] as $i ) {\n\t\t\t$image_id = !empty($i['image']) ? $i['image'] : false;\n\t\t\tif ( !$image_id ) continue;\n\t\t\tif ( get_post_type($image_id) != 'attachment' ) continue;\n\t\t\t\n\t\t\t$full_size = wp_get_attachment_image_src( $image_id, 'full' );\n\t\t\tif ( !$full_size ) continue;\n\t\t\t\n\t\t\techo '<a href=\"'. esc_attr($full_size[0]) . '\" target=\"_blank\" title=\"View full image\">';\n\t\t\techo wp_get_attachment_image( $image_id, 'medium' );\n\t\t\techo '</a>';\n\t\t}\n\t\t\n\t\techo '</p>';\n\t}\n\t?>\n\t\n\t<?php\n\t$content = ob_get_clean();\n\t\n\treturn $content;\n}",
"public function core_notify_Display_ad_display_classified_after_vars_set($vars)\n {\n //NOTE: This done for backwards compatibility only, the link is now\n //displayed by listing tag\n $listing = geoListing::getListing($vars['id']);\n\n if ($listing && ($this->userHasCurrentSubscription($listing->seller) > 0)) {\n $db = DataAccess::getInstance();\n\n $view = geoView::getInstance();\n $msgs = geoAddon::getText($this->auth_tag, $this->name);\n $view->storefront_link = \"<a href=\\\"\" . $db->get_site_setting('classifieds_file_name') . \"?a=ap&addon=storefront&page=home&store=\" . $listing->seller . \"\\\" class=\\\"notify_seller_link\\\">\" . $msgs['listing_storefront_link'] . \"</a>\";\n }\n }",
"public function hookDisplayCarrierExtraContent($params)\n {\n global $language;\n\n\n\t\t$id_carrier = $params['carrier']['id'];\n\n\t\t$carrierCountries = [];\n\t\tforeach (Packeteryclass::getCarriersList() as $carrier)\n\t\t{\n\t\t\t$carrierCountries[$carrier['id_carrier']] = $carrier['country'];\n\t\t}\n\t\t$carrierCountriesJson = json_encode($carrierCountries);\n\n\t\t$this->context->smarty->assign('widget_carrier', $id_carrier);\n\t\t/*FIELDS FOR AJAX*/\n\t\t$ajaxfields = array(\n\t\t\t'zip' => $this->l('ZIP'),\n\t\t\t'moredetails' => $this->l('More details'),\n\t\t\t'max_weight' => $this->l('Max weight'),\n\t\t\t'dressing_room' => $this->l('Dressing room'),\n\t\t\t'packet_consignment' => $this->l('Packet consignment'),\n\t\t\t'claim_assistant' => $this->l('Claim assistant'),\n\t\t\t'yes' => $this->l('Yes'),\n\t\t\t'no' => $this->l('No'),\n\t\t\t'please_choose' => $this->l('please choose'),\n\t\t\t'please_choose_branch' => $this->l('Please choose delivery branch')\n\t\t\t);\n\t\t$ajaxfields_json = json_encode($ajaxfields);\n\n\t\t$name_branch = \"\";\n\t\t$currency_branch = \"\";\n\t\t$id_branch = \"\";\n\t\tif(!empty($params['cart']))\n\t\t{\n\t\t\t$row = Db::getInstance()->getRow('SELECT * FROM ' . _DB_PREFIX_ . 'packetery_order WHERE id_cart =' . (int)$params['cart']->id . ' AND id_carrier = ' . (int)$id_carrier);\n\t\t\tif (!empty($row['id_branch']))\n\t\t\t{\n\t\t\t\t$id_branch = $row['id_branch'];\n\t\t\t}\n\t\t\tif (!empty($row['name_branch']))\n\t\t\t{\n\t\t\t\t$name_branch = $row['name_branch'];\n\t\t\t}\n\t\t\tif (!empty($row['currency_branch']))\n\t\t\t{\n\t\t\t\t$currency_branch = $row['currency_branch'];\n\t\t\t}\n\t\t}\n\n\t\tif(isset($params['cart']->id_address_delivery) && !empty($params['cart']->id_address_delivery))\n\t\t{\n\t\t\t$address = new AddressCore($params['cart']->id_address_delivery);\n\n\t\t\t$countryObj = new CountryCore($address->id_country);\n\t\t\t$this->context->smarty->assign('customer_country', strtolower($countryObj->iso_code));\n\t\t}\n\n\t\t$this->context->smarty->assign('module_version', $this->version);\n\t\t$this->context->smarty->assign('allowed_countries', json_encode($this->limited_countries));\n\t\t$this->context->smarty->assign('carrier_countries', $carrierCountriesJson);\n\t\t$this->context->smarty->assign('id_branch', $id_branch);\n\t\t$this->context->smarty->assign('name_branch', $name_branch);\n\t\t$this->context->smarty->assign('currency_branch', $currency_branch);\n\n\t\t$this->context->smarty->assign('ajaxfields', $ajaxfields_json);\n\n\t\t$this->context->smarty->assign('force_country', Packeteryclass::getConfigValueByOption('FORCE_COUNTRY'));\n\t\t$this->context->smarty->assign('force_language', Packeteryclass::getConfigValueByOption('FORCE_LANGUAGE'));\n\n\t\t$base_uri = __PS_BASE_URI__ == '/'?'':Tools::substr(__PS_BASE_URI__, 0, Tools::strlen(__PS_BASE_URI__) - 1);\n\t\t$this->context->smarty->assign('baseuri', $base_uri);\n\t\t$countries = $this->getCountriesList($id_carrier);\n\t\t$this->context->smarty->assign('countries', $countries);\n\t\t$countries_count = count($countries);\n\t\t$this->context->smarty->assign('countries_count', $countries_count);\n\t\t$this->context->smarty->assign('packeta_api_key', PacketeryApi::getApiKey());\n\t\t$this->context->smarty->assign('language', (array)$language);\n\t\t/*END FIELDS FOR AJAX*/\n\n\t\t$output = $this->context->smarty->fetch($this->local_path.'views/templates/front/widget.tpl');\n\t\treturn $output;\n }",
"function add_display_content($display_content)\r\n {\r\n\r\n // number_of_cards-1 is the index of the current card, i.e. the last card\r\n\r\n if ($this->card[$this->number_of_cards-1][\"type\"] == HAW_HDML_DISPLAY)\r\n {\r\n // current card is display card ==> continue with content\r\n\r\n if (isset($this->card[$this->number_of_cards-1][\"display_content\"]))\r\n $this->card[$this->number_of_cards-1][\"display_content\"] .= $display_content;\r\n else\r\n $this->card[$this->number_of_cards-1][\"display_content\"] = $display_content;\r\n }\r\n else\r\n {\r\n // current card is entry or choice card\r\n // ==> create new display card to display received content\r\n // ==> link current card to this new display card\r\n\r\n $this->card[$this->number_of_cards][\"type\"] = HAW_HDML_DISPLAY;\r\n\r\n $cardname = sprintf(\" name=\\\"%d\\\"\", $this->number_of_cards+1);\r\n $this->card[$this->number_of_cards][\"options\"] .= $cardname;\r\n\r\n if ($this->title)\r\n $this->card[$this->number_of_cards][\"options\"] .= \" title=\\\"$this->title\\\"\";\r\n\r\n $this->card[$this->number_of_cards][\"display_content\"] = $display_content;\r\n\r\n $action = sprintf(\"<action type=\\\"accept\\\" task=\\\"go\\\" dest=\\\"#%d\\\">\\n\",\r\n $this->number_of_cards+1);\r\n $this->card[$this->number_of_cards-1][\"action\"] = $action;\r\n\r\n $this->number_of_cards++;\r\n }\r\n }",
"public function appendPackingstationToShipping($observer)\n {\n $block = $observer->getBlock();\n if ($block instanceof Mage_Checkout_Block_Onepage_Shipping\n && false == $block instanceof Mage_Paypal_Block_Express_Review_Shipping\n && Mage::getModel('intraship/config')->isEnabled()\n && Mage::getModel('dhlaccount/config')->isPackstationEnabled($block->getQuote()->getStoreId())\n ) {\n $transport = $observer->getTransport();\n $layout = $block->getLayout();\n $html = $transport->getHtml();\n $parcelAnnouncementHtml = $layout->createBlock(\n 'dhlaccount/checkout_onepage_packingstation', 'onepage_packingstation')\n ->setTemplate('account/checkout/onepage/packingstation.phtml')\n ->renderView();\n $html = $html . $parcelAnnouncementHtml;\n $transport->setHtml($html);\n }\n }",
"public static function enable_packlink_shipping_methods() {\n\t\tstatic::change_shipping_methods_status();\n\t}",
"public function core_notify_Display_ad_display_classified_after_vars_set ($vars)\n\t{\n\t\t//NOTE: This done for backwards compatibility only, the link is now\n\t\t//displayed by listing tag\n\t\t$listing = geoListing::getListing($vars['id']);\n\t\t\n\t\tif ($listing && $this->userHasCurrentSubscription($listing->seller)) { \n\t\t\t$db = DataAccess::getInstance();\n\t\t\n\t\t\t$view = geoView::getInstance();\n\t\t\t$msgs = $db->get_text(true);\n\t\t\t$view->storefront_link = \"<a href=\\\"\".$db->get_site_setting('classifieds_file_name').\"?a=ap&addon=storefront&page=home&store=\".$listing->seller.\"\\\" class=\\\"notify_seller_link\\\">\".$msgs[500005].\"</a>\";\n\t\t}\n\t}",
"function showContent()\n {\n $this->showGroupNotices();\n }",
"function argmcAddStepsContent($step) {\n\n\t//First Step Content\n\tif ($step == 'step_livraison') {\n\n\t\twc_cart_totals_shipping_html();\n\n\t}\n\n\n\n}",
"abstract protected function displayContent();",
"function sp_woo_checkout_additional_info() {\n\t// get saved settings\n\t$show_additional_info = sp_get_option( 'show_checkout_additional_info' );\n\t$additional_info_text = sp_get_option( 'checkout_text_info' );\n\t$links = sp_get_option( 'checkout_add_links' ); // array\n\n\t// if off or not set bail\n\tif ( $show_additional_info === 'off' || ! isset( $show_additional_info ) )\n\t\treturn;\n\n\t$output = '';\n\n\t$output .= '<div class=\"checkout-additional-info row\">' . PHP_EOL;\n\t\n\t$output .= '<div class=\"' . sp_column_css( '12', '', '', '6' ) . '\">' . PHP_EOL;\n\n\tif ( isset( $additional_info_text ) && ! empty( $additional_info_text ) ) {\n\t\t\n\t\t$output .= $additional_info_text;\n\t\t\n\t}\n\t\n\t$output .= '</div><!--close .column-->' . PHP_EOL;\n\n\tif ( is_array( $links ) && $links ) {\n\t\t$i = 0;\n\n\t\t$output .= '<div class=\"clearfix links-column ' . sp_column_css( '12', '', '', '6' ) . '\">' . PHP_EOL;\n\t\t$output .= '<ul class=\"clearfix\">' . PHP_EOL;\n\n\t\tforeach( $links['link_name'] as $link ) {\n\t\t\t$output .= '<li class=\"info-link\">' . PHP_EOL;\n\t\t\t$output .= '<a href=\"#content-info-' . esc_attr( $i ) . '\" title=\"' . esc_attr( stripslashes( stripslashes( $link ) ) ) . '\" class=\"mfp-link\">' . stripslashes( stripslashes( $link ) ) . '</a>' . PHP_EOL;\n\t\t\t$output .= '<div class=\"content\" id=\"content-info-' . esc_attr( $i ) . '\">' . PHP_EOL;\n\t\t\t$output .= do_shortcode( stripslashes( stripslashes( wpautop( $links['link_content'][ $i ] ) ) ) ) . PHP_EOL;\n\t\t\t$output .= '</div><!--close .content-->' . PHP_EOL;\n\t\t\t$output .= '</li>' . PHP_EOL;\n\n\t\t\t$i++;\n\t\t}\n\n\t\t$output .= '</ul>' . PHP_EOL;\n\t\t$output .= '</div><!--close .column-->' . PHP_EOL;\n\t}\n\n\t$output .= '</div><!--close .checkout-additional-info-->' . PHP_EOL;\n\n\techo $output;\n}",
"function tamzang_user_shop_screen()\n{\n add_action( 'bp_template_content', 'tamzang_user_shop_screen_content' );\n bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));\n}",
"public function delivery()\n\t{\n\t\t$data['active_page'] = 'delivery';\n\t\t$data['cart_items_count'] = $this->m_cart->get_cart_count();\n\t\t$data['settings'] = $this->m_settings->get_all();\n\t\t$this->load->view('frontend/templates/header', $data);\n\t\t$this->load->view('frontend/templates/main_top_bg');\n\t\t$this->load->view('frontend/pages/boss/delivery', $data);\n\t\t$this->load->view('frontend/templates/footer', $data);\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test to see if getting one state fails | public function testGetOneStateFail() {
$query = $this->createMock('mockQuery');
$query->method('fetch')->willReturn(false);
$this->db->method('query')->willReturn($query);
$env = Environment::mock([
'REQUEST_METHOD' => 'GET',
'REQUEST_URI' => '/state/1',
]);
$req = Request::createFromEnvironment($env);
$this->app->getContainer()['request'] = $req;
// actually run the request through the app.
$response = $this->app->run(true);
// assert expected status code and body
$this->assertSame(404, $response->getStatusCode());
$this->assertSame('{"status":404,"message":"not found"}', (string)$response->getBody());
} | [
"protected function isStateFail()\n {\n return empty($_GET['state'])\n || (isset($_SESSION['oauth2state'])\n && $_GET['state'] !== $_SESSION['oauth2state']);\n }",
"public function testStateIssuedCorrectly()\n {\n $this->assertNull($this->state->issue());\n }",
"public function testReachStateException()\n {\n $machine = $this->getMachine();\n\n $machine->reachState('unpaid', 'shipped');\n }",
"public function testStateFailsWithIncorrectValue()\n {\n $state_issued = $this->stateHandler->issue();\n $this->assertFalse($this->stateHandler->validate($state_issued.'false'));\n $this->assertNull($this->sessionStore->get(SessionStateHandler::STATE_NAME));\n }",
"public function testExceptionRequiredStateNotAvailable()\n {\n try {\n Support\\MockFinder::$ignoreDefaultState = false;\n $this->getFactoryObject(new Support\\MockFinder('My\\Stated\\Class', 'path/to/my/class'))->build(false, 'NonExistentState');\n } catch (Exception\\StateNotFound $exception) {\n return;\n }\n\n $this->fail('Error, if the stated class has not the required starting state, the factory must throw an exception StateNotFound');\n }",
"abstract public function errorState();",
"public function testStateValidatesCorrectly()\n {\n $state_issued = $this->stateHandler->issue();\n $this->assertTrue($this->stateHandler->validate($state_issued));\n $this->assertNull($this->sessionStore->get(SessionStateHandler::STATE_NAME));\n\n }",
"abstract public function isFailed();",
"public function testHasStateOnCorrectState()\n {\n $response = $this->response;\n $state = rand(1, 99);\n $response->setState($state);\n $this->assertSame(true, $response->hasState($state));\n }",
"private function assertHasCurrentState()\n {\n if (!$this->hasCurrentState()) {\n throw new StateNotSet(sprintf('%s has no current state', __CLASS__));\n }\n }",
"public function GetSyncFailState() {\n if (!$this->uuid)\n return false;\n\n try {\n return $this->statemachine->GetState($this->device->GetDeviceId(), IStateMachine::FAILSAVE, $this->uuid, $this->oldStateCounter, $this->deleteOldStates);\n }\n catch (StateNotFoundException $snfex) {\n return false;\n }\n }",
"public function isFailure();",
"public function isFailed()\n {\n return !in_array(\n $this->data['state'],\n [\n self::NOTSTARTED,\n self::SNAPSHOT_IN_PROGRESS_DIFF_IN_PROGRESS,\n self::SNAPSHOT_IN_PROGRESS,\n self::PROGRESS,\n self::COMPLETED,\n self::ZIPFILE,\n self::COMPLETED_HOOK_EXECUTED,\n self::WITHOUT_ZIP,\n ]\n );\n }",
"public function testGetInvalidOrganizationByState() {\n\t\t$organization = Organization::getOrganizationByOrgState($this->getPDO(), \"ZQ\");\n\t\t$this->assertSame($organization->getSize(), 0);\n\t}",
"function HasFailedTrans() {}",
"public function testSetState()\n {\n $this->expectException('Exception');\n SpecialAddressBlock::__set_state(['invalid_field' => 'invalid value']);\n }",
"function validState($state)\r\n {\r\n global $dataLayer;\r\n //Verify state matches the available states in data-layer.php\r\n return in_array($state, $dataLayer->getStates());\r\n }",
"public function test_transition_invalid()\n\t{\n\t\t$sm = $this->get_statemachine_instance();\n\n\t\t$this->assertSame('pending', $sm->state());\n\n\t\t$sm->transition('deleted');\n\t}",
"public function hasStateFactory(): bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the Current Theme's theme.json file path. | public function getCurrentThemeJsonPath()
{
return $this->getConfiguredBundlePath() . '/css/' . $this->getThemeChoice() . '/theme.json';
} | [
"public function getThemePath();",
"public function getThemePath()\n {\n return $this->themePath;\n }",
"public function theme_path(){\n\t\treturn str_replace('\\\\', '/', getcwd());\n\t}",
"public function getThemePath(): string;",
"public function getActiveThemePath() {\n return $this->themeManager->getActiveTheme()->getPath();\n }",
"private function getCurrentThemeBasePath()\n {\n return $this->themeManager->find(setting('core::template'))->getPath();\n }",
"public function getThemePath(): string\n {\n if (null === $this->themePath) {\n if ($this->isProtected()) {\n $this->themePath = $this->getProtectedThemePath();\n } elseif ($this->isValid()) {\n $this->themePath = call_user_func([$this->getClassname(), 'getThemeFolder']);\n } else {\n $this->themePath = $this->projectDir . '/themes/' . $this->getThemeName();\n }\n }\n return $this->themePath;\n }",
"function theme_path($file = '', $theme = null)\n {\n return Theme::path($file, $theme);\n }",
"function themeDir()\n {\n return atkTheme::absPath($this->getAttribute(\"basepath\"));\n }",
"public function getJavascriptThemePath() {\n return $this->javascript_theme_path;\n }",
"private function theme()\n {\n return $this->theme_path = 'themes.' . env('THEME') . '.';\n }",
"public function getThemeDir();",
"public function getThemesPath()\n {\n return $this->getPackagesPath() . '/themes';\n }",
"public function assetsPath()\n {\n $themeAssetsDir = $this->config->get('themify.themes_assets_path');\n $theme = $this->get();\n\n return $themeAssetsDir . '/' . $theme;\n }",
"public function getThemeTemplatePath();",
"static function get_theme_folder() {\n\t\treturn self::current_theme() ? THEMES_DIR . \"/\" . self::current_theme() : project();\n\t}",
"function wp_irving_site_theme_json_directory_path( $path ) {\n\treturn get_stylesheet_directory() . '/site-theme/';\n}",
"public function getThemeFolder()\n {\n\n return $this->themeFolder;\n }",
"function themes_path() {\n return root_path() . '/themes/';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
second thing is to create a new model object defined by the url/router we then get the applicable model data, and drop it into an array | function getModelData(){
// get data from the model, returns the model object
// get array of model and action from the routerObj
// if the router has created a controller instance, and that instance isn't empty?
$controller = $this->routerObj->getController();
// logThis($controller);
if(isset($controller) && $controller != ""){
$controller = $controller."Controller";
while(strpos($controller, "/") !== false){
$slashPos = strpos($controller, "/");
$controller = str_replace("/", "", $controller);
}
// logThis($controller);
// if there is an associated controller, make an instance of that object
// perform the requested action, and return the data, otherwise drop into
// the default model.
/*if($controller == "AdminController" && ($_SESSION['user']->getUserAuth() < 3)){
header("location: ".BASEDIR."Default/");
exit;
}else*/{
if(file_exists("Controllers/".$controller.".php")){ // check if a file exists in the controller dir
include "Controllers/".$controller.".php";
$controllerObj = new $controller($this->routerObj->getActions(), $this->POST);
$this->view = $controllerObj->getView();
if($controllerObj->getVars()){$this->vars = $controllerObj->getVars();}
}else{ // a controller was called, but does not exist, send user to the default
} // end nested if-else
}
}else{
require_once "Controllers/DefaultController.php";
$controllerObj = new DefaultController();
if($controllerObj->getVars()){$this->vars = $controllerObj->getVars();}
}
} | [
"protected function afterGetModel () {}",
"abstract protected function prepareModels();",
"public function populateModels()\n {\n }",
"private function mapModels() {\n $this->resolveUrls();\n\n $this->mappedModels = [];\n foreach ($this->urls as $urlModel) {\n\n if (!isset($this->mappedModels[$urlModel->model])) {\n $this->mappedModels[$urlModel->model] = [];\n }\n\n $this->mappedModels[$urlModel->model][$urlModel->model_id] = $urlModel->id;\n }\n }",
"protected final function parse_model_request() {\n\t \n\t /* get the model from the request */\n\t $modeldata = (is_array($this->request['model'])) ? $this->request['model'] : array();\n\t /*\n\t *\tlooks something like this now:\n\t\t *\t$modeldata = array(\n\t\t * \t'title'\t\t\t\t=> 'my title',\n\t\t * \t'content'\t\t\t=> 'some content',\n\t\t * 'any backbone key'\t=> 'any backbone value'\n\t\t * );\n\t\t */\n\t \t \n\t \t/* the formatting of the parsed output */\n \t$parsed = array();\n \t\n \t/* get all data packages, also the core packages and parse them */\n\t \t$data_packages = array_merge($this->core_data_packages, $this->properties->custom_data_packages ); \n\t \tforeach ($data_packages as $data_package) {\n\t\t \t$parsed[$data_package] = array();\n\t \t} \t\n \t/*\n\t *\tlooks something like this now:\n\t\t *\t$parsed = array(\n\t\t * \t'post'\t\t\t\t\t\t\t=> array(),\n\t\t * \t'postmeta'\t\t\t\t\t\t=> array(),\n\t\t * \t'comment'\t\t\t\t\t\t=> array(),\n\t\t *\t\t'any registered data package' \t=> array()\n\t\t * );\n\t\t */\n \n \t/* get default values if some are set in the extended handler class */\n \t$parsed = $this->filter_pre_parse_model_request($parsed, $this->request_method);\n \t\n \t/* start parsing */\n\t\tforeach ($modeldata as $id_backbone => $value) {\n\t\t\t\n\t\t\t/* check if the data package field is registered */\n\t\t\t/* only data_package_fields registered in backbone pass this gate */\n\t\t\tif ( ! array_key_exists($id_backbone, $this->properties->data_package_fields) )\n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t// shorthand for data package fields\n\t\t\t$field = $this->properties->data_package_fields[$id_backbone]; // any backbone key\n\t\t\t$data_package = $field['data_package']; // the name of the package, e.g. 'post' or 'author'\n\t\t\t$wp_id = $field['id']; // the wp key name, e.g. post_title, post_parent\t\t\n\n\t\t\t/* some preprocessing */\n\t\t\tif( isset($field['options']) ) {\n\t\t\t\n\t\t\t\t/* this field is read only, so throw it away, we ignore this value */\n\t\t\t\tif( array_key_exists('readonly', $field['options']) && $field['options']['readonly'] )\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t/* validate the data */\n\t\t\t\tif( array_key_exists('validate', $field['options']) ) { \t\t\t\t\t\n\t\t\t\t\t$validate_callback = $field['options']['validate'];\n\t\t\t\t\t\n\t\t\t\t\t/* execute the validation callback e.g. esc_attr(), esc_url(), .. */\n\t\t\t\t\tif(function_exists($validate_callback))\n\t\t\t\t\t\t$value = call_user_func ($validate_callback, $value);\t\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/* sort all data in a nice way */\n\t\t\t$parsed[$data_package][$wp_id] = $value;\n\t\t\t/*\n\t\t *\tlooks something like this now:\n\t\t\t *\t$parsed = array(\n\t\t\t * \t'post'\t\t=> array( 'post_title' \t=> 'my title',\n\t\t\t * \t\t\t\t\t\t\t 'post_content'=> 'my content',\n\t\t\t *\t\t\t\t\t\t\t 'any wp key'\t=> 'value from backbone'\n\t\t\t *\t\t\t\t\t\t\t),\n\t\t\t * \t'postmeta'\t=> array(...),\n\t\t\t * \t'comment'\t=> array(...)\n\t\t\t * );\n\t\t\t */\n\t\t\t\n\t\t}\t\t\t\t\t\n\t\t\n\t\t/* override some key, values with filter in the child class */\n \t$parsed = $this->filter_post_parse_model_request($parsed, $this->request_method);\n \t\n \t/* there might be an error \t */\n \tif( ! $parsed ) {\n\t \t$this->set_error( 500, 'request could nt be parsed' );\n\t \t$parsed = array();\n \t}\n \t\n \t// successfully set our data\n \t$this->parsed_model_request = $parsed;\t \t\t\n\t}",
"public function setModelWebCam() {\n\t\tglobal $req_dataUrl;\n\t\t$model = new Model();\n\t\t$model->createFromWebCam($req_dataUrl); \n\t\treturn get_object_vars($model);\n\t}",
"public function newModel();",
"protected function makeModels() {\n\t\t$props = array(\n\t\t\tarray('uid' => 1, 'title' => 'Some Title'),\n\t\t\tarray('uid' => 2, 'title' => 'Another Title')\n\t\t);\n\n\t\tforeach ($props as $fields) {\n\t\t\t$model = new HashStorageTestModel();\n\t\t\tforeach ($fields as $prop => $value) {\n\t\t\t\t$model->_setProperty($prop, $value);\n\t\t\t}\n\t\t\t$this->models[] = $model;\n\t\t}\n\t}",
"public function loadModel(){\n $data = Service::find($this->modelId);\n $this->name = $data->name;\n $this->duration = $data->duration;\n $this->price = $data->price;\n $this->description = $data->description;\n $this->picture = $data->picture;\n }",
"public function get_all_objects() {//done\n //$this->instantiate_model();\n $this->model = $this->model->get_all_objects(); //ensures that an stdClass object is returned\n return $this->model;\n }",
"public function setModel() {\n\t\tglobal $req_file;\n\t\tif(empty($req_file) || !file_exists(UPLOADS_DIR . \"/\" . $req_file))\n\t\t\treturn array( 'err' => ERR_FILE );\n\t\t\n\t\t$model = new Model();\n\t\t$model->createFromFile($req_file); \n\t\treturn get_object_vars($model);\n\t}",
"abstract protected function initModel();",
"abstract protected function createNewModel();",
"function _createModel($name = null, $path = '')\r\n\t{\r\n\t\t$model = array();\r\n\t\t$model['name'] = $name;\r\n\t\t$model['path'] = $path;\r\n\t\treturn $model;\r\n\t}",
"private function __initializeModels() {\n\t\tif (isset($this->params['models']) && $this->params['models'] !== true) {\n\t\t\t$modelSetups = explode(',', $this->params['models']);\n\n\t\t\t$models = App::objects('model', CakePlugin::path($this->__plugin) . 'Model' . DS, false);\n\n\t\t\t$defaultSetup = array(\n\t\t\t\t'where' => '1=1',\n\t\t\t\t'limit' => '0'\n\t\t\t);\n\n\t\t\tforeach ($modelSetups as $modelSetup) {\n\t\t\t\t$modelSetup = explode('-', $modelSetup);\n\t\t\t\t$model = Inflector::classify($modelSetup[0]);\n\n\t\t\t\tif ($model == 'All') {\n\t\t\t\t\tforeach ($models as $model) {\n\t\t\t\t\t\tif (in_array('core', $modelSetup)) {\n\t\t\t\t\t\t\t$this->__models[$model]['core'] = $defaultSetup;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (in_array('sample', $modelSetup)) {\n\t\t\t\t\t\t\t$this->__models[$model]['sample'] = $defaultSetup;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (in_array($model, $models)) {\n\t\t\t\t\tif (in_array('core', $modelSetup)) {\n\t\t\t\t\t\t$this->__models[$model]['core'] = $defaultSetup;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (in_array('sample', $modelSetup)) {\n\t\t\t\t\t\t$this->__models[$model]['sample'] = $defaultSetup;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function setModelTemplate() {\n\t\tglobal $req_file;\n\t\t$model = new Model();\n\t\t$model->createFromTmpl($req_file); \n\t\treturn get_object_vars($model);\n\t}",
"public abstract function getModelFromView();",
"public function loadModel()\n {\n require APP . '/models/post.php';\n // create new \"model\" (and pass the database connection)\n $this->post = new Post($this->db);\n require APP . '/models/comment.php';\n // create new \"model\" (and pass the database connection)\n $this->comment = new Comment($this->db);\n }",
"function _smartdocs_model_resource_index(){\n $model = new Model(devconnect_default_org_config());\n $return = array();\n foreach($model->listModels() as $model){\n $return[$model->getName()] = $model->toArray();\n }\n return $return;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set all available members to NULL Used after delete the object in the database | public function _clear(){
foreach($this as $key => $val) $this->{$key} = null;
} | [
"public function reset(){\n foreach( $this->model as $key => $field ){\n $this->model->{$key}->value = null;\n }\n }",
"protected function resetObject() {\n\t\tforeach (get_class_vars(get_class($this)) as $var => $value) {\n\t\t\tif ($var != \"database\") {\n\t\t\t\t$this->$var = null;\n\t\t\t}\n\t\t}\n\t}",
"function Unload(){\n $field_array = get_object_vars($this);\n foreach($field_array as $key => $value){\n $this->$key = \"\";\n }\n }",
"public function clear()\n {\n $this->id = null;\n $this->name = null;\n $this->is_parent = null;\n $this->tag_generated = null;\n $this->favorites = null;\n $this->shareable_status = null;\n $this->created_at = null;\n $this->updated_at = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }",
"public function clear()\r\n\t{\r\n\t\tforeach ($this->_properties as $key => $value) {\r\n\t\t\t$this->_properties[$key] = null;\r\n\t\t}\r\n\t}",
"public function clearMembers()\n\t{\n\t\t$this->collMembers = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"function reset()\n\t{\n\t\t$this->data = static::$defaults;\n\t\t$this->data[static::$pk] = null;\n\t}",
"public function clearMetas()\n {\n $this->collMetas = null; // important to set this to NULL since that means it is uninitialized\n }",
"function clearValues() \n\t{\n \n // for each possible field this object manages ...\n for( $indx=0; $indx<count($this->fields); $indx++) {\n \n $key = $this->fields[$indx];\n \n $this->values[ $key ] = '';\n }\n \n $this->values[ $this->primaryKeyField ] = '';\n $this->primaryKeyValue = '';\n $this->dbCondition = '';\n \n \n }",
"protected function reset()\n {\n $this->collection = null;\n $this->joinTablename = null;\n $this->joinTableAlias = null;\n $this->joinType = null;\n $this->joinOn = null;\n $this->joinWhere = null;\n $this->joinSelectFields = null;\n }",
"function\n clear()\n {\n global $LOGIN_ID;\n\n $this->id = 0;\n $this->status = ORGANIZATION_STATUS_NON_MEMBER;\n $this->name = \"\";\n $this->domain = \"\";\n $this->create_date = \"\";\n $this->create_id = $LOGIN_ID;\n $this->modify_date = \"\";\n $this->modify_id = $LOGIN_ID;\n }",
"public function clearData()\n {\n foreach ($this->fields as $field) {\n $field->clearData();\n }\n }",
"function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setObjeto('');\n $this->setId_resto('');\n $this->setId_dl('');\n $this->setPrimary_key($aPK);\n }",
"public function declutter()\n\t{\n\t\t$fields = $this->fields;\n\t\t$attributes = $this->getAttributes();\n\t\t// Remove any other item attributes\n\t\tforeach($this as $key => $value) {\n\t\t\tif(!in_array($key, $attributes) && !array_key_exists($key, $fields)) {\n\t\t\t\tunset($this->$key);\n\t\t\t}\n\t\t}\n\t}",
"public function __wakeup() {\n $this->unset_members();\n }",
"public function reset()\n {\n $this->_metaData = array();\n $this->_columnMap = array();\n }",
"public function clear()\n {\n $this->id = null;\n $this->name = null;\n $this->description = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }",
"public function clear(){\n $this->clearDirtyKeys();\n $this->_attributes = array();\n }",
"public function reset()\n {\n $this->_contacts = [];\n $this->_lists = [];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function handles the AJAX request for previewing a query. TODO: Likely need to fix PHP notices/warnings here when clause groups do not have complete data but the preview AJAX request was executed | public function wp_ajax_conductor_query_builder_preview_query() {
// Generic error message
$error = __( 'There was an error previewing the query. Please try again later.', 'conductor' );
// Grab the post ID
$post_id = ( isset( $_POST['ID'] ) ) ? ( int ) $_POST['ID'] : false;
// Grab the post type
$post_type = ( $post_id ) ? get_post_type( $post_id ) : false;
// Status flags
$status = array();
// Check post ID, post type, and AJAX referrer
if ( ! $post_id || $post_type !== $this->post_type_name || ! check_ajax_referer( sanitize_text_field( $_POST['nonce_action'] ), 'nonce', false ) ) {
$status['error'] = $error;
wp_send_json_error( $status );
}
// Return an error if the current user can't edit this query
if ( ! current_user_can( 'edit_post', $post_id ) ) {
$status['error'] = __( 'You do not have sufficient permissions to preview a query on this site.', 'conductor' );
wp_send_json_error( $status );
}
// Grab the query builder mode
$query_builder_mode = $this->get_query_builder_mode();
// Grab the Conductor Query Builder data (default to an empty array)
$conductor_query_builder_data = $this->get_query_builder_data( $_POST, $query_builder_mode );
do_action( 'conductor_query_builder_preview_query_before', $post_id, $post_type, $query_builder_mode, $conductor_query_builder_data, $this );
// Grab the simple query builder data
$simple_conductor_query_builder_data = $this->get_simple_query_builder_data( ( $query_builder_mode === 'simple' ) ? $_POST : $conductor_query_builder_data, $query_builder_mode );
// Setup the query builder mode preview data reference
$this->preview_data['query_builder_mode'] = $query_builder_mode;
// Setup the Conductor Widget instance preview data reference
$this->preview_data['conductor_widget_instance'] = $simple_conductor_query_builder_data;
// Grab the clause types
$clause_types = $this->get_clause_types();
// Loop through the clause types
foreach ( $clause_types as $clause_type ) {
/*
* Setup the preview data references
*/
// Post Meta
$this->preview_data['post_meta'][$clause_type] = $this->get_clause_type_post_meta( $post_id, $clause_type, $conductor_query_builder_data );
// Query Arguments (call $this->get_clause_type_query_args() twice; once for the database value and once for the query value)
$this->preview_data['query_args'] += $this->get_clause_type_query_args( $post_id, $clause_type, $this->get_clause_type_query_args( $post_id, $clause_type, $this->preview_data['post_meta'][$clause_type] ), 'query', true );
}
// Start output buffering
ob_start();
// Preview this Conductor Query
$this->render_preview( $post_id );
// Grab the output from the buffer
$preview = ob_get_clean();
do_action( 'conductor_query_builder_preview_query_after', $post_id, $post_type, $query_builder_mode, $conductor_query_builder_data, $preview, $this );
// If the post was inserted successfully
if ( $post_id ) {
$status['preview'] = $preview;
wp_send_json_success( $status );
}
} | [
"public function switch_to_preview_query() {\n\n\t\t\t$current_post_id = get_the_ID();\n\n\t\t\tif ( jet_engine()->post_type->slug() !== get_post_type( $current_post_id ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$document = Elementor\\Plugin::instance()->documents->get_doc_or_auto_save( $current_post_id );\n\n\t\t\tif ( ! is_object( $document ) || ! method_exists( $document, 'get_preview_as_query_args' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$new_query_vars = $document->get_preview_as_query_args();\n\n\t\t\tif ( empty( $new_query_vars ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tElementor\\Plugin::instance()->db->switch_to_query( $new_query_vars );\n\n\t\t}",
"function ajax_query_handler()\n{\n global $AJAX_ACTION_NAME;\n check_ajax_referer($AJAX_ACTION_NAME, 'security');\n\n $params = json_decode(stripslashes($_POST['query']), true); // Sanitization is handled by WP_Query\n $params['post_status'] = 'publish';\n $query = new WP_Query($params);\n\n $post_type = $params['post_type'] ?: 'post';\n echo get_template_part(\"template-parts/{$post_type}-ajax\", null, ['query' => $query]);\n wp_die();\n}",
"private function _show_preview()\n {\n // --------------------------------------\n // Check prerequisites\n // --------------------------------------\n\n $member_id = ee()->session->userdata('member_id');\n $keywords = ee()->input->post('keywords');\n $fields = ee()->input->post('fields');\n $cats = ee()->input->post('cats');\n\n if (! ($keywords && $fields)) {\n if (is_ajax()) {\n die('No keywords or fields given.');\n } else {\n return;\n }\n }\n\n // Save this POST data as encoded data, so we know that what has been\n // previewed, is also used for the actual replacement\n $this->data['encoded_preview'] = pro_search_encode($_POST);\n $this->data['keywords'] = htmlspecialchars($keywords);\n\n // --------------------------------------\n // Get permitted categories, if it's installed\n // --------------------------------------\n\n $allowed_cats = ($this->member_group == 1) ? false : $this->_get_permitted_categories($member_id, true);\n $selected_cats = empty($cats) ? array() : $cats;\n\n // --------------------------------------\n // Compose query to get the matching entries\n // --------------------------------------\n\n $builder = ee('Model')\n ->get('ChannelEntry');\n\n // Loop thru each channel and its fields\n foreach ($fields as $channel_id => $field_ids) {\n $builder->orFilterGroup();\n $builder->filter('channel_id', $channel_id);\n\n $builder->filterGroup();\n // Per field, we need to add the LIKE clause to search it\n foreach ($field_ids as $attr) {\n // Field id could be numeric (for field_id_1) or not (for title)\n if (is_numeric($attr)) {\n $attr = 'field_id_' . $attr;\n }\n\n $builder->orFilter($attr, 'LIKE', \"%{$keywords}%\");\n }\n\n $builder->endFilterGroup();\n $builder->endFilterGroup();\n }\n\n // Limit to user's own entries\n if ($this->member_group != 1 && ee()->session->userdata('can_edit_other_entries') == 'n') {\n //ee()->db->where('t.author_id', $member_id);\n $builder->filter('author_id', $member_id);\n }\n\n // Join category_posts if necessary\n if ($selected_cats) {\n $builder->with('Categories');\n $builder->filter('Categories.cat_id', 'IN', $selected_cats);\n }\n\n $builder->order('entry_id', 'desc');\n $builder->limit(static::PREVIEW_LIMIT);\n\n $query = $builder->all();\n\n // --------------------------------------\n // Create nested array from results, with match preview\n // --------------------------------------\n\n $preview = array();\n $keyword_length = strlen($keywords);\n\n foreach ($query as $row) {\n $row = $row->toArray();\n\n $row['matches'] = array();\n\n foreach ($fields[$row['channel_id']] as $field_id) {\n // Field name shortcut\n $field = (is_numeric($field_id) ? $row['field_id_' . $field_id] : $row[$field_id]);\n\n if ($matches = pro_strpos_all($field, $keywords)) {\n $subs = pro_substr_pad($field, $matches, $keyword_length, static::PREVIEW_PAD);\n $subs = array_map('htmlspecialchars', $subs);\n foreach ($subs as &$sub) {\n $sub = pro_hilite($sub, htmlspecialchars($keywords));\n }\n $row['matches'][$field_id] = $subs;\n }\n }\n\n $row['edit_entry_url'] = ee('CP/URL', 'publish/edit/entry/' . $row['entry_id'])->compile();\n\n if ($row['matches']) {\n $preview[] = $row;\n }\n }\n\n $this->data['preview'] = $preview;\n\n // --------------------------------------\n // Create form action\n // --------------------------------------\n\n $this->data['form_action'] = $this->mcp_url('replace');\n\n // --------------------------------------\n // If Ajax request, load parial view and exit\n // --------------------------------------\n\n if (is_ajax()) {\n // Do CSRF jig\n //$this->_add_csrf_tokens_to_view();\n\n die(ee()->load->view('ajax_preview', $this->data, true));\n }\n }",
"public function switch_to_preview_query() {\n\n\t\t\t$current_post_id = get_the_ID();\n\t\t\t$document = Elementor\\Plugin::instance()->documents->get_doc_or_auto_save( $current_post_id );\n\n\t\t\tif ( ! is_object( $document ) || ! method_exists( $document, 'get_preview_as_query_args' ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$new_query_vars = $document->get_preview_as_query_args();\n\n\t\t\tif ( empty( $new_query_vars ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tElementor\\Plugin::instance()->db->switch_to_query( $new_query_vars );\n\n\t\t}",
"function ajax_query()\n {\n }",
"protected function _process_ajax() {}",
"public function ajax_fetch() {\n\n $conditions = array();\n if ($this->request->isget() && $this->request->query != null) {\n $data = $this->request->query;\n //for Global AJAX search filter\n if (isset($data['searchTerm']) && ($data['searchTerm'] != '' && $data['searchTerm'] != null )) {\n $where_conditions['Faq.question LIKE'] = \"%\" . $data['searchTerm'] . \"%\";\n $where_conditions['Faq.answer LIKE'] = \"%\" . $data['searchTerm'] . \"%\";\n if (preg_match('/active/i',$data['searchTerm'])) {\n $where_conditions['Faq.status'] = 1;\n }\n if (preg_match('/inactive/i',$data['searchTerm'])) {\n $where_conditions['Faq.status'] = 0;\n }\n $conditions['conditions'] = array(\"OR\" => $where_conditions);\n }\n }\n $config = array('find_configs' => $conditions);\n $faqMasters = $this->Crud->listdata($config, false);\n $this->autoRender = false;\n\n echo $faqMasters;\n exit();\n }",
"public function actionShowDataPostAjax()\n {\n return $this->module->runAction('filter/show-data-post');\n }",
"function qw_form_ajax() {\n\tswitch ( $_POST['form'] ) {\n\t\t/*\n\t\t * Preview, special case\n\t\t */\n\t\tcase 'preview':\n\t\t\t$decode = urldecode( $_POST['options'] );\n\t\t\t$options = array();\n\t\t\tparse_str( $decode, $options );\n\t\t\t$options['qw-query-options']['args']['paged'] = 1;\n\t\t\t$args = array(\n\t\t\t\t'options' => $options['qw-query-options'],\n\t\t\t\t'query_id' => $_POST['query_id'],\n\t\t\t);\n\t\t\tprint theme( 'query_preview', $args );\n\t\t\texit;\n\t\t\tbreak;\n\n\t\tcase 'sort_form':\n\t\t\t$template = 'query_sort';\n\t\t\t$all = qw_all_sort_options();\n\t\t\tbreak;\n\n\t\tcase 'field_form':\n\t\t\t$template = 'query_field';\n\t\t\t$all = qw_all_fields();\n\t\t\tbreak;\n\n\t\tcase 'filter_form':\n\t\t\t$template = 'query_filter';\n\t\t\t$all = qw_all_filters();\n\t\t\tbreak;\n\n\t\tcase 'override_form':\n\t\t\t$template = 'query_override';\n\t\t\t$all = qw_all_overrides();\n\t\t\tbreak;\n\n\t\tcase 'sort_sortable':\n\t\t\t$template = 'query_sort_sortable';\n\t\t\t$all = qw_all_sort_options();\n\t\t\tbreak;\n\n\t\tcase 'field_sortable':\n\t\t\t$template = 'query_field_sortable';\n\t\t\t$all = qw_all_fields();\n\t\t\tbreak;\n\n\t\tcase 'filter_sortable':\n\t\t\t$template = 'query_filter_sortable';\n\t\t\t$all = qw_all_filters();\n\t\t\tbreak;\n\t}\n\n\t/*\n\t * Generate handler item forms and data\n\t */\n\t$handler = $_POST['handler'];\n\t$item = array();\n\n\t$hook_key = qw_get_hook_key( $all, $_POST );\n\t$item = $all[ $hook_key ];\n\t$item['name'] = $_POST['name'];\n\t$item['form_prefix'] = qw_make_form_prefix( $handler, $item['name'] );\n\n\t// handler item's form\n\tif ( isset( $item['form_callback'] ) && function_exists( $item['form_callback'] ) ) {\n\t\tob_start();\n\t\t$item['form_callback']( $item );\n\t\t$item['form'] = ob_get_clean();\n\t} // provide template wrangler support\n\telse if ( isset( $item['form_template'] ) ) {\n\t\t$item['form'] = theme( $item['form_template'],\n\t\t\tarray( $handler => $item ) );\n\t}\n\n\t$args = array(\n\t\t$handler => $item,\n\t);\n\t// weight for sortable handler items\n\tif ( isset( $_POST['next_weight'] ) ) {\n\t\t$args['weight'] = $_POST['next_weight'];\n\t}\n\n\twp_send_json( array( 'template' => theme( $template, $args ) ) );\n}",
"private function processResults(){\n\t\tif(in_array($this->queryType, array(\"select\", \"describe\",\"show\")) && $this->needsPostProcessing){\n\t\t\t$this->results = $this->rewriteEngine->processResults($this->_results);\n\t\t}else{\n\t\t\t$this->results = $this->_results;\n\t\t}\n\t}",
"public function preview_broadcast() {\n\n\t\tcheck_ajax_referer( 'ig-es-admin-ajax-nonce', 'security' );\n\n\t\t$response = array();\n\n\t\t$preview_type = ig_es_get_request_data( 'preview_type' );\n\t\t$broadcast_data = ig_es_get_request_data( 'broadcast_data', array(), false );\n\n\t\t$template_data['content'] = ! empty( $broadcast_data['body'] ) ? $broadcast_data['body'] : '';\n\t\t$template_data['template_id'] = ! empty( $broadcast_data['template_id'] ) ? $broadcast_data['template_id'] : '';\n\t\t$template_data['campaign_id'] = ! empty( $broadcast_data['id'] ) ? $broadcast_data['id'] : 0;\n\n\t\t$tempate_html = '';\n\t\tob_start();\n\t\t$this->es_broadcast_preview_callback( $template_data );\n\t\t$tempate_html = ob_get_clean();\n\t\t$response['template_html'] = $tempate_html;\n\n\t\tif ( 'inline' === $preview_type ) {\n\t\t\t$inline_preview_data = $this->get_broadcast_inline_preview_data( $broadcast_data );\n\t\t\t$response = array_merge( $response, $inline_preview_data );\n\t\t}\n\n\t\tif ( ! empty( $response ) ) {\n\t\t\twp_send_json_success( $response );\n\t\t} else {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t}",
"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 preview_action() {\n if (Request::isAjax()) {\n $this->set_content_type('text/html; charset=UTF-8');\n $this->render_text(studip_utf8encode(formatReady(transformBeforeSave(studip_utf8decode(Request::get('posting'))))));\n } else {\n $this->render_text(formatReady(ForumEntry::parseEdit(transformBeforeSave(Request::get('posting')))));\n }\n }",
"function displayQueryForm($queryRequest) {\n\n registerShortcut(\"Ctrl+Alt+W\",\n \"addFilterRow(document.getElementById('numFilters').value++);\".\n \"toggleFieldDisabled();\");\n\n if ($queryRequest->getObject()) {;\n $describeSObjectResult = WorkbenchContext::get()->describeSObjects($queryRequest->getObject());\n\n $fieldValuesToLabels = array();\n foreach ($describeSObjectResult->fields as $field) {\n $fieldValuesToLabels[$field->name] = $field->name;\n }\n } else {\n displayInfo('First choose an object to use the SOQL builder wizard.');\n }\n\n print \"<script type='text/javascript'>\\n\";\n print \"var field_type_array = new Array();\\n\";\n if (isset($describeSObjectResult)) {\n foreach ($describeSObjectResult->fields as $fields => $field) {\n print \" field_type_array[\\\"$field->name\\\"]=[\\\"$field->type\\\"];\\n\";\n }\n }\n\n $ops = getComparisonOperators();\n\n print \"var compOper_array = new Array();\\n\";\n foreach ($ops as $opValue => $opLabel) {\n print \" compOper_array[\\\"$opValue\\\"]=[\\\"$opLabel\\\"];\\n\";\n }\n print \"</script>\\n\";\n print \"<script src='\" . getPathToStaticResource('/script/query.js') . \"' type='text/javascript'></script>\\n\";\n\n print \"<form method='POST' id='query_form' name='query_form' action='query.php'>\\n\";\n print getCsrfFormTag();\n print \"<input type='hidden' name='justUpdate' value='0' />\";\n print \"<input type='hidden' id='numFilters' name='numFilters' value='\" . count($queryRequest->getFilters()) .\"' />\";\n print \"<p class='instructions'>Choose the object, fields, and criteria to build a SOQL query below:</p>\\n\";\n print \"<table border='0' style='width: 100%;'>\\n\";\n print \"<tr><td valign='top' width='1'>Object:\";\n\n printObjectSelection($queryRequest->getObject(), 'QB_object_sel', \"16\", \"onChange='updateObject();'\", \"queryable\");\n\n print \"<p/>Fields:<select id='QB_field_sel' name='QB_field_sel[]' multiple='mutliple' size='4' style='width: 16em;' onChange='buildQuery();'>\\n\";\n if (isset($describeSObjectResult)) {\n\n print \" <option value='count()'\";\n if ($queryRequest->getFields() != null) { //check to make sure something is selected; otherwise warnings will display\n foreach ($queryRequest->getFields() as $selectedField) {\n if ('count()' == $selectedField) print \" selected='selected' \";\n }\n }\n print \">count()</option>\\n\";\n\n //print \">$field->name</option>\\n\";\n foreach ($describeSObjectResult->fields as $fields => $field) {\n print \" <option value='$field->name'\";\n if ($queryRequest->getFields() != null) { //check to make sure something is selected; otherwise warnings will display\n foreach ($queryRequest->getFields() as $selectedField) {\n if ($field->name == $selectedField) print \" selected='selected' \";\n }\n }\n print \">$field->name</option>\\n\";\n }\n }\n print \"</select></td>\\n\";\n print \"<td valign='top'>\";\n\n print \"<table border='0' align='right' style='width:100%'>\\n\";\n print \"<tr><td valign='top' colspan=2>View as:<br/>\" .\n \"<label><input type='radio' id='export_action_screen' name='export_action' value='screen' \";\n if ($queryRequest->getExportTo() == 'screen') print \"checked='true'\";\n print \" onClick='toggleMatrixSortSelectors(true);'>List</label> \";\n\n print \"<label><input type='radio' id='export_action_matrix' name='export_action' value='matrix' \";\n if ($queryRequest->getExportTo() == 'matrix') print \"checked='true'\";\n print \" onClick='toggleMatrixSortSelectors(true);'>Matrix</label>\";\n\n if (WorkbenchConfig::get()->value(\"allowQueryCsvExport\")) {\n print \"<label><input type='radio' id='export_action_csv' name='export_action' value='csv' \";\n if ($queryRequest->getExportTo() == 'csv') print \"checked='true'\";\n print \" onClick='toggleMatrixSortSelectors(true);'>CSV</label> \";\n }\n\n print \"<label><input type='radio' id='export_action_async_csv' name='export_action' value='async_CSV' \";\n if ($queryRequest->getExportTo() == 'async_CSV') print \"checked='true'\";\n print \" onClick='toggleMatrixSortSelectors(true);'>Bulk CSV</label> \";\n\n print \"<label><input type='radio' id='export_action_async_xml' name='export_action' value='async_XML' \";\n if ($queryRequest->getExportTo() == 'async_XML') print \"checked='true'\";\n print \" onClick='toggleMatrixSortSelectors(true);'>Bulk XML</label> \";\n\n\n print \"<td valign='top' colspan=2>Deleted and archived records:<br/>\" .\n \"<label><input type='radio' name='query_action' value='Query' \";\n if ($queryRequest->getQueryAction() == 'Query') print \"checked='true'\";\n print \" >Exclude</label> \";\n\n print \"<label><input type='radio' name='query_action' value='QueryAll' \";\n if ($queryRequest->getQueryAction() == 'QueryAll') print \"checked='true'\";\n print \" >Include</label></td></tr></table>\\n\";\n\n\n print \"<table id='QB_right_sub_table' border='0' align='right' style='width:100%'>\\n\";\n\n print \"<tr id='matrix_selection_headers' style='display: none;'><td><br/>Columns:</td> <td><br/>Rows:</td> <td> </td></tr>\\n\";\n print \"<tr id='matrix_selection_row' style='display: none;'><td><select id='matrix_cols' name='matrix_cols' style='width: 15em;' onChange='toggleFieldDisabled();buildQuery();' onkeyup='toggleFieldDisabled();buildQuery();'>\";\n if(isset($fieldValuesToLabels)) printSelectOptions(array_merge(array(\"\"=>\"\"),$fieldValuesToLabels), $queryRequest->getMatrixCols());\n print \"</select></td> <td><select id='matrix_rows' name='matrix_rows' style='width: 15em;' onChange='toggleFieldDisabled();buildQuery();' onkeyup='toggleFieldDisabled();buildQuery();'>\";\n if(isset($fieldValuesToLabels)) printSelectOptions(array_merge(array(\"\"=>\"\"),$fieldValuesToLabels), $queryRequest->getMatrixRows());\n print \"</select></td> <td><img onmouseover=\\\"Tip('Matrix view groups records into columns and rows of common field values.')\\\" align='absmiddle' src='\" . getPathToStaticResource('/images/help16.png') . \"'/></td></tr>\\n\";\n\n print \"<tr id='sort_selection_headers'><td colspan='2'><br/>Sort results by:</td> <td><br/>Max Records:</td></tr>\\n\";\n print \"<tr id='sort_selection_row'>\";\n print \"<td colspan='2'><select id='QB_orderby_field' name='QB_orderby_field' style='width: 16em;' onChange='buildQuery();'>\\n\";\n print \"<option value=''></option>\\n\";\n if (isset($describeSObjectResult)) {\n foreach ($describeSObjectResult->fields as $fields => $field) {\n print \" <option value='$field->name'\";\n if ($queryRequest->getOrderByField() != null && $field->name == $queryRequest->getOrderByField()) print \" selected='selected' \";\n print \">$field->name</option>\\n\";\n }\n }\n print \"</select>\\n\";\n\n $qBOrderbySortOptions = array(\n 'ASC' => 'A to Z',\n 'DESC' => 'Z to A'\n );\n\n print \"<select id='QB_orderby_sort' name='QB_orderby_sort' style='width: 6em;' onChange='buildQuery();' onkeyup='buildQuery();'>\\n\";\n foreach ($qBOrderbySortOptions as $opKey => $op) {\n print \"<option value='$opKey'\";\n if (isset($_POST['QB_orderby_sort']) && $opKey == $_POST['QB_orderby_sort']) print \" selected='selected' \";\n print \">$op</option>\\n\";\n }\n print \"</select>\\n\";\n\n $qBNullsOptions = array(\n 'FIRST' => 'Nulls First',\n 'LAST' => 'Nulls Last'\n );\n print \"<select id='QB_nulls' name='QB_nulls' style='width: 10em;' onChange='buildQuery();' onkeyup='buildQuery();'>\\n\";\n foreach ($qBNullsOptions as $opKey => $op) {\n print \"<option value='$opKey'\";\n if ($queryRequest->getOrderByNulls() != null && $opKey == $queryRequest->getOrderByNulls()) print \" selected='selected' \";\n print \">$op</option>\\n\";\n }\n print \"</select></td>\\n\";\n\n print \"<td><input type='text' id='QB_limit_txt' size='10' name='QB_limit_txt' value='\" . htmlspecialchars($queryRequest->getLimit() != null ? $queryRequest->getLimit() : null,ENT_QUOTES) . \"' onkeyup='buildQuery();' /></td>\\n\";\n\n print \"</tr>\\n\";\n\n print \"</table>\\n\";\n print \"</td></tr>\\n\";\n\n $filterRowNum = 0;\n foreach ($queryRequest->getFilters() as $filter) {\n print \"<script>addFilterRow(\" .\n $filterRowNum++ . \", \" .\n \"\\\"\" . $filter->getField() . \"\\\", \" .\n \"\\\"\" . $filter->getCompOper() . \"\\\", \" .\n \"\\\"\" . htmlspecialchars($filter->getValue(), ENT_QUOTES) . \"\\\"\" .\n \");</script>\";\n }\n\n\n print \"<tr><td valign='top' colspan=5><br/>Enter or modify a SOQL query below:\\n\" .\n \"<br/><textarea id='soql_query_textarea' type='text' name='soql_query' rows='\" . WorkbenchConfig::get()->value(\"textareaRows\") . \"' style='width: 99%; overflow: auto; font-family: monospace, courier;'>\" . htmlspecialchars($queryRequest->getSoqlQuery(),ENT_QUOTES) . \"</textarea>\\n\" .\n \"</td></tr>\\n\";\n\n\n print \"<tr><td colspan=1><input type='submit' name='querySubmit' class='disableWhileAsyncLoading' value='Query' onclick='return parentChildRelationshipQueryBlocker();' /></td>\";\n\n print \"<td colspan=4 align='right'>\";\n print \" \" .\n \"<img onmouseover=\\\"Tip('Where did saved queries go? They have been replaced with bookmarkable and shareable queries! Just run a query and bookmark the URL to save or copy and paste to share.')\\\" align='absmiddle' src='\" . getPathToStaticResource('/images/help16.png') . \"'/>\";\n print \"</td></tr></table><p/>\\n\";\n\n print \"<script>toggleFieldDisabled();toggleMatrixSortSelectors(false);</script>\";\n}",
"private function display_ajaxresponse(){\r\n print('<u style=\"cursor:pointer\" onclick=\"$(\\'#_'. $this->jq_gridName .'_debug_ajaxresponse\\').toggle(\\'fast\\');\">AJAX RESPONSE</u><br />');\r\n print(\"<pre id='_\". $this->jq_gridName .\"_debug_ajaxresponse' style='border:1pt dotted black;padding:5pt;background:yellow;color:black;display:block'>\");\r\n print(\"</pre>\");\r\n }",
"function ajax_edit_panel() {\r\n\trequire_once(\"queries.php\");\r\n\tif ($_REQUEST['panel_ID']) $q = mk_panel_update_query();\r\n\telse $q = mk_panel_insert_query();\r\n\t$ret = \"<pre>\\nRequest:\\n\";\r\n\tforeach ($_REQUEST as $name=>$value) { $ret .= \"[$name] = [$value]\\n\"; }\r\n\t$ret .= \"query: $q\\n\";\r\n\tif ($q) { ComixDB::get()->query($q) or $ret .= ajax_error(mysqli_error()); }\r\n\telse $ret .= ajax_error(\"Could not process request. Check your values.\");\r\n\treturn \"$ret\\n</pre>\\n\".ajax_get_panel_info();\r\n}",
"function acfe_is_dynamic_preview(){\n \n global $is_preview;\n \n // Flexible Content\n if(isset($is_preview) && $is_preview){\n \n return true;\n \n // Block Type\n }elseif(wp_doing_ajax() && acf_maybe_get_POST('query')){\n \n $query = acf_maybe_get_POST('query');\n \n if(acf_maybe_get($query, 'preview'))\n return true;\n \n }\n \n return false;\n \n}",
"function refresh() {\n\n global $wpdb;\n\n $params = $this->process_post_data();\n $output = FWP()->facet->render( $params );\n $data = stripslashes_deep( $_POST['data'] );\n $output = json_encode( $output );\n\n echo apply_filters( 'facetwp_ajax_response', $output, [\n 'data' => $data\n ] );\n\n exit;\n }",
"function post_grid_load_more_ajax_handler() {\n\n\t// Verify nonce. Defaults to die if invalid.\n\tcheck_ajax_referer( 'post-grid-load-more-nonce', 'nonce' );\n\n\tif ( ! empty( $_POST['query'] ) ) {\n\t\t$args = json_decode( wp_specialchars_decode( wp_unslash( $_POST['query'] ) ), true );\n\n\t\tif ( ! empty( $_POST['page'] ) ) {\n\t\t\t$args['paged'] = $_POST['page'] + 1;\n\t\t}\n\n\t\t$the_query = new \\WP_Query( $args );\n\t\tif ( $the_query->have_posts() && ! empty( $_POST['type'] ) ) {\n\t\t\twhile ( $the_query->have_posts() ) {\n\t\t\t\t$the_query->the_post();\n\t\t\t\tset_query_var( 'header_content', 'title_and_tags' );\n\t\t\t\tget_template_part( 'partials/content', $_POST['type'] );\n\t\t\t}\n\t\t}\n\t}\n\n\twp_die();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
1 write a function that calculates and returns the number of alphanumeric characters in a string. | function numAlphaNumeric($str)
{
for ($c = 0; $c < strlen($str); $c++) {
if (ctype_alnum($str{$c})) {
$numAlpha++;
}
}
return $numAlpha;
} | [
"function str_count_chars ($string, $mode = null)\n{\n return count_chars($string, $mode);\n}",
"function count_chars ($string, $mode = null) {}",
"function LetterCountI($str) {\n\n //Split the string into an array.\n $arr = explode(\" \", $str);\n\n //Initialize a new variable to store the word with the greatest number of repeated characters.\n $maxWord = \"-1\";\n\n //Initialize a new variable to store the number of repeated characters in a word.\n $wordNum = 0;\n\n for ($i = 0; $i < count($arr); $i++) {\n\n //For each element, count the number of repeated characters.\n foreach(count_chars($arr[$i], 1) as $j => $val) {\n\n //echo \"There were $val instances of \\\"\", chr($j), \"\\\" in the string.\\n\";\n\n //Check to see if the val has the max number of characters repeated.\n if (($wordNum < $val) And ($val != 1)) {\n //If the max number of repeated characters is found, store it.\n $wordNum = $val;\n //Also store the word that has the max number of repeated characters.\n $maxWord = $arr[$i];\n }\n\n }\n\n }\n\n //Return the first word with the great number of repeated letters or -1 if all letters are unique.\n return $maxWord;\n\n}",
"function modifier_count_characters($string, $include_spaces = 'false')\n\t{\n\t\t$include_spaces = (strtolower($include_spaces) == 'true');\n\t\t\n \tif ($include_spaces) return(strlen($string));\n\n \treturn preg_match_all(\"/[^\\s]/\",$string, $match);\n\t}",
"function getLetters() {\r\n $onlyText = $this->text; //sort of difensive copie\r\n $onlyText = preg_replace('/[\\W\\s]/', '', $onlyText); \r\n \r\n \r\n\t return strlen($onlyText);\r\n\t}",
"function smarty_mod_count_characters($string, $include_spaces=false) {\r\n\r\n if ($include_spaces)\r\n return(strlen($string));\r\n\r\n return preg_match_all(\"/[^\\s]/\",$string, $match);\r\n}",
"function countThese($str) {\n\t$result = array();\n\t$str = (strtolower($str));\n\tpreg_match_all('/[a-z0-9]/', $str, $matches);\n\tforeach ($matches[0] as $char) {\n\t (isset($result[$char])) ? $result[$char] ++ : $result[$char] = 1; \n\t}\n return $result;\n}",
"function wordCount($string){\r\n $words = \"\";\t\t\t\t\t\t//CAN BE USED TO COUNT WORDS IN A STRING AS WELL. NOT USING THIS AS OF NOW\r\n $string = eregi_replace(\" +\", \" \", $string);\r\n $array = explode(\" \", $string);\r\n for($i=0;$i < count($array);$i++){\r\n if (eregi(\"[0-9A-Za-zÀ-ÖØ-öø-ÿ]\", $array[$i]))\r\n $words[$i] = $array[$i];\r\n }\r\n return count($words);\r\n }",
"function am_countWords($string)\n {\n\t\t$word_count = 0;\n\t\t$string = eregi_replace(\" +\", \" \", $string);\n\t\t$string = eregi_replace(\"\\n+\", \" \", $string);\n\t\t$string = eregi_replace(\" +\", \" \", $string);\n\t\t$string = explode(\" \", $string);\n\t\n\t\twhile (list(, $word) = each ($string)) {\n\t\t\tif (eregi(\"[0-9A-Za-z�-��-��-�]\", $word)) {\n\t\t\t\t$word_count++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $word_count;\n\t\t\n\t}",
"function duplicateCount($text) {\n $text = mb_strtolower($text);//mb_strtolower - casts a string to lowercase\n $m = 0;\n foreach(count_chars($text, 1) as $i => $val)//iterate over the string\n {\n if ($val > 1)// checking if the character occurs more than once\n {\n $m++;\n }\n }\n return $m;\n}",
"public function nonSpaceCharCount($str) {\n\t\t$str = preg_replace('/\\s/u', '', $str);\n\t\treturn $this->len($str);\n\t}",
"function smarty_mod_count_words($string) {\r\n\r\n // split text by ' ',\\r,\\n,\\f,\\t\r\n $split_array = preg_split(\"/\\s+/\",$string);\r\n // count matches that contain alphanumerics\r\n $word_count = preg_grep(\"/[a-zA-Z0-9]/\",$split_array);\r\n\r\n return count($word_count);\r\n}",
"function _charset_count_chars($s) {\n $r = 0;\n for ($i = 0;$i < strlen($s);$i++) {\n $c = ord($s[$i]);\n if ($c >= 0xc0) $r++;\n }\n return $r;\n}",
"function is_alphanumeric($string, $min_length = 0, $max_length = 0)\r\n{\r\n\t$ret = _is_valid($string, $min_length, $max_length, \"[[:alnum:]]+\");\r\n\r\n\treturn($ret);\r\n}",
"function four_letter_words($s) {\n $res = 0;\n $words = preg_split('/\\s+/', $s);\n foreach($words as $w) {\n if (strlen($w) === 4) \n $res += 1;\n }\n return $res;\n}",
"public function strlen($str);",
"function utf8_word_count($string)\n{\n\t$string\t= preg_replace( '/[^\\\\p{L}\\\\p{Nd}\\-_]+/u' , '-' , $string );\n\t$string\t= trim( $string , '_-' );\n\n\treturn count( explode( '-' , $string ) );\n}",
"public function letter_count($strText)\n {\n $strText = $this->clean_text($strText); // To clear out newlines etc\n $intTextLength = 0;\n $strText = preg_replace('`[^A-Za-z]+`', '', $strText);\n try {\n\n if (!$this->blnMbstring) {\n throw new Exception('The extension mbstring is not loaded.');\n }\n\n if ($this->strEncoding == '') {\n $intTextLength = mb_strlen($strText);\n } else {\n $intTextLength = mb_strlen($strText, $this->strEncoding);\n }\n } catch (Exception $e) {\n $intTextLength = strlen($strText);\n }\n\n return $intTextLength;\n }",
"function vbstrlen($string)\n{\n\t$string = preg_replace('#&\\#([0-9]+);#', '_', $string);\n\treturn strlen($string);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/Get All Properties By Dealer Id | public function getResidencialProperty($dealer_id){
// echo "SELECT residential_properties.*,commercial_properties.* FROM residential_properties INNER JOIN commercial_properties ON commercial_properties.dealer_id=residential_properties.dealer_id where residential_properties.dealer_id=$dealer_id";die;
$this->db->select('residential_properties.*,property_category.cat_name');
$this->db->from('residential_properties');
$this->db->JOIN('property_category','residential_properties.cat_id = property_category.cat_id');
$this->db->where(array("residential_properties.dealer_id"=>$dealer_id,"property_option"=>'0'));
$query = $this->db->get();
return $result = $query->result_array();
} | [
"public function getProperties($id);",
"public function getAllProperties();",
"public function getAllProperties() {\n\t\ttry {\n\t\t\t\n\t\t\t$data = $this->invoke('getAllProperties', array());\n\t\t\t$results = array();\n\t\t\tforeach ($data as $obj) {\n\t\t\t\tarray_push($results, VCDSoapTools::GetUserPropertyObj($obj));\n\t\t\t}\n\t\t\treturn $results;\n\t\t\t\n\t\t} catch (Exception $ex) {\n\t\t\tthrow $ex;\n\t\t}\n\t}",
"public function getProperties()\n {\n return $this\n ->hasMany(\n Property::className(),\n [\n 'id' => 'property_id',\n ]\n )\n ->via('groupProperties');\n }",
"public function getProperties();",
"public function getCleanersForProperties($id)\n {\n return $this->cleaner_model->whereRaw('FIND_IN_SET('.$id.', cleaner_properties)')->pluck('id');\n }",
"function get_all ()\r\n\t{\r\n\t\t$properties = $this->load_all_where(array( \r\n\t\t));\r\n\t\tforeach ($properties as $property)\r\n\t\t{\r\n\t\t\t$this->properties[$property->name] = $property;\r\n\t\t}\r\n\t\treturn $this->properties;\r\n\t}",
"public function getPropertyById($id);",
"public function getProperty($id);",
"protected function findProperties()\n {\n return ElevatorProperty::findOne(['elevator_name' => $this->elevator_name]);\n }",
"function get_property($prop_id)\n {\n return $this->db->get_where('property',array('prop_id'=>$prop_id))->row_array();\n }",
"abstract public function getProperties();",
"public function properties()\n {\n return $this->hasMany(CurrencyProperty::class, CurrencyProperty::FIELD_ID_CURRENCY, self::FIELD_ID);\n }",
"public function getAgencyOffers($agency_id){\r\n return Property::find()->where(['user_id' => $agency_id])->orderBy(['id' => SORT_DESC])->all();\r\n }",
"protected function retrievableProperties()\n {\n $properties = array(\n// 'Addresses', //\tSubscriberAddress[]\tIndicates addresses belonging to a subscriber.\n// 'Attributes', //\tAttribute[]\tSpecifies attributes associated with an object.\n// 'Client', //\tClientID\tSpecifies the account ownership and context of an object.\n// 'CorrelationID', //\txsd:string\tIdentifies correlation of objects across several requests.\n 'CreatedDate', //\txsd:dateTime\tRead-only date and time of the object's creation.\n// 'CustomerKey', //\txsd:string\tUser-supplied unique identifier for an object within an object type.\n 'EmailAddress', //\txsd:string\tContains the email address for a subscriber. Indicates the data extension field contains email address data.\n 'EmailTypePreference', //\tEmailType\tThe format in which email should be sent\n// 'GlobalUnsubscribeCategory', //\tGlobalUnsubscribeCategory\tIndicates how the application handles a globally unsubscribed subscriber.\n 'ID', //\txsd:int\tRead-only legacy identifier for an object. Not supported on all objects.\n// 'Lists', //\tSubscriberList[]\tDefines lists a subscriber resides on.\n// 'Locale', //\tLocale\tContains the locale information for an Account.\n// 'ModifiedDate', //\tNullable`1\tLast time object information was modified.\n// 'ObjectID', //\txsd:string\tSystem-controlled, read-only text string identifier for object.\n// 'ObjectState', //\txsd:string\tReserved for future use.\n// 'Owner', //\tOwner\tDescribes account ownership of subscriber in an on-your-behalf account.\n 'PartnerKey', //\txsd:string\tUnique identifier provided by partner for an object, accessible only via API.\n// 'PartnerProperties', //\tAPIProperty[]\tA collection of metadata supplied by client and stored by system - only accessible via API.\n// 'PartnerType', //\txsd:string\tDefines partner associated with a subscriber.\n// 'PrimaryEmailAddress', //\tEmailAddress\tIndicates primary email address for a subscriber.\n// 'PrimarySMSAddress', //\tSMSAddress\tIndicates primary SMS address for a subscriber.\n// 'PrimarySMSPublicationStatus', //\tSubscriberAddressStatus\tIndicates the subscriber's modality status.\n 'Status', //\tSubscriberStatus\tDefines status of object. Status of an address.\n 'SubscriberKey', //\txsd:string\tIdentification of a specific subscriber.\n// 'SubscriberTypeDefinition', //\tSubscriberTypeDefinition\tSpecifies if a subscriber resides in an integration, such as Salesforce or Microsoft Dynamics CRM\n 'UnsubscribedDate'\n );\n\n return $properties;\n }",
"public function getProperties($id) {\n\t\t$object = $this->getObject($id);\n\t\tif ($object) {\n\t\t\treturn $object;\n\t\t}\n\t}",
"public function getAllProperties($id, $group='*') {\n if ($group=='*') {\n \t\t$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"post_property \n WHERE `post_id` = '\" . (int)$id . \"'\");\n } else {\n \t\t$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"post_property \n WHERE `post_id` = '\" . (int)$id . \"' \n AND `group` = '\". $this->db->escape($group) .\"'\");\n }\n \n\t\treturn $query->rows;\n\t}",
"public function GetDealer($id)\n\t{\n\t\t$xml = \"<?xml version='1.0' encoding='utf-8'?>\";\n\t\t$xml .= \"<request method='dealer.get'>\";\n\t\t$xml .= \"<dealer_id>$id</dealer_id>\";\n\t\t$xml .= \"</request>\";\n\n\t\t$this->handleResponse($this->sendRequest($xml));\n\n\t\t$dealer = array();\n\t\tif (!$this->hasError)\n\t\t{\n\t\t\tforeach($this->data->dealer[0] as $key=>$val)\n\t\t\t\t$dealer[(string)$key] = (string)$val;\n\t\t}\n\n\t\treturn $dealer;\n\t}",
"public function getAllProperties($id, $group='*') {\n if ($group=='*') {\n \t\t$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"post_category_property \n WHERE `post_category_id` = '\" . (int)$id . \"'\");\n } else {\n \t\t$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"post_category_property \n WHERE `post_category_id` = '\" . (int)$id . \"' \n AND `group` = '\". $this->db->escape($group) .\"'\");\n }\n \n\t\treturn $query->rows;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays an import button below the record preview. | protected function displayImportButton($key) {
$content = '
<input type="submit" name="cmd[import]" style="margin: 10px 0;" value="'.$GLOBALS['LANG']->getLL('importButton').'" />
';
return $content;
} | [
"public function addImportButton()\n {\n global $wp;\n\n $postType = get_current_screen()->post_type;\n\n if (empty($postType) || !$this->getImporterClassNameByPostType($postType)) {\n return;\n }\n\n $queryArgs = array_merge($wp->query_vars, array('import_projects' => 'true'));\n echo '<a href=\"' . add_query_arg('import_projects', 'true', $_SERVER['REQUEST_URI']) . '\" class=\"button-primary extraspace\" style=\"float: right; margin-right: 10px;\">' . __(\"Import\", PROJECTMANAGERINTEGRATION_TEXTDOMAIN) . ' ' . __(ucfirst(get_current_screen()->post_type), PROJECTMANAGERINTEGRATION_TEXTDOMAIN) . '</a>';\n }",
"public function getImportButtonHtml()\n {\n return ' <button onclick=\"editForm.startImport(\\'' . $this->getImportStartUrl()\n . '\\', \\'' . Mage_ImportExport_Model_Import::FIELD_NAME_SOURCE_FILE . '\\');\" class=\"scalable save\"'\n . ' type=\"button\"><span><span><span>' . $this->__('Import') . '</span></span></span></button>';\n }",
"function display_import_menu() {\n\t\t$this->get_view( 'import' );\n\t}",
"public static function importButton(){\r\n static $cssLoaded = false;\r\n\r\n if(!$cssLoaded){\r\n $doc = JFactory::getDocument();\r\n $url = JURI::root();\r\n $css = \".icon-32-import{background: url(\".$url.\"administrator/components/com_jresearch/assets/import.png) 100% 0 no-repeat;}\";\r\n $doc->addStyleDeclaration($css);\r\n $cssLoaded = true;\r\n }\r\n\r\n JToolBarHelper::custom('import', 'import', '', JText::_('Import'), false);\r\n }",
"function bunchy_render_import_demo_content_button() {\n\t?>\n\t<a class=\"button\"\n\t href=\"<?php echo esc_url( bunchy_get_import_demo_content_url() ); ?>\"><?php esc_html_e( 'Import', 'bunchy' ); ?></a>\n\t<?php\n}",
"public function renderButton(){\n\t\t\t$content = <<<ENDBUTTON\n\t<li><a id=\"btn-import-{$this->ID}\" href=\"#importerModal{$this->ID}\" data-toggle=\"modal\"><i class=\"{$this->icon}\"></i> From {$this->source}</a></li>\nENDBUTTON;\n\t\t\t\n\t\t\treturn $content;\n\t\t}",
"protected function generateImportButton()\n {\n if (!$confirmMessage = $this->generateConfirmMessage()) {\n return '<a class=\"navigation autoload\" onclick=\"if(!alert(\\'' .\n $GLOBALS['TL_LANG']['MSC']['member_import_import_alert'] .\n '\\'))return false;Backend.getScrollOffset()\">' . $GLOBALS['TL_LANG']['MSC']['member_import_import'] .\n '</a>';\n }\n\n return '<a class=\"navigation autoload\" href=\"' . Backend::addToUrl('do=member_import&import=analysis') . '\" ' .\n 'onclick=\"if(!confirm(\\'' . $confirmMessage .\n '\\'))return false;Backend.getScrollOffset()\">' . $GLOBALS['TL_LANG']['MSC']['member_import_import'] .\n '</a>';\n }",
"public function displayImport()\n {\n if(true === $error = $this->handleImport()){\n $result = $this->ImportForm();\n\n if($result['error'] == true)\n $error = $result['message'];\n else\n $success = $result['message'];\n }\n\n include __DIR__ . '/templates/import.php';\n }",
"private function putImportLayoutButton(){\n\t\t\n\t\t$nonce = UniteProviderFunctionsUC::getNonce();\n\t\t\n\t\t?>\n\t\t<style>\n\t\t\n\t\t#uc_import_layout_area{\n\t\t\tmargin: 50px 0 30px;\n \t\ttext-align: center;\t\t\t\n\t\t}\n\t\t\n\t\t#uc_form_import_template {\n\t\t background-color: #fff;\n\t\t border: 1px solid #e5e5e5;\n\t\t display: inline-block;\n\t\t margin-top: 30px;\n\t\t padding: 30px 50px;\n\t\t}\n\t\t\n\t\t#uc_import_layout_area_title{\n\t\t \tcolor: #555d66;\n \t\tfont-size: 18px;\t\t\t\n\t\t}\n \t\n\t\t</style>\n\t\t\n\t\t<div style=\"display:none\">\n\t\t\n\t\t\t<a id=\"uc_button_import_layout\" href=\"javascript:void(0)\" class=\"page-title-action\"><?php esc_html_e(\"Import Template With Addons\", \"unlimited_elements\")?></a>\n\t\t\t\n\t\t\t<div id=\"uc_import_layout_area\" style=\"display:none\">\n\t\t\t\t<div id=\"uc_import_layout_area_title\"><?php _e( 'Choose an Elementor template .zip file, that you exported using \"export with addons\" button'); ?></div>\n\t\t\t\t<form id=\"uc_form_import_template\" method=\"post\" action=\"<?php echo admin_url( 'admin-ajax.php' ); ?>\" enctype=\"multipart/form-data\">\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"unitecreator_elementor_import_template\">\n\t\t\t\t\t<input type=\"hidden\" name=\"nonce\" value=\"<?php echo esc_attr($nonce) ?>\">\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<input type=\"file\" name=\"file\" accept=\".json,.zip,application/octet-stream,application/zip,application/x-zip,application/x-zip-compressed\" required>\n\t\t\t\t\t\t<input type=\"submit\" class=\"button\" value=\"<?php esc_html_e( 'Import Now', \"unlimited_elements\" ); ?>\">\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t\t\n\t\t</div>\n\t\t\n\t\t<?php \n\t}",
"public function render_import_export_button() {\n $product_query = dokan()->product->all( [ 'author' => dokan_get_current_user_id(), 'posts_per_page' => 1 ] );\n ?>\n <?php if ( current_user_can( 'dokan_import_product' ) ) { ?>\n <a href=\"<?php echo dokan_get_navigation_url( 'tools/csv-import' ); ?>\" class=\"dokan-btn\">\n <?php esc_html_e( 'Import', 'dokan' ); ?>\n </a>\n <?php } ?>\n <?php if ( current_user_can( 'dokan_export_product' ) && apply_filters( 'dokan_csv_export_enabled', true ) && $product_query->have_posts() ) { ?>\n <a href=\"<?php echo dokan_get_navigation_url( 'tools/csv-export' ); ?>\" class=\"dokan-btn\">\n <?php esc_html_e( 'Export', 'dokan' ); ?>\n </a>\n <?php } ?>\n <?php\n }",
"public function load_import_form(){\n\t\t\n\t\t$current_page = $_SERVER['REQUEST_URI'];\n\n\t\techo \"\n\t\t\t<div style='margin: 20px 0; border: 3px solid green; background: white; padding: 20px; width: 500px; font-family: Raleway; font-size: 1.2em;'>\n\t\t\t<p>First line of CSV file must be labels. It will be processed accordingly. </p>\n\t\t\t<form action='$current_page' method='post' enctype='multipart/form-data'>\n\t\t\t<label for='nb_csv'>Upload Recent Records:</label>\n\t\t\t<input type='file' name='nb_csv' id='file'><br>\n\t\t\t<input type='submit' name='submit' value='Upload'>\n\t\t\t</form>\n\t\t\t</div>\n\t\t\";\n\t}",
"public function show_import_export()\n\t{\n\t\trequire_once LSCWP_DIR . 'admin/tpl/import_export.php' ;\n\t}",
"public function addProductImportButton($observer)\n {\n $_block = $observer->getBlock();\n $_type = $_block->getType();\n if ($_type == 'adminhtml/catalog_product_edit') {\n\n $_block->setChild(\n 'product_import_button',\n $_block->getLayout()->createBlock('swisspostdebug/adminhtml_widget_button')\n );\n\n $_deleteButton = $_block->getChild('delete_button');\n /* Prepend the new button to the 'Delete' button if exists */\n if (is_object($_deleteButton)) {\n $_deleteButton->setBeforeHtml($_block->getChild('product_import_button')->toHtml());\n } else {\n /* Prepend the new button to the 'Reset' button if 'Delete' button does not exist */\n $_resetButton = $_block->getChild('reset_button');\n if (is_object($_resetButton)) {\n $_resetButton->setBeforeHtml($_block->getChild('product_import_button')->toHtml());\n }\n }\n }\n\n }",
"function display()\r\n\t{\r\n\t\t\r\n\t\t$viewType\t= JFactory::getDocument()->getType();\r\n\t\t$view = & $this->getView('import', $viewType);\r\n\t\t$this->getModel('Importcsv', 'FabrikFEModel')->clearSession();\r\n\t\t$model = $this->getModel();\r\n\t\tif (!JError::isError($model)) {\r\n\t\t\t$view->setModel($model, true);\r\n\t\t}\r\n\t\t$view->display();\r\n\t}",
"function import_panel() {\n\n\t\t\techo '<div id=\"local-seo-import\" class=\"yoastbox\">';\n\t\t\techo '<h2>' . __( 'CSV import of locations for Local Search', 'yoast-local-seo' ) . '</h2>';\n\n\t\t\techo '</div>';\n\t\t}",
"public function indexAction()\n {\n $this->loadLayout()\n ->_setActiveMenu('sales/expeditorinet/import')\n ->_addContent($this->getLayout()->createBlock('expeditorinet/import_form'))\n ->renderLayout();\n }",
"public function listImportWizard()\n\t{\n\t\treturn ' <a href=\"' . $this->addToUrl('key=list') . '\" title=\"' . specialchars($GLOBALS['TL_LANG']['MSC']['lw_import'][1]) . '\" onclick=\"Backend.getScrollOffset()\">' . Image::getHtml('tablewizard.gif', $GLOBALS['TL_LANG']['MSC']['tw_import'][0], 'style=\"vertical-align:text-bottom\"') . '</a>';\n\t}",
"public function tableImportWizard()\n\t{\n\t\treturn ' <a href=\"' . $this->addToUrl('key=table') . '\" title=\"' . specialchars($GLOBALS['TL_LANG']['MSC']['tw_import'][1]) . '\" onclick=\"Backend.getScrollOffset()\">' . Image::getHtml('tablewizard.gif', $GLOBALS['TL_LANG']['MSC']['tw_import'][0], 'style=\"vertical-align:text-bottom\"') . '</a> ' . Image::getHtml('demagnify.gif', '', 'title=\"' . specialchars($GLOBALS['TL_LANG']['MSC']['tw_shrink']) . '\" style=\"vertical-align:text-bottom;cursor:pointer\" onclick=\"Backend.tableWizardResize(0.9)\"') . Image::getHtml('magnify.gif', '', 'title=\"' . specialchars($GLOBALS['TL_LANG']['MSC']['tw_expand']) . '\" style=\"vertical-align:text-bottom; cursor:pointer\" onclick=\"Backend.tableWizardResize(1.1)\"');\n\t}",
"function clients_importDisplaySelectFile() {\n\tglobal $gSession;\n\t\n\t$current_group = intval($_GET['group']);\n\t\n\t## setup the template\n\t$select_template = new Template();\n\t$select_template->set_templatefile(array(\"body\" => ENGINE.\"modules/clients/interface/fileupload.tpl\"));\n\n\t$select_template->set_var('language_inputhead','<b>'.LANG_MODULE_CLIENTS_ImportSelectFile.'</b>');\n\t$select_template->set_var('language_inputbody',LANG_MODULE_CLIENTS_ImportSelectFileDesc.'<br>');\n\t\n\t$select_template->set_var('update',LANG_MODULE_CLIENTS_ImportUpdate);\n\t$select_template->set_var('explain_update',LANG_MODULE_CLIENTS_ImportUpdateDesc);\n\t\n\t$select_template->set_var('element_desc','Click the \\'Browse\\' button to locate the text file<br> containing the subscribers on your computer.');\n\t\n\t$targetURL = \"module.php?cmd=import&step=1&group=\".$current_group;\n\t$targetURL = $gSession->url($targetURL);\n\t$select_template->set_var('actionURL',$targetURL);\t\n\t\n\t$select_template->pfill_block(\"body\");\n\t\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iteratively reduce the items to a single value using the `$callback` function. | public function reduce(callable $callback, $initial = null)
{
return array_reduce($this->items, $callback, $initial);
} | [
"function array_reduce($input, $callback, $initial = null) {}",
"function reduce($callback, array $arr, $initial=null) {\n return array_reduce($arr, $callback, $initial);\n}",
"public function reduce(callable $callback, $initial = NULL) {}",
"public function reduce(callable $callback, $initial = null) {}",
"function traversable_reduce( callable $callback, $initial, $traversable ) {\n $result = $initial;\n foreach( to_traversable( $traversable ) as $key => $value ) {\n $result = call_user_func( $callback, $result, $value, $key );\n }\n return $result;\n}",
"function array_reduce($input, $callback, $initial = null)\n{\n return 0;\n}",
"function array_reduce (array $input, callable $function, $initial = null) {}",
"public function apply($callback) {\n\n if ($this->noActive()) return false;\n\n return array_walk($this->items, $callback);\n }",
"public function foldLeft1(callable $callback): Collection;",
"public function reduce(iterable $array, callable $callback, $initialValue = null)\n {\n $accumulator = $initialValue;\n $needsAccumulator = $initialValue === null;\n foreach ($array as $key => $element) {\n // Lazily set the accumulator to prevent evaluation of the full array if a Traversable is given\n if ($needsAccumulator) {\n $accumulator = $element;\n $needsAccumulator = false;\n continue;\n }\n\n $accumulator = $callback($accumulator, $element, $key);\n }\n return $accumulator;\n }",
"function reduce(callable $fn, iterable $coll, $initial = null)\n{\n $acc = $initial;\n\n foreach ($coll as $key => $value) {\n $acc = $fn($acc, $value, $key);\n }\n\n return $acc;\n}",
"function reduce (iterable $iterable, callable $callable, $initial = null)\n{\n $carry = $initial;\n foreach ($iterable as $key => $value) {\n $carry = call_user_func($callable, $carry, $key, $value);\n }\n return $carry;\n}",
"public function map( $callback ) {\n\t\treturn array_map( $callback, $this->items );\n\t}",
"function reduce(array $array, callable $reducer, $initial)\n{\n\treturn \\array_reduce($array, $reducer, $initial);\n}",
"public function reduce(callable $callback, $identity)\n {\n $parent_callback = function($current_result, $new_result) use($callback)\n {\n return $callback($current_result, $new_result);\n };\n $child_callback = function($first, $last) use($callback, $identity)\n {\n $result = $identity;\n for ($i = $first; $i < $last; $i++) {\n $result = $callback($result, $this->data[$i]);\n }\n return $result;\n };\n return $this->genericParallel($identity, $parent_callback, $child_callback);\n }",
"public function reduce(Closure $func)\n {\n return array_reduce($this->itemList, $func);\n }",
"function array_reduce_left($array, $callback, $initial = null)\n {\n if (!is_array($array)) {\n trigger_error(\n sprintf('%s expects parameter %d to be array, %s given', __FUNCTION__, 1, gettype($array)),\n E_USER_WARNING\n );\n return null;\n }\n foreach ($array as $key => $value) {\n $initial = call_user_func($callback, $initial, $value, $key);\n }\n return $initial;\n }",
"public function reduce( $callable, $initial );",
"public function each(Closure $callback)\n {\n foreach ($this->items as $item) {\n $callback($item);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Access the value of support_number XML node, from the API response. | public function getSupportNumber() { return $this->supportNumber; } | [
"public function getSupportVal()\n {\n return $this->support_val;\n }",
"public function getSupportId() {\n return $this->supportId;\n }",
"public function getSupportPhoneNumber()\n {\n if (array_key_exists(\"supportPhoneNumber\", $this->_propDict)) {\n return $this->_propDict[\"supportPhoneNumber\"];\n } else {\n return null;\n }\n }",
"public function get_support_data() {\n\n if (empty($this->support_data)) {\n\n return false;\n } else {\n\n return $this->support_data;\n }\n }",
"public function getSupport()\n {\n return $this->support;\n }",
"public function getInvestigatorSupport()\n {\n\n return $this->investigator_support;\n }",
"public function getSdkSupportStatus()\n {\n return $this->sdk_support_status;\n }",
"public function getSupportLevel()\n {\n return $this->supportLevel;\n }",
"public function getNumber()\n {\n return isset($this->Number) ? $this->Number : null;\n }",
"public function getSupportUrl()\n {\n return $this->support_url;\n }",
"public function getSupportLevel() {\n\t\treturn $this->_supportLevel;\n\t}",
"public function getSupportUrl()\n {\n if (array_key_exists(\"supportUrl\", $this->_propDict)) {\n return $this->_propDict[\"supportUrl\"];\n } else {\n return null;\n }\n }",
"public function getSupportPhone(): ?string {\n return $this->supportPhone;\n }",
"public function getSupportLink()\n\t{\n\t\treturn $this->language->getInformation('support');\n\t}",
"public function getSupportEmail()\n {\n return $this->support_email;\n }",
"public function getNumberValue()\n {\n return $this->readOneof(2);\n }",
"public function getCourierSupportPhoneNumber(): ?string\n {\n if (count($this->courierSupportPhoneNumber) == 0) {\n return null;\n }\n return $this->courierSupportPhoneNumber['value'];\n }",
"public function getNumber(): string\r\n {\r\n\r\n return $this->number;\r\n }",
"public function getSupportLevelAttribute(): string\n {\n return self::getSupportLevelName($this->support_level_id);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Runs on Flux deactivation | function flux_deactivation() {
do_action( 'flux_deactivation' );
} | [
"public function on_deactivation(): void\n\t{\n\t\tthrow new \\LogicException(\"Cannot call 'on_deactivation' outside the actor\");\n\t}",
"function deactivation_hook() {\n\t\t// Do stuff\n\t}",
"public function on_deactivate() {\r\n\r\n }",
"public abstract function deactivationHooks(): array;",
"public function onDeactivation( Closure $callback ): void;",
"private static function plugin_on_deactivate() {\r\n\t\t\r\n\t}",
"public function unsubscribed(): void;",
"public function hecf_plugin_deactivation()\n\t{\n\t}",
"public static function on_deactivation() {\n\n\t\tdo_action( 'ubc_press_on_deactivation' );\n\n\t}",
"public function deactivate(){ //overrides abstract in parent LifeCycle\n }",
"public function __destruct()\n {\n $this->configuration->eventDispatcher()->dispatch(new Destruct($this));\n }",
"public function deactivation_callback() {\n\t\tTPM_Product_List::get_instance()->clear_cache();\n\t\tTPM_License_Manager::get_instance()->clear_cache();\n\t\tTPM_License_Manager::get_instance()->deactivate_all_licenses();\n\t\t$this->delete_tpm_version();\n\t\tdelete_option( 'tpm_bk_connection' );\n\t}",
"public function onDisconnection()\n {\n }",
"public static function deactivate() {\n\t\twp_clear_scheduled_hook( 'telemetry_cleanup' );\n\t}",
"public static function plugin_deactivated ()\n\t\t\t{\n\t\t\t\t\n\t\t\t}",
"public function plugin_deactivate() { }",
"public function destroy() {\n\t\t$this->active = false;\n\t\t$this->callable = null;\n\t}",
"public function onDetach()\n {\n }",
"static function pmpro_deactivation() {\n\t\twp_clear_scheduled_hook('pmpro_cron_stripe_subscription_updates');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The constructor should create a tree dropdown field | public function testFieldContainsTreeDropdownField()
{
$field = new DMSDocumentAddExistingField('Test', 'Test');
$this->assertContainsOnlyInstancesOf('TreeDropdownField', $field->getChildren());
$this->assertSame('PageSelector', $field->getChildren()->first()->getName());
} | [
"function __construct(){\n\n\t\tglobal $Db;\n\t\t$AltDb = new CDatabase($Db->link);\n\n\t\t//$Tree = new cd\n\n\t\t$Tree = new CDBTreeExt($AltDb,$this->TreeTable,$this->IndexTitle,$this->FieldNames);\n\n\t\t$this->Tree = $Tree;\n\n\n\n\n\t}",
"public function init()\n\t{\n\t\tif(isset($this->htmlOptions['id']))\n\t\t\t$id=$this->htmlOptions['id'];\n\t\telse\n\t\t\t$id=$this->htmlOptions['id']=$this->getId();\n\t\tif($this->url!==null)\n\t\t\t$this->url=CHtml::normalizeUrl($this->url);\n\t\t$cs=Yii::app()->getClientScript();\n\t\t$cs->registerCoreScript('treeview');\n\t\t$options=$this->getClientOptions();\n\t\t$options=$options===array()?'{}' : CJavaScript::encode($options);\n\t\t$cs->registerScript('Yii.CTreeView#'.$id,\"jQuery(\\\"#{$id}\\\").treeview($options);\");\n\t\tif($this->cssFile===null)\n\t\t\t$cs->registerCssFile($cs->getCoreScriptUrl().'/treeview/jquery.treeview.css');\n\t\telseif($this->cssFile!==false)\n\t\t\t$cs->registerCssFile($this->cssFile);\n\n\t\techo CHtml::tag('ul',$this->htmlOptions,false,false).\"\\n\";\n\t\techo self::saveDataAsHtml($this->data);\n\t}",
"public function init()\n\t{\n\t\tif(isset($this->htmlOptions['id']))\n\t\t\t$id=$this->htmlOptions['id'];\n\t\telse\n\t\t\t$id=$this->htmlOptions['id']=$this->getId();\n\t\tif($this->url!==null)\n\t\t\t$this->url=CHtml::normalizeUrl($this->url);\n\t\t$cs=Yii::app()->getClientScript();\n\t\t$cs->registerScriptFile(Yii::app()->baseUrl.'/js/wiki/treeview.js');\n\t\t$options=$this->getClientOptions();\n\t\t$options=$options===array()?'{}' : CJavaScript::encode($options);\n\t\t\n\t\t$bindString = '';\n\t\tif(count($this->binds) > 0) {\n\t\t foreach($this->binds as $event => $function) {\n\t\t $bindString .= '.bind(\"'.$event.'\", '.$function.')';\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\t$cs->registerScript('Yii.CTreeView#'.$id,\"jQuery(\\\"#{$id}\\\")\".$bindString.\".treeview($options);\");\n\t\tif($this->cssFile===null)\n\t\t\t$cs->registerCssFile($cs->getCoreScriptUrl().'/treeview/jquery.treeview.css');\n\t\telse if($this->cssFile!==false)\n\t\t\t$cs->registerCssFile($this->cssFile);\n\n\t\techo CHtml::tag('ul',$this->htmlOptions,false,false).\"\\n\";\n\t\techo self::saveDataAsHtml($this->data);\n\t}",
"protected function makeTree()\t{\n\t\t$this->treeViewObj = t3lib_div::makeInstance('tx_t3blog_modfunc_selecttreeview');\n\t\t$this->treeViewObj->table = 'tx_t3blog_cat';\n\n\t\t$where = ' AND sys_language_uid = 0 AND l18n_parent = 0 AND tx_t3blog_cat.pid = '.$this->id;\n\t\t$orderBy = 'catname';\n\n\t\t$this->treeViewObj->init($where, $orderBy);\n\t\t$this->treeViewObj->parentField = 'parent_id';\n\t\t$this->treeViewObj->expandAll = 0;\n\t\t$this->treeViewObj->expandFirst = 1;\n\t\t$this->treeViewObj->fieldArray = array('uid', 'catname as title', 'catname as categoriename'); // those fields will be filled to the array $treeViewObj->tree\n\t\t$this->treeViewObj->ext_IconMode = '1'; // no context menu on icons\n\t\t$this->treeViewObj->title = $GLOBALS['LANG']->getLL('sectionTitle');\n\t\t$this->treeViewObj->thisScript = 'index.php?id='.$this->id;\n\n\t\treturn $this->treeViewObj->getBrowsableTree();\n\t}",
"function __construct(){\n\t\t$this->FieldNames = array( // ����� ����� �������\n\t\t'left' => 'cleft',\n\t\t'right'=> 'cright',\n\t\t'level'=> 'clevel',\n\t\t'title'=> 'title',\n\t\t);\n\t\t$this->IndexTitle = 'node_id';\n\t\t$this->TreeTable = 'content_tree';\n\n\t\t/*$Tree = new CDBTreeExt($AltDb,'catalog_categories','cid',$field_names);\n\t\t$this->Tree = $Tree;*/\n\t\tparent::__construct();\n\n\t\t$this->setParams('short_description');\n\n\n\n\t}",
"public function initCustomFieldsTree(){\r\n\r\n if ($this->_p->getVar('custom_fields') && count($this->_p->getVar('custom_fields')) > 0)\r\n return $this;\r\n\r\n $this->_p->setVar('custom_fields', oTree::build($this->_p, array('model' => 'Field'), false, function(oPortal &$p, &$elem, &$params){\r\n\r\n $elem['type'] = $elem['field_type'];\r\n\r\n $elem['multilang'] = isset($elem['multilang']) && $elem['multilang'] ? $elem['multilang'] : false;\r\n $elem['empty'] = isset($elem['empty']) && $elem['empty'] ? false : true;\r\n $elem['fullempty'] = isset($elem['fullempty']) && $elem['fullempty'] ? false : true;\r\n\r\n $elem['default_value'] = $elem['default_value'] != '' ? $elem['default_value'] : null;\r\n $elem['helptext'] = $elem['helptext'] != '' ? $elem['helptext'] : null;\r\n $elem['maxlength'] = $elem['maxlength'] ? $elem['maxlength'] : null;\r\n $elem['max_input_size'] = $elem['max_input_size'] ? $elem['max_input_size'] : null;\r\n $elem['width'] = $elem['width'] ? $elem['width'] : null;\r\n $elem['height'] = $elem['height'] ? $elem['height'] : null;\r\n $elem['visual'] = array();\r\n $elem['custom'] = true;\r\n $elem['children'] = array();\r\n\r\n // parse regular expression\r\n if ($elem['fieldReg'] != ''){\r\n // it is always parsed\r\n }\r\n\r\n if ($elem['unique']){\r\n $elem['unique'] = array();\r\n } else {\r\n unset($elem['unique']);\r\n }\r\n\r\n // add array values for select\r\n if ($elem['arr_name'] != ''){\r\n $elem['visual']['source'] = array();\r\n //$values = explode(\"\\r\\n\", $arr['arr_name']);\r\n $values = unserialize($elem['arr_name']);\r\n\r\n foreach ($values['items'] as $y){\r\n //$fields[$v['nick']]['visual']['source']['arr_name'][$y] = $y;\r\n //$this->_p->custom_fields[$arr['real_id']]['visual']['source']['arr_name'][$x+1] = $y;\r\n if ($y['picture']){\r\n $y['picture'] = unserialize($y['picture']);\r\n //$this->_visual['target_dir'].calc_item_path($params['id'])\r\n $y['picture'] = Images::get($p, $y['picture'], $p->getVar('files_dir').'fields/upload/', $elem['real_id']);\r\n }\r\n $elem['visual']['source']['arr_name'][$y['id']] = array('title' => $y['title'], 'weight' => $y['weight'], 'picture' => $y['picture']);\r\n\r\n }\r\n\r\n }\r\n\r\n // add array values for select\r\n if ($elem['tbl_name'] != '' && isset($p->getVar('tables')[$elem['tbl_name']])){\r\n $elem['visual']['source'] = array();\r\n $elem['visual']['source']['tbl_name'] = $elem['tbl_name'];\r\n // describe linker table and check for is_top field\r\n $desc_tbl = describe_table($p, $p->getVar('tables')[$elem['tbl_name']]);\r\n\r\n $fields_add = array();\r\n $order = $primary = null;\r\n if ($desc_tbl && !empty($desc_tbl)){\r\n\r\n foreach ($desc_tbl as $field){\r\n $fields_add[] = $field;\r\n if ($field == 'real_id'){\r\n $elem['visual']['source']['multilang'] = true;\r\n }\r\n if ($field == 'title'){\r\n $order = $field;\r\n }\r\n }\r\n }\r\n\r\n // check if order is absent\r\n if (!$order){\r\n if (in_array('sname', $fields_add))\r\n $order = 'sname';\r\n\r\n if (in_array('fname', $fields_add))\r\n $order = 'fname';\r\n\r\n if (in_array('mname', $fields_add))\r\n $order = 'mname';\r\n }\r\n\r\n // hack :)\r\n $elem['visual']['source']['conditions']['where'][$order] = array('op' => '<>', 'value' => '');\r\n $elem['visual']['source']['conditions']['order'][$order] = 'asc';\r\n\r\n }\r\n\r\n if ($elem['visual_type'] != '')\r\n $elem['visual']['type'] = $elem['visual_type'];\r\n elseif (!$elem['field_type'])\r\n $elem['visual']['type'] = 'group';\r\n\r\n // some patching for visual fields\r\n if ($elem['visual']['type'] == 'range'){\r\n $elem['visual']['fields'] = array('value2');\r\n }\r\n\r\n if ($elem['visual_accept'] != '')\r\n $elem['visual']['accept'] = explode(',', str_replace(' ', '', $elem['visual_accept']));\r\n\r\n if ($elem['title'] != '')\r\n $elem['visual']['title'] = $elem['title'];\r\n\r\n }));\r\n\r\n\t\tif ($this->_p->getVar('is_debug')){\r\n\t\t\t$this->_p->debug->add(\"oForms: After get serialized custom fields\");\r\n\t\t}\r\n\r\n return $this;\r\n\r\n\t}",
"public function init()\n {\n $bowerDir = \\Yii::app()->params['bower-asset'];\n /** @var CClientScript $cs */\n $cs = \\Yii::app()->getClientScript();\n /** @var \\CAssetManager $am */\n $am = \\Yii::app()->assetManager;\n if (false === $path = \\Yii::getPathOfAlias('bower.bootstrap-treeview.dist')) {\n throw new \\Exception(\"The BootstrapTreeView wrapper requires a bower path alias to be defined.\");\n }\n $url = $am->publish($path);\n $cs->registerScriptFile(\"$url/bootstrap-treeview.min.js\");\n $cs->registerCssFile(\"$url/bootstrap-treeview.min.css\");\n\n $options = array_merge($this->options, [\n 'data' => $this->prepareData($this->data),\n 'checkedIcon' => $this->checkedIcon,\n 'collapseIcon' => $this->collapseIcon,\n 'emptyIcon' => $this->emptyIcon,\n 'expandIcon' => $this->expandIcon,\n 'nodeIcon' => $this->nodeIcon,\n 'backColor' => $this->backColor,\n 'color' => $this->color,\n 'enableLinks' => $this->enableLinks,\n 'showTags' => $this->showTags,\n 'showCheckbox' => $this->showCheckboxes,\n 'levels' => $this->levels,\n 'multiSelect' => $this->multiSelect\n\n ]);\n\n if(isset($this->htmlOptions['id'])) {\n $id = $this->htmlOptions['id'];\n } else {\n $id = $this->htmlOptions['id'] = $this->getId();\n }\n\n $json = json_encode($options, JSON_PRETTY_PRINT);\n $cs->registerScript(\"bstreeview#$id\", \"$('#$id').treeview($json);\", \\CClientScript::POS_END);\n echo \\CHtml::openTag('div', $this->htmlOptions);\n\n }",
"public static function tree_browser($options) {\n global $indicia_templates;\n self::add_resource('treeBrowser');\n // Declare the data service\n $url = parent::$base_url.\"index.php/services/data\";\n // Apply some defaults to the options\n $options = array_merge(array(\n 'valueField' => $options['captionField'],\n 'id' => $options['fieldname'],\n 'divId' => 'div_'.$options['fieldname'],\n 'singleLayer' => TRUE,\n 'outerClass' => 'ui-widget ui-corner-all ui-widget-content tree-browser',\n 'listItemClass' => 'ui-widget ui-corner-all ui-state-default',\n 'default' => self::check_default_value($options['fieldname'],\n array_key_exists('default', $options) ? $options['default'] : ''),\n 'view' => 'list'\n ), $options);\n $escaped_divId=str_replace(':','\\\\\\\\:',$options['divId']);\n // Do stuff with extraParams\n $sParams = '';\n foreach ($options['extraParams'] as $a => $b) {\n $b = str_replace(\"'\", \"\\'\", $b);\n $sParams .= \"$a : '$b',\";\n }\n // lop the comma off the end\n $sParams = substr($sParams, 0, -1);\n extract($options, EXTR_PREFIX_ALL, 'o');\n self::$javascript .= \"\n$('div#$escaped_divId').indiciaTreeBrowser({\n url: '$url/$o_table',\n extraParams : {\n orderby : '$o_captionField',\n mode : 'json',\n $sParams\n },\n valueControl: '$o_id',\n valueField: '$o_valueField',\n captionField: '$o_captionField',\n view: '$o_view',\n parentField: '$o_parentField',\n nodeTmpl: '\".$indicia_templates['tree_browser_node'].\"',\n singleLayer: '$o_singleLayer',\n backCaption: '\" . lang::get('back') . \"',\n listItemClass: '$o_listItemClass',\n defaultValue: '$o_default'\n});\\n\";\n return self::apply_template('tree_browser', $options);\n }",
"private function _build_tree_select($params)\n\t{\n\t\t$table = $field->field_data['table'];\n\t\t$key_field = isset($field->field_data['key_field']) ? $field->field_data['key_field'] : 'id';\n\t\t$title_field = isset($field->field_data['title_field']) ? $field->field_data['title_field'] : 'title';\n\t\t$where = isset($field->field_data['where']) ? $field->field_data['where'] : array();\n\n\t\t$params = array_merge(array(\n\t\t\t'table' => $table, \n\t\t\t'key_field' => $key_field, \n\t\t\t'title_field' => $title_field, \n\t\t\t'where' => $where,\n\t\t), $params);\n\t\t\n\t\textract($params);\n\n\t\t$html = '';\n\t\tif ($pages = $this->CI->db->where($where)->select(\"{$table}.{$key_field}, {$table}.{$title_field}\")->get($table)->result())\n\t\t{\n\n\t\t\tforeach($pages as $page)\n\t\t\t{\n\t\t\t\t$html .= '<option value=\"' . $page->$key_field . '\"';\n\t\t\t\t$html .= $selected == $page->$key_field ? ' selected=\"selected\">': '>';\n\t\t\t\t$html .= $page->$title_field . '</option>';\n\t\t\t\t//$dropdown[$page->$key_field] = $page->$title_field;\n\t\t\t}\n\t\t}\n\t\t\n\n\t\treturn $html;\n\t}",
"public function __construct(Tree $tree, $activeUrl = null);",
"public function initializeTreeData() {}",
"private function sql_select_addTreeview()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // #32223, 120120, dwildt+\n // Get $treeviewEnabled\n $conf_view = $this->conf_view;\n $cObj_name = $conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'treeview.' ][ 'enabled' ];\n $cObj_conf = $conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'treeview.' ][ 'enabled.' ];\n $treeviewEnabled = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // Get $treeviewEnabled\n // RETURN no treeview\n if ( !$treeviewEnabled )\n {\n if ( $this->pObj->b_drs_filter )\n {\n $prompt = 'treeview is disabled. Has an effect only in case of cps_tcatree and a proper TCA configuration.';\n t3lib_div :: devlog( '[INFO/FILTER] ' . $prompt, $this->pObj->extKey, 0 );\n }\n return;\n }\n // RETURN no treeview\n // DRS\n if ( $this->pObj->b_drs_filter )\n {\n $prompt = 'treeview is enabled. Has an effect only in case of cps_tcatree and a proper TCA configuration.';\n t3lib_div :: devlog( '[INFO/FILTER] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n // Load the TCA for the current table\n $this->pObj->objZz->loadTCA( $table );\n\n // RETURN table hasn't any treeParentField in the TCA\n if ( !isset( $GLOBALS[ 'TCA' ][ $table ][ 'ctrl' ][ 'treeParentField' ] ) )\n {\n if ( $this->pObj->b_drs_filter )\n {\n $prompt = 'TCA.' . $table . '.ctrl.treeParentField isn\\'t set.';\n t3lib_div :: devlog( '[INFO/FILTER] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n return;\n }\n // RETURN table hasn't any treeParentField in the TCA\n // Get $tableTreeParentField\n $treeParentField = $GLOBALS[ 'TCA' ][ $table ][ 'ctrl' ][ 'treeParentField' ];\n $tableTreeParentField = $table . \".\" . $treeParentField;\n\n // Add $tableTreeParentField to the SELECT statement\n $addSelect = \", \" . $tableTreeParentField . \" AS '\" . $tableTreeParentField . \"'\";\n\n // Add $tableTreeParentField to the class var array\n $this->sql_filterFields[ $this->curr_tableField ][ 'treeParentField' ] = $tableTreeParentField;\n\n // Add table to arr_tablesWiTreeparentfield\n // #i0117, 141223, dwildt, 1-/+\n //$this->arr_tablesWiTreeparentfield[] = $table;\n $this->arr_tablesWiTreeparentfield[] = $this->curr_tableField;\n\n // DRS\n if ( $this->pObj->b_drs_filter )\n {\n $prompt = 'TCA.' . $table . '.ctrl.treeParentField is set. ' . $table . ' is configured for a tree view.';\n t3lib_div :: devlog( '[INFO/FILTER] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n\n return $addSelect;\n }",
"protected function GetMediaTreeSelectBox()\n {\n $html = '';\n $oTreeSelect = new TCMRenderMediaTreeSelectBox();\n $html .= $oTreeSelect->GetTreeOptions(null, true);\n\n $this->data['mediaTreeSelectBox'] = $html;\n }",
"private function __createTreeview()\n\t{\n\t\t// Adiciona o model\n\t\t$model = new GtkListStore(GObject::TYPE_STRING, GObject::TYPE_DOUBLE, GObject::TYPE_STRING);\n\t\t$this->widgets['trvMain']->set_model($model);\n\t\t\n\t\t// Adiciona as colunas\n\t\t$column1 = $this->widgets['trvMain']->add_column(new GtkCellRendererText(), \"Arquivo\", \"text\");\n\t\t$column2 = $this->widgets['trvMain']->add_column(new GtkCellRendererProgress(), \"Progresso\", \"value\");\n\t\t\n\t\t// Ajusta o tamanho das colunas\n\t\t$column1->set_min_width(300);\n\t\t$column1->set_max_width(300);\n\t\t\n\t\t// Adiciona o highlight\n\t\t$this->widgets['trvMain']->set_highlight(\"#FFFFFF\", \"#DEDEDE\");\n\t\t\n\t\t// Seta as opções de drop\n\t\t$this->widgets['trvMain']->drag_dest_set(Gtk::DEST_DEFAULT_ALL, array(array(\"text/uri-list\", 0, 0)), Gdk::ACTION_COPY);\n\t\t\n\t}",
"function TreeNode($data = null, $id = null)\r\n\t{\r\n\t\t$this->data = $data;\r\n\t\t$this->id = $id;\r\n\t\t$this->children = array();\r\n\t}",
"function _webform_tree_dropdown_validate(&$element, &$form_state) {\n\n $wftdid = $element['wftdid']['#value'];\n\n\n // Set the proper return value. I.e. instead of returning all the values\n // that are used for making the hierarchical_select form element type work,\n // we pass a flat array of item ids. e.g. for the taxonomy module, this will\n // be an array of term ids. If a single item is selected, this will not be\n // an array.\n // If the form item is disabled, set the default value as the return value,\n // because otherwise nothing would be returned (disabled form items are not\n // submitted, as described in the HTML standard).\n if (isset($element['#disabled']) && $element['#disabled']) {\n $element['#return_value'] = $element['#default_value'];\n }\n /*echo '<pre>';\n print_r($form_state['node']);\n exit();*/\n \n $element['#value'] = $element['#return_value'];\n form_set_value($element, $element['#value'], $form_state);\n\n // We have to check again for errors. This line is taken litterally from\n // form.inc, so it works in an identical way.\n if ($element['#required'] &&\n (!count($element['#value']) || (is_string($element['#value']) && strlen(trim($element['#value'])) == 0))) {\n form_error($element, t('!name field is required.', array('!name' => $element['#title'])));\n _webform_tree_dropdown_form_set_error_class($element);\n }\n}",
"function projectdropdown()\r\r\r\r\t{\r\r\r\r App::import(\"Model\", \"Project\");\r\r\r\r $this->Project = &new Project();\r\r\r\r \r\r\r\r \t $projectdata = $this->Project->find(\"all\", array('conditions' => \"Project.delete_status='0'\",'order'=>'Project.created ASC'),array('fields'=>array(\"DISTINCT Project.project_name\",\"Project.id\"))); \r\r\r\r $projectsdropdown = Set::combine($projectdata, '{n}.Project.id', '{n}.Project.project_name');\r\r\r\r asort($projectsdropdown);\r\r\r\r\t $this->set(\"projectdropdown\", $projectsdropdown);\r\r\r\r\t \r\r\r\r }",
"function optgrouptree($fieldName, $key, $tree, $level, $selected, $leaffilter = NULL, $allselectable = FALSE) {\n $output = '';\n if ($allselectable || !is_array($tree) || !isset($tree['Data'])) {\n if (!isset($leaffilter, $tree['Type']) || $leaffilter == $tree['Type']) {\n $output .= '<option value=\"'.$key.'\"'.set_select($fieldName, $key, ($key == $selected || is_array($selected) && in_array($key, $selected))).'>'.str_repeat(' ', $level*LEVELINDENT).(is_array($tree) ? htmlspecialchars($tree['Name']) : $tree).'</option>'.\"\\n\";\n }\n } \n if (is_array($tree) && isset($tree['Data'])) {\n if (!$allselectable)\n $output .= '<optgroup label=\"'.str_repeat(' ', $level*LEVELINDENT).$tree['Name'].'\">'.\"\\n\";\n foreach ($tree['Data'] as $ID => $subtree)\n $output .= optgrouptree($fieldName, $ID, $subtree, $level + 1, $selected, $leaffilter);\n }\n return $output;\n}",
"public function display_tree() { $this->style = 'tree'; }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds a new GmthBridgeAvisDecision with the given repository and avis decision. | public function __construct(GmthDataRepository $repository, GmthDataAvisDecision $avisDecision)
{
$this->_repository = $repository;
$this->_avis_decision = $avisDecision;
} | [
"public function __construct(GmthDataRepository $repository, GmthDataDecision $decision)\n\t{\n\t\t$this->_repository = $repository;\n\t\t$this->_decision = $decision;\n\t}",
"public function createBuilderForDecision(Expr\\BinaryOp $decision) {\n\t\t$partialCoverageBuilders = $partialCoverages = array();\n\t\tforeach (array($decision->left, $decision->right) as $partialExpression) {\n\t\t\t// the partial expression might also be a decision (e.g. in \"A && (B || C)\")\n\t\t\t$builder = $this->createBuilderForExpression($partialExpression);\n\t\t\t$partialCoverageBuilders[] = $builder;\n\t\t\t$partialCoverages[] = $builder->getCoverage();\n\t\t}\n\t\t$decisionCoverage = $this->coverageFactory->createCoverageForDecision($decision, $partialCoverages);\n\t\t$coverageBuilder = new DecisionCoverageBuilder($decisionCoverage, $partialCoverageBuilders, $this->log);\n\t\t$this->eventDispatcher->addSubscriber($coverageBuilder);\n\n\t\treturn $coverageBuilder;\n\t}",
"public function create(DecisionConfigInterface $config): DecisionInterface;",
"protected function handleAvisDecision(GmthApiAvisDecision $apiAvisDecision)\n\t{\n\t\tif(empty($apiAvisDecision->getId()))\n\t\t\treturn false;\n// \t\t\tthrow new GmthApiException('Empty id for api avis decision.');\n\t\tif(isset($this->_avis_decision[$apiAvisDecision->getId()]))\n\t\t\t$avisDecision = $this->_avis_decision[$apiAvisDecision->getId()];\n\t\telse\n\t\t{\n\t\t\t$avisDecision = new GmthDataAvisDecision();\n\t\t\t$this->_avis_decision[$apiAvisDecision->getId()] = $avisDecision;\n\t\t}\n\t\t$avisDecision->id = $apiAvisDecision->getId();\n\t\tif(!empty($apiAvisDecision->getNom()))\n\t\t\t$avisDecision->libelle = $apiAvisDecision->getNom();\n\t\t\n\t\treturn true;\n\t}",
"public function create(string $decision): DecisionInterface;",
"public function buildAnalysis(AnalysisBuilder $analysisBuilder);",
"protected function handleAvis(GmthApiAvis $apiAvis, GmthApiEvaluation $apiEvaluation)\n\t{\n\t\tif(empty($apiAvis->getId()))\n\t\t\treturn false;\n// \t\t\tthrow new GmthApiException('Empty id for given api avis.');\n\t\tif(isset($this->_avis[$apiAvis->getId()]))\n\t\t\t$avis = $this->_avis[$apiAvis->getId()];\n\t\telse\n\t\t{\n\t\t\t$avis = new GmthDataAvis();\n\t\t\t$this->_avis[$apiAvis->getId()] = $avis;\n\t\t}\n\t\t$avis->id = $apiAvis->getId();\n\t\t$avis->evaluation_id = $apiEvaluation->getId();\n\t\tif($apiAvis->getTypeDecision() !== null)\n\t\t{\n\t\t\t$this->handleTypeDecision($apiAvis->getTypeDecision());\n\t\t\tif(!empty($apiAvis->getTypeDecision()->getId()))\n\t\t\t\t$avis->type_decision_id = $apiAvis->getTypeDecision()->getId();\n\t\t}\n\t\t\n\t\t// those are booleans\n\t\t$avis->avis_commission = $apiAvis->getAvisCommission();\n\t\t$avis->auditif_obtenu = $apiAvis->getAuditifObtenu();\n\t\t$avis->mental_obtenu = $apiAvis->getMentalObtenu();\n\t\t$avis->moteur_obtenu = $apiAvis->getMoteurObtenu();\n\t\t$avis->visuel_obtenu = $apiAvis->getVisuelObtenu();\n\t\t\n\t\treturn true;\n\t}",
"public function elasticBuildAnalysis(AnalysisBuilder $analysisBuilder, Visibility $provider);",
"public function create(DecisionConfigInterface $config): DecisionInterface\n {\n $decision = $this->instantiateDecision($config->getDecisionType());\n\n foreach ($config->getRuleProviders() as $provider) {\n if (($provider instanceof RuleProviderInterface) === false) {\n throw new InvalidRuleProviderException(\\sprintf(\n 'RuleProvider \"%s\" does not implement %s',\n \\get_class($provider),\n RuleProviderInterface::class\n ));\n }\n\n foreach ($provider->getRules() as $rule) {\n if ($rule instanceof ExpressionLanguageAwareInterface) {\n $rule->setExpressionLanguage($this->getExpressionLanguage($config));\n }\n\n $decision->addRule($rule);\n }\n }\n\n return $decision;\n }",
"abstract protected function _build();",
"public function create(string $decision): DecisionInterface\n {\n if (isset($this->resolved[$decision])) {\n return $this->resolved[$decision];\n }\n\n $config = \\config(\\sprintf('easy-decision.decisions.%s', $decision), null);\n\n if ($config === null) {\n throw new InvalidArgumentException(\\sprintf('No decision configured for \"%s\"', $decision));\n }\n\n if (\\is_array($config)) {\n return $this->resolved[$decision] = $this->doCreateForConfig($decision, $config);\n }\n\n if (\\is_string($config) || $config instanceof DecisionConfigProviderInterface) {\n return $this->resolved[$decision] = $this->doCreateForConfigProvider($decision, $config);\n }\n\n throw new InvalidArgumentException(\\sprintf(\n 'Config for decision \"%s\" must be either an array, a string or an instance of %s, \"%s\" given',\n $decision,\n DecisionConfigProviderInterface::class,\n \\gettype($config)\n ));\n }",
"public function getDecisionById($id)\n\t{\n\t\tif($id === null)\n\t\t\treturn null;\n\t\t$this->ensureDecisionsLoaded(array($id));\n\t\tif(!isset($this->_decisions[$id]))\n\t\t\treturn null;\n\t\treturn new GmthBridgeDecision($this, $this->_decisions[$id]);\n\t}",
"public function build() {\n\n $links_unchecked = $this->connection->query('SELECT COUNT(1) FROM {ocms_linkchecker_link} WHERE last_checked = :last_checked AND status = :status', array(':last_checked' => 0, ':status' => 1))->fetchField();\n if ($links_unchecked > 0) {\n $links_all = $this->connection->query('SELECT COUNT(1) FROM {ocms_linkchecker_link} WHERE status = :status', array(':status' => 1))->fetchField();\n drupal_set_message($this->translation->formatPlural($links_unchecked,\n 'There is 1 unchecked link of about @links_all links in the database. Please be patient until all links have been checked via cron.',\n 'There are @count unchecked links of about @links_all links in the database. Please be patient until all links have been checked via cron.',\n array('@links_all' => $links_all)), 'warning');\n }\n\n $query = $this->query;\n\n $header = array(\n array('data' => $this->t('URL'), 'field' => 'url', 'sort' => 'desc'),\n array('data' => $this->t('Response'), 'field' => 'code', 'sort' => 'desc'),\n array('data' => $this->t('Error'), 'field' => 'error'),\n array('data' => $this->t('Operations')),\n );\n\n $result = $query\n ->limit(50)\n ->orderByHeader($header)\n ->execute();\n\n // Evaluate permission once for performance reasons.\n $accessEditLinkSettings = $this->currentUser->hasPermission('edit link settings');\n $accessAdministerBlocks = $this->currentUser->hasPermission('administer blocks');\n $accessAdministerRedirects = $this->currentUser('administer redirects');\n\n $rows = array();\n foreach ($result as $link) {\n // Get the node, block and comment IDs that refer to this broken link and\n // that the current user has access to.\n $nids = $this->access->accessNodeIds($link, $this->currentUser);\n// $cids = _linkchecker_link_comment_ids($link, $this->currentUser);\n// $bids = _linkchecker_link_block_ids($link);\n\n // If the user does not have access to see this link anywhere, do not\n // display it, for reasons explained in _linkchecker_link_access(). We\n // still need to fill the table row, though, so as not to throw off the\n // number of items in the pager.\n// if (empty($nids) && empty($cids) && empty($bids)) {\n if (empty($nids)) {\n $rows[] = array(array('data' => $this->t('Permission restrictions deny you access to this broken link.'), 'colspan' => count($header)));\n continue;\n }\n\n $links = array();\n\n // Show links to link settings.\n if ($accessEditLinkSettings) {\n\t$url = Url::fromRoute('ocms_linkchecker.edit_link', array('linkId' => $link->lid), array('query' => $this->redirectDestination->getAsArray()));\n $links[] = Link::fromTextAndUrl($this->t('Edit link settings'), $url)->toString();\n }\n\n // Show link to nodes having this broken link.\n foreach ($nids as $nid) {\n $url = Url::fromUri('internal:/node/' . $nid . '/edit', array('query' => $this->redirectDestination->getAsArray()));\n $links[] = Link::fromTextAndUrl($this->t('Edit node @node', array('@node' => $nid)), $url)->toString();\n }\n\n // Show link to comments having this broken link.\n// $comment_types = linkchecker_scan_comment_types();\n// if (module_exists('comment') && !empty($comment_types)) {\n// foreach ($cids as $cid) {\n// $links[] = l(t('Edit comment @comment', array('@comment' => $cid)), 'comment/' . $cid . '/edit', array('query' => drupal_get_destination()));\n// }\n// }\n\n // Show link to blocks having this broken link.\n// if ($accessAdministerBlocks) {\n// foreach ($bids as $bid) {\n// $links[] = l(t('Edit block @block', array('@block' => $bid)), 'admin/structure/block/manage/block/' . $bid . '/configure', array('query' => drupal_get_destination()));\n// }\n// }\n\n // Show link to redirect this broken internal link.\n// if (module_exists('redirect') && $access_administer_redirects && _linkchecker_is_internal_url($link)) {\n// $links[] = l(t('Create redirection'), 'admin/config/search/redirect/add', array('query' => array('source' => $link->internal, drupal_get_destination())));\n// }\n\n $url = Url::fromUri($link->url);\n // Create table data for output.\n $rows[] = array(\n 'data' => array(\n Link::fromTextAndUrl(Html::escape($link->url), $url)->toString(),\n Html::escape($link->code),\n Html::escape($link->error),\n ['data' => ['#theme' => 'item_list', '#items' => $links]],\n ),\n );\n }\n\n $build['broken_links_table'] = array(\n '#type' => 'table',\n '#header' => $header,\n '#rows' => $rows,\n '#empty' => $this->t('No broken links have been found.'),\n );\n $build['broken_links_pager'] = array('#type' => 'pager');\n\n // I think I may not need to set cache meta data\n // @todo: How do I want to cache this page?\n // Will I use cache tags, cache contexts, both of them?\n //$build['#cache']['tags'][] = 'node_list';\n return $build;\n }",
"public function createForVcsBranch(): self\n {\n $this->createPlanBranch = new CreatePlanBranches(\n CreatePlanBranches::TRIGGER_BRANCH, null\n );\n\n return $this;\n }",
"public function build() {\n // This seems circular for no real reason....\n $this->converter->build_plan();\n $this->built = true;\n }",
"public function buildFromSelection($selection){\r\n\t\t$this->visitSelectionRelations($selection,0);\r\n\t}",
"public function build()\n {\n $workflowPath = $this->getWorkflowPath();\n $scriptName = $this->getScriptName();\n $binName = $this->getBinaryName();\n $scriptPath = $workflowPath . $scriptName;\n $go = $this->individualizationConfig->getValue('golang.binary.path', 'go', Util_Config::STRING);\n\n $env = $this->getEnvironmentVariables();\n $this->setEnvironmentVariables($env);\n\n $cmd = $this->getExportGoFlags() . $go . ' build -o ' . $workflowPath . $binName . ' ' . $scriptPath;\n $result = $this->runCommand($cmd);\n\n if ($result['exit_code'] === 0) {\n return true;\n }\n\n return false;\n }",
"public function __construct(GmthDataRepository $repository, GmthDataCandidat $candidat)\n\t{\n\t\t$this->_repository = $repository;\n\t\t$this->_candidat = $candidat;\n\t}",
"public function conditionalAccessPolicyCoverages(): ConditionalAccessPolicyCoveragesRequestBuilder {\n return new ConditionalAccessPolicyCoveragesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get latest OpenSSL error message. | protected static function _getLastOpenSSLError(): string
{
$msg = '';
while (false !== ($err = openssl_error_string())) {
$msg = $err;
}
return $msg;
} | [
"protected function _getLastOpenSSLError(): string\n {\n $msg = '';\n while (false !== ($err = openssl_error_string())) {\n $msg = $err;\n }\n return $msg;\n }",
"public static function lastError()\n {\n return new static(openssl_error_string());\n }",
"private function openSslErrors(): string\n {\n $errors = [];\n\n while ($error = openssl_error_string()) {\n $errors[] = $error;\n }\n\n if ([] !== $errors) {\n return \"\\n\" . implode(\"\\n* \", $errors);\n }\n\n return '';\n }",
"function openssl_error_string(): string|false {}",
"public function getErrMsg() {\n return $this->get(self::ERR_MSG);\n }",
"public function last_error_message();",
"public static function getLastError() {\n\n\t\tif (!function_exists('error_get_last')) {\n\t\t\treturn '[Cannot get error message]';\n\t\t}\n\n\t\t$error = error_get_last();\n\t\tif ($error === NULL) {\n\t\t\treturn '[No error message found]';\n\t\t}\n\n\t\treturn $error['message'];\n\t}",
"public function getLastError(): string\n {\n return $this->mailObj->getLastError();\n }",
"protected function getLastErrorMessage() {\n\t\t$errno = smbclient_state_errno($this->connection);\n\t\treturn posix_strerror($errno);\n\t}",
"function dump_openssl_errors() {\n\twhile (($error_string = openssl_error_string()) !== false) {\n\t\tvar_dump($error_string);\n\t}\n}",
"public function last_error_string(){\n return socket_strerror( $this->last_error() );\n }",
"public function get_last_message( $error_code = NULL );",
"public function getLastError()\n\t{\n\t\t$body = $this->last_response->body;\n\n\t\tif (isset($body['message']))\n\t\t{\n\t\t\treturn $body['message'];\n\t\t}\n\n\t\treturn 'An unspecified error occured';\n\t}",
"public abstract function last_error_as_plain_text ();",
"public function get_error_message()\n\t{\n\t\treturn $this->error;\n\t}",
"public function get_error_message() {\n\t\treturn $this->error_message;\n\t}",
"public function getLastErrorMessage()\n {\n \t// if got exception:\n \tif (!is_null($this->lastError))\n \t{\n \t\treturn $this->lastError->getMessage();\n \t}\n \t\n \t// if got response but its error\n \tif (!is_null($this->lastResponse) && $this->lastResponse->isError())\n \t{\n \t\treturn \"Got error code from server - \" . $this->lastResponse->getStatus() . \".\";\n \t}\n \t\n \treturn null;\n }",
"protected function _readErrorMessage()\n {\n try {\n $sErrorResponse = $this->io->read(self::ERROR_RESPONSE_SIZE);\n } catch (Throwable $e) {\n /**\n * Read IO exception exposed as Push exception so its catched properly\n */\n throw new ApnsPHP_Push_Exception($e->getMessage());\n }\n\n if (!$sErrorResponse) {\n /**\n * No response from APNS in (some period) time\n */\n return null;\n }\n\n if (self::ERROR_RESPONSE_SIZE !== strlen($sErrorResponse)) {\n throw new RuntimeException(\n 'Unexpected response size: ' . strlen($sErrorResponse)\n );\n }\n\n $aErrorResponse = unpack('Ccommand/CstatusCode/Nidentifier', $sErrorResponse);\n\n if (empty($aErrorResponse)) {\n /**\n * In theory unpack ALWAYS returns array:\n * Returns an associative array containing unpacked elements of binary string.\n *\n * @see http://php.net/manual/en/function.unpack.php\n */\n throw new RuntimeException('Failed to unpack response data');\n }\n\n if (!isset($aErrorResponse['command'], $aErrorResponse['statusCode'], $aErrorResponse['identifier'])\n || self::ERROR_RESPONSE_COMMAND !== $aErrorResponse['command']) {\n throw new RuntimeException(\n 'Unpacked error response has unexpected format: ' . json_encode($aErrorResponse)\n );\n }\n\n $aErrorResponse['time'] = time();\n\n $errMsg = 'Unknown error code: ' . $aErrorResponse['statusCode'];\n switch ($aErrorResponse['statusCode']) {\n case 0:\n $errMsg = 'No errors encountered';\n\n break;\n case 1:\n $errMsg = 'Processing error';\n\n break;\n case 2:\n $errMsg = 'Missing device token';\n\n break;\n case 3:\n $errMsg = 'Missing topic';\n\n break;\n case 4:\n $errMsg = 'Missing payload';\n\n break;\n case 5:\n $errMsg = 'Invalid token size';\n\n break;\n case 6:\n $errMsg = 'Invalid topic size';\n\n break;\n case 7:\n $errMsg = 'Invalid payload size';\n\n break;\n case 8:\n $errMsg = 'Invalid token';\n\n break;\n case 10:\n $errMsg = 'Shutdown';\n\n break;\n case 128:\n $errMsg = 'Protocol error';\n\n break;\n case 255:\n $errMsg = 'None (unknown)';\n\n break;\n }\n $aErrorResponse['statusMessage'] = $errMsg;\n\n return $aErrorResponse;\n }",
"public function get_error_message() {\n\n\t\treturn isset( $this->response_data->error->message ) ? $this->response_data->error->message : '';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set use pathstyle URI's | public function setUsePathStyleUri($value = false)
{
$this->_usePathStyleUri = $value;
return $this;
} | [
"protected function setURI()\n {\n $this->uri = $this->protocol . $this->host . '/' . $this->prefix . $this->path;\n }",
"protected function setUri(){\n $this->uri = array_values(\n array_filter(\n explode('/', $this->request->getUri()\n )));\n }",
"public function setUsePathStyleUri($value = false)\n {\n $this->_azureTableUtil->setUsePathStyleUri($value);\n }",
"function setUri($uri);",
"public function setUpUri()\n {\n $this->type = 'uri';\n }",
"private function uri()\n {\n $this->hexpress\n ->start($this->scheme())\n ->with(':')\n ->has($this->hierPart())\n ->maybe($this->query())\n ->maybe($this->fragment())\n ->end()\n ;\n }",
"public function setURI($uri);",
"public function setURI(string $uri);",
"function set_uri($uri) {\n $this->uri = $uri;\n }",
"abstract public function withUri(): string;",
"public function setBaseUri($uri) {}",
"public function setUrl(){\n\n $this->url = explode('/',URI);\n\n }",
"final public static function setUriOption(array $option):void\n {\n self::$config['option']['uri'] = Uri::option($option);\n }",
"private function uri()\n {\n $uri = '/';\n $uri .= $this->config['version'];\n $uri .= '/';\n $accessPoint = Session::Get('AccessPoint');\n\n $uri .= $accessPoint ? $accessPoint : '';\n $uri .= $accessPoint ? '/' : '';\n $uri .= $this->rel('resource');\n $uri .= '/';\n\n $this->options([\n 'request' => [\n 'uri' => $uri,\n ],\n ]);\n return $uri;\n }",
"function setUri($requestUri);",
"private function setPath()\n {\n $restoUrl = filter_input(INPUT_GET, '_path', FILTER_UNSAFE_RAW);\n if (isset($restoUrl)) {\n $this->path = ($restoUrl !== '/' && substr($restoUrl, -1) === '/' ? substr($restoUrl, 0, strlen($restoUrl) - 1) : $restoUrl);\n }\n }",
"public function setBaseUri($uri);",
"abstract function fromURIPath($path);",
"public function testSetPath()\n {\n $uri = $this->_newUri();\n $uri->setPath('/very/special/example/');\n $this->assertSame($uri->path, array('very', 'special', 'example'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Statut de l'auteur en cours dans une rubrique | function ciar_auteur_ec_statut($id_rubrique=0) {
$return = "";
$cistatut = "";
if (isset($GLOBALS['visiteur_session']['id_auteur']) && $GLOBALS['visiteur_session']['id_auteur'])
$id_auteur = $GLOBALS['visiteur_session']['id_auteur'];
else
$id_auteur = 0;
if ($id_auteur>0 AND $id_rubrique>0) {
// la rubrique est un EC
if (ciar_rub_ec($id_rubrique)) {
$row = sql_fetsel("id_rubrique", "spip_ciar_rubriques_protection", "id_rubrique=".$id_rubrique." AND acces_restreint='_acces_indiv'","","");
// la rubrique est un EC (direct et pas par heritage)
if ($row) {
$row2 = sql_fetsel("cistatut_auteur_rub", "spip_ciar_auteurs_acces_rubriques", "id_rubrique=".$id_rubrique." AND id_auteur=".$id_auteur,"","");
if ($row2)
$cistatut = $row2['cistatut_auteur_rub'];
} else {
// rechercher le parent EC (direct et pas par heritage)
$id_parent = ciar_parent_protege($id_rubrique);
$row3 = sql_fetsel("cistatut_auteur_rub", "spip_ciar_auteurs_acces_rubriques", "id_rubrique=".$id_parent." AND id_auteur=".$id_auteur,"","");
if ($row3)
$cistatut = $row3['cistatut_auteur_rub'];
}
if ($cistatut) {
if (in_array($cistatut, array('0minirezo', '1comite', '6forum', 'ciredval', 'ciredvaltout', 'eccma')))
$return = $cistatut;
}
}
}
return $return;
} | [
"public function auteur()\n {\n return $this->auteur;\n }",
"public function getAuteur() : string\r\n\t{\r\n\t\treturn $this->Auteur ?? 'Inconnu'; \r\n\t}",
"function ciar_auteur_ec_statut_normalise($id_rubrique=0) {\n\t$return = \"\";\n\t\n\t$cistatut = ciar_auteur_ec_statut($id_rubrique);\n\n\tif ($cistatut) {\n\t\tif ($cistatut=='0minirezo' OR $cistatut=='1comite' OR $cistatut=='6forum')\n\t\t\t$return = $cistatut;\n\t\telseif ($cistatut=='ciredval' OR $cistatut=='ciredvaltout')\n\t\t\t$return = '1comite';\t\n\t\telseif ($cistatut=='eccma')\n\t\t\t$return = '0minirezo';\t\n\t}\n\n\treturn $return;\t\n}",
"function acces_statut($id_auteur, $statut, $bio)\n{\n\tif ($statut != 'nouveau') return $statut;\n\tinclude_spip('inc/filtres');\n\tif (!($s = tester_config('', $bio))) return $statut;\n\tinclude_spip('action/editer_auteur');\n\tinstituer_auteur($id_auteur,array('statut'=> $s));\n\tinclude_spip('inc/modifier');\n\trevision_auteur($id_auteur, array('bio'=>''));\n\tinclude_spip('inc/session');\n\tsession_set('statut',$s);\n\treturn $s;\n}",
"function inc_instituer_auteur_dist($auteur, $modif = true) {\n\n\tif (!$id_auteur = intval($auteur['id_auteur'])) {\n\t\t$statut = _STATUT_AUTEUR_CREATION;\n\t} else\n\t\t$statut = $auteur['statut'];\n\n\t$ancre = \"instituer_auteur-\" . intval($id_auteur);\n\n\t$menu = $modif ? choix_statut_auteur($statut, $id_auteur, \"$ancre-aff\"):traduire_statut_auteur($auteur['statut']);\n\tif (!$menu) return '';\n\n\t$label = $modif?'label':'b';\n\t$res = \"<$label>\" . _T('info_statut_auteur').\"</$label> \" . $menu;\n\n\t// Prepare le bloc des rubriques pour les admins eventuellement restreints ;\n\t// si l'auteur n'est pas '0minirezo', on le cache, pour pouvoir le reveler\n\t// en jquery lorsque le menu de statut change\n\t$vis = in_array($statut, explode(',', _STATUT_AUTEUR_RUBRIQUE))\n\t\t? ''\n\t\t: \" style='display: none'\";\n \n\tif ($menu_restreints = choix_rubriques_admin_restreint($auteur, $modif))\n\t\t$res .= \"<div class='instituer_auteur' \"\n\t\t . ($modif?\"id='$ancre-aff'\":'') // seul le bloc en modification necessite un id\n\t\t . \"$vis>\"\n\t\t\t. $menu_restreints\n\t\t\t. \"</div>\";\n\n\treturn $res;\n}",
"public function getAuteur()\n {\n return $this->auteur;\n }",
"function cirr_tableau_rubriques_auteur() {\n\tif (isset($GLOBALS['visiteur_session']['id_auteur']) AND $GLOBALS['visiteur_session']['id_auteur'])\n\t\treturn liste_rubriques_auteur($GLOBALS['visiteur_session']['id_auteur']);\n\telse\n\t\treturn array(0);\n}",
"function droits_telecharge_auteur($id_auteur, $origine, $statut_doc) {\n\n\t$raut=sql_fetsel(\"statut\",\"spip_auteurs\",'id_auteur=$id_auteur\"');\n\t$statut_aut=$raut['statut'];\n\t\n\tswitch ($statut_aut) {\n\t\tcase '0minirezo':\n\t\t\t$diffusion = '1';\n\t\tbreak;\n\t\tcase '1comite':\n\t\t\t$diffusion = ($statut_doc<='2')? '1':'0';\n\t\tbreak;\n\t\tcase '6forum':\n\t\t\t$diffusion = ($statut_doc<='1')? '1':'0';\n\t\tbreak;\n\t}\n\treturn $diffusion;\n}",
"function droits_telecharge_auteur($id_auteur, $origine, $statut_doc) {\r\n\t$qaut=spip_query(\"SELECT statut FROM spip_auteurs WHERE id_auteur=$id_auteur\");\r\n\t\r\n\t$raut=spip_fetch_array($qaut);\r\n\t$statut_aut=$raut['statut'];\r\n\t\r\n\tswitch ($statut_aut) {\r\n\t\tcase '0minirezo':\r\n\t\t\t$diffusion = '1';\r\n\t\tbreak;\r\n\t\tcase '1comite':\r\n\t\t\t$diffusion = ($statut_doc<='2')? '1':'0';\r\n\t\tbreak;\r\n\t\tcase '6forum':\r\n\t\t\t$diffusion = ($statut_doc<='1')? '1':'0';\r\n\t\tbreak;\r\n\t}\r\n\treturn $diffusion;\r\n}",
"function ciar_tableau_membres($id_rubart) {\n\n\tstatic $auteurs = array();\n\n\tif (!$auteurs) {\n\t\tif ($id_rubart>0) {\n\n\t\t\t// Est-ce un EC directement ou par héritage ?\n\t\t\twhile ($id_rubart) {\n\t\t\t\tif (sql_fetsel(\"id_rubrique\", \"spip_ciar_rubriques_protection\", \"id_rubrique=$id_rubart AND acces_restreint='_acces_indiv'\",\"id_rubrique\",\"\")) {\n\t\t\t\t\t$id_rubrique = $id_rubart;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t$row = sql_fetsel(\"id_parent\", \"spip_rubriques\", \"id_rubrique=$id_rubart\",'', '');\n\t\t\t\t\t$id_rubart = $row['id_parent'];\n\t\t\t\t\tif ($id_rubart<1) break;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\t\t\t\n\t\t\tif ($id_rubrique>0) {\n\t\t\t\t// auteurs affectees directement a la rubrique\n\t\t\t\t$auteurs = array();\n\t\t\t\t$q = sql_select(\"id_auteur\", \"spip_ciar_auteurs_acces_rubriques\", \"id_rubrique=$id_rubrique AND id_auteur!=0\");\n\t\t\t\twhile ($row = sql_fetch($q)) {\n\t\t\t\t\t$id_auteur = $row['id_auteur'];\n\t\t\t\t\t$auteurs[$id_auteur] = $id_auteur;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (defined('_DIR_PLUGIN_CIAG')){\n\t\t\t\t\t// groupes d'auteurs affectees a cette rubrique\n\t\t\t\t\t$groupes = array();\n\t\t\t\t\t$q = sql_select(\"id_groupe\", \"spip_ciag_grpauteurs_rubriques\", \"id_rubrique=$id_rubrique\");\n\t\t\t\t\twhile ($row = sql_fetch($q)) {\n\t\t\t\t\t\t$id_groupe = $row['id_groupe'];\n\t\t\t\t\t\t$groupes[$id_groupe] = $id_groupe;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t// auteurs des groupes d'auteurs de cette rubrique\n\t\t\t\t\tif (count($groupes)>=1) {\n\t\t\t\t\t\t$where = \"id_groupe IN (\".implode(\",\",$groupes).\")\";\n\t\t\t\t\t\t$q = sql_select(\"id_auteur\", \"spip_ciag_grpauteurs_auteurs\", $where);\n\t\t\t\t\t\twhile ($row = sql_fetch($q)) {\n\t\t\t\t\t\t\t$id_auteur = $row['id_auteur'];\n\t\t\t\t\t\t\tif (!in_array($id_auteur,$auteurs))\n\t\t\t\t\t\t\t\t$auteurs[$id_auteur] = $id_auteur;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\n\t\t}\n\t}\n\n\treturn $auteurs;\t\t\n}",
"function tous_auteurs_date_passage() {\r\n\tglobal $couleur_claire, $connect_id_auteur;\r\n\r\n\t// fixer le nombre de ligne du tableau (tranche)\r\n\t$fl = $GLOBALS['actijour']['nbl_aut'];\r\n\r\n\t// recup $vl dans URL\r\n\t$dl = intval(_request('vl'));\r\n\t$dl = ($dl + 0);\r\n\t// valeur de tranche affichꥍ\r\n\t$nba1 = $dl + 1;\r\n\r\n\t$p_st = _request('st');\r\n\tif (!$p_st) {\r\n\t\t$where_st = \"statut IN ('0minirezo','1comite','6forum')\";\r\n\t\t$p_st = 'tous';\r\n\t} else {\r\n\t\t$where_st = \"statut = \" . _q($p_st);\r\n\t}\r\n\r\n\t$q = sql_select(\"SQL_CALC_FOUND_ROWS id_auteur, statut, nom,\r\n\t\t\t\t\t\tDATE_FORMAT(en_ligne,'%d/%m/%y %H:%i') AS vu \"\r\n\t\t. \"FROM spip_auteurs \"\r\n\t\t. \"WHERE $where_st \"\r\n\t\t. \"ORDER BY en_ligne DESC,nom \"\r\n\t\t. \"LIMIT $dl,$fl\"\r\n\t);\r\n\r\n\t// recup nombre total d'entrees\r\n\t$nl = sql_select(\"FOUND_ROWS()\");\r\n\t$found = @sql_fetch($nl);\r\n\t$nb_auteurs = $found['FOUND_ROWS()'];\r\n\r\n\t$ifond = 0;\r\n\r\n\t$aff = '';\r\n\r\n\t# onglet select statut\r\n\t$lst_statut = array('tous', '0minirezo', '1comite', '6forum');\r\n\t$script = _request('exec');\r\n\r\n\t$aff .= debut_onglet();\r\n\tforeach ($lst_statut as $statut) {\r\n\t\t$aff .= onglet(_T('actijour:onglet_connect_' . $statut),\r\n\t\t\tgenerer_url_ecrire($script, 'st=' . ($statut == 'tous' ? '' : $statut)),\r\n\t\t\t$statut,\r\n\t\t\t($p_st == $statut ? $statut : ''), '');\r\n\t}\r\n\t$aff .= fin_onglet();\r\n\r\n\r\n\t# tableau\r\n\t#\r\n\t$aff .= debut_cadre_relief(\"annonce.gif\", true);\r\n\r\n\t$aff .= \"<table align='center' border='0' cellpadding='2' cellspacing='0' width='100%'>\\n\"\r\n\t\t. \"<tr><td colspan='3' class='verdana3 bold'>\" . _T('actijour:tous_date_connections')\r\n\t\t. \"</td></tr>\";\r\n\t# Tranches\r\n\t$aff .= \"<tr><td colspan='3' class='verdana3 bold'>\";\r\n\t$aff .= \"<div align='center' class='iconeoff verdana2 bold' style='clear:both;'>\\n\"\r\n\t\t. tranches_liste_art($nba1, $nb_auteurs, $fl)\r\n\t\t. \"\\n</div>\\n\";\r\n\t$aff .= \"</td></tr>\";\r\n\r\n\twhile ($row = sql_fetch($q)) {\r\n\t\t$ifond = $ifond ^ 1;\r\n\t\t$couleur = ($ifond) ? '#FFFFFF' : $couleur_claire;\r\n\r\n\t\t$aff .= \"<tr bgcolor='$couleur'>\"\r\n\t\t\t. \"<td width='5%'>\\n\"\r\n\t\t\t. bonhomme_statut($row) . \"</td>\\n\"\r\n\t\t\t. \"<td width='75%'>\"\r\n\t\t\t. \"<a class='verdana2 bold' href='\" . generer_url_ecrire(\"auteur_infos\", \"id_auteur=\" . $row['id_auteur']) . \"'>\"\r\n\t\t\t. entites_html($row['nom']) . \"</a>\\n\"\r\n\t\t\t. \"<td width='20%'>\\n\"\r\n\t\t\t. \"<div align='right' class='verdana1'>\" . $row['vu'] . \"</div>\\n\"\r\n\t\t\t. \"</td></tr>\\n\";\r\n\r\n\t}\r\n\t$aff .= \"</table>\\n\\n\";\r\n\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}",
"public static function verifAuteur() {\n global $pdo;\n $id_ano = Membre::getIdFromPseudo(\"anonyme\");\n\n $req = $pdo->prepare(\"UPDATE `urls` SET `auteur`=:idano WHERE auteur IS NULL;\");\n $req->bindParam(':idano', $id_ano);\n $req->execute();\n }",
"public function bureauUitgebreid()\n {\n\n }",
"public function getOuvriereNourriturePlaine()\n {\n return $this->ouvriereNourriturePlaine;\n }",
"public function getStatutsujet()\r\n {\r\n return $this->statutsujet;\r\n }",
"function tableau_visites_rubriques($date) {\r\n\tglobal $couleur_claire;\r\n\r\n\t$tab_rubart = rubriques_du_jour($date);\r\n\r\n\t$aff = '';\r\n\t$aff .= debut_cadre_relief('rubrique-24.gif', true);\r\n\t$aff .= \"<div class='cart_titre_bold verdana3'>\" . _T('actijour:repartition_visites_secteurs') . \"</div>\";\r\n\r\n\tif ($tab_rubart) {\r\n\t\t// add visites\r\n\t\t$nbr = 0;\r\n\t\tforeach ($tab_rubart as $s => $c) {\r\n\t\t\t$nbr += $c['vis'];\r\n\t\t}\r\n\r\n\t\t$ifond = 0;\r\n\r\n\t\t$aff .= \"<table cellpadding='2' cellspacing='0' width='100%' border='0'>\\n\";\r\n\r\n\t\tforeach ($tab_rubart as $sect => $cat) {\r\n\t\t\t$ifond = $ifond ^ 1;\r\n\t\t\t$couleur = ($ifond) ? '#FFFFFF' : $couleur_claire;\r\n\t\t\t$s_titre = typo(info_rubrique($sect));\r\n\t\t\t$prct_s = round(($cat['vis'] / $nbr) * 100, 1);\r\n\r\n\t\t\t$aff .= \"<tr bgcolor='$couleur'>\\n<td colspan='2'>\"\r\n\t\t\t\t. http_img_pack('secteur-12.gif', 'ico', 'align=\\'absmiddle\\'', '') . \" <b>\"\r\n\t\t\t\t. supprimer_numero($s_titre) . \"</b></td>\\n\"\r\n\t\t\t\t. \"<td width='8%'><div align='right'><b>\"\r\n\t\t\t\t. $cat['vis'] . \"</b></div></td>\\n\"\r\n\t\t\t\t. \"<td width='12%'><div class='verdana2 bold' align='right'>\"\r\n\t\t\t\t. $prct_s . \"%</div></td>\\n\"\r\n\t\t\t\t. \"</tr>\\n\";\r\n\r\n\t\t\tif ($cat['rub']) {\r\n\t\t\t\tforeach ($cat['rub'] as $idr => $vis) {\r\n\t\t\t\t\t$r_titre = typo(info_rubrique($idr));\r\n\t\t\t\t\t$prct_r = round(($vis / $nbr) * 100, 1);\r\n\r\n\t\t\t\t\t$aff .= \"<tr bgcolor='$couleur'>\\n<td width='2%'> </td>\"\r\n\t\t\t\t\t\t. \"<td>\"\r\n\t\t\t\t\t\t. http_img_pack('rubrique-12.gif', 'ico', 'align=\\'absmiddle\\'', '') . \" \"\r\n\t\t\t\t\t\t. supprimer_numero($r_titre) . \"</td>\\n\"\r\n\t\t\t\t\t\t. \"<td width='8%'><div align='right'>\"\r\n\t\t\t\t\t\t. $vis . \"</div></td>\\n\"\r\n\t\t\t\t\t\t. \"<td width='12%'><div class='verdana1' align='right'>\"\r\n\t\t\t\t\t\t. $prct_r . \"%</div></td>\\n</tr>\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$aff .= \"</table>\\n\";\r\n\t}\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}",
"function profils_verifier_auteur_souscription($id_souscription,&$champs,$notifier = true){\n\t$id_auteur = 0;\n\t$message = \"\";\n\t$cadeau = false;\n\n\tif (!$souscription = sql_fetsel(\"*\",\"spip_souscriptions\",\"id_souscription=\".intval($id_souscription))){\n\t\treturn \"\";\n\t}\n\n\n\t$souscription_m = array_merge($souscription,$champs);\n\t// attention si c'est un cadeau prendre l'email du destinataire du cadeau\n\t// et l'auteur eventuellement deja cree pour lui\n\tif (isset($souscription_m['cadeau'])\n\t\tAND $cadeau = $souscription_m['cadeau']\n\t AND $cadeau = unserialize($cadeau)){\n\t\t$email = $cadeau['courriel'];\n\t\t$id_auteur = (isset($cadeau['id_auteur'])?$cadeau['id_auteur']:0);\n\t}\n\telse {\n\t\t$email = $souscription_m['courriel'];\n\t\tif (isset($champs['id_auteur']) AND $champs['id_auteur'])\n\t\t\t$id_auteur = $champs['id_auteur'];\n\t\tif (!$id_auteur)\n\t\t\t$id_auteur = $souscription['id_auteur'];\n\t}\n\n\t// est-ce que l'auteur existe bien ?\n\t// $id_auteur == -1 pour ne pas creer d'auteur\n\tif ($id_auteur>0 AND !sql_countsel('spip_auteurs','id_auteur='.intval($id_auteur))){\n\t\t$id_auteur = 0;\n\t}\n\n\t// si pas d'id_auteur deja connu pour la souscription\n\tif (!$id_auteur AND $email){\n\n\t\t// cet auteur existe deja ?\n\t\tif ($row = sql_fetsel(\"*\",\"spip_auteurs\",\"email=\".sql_quote($email).\" AND statut<>\".sql_quote(\"5poubelle\"))){\n\t\t\t$id_auteur = $row['id_auteur'];\n\t\t\t$message = _T('profils:message_info_creation_profil',array('email' => $email));\n\t\t}\n\t\telse {\n\t\t\tinclude_spip(\"inc/profils\");\n\t\t\tif ($cadeau AND !isset($champs['cadeau']))\n\t\t\t\t$champs['cadeau'] = serialize($cadeau);\n\t\t\tif ($id_auteur = profils_creer_depuis_souscription($souscription,$notifier)){\n\t\t\t\t$message = _T('profils:message_info_deja_profil',array('email' => $email));\n\t\t\t}\n\t\t}\n\t\tif ($id_auteur){\n\t\t\tif ($cadeau){\n\t\t\t\t$cadeau['id_auteur'] = $id_auteur;\n\t\t\t\t$champs['cadeau'] = serialize($cadeau);\n\t\t\t\t// si jamais l'auteur de la souscription est connu, on lui attribue la souscription, c'est mieux\n\t\t\t\tif ( ($email2 = $souscription_m['courriel'] OR $email2=$souscription['courriel'])\n\t\t\t\t AND $id2 = sql_getfetsel(\"id_auteur\",\"spip_auteurs\",\"email=\".sql_quote($email2).\" AND statut<>\".sql_quote(\"5poubelle\"))){\n\t\t\t\t\t$champs['id_auteur'] = $id2;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$champs['id_auteur'] = $id_auteur;\n\t\t\t\t// doit on le loger ? oui si pas d'historique de souscription (a confirmer)\n\t\t\t\tif (!sql_countsel(\"spip_souscriptions\",\"id_auteur=\".intval($id_auteur).\" AND id_souscription<>\".intval($id_souscription))){\n\t\t\t\t\t// TODO : loger l'auteur ?\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $message;\n}",
"function affichComOeuvreFromId($id_artiste){ \n$req = \"SELECT * FROM commentaire WHERE id_membre = $id_artiste ORDER by date_updated DESC\";\n$res = mysql_query($req);\n$titre = \"\";\n\twhile($ligne = mysql_fetch_assoc($res))\n\t{\n\t$req_o = \"SELECT titre FROM oeuvre WHERE id_oeuvre = \".$ligne['id_oeuvre'].\" ORDER by date_updated DESC\";\n\t$res_o = mysql_query($req_o);\n\t$ligne_o = mysql_fetch_assoc($res_o);\n\t$heure = conversionToHourFacebook(new DateTime($ligne['date_updated']));\n\t$type = getTypeId($ligne['id_membre']);\n\t$src = getSrcAvatar($ligne['id_membre'],$type);\n\t$id_commentaire = $ligne['id_commentaire'];\n\t$titre = ($titre == $ligne_o['titre'])? \" \" : $ligne_o['titre'];\n\techo \"<div>$titre</div>\";\n\t\techo \"<div class='pane post' id='$id_commentaire'>\n\t\t\t<img src='$src'\t\talt='avatar' id='img_mini' width='50px' height='50px'>\n\t\t\t<div id='post_text'>\n\t\t\t\t<div>\".$ligne['txt_com'].\"</div>\n\t\t\t\t<span><a href='#'>\".getPseudo($ligne['id_membre'],$type).\"</a></span>\n\t\t\t\t<span>$heure</span>\n\t\t\t</div>\";\n\t\techo \"</div>\";\n\t}\n}",
"function formatAuteurEtContributeursAPA($auteurs_et_contributeurs) {\n // Init\n $liste_auteurs = \"\";\n $liste_contributeurs = \"\";\n $countAuteurs = 0;\n $countContrib = 0;\n\n $totalAuteurs = 0;\n $totalContrib = 0;\n\n $lastAuteur = \"\";\n $lastContrib = \"\";\n\n // Explosion du tableau des auteurs\n if($auteurs_et_contributeurs != \"\") {\n $auteurs = explode(\",\", $auteurs_et_contributeurs);\n\n // Calcul du nombre total AVANT traitement\n foreach ($auteurs as $auteur) {\n // Explosion du tableau\n $auteurParams = explode(':', $auteur);\n $auteurPrenom = $auteurParams[0];\n $auteurNom = $auteurParams[1];\n\n // Définition des contributeurs (ceux ayant un attribut)\n if(($auteurParams[3]) && (trim($auteurParams[3]) != \"\")) { $totalContrib++; }\n // Définition des auteurs (ceux n'ayant pas d'attribut)\n else {\n // Tant qu'il n'y a pas de contribution, il s'agit d'un auteur\n if($totalContrib == 0) { $totalAuteurs++; }\n // ...sinon, c'est un contributeur\n else { $totalContrib++; }\n }\n }\n\n // Parcours de chaque élément du tableau (chaque auteur & contributeur)\n foreach ($auteurs as $auteur) {\n // Explosion du tableau\n $auteurParams = explode(':', $auteur);\n $auteurPrenom = trim($auteurParams[0]);\n $auteurNom = trim($auteurParams[1]);\n \n // Définition des contributeurs (ceux ayant un attribut)\n if(($auteurParams[3]) && (trim($auteurParams[3]) != \"\")) {\n $auteurContribution = strtolower($auteurParams[3]);\n //$liste_contributeurs .= substr($auteurPrenom, 0, 1) .'. <span class=\"UpperCase\">' . $auteurNom . '</span>, ';\n $liste_contributeurs .= mb_substr($auteurPrenom, 0, 1, \"utf-8\") .'. <span class=\"UpperCase\">' . $auteurNom . '</span>, ';\n $countContrib++;\n }\n // Définition des auteurs (ceux n'ayant pas d'attribut)\n else {\n // Tant qu'il n'y a pas de contribution, il s'agit d'un auteur\n if($countContrib == 0) { \n\n // Pour le dernier auteur, on affiche un\n if(($countAuteurs == $totalAuteurs-1) && ($totalAuteurs > 1)) {\n //$liste_auteurs .= '& <span class=\"UpperCase\">' . $auteurNom . '</span>, ' . substr($auteurPrenom, 0, 1) . '., ';\n $liste_auteurs .= '& <span class=\"UpperCase\">' . $auteurNom . '</span>, ' . mb_substr($auteurPrenom, 0, 1, \"utf-8\") . '., ';\n }\n else {\n // Si il y a plus de 8 auteurs\n if($totalAuteurs > 8) {\n if($countAuteurs < 6) {\n //$liste_auteurs .= '<span class=\"UpperCase\">' . $auteurNom . '</span>, ' . substr($auteurPrenom, 0, 1) . '., ';\n $liste_auteurs .= '<span class=\"UpperCase\">' . $auteurNom . '</span>, ' . mb_substr($auteurPrenom, 0, 1, \"utf-8\") . '., ';\n }\n if($countAuteurs == 6) {\n $liste_auteurs .= \"...\";\n }\n }\n // Moins de 8 auteurs\n else {\n //$liste_auteurs .= '<span class=\"UpperCase\">' . $auteurNom . '</span>, ' . substr($auteurPrenom, 0, 1) . '., ';\n $liste_auteurs .= '<span class=\"UpperCase\">' . $auteurNom . '</span>, ' . mb_substr($auteurPrenom, 0, 1, \"utf-8\") . '., ';\n }\n }\n $countAuteurs++;\n }\n // ...sinon, c'est un contributeur\n else {\n // Pour le dernier auteur, on affiche un (Dir)\n if(($countContrib == $totalContrib-1) && ($totalContrib > 1)) {\n //$liste_contributeurs .= '& '.substr($auteurPrenom, 0, 1) .'. <span class=\"UpperCase\">' . $auteurNom . '</span> (Dir), ';\n $liste_contributeurs .= '& '.mb_substr($auteurPrenom, 0, 1, \"utf-8\") .'. <span class=\"UpperCase\">' . $auteurNom . '</span> (Dir), ';\n }\n else {\n //$liste_contributeurs .= substr($auteurPrenom, 0, 1) .'. <span class=\"UpperCase\">' . $auteurNom . '</span>, ';\n $liste_contributeurs .= mb_substr($auteurPrenom, 0, 1, \"utf-8\") .'. <span class=\"UpperCase\">' . $auteurNom . '</span>, ';\n }\n $countContrib++;\n } \n }\n } \n // Cas spéciaux\n // Certains noms contiennent des éléments à remplacer :\n $liste_auteurs = str_replace(array(\", &\", \",&\"), \" &\", $liste_auteurs);\n $liste_auteurs = str_replace(array(\"., ...\"), \" ... \", $liste_auteurs);\n $liste_auteurs = str_replace(array(\"..\"), \".\", $liste_auteurs);\n\n $liste_contributeurs = str_replace(array(\", &\", \",&\"), \" &\", $liste_contributeurs);\n $liste_contributeurs = str_replace(array(\"., ...\"), \" ... \", $liste_contributeurs);\n $liste_contributeurs = str_replace(array(\"..\"), \".\", $liste_contributeurs); \n }\n\n // Retour des données\n return array(\"AUTEURS\" => $liste_auteurs, \"CONTRIBUTEURS\" => $liste_contributeurs);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the setDestPointIrc() method. | public function testSetDestPointIrc() {
$obj = new ConstantesEntreprise();
$obj->setDestPointIrc("destPointIrc");
$this->assertEquals("destPointIrc", $obj->getDestPointIrc());
} | [
"public function getDestPointIrc() {\n return $this->destPointIrc;\n }",
"public function getDestPointIrc(): ?string {\n return $this->destPointIrc;\n }",
"public function setting_scanner_ip(){\n $ip_address = '127.0.0.1';\n $doxie = new DoxieConsumer();\n $doxie->set_logger($this->_logger);\n\n $this->assertFalse($doxie->is_scanner_ip_set());\n $doxie->set_scanner_ip($ip_address);\n $this->assertTrue($doxie->is_scanner_ip_set());\n $this->assertEquals($ip_address, $doxie->get_scanner_ip());\n $doxie->unset_scanner_ip();\n $this->assertFalse($doxie->is_scanner_ip_set());\n }",
"public function testPutCandidateCurrentLocation()\n {\n }",
"public function testSetDestination() : void\n {\n $instance = $this->createEmptyInstance();\n\n $destination = 'myDestinationLocation';\n\n $this->assertSame($instance, $instance->setDestination($destination));\n $this->assertEquals($destination, $this->getValue($instance, 'destination'));\n }",
"public function testSetSelAdresseDest() {\n\n $obj = new DecTva();\n\n $obj->setSelAdresseDest(\"selAdresseDest\");\n $this->assertEquals(\"selAdresseDest\", $obj->getSelAdresseDest());\n }",
"public function testSetAdresseIp() {\n\n $obj = new iSessions();\n\n $obj->setAdresseIp(\"adresseIp\");\n $this->assertEquals(\"adresseIp\", $obj->getAdresseIp());\n }",
"public function testSetTvaDestAttn() {\n\n $obj = new Dossier4();\n\n $obj->setTvaDestAttn(\"tvaDestAttn\");\n $this->assertEquals(\"tvaDestAttn\", $obj->getTvaDestAttn());\n }",
"public function testRemoteResource()\n {\n $this->assertFalse($this->infoProduct->getRemoteResource(), 'Initial state not false per declaration.');\n $this->infoProduct->setRemoteResource(true);\n $this->assertTrue($this->infoProduct->getRemoteResource());\n }",
"public function testCrceIccaTransferResources()\n {\n\n }",
"public function testSetRemoteIp()\n {\n $this->_req->setRemoteIp('999.99.998.9');\n $this->assertEquals('999.99.998.9', $this->_req->getRemoteIp());\n }",
"function setId_ctr_destino($iid_ctr_destino = '')\n {\n $this->iid_ctr_destino = $iid_ctr_destino;\n }",
"public function testGetURL()\n {\n $this->assertEquals(self::SRC, $this->image->getURL(), 'Failed to retrieve image URL set in the class constructor');\n }",
"public function testSetCodeCollaborateurDest() {\n\n $obj = new AppelsEnCours();\n\n $obj->setCodeCollaborateurDest(\"codeCollaborateurDest\");\n $this->assertEquals(\"codeCollaborateurDest\", $obj->getCodeCollaborateurDest());\n }",
"public function test_set_and_get_crops_folder()\n {\n $this->handler\n ->setCropsFolder( $this->baseFolder );\n $this->assertEquals( $this->baseFolder, $this->handler->getCropsFolder() );\n }",
"public function testBoardingPassSource()\n {\n \t$this->assertTrue($this->boardingPass->source == \"Test Source\");\n }",
"public function test_default_origin()\n {\n $this->assertEquals($this->mappr->origin, 0);\n }",
"public function testUriIntisWithProvidedValue()\n {\n $stream = new \\Lunr\\Network\\StreamSocketClient('alinktosee');\n\n $property = $this->stream_socket_client_reflection->getProperty('uri');\n $property->setAccessible(TRUE);\n\n $this->assertEquals('alinktosee', $property->getValue($stream));\n\n unset($stream);\n }",
"public function testSetCurrentID()\n {\n $complement = $this->complement;\n\n $this->assertTrue(\n $complement::setCurrentID('AdvancedLocalComplement')\n );\n\n $this->assertTrue(\n $complement::setCurrentID('BasicLocalComplement')\n );\n\n $this->assertTrue(\n $complement::setCurrentID('RemoteComplement')\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PUBLIC METHODS / NAME Load Loads text contents from a PDF file. PROTOTYPE $pdf > Load ( $filename ) ; DESCRIPTION Extracts text contents from the specified PDF file. Once processed, text contents will be available through the "Text" property. PARAMETERS $filename (string) Optional PDF filename whose text contents are to be extracted. | function Load ( $filename )
{
// Check if the file exists
if ( ! file_exists ( $filename ) )
throw ( new \Exception ( "File \"$filename\" does not exist." ) ) ;
// Load its contents
$contents = file_get_contents ( $filename, FILE_BINARY ) ;
// Check that this is a PDF file
if ( ! preg_match ( '/^ %PDF- (?P<version> \d+ (\. \d+)*) /ix', $contents, $match ) )
throw ( new \Exception ( "File \"$filename\" is not a valid PDF file." ) ) ;
$this -> PdfVersion = $match [ 'version' ] ;
// Initializations
$this -> Text = '' ;
$this -> FontTable = new PdfTexterFontTable ( ) ;
$this -> Filename = $filename ;
$this -> PageMappings = array() ;
$this -> Pages = array() ;
// Extract pdf objects that are enclosed by the "obj" and "endobj" keywords
if ( ! preg_match_all ( '/(?P<num> \d+) \s+ \d+ \s+ obj (?P<object> .*?) endobj/imsx', $contents, $object_matches ) )
return ( false ) ;
// Character maps encountered so far
$cmaps = array() ;
// Page definitions - if the optional /Pages /Kids[] construct is encountered
$pages = false ;
// Loop through the objects
$text = array() ;
for ( $i = 0 ; $i < count ( $object_matches [ 'object' ] ) ; $i ++ )
{
$object_data = $object_matches [ 'object' ] [$i] ;
$object_number = $object_matches [ 'num' ] [$i] ;
// Check if current data contains page information. We don't put a "continue" statement here,
// since the data can contain additional relevant information, such as font declarations...
if ( $this -> IsPage ( $object_data ) )
{
$this -> AddPage ( $object_number, $object_data ) ;
}
// Check if current data contains page list
if ( $this -> IsPageList ( $object_data ) )
{
$pages = $this -> GetPageList ( $object_data ) ;
}
// Some font definitions are in clear text in an object, some are encoded in a stream within the object
// We process here the unencoded ones
if ( PdfTexterFontTable::IsFont ( $object_data ) )
{
$this -> FontTable -> Add ( $object_number, $object_data ) ;
continue ;
}
// Some character maps may also be in clear text
else if ( PdfTexterCharacterMap::IsCharacterMap ( $object_data ) )
{
$cmap = PdfTexterCharacterMap::CreateInstance ( $object_number, $object_data ) ;
if ( $cmap )
//jlv $cmaps [] = $cmap ;
$cmaps = $cmap ;
continue ;
}
// Check if there is an association between font number and object number
else if ( PdfTexterFontTable::IsFontMap ( $object_data ) )
{
$this -> FontTable -> AddFontMap ( $object_number, $object_data ) ;
continue ;
}
// Ignore other objects that do not contain an encoded stream
else if ( ! preg_match ( '#[^/] stream \r? \n (?P<stream> .*?) endstream#imsx', $object_data, $stream_match ) )
continue ;
// Isolate stream data and try to find its encoding type
$stream_data = $stream_match [ 'stream' ] ;
$type = $this -> GetEncodingType ( $object_data ) ;
// Ignore this stream if the object does not contain an encoding type (/FLATE, /ASCIIHEX or /ASCII85)
if ( $type == self::PDF_UNKNOWN_ENCODING )
continue ;
// Decode the encoded stream
$decoded_stream_data = $this -> DecodeData ( $stream_data, $type ) ;
// Check for character maps
if ( PdfTexterCharacterMap::IsCharacterMap ( $decoded_stream_data ) )
{
$cmap = PdfTexterCharacterMap::CreateInstance ( $object_number, $decoded_stream_data ) ;
if ( $cmap )
$cmaps [] = $cmap ;
}
// Font definitions
else if ( PdfTexterFontTable::IsFont ( $decoded_stream_data ) )
{
$this -> FontTable -> Add ( $object_number, $decoded_stream_data ) ;
}
// Plain text (well, in fact PDF drawing instructions)
else if ( $this -> IsText ( $object_data, $decoded_stream_data ) )
{
$text [ $object_number ] = $decoded_stream_data ;
}
}
// Associate character maps with declared fonts
foreach ( $cmaps as $cmap )
$this -> FontTable -> AddCharacterMap ( $cmap ) ;
// Current font defaults to -1, which means : take the first available font as the current one.
// Sometimes it may happen that text drawing instructions do not set a font at all (PdfPro for example)
$current_font = -1 ;
$last_page = 1 ;
// Extract text from the collected TEXT elements
foreach ( $text as $id => $str )
{
$text = $this -> ExtractText ( $id, $str, $current_font ) ;
// Put a form feed between each text block - not sure it is appropriate
if ( $this -> Text )
$this -> Text .= "\f" ;
// Add this new page
$start = strlen ( $this -> Text ) ;
// Trying this class on the PDF specifications 1.7 file shows that 3 pages are like "orphans", ie they
// are not referenced by any /Page option
if ( ! isset ( $this -> PageMappings [ $id ] ) )
$this -> PageMappings [ $id] [ 'page' ] = $last_page + 1 ;
$page_number = $this -> PageMappings [ $id ] [ 'page' ] ;
$this -> PageLocations [$page_number] = $start ; //jlv
// Then add this page to the text already collected
$this -> Text .= $text ;
$last_page = $page_number ;
}
// Remap pages in case of the /Kids parameter would give a different order (not yet tested)
$this -> RemapPages ( $pages ) ;
// Rearrange the PageLocations property so that we have a text length and an ending offset for each page
$text_length = strlen ( $this -> Text ) ;
$page_numbers = array_keys ( $this -> PageLocations ) ;
for ( $i_page = 0, $count = count ( $this -> PageLocations ) ; $i_page < $count ; $i_page ++ )
{
$i = $page_numbers [ $i_page ] ;
$next = ( $i_page + 1 < $count && isset ( $this -> PageLocations [ $i + 1 ] ) ) ?
$this -> PageLocations [ $i + 1 ] [ 'start' ] : $text_length ;
$this -> PageLocations [$i] [ 'end' ] = $next - 1 ;
$this -> PageLocations [$i] [ 'length' ] = $next - $this -> PageLocations [$i] [ 'start' ] ;
}
// Build page array
foreach ( $this -> PageLocations as $page_number => $location )
$this -> Pages [ $page_number ] = substr ( $this -> Text, $location [ 'start' ], $location [ 'length' ] ) ;
} | [
"protected function get_text_from_pdf()\n\t\t{\n\t\t\tif (is_file($this->file_work_ocr))\n\t\t\t{\n\t\t\t\t$this->ocr_text = \"\";\n\t\t\t\t\n\t\t\t\t$this->log_write(\"Extracting Text\");\n\t\t\t\t$command = \"pdftotext -nopgbrk -eol unix {$this->file_work_ocr} {$this->file_work_text} >{$this->dir_temp}/pdftotext.txt 2>&1\";\n\t\t\t\t$output = shell_exec($command);\n\t\t\t\t$this->file_to_log($this->dir_temp . \"/pdftotext.txt\");\n\n\t\t\t\tif (is_file($this->file_work_text))\n\t\t\t\t{\n\t\t\t\t\tif($file_handle = fopen($this->file_work_text, \"r\"))\n\t\t\t\t\t{\n\t\t\t\t\t\twhile ($text = fgets($file_handle))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$text = str_replace(\"\\n\", \" \", $text);\n\t\t\t\t\t\t\t$this->ocr_text .= \" \" . $text;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfclose($file_handle);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function extractDocumentText($pdfFilePath) {\n\n // TODO: fer aixo\n// return 'TODO';\n }",
"function LoadTxt($fn)\r\n{\r\n\r\n\t$filepath = str_replace(\"\\\\\\\\\",\"\\\\\",dirname(ewScriptFileName()));\r\n\t// Get text file content\r\n\tif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\r\n\t\t$filepath .= \"\\\\\" . $fn;\r\n\t} else {\r\n\t\t$filepath .= \"/\" . $fn;\t\t\r\n\t}\r\n\t$fobj = fopen ($filepath , \"r\");\r\n\treturn fread ($fobj, filesize ($filepath));\r\n\r\n}",
"private function load_txt($file){\n //check file exists\n if (!is_file($file)){\n\t\t\t die('Error reading file: ' . $file);\n\t\t }\n \n\t\t\tif ($this->debug)\n\t\t\t\techo 'Loaded txt content<br>';\n\t\t return file_get_contents($file);\n }",
"function decodePDF() {\n\t\t$infile = @file_get_contents($this->filename, FILE_BINARY); \n\t\tif (empty($infile)) \n\t\t\treturn \"\"; \n\t\t\n\t\t// Get all text data.\n\t\t$transformations = array(); \n\t\t$texts = array(); \n\t\t\n\t\t// Get the list of all objects.\n\t\tpreg_match_all(\"#obj[\\n|\\r](.*)endobj[\\n|\\r]#ismU\", $infile, $objects); \n\t\t$objects = @$objects[1]; \n\t\t\n\t\t// Select objects with streams.\n\t\tfor ($i = 0; $i < count($objects); $i++) { \n\t\t\t$currentObject = $objects[$i]; \n\t\t\t\n\t\t\t// Check if an object includes data stream.\n\t\t\tif (preg_match(\"#stream[\\n|\\r](.*)endstream[\\n|\\r]#ismU\", $currentObject, $stream)) { \n\t\t\t\t$stream = ltrim($stream[1]); \n\t\t\t\t\n\t\t\t\t// Check object parameters and look for text data. \n\t\t\t\t$options = $this->getObjectOptions($currentObject); \n\t\t\t\t\n\t\t\t\tif (!(empty($options[\"Length1\"]) && empty($options[\"Type\"]) && empty($options[\"Subtype\"]))) \n\t\t\t\t\tcontinue; \n\t\t\t\t\n\t\t\t\t// Hack, length doesnt always seem to be correct\n\t\t\t\tunset($options[\"Length\"]);\n\t\t\t\t\n\t\t\t\t// So, we have text data. Decode it.\n\t\t\t\t$data = $this->getDecodedStream($stream, $options); \n\t\t\t\t\n\t\t\t\tif (strlen($data)) { \n\t\t\t\t\tif (preg_match_all(\"#BT[\\n|\\r](.*)ET[\\n|\\r]#ismU\", $data, $textContainers)) {\n\t\t\t\t\t\t$textContainers = @$textContainers[1]; \n\t\t\t\t\t\t$this->getDirtyTexts($texts, $textContainers); \n\t\t\t\t\t} else \n\t\t\t\t\t\t$this->getCharTransformations($transformations, $data); \n\t\t\t\t} \n\t\t\t} \n\t\t} \n\t\t\n\t\t// Analyze text blocks taking into account character transformations and return results. \n\t\t$this->decodedtext = $this->getTextUsingTransformations($texts, $transformations); \n\t}",
"function textloader($whatfile)\n\t{\n\t\tif (!file_exists($whatfile))\n\t\t{\n\t\t\tprint (\"<h3>Sorry, textloader cannot find $whatfile.</h3>\");\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$textarray=file($whatfile);\n\t\t\treturn $textarray;\n\t\t}\n\t}",
"protected function loadText() {\n\t\twfProfileIn( __METHOD__ );\n\n\t\t// Caching may be beneficial for massive use of external storage\n\t\tglobal $wgRevisionCacheExpiry, $wgMemc;\n\t\t$textId = $this->getTextId();\n\t\t$key = wfMemcKey( 'revisiontext', 'textid', $textId );\n\t\tif ( $wgRevisionCacheExpiry ) {\n\t\t\t$text = $wgMemc->get( $key );\n\t\t\tif ( is_string( $text ) ) {\n\t\t\t\twfDebug( __METHOD__ . \": got id $textId from cache\\n\" );\n\t\t\t\twfProfileOut( __METHOD__ );\n\t\t\t\treturn $text;\n\t\t\t}\n\t\t}\n\n\t\t// If we kept data for lazy extraction, use it now...\n\t\tif ( isset( $this->mTextRow ) ) {\n\t\t\t$row = $this->mTextRow;\n\t\t\t$this->mTextRow = null;\n\t\t} else {\n\t\t\t$row = null;\n\t\t}\n\n\t\tif ( !$row ) {\n\t\t\t// Text data is immutable; check slaves first.\n\t\t\t$dbr = wfGetDB( DB_SLAVE );\n\t\t\t$row = $dbr->selectRow( 'text',\n\t\t\t\tarray( 'old_text', 'old_flags' ),\n\t\t\t\tarray( 'old_id' => $textId ),\n\t\t\t\t__METHOD__ );\n\t\t}\n\n\t\t// Fallback to the master in case of slave lag. Also use FOR UPDATE if it was\n\t\t// used to fetch this revision to avoid missing the row due to REPEATABLE-READ.\n\t\t$forUpdate = ( $this->mQueryFlags & self::READ_LOCKING == self::READ_LOCKING );\n\t\tif ( !$row && ( $forUpdate || wfGetLB()->getServerCount() > 1 ) ) {\n\t\t\t$dbw = wfGetDB( DB_MASTER );\n\t\t\t$row = $dbw->selectRow( 'text',\n\t\t\t\tarray( 'old_text', 'old_flags' ),\n\t\t\t\tarray( 'old_id' => $textId ),\n\t\t\t\t__METHOD__,\n\t\t\t\t$forUpdate ? array( 'FOR UPDATE' ) : array() );\n\t\t}\n\n\t\tif ( !$row ) {\n\t\t\twfDebugLog( 'Revision', \"No text row with ID '$textId' (revision {$this->getId()}).\" );\n\t\t}\n\n\t\t$text = self::getRevisionText( $row );\n\t\tif ( $row && $text === false ) {\n\t\t\twfDebugLog( 'Revision', \"No blob for text row '$textId' (revision {$this->getId()}).\" );\n\t\t}\n\n\t\t# No negative caching -- negative hits on text rows may be due to corrupted slave servers\n\t\tif ( $wgRevisionCacheExpiry && $text !== false ) {\n\t\t\t$wgMemc->set( $key, $text, $wgRevisionCacheExpiry );\n\t\t}\n\n\t\twfProfileOut( __METHOD__ );\n\n\t\treturn $text;\n\t}",
"private function LoadFile($filename) {\n\t\t$filename = realpath($this->base_directory.'/'.$filename);\n\t\t\n\t\tif ($filename && strpos($filename, $this->base_directory) !== 0) {\n\t\t\t//@TODO codify this error\n\t\t\tthrow new Exception('Atempted to load file outside'\n\t\t\t\t\t\t\t.' of acceptable range.');\t\n\t\t}\n\t\t\n\t\tif (!$filename || !file_exists($filename)) {\n\t\t\t//TODO clean up this exception\n\t\t\tthrow new Exception(\"File:\", $code, $previous);\n\t\t}\n\t\t$realpath = realpath($filename);\n\t\t$this->filetexts[$realpath] = file_get_contents($realpath);\n\t\t\n\t\t$this->PushFileStack($realpath);\n\t\treturn $realpath;\n\t}",
"public static function loadPdfFile($fileName, $storeContent = false, $fileEncoding = null, $internalEncoding = null)\r\n {\r\n if (!is_readable($fileName)) {\r\n require_once 'Zend/Search/Lucene/Document/Exception.php';\r\n throw new Zend_Search_Lucene_Document_Exception('Provided file \\'' . $fileName . '\\' is not readable.');\r\n }\r\n\r\n return new RW_Search_Lucene_Document_Pdf($fileName, $storeContent, $fileEncoding, $internalEncoding);\r\n }",
"public function getText()\n {\n $parameters = func_get_args();\n\n //set parameter values\n if (count($parameters) > 0) {\n $pageNumber = $parameters[0];\n }\n\n\n $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() .\n ((isset($parameters[0])) ? '/pages/' . $pageNumber . '/TextItems' : '/TextItems');\n\n $signedURI = Utils::sign($strURI);\n\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n\n $json = json_decode($responseStream);\n\n $rawText = '';\n foreach ($json->TextItems->List as $textItem) {\n $rawText .= $textItem->Text;\n }\n return $rawText;\n }",
"protected function pdf2txt($filename){\n\n $data = $this->getFileData($filename);\n \n $s=strpos($data,\"%\")+1;\n \n $version=substr($data,$s,strpos($data,\"%\",$s)-1);\n if(substr_count($version,\"PDF-1.2\")==0)\n return $this->handleV3($data);\n else\n return $this->handleV2($data);\n\n \n}",
"function pdf2txt($filename){\n\n\t$data = getFileData($filename);\n\n\t$s=strpos($data,\"%\")+1;\n\n\t$version=substr($data,$s,strpos($data,\"%\",$s)-1);\n\tif(substr_count($version,\"PDF-1.2\")==0)\n\t\treturn handleV3($data);\n\telse\n\t\treturn handleV2($data);\n\n\n}",
"private static function extract_pdf_content( string $file, $data = null ) {\n\t\t$content = apply_filters( 'searchwp\\parser\\pdf', '', [ 'file' => $file, 'data' => $data ] );\n\n\t\t// If the content was populated externally, bail out.\n\t\tif ( ! file_exists( $file ) || ! empty( $content ) ) {\n\t\t\treturn $content;\n\t\t}\n\n\t\t$pdf_parser = new \\SearchWP\\Dependencies\\Smalot\\PdfParser\\Parser();\n\t\ttry {\n\t\t\t$content = (string) $pdf_parser->parseFile( $file )->getText();\n\t\t} catch (\\Exception $e) {\n\t\t\tdo_action(\n\t\t\t\t'searchwp\\debug\\log',\n\t\t\t\t'PDF text extraction failed: ' . sanitize_text_field( $e->getMessage() ),\n\t\t\t\t'parser'\n\t\t\t);\n\n\t\t\t$content = false;\n\t\t}\n\n\t\treturn $content;\n\t}",
"public function getText()\n {\n $text = $this->read_doc($this->fileName);\n\n if ($text) {\n return $text;\n } else {\n throw new IOException(\"Error loading file \" . $this->fileName);\n }\n }",
"public function extractText(){\n switch($this->file_extension){\n case 'doc':\n case 'docx':\n $this->extractWord();\n break;\n case 'xls':\n case 'xlsx':\n $this->extractExcel();\n break;\n case 'ppt':\n case 'pptx':\n $this->extractPowerPoint();\n break;\n case 'pdf':\n $this->extractPDF();\n break;\n case 'png':\n case 'tif':\n case 'jpg':\n $this->extractImage();\n break;\n default:\n break;\n }\n $this->cleanUp();\n return $this->getText();\n }",
"function PDF_load_3ddata($pdfdoc, $filename, $optlist){}",
"function ExtractTextFromPdf ($pdfdata) {\n\t\t\t\t \t\t\tif (strlen ($pdfdata) < 1000 && file_exists ($pdfdata)) $pdfdata = file_get_contents ($pdfdata); //get the data from file\n\t\t\t\t \t\t\tif (!trim ($pdfdata)) echo \"Error: there is no PDF data or file to process.\";\n\t\t\t\t \t\t\t$result = ''; //this will store the results\n\t\t\t\t \t\t\t//Find all the streams in FlateDecode format (not sure what this is), and then loop through each of them\n\t\t\t\t \t\t\tif (preg_match_all ('/<<[^>]*FlateDecode[^>]*>>\\s*stream(.+)endstream/Uis', $pdfdata, $m)) foreach ($m[1] as $chunk) {\n\t\t\t\t \t\t\t\t$chunk = gzuncompress (ltrim ($chunk)); //uncompress the data using the PHP gzuncompress function\n\t\t\t\t \t\t\t\t//If there are [] in the data, then extract all stuff within (), or just extract () from the data directly\n\t\t\t\t \t\t\t\t$a = preg_match_all ('/\\[([^\\]]+)\\]/', $chunk, $m2) ? $m2[1] : array ($chunk); //get all the stuff within []\n\t\t\t\t \t\t\t\tforeach ($a as $subchunk) if (preg_match_all ('/\\(([^\\)]+)\\)/', $subchunk, $m3)) $result .= join ('', $m3[1]); //within ()\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t\telse echo \"Error: there is no FlateDecode text in this PDF file that I can process.\";\n\t\t\t\t \t\t\treturn $result; //return what was found\n\t\t\t\t \t\t}",
"private function docToText($filename) {\n\t\treturn preg_replace(\"/[^a-zA-Z0-9\\s\\,\\.\\-\\n\\r\\t@\\/\\_\\(\\)]/\",\"\",//Condensed Gourav Mehta.\n\t\t\timplode(\" \",array_filter(explode(chr(0x0D),file_get_contents($filename)),function($x){\n\t\t\t\treturn strpos($x,chr(0x00))===FALSE&&strlen($x)!=0;})));\n\t}",
"function pdf_open_file($pdfdoc, $filename = null) {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the encoding. for constants | public function getEncoding(); | [
"protected static function encoding()\n {\n return static::$encoding;\n }",
"public function getEncoding(){ }",
"public function get_encoding()\n {\n }",
"function getEncodingName(){}",
"private function get_encoding()\n {\n return $this->encoding;\n }",
"static function GetDefaultEncoding(){}",
"public function getEncoding() {\n\t\treturn $this->rfi->getEncoding();\n\t}",
"private function getEncoding()\n {\n return $this->encoding;\n }",
"public static function getGlobalEncoding() {\n return self::$globalEncoding;\n }",
"public function getEncoding() {\n\t\treturn $this->babel->getEncoding();\n\t}",
"public function getEncodingType(): string;",
"public function getFileEncoding(): string\n {\n return $this->currentFileEncoding;\n }",
"public function getEncodingFormat();",
"public function getCodec();",
"public function getConvertEncoding();",
"function getBestEncoding();",
"public function getContentEncoding(): string;",
"public function getConversionInputEncoding(): string\n {\n return $this->conversion_input_encoding;\n }",
"public function getFileEncoding()\n {\n if (isset($this->currentFileEncoding)) {\n return $this->currentFileEncoding;\n }\n return self::DEFAULT_FILE_ENCODING;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field .Ydb.PersQueue.V1.MigrationStreamingReadServerMessage.Release release = 6; | public function getRelease()
{
return $this->readOneof(6);
} | [
"public function read_release() { $this->request_release(self::READ_ACCESS); }",
"public function getRelease()\n {\n return $this->release;\n }",
"function getRelease() {\n\t\treturn $this->_release;\n\t}",
"private function getCurrentReleaseChannel() {\n\t\treturn 'stable';\n\t}",
"protected function _processReleases() { }",
"private function decodePubrel()\n {\n if ($this->qos !== 1) throw new \\Exception(' bad buffer #' . __METHOD__);\n $this->packet_id = $this->bufPop(static::FL_FIXED, 2);\n $this->ack = chr(0x70) . chr(0x02) . $this->packet_id; //pubcomp\n }",
"function readingFromMQ_00(&$flag, $sCnt)\n\t\t{\n\t\t\t// prepare for reading from MQ\n\t $message_queue_key = 0x1234; // key of the device-to-web queue\n\t $message_queue = msg_get_queue($message_queue_key, 0666);\n//\t var_dump($message_queue);\n\t \n\t // the standard length of $message get from the queue is 256\n // need to get the real length of it and discard the tail\n $msgArray = array();\n \n// if (msg_receive($message_queue, 0, $message_type, 256, $message, false, MSG_IPC_NOWAIT)) {\n// if (msg_receive($message_queue, 1, $message_type, 256, $message, false, MSG_IPC_NOWAIT)) {\n//------------------------------ \n// + Nov.27.2011 change the desired messafge type from 0 (anything) to 1 (Webserver specific) \n//------------------------------ \n if (msg_receive($message_queue, 1, $message_type, 1450, $message, false, MSG_IPC_NOWAIT)) {\n\n//============================================================================== \n// note : both old msg format and new have the field,OC-len, located at field no. 15 \n// i.e. string location 14, and old format only occupies 1 byte, whiile the new occupies 2 \n//============================================================================== \n $objLength = hexdec(bin2hex(substr($message, 14, 2))); \n\t \t$length = 18 + $objLength ; // Headers + obj + CRC + EOF\n\n// + Sep.30.2011\n//print_r(\" inside readingFromMQ_00 --message_type \".$message_type.\"\\r\\n\") ;\n//print_r(\" message \".$message.\"\\r\\n\"); \n//print_r(\" inside readingFromMQ_00 --Length: \".$length.\"\\r\\n\");\n\n// + Sep.30.2011\n//echo \" inside readingFromMQ_00 - message_type : \".$message_type ; \n//echo \" inside readingFromMQ_00 - message : \".$message ; \n//echo \" inside readingFromMQ_00 - length : \".$length ; \n//echo \" inside readingFromMQ_00 - message_type : \".$message_type ; \n \n $content = substr($message, 0, $length); // get the msg in the real length\n\t \t \t\n// + Oct.06.2011 \n//\t\t\t\t$parse = \"CucSof/ CucApID/ CucNpID/ LSid/ CDid/ SPid/ CucNpCmd/ CNPucAPID/ CucCmdID/ CucAckID/ COLen/ SOID/C\".$objLength.\"/SusCRC/CucEof\";\n// $parse = \"CucApID/CucNpID/LSid/CDid/SPid/CNPucAPID/CucNpCmd/CucNoID/CucCmdID/CucAckID/SOLen/SOID/C\".$objLength ;\n\t\t\t\t//==============================================================================\n\t\t\t\t// During unpack, only care about fields Object ID and Object Length to retrieve content, althought the field $ucNpCmd is replaced by $ucUpPrtID, its ignored \n\t\t\t\t//============================================================================== \n $parse = \"CucApID/CucNpID/VSid/CDid/nPid/CNPucAPID/CucNpCmd/CucNoID/CucCmdID/CucAckID/vOLen/vOID/C\".$objLength ;\n \n\t\t\t\t$msgArray = unpack($parse, $content);\n\n// + Debug Oct.02.2011 \n//echo \" inside readingFromMQ_00 - parse : \".$parse ; \n//var_dump(unpack($parse, $content)) ; \n \n\t\t\t\t// ************************************************************************************\n\t\t\t\t// re-creat $parse into different formats according the different OIDs\n\t\t\t\t// ************************************************************************************\t\n\t\t\t\t$oid = $msgArray['OID'];\n// + Sep.30.2011 \n//print_r(\"oid: \".$oid.\"\\r\\n\");\n// + Oct.21.2011 \n//echo \"oid: \".$oid.\"\\r\\n\";\n //----------------------------------------------\n // notify to read again if not matching Packet Id ( Correlator) ???\n //----------------------------------------------\n $Pid = $msgArray['Pid'] ;\n if ($Pid == $sCnt) {\n// debug\necho \" *** we have a MATCH ! *** - Pid: $Pid - sCnt: $sCnt /n/r \" ; \n $flag = 1;\n \n }\n \n \n \n\t\t\t\t$isString = False;\n\t\t\t\t$isbArray = False;\n \n// + Oct.06.2011\n // flip the byte back to proper order\n $oid2 = byteswap2($oid,1) ;\n\n//Debug \n//echo \" -- within readingFromMQ_03 oid2: \".$oid2 .\" - len: \".strlen($msgArray).\" - parse: \".$parse.\"</br>\";\n//echo \" -- within readingFromMQ_03 - oid: \".$oid.\" - oid2: \".$oid2 .\" - len: \".strlen($msgArray).\"</br>\";\necho \"oid2: \".$oid2.\"\\r\\n\";\necho \"Pid: \".$Pid.\"\\r\\n\";\n//var_dump($msgArray) ;\n\n \n// + Sep.29.2011 \n//\t\t\t\tswitch (objectType($oid)) {\n//\t\t\t\tswitch (objectType_00($oid)) {\n\t\t\t\tswitch (objectType_00($oid2)) {\n\n //------------------------------\n\t\t\t\t\t// signed 1 byte integer\n //------------------------------\n case 'sint1':\n\t\t\t\t \t$contentParse = \"cContent\";\n\t\t\t\t \tbreak;\n //------------------------------\n // unsigned 1 byte integer \n //------------------------------ \n case 'uint1':\n\t\t\t\t \t$contentParse = \"CContent\";\n\t\t\t\t \tbreak;\t\n \t\t\t\t//------------------------------\n \t\t\t// unsigned 2 byte integer\n \t\t//------------------------------\n case 'uint2':\n\t\t\t\t \t$contentParse = \"SContent\";\n\t\t\t\t \tbreak;\t\t\t \t\n \t\t\t\t//------------------------------\n \t\t\t// unsigned 4 bytes integer\n \t\t//------------------------------\n\t\t\t\t case 'uint4':\n\t\t\t\t \t$contentParse = \"LContent\";\n\t\t\t\t \tbreak;\t\n \t\t\t\t//------------------------------\n \t\t\t// double\n \t\t//------------------------------\n case 'double':\n\t\t\t\t \t$contentParse = \"dContent\";\n\t\t\t\t \tbreak;\n \t\t\t\t//------------------------------\n \t\t\t// string - 32-char\n \t\t//------------------------------\n\t\t\t\t case 'string':\n\t\t\t\t\t$isString = True;\n\t\t\t\t \t$contentParse = \"C\".$objLength;\n\t\t\t\t \tbreak;\n \t\t\t\t//------------------------------\n \t\t\t// binary array - 32-uint \n \t\t//------------------------------\n\t\t\t\t case 'bArray':\n\t\t\t\t\t$isbArray = True;\n\t\t\t\t \t$contentParse = \"C\".$objLength;\n\t\t\t\t \tbreak;\n \t\t\t\t//------------------------------\n // unknow\n \t\t\t\t//------------------------------\n\t\t\t\t default:\n\t\t\t\t \t$contentParse = \"C\".$objLength;\n// + Debug Sep.30.2011\necho \"<br>error: \".$oid;\n\t\t\t\t}\n\n// + Debug Oct.21.2011\n//echo \"<br>contentParse: \".$contentParse.\"</br>\";\n\n\n// + Oct.06.2011 \n// $newParse = \"CucSof/CucApID/CucNpID/LSid/CDid/SPid/CucNpCmd/CNPucAPID/CucCmdID/CucAckID/COLen/SOID/\".$contentParse.\"/SusCRC/CucEof\";\t\t\t\t\n// $newParse = \"CucApID/CucNpID/LSid/CDid/SPid/CNPucAPID/CucNpCmd/CucNoID/CucCmdID/CucAckID/SOLen/SOID/\".$contentParse ;\n $newParse = \"CucApID/CucNpID/VSid/CDid/nPid/CNPucAPID/CucNpCmd/CucNoID/CucCmdID/CucAckID/vOLen/vOID/\".$contentParse ;\n\n \n// + Debug Sep.30.2011\n//echo \"<br> newParse: \".$newParse;\n//var_dump(unpack($newParse, $content)) ;\n \n $msgArray = unpack($newParse, $content);\n\n// + Debug Oct.06.2011\n//echo \" -- within readingFromMQ_00 ** <br> newParse: \".$newParse;\n//var_dump($msgArray) ;\n\n\n\t //re-create value to readable format\n\t if ($isString || $isbArray) { //string value or binary array\n\n// + Debug oct.06.2011\n//echo \" inside readingFromMQ_00 - isString or isbArray \" ; \n \n \n $str = \"\";\n\t \t\tif ($objLength > 0) {\n\t\t \t\tfor($i=1; $i<=$objLength; $i++)\n\t\t \t\t{\n\t\t \t\t\tif ($isString) {\n\t\t \t\t\t$str = $str.chr($msgArray[$i]);\n\t\t\t \t\t} else {\n\t\t\t \t\t\t$str = $str.intval($msgArray[$i]);\n\t\t\t \t\t}\n\t\t \t\t\t//echo chr($msgArray[$i]);\n\t\t \t\t\tunset($msgArray[$i]);\n\t\t \t\t}\n\t\t \t}\n\t\t \t$msgArray['Content'] = $str; \n\t\t } else {\n\t\t \t$msgArray['Content'] = valueTransfer($msgArray['Content'], $msgArray['OID'], True);\n\t\t }\n\t \t}\n \t\n \t\treturn $msgArray;\n\t\t}",
"protected function get_latest_release()\n {\n }",
"function readingFromMQ_02()\n\t\t{\n\t\t\t// prepare for reading from MQ\n\t $message_queue_key = 0x1234; // key of the device-to-web queue\n\t $message_queue = msg_get_queue($message_queue_key, 0666);\n//\t var_dump($message_queue);\n\t \n\t // the standard length of $message get from the queue is 256\n // need to get the real length of it and discard the tail\n $msgArray = array();\n\n// + Nov.07.2011 \n $flgContent = true;\n \n// + Oct.03.2011 change the desired messafge type from 0 (anything) to 1 (Webserver specific) \n// if (msg_receive($message_queue, 1, $message_type, 256, $message, false, MSG_IPC_NOWAIT)) {\n if (msg_receive($message_queue, 1, $message_type, 1450, $message, false, MSG_IPC_NOWAIT)) {\n\n //Get the lenght of the Object\n// $objLength = hexdec(bin2hex(substr($message, 14, 1))); \n//\t \t$length = 17 + $objLength + 2 + 1; // Headers + obj + CRC + EOF\n//============================================================================== \n// note : both old msg format and new have the field,OC-len, located at field no. 15 \n// i.e. string location 14, and old format only occupies 1 byte, whiile the new occupies 2 \n//============================================================================== \n $objLength = hexdec(bin2hex(substr($message, 14, 2))); \n\t \t$length = 18 + $objLength ; // Headers + obj + CRC + EOF\n\n//echo \" inside readingFromMQ_02 - message_type : \".$message_type ; \n//echo \" inside readingFromMQ_02 - message : \".$message ; \n//echo \" inside readingFromMQ_02 - length : \".$length.\" \\n\\r \" ; \n//echo \" inside readingFromMQ_02 - message_type : \".$message_type ; \n \n $content = substr($message, 0, $length); // get the msg in the real length\n \t//==============================================================================\n\t\t// During unpack, only care about fields Object ID and Object Length to retrieve content, althought the field $ucNpCmd is replaced by $ucUpPrtID, its ignored \n\t\t//============================================================================== \n $parse = \"CucApID/CucNpID/VSid/CDid/nPid/CNPucAPID/CucNpCmd/CucNoID/CucCmdID/CucAckID/vOLen/vOID/C\".$objLength ;\n \n\t\t$msgArray = unpack($parse, $content);\n\n// + Debug Oct.02.2011 \n//echo \" inside readingFromMQ_00 - parse : \".$parse ; \n//var_dump(unpack($parse, $content)) ; \n \n\t\t// ************************************************************************************\n\t\t// re-creat $parse into different formats according the different OIDs\n\t\t// ************************************************************************************\t\n\t\t$oid = $msgArray['OID'];\n// + Sep.30.2011 \n//print_r(\"oid: \".$oid.\"\\r\\n\");\n// + Oct.21.2011 \n//echo \"oid: \".$oid.\"\\r\\n\";\n\t\t$isbArray = False;\n \n// + Oct.06.2011\n // flip the byte back to proper order\n $oid2 = byteswap2($oid,1) ;\n\n// + Oct.21.2011 \n//echo \"oid2: \".$oid2.\" - obj len: \".$objLength.\"\\r\\n\";\n //------------------------------\n // string - with variable length\n //------------------------------\n\t\t$isString = True;\n\t\t$contentParse = \"C\".$objLength;\n }\n\n \n //------------------------------\n // Need to bypass if Object ID other than 4113 and 4112 \n //------------------------------\n if (($oid2 == 0x1002) || ($oid2==0x1005) || ($oid2==0x1007) ) {\n $flgContent = false; \n }\n if ($objLength == 0 ) {\n $flgContent = false; \n }\n\n //------------------------------\n // Bypass the Message decoding if no content is involved\n //------------------------------\n if ($flgContent) {\n//echo \" -- flgContent : TRUE \\r\\n\" ;\n } else {\n//echo \" -- flgContent : FALSE \\r\\n\" ;\n $isString = false;\n }\n \n //------------------------------\n // Proceed to retrieve the content either Object ID not 0x1002 nor 0x1005, or\n // corresponding length of Object Content greater than zero\n //------------------------------\n if ($flgContent) {\n//------------------------------------------------------------------------------ \n $newParse = \"CucApID/CucNpID/VSid/CDid/nPid/CNPucAPID/CucNpCmd/CucNoID/CucCmdID/CucAckID/vOLen/vOID/\".$contentParse ;\n $msgArray = unpack($newParse, $content);\n\n// + Debug Oct.06.2011\n//if (($oid2 == 0x1002) || ($oid2==0x1005)) {\n//if ($oid2==0x1011) {\n// echo \" -- within readingFromMQ_02 ** <br> newParse: \".$newParse;\n// var_dump($msgArray) ;\n//} \n \n //re-create value to readable format\n if ($isString || $isbArray) {\n $str = \"\";\n if ($objLength > 0) {\n for($i=1; $i<=$objLength; $i++)\n {\n if ($isString) {\n $str = $str.chr($msgArray[$i]);\n } else {\n $str = $str.intval($msgArray[$i]);\n }\n //echo chr($msgArray[$i]);\n unset($msgArray[$i]);\n }\n $msgArray['Content'] = $str; \n } \n// Debug\n//echo \" -- Content: \".$str.\"\\r\\n\";\n } else {\n\n// + Oct.21.2011 \n//echo \"oid2: \".$oid2.\" - b4 calling valueTransfer() TRUE - flgContent: $flgContent \\r\\n\";\n \n $msgArray['Content'] = valueTransfer($msgArray['Content'], $msgArray['OID'], True);\n }\n//------------------------------------------------------------------------------ \n } else {\n\n// + Oct.21.2011 \n//echo \"oid2: \".$oid2.\" - b4 calling valueTransfer() FALSE - flgContent: $flgContent \\r\\n\";\n \n $msgArray['Content'] = valueTransfer(\"0\", $msgArray['OID'], True);\n }\n \n \treturn $msgArray;\n}",
"function getNewPluginMessages($subscriptions=\"\") {\n\t\n\tglobal $DEBUG, $messageQueuePluginPath,$messageQueueFile, $TwilioVersion, $MatrixMessageVersion;\n\t\n\tif($DEBUG)\n\t\tlogEntry(\"MESSAGE QUEUE: Inside function \".__METHOD__,0,__FILE__,__LINE__);\n\t\n\t$pluginVersion = $TwilioVersion;\n\t$pluginVersion = $MatrixMessageVersion;\n\t$pluginVersion = \"2.0\";\n\t\n\tlogEntry(\"Plugin version: \".$pluginVersion);\n\t\n\tswitch ($pluginVersion) {\n\t\t\n\t\tcase \"2.0\":\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif($subscriptions == \"\") {\n\t\t\t\t$pluginSubscriptions[] = $pluginName;\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$pluginSubscriptions = explode(\",\",$subscriptions);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//build list of messages from the pluginSubscriptions array\n\t\t\t$newMessages=array();\n\t\t\t$pluginLastRead= 0;\n\t\t\tforeach($pluginSubscriptions as $pluginName) {\n\t\t\t\t//require(\"/opt/fpp/www/common.php\");\n\t\t\t\t$DB_NAME = $settings['configDirectory'].\"/FPP.\".$pluginName.\".db\";\n\t\t\t\t$DB_NAME = \"/home/fpp/media/config\".\"/FPP.\".$pluginName.\".db\";\n\t\t\t\t\n\t\t\t\tlogEntry(\"MESSAGE QUEUE: getting NEW \".$pluginName.\" messages from \".$pluginName.\" \".$DB_NAME.\" DB\");\n\t\t\t\t\n\t\t\t\t$pluginLastRead = urldecode(ReadSettingFromFile(\"LAST_READ\",$pluginName));\n\t\t\t\tlogEntry(\"MESSAGE QUEUE: plugin \".$pluginName.\" last read: \".$pluginLastRead);\n\t\t\t\t\n\t\t\t\t$db = new SQLite3($DB_NAME) or die(\"Unable to open \".$pluginName.\" database\");\n\t\t\t\t\n\t\t\t\t//using > ONLY. caused the last message to be repeated, repeated, repeated because it was = the last read!\n\t\t\t\t//if TWO messages arrive with the EXACT same timestamp. this could cause one message to possibly be missed, \n\t\t\t\t//highly unlikely\n\t\t\t\t\n\t\t\t\t$messagesQuery = \"SELECT * FROM messages WHERE pluginName = '\".$pluginName.\"' AND timestamp > '\".$pluginLastRead.\"'\";\n\t\t\t\t\n\t\t\t\tif($DEBUG) {\n\t\t\t\t\tlogEntry(\"MESSAGE QUEUE: New Messages query: \".$messagesQuery);\n\t\t\t\t}\n\t\t\t\t$messagesResult = $db->query($messagesQuery) or die('Query failed');\n\t\t\t\t\n\t\t\t\twhile ($row = $messagesResult->fetchArray()) {\n\t\t\t\t\t\n\t\t\t\t\tlogEntry(\"MESSAGE QUEUE: Message found: \".$row['timestamp'].\" \".$row['message'].\" \".$row['pluginName'].\" \".$row['pluginData']);\n\t\t\t\t\t\n\t\t\t\t\t//add message to array\n\t\t\t\t\t$newMessages[] = $row['timestamp'].\"|\".$row['message'].\"|\".$pluginName.\"|\".$row['pluginData'];\n\t\t\t\t\t//update the last read with each incremental read\n\t\t\t\t\t\n\t\t\t\t\t$pluginLastRead = $row['timestamp'];\n\t\t\t\t\tlogEntry(\"MESSAGEQUEUE: Plugin: \".$pluginName.\" last read set to: \".$pluginLastRead);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlogEntry(\"MESSAGE QUEUE: Writing high water mark for plugin: \".$pluginName.\" LAST_READ = \".$pluginLastRead);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tWriteSettingToFile(\"LAST_READ\",urlencode($pluginLastRead),$pluginName);\n\t\t\t\t\n\t\t\t//\t$db.close();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($DEBUG) {\n\t\t\t\tlogEntry(\"MESSAGE QUEUE: Wrote high water mark\",0,__FILE__,__LINE__);\n\t\t\t}\n\t\t\t//debug to output messages to log file\n\t\t\t\n\t\t\tif($DEBUG) {\n\t\t\t\tforeach($newMessages as $tmpMsg) {\n\t\t\t\t\tlogEntry(\"MESSAGE QUEUE PENDING QUEUE: \".$tmpMsg);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $newMessages;\n\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\tdefault:\n\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t}\n\t\n}",
"public function unserialize()\n {\n parent::unserialize();\n\n $this->sequence = $this->getNumber2();\n $this->version = $this->getNumber2();\n $this->level = $this->getNumber();\n $this->event = $this->getNumber();\n $this->node = $this->getNumber2();\n $this->peer = $this->getNumber2();\n $this->time = $this->getNumber8();\n $this->host = $this->getString();\n $this->data = $this->getLongString();\n\n // Cleanup\n $this->needle = 0;\n // 0xAAA0 is the signature of the messages\n $this->buffer = pack('C*', 0xAA, 0xA0 | 0, static::ID);\n }",
"function msg_receive ($queue, $desiredmsgtype, &$msgtype, $maxsize, &$message, $unserialize = null, $flags = null, &$errorcode = null) {}",
"public static function numberOfTracksOnRelease(): string\n {\n return 'tracksrelease';\n }",
"function create_release($tag_id) {\n $tag = $this->get_tag($tag_id);\n if ($tag && $file = $this->create_package($tag_id)) {\n $node = new stdClass();\n $node->type = 'fserver_release';\n $node->status = 1;\n $node->created = !empty($tag['timestamp']) ? $tag['timestamp'] : time();\n $node->uid = $this->node->uid;\n $node->title = \"{$this->name} {$tag_id}\";\n $node->body = !empty($tag['message']) ? $tag['message'] : '';\n\n $node->field_fserver_file = array(0 => (array) $file);\n $node->field_fserver_project = array(0 => array('nid' => $this->node->nid));\n $node->field_fserver_api = array(0 => array('value' => $tag['core']));\n $node->field_fserver_versionmajor = array(0 => array('value' => $tag['major']));\n $node->field_fserver_versionpatch = array(0 => array('value' => $tag['patch']));\n $node->field_fserver_versionextra = array(0 => array('value' => $tag['extra']));\n\n // Handle the release extra info\n $extratype = FSERVER_EXTRATYPE_RELEASE;\n $extranum = NULL;\n if (!empty($tag['extra'])) {\n $extratypes = fserver_cck_options('extratype');\n $extratypes = array_flip($extratypes);\n $extratype = array_key_exists($tag['extratype'], $extratypes) ? $extratypes[$tag['extratype']] : FSERVER_EXTRATYPE_OTHER;\n $extranum = $tag['extranum'];\n }\n $node->field_fserver_versionextratype = array(0 => array('value' => $extratype));\n $node->field_fserver_versionextranum = array(0 => array('value' => $extranum));\n\n // @TODO\n $node->field_fserver_recommended = array(0 => array('value' => 1));\n $node->field_fserver_security = array(0 => array('value' => 0));\n node_save($node);\n }\n return $node;\n }",
"public function getReleaseId(): int\n {\n return $this->releaseId;\n }",
"public function setNextRelease($release)\n {\n $this->nextRelease = $release;\n }",
"public function testAdminMessageCreateChangeStreamGetAdminMessagesChangeStream()\n {\n\n }",
"public function onVersionReply()\n {\n }",
"public function releaseInfo()\n {\n $table = DB::table('migrations');\n $latest = $table->max('batch');\n $migrations = $table->whereBatch($latest)->get()->pluck('migration');\n return array_merge(\n $this->getPhpInfo(),\n [\n 'database' => [\n 'schema-version' => '<might-need-to-implement-one>',\n 'last-migrations' => $migrations\n ]\n ],\n $this->getReleaseInfo()\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the jobTitle column Example usage: $query>filterByJobtitle('fooValue'); // WHERE jobTitle = 'fooValue' $query>filterByJobtitle('%fooValue%', Criteria::LIKE); // WHERE jobTitle LIKE '%fooValue%' | public function filterByJobtitle($jobtitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($jobtitle)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(EmployeesTableMap::COL_JOBTITLE, $jobtitle, $comparison);
} | [
"public function setTitleFilter($titleFilter) {\n $this->titleFilter = \"%\" . $titleFilter . \"%\"; // add percent signs because this is used in LIKE in MySQL queries\n }",
"function title_filter($where, &$wp_query) {\n\n\tglobal $wpdb;\n\n\tif ( $search_term = $wp_query->get('search_post_title') ) {\n\t\t$where .= ' AND ' . $wpdb->posts . '.post_title LIKE \\'%' . esc_sql( like_escape( $search_term ) ) . '%\\'';\n\t}\n\n\treturn $where;\n\n}",
"public function filter_title()\n {\n }",
"public function filterByTitle($value, $operator = Rule::OP_EQ)\n\t{\n\t\treturn $this->filterBy('title', $value, $operator);\n\t}",
"protected function where_clause_Title()\n\t{\n\t\tif(!method_exists($this->incoming_record, 'get_Title'))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t$Title = $this->incoming_record->get_Title();\n\t\t$where_fragment = '';\n\t\tif($Title != '')\n\t\t{\n\t\t\t$where_fragment=\" and l.Title = {$this->db->quote($Title)}\";\n\t\t}\n\t\treturn $where_fragment;\n\t}",
"public function setJobTitle($value)\n {\n $this->jobTitle = $value;\n }",
"function like_title_posts_where( $where, &$wp_query )\n {\n global $wpdb;\n if ( $wp_title = $wp_query->get( 'wp_title' ) ) {\n $where .= ' AND ' . $wpdb->posts . '.post_title LIKE \\'' . esc_sql( $wpdb->esc_like( $wp_title ) ) . '%\\'';\n }\n return $where;\n }",
"public function setJobTitle($var)\n {\n GPBUtil::checkString($var, True);\n $this->job_title = $var;\n\n return $this;\n }",
"public function setJobTitle($val)\n {\n $this->_propDict[\"jobTitle\"] = $val;\n return $this;\n }",
"public function setJobTitle($jobTitle)\r\n\t\t{\r\n\t\t\t$this->jobTitle = $jobTitle;\r\n\t\t}",
"public function setJobTitle(?string $jobTitle){\n $this->jobTitle = $jobTitle;\n }",
"function searchEmployeeAndTitle(){ \n\t\t\n\t\t$sql = \"SELECT a.emp_number, CONCAT(a.emp_firstname,' ',a.emp_middle_name, ' ', a.emp_lastname) AS fullname, c.name\n\t\t\t\t\tFROM panpic_employee AS a\n\t\t\t\t\tJOIN config_general AS b\n\t\t\t\t\tON a.emp_job_title = b.id $this->cond\n\t\t\t\t\tJOIN config_general_desc AS c \n\t\t\t\t\t\tON b.id = c.id AND c.lang = '$this->_lang'\";\n\n\t\treturn $this->_db->fetchAll($sql);\n\t\t\n\t\t/*\n\t\tAND b.`type` = 'job_title'\n\t\tAND a.emp_number != '$emp_number'\n\t\tAND (a.emp_lastname LIKE '$q%' OR a.emp_firstname LIKE '$q%') \n\t\t */\n\t}",
"private function filterRemixjobsByTitle($jobImport)\n {\n // set filter array sf2 jobs\n $sf2_occurences = array(\n 'Symfony',\n 'symfony',\n 'Symfony 2',\n 'Symfony2',\n 'symfony 2',\n 'symfony2',\n 'sf2',\n 'SF2',\n 'PHP/Symfony2',\n 'PHP-Symfony2'\n );\n\n // check if title contain sf2 occurences\n foreach ($sf2_occurences as $sf2_occurence) {\n\n // filter sf2 jobs\n if (strpos($jobImport->title, $sf2_occurence) > 0)\n $flagSfJob = true;\n\n }\n\n // check if flag exists\n if (isset($flagSfJob))\n return $flagSfJob;\n else\n return false;\n }",
"function searchTitle($title) {\n\t\t\n\t\treturn $this->getMapper()->searchTitle($title,$this);\n\t\t\n\t}",
"public function updateJobTitle($jobtitle) {\n //\n $datetoday = date_create(date('Y/m/d H:i'));\n $date_today = date_format($datetoday, \"Y-m-d H:i\");\n //\n $mjob = new Jobtitle();\n $mjob = $jobtitle;\n\n /**\n * do update to jobtitle\n */\n $rs_head = $this->db->update('jobtitle', array(\n 'shortname' => $mjob->getShortname(),\n 'longname' => $mjob->getLongname(),\n 'date_change' => $date_today), \"jobtitle_id = {$mjob->getJobtitle_id()}\");\n\n //print \"<pre>\";\n //print_r($obj);\n //print \"</pre>\";\n //exit();\n return $rs_head;\n }",
"public function get_filter_title() {\r\n\t\treturn $this->filter_object->get_title();\r\n\t}",
"function set_jobtitle($jobtitle) {\n\t\t$this->jobtitle = $jobtitle;\n\t}",
"public function updateJobTitle() {\n try {\n if (!($this->jobTitle instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_JobTitle)) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(\" JobTitle Entity not intialized\");\n } else {\n $objJobTitle = new Base_Model_ObtorLib_App_Core_Catalog_Dao_JobTitle();\n $objJobTitle->jobTitle = $this->jobTitle;\n return $objJobTitle->updateJobTitle();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);\n }\n }",
"public static function searchProductsByTitle($title)\n\t{\n\t\t$conn = Connection::getInstance();\n\t\t$secureTitle = $conn->escapeString($title);\n\t\t$query = \"SELECT * FROM products WHERE title LIKE '%{$secureTitle}%'\";\n\n\t\treturn $conn->doSelect($query);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds as releaseDeal A Composite containing details of one or more Deals pertaining to one or more Releases. | public function addToReleaseDeal(\DedexBundle\Entity\Ern382\ReleaseDealType $releaseDeal)
{
$this->releaseDeal[] = $releaseDeal;
return $this;
} | [
"public function addToDealReleaseReference($dealReleaseReference)\n {\n $this->dealReleaseReference[] = $dealReleaseReference;\n return $this;\n }",
"public function add()\n {\n $this->loadModel('Partners');\n $this->loadModel('Authors');\n $release = $this->Releases->newEmptyEntity();\n\n if ($this->request->is('post')) {\n $release = $this->processForm($release);\n\n if ($this->Releases->save($release)) {\n $this->Flash->success('Release added');\n Cache::delete('sidebar_tags', 'long');\n Cache::delete('sidebar_partners', 'long');\n\n return $this->redirect($release->url);\n } else {\n $this->Flash->error(\n 'The release could not be saved. Please correct any indicated errors and try again.'\n );\n }\n }\n\n $this->set(['pageTitle' => 'Add a New Release']);\n $this->setReleaseFormVars($release);\n\n return $this->render('/Releases/form');\n }",
"function items_release() {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canEdit($this->logged_user) && ($this->active_invoice->isDraft() || $this->active_invoice->isCanceled())) {\n if($this->request->isSubmitted()) {\n try {\n $release_times = $this->request->post('release_times');\n $release_expenses = $this->request->post('release_expenses');\n \n if(is_foreachable($release_times)) {\n $this->active_invoice->releaseTimeRecordsByIds($release_times);\n }//if\n if(is_foreachable($release_expenses)) {\n $this->active_invoice->releaseExpensesByIds($release_expenses);\n }//if\n $this->response->respondWithData($this->active_invoice, array('as' => 'invoice'));\n } catch (Exception $e) {\n $this->response->exception($e);\n }//try\n } else {\n $this->response->badRequest();\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }",
"public function add($deal)\n {\n return $this->basket->update(function($basket) use($deal) {\n $deal = $basket->deals->resolve($deal);\n\n if ($basket->deals->has($deal)) {\n $basket->deals->update($deal, function(&$deal) {\n //\n });\n } else {\n $basket->deals->push($deal);\n }\n\n return $basket;\n });\n }",
"public function setDealReleaseReference(array $dealReleaseReference)\n {\n $this->dealReleaseReference = $dealReleaseReference;\n return $this;\n }",
"function dc_add_release()\n{\n\tglobal $wpdb;\n\t\n\t$title \t\t\t= trim($_POST['title']);\n\t$artist \t\t= trim($_POST['artist']);\n\t$filename \t\t= $_POST['filename'];\n\t$downloads \t\t= $_POST['downloads'];\n\t\n\t$errors = array();\n\t\n\t// Check if all fields have been filled out properly\n\tif ( '' == $title ) {\n\t\t$errors[] = \"The title must not be empty\";\t\n\t}\n\tif ( '' == $filename ) {\n\t\t$errors[] = \"Please choose a valid file for this release\";\t\n\t}\n\tif ( !is_numeric( $downloads ) ) {\n\t\t$errors[] = \"Allowed downloads must be a number\";\n\t}\n\t\n\t// Update or insert if no errors occurred.\n\tif ( !sizeof($errors) ) \n\t{\n\t\treturn \n\t\t$wpdb->insert(\tdc_tbl_releases(), \n\t\t\t\t\tarray( 'title' => $title, 'artist' => $artist, 'filename' => $filename, 'allowed_downloads' => $downloads),\n\t\t\t\t\tarray( '%s', '%s', '%s', '%d' ) );\n\t} else\n\t{\n\t\treturn $errors;\n\t}\n}",
"public function insert2($l_event_release)\n {\n $query=\"INSERT INTO l_event_release ( \".\n\t \"id,\".\n \"link,\".\n \"entity0,\".\n \"entity1,\".\n \"edits_pending,\".\n \"last_updated,\".\n \"link_order,\".\n \"entity0_credit,\".\n \"entity1_credit \". \n \")\".\n \"VALUES (\".\n \"null,\".\n \" \".$l_event_release->link.\" ,\".\n \" \".$l_event_release->entity0.\" ,\".\n \" \".$l_event_release->entity1.\" ,\".\n \" \".$l_event_release->edits_pending.\" ,\".\n \"'\".$this->sqlSafe($l_event_release->last_updated).\"',\".\n \" \".$l_event_release->link_order.\" ,\".\n \"'\".$this->sqlSafe($l_event_release->entity0_credit).\"',\".\n \"'\".$this->sqlSafe($l_event_release->entity1_credit).\"' \". \n \")\"; \n\n $id = $this->executeInsert($query);\n\t $l_event_release->id = $id;\n\t return($l_event_release);\t\n }",
"public function setRelease(Release $release)\n {\n $this->release = $release;\n }",
"public function add(Release $release, &$responseCode, array &$responseHeaders)\n {\n $releases = $this->createExecutablePayloads($release);\n $this->executePayloads($releases);\n }",
"public function addReleaseType(string $releaseType) {\n return $this->addDimension('ReleaseTypes', $releaseType);\n }",
"public function addPurchase($object)\n {\n $object->addPurchase($this->id);\n }",
"public function addToRelatedRelease(\\DedexBundle\\Entity\\Ern411\\RelatedReleaseType $relatedRelease)\n {\n $this->relatedRelease[] = $relatedRelease;\n return $this;\n }",
"public function testAddingReleaseCreatesRelatedPeopleEntries()\n {\n $this->release->add($this->json);\n\n $sql = $this->get->select()->from('People')->where('Name = :name')->limit(1)->result();\n $pdo = array('name' => 'UnitTestExampler');\n\n $result = $this->database->run($sql, $pdo);\n\n $this->assertFalse(empty($result));\n }",
"private static function store_new_deal()\n\t{\n\t\t$deal = new ProductDeal;\n\n\t\t$input = Input::all();\n\t\t$null_validated = true;\n\t\t$product_validated = true;\n\t\t$status = false; // false means OK! that we don't have a situation\n\n\t\t$validator = Validator::make($input, Deal::$create_rules);\n\t\t$validated = $validator->passes();\n\n\t\tforeach($input as $key => $val) \n\t\t{\n\t\t\t// if any keys have a null value, then validation has failed\n\t\t\tif (!isset($input[$key]) || $input[$key] == null) { $null_validated = false; break; }\n\n\t\t\t// check that each of these fields are set\n\t\t\tif (!isset($input['price_discount']))\t{ $null_validated = false; break; }\n\t\t\tif (!isset($input['terms']))\t\t\t{ $null_validated = false; break; }\n\t\t\tif (!isset($input['expires_time']))\t\t{ $null_validated = false; break; }\n\t\t\tif (!isset($input['begins_time']))\t\t{ $null_validated = false; break; }\n\t\t\tif (!isset($input['category']))\t\t\t{ $null_validated = false; break; }\n\t\t\tif (!isset($input['product_id']))\t\t{ $null_validated = false; break; }\n\t\t}\n \t\n \t\tif ($null_validated) {\n\t \t\t$deal->price_discount \t= $input['price_discount'];\n\t\t\t$deal->terms \t\t\t= $input['terms'];\n\t\t\t$deal->expires_time \t= $input['expires_time'];\n\t\t\t$deal->begins_time \t\t= $input['begins_time'];\n\t\t\t$deal->category \t\t= $input['category'];\n\t\t\t$deal->product_id \t\t= $input['product_id'];\n\n\t\t\t// must check for a product\n\t\t\t$product = Product::find($input['product_id']);\n\t\t\tif (!isset($product)) $product_validated = false;\n\n\t\t\tif ($product_validated)\n\t\t\t\t$status = !$deal->save(); // save the deal\n\t\t\telse \n\t\t\t\t$status = false; // for now, when product validation fails, set this as false (to mean that everything's fine); we'll use the $product_validated variable to check later. we just don't want to call $deal->save when there no valid product_id. Laravel will throw its own exception and return HTML.\n\n \t\t} else {\n\t\t\t$status = true; // we have a situation\n \t\t}\n\n\t\t$response = array('status' => $status, 'message' => null, 'deal' => null);\n\n\t\t$response['deal'] = [\n\t\t\t'input provided was' => $input, \n\t\t\t'product_id ok?' => $product_validated,\n\t\t\t'validation passed?' => $validated,\n\t\t\t'validation messages' => array($validator->messages()->all())\n\t\t];\n\n\t\t// if we have a situation...\n\t\tif ($status) {\n\t\t\t$response['message'] = \"cannot create record; check that a value exists for 'price_discount', 'terms', 'expires_time', 'begins_time', 'category', 'product_id' \";\n\t\t// if we cannot find a valid product (based on 'product_id')\n\t\t} else if (!$product_validated) {\n\t\t\t$response['message'] = \"cannot create record; product_id supplied is invalid (must already exist; use web interface to enter new products)\";\n\t\t} else {\n\t\t\t$response['message'] = 'record was created';\n\t\t}\n\n\t\treturn Response::json($response, 200);\n\t}",
"public function setNextRelease($release)\n {\n $this->nextRelease = $release;\n }",
"public function addToReleaseDetailsByTerritory(\\DedexBundle\\Entity\\Ern382\\ReleaseDetailsByTerritoryType $releaseDetailsByTerritory)\n {\n $this->releaseDetailsByTerritory[] = $releaseDetailsByTerritory;\n return $this;\n }",
"public function testGetReleasesReturnsArrayWithReleaseInstanceAfterAddRelease()\n {\n $hostMock = $this->getMockBuilder(Host::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $release = new Release('1.0.0');\n\n $workspace = new Workspace($hostMock);\n $workspace->addRelease($release);\n\n $this->assertSame(array($release), $workspace->getReleases());\n }",
"public function insert($release_raw)\n {\n $query=\"INSERT INTO release_raw ( \".\n\t \"id,\".\n \"title,\".\n \"artist,\".\n \"added,\".\n \"last_modified,\".\n \"lookup_count,\".\n \"modify_count,\".\n \"source,\".\n \"barcode,\".\n \"comment \". \n \")\".\n \"VALUES (\".\n \"null,\".\n \"'\".$this->sqlSafe($release_raw->title).\"',\".\n \"'\".$this->sqlSafe($release_raw->artist).\"',\".\n \"'\".$this->sqlSafe($release_raw->added).\"',\".\n \"'\".$this->sqlSafe($release_raw->last_modified).\"',\".\n \" \".$release_raw->lookup_count.\" ,\".\n \" \".$release_raw->modify_count.\" ,\".\n \" \".$release_raw->source.\" ,\".\n \"'\".$this->sqlSafe($release_raw->barcode).\"',\".\n \"'\".$this->sqlSafe($release_raw->comment).\"' \". \n \")\"; \n\n $this->executeQuery($query);\n }",
"protected function addDate(Release $release)\n\t{\n\t\t$content = '';\n\t\t$date = $release->getDate();\n\t\tif ($date !== null)\n\t\t{\n\t\t\t$content = ' - ' . $date->format('Y-m-d');\n\t\t}\n\t\treturn $content;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Indicates whether a pre invoice with the specified ID exists. | public function preInvoiceExists( $preInvoiceId )
{
$sql = 'SELECT %s
FROM %s
WHERE %s=%d
AND %s=%d';
$sql = sprintf( $sql,
$this->db->quoteIdentifier( 'id_facture' ),
$this->db->quoteIdentifier( 'gr_factures'),
$this->db->quoteIdentifier( 'statut' ),
$this->db->quote( GlobalRecreatifInvoiceStatus::Prepared, 'integer' ),
$this->db->quoteIdentifier( 'id_facture' ),
$this->db->quote( $preInvoiceId, 'integer' )
);
$this->db->setLimit( 1 );
$preInvoiceInformation = $this->db->queryOne( $sql );
if( empty( $preInvoiceInformation ) )
{
// Pre invoice doesn't seem to exist.
return false;
}
return true;
} | [
"public function check_invoice()\n\t{\n\t\t$sc = TRUE;\n\t\t$invoice = trim($this->input->get('invoice_code'));\n\t\tif(!empty($invoice))\n\t\t{\n\t\t\t$valid = $this->return_order_model->get_valid_invoice($invoice);\n\t\t\tif(empty($valid))\n\t\t\t{\n\t\t\t\t$sc = FALSE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sc = FALSE;\n\t\t}\n\n\t\techo $sc === TRUE ? 'success' : \"Not found\";\n\t}",
"public function check_invoice_exists($orderId)\n\t{\n\t\t$invoiceTable = Mage::getSingleton('core/resource')->getTableName('sales_flat_invoice');\n\t\t$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);\n\t\t$Id = $order->getId();\n\t\t$sql = \"select entity_id from \" . $invoiceTable . \"\n\t\t\t\t\t\t\twhere order_id = '\" . (int) $Id . \"'\";\n\n\t\t$invoice = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchRow($sql);\n\t\t\n\t\tif (!empty($invoice)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function db_exist_invoice($iID){\r\n\t\t$dbc = db_connect()->query(\"SELECT COUNT(*) FROM \".db_table('invoice').\" WHERE id = '$iID';\");\r\n\t\t$dbr = $dbc->fetch_row();\r\n\t\treturn (int)$dbr[0];\r\n\t}",
"public function hasInvoiceNumber()\n {\n return $this->InvoiceNumber !== null;\n }",
"public function isCreatedVendorInvoice($invoiceId){\n $table = $this->getTable('ves_vendor_sales_invoice');\n $readCollection = $this->getConnection();\n $sql = \"SELECT count(entity_id) as invoice_num FROM $table WHERE invoice_id=\\\"{$invoiceId}\\\";\";\n $count = $readCollection->fetchOne($sql);\n return $count > 0;\n }",
"public function exists($id);",
"public function hasInvoiceInfo()\n {\n return $this->InvoiceInfo !== null;\n }",
"public function hasInvoiceMetadata()\n {\n return $this->InvoiceMetadata !== null;\n }",
"public function isSetInvoice()\n {\n return !is_null($this->_fields['Invoice']['FieldValue']);\n }",
"public function recordExists($id);",
"public function isInvoice()\n {\n return $this->type == self::INVOICE;\n }",
"public function canGetSpecificInvoiceById()\n {\n // Arrange\n if (! isset($this->invoice)) {\n $this->canCreateInvoice();\n }\n\n // Act\n\n $invoice = Ezypay::getInvoice($this->invoice['id']);\n\n // Assert\n $this->assertEquals($this->invoice['id'], $invoice['id']);\n\n $this->assertTrue(array_key_exists('id', $invoice));\n $this->assertTrue(array_key_exists('documentNumber', $invoice));\n $this->assertTrue(array_key_exists('date', $invoice));\n }",
"public function isExists(){\n\t\treturn $this->getId() != 0;\n\t}",
"public function hasID()\n {\n return (isset($this->_objData[$this->_objField]) && $this->_objData[$this->_objField]);\n }",
"function isReceiptExist()\n\t{\n\t\tglobal $db;\n\n\t\t$query = 'SELECT receipt_id FROM '.receipt_table.' WHERE receipt_id = '.$this->receipt_id;\n\t\t$db->query($query);\n\t\t$result = $db->query($query);\n\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_info = $db->errorInfo();\n\t\t\techo $err_info[2];\n\t\t\terror_log('Function : isReceiptExist, Class : receipt, '.$err_info[2]);\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr = $result->fetch(PDO::FETCH_ASSOC);\n\t\t\t$receipt_id = $arr['receipt_id'];\n\t\t}\n\t\treturn $receipt_id;\n\t}",
"public function canInvoice()\n {\n return $this->getQtyToInvoice()>0;\n }",
"public function isInInvoice($productName)\r\n\t{\r\n\t\treturn array_key_exists($productName, $this->invoice);\r\n\t}",
"public function hasInvoiceDate()\n {\n return $this->InvoiceDate !== null;\n }",
"public function clientExists($id);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds an object to the instance pool. Propel keeps cached copies of objects in an instance pool when they are retrieved from the database. In some cases especially when you override doSelect() methods in your stub classes you may need to explicitly add objects to the cache in order to ensure that the same objects are always returned by doSelect() and retrieveByPK() calls. | public static function addInstanceToPool($obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getROperationUniverseId();
} // if key === null
ROperationUniversesPeer::$instances[$key] = $obj;
}
} | [
"public static function addInstanceToPool($obj, $key = null)\n {\n if (Propel::isInstancePoolingEnabled())\n {\n if ($key === null)\n {\n $key = (string) $obj->getId();\n }\n self::$instances[$key] = $obj;\n }\n }",
"public static function addInstanceToPool($obj, $key = null)\n {\n if (Propel::isInstancePoolingEnabled()) {\n if ($key === null) {\n $key = (string) $obj->getId();\n } // if key === null\n StorePeer::$instances[$key] = $obj;\n }\n }",
"public static function addInstanceToPool($obj, $key = null)\n\t{\n\t\tif (Propel::isInstancePoolingEnabled()) {\n\t\t\tif ($key === null) {\n\t\t\t\t$key = (string) $obj->getIdOrderDetail();\n\t\t\t} // if key === null\n\t\t\tself::$instances[$key] = $obj;\n\t\t}\n\t}",
"public static function addInstanceToPool($obj, $key = null)\n\t{\n\t\tif (Propel::isInstancePoolingEnabled()) {\n\t\t\tif ($key === null) {\n\t\t\t\t$key = (string) $obj->getId();\n\t\t\t} // if key === null\n\t\t\tself::$instances[$key] = $obj;\n\t\t}\n\t}",
"public static function addInstanceToPool(Columna $obj, $key = null)\n\t{\n\t\tif (Propel::isInstancePoolingEnabled()) {\n\t\t\tif ($key === null) {\n\t\t\t\t$key = (string) $obj->getColCodigo();\n\t\t\t} // if key === null\n\t\t\tself::$instances[$key] = $obj;\n\t\t}\n\t}",
"public function add() {\n\t\t$model = $this->model;\n\t\t$instance = new $model ();\n\t\t$this->operate_ ( $instance, function ($instance) {\n\t\t\t$this->_setValuesToObject ( $instance, URequest::getDatas () );\n\t\t\treturn DAO::insert ( $instance );\n\t\t}, \"inserted\", \"Unable to insert the instance\", [ ] );\n\t}",
"public function add($object);",
"public abstract function add($object);",
"static public function add($object, $name = null) {\n\t\t// Use class name if no name is provided\n\t\t$name = (!is_null($name)) ?: get_class($object);\n\t\t$name = strtolower($name);\n\n\t\t$return = null;\n\t\tif (isset(self::$_store[$name])) {\n\t\t\t$return = self::$_store[$name];\n\t\t}\n\n\t\tself::$_store[$name] = $object;\n\t\treturn $return;\n\t}",
"public function add($obj);",
"public function add(QueryInterface $query): void\n {\n $this->pool[$query->getHashKey()] = $query;\n }",
"public function add($object)\n \t{\n \t\t$this->objects[] = $object;\n \t}",
"protected function add($object) {\n array_push($this->collection, $object);\n }",
"public function add($object)\n {\n parent::add($object);\n $this->persistenceManager->persistAll();\n }",
"public function addObject(OSM_Object $obj) {\n\n\t\t$objectId = $obj->getId();\n\t\tif (empty($objectId))\n\t\t\tthrow new OSM_Exception('Object Id must be set');\n\n\t\tif ($objectId < 0)\n\t\t{\n\t\t\t$obj->setAttribute('changeset', $this->_id);\n\t\t\t$this->_createdObjects[$objectId] = $obj;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$obj->setAttribute('changeset', $this->_id);\n\t\t\t// do not increment the version, it's need by the server to detect conflict.\n\t\t\t//$obj->setAttribute('version', $obj->getAttribute('version') + 1);\n\t\t\t$this->_modifiedObjects[$objectId] = $obj;\n\t\t}\n\t}",
"public function add(Model $object)\n {\n if ($this->collection === null) {\n $this->collection = $object::collection();\n }\n\n $bulkOperation = $object->asBulkOperation();\n\n if ($bulkOperation !== null) {\n $this->addRaw($bulkOperation);\n }\n }",
"public function insert(SqoolObject $object) {\n\t\tif( $object->databaseRootObject !== null) {\n\t\t\tthrow new cept(\"Trying to insert an object that's already stored in a database. Please create a copy of the object first.\");\n\t\t}\n\n\t\t$object->setUpSqoolObject($this);\n\t\t$this->addAllToQueue($this->createInsertOp($object));\n\t\treturn $object;\n\t}",
"public function addObject($object)\n\t{\n\t\t$this->tableObjects[$this->count++] = $object;\n\t}",
"public function add(Services_OpenStreetMap_Object $object): void\n {\n if (!$this->open) {\n throw new Services_OpenStreetMap_RuntimeException(\n 'Object added to closed changeset'\n );\n }\n $object->setChangesetId($this->getId());\n $objectId = $object->getType() . $object->getId();\n if (!in_array($objectId, $this->membersIds)) {\n $this->members[] = $object;\n $this->membersIds[] = $objectId;\n } else {\n throw new Services_OpenStreetMap_RuntimeException(\n 'Object added to changeset already'\n );\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get next (franchise/member) user name | function get_next_username($parent_id, $user_priv) {
if ($parent_id && $user_priv) {
$where['user_id&user_priv'] = array($parent_id, $user_priv, '_multi'=>true);
$last_name = M('last_username')->where($where)->field('user_name,last_num')->find();
// echo M('last_username')->getLastSQL();
// var_dump($last_name);
$new_name = '';
if ($last_name) {
$new_name = $last_name['user_name'] . sprintf("%03d", intval($last_name['last_num']) + 1);
} else {
$user_name = M("users")->where(array('user_id'=>$parent_id))->getField('user_name');
$new_name = $user_name . '001';
}
return $new_name;
}
} | [
"function getNextUser() \n {\n return $this->instance->getNextUser();\n }",
"function get_user_name();",
"public function getNextAssignee() {\n\t\t$admin = &Yii::app()->params->admin;\n\t\t$type = $admin->serviceDistribution;\n\t\tif ($type == \"\") {\n\t\t\treturn \"Anyone\";\n\t\t} elseif ($type == \"evenDistro\") {\n\t\t\treturn $this->evenDistro();\n\t\t} elseif ($type == \"trueRoundRobin\") {\n\t\t\treturn $this->roundRobin();\n\t\t} elseif($type=='singleUser') {\n $user=User::model()->findByPk($admin->srrId);\n if(isset($user)){\n return $user->username;\n }else{\n return \"Anyone\";\n }\n } elseif($type=='singleGroup') {\n $group=Groups::model()->findByPk($admin->sgrrId);\n if(isset($group)){\n return $group->id;\n }else{\n return \"Anyone\";\n }\n }\n\t}",
"private function get_user_name() {\r\n global $user;\r\n return $user->data['username'];\r\n }",
"public function generateUsername() {\n\t\t$member = $this->getOwner();\t\n\t\t$count = 1;\n\t\tdo{\n\t\t\t$username = strtolower(substr($member->FirstName,0,$count).$member->Surname);\n\t\t\tif(strlen($member->FirstName) < $count) $username .= $count;\n\t\t\t$username = preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $username);\n\t\t\t$count++;\n\t\t}while(Member::get()->filter(\"Username\", $username)->exists());\n\n\t\treturn $username;\n\t}",
"public function get_next_member($member)\n {\n $tempid = $this->connection->query_value_if_there('SELECT uid FROM ' . $this->connection->get_table_prefix() . 'users WHERE uid>' . strval($member) . ' ORDER BY uid');\n return $tempid;\n }",
"public function name() {\n return isset($this->_adaptee->user_info['user_displayname']) ? $this->_adaptee->user_info['user_displayname'] : null;\n }",
"public function assign_logged_in_user_name(){\r\n\r\n\t\t$user = wp_get_current_user();\r\n\t\t$name = $user->first_name;\t\t\r\n\t\treturn $name;\r\n\t}",
"public function generateUsername()\n {\n // try to use name part of email\n $this->username = explode('@', $this->email)[0];\n if ($this->validate(['username'])) {\n return $this->username;\n }\n\n // generate username like \"user1\", \"user2\", etc...\n while (!$this->validate(['username'])) {\n $row = (new Query())\n ->from('{{%user}}')\n ->select('MAX(id) as id')\n ->one();\n\n $this->username = 'user' . ++$row['id'];\n }\n\n return $this->username;\n }",
"public function getNextGuestUserId()\r\n\t{\r\n\t\t$db = JFactory::getDbo();\r\n\t\tTienda::load( 'TiendaQuery', 'library.query' );\r\n\t\t$q = new TiendaQuery();\r\n\t\t$start_id = Tienda::getGuestIdStart();\r\n\t\t\r\n\t\t$q->select( 'min( tbl.user_id)' );\r\n\t\t$q->from( '#__tienda_userinfo tbl' );\r\n\t\t$q->where( 'tbl.user_id < '.$start_id );\r\n\t\t$db->setQuery( ( string )$q );\r\n\t\t$res = $db->loadResult();\r\n\t\tif( $res === null ) // no guest account in system\r\n\t\t\treturn $start_id-1; // start off with -11\r\n\t\telse\r\n\t\t\treturn $res - 1; // the last guest account id -1\r\n\t}",
"public function getName_user()\n {\n return $this->name_user;\n }",
"public function get_user_name(){\n\t\treturn $this->v_user_name;\n\t}",
"public function getNameUser(){\n return $this->name_user;\n }",
"public function getNameUser() {\n return $this->nameUser;\n }",
"public function getUidnext() {\n\t\tif (!isset($this->uidNext)) {\n\t\t\t$status = $this->getStatus(['UIDNEXT']);\n\n\t\t\t$this->uidNext = $status['UIDNEXT'];\n\t\t}\n\n\t\treturn $this->uidNext;\n\t}",
"public function getRealName()\r\n\t{\r\n\t\treturn $this->user->realname;\r\n\t}",
"public function uidnext()\n {\n return $this->_status[self::UIDNEXT];\n }",
"public function generateUsername()\n {\n $fullName = cryllicToLatin(\"{$this->first_name}_{$this->last_name}\");\n $username = $fullName;\n $counter = 2;\n\n while (self::where('username', $username)->exists()) {\n $username = $fullName . $counter;\n $counter++;\n }\n\n return $username;\n }",
"function generate_username($first_name, $last_name, $role = 0){\n\t$username = $first_name . $last_name;\n\tif($role === STUDENT){\n\t\t$username .= get_next_student_id();\n\t} else{\n\t\t$username .= get_next_faculty_id();\n\t}\n\treturn strtolower($username);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END group_lastupdate() METHOD THIS METHOD RETURNS MAXIMUM PRIVACY LEVEL VIEWABLE BY A USER WITH REGARD TO THE CURRENT GROUP INPUT: $other_user REPRESENTING A USER OBJECT OUTPUT: RETURNS PRIVACY LEVEL OF GIVEN USER WITH RESPECT TO CURRENT GROUP | function group_privacy_max($user) {
global $database;
switch(TRUE) {
// GROUP LEADER
case($this->group_info['group_user_id'] == $user->user_info['user_id']):
return 1;
break;
// GROUP OFFICER
case($database->database_num_rows($database->database_query("SELECT groupmember_id FROM se_groupmembers WHERE groupmember_user_id='{$user->user_info['user_id']}' AND groupmember_group_id='{$this->group_info['group_id']}' AND groupmember_status='1' AND groupmember_rank='1'")) != 0):
return 2;
break;
// GROUP MEMBER
case($database->database_num_rows($database->database_query("SELECT groupmember_id FROM se_groupmembers WHERE groupmember_user_id='{$user->user_info['user_id']}' AND groupmember_group_id='{$this->group_info['group_id']}' AND groupmember_status='1'")) != 0):
return 4;
break;
// GROUP LEADER'S FRIEND
case($database->database_num_rows($database->database_query("SELECT friend_id FROM se_friends WHERE friend_status='1' AND friend_user_id1='{$this->group_info['group_user_id']}' AND friend_user_id2='{$user->user_info['user_id']}'")) != 0):
return 8;
break;
// GROUP MEMBER'S FRIEND
case($database->database_num_rows($database->database_query("SELECT se_friends.friend_id FROM se_groupmembers LEFT JOIN se_friends ON se_groupmembers.groupmember_user_id=se_friends.friend_user_id1 WHERE se_groupmembers.groupmember_status='1' AND se_groupmembers.groupmember_group_id='{$this->group_info['group_id']}' AND se_friends.friend_status='1' AND se_friends.friend_user_id2='{$user->user_info['user_id']}'")) != 0):
return 16;
break;
// FRIEND OF GROUP MEMBER'S FRIENDS
case($database->database_num_rows($database->database_query("SELECT t2.friend_user_id2 FROM se_groupmembers LEFT JOIN se_friends AS t1 ON se_groupmembers.groupmember_user_id=t1.friend_user_id1 LEFT JOIN se_friends AS t2 ON t1.friend_user_id2=t2.friend_user_id1 WHERE se_groupmembers.groupmember_status='1' AND se_groupmembers.groupmember_group_id='{$group->group_info['group_id']}' AND t1.friend_status='1' AND t2.friend_status='1' AND t2.friend_user_id2='{$user->user_info['user_id']}'")) != 0):
return 32;
break;
// REGISTERED USER
case($user->user_exists == 1):
return 64;
break;
// DEFAULT EVERYONE
default:
return 128;
}
} | [
"function user_privacy_max($other_user, $allowable_privacy = \"012345\") {\n\t global $database;\n\t\n\t switch(TRUE) {\n\t\n\t // NOBODY\n\t // NO ONE HAS $privacy_level = 6\n\n\t // OWNER\n\t case($this->user_info[user_id] == $other_user->user_info[user_id]):\n\t $privacy_level = 5;\n\t break;\n\n\t // FRIEND\n\t case($this->user_friended($other_user->user_info[user_id])):\n\t $privacy_level = 4;\n\t break;\n \n\t // FRIEND OF FRIEND WITHIN SAME SUBNETWORK\n\t case($this->user_info[user_subnet_id] == $other_user->user_info[user_subnet_id] AND $this->user_friend_of_friend($other_user->user_info[user_id]) == TRUE):\n\t $privacy_level = 3;\n\t break;\n\n\t // SAME SUBNETWORK\n\t case($this->user_info[user_subnet_id] == $other_user->user_info[user_subnet_id]):\n\t $privacy_level = 2;\n\t break;\n\n\t // REGISTERED USER\n\t case($other_user->user_exists != 0):\n\t $privacy_level = 1;\n\t break;\n\n\t // EVERYONE (DEFAULT)\n\t default:\n\t $privacy_level = 0;\n\t break;\n\t\n\t }\n\n\t // MAKE SURE PRIVACY LEVEL IS ALLOWED BY ADMIN\n\t $allowable_privacy = str_split($allowable_privacy);\n\t rsort($allowable_privacy);\n\t if($privacy_level >= $allowable_privacy[0]) {\n\t $privacy_level = 6;\n\t }\n\n\t // RETURN PRIVACY LEVEL\n\t return $privacy_level;\n\n\t}",
"public static function getUserRules(){\n \n $db = JFactory::getDBO();\n $user = JFactory::getUser();\n \n jimport( 'joomla.access.access' );\n $groups_id = JAccess::getGroupsByUser($user->id);\n \n if (!$groups_id) $groups_id[] = 1; // user is not registered = guest\n \n // load the needed data for the importance \n $query = $db->getQuery(true)\n ->select('group_id, importance, id')\n ->from('#__jdownloads_usergroups_limits')\n ->order('importance');\n $db->setQuery($query);\n $groups_levels = $db->loadAssocList('group_id');\n \n // user is a member in multiple groups so we mucg search the 'most important' group\n if (count($groups_id) > 1){\n $value = 0;\n $dummy = 0;\n foreach ($groups_id as $group_id){\n if (isset($groups_levels[$group_id])){\n if ($groups_levels[$group_id]['importance'] > $dummy){\n $dummy = $groups_levels[$group_id]['importance'];\n $value = $groups_levels[$group_id]['group_id'];\n } \n }\n }\n if ($value > 0){\n // we have found the most important group so update the value\n unset($groups_id);\n $groups_id[] = $value;\n }\n } \n \n $groups_ids = implode(',', $groups_id);\n $sql = 'SELECT * FROM #__jdownloads_usergroups_limits WHERE group_id IN (' . $groups_ids. ')';\n $db->setQuery($sql);\n $jd_user_settings = $db->loadObjectList();\n\n if (count($jd_user_settings) == 1){\n // user is only in a single group\n // this should be the normal case!\n return $jd_user_settings[0];\n } else {\n // fallback option for special situations !!!\n \n // user is in multi groups\n // so we must get the group with the highest permission levels from the default group: \n // 1. super users ID = 8\n // 2. admin ID = 7\n // 3. manager ID = 6\n // 4. publisher ID = 5\n // 5. shop suppliers ID = 10\n // 6. editor ID = 4\n // 7. customer group ID = 12\n // 8. author ID = 3\n // 9. registered ID = 2\n // 10 guest ID = 13 \n // 11 public ID = 1\n if (in_array('8', $groups_id)) {\n $key = self::findUserGroupID($jd_user_settings, '8');\n return $jd_user_settings[$key];\n }\n if (in_array('7', $groups_id)) {\n $key = self::findUserGroupID($jd_user_settings, '7');\n return $jd_user_settings[$key];\n } \n if (in_array('6', $groups_id)) {\n $key = self::findUserGroupID($jd_user_settings, '6');\n return $jd_user_settings[$key];\n } \n if (in_array('5', $groups_id)) {\n $key = self::findUserGroupID($jd_user_settings, '5');\n return $jd_user_settings[$key];\n } \n if (in_array('10', $groups_id)) {\n $key = self::findUserGroupID($jd_user_settings, '10');\n return $jd_user_settings[$key];\n } \n if (in_array('4', $groups_id)) {\n $key = self::findUserGroupID($jd_user_settings, '4');\n return $jd_user_settings[$key];\n }\n if (in_array('12', $groups_id)) {\n $key = self::findUserGroupID($jd_user_settings, '12');\n return $jd_user_settings[$key];\n } \n if (in_array('3', $groups_id)) {\n $key = self::findUserGroupID($jd_user_settings, '3');\n return $jd_user_settings[$key];\n } \n if (in_array('2', $groups_id)) {\n $key = self::findUserGroupID($jd_user_settings, '2');\n return $jd_user_settings[$key];\n } \n if (in_array('13', $groups_id)) {\n $key = self::findUserGroupID($jd_user_settings, '13');\n return $jd_user_settings[$key];\n } \n if (in_array('1', $groups_id)) {\n $key = self::findUserGroupID($jd_user_settings, '1');\n return $jd_user_settings[$key];\n } \n }\n return $jd_user_settings[0];\n }",
"function get_effective_access_level($p_user_id = 0, $p_project_id = -1)\n{\n global $g_mantis_project_user_list_table,\n $g_project_cookie_val;\n\n # use the current user unless otherwise specified\n if (0 == $p_user_id) {\n $t_user_id = get_current_user_field(\"id\");\n } else {\n $t_user_id = $p_user_id;\n }\n\n # all projects\n if (-1 == $p_project_id) {\n $query = \"SELECT access_level\n\t\t\t\t\tFROM $g_mantis_project_user_list_table\n\t\t\t\t\tWHERE user_id='$t_user_id' AND project_id='$g_project_cookie_val'\";\n } else {\n if (0 == $p_project_id) {\n $g_project_cookie_val = p_project_id;\n $query = \"SELECT access_level\n\t\t\t\t\tFROM $g_mantis_project_user_list_table\n\t\t\t\t\tWHERE user_id='$t_user_id'\";\n } else {\n $query = \"SELECT access_level\n\t\t\t\t\tFROM $g_mantis_project_user_list_table\n\t\t\t\t\tWHERE user_id='$t_user_id' AND project_id='$p_project_id'\";\n }\n }\n\n $result = db_query($query);\n $count = db_num_rows($result, 0, 0);\n if ($count > 0) {\n return db_result($result, 0, 0);\n } else {\n return get_user_field($t_user_id, \"access_level\");\n }\n}",
"function get_second_group($user)\n{\n $group = (int) (isset($user->group) ? $user->group : $user->power);\n if ($group === 1) {\n return (int) $user->ca;\n } elseif ($group === 2) {\n if (isset($user->temp_mod) && $user->temp_mod) {\n return 0;\n } elseif ((bool) (int) $user->trial_mod) {\n return 1;\n } else {\n return 2;\n }\n }\n return -1;\n}",
"function GetUserGroupAccessToBackEnd($user_group)\n {\n $q=\"select * from `\".TblSysGroupUsers.\"` where id='\".$user_group.\"'\";\n $this->db->db_Query($q);\n $row_res=$this->db->db_FetchAssoc();\n $this->users_access_to_admin_part = $row_res['adm_menu'];\n return $this->users_access_to_admin_part;\n }",
"public function groupAccessLevel(){\n\t\n\t global $db;\n\t \n\t #see if user is guest, if so, they have zero-level access.\n\t\tif($this->user == \"guest\"){\n\t\t $getAccessLevel = 0;\n\t\t return($getAccessLevel);\n\t\t}else{\n\t \t$db->SQL = \"SELECT Level FROM ebb_groups where id='\".$this->gid.\"' LIMIT 1\";\n\t\t\t$getAccessLevel = $db->fetchResults();\n\n\t\t\treturn($getAccessLevel['Level']);\n\t\t}\n\t}",
"function get_user_max_group($temp, $all_groups) {\n\t$groups\t\t\t\t= $temp['usergroups'] != '' ? iif(!unserialize($temp['usergroups']), array(), unserialize($temp['usergroups'])) : array();\n\t\t\t\n\tif(is_array($groups)) {\n\t\t\n\t\t\n\t\t/**\n\t\t * Loop through all of the groups and all of this users groups\n\t\t * Find the one with the highest permission and use it as the color\n\t\t * for this person's username. The avatar is separate because not all\n\t\t * groups will automatically have avatars, so get the highest possible\n\t\t * set avatar for this user.\n\t\t */\n\t\tforeach($groups as $g) {\n\t\t\t\n\t\t\t/* If the group variable isn't set, set it */\n\t\t\tif(!isset($group) && isset($all_groups[$g]))\n\t\t\t\t$group\t= $all_groups[$g];\n\t\t\t\n\t\t\tif(!isset($avatar) && isset($all_groups[$g]) && $all_groups[$g]['avatar'] != '')\n\t\t\t\t$avatar\t= $all_groups[$g]['avatar'];\n\n\t\t\t/**\n\t\t\t * If the perms of this group are greater than that of the $group 'prev group', \n\t\t\t * set is as this users group \n\t\t\t */\n\t\t\tif(isset($all_groups[$g]['max_perm']) && isset($group['max_perm']) && ($all_groups[$g]['max_perm'] > $group['max_perm'])) {\n\t\t\t\t$group\t= $all_groups[$g];\n\t\t\t\t\n\t\t\t\t/* Give this user an appropriate group avatar */\n\t\t\t\tif($all_groups[$g]['avatar'] != '')\n\t\t\t\t\t$avatar\t= $all_groups[$g]['avatar'];\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$group['avatar']\t\t= isset($avatar) ? $avatar : '';\n\n\treturn $group;\n}",
"function zg_fetch_latest_quest_group(\\stdClass $game_user) {\n if ($lqg = zg_get_value($game_user, 'actual_last_quest_groups_id')) {\n\n // Use zfqg($gu)[$id] instead of zfqg($gu, $id) so we get correct show flag.\n $lqgo = zg_fetch_quest_groups($game_user)[$lqg];\n if (strpos($lqgo->class, 'clickable') !== FALSE) {\n return $lqg;\n }\n }\n return $game_user->fkey_last_played_quest_groups_id;\n}",
"function _c4m_user_notifications_dispatch_og_group_access_update($node, $wrapper, $wrapper_original) {\n if (!isset($wrapper->group_access) || !isset($wrapper_original->group_access)) {\n return;\n }\n\n try {\n $group_access = c4m_og_get_access_type($wrapper->value());\n }\n catch (EntityMetadataWrapperException $e) {\n watchdog('c4m_user_notifications', 'EntityMetadataWrapperException when getting group value', [], WATCHDOG_ERROR);\n return;\n }\n\n try {\n $group_former_access = c4m_og_get_access_type($wrapper_original->value());\n }\n catch (EntityMetadataWrapperException $e) {\n watchdog('c4m_user_notifications', 'EntityMetadataWrapperException when getting group value', [], WATCHDOG_ERROR);\n return;\n }\n\n $group_membership_request_type = _c4m_user_notifications_get_group_membership_request_type($wrapper);\n\n // Check if the group access type change.\n if ($group_access['type'] != $group_former_access['type']) {\n $permissions = _c4m_user_notifications_build_group_permissions($group_access, $group_membership_request_type);\n // Send MT34 - Inform group admins the access level changed.\n _c4m_user_notifications_notify_og_group_access_update($node, $permissions);\n }\n else {\n // Check if 'membership open' state was changed.\n $prev_membership_open = $wrapper_original->field_membership_open_request->value();\n\n if ($group_membership_request_type != $prev_membership_open) {\n $permissions = _c4m_user_notifications_build_group_permissions($group_access, $group_membership_request_type);\n // Send MT34 - Inform group admins the access level changed.\n _c4m_user_notifications_notify_og_group_access_update($node, $permissions);\n }\n }\n}",
"function testRectifyUserGroup()\n\t{\n\t\t$currentUserGroupString = $this->getCurrentUserGroupString();\n\t\t\n\t\t//function appendAccessLevel($currentAccessLevel, $desiredAccessLevel)\n\t\t$memberaccess = new tx_memberaccess_modfunc1; \n\t\t$memberaccess->db = $GLOBALS['TYPO3_DB'];\n\t\tif ($this->debug) {\n\t\t\t$memberaccess->debug = true;\n\t\t}\n\t\t$desiredAccessLevel = $this->dataArr['usergroup']; \n\t\t$newUserGroupString = $memberaccess->appendAccessLevel($currentUserGroupString, $desiredAccessLevel);\n\n\t\tif($this->debug) {\n\t\t\techo \"\\$currentUserGroupString = $currentUserGroupString \\n<br>\";\n\t\t\techo \"\\$newUserGroupString = $newUserGroupString \\n<br>\";\n\t\t}\n\t\t\n\t\t$ignoredLevels = '1,2,3,4';\n\t\t$newUserGroupString = $memberaccess->appendAccessLevel('1,9,10', $desiredAccessLevel, $ignoredLevels);\n\n\t\tif($this->debug) {\n\t\t\techo \"\\$currentUserGroupString = $currentUserGroupString \\n<br>\";\n\t\t\techo \"\\$newUserGroupString = $newUserGroupString \\n<br>\";\n\t\t}\n\t}",
"public function getLevelUpgradeTo()\n {\n $groupId = $this->getCustomer()->getGroupId();\n $customerGroup = clone $this->getCustomer()->getGroup();\n //if ($groupId == $gold = $this->_getHelper()->getGroupIdByVipLevel('gold')) {\n if ($groupId == $platinum = $this->_getHelper()->getGroupIdByVipLevel('platinum')) {\n return $this->__('You are already %s Member!', $this->_getHelper()->__($customerGroup->getCode()));\n }\n\t\telseif ($groupId == $gold = $this->_getHelper()->getGroupIdByVipLevel('gold')) {\n\t\t\t$nextLevel = $platinum;\n\t\t}\n\t\telseif($groupId == $silver = $this->_getHelper()->getGroupIdByVipLevel('silver')) {\n\t $nextLevel = $gold;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nextLevel = $silver;\n\t\t}\n\n\t\t\n $nextLevel = $customerGroup->unsetData()->load($nextLevel)->getCode();\n //return $this->_getHelper()->__('Points to upgrade to %s', $this->_getHelper()->__($nextLevel));\n\t\treturn $this->_getHelper()->__($nextLevel);\n }",
"function rectifyUserGroup()\n\t{\n\t\t$currentUserGroupString = $this->getCurrentUserGroupString();\n\t\t\n\t\t$memberaccess = new tx_memberaccess_modfunc1; \n\t\t$memberaccess->db = $GLOBALS['TYPO3_DB'];\n\t\tif ($this->debug) {\n\t\t\t$memberaccess->debug = true;\n\t\t}\n\t\t//Ignore the free/professional/complimentary groups because those are the \n\t\t//groups that we want to change, not ones that we want to keep.\n\t\t$ignoredLevels = '1,2,3,4';\n\n\t\t$desiredAccessLevel = $this->dataArr['usergroup']; \n\t\t$newUserGroupString = $memberaccess->appendAccessLevel($currentUserGroupString, $desiredAccessLevel, $ignoredLevels);\n\n\t\tif($this->debug) {\n\t\t\techo \"\\$currentUserGroupString = $currentUserGroupString \\n<br>\";\n\t\t\techo \"\\$newUserGroupString = $newUserGroupString \\n<br>\";\n\t\t}\n\t\t\n\t\t$this->dataArr['usergroup'] = $newUserGroupString;\n\n\t}",
"function _get_user_level($user_id) {\n $this->module('trongate_users-trongate_user_levels');\n $user_level = $this->trongate_user_levels->_get_user_level($user_id);\n return $user_level;\n }",
"function get_user_access_granted($resource_id,$user_id)\n\t{\n\t\tif (empty($resource_id) || $resource_id == 0) return 0; //\n\t if (empty($user_id)) {\n\t $user_id = 20; // default bruger\n\t }\n\t\t$query = \"\";\n\t $query .= \" select distinct * from accgrants grants,\";\n\t $query .= \" accgroups groups,\";\n\t $query .= \" accmember member,\";\n\t $query .= \" accresources resource\";\n\t $query .= \" where grants.resource_id=resource.resource_id\";\n\t $query .= \" and ressource.resource_id=$resource_id\";\n\t $query .= \" and (grants.user_id=$user_id\";\n\t $query .= \" or (grants.group_id=groups.group_id\";\n\t $query .= \" and groups.group_id=member.group_id\";\n\t $query .= \" and member.user_id = $user_id)\";\n\t $query .= \") order by access_level desc\";\n//\t\t$query .= \"limit 1\";\n// echo \"<br />[$query]\";\n\n\t\t$access = mysql_fetch_array($select);\n\t\t$accesslevel = $access['numAccLevel'];\n\t\treturn $accesslevel;\n\t}",
"function get_current_user_access_level()\n{\n global $g_string_cookie_val;\n\n $t_access_level = get_current_user_field(\"access_level\");\n $t_access_level2 = get_project_access_level();\n\n if ($t_access_level >= ADMINISTRATOR) {\n return $t_access_level;\n }\n\n if (-1 == $t_access_level2) {\n return $t_access_level;\n } else {\n return $t_access_level2;\n }\n}",
"function get_last_group() { return $this->last_group; }",
"function update_user_group($update_user_group, $update_other_user_id) {\n $this->db->where('user_id', $update_other_user_id);\n $this->db->update('users_groups', $update_user_group);\n //echo $this->db->last_query();\n }",
"function getUserLevel(){\n\t\treturn $this->userLevel;\n\t}",
"private function storeUserLevel() {\n $group = $this->parent->config->auth[\"xenforo_committee_group_id\"];\n if (XenForo_Visitor::getInstance()->get(\"is_admin\")) {\n $this->userLevel = UserLevels::Admin;\n } else if (XenForo_Visitor::getInstance()->get(\"user_group_id\") == $group || in_array($group, explode(\",\", XenForo_Visitor::getInstance()->get(\"user_group_id\")))) {\n $this->userLevel = UserLevels::Regular;\n } else {\n $this->userLevel = UserLevels::Guest;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function which return default blog list for archive post types | function mixtape_qodef_get_default_blog_list() {
$blog_list = mixtape_qodef_options()->getOptionValue('blog_list_type');
return $blog_list;
} | [
"function medigroup_mikado_get_default_blog_list() {\n\n $blog_list = medigroup_mikado_options()->getOptionValue('blog_list_type');\n\n return $blog_list;\n\n }",
"function kloe_qodef_get_default_blog_list() {\n\n\t\t$blog_list = kloe_qodef_options()->getOptionValue('blog_list_type');\n\t\treturn $blog_list;\n\n\t}",
"function discussion_get_default_blog_list() {\n\n\t\t$blog_list = discussion_options()->getOptionValue('blog_list_type');\n\n\t\tif (strpos($blog_list, 'type') !== false){\n\t\t\t$blog_list = 'unique-type';\n\t\t}\n\n\t\treturn $blog_list;\n\t}",
"function newsroom_elated_get_default_blog_list() {\n\n $blog_list = newsroom_elated_options()->getOptionValue('blog_list_type');\n\n if (strpos($blog_list, 'type') !== false) {\n $blog_list = 'unique-type';\n }\n\n return $blog_list;\n }",
"function wp_get_post_type_archives($post_type, $args = array()) {\n\t$echo = isset($args['echo']) ? $args['echo'] : true;\n\t$type = isset($args['type']) ? $args['type'] : 'monthly';\n\t$format = isset($args['format']) ? $args['format'] : 'html';\n\t\n\t$args['post_type'] = $post_type;\n\t$args['echo'] = false;\n\t\n\t$html = wp_get_archives($args); // let WP do the hard stuff\n\t\n\tif($post_type != 'all' and $type != 'postbypost' and $type != 'alpha') {\n\t\tif($format == 'option') {\n\t\t\t$pattern = 'value=\\'' . get_bloginfo('url') . '/';\n\t\t\t$replacement = 'value=\\'' . get_the_post_type_permalink($post_type);\n\t\t}\n\t\telse {\n\t\t\t$pattern = 'href=\\'' . get_bloginfo('url') . '/';\n\t\t\t$replacement = 'href=\\'' . get_the_post_type_permalink($post_type);\n\t\t}\n\t\t\n\t\t$html = str_replace($pattern, $replacement, $html);\n\t}\n\t\n\tif($echo)\n\t\techo $html;\n\telse\n\t\treturn $html;\n}",
"function parse_bloglist($template, $bnametype = '', $orderby='number', $direction='asc') {\n BLOG::showBlogList($template, $bnametype, $orderby, $direction);\n }",
"function nm_get_posts_default() {\n if (!defined('NMDEFAULTEXCLUDETAGGED')) {\n return nm_get_posts();\n } else {\n static $posts = null; // lazy init...\n if ($posts === null) {\n $posts = nm_get_posts();\n $tags = nm_lowercase_tags(NMDEFAULTEXCLUDETAGGED);\n $tags = explode(',', trim(preg_replace(array('/\\s+/','/\\s*,\\s*/','/,+/'),array(' ',',',','), $tags), ' ,'));\n foreach ($posts as $k => $post)\n foreach (explode(',', nm_lowercase_tags(strip_decode($post->tags))) as $tag)\n if (in_array($tag, $tags)) {\n unset($posts[$k]);\n break;\n }\n\n }\n return $posts;\n }\n}",
"public function get_author_archive_post_types()\n {\n }",
"private static function _getPosts ()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tglobal $_baseURI, $_title, $_api;\r\n\t\t\t\r\n\t\t\t// Declarations\r\n\t\t\t$title = 'Blog - '.$_title;\r\n\t\t\t$retVal = new stdClass();\r\n\t\t\t$minDate = null;\r\n\t\t\t$maxDate = null;\r\n\t\t\t$tag = '';\r\n\t\t\t$page = '';\r\n\t\t\t\r\n\t\t\t// Get the page\r\n\t\t\t$page = Lib\\Url::GetInt('p', 1);\r\n\t\t\t\r\n\t\t\t// Figure up tags\r\n\t\t\tif (isset($_GET['tag']) && $_GET['tag']) {\r\n\t\t\t\t$tag = urldecode($_GET['tag']);\r\n\t\t\t\t$title = 'Blog - Posts tagged with ' . $tag . ' - ' . $_title;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check the dates\r\n\t\t\t$year = Lib\\Url::GetInt('year');\r\n\t\t\t$month = Lib\\Url::GetInt('month');\r\n\t\t\tif ($month && $year) {\r\n\t\t\t\t$minDate = mktime (0, 0, 0, $month, 1, $year);\r\n\t\t\t\t$maxDate = mktime (0, 0, 0, $month + 1, 1, $year);\r\n\t\t\t\t$title = 'Blog - Posts from ' . date('F Y', $minDate) . ' - ' . $_title;\r\n\t\t\t} else if ($year) {\r\n\t\t\t\t$minDate = mktime (0, 0, 0, 1, 1, $year);\r\n\t\t\t\t$maxDate = mktime (0, 0, 0, 12, 31, $year);\r\n\t\t\t\t$title = 'Blog - Posts from ' . $year . ' - ' . $_title;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If we're not on the home page, use the blog template\r\n\t\t\t$homePage = true;\r\n\t\t\tif ($page > 1 || $tag || $minDate || $maxDate) {\r\n\t\t\t\tLib\\Display::setTemplate('content_plain');\r\n\t\t\t\t$homePage = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$type = Lib\\Url::Get('type', 'blog,art,comic');\r\n\t\t\t\r\n\t\t\t// Generate the cache key\r\n\t\t\t$cacheKey = 'BlogHome_' . $page . '_' . $minDate . '_' . $maxDate . '_' . $tag . '_' . $type;\r\n\t\t\t\r\n\t\t\t$retVal = Lib\\Cache::Get($cacheKey);\r\n\t\t\tif (!$retVal) {\r\n\t\t\t\r\n\t\t\t\t// Grab the fifteen latest posts\r\n\t\t\t\t$retVal = new stdClass();\r\n\t\t\t\t$obj = Api\\Content::getContent(array( 'offset'=>($page - 1) * ENTRIES_PER_PAGE, 'tag'=>$tag, 'mindate'=>$minDate, 'maxdate'=>$maxDate, 'max'=>ENTRIES_PER_PAGE, 'parent'=>0, 'contentType'=>$type ));\r\n\t\t\t\tif (isset($obj->content)) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Format each entry\r\n\t\t\t\t\t$arr = array();\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach ($obj->content as $post) {\r\n\t\t\t\t\t\t$arr[] = self::_formatPost ($post, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t// Figure up the paging buttons\r\n\t\t\t\t\t$numPages = $obj->count / ENTRIES_PER_PAGE;\r\n\t\t\t\t\t$localDir = str_replace ('index.php', '', $_SERVER['SCRIPT_NAME']);\r\n\t\t\t\t\t$rawPage = preg_replace ('@/page/(\\d+)/@', '/', str_replace ($localDir, '/', $_SERVER['REQUEST_URI']));\r\n\r\n\t\t\t\t\t$t = new stdClass;\r\n\t\t\t\t\t$t->contentType = $type ? '/' . $type . '/' : '/';\r\n\t\t\t\t\tif ($numPages > $page) {\r\n\t\t\t\t\t\t$t->prev = $_baseURI . '?p='.($page + 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($page > 1) {\r\n\t\t\t\t\t\t$t->next = $_baseURI . '?p='.($page - 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t$t->articles = $arr;\r\n\t\t\t\t\t$retVal = Lib\\Display::compile($t, 'content_articles', $cacheKey);\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tLib\\Display::showError('Content returned empty or malformed', 'There was an error siplaying that page!');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tLib\\Display::setVariable('title', $_title);\r\n\t\t\tLib\\Display::setVariable('content', $retVal);\r\n\t\t\t\r\n\t\t}",
"public function index_post_type_archives()\n {\n }",
"function mbpc_get_post_type_archives($post_type, $args = array()) {\n\t$echo = isset($args['echo']) ? $args['echo'] : true;\n\t$type = isset($args['type']) ? $args['type'] : 'monthly';\n\t\n\t$args['post_type'] = $post_type;\n\t$args['echo'] = false;\n\t\n\t$html = wp_get_archives($args); // let WP do the hard stuff\n\t\n\tif($post_type != 'all' and $type != 'postbypost' and $type != 'alpha') {\n\t\t //Generate CPT archive links for chinese site\n\t\tif( strpos(get_bloginfo('url'), 'chinese') ) {\n\t\t\t$pattern = get_bloginfo('url');\n\t\t\t$replacement = get_bloginfo('url') . '/' . $post_type;\n\t\t}\n\t\t//Replace default 'blog' path with CPT name\n\t\t//This is for the default english site\n\t\telse {\n\t\t\t$pattern = get_bloginfo('url') . '/blog/';\n\t\t\t$replacement = get_bloginfo('url') . '/' . $post_type .'/';\n\t\t}\n\t\t$html = str_replace($pattern, $replacement, $html);\n\t}\n\n\t//get an array of all the years\n\t//the generated html is in reverse chronological order\n\t//this can be used to determine when to insert a year header\n\tpreg_match_all(\"|<li><a .*>.*([0-9]{4}).*</a></li>|\", $html, $out, PREG_PATTERN_ORDER);\n\n\t$html = \"\";\n\t$year_counts = array();\n\n\t//counts the number of months with archives for each year\n\tforeach ( $out[1] as $entry ) {\n\t\tif ( isset( $year_counts[ $entry ] ) ) {\t\t//increment count for the year\n\t\t\t$year_counts[ $entry ] = $year_counts[ $entry ] + 1;\n\t\t}\n\t\telse {\n\t\t\t$year_counts[ $entry ] = 1;\t\t\t\t\t//1st time this year is encountered\n\t\t}\n\t}\n\n\t$years = array_keys( $year_counts );\n\t$counts = array_values( $year_counts );\n\t$i = 0;\n\t$k = 0;\n\n\tforeach ( $years as $year ) {\n\t\t$html .= '<h3>' . $year . '</h3><div><ul class=\"accordion-list-content\">';\t\t//create a heading for each year\n\t\tfor ( $j = 0; $j < $counts[ $i ]; $j++) {\t\t//create an entry for each month in the year\n\t\t\t$html .= $out[ 0 ][ $k ];\n\t\t\t$k++;\n\t\t}\n\t\t$i++;\n\t\t$html .= '</ul></div>';\n\t}\n\t\n\tif($echo)\n\t\techo $html;\n\telse\n\t\treturn $html;\n}",
"function wprtt_custom_blog_posttype(){\n\n $labels = array(\n 'name' => __('Blogs','wprtt'),\n 'singular_name' => __('Blog','wprtt'),\n 'add_new' => __('Add Blog','wprtt'),\n 'all_items' => __('All Blogs','wprtt'),\n 'add_new_item' => __('Add Blog','wprtt'),\n 'edit_item' => __('Edit Blog','wprtt'),\n 'new_item' => __('New Blog','wprtt'),\n 'view_item' => __('View Blog','wprtt'),\n 'search_item' => __('Search Blog','wprtt'),\n 'not_found' => __('No Blogs Found','wprtt'),\n 'not_found_in_trash' => __('No Blogs Found In Trash','wprtt'),\n 'parent_item_colon' => __('Parent Blog','wprtt'),\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => true,\n 'publicly_queryable' => true,\n 'query_var' => true,\n 'rewrite' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'supports' => array(\n 'title', \n 'editor',\n 'excerpt',\n 'thumbnail',\n 'revisions',\n 'comments',\n ),\n 'taxonomies' => array(\n 'category',\n 'post_tag',\n ),\n 'menu_position' => 5,\n 'exclude_from_search' => false,\n );\n\n register_post_type( 'blogs', $args );\n\n}",
"public function blogList(){\n\t\treturn \\View::make('admin.pages.blog.list');\n\t}",
"public function archive()\n\t{\n\t\tif(\\Module::isDisabled('Blog')) {\n\t\t\treturn null;\n\t\t}\n\n\t\t\\Module::load('Blog');\n\t\t$title = $this->get('title', 'Archives');\n\t\t$limit = $this->get('limit', 5);\n\t\t$data = array();\n\n\t\t$data['title'] = $this->get('title', 'Blog Archives');\n\t\t$data['list'] = array();\n\n\t\treturn $this->show($data, 'archive');\n\t}",
"public function showBlogList()\n {\n $posts = Post::published()->type('post')->newest()->paginate(10);\n $data = [\n 'posts' => $posts\n ];\n return view('content.index.index.blog', $data);\n }",
"function get_archive_layouts_list() {\n\t// Declare default archive layouts and allow themes and plugins to over-ride as needed.\n\t$archive_layouts = apply_filters( 'archive_layouts_list', array(\n\t\tarray(\n\t\t\t'taxonomies' => 'category',\n\t\t\t'supports' => array(),\n\t\t),\n\t\tarray(\n\t\t\t'taxonomies' => 'post_tag',\n\t\t\t'supports' => array(),\n\t\t\t'layout_name' => 'Tags',\n\t\t),\n\t));\n\n\tforeach ( $archive_layouts as $archive_layout ) {\n\t\tforeach ((array) $archive_layout['taxonomies'] as $taxonomy) {\n\t\t\tif (taxonomy_exists($taxonomy) || 'home' == $taxonomy) {\n\t\t\t\t$taxonomies[] = $taxonomy;\n\t\t\t}\n\t\t}\n\n\t\tif ( empty($taxonomies) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$archive_layout['taxonomies'] = $taxonomies;\n\t\t$archive_layout['layout_name'] = ( empty( $archive_layout['layout_name'] ) ) ? implode( '', array_map( 'ucwords', $taxonomies ) ) : $archive_layout['layout_name'];\n\t\t$archive_layout['short_name'] = strtolower( substr( $archive_layout['layout_name'], 0, 17 ) ) . '_al';\n\n\t\t$archive_layouts_list[] = $archive_layout;\n\t}\n\n\treturn $archive_layouts_list;\t\n}",
"public function archives()\n {\n $year = $this->param('year');\n $month = $this->param('month');\n $page = $this->param('page');\n\n $month_name = '';\n\n $options = array(\n 'total_items' => $this->provider->getArchives($year, $month, 0, 0, true),\n 'items_per_page' => Setting::get('blog_per_page'),\n );\n\n $pagination = Pagination::create($options);\n\n $blogs = $this->provider->getArchives($year, $month, Pagination::limit(), \n Pagination::offset());\n\n\n if ($month) {\n \n $month_name = date(\"F\", mktime(0, 0, 0, $month, 10));\n\n }\n\n if (self::checkPartial('archives')) {\n $this->template->setPartial('archives');\n } else {\n $this->template->setPartial('index');\n }\n\n $this->template->title('Blog')\n ->set('list_type', 'archives')\n ->set('blogs', $blogs)\n ->set('pagination', $pagination)\n ->breadcrumb('Blog', rbUrl('blog'))\n ->breadcrumb($year, rbUrl('blog/archives/'.$year));\n\n if ($month_name) {\n $this->template->breadcrumb($month_name);\n }\n }",
"protected function _get_all_nav_posts()\n\t{\n\t\t// Get navigation settings\n\t\t$nav_parm = NULL;\n\t\t$nav_type = $this->_nav_type;\n\t\tif (is_array($nav_type) AND ! empty($nav_type))\n\t\t{\n\t\t\t$nav_type = key($this->_nav_type);\n\t\t\t$nav_parm = Arr::get($this->_nav_type, $nav_type);\n\t\t}\n\n\t\t// Get posts\n\t\t$posts = NULL;\n\t\tswitch ($nav_type)\n\t\t{\n\t\t\tcase MMI_Blog::NAV_CATEGORY:\n\t\t\tcase MMI_Blog::NAV_TAG:\n\t\t\t\t$method = ($nav_type === MMI_Blog::NAV_CATEGORY) ? 'get_categories_by_slug' : 'get_tags_by_slug';\n\t\t\t\t$terms = MMI_Blog_Term::factory($this->_driver)->$method($nav_parm);\n\t\t\t\t$term = Arr::get($terms, $nav_parm);\n\t\t\t\t$post_ids = empty($term) ? NULL : $term->post_ids;\n\t\t\t\tif ( ! empty($post_ids))\n\t\t\t\t{\n\t\t\t\t\t$posts = MMI_Blog_Post::factory($this->_driver)->get_post_list($post_ids);\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase MMI_Blog::NAV_ARCHIVE:\n\t\t\t\t$month = substr($nav_parm, -2);\n\t\t\t\t$year = substr($nav_parm, 0, 4);\n\t\t\t\t$posts = MMI_Blog_Post::factory($this->_driver)->get_archive_list($year, $month);\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$posts = MMI_Blog_Post::factory($this->_driver)->get_post_list();\n\t\t\tbreak;\n\t\t}\n\t\treturn $posts;\n\t}",
"public function add_default_archive_items() {\n\n\t\t\t/* If this is a date-/time-based archive, add $wp_rewrite->front to the trail. */\n\t\t\tif ( is_date() || is_time() ) {\n\t\t\t\t$this->add_rewrite_front_items();\n\t\t\t}\n\n\t\t\t$this->_add_item( 'target_format', $this->args['labels']['archives'] );\n\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Require classes witch cant be autoloaded | protected function _requireClasses()
{
require_once 'Autoloader.php';
} | [
"abstract protected function doAutoload($class);",
"public function loadClasses(){\n require_once('Controller/routeHandler.class.php');\n require_once('Model/database.class.php');\n require_once('Model/yaml.class.php');\n require_once('Model/user/user.class.php');\n require_once('Model/post/post.class.php');\n require_once('Model/post/postlist.class.php');\n require_once('View/vendor/autoload.php');\n }",
"public function autoload_classes()\n {\n $this->autoloadClasses();\n }",
"function __autoload($class_name)\n{\n if (file_exists('../app/classes/'.$class_name.'.php')) {\n require_once '../app/classes/'.$class_name.'.php';\n } elseif (file_exists('../app/controllers/'.$class_name.'.php')) {\n require_once '../app/controllers/'.$class_name.'.php';\n } elseif (file_exists('../app/models/'.$class_name.'.php')) {\n require_once '../app/models/'.$class_name.'.php';\n }\n}",
"function __autoload($class_name) {\n require 'lib/class.' . $class_name . '.inc';\n}",
"function my_autoLoader($class){\r\n require $class . \".php\";\r\n}",
"function classAutoload($class_name) {\n if (file_exists( __DIR__ . '/includes/classes/' . $class_name . '.php')) {\n require_once __DIR__ . '/includes/classes/' . $class_name . '.php';\n }\n}",
"function __autoload($className)\n{\n require_once \"webcore.reflection.php\";\n \n ClassLoader::loadClass($className);\n}",
"function __autoload($className) {\n require_once \"../klassen/$className.class.php\";\n}",
"public function classes() {\n\t\trequire_once($this->get_filepath('classes').'classes-loader.php');\n\t}",
"protected function loadClasses()\n {\n $lib = Mage::getBaseDir('lib');\n \n // INFO: when using client, load all classes\n require_once $lib . '/BudgetMailer/Api/Client/Http.php';\n require_once $lib . '/BudgetMailer/Api/Client/RestJson.php';\n require_once $lib . '/BudgetMailer/Api/Cache.php';\n require_once $lib . '/BudgetMailer/Api/Client.php';\n require_once $lib . '/BudgetMailer/Api/Config.php';\n }",
"function __autoload($c_name)\n{\n\tinclude(\"classes/$c_name.php\"); // it include all classes who have in classes director\n}",
"private function registerClases() \n {\n spl_autoload_register([$this, 'load']);\n }",
"public function ensureClassLoadingInformationExists() {}",
"function autoload($className) {\n if (file_exists(\"./src/{$className}.php\")){\n require \"./src/{$className}.php\";\n }\n}",
"function autoloadClasses($name) {\n if (in_array($name, TRAIT_NAMES)){\n $path = TRAITS_PATH . $name . '.trait.php';\n } else {\n $path = CLASSES_PATH . $name . '.class.php';\n }\n\n if(file_exists($path)) {\n require_once($path);\n } else {\n logger('File in path ' . $path . ' not found');\n }\n}",
"private function registerClasses(): void\n {\n spl_autoload_register([$this, 'load']);\n }",
"function __autoload($className)\n{\n if (preg_match('/.*Dao$/', $className) > 0) {\n # Dao class\n if (file_exists(realpath(dirname(__FILE__)) . '/../dao/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../dao/' . $className . '.php');\n }\n } elseif (preg_match('/.*Manager$/', $className) > 0) {\n # Managers interfaces\n if (file_exists(realpath(dirname(__FILE__)) . '/../managers/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../managers/' . $className . '.php');\n }\n } elseif (preg_match('/.*Module$/', $className) > 0) {\n # Get the module name\n $moduleName = strtolower(preg_replace('/^(.*)Module$/', '\\1', $className));\n if (file_exists(realpath(dirname(__FILE__)) . '/../../modules/' . $moduleName . '/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../../modules/' . $moduleName . '/' . $className . '.php');\n }\n } else {\n # Models\n if (file_exists(realpath(dirname(__FILE__)) . '/../model/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../model/' . $className . '.php');\n }\n }\n Utils::log(LOG_DEBUG, \"Class $className loaded\", __FILE__, __LINE__);\n}",
"function SlimGb_autoload($className)\n{\n\t$fileName = SLIMGB_BASEPATH . '/core/' . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';\n\tif (file_exists($fileName)) {\n\t\trequire $fileName;\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation postTreatmentPurposeCollection Creates a TreatmentPurpose resource. | public function postTreatmentPurposeCollection($body = null)
{
list($response) = $this->postTreatmentPurposeCollectionWithHttpInfo($body);
return $response;
} | [
"public function postTreatmentPurposeCollectionAsync($body = null)\n {\n return $this->postTreatmentPurposeCollectionAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function postTreatmentPurposeCollectionRequest($body = null)\n {\n\n $resourcePath = '/api/v1/treatment_purposes';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/ld+json', 'application/json', 'text/html']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/ld+json', 'application/json', 'text/html'],\n ['application/ld+json', 'application/json', 'text/html']\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 Bearer token\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 function createAction(Purpose $purpose) {\n\t\t$this->purposeRepository->add($purpose);\n\t\t$this->addFlashMessage('Purpose '.$purpose->getTitle().' added.');\n\t\t$this->redirect('index');\n\t}",
"public function postTreatmentPurposeCollectionWithHttpInfo($body = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TreatmentPurposeJsonldTreatmentPurposeRead';\n $request = $this->postTreatmentPurposeCollectionRequest($body);\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 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\TreatmentPurposeJsonldTreatmentPurposeRead',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function addToTripPurpose(\\Devlabs91\\GenericOtaHotelApiService\\StructType\\TripPurpose $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Devlabs91\\GenericOtaHotelApiService\\StructType\\TripPurpose) {\n throw new \\InvalidArgumentException(sprintf('The TripPurpose property can only contain items of \\Devlabs91\\GenericOtaHotelApiService\\StructType\\TripPurpose, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->TripPurpose[] = $item;\n return $this;\n }",
"public function addPurpose($purpose)\n {\n $this->purpose[$purpose] = $purpose;\n return $this;\n }",
"public function setCategoryPurpose($var)\n {\n GPBUtil::checkString($var, True);\n $this->category_purpose = $var;\n\n return $this;\n }",
"function insertArticlePurpose(&$articlePurpose) {\r\n\t\t$this->update(\r\n\t\t\t'INSERT INTO article_purpose (article_id, type, ct_phase, allocation, masking, control, assignment, endpoint)\r\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?)',\r\n\t\t\tarray(\r\n\t\t\t\t(int) $articlePurpose->getArticleId(),\r\n\t\t\t\t(int) $articlePurpose->getType(),\r\n\t\t\t\t(int) $articlePurpose->getCTPhase(),\r\n\t\t\t\t(int) $articlePurpose->getAllocation(),\r\n\t\t\t\t(int) $articlePurpose->getMasking(),\r\n (int) $articlePurpose->getControl(),\r\n\t\t\t\t(int) $articlePurpose->getAssignment(),\r\n\t\t\t\t(int) $articlePurpose->getEndpoint()\r\n\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"function add_purpose() {\n \n \n\t\t$this->authentication->is_admin_logged_in(true);\n\t\t\n\t\tisAdminSection();\n \n $this->mcontents['page_heading'] = $this->mcontents['page_title'] = 'Add contact us purpose';\n \n\t\tif( isset($_POST) && !empty($_POST) ) {\n\t\t\t\n $this->form_validation->set_message('greater_than', 'This field is required');\n\t\t\t$this->form_validation->set_rules('title', 'Title', 'required|trim');\n\t\t\t$this->form_validation->set_rules('description', 'Description', 'trim');\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'required|trim|valid_email');\n\t\t\t$this->form_validation->set_rules('reciever_name', 'Reciever Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('email_template_id', 'Email Template', 'required|greater_than[0]');\n\t\t\t$this->form_validation->set_rules('status', 'Status', 'required');\n\t\t\t$this->form_validation->set_rules('success_message', 'Success Message', 'required|trim');\n\t\t\t\n\t\t\tif( $this->form_validation->run() !== false ) {\n \n $this->db->where('id', safeText('email_template_id'));\n if( ! $this->db->get('email_templates')->row() ) {\n \n $this->merror['error'][] = 'invalid template';\n }\n \n \n if( empty($this->merror['error']) ) {\n \n $aData = array(\n 'title' => safeText('title'),\n 'email_template_id' => safeText('email_template_id'),\n 'description' => safeText('description'),\n 'email' => safeText('email'),\n 'reciever_name' => safeText('reciever_name'),\n 'status' => safeText('status'),\n 'success_message' => safeText('success_message'),\n );\n $this->db->insert('contact_us_purposes', $aData);\n \n sf('success_message', 'New contact us purpose has been created.');\n redirect('contact_us/add_purpose');\n }\n\n }\n }\n \n // get the email templates drop down\n $this->mcontents['aEmailTemplates'] = $this->_get_email_templates_dropdown();\n \n \n //$this->mcontents['load_css'][] = 'form.css';\n //$this->mcontents['load_css'][] = 'forms/contact_us/add_purpose.css';\n $this->mcontents['load_js'][] = 'jquery/jquery.validate.min.js';\n $this->mcontents['load_js'][] = 'validation/contact_us/add_purpose.js';\n \n \n \n loadAdminTemplate('contact_us/add_purpose');\n \n \n }",
"public function postTreatmentPurposeCollectionAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TreatmentPurposeJsonldTreatmentPurposeRead';\n $request = $this->postTreatmentPurposeCollectionRequest($body);\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 setTravelPurpose($travelPurpose)\n {\n $this->travelPurpose = $travelPurpose;\n return $this;\n }",
"public function setPurpose($purpose)\r\n {\r\n $this->purpose = $purpose;\r\n }",
"public function getPurposeId() {\n\t\t\treturn $this->purpose_id;\n\t\t}",
"public function getPurposeData()\n {\n return $this->purpose_data;\n }",
"protected function deleteTreatmentPurposeItemRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling deleteTreatmentPurposeItem'\n );\n }\n\n $resourcePath = '/api/v1/treatment_purposes/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\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 Bearer token\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 saveTreatment()\n {\n\n $group_bin_table = Input::get('group_type');\n $unique_id = Input::get('unique_id');\n $bin_id = Input::get('bin_id');\n $deceased_pigs = Input::get('pigs');\n\n $pigs = DB::table($group_bin_table)->where('unique_id',$unique_id)->where('bin_id',$bin_id)->select('number_of_pigs')->first();\n\n $group_type = str_replace(\"feeds_movement_\",\"\",$group_bin_table);\n $group_type = str_replace(\"_bins\",\"\",$group_type);\n $data = array(\n 'group_id'\t\t=>\tInput::get('group_id'),\n 'group_type'\t=>\t$group_type,\n 'farm_id'\t\t\t=>\tInput::get('farm_id'),\n 'bin_id'\t\t\t=>\t$bin_id,\n 'created_at'\t=>\tdate(\"Y-m-d\",strtotime(Input::get('created_at'))),\n 'pigs'\t\t\t\t=>\t$deceased_pigs,\n 'illness'\t\t\t=>\tInput::get('illness'),\n 'drug_used'\t\t=>\tInput::get('drug_used'),\n 'notes' =>\tInput::get('notes'),\n 'user_id' => Auth::id()\n );\n\n DB::table('feeds_treatment')->insert($data);\n }",
"public function groupsSetPurpose($room_id, $purpose) {\n return $this->post('groups.setPurpose', [\n 'roomId' => $room_id,\n 'purpose' => $purpose\n ]);\n }",
"public function getCategoryPurpose()\n {\n return $this->category_purpose;\n }",
"public function getPurpose()\n {\n return $this->purpose;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom profile fields This function show a list of current member fields and the form that allows you to create a new field. | function custom_profile_fields($group_id = '')
{
if ( ! Session::access('can_admin_members'))
{
return Cp::unauthorizedAccess();
}
// Fetch language file
// There are some lines in the publish administration language file
// that we need.
Cp::$title = __('members.custom_member_fields');
Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).
Cp::breadcrumbItem(__('members.custom_member_fields'));
$right_links[] = [
BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=edit_field',
__('members.create_new_profile_field')
];
$r = Cp::header(__('members.custom_member_fields'), $right_links);
// Build the output
if (Request::input('U')) {
$r .= Cp::quickDiv('successMessage', __('members.field_updated'));
}
$query = DB::table('member_fields')
->select('m_field_id', 'm_field_order', 'm_field_label')
->orderBy('m_field_order')
->get();
if ($query->count() == 0)
{
Cp::$body = Cp::div('box');
Cp::$body .= Cp::quickDiv('littlePadding', Cp::heading(__('members.no_custom_profile_fields'), 5));
Cp::$body .= Cp::quickDiv('littlePadding', Cp::anchor(BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=edit_field', __('members.create_new_profile_field')));
Cp::$body .= '</div>'.PHP_EOL;
return;
}
$r .= Cp::table('tableBorder', '0', '10', '100%').
'<tr>'.PHP_EOL.
Cp::td('tableHeadingAlt', '', '3').
__('members.current_fields').
'</td>'.PHP_EOL.
'</tr>'.PHP_EOL;
$i = 0;
foreach ($query as $row)
{
$r .= '<tr>'.PHP_EOL;
$r .= Cp::tableCell('', $row->m_field_order.' '.Cp::quickSpan('defaultBold', $row->m_field_label), '40%');
$r .= Cp::tableCell('', Cp::anchor(BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=edit_field'.AMP.'m_field_id='.$row->m_field_id, __('cp.edit')), '30%');
$r .= Cp::tableCell('', Cp::anchor(BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=del_field_conf'.AMP.'m_field_id='.$row->m_field_id, __('cp.delete')), '30%');
$r .= '</tr>'.PHP_EOL;
}
$r .= '</table>'.PHP_EOL;
$r .= Cp::quickDiv('paddedWrapper', Cp::anchor(BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=edit_field_order', __('members.edit_field_order')));
Cp::$body = $r;
} | [
"function display_profile_fields()\n\t{\n\t\t//initializing variables\n\t\t$user =& get_user();\n\t\t$fields = get_custom_user_fields( $user->roles[0] );\n\t\t$defaults = bum_get_default_profile_fields();\n\t\t\n\t\t$fields = wp_parse_args( $fields, $defaults );\n\t\tbum_display_custom_user_fields($user, $fields);\n\t}",
"function profile_print_custom_fields(&$form, $userid=0) {\n global $USER, $CFG;\n\n if ($userid == 0) $userid = $USER->id;\n\n if ($categories = get_records_select('user_info_category', '', 'sortorder ASC')) {\n foreach ($categories as $category) {\n if ($fields = get_records_select('user_info_field', \"categoryid=$category->id\", 'sortorder ASC')) {\n\n $form->addElement('header', 'category_'.$category->id, $category->name);\n\n foreach ($fields as $field) {\n\n require_once($CFG->dirroot.'/user/profile/field/'.$field->datatype.'/field.class.php');\n $newfield = 'profile_field_'.$field->datatype;\n $formfield = new $newfield($field->id,$user->id);\n $formfield->display_field($form);\n unset($formfield);\n\n }\n } /// End of $fields if\n } /// End of $categories foreach\n } /// End of $categories if\n}",
"function template_show_custom_profile()\n{\n\tglobal $context, $txt;\n\n\t// Standard fields.\n\ttemplate_show_list('standard_profile_fields');\n\n\t// Custom fields.\n\techo '\n\t\t<we:title>', $txt['custom_profile_title'], '</we:title>\n\t\t<form action=\"<URL>?action=admin;area=memberoptions;sa=profileedit\" method=\"post\">';\n\n\tif (empty($context['custom_fields']))\n\t\techo '\n\t\t\t<div class=\"information\">', $txt['custom_profile_none'], '</div>';\n\telse\n\t{\n\t\techo '\n\t\t\t<ul id=\"sortable\">';\n\n\t\tforeach ($context['custom_fields'] as $id => $field)\n\t\t{\n\t\t\techo '\n\t\t\t\t<li class=\"windowbg\">\n\t\t\t\t\t<span class=\"handle\"></span>\n\t\t\t\t\t<div class=\"floatright\">\n\t\t\t\t\t\t<input type=\"submit\" name=\"modify[', $id, ']\" value=\"', $txt['modify'], '\" class=\"modify\">\n\t\t\t\t\t\t<input type=\"hidden\" name=\"order[]\" value=\"', $id, '\">\n\t\t\t\t\t</div>\n\t\t\t\t\t<span class=\"sortme\">', $field['field_name'], '</span>\n\t\t\t\t\t<span class=\"badge\">', $field['field_type_formatted'], '</span>\n\t\t\t\t\t<div class=\"badge\"><span class=\"cf_', $field['active_type'], '\"><div class=\"icon\"></div> ', $txt['custom_profile_' . $field['active_type']], '</div>\n\t\t\t\t\t<div class=\"floatleft\">', sprintf($txt['custom_profile_placement'], $field['placement_text']), '</div>\n\t\t\t\t\t<br class=\"clear\">\n\t\t\t\t</li>';\n\t\t}\n\n\t\techo '\n\t\t\t</ul>';\n\t}\n\n\techo '\n\t\t\t<br class=\"clear\">\n\t\t\t<div class=\"right\">\n\t\t\t\t<input type=\"submit\" name=\"add\" value=\"', $txt['custom_profile_make_new'], '\" class=\"new\">\n\t\t\t\t<input type=\"submit\" name=\"saveorder\" value=\"', $txt['editnews_saveorder'], '\" class=\"save\" id=\"saveorder\">\n\t\t\t</div>\n\t\t\t<input type=\"hidden\" name=\"', $context['session_var'], '\" value=\"', $context['session_id'], '\">\n\t\t</form>';\n\n\t// !! template_show_list('custom_profile_fields'); ??\n\n\tadd_js('\n\tvar iNumChecks = document.forms.standardProfileFields.length;\n\tfor (var i = 0; i < iNumChecks; i++)\n\t\tif (document.forms.standardProfileFields[i].id.indexOf(\\'reg_\\') == 0)\n\t\t\tdocument.forms.standardProfileFields[i].disabled = document.forms.standardProfileFields[i].disabled || !document.getElementById(\\'active_\\' + document.forms.standardProfileFields[i].id.slice(4)).checked;\n\n\t$(\\'#sortable\\').sortable({ handle: \\'.handle\\', update: function (event, ui) { $(\\'#saveorder\\').show(); } });\n\t$(\\'#sortable\\').disableSelection();\n\t$(\\'#saveorder\\').hide();');\n}",
"public function form_fields() {\n\n\t\t$fields = array(\n\t\t\tarray(\n\t\t\t\t'title' => __( 'Email público', APP_TD ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'name' => 'hrb_email',\n\t\t\t\t'extra' => array(\n\t\t\t\t\t'class' => 'required important-field regular-text',\n\t\t\t\t),\n\t\t\t\t'desc' => __( 'Tu email público (solo compartido con los participantes del proyecto)', APP_TD ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'title' => __( 'LinkedIn', APP_TD ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'name' => 'hrb_linkedin',\n\t\t\t\t'desc' => __( 'Tu ID de LinkedIn', APP_TD ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'title' => __( 'Twittter ', APP_TD ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'name' => 'hrb_twitter',\n\t\t\t\t'desc' => __( 'Tu URL de Twittter', APP_TD ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'title' => __( 'Facebook ', APP_TD ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'name' => 'hrb_facebook',\n\t\t\t\t'desc' => __( 'Tu URL de Facebook', APP_TD ),\n\t\t\t),\n\t\t);\n\t\treturn apply_filters( 'hrb_profile_social_fields', $fields );\n\t}",
"public function output_profile_fields_area() {\n\n\t\tif ( ! $this->is_profile_fields_area() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$profile_fields = $this->get_profile_fields_for_user();\n\n\t\tif ( ! $profile_fields ) {\n\t\t\treturn;\n\t\t}\n\n\t\twc_get_template( 'myaccount/my-profile-fields.php', [\n\t\t\t'profile_fields' => $profile_fields,\n\t\t\t'security' => wp_create_nonce( 'update_profile_fields' ),\n\t\t] );\n\t}",
"protected static function create_custom_fields() {\n global $DB;\n\n // Create custom field category.\n $category = (object)[\n 'name' => 'Test fields',\n 'sortorder' => 999\n ];\n $category->id = $DB->insert_record('user_info_category', $category);\n\n // Create two custom fields.\n $define = new \\profile_define_text();\n $field = (object)[\n 'shortname' => 'frog',\n 'name' => 'Frog',\n 'datatype' => 'text',\n 'description' => '',\n 'categoryid' => $category->id,\n 'sortorder' => 1,\n 'locked' => 1,\n 'defaultdata' => '',\n 'param1' => 8, // Display size.\n 'param2' => 8 // Max length.\n ];\n $define->define_save($field);\n $field = (object)[\n 'shortname' => 'zombie',\n 'name' => 'Zombie',\n 'datatype' => 'text',\n 'description' => '',\n 'categoryid' => $category->id,\n 'sortorder' => 2,\n 'locked' => 1,\n 'defaultdata' => '',\n 'param1' => 8, // Display size.\n 'param2' => 8 // Max length.\n ];\n $define->define_save($field);\n }",
"function ManageCustomFields()\n\t{\n\t\t$user = &GetUser();\n\t\t$perpage = $this->GetPerPage();\n\n\t\t$DisplayPage = $this->GetCurrentPage();\n\t\t$start = 0;\n\t\tif ($perpage != 'all') {\n\t\t\t$start = ($DisplayPage - 1) * $perpage;\n\t\t}\n\n\t\t$sortinfo = $this->GetSortDetails();\n\n\t\t$api = $this->GetApi();\n\n\t\t$fieldowner = ($user->Admin()) ? 0 : $user->userid;\n\t\t$NumberOfFields = $api->GetCustomFields($fieldowner, $sortinfo, true);\n\t\t$myfields = $api->GetCustomFields($fieldowner, $sortinfo, false, $start, $perpage);\n\n\t\tif ($user->HasAccess('CustomFields', 'Create')) {\n\t\t\t$GLOBALS['CustomFields_AddButton'] = $this->ParseTemplate('CustomFields_Create_Button', true, false);\n\t\t}\n\n\t\tif ($user->HasAccess('CustomFields', 'Delete')) {\n\t\t\t$GLOBALS['CustomFields_DeleteButton'] = $this->ParseTemplate('CustomFields_Delete_Button', true, false);\n\t\t}\n\n\t\tif (!isset($GLOBALS['Message'])) {\n\t\t\t$GLOBALS['Message'] = '';\n\t\t}\n\n\t\t$lists = $user->GetLists();\n\t\t$listids = array_keys($lists);\n\t\tif (sizeof($listids) < 1) {\n\t\t\t$GLOBALS['Intro_Help'] = GetLang('Help_CustomFieldsManage');\n\t\t\t$GLOBALS['Intro'] = GetLang('CustomFieldsManage');\n\t\t\t$GLOBALS['Lists_AddButton'] = '';\n\n\t\t\tif ($user->CanCreateList() === true) {\n\t\t\t\t$GLOBALS['Message'] = $this->PrintSuccess('CustomFields_NoLists', GetLang('ListCreate'));\n\t\t\t\t$GLOBALS['Lists_AddButton'] = $this->ParseTemplate('List_Create_Button', true, false);\n\t\t\t} else {\n\t\t\t\t$GLOBALS['Message'] = $this->PrintSuccess('CustomFields_NoLists', GetLang('ListAssign'));\n\t\t\t}\n\t\t\t$this->ParseTemplate('Subscribers_No_Lists');\n\t\t\treturn;\n\t\t}\n\n\t\tif ($NumberOfFields == 0) {\n\t\t\t$GLOBALS['Message'] .= $this->PrintSuccess('NoCustomFields');\n\t\t\t$this->ParseTemplate('CustomFields_Manage_Empty');\n\t\t\treturn;\n\t\t}\n\n\t\t$this->SetupPaging($NumberOfFields, $DisplayPage, $perpage);\n\t\t$GLOBALS['FormAction'] = 'Action=ProcessPaging';\n\t\t$paging = $this->ParseTemplate('Paging', true, false);\n\n\t\t$template = $this->ParseTemplate('CustomFields_Manage', true, false);\n\n\t\t$customfieldlist = '';\n\n\t\tforeach ($myfields as $pos => $fieldinfo) {\n\t\t\t$api->Load($fieldinfo['fieldid']);\n\t\t\t$GLOBALS['id'] = $fieldinfo['fieldid'];\n\t\t\t$GLOBALS['Name'] = htmlspecialchars($fieldinfo['name'], ENT_QUOTES, SENDSTUDIO_CHARSET);\n\t\t\t$GLOBALS['Created'] = $this->PrintDate($api->createdate);\n\t\t\t$GLOBALS['CustomFieldType'] = GetLang('CustomFieldType_' . $api->fieldtype);\n\t\t\t$GLOBALS['CustomFieldRequired'] = ($api->Settings['FieldRequired']) ? GetLang('Yes') : GetLang('No');\n\t\t\t$GLOBALS['CustomFieldAction'] = '';\n\n\t\t\tif ($user->Admin() || ($user->HasAccess('customfields', 'edit') && $user->Get('userid') == $api->Get('ownerid'))) {\n\t\t\t\t$GLOBALS['CustomFieldAction'] .= ' <a href=\"index.php?Page=CustomFields&Action=Edit&id=' . $fieldinfo['fieldid'] . '\">' . GetLang('Edit') . '</a>';\n\t\t\t} else {\n\t\t\t\t$GLOBALS['CustomFieldAction'] .= $this->DisabledItem('Edit');\n\t\t\t}\n\n\t\t\tif ($user->Admin() || ($user->HasAccess('customfields', 'delete') && $user->Get('userid') == $api->Get('ownerid'))) {\n\t\t\t\t$GLOBALS['CustomFieldAction'] .= ' <a href=\"javascript: ConfirmDelete(' . $fieldinfo['fieldid'] . ');\">' . GetLang('Delete') . '</a>';\n\t\t\t} else {\n\t\t\t\t$GLOBALS['CustomFieldAction'] .= $this->DisabledItem('Delete');\n\t\t\t}\n\n\t\t\t$customfieldlist .= $this->ParseTemplate('CustomFields_Manage_Row', true, false);\n\t\t}\n\t\t$template = str_replace('%%TPL_CustomFields_Manage_Row%%', $customfieldlist, $template);\n\t\t$template = str_replace('%%TPL_Paging%%', $paging, $template);\n\t\t$template = str_replace('%%TPL_Paging_Bottom%%', $GLOBALS['PagingBottom'], $template);\n\t\techo $template;\n\t}",
"function add_user_fields($profile_fields) {\n\n // Add new fields\n $profile_fields['title'] = 'Title';\n\n return $profile_fields;\n}",
"private function profile_fields() {\n global $DB;\n // Store the profile fields in an array called \"names\".\n if ($categories = $DB->get_records('user_info_category', null, 'sortorder ASC')) {\n foreach ($categories as $category) {\n if ($fields = $DB->get_records('user_info_field', array('categoryid' => $category->id), 'sortorder ASC')) {\n foreach ($fields as $field) {\n $pfields[] = format_string($field->shortname);\n }\n }\n }\n }\n return $pfields;\n }",
"function createCustomFields() {\n if ( function_exists( 'add_meta_box' ) ) {\n foreach ( $this->postTypes as $postType ) {\n add_meta_box( 'jvfrm-post-custom-fields', 'Additional information', array( &$this, 'displayCustomFields' ), $postType, 'normal', 'high' );\n }\n }\n }",
"function plugin_headings_customfields($item) {\n global $CFG_GLPI;\n\n $ID = $item->getField('id');\n $type = get_class($item);\n\n if ($type == 'Profile') {\n $prof = new PluginCustomfieldsProfile();\n if ($prof->GetfromDB($ID) || $prof->createUserAccess($item)) {\n $prof->showForm($ID,\n array('target' => $CFG_GLPI[\"root_doc\"].\n \"/plugins/customfields/front/profile.form.php\"));\n }\n\n } else {\n if ($ID > 0) {\n echo '<div class=\"center\">';\n echo plugin_customfields_showAssociated($item);\n echo '</div>';\n }\n }\n}",
"function elgg_profile_fields_setup() {\n\tglobal $CONFIG;\n\n\t$profile_defaults = array (\n\t\t'description' => 'longtext',\n\t\t'briefdescription' => 'text',\n\t\t'location' => 'location',\n\t\t'interests' => 'tags',\n\t\t'skills' => 'tags',\n\t\t'contactemail' => 'email',\n\t\t'phone' => 'text',\n\t\t'mobile' => 'text',\n\t\t'website' => 'url',\n\t\t'twitter' => 'text'\n\t);\n\n\t$loaded_defaults = array();\n\tif ($fieldlist = elgg_get_config('profile_custom_fields')) {\n\t\tif (!empty($fieldlist)) {\n\t\t\t$fieldlistarray = explode(',', $fieldlist);\n\t\t\tforeach ($fieldlistarray as $listitem) {\n\t\t\t\tif ($translation = elgg_get_config(\"admin_defined_profile_{$listitem}\")) {\n\t\t\t\t\t$type = elgg_get_config(\"admin_defined_profile_type_{$listitem}\");\n\t\t\t\t\t$loaded_defaults[\"admin_defined_profile_{$listitem}\"] = $type;\n\t\t\t\t\tadd_translation(get_current_language(), array(\"profile:admin_defined_profile_{$listitem}\" => $translation));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (count($loaded_defaults)) {\n\t\t$CONFIG->profile_using_custom = true;\n\t\t$profile_defaults = $loaded_defaults;\n\t}\n\n\t$CONFIG->profile_fields = elgg_trigger_plugin_hook('profile:fields', 'profile', NULL, $profile_defaults);\n\n\t// register any tag metadata names\n\tforeach ($CONFIG->profile_fields as $name => $type) {\n\t\tif ($type == 'tags' || $type == 'location' || $type == 'tag') {\n\t\t\telgg_register_tag_metadata_name($name);\n\t\t\t// register a tag name translation\n\t\t\tadd_translation(get_current_language(), array(\"tag_names:$name\" => elgg_echo(\"profile:$name\")));\n\t\t}\n\t}\n}",
"function the_admin_members_fields() {\n\n // Call the Members class\n $members = (new MidrubBaseAdminComponentsCollectionMembersClasses\\Members);\n\n // Returns the fields\n return $members->load_fields();\n \n }",
"protected function createFormFields() {\n\t}",
"function fetch_custom_member_fields()\n {\n global $DB;\n \n $query = $DB->query(\"SELECT m_field_id, m_field_name FROM exp_member_fields\");\n \n foreach ($query->result as $row)\n { \n $this->mfields[$row['m_field_name']] = $row['m_field_id'];\n }\n }",
"function bcbg_rcp_add_member_edit_fields( $user_id = 0 ) {\n\t\n\t$business_phone = get_user_meta( $user_id, 'rcp_business_phone', true );\n\t$business_name = get_user_meta( $user_id, 'rcp_business_name', true );\n\t?>\n\t<tr valign=\"top\">\n\t\t<th scope=\"row\" valign=\"top\">\n\t\t\t<label for=\"rcp_business_phone\"><?php _e( 'Business Phone', 'rcp' ); ?></label>\n\t\t</th>\n\t\t<td>\n\t\t\t<input name=\"rcp_business_phone\" id=\"rcp_business_phone\" type=\"text\" value=\"<?php echo esc_attr( $business_phone ); ?>\"/>\n\t\t\t<p class=\"description\"><?php _e( 'The member\\'s Business Phone', 'rcp' ); ?></p>\n\t\t</td>\n\t</tr>\n\t<tr valign=\"top\">\n\t\t<th scope=\"row\" valign=\"top\">\n\t\t\t<label for=\"rcp_business_phone\"><?php _e( 'Business Name', 'rcp' ); ?></label>\n\t\t</th>\n\t\t<td>\n\t\t\t<input name=\"rcp_business_name\" id=\"rcp_business_name\" type=\"text\" value=\"<?php echo esc_attr( $business_name ); ?>\"/>\n\t\t\t<p class=\"description\"><?php _e( 'The member\\'s Business Name', 'rcp' ); ?></p>\n\t\t</td>\n\t</tr>\n\t<?php\n}",
"function pw_rcp_add_member_edit_fields( $user_id = 0 ) {\n\n\t$address = get_user_meta( $user_id, 'rcp_address', true );\n\t$phonenumber = get_user_meta( $user_id, 'rcp_phonenumber', true );\n\t$children = get_user_meta( $user_id, 'rcp_children', true );\n\t$residents = get_user_meta( $user_id, 'rcp_residents', true );\n\t$volunteer = get_user_meta( $user_id, 'rcp_volunteer', true );\n\n\t?>\n\t<tr valign=\"top\">\n\t\t<th scope=\"row\" valign=\"top\">\n\t\t\t<label for=\"rcp_address\"><?php _e( 'Address', 'rcp' ); ?></label>\n\t\t</th>\n\t\t<td>\n\t\t\t<input name=\"rcp_address\" id=\"rcp_address\" type=\"text\" value=\"<?php echo esc_attr( $address ); ?>\"/>\n\t\t\t<p class=\"description\"><?php _e( 'The member\\'s address', 'rcp' ); ?></p>\n\t\t</td>\n\t</tr>\n\t<tr valign=\"top\">\n\t\t<th scope=\"row\" valign=\"top\">\n\t\t\t<label for=\"rcp_address\"><?php _e( 'Phone Number', 'rcp' ); ?></label>\n\t\t</th>\n\t\t<td>\n\t\t\t<input name=\"rcp_phonenumber\" id=\"rcp_phonenumber\" type=\"text\" value=\"<?php echo esc_attr( $phonenumber ); ?>\"/>\n\t\t\t<p class=\"description\"><?php _e( 'The member\\'s phone number', 'rcp' ); ?></p>\n\t\t</td>\n\t</tr>\n <tr valign=\"top\">\n <th scope=\"row\" valign=\"top\">\n <label for=\"rcp_children\"><?php _e( 'Children', 'rcp' ); ?></label>\n </th>\n <td>\n <input type=\"number\" id=\"rcp_children\" name=\"rcp_children\" value=\"<?php echo esc_attr( $children ); ?>\"/>\n </td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\" valign=\"top\">\n <label for=\"rcp_residents\"><?php _e( 'Residents', 'rcp' ); ?></label>\n </th>\n <td>\n <input type=\"number\" id=\"rcp_residents\" name=\"rcp_residents\" value=\"<?php echo esc_attr( $residents ); ?>\"/>\n </td>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\" valign=\"top\">\n <label for=\"rcp_volunteer\"><?php _e( 'I would like to volunteer with the community association.', 'rcp' ); ?></label>\n </th>\n <td>\n <select id=\"rcp_volunteer\" name=\"rcp_volunteer\">\n <option value=\"yes\" <?php selected( $volunteer, 'yes'); ?>><?php _e( 'Yes', 'rcp' ); ?></option>\n <option value=\"no\" <?php selected( $volunteer, 'no'); ?>><?php _e( 'No', 'rcp' ); ?></option>\n </select>\n </td>\n </tr>\n\t<?php\n}",
"protected function addFields()\n {\n $this->crud->addFields([\n [\n 'name' => 'name',\n 'label' => trans('eduardoarandah::usermanager.name'),\n 'type' => 'text',\n ],\n [\n 'name' => 'email',\n 'label' => trans('eduardoarandah::usermanager.email'),\n 'type' => 'email',\n ],\n [\n 'name' => 'password',\n 'label' => trans('eduardoarandah::usermanager.password'),\n 'type' => 'password',\n ],\n [\n 'name' => 'password_confirmation',\n 'label' => trans('eduardoarandah::usermanager.password_confirmation'),\n 'type' => 'password',\n ]\n ]);\n }",
"static public function get_profile_fields() {\n\t\tglobal $DB;\n\t\t\n\t\t$fields = $DB->get_records_menu('user_info_field', null, null, $fields = 'id, shortname');\n\n\t\treturn $fields;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether the given OFFLINE player has a bank opened or not. | public abstract function hasBank(IPlayer $player): bool; | [
"public abstract function isBankMember(IPlayer $player, string $bankName): bool;",
"public function isOpen()\n {\n return $this->getFirstOpenPaymentTransaction() && $this->hasUnpaidTotal();\n }",
"public function isBusinessUnitOwned()\n {\n return $this->isLocalLevelOwned();\n }",
"public function isOpen()\n {\n return $this->status === SettlementStatus::STATUS_OPEN;\n }",
"public function isBankCodeFieldVisible()\n {\n return array_key_exists('country', $this->previousParams)\n && ('DE' == strtoupper($this->getCountry())\n || 'AT' == strtoupper($this->getCountry()));\n }",
"public abstract function has(IPlayer $player, int $balance): bool;",
"public function isAnnualBillingSwitchPossible(): bool;",
"public function isOpen()\n {\n return $this->invoice->status === StripeInvoice::STATUS_OPEN;\n }",
"function isAccountClosed($accountNo){\n }",
"public function hasBisLockedAccount()\n {\n return $this->bis_locked_account !== null;\n }",
"public function isClosed() {\n\t\t$username = $this->user['username'];\n\t\t$query = mysqli_query($this->con, \"SELECT user_closed FROM users WHERE username='$username'\");\n\t\t$row = mysqli_fetch_array($query);\n\n\t\tif($row['user_closed'] == 'yes')\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t}",
"public function hasOpenBattleAgainst(User $user)\n {\n //$cnt = $this->openBattles()->where('rapper1_id', $user->id)->orWhere('rapper2_id', $user->id)->count();\n //return $cnt > 0;\n // possibly naive solution, other one had really ugly bugs\n $cnt1 = OpenBattle::where('rapper1_id', $this->id)->where('rapper2_id', $user->id)->open()->count();\n $cnt2 = OpenBattle::where('rapper2_id', $this->id)->where('rapper1_id', $user->id)->open()->count();\n return $cnt1 > 0 || $cnt2 > 0;\n }",
"public function hasIsInBattle()\n {\n return $this->is_in_battle !== null;\n }",
"public function canWithdraw()\n {\n $user = $this->getUser();\n\n return ($this->getData('user_id') == $user['id'] &&\n $this->getData('status') == self::STATUS_PENDING) ? true : false;\n }",
"public function isOpen()\n\t{\n\t\treturn $this->getBase()->getStatus() === InvoiceStatus::OPEN;\n\t}",
"public function hasActivePlayer()\n {\n $this->read(array('type'=>'key', 'filter'=>'state=3'));\n return $this->hasData();\n }",
"public function isOpen()\n {\n return \\in_array($this->getStatus(), [OrderInterface::STATUS_OPEN], true);\n }",
"public function hasLobby()\n {\n return $this->lobbies()->exists();\n }",
"function isWithdrawn() {\n\t\tif ($this->active==0) { return false; }\n\t\treturn $this->dateWithdrawn > 0;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print the final state of the blocks. | protected function export()
{
for ($i=0; $i<count($this->blocks); $i++) {
printf("%d:", $i);
for ($j=0; $j<count($this->blocks[$i]); $j++) {
printf(" %d", $this->blocks[$i][$j]);
}
printf("\n");
}
} | [
"function printBlocks( $blocks )\n{\n for ( $i = 0 ; $i < ( count( $blocks ) ) ; $i++ ) \n // does block 0 contain interesting information? ask to Germano,\n // at the moment I skip them. The last block is related to \n // error messages. \n {\n echo \"<br><br>\";\n printSingleBlock( $blocks[ $i ] );\n }\n}",
"public function showState() {\n\t\tprintf(\"Original Status: %s\\n\", $this->getState());\n\t}",
"public function print_transitions() {\n\t\tforeach ($this->states as $state_num => $state_value) {\n\t\t\n\t\t$next_state[0] = $this->transitions[$state_num][0][0];\n\t\t$next_state[1] = $this->transitions[$state_num][1][0];\n\t\t\n\t\tprint \"\\n\";\n\t\tprint \"state({$state_num}) has an output of {$state_value}\\n\";\n\t\tprint \"--- state({$state_num}) -> if input(0) -> new state: state({$next_state[0]})\\n\";\n\t\tprint \"--- state({$state_num}) -> if input(1) -> new state: state({$next_state[1]})\\n\";\n\t\t\n\t\t}\n\t}",
"protected function _showFinalMessages()\n {\n if ($this->_errors) {\n $this->_output->writeln(\n \"<fg=red>There was some errors on setting configuration: \\n{$this->_errors}</fg=red>\"\n );\n }\n\n if ($this->_warnings) {\n $this->_output->writeln(\n \"<comment>There was some warnings on setting configuration: \\n{$this->_warnings}</comment>\"\n );\n }\n\n if ($this->_configurationCounter > 0) {\n $this->_output->writeln(\n \"<info>Configuration has been applied</info>\"\n );\n\n $this->_output->writeln(\n \"<info>Total changed configurations: {$this->_configurationCounter}</info>\"\n );\n } else {\n $this->_output->writeln(\n \"<error>There was no configuration applied.</error>\"\n );\n }\n }",
"function debug_blocks() {\n global $PAGE, $OUTPUT;\n\n if (optional_param('blockdebug', false, PARAM_BOOL)) {\n\n $regions = $PAGE->blocks->get_content_for_all_regions($OUTPUT);\n $output = [];\n foreach ($regions as $regionname => $region) {\n foreach ($region as $block) {\n $outputblock = clone($block);\n unset($outputblock->content);\n unset($outputblock->footer);\n $output[$regionname][] = $outputblock;\n }\n }\n print_object($output);\n }\n}",
"public function dump()\n {\n $xs = array_keys($this->grid);\n $minX = $minY = $maxX = $maxY = 0;\n \n foreach ($xs as $x) {\n if ($minX > $x)\n $minX = $x;\n \n if ($maxX < $x)\n $maxX = $x;\n \n $ys = array_keys($this->grid[$x]);\n \n foreach ($ys as $y) {\n if ($minY > $y)\n $minY = $y;\n\n if ($maxY < $y)\n $maxY = $y; \n } \n }\n \n // print \"$minX = $minY = $maxX = $maxY\\n\";\n // print_r($this->grid);\n \n // Print grid\n for ($y = $maxY; $y >= $minY; $y--) { \n for ($x = $minX; $x <= $maxX; $x++) {\n $block = (isset($this->grid[$x][$y])) ? $this->grid[$x][$y] : '.';\n\n if (($x == $this->curX) && ($y == $this->curY)) {\n print \"[$block]\"; \n } else {\n print \" $block \";\n }\n } \n \n print \"\\n\"; \n }\n \n print \"\\n\"; \n }",
"public static function flushBlocks()\n {\n static::$blocks = array();\n }",
"public function printStations(){\n echo $this->getStationState();\n }",
"public function printNodes() {\n for ($i = 0; $i < $this->length; $i++) {\n echo $this->nodeArr[$i]->id.\" \";\n echo $this->nodeArr[$i]->path.\" \";\n echo $this->nodeArr[$i]->active.\"\\n\";\n }\n $this->printNumCycles();\n }",
"public function getLastBlock()\n {\n }",
"function outputCurrentState() {\n $this->getApplication()->outputCurrentState($this->getIo());\n }",
"public function out($block = 'MAIN')\n\t{\n\t\tif (self::$debug_mode && self::$debug_output)\n\t\t{\n\t\t\t// Print debug stuff for current file\n\t\t\t$file = basename($this->filename);\n\t\t\techo \"<h1>$file</h1>\";\n\t\t\tforeach (self::$debug_data[$file] as $block => $tags) {\n\t\t\t\t$block_name = $file . ' / ' . str_replace('.', ' / ', $block);\n\t\t\t\techo \"<h2>$block_name</h2>\";\n\t\t\t\techo \"<ul>\";\n\t\t\t\tforeach ($tags as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (is_array($val))\n\t\t\t\t\t{\n\t\t\t\t\t\t// One level of nesting is supported\n\t\t\t\t\t\tforeach ($val as $key2 => $val2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo self::debugVar($key . '.' . $key2, $val2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo self::debugVar($key, $val);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo \"</ul>\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo $this->text($block);\n\t\t}\n\t\treturn $this;\n\t}",
"protected function _getInfoBlock()\n {\n $result = $this->_endLine;\n $result .= $this->_tab.'/**'.$this->_endLine;\n $result .= $this->_tab.' * Automatically generated Published Block, which Contains Controls from Template.'.$this->_endLine;\n $result .= $this->_tab.' * Generation time: '.date('Y-m-d, H:i:s').';'.$this->_endLine;\n $result .= $this->_tab.' * '.$this->_endLine;\n $result .= $this->_tab.' * Warning:'.$this->_endLine;\n $result .= $this->_tab.' *'.$this->_endLine;\n $result .= $this->_tab.' * Do not Remove this block from template manually.'.$this->_endLine;\n $result .= $this->_tab.' * If you want to remove this block use commandline script loaduicomponentsdefinition.phpcli'.$this->_endLine;\n $result .= $this->_tab.' * with flag -r.'.$this->_endLine;\n $result .= $this->_tab.' *'.$this->_endLine;\n $result .= $this->_tab.' * Example:'.$this->_endLine;\n $result .= $this->_tab.' *'.$this->_endLine;\n $result .= $this->_tab.' * loaduicomponentsdefinition.phpcli --page-class-file=\"page.class.file.php\" -r'.$this->_endLine;\n $result .= $this->_tab.' *'.$this->_endLine;\n $result .= $this->_tab.' * @author '.$this->_author.$this->_endLine;\n $result .= $this->_tab.' */'.$this->_endLine;\n\n return $result;\n }",
"public function showFinalStep()\n {\n return true;\n }",
"function DebugDump()\r\n {\r\n $this->DebugOutput('<u>Datastreams:</u>');\r\n foreach ($this->datastreams as $key => $node) \r\n $this->DebugOutput(\"[$key] $node\");\r\n \r\n $this->DebugOutput('<u>Commands:</u>');\r\n foreach ($this->commands as $key => $node) \r\n $this->DebugOutput(\"[$key] $node\"); \r\n }",
"public function printHand()\n {\n printf($this->name . \" hand is now: \");\n foreach ($this->tiles as $tile) {\n $tile->print();\n }\n print PHP_EOL;\n }",
"function printStatus (): void {\r\n foreach ( $this->allPlayers() as $player ) {\r\n $player->printDeck();\r\n }\r\n }",
"public function _end_block()\n\t{\n\t}",
"protected function printStepBody()\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Truncate Queue Used when the queue should be completely flushed of all pending Tasks, regardless of status. | public function truncateQueueCommand() {
$result = $this->interactionService->truncateQueue();
$this->echoResultToConsole($result);
} | [
"public function flush() {\n $queueSize = $this->queueSize();\n if ($queueSize > 0) {\n $this->logInfo('Flushing queue of size ' . $queueSize);\n $this->sendBatch($this->_queue);\n $this->_queue = array();\n }\n }",
"public function clearQueue()\r\n {\r\n }",
"public function emptyQueue() {\n $this->client->zremrangebyscore(self::JOB_QUEUE_NAME, \"-inf\", \"inf\");\n $this->client->del(\"total_processing_time\");\n $this->client->del(\"num_jobs_processed\");\n }",
"private function flushQueue()\n {\n self::$queue = [];\n }",
"private function clearQueue()\n {\n $this->queue = array();\n }",
"public function clearQueue()\n {\n $this->queue = array();\n }",
"private function truncateJobs()\n {\n \\DB::delete('queue_errors')\n ->execute();\n\n \\DB::delete('queue_jobs')\n ->execute();\n }",
"public function flushQueue()\n {\n $spool = $this->mailer->getTransport()->getSpool();\n $transport = $this->container->get('swiftmailer.transport.real');\n $spool->flushQueue($transport);\n $transport->stop();\n }",
"public function clear()\n {\n $this->queue = array();\n }",
"public function clearQueuedMessages()\n\t{\n\t\t$this->queued = array();\n\t}",
"public function clearQueue() {\n $radiamQueue = $this->getRadiamQueue();\n if ($radiamQueue)\n {\n foreach ($radiamQueue as $event)\n {\t \n $id = $event->id;\n $this->deleteRadiamQueueRow($id);\n }\n }\n }",
"public function removeQueueLimitation() {\n\t\tunset($this->whereClauseParts['queue']);\n\t}",
"public function clear() {\n\t\t$this->_end = -1;\n\t\t$this->_queue = array();\n\t}",
"public function clear_queue() {\n\t\t$this->data = array();\n\t}",
"private function deleteQueue() {\n $this->refreshQueue();\n $this->queue->deleteQueue();\n }",
"public function clear() \r\n {\r\n unset($this->queue);\r\n $this->queue = array();\r\n $this->position['tail'] = 0;\r\n $this->position['head'] = 0;\r\n }",
"protected function cleanCompleted()\n {\n $days = $this->config->getQueueSuccessLifetime();\n $filters[] = $this->filterBuilder\n ->setConditionType('eq')\n ->setField(Queue::STATUS)\n ->setValue(Queue::STATUS_COMPLETE)\n ->create();\n $filters[] = $this->filterBuilder\n ->setConditionType('lt')\n ->setField(Queue::CREATED_AT)\n ->setValue($this->dateTime->gmDate('Y-m-d H:i:s', strtotime('-' . $days . ' days')))\n ->create();\n $this->searchCriteriaBuilder->addFilters($filters);\n $items = $this->queueRepository->getList(\n $this->searchCriteriaBuilder->create()\n )->getItems();\n\n // delete items\n foreach ($items as $item) {\n $this->queueRepository->delete($item);\n }\n\n return $this;\n }",
"public function deleteQueue();",
"public function resetQueue()\n {\n $shopQueueLogs = ShopQueueLog::all();\n foreach ($shopQueueLogs as $shopQueueLog) {\n if ($shopQueueLog->expires_at > 0) {\n $carbon = Carbon::parse($shopQueueLog->created_at);\n // if expired, remove the entry from the shop_queue_logs table\n if ($carbon->diffInMinutes(Carbon::now()) >= $shopQueueLog->expires_at) {\n $shopQueueLog->delete();\n }\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Function: check_out_path Check that the destination path exists Parameters: none Returns: boolean true if path exists | protected function check_out_path()
{
if (is_dir($this->dest_path))
{
return true;
} else {
return false;
}
} | [
"public function checkPath();",
"protected function destination_exist() {\r\n\r\n\t\treturn is_writable($this->root . $this->destination);\r\n\r\n\t}",
"protected function destination_exist()\n {\n\n return is_writable($this->root . $this->destination);\n }",
"private function pathExists()\r\n {\r\n return is_file($this->fullPath());\r\n }",
"private function __checked_target_path() {\r\n\t\t$dir_exist = true;\r\n\t\tif (!is_dir($this->target_path)) {\r\n\t\t\t$dir_check = (!@mkdir($this->target_path)) ? false : true;\r\n\t\t}\r\n\t\treturn $dir_exist;\r\n\t}",
"public function hasOldPath();",
"private function destination_exist()\n {\n return is_writable($this->_destination);\n }",
"private function pathExists($path){\n\t\t$this->messageLog->write(\"Checking for existance of {$path}\");\n\t\t$cmd = \"svn ls {$this->url}/{$path} {$this->cmdAppend}\";\n\t\t$success = $this->commandClient->execute($cmd);\n\n\t\tif($success){\n\t\t\t$this->messageLog->write(\"{$path} found\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->messageLog->write(\"{$path} NOT found\");\n\t\t\treturn false;\n\t\t}\n\t}",
"protected function checkOutputPaths()\n {\n /* Uncomment iff shared dir is brought back */\n /* if (!is_dir($this->baseExportDir . self::SHARED_DIR_DOWNLOADS . '/' . $this->accountID)) { */\n /* mkdir($this->baseExportDir . self::SHARED_DIR_DOWNLOADS . '/' . $this->accountID); */\n /* chmod($this->baseExportDir . self::SHARED_DIR_DOWNLOADS . '/' . $this->accountID, 0777); */\n /* } */\n\n if (!is_dir($this->baseExportDir . '/'. $this->accountID)) {\n mkdir($this->baseExportDir . '/'. $this->accountID);\n chmod($this->baseExportDir . '/'. $this->accountID, 0777);\n }\n\n if (!is_dir($this->commissionsOutPath)) {\n mkdir($this->commissionsOutPath);\n chmod($this->commissionsOutPath, 0777);\n }\n\n if (!is_dir($this->settingsOutPath)) {\n mkdir($this->settingsOutPath);\n chmod($this->settingsOutPath, 0777);\n }\n\n if (!is_dir($this->dailyFileOutPath)) {\n mkdir($this->dailyFileOutPath);\n chmod($this->dailyFileOutPath, 0777);\n }\n\n if (!is_dir($this->monthlyFileOutPath)) {\n mkdir($this->monthlyFileOutPath);\n chmod($this->monthlyFileOutPath, 0777);\n }\n\n if (!is_dir($this->metaFileOutPath)) {\n mkdir($this->metaFileOutPath);\n chmod($this->metaFileOutPath, 0777);\n }\n }",
"public function localCopyExists(){\n\t\treturn file_exists($this->repoDir().$this->localPath());\n\t}",
"protected function checkPaths() {\n\t\t\n\t\treturn (bool) $this->checkPath( $this->source_path ) && $this->checkPath( $this->target_path );\n\t\n\t}",
"private function pathCheck(){\n \n $this->path_check = false;\n \n //Test whether log file exists. If not, attempt to create it.\n if (is_dir($this->log_path) && !file_exists($this->log_path . DS . $this->log_file)){\n \n if (is_writable($this->log_path)){\n $log = \"\\r\\n [\" . date(\"m-d-y h:i:s A\") . \"] Initializing... \";\n file_put_contents($this->log_path . DS . $this->log_file, $log);\n }\n }\n \n //Test log file and path and set the path_check to true on success.\n if (is_dir($this->log_path) && is_writable($this->log_path) && file_exists($this->log_path . DS . $this->log_file)){\n $this->path_check = true;\n }\n \n if (!$this->path_check){\n error_log(\"Path set in Logger not found: \" . $this->log_path . DS . $this->log_file);\n }\n }",
"public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}",
"public function testCheckIsPathExists() {\n\t\t$filePath = $this->testBasePath . 'test.txt';\n\n\t\ttouch($filePath);\n\n\t\t$this->assertTrue(file_exists($filePath), 'Precondition failed. File was not created: ' . $filePath);\n\t\t$this->assertFalse(file_exists($filePath . 1), 'Precondition failed. File exists: ' . $filePath . 1);\n\n\t\t$this->assertFalse($this->fileHandler->checkIsPathExists($filePath . 1),\n\t\t\t'TRUE returned for checking if a non-existing file exists');\n\t\t$this->assertTrue($this->fileHandler->checkIsPathExists($filePath),\n\t\t\t'FALSE returned for checking if an existing file exists');\n\t}",
"private function checkExportDirectory()\n {\n if (is_readable($this->exportPath))\n {\n $this->output('The \"' . $this->exportDir . '\" directory exists. Do you want to remove it ? (y/n)');\n $user_input = fopen('php://stdin', 'r');\n $confirm_directory_deletion = strtolower(trim(fgets($user_input)));\n if (!in_array($confirm_directory_deletion, array('y', 'yes')))\n {\n $this->output('Aborted. Please delete the \"' . $this->exportDir . '\" directory before processing again.');\n return false;\n }\n $this->executeCommand('rm -rf ' . $this->exportPath);\n if (is_readable($this->exportPath))\n {\n $this->output('Aborted. The \"' . $this->exportDir . '\" directory could not be deleted.');\n return false;\n }\n else\n {\n $this->output('Directory deleted: \"' . $this->exportPath . '\"');\n $this->output();\n }\n }\n return true;\n }",
"public function exist($path): bool;",
"function folderExists($path)\n\t{\n\t\t//not applicable\n\t}",
"public function folderExists(string $path): bool;",
"public function testOutputFolderIsExist()\n {\n $folderPath = storage_path('/app/data/output');\n\n //-- assert if folder exist\n $this->assertTrue(file_exists($folderPath), \"Output folder not exist: \". $folderPath);\n //-- assert if folder is writable\n $this->assertFileIsWritable($folderPath, \"Output folder not writable: \". $folderPath);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This is rather complicated, but essentialy it works like: Pass it a new amt and period, then it finds the old amt and period, to calculate how much money is unused from their last payment. Then it takes that money and applies it to the cost per day of the new plan, returning the timestamp of the day the first payment of the new plan should take place. | function calc_upgrade($blog_id, $new_amt, $new_level, $new_period) {
global $wpdb;
$old = $wpdb->get_row("SELECT expire, level, term, amount FROM {$wpdb->base_prefix}pro_sites WHERE blog_ID = '$blog_id'");
if (!$old)
return false;
//if level is not being raised not an upgrade
if ($new_level <= $old->level)
return false;
//some complicated math calculating the prorated amt left and applying it to the price of new plan
$diff = $old->expire - time();
$duration = $old->term * 30.4166 * 24 * 60 * 60; //number of seconds in the period
$left = $duration - ($duration - $diff);
if ($left <= 0 || empty($old->amount) || $old->amount <= 0)
return false;
$prorate_amt = $old->amount * ($left / $duration);
$new_duration = $new_period * 30.4166 * 24 * 60 * 60; //number of seconds in the period
$first_payment = ($prorate_amt / ($new_amt / $new_duration)) + time(); //return timestamp of first payment date
$first_payment = intval(round($first_payment));
return ($first_payment > time()) ? $first_payment : false;
} | [
"function recalculateRebillDate()\n {\n if (is_null($this->tm_started) || in_array($this->status, array(self::RECURRING_FAILED, self::RECURRING_FINISHED, self::RECURRING_CANCELLED))) {\n $this->updateQuick('rebill_date', null);\n return;\n }\n $date = null;\n $c = $this->getPaymentsCount();\n if ($this->first_total <= 0)\n $c++; // first period is \"fake\" because it was free trial\n //if ($c < $this->getExpectedPaymentsCount()) // not yet done with rebills\n if ($this->rebill_times > ($c - 1)) { // not yet done with rebills\n // we count starting from first payment date, we rely on tm_started field here\n if ($this->first_total <= 0)\n list($date, ) = explode(' ', $this->tm_started);\n else\n $date = $this->getAdapter()\n ->selectCell(\"SELECT MIN(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n $date = date('Y-m-d', strtotime($date));\n\n $period1 = new Am_Period($this->first_period);\n $date = $period1->addTo($date);\n $period2 = new Am_Period($this->second_period);\n for ($i = 1; $i < $c; $i++) { // we skip first payment here, already added above\n $date = $period2->addTo($date);\n }\n // If date is in the past, something is wrong here. Now we try to calculate rebill date from user's last payment.\n if ($date < $this->getDi()->dateTime->format('Y-m-d')) {\n\n $last_payment_date = $this->getAdapter()\n ->selectCell(\"SELECT MAX(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n if ($last_payment_date) {\n\n $period = new Am_Period($this->second_period);\n $date = date('Y-m-d', strtotime($last_payment_date));\n $date = $period->addTo($date);\n }\n // date is in the past again; Use tomorrow's date instead;\n $restore_limit_date = $this->getDi()->dateTime;\n $restore_limit_date->modify('-30 days');\n if (($date < $this->getDi()->sqlDate) && ($date > $restore_limit_date->format('Y-m-d'))) {\n $tomorrow = $this->getDi()->dateTime;\n $tomorrow->modify('+1 days');\n $date = $tomorrow->format('Y-m-d');\n }\n }\n }\n $this->updateQuick('rebill_date', $date);\n }",
"function adBillingProcessor($ad_id, $cost_per_impression)\n{\n $current_timestamp = time();\n $billing_day = date('d', $current_timestamp);\n $current_billing_day = getAdCurrentBillingDay($ad_id);\n $ad_owner_id = getAdPart($ad_id, 'user_id');\n\n //Check if there is still enough credit to enable this advert.\n $current_cash_balance = getAvailableCashBalance($ad_owner_id);\n if($current_cash_balance >= $cost_per_impression)\n {\n //check if daily budget has been reached.\n $daily_budget = getAdPart($ad_id, 'daily_budget');\n $stats_id = getAdCurrentStatsID($ad_id);\n $current_amount = getAdStatsPart($stats_id, 'amount');\n $current_impression = getAdStatsPart($stats_id, 'total_impression');\n //Check if we are still on the latest billing day or cycle.\n if($current_billing_day == $billing_day)\n {\n //check if budget has been reached for the day.\n if($current_amount >= $daily_budget){ //Budget reached\n //stop rotating this ad as budget has been reached.\n $rotation = 2;\n $query = mysql_query(\"UPDATE om_adverts SET\n rotation = '\".mysql_real_escape_string($rotation).\"' WHERE\n id = '\".mysql_real_escape_string($ad_id).\"'\") or die(mysql_error());\n }else{\n //Budget not yet reached. Update billing records.\n $new_amount = $current_amount + $cost_per_impression;\n $new_impression = $current_impression + 1;\n //Update records on database.\n $query = mysql_query(\"UPDATE om_advert_daily_billing SET\n amount = '\".mysql_real_escape_string($new_amount).\"',\n total_impression = '\".mysql_real_escape_string($new_impression).\"' WHERE\n billing_day = '\".mysql_real_escape_string($current_billing_day).\"' AND\n advert_id = '\".mysql_real_escape_string($ad_id).\"'\") or die(mysql_error());\n //Update Ad transaction\n $trans_id = getAdTransactionID($ad_id);\n $total_trans_amount = getTransactionPart($trans_id, 'amount') + $cost_per_impression;\n $queryt = mysql_query(\"UPDATE om_transactions SET\n amount = '\".mysql_real_escape_string($total_trans_amount).\"' WHERE\n id = '\".mysql_real_escape_string($trans_id).\"'\") or die(mysql_error());\n }\n\n }else{\n //This should trigger a new billing cycle for all ads stopped.\n updateStoppedAds(); //Resume ad rotation for ads.\n\n //Create new billing cycle.\n $total_impression = 1;\n $total_clicks = 0;\n $date_created = time();\n $status = 1;\n $ad_owner = getAdPart($ad_id, 'user_id');\n\n $query = mysql_query(\"INSERT INTO om_advert_daily_billing\n (advert_id, billing_day, amount, total_impression, total_clicks,\n date_created, status, user_id)\n VALUES('\".mysql_real_escape_string($ad_id).\"',\n '\".mysql_real_escape_string($billing_day).\"',\n '\".mysql_real_escape_string($cost_per_impression).\"',\n '\".mysql_real_escape_string($total_impression).\"',\n '\".mysql_real_escape_string($total_clicks).\"',\n '\".mysql_real_escape_string($date_created).\"',\n '\".mysql_real_escape_string($status).\"',\n '\".mysql_real_escape_string($ad_owner).\"')\")\n or die(mysql_error());\n\n //Update Ad transaction\n $trans_id = getAdTransactionID($ad_id);\n $total_trans_amount = getTransactionPart($trans_id, 'amount') + $cost_per_impression;\n $queryt = mysql_query(\"UPDATE om_transactions SET\n amount = '\".mysql_real_escape_string($total_trans_amount).\"' WHERE\n id = '\".mysql_real_escape_string($trans_id).\"'\") or die(mysql_error());\n\n }\n }else{\n //User has ran out of cash. Stop advert.\n $stop_ad = 2;\n $query = mysql_query(\"UPDATE om_adverts SET\n status = '\".mysql_real_escape_string($stop_ad).\"' WHERE\n id = '\".mysql_real_escape_string($ad_id).\"'\") or die(mysql_error());\n //Send user an email that his/her ad has stopped running on UpGhana\n }\n}",
"function billing_stat_payment( $list ){\n\n\t$q = \" SELECT SUM(`cost`) FROM `billing_invoice` WHERE `date`>0 \";\n\t\n\tif( $user_id = $list['user_id'] ){\n\t\t$q.= \" AND `user_id`='$user_id' \";\n\t}\n\t\n\tif( $method = $list['method'] ){\n\t\t$q.= \" AND `method`='$method' \";\n\t}\n\t\n\tif( $list['skipwallet'] ){\n\t\t$q.= \" AND `method`!='wallet' \";\n\t}\n\t\n\tif( $date = $list['date'] ){\n\t\t\n\t\tforeach ($date as $k => $d) {\n\t\t\t\n\t\t\tswitch ($k) {\n\t\t\t\tcase 'day':\n\t\t\t\t\t$d = $d.\" 00:00:00\";\n\t\t\t\t\t$d = DateU($d);\n\t\t\t\t\t$date_from = $d;\n\t\t\t\t\t$date_to = $d + (3600 * 24);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'week':\n\t\t\t\t\t$d = $d.\" 23:59:59\";\n\t\t\t\t\t$d = DateU($d);\n\t\t\t\t\t$date_to = $d;\n\t\t\t\t\t$date_from = $d - (3600 * 24 * 7);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'month':\n\t\t\t\t\t$d = $d.\" 23:59:59\";\n\t\t\t\t\t$d = DateU($d);\n\t\t\t\t\t$date_to = $d;\n\t\t\t\t\t$date_from = $d - (3600 * 24 * 30);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'monthIn':\n\t\t\t\t\t$d_month = substr($d, 5, 2);\n\t\t\t\t\t$day_max = ($d_month<=6?31:($d_month==12?29:30));\n\t\t\t\t\t$date_from = DateU( $d.\"/01 00:00:00\" );\n\t\t\t\t\t$date_to = DateU( $d.\"/$day_max 23:59:59\" );\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'year':\n\t\t\t\t\t$d = $d.\" 23:59:59\";\n\t\t\t\t\t$d = DateU($d);\n\t\t\t\t\t$date_to = $d;\n\t\t\t\t\t$date_from = $d - (3600 * 24 * 365);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'yearIn':\n\t\t\t\t\t$d_year = substr($d, 0, 4);\n\t\t\t\t\t$date_from = DateU( $d.\"/01/01 00:00:00\" );\n\t\t\t\t\t$date_to = DateU( $d.\"/12/29 23:59:59\" );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\t\n\t\t}\n\t\t\n\t\t$q.= \" AND (`date`>'$date_from' AND `date`<'$date_to') \";\n\n\t}\n\n\tif(! $rs = dbq( $q ) ){\n\t\te();\n\n\t} else {\n\n\t\t$sum_of_cost = dbr( $rs, 0, 0 );\n\n\t\tif( lang_code == 'fa' ){\n\t\t\treturn $sum_of_cost;\n\n\t\t} else {\n\t\t\t// return number_format( $sum_of_cost, 2, '.', '' );\n\t\t\treturn round( $sum_of_cost , 2 );\n\t\t}\n\n\t}\n\n\t// return \"kk\";\n\n\t\n}",
"function calc_upgrade_cost( $blog_id, $new_level, $new_period, $new_amt ) {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t//If no blog id is set, or value is 0, return the amount\r\n\t\tif ( empty( $blog_id ) || $blog_id === 0 ) {\r\n\t\t\treturn $new_amt;\r\n\t\t}\r\n\r\n\t\t$old = $wpdb->get_row( $wpdb->prepare( \"SELECT expire, level, term, amount FROM {$wpdb->base_prefix}pro_sites WHERE blog_ID = %d\", $blog_id ) );\r\n\r\n\t\tif ( ! $old ) {\r\n\t\t\treturn $new_amt;\r\n\t\t}\r\n\t\tif ( $old->expire < time() ) {\r\n\t\t\treturn $new_amt;\r\n\t\t}\r\n\r\n\t\tif ( $new_level < $old->level && $new_period < $old->term ) // if customer is downgrading no need to charge them\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}elseif( $new_level == $old->level && $new_period == $old->term ) {\r\n\t\t\tif( is_pro_trial( $blog_id ) ) {\r\n\t\t\t\t//Non Recurring, with trial (Level and Period is assigned)\r\n\t\t\t\treturn $new_amt;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$diff = $old->expire - time();\r\n\t\t$duration = $old->term * 30.4166 * 24 * 60 * 60; //number of seconds in the period\r\n\t\t$left = $duration - ( $duration - $diff ); //number of seconds left in current period\r\n\r\n\t\tif ( $left <= 0 || empty( $old->amount ) || $old->amount <= 0 ) {\r\n\t\t\treturn $new_amt;\r\n\t\t}\r\n\t\t$refund_amt = round( $old->amount * ( $left / $duration ), 2 ); //amount to refund\r\n\t\t$refund_amt = $refund_amt > $old->amount ? $old->amount : $refund_amt;\r\n\r\n\t\t$new_amt = $new_amt - $refund_amt;\r\n\r\n\t\treturn ( $new_amt < 0 ) ? 0 : $new_amt;\r\n\t}",
"public function payNow();",
"abstract protected function local_has_paid_plan();",
"public function updatePay(): int {\n if ($this->amtDue === $this->amtPayed) {\n $this->state = State::PAYED;\n $this->appt->state = State::DONE;\n $this->appt->updateTime = new \\DateTime();\n $this->appt->update();\n }\n if ($this->amtDue < $this->amtPayed) {\n $this->amtPayed = $this->amtDue;\n $this->state = State::PAYED;\n $this->appt->state = State::DONE;\n $this->appt->updateTime = new \\DateTime();\n $this->appt->update();\n }\n $this->updateTime = new \\DateTime();\n return self::update();\n }",
"public function getNextBillingTimestamp();",
"public function calculateCharges( Plan $plan = null )\n {\n try\n {\n if ( !is_null($plan) )\n $this->plan = $plan;\n\n $this->items = [];\n\n if ( !is_null($this->plan->schedule->last_ran_at) )\n foreach ( $this->plan->charges as $charge )\n foreach ( $charge->runDatesBetween($this->plan->schedule->last_ran_at) as $schedule )\n foreach ( $schedule->events as $date )\n $this->items[] = [\n 'amount' => $charge->amount,\n 'description' => $charge->description,\n 'charged_at' => $date\n ];\n }\n catch ( \\Exception $e )\n {\n throw $e;\n }\n finally\n {\n return $this;\n }\n }",
"function wp_stripe_find_or_create_plan($amount, $interval) {\n \n /*\n * Currency - All amounts must be denominated in USD when creating charges with Stripe — the currency conversion happens automatically\n */\n $currency = 'usd';\n\n $plan = null;\n\n // Construct desired plan\n $requested_plan = array(\n 'amount' => $amount,\n 'interval' => $interval,\n 'name' => '$' . $amount/100 . '/' . $interval,\n 'currency' => $currency,\n 'id' => $amount . $interval[0] . '_wp'\n );\n\n $existing_plans = Stripe_Plan::all();\n\n // Loop through plans, looking for one that matches our desired plan\n foreach( $existing_plans->data as $existing_plan ) {\n if ( $existing_plan->amount == $requested_plan['amount'] && $existing_plan->interval == $requested_plan['interval'] ) {\n $plan = $existing_plan;\n break;\n }\n }\n\n // Create a new plan if we didn't find one that matched\n if ( !$plan ) {\n $plan = Stripe_Plan::create($requested_plan);\n }\n \n return $plan;\n}",
"public function testAccountBillingPeriodChangeIsRecorded()\n {\n $account_updates_table = $this->insight->getTableName('account_updates');\n\n $this->insight->accounts->addPaid(1, new PlanM(), new Monthly());\n\n $this->assertEquals(0, $this->connection->count($account_updates_table));\n\n $this->insight->accounts->changePlan(1, new PlanM(), new Yearly());\n\n $this->assertEquals(1, $this->connection->count($account_updates_table));\n\n $row = $this->connection->executeFirstRow(\"SELECT `old_billing_period`, `new_billing_period` FROM `$account_updates_table` WHERE `account_id` = ?\", 1);\n\n $this->assertInternalType('array', $row);\n $this->assertEquals(Monthly::class, $row['old_billing_period']);\n $this->assertEquals(Yearly::class, $row['new_billing_period']);\n }",
"public static function mlmWithdrawalPeriod();",
"function ppt_resources_get_next_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_period['und'])) {\n $node_date = $node->field_planned_period['und'][0]['value'];\n $planned_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $planned_quantity = 0;\n if (isset($node->field_planned_quantity['und'])) {\n $planned_quantity = $node->field_planned_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['planned'][$planned_product_name])) {\n if (isset($final_arr['planned'][$planned_product_name][$planned_month])) {\n $final_arr['planned'][$planned_product_name][$planned_month][0] += (int) $planned_quantity;\n } else {\n $final_arr['planned'][$planned_product_name][$planned_month][0] = [(int) $planned_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['planned'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['planned'][$planned_product_name][$month] = [0];\n }\n $final_arr['planned'][$planned_product_name][$planned_month] = [(int) $planned_quantity];\n }\n }\n }\n return $final_arr;\n}",
"public function testWorkflow_Active_NewPlan_AtTermEnd()\n {\n $this->setUpPlans();\n\n /*\n * Start with basic plan\n */\n list($user, $plan, $membership, $service, $invoice) = $payload = $this->generatePaidMembership();\n $this->assertNotNull($plan, $membership, $service, $service->status, $invoice, $invoice->status);\n\n $this->assertEquals(Status::STATUS_ACTIVE, $service->status->code);\n $this->assertEquals(1, $service->isActive());\n\n /*\n * Emulate in the wild\n */\n $now = $this->timeTravelDay(1);\n $this->workerProcess();\n\n /*\n * Change to the new plan\n */\n $newService = MembershipManager::instance()->switchPlan($membership, $this->newPlan);\n list($user, $plan, $membership, $service, $invoice) = $payload = $this->reloadMembership($payload);\n\n /*\n * Old plan should remain active until payment\n */\n $this->assertEquals(Status::STATUS_ACTIVE, $service->status->code);\n $this->assertEquals(Status::STATUS_NEW, $newService->status->code);\n $this->assertEquals(1, $newService->is_throwaway);\n\n /*\n * Pay the new plan\n */\n $invoice = $newService->first_invoice;\n $invoice->submitManualPayment('Testing');\n\n /*\n * Emulate in the wild\n */\n $now = $this->timeTravelDay(1);\n $this->workerProcess();\n\n list($user, $plan, $membership, $service, $invoice) = $payload = $this->reloadMembership($payload);\n $newService = Service::find($newService->id);\n\n /*\n * Old service not cancelled until next month\n */\n $this->assertEquals(Status::STATUS_ACTIVE, $service->status->code);\n $this->assertEquals(Status::STATUS_PENDING, $newService->status->code);\n $this->assertEquals(1, $service->isActive());\n $this->assertEquals(0, $newService->isActive());\n\n /*\n * Emulate in the wild\n */\n $now = $this->timeTravelMonth(1);\n $this->workerProcess();\n\n list($user, $plan, $membership, $service, $invoice) = $payload = $this->reloadMembership($payload);\n $newService = Service::find($newService->id);\n\n /*\n * Old service now cancelled\n */\n $this->assertEquals(Status::STATUS_ACTIVE, $newService->status->code);\n $this->assertEquals(Status::STATUS_CANCELLED, $service->status->code);\n $this->assertEquals(0, $service->isActive());\n $this->assertEquals(1, $newService->isActive());\n }",
"function pay_now($tablename, $columnname, $returnpage) {\r\n\t\t\r\n\t\tif ($_POST && isset($_POST['submit'])) {\r\n\r\n\t\t\t$get_amount = $this->findAll(TAB_PREFIX . $tablename, $columnname[0] . '=' . $_SESSION['plan_id'], \"\" . $columnname[1] . \" as amount\");\r\n $get_UserDetails = $this->findAll(TAB_PREFIX . 'user', ' user_id=' . $_SESSION['user_detail']['user_id']);\r\n\t\t\t$userStateData = $this->getStateDetailByStateId($get_UserDetails[0]->state);\r\n\r\n $cur_date = date('Y-m-d H:i:s');\r\n $ref_id = date('siHmdy');\r\n\r\n\t\t\t//Update payment process date\r\n $this->update(TAB_PREFIX . 'user_subscribed_plan', array('ref_id' => $ref_id), array('id' => $_SESSION['subs_id']));\r\n\r\n\t\t\t//coupon\r\n\t\t\tif(isset($_POST['coupon']) && !empty($_POST['coupon'])) {\r\n\r\n\t\t\t\t$couponData = $this->get_results(\"select * from \".TAB_PREFIX . \"coupon where name='\".$this->sanitize($_POST['coupon']).\"'\");\r\n\t\t\t\tif(!empty($couponData)) {\r\n\r\n\t\t\t\t\t$client_datas = $this->get_results(\"select * from \".TAB_PREFIX.\"user where coupon='\".$this->sanitize($_POST['coupon']).\"'\");\r\n\t\t\t\t\tif(isset($couponData[0]->coupon_uses) && count($client_datas)<$couponData[0]->coupon_uses) {\r\n\t\t\t\t\t\t$this->update(TAB_PREFIX . 'user', array('coupon' => $this->sanitize($_POST['coupon'])), array('user_id' => $_SESSION['user_detail']['user_id']));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->setError('Coupon Code Expired');\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setError('Invalid Coupon Code');\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n //Insert data in payment log\r\n $this->insert(TAB_PREFIX . 'payment_log', array(\r\n 'process_payment_id' => $ref_id,\r\n\t\t\t\t'ref_id' => $ref_id,\r\n 'datetime' => $cur_date,\r\n 'status' => '0'\r\n ));\r\n\t\t\t\r\n\t\t\t$price_data = $get_amount[0]->amount;\r\n\t\t\tif(!empty($couponData)) {\r\n\r\n\t\t\t\tif(isset($couponData[0]->type) && $couponData[0]->type=='0') {\r\n\t\t\t\t\t$get_amount[0]->amount = $price_data - $couponData[0]->coupon_value;\r\n\t\t\t\t\t$get_amount[0]->amount = $get_amount[0]->amount + ($get_amount[0]->amount*0.18);\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse if(isset($couponData[0]->type) && $couponData[0]->type=='1') {\r\n\t\t\t\t\t$get_amount[0]->amount = $get_amount[0]->amount - round((($price_data*$couponData[0]->coupon_value)/(100+$couponData[0]->coupon_value)), 2, PHP_ROUND_HALF_DOWN);\r\n\t\t\t\t\t$get_amount[0]->amount = $get_amount[0]->amount + ($get_amount[0]->amount*0.18);\r\n\t\t\t\t\t$get_amount[0]->amount = round($get_amount[0]->amount, 2, PHP_ROUND_HALF_DOWN);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$get_amount[0]->amount = $get_amount[0]->amount + ($get_amount[0]->amount * 0.18);\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\t<form action=\"<?php echo PROJECT_URL; ?>/go4hosting/keeper_payment.php\" name=\"payment\" method=\"POST\" id=\"payment\"> \r\n <input type=\"hidden\" value=\"0\" name=\"channel\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"25039\" name=\"account_id\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"<?php echo $ref_id; ?>\" name=\"reference_no\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"<?php echo $get_amount[0]->amount; ?>\" name=\"amount\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"INR\" name=\"currency\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"INR\" name=\"display_currency\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"1\" name=\"display_currency_rates\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"Payment information from GST\" name=\"description\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"<?php echo PROJECT_URL . \"/go4hosting/keeper_response.php\"; ?>\" name=\"return_url\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"LIVE\" name=\"mode\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"<?php echo $get_UserDetails[0]->username; ?>\" name=\"name\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"<?php if(!empty($userStateData['data']) && isset($userStateData['data']->state_name)) { echo $userStateData['data']->state_name; } else { echo \"Delhi\"; } ?>\" name=\"address\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"<?php if(empty($get_UserDetails[0]->city)) { echo \"Delhi\"; } else { echo $get_UserDetails[0]->city; } ?>\" name=\"city\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"110010\" name=\"postal_code\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"IND\" name=\"country\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"<?php echo $get_UserDetails[0]->email; ?>\" name=\"email\"/>\r\n\t\t\t\t<input type=\"hidden\" value=\"<?php echo $get_UserDetails[0]->phone_number; ?>\" name=\"phone\"/>\r\n </form>\r\n\r\n <script type=\"text/javascript\">\r\n\t\t\t\twindow.onload=func1;\r\n\t\t\t\tfunction func1(){\r\n\t\t\t\t\tdocument.payment.submit();\r\n\t\t\t\t}\r\n\t\t\t</script>\r\n\t\t\t<?php\r\n\t\t\texit();\r\n }\r\n }",
"public function paidCostPerDate($prj_kode='', $sit_kode='', $start_date='', $end_date='')\n {\n $sql =\"DROP TEMPORARY TABLE IF EXISTS PaidCost;\n CREATE TEMPORARY TABLE PaidCost\n (\n id int(11) NOT NULL AUTO_INCREMENT,\n prj_kode varchar(255) DEFAULT '',\n prj_nama varchar(255) DEFAULT '',\n sit_kode varchar(255) DEFAULT '',\n sit_nama varchar(255) DEFAULT '',\n tgl timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n kategori varchar(20) DEFAULT '',\n trano char(20) DEFAULT '',\n val_kode varchar(6) DEFAULT '',\n rateidr decimal(12,2) DEFAULT '0',\n amount decimal(22,4) DEFAULT '0',\n total decimal(22,4) DEFAULT '0',\n author varchar(30) DEFAULT '',\n PRIMARY KEY (id)\n );\";\n \n $this->db->query($sql);\n \n\n $s_sit = ($sit_kode !=''|| $sit_kode!=null) ? \" AND sit_kode='$sit_kode' \" : '';\n $s_date = (($start_date !=''|| $start_date!=null) && ($end_date !=''|| $end_date!=null)) ? \" AND (tgl BETWEEN '$start_date' AND '$end_date') \" : '';\n \n $s_sit_rpi = ($sit_kode !=''|| $sit_kode!=null) ? \" AND d.sit_kode='$sit_kode' \" : '';\n $s_date_rpi = (($start_date !=''|| $start_date!=null) && ($end_date !=''|| $end_date!=null)) ? \" AND (d.tgl BETWEEN '$start_date' AND '$end_date') \" : '';\n \n // INSERT ASF CLAIM\n $sql1 =\"INSERT INTO PaidCost(prj_kode, prj_nama, sit_kode, sit_nama, tgl,kategori,trano, val_kode, rateidr,amount,total,author)\n SELECT prj_kode, prj_nama, sit_kode, sit_nama, tgl,'ASF CLAIM',trano, val_kode, rateidr,\n COALESCE(harga*qty,0),\n COALESCE(CASE val_kode WHEN 'IDR' THEN qty*harga ElSE qty*harga*rateidr END,0),\n petugas\n FROM imderpdb.procurement_asfdd\n WHERE prj_kode='$prj_kode' $s_sit $s_date AND qty*harga >0 AND approve !=300 AND trano LIKE '%ASF%' ;\";\n \n $this->db->query($sql1);\n \n // INSERT BSF CLAIM\n $sql2 =\"INSERT INTO PaidCost(prj_kode, prj_nama, sit_kode, sit_nama, tgl,kategori,trano, val_kode, rateidr,amount,total,author)\n SELECT prj_kode, prj_nama, sit_kode, sit_nama, tgl,'BSF CLAIM',trano, val_kode, rateidr,\n COALESCE(harga*qty,0),\n COALESCE(CASE val_kode WHEN 'IDR' THEN qty*harga ElSE qty*harga*rateidr END,0),\n petugas\n FROM imderpdb.procurement_asfdd\n WHERE prj_kode='$prj_kode' $s_sit $s_date AND qty*harga >0 AND approve !=300 AND trano LIKE '%BSF%' ;\";\n \n $this->db->query($sql2);\n\n \n // INSERT PIECEMEAL\n $sql3 =\"INSERT INTO PaidCost(prj_kode, prj_nama, sit_kode, sit_nama, tgl,kategori,trano, val_kode, rateidr,amount,total,author)\n SELECT prj_kode, prj_nama, sit_kode, sit_nama, tgl,'Piecemeal',notran, val_kode, rateidr,\n COALESCE(harga_borong*qty,0),\n COALESCE(CASE val_kode WHEN 'IDR' THEN qty*harga_borong ElSE qty*harga_borong*rateidr END,0),\n ''\n FROM imderpdb.boq_dboqpasang\n WHERE prj_kode='$prj_kode' $s_sit $s_date AND approve !=300 ; \";\n\n $this->db->query($sql3);\n \n // INSERT Salary, Jamsostek, Personal Income Tax (VERSI SEBELUM OCA)\n $sql4 =\"INSERT INTO PaidCost(prj_kode, prj_nama, sit_kode, sit_nama, tgl,kategori,trano, val_kode, rateidr,amount,total,author)\n SELECT prj_kode, prj_nama, sit_kode, sit_nama, tgl, 'OCA', trano, val_kode, rateidr, COALESCE(qty*harga,0), COALESCE(CASE val_kode WHEN 'IDR' THEN (qty*harga) ElSE qty*harga*rateidr END,0), petugas\n FROM imderpdb.procurement_sald \n WHERE prj_kode='$prj_kode' $s_sit $s_date ; \";\n\n $this->db->query($sql4);\n \n // INSERT OCA\n $sql5 =\"INSERT INTO PaidCost(prj_kode, prj_nama, sit_kode, sit_nama, tgl,kategori,trano, val_kode, rateidr,amount,total,author)\n SELECT prj_kode, prj_nama, sit_kode, sit_nama, tgl, 'OCA', trano, val_kode, rateidr, COALESCE(qty*harga,0), COALESCE(CASE val_kode WHEN 'IDR' THEN (qty*harga) ElSE qty*harga*rateidr END,0), petugas\n FROM imderpdb.procurement_asfdd\n WHERE prj_kode='$prj_kode' $s_sit $s_date AND trano LIKE '%OCA%' AND approve !=300 ;\";\n\n $this->db->query($sql5);\n \n // INSERT PAYMENT RPI(to site)\n $sql6 =\"INSERT INTO PaidCost (prj_kode, prj_nama, sit_kode, sit_nama, tgl,kategori,trano, val_kode, rateidr,amount,total,author)\n SELECT d.prj_kode, d.prj_nama, d.sit_kode, d.sit_nama, d.tgl,'Payment RPI(to site)',d.trano, d.val_kode, d.rateidr,\n COALESCE(d.total_bayar,0),\n COALESCE(CASE d.val_kode WHEN 'IDR' THEN d.total_bayar ElSE d.total_bayar*d.rateidr END,0),\n d.uid\n FROM imderpdb.finance_payment_rpi d\n INNER JOIN imderpdb.procurement_rpih h ON (d.doc_trano = h.trano)\n WHERE d.stspayment ='Y' AND h.statusbrg='SITE' AND h.prj_kode='$prj_kode' $s_sit_rpi $s_date_rpi ;\";\n \n $this->db->query($sql6);\n \n // INSERT DO\n $sql7 =\"INSERT INTO PaidCost(prj_kode, prj_nama, sit_kode, sit_nama, tgl,kategori,trano, val_kode, rateidr,amount,total,author)\n SELECT prj_kode, prj_nama, sit_kode, sit_nama, tgl, 'DO', trano, val_kode, rateidr, COALESCE(qty*harga,0), COALESCE(CASE val_kode WHEN 'IDR' THEN (qty*harga) ElSE qty*harga*rateidr END,0), petugas\n FROM imderpdb.procurement_whod\n WHERE prj_kode='$prj_kode' $s_sit $s_date ;\";\n\n $this->db->query($sql7);\n \n // INSERT MATERIAL CANCEL\n $sql8 =\"INSERT INTO PaidCost(prj_kode, prj_nama, sit_kode, sit_nama, tgl,kategori,trano, val_kode, rateidr,amount,total,author)\n SELECT prj_kode, prj_nama, sit_kode, sit_nama, tgl,'Material Cancel',trano, val_kode, rateidr,\n COALESCE(-1*harga*qty,0),\n COALESCE(CASE val_kode WHEN 'IDR' THEN -1*qty*harga ElSE -1*qty*harga*rateidr END,0),\n petugas\n FROM imderpdb.procurement_whbringbackd\n WHERE prj_kode='$prj_kode' $s_sit $s_date AND approve!=300 ;\";\n\n $this->db->query($sql8);\n \n // INSERT MATERIAL RETURN\n $sql9 =\"INSERT INTO PaidCost(prj_kode, prj_nama, sit_kode, sit_nama, tgl,kategori,trano, val_kode, rateidr,amount,total,author)\n SELECT prj_kode, prj_nama, sit_kode, sit_nama, tgl,'Material Return',trano, val_kode, rateidr,\n COALESCE(-1*harga*qty,0),\n COALESCE(CASE val_kode WHEN 'IDR' THEN -1*qty*harga ElSE -1*qty*harga*rateidr END,0),\n petugas\n FROM imderpdb.procurement_whreturnd\n WHERE prj_kode='$prj_kode' $s_sit $s_date AND approve!=300 ;\";\n\n $this->db->query($sql9);\n \n $sql10 = 'SELECT prj_kode,\n prj_nama,\n sit_kode,\n sit_nama,\n tgl,\n kategori,\n trano,\n val_kode,\n SUM(amount) AS amount,\n SUM(total) AS total,\n author FROM PaidCost GROUP BY trano,kategori,val_kode ORDER BY kategori,tgl ASC;';\n\n $fetch = $this->db->query($sql10);\n $data = $fetch->fetchAll();\n \n return $data;\n \n\n }",
"function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }",
"function get_finance_amount($the_deposit, $the_new_price){\n\t\n\treturn $the_new_price - $the_deposit;\n}",
"public function fillPreviousMonthAction()\n\t\t{\n\t\t\t$this->getHelper( 'ViewRenderer' )->setNoRender( true );\n\t\t\t// Start cron.\n\t\t\t$this->getHelper( 'admin' )\n\t\t\t\t->startCronTask( 'fill-previous-month' );\n\t\t\t// Prepare.\n\t\t\t$config = Config::getInstance();\n\t\t\t$modelPayment = new Payment_Model_Payment();\n\t\t\t// Select all records with last month period.\n\t\t\t$period = date( \"Y-m-00\", strtotime( \"-1 month\" ) );\n\t\t\tif ( $statistics = Table::_( 'optionStat' )->previousPeriod( $period ) ) {\n\t\t\t\t// Fill option's fields.\n\t\t\t\tforeach ( $statistics as $_record ) {\n\t\t\t\t\t$shop = Table::_( 'shops' )->get( $_record->shop_id );\n\t\t\t\t\t$plugin = Table::_( 'plugins' )->get( $_record->plugin_id );\n\t\t\t\t\t$currentPlan = $modelPayment->setting( $shop, $plugin, 'current plan' );\n\t\t\t\t\t$currentPlan = Table::_( 'plans' )->getPlan( $_record->plugin_id, $currentPlan );\n\t\t\t\t\tif ( $option = Table::_( 'options' )->getForStatistics( $currentPlan->id, $_record->key ) ) {\n\t\t\t\t\t\t$currentValue = $_record->value / $option->overdraft_unit_count;\n\t\t\t\t\t\t$overdraftValue = $currentValue - $option->value;\n\t\t\t\t\t\t$price = $overdraftValue * $option->price_for_overdraft_unit;\n\t\t\t\t\t\t$overdraft =\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t( $currentValue > $option->value )\n\t\t\t\t\t\t\t&& ( $price > $config->options->overdraft->minimalPrice )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( $_record->use_for_payment ) {\n\t\t\t\t\t\t\t$_record->overdraft_status = $overdraft ? 'overdraft' : 'not overdraft';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$_record->option_name = $option->name;\n\t\t\t\t\t\t$_record->option_value = $option->value;\n\t\t\t\t\t\t$_record->option_unit = $option->unit;\n\t\t\t\t\t\t$_record->option_price_for_overdraft_unit = $option->price_for_overdraft_unit;\n\t\t\t\t\t\t$_record->option_overdraft_unit_count = $option->overdraft_unit_count;\n\t\t\t\t\t\t$_record->setReadOnly( false );\n\t\t\t\t\t\t$_record->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Stop cron.\n\t\t\t$this->getHelper( 'admin' )\n\t\t\t\t->stopCronTask( 'fill-previous-month' );\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/DELETE CURRENT MS PAYMENT | function deleteCurrenMSPayment($transactionNo,$studentNo){
$sql1 = "DELETE FROM tblpaymentcashflow WHERE fldTransactionNo='$transactionNo' AND fldStudentNum='$studentNo'";
mysql_query($sql1,$this->openCon());
$sql2 = "DELETE FROM tblpaymentbreakdown WHERE fldTransactionNo='$transactionNo' AND fldStudentNum='$studentNo'";
mysql_query($sql2,$this->openCon());
$this->closeCon();
} | [
"public function unsetApprovedPayment()\n {\n $oShop = $this->getShop();\n\n $oShop->deleteSessionVariable($this->_sApprovedPaymentSessionKey);\n $oShop->deleteSessionVariable($this->_sApprovedPaymentIdSessionKey);\n }",
"public function declineReceipt(): void {\n\t}",
"public function deletePaymentMethod()\n {\n\n $payment_method = \\Stripe\\PaymentMethod::retrieve(\n\n 'pm_123456789'\n\n );\n\n $payment_method->detach();\n \n }",
"public function deleted(SmsPayment $smsPayment)\n {\n //\n }",
"function paypal_cancel()\n {\n $payment_id = $this->session->userdata('payment_id');\n $this->db->where('advertisement_payment_id', $payment_id);\n $this->db->delete('advertisement_payment');\n $this->session->set_userdata('payment_id', '');\n $this->session->set_flashdata('alert', 'payment_cancel');\n redirect(base_url() . 'home/marketing', 'refresh');\n }",
"private function deletePendingSms() {\r\n $sms2del = $this->session->userdata('sms_delete');\r\n if (!$sms2del) {\r\n return;\r\n }\r\n\r\n foreach ($sms2del as $smsid) {\r\n self::deleteSmsAttributes($smsid);\r\n $sql = \"DELETE FROM smart_message WHERE smart_message_id = ? \";\r\n $this->db->query($sql, array($smsid));\r\n }\r\n $this->session->unset_userdata('sms_delete');\r\n }",
"public function DeletePaypalBatch() {\n\t\t\t$this->objPaypalBatch->Delete();\n\t\t}",
"public function clearPaid()\n {\n $sql = (\"DELETE FROM fishes WHERE crnt_payoff = '0.00'\");\n $query = $this->db->prepare($sql);\n $query->execute();\n }",
"public function unsetCurrentPayment()\n {\n $this->current_payment = null;\n }",
"public function remove()\n {\n secupay_log($this->sp_log, \"remove\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key IN ('\" . implode(\n \"', '\",\n $this->keys()\n ) . \"','MODULE_PAYMENT_SECUPAY_SK_XTC_ALLOWED') AND configuration_key NOT IN ('MODULE_PAYMENT_SECUPAY_APIKEY','MODULE_PAYMENT_SECUPAY_EXPERIENCE','MODULE_PAYMENT_SECUPAY_TAUTOSEND','MODULE_PAYMENT_SECUPAY_ORDER_BEFORE_PAYMENT','MODULE_PAYMENT_SECUPAY_SESSION')\");\n\n //check for other secupay payment module\n $qry = xtc_db_query(\"SELECT * FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key LIKE 'MODULE_PAYMENT_SP%_SORT_ORDER';\");\n\n if (xtc_db_num_rows($qry) == 0) {\n //no other secupay payment module installed, remove apikey\n secupay_log($this->sp_log, \"remove apikey\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_APIKEY'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_TAUTOSEND'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_EXPERIENCE'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_ORDER_BEFORE_PAYMENT'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_SESSION'\");\n }\n }",
"protected function _fcpoRemoveSamplePayment() \n {\n $sQuery = \"\n DELETE FROM oxpayments WHERE OXID = 'fcpounittest'\n \";\n\n oxDb::getDb()->Execute($sQuery);\n }",
"public function deleteMaturedNotPaid(){\n $now = Carbon::now();\n $invoices = $this->query()\n ->where('ispaid', 0)\n ->where('mature_date', '<', $now)\n ->get();\n foreach ($invoices as $invoice) {\n $this->destroy($invoice);\n }\n }",
"protected function triggerDeleteCCData() {\n $userId = Shopware()->Session()->sUserId;\n $paymentData = [];\n $serializedPaymentData = serialize($paymentData);\n $sql = 'UPDATE s_plugin_mopt_payone_payment_data SET `moptPaymentData`= ? WHERE userId = ?';\n Shopware()->Db()->executeUpdate($sql,array($serializedPaymentData, $userId));\n // also remove creditcard as default payment\n $sql = \"UPDATE s_user SET paymentID = ? WHERE id = ?\";\n Shopware()->Db()->query($sql, array((int)Shopware()->Config()->Defaultpayment, (int)$userId));\n // also remove creditcard data in Session\n unset(Shopware()->Session()->moptPayment);\n }",
"function deleteCmPayment() {\n if ($this->session->userdata('username') && $this->session->userdata('role') == 200) {\n $selPay = $this->input->post('selPay');\n if (!empty($selPay)) {\n $isDeleted = $this->mbackoffice->deleteCmPayment($selPay);\n if ($isDeleted) {\n $this->session->set_flashdata('success_message', 'Payment deleted successfully');\n echo '1';\n } else {\n $this->session->set_flashdata('error_message', 'Failed to delete payment');\n echo '0';\n }\n } else {\n echo '0';\n }\n } else {\n $this->session->sess_destroy();\n redirect('backoffice', 'refresh');\n }\n }",
"public function purchase_unsaved_delete()\n {\n $purchase_no = $this->input->post('purchase_no');\n /** Remove auto created purchase journal */\n $journal = $this->MAc_journal_master->get_by_doc('Purchase', $purchase_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created payment receipt for partial or full cash purchase */\n $payment = $this->MAc_payment_receipts->get_by_doc('Purchase', $purchase_no);\n if (count($payment) > 0)\n {\n $this->MAc_payment_receipts->delete($payment['id']);\n }\n /** Remove purchase */\n $this->MPurchase_details->delete_by_purchase_no($purchase_no);\n $this->MPurchase_master->delete_by_purchase_no($purchase_no);\n }",
"function delete_pending_orders_for_current_user($keep_order_id = null, $purchase_through = null)\n{\n $where = array(\n 'order_status' => 'ORDER_STATUS_awaiting_payment',\n );\n if ($purchase_through !== null) {\n $where['purchase_through'] = $purchase_through;\n }\n if (is_guest()) {\n $where['session_id'] = get_session_id();\n } else {\n $where['c_member'] = get_member();\n }\n $extra = ' AND add_date<' . strval(time() - 60 * 60 * 24 * 7); // If a week old, as otherwise a transaction may still come through\n $orders = $GLOBALS['SITE_DB']->query_select('shopping_order', array('id', 'notes'), $where, $extra);\n foreach ($orders as $order) {\n if ($order['id'] !== $keep_order_id) {\n if ($order['notes'] == '') {\n $GLOBALS['SITE_DB']->query_delete('shopping_order_details', array('order_id' => $order['id']));\n $GLOBALS['SITE_DB']->query_delete('shopping_order', array('id' => $order['id']), '', 1);\n } else {\n // Set to cancelled, as there are some notes on this order to be preserved\n $GLOBALS['SITE_DB']->query_update('shopping_order_details', array('order_status' => 'ORDER_STATUS_cancelled'), array('order_id' => $order['id']));\n $GLOBALS['SITE_DB']->query_update('shopping_order', array('order_status' => 'ORDER_STATUS_cancelled'), array('id' => $order['id']), '', 1);\n }\n }\n }\n}",
"public function cleanUpPendingOrders();",
"public function deletePendingState()\n {\n $order_status = (int)Configuration::get('PS_OS_WAITING_BANKS_PAYMENT');\n $orderState = new OrderState($order_status);\n $orderState->delete();\n Configuration::deleteByName('PS_OS_WAITING_BANKS_PAYMENT');\n }",
"abstract public function deletePayment_x( $id );"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return total number of registered employees (except system admin) | public function total() {
return $this->getRegisteredEmployees()->count();
} | [
"public function adminUnregisteredEmployees()\n\t{\n\t\tglobal $wpdb;\n\t\t\n\t\t// Variables\n\t\t$Count = 0;\n\t\tif ( $this->adminrole != NULL )\n\t\t{\n\t\t\t// Find All Unregistered Emplopyees\n\t\t\t$result = $wpdb->get_results(\n\t\t\t\t\" SELECT COUNT(emp.employee_email_address) AS table_count \n\t\t\t\t\tFROM {$wpdb->kpmg_employees} emp\n\t\t\t\t\tLEFT JOIN {$wpdb->kpmg_registration_details} det ON det.employee_email_address = emp.employee_email_address\n\t\t\t\t\tWHERE LOWER(emp.employee_status) = 'unregistered'\n\t\t\t\t\t\tAND det.employee_status IS NULL \n\t\t\t\t\t\"\t\n\t\t\t\t, ARRAY_A\n\t\t\t);\t\t\t\n\t\t\tif( count($result) > 0 ) \n\t\t\t{\n\t\t\t\t$Count = $result[0]['table_count']; // First One only\n\t\t\t}\n\n\t\t\treturn $Count;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"function employeesCount(){\n\t\t\t$database = new connect();\n\t\t\t$query = \"SELECT * FROM employee_record WHERE username != 'admin'\";\n\t\t\t$resultQuery = $database->getResultsDatabase($query);\n\t\t\t\n\t\t\t\t$result = mysql_num_rows($resultQuery);\n\t\t\t\treturn $result;\n\t\t}",
"public function countEmployee(){\n\t\t\t\t\t return count($this->listeEmployee());\n\t\t\t\t\t }",
"public function get_total_employees() {\n\t $query = $this->db->get(\"employees\");\n\t return $query->num_rows();\n\t}",
"public static function employeeCount()\r\n {\r\n echo \"<pre>There are \".count(self::$employees).\" employees.</pre>\";\r\n }",
"public function getEmployeeCount(): int\n {\n return count($this->getEmployeeIds());\n }",
"public function getTotalEmployee();",
"public function getEmployeeCount()\n {\n return count($this->getEmployeeIds());\n }",
"public function getEmployeeCount()\n {\n return $this->employee_count;\n }",
"public function getEmployeesCount() {\n return $this->getTable()->getEmployeesCount();\n }",
"public function get_num_employees() {\n return $this->get_org_details_field( 'num_employees' );\n }",
"public function activeTotal() {\n\t\treturn Employee::all()->count();\n\t}",
"public function countEmployee_equipe(){\n\t\t\t\t\t return count($this->listeEmployee_equipe());\n\t\t\t\t\t }",
"public function getNumberOfEmployees() {\n\t\treturn $this->numberOfEmployees;\n\t}",
"public function getStaffCount(){\n $pdo = new PDO_MYSQL();\n $res = $pdo->query(\"SELECT COUNT(*) as count FROM entrance_employee WHERE emID = :emid\", [\":emid\" => $this->emID]);\n return $res->count;\n }",
"public function CountOrgEmployees()\n {\n $result = $this->RUNSearch(\"SELECT SUM(branch_emp) as employees, SUM(org_managers) as managers FROM count_employees WHERE org_id = ? GROUP BY org_id\", [$this->org_id]);\n\n return $result->rowCount() > 0 ? $result->fetch() : false;\n }",
"public function totalAdminUsers() {\n\t\t//$total = $this->find('all', array('conditions'=>array('OR'=>array('role'=>array('super-admin','admin')))));\n\n\t\t$total = $this->find('count', array(\n\t\t\t\t'conditions'=>array('OR'=>array('role'=>array('super-admin','admin')))\n\t\t));\n\t\treturn $total;\n\t}",
"private function countRegisteredStaff()\r\n {\r\n $data = $this->getRegisteredStaffs();\r\n $count = count($data);\r\n return $count;\r\n }",
"public function cantidad_empleados() {\n \n /*Recupera los empleados creados*/\n $query = $this->db->query(\"SELECT\n count(1) as cantidadEmpleados\n FROM\n app_usuarios\n WHERE\n idTipoUsuario = 1\n AND activo = 'S'\");\n \n return $query->row();\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field int32 SourceStationType = 5; | public function getSourceStationType()
{
return $this->SourceStationType;
} | [
"public function setSourceStationType($var)\n {\n GPBUtil::checkInt32($var);\n $this->SourceStationType = $var;\n\n return $this;\n }",
"public function getSourceType()\n {\n return $this->source_type;\n }",
"public function getSourceType()\n {\n }",
"public function getSourceType(): string\n {\n return $this->sourceType;\n }",
"public function getSourceType()\n {\n return $this->sourceType;\n }",
"public function getSourceType();",
"public function getSourceType()\n {\n return isset($this->source_type) ? $this->source_type : '';\n }",
"public function getStationId() {\n return (string)$this->value('station_id');\n }",
"public function getStationNum() {\n return $this->get(self::STATION_NUM);\n }",
"static function getFromTypeCode($typeCode) {\n $type = new StationType();\n return $type->retrieve_one(\"typeCode=?\", array($typeCode));\n }",
"public function getLocationSourceType()\n {\n return $this->location_source_type;\n }",
"protected function getSourceType()\n {\n }",
"public function getStreet_type()\n {\n return isset($this->street_type) ? $this->street_type : null;\n }",
"public static function CHANNEL_NUMBER()\n {\n return new SourceChannelType(self::CHANNEL_NUMBER);\n }",
"public function getLocalStationId()\n {\n return $this->localId;\n }",
"public function getTypeStc() {\n return $this->typeStc;\n }",
"public function getOriginControlPacket(): int\n {\n return 0;\n }",
"protected function getSourceID()\n\t{\n\t\tif ($call_type == self::TYPE_IDV)\n\t\t{\n\t\t\t// hooray! hard coding!\n\t\t\t// eventually when branch for gforge [#10745] is merged in,\n\t\t\t// we won't have to do this it will be centralized\n\t\t\treturn 17;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Blackbox_Exception(sprintf(\n\t\t\t\t'source id for unknown call type (%s) requested',\n\t\t\t\tstrval($call_type))\n\t\t\t);\n\t\t}\n\t}",
"public function getSourceType() : IType;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field int32 loginPluginId = 11; | public function setLoginPluginId($var)
{
GPBUtil::checkInt32($var);
$this->loginPluginId = $var;
return $this;
} | [
"public function getLoginPluginId()\n {\n return $this->loginPluginId;\n }",
"public function setLoginPluginId($var)\n {\n GPBUtil::checkString($var, True);\n $this->loginPluginId = $var;\n\n return $this;\n }",
"public function getPluginId();",
"abstract protected function getPluginId();",
"static public function getLoginPluginName()\n\t{\n\t\treturn Zend_Registry::get('auth')->getName();\n\t}",
"function getPluginID () {return $this->getFieldValue ('plugin_id');}",
"protected function getPluginUid(): int\n {\n return $this->configurationManager->getContentObject()->data['uid'];\n }",
"public function getAccountSafePluginId()\n {\n return $this->accountSafePluginId;\n }",
"public function getIdLogin()\n {\n return $this->IdLogin;\n }",
"public function getLoginId(): int\n {\n }",
"public function getLoginId()\n {\n return isset($this->loginId) ? $this->loginId : null;\n }",
"public function get_login_user_id()\n\t{\n\t\n\t\treturn 1;\n\t}",
"function testPluginId()\n {\n\t $this->assertEquals(XiptLibApps::getPluginId('joomla', 'authentication'),XIPT_TEST_AUTHENTICATION_PLUGIN);\n\t $this->assertEquals(XiptLibApps::getPluginId('content', 'search'),XIPT_TEST_SEARCH_PLUGIN);\t \n\t \t\n\t // invalid search\n\t $this->assertEquals(XiptLibApps::getPluginId('joomla', 'stupid'),false);\n\t \n\t // cached search\n\t $this->assertEquals(XiptLibApps::getPluginId('content', 'search'),XIPT_TEST_SEARCH_PLUGIN);\n\t $this->assertEquals(XiptLibApps::getPluginId('joomla', 'stupid'),false);\n\t \n\n }",
"public function getSearchPluginId();",
"public function getPluginId() {\n return $this->pluginId;\n }",
"public function setLoginId(): void\n {\n }",
"public static function getFieldsPluginId()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true)\n\t\t\t->select($db->quoteName('extension_id'))\n\t\t\t->from($db->quoteName('#__extensions'))\n\t\t\t->where($db->quoteName('folder') . ' = ' . $db->quote('system'))\n\t\t\t->where($db->quoteName('element') . ' = ' . $db->quote('fields'));\n\t\t$db->setQuery($query);\n\n\t\ttry\n\t\t{\n\t\t\t$result = (int) $db->loadResult();\n\t\t}\n\t\tcatch (RuntimeException $e)\n\t\t{\n\t\t\tJError::raiseWarning(500, $e->getMessage());\n\t\t\t$result = 0;\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function getLoginIdentifier(): string\n {\n return $this->getUserId() ?? $this->data['sub'];\n }",
"public function getPluginId()\n {\n return $this->pluginId;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load users to Excel Return .xlsx file | public function loadUsersToExcel()
{
$users = $this->getAllUsers();
$data = $this->getData('Пользователи');
// Headers
$headings = [
'ID',
'НИК',
'email',
'Имя',
'Роль'
];
$countFields = 'E'; // Number of fields, it is need for styles
// Row width
$data['ews']->getColumnDimension('A')
->setWidth(7);
$data['ews']->getColumnDimension('B')
->setWidth(18);
$data['ews']->getColumnDimension('C')
->setWidth(25);
$data['ews']->getColumnDimension('D')
->setWidth(35);
$data['ews']->getColumnDimension('E')
->setWidth(18);
$data['rowNumber'] = $this->insertHeadings($headings, $data, $countFields);
// Insert data
if (! empty($users)) {
foreach ($users as $user) {
$col = 'A';
if (! empty($user)) {
foreach ($user as $userKey => $userVal) {
if ($userKey == 'role') {
($userVal == 2) ? $userVal = 'Администратор' : $userVal = 'Пользователь';
}
$data['ews']->setCellValue($col . $data['rowNumber'], $userVal);
$col++;
}
}
$data['rowNumber']++;
}
}
$this->getFile($data, $countFields);
exit;
} | [
"public function laporanExcelUser()\n {\n $date = date(now());\n return (new UserReport)->download('user-' . $date . '.xlsx');\n }",
"public function user_export()\n {\n return Excel::download(new UserExport, 'users.xlsx');\n }",
"public function export()\n {\n return Excel::download(new ExportUser, 'users.xlsx');\n }",
"public function exportExcel(){\n $profiles=$this->updateQuery(true);\n return Excel::download(new UsersExports($profiles),'proyectoeHidra.xlsx');\n }",
"public function export()\n {\n $this->denyAccessUnlessGranted('ROLE_ADMIN');\n date_default_timezone_set('Europe/Berlin');\n\n $spreadsheet = new Spreadsheet();\n $sheet = $spreadsheet->getActiveSheet();\n\n $sheet->setTitle('User List');\n $sheet->getCell('A1')->setValue('User');\n $sheet->getCell('B1')->setValue('Question');\n $sheet->getCell('C1')->setValue('Answer');\n $sheet->getCell('D1')->setValue('Answer_ID');\n\n // Increase row cursor after header write\n $sheet->fromArray($this->getData(), null, 'A2', true);\n\n $writer = new Xlsx($spreadsheet);\n\n // Create a Temporary file in the system\n $fileName = \"Results \" . date('d-m-Y h:i a') . \".xlsx\";\n $temp_file = tempnam(sys_get_temp_dir(), $fileName);\n $writer->save($temp_file);\n\n // Return the excel file as an attachment\n return $this->file($temp_file, $fileName, ResponseHeaderBag::DISPOSITION_INLINE);\n }",
"public function excel()\n\t{\n\t\t$name = 'import_items.csv';\n\t\t$data = file_get_contents('../' . $name);\n\t\tforce_download($name, $data);\n\t}",
"public function exporta_excel_users() {\n global $config;\n\n $objPHPExcel = new PHPExcel();\n\n //Informacion del excel\n $objPHPExcel->getProperties() ->setCreator(\"Jorge Jara H.\")\n ->setLastModifiedBy(\"JJH\")\n ->setTitle(\"Usuarios\");\n //encabezado\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', 'id');\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B1', 'Nombre');\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C1', 'E-Mail');\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('D1', 'Fono');\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('E1', 'Rol');\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('F1', 'Estado');\n\n $u = $this->getUsers('id_user,name,email,fono,Rol,Estado','1=1');\n $fila = 2;\n foreach ($u as $value => $data) {\n\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A'.$fila, $data['id_user']);\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$fila, $data['name']);\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C'.$fila, $data['email']);\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('D'.$fila, $data['fono']);\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('E'.$fila, $data['Rol'] ? 'Admin':'Normal' );\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue('F'.$fila, $data['Estado'] ? 'Activo':'Bloqueado' );\n\n $fila++;\n }\n\n //autisize para las columna\n foreach(range('A','E') as $columnID)\n {\n $objPHPExcel->getActiveSheet()->getColumnDimension($columnID)->setAutoSize(true);\n }\n\n $objPHPExcel->setActiveSheetIndex(0);\n\n $objPHPExcel->getActiveSheet()->setTitle('listado_usuarios');\n\n // Redirect output to a client’s web browser (Excel2007)\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=\"listar_usuarios.xlsx\"');\n header('Cache-Control: max-age=0');\n // If you're serving to IE 9, then the following may be needed\n header('Cache-Control: max-age=1');\n\n // If you're serving to IE over SSL, then the following may be needed\n header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified\n header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n header ('Pragma: public'); // HTTP/1.0\n\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n $objWriter->save('php://output');\n }",
"public function UserReport()\n\n {\n\n // filename for download\n\n \n $this->load->model('admin/Users_model', 'users');\n $data['usersList'] = $this->users->getUserExport();\n \n //print_r($data['usersList']);\n \n $filename = \"user-data-\" . date('d-m-Y') . \".xls\";\n\n\n\n \n \n $this->load->view('admin/user_data_report', $data);\n \n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\n header(\"Content-Type: application/vnd.ms-excel\");\n \n \n \n \n \n\t}",
"public function export()\n {\n return Excel::download(new GuruExport($this->guruModel), 'User.xlsx');\n }",
"public function getExcel();",
"public function QueryReport()\n\n {\n\n // filename for download\n\n \n $this->load->model('admin/Users_model', 'users');\n $data['usersList'] = $this->users->getQueryExport();\n \n //print_r($data['usersList']);\n \n $filename = \"query-data-\" . date('d-m-Y') . \".xls\";\n\n\n\n \n \n $this->load->view('admin/user_query_report', $data);\n \n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\n header(\"Content-Type: application/vnd.ms-excel\");\n \n \n \n \n \n\t}",
"public function exportAll()\n {\n return Excel::download(new UsersExport(), 'all_users_' . date(\"y_m_d_h_i_s\") . '.xlsx');\n }",
"public function export_excel()\n {\n return (new SiswaExport)->download('StudentList.xlsx');\n }",
"function export_subscribers_excel() {\n\t if (!empty($_POST['fellow_export_excel'])) {\n\t if (current_user_can('manage_options')) {\n\t header(\"Content-type: application/force-download\");\n\t header('Content-Disposition: inline; filename=\"users'.date('YmdHis').'.xlsx\"');\n\n\t global $wpdb;\n\t //table name of subscribers custome table \n\t\t\t\t$table ='user';\n\n\t\t\t\t$current_user = wp_get_current_user();\n\t\t\t\t//check role of login user\n\t\t\t\t$loginrole=$current_user->roles[0];\n\t //filte excel data on the base of user role.\n\t\t\t\tif($loginrole==\"administrator\"){\n\t\t\t\t\t //get all subscriber data who hase agency id \n\t\t\t\t\t\t $sql = \"SELECT * FROM $table WHERE agencyId != ''\";\n\t\t\t\t\t\t //Header of excel file \n\t\t\t\t\t\t echo '\"Name\",\"Email\",\"Agency Name\",\"Date Registered\",\"Status\"' . \"\\r\\n\";\n\t\t\t\t\t\t $results = $wpdb->get_results($sql);\n\t\t\t\t\t\t //print_r($results);\n\t\t\t\t\t\tforeach($results as $result){\n\t\t\t\t\t\t\t$name \t\t = $result->firstName.\" \".$result->lastName;\n\t\t\t\t\t\t\t$email \t\t = $result->email;\n\t\t\t\t\t\t\t$reg_date \t = date('m/d/Y', $result->date_created);\n\t\t\t\t\t\t\t//check status\n\t\t\t\t\t\t\t$status \t = $result->status;\n\t\t\t\t\t\t\tif($status=='0'){\n\t\t\t\t\t\t\t\t$status_action='Block';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$status_action='Active';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$agencydata=get_user_by('ID', $result->agencyId);\n\t\t\t\t\t\t\t$agency_name =$agencydata->display_name;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo '\"' . $name . '\",\"' . $email . '\",\"' . $agency_name . '\",\"' . $reg_date . '\",\"' . $status_action . '\"' . \"\\r\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}elseif($loginrole==\"agencyadmin\"){\n\t\t\t\t\t$cuurentuid=$current_user->ID;\n\t\t\t\t\t\t$sql = \"SELECT * FROM $table WHERE agencyId = $cuurentuid\";\n\t\t\t\t\t\t echo '\"Name\",\"Email\",\"Date Registered\",\"Status\"' . \"\\r\\n\";\n\t\t\t\t\t\t $results = $wpdb->get_results($sql);\n\t\t\t\t\tforeach($results as $result){\n\t\t\t\t\t\t$name = $result->firstName.\" \".$result->lastName;\n\t\t\t\t\t\t$email = $result->email;\n\t\t\t\t\t\t$reg_date = date('m/d/Y', $result->date_created);\n\t\t\t\t\t\t$status = $result->status;\n\t\t\t\t\t\tif($status=='0'){\n\t\t\t\t\t\t\t\t$status_action='Block';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$status_action='Active';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\techo '\"' . $name . '\",\"' . $email . '\",\"' . $reg_date . '\",\"' . $status_action . '\"' . \"\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t exit();\n\t }\n\t }\n\t}",
"public function export()\n {\n return Excel::download(new InactiveUsersExport, toDay()->format('d-m-Y') . '_usuarios_inactivos.xlsx');\n }",
"public function downloadExcel()\n {\n $file = Storage::disk('public')->get('staff_template.xlsx');\n return (new Response($file, 200))\n ->header('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n }",
"public function actionExcel()\n {\n // get a filename\n $filename = str_replace('.php', '.xlsx', __FILE__);\n\n // create excel object\n $objPHPExcel = Yii::app()->excel->create();\n\n // Set properties\n $objPHPExcel->getProperties()->setCreator(\"Maarten Balliauw\");\n $objPHPExcel->getProperties()->setLastModifiedBy(\"Maarten Balliauw\");\n $objPHPExcel->getProperties()->setTitle(\"Office 2007 XLSX Test Document\");\n $objPHPExcel->getProperties()->setSubject(\"Office 2007 XLSX Test Document\");\n $objPHPExcel->getProperties()->setDescription(\"Test document for Office 2007 XLSX, generated using PHP classes.\");\n\n // Add some data\n $objPHPExcel->setActiveSheetIndex(0);\n $objPHPExcel->getActiveSheet()->SetCellValue('A1', 'Hello');\n $objPHPExcel->getActiveSheet()->SetCellValue('B2', 'world!');\n $objPHPExcel->getActiveSheet()->SetCellValue('C1', 'Hello');\n $objPHPExcel->getActiveSheet()->SetCellValue('D2', 'world!');\n\n // Rename sheet\n $objPHPExcel->getActiveSheet()->setTitle('Simple');\n\n // Save Excel 2007 file\n $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);\n $objWriter->save($filename);\n\n // send to user\n Yii::app()->getRequest()->sendFile('example.xlsx', @file_get_contents($filename));\n }",
"public function exportUsers()\n {\n Excel::create('Clients', function ($excel) {\n $excel->sheet('Sheetname', function ($sheet) {\n $sheet->fromModel(Client::where('parent',Auth::guard('client')->user()->id)->get());\n });\n\n })->export('csv');\n }",
"public function download_excel_file($report_name,$excel_data,$column_heads){\n\n //load the excel library\n $this->load->library('excel');\n\n\n\n // Creating a new workbook\n $objPHPExcel = new PHPExcel();\n // Set properties\n $objPHPExcel->getProperties()->setTitle($report_name)->setDescription(\"none\");\n\n //activate worksheet number 1\n $objPHPExcel->setActiveSheetIndex(0);\n\n\n $col = 0;\n foreach ($column_heads as $field)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, 1, $field);\n $col++;\n }\n\n\n // Fetching the table data\n $row = 2;\n foreach($excel_data as $data)\n {\n $col = 0;\n foreach ($column_heads as $field)\n {\n $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col, $row, $data->$field);\n $col++;\n }\n\n $row++;\n }\n\n\n header('Content-Type: application/vnd.ms-excel');//mime type\n header('Content-Disposition: attachment;filename=\"Members.xls\"');//tell browser what's the file name\n header('Cache-Control: max-age=0');//no cache\n\n\n //save it to Excel5 format (excel 2003 .XLS file), change this to 'Excel2007' (and adjust the filename extension, also the header mime type)\n //if you want to save it as .XLSX Excel 2007 format\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n\n //force user to download the Excel file without writing it to server's HD\n ob_start();\n $objWriter->save(\"php://output\");\n $xlsData = ob_get_contents();\n ob_end_clean();\n\n\n $response = array(\n 'report_name' => $report_name,\n 'file' => \"data:application/vnd.ms-excel;base64,\".base64_encode($xlsData)\n );\n\n die(json_encode($response));\n\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$cnote = scandir ($this>dir . "/" . $category . "/" . $note); | public function get_note($note, $category, $relativePath) {
$cnote = scandir ( $relativePath . $category . "/" . $note);
unset($cnote[0]);
unset($cnote[1]);
return array_values($cnote);
} | [
"function get_categories()\n{\n $categories = array();\n \n foreach(scandir(CATBASE) as $item)\n {\n if(is_dir(CATBASE . $item) && $item != '.' && $item != '..') \n {\n $categories[] = $item;\n }\n }\n return $categories;\n}",
"function scandir($resource)\n {\n }",
"function listar_directorios($ruta) {\n if (is_dir($ruta)) { \n if ($dh = opendir($ruta)) {\n while (($file = readdir($dh)) !== false) { \n //esta línea la utilizaríamos si queremos listar todo lo que hay en el directorio \n //mostraría tanto archivos como directorios \n //echo \"<br>Nombre de archivo: $file : Es un: \" . filetype($ruta . $file); \n if (is_dir($file) && $file != \".\" && $file != \"..\") {\n //solo si el archivo es un directorio, distinto que \".\" y \"..\" \n echo \"<div class='compra'>Compra N°:$file</div>\";\n listar_sub_directorios($ruta.'\\\\'.$file.'\\\\',$file);\n }\n }\n closedir($dh);\n }\n } else{\n echo \"<br>No es ruta valida\";\n }\n}",
"function _listar_directorios_ruta($ruta=\"./\"){\n if (is_dir($ruta)) { \n if ($dh = opendir($ruta)) { \n $carpetas = [];\n while (($file = readdir($dh)) !== false) { \n //esta línea la utilizaríamos si queremos listar todo lo que hay en el directorio \n //mostraría tanto archivos como directorios \n //echo \"<br>Nombre de archivo: $file : Es un: \" . filetype($ruta . $file); \n if (is_dir($ruta . $file) && $file!=\".\" && $file!=\"..\"){ \n //solo si el archivo es un directorio, distinto que \".\" y \"..\" \n \n $c = array_push($carpetas, $file);\n \n \n // echo \"<br>Directorio: $ruta$file\"; \n \n // _listar_directorios_ruta($ruta . $file . \"/\"); \n } \n } \n closedir($dh); \n } \n}else {\n echo \"<br>No es ruta valida\"; \n}\nreturn $carpetas;\n\n}",
"function scandirectorio($path){\n\t$estructuraSeries = array_values(array_diff(scandir($path),array('..','.','cover.jpg'))); // genera array de dir con nombre serie\n\tforeach ($estructuraSeries as $serie) { //recorre el directorio base de series\n\t\t$temporada=0;\t\n\t\tif (is_dir($path.$serie)) { // si es un directorio y no un archivo ejecuto busqueda\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$directorio=array_values(array_diff(scandir($path.$serie), array('..','.','cover.jpg'))); // genera array de dir con nombre \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttemporada\n\t\t\t//echo \"Serie: \".$serie.\"\\n\";\n\t\t\tdescargaCover($serie,$temporada,$path);\n\t\t\tforeach ($directorio as $temporada) { // recorre el directorio para sus temporadas\n\t\t\t\tif (is_dir($path.$serie.'/'.$temporada)) { // si es un dir y no un archivo ejecuto busqueda\n\t\t\t\t\t//echo \"\\t Temporada: \".$temporada.\"\\n\";\n\t\t\t\t\tdescargaCover($serie,$temporada,$path);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}\n}",
"function counting_files()//FOR READING/WRITING PURPOSE-WHICH FILE TO READ/WRITE CURRENTLY....\r\n{\r\n\t$arr=scandir(\"notice_records\",SCANDIR_SORT_DESCENDING);\r\n\treturn ($arr[0]);//RETURNING HIGHEST NUMBERED FILE\r\n}",
"function read_cat_files()\n {\n $cats_read = 0;\n $docs_read = 0;\n $file_errors = 0;\n\n $dir = opendir( '.' );\n if ( $dir === FALSE )\n {\n closedir( $dir );\n ++$file_errors;\n }\n else\n {\n $filenames = array();\n \n while ( ( $entry = readdir( $dir ) ) !== FALSE )\n {\n if ( is_cat_file( $entry ) ) $filenames[] = $entry;\n }\n closedir( $dir );\n \n sort ( $filenames );\n foreach ( $filenames as $filename )\n {\n $result = read_cat_file( $filename );\n if ( $result === FALSE )\n {\n ++$file_errors;\n }\n else\n {\n $docs_read += $result;\n ++$cats_read;\n }\n }\n }\n\n return array( $cats_read, $docs_read, $file_errors );\n }",
"function listar_directorios_ruta($ruta) {\n if (is_dir($ruta)) {\n if ($dh = opendir($ruta)) {\n while (($file = readdir($dh)) !== false) {\n //esta línea la utilizaríamos si queremos listar todo lo que hay en el directorio \n //mostraría tanto archivos como directorios \n //echo \"<br>Nombre de archivo: $file : Es un: \" . filetype($ruta . $file); \n if (is_dir($ruta . $file) && $file != \".\" && $file != \"..\") {\n //solo si el archivo es un directorio, distinto que \".\" y \"..\" \n echo \"<br>Directorio: $ruta$file\";\n listar_directorios_ruta($ruta . $file . \"/\");\n }\n }\n closedir($dh);\n }\n } else\n echo \"<br>No es ruta valida\";\n}",
"function listar_directorios_ruta($ruta){\r\n if (is_dir($ruta)) { \r\n if ($dh = opendir($ruta)) { \r\n while (($file = readdir($dh)) !== false) { \r\n //esta línea la utilizaríamos si queremos listar todo lo que hay en el directorio \r\n //mostraría tanto archivos como directorios \r\n //echo \"<br>Nombre de archivo: $file : Es un: \" . filetype($ruta . $file); \r\n if (is_dir($ruta.\"\\\\\".$file) && $file!=\".\" && $file!=\"..\"){ \r\n //solo si el archivo es un directorio, distinto que \".\" y \"..\"\r\n echo \"<br>$ruta$file <b>(\".filetype($ruta.$file).\")</b>\";\r\n listar_directorios_ruta($ruta . $file .\"/\"); \r\n }elseif($file!=\".\" && $file!=\"..\"){\r\n //entra cuando es un fichero\r\n renombrar($ruta,$file);\r\n }\r\n } \r\n closedir($dh); \r\n } \r\n }else \r\n echo \"<br>No es ruta valida\"; \r\n}",
"function listar_directorios_ruta($ruta){\n if (is_dir($ruta)) {\n if ($dh = opendir($ruta)) {\n while (($file = readdir($dh)) !== false) {\n //esta línea la utilizaríamos si queremos listar todo lo que hay en el directorio\n //mostraría tanto archivos como directorios\n //echo \"<br>Archivo: <a href='\" . $ruta . $file . \"'>$file</a> : Es un: \" . filetype($ruta . $file);\n echo \"<br>Archivo: <a href='\" . $ruta . $file . \"'>$file</a> : \" . filetype($ruta . $file);\n if (is_dir($ruta . $file) && $file!=\".\" && $file!=\"..\"){\n //solo si el archivo es un directorio, distinto que \".\" y \"..\"\n echo \"<br>Directorio: <a href='\" . $ruta . $file . \"'>$ruta$file</a>\";\n listar_directorios_ruta($ruta . $file . \"/\");\n }\n }\n closedir($dh);\n }\n }else\n echo \"<br>No es ruta valida\";\n}",
"function list_all_categories_for_a_given_note($note_id){\r\n\t\r\n\t\tglobal $connection;\r\n\t\t$sql = \"SELECT pahro__notes_category.note_cat_name, pahro__notes_category.note_cat_id \r\n\t\t\t\tFROM pahro__notes_category_rel \r\n\t\t\t\tLEFT JOIN pahro__notes_category ON pahro__notes_category.note_cat_id = pahro__notes_category_rel.note_cat_id \r\n\t\t\t\tWHERE pahro__notes_category_rel.note_id = \".$note_id . \" AND note_owner_section = 'STAFF'\";\r\n\t\t$notes_category_param = array('note_cat_name', 'note_cat_id');\r\n\t\treturn AppModel::grab_db_function_class()->result_to_array_for_few_fields(AppModel::grab_db_function_class()->execute_query($sql), $notes_category_param);\t\t\t\t\r\n\t}",
"function fm_get_folder_shared_by_cat($original,$catid) {\r\n\treturn get_records('fmanager_folders',\"owner = $original AND category\",$catid);\r\n\r\n}",
"function list_all_categories_for_a_given_note($note_id){\r\n\t\r\n\t\tglobal $connection;\r\n\t\t$sql = \"SELECT pahro__notes_category.note_cat_name, pahro__notes_category.note_cat_id \r\n\t\t\t\tFROM pahro__notes_category_rel \r\n\t\t\t\tLEFT JOIN pahro__notes_category ON pahro__notes_category.note_cat_id = pahro__notes_category_rel.note_cat_id \r\n\t\t\t\tWHERE pahro__notes_category_rel.note_id = \".$note_id . \" AND note_owner_section = 'CASE'\";\r\n\t\t$notes_category_param = array('note_cat_name', 'note_cat_id');\r\n\t\treturn AppModel::grab_db_function_class()->result_to_array_for_few_fields(AppModel::grab_db_function_class()->execute_query($sql), $notes_category_param);\t\t\t\t\r\n\t}",
"function read_images_trashcan($dir) {\n $path = opendir($dir);\n while (false !== ($file = readdir($path))) {\n if(($file !== \".\") and ($file !== \"..\")) {\n if(is_file($dir.\"/\".$file))\n $files[]=$file;\n else\n $dirs[]=$dir.\"/\".$file; \n }\n }\n if (!$files) {\n\t//Include Translation data\n\tinclude (\"data/settings/langpref.php\");\n\tinclude (\"data/inc/lang/en.php\");\n\tinclude (\"data/inc/lang/$langpref\");\n\techo \"<span class=\\\"kop4\\\">$lang_albums14</span>\"; }\n if($files) {\n natcasesort($files);\n foreach ($files as $file) {\n //Include Translation data\n\t\t\t\tinclude (\"data/settings/langpref.php\");\n\t\t\t\tinclude (\"data/inc/lang/en.php\");\n\t\t\t\tinclude (\"data/inc/lang/$langpref\");\necho \"<div class=\\\"menudiv\\\" style=\\\"margin: 20px;\\\">\n<table>\n\t<tr>\n\t\t<td>\n\t\t\t<img src=\\\"data/image/image.png\\\" border=\\\"0\\\" alt=\\\"\\\">\n\t\t</td>\n\t\t<td style=\\\"width: 350px;\\\">\n\t\t\t<span style=\\\"font-size: 17pt;\\\">$file</span>\n\t\t</td>\n\t\t<td>\n\t\t<a href=\\\"data/trash/images/$file\\\" target=\\\"_blank\\\"><img src=\\\"data/image/view.png\\\" border=\\\"0\\\" alt=\\\"$lang_trash7\\\" title=\\\"$lang_trash7\\\"></a>\t\t\n\t\t</td>\n\t\t<td>\n\t\t<a href=\\\"?trash_restoreitem=$file&cat=image\\\"><img src=\\\"data/image/restore.png\\\" border=\\\"0\\\" title=\\\"$lang_trash10\\\" alt=\\\"$lang_trash10\\\"></a>\t\t\n\t\t</td>\n\t\t<td>\n\t\t<a href=\\\"?trash_deleteitem=$file&cat=image\\\"><img src=\\\"data/image/delete_from_trash.png\\\" border=\\\"0\\\" title=\\\"$lang_trash8\\\" alt=\\\"$lang_trash8\\\"></a>\t\t\n\t\t</td>\n\t</tr>\n</table>\n</div>\"; }\n }\n closedir($path);\n}",
"function obtenerElementos($ruta){\n chdir($ruta);\n $elementos = shell_exec(\"ls -l\");\n return $elementos;\n}",
"function leer_archivos_y_directorios($ruta) {\n\t\t$directorio = opendir($ruta);\n\t\t//ruta actual\n\n\t\twhile ($archivo = readdir($directorio))//obtenemos un archivo y luego otro sucesivamente\n\t\t{\n\t\t\tif (is_dir($archivo))//verificamos si es o no un directorio\n\t\t\t{\n\t\t\t\techo \"[\" . $archivo . \"]<br />\";\n\t\t\t\t//de ser un directorio lo envolvemos entre corchetes\n\t\t\t} else {\n\t\t\t\techo $archivo . \"<br />\";\n\t\t\t}\n\t\t}\n\t}",
"function lee_archivos($directorio,$filtro)\n{\n $archs=array();\n $midir=opendir($directorio);\n $i=0;\n $filtro = substr($filtro, 0, strlen($filtro) - strlen(strrchr($filtro,\".\")));//Obtengo el nombre del archivo del filtro\n while($archivo=readdir($midir))\n {\n\t $ext=strrchr($archivo,\".\");//Obtengo la extension del archivo\n\t $nom=substr($archivo, 0, strlen($archivo) - strlen(strrchr($archivo,\".\")));//Obtengo el nombre sin la extension del archivo\n\t //echo($ext . \" - \" . $archivo . \" - \" . $nom . \" - \" . substr_count($nom, $filtro) . \"<br>\");\n\t if (!is_dir($archivo) && (substr_count($nom, $filtro) > 0 || !$filtro))\n\t\t$archs[$i++]=$archivo;\n }\n return $archs;\n}",
"public function fetch_all_folder_files()\n {\n $entries = scandir(public_path());\n\n $root = public_path();\n \n foreach (File::allFiles($root) as $file) {\n $data[] = $file->getFilename();\n }\n echo \"<pre>\"; print_r($data);die;\n \n }",
"function opendir ($path, $context = null) {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Plugin Name: Plugin AJAX Plugin URI: description: A custom plugin to demonstrate call and handle AJAX request Version: 1.0.0 Author: Yogesh Singh Author URI: Add menu | function pluginajax_menu() {
add_menu_page("Plugin AJAX", "Plugin AJAX","manage_options", "myplugin", "employeeList",plugins_url('/pluginajax/img/icon.png'));
} | [
"function wp_ajax_install_plugin()\n {\n }",
"function wp_ajax_update_plugin() {}",
"function wp_ajax_update_plugin()\n {\n }",
"function wp_ajax_update_plugin()\n{\n}",
"function HD_program_ajax(){\n\trequire_once(HD_PLUGIN_DIR.'/program/ajax.program.php');\n\t$function = 'HD_program_ajax_'.$_POST['handle'];\n\t$function();\n}",
"private function action(){\n\t\t\tadd_action('admin_menu', array($this,'add_menu'));\n\t\t\t//add_action('admin_init', array($this,'display_component'));\n\t\t\tadd_action('admin_enqueue_scripts', array($this,'__enqueue'));\n\t\t\tadd_action('wp_ajax_'. $this->args['option_name'] .'_save_update', array( $this, 'save_update') );\n\t\t}",
"public function addPluginAction() {\n $this->view->disable();\n $plugin_name = $this->request->getPost(\"plugin_name\");\n $menu_name = $this->request->getPost(\"exibition_name\");\n $menu_icon = $this->request->getPost(\"icon\");\n $menu_url = $this->request->getPost(\"url\");\n $menu_level_permission = $this->request->getPost(\"level_permission\");\n $menu_active = $this->request->getPost(\"menu_active\") == 'on' ? true : false;\n\n $id_menu = Menu::createMenu($menu_icon, $menu_name, $menu_url, $menu_level_permission, $menu_active);\n\n Plugin::createPlugin($id_menu, $plugin_name);\n $success = true;\n if (!empty($this->request->getPost(\"submenu1_name\"))) {\n $submenu_name = $this->request->getPost(\"submenu1_name\");\n $submenu_url = $this->request->getPost(\"submenu1_url\");\n $submenu_icon = $this->request->getPost(\"submenu1_icon\");\n $success = Submenu::createSubmenu($id_menu, $submenu_icon, $submenu_name, $submenu_url, 1);\n }\n\n if (!empty($this->request->getPost(\"submenu2_name\")) && $success) {\n $submenu_name = $this->request->getPost(\"submenu2_name\");\n $submenu_url = $this->request->getPost(\"submenu2_url\");\n $submenu_icon = $this->request->getPost(\"submenu2_icon\");\n $success = Submenu::createSubmenu($id_menu, $submenu_icon, $submenu_name, $submenu_url, 2);\n }\n if ($id_menu != 0 && $success) {\n $data['success'] = true;\n }\n else {\n $data['success'] = false;\n }\n\n echo json_encode($data);\n }",
"function wp_ajax_edit_theme_plugin_file()\n {\n }",
"function wp_ajax_edit_theme_plugin_file()\n{\n}",
"public function register_ajax_hooks();",
"function mvc_admin_menu() {\n\t\t\n\t\tadd_menu_page( 'MVC Plugin', 'MVC Plugin', 'manage_options', 'mvc-plugin', array($this, 'mvc_plugin_render'), 'dashicons-backup', 90 );\t\t\n\t}",
"function wp_ajax_add_menu_item()\n {\n }",
"public function admin_menu() {\n\t\tadd_submenu_page( 'tools.php', 'AJAXEndpoint', 'AJAXEndpoint', 'manage_options', 'ajaxendpoint', array( $this, 'admin_page' ) );\n\t}",
"function wp_ajax_update_welcome_panel()\n {\n }",
"function wp_ajax_menu_get_metabox()\n{\n}",
"function wp_ajax_update_welcome_panel() {}",
"function saplugin_custom_menu_template_callback(){\n\n ?>\n <h1>ok this is template</h1>\n\n<?php\n\n}",
"public function send_plugin_data ( ) {\n\n\n $sensei_data = array( 'plugin'=>'Sensei', 'version' => Sensei()->version );\n\n // call the wordpress function that returns the data with a success header\n\t wp_send_json_success( $sensei_data );\n\n }",
"function topbar_plugin_page() {\r\n $page_title = 'Top Bar Options';\r\n $menu_title = 'Top Bar' ;\r\n $capabiliy = 'manage_options';\r\n $slug = 'topbar-plugin';\r\n $callback = 'topbar_page_html';\r\n $icon = 'dashicons-schedule';\r\n $position = 60;\r\n\r\n add_menu_page($page_title, $menu_title, $capabiliy, $slug, $callback, $icon, $position);\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter notes by pages. | function filterByPage(Page $page){
$ticket = $page->ticket->ticket;
$ticket_id = $page->ticket->id;
$ticket_details = Ticket::where('ticket', '=', $ticket)->get();
$pages = Page::where('ticket_id', '=', $ticket_id)->get();
$noteTypes = NoteType::all(); //releasenote or workaround
$general_notes = Note::where('ticket_id', '=', $ticket_id)
->where('page_id', '=', $page->id)
->get();
$releaseNotes = Note::where('ticket_id', '=', $ticket_id)
->where('page_id', '=', $page->id)
->where('note_type_id', '=', 1)
->where('needs_edit', '=', null)
->get();
$workArounds = Note::where('ticket_id', '=', $ticket_id)
->where('page_id', '=', $page->id)
->where('note_type_id', '=', 2)
->where('needs_edit', '=', null)
->get();
// needsEditRN & needsEditWA are for notes for QCs Needs Edit
$needsEdit = Note::where('ticket_id', '=', $ticket_id)
->where('page_id', '=', $page->id)
->where('needs_edit', '=', 1)
->get();
$needsEdit_RN = Note::where('ticket_id', '=', $ticket_id)
->where('page_id', '=', $page->id)
->where('note_type_id', '=', 1)
->where('needs_edit', '=', 1)
->get();
$needsEdit_WA = Note::where('ticket_id', '=', $ticket_id)
->where('page_id', '=', $page->id)
->where('note_type_id', '=', 2)
->where('needs_edit', '=', 1)
->get();
$developers = Note::where('ticket_id', '=', $ticket_id)
->groupBy('user_id')
->get();
$noteTypes = NoteType::all(); //releasenote or workaround
// dd($tickets);
return view('tickets.ticket-show',
[
'ticket' => $ticket,
'ticket_details' => $ticket_details,
'pages' => $pages,
'noteTypes' => $noteTypes,
'general_notes' => $general_notes,
'releaseNotes' => $releaseNotes,
'workArounds' => $workArounds,
'needsEdit' => $needsEdit,
'needsEdit_RN' => $needsEdit_RN,
'needsEdit_WA' => $needsEdit_WA,
'developers' => $developers,
]
);
} | [
"function fn_get_pages($params = array(), $items_per_page = 0, $lang_code = CART_LANGUAGE)\n{\n /**\n * Changes params for selecting pages\n *\n * @param array $params Pages search params\n * @param int $items_per_page Items per page\n * @param string $lang_code Two-letter language code (e.g. 'en', 'ru', etc.)\n */\n fn_set_hook('get_pages_pre', $params, $items_per_page, $lang_code);\n\n $view_type = 'pages';\n if (!empty($params['page_type']) && fn_is_exclusive_page_type($params['page_type'])) {\n $view_type .= '_' . $params['page_type'];\n }\n\n // Init filter\n $params = LastView::instance()->update($view_type, $params);\n\n $default_params = array(\n 'page_id' => 0,\n 'page' => 1,\n 'visible' => false,\n 'get_tree' => '',\n 'pdescr' => '',\n 'subpages' => '',\n 'match' => '',\n 'page_type' => '',\n 'items_per_page' => $items_per_page\n );\n\n if (is_array($params)) {\n $params = array_merge($default_params, $params);\n } else {\n $params = $default_params;\n }\n\n if (empty($params['pname']) && empty($params['pdescr']) && empty($params['subpages'])) {\n $params['pname'] = 'Y';\n }\n\n $fields = array(\n '?:pages.*',\n );\n\n if (!empty($params['simple'])) {\n $fields[] = '?:page_descriptions.page';\n } else {\n $fields[] = '?:page_descriptions.*';\n }\n\n // Define sort fields\n $sortings = array(\n 'position' => array(\n '?:pages.position',\n '?:page_descriptions.page',\n ),\n 'name' => '?:page_descriptions.page',\n 'timestamp' => '?:pages.timestamp',\n 'type' => '?:pages.page_type',\n 'multi_level' => array(\n '?:pages.position',\n '?:pages.parent_id',\n '?:page_descriptions.page',\n ),\n );\n\n $auth = & Tygh::$app['session']['auth'];\n\n $condition = '1';\n $join = $limit = $group_by = '';\n\n if (isset($params['q']) && fn_string_not_empty($params['q'])) {\n\n $params['q'] = trim($params['q']);\n if ($params['match'] == 'any') {\n $pieces = fn_explode(' ', $params['q']);\n $search_type = ' OR ';\n } elseif ($params['match'] == 'all') {\n $pieces = fn_explode(' ', $params['q']);\n $search_type = ' AND ';\n } else {\n $pieces = array($params['q']);\n $search_type = '';\n }\n\n $_condition = array();\n foreach ($pieces as $piece) {\n if (strlen($piece) == 0) {\n continue;\n }\n\n $tmp = array();\n if (!empty($params['pname']) && $params['pname'] == 'Y') {\n $tmp[] = db_quote(\"?:page_descriptions.page LIKE ?l\", \"%$piece%\"); // check search words\n }\n\n if ($params['pdescr'] == 'Y') {\n $tmp[] = db_quote(\"?:page_descriptions.description LIKE ?l\", \"%$piece%\");\n }\n\n if (!empty($tmp)) {\n $_condition[] = '(' . implode(' OR ', $tmp) . ')';\n }\n }\n if (!empty($_condition)) {\n $condition .= ' AND (' . implode($search_type, $_condition) . ')';\n }\n }\n\n $condition .= fn_get_company_condition('?:pages.company_id');\n\n if (isset($params['parent_id']) && $params['parent_id'] !== '') {\n $p_ids = array();\n if ($params['subpages'] == 'Y') {\n $p_ids = db_get_fields(\"SELECT a.page_id FROM ?:pages as a LEFT JOIN ?:pages as b ON b.page_id = ?i WHERE a.id_path LIKE CONCAT(b.id_path, '/%')\", $params['parent_id']);\n }\n $p_ids[] = $params['parent_id'];\n\n $condition .= db_quote(\" AND ?:pages.parent_id IN (?n)\", $p_ids);\n }\n\n if (isset($params['parent_page_id'])) {\n // set parent id, that was set in block properties\n $params['from_page_id'] = $params['parent_page_id'];\n }\n if (!empty($params['from_page_id'])) {\n $from_id_path = db_get_field(\"SELECT id_path FROM ?:pages WHERE page_id = ?i\", $params['from_page_id']);\n $condition .= db_quote(\" AND ?:pages.id_path LIKE ?l\", \"$from_id_path/%\");\n }\n\n if (!empty($params['status'])) {\n $condition .= db_quote(\" AND ?:pages.status IN (?a)\", $params['status']);\n }\n\n if (AREA === 'C' && empty($params['vendor_pages'])) {\n /** @var \\Tygh\\Storefront\\Storefront $storefront */\n $storefront = Tygh::$app['storefront'];\n $params['company_id'] = isset($params['company_id'])\n ? (array) $params['company_id']\n : [];\n\n if ($storefront->getCompanyIds()) {\n if ($params['company_id']) {\n $params['company_id'] = array_intersect($storefront->getCompanyIds(), $params['company_id']);\n } else {\n $params['company_id'] = array_merge([0], $storefront->getCompanyIds());\n }\n }\n }\n\n if (!empty($params['vendor_pages']) && empty($params['company_id'])) {\n return array(array(), $params);\n } elseif (!empty($params['company_id'])) {\n $condition .= db_quote(\" AND ?:pages.company_id IN (?n)\", $params['company_id']);\n }\n\n if (empty($params['full_search'])) {\n $types = fn_get_page_type_filter($params['page_type']);\n if ($types) {\n $condition .= db_quote(\" AND ?:pages.page_type IN (?a)\", array_keys($types));\n } else {\n $condition .= db_quote(\" AND 0\");\n }\n }\n\n if (!empty($params['visible'])) { // for pages tree: show visible branch only\n $page_ids = array();\n if (!empty($params['current_page_id'])) {\n $cur_id_path = db_get_field(\"SELECT id_path FROM ?:pages WHERE page_id = ?i\", $params['current_page_id']);\n if (!empty($cur_id_path)) {\n $page_ids = explode('/', $cur_id_path);\n }\n }\n\n if (!empty($from_id_path)) {\n $_page_ids = explode('/', $from_id_path);\n $page_ids = array_merge($page_ids, $_page_ids);\n $page_ids = array_unique($page_ids);\n }\n\n $page_ids[] = $params['page_id'];\n $condition .= db_quote(\" AND ?:pages.parent_id IN (?n)\", $page_ids);\n }\n\n if (!empty($params['period']) && $params['period'] != 'A') {\n list($params['time_from'], $params['time_to']) = fn_create_periods($params);\n $condition .= db_quote(\" AND (?:pages.timestamp >= ?i AND ?:pages.timestamp <= ?i)\", $params['time_from'], $params['time_to']);\n }\n\n if (!empty($params['item_ids'])) { // get only defined pages\n $condition .= db_quote(\" AND ?:pages.page_id IN (?n)\", explode(',', $params['item_ids']));\n }\n\n if (!empty($params['except_id']) && (empty($params['item_ids']) || !empty($params['item_ids']) && !in_array($params['except_id'], explode(',', $params['item_ids'])))) {\n $condition .= db_quote(' AND ?:pages.page_id != ?i AND ?:pages.parent_id != ?i', $params['except_id'], $params['except_id']);\n }\n\n if (AREA !== 'A') {\n $condition .= fn_get_localizations_condition('?:pages.localization', true);\n $condition .= db_quote(\n ' AND (?p)', fn_find_array_in_set($auth['usergroup_ids'], '?:pages.usergroup_ids', true)\n );\n $condition .= db_quote(\n ' AND (?p OR (?p AND ?p AND (?p OR ?p)))',\n db_quote('?:pages.use_avail_period = ?s', 'N'),\n db_quote('?:pages.use_avail_period = ?s', 'Y'),\n db_quote('?:pages.avail_from_timestamp <= ?i', TIME),\n db_quote('?:pages.avail_till_timestamp >= ?i', TIME),\n db_quote('?:pages.avail_till_timestamp = ?i', 0)\n );\n }\n\n $join = db_quote('LEFT JOIN ?:page_descriptions ON ?:pages.page_id = ?:page_descriptions.page_id AND ?:page_descriptions.lang_code = ?s', $lang_code);\n\n if (!empty($params['limit'])) {\n $limit = db_quote(\" LIMIT 0, ?i\", $params['limit']);\n }\n\n if (!empty($params['neighbours'])) {\n $parent_ids = array();\n if (!empty($params['neighbours_page_id'])) {\n $id_path = db_get_field(\"SELECT id_path FROM ?:pages WHERE page_id = ?i\", $params['neighbours_page_id']);\n $parent_ids = explode('/', $id_path);\n if (count($parent_ids) == 1) {\n array_unshift($parent_ids, 0);\n }\n $params['root_id'] = $parent_ids[0];\n } else {\n $parent_ids[] = 0;\n }\n\n $condition .= db_quote(\" AND ?:pages.parent_id IN (?n)\", array_unique($parent_ids));\n }\n\n fn_set_hook('get_pages', $params, $join, $condition, $fields, $group_by, $sortings, $lang_code);\n\n if (!empty($params['get_tree'])) {\n $params['sort_by'] = 'multi_level';\n }\n\n $sorting = db_sort($params, $sortings, 'position', 'asc');\n\n if (!empty($group_by)) {\n $group_by = ' GROUP BY ' . $group_by;\n }\n\n // Get search conditions\n if (!empty($params['get_conditions'])) {\n return array($fields, $join, $condition);\n }\n\n if (!empty($params['items_per_page'])) {\n $params['total_items'] = db_get_field(\"SELECT COUNT(DISTINCT(?:pages.page_id)) FROM ?:pages ?p WHERE ?p ?p ?p\", $join, $condition, $group_by, $sorting);\n $limit = db_paginate($params['page'], $params['items_per_page'], $params['total_items']);\n }\n\n $pages = db_get_hash_array(\"SELECT \" . implode(', ', $fields) .\" FROM ?:pages ?p WHERE ?p ?p ?p ?p\", 'page_id', $join, $condition, $group_by, $sorting, $limit);\n\n /**\n * This hook allows you to modify the pages before they are included into the page_tree structure\n *\n * @param array $params Page params\n * @param int $items_per_page Limit items per page\n * @param string $lang_code Language code\n * @param array $pages Selected pages\n * */\n fn_set_hook('get_pages_after_sql', $params, $items_per_page, $lang_code, $pages);\n\n if (!empty($params['active_page_id']) && !empty($pages[$params['active_page_id']])) {\n $pages[$params['active_page_id']]['active'] = true;\n Registry::set('runtime.active_page_ids', explode('/', $pages[$params['active_page_id']]['id_path']));\n }\n\n if (!empty($pages)) {\n foreach ($pages as $k => $v) {\n $pages[$k]['level'] = substr_count($v['id_path'], '/');\n }\n\n if (!empty($params['get_tree'])) {\n $missing_parent_pages_ids = array();\n foreach ($pages as $k => $v) {\n // collect parent pages that are missing in currently fetched pages\n if (!empty($v['parent_id']) && ((!isset($params['root_id']) && empty($pages[$v['parent_id']])) || (isset($params['root_id']) && $v['parent_id'] != $params['root_id'])) && (empty($params['from_page_id']) || $params['from_page_id'] != $v['parent_id'])) {\n foreach (explode('/', $v['id_path']) as $path_id) {\n if ($path_id != $k) {\n $missing_parent_pages_ids[$path_id] = $path_id;\n }\n }\n }\n }\n if (!empty($missing_parent_pages_ids)) {\n list($missing_parent_pages) = fn_get_pages(array(\n 'item_ids' => implode(',', array_keys($missing_parent_pages_ids)),\n 'page_type' => $params['page_type']\n ));\n\n foreach ($missing_parent_pages as $missing_page) {\n $pages[$missing_page['page_id']] = $missing_page;\n }\n unset($missing_parent_pages, $missing_parent_pages_ids);\n }\n\n // build tree structure\n $delete_keys = array();\n foreach ($pages as $k => $v) {\n if (!empty($v['parent_id']) && !empty($pages[$v['parent_id']])) {\n $pages[$v['parent_id']]['subpages'][$v['page_id']] = & $pages[$k];\n $delete_keys[] = $k;\n }\n }\n\n foreach ($delete_keys as $k) {\n unset($pages[$k]);\n }\n\n // sort pages tree\n $order_by = array();\n foreach ($sortings['multi_level'] as $sorting) {\n $sorting = explode('.', $sorting);\n $order_by[] = end($sorting);\n }\n $pages = fn_sort_tree($pages, 'subpages', $order_by, 'asc');\n } elseif (!empty($params['item_ids'])) {\n $pages = fn_sort_by_ids($pages, explode(',', $params['item_ids']), 'page_id');\n }\n\n if ($params['get_tree'] == 'plain') {\n $pages = fn_multi_level_to_plain($pages, 'subpages');\n }\n\n if (!empty($params['get_children_count'])) {\n $where_condition = !empty($params['except_id']) ? db_quote(' AND page_id != ?i', $params['except_id']) : '';\n if ($params['get_tree'] == 'plain') {\n $_page_ids = fn_array_column($pages, 'page_id');\n } else {\n $_page_ids = array_keys($pages);\n }\n $children = db_get_hash_single_array(\"SELECT parent_id, COUNT(page_id) as children FROM ?:pages WHERE parent_id IN (?n) ?p GROUP BY parent_id\", array('parent_id', 'children'), $_page_ids, $where_condition);\n\n if (!empty($children)) {\n if ($params['get_tree'] == 'plain') {\n foreach ($pages as $_id => $_p) {\n if (!empty($children[$_p['page_id']])) {\n $pages[$_id]['has_children'] = true;\n }\n }\n } else {\n foreach ($children as $k => $v) {\n $pages[$k]['has_children'] = !empty($v);\n }\n }\n }\n }\n }\n\n if (!empty($params['add_root'])) {\n array_unshift($pages, array('page_id' => '', 'page' => $params['add_root']));\n }\n\n fn_dropdown_appearance_cut_second_third_levels($pages, 'subpages', $params);\n\n fn_set_hook('post_get_pages', $pages, $params, $lang_code);\n\n LastView::instance()->processResults($view_type, $pages, $params);\n\n return array($pages, $params);\n}",
"function filter_page_set( $pages, $options, $log ) {\n\t$tags = get_multi_option($options, 'template'); \n\t\n\t$since = normalize_date(@$options['since']); \n\t$newer = normalize_date(@$options['newer']); #FIXME: doesn't work! #BROKEN! \n\t$older = normalize_date(@$options['older']); #FIXME: doesn't work! #BROKEN! \n\t$larger = normalize_size(@$options['larger']); \n\t$smaller = normalize_size(@$options['smaller']);\n\n\t$ns = @$options['ns']; #FIXME: validate #FIXME: without #TODO: allow localized names and aliasses\n\n\tif ( $tags ) {\n\t\tforeach ( $tags as $n => $tag ) {\n\t\t\t$not = extract_not( $tag ) || @$options[\"template{$n}_not\"];\n\t\t\t$allowed_tags = explode('|', $tag); \n\t\t\t\n\t\t\tif ( $not ) {\n\t\t\t\t$pages->strip_transcluding( $allowed_tags );\n\t\t\t\t$log->log( array( \"filter\" => \"without-templates\", \"templates\" => $allowed_tags, \"items\" => $pages->size() ) );\n\t\t\t} else {\n\t\t\t\t$pages->retain_transcluding( $allowed_tags );\n\t\t\t\t$log->log( array( \"filter\" => \"templates\", \"templates\" => $allowed_tags, \"items\" => $pages->size() ) );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $larger ) {\n\t\t$pages->retain_larger( $larger );\n\t\t$log->log( array( \"filter\" => \"larger\", \"larger\" => $larger, \"items\" => $pages->size() ) );\n\t}\n\n\tif ( $smaller ) {\n\t\t$pages->retain_smaller( $smaller );\n\t\t$log->log( array( \"filter\" => \"smaller\", \"smaller\" => $smaller, \"items\" => $pages->size() ) );\n\t}\n\n\tif ( $older ) {\n\t\t$pages->retain_older( $older );\n\t\t$log->log( array( \"filter\" => \"older\", \"older\" => $older, \"items\" => $pages->size() ) );\n\t}\n\n\tif ( $newer ) {\n\t\t$pages->retain_newer( $newer );\n\t\t$log->log( array( \"filter\" => \"newer\", \"newer\" => $newer, \"items\" => $pages->size() ) );\n\t}\n\t\n\t$pages->resolve_ids();\n\t$log->log( array( \"resolve\" => \"titles\", \"items\" => $pages->size() ) );\n\n\t#TODO: don't filter if the list of requested namespaces is the same as the list in the meta-var gpfeeder-namespaces.\n\tif ( $ns !== null && $ns !== \"\" ) {\n\t\t$ns = explode('|', $ns);\n\t\t\n\t\t$pages->retain_namespace( $ns );\n\t\t$log->log( array( \"filter\" => \"namespace\", \"ns\" => $ns, \"items\" => $pages->size() ) );\n\t}\n\n\tif ( $since ) {\n\t\t$pages->retain_modified_since( $since );\n\t\t$log->log( array( \"filter\" => \"since\", \"since\" => $since, \"items\" => $pages->size() ) );\n\t}\n\n\t#TODO: orphans, deadends\n}",
"public function getPages();",
"public function addInCmsPageFilter()\n {\n return $this->getSelect()->where('main_table.in_cms_page = 1');\n }",
"private function filter(): void {\n $trigger = Trigger::current();\n $trigger->filter($this, \"filter_page\");\n\n $this->title_unfiltered = $this->title;\n $this->body_unfiltered = $this->body;\n\n $trigger->filter($this->title, array(\"markup_page_title\", \"markup_title\"), $this);\n $trigger->filter($this->body, array(\"markup_page_text\", \"markup_text\"), $this);\n }",
"public function filterPageAdminPages() {\n\t\t\n\t\t$sLangCode = '';\n\t\t\n\t\tif ( $iPostId = $_REQUEST[ 'post' ] ) {\n\t\t\t\n\t\t\t$oObj = Geko_Wp_Language_Member::getOne( array( 'obj_id' => $iPostId, 'type' => 'post' ), FALSE );\n\t\t\tif ( $oObj->isValid() ) $sLangCode = $oObj->getLangCode();\n\t\t\t\n\t\t} elseif ( $iLangId = $_REQUEST[ 'post_lang_id' ] ) {\n\t\t\t\n\t\t\t$sLangCode = $this->getLanguage( $iLangId )->getSlug();\n\t\t}\n\t\t\n\t\tif ( $sLangCode ) $this->_sFilterLangCode = $sLangCode;\n\t\t\n\t\tadd_filter( 'get_pages', array( $this, 'pageFilterQuery' ), 10, 2 );\n\t}",
"private static function filterPages($pages) {\n\t\t\t// remove specific predefined pages (WebAPI...)\n\t\t\tforeach($pages as $page) {\n\t\t\t\t// for each page that shall be ignored\n\t\t\t\tforeach(Registry::get('missingPagesExceptions') as $line) {\n\t\t\t\t\t// remove\n\t\t\t\t\t$line = trim(str_replace(chr(65279), '', $line));\n\t\t\t\t\t// exclude several pages with one entry in the missingExceptions.txt\n\t\t\t\t\t// \"WebAPI\" exlcudes WebAPI/GetBadges, WebAPI/GetHeroes etc.\n\t\t\t\t\tif (startsWith($page, trim($line))) {\n\t\t\t\t\t\t// remove the entry from the input array\n\t\t\t\t\t\tif(($key = array_search($page, $pages)) !== false) {\n\t\t\t\t\t\t\tunset($pages[$key]);\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// remove disambiguation pages since they often make no sense on translated pages\n\t\t\tforeach($pages as $page) {\n\t\t\t\tforeach(Registry::get('disambiguations') as $line) {\n\t\t\t\t\tif ($page == trim($line)) {\n\t\t\t\t\t\tif(($key = array_search($page, $pages)) !== false) {\n\t\t\t\t\t\t\tunset($pages[$key]);\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\treturn $pages;\n\t\t}",
"public function addPageFilter($page) {\n\t\t $this->getSelect()->where('FIND_IN_SET('.$page.',main_table.page_id)');\n return $this;\n }",
"private function getPages()\n\t{\n\t\tself::$pages = $this->getAllTree(array('id', 'url', 'path', 'publish'));\n\t}",
"function setPageFilters() {\n\n\t\t// load the ts part\n\t\t$pageFilters = $this->conf['pageFilters.'];\n\n\t\t// check if there is a filters defined for the current page\n\t\tif ($pageFilters[$GLOBALS['TSFE']->id . '.']) {\n\n\t\t\t// process each filter\n\t\t\tforeach ($pageFilters[$GLOBALS['TSFE']->id . '.'] as $filter => $value) {\n\t\t\t\t$this->filters[$filter][] = $value;\n\t\t\t}\n\t\t}\n\t}",
"public function paginateFilters();",
"public function removePages() {}",
"function page_rotation_get_all_pages() {\n\t//empty array to store pages\n\t$filtered_pages = array();\n\t$IDs= get_all_page_ids();\n\n\tforeach ($IDs as $id) {\n\t\t$category = get_the_category($id);\n\t\tif($category)\n\t\t\t$category = $category[0]->name;\n\t\t$status = get_post_status($id);\n\t\t//Check if page is not a start of a sequence or trashed\n\t\tif($category != 'Sekvencie' && $status != 'trash'\n\t\t && $status != 'draft' && $status != 'auto-draft' && $category != \"Obrazovky\")\n\t\t\tarray_unshift($filtered_pages,$id);\n\t}\n\n\treturn $filtered_pages;\n}",
"public function getAllPages()\n {\n $this->app->db->connect();\n $sql = <<<EOD\nSELECT\n*,\nCASE\nWHEN (deleted <= NOW()) THEN \"isDeleted\"\nWHEN (published <= NOW()) THEN \"isPublished\"\nELSE \"notPublished\"\nEND AS status\nFROM content\nWHERE type=?\n;\nEOD;\n $res = $this->app->db->executeFetchAll($sql, [\"page\"]);\n return $res;\n }",
"function filter_page_list_item() {\n\t\tif ( $this->check_user() )\n\t\t\treturn array();\n\t\t// Show Private Pages\n\t\tif ( $this->options->capa_protect_show_private_pages ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$current_role = implode( '', $this->user->roles );\n\t\tif ( $this->user->id == 0 ) {\n\t\t\t$user_access_page_check = $this->options->capa_protect_pag_anonymous;\n\t\t}\n\t\telse{\n\t\t\t$user_access_page_check = get_option(\"capa_protect_pag_user_\".$this->user->id);\n\t\t}\n\n\t\tif ( empty( $user_access_page_check ) ) {\n\t\t\t$user_access_page_check = (\n\t\t\t\t$current_role ?\n\t\t\t\tget_option( \"capa_protect_pag_role_{$current_role}\" ) :\n\t\t\t\t$this->options->capa_protect_pag_default\n\t\t\t);\n\t\t}\n\n\t\t// If the DB contains no data all pages will be excluded\n\t\t$excludes_page = get_all_page_ids();\n\t\tif ( is_array( $user_access_page_check ) ) {\n\t\t\t$tmp['all_pages'] = $excludes_page;\n\t\t\tforeach ( $user_access_page_check as $check => $id ) {\n\t\t\t\t$tmp_id = array_search( $check, $tmp['all_pages'] );\n\t\t\t\tif ( false !== $tmp_id ) {\n\t\t\t\t\tunset( $tmp['all_pages'][$tmp_id] );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$tmp['all_pages'] = array_flip( $tmp['all_pages'] );\n\t\t\t$excludes_page = array_keys( $tmp['all_pages'] );\n\t\t}\n\t\treturn $excludes_page;\n\t}",
"public function getList($page);",
"public function return_only_pages(){\n\t\treturn $this->pages_array();\n\t}",
"public function pagedSearch($data,$page);",
"public function fetchAllPages()\n {\n $results = $this->fetchAllAsArray(\n array(\n 'where' => array(\n 'content_type = ?' => array(2)\n ),\n 'order' => array (\n 'id DESC'\n ),\n 'eager' => array(\n 'comments' => array(\n 'eager' => array(\n 'commentinfo'\n )\n ),\n 'tags',\n 'postinfo',\n 'users',\n ),\n )\n );\n Foresmo::dateFilter($results);\n Foresmo::sanitize($results);\n return $results;\n }"
] | {
"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.