query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
setter: Specifies the number of iterations of the animation function.
public function setRepeatCount($repeatCount) { $this->attributes['repeatCount'] = $repeatCount; $this->repeatCount = $repeatCount; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function iterations($count)\n {\n $this->iterations = (int) $count;\n return $this;\n }", "private function setIteration ()\n {\n ++$this->iterations;\n if ( $this->iterations % 100 == 0 ) {\n echo \"processed event queues since : \" . $this->startTime . \" value : \" . $this->iterations . PHP_EOL;\n }\n }", "public function setAnimatedSteps($value) {\r\n $this->animatedSteps = $value;\r\n }", "public function setAnimated($value) {\r\n $this->animated = $value;\r\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function makeIteration(int $iteration) : void;", "public function animation($value)\n {\n return $this->setProperty('animation', $value);\n }", "public function setIncrementing($value);", "public function setRepeat($value) {\n $this->repeat= $value;\n }", "public function setJumpTimes($value)\n {\n return $this->set(self::_JUMP_TIMES, $value);\n }", "protected function setCount($count) {\r\n $this->count = $count;\r\n }", "public function setTimes($value)\n {\n return $this->set(self::_TIMES, $value);\n }", "public function setAnimation($param){\n $this->_config_mapper(array('showAnim' => $param)); \n }", "public function setNumber(/*int*/ $value) /*: this*/ {\n $this->number = $value;\n return $this;\n }", "public function setCount(int $count): void\n {\n $this->count = $count;\n }", "function set_num_items($num){\n $this -> num_of_items = $num;\n }", "public function set_step( $step ) {\r\n\t\t$this->step = absint( $step );\r\n\t}", "public function setCount(int $count)\n {\n $this->count = $count;\n }", "private function _setCount($count)\n\t{\n\t\t$this->_count = $count;\n\t}", "function MyMod_Paging_NPages_Set()\n {\n if ($this->NumberOfItems>$this->NItemsPerPage)\n {\n $this->MyMod_Paging_N=intval($this->NumberOfItems/$this->NItemsPerPage);\n $res=$this->NumberOfItems % $this->NItemsPerPage;\n if ($res>0) { $this->MyMod_Paging_N++; }\n }\n elseif ($this->NumberOfItems>0)\n {\n $this->MyMod_Paging_N=1;\n }\n else\n {\n $this->MyMod_Paging_N=0;\n }\n }", "public function setAdvance($number);", "function increase($num): void {\n $num +=2;\n}", "public function setMiterLimit($miterLimit = 10) {}", "public function setRepeat()\n {\n $this->repeat = true;\n }", "public function setFactor($f)\n\t{\n\t\t$this->factor = (int) $f;\n\n\t\treturn $this;\n\t}", "public function setCount(int $count) : self\n {\n $this->count = $count;\n return $this;\n }", "public function setStep(int $value): CustomField\n {\n $this->step = $value;\n\n return $this;\n }", "function getNumberOfIterations();", "public function setMiterLimit($miterLimit) {}", "public function setCount($count)\n {\n $this->count = $count;\n }", "public function setCount($count)\n {\n $this->count = $count;\n }", "public function setIncrement(int $increment): self\n {\n $this->increment = $increment;\n\n return $this;\n }", "public function setCount($iCount)\n\t{\n\t\t$this->aParameters['count'] = $iCount;\n\t}", "public function setStart(int $i): self\n {\n $this->start = $i;\n\n return $this;\n }", "public function setTimeout(int $value): void {}", "public function setOptions(Array $options)\n {\n parent::setOptions($options);\n\n $options = array_change_key_case($options, CASE_LOWER);\n foreach ($options as $key => $value) {\n switch ($key) {\n case 'iterationcountlog2':\n $value = (int) $value;\n $value = bcpow(2, $value, 0);\n // Fall through\n case 'iterationcount':\n $value = (float) $value;\n if (!ctype_digit((string) $value) || $value < $this->_iterationCountMin || $value > $this->_iterationCountMax) {\n throw new InvalidArgumentException(\"Iteration count must be an integer between {$this->_iterationCountMin} and {$this->_iterationCountMax}\");\n }\n $this->_iterationCount = $value;\n break;\n default:\n break;\n }\n }\n\n return $this;\n }", "public function setCount(int $value): Get\n {\n $this->count = $value;\n return $this;\n }", "public function speed(int $value)\n {\n $this->groups->last()->updateLastMessage(['speed' => $value]);\n\n return $this;\n }", "public function setExpires($i)\n\t{\n\t\tif (is_null($i))\n\t\t\t$this->expires = null;\n\t\telseif (is_numeric($i))\n\t\t\t$this->expires = $i * 1;\n\t}", "public function setMedianImpactInMs(?int $value): void {\n $this->getBackingStore()->set('medianImpactInMs', $value);\n }", "public function setIterationMode(int $mode);", "public function setCount($value)\n {\n return $this->set('Count', $value);\n }", "public function setCount($value)\n {\n return $this->set('Count', $value);\n }", "public function setNumber($number);", "public function maxAutoRetries($value) {\n return $this->setProperty('maxAutoRetries', $value);\n }", "private function setNumberOfPages(): void\n {\n $this->number_of_pages = (int)ceil($this->number_of_records / $this->per_page);\n }", "public function setIncrement($value)\n {\n $this->set('Increment', max(1, (int) $value));\n return $this;\n }", "public function setSimultaneousLimit($count)\n {\n if (!is_int($count) || $count < 2) {\n throw new \\InvalidArgumentException(\"setSimultaneousLimit count must be an int >= 2\");\n }\n $this->simultaneousLimit = $count;\n return $this;\n }", "public function number($value): self\n {\n $this->number = $value;\n \n return $this;\n }", "public function set(int $value): void {}", "function setNum($num)\n {\n $this->num = $num;\n }", "public function setSequenceValue() { $args = func_get_args(); return $this->__call(__FUNCTION__, $args); }", "public function setNumber(?int $number): self\n {\n $this->initialized['number'] = true;\n $this->number = $number;\n\n return $this;\n }", "public function setNumber(int $number) : self\n {\n $this->initialized['number'] = true;\n $this->number = $number;\n return $this;\n }", "function __construct($k)\n {\n $this->count = $k + 1;\n }", "public function _set($number)\n {\n }", "public function setCount($count)\n {\n $this->count = $count;\n return $this;\n }", "public function setResetTimes($value)\n {\n return $this->set(self::_RESET_TIMES, $value);\n }", "public function setResetTimes($value)\n {\n return $this->set(self::_RESET_TIMES, $value);\n }", "public function slowBlink()\n {\n $this->label.= '5;';\n return $this;\n }", "public function setNumber(?int $number)\n {\n $this->number = $number;\n\n return $this;\n }", "public function animate() : Bootstrap4ProgressBarMultiple\n {\n $this->animate = true;\n\n return $this;\n }", "public function setAttemptsCount($val)\n {\n $this->_propDict[\"attemptsCount\"] = intval($val);\n return $this;\n }", "public function setNumerator($value): TURational\n\t{\n\t\t$value = min(max(0, $value), TBitHelper::PHP_INT32_UMAX);\n\t\tif (PHP_INT_SIZE > 4 || $value <= PHP_INT_MAX) {\n\t\t\t$this->_numerator = (int) $value;\n\t\t} else {\n\t\t\t$this->_numerator = (float) $value;\n\t\t}\n\t\treturn $this;\n\t}", "public function setIncrement($value) {\r\n\r\n /** @todo RAISING EXCEPTIONS HERE FORCES DECLARING \"THROW\" EVERYWHERE! */\r\n// if ($value < 0) {\r\n// throw new TeeChartException(Language.getString(\"AxisIncrementNeg\"));\r\n// }\r\n\r\n //if (isDateTime()) System.Convert.ToDateTime($value).ToString();\r\n $this->desiredIncrement = $this->setDoubleProperty($this->desiredIncrement, $value);\r\n }", "public function setCount($count)\n {\n $this->Count = $count;\n return $this;\n }", "public function testTimes() {\n\t\t$function = function() {\n\t\t\tstatic $n = null;\n\t\t\tif (is_null($n)) {\n\t\t\t\t$n = 1;\n\t\t\t} else {\n\t\t\t\t++$n;\n\t\t\t}\n\t\t\treturn $n;\n\t\t};\n\t\t$result = _::times(5, $function);\n\t\t$this->assertEquals(array(1, 2, 3, 4, 5), $result);\n\t}", "public function setMaxJitter($val)\n {\n $this->_propDict[\"maxJitter\"] = $val;\n return $this;\n }", "function iteration($i){\n switch ($i) {\n case 1:\n echo \"First Iteration\";\n break;\n case 2:\n echo \"Second Iteration\";\n break;\n case 3:\n echo \"Third Iteration\";\n break;\n case 4:\n echo \"Fourth Iteration\";\n break;\n case 5:\n echo \"Fifth Iteration\";\n break;\n case 6:\n echo \"Sixth Iteration\";\n break;\n case 7:\n echo \"Seventh Iteration\";\n break;\n case 8:\n echo \"Eight Iteration\";\n break;\n case 9:\n echo \"Ninth Iteration\";\n break;\n case 10:\n echo \"Tenth Iteration\";\n break;\n case 11:\n echo \"Eleventh Iteration\";\n break;\n case 12:\n echo \"Twelth Iteration\";\n break;\n case 13:\n echo \"Thirteenth Iteration\";\n break;\n case 14:\n echo \"Fourteenth Iteration\";\n break;\n case 15:\n echo \"Fifteenth Iteration\";\n break;\n case 16:\n echo \"Sixteenth Iteration\";\n break;\n case 17:\n echo \"Seventeenth Iteration\";\n break;\n case 18:\n echo \"Eighteenth Iteration\";\n break;\n case 19:\n echo \"Ninteenth Iteration\";\n break;\n case 20:\n echo \"Twentyth Iteration\";\n break;\n case 21:\n echo \"Twenty First Iteration\";\n break;\n case 22:\n echo \"Twenty Second Iteration\";\n break;\n case 23:\n echo \"Twenty Third Iteration\";\n break;\n case 24:\n echo \"Twenty Fourth Iteration\";\n break;\n case 25:\n echo \"Twenty Fifth Iteration\";\n break;\n case 26:\n echo \"Twenty Sixth Iteration\";\n break;\n case 27:\n echo \"Twenty Seventh Iteration\";\n break;\n case 28:\n echo \"Twenty Eight Iteration\";\n break;\n case 29:\n echo \"Twenty Ninth Iteration\";\n break;\n case 30:\n echo \"thirteeth Iteration\";\n break;\n case 31:\n echo \"Thirty First Iteration\";\n break;\n case 32:\n echo \"Thirty Second Iteration\";\n break;\n case 33:\n echo \"Thirty Third Iteration\";\n break;\n case 34:\n echo \"Thirty Fourth Iteration\";\n break;\n case 35:\n echo \"Thirty Fifth Iteration\";\n break;\n case 36:\n echo \"Thirty Sixth Iteration\";\n break;\n case 37:\n echo \"Thirty Seventh Iteration\";\n break;\n case 38:\n echo \"Thirty Eight Iteration\";\n break;\n case 39:\n echo \"Thirty Ninth Iteration\";\n break;\n case 40:\n echo \"Fouthy Iteration\";\n break;\n case 41:\n echo \"Fourty First Iteration\";\n break;\n case 42:\n echo \"Fourty Second Iteration\";\n break;\n case 43:\n echo \"Fourty Third Iteration\";\n break;\n case 44:\n echo \"Fourty Fourth Iteration\";\n break;\n case 45:\n echo \"Fourty Fifth Iteration\";\n break;\n case 46:\n echo \"Fourty Sixth Iteration\";\n break;\n case 47:\n echo \"Fourty Seventh Iteration\";\n break;\n case 48:\n echo \"Fourty Eight Iteration\";\n break;\n case 49:\n echo \"Fourty Ninth Iteration\";\n break;\n case 50:\n echo \"Fifty Iteration\";\n break;\n }\n \n }", "public function delta(int $increment): IncrementOptions\n {\n $this->delta = $increment;\n return $this;\n }", "public function setTotalImpactInMs(?int $value): void {\n $this->getBackingStore()->set('totalImpactInMs', $value);\n }", "public function __construct()\n {\n\n $this->count = 10;\n }", "function setCount( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Count = $value;\n setType( $this->Count, \"integer\" );\n }", "public function limit($value)\n {\n $this->iterator = new \\LimitIterator($this->iterator,0,$value);\n return $this;\n }", "public function withFPSOperation($value)\n {\n $this->setFPSOperation($value);\n return $this;\n }", "public function setStep(int $iStep) : void\n {\n $this->iStep = $iStep;\n }", "public function repeat($repeatCount) {\r\n $this->expectation->setRepeat($repeatCount);\r\n return $this;\r\n }", "public function setIncompleteStepsCount(?int $value): void {\n $this->getBackingStore()->set('incompleteStepsCount', $value);\n }", "public function __invoke(): void\n {\n ++$this->counter;\n }", "public function next_step() {\r\n\t\t$this->step ++;\r\n\t}", "public function animation($animation)\n {\n $this->option('animation', $animation);\n\n return $this;\n }", "public function setInsightCounts($val)\n {\n $this->_propDict[\"insightCounts\"] = $val;\n return $this;\n }", "public function chunkSize($value) {\n return $this->setProperty('chunkSize', $value);\n }", "public function setMemberCount($newValue) {\r\n $this->cached_member_count = $newValue;\r\n }", "public function setSettingCount(?int $value): void {\n $this->getBackingStore()->set('settingCount', $value);\n }", "public function setCompleteStepsCount(?int $value): void {\n $this->getBackingStore()->set('completeStepsCount', $value);\n }", "public function setTimeout(?int $amount): void;", "public function setMaxSpeed($val){\n $this->maxSpeed = $val;\n return $this;\n }", "public function setStart($number)\n {\n parent::setAttr(\"start\", $number);\n }", "public static function times($number = INF, ?callable $callback = null): Base;", "public function setProgressNow(int $value)\n {\n $this->update(['progress_now' => $value]);\n }", "public function setNumber($value)\n {\n /**\n * @var static\n */\n return $this->setParameter('number', $value);\n }", "public function setItemCount($val)\n {\n $this->_propDict[\"itemCount\"] = $val;\n return $this;\n }", "public function setSeconds(int|float|string $set): self {\n\t\t$this->duration = $this->parse($set);\n\t\tif ($this->duration < 0) {\n\t\t\t$this->duration = -$this->duration;\n\t\t\t$this->invert = true;\n\t\t} else {\n\t\t\t$this->invert = false;\n\t\t}\n\t\treturn $this;\n\t}", "public function incrementRender()\n {\n ++$this->renderCount;\n }", "public function set_value($value) {\n\t\t$this->_value = $value + 0;\n\t}", "public function nth(int $step, int $offset = 0): self;", "public function setStep(int $step): NthPercentOffRule\n {\n $this->step = $step;\n return $this;\n }" ]
[ "0.61867946", "0.6022064", "0.59425414", "0.5658082", "0.5517821", "0.5517821", "0.5517821", "0.5514536", "0.5474906", "0.5411199", "0.5203021", "0.5133362", "0.50707376", "0.50293213", "0.5010768", "0.494064", "0.4931551", "0.49083954", "0.49061593", "0.48870745", "0.48852777", "0.483965", "0.48359385", "0.48347512", "0.48088193", "0.48034945", "0.4798265", "0.47839093", "0.47774613", "0.47757086", "0.47752476", "0.47615153", "0.47615153", "0.47608113", "0.4760184", "0.47039202", "0.47023803", "0.4702324", "0.4677728", "0.4675757", "0.46718028", "0.466768", "0.46451864", "0.46418938", "0.46418938", "0.46368146", "0.46173295", "0.46131277", "0.4604929", "0.46023947", "0.45967945", "0.45925695", "0.4591031", "0.45908257", "0.45847672", "0.4581231", "0.45479187", "0.4542784", "0.45285517", "0.45254055", "0.45254055", "0.45222858", "0.45219734", "0.45206183", "0.4509437", "0.4507974", "0.4502555", "0.45012963", "0.4493925", "0.44875082", "0.44858667", "0.4481933", "0.4479425", "0.44736665", "0.4469531", "0.44625315", "0.44569013", "0.4452498", "0.44511822", "0.44471303", "0.4441193", "0.44403878", "0.44397274", "0.44384423", "0.44373322", "0.4436597", "0.44360104", "0.44301277", "0.4424564", "0.44229493", "0.44157967", "0.44127783", "0.44103613", "0.44068563", "0.44059372", "0.44014254", "0.43935558", "0.43901247", "0.4386947", "0.43855482" ]
0.44256163
88
setter: Specifies the total duration for repeat.
public function setRepeatDur($repeatDur) { $this->attributes['repeatDur'] = $repeatDur; $this->repeatDur = $repeatDur; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDuration($val)\n {\n $this->_propDict[\"duration\"] = $val;\n return $this;\n }", "public function setDuration($value)\n {\n $this->duration = $value;\n }", "function setDuration( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Duration = $value;\n }", "public function duration($value)\n {\n return $this->setProperty('duration', $value);\n }", "public function setDurationAttribute($value)\n {\n $this->attributes['duration'] = $value . ':00';\n }", "public function duration($duration) {\n $this->duration = $duration;\n }", "public function setDuration(?string $value): void {\n $this->getBackingStore()->set('duration', $value);\n }", "public function setDuration($duration)\n {\n return $this->setData(self::DURATION, $duration);\n }", "public function setTotalTime($val){\n $this->totalTime = $val;\n return $this;\n }", "public function setRepeat($value) {\n $this->repeat= $value;\n }", "public function setDuration($duration)\n {\n $this->duration = $duration;\n }", "public function setDuration($duration)\n {\n $this->duration = $duration;\n }", "public function setDur($dur) {\n\t\t$this->attributes['dur'] = $dur;\n\t\t$this->dur = $dur;\n\t\treturn $this;\n\t}", "public function setDuration(int $duration): void\n {\n $this->duration = $duration;\n }", "public function setDurationTime($dur)\n {\n $this->duration = $dur / 60 / 1000 / 60;\n }", "public function setDuration($v)\n\t{\n\r\n\t\t// Since the native PHP type for this column is integer,\r\n\t\t// we will cast the input value to an int (if it is not).\r\n\t\tif ($v !== null && !is_int($v) && is_numeric($v)) {\r\n\t\t\t$v = (int) $v;\r\n\t\t}\r\n\n\t\tif ($this->duration !== $v || $v === 0) {\n\t\t\t$this->duration = $v;\n\t\t\t$this->modifiedColumns[] = MmPeer::DURATION;\n\t\t}\n\n\t}", "public function setDuration($var)\n {\n GPBUtil::checkString($var, True);\n $this->duration = $var;\n\n return $this;\n }", "public function setDuration($duration) {\n $this->duration = $duration;\n return $this;\n }", "public function getTotalDuration()\n {\n return $this->totalDuration;\n }", "public function setTotalTime($value)\n {\n return $this->set(self::TOTAL_TIME, $value);\n }", "public function setDuration(?int $duration): self\n {\n $this->duration = $duration;\n\n return $this;\n }", "public function set_due_duration_by( $value ) {\n\t\t$this->set_prop( 'due_duration_by', $value ) ;\n\t}", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration()\n {\n return $this->duration;\n }", "public function getDuration() {\n return $this->duration;\n }", "public function getDuration(): float;", "public function setDuration(Duration $duration, array $parameters = null) {\n $this->instance->add($this->calendar->createProperty('DURATION', $duration->toString(), $parameters));\n }", "public function setRepeat()\n {\n $this->repeat = true;\n }", "public function getDuration() {\n\t\treturn $this->duration;\n\t}", "public function getDuration();", "public function getDuration()\n\t{\n\t\treturn $this->duration;\n\t}", "public function get_duration();", "public function setDuration(float $duration) {\n $this->transaction->setDuration($duration);\n }", "public function duration(int $duration)\n {\n $this->options['duration'] = $duration;\n\n return $this;\n }", "function update_total_duration( $post_id ) {\n\t$post_type = get_post_type( $post_id );\n\tif ( 'recipe' === $post_type && get_field( 'total_duration', $post_id ) !== null && get_field( 'step_groups', $post_id ) ) {\n\t\t$total_duration = 0;\n\t\twhile ( the_repeater_field( 'step_groups', $post_id ) ) {\n\t\t\t$duration = get_sub_field( 'duration' );\n\t\t\tif ( $duration && is_numeric( $duration ) ) {\n\t\t\t\t$total_duration += $duration;\n\t\t\t}\n\t\t}\n\t\tupdate_field( 'total_duration', $total_duration, $post_id );\n\t}\n}", "public function getDuration(): int\n {\n return $this->duration;\n }", "public function getDuration() {}", "public function getDuration()\n\t{\n\n\t\treturn $this->duration;\n\t}", "public function deadlineDuration(?string $value): self\n {\n $this->instance->setDeadlineDuration($value);\n return $this;\n }", "public function getDur() {\n\t\treturn $this->dur;\n\t}", "public function getUnassignedDuration()\n {\n return $this->unassigned_duration;\n }", "public function getDuration() {\n $seconds = $this->getSeconds();\n $this->duration = sprintf('%s %02d:%02d:%02d', ((($seconds/86400%60) !== 0) ? ($seconds/86400%60) . 'd' : ''), ($seconds/3600%24),($seconds/60%60), $seconds%60);\n return $this->duration;\n }", "public function add(int $seconds): self {\n\t\t$this->duration = $this->duration + $seconds;\n\t\treturn $this;\n\t}", "public function getRepeatInterval()\n {\n return $this->repeatInterval;\n }", "public function setTimes($value)\n {\n return $this->set(self::_TIMES, $value);\n }", "public function get_duration() {\n if ( empty( $this->duration ) ) {\n $this->duration = $this->calculate_duration();\n }\n return $this->duration;\n }", "function setSecondsElapsed( $value )\r\n {\r\n $this->SecondsElapsed = $value;\r\n }", "public function setSeconds(int|float|string $set): self {\n\t\t$this->duration = $this->parse($set);\n\t\tif ($this->duration < 0) {\n\t\t\t$this->duration = -$this->duration;\n\t\t\t$this->invert = true;\n\t\t} else {\n\t\t\t$this->invert = false;\n\t\t}\n\t\treturn $this;\n\t}", "public function getCombinedDuration()\n {\n return $this->combinedDuration;\n }", "public function getRepeat() {\n return $this->repeat;\n }", "public function Duration(int $duration)\n {\n IPS_SetProperty($this->InstanceID, 'UpdateTimer', $duration);\n IPS_ApplyChanges($this->InstanceID);\n }", "public function getDurationTime()\n {\n return $this->duration * 60 * 60;\n }", "public function SetDuration(\n $in_max_duration, ///< An epoch time, defining the maximum duration of a meeting.\n $in_min_duration = null ///< If defined, the minimum duration of the meeting.\n ) {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $this->_max_duration = $in_max_duration;\n \n // We don't let this be less than, or equal to, the start time.\n if (((null != $in_max_duration) && (null != $in_min_duration)) && intval($in_min_duration) >= intval($in_max_duration)) {\n $in_min_duration = null;\n }\n\n $this->_min_duration = $in_min_duration;\n }", "public function setDuration(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Duration::class);\n $this->duration = $var;\n }", "public function getTravelDurationMultiple()\n {\n return isset($this->travel_duration_multiple) ? $this->travel_duration_multiple : 0.0;\n }", "public function setTtl($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Duration::class);\n $this->writeOneof(17, $var);\n\n return $this;\n }", "public function getDurationAttribute($value)\n {\n // if ($value) {\n if (array_key_exists($value, self::$duration)) {\n return self::$duration[$value];\n }\n // }\n // return self::$duration[0];\n\n }", "public function getRepeatCount()\n {\n return $this->repeatCount;\n }", "public static function createDuration();", "public function setHoldRepeat($repeat)\n {\n $this->_param['holdrepeat'] = (int)$repeat;\n return $this;\n }", "public function duration()\n\t{\n\t\t$dif = $this->runEnd->difference( $this->runStart );\n\n\t\t$minutes = (int) $dif->getMinutes( true );\n\t\t$seconds = $dif->getSeconds( true );\n\n\t\t// Since $seconds includes the minutes, calc the extra\n\t\t$seconds = $seconds - ( $minutes * 60 );\n\n\t\treturn str_pad( (string) $minutes, 2, '0', STR_PAD_LEFT ) . ':' . str_pad( (string) $seconds, 2, '0', STR_PAD_LEFT );\n\t}", "public function set($key, $value, $duration = 0): void;", "public function repeat(DurationInfo $repeat = null)\n {\n if(null === $repeat)\n {\n return $this->child('repeat');\n }\n return $this->child('repeat', $repeat);\n }", "public function testSetGetDuration()\n {\n $duration = 3.5;\n $event = (new Event())->setDuration($duration);\n $this->assertEquals($duration, $event->getDuration());\n }", "public function setBanDuration($value)\n {\n $this->banDuration = ((string) $value === '') ? null : (int) $value;\n\n return $this;\n }", "public function setUseTimes($value)\n {\n return $this->set(self::_USE_TIMES, $value);\n }", "private function set_tasktimer_totaltime($step)\n\t{\n\t\tlist($start_usec, $start_sec) = explode(\" \", $this->task->steps[$step]['timerstart']);\n\t\tlist($end_usec, $end_sec) = explode(\" \", $this->task->steps[$step]['timerend']);\n\t\t$diff_sec = intval($end_sec) - intval($start_sec);\n\t\t$diff_usec = floatval($end_usec) - floatval($start_usec);\n\t\t$totaltime = floatval($diff_sec) + $diff_usec;\n\t\t# add to step timer\n\t\t$this->task->steps[$step]['totaltime'] = $totaltime;\n\t\t# add to global timer\n\t\t$this->task->totaltime += $totaltime;\n\t}", "public function setFrameDuration($duration)\n {\n $payload = '';\n $payload .= pack('v', $duration);\n\n $this->sendRequest(self::FUNCTION_SET_FRAME_DURATION, $payload);\n }", "public function set_cache_duration($seconds = 3600)\n {\n }", "public function setTimeEnded($val)\n {\n $this->_propDict[\"timeEnded\"] = $val;\n return $this;\n }", "public function setCombinedDuration($combinedDuration)\n {\n $this->combinedDuration = $combinedDuration;\n return $this;\n }", "public function getDuration()\n {\n return $this->_getData(self::DURATION);\n }", "private function add_duration( &$data, $attributes ) {\n\t\tif ( ! empty( $attributes['hasDuration'] ) && $attributes['hasDuration'] ) {\n\t\t\t$days = empty( $attributes['days'] ) ? 0 : $attributes['days'];\n\t\t\t$hours = empty( $attributes['hours'] ) ? 0 : $attributes['hours'];\n\t\t\t$minutes = empty( $attributes['minutes'] ) ? 0 : $attributes['minutes'];\n\n\t\t\tif ( ( $days + $hours + $minutes ) > 0 ) {\n\t\t\t\t$data['totalTime'] = esc_attr( 'P' . $days . 'DT' . $hours . 'H' . $minutes . 'M' );\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getDurationAttribute()\n {\n // Did a SQL SELECT already compute this?\n if (isset($this->attributes['duration'])) {\n return (int)$this->attributes['duration'];\n }\n\n $on_duty = $this->getOriginal('on_duty');\n if ($this->off_duty) {\n return $this->off_duty->diffInSeconds($this->on_duty);\n }\n\n // Still on duty - return how many seconds have elasped so far\n return Carbon::parse(now())->diffInSeconds($this->on_duty);\n }", "function setTotalRecords($total)\n\t{\n\t\t$this->total_records = 0+$total;\n\t}", "public function getDurationAttribute($value)\n {\n return substr($value, 0, strlen($value) -3);\n }", "public function get_field_resolver_duration()\n {\n }", "public function totalTimer() {\n return \"It took \" . $this->getTime() . \" seconds to run \" . $this->getName() . \" <br>\";\n }", "protected function _setTotal($total = 0){\n\t\t$this->_total = $total;\n\t}", "public function duration(int $duration = null): int\n {\n if (is_int($duration)) {\n // verify that the duration is at least 1 second\n if ($duration < 1) {\n throw new InvalidArgumentException([\n 'data' => ['method' => 'Session::duration', 'argument' => '$duration'],\n 'translate' => false\n ]);\n }\n\n $this->prepareForWriting();\n $this->duration = $duration;\n $this->expiryTime = time() + $duration;\n $this->regenerateTokenIfNotNew();\n }\n\n return $this->duration;\n }", "public function getDurationLabel()\n {\n return $this->format_duration($this->getWorkingDuration());\n }", "public function set_autodiscovery_cache_duration($seconds = 604800)\n {\n }", "public function setActualDuration($duration, $timeUnitId)\n {\n $this->setItemValue(\n 'actual_duration',\n [\n 'duration' => (float)$duration,\n 'time_unit' => [\n 'id' => (int)$timeUnitId\n ]\n ]\n );\n }", "public function setTotalCalories($val){\n $this->totalCalories = $val;\n return $this;\n }", "public function getTotalDuration(): float\r\n\t{\r\n\t\t$time = 0;\r\n\t\tforeach ($this->data as $command) {\r\n\t\t\t$time += $command['duration'];\r\n\t\t}\r\n\r\n\t\treturn $time;\r\n\t}", "public function getDuration(): string|null;", "function getTimeDuration();", "public function setDuration(\\DateInterval $duration)\n {\n $this->duration = $duration;\n return $this;\n }", "public function setDuration(\\DateInterval $duration)\n {\n $this->duration = $duration;\n return $this;\n }", "public function setDuration(\\DateInterval $duration)\n {\n $this->duration = $duration;\n return $this;\n }", "public function getRepeatEndDate()\n {\n return $this->repeatEndDate;\n }", "public function get_duration() {\n\t\t$duration = $this->get_product_meta( 'job_listing_duration' );\n\t\treturn absint( $duration ? $duration : mylisting_get_setting( 'submission_default_duration' ) );\n\t}", "public function getAdjustDuration()\n {\n return $this->_adjustDuration;\n }" ]
[ "0.6775721", "0.6632101", "0.6462276", "0.6460787", "0.63558704", "0.6329751", "0.63183904", "0.6201786", "0.619751", "0.6121155", "0.6082243", "0.6082243", "0.5968103", "0.59459394", "0.591774", "0.58419913", "0.5802509", "0.579703", "0.5752468", "0.5705886", "0.5657899", "0.56076014", "0.55858004", "0.55858004", "0.55858004", "0.55858004", "0.55858004", "0.55858004", "0.55858004", "0.55858004", "0.55858004", "0.5567678", "0.5560716", "0.5522131", "0.55218244", "0.5513646", "0.550489", "0.54973346", "0.54965997", "0.5495706", "0.549485", "0.54840606", "0.54774415", "0.54712445", "0.54047084", "0.5400909", "0.53078", "0.525214", "0.52519727", "0.52319026", "0.5227357", "0.52190876", "0.5190344", "0.5184158", "0.5174043", "0.5165808", "0.51574093", "0.5136141", "0.51320004", "0.51053464", "0.51007515", "0.50845003", "0.5077426", "0.5068577", "0.5055724", "0.50532925", "0.5047394", "0.5030678", "0.50217676", "0.49947476", "0.49863455", "0.4984306", "0.49678546", "0.49506235", "0.49376044", "0.4935848", "0.49297693", "0.4928618", "0.49166498", "0.49077713", "0.48672944", "0.4852778", "0.48503602", "0.482628", "0.48183152", "0.47981033", "0.4789318", "0.47876868", "0.4766375", "0.47659928", "0.47510752", "0.47459248", "0.47428006", "0.47351986", "0.47348192", "0.47348192", "0.47348192", "0.47344515", "0.47200048", "0.47029823" ]
0.6272013
7
setter: What should happen when the anamation id over? Valid values: freeze|remove
public function setFill($fill) { $this->attributes['fill'] = $fill; $this->fill = $fill; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setRemoved( $value )\n {\n $this->Removed = $value;\n }", "public final function setImmutable()\n {\n $this->isImmutable = true;\n }", "public function setUnmodified()\n {\n\t$this->modified= false;\n }", "public function __set($name, $value)\n {\n // Don't allow to set attributes\n }", "public function markUnchanged();", "function zap() {\n// $this->id = null;\n }", "public function lock()\n\t{\n\t\t$this->immutable = true;\n\t}", "public function set()\n {\n\t\tif ($this->model->state())\n $this->model->set();\n }", "public function set()\n {\n if ( ! $this->value ) {\n $this->generate();\n }\n }", "public function markForDelete() {\n\t$this->_markForDelete = true;\n }", "private function setSequence(): void\n {\n $this->sequence = $this->getSequence();\n }", "public function setDeletable($value);", "abstract public function set();", "function setSyncItemsCodeEan()\n {\n }", "public function setInactive()\r\n {\r\n $this->active = false;\r\n }", "public static function setUnlocked()\n {\n self::$locked = false;\n }", "protected function onParentSet() : void\n {\n $value = $this->oFG->getData()->getValue($this->strName);\n $this->iValue = $value ? intval($value) : $this->iMin;\n }", "public function setUnique($value = TRUE);", "function setId($value){\n\t\t//echo \"setting ID to \".$value;\n\t\t$this->_id=$value;\n\t\t//echo \"ID set to \".$this->_id;\n\t\treturn $this;\n\t}", "public function identifierWorkaround()\n {\n $this->isUniqueIdentifier = $this->isUniqueIdentifer;\n }", "public function setPrimaryKey()\n {\n\tif ( $this->isFrozen()) throw new FreezeException();\n\t$this->primaryKey= true;\n }", "public function setActive() {}", "function unsetID( )\n {\n unset( $this->ID );\n }", "public function stick()\n {\n $this->sticked = 1;\n //This prevents the call of beforesave, and the setting of update_at \n $this->updateAttributes(['sticked']);\n }", "public function markUnapproved()\n {\n $this->Moderated = false;\n $this->write();\n $this->extend('afterMarkUnapproved');\n }", "public function markAsActivate() : bool\n {\n $this->is_active = 1;\n $this->paid = 1;\n //$this->grace_period_ends = new RawValue('NULL');\n $this->ends_at = null; //new rawValue('NULL');\n $this->next_due_payment = $this->ends_at;\n $this->is_cancelled = 0;\n return $this->update();\n }", "function reset() {\n\t\t$this->_UserID = 0;\n\t\treturn parent::_resetSet();\n\t}", "public function setToUpdate()\n\t{\n\t\t$this->todo = 2 ;\n\t}", "public function __wakeup() {\n $this->current = 0;\n }", "public function markMutable()\n {\n unset($_SESSION['_IMMUTABLE']);\n\n return $this;\n }", "public function setIdentity($value);", "public static function setLocked()\n {\n self::$locked = true;\n }", "public function __unset($name)\n\t{\n\t\tif(method_exists($this,$setter='set'.$name))\n\t\t\t$this->$setter(null);\n\t\telse if(method_exists($this,$jssetter='setjs'.$name))\n\t\t\t$this->$jssetter(null);\n\t\telse if(strncasecmp($name,'on',2)===0&&method_exists($this,$name))\n\t\t\t$this->_e[strtolower($name)]->clear();\n\t\telse if(strncasecmp($name,'fx',2)===0)\n\t\t\t$this->getEventHandlers($name)->remove(array($this, $name));\n\t\telse if($this->_m!==null&&$this->_m->getCount()>0&&$this->_behaviorsenabled)\n\t\t{\n\t\t\tif(isset($this->_m[$name]))\n\t\t\t\t$this->detachBehavior($name);\n\t\t\telse {\n\t\t\t\t$unset=0;\n\t\t\t\tforeach($this->_m->toArray() as $behavior)\n\t\t\t\t{\n\t\t\t\t\tif((!($behavior instanceof IBehavior)||$behavior->getEnabled())) {\n\t\t\t\t\t\tunset($behavior->$name);\n\t\t\t\t\t\t$unset++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!$unset&&method_exists($this,'get'.$name))\n\t\t\t\t\tthrow new TInvalidOperationException('component_property_readonly',get_class($this),$name);\n\t\t\t}\n\t\t} else if(method_exists($this,'get'.$name))\n\t\t\tthrow new TInvalidOperationException('component_property_readonly',get_class($this),$name);\n\t}", "public function freeze()\n {\n $this->frozen = true;\n }", "function setId($id) {\r\n\t\t// Set id and wipe data\r\n\t\t$this->_id = $id;\r\n\t}", "function set_id($id)\n\t{\n\t\t//set the id of the actual object. Nobody should do this.\n\t\treturn NOT_ALLOWED;\n\t}", "public function resetId()\n {\n\n $this->id = null;\n\n }", "public function enableFlag()\n {\n $this->state->setItem(self::SAFE_ATTRIBUTE_FLAG, true);\n }", "public function setMinDamage(){ $this->minDamage = 10; }", "public function freeze()\n {\n\t$this->freeze= true;\n }", "public function __unset($name)\n {\n // Dont' allow to unset attributes Ruts\n }", "public function setGoal()\n {\n }", "public function setPropertyBehavior() {\n $this->isInPropertyBehavior= TRUE;\n }", "public function beforeSave() {\n $this->owner->{$this->column} = Yii::$app->db->createCommand(\"SELECT UUID()\")->queryScalar();\n }", "public function setReadOnly ()\n {\n $this->resetNeedsSaving();\n $this->readOnly = true;\n }", "public function __set($name, $value)\n {\n throw new \\BadMethodCallException( 'Writing data to inaccessible properties is not allowed.' );\n }", "public function __set($name, $value)\n {\n throw new \\BadMethodCallException( 'Writing data to inaccessible properties is not allowed.' );\n }", "function beSelf(){\r\n\t\t$_SESSION['userid'] = $_SESSION['realUserId'];\r\n\t\t$_SESSION['roleid'] = $_SESSION['realRoleId'];\r\n\t\tunset( $_SESSION['realRoleId'] );\r\n\t\tunset( $_SESSION['realUserId'] );\r\n\t}", "public function setNameAndId() {}", "function setAutoAssignPermissions($value) {\n \treturn parent::setAutoAssignPermissions(serialize($value));\n }", "protected function _markNew() \n {\n DomainWatcher::addNewObject($this);\n }", "function setId($id) {\n // Set id and wipe data\n $this->_id = $id;\n //die($id);\n $this->_data = null;\n }", "function setSyncWarranty()\n {\n }", "public function remove()\n\t{\n\t\t$this->todo = 3 ;\n\t}", "public function __set($name, $value)\n {\n // if the property is not declared (automatically not public), it can be created\n if (!property_exists($this, $name)) {\n $this->$name = $value;\n } else {\n // otherwise we indicate that we must go through the setter\n trigger_error(\"You are trying to rewrite an existing protected or private attribute without going through its setter! (__set)\", E_USER_NOTICE);\n }\n }", "public function __set($name, $value)\n {\n throw new \\Foundation\\Exception\\BadMethodCallException('Writing data to inaccessible properties is not allowed.');\n }", "public function __set($name, $value)\n {\n throw new \\Foundation\\Exception\\BadMethodCallException('Writing data to inaccessible properties is not allowed.');\n }", "public function __set($name, $value)\n {\n throw new \\Foundation\\Exception\\BadMethodCallException('Writing data to inaccessible properties is not allowed.');\n }", "public function testSetNonexistentCurrentID()\n {\n $complement = $this->complement;\n\n $this->assertFalse(\n $complement::setCurrentID('Unknown')\n );\n }", "public function testDestiny2SetItemLockState()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function setActive()\n\t\t{\n\t\t\t$this->_state = 1;\n\t\t}", "public function makeEternal()\n {\n return $this->update([\n $this->model->getExpirationAttribute() => null\n ]);\n }", "public function __set($name, $value)\n\t{\n\t\tswitch($name) {\n\t\t\tcase 'APPLICANTS_FAMILY_DATA_SIBLINGS_ID':\n\t\t\t\t//if the id isn't null, you shouldn't update it!\n\t\t\t\tif( !is_null($this->APPLICANTS_FAMILY_DATA_SIBLINGS_ID) ) {\n\t\t\t\t\tthrow new Exception('Cannot update APPLICANTS_FAMILY_DATA_SIBLINGS_ID!');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t\t\n\t\t//set the attribute with the value\n\t\t$this->$name = $value;\n\t}", "public function __clone()\n {\n $this->_id = null;\n }", "function setid_exp($val)\n { $this->id_exp=$val;}", "public function setShipped()\n {\n return $this->setMarkedAs($this->getShippedValue());\n }", "public function testSetHeaterState()\n {\n }", "function setId($id)\n\t{\n\t\t// Set id and wipe data\n\t\t$this->_id\t\t= $id;\n\t\t//$this->_data\t= null;\n\t}", "public function invalidate()\n {\n $this->name = '';\n }", "public function setId($x) { $this->id = $x; }", "public function __set($name, $value)\n\t{\n\t\tswitch($name) {\n\t\t\tcase 'USER_GROUP_ID':\n\t\t\t\t//if the id isn't null, you shouldn't update it!\n\t\t\t\tif( !is_null($this->USER_GROUP_ID) ) {\n\t\t\t\t\tthrow new Exception('Cannot update USER_GROUP_ID!');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t\t\n\t\t//set the attribute with the value\n\t\t$this->$name = $value;\n\t}", "public function setAlreadySaved()\n\t\t{\n\t\t\t$this->_alreadySaved = true;\n\t\t}", "function setId($value) {\n $this->_id = intval($value);\n }", "function setid_exp($val)\n { $this->id_exp=$val;}", "function setid_exp($val)\n { $this->id_exp=$val;}", "public function setActivation(): void;", "public function setId()\n\t{\n\t}", "public function getIncrementing(){\n return false;\n }", "public function markAsUnpaid() {\n $this->status = parent::STATUS_APPROVED_BY_USER;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "public function setHidden(){\n $this->_hidden = true;\n }", "private function setPopulated() {\n $this->is_populated = true;\n }", "public function __clone()\n {\n unset($this->id);\n }", "public function setIsPersistedOnAssignmentRemoval(?bool $value): void {\n $this->getBackingStore()->set('isPersistedOnAssignmentRemoval', $value);\n }", "public function dispense()\n {\n $this->sequence = 0;\n }", "public function setDeleted(): void\n {\n $this->attributes['mode'] = 'delete';\n }", "public function setPublicIdAttribute($value)\n {\n do{\n \t $newPublicId = chr(rand(64, 90)) . chr(rand(64, 90)) . rand(10,99);\n $publicIdCount = count( $this->whereRaw(\"public_id = '{$newPublicId}'\")->get());\n }while($publicIdCount != 0);\n $this->attributes['public_id'] = $newPublicId;\n }", "function setId($id) {\r\n // Set id and wipe data\r\n $this->_id = $id;\r\n $this->_data = null;\r\n }", "function reset() {\n\t\t$this->_UserID = 0;\n\t\treturn $this->_resetSet();\n\t}", "function SetId($value) { $this->id=$value; }", "public function touch()\n {\n $this->_factory->markAsModified($this);\n }", "public function enable()\n\t{\n\t\t$this->disabled_at = null;\n\t\t$this->disabled_by_user_id = null;\n\t\t$this->save();\n\t}", "function can_be_manually_set() {\n return true;\n }", "public function markDisabled()\n {\n return $this->forceFill([\n 'disabled' => true,\n ])->save();\n }", "public function setIncrementing($value);", "function jo($entity) {\n $entity->setEntityId(($entity->getEntityId() +1));\n }", "public function isMutable()\n\t{\n\t\treturn true;\n\t}", "function makeClone()\n {\n $this->id = 0;\n }", "protected function doSet($value)\n {\n }", "public function setActive()\n {\n $this->status = AutoEvent::STATUS_ACTIVE;\n $this->save();\n }", "public function save()\n {\n // make sure there is a maximum of 1 unassigned appointment\n if( is_null( $this->assignment_id ) )\n {\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'participant_id', '=', $this->participant_id );\n $modifier->where( 'assignment_id', '=', NULL );\n if( !is_null( $this->id ) ) $modifier->where( 'id', '!=', $this->id );\n if( 0 < static::count( $modifier ) )\n throw lib::create( 'exception\\runtime',\n 'Cannot have more than one unassigned appointment per participant.', __METHOD__ );\n }\n\n parent::save();\n }", "protected function setTo() {}" ]
[ "0.57584226", "0.5703849", "0.5687998", "0.5612565", "0.5569503", "0.55649555", "0.5524297", "0.55099314", "0.5477032", "0.54534376", "0.54099303", "0.5388333", "0.53426075", "0.5335575", "0.532019", "0.5315341", "0.5297449", "0.5293921", "0.52889824", "0.5285884", "0.52839434", "0.52544373", "0.52380323", "0.5212721", "0.52044547", "0.5199156", "0.51902336", "0.5181829", "0.5163727", "0.5155802", "0.5140471", "0.5130906", "0.5118427", "0.51079303", "0.508143", "0.5063481", "0.50499654", "0.5047079", "0.50452775", "0.5034238", "0.50336623", "0.50263053", "0.50224936", "0.5003615", "0.50011754", "0.49660444", "0.49660444", "0.49631518", "0.4962599", "0.49532598", "0.49462458", "0.49456993", "0.4937743", "0.49359435", "0.49358803", "0.49344325", "0.49344325", "0.49344325", "0.49338916", "0.49321374", "0.49280387", "0.49271044", "0.49258673", "0.4921515", "0.49199393", "0.4919732", "0.4919641", "0.49189153", "0.49175924", "0.49101272", "0.49052292", "0.49042588", "0.49022862", "0.4898622", "0.4898622", "0.48969665", "0.48967308", "0.48951873", "0.4881435", "0.48707983", "0.48624912", "0.4858529", "0.48558262", "0.48497108", "0.48479643", "0.4847469", "0.48458505", "0.4838687", "0.4835475", "0.4830035", "0.48270077", "0.48255953", "0.48235008", "0.48195788", "0.48190936", "0.4814294", "0.48120704", "0.48083633", "0.48069632", "0.48056623", "0.48014733" ]
0.0
-1
setter: Specifies the interpolation mode for the animation.
public function setCalcMode($calcMode) { $this->attributes['calcMode'] = $calcMode; $this->calcMode = $calcMode; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAnimation($param){\n $this->_config_mapper(array('showAnim' => $param)); \n }", "public function setAnimated($value) {\r\n $this->animated = $value;\r\n }", "function setMode($mode){\n\t\t//Switches the operating mode of\n\t\t//'ScaleTool'.\n\n\t\tif($mode == 'fit' || $mode == 'fill')\n\t\t\t$this->mode = $mode;\n\t}", "public function disableInterpolationForOverlength($flag = false)\n {\n $this->InterpolateOverlength = $flag;\n }", "public static function getInterpolatorInstance()\n {\n if (static::$interpolator === null)\n {\n static::$interpolator = new Interpolator;\n }\n\n return static::$interpolator;\n }", "public function setIterationMode(int $mode);", "public function setBlendMode($blendMode) {}", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "function setRatio( $fRatio = 0.65 ){\n $this->fRatio = $fRatio;\n }", "public function animation($value)\n {\n return $this->setProperty('animation', $value);\n }", "public function set_orientation($mode){\n $this->orient=$mode;\n }", "private function modifyPreviewModeSettings() {\n\t\t$params = $this->slider->getParams();\n\t\t$params['js_to_body'] = 'false';\n\n\t\t$this->slider->setParams( $params );\n\t}", "public function setFitMode($fitMode) {}", "public function setRise($rise) {}", "public function isBilinear()\n\t{\n\t\treturn $this->bilinear;\n\t}", "public function setSensitivity($val)\n {\n $this->_propDict[\"sensitivity\"] = intval($val);\n return $this;\n }", "public function setBilinear($bilinear)\n\t{\n\t\t$this->bilinear = (bool) $bilinear;\n\t\t\n\t\treturn $this;\n\t}", "public function setMode($mode)\n {\n $this->options['mode'] = $mode ?? $this->options['mode'];\n return $this;\n }", "public function getRoundingMode(): ?int;", "public function setZoom($value) {\n\t}", "public function interval($value) {\n return $this->setProperty('interval', $value);\n }", "function set_mode($mode){\r\n\r\n\t\tswitch($mode){\r\n\t\t\tcase self::OUTPUT_MODE_NORMAL:\r\n\t\t\tcase self::OUTPUT_MODE_TEMPLATE:\r\n\t\t\t$this->_mode = $mode;\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tthrow new Exception(get_instance()->lang->line(\"Unknown output mode.\"));\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t}", "function setMode($value) {\r\n\t\t$this->mode = $value;\r\n\t}", "public function orientationCalculationOff()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_ORIENTATION_CALCULATION_OFF, $payload);\n }", "public function setFormat($value) {}", "public function setMode($mode)\n {\n $this->mode = $mode;\n }", "public function setMode($mode) {\n $this->mode = $mode;\n }", "public function setMode($val)\n {\n $this->_propDict[\"mode\"] = $val;\n return $this;\n }", "public function setWrapMode(int $value)\n {\n if ($value < 0 || $value > 2) {\n throw new InvalidArgumentException(\"Invalid expression modifier: $value\");\n }\n $this->wrapMode = $value;\n }", "public function setCloudZoomMode($mode)\n {\n $mode = in_array($mode, $this->getAllowedCloudZoomModes()) ? $mode : \\XLite\\View\\FormField\\Select\\CloudZoomMode::MODE_INSIDE;\n\n \\XLite\\Core\\Database::getRepo('XLite\\Model\\Config')->createOption(\n array(\n 'category' => 'Layout',\n 'name' => 'cloud_zoom_mode',\n 'value' => $mode,\n )\n );\n\n return $this;\n }", "public function setInteractive($value)\n {\n $this->interactive = $value;\n }", "function setMode($mode) {\n\t\t$this->_mode = $mode;\n\t}", "function setMode($mode) {\n\t\t$this->_mode = $mode;\n\t}", "private function setMode() {\r\n\t\t$this->mode = substr($this->mode, -1);\r\n\t}", "function setElementToConvertMode($mode) {\n if (!preg_match(\"/(?i)^(cut-out|remove-siblings|hide-siblings)$/\", $mode))\n throw new Error(create_invalid_value_message($mode, \"mode\", \"html-to-image\", \"Allowed values are cut-out, remove-siblings, hide-siblings.\", \"set_element_to_convert_mode\"), 470);\n \n $this->fields['element_to_convert_mode'] = $mode;\n return $this;\n }", "private function setBundlePricesMode(bool $mode): void\n {\n Mage::getConfig()->saveConfig(\n 'splashsync_splash_options/advanced/bundle_mode',\n $mode ? '1' : '0',\n 'default',\n 0\n );\n }", "private function setMode($mode)\n {\n $this->mode = $mode;\n }", "public function setLowFrameRateRatio($val)\n {\n $this->_propDict[\"lowFrameRateRatio\"] = $val;\n return $this;\n }", "public function updateQuality(): void\n {\n $this->getItem()->quality = $this->getNewQuality();\n\n if ($this->isQualityOverHighestValue()) {\n $this->setToHighestQuality();\n }\n if ($this->isQualityUnderLowestValue()) {\n $this->setToLowestQuality();\n }\n }", "public function setMode(?int $mode): self\n {\n $this->mode = $mode;\n\n return $this;\n }", "public function setPrice()\n {\n $price = $this->price;\n $outFix = $this->outFix;\n $outPer = $this->outPer;\n $inPer = $this->inPer;\n $inFix = $this->inFix;\n $flag = $this->flagInOut;\n if ($price < 1) {\n $sumIn = $outFix > 0 ? 1 + $outFix : 1; //outFix\n $sumIn = $outPer > 0 ? $sumIn + ($sumIn * $outPer / 100) : $sumIn; //outPer\n $sumIn = $sumIn / $price; // price\n $sumIn = $inFix > 0 ? $sumIn + $inFix : $sumIn;// inFix\n $ss = $sumIn * $inPer / 100;\n $sumIn = $inPer > 0 ? $sumIn + $ss : $sumIn;\n $this->in = $this->format_amount($sumIn);\n $this->out = $flag ? 1 : 0;\n } else {\n $val = $inFix > 0 ? 1 - $inFix : 1;\n $val = $inPer > 0 ? $val - $val * ($inPer / 100) : $val;\n $sumOut = $price * $val;\n $sumOut = $outFix > 0 ? $sumOut - $outFix : $sumOut;\n $sumOut = $outPer > 0 ? $sumOut - $outPer / 100 * $sumOut : $sumOut;\n $this->out = $this->format_amount($sumOut);\n $this->in = $flag ? 1 : 0;\n }\n $this->price = (float)$price;\n }", "public function setNumerator($value): TURational\n\t{\n\t\t$value = min(max(0, $value), TBitHelper::PHP_INT32_UMAX);\n\t\tif (PHP_INT_SIZE > 4 || $value <= PHP_INT_MAX) {\n\t\t\t$this->_numerator = (int) $value;\n\t\t} else {\n\t\t\t$this->_numerator = (float) $value;\n\t\t}\n\t\treturn $this;\n\t}", "public function setIntegrationMethod($method) {\n return $this->intMethod = $method;\n }", "public function setFormat($val)\n {\n $this->_propDict[\"format\"] = $val;\n return $this;\n }", "public function setRoundingMode(int $roundingMode): CalculatorInterface;", "public function orientationCalculationOn()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_ORIENTATION_CALCULATION_ON, $payload);\n }", "function setImageOrientation()\n\t{\n\n\t\tif ($this->width < $this->height) {\n\t\t\t$this->orientation = 'portrait';\n\t\t}\n\n\t\tif ($this->width > $this->height) {\n\t\t\t$this->orientation = 'landscape';\n\t\t}\n\n\t\tif ($this->width == $this->height) {\n\t\t\t$this->orientation = 'square';\n\t\t}\n\t}", "public function sepia()\n {\n $this->addConvertOption('sepia-tone', \"85%\");\n\n return $this;\n }", "public function setMode($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\OsConfig\\V1\\PatchRollout\\Mode::class);\n $this->mode = $var;\n\n return $this;\n }", "function writeOrientation($value)\r\n {\r\n if (($this->ControlState & csDesigning) == csDesigning)\r\n {\t\t\t\t\r\n\t\t\t\r\n global $allowupdates;\r\n\r\n //This mean this property is being updated in the IDE, specifically\r\n //so we need to switch coordinates\r\n if ($allowupdates)\r\n {\r\n $this->switchDimensions();\r\n }\t\t\t\r\n\t\t\t\r\n }\r\n else\r\n {\r\n //If not, we need to check if the value has changed before switching dimensions\r\n if ($this->_orientation!=$value) $this->switchDimensions();\r\n }\r\n $this->_orientation=$value;\r\n }", "public function smooth($value=6)\n\t{\n\t\tif (!function_exists('imagefilter')) {\n\t\t\tthrow new Exception('imagefilter function is only available if PHP is compiled with the bundled version of the GD library.');\n\t\t}\n\t\t$this->checkImage();\n\t\t$value = max(-12, min($value, 12));\n\t\timagefilter($this->imageResized, IMG_FILTER_SMOOTH, $value);\n\n\t\treturn $this;\n\t}", "public function getAnimated()\r\n {\r\n return $this->animated;\r\n }", "public function animation($animation)\n {\n $this->option('animation', $animation);\n\n return $this;\n }", "function interpolate($pBegin, $pEnd, $pStep, $pMax) \n{\n\tif ($pBegin < $pEnd) \n\t{\n \t\treturn (($pEnd - $pBegin) * ($pStep / $pMax)) + $pBegin;\n\t} \n\telse \n\t{\n \t\treturn (($pBegin - $pEnd) * (1 - ($pStep / $pMax))) + $pEnd;\n\t}\n}", "public function setIllumination($value) {\n $this->illuminate = $value;\n }", "public function setRepeat()\n {\n $this->repeat = true;\n }", "public function setAnimatedSteps($value) {\r\n $this->animatedSteps = $value;\r\n }", "public function setScaling($scaleing) {}", "public function setMode($mode)\n {\n $this->mode = $mode;\n return $this;\n }", "function GetAnimation() {\n return ($this->GIF);\n }", "public function setMode(string $mode)\n {\n $this->mode = $mode;\n return $this;\n }", "public function setLandscape($value) {\n\t}", "function setWritingMode($writingMode) {\n\t\tswitch ($writingMode) {\n\t\t\tcase StyleConstants::LR_TB:\n\t\t\t\t$writingMode = 'lr-tb';break;\n\t\t\tcase StyleConstants::RL_TB:\n\t\t\t\t$writingMode = 'rl-tb';break;\n\t\t\tcase StyleConstants::TB_RL:\n\t\t\t\t$writingMode = 'tb-rl';break;\n\t\t\tcase StyleConstants::TB_LR:\n\t\t\t\t$writingMode = 'tb-lr';break;\n\t\t\tcase StyleConstants::RL:\n\t\t\t\t$writingMode = 'rl';break;\n\t\t\tcase StyleConstants::TB:\n\t\t\t\t$writingMode = 'tb';break;\n\t\t\tcase StyleConstants::PAGE:\n\t\t\t\t$writingMode = 'page';break;\n\t\t\tdefault:\n\t\t\t\tthrow new StyleException('Invalid writing-mode value');\n\t\t}\n\t\t$this->tableProp->setAttribute('style:writing-mode', $writingMode);\n\t}", "function setRawLogMode($value)\n {\n $this->_props['RawLogMode'] = $value;\n }", "public function SetMode($mode)\n\t{\n\t\t$this->mode = $mode;\n\t}", "public function setEffect( $effect ) {\n $this->effect = $effect;\n }", "public function setIncrementing($value);", "public function scaleX($by) {}", "public function setMode($mode = self::MODE_SINGLE) {\n $this->mode = $mode;\n\n return $this;\n }", "public function setIntensity($intensity) {}", "function setSlider($slider=7){\n\t\t\t$this->slider = $slider;\n\t\t}", "public function setPropertyBehavior() {\n $this->isInPropertyBehavior= TRUE;\n }", "public function initialAspectRatio()\n {\n return $this->setRightOperand(PVar::INITIAL_ASPECT_RATIO);\n }", "public function setFormat( $format ) {\n\t\t\t$this->_format = $format;\n\t\t\t$this->_data['format'] = $this->_format;\n\t\t}", "public function getSmoothingFactor()\n {\n return $this->smoothingFactor;\n }", "public function setMode($mode)\n {\n if (in_array($mode, $this->modeList)) {\n $this->mode = $mode;\n }\n\n return $this;\n }", "public function setQuality($value) {\n\t\t$this->_quality = $value;\n\t}", "public function saveMode(string $mode)\n {\n //Change config options\n $this->configWriter->saveConfig(self::XML_PATH_PRICE_DIMENSIONS_MODE, $mode);\n $this->cacheTypeList->cleanType('config');\n $this->indexer->load(\\Magento\\Catalog\\Model\\Indexer\\Product\\Price\\Processor::INDEXER_ID);\n $this->indexer->invalidate();\n }", "public function setSetNumberFormat($setNumberFormat)\n {\n $this->setNumberFormat = (bool) $setNumberFormat;\n\n return $this;\n }", "public function setMode(string $mode): self\n {\n //dd($mode);\n if ($this->isValidMode($mode)) {\n $this->mode = $mode;\n } else {\n throw new \\Exception('Can\\'t set \"' . $mode . '\" as current mode, due to \"' . $mode . '\" is not a ' . static::class . ' valid mode. You must implement \"'.Str::camel($mode).static::MODES_METHODS_NAME_SUFFIX.'()\" at ' . static::class .' in order to use that mode');\n }\n return $this;\n }", "public function setScaling($scaling = 100) {}", "public function setCompression($mode) { \n switch($mode) {\n case \"gzip\":\n $this->compression = \"gz\";\n break;\n case \"bzip2\":\n $this->compression = \"bz2\";\n break;\n case \"none\":\n $this->compression = null;\n break;\n default:\n $this->log(\"Ignoring unknown compression mode: \".$mode, Project::MSG_WARN);\n $this->compression = null;\n }\n }", "public function setExposureNumerator(?float $value): void {\n $this->getBackingStore()->set('exposureNumerator', $value);\n }", "function setThumbQuality( $iThumbQuality = 80 ){\n $this->iQuality = $iThumbQuality;\n }", "public function setFixed() {\n }", "public function setFormat($format) { $this->_format = $format; }", "public function setRate(?float $rate): self\n {\n $this->initialized['rate'] = true;\n $this->rate = $rate;\n\n return $this;\n }", "public function setSeconds(int|float|string $set): self {\n\t\t$this->duration = $this->parse($set);\n\t\tif ($this->duration < 0) {\n\t\t\t$this->duration = -$this->duration;\n\t\t\t$this->invert = true;\n\t\t} else {\n\t\t\t$this->invert = false;\n\t\t}\n\t\treturn $this;\n\t}", "public static function PER_TITLE_TEMPLATE_FIXED_RESOLUTION()\n {\n return new StreamMode(self::PER_TITLE_TEMPLATE_FIXED_RESOLUTION);\n }", "public function setFormat($format){\n\t\t$this->_format = $format;\n\t}", "public function spin()\n\t{\n\t\t$this->number = $this->generate_random_number(self::MIN_WHEEL_NUMBER, self::MAX_WHEEL_NUMBER);\n\n\t\t$this->color = $this->find_number_color($this->number);\n\t}", "public static function animatedPng()\n {\n return new FlagQualifier(self::ANIMATED_PNG);\n }", "public function setMag($mag_)\n\t{\n\t\t$s = $mag_ / $this->mag();\n\t\t$this->scale($s);\n\t}", "public function setRepeat($value) {\n $this->repeat= $value;\n }", "public function setModeForecast() {\n\t\t$this->mode = 'forecast';\n\t}", "public function setMode($value)\n {\n return $this->set('Mode', $value);\n }", "public function setMode($value)\n {\n return $this->set('Mode', $value);\n }", "function setRenderingMode($rendering_mode) {\n if (!preg_match(\"/(?i)^(default|viewport)$/\", $rendering_mode))\n throw new Error(create_invalid_value_message($rendering_mode, \"rendering_mode\", \"html-to-pdf\", \"Allowed values are default, viewport.\", \"set_rendering_mode\"), 470);\n \n $this->fields['rendering_mode'] = $rendering_mode;\n return $this;\n }", "public static function mode($mode) {\n static::$mode = $mode;\n }" ]
[ "0.49134657", "0.47050512", "0.46603566", "0.45284337", "0.43800914", "0.43393394", "0.4242004", "0.41734034", "0.41734034", "0.41734034", "0.41411075", "0.41371092", "0.4090187", "0.40384465", "0.4015786", "0.40117514", "0.40067428", "0.40048915", "0.39947", "0.39937574", "0.3973799", "0.39710212", "0.3962466", "0.39268765", "0.3919673", "0.3911542", "0.3904896", "0.39004675", "0.3896335", "0.38868618", "0.3883058", "0.38663644", "0.3862015", "0.3845843", "0.3845843", "0.38362718", "0.38230824", "0.38229224", "0.38165897", "0.3816357", "0.38151658", "0.38145766", "0.3809211", "0.3798092", "0.37916386", "0.3790452", "0.37788492", "0.3771147", "0.37387982", "0.37352818", "0.37309185", "0.3719253", "0.3717838", "0.37167606", "0.36970776", "0.36954048", "0.36849725", "0.36819726", "0.3681449", "0.36800548", "0.36712378", "0.36707357", "0.36701244", "0.36690044", "0.36664504", "0.36643913", "0.36603522", "0.36553356", "0.3651338", "0.36408713", "0.36360356", "0.3634841", "0.363377", "0.3624417", "0.36089832", "0.36073798", "0.3585556", "0.35761893", "0.35756317", "0.35700455", "0.35681078", "0.3557094", "0.35530508", "0.35373533", "0.35368043", "0.3530075", "0.35269243", "0.35239273", "0.35205305", "0.35173386", "0.35111788", "0.35025612", "0.34998146", "0.3494186", "0.349377", "0.3488886", "0.3486736", "0.348251", "0.34812233", "0.34785807", "0.34777164" ]
0.0
-1
setter: A semicolonseparated list of one or more values.
public function setValues($values) { $this->attributes['values'] = $values; $this->values = $values; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setValues($values = []);", "public static function setters();", "public function setValues($values);", "public function setParts(array $values) {\n\n // add slashes to all semicolons and commas in the single values\n $values = array_map(\n function($val) {\n return strtr($val, array(',' => '\\,', ';' => '\\;'));\n }, $values);\n\n $this->setValue(\n implode($this->getDelimiter(), $values)\n );\n\n }", "public function setValues(array $values);", "public function setList($list = array())\n {\n if (!is_array($list)) {\n $list = ArrayUtils::iteratorToArray($list);\n }\n\n $this->list = $list;\n }", "public function set_values( $values = array() ) {\n\t\t\n\t\t$this->values = $values;\n\t\t\n\t}", "function setValueList($valueList) {\n if ($valueList !== ($oldValueList = $this->valueList)) {\n $this->valueList = $valueList;\n }\n }", "public function setValues($values)\n {\n $this->values = $values;\n }", "public function setArray(array $list);", "public function setValues($values) {\n $this->values = $values;\n }", "abstract public function set();", "function setInputValues( array $values );", "function setValues($list) {\n global $params;\n if (count($list)) {\n\tforeach ($list as $k=>$v) {\n\t $params[$k] = $v;\n\t}\n }\n}", "public function setMultiple($values) : bool;", "public function setValuesOption($values)\n {\n $this->values = $values;\n }", "public function setValues($values)\n {\n foreach ($this->entities as $entity) \n {\n $entity->setValues($values);\n }\n }", "public function setList($list)\n {\n if (is_string($list)) {\n htmlspecialchars($list);\n $this->_list = $list;\n }\n }", "public function setValue( array $values ) {\n\t\t\t$this->value = $values;\n\t\t}", "private function setValues($values)\n {\n //echo \"<pre>\";\n //print_r($values);\n //echo \"</pre>\";\n foreach ($values as $field => $value) {\n $this->$field = $value;\n }\n\n //echo \"<pre>\";\n //print_r($this);\n //echo \"</pre>\";\n //die();\n\n }", "public function setValues(array $values): void\n {\n $this->values = $values;\n }", "function __set($property, $value) {\n global $DB;\n if(is_array($value) && @$this->TYPE[$property] === 'CSV') $value = join(',',$value);\n if(!isset($this->DATA[$property])\n || $this->DATA[$property] !== $value) {\n $DB->config->update(array('value' => $value), array('property' => $property, 'section' => $this->NAME), true);\n $this->DATA[$property] = $value;\n }\n }", "public function assignValues($values=[]) {\n }", "public function setValue($entries) {}", "public function setValues($values){\n\t\tif(!is_array($values)) return;\n\t\t\n\t\tforeach($values as $field_name => $value){\n\t\t\tif(isset($this->Fields[$field_name])){\n\t\t\t\t$this->Fields[$field_name]->value = $value;\n\t\t\t}\n\t\t}\n\t}", "public function setValues(array $values, $caseSensitive = false)\n\t{\n\t\tif (!is_bool($caseSensitive))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Argument 2 passed to ' . __METHOD__ . ' must be a boolean');\n\t\t}\n\n\t\t// Create a regexp based on the list of allowed values\n\t\t$regexp = RegexpBuilder::fromList($values, ['delimiter' => '/']);\n\t\t$regexp = '/^' . $regexp . '$/D';\n\n\t\t// Add the case-insensitive flag if applicable\n\t\tif (!$caseSensitive)\n\t\t{\n\t\t\t$regexp .= 'i';\n\t\t}\n\n\t\t// Add the Unicode flag if the regexp isn't purely ASCII\n\t\tif (!preg_match('#^[[:ascii:]]*$#D', $regexp))\n\t\t{\n\t\t\t$regexp .= 'u';\n\t\t}\n\n\t\t// Set the regexp associated with this list of values\n\t\t$this->setRegexp($regexp);\n\t}", "public function set($params) {}", "public function setValues(?array $value): void {\n $this->getBackingStore()->set('values', $value);\n }", "public function setValues(?array $value): void {\n $this->getBackingStore()->set('values', $value);\n }", "public function update($listOfValue);", "public function setData($key, $val) {\n\t\t$this->_data[$key] = explode(\",\", $val);\n\t}", "public function setValue(array $arr){\r\n $this->_valores = $arr;\r\n }", "public function __set($name, $value) {\n\t\t\tthrow new RuntimeException('Invalid usage. Cannot set property value for set of records');\n\t\t}", "public function setUrls(?array $value): void {\n $this->getBackingStore()->set('urls', $value);\n }", "public function setValues($values = array(), $append = false) {\n\t\tif ($append) {\n\t\t\tforeach ($values as $key => $value) {\n\t\t\t\tif (isset($this->values[$key]) && is_string($this->values[$key])) {\n\t\t\t\t\t$this->values[$key] .= $value;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->values[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->values = array_merge($this->values, $values);\n\t\t}\n\t\treturn $this;\n\t}", "public function setValues(){\n if($this->getType() == \"var\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"int\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"bool\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"string\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"nil\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"label\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"type\"){\n $this->setValue($this->getArg());\n }else{\n $this->setValue(\"CHYBA\");\n }\n }", "function setValues($list) {\n global $params;\n if ( count($list )) {\n foreach ($list as $k => $v ) {\n $params[$k] = $v;\n }\n }\n}", "public function setValue($values = array())\n\t{\n\t\treturn $this->setTags($values);\n\t}", "public function setFromArray(array $data);", "public function setKinoseiShokuhinAttribute($value) {\n \t$this->attributes['kinosei_shokuhin'] = implode(',', $value);\n }", "public function setAll($values)\r\n {\r\n foreach ($values as $key => $value)\r\n $this->$key = $value;\r\n }", "public function setValues(array $values, bool $forceQuote = false): self\n {\n foreach ($values as $key => $value) {\n $this->set($key, $value, $forceQuote);\n }\n\n return $this;\n }", "public function setValues(array $values) {\n $this->data = $values;\n }", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValues($values)\n {\n foreach ($values as $field => $value)\n {\n if (isset($this->properties[$field])) {\n /** @var Property $this->$field */\n $this->$field->set($value);\n }\n }\n }", "public function setMulti($list = array()) {\n foreach($list as $array) {\n $this->set($array[0], isset($array[1]) ? $array[1] : 300, isset($array[2]) ? $array[2] : array());\n }\n }", "function setUsers($users) {\n if (is_array($users)) {\n $users = implode(',', $users);\n }\n $this->users = $users;\n }", "public function set($data);", "public function setList(array $list = null) {\n $this->list = $list;\n }", "function setValues($array){\r\n\t\tforeach($array as $key => $val){\r\n\t\t\t$key = lcfirst(str_replace(\" \",\"\",ucwords(str_replace(\"_\",\" \",$key))));\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t\t}\r\n\t}", "function setValues($array){\r\n\t\tforeach($array as $key => $val){\r\n\t\t\t$key = lcfirst(str_replace(\" \",\"\",ucwords(str_replace(\"_\",\" \",$key))));\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t\t}\r\n\t}", "abstract public function setValue($value);", "public function setAttributes($values)\n {\n if (is_array($values)) {\n foreach ($values as $name => $value) {\n $setter = 'set' . ucfirst($name);\n if (method_exists($this, $setter)) {\n // set property\n $this->$setter($value);\n }\n }\n }\n }", "function setValues($array){\r\n\t\tforeach($array as $key => $val)\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t}", "public function decodeSetOptions($list)\n {\n if (substr($list, 0, 4) == 'set(') {\n $list = substr($list, 4, -1);\n }\n $result = explode(',', $list);\n foreach ($result as &$value) {\n $value = strtr(substr($value, 1, -1), [\"''\" => \"'\", \"\\\\\\\\\" => \"\\\\\"]);\n }\n return $result;\n }", "public function setValues(array $values): void\n {\n $this->values = array_map(function ($value) {\n return ChunkRecommendationsValue::constructFromArray(['value' => $value]);\n }, $values);\n }", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setAllowedValues($values);", "public function set($name, $value){}", "public function set($value = null);", "public function setNames($names) {}", "public function setValues($val)\n {\n $this->_propDict[\"values\"] = $val;\n return $this;\n }", "public function setValue($val, $obj = null)\n {\n // we can look for it in a relation method on the object passed as a second arg\n if (!$val && $obj && $obj instanceof DataObject && $obj->hasMethod($this->name)) {\n $funcName = $this->name;\n $val = array_values($obj->$funcName()->getIDList());\n }\n\n if ($val) {\n if (!$this->multiple && is_array($val)) {\n throw new InvalidArgumentException('Array values are not allowed (when multiple=false).');\n }\n\n if ($this->multiple) {\n $parts = (is_array($val)) ? $val : preg_split(\"/ *, */\", trim($val));\n if (ArrayLib::is_associative($parts)) {\n // This is due to the possibility of accidentally passing an array of values (as keys) and titles (as values) when only the keys were intended to be saved.\n throw new InvalidArgumentException('Associative arrays are not allowed as values (when multiple=true), only indexed arrays.');\n }\n\n // Doesn't check against unknown values in order to allow for less rigid data handling.\n // They're silently ignored and overwritten the next time the field is saved.\n parent::setValue($parts);\n } else {\n if (!in_array($val, array_keys($this->getSource()))) {\n if (self::config()->throw_exceptions) {\n throw new InvalidArgumentException(sprintf('Invalid value \"%s\" for multiple=false', Convert::raw2xml($val)));\n } else {\n $src = $this->getSourceAsArray();\n $src[$val] = $val;\n $this->setSource($src);\n }\n }\n\n $this->value = $val;\n }\n } else {\n $this->value = $val;\n }\n\n return $this;\n parent::setValue($value);\n }", "public function setValue($value)\n {\n $values = array();\n $value = empty($value) ? array() : $value;\n foreach ($value as $text) {\n $text = trim((string)$text);\n if (!empty($text)) {\n $values[] = $text;\n }\n }\n\n parent::setValue($values);\n }", "public function setValues(array $values): static\n {\n $this->what = $values;\n return $this;\n }", "public function set($arr)\n {\n $this->arr = $arr;\n }", "public function set()\n {\n $args = func_get_args();\n $num = func_num_args();\n if ($num == 2) {\n self::$data[$args[0]] = $args[1];\n } else {\n if (is_array($args[0])) {\n foreach ($args[0] as $k => $v) {\n self::$data[$k] = $v;\n }\n }\n }\n }", "public function setMultiple($value = null)\n {\n $this->multiple = false;\n }", "public function set( $name, $value = NULL );", "protected function doSet($value)\n {\n }", "public function setWebsiteList(?array $value): void {\n $this->getBackingStore()->set('websiteList', $value);\n }", "function set($value) {\n\t\tif (!is_array($value))\n\t\t\t$value = array($value);\n\t\treturn (empty($this->_data)) ? $this->_data = $value : $this->_data = array_merge($this->_data,$value);\n\t}", "public function setValues(array $values): void\n {\n foreach ($this->getInputNames() as $name) {\n if (array_key_exists($name, $values)) {\n $this->$name = $values[$name];\n }\n }\n }", "public function setTagList($taglist){\n\t\t$tags = explode(\",\",$taglist);\n\t\tforeach($tags as $tag) {\n\t\t\tif ($tag) $this->taglist .= \"'\".trim($tag).\"',\";\n\t\t}\n\t\t$this->taglist = substr($this->taglist, 0, -1);\n\t}", "public function setMulti(array $values, $expiry = 0) {}", "public function __set($_name, $_value);", "public function setValues(array $values) {\n $this->_values = $values;\n $allowedValues = array();\n foreach ($values as $index => $group) {\n $groupValues = array_keys(isset($group['options']) ? $group['options'] : $group);\n $allowedValues = array_merge($allowedValues, $groupValues);\n }\n $this->setFilter(new PapayaFilterList($allowedValues));\n }", "public function setParams($value)\n {\n if (!empty($value)) {\n $listParams = explode('&', $value);\n\n foreach ($listParams as $param) {\n $value = explode('=', $param);\n $this->setParam($value[0], $value[1]);\n }\n }\n }", "public function __set($name,$value)\n\t{\n\t\tif(in_array($name,$this->config_other_attributes))\n\t\t\t$this->list_other_attributes[$name]=$value;\n\t\telse \n\t\t\tparent::__set($name,$value);\n\t}" ]
[ "0.68151194", "0.6732347", "0.66938525", "0.6668575", "0.6554356", "0.63877124", "0.63843983", "0.6377377", "0.6300289", "0.6295127", "0.62627727", "0.6203645", "0.61246145", "0.6116721", "0.60924363", "0.6048018", "0.60147494", "0.6003122", "0.5976356", "0.5968658", "0.5960144", "0.5957298", "0.59541196", "0.5916648", "0.58630306", "0.5813545", "0.58106714", "0.5796306", "0.5796306", "0.5790882", "0.5784627", "0.5732243", "0.57294095", "0.57217044", "0.5721407", "0.5716072", "0.57140684", "0.57093126", "0.5700349", "0.56907743", "0.5688155", "0.5681544", "0.56797063", "0.5672827", "0.5672827", "0.5672827", "0.5672827", "0.5672827", "0.5672827", "0.5672827", "0.5672827", "0.5672827", "0.5672827", "0.5672827", "0.567164", "0.567164", "0.56703055", "0.5665528", "0.565992", "0.56597817", "0.5655328", "0.5641407", "0.5641407", "0.56396586", "0.56315786", "0.5625217", "0.5623039", "0.5600914", "0.5599442", "0.5599442", "0.5599442", "0.5599442", "0.5599442", "0.5599442", "0.5599442", "0.5599442", "0.5599442", "0.5599442", "0.5597758", "0.5592414", "0.55923885", "0.55893487", "0.5579244", "0.55747455", "0.55744565", "0.55684745", "0.5563706", "0.55573493", "0.553853", "0.55383503", "0.55333275", "0.5527516", "0.55210936", "0.55036414", "0.5496561", "0.5493955", "0.54715866", "0.5469314", "0.5455722", "0.5451683" ]
0.58803314
24
setter: A semicolonseparated list of time values used to control the pacing of the animation.
public function setKeyTimes($keyTimes) { $this->attributes['keyTimes'] = $keyTimes; $this->keyTimes = $keyTimes; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setTimes($value)\n {\n return $this->set(self::_TIMES, $value);\n }", "public function setSplitTimes($value)\n {\n return $this->set(self::_SPLIT_TIMES, $value);\n }", "function setTimeOffset($value)\n {\n $this->_props['TimeOffset'] = $value;\n }", "public function setTime($value) {\n\t\t$segments = explode(':',$value);\n\t\t$length = count($segments);\n\t\tswitch ($length) {\n\t\t\tcase 1:\n\t\t\t\t$time = \"0:00:\".sprintf('%02d',$segments[0]);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$time = \"0:\".sprintf('%02d',$segments[0]).\":\".sprintf('%02d',$segments[1]);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$time = $value;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->_time = $time;\n\t}", "public function setSeconds(int|float|string $set): self {\n\t\t$this->duration = $this->parse($set);\n\t\tif ($this->duration < 0) {\n\t\t\t$this->duration = -$this->duration;\n\t\t\t$this->invert = true;\n\t\t} else {\n\t\t\t$this->invert = false;\n\t\t}\n\t\treturn $this;\n\t}", "public function setDuration(?string $value): void {\n $this->getBackingStore()->set('duration', $value);\n }", "function setDuration( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Duration = $value;\n }", "public function setDurationAttribute($value)\n {\n $this->attributes['duration'] = $value . ':00';\n }", "public function setTime($time);", "public function setSpacing($spacing)\n {\n $this->fixedSpacing = true;\n $this->spacing = (int) $spacing;\n }", "public function setJoinTimes($value)\n {\n return $this->set(self::_JOIN_TIMES, $value);\n }", "public function spacing($value) {\n return $this->setProperty('spacing', $value);\n }", "public function spacing($value) {\n return $this->setProperty('spacing', $value);\n }", "public function setUseTimes($value)\n {\n return $this->set(self::_USE_TIMES, $value);\n }", "public function setAnimated($value) {\r\n $this->animated = $value;\r\n }", "public function setDuration($value)\n {\n $this->duration = $value;\n }", "public function setJumpTimes($value)\n {\n return $this->set(self::_JUMP_TIMES, $value);\n }", "public function setDuration($val)\n {\n $this->_propDict[\"duration\"] = $val;\n return $this;\n }", "public function setTime($value)\n {\n if (!array_key_exists('time', $this->fieldsModified)) {\n $this->fieldsModified['time'] = $this->data['fields']['time'];\n } elseif ($value === $this->fieldsModified['time']) {\n unset($this->fieldsModified['time']);\n }\n\n $this->data['fields']['time'] = $value;\n }", "public function setTimeOverride( $time ) {\n\t\t$this->time = $time;\n\t}", "public function set_play_offs_qtt($arg) {\n while ($arg * 2 > $this->participants_qtt) { //when there's more play offs than participants\n $arg /= 2;\n }\n if ($arg * 2 < $this->group_qtt) {\n $arg = $this->group_qtt / 2;\n }\n //$this->play_offs_qtt = $arg / 2;\n $this->play_offs_qtt = $arg;\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function setTime($time=0){\n\t\t\t$this->_time = $time;\n\t\t}", "public function setSyncTime(): void\n {\n }", "public function animation($value)\n {\n return $this->setProperty('animation', $value);\n }", "public function setAnimation($param){\n $this->_config_mapper(array('showAnim' => $param)); \n }", "protected function setGenerationTime($value)\n\t{\n\t\t$this->setTextFont(10);\n\t\tfor($i=0;$i<$this->copies;$i++){\n\t\t\t$this->_getPdf()->pages[$i]->drawText(date(\"d/m/Y\", strtotime($value)), 385, 761, 'UTF-8');\n\t\t}\n\t\t$this->barcode->addGenerationTime($value);\n\t}", "function setSecond($s) {\r\n if($s > 59 || $s < 0) {\r\n $this->segundo = 0;\r\n } else {\r\n $this->segundo = $s;\r\n }\r\n }", "public function setDur($dur) {\n\t\t$this->attributes['dur'] = $dur;\n\t\t$this->dur = $dur;\n\t\treturn $this;\n\t}", "function setSecond( $value )\r\n {\r\n $value = min( $value, 59 );\r\n $this->SecondsElapsed = ( ( $this->hour() * 3600 ) + ( $this->minute() * 60 ) + $value );\r\n }", "public function setShowTimeAttribute($value)\n {\n $this->attributes['show_time'] = $value;\n }", "public function setHeaderSpacing($value)\n {\n if ((float)$value) {\n $this->fields['options']['header_spacing'] = (float)$value;\n }\n }", "public function setRise($rise) {}", "public function setTime($value)\n {\n return $this->set(self::TIME, $value);\n }", "public function setTime($value)\n {\n return $this->set(self::TIME, $value);\n }", "public function setValue($value)\n\t{\n\t\tif(is_array($value))\n\t\t{\n\t\t\t$this->setStart(new ilDateTime($value['start'], IL_CAL_UNIX));\n\t\t\t$this->setEnd(new ilDateTime($value['end'], IL_CAL_UNIX));\n\t\t}\n\t}", "public function setTextLineSpacing($value)\n {\n $this->_textLineSpacing = $value;\n }", "public function setLapTime($time)\n {\n\n }", "public function setCharSpacing($charSpacing) {}", "public function setBehelpedTimes($value)\n {\n return $this->set(self::BEHELPED_TIMES, $value);\n }", "function setSecondsElapsed( $value )\r\n {\r\n $this->SecondsElapsed = $value;\r\n }", "public function setTime(?DateTime $value): void {\n $this->getBackingStore()->set('time', $value);\n }", "public function setTimeFormat(?string $value): void {\n $this->getBackingStore()->set('timeFormat', $value);\n }", "public function setTime($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function setTime($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function setTime($value)\n {\n return $this->set(self::_TIME, $value);\n }", "public function setTime($value)\n {\n return $this->set(self::_TIME, $value);\n }", "public function setTime($value)\n {\n return $this->set(self::_TIME, $value);\n }", "function setMinute( $value )\r\n {\r\n $value = min( $value, 59 );\r\n $this->SecondsElapsed = ( ( $this->hour() * 3600 ) + ( $value * 60 ) + $this->second() );\r\n }", "public function time($value): self\n {\n $this->time = $value;\n \n return $this;\n }", "public function setGpsTime($value)\n {\n return $this->set(self::GPSTIME, $value);\n }", "public function setCharacterSpacing($characterSpacing) {}", "public function setTiming(array $timing)\n {\n $this->timing = $timing;\n return $this;\n }", "public function setSeparator($sep = ' - ')\n\t{\n\t\t$this->_separator = $sep;\n\t}", "public function setSeconds($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function setQueuedAtAttribute($value)\n {\n $value = ($value) ? : Carbon::now('Europe/London');\n $this->attributes['queued_at'] = $value;\n }", "public function setFooterSpacing($value)\n {\n if ((float)$value) {\n $this->fields['options']['footer_spacing'] = (float)$value;\n }\n }", "public function setY($y) {}", "public function duration($value)\n {\n return $this->setProperty('duration', $value);\n }", "public function set(string $key, mixed $value, int $time, $path): void\n {\n }", "public function setCharacterSpacing($charSpacing = 0) {}", "function __set($name, $value) {\r\n if ($name == 'mr') {\r\n $this->max_rating = intval($value);\r\n } else if ($name == 'st') {\r\n $this->step = intval($value);\r\n } else if ($name == 'vis') {\r\n $this->visible = $value == '1';\r\n } else if ($name == 'seq') {\r\n $this->sequence = intval($value);\r\n } else if ($name == 'cr') {\r\n $this->created = DateTime::createFromFormat('Y-m-d H:i:s', $value);\r\n } else if ($name == 'upd') {\r\n $this->updated = DateTime::createFromFormat('Y-m-d H:i:s', $value);\r\n } else if ($name == 'num') {\r\n $this->num_ratings = intval($value);\r\n } else if ($name == 'total') {\r\n $this->tot_ratings = floatval($value);\r\n }\r\n\r\n }", "public function setPositionUnits($value) {\r\n if ($this->positionUnits != $value) {\r\n $this->positionUnits = $value;\r\n $this->invalidate();\r\n }\r\n }", "public function setFormationTime($value)\n {\n return $this->set(self::FORMATIONTIME, $value);\n }", "function setTimeSetFlag($boolean)\n\t{\n\t\t$this->TimeSet_Flag = $boolean;\n\t}", "public function setAnimatedSteps($value) {\r\n $this->animatedSteps = $value;\r\n }", "public function set($key, $value, $time = 300, array $options = array());", "public function setTimeBasedAttribute($val)\n {\n $this->_propDict[\"timeBasedAttribute\"] = $val;\n return $this;\n }", "function setColumnSpacing($spacing = 25)\n {\n $spacing = intval($spacing);\n\n $this->column_spacing = $spacing;\n }", "function setLifeTime($time);", "public function setY($y);", "public function set_due_duration_by( $value ) {\n\t\t$this->set_prop( 'due_duration_by', $value ) ;\n\t}", "function setSeparator($sep = ', '){\n\t\t\t$this->separator = $sep;\n\t\t}", "public function set($key, $value, $minutes = 30);", "public function setLevelupTime($value)\n {\n return $this->set(self::LEVELUP_TIME, $value);\n }", "function setProperty($key ='', $value ='') {\r\r\n \r\r\n return ( array_key_exists($key, $this->_timezone) ? ($this->_timezone[$key] = $value) : false );\r\r\n }", "function setSpeed($down = NULL, $up = NULL)\n{\n $append = \"\";\n \n if($down != NULL)\n $append.=' -d'.$down;\n else if($down == 0)\n $append.=' -D';\n \n if($up != NULL)\n $append.=' -u'.$up;\n else if($up == 0)\n $append.=' -U';\n \n return generateQuery($append);\n \n}", "public function setMiterLimit($miterLimit) {}", "public function set($key, $value, $duration = 0): void;", "public function setFrame($value) {}", "public function setTimeOff($val)\n {\n $this->timeOff = (string)$val;\n return $this;\n }", "public function setDurationTime($dur)\n {\n $this->duration = $dur / 60 / 1000 / 60;\n }", "function setGutter($gutter) {\t \r\n\t $this->gutter = $gutter;\r\n\t}", "public function setAssistArriveTime($value)\n {\n return $this->set(self::ASSIST_ARRIVE_TIME, $value);\n }", "public static function setters();", "public function testSetTime() {\n $time = new \\DateTime();\n $this->order->setTime($time);\n $this->assertEquals($time, $this->order->getTime());\n }", "public function setSearchTimes($value)\n {\n return $this->set(self::_SEARCH_TIMES, $value);\n }", "public function setDuration($v)\n\t{\n\r\n\t\t// Since the native PHP type for this column is integer,\r\n\t\t// we will cast the input value to an int (if it is not).\r\n\t\tif ($v !== null && !is_int($v) && is_numeric($v)) {\r\n\t\t\t$v = (int) $v;\r\n\t\t}\r\n\n\t\tif ($this->duration !== $v || $v === 0) {\n\t\t\t$this->duration = $v;\n\t\t\t$this->modifiedColumns[] = MmPeer::DURATION;\n\t\t}\n\n\t}", "public function setPosition() {\n }", "public function configure(): static\n {\n return $this->afterMaking(function ($slot) {\n $slot->begins_year = $slot->begins->year;\n $slot->begins_time = $slot->begins_adjusted->timestamp;\n $slot->ends_time = $slot->ends_adjusted->timestamp;\n $slot->duration = $slot->ends_time - $slot->begins_time;\n });\n }", "public function space( $space){\n\t\t\t\t\n\t\t\t\t$this->_spacing += $space;\n\t\t\t\n\t\t}", "function setHour( $value )\r\n {\r\n $value = min( $value, 23 );\r\n $this->SecondsElapsed = ( ( $value * 3600 ) + ( $this->minute() * 60 ) + $this->second() );\r\n setType( $this->SecondsElapsed, \"integer\" );\r\n }", "function __set ($name, $value)\n\t{\n\t\tswitch ($name) {\n\t\t\tcase \"name\":\n\t\t\tcase \"alt\":\n\t\t\tcase \"align\":\n\t\t\tcase \"codeBase\":\n\t\t\tcase \"archive\":\n\t\t\tcase \"code\":\n\t\t\tcase \"object\":\n\t\t\t\t$this->_setProperty($name, $value);\n\t\t\tbreak;\n\t\t\tcase \"width\":\n\t\t\tcase \"height\":\n\t\t\t\t$this->_setProperty($name, $value, \"intperc\");\n\t\t\tbreak;\n\t\t\tcase \"hspace\":\n\t\t\tcase \"vspace\":\n\t\t\t\t$this->_getProperty($name, (int) $value, \"int\", 0);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tparent::__set($name, $value);\n\t\t\tbreak;\n\t\t}\n\t}", "public function setFixed() {\n }", "public function setWordSpacing($wordSpacing) {}", "public function setWordSpacing($wordSpacing) {}", "public function setMiterLimit($miterLimit = 10) {}", "public function setTimeZone($value)\n {\n date_default_timezone_set($value);\n }" ]
[ "0.58745086", "0.5824327", "0.57021314", "0.5686209", "0.5544003", "0.55115986", "0.55017203", "0.5450861", "0.53995365", "0.53892535", "0.538493", "0.5326185", "0.5326185", "0.52965784", "0.52799475", "0.52645457", "0.5255215", "0.52483517", "0.52252096", "0.5217258", "0.5154332", "0.5147951", "0.5147951", "0.5147951", "0.51417387", "0.5115135", "0.5114676", "0.51052606", "0.5096282", "0.50874585", "0.507348", "0.5032706", "0.5012814", "0.5006586", "0.49990764", "0.49953884", "0.49953884", "0.49925625", "0.4986822", "0.4977946", "0.49750337", "0.49484396", "0.49476355", "0.49420202", "0.49369046", "0.49270773", "0.49270773", "0.49250296", "0.49250296", "0.49250296", "0.4923276", "0.49157035", "0.49036974", "0.4903119", "0.4894585", "0.48887774", "0.48758045", "0.4865836", "0.48542133", "0.48396057", "0.48291948", "0.48067552", "0.48047006", "0.48009765", "0.47972524", "0.4797245", "0.47929728", "0.47906289", "0.47771773", "0.47724426", "0.477192", "0.47702336", "0.47641665", "0.4742841", "0.4720818", "0.47148323", "0.47069567", "0.4703591", "0.47018343", "0.47009254", "0.46867448", "0.46847683", "0.46624464", "0.46366513", "0.4632607", "0.4632422", "0.46323615", "0.46272844", "0.46266404", "0.46256456", "0.4622917", "0.46202907", "0.46183985", "0.46171054", "0.46158698", "0.4614089", "0.45843673", "0.45843673", "0.45805383", "0.45774385" ]
0.4812361
61
setter: Specifies the starting value of the animation.
public function setFrom($from) { $this->attributes['from'] = $from; $this->from = $from; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setStart ($value)\r\n\t{\r\n\t\t$this->start = $value;\r\n\t}", "public function start($value) {\n return $this->setProperty('start', $value);\n }", "public function setStart($val)\n {\n $this->_propDict[\"start\"] = $val;\n return $this;\n }", "public function setAnimated($value) {\r\n $this->animated = $value;\r\n }", "public function setStart($number)\n {\n parent::setAttr(\"start\", $number);\n }", "public function startAngle($value) {\n return $this->setProperty('startAngle', $value);\n }", "public function startAngle($value) {\n return $this->setProperty('startAngle', $value);\n }", "public function startAngle($value) {\n return $this->setProperty('startAngle', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function setStart($intStart);", "public function animation($value)\n {\n return $this->setProperty('animation', $value);\n }", "public function setMinValue($value)\n\t{\n\t\t$this->setViewState('MinValue',$value,'');\n\t}", "public function moveStart($value) {\n if (is_string($value)) {\n $value = new \\Kendo\\JavaScriptFunction($value);\n }\n\n return $this->setProperty('moveStart', $value);\n }", "public function setStart($start)\n {\n Argument::i()->test(1, 'int');\n \n if ($start < 0) {\n $start = 0;\n }\n \n $this->start = $start;\n \n return $this;\n }", "public function setMinValue($value)\n {\n $this->set('MinValue', (int) $value);\n return $this;\n }", "public function setAnimatedSteps($value) {\r\n $this->animatedSteps = $value;\r\n }", "public function set()\n {\n if ( ! $this->value ) {\n $this->generate();\n }\n }", "public function setMin($value)\n {\n $this->_minValue = $value;\n return $this;\n }", "public function setStartPosition($value) {\r\n $this->startPosition = $this->setDoubleProperty($this->startPosition, $value);\r\n }", "public function setAutomaticMinimum($value) {\r\n $this->automaticMinimum = $this->setAutoMinMax($this->automaticMinimum, $this->automaticMaximum,\r\n $value);\r\n }", "public function setMinimum($value) {\r\n $this->internalSetMinimum($value);\r\n }", "public function setStart($start)\n\t{\n\t\t$this->start\t\t= $start;\n\t}", "public function setStart(int $i): self\n {\n $this->start = $i;\n\n return $this;\n }", "public function setStartYear($value)\n {\n return $this->setYearParameter('startYear', $value);\n }", "public function setAutomatic($value) {\r\n $this->automatic = $this->setBooleanProperty($this->automatic, $value);\r\n $this->automaticMinimum = $value;\r\n $this->automaticMaximum = $value;\r\n }", "public function setStart($start) {\n\t\t$this->attributes['start'] = $start;\n\t\treturn $this;\n\t}", "public function set_value($value) {\n\t\t$this->_value = $value + 0;\n\t}", "public function getStart(): float;", "public function setStartDateAttribute($value)\n {\n $this->attributes['start_date'] = Carbon::parse($value);\n }", "function GetStart()\n {\n $this->Set_Getvar_val();\n $this->start = (($this->getvar_val-1)*$this->length);\n }", "public function setStart(?int $start): self\n {\n $this->start = $start;\n\n return $this;\n }", "public function setStartIndex($value)\n {\n return $this->set('StartIndex', $value);\n }", "public function setStartDateAttribute($value)\n\t{\n\t\treturn $this->attributes['start_date'] = Carbon::parse($value)->format('Y-m-d H:i:s');\n\t}", "public function setMin( int $min ): void {\n\t\t\t$this->minimum = abs( $min );\n\t\t}", "public function min($value) {\n return $this->setProperty('min', $value);\n }", "public function min($value) {\n return $this->setProperty('min', $value);\n }", "public function setStartMonthYear($val)\n {\n $this->_propDict[\"startMonthYear\"] = $val;\n return $this;\n }", "public function setStartDate($value)\n {\n $this->startDate = $value;\n }", "public function setStartBeginning($startbeginning);", "public function setFirst($value)\n\t{\n\t\t$this->first = $value;\n\t\treturn $this;\n\t}", "public function setStart($start)\n {\n ValidationUtility::ensureInteger('$start', $start);\n\n $this->start = $start;\n\n return $this;\n }", "public function setMinValue($minValue);", "public function setStartMonth($value)\n {\n return $this->setParameter('startMonth', (int) $value);\n }", "public function setInitialMarking($initialMarking, $setTokens = false) {\n\t\t$this->initialMarking = (int) $initialMarking;\n\t\tif($setTokens) {\n\t\t\t$this->resetTokens();\n\t\t}\n\t}", "public function set_step( $step ) {\r\n\t\t$this->step = absint( $step );\r\n\t}", "public function setMinAxisIncrement($value) {\r\n $this->iMinAxisIncrement = $value;\r\n }", "public function setStartDate($value)\n {\n return $this->set('StartDate', $value);\n }", "public function setStartDate($value)\n {\n return $this->set('StartDate', $value);\n }", "public function set($value = null)\r\n {\r\n return parent::set((float)$value);\r\n }", "public function setLeft($val)\n {\n $this->_propDict[\"left\"] = floatval($val);\n return $this;\n }", "function setStart($start) {\n\t\t\t$this->start = $start;\n\t\t\treturn TRUE;\n\t\t}", "public function testSetStart() {\n\n $obj = new DataTablesRequest();\n\n $obj->setStart(0);\n $this->assertEquals(0, $obj->getStart());\n }", "private function setSequence(): void\n {\n $this->sequence = $this->getSequence();\n }", "protected function onParentSet() : void\n {\n $value = $this->oFG->getData()->getValue($this->strName);\n $this->iValue = $value ? intval($value) : $this->iMin;\n }", "public function setProgressNow(int $value)\n {\n $this->update(['progress_now' => $value]);\n }", "public function SetStart()\n\t\t{\n\t\t\t$start = 0;\n\n\t\t\tswitch ($this->_pricepage) {\n\t\t\t\tcase 1: {\n\t\t\t\t\t$start = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// Page 2 or more\n\t\t\t\tdefault: {\n\t\t\t\t\t$start = ($this->GetPage() * GetConfig('CategoryProductsPerPage')) - GetConfig('CategoryProductsPerPage');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->_pricestart = $start;\n\t\t}", "public function setMinimumOffset($value) {\r\n $this->minimumOffset = $this->setIntegerProperty($this->minimumOffset, $value);\r\n }", "public function setIncrementing($value);", "public function setStart(Point $start)\n {\n $this->start = $start;\n }", "public function setMinimum(?Json $value): void {\n $this->getBackingStore()->set('minimum', $value);\n }", "function setMin($min) {\n $this->field['min'] = (int) $min;\n\n return $this;\n }", "public function setCurrent($value)\n {\n return $this->set(self::_CURRENT, $value);\n }", "public function setMin($min) {\n\t\t$this->attributes['min'] = $min;\n\t\t$this->min = $min;\n\t\treturn $this;\n\t}", "function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}", "public function setStart($var)\n {\n GPBUtil::checkInt32($var);\n $this->start = $var;\n\n return $this;\n }", "public function setIndicator($val)\n {\n $this->_propDict[\"indicator\"] = $val;\n return $this;\n }", "public function setStart(string $start)\n {\n $this->start = $start;\n\n return $this;\n }", "public function setBeginTime($value)\n {\n return $this->set(self::_BEGIN_TIME, $value);\n }", "public function setXMin($xMin) {}", "public function setStart($var)\n {\n GPBUtil::checkDouble($var);\n $this->start = $var;\n\n return $this;\n }", "public function setStartDate($value) \n {\n $this->_fields['StartDate']['FieldValue'] = $value;\n return $this;\n }", "public function setStart($var)\n {\n GPBUtil::checkInt64($var);\n $this->start = $var;\n\n return $this;\n }", "public function setInitialPrice(?float $initialPrice = null): self\n {\n // validation for constraint: float\n if (!is_null($initialPrice) && !(is_float($initialPrice) || is_numeric($initialPrice))) {\n throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($initialPrice, true), gettype($initialPrice)), __LINE__);\n }\n if (is_null($initialPrice) || (is_array($initialPrice) && empty($initialPrice))) {\n unset($this->InitialPrice);\n } else {\n $this->InitialPrice = $initialPrice;\n }\n \n return $this;\n }", "public function setRentalInitialValue($value)\n {\n $this->_fields['RentalInitialValue']['FieldValue'] = $value;\n return $this;\n }", "public function setStartTimestamp($value)\n {\n return $this->set('StartTimestamp', $value);\n }", "public function setStartTimestamp($value)\n {\n return $this->set('StartTimestamp', $value);\n }", "public function setStartTimestamp($value)\n {\n return $this->set('StartTimestamp', $value);\n }", "public function setStartTimestamp($value)\n {\n return $this->set('StartTimestamp', $value);\n }", "public function setStartTimestamp($value)\n {\n return $this->set('StartTimestamp', $value);\n }", "public function setStartDate(?Date $value): void {\n $this->getBackingStore()->set('startDate', $value);\n }", "function setValue($value) {\n $this->value = $value;\n }", "public function setStartAt($start_at)\n {\n $this->start_at = $start_at;\n }", "function setDefault($value)\n {\n $this->_defValue = $value;\n }", "public function start($start)\n {\n if (!is_numeric($start)) {\n throw new \\InvalidArgumentException('$start needs to be numeric');\n }\n $this->start = $start;\n return $this;\n }", "function set_begin($begin)\n {\n $this->set_default_property(self :: PROPERTY_BEGIN, $begin);\n }", "public function setStartDate($val)\n {\n $this->_propDict[\"startDate\"] = $val;\n return $this;\n }", "public function setSequence($val)\n {\n $this->_propDict[\"sequence\"] = intval($val);\n return $this;\n }", "public function setMin(int $value): CustomField\n {\n $this->min = $value;\n\n return $this;\n }", "function setValue ($value) {\n\t\t$this->_value = $value;\n\t}", "public function setPageStart(?int $page): Ghostscript\n {\n $this->pageStart = $page;\n return $this;\n }", "public function setStart($start)\n {\n //Argument 1 must be a string\n Argument::i()->test(1, 'string', 'int');\n\n if (is_string($start)) {\n $start = strtotime($start);\n }\n\n $start = date('Y-m-d H:i:s', $start);\n\n $this->query['start_date'] = $start;\n\n return $this;\n }", "function seekToStart() : void;", "public function setMinimumValue(int $minimumValue): void;", "public function setCurStage($value)\n {\n return $this->set(self::_CUR_STAGE, $value);\n }", "public function setAnimation($param){\n $this->_config_mapper(array('showAnim' => $param)); \n }", "public function setNumerator($value): TURational\n\t{\n\t\t$value = min(max(0, $value), TBitHelper::PHP_INT32_UMAX);\n\t\tif (PHP_INT_SIZE > 4 || $value <= PHP_INT_MAX) {\n\t\t\t$this->_numerator = (int) $value;\n\t\t} else {\n\t\t\t$this->_numerator = (float) $value;\n\t\t}\n\t\treturn $this;\n\t}", "public function setStartAtMin(?string $startAtMin): void\n {\n $this->startAtMin = $startAtMin;\n }", "public function beginTime(?string $value): self\n {\n $this->instance->setBeginTime($value);\n return $this;\n }", "public function beginTime(?string $value): self\n {\n $this->instance->setBeginTime($value);\n return $this;\n }" ]
[ "0.70164233", "0.66053706", "0.6604908", "0.6342563", "0.6307958", "0.6063377", "0.6063377", "0.6063377", "0.59954774", "0.59954774", "0.59954774", "0.59680957", "0.595145", "0.5918067", "0.5856922", "0.5739064", "0.5733809", "0.5723544", "0.57015026", "0.5694267", "0.5677737", "0.5660819", "0.5641228", "0.56109506", "0.5601085", "0.54923344", "0.54656523", "0.5461253", "0.5437186", "0.5429663", "0.54145527", "0.5413288", "0.541173", "0.5379878", "0.5361897", "0.5341965", "0.5301534", "0.5301534", "0.52846724", "0.5281511", "0.5279262", "0.527343", "0.5268584", "0.52565306", "0.52532935", "0.52387065", "0.52066153", "0.519796", "0.51969755", "0.5195363", "0.5184371", "0.5181881", "0.5177639", "0.5146934", "0.51408744", "0.512555", "0.51249933", "0.51225823", "0.5098695", "0.5097671", "0.50613475", "0.5046998", "0.5046984", "0.50395244", "0.50320446", "0.5030381", "0.50254875", "0.5018721", "0.50020057", "0.5000851", "0.4995521", "0.49954164", "0.49942487", "0.49875215", "0.49869207", "0.49849328", "0.49802625", "0.49802625", "0.49802625", "0.49802625", "0.49802625", "0.4979905", "0.49615818", "0.4957792", "0.49481225", "0.49474704", "0.4946357", "0.49459308", "0.49380216", "0.493766", "0.4936861", "0.4936808", "0.49365002", "0.49281746", "0.4922946", "0.4921263", "0.49204078", "0.49189687", "0.49180436", "0.49179184", "0.49179184" ]
0.0
-1
setter: Specifies the ending value of the animation.
public function setTo($to) { $this->attributes['to'] = $to; $this->to = $to; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setEnd($val)\n {\n $this->_propDict[\"end\"] = $val;\n return $this;\n }", "function set_end($end)\n {\n $this->set_default_property(self :: PROPERTY_END, $end);\n }", "public function setEndPosition($value) {\r\n $this->endPosition = $this->setDoubleProperty($this->endPosition, $value);\r\n }", "public function setEnd($end) {\n\t\t$this->attributes['end'] = $end;\n\t\t$this->end = $end;\n\t\treturn $this;\n\t}", "public function moveEnd($value) {\n if (is_string($value)) {\n $value = new \\Kendo\\JavaScriptFunction($value);\n }\n\n return $this->setProperty('moveEnd', $value);\n }", "function setEnd($end) {\n\t\t\t$this->end = $end;\n\t\t\treturn TRUE;\n\t\t}", "public function setEndTime($value)\n {\n return $this->set(self::_END_TIME, $value);\n }", "public function setTimeOutEnd($value)\n {\n return $this->set(self::_TIME_OUT_END, $value);\n }", "public function setEndTime($value) {\n return $this->set(self::ENDTIME, $value);\n }", "public function setStateEndTs($value)\n {\n return $this->set(self::_STATE_END_TS, $value);\n }", "public function setEnd($var)\n {\n GPBUtil::checkDouble($var);\n $this->end = $var;\n\n return $this;\n }", "public function end($end);", "public function setEnd($end)\n {\n ValidationUtility::ensureInteger('$end', $end);\n\n $this->end = $end;\n\n return $this;\n }", "public function setEnd($var)\n {\n GPBUtil::checkInt32($var);\n $this->end = $var;\n\n return $this;\n }", "public function setEnd(string $end)\n {\n $this->end = $end;\n\n return $this;\n }", "public function setEnd($var)\n {\n GPBUtil::checkInt64($var);\n $this->end = $var;\n\n return $this;\n }", "function get_end()\n {\n return $this->get_default_property(self :: PROPERTY_END);\n }", "static function setEnd(){\n\t\tif( empty(self::$cacheStack)){\n\t\t\tthrow new BadMethodCallException(__class__.\"::setEnd() called with no previous matching call to \".__class__.\"setStart() method\");\n\t\t}\n\t\t$name = array_pop(self::$cacheStack);\n\t\treturn self::set($name,ob_get_clean());\n\t}", "function end()\n\t{\n\t\t$this->over = true;\n\t}", "public function setFinished($value)\t\r\n\t{\r\n\t\tif ( is_bool($value) )\r\n\t\t{\r\n\t\t\t$this->finished = $value;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new \\InvalidArgumentException(\"param 1 must be of type bool\");\r\n\t\t}\r\n\t}", "public function setEnd(?int $end): self\n {\n $this->end = $end;\n\n return $this;\n }", "public function getEnd()\n\t{\n\t\treturn $this->End;\n\t}", "public function getEnd()\n {\n return $this->end;\n }", "public function getEnd()\n {\n return $this->end;\n }", "public function getEnd()\n {\n return $this->end;\n }", "public function getEnd()\n {\n return $this->end;\n }", "public function getEnd()\n {\n return $this->end;\n }", "public function getEnd()\n {\n return $this->end;\n }", "public function end() {\n return $this->end;\n }", "public function setEndDateTime($val)\n {\n $this->_propDict[\"endDateTime\"] = $val;\n return $this;\n }", "public function setEndBat(Down_TbcEndBattle $value)\n {\n return $this->set(self::_END_BAT, $value);\n }", "public function getEnd();", "public function setInstanceEnd(Down_GuildInstanceEndDown $value)\n {\n return $this->set(self::_INSTANCE_END, $value);\n }", "public function setLast($value)\n\t{\n\t\t$this->last = $value;\n\t\treturn $this;\n\t}", "public function setEndMonthYear($val)\n {\n $this->_propDict[\"endMonthYear\"] = $val;\n return $this;\n }", "function getEnd() {\n\t\t\treturn $this->end;\n\t\t}", "public function end($end)\n {\n $this->end = (string) $end;\n return $this;\n }", "public function setEndAt($end_at)\n {\n $this->end_at = $end_at;\n }", "public function end() {\n return $this->_end;\n }", "public function getEndPosition() {\r\n return $this->endPosition;\r\n }", "public function ends()\n {\n return $this->endRepeat !== \"never\";\n }", "public function setAnimated($value) {\r\n $this->animated = $value;\r\n }", "public function getEnd() {}", "public function getRangeEnd()\n {\n return $this->range_end;\n }", "public function setEndTimestamp($value)\n {\n return $this->set('EndTimestamp', $value);\n }", "public function setEndTimestamp($value)\n {\n return $this->set('EndTimestamp', $value);\n }", "public function setEndTimestamp($value)\n {\n return $this->set('EndTimestamp', $value);\n }", "public function setEndTimestamp($value)\n {\n return $this->set('EndTimestamp', $value);\n }", "public function setEndTimestamp($value)\n {\n return $this->set('EndTimestamp', $value);\n }", "public function setEnd($end)\n {\n //Argument 1 must be a string\n Argument::i()->test(1, 'string', 'int');\n\n if (is_string($end)) {\n $end = strtotime($end);\n }\n\n $end = date('Y-m-d H:i:s', $end);\n\n $this->query['end_date'] = $end;\n\n return $this;\n }", "public function GoToEnd()\n {\n $this->setItemPointer(($this->Length() - 1));\n }", "public function setEndTime($value)\n {\n return $this->set('EndTime', $value);\n }", "public function end($end)\n {\n $this->setTimeLimits('end', $end);\n\n return $this;\n }", "public function setEndBattle(Down_EndBattle $value)\n {\n return $this->set(self::_END_BATTLE, $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function getEndAt()\n {\n return $this->end_at;\n }", "public function getEndAt()\n {\n return $this->end_at;\n }", "public function getEnd()\n {\n return clone $this->_end;\n }", "public function getEnd()\n {\n return $this->metaRefreshValues['end'];\n }", "public function setEndState($state)\n {\n $this->end_state = strtoupper($state);\n }", "public function setEndtime($endtime){\n $this->_endtime = $endtime;\n }", "public function endTime(?string $value): self\n {\n $this->instance->setEndTime($value);\n return $this;\n }", "public function endTime(?string $value): self\n {\n $this->instance->setEndTime($value);\n return $this;\n }", "public function animation($value)\n {\n return $this->setProperty('animation', $value);\n }", "public function setEndString($endl='rn') {\n\t\tif($endl='rn') {\n\t\t\t$this->_endString = \"\\r\\n\"; \n\t\t}\n\t\telseif($endl='n') {\n\t\t\t$this->_endString = \"\\n\";\n\t\t}\n\t\telseif($endl='r') {\n\t\t\t$this->_endString = \"\\r\";\n\t\t}\n\t\telse {\n\t\t\t$this->_endString = \"\\r\\n\";\n\t\t}\n\t}", "public function getEndPosition()\n\t{\n\t\treturn $this->endPosition;\n\t}", "public function setEndDateAttribute($value)\n\t{\n\t\treturn $this->attributes['end_date'] = Carbon::parse($value)->format('Y-m-d H:i:s');\n\t}", "public function setEndTime(?Time $value): void {\n $this->getBackingStore()->set('endTime', $value);\n }", "public function getArrEndEasing(){\r\n\t\t$arrEasing = $this->getArrEasing();\r\n\t\t$arrEasing = array_merge(array(\"nothing\" => \"No Change\"),$arrEasing);\r\n\r\n\t\treturn($arrEasing);\r\n\t}", "protected function getEndIntervalAttribute()\n {\n return $this->fetchData[self::INTERVAL_END];\n }", "public function get_end_interval()\n\t{\n\t\treturn $this->end_interval;\n\t}", "public function setHeroSplitEnding($value)\n {\n return $this->set(self::_HERO_SPLIT_ENDING, $value);\n }", "public function ended();", "public function getEnd(): int;", "public function getEnd(): int\n {\n return $this->end;\n }", "public function setEnd(ilDateTime $a_date = null)\n\t{\n\t\t$this->end = $a_date;\n\t}", "public function setEndedAt(?string $endedAt): void\n {\n $this->endedAt['value'] = $endedAt;\n }", "public function setEndDateAttribute($value)\n {\n $this->attributes['end_date'] = Carbon::parse($value);\n }", "public function setEnd(\\DateTime $end)\n {\n $this->end = $end;\n return $this;\n }", "public function setEnd(\\DateTime $end)\n {\n $this->end = $end;\n return $this;\n }", "public function setAnimatedSteps($value) {\r\n $this->animatedSteps = $value;\r\n }", "function setDuration( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Duration = $value;\n }", "public function set_end_date()\n {\n if ($this->end_date === NULL && $this->start_date === NULL) {\n $this->formated_end_date = \"the game has not started yet\";\n } elseif($this->end_date === NULL && $this->start_date !== NULL) {\n $this->formated_end_date = \"the game is not finished yet\";\n } else {\n $end_date = Carbon::createFromTimestamp($this->end_date / 1000);\n $this->formated_end_date = $end_date->toDayDateTimeString();\n }\n return $this->formated_end_date; \n }", "public function setEndDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('endDateTime', $value);\n }", "public function setEnds($ends)\r\n {\r\n $this->ends = $ends;\r\n\r\n return $this;\r\n }", "private function end() {\n return $this->formats['end'];\n }", "public function setEnd(Point $end)\n {\n $this->end = $end;\n }", "public function getEnd($decimal = false)\n {\n return $decimal ? $this->iend : $this->end;\n }", "public function SetEndTime(\n $in_ends_before ///< An epoch time, defining that the meeting must end no later than this.\n ) {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $this->_end_before = $in_ends_before;\n }", "function endRound() {\n\n\t\t$this->console_text('End Round');\n\t\t$this->releaseEvent('onEndRound', null);\n\t}", "public function setExcavateEndBattleReply(Down_ExcavateEndBattleReply $value)\n {\n return $this->set(self::_EXCAVATE_END_BATTLE_REPLY, $value);\n }", "public function setEndDate($value)\n {\n return $this->set('EndDate', $value);\n }", "public function setEndDate($value)\n {\n return $this->set('EndDate', $value);\n }", "public function getEnd()\n {\n return $this->end_time;\n }", "public function getEndIn()\n {\n return $this->end_in;\n }", "public function setOndragend(string $value):static {\n return $this->setAttribute('ondragend', $value);\n }", "function setYAxisMax($a_val)\n\t{\n\t\t$this->y_max = $a_val;\n\t}", "public function getEnds()\r\n {\r\n return $this->ends;\r\n }", "public function setEndTag($tag)\n {\n $this->endTag = $tag;\n }" ]
[ "0.7019486", "0.6512143", "0.6432066", "0.6229182", "0.60902303", "0.60779256", "0.59539574", "0.5883854", "0.588124", "0.5874175", "0.58448035", "0.583841", "0.5818415", "0.57867414", "0.5759839", "0.5733175", "0.57120496", "0.5629215", "0.5607078", "0.55984396", "0.5585446", "0.5557393", "0.5538025", "0.5538025", "0.5538025", "0.5538025", "0.5538025", "0.5538025", "0.55328655", "0.54883903", "0.54644185", "0.5450513", "0.54429215", "0.54287875", "0.5422647", "0.54218435", "0.5411001", "0.5386442", "0.5381871", "0.53481483", "0.532957", "0.5327597", "0.5320031", "0.5303604", "0.52964103", "0.52964103", "0.52964103", "0.52964103", "0.52964103", "0.528778", "0.52853954", "0.5282998", "0.5276406", "0.5271472", "0.52511644", "0.52511644", "0.52511644", "0.52137756", "0.52137756", "0.5212377", "0.51954025", "0.518512", "0.5182763", "0.5176971", "0.5176971", "0.51753026", "0.5175098", "0.51663554", "0.5132537", "0.5132232", "0.51299804", "0.5120461", "0.5112148", "0.5110349", "0.51041275", "0.5077977", "0.5076249", "0.50733256", "0.5065897", "0.5049032", "0.5043705", "0.5043705", "0.5042171", "0.50394344", "0.50324523", "0.5027632", "0.5022353", "0.50146395", "0.49871925", "0.49489245", "0.49447376", "0.4936558", "0.49143633", "0.4913617", "0.4913203", "0.4907736", "0.49051833", "0.49017656", "0.48939824", "0.4892019", "0.4888994" ]
0.0
-1
setter: Specifies a relative offset value for the animation. It adds the given value to the attributeName So...if the value of the attribute is 100 and by is 20 it results in 120
public function setBy($by) { $this->attributes['by'] = $by; $this->by = $by; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setterIze($offset)\n {\n return 'set' . str_replace(' ', '', ucwords(strtr($offset, '_-', ' ')));\n }", "function setOffset($value) {\n $this->offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->attrs[$offset] = $value;\n return $this;\n }", "function setOffset($offset) {\n\t\t$this->_offset = 3600 * $offset;\n\t}", "function setOffset ($offSet, $newOffset) {\r\n $offSet = $offSet + $newOffset; \r\n return $offSet;\r\n}", "public function setOffset($value){\n \n $this->offset = $value;\n\n return $this;\n\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "#[\\ReturnTypeWillChange]\n public function offsetSet($offset, $value)\n {\n $this->attributes[$offset] = $value;\n }", "public function setYOffset($measure, $unit = null);", "public function setOffset($offset) {\n\t\t$this->offset = $offset;\n\t}", "public function setOffset($offset);", "public function setOffset($offset);", "public function setAttributes_price_factor_offset( $attributes_price_factor_offset ) {\n\t\t$this->attributes_price_factor_offset = $attributes_price_factor_offset;\n\t}", "public function setOffset($offset, $value, $container = 'default');", "public function setOffset($offset) { $this->_offset = $offset; }", "public function setXOffset($measure, $unit = null);", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function setOffset($offset) {}", "public function setOffset($offset)\r\n {\r\n $this->offset = intval($offset);\r\n }", "public function setAnimated($value) {\r\n $this->animated = $value;\r\n }", "public function set($offset, $value);", "public function setOffset($offset) {\n $this->offset = (int)$offset;\n }", "public function animation($value)\n {\n return $this->setProperty('animation', $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetX($value) {\n return $this->setProperty('offsetX', $value);\n }", "public function offsetX($value) {\n return $this->setProperty('offsetX', $value);\n }", "public function setOffset($offset)\n {\n $this->vkarg_offset = $offset;\n\n return $this;\n }", "function __set ($name, $value)\n\t{\n\t\tswitch ($name) {\n\t\t\tcase \"name\":\n\t\t\tcase \"alt\":\n\t\t\tcase \"align\":\n\t\t\tcase \"codeBase\":\n\t\t\tcase \"archive\":\n\t\t\tcase \"code\":\n\t\t\tcase \"object\":\n\t\t\t\t$this->_setProperty($name, $value);\n\t\t\tbreak;\n\t\t\tcase \"width\":\n\t\t\tcase \"height\":\n\t\t\t\t$this->_setProperty($name, $value, \"intperc\");\n\t\t\tbreak;\n\t\t\tcase \"hspace\":\n\t\t\tcase \"vspace\":\n\t\t\t\t$this->_getProperty($name, (int) $value, \"int\", 0);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tparent::__set($name, $value);\n\t\t\tbreak;\n\t\t}\n\t}", "function setOffset($offset) {\n if ($offset !== ($oldOffset = $this->offset)) {\n $this->offset = $offset;\n $this->updateDataControlRecords();\n }\n }", "public function offsetY($value) {\n return $this->setProperty('offsetY', $value);\n }", "public function offsetY($value) {\n return $this->setProperty('offsetY', $value);\n }", "public function offsetSet($offset,$item)\n\t{\n\t\t$this->$offset=$item;\n\t}", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function setOffset($offset)\n {\n if ($offset < 1 || !is_int($offset)) {\n throw new \\InvalidArgumentException('setOffset() accepts only integers greater 0.', 1263387252);\n }\n $this->offset = $offset;\n\n return $this;\n }", "function setOffset($localVarName, $value) {\n $this->setSessionVariable($localVarName, \"offset\", $value);\n}", "public function px($value)\n {\n $this->args = array_merge($this->args, ['px' => $value]);\n\n return $this;\n }", "public function setOffset($offset)\n {\n $this->offsetStart = max(0, intval($offset));\n\n return $this;\n }", "public function setAttributes_price_factor_onetime_offset( $attributes_price_factor_onetime_offset ) {\n\t\t$this->attributes_price_factor_onetime_offset = $attributes_price_factor_onetime_offset;\n\t}", "public function offsetSet($offset, $value)\n\t{\n\t\t$this->properties[$offset] = $value;\n\t}", "public function __set($name, $value)\n { \n //set the attribute with the value\n $this->$name = $value;\n }", "public function setOffset(int $value): Get\n {\n $this->offset = $value;\n return $this;\n }", "public function setOffset(int $offset) : self\n {\n $this->offset = $offset;\n\n return $this;\n }", "public function setOffset($offset)\n {\n $this->offset = $offset;\n\n return $this;\n }", "public function setOffset($offset)\n {\n if (is_integer($offset)) {\n $this->request->appendToParameter('options', 'skp-' . $offset);\n }\n\n return $this;\n }", "private function setOffset()\n {\n $this->offset = ($this->limit * $this->currentPage) - $this->limit;\n }", "public function setPositionUnits($value) {\r\n if ($this->positionUnits != $value) {\r\n $this->positionUnits = $value;\r\n $this->invalidate();\r\n }\r\n }", "public function set($offset, $value = null);", "public function setAnimation($param){\n $this->_config_mapper(array('showAnim' => $param)); \n }", "public function offsetSet($offset, $value)\n {\n $method = 'set' . str_replace(\" \", \"\", ucwords(strtr($offset, \"_-\", \" \")));\n if(method_exists($this, $method)){\n $this->$method($value);\n }\n }", "public function offsetSet($offset, $value)\n\t{\n\t\t$this->{$offset} = $value;\n\t}", "public function offsetSet( $offset, $value ) {\r\n if ( ! is_null( $offset ) ) {\r\n $this->props[ $offset ] = $value;\r\n }\r\n }", "public static function setTimeCorrectionOffset($offset = 0)\n\t{\n\t\tif ($offset == 0)\n\t\t{\n\t\t\t$rest = new S3Request('HEAD');\n\t\t\t$rest = $rest->getResponse();\n\t\t\t$awstime = $rest->headers['date'];\n\t\t\t$systime = time();\n\t\t\t$offset = $systime > $awstime ? -($systime - $awstime) : ($awstime - $systime);\n\t\t}\n\t\tself::$__timeOffset = $offset;\n\t}", "function setSeeking($newSeeking){\n $this->seeking = $newSeeking;\n }", "public function set_attribute($name, $value)\n {\n }", "public function setAttribute($name, $value);", "public function offset($offset = \"\"){\n\t\t\tif(is_numeric($offset)){\n\t\t\t\t$this->offset = \" OFFSET :offset\";\n\t\t\t\t$this->addParam(\"offset\", $offset);\n\t\t\t}else{\n\t\t\t\t$this->offset = false;\n\t\t\t\tunset($this->parameters[\"offset\"]);\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function setOffsetFor($objectId, $generation, $offset) {}", "public function setDateOffAttribute($value, $offset)\n\t{\n//\t\t$dateUTC = Carbon::parse($date, 'UTC');\n\t\t$date_offset = timezone_name_from_abbr(\"\", $offset, 1);\t\t\t//Находит ближайшую (указанную в кавычках - если не указано ищет по смещению) аббревиатуру часового пояса в формате 'Europe/Kiev' по смещению в секундах, \"1\" - учитывает переход на летнее время\n\t\t$date = new DateTime($value, new DateTimeZone($date_offset));\n\t\t$date->format('Y-m-d H:i:sP');\n\t\t$date->setTimezone(new DateTimeZone('UTC'));\n\t\t$this->attributes['date_off'] = $date;\n\t\t$this->save();\n\t}", "public function offsetSet($offset, $value)\n {\n\n // add the data depending an offset has been passed or not\n if (is_null($offset)) {\n $offset = apc_inc($this->serial);\n }\n\n // store the data back to the property\n $this->__set($offset, $value);\n }", "public function setPosition()\n {\n // get the current position\n $currentX = $this->_pdf->getX();\n $currentY = $this->_pdf->getY();\n\n // save it\n $this->value['xc'] = $currentX;\n $this->value['yc'] = $currentY;\n\n if ($this->value['position']=='relative' || $this->value['position']=='absolute') {\n if ($this->value['right']!==null) {\n $x = $this->getLastWidth(true) - $this->value['right'] - $this->value['width'];\n if ($this->value['margin']['r']) $x-= $this->value['margin']['r'];\n } else {\n $x = $this->value['left'];\n if ($this->value['margin']['l']) $x+= $this->value['margin']['l'];\n }\n\n if ($this->value['bottom']!==null) {\n $y = $this->getLastHeight(true) - $this->value['bottom'] - $this->value['height'];\n if ($this->value['margin']['b']) $y-= $this->value['margin']['b'];\n } else {\n $y = $this->value['top'];\n if ($this->value['margin']['t']) $y+= $this->value['margin']['t'];\n }\n\n if ($this->value['position']=='relative') {\n $this->value['x'] = $currentX + $x;\n $this->value['y'] = $currentY + $y;\n } else {\n $this->value['x'] = $this->_getLastAbsoluteX()+$x;\n $this->value['y'] = $this->_getLastAbsoluteY()+$y;\n }\n } else {\n $this->value['x'] = $currentX;\n $this->value['y'] = $currentY;\n if ($this->value['margin']['l']) $this->value['x']+= $this->value['margin']['l'];\n if ($this->value['margin']['t']) $this->value['y']+= $this->value['margin']['t'];\n }\n\n // save the new position\n $this->_pdf->setXY($this->value['x'], $this->value['y']);\n }", "public function setRelativePosition($value) {\r\n $this->relativePosition = $this->setDoubleProperty($this->relativePosition, $value);\r\n }", "function __set($attr_name, $value) {\n // in $attr_name, replace _ with \" \"\n $attr_name = str_replace('_', ' ', $attr_name);\n $attr_name = ucwords($attr_name);\n $attr_name = str_replace(' ', '', $attr_name);\n $function = \"set$attr_name\";\n //var_dump($function);\n $this->$function($value);\n }", "public function offsetSet($offset, $value)\n {\n $this->params[$offset] = $value;\n }", "#[@fromDia(xpath= 'dia:attribute[@name=\"alignment\"]/dia:enum/@val', value= 'int')]\n public function setAlignment($alignment) {\n $this->setEnum('alignment', $alignment);\n }", "public function position($value) {\n return $this->setProperty('position', $value);\n }", "public function position($value) {\n return $this->setProperty('position', $value);\n }", "public function position($value) {\n return $this->setProperty('position', $value);\n }" ]
[ "0.6168638", "0.5744887", "0.5707283", "0.5609767", "0.5529855", "0.5511675", "0.54339004", "0.54339004", "0.54339004", "0.5429025", "0.5399287", "0.534377", "0.5242169", "0.52078575", "0.52078575", "0.5192283", "0.51782846", "0.51739156", "0.51705295", "0.5169396", "0.5169396", "0.5169396", "0.51573825", "0.51437", "0.5142778", "0.51234174", "0.51144034", "0.5108043", "0.5087336", "0.5083982", "0.5083982", "0.50735146", "0.5069618", "0.5064471", "0.50486094", "0.50486094", "0.5022347", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.5018822", "0.50142825", "0.50075024", "0.49685732", "0.49502698", "0.49266446", "0.49264616", "0.49213505", "0.48981118", "0.4892152", "0.4882493", "0.48580512", "0.48509485", "0.483654", "0.48353592", "0.4808246", "0.47902483", "0.47707108", "0.47424492", "0.47412306", "0.47384167", "0.47185123", "0.47159064", "0.47128558", "0.47076598", "0.46997303", "0.46884903", "0.46847454", "0.4671564", "0.4663931", "0.46570534", "0.46485922", "0.46458587", "0.46458587", "0.46458587" ]
0.0
-1
setter: Controls whether or not the animation is additive. Valid values: replace|sum
public function setAdditive($additive) { $this->attributes['additive'] = $additive; $this->additive = $additive; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAnimated($value) {\r\n $this->animated = $value;\r\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function effect1()\n {\n }", "public function animation($value)\n {\n return $this->setProperty('animation', $value);\n }", "public function setRepeat()\n {\n $this->repeat = true;\n }", "public function setGoal()\n {\n }", "public function setIsAdjustment($bool)\n\t{\n\t\treturn $this->setBooleanType('IsAdjustment', $bool);\n\t}", "public function setIsEffect($is_effect)\n {\n $this->is_effect = $is_effect;\n\n return $this;\n }", "public function effects($value)\n {\n return $this->setProperty('effects', $value);\n }", "public function setAddition($value)\n {\n if (!isset($this->data->amount->subtotals)) {\n $this->data->amount->subtotals = new stdClass();\n }\n $this->data->amount->subtotals->addition = (float) $value;\n\n return $this;\n }", "public function addInterlaced($value)\n {\n $this->addToFirstFrameWithoutProperty($value, 'interlaced');\n }", "abstract public function buildEffect();", "public function setIncrementing($value);", "function setScore($amount = 0)\n\t{\n\t\treturn $this->score += $amount;\n\t}", "public function setAccumulate($accumulate) {\n\t\t$this->attributes['accumulate'] = $accumulate;\n\t\t$this->accumulate = $accumulate;\n\t\treturn $this;\n\t}", "public static function animated()\n {\n return new FlagQualifier(self::ANIMATED);\n }", "public function setAnimation($param){\n $this->_config_mapper(array('showAnim' => $param)); \n }", "function conjugate() {\n $this->setI(-1 * $this->getI());\n $this->setJ(-1 * $this->getJ());\n $this->setK(-1 * $this->getK());\n }", "public function setOverwrite( bool $bool ) : Asset\n {\n if( !c\\BooleanValues::isBoolean( $bool ) )\n throw new e\\UnacceptableValueException( \n S_SPAN . \"The value $bool must be a boolean.\" . E_SPAN );\n \n $this->getProperty()->overwrite = $bool;\n \n return $this;\n }", "public function setAddition($addition)\n {\n $this->addition = $addition;\n\n return $this;\n }", "protected function translatableIndicator(?bool $add = null): bool\n {\n return is_null($add)\n ? $this->translatableIndicator\n : ($this->translatableIndicator = (bool) $add);\n }", "public function setMinDamage(){ $this->minDamage = 10; }", "public function setAdjustmentPositive($adjustmentPositive);", "public function isSequencedAnimation()\n {\n return $this->sequencedAnimation;\n }", "public function setGoal($goal)\n{\n$this->goal = $goal;\n\nreturn $this;\n}", "public function continuous () {\n\t\t$this->opts['continuous'] = true;\n\t\treturn $this;\n\t}", "public function additiveExpression(){\n try {\n // Sparql11query.g:425:3: ( multiplicativeExpression ( PLUS multiplicativeExpression | MINUS multiplicativeExpression | numericLiteralPositive | numericLiteralNegative )* ) \n // Sparql11query.g:426:3: multiplicativeExpression ( PLUS multiplicativeExpression | MINUS multiplicativeExpression | numericLiteralPositive | numericLiteralNegative )* \n {\n $this->pushFollow(self::$FOLLOW_multiplicativeExpression_in_additiveExpression1472);\n $this->multiplicativeExpression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:427:3: ( PLUS multiplicativeExpression | MINUS multiplicativeExpression | numericLiteralPositive | numericLiteralNegative )* \n //loop51:\n do {\n $alt51=5;\n $LA51 = $this->input->LA(1);\n if($this->getToken('PLUS')== $LA51)\n {\n $alt51=1;\n }\n else if($this->getToken('MINUS')== $LA51)\n {\n $alt51=2;\n }\n else if($this->getToken('INTEGER_POSITIVE')== $LA51||$this->getToken('DECIMAL_POSITIVE')== $LA51||$this->getToken('DOUBLE_POSITIVE')== $LA51)\n {\n $alt51=3;\n }\n else if($this->getToken('INTEGER_NEGATIVE')== $LA51||$this->getToken('DECIMAL_NEGATIVE')== $LA51||$this->getToken('DOUBLE_NEGATIVE')== $LA51)\n {\n $alt51=4;\n }\n\n\n\n switch ($alt51) {\n \tcase 1 :\n \t // Sparql11query.g:428:5: PLUS multiplicativeExpression \n \t {\n \t $this->match($this->input,$this->getToken('PLUS'),self::$FOLLOW_PLUS_in_additiveExpression1482); \n \t $this->pushFollow(self::$FOLLOW_multiplicativeExpression_in_additiveExpression1484);\n \t $this->multiplicativeExpression();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n \tcase 2 :\n \t // Sparql11query.g:429:7: MINUS multiplicativeExpression \n \t {\n \t $this->match($this->input,$this->getToken('MINUS'),self::$FOLLOW_MINUS_in_additiveExpression1492); \n \t $this->pushFollow(self::$FOLLOW_multiplicativeExpression_in_additiveExpression1494);\n \t $this->multiplicativeExpression();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n \tcase 3 :\n \t // Sparql11query.g:430:7: numericLiteralPositive \n \t {\n \t $this->pushFollow(self::$FOLLOW_numericLiteralPositive_in_additiveExpression1502);\n \t $this->numericLiteralPositive();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n \tcase 4 :\n \t // Sparql11query.g:431:7: numericLiteralNegative \n \t {\n \t $this->pushFollow(self::$FOLLOW_numericLiteralNegative_in_additiveExpression1510);\n \t $this->numericLiteralNegative();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop51;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function getAnimated()\r\n {\r\n return $this->animated;\r\n }", "public function animation($animation)\n {\n $this->option('animation', $animation);\n\n return $this;\n }", "public function animate() : Bootstrap4ProgressBarMultiple\n {\n $this->animate = true;\n\n return $this;\n }", "public function setIneffectiveAttribute($value)\n {\n $this->attributes['ineffective'] = $this->makeCollection($value);\n }", "function vcex_vc_map_add_css_animation( $args = array() ) {\n\n\t// Fallback pre VC 5.0\n\tif ( ! function_exists( 'vc_map_add_css_animation' ) ) {\n\n\t\t$animations = apply_filters( 'wpex_css_animations', array(\n\t\t\t'' => esc_html__( 'None', 'total') ,\n\t\t\t'top-to-bottom' => esc_html__( 'Top to bottom', 'total' ),\n\t\t\t'bottom-to-top' => esc_html__( 'Bottom to top', 'total' ),\n\t\t\t'left-to-right' => esc_html__( 'Left to right', 'total' ),\n\t\t\t'right-to-left' => esc_html__( 'Right to left', 'total' ),\n\t\t\t'appear' => esc_html__( 'Appear from center', 'total' ),\n\t\t) );\n\n\t\treturn array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => esc_html__( 'Appear Animation', 'total-theme-core' ),\n\t\t\t'param_name' => 'css_animation',\n\t\t\t'value' => array_flip( $animations ),\n\t\t\t'dependency' => array( 'element' => 'filter', 'value' => 'false' ),\n\t\t);\n\n\t}\n\n\t// New since VC 5.0.\n\t$defaults = array(\n\t\t'type' => 'animation_style',\n\t\t'heading' => esc_html__( 'CSS Animation', 'total-theme-core' ),\n\t\t'param_name' => 'css_animation',\n\t\t'value' => 'none',\n\t\t'std' => 'none',\n\t\t'settings' => array(\n\t\t\t'type' => 'in',\n\t\t\t'custom' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Default', 'total-theme-core' ),\n\t\t\t\t\t'values' => array(\n\t\t\t\t\t\tesc_html__( 'Top to bottom', 'total-theme-core' ) => 'top-to-bottom',\n\t\t\t\t\t\tesc_html__( 'Bottom to top', 'total-theme-core' ) => 'bottom-to-top',\n\t\t\t\t\t\tesc_html__( 'Left to right', 'total-theme-core' ) => 'left-to-right',\n\t\t\t\t\t\tesc_html__( 'Right to left', 'total-theme-core' ) => 'right-to-left',\n\t\t\t\t\t\tesc_html__( 'Appear from center', 'total-theme-core' ) => 'appear',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t\t'description' => esc_html__( 'Select a CSS animation for when the element \"enters\" the browser\\'s viewport. Note: Animations will not work with grid filters as it creates a conflict with re-arranging items.', 'total-theme-core' ) ,\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t/**\n\t * Filters the vc map CSS animation parameter args.\n\t *\n\t * @parray array $args\n\t */\n\t$args = apply_filters( 'vc_map_add_css_animation', $args );\n\n\treturn $args;\n}", "public function inc(): void {}", "public function setEffect( $effect ) {\n $this->effect = $effect;\n }", "public function setIntercept($toggle)\n {\n $this->intercept = (bool) $toggle;\n }", "protected function setAdditionAttributes(): bool\n {\n $this->model->setAttributes($this->additionAttributes, false);\n\n return true;\n }", "public function setFlags($flags, $add = true) {}", "public function setFlags($flags, $add = true) {}", "public function flag($name,$value=true) {\n\t\t$this->flags[$name] = $value;\n\t\tforeach($this->sets as $set) $set->switch_flags($name);\n\t}", "function tideways_prepend_overwritten()\n{\n}", "public function useYear($flag = false) {\n $this->use_year = ($flag !== false);\n }", "public function engordar($quilos){\n $this->peso = $this->peso + $quilos;\n}", "function add( $value ) {\n\t\t$this->source .= $value;\n\t\treturn $this;\n\t}", "public function testSetAnnulationTache() {\n\n $obj = new Collaborateurs();\n\n $obj->setAnnulationTache(true);\n $this->assertEquals(true, $obj->getAnnulationTache());\n }", "public function setNewFlux(){\n return true; \n }", "public function setSequencedAnimation($sequenced = true)\n {\n $this->sequencedAnimation = (bool) $sequenced;\n \n return $this;\n }", "public function addAnimation(array $params = array()) {\n if (!count($this->objects)) {\n throw new \\Exception(\"Add something to layout before animate it\");\n }\n $last_object_index = count($this->objects) - 1;\n $this->objects[$last_object_index][\"animation\"][] = $params;\n\n return $this;\n }", "public function update(): void\n {\n // Update quality\n $this->item->quality = self::QUALITY_MAX;\n }", "public function implement_all_effects()\n\t{\n\t\tforeach ($this->collection as $image)\n\t\t{\n\t\t\t$image->implement_effects();\n\t\t}\n\t}", "public function setAnimatedSteps($value) {\r\n $this->animatedSteps = $value;\r\n }", "public function setFx($fx)\n {\n $this->Fx = $fx;\n return $this;\n }", "public function getAdjustmentPositive();", "public function setItalic(?bool $value): void {\n $this->getBackingStore()->set('italic', $value);\n }", "public function setCirculante_A(){\n\t\t$this->Circulante_A = $this->getCaixa_e_Equivalentes_de_Caixa()\n\t\t+ $this->getContas_a_Receber_C()\n\t\t+ $this->getEstoques()\n\t\t+ $this->getOutros_Creditos()\n\t\t+ $this->getDespesas_do_Exercicio_Seguinte();\n\t}", "public function setIncremental($incremental = TRUE);", "public function update()\r\n {\r\n $this->x += $this->dx;\r\n $this->y += $this->dy;\r\n $this->z += $this->dz;\r\n }", "function setKeepWithNext() {\n\t\t$this->tableProp->setAttribute('fo:keep-with-next', 'always');\n\t}", "public function setWeight() {\n }", "public function makeGoal()\n\t\t{\n\t\t\t$this->estimated = 0;\n\t\t}", "public function setFlag($flag);", "public function set_value($value) {\n\t\t$this->_value = $value + 0;\n\t}", "public function getIsEffect()\n {\n return $this->is_effect;\n }", "public function resetOptimizationFlagCommand()\n {\n $this->imageManipulationService->resetOptimizationFlag();\n }", "function withAnyCase( $enable = true ) {\n\t\tif($enable)\n\t\t\t$this->addModifier('i');\n\t\telse\n\t\t\t$this->removeModifier('i');\n\n\t\treturn $this;\n\t}", "public static function getArrEndAnimations($all = true){\r\n\t\t$arrAnimations = array();\r\n\t\t$arrAnimations['custom'] = array('handle' => __('## Custom Animation ##', REVSLIDER_TEXTDOMAIN));\r\n\t\t$arrAnimations['auto'] = array('handle' => __('Automatic Reverse', REVSLIDER_TEXTDOMAIN));\r\n\t\t$arrAnimations['v5s'] = array('handle' => '-----------------------------------');\r\n\t\t$arrAnimations['v5'] = array('handle' => __('- VERSION 5.0 ANIMATIONS -', REVSLIDER_TEXTDOMAIN));\r\n\t\t$arrAnimations['v5e'] = array('handle' => '-----------------------------------');\r\n\r\n\t\t$arrAnimations['BounceOut'] = array('handle' => 'BounceOut','params' => '{\"movex\":\"inherit\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"0deg\",\"scalex\":\"0.7\",\"scaley\":\"0.7\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"true\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"easing\":\"Back.easeIn\",\"speed\":\"500\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['Fade-Out-Long'] = array('handle' => 'Fade-Out-Long','params' => '{\"movex\":\"inherit\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"easing\":\"Power2.easeIn\",\"speed\":\"1000\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SlideMaskToBottom'] = array('handle' => 'SlideMaskToBottom','params' => '{\"movex\":\"inherit\",\"movey\":\"[100%]\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"inherit\",\"mask_y\":\"inherit\",\"easing\":\"nothing\",\"speed\":\"300\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SlideMaskToLeft'] = array('handle' => 'SlideMaskToLeft','params' => '{\"movex\":\"[-100%]\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"inherit\",\"mask_y\":\"inherit\",\"easing\":\"Power3.easeInOut\",\"speed\":\"1000\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SlideMaskToRight'] = array('handle' => 'SlideMaskToRight','params' => '{\"movex\":\"[100%]\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"inherit\",\"mask_y\":\"inherit\",\"easing\":\"Power3.easeInOut\",\"speed\":\"1000\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SlideMaskToTop'] = array('handle' => 'SlideMaskToTop','params' => '{\"movex\":\"inherit\",\"movey\":\"[-100%]\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"inherit\",\"mask_y\":\"inherit\",\"easing\":\"nothing\",\"speed\":\"300\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SlurpOut'] = array('handle' => 'SlurpOut','params' => '{\"movex\":\"inherit\",\"movey\":\"[100%]\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"0deg\",\"scalex\":\"0.7\",\"scaley\":\"0.7\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"easing\":\"Power3.easeInOut\",\"speed\":\"1000\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['SmoothCropToBottom'] = array('handle' => 'SmoothCropToBottom','params' => '{\"movex\":\"inherit\",\"movey\":\"[175%]\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"true\",\"mask_x\":\"inherit\",\"mask_y\":\"inherit\",\"easing\":\"Power2.easeInOut\",\"speed\":\"1000\",\"split\":\"none\",\"splitdelay\":\"10\"}', 'settings' => array('version' => '5.0'));\r\n \r\n\t\t$arrAnimations['v4s'] = array('handle' => '-----------------------------------');\r\n\t\t$arrAnimations['v4'] = array('handle' => __('- VERSION 4.0 ANIMATIONS -', REVSLIDER_TEXTDOMAIN));\r\n\t\t$arrAnimations['v4e'] = array('handle' => '-----------------------------------');\r\n\t\t$arrAnimations['noanimout'] = array('handle' => 'No-Out-Animation','params' => '{\"movex\":\"inherit\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['fadeout'] = array('handle' => 'Fade-Out','params' => '{\"movex\":\"inherit\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"0\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['stt'] = array('handle' => 'Short-To-Top','params' => '{\"movex\":\"inherit\",\"movey\":\"-50px\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['stb'] = array('handle' => 'Short-To-Bottom','params' => '{\"movex\":\"inherit\",\"movey\":\"50px\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['stl'] = array('handle' => 'Short-To-Left','params' => '{\"movex\":\"-50px\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['str'] = array('handle' => 'Short-To-Right','params' => '{\"movex\":\"50px\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['ltr'] = array('handle' => 'Long-To-Right','params' => '{\"movex\":\"right\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['ltl'] = array('handle' => 'Long-To-Left','params' => '{\"movex\":\"left\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['ltt'] = array('handle' => 'Long-To-Top','params' => '{\"movex\":\"inherit\",\"movey\":\"top\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['ltb'] = array('handle' => 'Long-To-Bottom','params' => '{\"movex\":\"inherit\",\"movey\":\"bottom\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['skewtoleft'] = array('handle' => 'Skew-To-Long-Left','params' => '{\"movex\":\"left\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"45px\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['skewtoright'] = array('handle' => 'Skew-To-Long-Right','params' => '{\"movex\":\"right\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"-85px\",\"skewy\":\"inherit\",\"captionopacity\":\"inherit\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['skewtorightshort'] = array('handle' => 'Skew-To-Short-Right','params' => '{\"movex\":\"200px\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"-85px\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['skewtoleftshort'] = array('handle' => 'Skew-To-Short-Left','params' => '{\"movex\":\"-200px\",\"movey\":\"inherit\",\"movez\":\"inherit\",\"rotationx\":\"inherit\",\"rotationy\":\"inherit\",\"rotationz\":\"inherit\",\"scalex\":\"inherit\",\"scaley\":\"inherit\",\"skewx\":\"85px\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\t\t$arrAnimations['randomrotateout'] = array('handle' => 'Random-Rotate-Out','params' => '{\"movex\":\"{-250,250}\",\"movey\":\"{-150,150}\",\"movez\":\"inherit\",\"rotationx\":\"{-90,90}\",\"rotationy\":\"{-90,90}\",\"rotationz\":\"{-360,360}\",\"scalex\":\"{0,1}\",\"scaley\":\"{0,1}\",\"skewx\":\"inherit\",\"skewy\":\"inherit\",\"captionopacity\":\"0\",\"mask\":\"false\",\"mask_x\":\"0\",\"mask_y\":\"0\",\"mask_speed\":\"500\"}', 'settings' => array('version' => '5.0'));\r\n\r\n\t\tif($all){\r\n\t\t\t$arrAnimations['vss'] = array('handle' => '--------------------------------------');\r\n\t\t\t$arrAnimations['vs'] = array('handle' => __('- SAVED CUSTOM ANIMATIONS -', REVSLIDER_TEXTDOMAIN));\r\n\t\t\t$arrAnimations['vse'] = array('handle' => '--------------------------------------');\r\n\t\t\t//$custom = RevSliderOperations::getCustomAnimations('customout');\r\n\t\t\t$custom = RevSliderOperations::getCustomAnimationsFullPre('customout');\r\n\r\n\t\t\t$arrAnimations = array_merge($arrAnimations, $custom);\r\n\t\t}\r\n\t\t\r\n\t\tforeach($arrAnimations as $key => $value){\r\n\t\t\tif(!isset($value['params'])) continue;\r\n\t\t\t\r\n\t\t\t$t = json_decode(str_replace(\"'\", '\"', $value['params']), true);\r\n\t\t\tif(!empty($t))\r\n\t\t\t\t$arrAnimations[$key]['params'] = $t;\r\n\t\t}\r\n\t\treturn($arrAnimations);\r\n\t}", "public function setPropertyBehavior() {\n $this->isInPropertyBehavior= TRUE;\n }", "public function setRise($rise) {}", "public function setDecorate(bool $decorate): void;", "public function updateQuality(): void\n {\n $this->getItem()->quality = $this->getNewQuality();\n\n if ($this->isQualityOverHighestValue()) {\n $this->setToHighestQuality();\n }\n if ($this->isQualityUnderLowestValue()) {\n $this->setToLowestQuality();\n }\n }", "public function setIsWorkflowInEffect() {\n\t\t// if there is a workflow applied, we can't set the publishing date directly, only the 'desired' publishing date\n\t\t$effective = $this->workflowService->getDefinitionFor($this->owner);\n\t\t$this->isWorkflowInEffect = $effective?true:false;\n\t}", "private function __set_arm($arm) {\n # tau(r+1) - tau(r) episodes.\n $this->current_arm = $arm;\n $this->next_update += max(1.0, $this->__tau($this->r[$arm] + 1.0) - $this->__tau($this->r[$arm]));\n $this->r[$arm] += 1;\n }", "public function setSeconds(int|float|string $set): self {\n\t\t$this->duration = $this->parse($set);\n\t\tif ($this->duration < 0) {\n\t\t\t$this->duration = -$this->duration;\n\t\t\t$this->invert = true;\n\t\t} else {\n\t\t\t$this->invert = false;\n\t\t}\n\t\treturn $this;\n\t}", "public function setPrimaryEffectsAttribute($value)\n {\n $effects = [];\n\n // $value is an array of [0] = effect id, [1] = value\n if (is_array($value)) {\n array_push($effects, [\n 'effect_id' => Arr::get($value, 0),\n 'value' => Arr::get($value, 1),\n ]);\n }\n\n $this->attributes['primary_effects'] = !empty($value) && is_array($value) ? json_encode($effects) : null;\n }", "public function getArcsModifier();", "public function updateQuality() {\n\n if ($this->sellIn > 0) {\n //Not reached sellby date\n $this->quality -= 2;\n } else {\n //Passed sellby date, so decrease in quality twice as fast\n $this->quality -= 4;\n }\n\n //Quality cannot be less than zero\n if ($this->quality < 0){\n $this->quality = 0;\n }\n }", "public function withScores() {\n $this->withScores = 'WITHSCORES';\n return $this;\n }", "public function gain(){\r\n $actionPoint = $this->target->getActionPoint();\r\n $actionPoint = round($actionPoint / 2);\r\n\r\n $this->target->setActionPoint($actionPoint);\r\n $this->target->setTimestamp();\r\n\r\n self::getActionPoint();\r\n }", "public function setLogic($flag)\n {\n $this->_logic = (bool) $flag;\n }", "public function setPrefixEffectsAttribute($value)\n {\n $effects = [];\n\n // $value is an array of [0] = effect id, [1] = value\n if (is_array($value)) {\n array_push($effects, [\n 'effect_id' => Arr::get($value, 0),\n 'value' => Arr::get($value, 1),\n ]);\n }\n\n $this->attributes['prefix_effects'] = !empty($value) && is_array($value) ? json_encode($effects) : null;\n }", "public function updater_animations()\n {\n //return $this->hasOne('NationRegion','id','nation_region_id');\n return $this->hasMany('App\\Animation','updated_user','id');\n }", "function GetAnimation() {\n return ($this->GIF);\n }", "public function setAnnotationFlags($flags, $set = true) {}", "public function setDur($dur) {\n\t\t$this->attributes['dur'] = $dur;\n\t\t$this->dur = $dur;\n\t\treturn $this;\n\t}", "public function setIsModifier($isModifier) {\n $this->isModifier = $isModifier;\n return $this;\n }", "public function set_stupidly_fast($set = \\false)\n {\n }", "public function setCompressible(bool $isCompressible);", "function increase($num): void {\n $num +=2;\n}", "public function getIncrementing(){\n return false;\n }", "public function setIsMultiple($flag = true)\n {\n $this->_isMultiple = (bool) $flag;\n }", "public function increaseEffectDuration($Battleeffect, $sameHero = true) {\n $existingEffectIndex = $this->battleeffects->indexOf($Battleeffect, $sameHero);\n if($existingEffectIndex > -1) {\n $existingEffect = $this->battleeffects->itemAt($existingEffectIndex);\n $existingEffect->turns += $Battleeffect->turns;\n } else {\n // nothing or throw exception?\n }\n }", "public function set_add($param)\n\t{\n\t\t$this->add = (bool)$param;\n\t\treturn $this;\n\t}", "public function getEffect() {\n return $this->effect;\n }", "public function setInteractive($value)\n {\n $this->interactive = $value;\n }", "public function setBaseAdjustmentPositive($baseAdjustmentPositive);", "public function __set( $name, $value )\n\t{\n\t\t//\tThen behaviors\n\t\tforeach ( $this->_behaviorCache as $_behaviorName )\n\t\t{\n\t\t\tif ( ( $_behavior = $this->asa( $_behaviorName ) ) instanceof IPSOptionContainer && $_behavior->contains( $name ) )\n\t\t\t\treturn $_behavior->setValue( $name, $value );\n\t\t}\n\n\t\t//\tLet parent take a stab. He'll check getter/setters and Behavior methods\n\t\treturn parent::__set( $name, $value );\n\t}", "function setSumarPais(){\n\t\t$this->cantidad_paises++;\n\t}", "public function setQuantity($value)\n {\n $this->quantity = $value;\n $this->recalculate();\n }", "public function setRepeat($value) {\n $this->repeat= $value;\n }" ]
[ "0.5413882", "0.4737453", "0.4737453", "0.4737453", "0.46572694", "0.4655578", "0.46480614", "0.46404353", "0.46163407", "0.45575777", "0.45531964", "0.45508116", "0.45430493", "0.4511489", "0.45069647", "0.44596118", "0.44341323", "0.44317666", "0.44251168", "0.43985704", "0.43850175", "0.43702528", "0.4360475", "0.43536982", "0.4353483", "0.435255", "0.435083", "0.43408027", "0.43363884", "0.43314824", "0.43239623", "0.4313693", "0.429988", "0.42751288", "0.4275043", "0.4265087", "0.42574403", "0.4215347", "0.42120954", "0.42120954", "0.4204622", "0.41977912", "0.41959158", "0.417256", "0.41624585", "0.41476905", "0.4141252", "0.41374025", "0.41281384", "0.41230148", "0.41229653", "0.4116867", "0.41158667", "0.4098143", "0.40932763", "0.4085386", "0.4082149", "0.40720975", "0.40557393", "0.4055345", "0.40470526", "0.40445298", "0.40322673", "0.40315643", "0.403074", "0.40304682", "0.40187755", "0.4001494", "0.4001023", "0.3992323", "0.39894196", "0.3976838", "0.3976466", "0.39753473", "0.39748022", "0.39734864", "0.39720297", "0.39715028", "0.3970053", "0.39531502", "0.39522734", "0.39444393", "0.39414248", "0.3933469", "0.39327636", "0.39286005", "0.39239365", "0.39223403", "0.3917326", "0.3913554", "0.39128456", "0.3907369", "0.39058763", "0.39050597", "0.3902875", "0.38990438", "0.38982502", "0.389572", "0.38954502", "0.38903278" ]
0.55739313
0
setter: Controls whether or not the animation is cumulative. Valid values: none|sum
public function setAccumulate($accumulate) { $this->attributes['accumulate'] = $accumulate; $this->accumulate = $accumulate; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAnimated($value) {\r\n $this->animated = $value;\r\n }", "public function continuous () {\n\t\t$this->opts['continuous'] = true;\n\t\treturn $this;\n\t}", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value) {\n return $this->setProperty('animation', $value);\n }", "public function animation($value)\n {\n return $this->setProperty('animation', $value);\n }", "public function setAnimatedSteps($value) {\r\n $this->animatedSteps = $value;\r\n }", "public function isSequencedAnimation()\n {\n return $this->sequencedAnimation;\n }", "public function cumulativeNoparse($mode)\n {\n $this->parser_options['cumulative_noparse'] = $mode;\n\n return parent::cumulativeNoparse($mode);\n }", "public function getAnimated()\r\n {\r\n return $this->animated;\r\n }", "function makeCumulative(&$genelist) {\n $cumul = 0.0;\n foreach($genelist as $k=>&$v) {\n $cumul = $v += $cumul;\n }\n}", "public function setRepeat()\n {\n $this->repeat = true;\n }", "public function set_value($value) {\n\t\t$this->_value = $value + 0;\n\t}", "public function setFinished($value)\t\r\n\t{\r\n\t\tif ( is_bool($value) )\r\n\t\t{\r\n\t\t\t$this->finished = $value;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new \\InvalidArgumentException(\"param 1 must be of type bool\");\r\n\t\t}\r\n\t}", "public function setGoal()\n {\n }", "public function initTotalItemToBeShown($value) \n {\n $this->totalItemsToBeShown = (int)$value;\n return;\n }", "public function setTotalCalories($val){\n $this->totalCalories = $val;\n return $this;\n }", "public function setCalculateDiscountOnCreditMemos(?bool $value): void {\n $this->getBackingStore()->set('calculateDiscountOnCreditMemos', $value);\n }", "public function setAutomatic($value) {\r\n $this->automatic = $this->setBooleanProperty($this->automatic, $value);\r\n $this->automaticMinimum = $value;\r\n $this->automaticMaximum = $value;\r\n }", "public function setIncrementing($value);", "public function reprova()\n {\n $this -> estadoAtual -> reprova($this);\n }", "public function calc() {\n $this->getChildNodes(0, 0, 0);\n }", "public function set()\n {\n if ( ! $this->value ) {\n $this->generate();\n }\n }", "function plot_cirque($how,$total=null,$color=\"94BA65\",$label=\"\"){\n if($color==''){\n \n /*$col=array(\n \"94BA65\",\n \n \n );*/\n \n $color=\"94BA65\";\n }\n $html='<div class=\"cirque-stats\">';\n $tothtml=\"\";\n if(isset($total)and $total>0){\n $tothtml='data-total=\"'.$total.'\"';\n }\n $data_label='';\n if(strlen($label)>0){\n $data_label='data-label=\"'.$label.'\"';\n }\n $html.='<div class=\"ui-cirque\" data-value=\"'.$how.'\" '.$tothtml.' data-arc-color=\"#'.$color.'\" '.$data_label.'\"></div>';\n $html.='</div>';\n return $html;\n}", "function setDuration( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Duration = $value;\n }", "public function setCheckSumAdjustment($value) {}", "protected function calculateChange()\n {\n $difference = (int) $this->value['value'] - (int) $this->previous;\n\n // Prevent division by zero\n if ($difference !== 0) {\n $this->change = round(($difference / $this->value['value']) * 100, 2);\n } else {\n $this->change = 0;\n }\n\n if($this->previous && (int) $this->previous > 0){\n $this->changeLabel = abs($this->change) . '% ' . ($this->change > 0? 'Increase' : 'Decrease');\n }else{\n $this->changeLabel = 'No Prior Data';\n }\n }", "public function setAnimation($param){\n $this->_config_mapper(array('showAnim' => $param)); \n }", "public function set($value = null)\r\n {\r\n return parent::set((float)$value);\r\n }", "public function setZoomed($value) {\r\n $this->zoomed = $value;\r\n if (($this->chart->getParent() != null) && (!$this->zoomed)) {\r\n $this->chart->getParent()->doUnZoomed($this);\r\n }\r\n $this->invalidate();\r\n }", "public function setIncremental($incremental = TRUE);", "public function setIsCalculated($isCalculated)\n {\n $this->isCalculated = $isCalculated;\n return $this;\n }", "public function setNewFlux(){\n return true; \n }", "public function setPercentChange()\n {\n \n $previous = $this->last()->last->value;\n\n $this->each(function($item) use (&$previous){\n $current = $item->last->value;\n \n if(!isset($item->percentChange))\n $item->percentChange = self::percentChange($current, $previous); \n \n $previous = $item->last->value;\n }); \n \n }", "public function getAdjustmentPositive();", "function setSumarPais(){\n\t\t$this->cantidad_paises++;\n\t}", "public function setCalculation($calculation);", "public function setSequenceValue() { $args = func_get_args(); return $this->__call(__FUNCTION__, $args); }", "private function setIteration ()\n {\n ++$this->iterations;\n if ( $this->iterations % 100 == 0 ) {\n echo \"processed event queues since : \" . $this->startTime . \" value : \" . $this->iterations . PHP_EOL;\n }\n }", "public function calcTotal($bool = true)\n {\n $this->calcTotal = (bool)$bool;\n\n return $this;\n }", "public function setCalories($value)\n {\n $this->calories = $value;\n }", "public function setAddition($value)\n {\n if (!isset($this->data->amount->subtotals)) {\n $this->data->amount->subtotals = new stdClass();\n }\n $this->data->amount->subtotals->addition = (float) $value;\n\n return $this;\n }", "function setRemoved( $value )\n {\n $this->Removed = $value;\n }", "public function testSetCumNetImposable() {\n\n $obj = new Employes();\n\n $obj->setCumNetImposable(10.092018);\n $this->assertEquals(10.092018, $obj->getCumNetImposable());\n }", "public function setIsFinal($final)\n {\n $this->final = (bool) $final;\n }", "public function makeGoal()\n\t\t{\n\t\t\t$this->estimated = 0;\n\t\t}", "public function setFinal(bool $final): View {\r\n $this->final = $final;\r\n\r\n return $this;\r\n }", "public function setInteractive($value)\n {\n $this->interactive = $value;\n }", "public function makeCummulative(){\n //perform calculations...\n //insert new data into per day table...\n\n $cummulatives = PerHourLog::all();\n $totalNum = PerHourLog::all()->count();\n\n if(count($cummulatives)){\n $x = $a= $c = 0;\n foreach ($cummulatives as $cummulative) {\n $dispensing = $cummulative->dispensing;\n $outofservice = $cummulative->outofservice;\n $notdispensing = $cummulative->notdispensing;\n\n $y = $x + $dispensing;//Adds all dispensing\n $x = $y;\n\n $b = $a + $outofservice;//Adds all out of service\n $a = $b;\n\n $d = $c + $notdispensing;//Adds all dispensing\n $c = $d;\n \n }\n\n $allDispensing = $x;\n $cummDispensing = $allDispensing/$totalNum;\n\n $alloutOfService = $a;\n $cummoutOfService = $alloutOfService/$totalNum;\n\n $allnotDispensing = $c;\n $cummnotDispensing = $allnotDispensing/$totalNum;\n\n $DailyLog = new DailyLog;\n\n $DailyLog->dispensing = $cummDispensing;\n $DailyLog->outofservice = $cummoutOfService;\n $DailyLog->notdispensing = $cummnotDispensing;\n\n $DailyLog->save();\n\n //Delete all data from the per hour table..\n PerHourLog::getQuery()->delete();\n\n }\n\n }", "public function setNoEffectAttribute($value)\n {\n $this->attributes['no_effect'] = $this->makeCollection($value);\n }", "public function animate() : Bootstrap4ProgressBarMultiple\n {\n $this->animate = true;\n\n return $this;\n }", "public function setIsWorkflowInEffect() {\n\t\t// if there is a workflow applied, we can't set the publishing date directly, only the 'desired' publishing date\n\t\t$effective = $this->workflowService->getDefinitionFor($this->owner);\n\t\t$this->isWorkflowInEffect = $effective?true:false;\n\t}", "public function setProcessed()\r\n {\r\n $this->processed = true;\r\n }", "public function setTotalTime($val){\n $this->totalTime = $val;\n return $this;\n }", "public function setGrandTotal($amount);", "function setAutoRender($value) {\n $this->auto_render = (boolean) $value;\n }", "public function setTrendDelta()\n {\n $highLow = self::getHighLowByName($this->getName());\n $this->_trendDelta = $this->getRate() - $highLow->rate / $this->getRate();\n }", "public function setTotalCanceled($totalCanceled);", "function setAutoRender($value) {\r\n $this->auto_render = (boolean) $value;\r\n }", "public function setIsAdjustment($bool)\n\t{\n\t\treturn $this->setBooleanType('IsAdjustment', $bool);\n\t}", "public function setProgressNow(int $value)\n {\n $this->update(['progress_now' => $value]);\n }", "public function setClosed($value);", "public function setRepeat($value) {\n $this->repeat= $value;\n }", "public function setIncrement($value) {\r\n\r\n /** @todo RAISING EXCEPTIONS HERE FORCES DECLARING \"THROW\" EVERYWHERE! */\r\n// if ($value < 0) {\r\n// throw new TeeChartException(Language.getString(\"AxisIncrementNeg\"));\r\n// }\r\n\r\n //if (isDateTime()) System.Convert.ToDateTime($value).ToString();\r\n $this->desiredIncrement = $this->setDoubleProperty($this->desiredIncrement, $value);\r\n }", "public function setComputed($computed)\n {\n $this->computed = (bool) $computed;\n return $this;\n }", "public function getIncrementing(){\n return false;\n }", "protected function calidadImagenDefaut(){\r\n\t\t$this->calidadImagen=100;\r\n\t}", "function setComplete()\n {\n $this->complete = true;\n return $this;\n }", "public function setMinDamage(){ $this->minDamage = 10; }", "public function setCirculante_A(){\n\t\t$this->Circulante_A = $this->getCaixa_e_Equivalentes_de_Caixa()\n\t\t+ $this->getContas_a_Receber_C()\n\t\t+ $this->getEstoques()\n\t\t+ $this->getOutros_Creditos()\n\t\t+ $this->getDespesas_do_Exercicio_Seguinte();\n\t}", "function getAnimationState() {\n\t//Return\t\n\treturn (($_SESSION['animation']<>\"0\") ? \"1\" : \"0\");\n}", "public function setSequencedAnimation($sequenced = true)\n {\n $this->sequencedAnimation = (bool) $sequenced;\n \n return $this;\n }", "public function setTotal($value) {\n return $this->set(self::TOTAL, $value);\n }", "public function decreaseAmount(): void;", "private function compute()\n {\n if ($this->computed) {\n return true;\n }\n\n $this->load('items');\n\n foreach ($this->items as $item) {\n $this->_total += ($item->amount) / 100;\n $this->_gst += ($item->gst) / 100;\n $this->_pst += ($item->pst) / 100;\n }\n\n $this->computed = true;\n }", "public function effect1()\n {\n }", "public function getIsEffect()\n {\n return $this->is_effect;\n }", "public function getDisplayTaxAndDutyCumulatively()\n {\n return Mage::getStoreConfig('iparcel/tax/mode') == Iparcel_All_Model_System_Config_Source_Tax_Mode::CUMULATIVELY;\n }", "protected function onParentSet() : void\n {\n $value = $this->oFG->getData()->getValue($this->strName);\n $this->iValue = $value ? intval($value) : $this->iMin;\n }", "public function DiscussionModel_SetCalculatedFields_Handler($Sender) {\n\t\t// Only for members\n\t\tif (!Gdn::Session()->IsValid()) return;\n\t\t\n\t\t// Recalculate New count with each category's DateMarkedRead\n\t\t$Discussion = &$Sender->EventArguments['Discussion'];\n $Category = CategoryModel::Categories($Discussion->CategoryID);\n $CategoryLastDate = Gdn_Format::ToTimestamp($Category[\"DateMarkedRead\"]);\n if ($CategoryLastDate != 0)\n $this->CheckDiscussionDate($Discussion, $CategoryLastDate);\n \n\t}", "public function setPrice()\n {\n $price = $this->price;\n $outFix = $this->outFix;\n $outPer = $this->outPer;\n $inPer = $this->inPer;\n $inFix = $this->inFix;\n $flag = $this->flagInOut;\n if ($price < 1) {\n $sumIn = $outFix > 0 ? 1 + $outFix : 1; //outFix\n $sumIn = $outPer > 0 ? $sumIn + ($sumIn * $outPer / 100) : $sumIn; //outPer\n $sumIn = $sumIn / $price; // price\n $sumIn = $inFix > 0 ? $sumIn + $inFix : $sumIn;// inFix\n $ss = $sumIn * $inPer / 100;\n $sumIn = $inPer > 0 ? $sumIn + $ss : $sumIn;\n $this->in = $this->format_amount($sumIn);\n $this->out = $flag ? 1 : 0;\n } else {\n $val = $inFix > 0 ? 1 - $inFix : 1;\n $val = $inPer > 0 ? $val - $val * ($inPer / 100) : $val;\n $sumOut = $price * $val;\n $sumOut = $outFix > 0 ? $sumOut - $outFix : $sumOut;\n $sumOut = $outPer > 0 ? $sumOut - $outPer / 100 * $sumOut : $sumOut;\n $this->out = $this->format_amount($sumOut);\n $this->in = $flag ? 1 : 0;\n }\n $this->price = (float)$price;\n }", "private function calculatePoints()\n {\n $this->points += 100;\n $this->points = $this->points < 0 ? 0 : $this->points;\n }", "public function setTop($val)\n {\n $this->_propDict[\"top\"] = floatval($val);\n return $this;\n }", "protected function _setTotal($total = 0){\n\t\t$this->_total = $total;\n\t}", "public function dispense()\n {\n $this->sequence = 0;\n }", "public function setFixed() {\n }", "public function setQuantity($value)\n {\n $this->quantity = $value;\n $this->recalculate();\n }", "public function applyDefaultValues()\n {\n $this->montacargas_baja = 0;\n }", "function setRestarPais(){\n\t\t$this->cantidad_paises--;\n\t}", "public function setTotalImpactInMs(?int $value): void {\n $this->getBackingStore()->set('totalImpactInMs', $value);\n }", "public function deferRender(bool $value = true): static\n {\n $this->attributes['deferRender'] = $value;\n\n return $this;\n }", "public function cortesia()\n {\n $this->costo = 0;\n }", "public function cumulative($column){\r\n\t\t$pfx = $this->c->dbprefix;\r\n\t\t$conn = $this->conn();\r\n\r\n\t\t$sql = \"update \".$pfx.\"wls_question set \".$column.\" = \".$column.\"+1 where id = \".$this->id;\r\n\t\ttry{\r\n\t\t\tmysql_query($sql,$conn);\r\n\t\t\treturn true;\r\n\t\t}catch (Exception $ex){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function setUnmodified()\n {\n\t$this->modified= false;\n }", "public function updatePositiveCount() {\n\n\t}", "public function getBaseTotalCanceled();", "public function getIncreases() {\n return $this->_increases;\n }", "public function reset_pos() {\n\t\tFile::save( $this->_resetfile, time() , true );\n\n\t\t$this->_summary[ 'is_running' ] = 0;\n\t\tself::save_summary();\n\t}", "public function getBaseAdjustmentPositive();", "function GetAnimation() {\n return ($this->GIF);\n }" ]
[ "0.55405897", "0.5090709", "0.48481628", "0.48481628", "0.48481628", "0.4788987", "0.46734577", "0.4607019", "0.45495296", "0.4459894", "0.44503877", "0.44421944", "0.44351053", "0.44333872", "0.44155732", "0.43926743", "0.43657193", "0.43360013", "0.432845", "0.43272677", "0.432154", "0.43019798", "0.43011552", "0.42976665", "0.42935514", "0.42898592", "0.42887476", "0.4284705", "0.42804703", "0.42650485", "0.42566192", "0.42533186", "0.42486027", "0.42403615", "0.4233674", "0.42194852", "0.42155737", "0.42069486", "0.41977194", "0.41955394", "0.41942915", "0.41884577", "0.41675133", "0.4148761", "0.41406628", "0.41347834", "0.4116368", "0.4115078", "0.41122147", "0.40998256", "0.40984088", "0.4097104", "0.4087812", "0.40853477", "0.4057668", "0.4054875", "0.40542093", "0.40503573", "0.403802", "0.403379", "0.40331456", "0.4028873", "0.402215", "0.40137467", "0.4011987", "0.40004253", "0.39991623", "0.39969516", "0.39952734", "0.39922193", "0.3988833", "0.3987681", "0.39860263", "0.3978818", "0.39720505", "0.3970415", "0.39696768", "0.39673328", "0.39592877", "0.39562213", "0.39546618", "0.39519203", "0.39466116", "0.39455935", "0.3943991", "0.39372805", "0.39369413", "0.39279908", "0.39230135", "0.39180183", "0.39086783", "0.39061967", "0.3906194", "0.38996863", "0.38986856", "0.3896044", "0.38885972", "0.38838986", "0.38751656", "0.38746452" ]
0.45787326
8
Executed when the IProperty is attached to an entity.
public function onEntityAttach(IEntity $entity): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onEntityRepositoryAttach(IEntity $entity): void;", "public function postPersist(LifecycleEventArgs $args): void\n {\n $entity = $args->getEntity();\n\n if (property_exists($entity, self::UPDATED_AT_FIELD)) {\n $entity->setUpdatedAt(new \\DateTime());\n }\n }", "public function postLoad($entity);", "public function prePersist($entity);", "public function postPersist(LifecycleEventArgs $args): void\n {\n // Get the object and make sure it is what we need.\n $object = $args->getObject();\n if (!$object instanceof PublishableInterface) {\n return;\n }\n\n // Execute published event after the object is persisted.\n if ($object->isPublished()) {\n $event = new EntityPublishedEvent($object);\n $this->event_dispatcher->dispatch(EntityPublishedEvent::NAME, $event);\n }\n }", "public function appendAffectedObjectProperty(PropertyInterface $property)\n {\n $this->affectedObjectProperties[] = $property;\n }", "public function execute(Observer $observer)\n {\n /** @var \\Magento\\Eav\\Model\\Entity\\Attribute $attribute */\n $attribute = $observer->getEvent()->getData('attribute');\n if ($attribute->getFrontendInput() == 'smile_custom_entity') {\n $attribute->setFrontendModel(CustomEntity::class);\n }\n }", "public function postPersist($entity);", "public function Attach(&$entity)\n {\n \n }", "public function preUpdate($entity, PreUpdateEventArgs $eventArgs);", "public function postUpdate(LifecycleEventArgs $args): void\n {\n $entity = $args->getEntity();\n\n if (property_exists($entity, self::UPDATED_AT_FIELD)) {\n $entity->setUpdatedAt(new \\DateTime());\n }\n }", "public function postUpdate(LifecycleEventArgs $args): void\n {\n // Get the object and make sure it is what we need.\n $object = $args->getObject();\n if (!$object instanceof PublishableInterface) {\n return;\n }\n\n // Get the changeset from the unit of work.\n $uow = $args->getObjectManager()->getUnitOfWork();\n $changeset = $uow->getEntityChangeset($object);\n\n // If the published state changed fire the published event.\n if (isset($changeset['published'])\n && false === $changeset['published'][0]\n && true === $changeset['published'][1]) {\n $event = new EntityPublishedEvent($object);\n $this->event_dispatcher->dispatch(EntityPublishedEvent::NAME, $event);\n }\n }", "public function preUpdate(LifecycleEventArgs $args): void\n {\n $entity = $args->getEntity();\n\n if (property_exists($entity, self::UPDATED_AT_FIELD)) {\n $entity->setUpdatedAt(new \\DateTime());\n }\n }", "public function beforeUpdate(&$id, \\stdClass $data, Entity $entity) { }", "abstract public function property($propertyIdent);", "public function afterUpdate(&$id, \\stdClass $data, Entity $entity) { }", "public function setPropertyBehavior() {\n $this->isInPropertyBehavior= TRUE;\n }", "public function prePersist(LifecycleEventArgs $args): void\n {\n // Get the object and make sure it is what we need.\n $object = $args->getObject();\n if (!$object instanceof PublishableInterface) {\n return;\n }\n\n // Publish active objects immediately.\n if ($object->isActive()) {\n $object->setPublished(true);\n } else {\n $object->setPublished(false);\n }\n }", "public function postUpdate(LifecycleEventArgs $args)\n {\n $this->postPersist($args);\n }", "public function afterCreate(\\stdClass $data, Entity $entity) { }", "public function propertyChanged(object $sender, string $propertyName, $oldValue, $newValue);", "public function prePersist(LifecycleEventArgs $args): void\n {\n $entity = $args->getEntity();\n\n if (property_exists($entity, self::CREATED_AT_FIELD)) {\n $entity->setCreatedAt(new \\DateTimeImmutable());\n }\n\n if (property_exists($entity, self::UPDATED_AT_FIELD)) {\n $entity->setUpdatedAt(new \\DateTime());\n }\n\n if (($entity instanceof Offer || $entity instanceof Resume) && $user = $this->authService->getUserOrNull()) {\n $entity->setOwner($user);\n }\n }", "public function property($propertyIdent);", "public function postPersist(LifecycleEventArgs $args)\n {\n $this->indexingProduct($args);\n }", "public function postUpdate(LifecycleEventArgs $args)\n {\n $this->doctrineLog($args,\n array(\n 'action' => 'updated',\n 'level' => 'doctrine',\n ));\n }", "public function identifierChanged($sender, $propertyName, $oldValue, $newValue): void;", "public function postPersist(LifecycleEventArgs $eventArgs)\n {\n $entity = $eventArgs->getEntity();\n if ($entity instanceof View) {\n $em = $eventArgs->getEntityManager();\n $this->manageView($entity, $em, $em->getUnitOfWork());\n }\n }", "public function onSave()\n {\n if ($this->getPerson()->getEmail() === null) {\n throw new \\RuntimeException(\n 'A user entity\\'s related Person\\'s email property cannot be null'\n );\n }\n if (! $this->id) {\n $this->created = new \\DateTime();\n }\n }", "protected function attached( $obj )\n\t{\n\t\tparent::attached( $obj );\n\t\tDebugger::barDump($this, 'this scancode');\n\t\t$this->loadConfig();\n\t\tDebugger::barDump($this->config, 'this config');\n\t}", "public function postLoad(LifecycleEventArgs $eventArgs)\n {\n $this->dispatchEntityEvent($eventArgs->getEntity(), 'onPostLoad', [$eventArgs]);\n }", "public function postPersist(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n\n if ($entity instanceof SiteInterface && true === $entity->getEnableSourceReport()) {\n $defaultEMail = $entity->getPublisher()->getEmail();\n $this->eventDispatcher->dispatch(NewSourceConfigEvent::NAME, new NewSourceConfigEvent(array($defaultEMail), array($entity)));\n }\n\n }", "public function prePersist(EventArgs $args)\n {\n $om = $this->getObjectManager($args);\n $object = $this->getObject($args);\n $meta = $om->getClassMetadata(get_class($object));\n \n if ($config = $this->getConfiguration($om, $meta->name)) {\n $this->getStrategy($om, $meta->name)->processPrePersist($om, $object);\n }\n }", "protected function attached($component)\n\t{\n\t\tif ($component instanceof DataGrid\\DataGrid) {\n\t\t\t$this->setParent($component);\n\n\t\t\tif ($this->caption === NULL) {\n\t\t\t\t$this->caption = $this->getName();\n\t\t\t}\n\t\t}\n\t}", "public static function attached ($callback, $priority = 0) {\n static::registerModelEvent('attached', $callback, $priority);\n }", "public function postPersist(EventArgs $args)\n {\n $om = $this->getObjectManager($args);\n $object = $this->getObject($args);\n $meta = $om->getClassMetadata(get_class($object));\n \n if ($config = $this->getConfiguration($om, $meta->name)) {\n $this->getStrategy($om, $meta->name)->processPostPersist($om, $object);\n }\n }", "public function postPersist(LifecycleEventArgs $args)\n {\n $this->doctrineLog($args,\n array(\n 'action' => 'created',\n 'level' => 'doctrine',\n ));\n }", "public function prePersist(Event\\LifecycleEventArgs $eventArgs)\n {\n $memberId = $this->session->get('memberId') ?: 0;\n $entity = $eventArgs->getEntity();\n\n if (method_exists($entity, 'setAddedBy')) {\n $entity->setAddedBy($memberId);\n }\n\n if (method_exists($entity, 'setAddedOn')) {\n $entity->setAddedOn(time());\n }\n\n if ($entity instanceof EffectiveEntity) {\n // If EffectiveTime has not been explicitly set,\n // set it to time().\n $entity->setEffectiveTime($entity->getEffectiveTime() ?: time());\n } else {\n if (method_exists($entity, 'setModifiedBy')) {\n $entity->setModifiedBy($memberId);\n }\n\n if (method_exists($entity, 'setModifiedOn')) {\n $entity->setModifiedOn(time());\n }\n }\n }", "protected function notify($event, WorkflowEntityInterface $entity)\n {\n foreach ($this->observers as $observer) {\n $observer->$event($entity);\n }\n }", "public function postPersist(LifecycleEventArgs $args)\n {\n //$args is the object concerned by the evenement\n // if it's modified and flushed, it's intercepted there\n \n $entity = $args->getObject();\n $slugger = new Slugger;\n\n //If it's a Recipe Object\n if ($entity instanceof Recipe) {\n $recipe = $entity;\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($recipe->getName(), $recipe->getId());\n\n //Associate the new slug to the entity\n $recipe->setSlug($newSlug);\n\n $entityManager = $args->getObjectManager();\n $entityManager->flush();\n }\n }", "public function postPersist(LifecycleEventArgs $args): void {\n\t\tif(!$this->enableIndexing) {\n\t\t\treturn;\n\t\t}\n\t\t$this->updateEntity($args->getObject(), $args->getObjectManager());\n\t}", "public function triggerBeforeFind()\n {\n if (!$this->_beforeFindFired && $this->clause('action') === self::ACTION_READ) {\n /** @var \\Muffin\\Webservice\\Model\\Endpoint $endpoint */\n $endpoint = $this->getRepository();\n $this->_beforeFindFired = true;\n $endpoint->dispatchEvent('Model.beforeFind', [\n $this,\n new ArrayObject($this->_options),\n !$this->isEagerLoaded(),\n ]);\n }\n }", "public function prePersist()\n {\n }", "public function relationLoaded( $key );", "public function testPrePersist()\n {\n $obj = new DummyEntity();\n $class = new \\ReflectionClass($obj);\n\n $args = $this->getMockBuilder('Doctrine\\Common\\EventArgs')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->adapter\n ->expects($this->once())\n ->method('getObjectFromArgs')\n ->will($this->returnValue($obj));\n\n $this->adapter\n ->expects($this->once())\n ->method('getReflectionClass')\n ->will($this->returnValue($class));\n\n $uploadable = $this->getMockBuilder('Vich\\UploaderBundle\\Mapping\\Annotation\\Uploadable')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->driver\n ->expects($this->once())\n ->method('readUploadable')\n ->with($class)\n ->will($this->returnValue($uploadable));\n\n $this->storage\n ->expects($this->once())\n ->method('upload')\n ->with($obj);\n\n $this->injector\n ->expects($this->once())\n ->method('injectFiles')\n ->with($obj);\n\n $listener = new UploaderListener($this->adapter, $this->driver, $this->storage, $this->injector);\n $listener->prePersist($args);\n }", "public function prePersist(LifecycleEventArgs $args): void\n\t{\n\t\t$this->setSlug($args->getObject());\n\t}", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function testOnPreUpdatedOnPrePersist()\n {\n $eavDocument = new EavDocument();\n\n $this->assertNull($eavDocument->getCreatedAt());\n $this->assertNull($eavDocument->getModifiedAt());\n\n $eavDocument->onPrePersist();\n $eavDocument->onPreUpdate();\n\n $createdAt = $eavDocument->getCreatedAt();\n $this->assertInstanceOf(DateTime::class, $createdAt);\n\n $modifiedAt = $eavDocument->getModifiedAt();\n $this->assertInstanceOf(DateTime::class, $modifiedAt);\n }", "public function onInit()\n {\n if (!$this->object_key) {\n $this->object_key = get_class($this->owner);\n }\n if (!$this->owner->hasAttribute($this->statusColumn)) {\n\n throw new InvalidConfigException(\"Model {get_class($this->owner)} has not {$this->statusColumn} property. Set Behavior \\$statusColumn to status column name.\");\n }\n }", "public function propertyChanged($entity, $propertyName, $oldValue, $newValue)\n {\n $oid = spl_object_hash($entity);\n $class = $this->manager->getClassMetadata(get_class($entity));\n $isAssocField = $class->hasAssociation($propertyName);\n if (!$isAssocField && !$class->hasField($propertyName)) {\n return; // ignore non-persistent fields\n }\n // Update changeset and mark entity for synchronization\n $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue];\n if (!isset($this->scheduledForSynchronization[$class->getRootEntityName()][$oid])) {\n $this->scheduleForDirtyCheck($entity);\n }\n }", "public function preUpdate(LifecycleEventArgs $args): void\n {\n // Get the object and make sure it is what we need.\n $object = $args->getObject();\n if (!$object instanceof PublishableInterface) {\n return;\n }\n\n // Active unpublished objects should be published.\n if ($object->isActive() && !$object->isPublished()) {\n $object->setPublished(true);\n }\n }", "public function propertyObject($propertyIdent);", "public function __isset($property) {}", "public function postUpdate(LifecycleEventArgs $args)\n {\n //$args is the object concerned by the evenement\n // if it's modified and flushed, it's intercepted there\n $entity = $args->getObject();\n \n $slugger = new Slugger;\n\n //If it's a Recipe Object\n if($entity instanceof Recipe){\n\n $recipe = $entity;\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($recipe->getName(), $recipe->getId());\n \n //Associate the new slug to the entity\n $recipe->setSlug($newSlug);\n }\n //If it's an User Object\n elseif($entity instanceof User){\n \n $user = $entity;\n //Create a new slug for the user\n $newSlug = strtolower($user->getUsername());\n\n //Associate the new slug to the user\n $user->setSlug($newSlug);\n }\n //If it's an entity with a slug property other than Recipe\n elseif(property_exists($entity, 'slug')){\n\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($entity->getName());\n \n //Associate the new slug to the entity\n $entity->setSlug($newSlug);\n }\n }", "public function prePersist(LifecycleEventArgs $eventArgs)\n {\n $this->preUpdate($eventArgs);\n }", "public function preUpdate(\\Doctrine\\ODM\\MongoDB\\Event\\LifecycleEventArgs $eventArgs);", "public function prePersist(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n if ($entity instanceof WorkflowItem) {\n $this->updateWorkflowDefinition($args->getEntityManager(), $entity);\n }\n }", "public function pushEntity($entity): void\n {\n /** @var EntityRepository $repository */\n $repository = Prime::repository($entity);\n $mapper = $repository->mapper();\n\n $isReadOnly = $mapper->isReadOnly();\n $mapper->setReadOnly(false);\n\n $repository->disableEventNotifier();\n $repository->insert($entity);\n $repository->enableEventNotifier();\n\n $mapper->setReadOnly($isReadOnly);\n }", "public function triggerLazyLoad(string $propertyName): void\n {\n if (count($this->lazyLoaders)) {\n if (array_key_exists($propertyName, $this->lazyLoaders)) {\n if (!empty($this->lazyLoaders[$propertyName])) {\n $closure = $this->lazyLoaders[$propertyName];\n $value = $closure();\n $this->setValueObjectiphy($propertyName, $value);\n unset($this->lazyLoaders[$propertyName]);\n }\n }\n }\n }", "public function prePersist(LifecycleEventArgs $args)\n {\n $this->validator->validateWithException($args->getEntity());\n }", "public function register($property, $value) {\n $this->_events->register($property, $value);\n }", "protected function afterPopulate()\n {\n\n }", "protected function propertyExpression(Property $node): void\n {\n /** @var \\Flat3\\Lodata\\Property $property */\n $property = $node->getValue();\n\n if ($node instanceof Property\\Lambda) {\n $type = $this->entitySet->getType();\n\n /** @var DeclaredProperty $property */\n $property = $type->getProperty($node->getValue());\n }\n\n if (!$property || !$property->isFilterable()) {\n throw new BadRequestException(\n sprintf('The provided property (%s) is not filterable', $property->getName())\n );\n }\n\n $expression = $this->entitySet->propertyToExpression($property);\n $this->pushExpression($expression);\n }", "public function attach( Component $owner ) {\n\t\t$this->owner = $owner;\n\t\t$owner->attachBehavior( self::getClassName(), $this );\n\t}", "public function addProperty(Entities\\Devices\\Properties\\Property $property): void\n\t{\n\t\tif (!$this->properties->contains($property)) {\n\t\t\t// ...and assign it to collection\n\t\t\t$this->properties->add($property);\n\t\t}\n\t}", "public function onAfterWrite()\n {\n if ($this->owner->ImageID) {\n $this->owner->Image()->publishSingle();\n }\n }", "public function prePersist(LifecycleEventArgs $args)\n {\n $object = $args->getObject();\n if ($object instanceof UploadObjectInterface) {\n $this->prepareUploadFileReferences($object);\n }\n }", "public function testPostLoad()\n {\n $obj = new DummyEntity();\n $class = new \\ReflectionClass($obj);\n\n $args = $this->getMockBuilder('Doctrine\\Common\\EventArgs')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->adapter\n ->expects($this->once())\n ->method('getObjectFromArgs')\n ->will($this->returnValue($obj));\n\n $this->adapter\n ->expects($this->once())\n ->method('getReflectionClass')\n ->will($this->returnValue($class));\n\n $uploadable = $this->getMockBuilder('Vich\\UploaderBundle\\Mapping\\Annotation\\Uploadable')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->driver\n ->expects($this->once())\n ->method('readUploadable')\n ->with($class)\n ->will($this->returnValue($uploadable));\n\n $this->injector\n ->expects($this->once())\n ->method('injectFiles')\n ->with($obj);\n\n $listener = new UploaderListener($this->adapter, $this->driver, $this->storage, $this->injector);\n $listener->postLoad($args);\n }", "function set_property(){\n }", "public function onPrePersist()\r\n {\r\n $this->joinedTime = new \\DateTime();\r\n }", "public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }", "public function registerOnce($property, $value) {\n $this->_events->registerOnce($property, $value);\n }", "public function __set($property, $value) {}", "protected function _preSave(MetadataInterface $metaData, $exists, $identityField) {}", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n $this->updated = new \\DateTime(\"now\");\n }", "public function prePersist(LifecycleEventArgs $args)\n {\n $obj = $args->getDocument();\n \n $this->doPrePersist($obj);\n }", "function notify()\n {\n foreach ($this->observers as $obKey => $obValue) {\n $obValue->update($this);\n }\n }", "public function testPreUpdate()\n {\n $obj = new DummyEntity();\n $class = new \\ReflectionClass($obj);\n\n $args = $this->getMockBuilder('Doctrine\\Common\\EventArgs')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->adapter\n ->expects($this->once())\n ->method('getObjectFromArgs')\n ->will($this->returnValue($obj));\n\n $this->adapter\n ->expects($this->once())\n ->method('getReflectionClass')\n ->will($this->returnValue($class));\n\n $this->adapter\n ->expects($this->once())\n ->method('recomputeChangeSet')\n ->with($args);\n\n $uploadable = $this->getMockBuilder('Vich\\UploaderBundle\\Mapping\\Annotation\\Uploadable')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->driver\n ->expects($this->once())\n ->method('readUploadable')\n ->with($class)\n ->will($this->returnValue($uploadable));\n\n $this->storage\n ->expects($this->once())\n ->method('upload')\n ->with($obj);\n\n $this->injector\n ->expects($this->once())\n ->method('injectFiles')\n ->with($obj);\n\n $listener = new UploaderListener($this->adapter, $this->driver, $this->storage, $this->injector);\n $listener->preUpdate($args);\n }", "public function onFlush($entity, $uowEntityState, UnitOfWork $uow);", "public function postSave(EntityEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function postPersist(LifecycleEventArgs $event)\n {\n $entity = $event->getEntity();\n $this->processUploads($entity);\n }", "protected function fireAttributeEvents()\n {\n foreach($this->getAttributeEvents() as $attributeValue => $classOrMethod) {\n [$attribute, $v] = explode(':', $attributeValue);\n\n // Skip if the attribute does not exist or if it has not been changed\n if(!array_key_exists($attribute, $this->attributes)) continue;\n if(!$this->isDirty($attribute)) continue;\n\n // Get the value of the attribute\n $value = $this->getAttributeValue($attribute);\n\n // Decide if we are to fire the event based on if the value matches the specified attribute event\n if($v === '*' // Any - always call no matter what the value is\n || $v === 'true' && $value === true // bool(true)\n || $v === 'false' && $value === false // bool(false)\n || is_numeric($v) && strpos($v, '.') !== false && $value === (float) $v // float\n || is_numeric($v) && $value === (int) $v // int\n || $v === $value\n ) {\n $this->fireModelEvent($attribute, false);\n }\n }\n }", "protected function afterSave(EntityInterface $entity): void\n {\n $argv = compact('entity');\n $argv = $this->getEventManager()->prepareArgs($argv);\n\n $this->getEventManager()->trigger(\"{$this->event_prefix}_save_after\", $this, $argv);\n if ($this->entity_event_prefix) {\n $this->getEventManager()->trigger(\"{$this->entity_event_prefix}_save_after\", $this, $argv);\n }\n }", "public function preUpdate(LifecycleEventArgs $args)\n {\n $this->validator->validateWithException($args->getEntity());\n }", "function attached(&$observer)\n {\n return isset($this->observers[$observer->getHashCode()]);\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function onBeforeSave();", "public function onBeforeWrite() {\n\t\tparent::onBeforeWrite();\n\t\t\n\t\tswitch($this->TriggerType) {\n\t\t\tcase 'WhenItemSaved':\n\t\t\t\tforeach($this->Facts() as $fact) {\n\t\t\t\t\tif($fact->Temporal) {\n\t\t\t\t\t\t$this->TriggerType = 'WhenTimePassed';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'WhenTimePassed':\n\t\t\t\t$temporal = false;\n\t\t\t\tforeach($this->Facts() as $fact) {\n\t\t\t\t\tif($fact->Temporal) {\n\t\t\t\t\t\t$temporal = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$temporal) {\n\t\t\t\t\t$this->TriggerType = 'WhenItemSaved';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function prePersist(LifecycleEventArgs $args): void\n {\n $this->setPassword('persist', $args);\n }", "public function fire()\n {\n parent::fire();\n }", "public function fire()\n {\n parent::fire();\n }", "public function bootRevisionable()\n {\n if (!property_exists(get_class($this->model), 'revisionable') && !$this->model->getDynamicProperties()['revisionable']) {\n throw new Exception(sprintf(\n 'You must define a $revisionable property in %s to use the Revisionable behavior.',\n get_class($this->model)\n ));\n }\n\n $this->model->bindEvent('model.afterUpdate', function () {\n $this->model->revisionableAfterUpdate();\n });\n\n $this->model->bindEvent('model.afterDelete', function () {\n $this->model->revisionableAfterDelete();\n });\n }", "private function relationshipWasCreated()\n {\n $this->info(\"The relationship \\\"{$this->type}\\\" was created\");\n }", "public function prePersist(LifecycleEventArgs $args): void\n {\n //$args->getObject()->computeSlug($this->slugger);\n }", "public function prePersist(LifecycleEventArgs $args)\n {\n $em = $args->getEntityManager();\n $entity = $args->getEntity();\n\n if ($config = $this->getConfiguration($em, get_class($entity))) {\n $this->_generateSlug($em, $entity, false);\n }\n }", "public function __isset($property){\n echo isset($this->$property);\n }", "public function postLoad(LifecycleEventArgs $event)\n {\n $entity = $event->getEntity();\n\n if (! ($entity instanceof Menu)) {\n return;\n }\n\n $builder = $this->builderRegistry->getBuilder($entity->getType());\n $entity->setBuilder($builder);\n }", "public function property(&$class, $property);", "public function postLoad(LifecycleEventArgs $event)\n {\n $entity = $event->getEntity();\n $this->hydrateUploads($entity);\n }" ]
[ "0.6246739", "0.54009426", "0.53688914", "0.53679645", "0.5353164", "0.5186232", "0.5125274", "0.5122279", "0.506296", "0.5047489", "0.50377864", "0.5014221", "0.49707687", "0.49219653", "0.49144474", "0.48536116", "0.48480183", "0.48477426", "0.48410198", "0.481853", "0.48036242", "0.48017675", "0.48010325", "0.47893798", "0.47535357", "0.47360906", "0.47324005", "0.47297326", "0.47273237", "0.47102064", "0.47077787", "0.4699299", "0.46935177", "0.46844655", "0.46823382", "0.46770138", "0.46739087", "0.4666512", "0.46611762", "0.46429977", "0.4623151", "0.4604279", "0.4596661", "0.45930225", "0.45748228", "0.45732313", "0.45732313", "0.45651037", "0.45435327", "0.45340562", "0.45294842", "0.45251882", "0.45235974", "0.45233178", "0.45213842", "0.45178086", "0.45129994", "0.4495865", "0.44896016", "0.4485384", "0.44853196", "0.44792277", "0.44787464", "0.44783995", "0.44755605", "0.44713256", "0.44691312", "0.44620895", "0.4459418", "0.44593376", "0.4450342", "0.44472033", "0.44395524", "0.44340518", "0.44284374", "0.44265553", "0.44260544", "0.4420688", "0.44199535", "0.4411527", "0.4409443", "0.44046846", "0.44042146", "0.4401186", "0.4395534", "0.43923017", "0.43916118", "0.4383007", "0.4381217", "0.43795562", "0.43785042", "0.43785042", "0.43719363", "0.4366888", "0.4366214", "0.4361807", "0.43617812", "0.4357469", "0.4357059", "0.43565488" ]
0.65211046
0
Executed when the entity is attached to the repository.
public function onEntityRepositoryAttach(IEntity $entity): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onEntityAttach(IEntity $entity): void;", "public function postPersist($entity);", "public function postPersist(LifecycleEventArgs $args): void\n {\n // Get the object and make sure it is what we need.\n $object = $args->getObject();\n if (!$object instanceof PublishableInterface) {\n return;\n }\n\n // Execute published event after the object is persisted.\n if ($object->isPublished()) {\n $event = new EntityPublishedEvent($object);\n $this->event_dispatcher->dispatch(EntityPublishedEvent::NAME, $event);\n }\n }", "public function prePersist($entity);", "public function postLoad($entity);", "public function postPersist(LifecycleEventArgs $args): void\n {\n $entity = $args->getEntity();\n\n if (property_exists($entity, self::UPDATED_AT_FIELD)) {\n $entity->setUpdatedAt(new \\DateTime());\n }\n }", "public function Attach(&$entity)\n {\n \n }", "public function postPersist(LifecycleEventArgs $args)\n {\n $this->doctrineLog($args,\n array(\n 'action' => 'created',\n 'level' => 'doctrine',\n ));\n }", "public function postSave(EntityEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }", "public function persist()\n {\n\n $this->persistor->persist(\n $this->event,\n $this->relatedEntities,\n $this->eventRequest->getApplication(),\n $this->eventRequest->getAccount(),\n $this->eventRequest->getProduct(),\n $this->eventRequest->appendCustomer\n );\n\n }", "public function afterCreate(\\stdClass $data, Entity $entity) { }", "public function postPersist(LifecycleEventArgs $args)\n {\n //$args is the object concerned by the evenement\n // if it's modified and flushed, it's intercepted there\n \n $entity = $args->getObject();\n $slugger = new Slugger;\n\n //If it's a Recipe Object\n if ($entity instanceof Recipe) {\n $recipe = $entity;\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($recipe->getName(), $recipe->getId());\n\n //Associate the new slug to the entity\n $recipe->setSlug($newSlug);\n\n $entityManager = $args->getObjectManager();\n $entityManager->flush();\n }\n }", "public function postUpdate(LifecycleEventArgs $args)\n {\n $this->doctrineLog($args,\n array(\n 'action' => 'updated',\n 'level' => 'doctrine',\n ));\n }", "public function postPersist(LifecycleEventArgs $args): void {\n\t\tif(!$this->enableIndexing) {\n\t\t\treturn;\n\t\t}\n\t\t$this->updateEntity($args->getObject(), $args->getObjectManager());\n\t}", "public function prePersist()\n {\n }", "public function postUpdate(LifecycleEventArgs $args): void\n {\n // Get the object and make sure it is what we need.\n $object = $args->getObject();\n if (!$object instanceof PublishableInterface) {\n return;\n }\n\n // Get the changeset from the unit of work.\n $uow = $args->getObjectManager()->getUnitOfWork();\n $changeset = $uow->getEntityChangeset($object);\n\n // If the published state changed fire the published event.\n if (isset($changeset['published'])\n && false === $changeset['published'][0]\n && true === $changeset['published'][1]) {\n $event = new EntityPublishedEvent($object);\n $this->event_dispatcher->dispatch(EntityPublishedEvent::NAME, $event);\n }\n }", "public function postPersist(LifecycleEventArgs $eventArgs)\n {\n $entity = $eventArgs->getEntity();\n if ($entity instanceof View) {\n $em = $eventArgs->getEntityManager();\n $this->manageView($entity, $em, $em->getUnitOfWork());\n }\n }", "public function postPersist(EventArgs $args)\n {\n $om = $this->getObjectManager($args);\n $object = $this->getObject($args);\n $meta = $om->getClassMetadata(get_class($object));\n \n if ($config = $this->getConfiguration($om, $meta->name)) {\n $this->getStrategy($om, $meta->name)->processPostPersist($om, $object);\n }\n }", "public function pushEntity($entity): void\n {\n /** @var EntityRepository $repository */\n $repository = Prime::repository($entity);\n $mapper = $repository->mapper();\n\n $isReadOnly = $mapper->isReadOnly();\n $mapper->setReadOnly(false);\n\n $repository->disableEventNotifier();\n $repository->insert($entity);\n $repository->enableEventNotifier();\n\n $mapper->setReadOnly($isReadOnly);\n }", "public function postUpdate(LifecycleEventArgs $args)\n {\n $this->postPersist($args);\n }", "public function postLoad(LifecycleEventArgs $eventArgs)\n {\n $this->dispatchEntityEvent($eventArgs->getEntity(), 'onPostLoad', [$eventArgs]);\n }", "public function postPersist(LifecycleEventArgs $event)\n {\n $entity = $event->getEntity();\n $this->processUploads($entity);\n }", "public function crudSaved(Entity $entity)\n {\n $this->saveTags($entity);\n }", "public function postUpdate(LifecycleEventArgs $args): void\n {\n $entity = $args->getEntity();\n\n if (property_exists($entity, self::UPDATED_AT_FIELD)) {\n $entity->setUpdatedAt(new \\DateTime());\n }\n }", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function afterFindOne(&$id, Entity $entity = null) { }", "public function afterSaveCommit(): void\n {\n }", "public function onAfterSave();", "public function onAfterDelete()\n {\n parent::onAfterDelete();\n $this->createAudit($this->owner->toMap());\n }", "public function postPersist(LifecycleEventArgs $args)\n {\n $this->indexingProduct($args);\n }", "protected function onBeforeSave()\n {\n }", "public function persist($entity)\n {\n }", "public function onSave()\n {\n if ($this->getPerson()->getEmail() === null) {\n throw new \\RuntimeException(\n 'A user entity\\'s related Person\\'s email property cannot be null'\n );\n }\n if (! $this->id) {\n $this->created = new \\DateTime();\n }\n }", "public function afterSave()\n {\n\n }", "public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }", "public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }", "public function prePersist(LifecycleEventArgs $args): void\n {\n $entity = $args->getEntity();\n\n if (property_exists($entity, self::CREATED_AT_FIELD)) {\n $entity->setCreatedAt(new \\DateTimeImmutable());\n }\n\n if (property_exists($entity, self::UPDATED_AT_FIELD)) {\n $entity->setUpdatedAt(new \\DateTime());\n }\n\n if (($entity instanceof Offer || $entity instanceof Resume) && $user = $this->authService->getUserOrNull()) {\n $entity->setOwner($user);\n }\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime('now');\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "public function prePersist()\n {\n $this->created = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function hooked()\n {\n $this->setData();\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function prePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n $this->updated = new \\DateTime(\"now\");\n }", "public function add(object $entity): void\n {\n }", "public function onAfterStructure() {\n $this->events->fire('updateModel_afterStructure', $this);\n }", "public function testPostLoad()\n {\n $obj = new DummyEntity();\n $class = new \\ReflectionClass($obj);\n\n $args = $this->getMockBuilder('Doctrine\\Common\\EventArgs')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->adapter\n ->expects($this->once())\n ->method('getObjectFromArgs')\n ->will($this->returnValue($obj));\n\n $this->adapter\n ->expects($this->once())\n ->method('getReflectionClass')\n ->will($this->returnValue($class));\n\n $uploadable = $this->getMockBuilder('Vich\\UploaderBundle\\Mapping\\Annotation\\Uploadable')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->driver\n ->expects($this->once())\n ->method('readUploadable')\n ->with($class)\n ->will($this->returnValue($uploadable));\n\n $this->injector\n ->expects($this->once())\n ->method('injectFiles')\n ->with($obj);\n\n $listener = new UploaderListener($this->adapter, $this->driver, $this->storage, $this->injector);\n $listener->postLoad($args);\n }", "public function postUpdate(LifecycleEventArgs $args)\n {\n //$args is the object concerned by the evenement\n // if it's modified and flushed, it's intercepted there\n $entity = $args->getObject();\n \n $slugger = new Slugger;\n\n //If it's a Recipe Object\n if($entity instanceof Recipe){\n\n $recipe = $entity;\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($recipe->getName(), $recipe->getId());\n \n //Associate the new slug to the entity\n $recipe->setSlug($newSlug);\n }\n //If it's an User Object\n elseif($entity instanceof User){\n \n $user = $entity;\n //Create a new slug for the user\n $newSlug = strtolower($user->getUsername());\n\n //Associate the new slug to the user\n $user->setSlug($newSlug);\n }\n //If it's an entity with a slug property other than Recipe\n elseif(property_exists($entity, 'slug')){\n\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($entity->getName());\n \n //Associate the new slug to the entity\n $entity->setSlug($newSlug);\n }\n }", "protected function afterSave() {\n\n }", "public function postPersist(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n\n if ($entity instanceof SiteInterface && true === $entity->getEnableSourceReport()) {\n $defaultEMail = $entity->getPublisher()->getEmail();\n $this->eventDispatcher->dispatch(NewSourceConfigEvent::NAME, new NewSourceConfigEvent(array($defaultEMail), array($entity)));\n }\n\n }", "public function onFlush($entity, $uowEntityState, UnitOfWork $uow);", "public function preUpdate($entity, PreUpdateEventArgs $eventArgs);", "public function execute(Observer $observer)\n {\n /** @var \\Magento\\Eav\\Model\\Entity\\Attribute $attribute */\n $attribute = $observer->getEvent()->getData('attribute');\n if ($attribute->getFrontendInput() == 'smile_custom_entity') {\n $attribute->setFrontendModel(CustomEntity::class);\n }\n }", "public function onExtBaseObjectPersisting(EntityPersistedEvent $event): void\n {\n $this->clearWithTags(CacheUtil::stringifyTag($event->getObject()));\n }", "public function postUpdate(LifecycleEventArgs $event)\n {\n $entity = $event->getEntity();\n $this->processUploads($entity);\n }", "public function afterUpdate(&$id, \\stdClass $data, Entity $entity) { }", "public function postPersist(LifecycleEventArgs $args)\n {\n $object = $args->getObject();\n if ($object instanceof UploadObjectInterface) {\n $this->storeFileUploads($object);\n }\n }", "public function onBeforeSave();", "public function markAsPersisted(): void;", "public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }", "public function prePersist(EventArgs $args)\n {\n $om = $this->getObjectManager($args);\n $object = $this->getObject($args);\n $meta = $om->getClassMetadata(get_class($object));\n \n if ($config = $this->getConfiguration($om, $meta->name)) {\n $this->getStrategy($om, $meta->name)->processPrePersist($om, $object);\n }\n }", "public function Add($entity) {\n }", "public function prePersist()\n {\n $this->date_created = new \\DateTime();\n }", "public function prePersist(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n// $entityManager = $args->getEntityManager();\n// $className = $entityManager->getClassMetadata(get_class($entity))->getName();\n\n if ($entity instanceof Files){\n $entity->setName(uniqid());\n $entity->setCreatedAt($this->setupCreatedAt($entity));\n\n return;\n }\n }", "public function onPrePersist()\n {\n $now = new \\DateTime();\n $this->setCreatedAt($now);\n $this->setUpdatedAt($now);\n }", "public function onPrePersist()\n {\n $this->setCreated(new \\DateTime(\"now\"));\n }", "public function afterSave(){\n\t}", "public function preUpdate(\\Doctrine\\ODM\\MongoDB\\Event\\LifecycleEventArgs $eventArgs);", "public function postLoad(LifecycleEventArgs $event)\n {\n $entity = $event->getEntity();\n $this->hydrateUploads($entity);\n }", "public function postUpdate(LifecycleEventArgs $args): void {\n\t\tif(!$this->enableIndexing) return;\n\t\t$this->updateEntity($args->getObject(), $args->getObjectManager());\n\t}", "public function prePersist(LifecycleEventArgs $args): void\n\t{\n\t\t$this->setSlug($args->getObject());\n\t}", "public function postLoad(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n\n if ($entity instanceof Files){\n\n return;\n }\n }", "public function onPrePersist()\n {\n $this->status = 1;\n $this->createdDateTime = new \\DateTime(\"now\");\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }", "public function after_update() {}", "public function prePersist()\n {\n $this->dateCreation = new \\DateTime();\n }", "public function onAfterWrite()\n {\n if ($this->owner->ImageID) {\n $this->owner->Image()->publishSingle();\n }\n }", "public function prePersist(Event\\LifecycleEventArgs $eventArgs)\n {\n $memberId = $this->session->get('memberId') ?: 0;\n $entity = $eventArgs->getEntity();\n\n if (method_exists($entity, 'setAddedBy')) {\n $entity->setAddedBy($memberId);\n }\n\n if (method_exists($entity, 'setAddedOn')) {\n $entity->setAddedOn(time());\n }\n\n if ($entity instanceof EffectiveEntity) {\n // If EffectiveTime has not been explicitly set,\n // set it to time().\n $entity->setEffectiveTime($entity->getEffectiveTime() ?: time());\n } else {\n if (method_exists($entity, 'setModifiedBy')) {\n $entity->setModifiedBy($memberId);\n }\n\n if (method_exists($entity, 'setModifiedOn')) {\n $entity->setModifiedOn(time());\n }\n }\n }", "public function prePersist(LifecycleEventArgs $args): void\n {\n //$args->getObject()->computeSlug($this->slugger);\n }", "function onSave()\n {\n $object = parent::onSave();\n }", "public function prePersist(LifecycleEventArgs $eventArgs)\n {\n $this->preUpdate($eventArgs);\n }", "public function add($entity)\n {\n $this->getEventDispatcher()->dispatch(\n TrackingHistoryEvents::PRE_CREATE,\n new TrackingHistoryEvent($entity)\n );\n\n parent::add($entity);\n\n $this->getEventDispatcher()->dispatch(\n TrackingHistoryEvents::POST_CREATE,\n new TrackingHistoryEvent($entity)\n );\n }", "public function prePersist(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n if ($entity instanceof WorkflowItem) {\n $this->updateWorkflowDefinition($args->getEntityManager(), $entity);\n }\n }", "public function prePersist(LifecycleEventArgs $args)\n {\n $object = $args->getObject();\n if ($object instanceof UploadObjectInterface) {\n $this->prepareUploadFileReferences($object);\n }\n }", "public function nodePostSave(EntityEvent $event) {\n $node = $event->getEntity();\n\n // By default, workbench_moderation delays calling node_save() on new\n // revisions until the PHP proc is being shutdown.\n if (module_exists('workbench_moderation') && !empty($node->workbench_moderation['published'])) {\n workbench_moderation_store($node);\n }\n }", "protected function afterSave(EntityInterface $entity): void\n {\n $argv = compact('entity');\n $argv = $this->getEventManager()->prepareArgs($argv);\n\n $this->getEventManager()->trigger(\"{$this->event_prefix}_save_after\", $this, $argv);\n if ($this->entity_event_prefix) {\n $this->getEventManager()->trigger(\"{$this->entity_event_prefix}_save_after\", $this, $argv);\n }\n }", "public function preUpdate(LifecycleEventArgs $args): void\n {\n $entity = $args->getEntity();\n\n if (property_exists($entity, self::UPDATED_AT_FIELD)) {\n $entity->setUpdatedAt(new \\DateTime());\n }\n }", "public function afterSave() \n {\n LogProduct::log($this);\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n $this->updatedAt = new \\DateTime(\"now\");\n $this->setTotalAmounts();\n }", "public function prePersist(LifecycleEventArgs $args): void\n {\n // Get the object and make sure it is what we need.\n $object = $args->getObject();\n if (!$object instanceof PublishableInterface) {\n return;\n }\n\n // Publish active objects immediately.\n if ($object->isActive()) {\n $object->setPublished(true);\n } else {\n $object->setPublished(false);\n }\n }", "public function postUpdate(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n\n if ($entity instanceof Files){\n\n return;\n }\n }", "protected function performPostPersistCallback()\n {\n // echo 'inserted a record ...';\n return true;\n }", "public function testPrePersist()\n {\n $obj = new DummyEntity();\n $class = new \\ReflectionClass($obj);\n\n $args = $this->getMockBuilder('Doctrine\\Common\\EventArgs')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->adapter\n ->expects($this->once())\n ->method('getObjectFromArgs')\n ->will($this->returnValue($obj));\n\n $this->adapter\n ->expects($this->once())\n ->method('getReflectionClass')\n ->will($this->returnValue($class));\n\n $uploadable = $this->getMockBuilder('Vich\\UploaderBundle\\Mapping\\Annotation\\Uploadable')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->driver\n ->expects($this->once())\n ->method('readUploadable')\n ->with($class)\n ->will($this->returnValue($uploadable));\n\n $this->storage\n ->expects($this->once())\n ->method('upload')\n ->with($obj);\n\n $this->injector\n ->expects($this->once())\n ->method('injectFiles')\n ->with($obj);\n\n $listener = new UploaderListener($this->adapter, $this->driver, $this->storage, $this->injector);\n $listener->prePersist($args);\n }", "public function execute()\n {\n $this->cleanHistory();\n $this->log();\n $this->instanceManager->update($this->instance);\n }", "public function onPrePersist()\n {\n $this->created_at = new \\DateTime(\"now\");\n $this->modified_at = new \\DateTime(\"now\");\n }", "public function onPrePersist()\r\n {\r\n $this->joinedTime = new \\DateTime();\r\n }", "public function process($entity)\n {\n }", "public function Add(&$entity)\n {\n \n }", "public function userPreSave(EntityEvent $event) {\n $user = $event->getEntity();\n\n // Prevent bug caused by pathauto menu rebuild outside of Drupal context.\n // @see http://previousnext.com.au/blog/using-behat-and-drupaldriver-beware-pathauto\n $user->path = array('pathauto' => 0);\n }" ]
[ "0.75695527", "0.6565409", "0.6323821", "0.627743", "0.6268234", "0.62218183", "0.62160337", "0.60906976", "0.6055589", "0.6038687", "0.6029597", "0.59281176", "0.5901618", "0.58677757", "0.5853515", "0.583076", "0.58126074", "0.5794882", "0.57846165", "0.5767942", "0.5764222", "0.5749731", "0.57181025", "0.56732315", "0.5672368", "0.5672368", "0.5662607", "0.56587994", "0.56577855", "0.56453896", "0.56175303", "0.56159616", "0.56084144", "0.5582336", "0.5579321", "0.5578234", "0.5578234", "0.55775714", "0.5577132", "0.5569369", "0.5563002", "0.5542077", "0.5541215", "0.5540955", "0.5530188", "0.55243075", "0.55213094", "0.55195785", "0.551695", "0.5514031", "0.55128604", "0.550784", "0.54729384", "0.54710495", "0.5464513", "0.5462976", "0.5458117", "0.5456906", "0.5452392", "0.543899", "0.5438012", "0.54327345", "0.5423692", "0.54218304", "0.54173565", "0.54100996", "0.5391386", "0.5386844", "0.53833437", "0.5379421", "0.53773683", "0.53735524", "0.53652734", "0.5360199", "0.53498644", "0.533878", "0.53381103", "0.5332705", "0.53273505", "0.53143764", "0.53093874", "0.5309197", "0.53075063", "0.5306814", "0.5306801", "0.53058434", "0.5304637", "0.5295771", "0.52937305", "0.528753", "0.5286742", "0.5283803", "0.52750856", "0.5268871", "0.5266433", "0.52641475", "0.52634996", "0.52535594", "0.5250414", "0.524792" ]
0.79268277
0
light function fo wp_get_attachment_image_src()
function image_src($id, $size = 'full', $background_image = false, $height = false) { if ($image = wp_get_attachment_image_src($id, $size, true)) { return $background_image ? 'background-image: url('.$image[0].');' . ($height?'min-height:'.$image[2].'px':'') : $image[0]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_get_original_image_url($attachment_id)\n {\n }", "function wp_get_actual_attachment_image_src($image_id, $size = 'full') {\n return ($i = wp_get_attachment_image_src($image_id, $size)) ? $i[0] : '';\n}", "function get_image_url(){\n $image_id = get_post_thumbnail_id();\n $image_url = wp_get_attachment_image_src($image_id,'full');\n $image_url = $image_url[0];\n echo $image_url;\n }", "function cbv_get_image_src( $id, $size = 'full' ){\n if( isset( $id ) ){\n $afbeelding = wp_get_attachment_image_src($id, $size, false );\n if( is_array( $afbeelding ) && isset( $afbeelding[0] ) ){\n return $afbeelding[0];\n }\n }\n return false;\n}", "function dizzy_featured_ogimg () { \n\t $thumb = get_the_post_thumbnail($post->ID);\n\t\t$pattern= \"/(?<=src=['|\\\"])[^'|\\\"]*?(?=['|\\\"])/i\";\n\t\tpreg_match($pattern, $thumb, $thePath);\n\t\t$theSrc = $thePath[0];\n}", "function wp_get_attachment_image_url($attachment_id, $size = 'thumbnail', $icon = \\false)\n {\n }", "function get_templ_image($post_id,$size='thumbnail') {\r\n\r\n\tglobal $post;\r\n\t/*get the thumb image*/\t\r\n\t$thumbnail = wp_get_attachment_image_src ( get_post_thumbnail_id ( $post_id ), $size ) ;\t\r\n\tif($thumbnail[0]!='')\r\n\t{\r\n\t\t$image_src=$thumbnail[0];\t\t\r\n\t}else\r\n\t{\r\n\t\t$post_img_thumb = bdw_get_images_plugin($post_id,$size); \r\n\t\t$image_src = $post_img_thumb[0]['file'];\r\n\t}\t\r\n\treturn $image_src;\r\n}", "function image_src($id, $size = 'full', $background_image = false, $height = false) {\n if ($image = wp_get_attachment_image_src($id, $size, true)) {\n return $background_image ? 'background-image: url('.$image[0].');' . ($height?'height:'.$image[2].'px':'') : $image[0];\n }\n}", "function wp_get_attachment_thumb_url($post_id = 0)\n {\n }", "function nb_get_image_src( $object, $field_name, $request ) {\n $featured_img_array = wp_get_attachment_image_src( $object[ 'featured_media'], 'full', true);\n return $featured_img_array[0];\n}", "function cl_wp_get_attachment_image_src($id, $type) {\n $url = wp_get_attachment_image_src($id, $type);\n if ( defined('FBRWEB_OFFLOAD_HOST') && ($rep = constant('FBRWEB_OFFLOAD_HOST')) ) {\n return str_replace( '//' . $_SERVER['HTTP_HOST'], '//' . $rep, $url);\n }\n return $url;\n}", "function get_thumb_urlfull ($postID) {\n\n$image_id = get_post_thumbnail_id($post); \n\n$image_url = wp_get_attachment_image_src($image_id,'large'); \n\n$image_url = $image_url[0]; \n\nreturn $image_url;\n\n}", "function wp_get_attachment_url($attachment_id = 0)\n {\n }", "function wp_get_original_image_path($attachment_id, $unfiltered = \\false)\n {\n }", "function cws_get_image_url() {\n\n\tglobal $post;\n\n\t$thumbnail_url = wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ) );\n\t$image_url = print( $thumbnail_url );\n\n\treturn $image_url;\n\n}", "function get_image_attachment_src($attachmentID, $size = 'thumbnail')\n{\n $imageSrc = get_template_directory_uri() . '/images/default-'. $size .'.png';\n\n if( wp_attachment_is_image( $attachmentID ) ) {\n $imageInfo = wp_get_attachment_image_src( $attachmentID, $size);\n $imageSrc = $imageInfo[0];\n }\n\n return $imageSrc;\n}", "function fs_get_featured_image_src( $size ) {\r\n\tglobal $post;\r\n\t$featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), $size);\r\n\treturn $featured_image[0];\r\n}", "function get_featured_img_url($id) {\n\t$thumb_id = get_post_thumbnail_id($id);\n\t$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'grid-thumbnail-medium', true);\n\t$thumb_url = $thumb_url_array[0];\n\treturn $thumb_url;\n}", "function get_the_post_thumbnail_src($img)\n\n{\n\n return (preg_match('~\\bsrc=\"([^\"]++)\"~', $img, $matches)) ? $matches[1] : '';\n\n}", "function get_page_feature_image_url($postID, $size)\n{\n //get wp object of featured image\n $feature_image_id = get_post_thumbnail_id($postID);\n //get array of the featured image based on size\n $feature_image_meta = wp_get_attachment_image_src($feature_image_id, $size);\n //the 1st argument of the array is the url of the image 2nd is the width the 3ed is the height\n $link = $feature_image_meta[0];\n //return the first argument\n return $link;\n}", "function featuredURL($size = 'full'){\n $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $size );\n $url = $thumb['0'];\n echo $url;\n}", "function featuredURL($size = 'full'){\n $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $size );\n $url = $thumb['0'];\n echo $url;\n}", "function get_thumb_src($post_id, $size = 'full'){\n\t$img_src = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), $size);\n\tif ($img_src)\n\t\treturn $img_src[0];\n\telse\n\t\treturn false;\n}", "function get_feature_image_url($post_id)\n{\n\tif(has_post_thumbnail($post_id))\n\t{\n\t\t$image5 = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'full' );\n\t\treturn $image5[0];\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function get_feature_image_url($post_id)\n{\n\tif(has_post_thumbnail($post_id))\n\t{\n\t\t$image5 = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'full' );\n\t\treturn $image5[0];\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function psa_get_the_post_thumbnail_src( $size = 'thumbnail' ) {\n\tglobal $post;\n\t$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $size );\n\treturn $image[0];\n}", "public function featured_img() {\n\n $featured_img = wp_get_attachment_image_src(\n get_post_thumbnail_id( get_the_ID() ), 'large'\n );\n\n return $featured_img[0];\n }", "function wprt_get_image( $args = array() ) {\n\t$default = array(\n\t\t'post_id' => get_the_ID(),\n\t\t'size' => 'thumbnail',\n\t\t'format' => 'html', // html or src\n\t\t'attr' => '',\n\t\t'meta_key' => '',\n\t\t'scan' => true,\n\t\t'default' => '',\n\t);\n\n\t$args = wp_parse_args( $args, $default );\n\n\tif ( ! $args['post_id'] )\n\t\t$args['post_id'] = get_the_ID();\n\n\t// Get image from cache\n\t$key = md5( serialize( $args ) );\n\t$image_cache = wp_cache_get( $args['post_id'], 'wprt_get_image' );\n\n\tif ( ! is_array( $image_cache ) )\n\t\t$image_cache = array();\n\n\tif ( empty( $image_cache[$key] ) ) {\n\t\t// Get post thumbnail\n\t\tif ( has_post_thumbnail( $args['post_id'] ) ) {\n\t\t\t$id = get_post_thumbnail_id();\n\t\t\t$html = wp_get_attachment_image( $id, $args['size'], false, $args['attr'] );\n\t\t\tlist( $src ) = wp_get_attachment_image_src( $id, $args['size'], false, $args['attr'] );\n\t\t}\n\n\t\t// Get the first image in the custom field\n\t\tif ( ! isset( $html, $src ) && $args['meta_key'] ) {\n\t\t\t$id = get_post_meta( $args['post_id'], $args['meta_key'], true );\n\n\t\t\t// Check if this post has attached images\n\t\t\tif ( $id ) {\n\t\t\t\t$html = wp_get_attachment_image( $id, $args['size'], false, $args['attr'] );\n\t\t\t\tlist( $src ) = wp_get_attachment_image_src( $id, $args['size'], false, $args['attr'] );\n\t\t\t}\n\t\t}\n\n\t\t// Get the first attached image\n\t\tif ( ! isset( $html, $src ) ) {\n\t\t\t$image_ids = array_keys( get_children( array(\n\t\t\t\t'post_parent' => $args['post_id'],\n\t\t\t\t'post_type'\t => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'orderby' => 'menu_order',\n\t\t\t\t'order'\t => 'ASC',\n\t\t\t) ) );\n\n\t\t\t// Check if this post has attached images\n\t\t\tif ( ! empty( $image_ids ) ) {\n\t\t\t\t$id = $image_ids[0];\n\t\t\t\t$html = wp_get_attachment_image( $id, $args['size'], false, $args['attr'] );\n\t\t\t\tlist( $src ) = wp_get_attachment_image_src( $id, $args['size'], false, $args['attr'] );\n\t\t\t}\n\t\t}\n\n\t\t// Get the first image in the post content\n\t\tif ( ! isset( $html, $src ) && ( $args['scan'] ) ) {\n\t\t\tpreg_match( '|<img.*?src=[\\'\"](.*?)[\\'\"].*?>|i', get_post_field( 'post_content', $args['post_id'] ), $matches );\n\n\t\t\tif ( !empty( $matches ) ) {\n\t\t\t\t$html = $matches[0];\n\t\t\t\t$src = $matches[1];\n\t\t\t}\n\t\t}\n\n\t\t// Use default when nothing found\n\t\tif ( ! isset( $html, $src ) && !empty( $args['default'] ) ) {\n\t\t\tif ( is_array( $args['default'] ) ) {\n\t\t\t\t$html = $args['html'];\n\t\t\t\t$src = $args['src'];\n\t\t\t} else {\n\t\t\t\t$html = $src = $args['default'];\n\t\t\t}\n\t\t}\n\n\t\t// Still no images found?\n\t\tif ( ! isset( $html, $src ) )\n\t\t\treturn false;\n\n\t\t$output = 'html' === strtolower( $args['format'] ) ? $html : $src;\n\n\t\t$image_cache[$key] = $output;\n\t\twp_cache_set( $args['post_id'], $image_cache, 'wprt_get_image' );\n\t}\n\t// If image already cached\n\telse {\n\t\t$output = $image_cache[$key];\n\t}\n\n\t$output = apply_filters( 'wprt_get_image', $output, $args );\n\n\treturn $output;\n}", "function wgom_post_thumbnail_url() {\n\tif (has_post_thumbnail()) {\n\t\t$post = get_post(null);\n\t\t$post_thumbnail_id = get_post_thumbnail_id($post);\n\t\t$size = apply_filters('post_thumbnail_size', 'post-thumbnail', $post->ID);\n\t\tif ($post_thumbnail_id) {\n\t\t\t$image_src = wp_get_attachment_image_src($post_thumbnail_id, $size, false);\n\t\t\tif ($image_src) {\n\t\t\t\t$image_url = $image_src[0];\n\t\t\t\treturn $image_url;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\t// This is the WGOM extension part.\n\t\t$image_src = wgom_video_post_featured_image(false);\n\t\treturn $image_src;\n\t}\n\treturn \"\";\n}", "function sld_get_post_thumbnail_src( $postid, $size='thumbnail' ) {\n\tif ( has_post_thumbnail( $postid ) ) {\n\t\t$id = get_post_thumbnail_id( $postid );\n\t\t$image = wp_get_attachment_image_src( $id, $size );\n\t\treturn $image[0];\n\t} else {\n\t\t// echo 'has no thumbnail';\n\t\t$post = get_post( $postid );\n\t\tif ( preg_match_all( '/<img [^>]class=[\"|\\'][^\"|\\']*wp-image-([\\d]+)/i', $post->post_content, $matches) ) {\n\t\t\t$img_id = @$matches[1][0];\n\t\t\treturn wp_get_attachment_image_src( $img_id, $size );\n\t\t} else if ( preg_match_all( '/<img [^>]*src=[\"|\\']([^\"|\\']+)/i', $post->post_content, $matches) ) {\n\t\t\t// todo: get sizes dimensions from wp\n\t\t\t$img = @$matches[1][0];\n\t\t\treturn $img;\n\t\t}\t\t\n\t}\n}", "function shariff3uu_catch_image() {\n\t\t$result = preg_match_all( '/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', get_post_field( 'post_content', get_the_ID() ), $matches );\n\t\tif ( array_key_exists( 0, $matches[1] ) ) {\n\t\t\treturn $matches[1][0];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "function faculty_get_photo( $id = null ) {\n $thumbnail_id = get_post_thumbnail_id( $id );\n\n if ( $thumbnail_id ) {\n return wp_get_attachment_url( $thumbnail_id );\n }\n\n return get_stylesheet_directory_uri() . '/static/img/knight.png';\n}", "function rest_get_featured_image( $post, $field_name, $request ) {\n $attachment_id = $post['featured_media'];\n $attachment_info = wp_get_attachment_image_src( $attachment_id, 'rest_post_thumbnail' );\n return $attachment_info[0];\n}", "function wpseed_the_post_thumbnail_url($size, $postid) {\n echo wp_get_attachment_image_src( get_post_thumbnail_id($postid), $size )['0'];\n }", "function wgom_get_featured_image() {\n\t// This is the usual code that gets executed.\n\tif ( has_post_thumbnail() ) {\n\t\tif ( 'grid' == get_theme_mod( 'featured_content_layout' ) )\n\t\t\tthe_post_thumbnail();\n\t\telse\n\t\t\tthe_post_thumbnail( 'twentyfourteen-full-width' );\n\t}\n\telse {\n\t\t// This is the WGOM extension part.\n\t\t$image_html = wgom_video_post_featured_image();\n\t\tif (!empty($image_html)) {\n\t\t\techo $image_html;\n\t\t}\n\t}\n\n\twgom_get_featured_overlay();\n}", "function add_toolkit_banner_img( $post ) {\t\n\t\t\n\t$post_thumbnail_id = get_post_thumbnail_id( $post );\n\t$banner_feat_img = wp_get_attachment_image_src($post_thumbnail_id, 'full' );\n\t\n\techo $banner_feat_img[0];\n\t\n\t//echo '<pre>';print_r( $wide_banner_img[0] );echo '</pre>';\n\t\n}", "static function get_post_thumbnail_src($post_id,$size=null){\n\t\t$post_thumbnail_id = get_post_thumbnail_id($post_id);\n\t\t$thumbnail = wp_get_attachment_image_src($post_thumbnail_id,$size);\n\t\tif(isset($thumbnail[0])){\n\t\t\treturn $thumbnail[0];\n\t\t}\n\t\treturn false;\n\t}", "function get_featured_image( $id ) {\n\treturn wp_get_attachment_image_src( get_post_thumbnail_id( $id ), IMAGE_CAPTIONS_IMAGE_SIZE )[0];\n}", "function wp_get_attachment_thumb_file($post_id = 0)\n {\n }", "function shoestrap_get_attachment_id_from_src( $image_src ) {\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n $id = $wpdb->get_var( $query );\n return $id;\n}", "function wp_load_image($file)\n {\n }", "function ts_get_attachment_id_from_src ($image_src) {\r\n\r\n\tglobal $wpdb;\r\n\t$query = $wpdb -> prepare(\"SELECT ID FROM {$wpdb->posts} WHERE guid= %s \",$image_src);\r\n\t$id = $wpdb->get_var($query);\r\n\treturn $id;\r\n}", "function truethemes_get_attachment_id_from_src($image_src){\n $image_src = esc_url($image_src);\n\n\t\t//irregardless of multisite or single install\n\t\t//$wpdb->posts will point to the correct posts table.\n\t\t//tested and proven on multisite setup.\n \n //mod by denzel\n //@since version 3.0, check WordPress version to determine which prepared statement to use.\n $check_wp_version = get_bloginfo('version');\n if($check_wp_version < 3.5){\n\t\tglobal $wpdb;\n\t\t$query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n\t\t$id = $wpdb->get_var( $wpdb->prepare( $query ) );\n\t\t\n\t}else{\n\t\tglobal $wpdb;\n\t\t$query = $wpdb->prepare(\"SELECT ID FROM {$wpdb->posts} WHERE guid=%s\",$image_src);\n\t\t$id = $wpdb->get_var($query);\n\t}\n\t\treturn $id;\n\n}", "function getSrcAltImage($postID,$size=false){\n\t$imgID = get_post_thumbnail_id($postID);\n\t$img = wp_get_attachment_image_src($imgID,$size, false, '');\n\t$imgAlt = get_post_meta($imgID,'_wp_attachment_image_alt', true);\n\t$imgAttr = array(\n\t\t'url' => $img,\n\t\t'alt' => $imgAlt\n\t);\n\tif(is_shop()){\n\t\techo '<section class=\"shop-image\">';\n\t\techo '<img class=\"img-max\" src=\"' . $imgAttr['url'][0] . '\" alt=\"\" />';\n\t\techo '</section>';\n\t}else{\n\t\treturn $imgAttr;\n\t}\n}", "function get_the_image_by_default( $args = array() ) {\n\treturn array( 'src' => $args['default_image'] );\n}", "function wp_get_attachment_image_url( $attachment_id, $size = 'thumbnail', $icon = false ) {\n\t\t$image = wp_get_attachment_image_src( $attachment_id, $size, $icon );\n\t\treturn isset( $image['0'] ) ? $image['0'] : false;\n\t}", "function get_correct_image_link_thumb($thumb_id='', $size='large'){\n\n if ($thumb_id != '') {\n $imagepermalink = wp_get_attachment_image_src($thumb_id, $size, true);\n } else {\n $imagepermalink[0] = get_stylesheet_directory_uri() . '/images/cover.jpg';\n }\n return $imagepermalink[0];\n}", "function cultiv8_getImage( $post_id = null, $size = 'large' ){\n\tif( null == $post_id ) {\n\t\tglobal $post;\t\n\t\t$post_id = $post -> ID;\n\t}\t\n\t\n\t// Check for a CTC image\n\t$img = get_post_meta( $post_id, '_ctc_image' , true ); \n\t\n\t// Fall back to the post thumbnail\n\tif( empty( $img ) ) {\n\t\t$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), $size );\n\t\tif( $thumbnail ) $img = $thumbnail[0];\n\t}\n\t\n\t// Fall back to the site feed logo\n\tif( empty( $img ) )\n\t\t$img = get_theme_mod( 'cultiv8_feed_logo', '' );\n\t\n\t// Fall back to the site logo\n\tif( empty( $img ) )\n\t\t$img = cultiv8_get_site_logo();\n\t\t\t\n\treturn $img;\n\t\n}", "function get_link_img_post(){\n\tglobal $post;\n\tpreg_match_all('/src=\"(.*)\"/Us',get_the_content(),$matches);\n\t$link_img_post = $matches[1];\n\treturn $link_img_post;\n}", "function barjeel_autoset_featured_img() {\n\n $post_thumbnail = barjeel_post_thumbnail_check();\n if ($post_thumbnail == true ){\n return the_post_thumbnail();\n }\n if ($post_thumbnail == false ){\n $image_args = array(\n 'post_type' => 'attachment',\n 'numberposts' => 1,\n 'post_mime_type' => 'image',\n 'post_parent' => $post->ID,\n 'order' => 'desc'\n );\n $attached_image = get_children( $image_args );\n if ($attached_image) {\n foreach ($attached_image as $attachment_id => $attachment) {\n set_post_thumbnail($post->ID, $attachment_id);\n }\n return the_post_thumbnail();\n } else { return \" \";}\n }\n }", "private function get_slide_img_thumb($attachment_id){\r\n $attachment_id = (int) $attachment_id;\r\n if($attachment_id > 0){\r\n $image_url = wp_get_attachment_image_src( $attachment_id, 'medium', true );\r\n $image_url = (is_array($image_url)) ? $image_url[0] : '';\r\n return $image_url;\r\n }\r\n return false;\r\n }", "function cpo_image_url( $id, $size = 'full' ) {\n\t$url = '';\n\tif ( is_numeric( $id ) ) {\n\t\t$url = wp_get_attachment_image_src( $id, $size );\n\t\t$url = $url[0];\n\t} else {\n\t\t$url = $id;\n\t}\n\n\treturn $url;\n}", "function pl_the_thumbnail_url( $post_id, $size = false ){\n\t\n\tif( has_post_thumbnail($post_id) ){\n\t\t\n\t\t$img_data = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), $size, false);\n\n\t\t$a['img'] = ($img_data[0] != '') ? $img_data[0] : '';\n\n\t\treturn $a['img'];\n\t\t\n\t} else\n\t\treturn false;\n}", "function get_featured_image_url( $post_id, $size ) {\n // for current post, call it with like $url = get_featured_image_url( get_the_ID(), 'full' );\n //$post_id = get_the_ID(); // try this just in case\n if (!$post_id) { return; } // bail if we still don't have a post_id\n if (!size) { $size = 'thumbnail'; } // default to the \"thumbnail\" sized image if we have no size specified\n\n if ( has_post_thumbnail( $post_id ) ) {\n $thumb_id = get_post_thumbnail_id($post_id);\n $thumbsrc = wp_get_attachment_image_src($thumb_id, $size);\n return $thumbsrc[0];\n }\n else { return; }\n}", "function get_attachment_id_from_src ($image_src) {\n\n\tglobal $wpdb;\n\t$query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n\t$id = $wpdb->get_var($query);\n\treturn $id;\n\n}", "function getPageImage() {\n global $post;\n\n $imageUrl = esc_url( trailingslashit( get_template_directory_uri() ) . 'img/preview.png' );\n\n // single / page\n if( ( is_single() || is_page() ) && !is_front_page() ) {\n if( function_exists( 'get_field' ) ) {\n $imageId = get_field( 'linkpreview--image', $post->ID );\n if( $imageId ) {\n $imageUrl = wp_get_attachment_image_src( $imageId, 'large' )[0];\n }\n }\n }\n\n return $imageUrl;\n}", "function wprss_get_feed_image( $source_id ) {\n return get_post_meta( $source_id, 'wprss_feed_image', true );\n }", "function get_attachment_id_from_src ($image_src) {\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n $id = $wpdb->get_var($query);\n return $id;\n}", "public function get_image_attached($post){\n\t\n\tpreg_match_all('/src=([\"\\'])(.*?)\\1/', $post, $matches);\n\t$img = $matches[2];\n\t\n\treturn $img;\n\t\n\treturn false;\n }", "function getThumbUrl($size,$post_id) {\n if (!isset($size)) {\n $size = 'full';\n }\n $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), $size);\n if($thumb[0] != \"\") {\n return $thumb[0];\n }\n}", "function get_hisrc_img( $img_id, $link='', $width_mobile='200', $height_mobile='200' ) {\n $out = '';\n if ( $img_id !='' ) {\n $img_src_mobile = wp_get_attachment_image_src( $img_id, array( $width_mobile, $height_mobile ) );\n $img_src_desktop = wp_get_attachment_image_src( $img_id, array( 400, 400 ) );\n $out .= '<div class=\"hisrc\">';\n if ( $link != '' ) {\n $out .= '<a href=\"'.$link.'\"><img src=\"'.$img_src_mobile[0].'\" width=\"'.$width_mobile.'\" height=\"'.$height_mobile.'\"\n data-1x=\"'.$img_src_desktop[0].'\" alt=\"'.$post->post_title.'\" /></a>';\n } else {\n $out .= '<img src=\"'.$img_src_mobile[0].'\" width=\"'.$width_mobile.'\" height=\"'.$height_mobile.'\"\n data-1x=\"'.$img_src_desktop[0].'\" alt=\"'.$post->post_title.'\" />';\n }\n $out .= '</div>';\n }\n return $out;\n}", "function get_post_thumbnail_url( $size = 'full', $post_id = false, $icon = false ) {\n if ( ! $post_id ) {\n $post_id = get_the_ID();\n }\n\n $thumb_url_array = wp_get_attachment_image_src(\n get_post_thumbnail_id( $post_id ), $size, $icon\n );\n return $thumb_url_array[0];\n}", "function bootstrapwp_autoset_featured_img()\n{\n global $post;\n\n $post_thumbnail = bootstrapwp_is_post_thumbnail_set();\n if ($post_thumbnail == true) {\n return get_the_post_thumbnail();\n }\n $image_args = array(\n 'post_type' => 'attachment',\n 'numberposts' => 1,\n 'post_mime_type' => 'image',\n 'post_parent' => $post->ID,\n 'order' => 'desc'\n );\n $attached_images = get_children($image_args, ARRAY_A);\n $first_image = reset($attached_images);\n if (!$first_image) {\n return false;\n }\n\n return get_the_post_thumbnail($post->ID, $first_image['ID']);\n\n}", "function get_the_image_by_post_thumbnail( $args = array() ) {\n\n\t/* Check for a post image ID (set by WP as a custom field). */\n\t$post_thumbnail_id = get_post_thumbnail_id( $args['post_id'] );\n\n\t/* If no post image ID is found, return false. */\n\tif ( empty( $post_thumbnail_id ) )\n\t\treturn false;\n\n\t/* Apply filters on post_thumbnail_size because this is a default WP filter used with its image feature. */\n\t$size = apply_filters( 'post_thumbnail_size', $args['size'] );\n\n\t/* Get the attachment image source. This should return an array. */\n\t$image = wp_get_attachment_image_src( $post_thumbnail_id, $size );\n\n\t/* Get the attachment alt text. */\n\t$alt = trim( strip_tags( get_post_meta( $post_thumbnail_id, '_wp_attachment_image_alt', true ) ) );\n\n\t/* Get the attachment caption. */\n\t$caption = get_post_field( 'post_excerpt', $post_thumbnail_id );\n\n\t/* Return both the image URL and the post thumbnail ID. */\n\treturn array( 'src' => $image[0], 'post_thumbnail_id' => $post_thumbnail_id, 'alt' => $alt, 'caption' => $caption );\n}", "function my_post_image_html( $html, $post_id, $post_image_id )\r\n{\r\n\t$src = wp_get_attachment_image_src ( get_post_thumbnail_id ( $post_id ));\r\n\t\r\n\t$html = '<img src=\"'.$src[0].'\" alt=\"'.esc_attr( get_post_field( 'post_title', $post_id ) ).'\">';\r\n\t\r\n\treturn $html;\r\n}", "public function getImageSrc()\n {\n return $this->imageSrc;\n }", "function getImageSource() {return $this->_imagesource;}", "function cjpopups_featured_image($size = null, $single = false){\n\tglobal $post;\n\tif(has_post_thumbnail( $post->ID )){\n\t\tif(!is_array($size)){\n\t\t\t$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $size );\n\t\t}else{\n\t\t\t$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $size );\n\t\t\t$image = cjpopups_resize_image($image[0], $size[0], $size[1], true, $single);\n\t\t}\n\t\tif($single){\n\t\t\t$return = $image[0];\n\t\t}else{\n\t\t\t$return = $image;\n\t\t}\n\t}else{\n\t\t$return[] = 'http://placehold.it/600x600/eeeeee/cccccc&text=No+Thumbnail';\n\t\t$return[] = 150;\n\t\t$return[] = 150;\n\t\treturn $return;\n\t}\n\treturn $return;\n}", "function dt_get_thumb_img( $opts = array() ) {\n\tglobal $post;\n\n\t$default_image = presscore_get_default_image();\n\n\t$defaults = array(\n\t\t'wrap' => '<a %HREF% %CLASS% %TITLE% %CUSTOM%><img %SRC% %IMG_CLASS% %SIZE% %ALT% %IMG_TITLE% /></a>',\n\t\t'class' => '',\n\t\t'alt' => '',\n\t\t'title' => '',\n\t\t'custom' => '',\n\t\t'img_class' => '',\n\t\t'img_title' => '',\n\t\t'img_description' => '',\n\t\t'img_caption' => '',\n\t\t'href' => '',\n\t\t'img_meta' => array(),\n\t\t'img_id' => 0,\n\t\t'options' => array(),\n\t\t'default_img' => $default_image,\n\t\t'prop' => false,\n\t\t'lazy_loading' => false,\n\t\t'lazy_class' => 'lazy-load',\n\t\t'lazy_bg_class' => 'layzr-bg',\n\t\t'echo' => true,\n\t);\n\t$opts = wp_parse_args( $opts, $defaults );\n\t$opts = apply_filters('dt_get_thumb_img-args', $opts);\n\n\t$original_image = null;\n\tif ( $opts['img_meta'] ) {\n\t\t$original_image = $opts['img_meta'];\n\t} elseif ( $opts['img_id'] ) {\n\t\t$original_image = wp_get_attachment_image_src( $opts['img_id'], 'full' );\n\t}\n\n\tif ( !$original_image ) {\n\t\t$original_image = $opts['default_img'];\n\t}\n\n\t// proportion\n\tif ( $original_image && !empty($opts['prop']) && ( empty($opts['options']['h']) || empty($opts['options']['w']) ) ) {\n\t\t$_prop = $opts['prop'];\n\t\t$_img_meta = $original_image;\n\n\t\tif ( $_prop > 1 ) {\n\t\t\t$h = (int) floor((int) $_img_meta[1] / $_prop);\n\t\t\t$w = (int) floor($_prop * $h );\n\t\t} else if ( $_prop < 1 ) {\n\t\t\t$w = (int) floor($_prop * $_img_meta[2]);\n\t\t\t$h = (int) floor($w / $_prop );\n\t\t} else {\n\t\t\t$w = $h = min($_img_meta[1], $_img_meta[2]);\n\t\t}\n\n\t\tif ( !empty($opts['options']['w']) && $w ) {\n\t\t\t$__prop = $h / $w;\n\t\t\t$w = intval($opts['options']['w']);\n\t\t\t$h = intval(floor($__prop * $w));\n\t\t} else if ( !empty($opts['options']['h']) && $h ) {\n\t\t\t$__prop = $w / $h;\n\t\t\t$h = intval($opts['options']['h']);\n\t\t\t$w = intval(floor($__prop * $h));\n\t\t}\n\n\t\t$opts['options']['w'] = $w;\n\t\t$opts['options']['h'] = $h;\n\t}\n\n\t$src = '';\n\t$hd_src = '';\n\t$resized_image = $resized_image_hd = array();\n\n\tif ( $opts['options'] ) {\n\n\t\t$resized_image = dt_get_resized_img( $original_image, $opts['options'], true, false );\n\t\t$resized_image_hd = dt_get_resized_img( $original_image, $opts['options'], true, true );\n\n\t\t$hd_src = $resized_image_hd[0];\n\t\t$src = $resized_image[0];\n\n\t\tif ( $resized_image_hd[0] === $resized_image[0] ) {\n\t\t\t$resized_image_hd = array();\n\t\t}\n\n\t} else {\n\t\t$resized_image = $original_image;\n\t\t$src = $resized_image[0];\n\t}\n\n\tif ( $img_id = absint( $opts['img_id'] ) ) {\n\n\t\tif ( '' === $opts['alt'] ) {\n\t\t\t$opts['alt'] = get_post_meta( $img_id, '_wp_attachment_image_alt', true );\n\t\t}\n\n\t\tif ( '' === $opts['img_title'] ) {\n\t\t\t$opts['img_title'] = get_the_title( $img_id );\n\t\t}\n\t}\n\n\t$href = $opts['href'];\n\tif ( !$href ) {\n\t\t$href = $original_image[0];\n\t}\n\n\t$_width = $resized_image[1];\n\t$_height = $resized_image[2];\n\n\tif ( empty($resized_image[3]) || !is_string($resized_image[3]) ) {\n\t\t$size = image_hwstring( $_width, $_height );\n\t} else {\n\t\t$size = $resized_image[3];\n\t}\n\n\t$lazy_loading_src = \"data:image/svg+xml,%3Csvg%20xmlns%3D&#39;http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg&#39;%20viewBox%3D&#39;0%200%20{$_width}%20{$_height}&#39;%2F%3E\";\n\n\t$lazy_loading = ! empty( $opts['lazy_loading'] );\n\t$srcset_tpl = '%s %dw';\n\n\tif ( $lazy_loading ) {\n\t\t$src = str_replace( array(' '), array('%20'), $src );\n\t\t$hd_src = str_replace( array(' '), array('%20'), $hd_src );\n\n\t\t$esc_src = esc_attr( $src );\n\t\t$src_att = sprintf( $srcset_tpl, $esc_src, $resized_image[1] );\n\t\tif ( $resized_image_hd ) {\n\t\t\t$src_att .= ', ' . sprintf( $srcset_tpl, esc_attr( $hd_src ), $resized_image_hd[1] );\n\t\t}\n\t\t$src_att = 'src=\"' . $lazy_loading_src . '\" data-src=\"' . $esc_src . '\" data-srcset=\"' . $src_att . '\"';\n\t\t$opts['img_class'] .= ' ' . $opts['lazy_class'];\n\t\t$opts['class'] .= ' ' . $opts['lazy_bg_class'];\n\t} else {\n\t\t$src_att = sprintf( $srcset_tpl, $src, $resized_image[1] );\n\t\tif ( $resized_image_hd ) {\n\t\t\t$src_att .= ', ' . sprintf( $srcset_tpl, $hd_src, $resized_image_hd[1] );\n\t\t}\n\t\t$src_sizes = $resized_image[1] . 'px';\n\t\t$src_att = 'src=\"' . esc_attr( $src ) . '\" srcset=\"' . esc_attr( $src_att ) . '\" sizes=\"' . esc_attr( $src_sizes ) . '\"';\n\t}\n\n\t$class = empty( $opts['class'] ) ? '' : 'class=\"' . esc_attr( trim($opts['class']) ) . '\"';\n\t$title = empty( $opts['title'] ) ? '' : 'title=\"' . esc_attr( trim($opts['title']) ) . '\"';\n\t$img_title = empty( $opts['img_title'] ) ? '' : 'title=\"' . esc_attr( trim($opts['img_title']) ) . '\"';\n\t$img_class = empty( $opts['img_class'] ) ? '' : 'class=\"' . esc_attr( trim($opts['img_class']) ) . '\"';\n\n\t$output = str_replace(\n\t\tarray(\n\t\t\t'%HREF%',\n\t\t\t'%CLASS%',\n\t\t\t'%TITLE%',\n\t\t\t'%CUSTOM%',\n\t\t\t'%SRC%',\n\t\t\t'%IMG_CLASS%',\n\t\t\t'%SIZE%',\n\t\t\t'%ALT%',\n\t\t\t'%IMG_TITLE%',\n\t\t\t'%RAW_TITLE%',\n\t\t\t'%RAW_ALT%',\n\t\t\t'%RAW_IMG_TITLE%',\n\t\t\t'%RAW_IMG_DESCRIPTION%',\n\t\t\t'%RAW_IMG_CAPTION%'\n\t\t),\n\t\tarray(\n\t\t\t'href=\"' . esc_url( $href ) . '\"',\n\t\t\t$class,\n\t\t\t$title,\n\t\t\tstrip_tags( $opts['custom'] ),\n\t\t\t$src_att,\n\t\t\t$img_class,\n\t\t\t$size,\n\t\t\t'alt=\"' . esc_attr( $opts['alt'] ) . '\"',\n\t\t\t$img_title,\n\t\t\tesc_attr( $opts['title'] ),\n\t\t\tesc_attr( $opts['alt'] ),\n\t\t\tesc_attr( $opts['img_title'] ),\n\t\t\tesc_attr( $opts['img_description'] ),\n\t\t\tesc_attr( $opts['img_caption'] )\n\t\t),\n\t\t$opts['wrap']\n\t);\n\n\t$output = apply_filters( 'dt_get_thumb_img-output', $output, $opts );\n\n\tif ( $opts['echo'] ) {\n\t\techo $output;\n\t\treturn '';\n\t}\n\n\treturn $output;\n}", "function wp_image_src_get_dimensions($image_src, $image_meta, $attachment_id = 0)\n {\n }", "function flawless_image_link( $attachment_id = false, $size = false, $args = array() ) {\r\n\r\n if ( !$size || !$attachment_id ) {\r\n return false;\r\n }\r\n\r\n $image_sizes = Flawless::image_sizes();\r\n\r\n $args = wp_parse_args( $args, array(\r\n 'return' => 'string',\r\n 'cache_id' => sanitize_title( $attachment_id . $size ),\r\n 'default' => ''\r\n ) );\r\n\r\n if ( $return = wp_cache_get( $args[ 'cache_id' ], 'flawless_image_link' ) ) {\r\n return $return;\r\n }\r\n\r\n $attachment_image_src = ( array ) wp_get_attachment_image_src( $attachment_id, $size );\r\n\r\n if ( empty( $image_sizes ) || ( is_array( $attachment_id ) && $attachment_id[ 1 ] == $image_sizes[ $size ][ 'width' ] ) ) {\r\n $return = $attachment_image_src[ 0 ];\r\n wp_cache_set( $args[ 'cache_id' ], $return, 'flawless_image_link' );\r\n return $return;\r\n }\r\n\r\n /** Get the metadata */\r\n $metadata = wp_get_attachment_metadata( $attachment_id );\r\n /** If we have metadata, we need to check it before continuing */\r\n if ( $metadata ) {\r\n /** Check to see if the original file exists */\r\n if ( isset( $metadata[ 'sizes' ] ) && isset( $metadata[ 'sizes' ][ $size ] ) && isset( $metadata[ 'sizes' ][ $size ][ 'file' ] ) ) {\r\n /** Get the upload directory */\r\n $upload_dir = wp_upload_dir();\r\n /** Determine the file's directory */\r\n $file_dir = explode( '/', $metadata[ 'file' ] );\r\n array_pop( $file_dir );\r\n $file_dir = implode( '/', $file_dir );\r\n /** Build the file path */\r\n $resized_file = $upload_dir[ 'basedir' ] . '/' . $file_dir . '/' . $metadata[ 'sizes' ][ $size ][ 'file' ];\r\n if ( file_exists( $resized_file ) ) {\r\n $file_url = $upload_dir[ 'baseurl' ] . '/' . $file_dir . '/' . $metadata[ 'sizes' ][ $size ][ 'file' ];\r\n wp_cache_set( $args[ 'cache_id' ], $file_url, 'flawless_image_link' );\r\n return $file_url;\r\n }\r\n }\r\n }\r\n\r\n $image_resize = image_resize( get_attached_file( $attachment_id, true ), $image_sizes[ $size ][ 'width' ], $image_sizes[ $size ][ 'height' ], $image_sizes[ $size ][ 'crop' ], 'test' );\r\n\r\n if ( is_wp_error( $image_resize ) || !file_exists( $image_resize ) ) {\r\n\r\n if ( $attachment_image_src[ 0 ] ) {\r\n $return = $args[ 'default' ] ? $args[ 'default' ] : $attachment_image_src[ 0 ];\r\n } else {\r\n $return = $args[ 'default' ];\r\n }\r\n\r\n wp_cache_set( $args[ 'cache_id' ], $return, 'flawless_image_link' );\r\n return $return;\r\n }\r\n\r\n require_once( ABSPATH . 'wp-admin/includes/image.php' );\r\n\r\n wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, get_attached_file( $attachment_id, true ) ) );\r\n\r\n $attachment_image_src = ( array ) wp_get_attachment_image_src( $attachment_id, $size );\r\n\r\n $return = $attachment_image_src[ 0 ] ? $attachment_image_src[ 0 ] : $args[ 'default' ];\r\n\r\n wp_cache_set( $args[ 'cache_id' ], $return, 'flawless_image_link' );\r\n\r\n return $return;\r\n\r\n }", "public function get_image_url()\n {\n }", "function cc_get_attachment_image($id, $width) {\n if ($attachments = cc_get_attachment($id)) {\n foreach ($attachments as $attachment => $attachment_id) {\n $image = wp_get_attachment_image_src($attachment, full);\n \n // Check if the image is the requested width, and break if it is.\n if ($image[1] == $width) { break; }\n }\n }\n return $image;\n}", "function get_image_url( $id, $width=false, $height=false ) {\n\t\t\n\t\t/**/\n\t\t// Get attachment and resize but return attachment path (needs to return url)\n\t\t$attachment = wp_get_attachment_metadata( $id );\n\t\t$attachment_url = wp_get_attachment_url( $id );\n\t\tif (isset($attachment_url)) {\n\t\t\tif ($width && $height) {\n\t\t\t\t$uploads = wp_upload_dir();\n\t\t\t\t$imgpath = $uploads['basedir'].'/'.$attachment['file'];\n\t\t\t\terror_log($imgpath);\n\t\t\t\t$image = image_resize( $imgpath, $width, $height );\n\t\t\t\tif ( $image && !is_wp_error( $image ) ) {\n\t\t\t\t\terror_log( is_wp_error($image) );\n\t\t\t\t\t$image = path_join( dirname($attachment_url), basename($image) );\n\t\t\t\t} else {\n\t\t\t\t\t$image = $attachment_url;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$image = $attachment_url;\n\t\t\t}\n\t\t\tif (isset($image)) {\n\t\t\t\treturn $image;\n\t\t\t}\n\t\t}\n\t}", "function get_img_src ($img) {\n return (preg_match('~\\bsrc=\"([^\"]++)\"~', $img, $matches)) ? $matches[1] : '';\n}", "function spellerberg_get_image($imageid,$fallbacksize = 'full',$sizeguidance = '') {\n\n\t$attachment = get_post($imageid);\n\n\t$alt_text = get_post_meta($imageid, '_wp_attachment_image_alt', true);\n\n\tif ( !$alt_text || $alt_text == \"\" ) :\n\t\t$alt_text = $attachment->post_title;\n\tendif;\n\n\tif ( $attachment->post_mime_type == \"image/jpeg\" ) :\n\n\t\t$sizeset = spellerberg_size_set($fallbacksize);\n\t\n\t\t$fallback = wp_get_attachment_image_src( $imageid, $fallbacksize);\n\t\n\t\tif ( $sizeguidance != '' ) :\n\t\t \t$sizesattr = 'sizes=\"' . $sizeguidance . '\" ';\n\t\telse :\n\t\t\t$sizesattr = spellerberg_sizesattr($imageid,$fallbacksize);\n\t\tendif;\n\n\t\t$output = '<img ';\t\n\t\t$output .= $sizesattr;\n\t\t$output .= spellerberg_srcsetattr( $imageid,$fallbacksize);\n\t\t$output .= 'src=\"' . $fallback[0] . '\" ';\n\t\t$output .= 'alt=\"' . $alt_text . '\" />';\n\t\n\telse:\n\n\t\t$fallback = wp_get_attachment_image_src( $imageid, 'full');\n\n\t\t$output = '<img src=\"' . $fallback[0] . '\" alt=\"' . $alt_text . '\" />';\n\n\tendif;\n\t\n\treturn $output;\n\n}", "function get_custom_logo_url( $echo = true ){\n $custom_logo_id = get_theme_mod( 'custom_logo' );\n $image = wp_get_attachment_image_src( $custom_logo_id , 'full' );\n\n if(!$echo){\n return $image[0];\n }\n\n echo $image[0];\n}", "function cjpopups_post_featured_image($post_id, $size = null, $single = false, $default_text = 'No Thumbnail'){\n\tglobal $post;\n\tif(has_post_thumbnail( $post_id )){\n\t\tif(!is_array($size)){\n\t\t\t$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), $size );\n\t\t}else{\n\t\t\t$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), $size );\n\t\t\t$image = cjpopups_resize_image($image[0], $size[0], $size[1], true, false);\n\t\t}\n\n\t\tif($single){\n\t\t\t$return = $image[0];\n\t\t}else{\n\t\t\t$return = $image;\n\t\t}\n\t}else{\n\t\tif($single){\n\t\t\t$return = 'http://placehold.it/600x600/eeeeee/cccccc&text='.urlencode($default_text);\n\t\t}else{\n\t\t\t$return[] = 'http://placehold.it/600x600/eeeeee/cccccc&text='.urlencode($default_text);\n\t\t\t$return[] = 250;\n\t\t\t$return[] = 250;\n\t\t}\n\t\t$return[] = 'http://placehold.it/600x600/eeeeee/cccccc&text=No+Thumbnail';\n\t\t$return[] = 250;\n\t\t$return[] = 250;\n\t\treturn $return;\n\t}\n\treturn $return;\n}", "function set_featured_image( $id, $is_static ) {\n\t$size = $is_static ? IMAGE_CAPTIONS_HERO_SIZE : IMAGE_CAPTIONS_IMAGE_SIZE;\n\treturn wp_get_attachment_image_src( get_post_thumbnail_id( $id ), $size )[0];\n}", "function use_the_attachment_image($size='thumbnail')\n{\tif ( $images = get_children(array(\n\t\t'post_parent' => get_the_ID(),\n\t\t'post_status' => 'inherit',\n\t\t'post_type' => 'attachment',\n\t\t'post_mime_type' => 'image',\n\t\t'order' => 'ASC',\n\t\t'orderby' => 'menu_order ID',\n\t\t'numberposts' => 1)))\n\t{\t$permalink = get_permalink();\n\t\tforeach( $images as $image )\n\t\t{\techo '<a href=\"'.$permalink.'\">';\n\t\t\techo wp_get_attachment_image($image->ID, $size, false);\n\t\t\techo '</a>';\n\t\t}\n\t}\n\telse {}\n}", "function photonfill_get_lazyload_image( $attachment_id, $img_size, $attr = array() ) {\n\treturn Photonfill()->get_lazyload_image( $attachment_id, $img_size, $attr );\n}", "function tema_image_single() {\n\t\tif(has_post_thumbnail() && is_single()) {\n?>\n\t\t\t<a href=\"<?php the_permalink(); ?>\" title=\"<?php the_title(); ?>\" class=\"post-thumbnail\">\n\t\t\t\t<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'temaku'); ?>\n\t\t\t\t<img src=\"<?php echo $image[0]; ?>\" alt=\"<?php the_title(); ?>\" width=\"100%\">\n\t\t\t</a><br><br>\n<?php\n\t\t}\n\t}", "function wp_get_attachment( $attachment_id ) {\n $a = str_replace( 'attachment_', '', $attachment_id );\n\t$attachment = get_post($a);\n\treturn array(\n\t\t'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),\n\t\t'caption' => $attachment->post_excerpt,\n\t\t'description' => $attachment->post_content,\n\t\t'href' => get_permalink( $attachment->ID ),\n\t\t'src' => $attachment->guid,\n\t\t'title' => $attachment->post_title\n\t);\n}", "public function get_image_link()\n {\n }", "function get_representative_images() {\n global $post;\n $images = array('http://www.heyreverb.com/wp-content/themes/spiegelmagazine-pro/images/logo.png');\n if ( has_post_thumbnail($post->ID) ) { // check if the post has a Post Thumbnail assigned to it.\n $image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail');\n array_unshift($images, $image_url[0]);\n }\n return $images;\n}", "public function responsive_image_src( $attachment_id, $image_size = 'large' ) \n\t\t{\n\t\t\t$img_src = wp_get_attachment_image_src( $attachment_id, $image_size );\n\t\t\t\n\t\t\tif( false === $img_src )\n\t\t\t{\n\t\t\t\treturn $img_src;\n\t\t\t}\n\t\t\t\n\t\t\t$img_src['srcset'] = '';\n\t\t\t$img_src['sizes'] = '';\n\t\t\t\n\t\t\tif( ! $this->responsive_images_active() )\n\t\t\t{\n\t\t\t\treturn $img_src;\n\t\t\t}\n\t\t\t\n\t\t\t$img = \"<img src='{$img_src[0]}' width='{$img_src[1]}' height='{$img_src[2]}' />\";\n\t\t\t\n\t\t\t$img = $this->make_image_responsive( $img, $attachment_id );\n\t\t\t\n\t\t\t$attrs = array( 'srcset', 'sizes' );\n\t\t\t\n\t\t\tforeach( $attrs as $attr ) \n\t\t\t{\n\t\t\t\t$match = array();\n\t\t\t\tif( preg_match( \"/{$attr}='([^']+)'/\", $img, $match ) )\n\t\t\t\t{\n\t\t\t\t\t$img_src[ $attr ] = $match[1];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif( preg_match( \"/{$attr}=\\\"([^\\\"]+)\\\"/\", $img, $match ) )\n\t\t\t\t{\n\t\t\t\t\t$img_src[ $attr ] = $match[1];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $img_src;\n\t\t}", "function post_featured_image_json( $data, $post, $context ) {\n $featured_image_id = $data->data['featured_media'];\n $featured_image_url = wp_get_attachment_image_src( $featured_image_id, 'original' );\n if( $featured_image_url ) {\n $data->data['featured_image_url'] = $featured_image_url[0];\n }\n return $data;\n}", "public function src(){\n return $this->imageFirstInContent;\n }", "function get_the_image( $args = array() ) {\n\tglobal $_wp_additional_image_sizes;\n\n\t/* Set the default arguments. */\n\t$defaults = array(\n\n\t\t/* Post the image is associated with. */\n\t\t'post_id' => get_the_ID(),\n\n\t\t/* Methods of getting an image (in order). */\n\t\t'meta_key' => array( 'Thumbnail', 'thumbnail' ), // array|string\n\t\t'the_post_thumbnail' => true,\n\t\t'attachment' => true,\n\t\t'image_scan' => false,\n\t\t'callback' => null,\n\t\t'default_image' => false,\n\n\t\t/* Attachment-specific arguments. */\n\t\t'size' => isset( $_wp_additional_image_sizes['post-thumbnail'] ) ? 'post-thumbnail' : 'thumbnail',\n\t\t'order_of_image' => 1,\n\n\t\t/* Format/display of image. */\n\t\t'link_to_post' => true,\n\t\t'image_class' => false,\n\t\t'width' => false,\n\t\t'height' => false,\n\t\t'before' => '',\n\t\t'after' => '',\n\n\t\t/* Captions. */\n\t\t'caption' => false, // Default WP [caption] requires a width.\n\n\t\t/* Saving the image. */\n\t\t'meta_key_save' => false,\n\t\t'thumbnail_id_save' => false, // Set 'featured image'.\n\t\t'cache' => true,\n\n\t\t/* Return/echo image. */\n\t\t'format' => 'img',\n\t\t'echo' => true,\n\n\t\t/* Deprecated arguments. */\n\t\t'custom_key' => null, // @deprecated 0.6. Use 'meta_key'.\n\t\t'default_size' => null, // @deprecated 0.5. Use 'size'.\n\t);\n\n\t/* Allow plugins/themes to filter the arguments. */\n\t$args = apply_filters( 'get_the_image_args', $args );\n\n\t/* Merge the input arguments and the defaults. */\n\t$args = wp_parse_args( $args, $defaults );\n\n\t/* If no post ID, return. */\n\tif ( empty( $args['post_id'] ) )\n\t\treturn false;\n\n\t/* If $default_size is given, overwrite $size. */\n\tif ( !is_null( $args['default_size'] ) )\n\t\t$args['size'] = $args['default_size']; // Deprecated 0.5 in favor of $size\n\n\t/* If $custom_key is set, overwrite $meta_key. */\n\tif ( !is_null( $args['custom_key'] ) )\n\t\t$args['meta_key'] = $args['custom_key']; // Deprecated 0.6 in favor of $meta_key\n\n\t/* If $format is set to 'array', don't link to the post. */\n\tif ( 'array' == $args['format'] )\n\t\t$args['link_to_post'] = false;\n\n\t/* Extract the array to allow easy use of variables. */\n\textract( $args );\n\n\t/* Get cache key based on $args. */\n\t$key = md5( serialize( compact( array_keys( $args ) ) ) );\n\n\t/* Check for a cached image. */\n\t$image_cache = wp_cache_get( $post_id, 'get_the_image' );\n\n\tif ( !is_array( $image_cache ) )\n\t\t$image_cache = array();\n\n\t/* Set up a default, empty $image_html variable. */\n\t$image_html = '';\n\n\t/* If there is no cached image, let's see if one exists. */\n\tif ( !isset( $image_cache[ $key ] ) || empty( $cache ) ) {\n\n\t\t/* If a custom field key (array) is defined, check for images by custom field. */\n\t\tif ( !empty( $meta_key ) )\n\t\t\t$image = get_the_image_by_meta_key( $args );\n\n\t\t/* If no image found and $the_post_thumbnail is set to true, check for a post image (WP feature). */\n\t\tif ( empty( $image ) && !empty( $the_post_thumbnail ) )\n\t\t\t$image = get_the_image_by_post_thumbnail( $args );\n\n\t\t/* If no image found and $attachment is set to true, check for an image by attachment. */\n\t\tif ( empty( $image ) && !empty( $attachment ) )\n\t\t\t$image = get_the_image_by_attachment( $args );\n\n\t\t/* If no image found and $image_scan is set to true, scan the post for images. */\n\t\tif ( empty( $image ) && !empty( $image_scan ) )\n\t\t\t$image = get_the_image_by_scan( $args );\n\n\t\t/* If no image found and a callback function was given. Callback function must pass back array of <img> attributes. */\n\t\tif ( empty( $image ) && !is_null( $callback ) && function_exists( $callback ) )\n\t\t\t$image = call_user_func( $callback, $args );\n\n\t\t/* If no image found and a $default_image is set, get the default image. */\n\t\tif ( empty( $image ) && !empty( $default_image ) )\n\t\t\t$image = get_the_image_by_default( $args );\n\n\t\t/* If an image was found. */\n\t\tif ( !empty( $image ) ) {\n\n\t\t\t/* If $meta_key_save was set, save the image to a custom field. */\n\t\t\tif ( !empty( $meta_key_save ) )\n\t\t\t\tget_the_image_meta_key_save( $args, $image );\n\n\t\t\t/* Format the image HTML. */\n\t\t\t$image_html = get_the_image_format( $args, $image );\n\n\t\t\t/* Set the image cache for the specific post. */\n\t\t\t$image_cache[ $key ] = $image_html;\n\t\t\twp_cache_set( $post_id, $image_cache, 'get_the_image' );\n\t\t}\n\t}\n\n\t/* If an image was already cached for the post and arguments, use it. */\n\telse {\n\t\t$image_html = $image_cache[$key];\n\t}\n\n\t/* Allow plugins/theme to override the final output. */\n\t$image_html = apply_filters( 'get_the_image', $image_html );\n\n\t/* If $format is set to 'array', return an array of image attributes. */\n\tif ( 'array' == $format ) {\n\n\t\t/* Set up a default empty array. */\n\t\t$out = array();\n\n\t\t/* Get the image attributes. */\n\t\t$atts = wp_kses_hair( $image_html, array( 'http', 'https' ) );\n\n\t\t/* Loop through the image attributes and add them in key/value pairs for the return array. */\n\t\tforeach ( $atts as $att )\n\t\t\t$out[ $att['name'] ] = $att['value'];\n\n\t\tif ( !empty( $out['src'] ) )\n\t\t\t$out['url'] = $out['src']; // @deprecated 0.5 Use 'src' instead of 'url'.\n\n\t\t/* Return the array of attributes. */\n\t\treturn $out;\n\t}\n\n\t/* Or, if $echo is set to false, return the formatted image. */\n\telseif ( false === $echo ) {\n\t\treturn !empty( $image_html ) ? $args['before'] . $image_html . $args['after'] : $image_html;\n\t}\n\n\t/* If there is a $post_thumbnail_id, do the actions associated with get_the_post_thumbnail(). */\n\tif ( isset( $image['post_thumbnail_id'] ) )\n\t\tdo_action( 'begin_fetch_post_thumbnail_html', $post_id, $image['post_thumbnail_id'], $size );\n\n\t/* Display the image if we get to this point. */\n\techo !empty( $image_html ) ? $args['before'] . $image_html . $args['after'] : $image_html;\n\n\t/* If there is a $post_thumbnail_id, do the actions associated with get_the_post_thumbnail(). */\n\tif ( isset( $image['post_thumbnail_id'] ) )\n\t\tdo_action( 'end_fetch_post_thumbnail_html', $post_id, $image['post_thumbnail_id'], $size );\n}", "public function get_image() {\n\n return $this->image_id !== null ? $this->image->full_src() : null;\n }", "function newsletter_image($ref, $size){\r\n\t\r\n\t$default_attr = array(\r\n\t\t'class'\t=> \"attachment-$size\",\r\n\t\t'alt' => trim(strip_tags( get_post_meta($ref, '_wp_attachment_image_alt', true) ))\r\n\t);\r\n\t\r\n\t$retour->image\t\t= wp_get_attachment_image( $ref, $size , false, $default_attr);\r\n\t$retour->legende\t= '<p style=\"font-family:Tahoma, Arial, sans-serif;color:#666666;font-size:11px;margin:7px 0;padding:0;font-style:italic;\">' . get_post_meta($ref, '_wp_attachment_image_alt', true) . '</p>';\r\n\t\r\n\treturn $retour;\r\n}", "function wp_get_attachment_image_srcset($attachment_id, $size = 'medium', $image_meta = \\null)\n {\n }", "function truethemes_crop_image($thumb=null,$image_path=null,$width,$height){\n \n//first try, assuming image is internal.\n//use image-thumbs.php to get WordPress Uploaded photo.\n$image_output = array();\n$image_output = vt_resize($thumb,$image_path,$width,$height,true);\n$image_src = (string) $image_output['url'];\n \n//second try, if there is no image_src returned from first try, we assume is external\n//we get it from external using timthumbs.\n if(empty($image_src)){\n \n //get PHP loaded extension names array, for checking of curl and gd extension\n $extensions = get_loaded_extensions();\n \n //check for curl extension, if not installed disable script,\n //return original input image url.\n if(!in_array('curl',$extensions)){\n return;\n } \n \n //check for gd extension, if not installed disable script\n if(!in_array('gd',$extensions)){\n return;\n }\n \n //passed all checks for PHP extensions required by timthumb.\n //we construct the timthumb url for image_src\n \n if(is_multisite()){\n //multisite timthumb request url - to tested online.\n \n if(!empty($image_path)){\n \n global $blog_id;\n if (isset($blog_id) && $blog_id > 0) {\n $imageParts = explode('/files/', $image_path);\n if (isset($imageParts[1])) {\n $theImageSrc = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1];\n }\n } \n \t\t\t//check whether image is internal, using GD image library's function getimagesize()\n \t$check_url = WP_CONTENT_URL.$theImageSrc;\n $size = @getimagesize($check_url);\n \tif(!empty($size)){\n \t//this is internal image.\n \t$image_src = TIMTHUMB_SCRIPT_MULTISITE.\"?src=$theImageSrc&amp;h=$height&amp;w=$width\";\n \t}else{\n \t//if not, we assume it to be external image.\n \t$image_src = TIMTHUMB_SCRIPT_MULTISITE.\"?src=$image_path&amp;h=$height&amp;w=$width\"; \t\n \t}\n }\n \n }else{\n //single site timthumb request url\n if(!empty($image_path)){\n $image_src = TIMTHUMB_SCRIPT.\"?src=$image_path&amp;h=$height&amp;w=$width\";\n }\n \n }\n \n }\n \n //that's all, we return $image src.\n return $image_src;\n \n}", "function kt_get_image_id($image_url) {\n global $wpdb;\n $attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url )); \n return $attachment[0]; \n}", "function Generate_Featured_Image($file, $post_id, $desc)\n{\n preg_match('/[^\\?]+\\.(jpe?g|jpe|gif|png)\\b/i', $file, $matches);\n if (!$matches) {\n return new WP_Error('image_sideload_failed', __('Invalid image URL'));\n }\n\n $file_array = array();\n $file_array['name'] = basename($matches[0]);\n\n // Download file to temp location.\n $file_array['tmp_name'] = download_url($file);\n\n // If error storing temporarily, return the error.\n if (is_wp_error($file_array['tmp_name'])) {\n return $file_array['tmp_name'];\n }\n\n // Do the validation and storage stuff.\n $id = media_handle_sideload($file_array, $post_id, $desc);\n\n // If error storing permanently, unlink.\n if (is_wp_error($id)) {\n @unlink($file_array['tmp_name']);\n return $id;\n }\n return set_post_thumbnail($post_id, $id);\n\n}", "function get_thumb ($post_ID){\n $thumbargs = array(\n 'post_type' => 'attachment',\n 'numberposts' => 1,\n 'post_status' => null,\n 'post_parent' => $post_ID\n );\n $thumb = get_posts($thumbargs);\n if ($thumb) {\n return wp_get_attachment_image($thumb[0]->ID);\n }\n}", "function ridizain_the_attached_image() {\r\n\t$post = get_post();\r\n\t/**\r\n\t * Filter the default Ridizain attachment size.\r\n\t *\r\n\t * @since Ridizain 1.0\r\n\t *\r\n\t * @param array $dimensions {\r\n\t * An array of height and width dimensions.\r\n\t *\r\n\t * @type int $height Height of the image in pixels. Default 810.\r\n\t * @type int $width Width of the image in pixels. Default 810.\r\n\t * }\r\n\t */\r\n\t$attachment_size = apply_filters( 'ridizain_attachment_size', array( 810, 810 ) );\r\n\t$next_attachment_url = wp_get_attachment_url();\r\n\r\n\t/*\r\n\t * Grab the IDs of all the image attachments in a gallery so we can get the URL\r\n\t * of the next adjacent image in a gallery, or the first image (if we're\r\n\t * looking at the last image in a gallery), or, in a gallery of one, just the\r\n\t * link to that image file.\r\n\t */\r\n\t$attachment_ids = get_posts( array(\r\n\t\t'post_parent' => $post->post_parent,\r\n\t\t'fields' => 'ids',\r\n\t\t'numberposts' => -1,\r\n\t\t'post_status' => 'inherit',\r\n\t\t'post_type' => 'attachment',\r\n\t\t'post_mime_type' => 'image',\r\n\t\t'order' => 'ASC',\r\n\t\t'orderby' => 'menu_order ID',\r\n\t) );\r\n\r\n\t// If there is more than 1 attachment in a gallery...\r\n\tif ( count( $attachment_ids ) > 1 ) {\r\n\t\tforeach ( $attachment_ids as $attachment_id ) {\r\n\t\t\tif ( $attachment_id == $post->ID ) {\r\n\t\t\t\t$next_id = current( $attachment_ids );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// get the URL of the next image attachment...\r\n\t\tif ( $next_id ) {\r\n\t\t\t$next_attachment_url = get_attachment_link( $next_id );\r\n\t\t}\r\n\r\n\t\t// or get the URL of the first image attachment.\r\n\t\telse {\r\n\t\t\t$next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );\r\n\t\t}\r\n\t}\r\n\r\n\tprintf( '<a href=\"%1$s\" rel=\"attachment\">%2$s</a>',\r\n\t\tesc_url( $next_attachment_url ),\r\n\t\twp_get_attachment_image( $post->ID, $attachment_size )\r\n\t);\r\n}", "function shoestrap_image( $img ) {\n\n if ( empty( $img ) || ( empty( $img['id'] ) && empty( $img['url'] ) ) )\n return; // Nothing here to do!\n\n // We don't have an attachment id\n $img['id'] = ( empty( $img['id'] ) ) ? shoestrap_get_attachment_id_from_src( $img['url'] ) : $img['id'];\n\n // Get the full size attachment\n $image = wp_get_attachment_image_src( $img['id'], 'full' );\n\n $img['url'] = $image[0];\n \n $img['width'] = $image[1];\n $img['height'] = $image[2];\n\n return shoestrap_image_resize( $img );\n}", "function get_attachment_icon_src($id = 0, $fullsize = \\false)\n {\n }", "function wp_get_attachment_link($post = 0, $size = 'thumbnail', $permalink = \\false, $icon = \\false, $text = \\false, $attr = '')\n {\n }" ]
[ "0.83879715", "0.83010054", "0.78647757", "0.7850853", "0.7695717", "0.7610505", "0.7546507", "0.7486138", "0.7432408", "0.741648", "0.7410163", "0.73876184", "0.7382431", "0.7372987", "0.7353173", "0.7351048", "0.7315457", "0.7266962", "0.7259537", "0.7253262", "0.72440976", "0.72440976", "0.72418624", "0.7177164", "0.7177164", "0.7174015", "0.71508706", "0.7143225", "0.7118468", "0.7104277", "0.7064347", "0.70604944", "0.7060205", "0.70069975", "0.69852483", "0.69583446", "0.6952488", "0.6949964", "0.6935714", "0.69265133", "0.6924142", "0.691326", "0.69055533", "0.69004375", "0.68881613", "0.68848634", "0.6873864", "0.68553364", "0.685423", "0.6837436", "0.6819209", "0.6816111", "0.6809998", "0.6799467", "0.67815626", "0.67794794", "0.67790806", "0.6775324", "0.6771539", "0.6765164", "0.6756212", "0.67503977", "0.67425406", "0.67327344", "0.67313534", "0.6696233", "0.6683882", "0.6680414", "0.66370744", "0.6634793", "0.66277236", "0.6622271", "0.6614093", "0.66116184", "0.6597881", "0.6592427", "0.65911394", "0.65858704", "0.6580587", "0.6576543", "0.65638876", "0.65612805", "0.65588725", "0.655698", "0.65560615", "0.6554442", "0.6552499", "0.65400696", "0.65312904", "0.6526496", "0.6521489", "0.6519873", "0.65000993", "0.64943993", "0.6490205", "0.6488663", "0.6484197", "0.6471086", "0.6459839", "0.6458095" ]
0.73402846
16
HelloWorlds view display method
function display($tpl = null) { // Get data from the model $items = $this->get('Items'); $pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->assoc = $this->get('Assoc'); $this->activeFilters = $this->get('ActiveFilters'); $this->filterForm = $this->get('FilterForm'); $user = JFactory::getUser(); $userId = $user->get('id'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } // Assign data to the view $this->items = $items; $this->pagination = $pagination; // Set the toolbar and number of found items $this->addToolBar($this->pagination->total); // Display the template parent::display($tpl); // Set the document $this->setDocument(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display() {}", "public function display() {}", "public function index()\n\t{\n\t\t$data['result'] = $this->helloworld_model->getData();\n\t\t//load view and pass the data\n\t\t$this->load->view('helloWorld.view', $data);\n\t}", "public function indexAction()\n\t{\n\t\t$this->view->helloWorld = \"Howdy All!\";\n\t}", "public function display(){}", "public function display() {\n echo $this->render();\n }", "public function Index() {\n $this->Display();\n }", "public function index(){\n \n $this->display();\n }", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "function printSaying() {\n\n //show the view\n echo Template::instance()->render('views/saying.php');\n }", "public function index(){\r\n $this->display();\r\n }", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "public function showWelcome(){\n\t\treturn View::make('hello');\n\t}", "public function display() {\n $data = $this->container->get('data');\n $people = $data->load('people');\n $this->render('people', ['people' => $people]);\n }", "public function view() {\r\n\r\n\t}", "public function display() {\n\t}", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function showWelcome() {\n return View::make('hello');\n }", "public function display()\n {\n }", "public function display()\n {\n }", "public function index(){\n\t\treturn View::make('hello');\n\t}", "public function display()\n {\n }", "public function display()\n {\n }", "function index() {\n\n $this->view->render();\n\n }", "public function index()\n {\n $this->view();\n }", "public function index()\n {\n $this->view();\n }", "function index()\r\n\t{\r\n\t\t$this->view(); \r\n\t}", "public function index()\n {\n $post = $this->loadModel('post');\n $this->_view->posts = $post->getPosts();\n\n // de esta forma se pasan parámetros a la vista\n $this->_view->titulo = 'Hola - '.APP_NAME;\n\n // llamamos al metodo renderizar para mostrar la vista\n $this->_view->renderizar('hola','hola');\n }", "public function action_index()\n\t{\n\t\treturn Response::forge(View::forge('index/hello'));\n\t}", "function run() {\n\t\t$view = new View();\n\t\t\n\t\t$students = new Student();\n\t\tif ($view->students_tbl = $students->get_students_as_tbl_arr() ) {\n\t\t\t$view->error = $students->get_error();\n\t\t}\n\n\t\t$view->student_desc = $students->get_student_desc();\n\t\t$view->render('main_page.php');\n\t}", "public function display()\n \t{\n \t\t$this->assign(\"__view\", $this->_view);\n \t\tparent::display();\n \t}", "public abstract function display();", "public function index()\n {\n\n\n $this->view->render();\n }", "public function show()\n\t{\n\t\t\n\t}", "public function index()\n\t{\n $this->view->render();\n\t}", "public function display() {\n return $this->out(call_user_func_array([$this, 'render'], func_get_args()));\n }", "public function Display(){\n\t\trequire($this->viewFileName);\n\t}", "public static function view() \n {\n $articleDAO = new ArticleDAO();\n $articles = $articleDAO->load();\n\n $dispatch = new Dispatch();\n $dispatch->render(\n 'main_page', [\n 'articles' => $articles\n ]\n );\n }", "function main()\n\t{\n\t\t//Accedemos al metodo del controlador que nos trae la consulta\n\t\t$fecha = $this->Model->metodo(1);\n\n\t\t$hello \t= \"Hello World!\";\n\n\t\t//Metodo que renderiza la vista\n\t\t$this->view('index/main', compact('hello','fecha'));\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "function sayHi(){\n $bookList = $this->BookModel->getBooks();\n\n // Call Views\n $this->requireView(\"Master1\", [\n \"page\" => \"book\"\n ]);\n }", "public function view() {\n }", "public function display() {\r\n echo $this->template;\r\n }", "public function show()\n\t{\n\n\t}", "public function index () {\n $view = new WelcomeIndex();\n $view->display();\n }", "public function show();", "public function show();", "public function show();", "public function show();", "function display()\n {\n\n view::$output = $this->output;\n }", "public function display ()\n {\n echo $this->as_text ();\n }", "public function action_hello()\r\n\t{\r\n\t\treturn Response::forge(Presenter::forge('welcome/hello'));\r\n\t}", "public function display() {\r\n\t\t$this->script();\r\n\t\t$this->html();\r\n\t\t\r\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view');\n\t}", "public function index(){\n $example=new Example();//no hace falta incluir el modelo ya esta incluido\n $exampleArray=$example->getAll();\n //ESTE METODO INCLUYE UNA VISTA\n $this->view('Example/home',['exampleArray'=>$exampleArray]);\n }", "function runShowAction() {\n // Fetch data from database and pass it to the template\n $dao = new sample_SampleDAO;\n $this->samples = $dao->find(); // Get all 'samples'\n\n $this->title = \"'Show' Action\"; // Set the page (<h1>) title, and append to the document <title>\n $this->addNotice(\"Something happened.\"); // Send a notice to the user\n $this->greeting = \"Hello, world!\"; // Send some data to the template\n }", "public function show()\n {\n //the board string is used in the view\n $data = $this->getBoardAsString();\n require VIEW_PATH.'web.php';\n\n }", "public function display() {\n\t\t$this->init();\n\t\treturn $this->output();\n\t}", "public function indexAction()\n {\n $arr = [\n 'title' => 'Welcome',\n 'data' => [\n 'name' => 'PHP FRAMEWORK',\n ]\n ];\n View::renderTemplate('Welcome/index.html', $arr);\n }", "public function action_hello()\n\t{\n\t\treturn Response::forge(Presenter::forge('welcome/hello'));\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function index()\n {\n \n echo \"I am calling it from the index method controller\";\n echo \"This is my first test paragraph\"; \n \n }", "public function helloAction(){\n return $this->render('AcmeDemoBundle:Demo:hello.html.twig', array(\n 'name' => 'Billy Shen',\n ));\n }", "public function index()\r\n {\r\n View::render('home');\r\n }", "public function show() {\n\t}", "public function view()\n {\n //\n }", "public function index(){\r\n $this->load->view('hello');\r\n }", "function display()\n {\n view::$output = $this->output;\n }", "public function indexAction()\n\t{\n\t\t//echo 'Hello from the index action in the Home controller!';\n\t\t\n\t\t/*View::render('Home' . DS . 'index.php', [\n\t\t\t\"name\" => \"Laura\",\n\t\t\t\"colours\" => [\"red\", \"green\", \"blue\"]\n\t\t]);*/\n\t\t\n\t\t// View::renderTemplate('Home' . DS . 'index.html', [\n\t\t// \t\"name\" => \"Laura\",\n\t\t// \t\"colours\" => [\"red\", \"green\", \"blue\"]\n // ]);\n \n\t\t$this->showRouteParams();\n\t\t// echo \"Hello, World!\";\n }", "public function indexAction() {\n\t\t\n\t\t// plain assign\n\t\t$this->view->assign('helloworld1', 'Hello World 1!');\n\t\t\n\t\t// normal array assign\n\t\t$array = array('Hello','World','2!');\n\t\t$this->view->assign('helloworld2', $array);\n\t\t\n\t\t// assoziative array assign\n\t\t$array = array('first' => 'Hello', 'middle' => 'World', 'last' => '3!');\n\t\t$this->view->assign('helloworld3', $array);\n\t\t\n\t\t// object assign\n\t\t$start = new Tx_Efempty_Domain_Model_Start;\n \t$start->setTitle(\"Hello World 4!\");\n \t$this->view->assign('helloworld4', $start);\n\n\t}", "public function IndexAction() {\r\n $this->ExecuteView();\r\n }", "public function view() {\n\t\treturn;\n\t}", "public function index() {\n\t\t$this->display('index');\n\t}", "public function indexAction() {\n $this->view->title = 'Hello World !';\n $this->view->headTitle('Hello World !');\n }", "protected function display(){\n echo \"<div class='wrap'><h1 class='wp-heading-inline'>\".__('Hello There', 'eventus').\"</h1></div>\";\n return;\n }", "abstract function display();", "abstract function display();", "public function display()\n\t{\n\t\tparent::display();\n\t}", "private function display(){\n\t\t \n\t\tif(empty($this->view)){\n\t\t\tthrow new Exception(\"Empty view requested!\");\n\t\t}\n\t\t\n\t\t$controller_class = \"Controllers_\" . $this->view;\n\t\t\n\t\tif(!class_exists($controller_class)){\n\t\t\tthrow new Exception(\"Controller not found for determined view '{$this->view}'\");\n\t\t\treturn;\n\t\t} \n\t\t\n\t\t$this->controller = new $controller_class($_GET, $_POST);\n\t\t\n\t\t$output = $this->controller->display();\n\t\treturn $output;\n\t}", "public function showWelcome()\n\t{\n \n\t\treturn View::make('home');\n\t}", "function index() {\n $template = $this->loadView(\"home/index\");\n $template->set('name', 'Jonh Doe');\n $template->render();\n }", "public function indexAction() {\r\n $this->view->title = 'Hello World !';\r\n $this->view->headTitle('Hello World !');\r\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function show()\n {\n }", "public function show()\n {\n }", "public function show()\n {\n }", "public function show()\n {\n }", "public function show()\n {\n }", "public function show()\n {\n }", "public function show()\n {\n }" ]
[ "0.74884087", "0.74884087", "0.7443982", "0.73730195", "0.73443484", "0.7342499", "0.73226994", "0.7319136", "0.7313499", "0.7313499", "0.7313499", "0.7313499", "0.7313499", "0.7313499", "0.7313499", "0.7313499", "0.7313499", "0.7313499", "0.7278474", "0.7269094", "0.72639805", "0.7245661", "0.72325814", "0.721225", "0.7210504", "0.71953773", "0.719253", "0.71906304", "0.71906304", "0.7190032", "0.7189247", "0.7189247", "0.71119136", "0.70810467", "0.70810467", "0.7081027", "0.7077442", "0.7073795", "0.7059282", "0.70426536", "0.70423084", "0.70382714", "0.7032025", "0.7021636", "0.70141715", "0.70030856", "0.6999817", "0.6998322", "0.69838005", "0.69838005", "0.69838005", "0.69794226", "0.696307", "0.6936939", "0.69256556", "0.6882948", "0.6879129", "0.6879129", "0.6879129", "0.6879129", "0.68606067", "0.6846179", "0.6831256", "0.68249506", "0.68192965", "0.68185616", "0.6817676", "0.6812726", "0.68106765", "0.6806525", "0.68014115", "0.68005514", "0.67987734", "0.67865074", "0.6781351", "0.67764294", "0.67741334", "0.6773756", "0.67673796", "0.67570615", "0.675266", "0.6749577", "0.67481905", "0.67459106", "0.6735908", "0.67245495", "0.672412", "0.672412", "0.6723983", "0.67221016", "0.6718613", "0.67181695", "0.6716623", "0.6716036", "0.671211", "0.671211", "0.671211", "0.671211", "0.671211", "0.671211", "0.671211" ]
0.0
-1
Gets a single album record specified by its ID
public function getAlbumById($albumId, array $fetchOptions = array()) { $joinOptions = $this->prepareAlbumFetchOptions($fetchOptions); return $this->_getDb()->fetchRow(' SELECT album.* ' . $joinOptions['selectFields'] . ' FROM xengallery_album AS album ' . $joinOptions['joinTables'] . ' WHERE album.album_id = ? ', $albumId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show($id)\n {\n return albumdetail::findOrFail($id);\n }", "public function getAlbum($id)\n {\n // cast the supplied argument\n $id = (int)$id;\n // retrieve the rowset based on the supplied parameter id\n $rowset = $this->tableGateway->select(array('id' => $id));\n // get the first item in the rowset\n $row = $rowset->current();\n // if nothing throw an \\Exception\n if (! $row) {\n throw new \\Exception('Could not find row ' . $id);\n }\n // return the item\n return $row;\n }", "public function getAlbum($id)\n {\n $album = DB::table('albums')->select('name')->where(['id' => $id])->first();\n return $album->name;\n }", "public function getAlbum($id)\n {\n $key = md5($id);\n if($this->cache->hasItem($key)){\n return unserialize($this->cache->getItem($key));\n }\n\n $results = $this->realSpotifyApi->getAlbum($id);\n\n $this->cache->setItem($key, serialize($results));\n return $results;\n }", "function get_single_album($pid) {\n $sql = \"SELECT * FROM album WHERE id='$pid'\";\n $res = $this->mysqli->query($sql);\n return $res->fetch_array(MYSQLI_ASSOC);\n }", "public function show($id)\n {\n $sql = 'select * FROM albums WHERE id=:id';\n return DB::select($sql, ['id' => $id]);\n }", "public function getAlbum($id)\n {\n $id = (int) $id;\n $rowSet = $this->tableGateway->select(array('id' => $id));\n $row = $rowSet->current();\n \n if (!$row) {\n throw new \\Exception(\"Could not find row $id\");\n }\n \n return $row;\n }", "public function show($id)\n {\n $album = Album::with('photos')->findOrFail($id);\n return new AlbumsResource($album);\n }", "public function show($id)\n\t{\n\t\tif (Request::ajax()) {\n\t\t\t$album = Album::with('images')->find($id);\n\t\t\treturn $album;\n\t\t}\n\t}", "public function getAlbumById($album_id) {\n $query = \"SELECT\n al.id,\n al.name,\n al.year,\n al.version,\n al.location,\n al.sport,\n al.event_type,\n al.manufacturer,\n al.url\n FROM \" . $this->__schema . \".album al\n WHERE al.id = \" . $this->db()->quote($album_id);\n $data = $this->db()->getRow($query);\n if ($data) {\n return [\n 'success' => TRUE,\n 'payload' => $data,\n ];\n }\n else {\n return [\n 'success' => FALSE,\n 'payload' => NULL,\n ];\n }\n }", "public function getAlbum($id) {\n $this->requirePermission('album.get');\n\n $album = $this->controller->getAlbum($id, ['arts', 'artist' => function($query) {\n $query->select('id', 'name');\n }]);\n\n $album->makeVisible(['type', 'song_count', 'total_duration', 'song_ids']);\n\n return $this->response($album);\n }", "public function album ($album_id = '')\n {\n if (preg_match('#^http#iu', $album_id)) {\n $album_id = parse_url ($album_id, PHP_URL_PATH);\n $album_id = trim ($album_id, '/');\n\n if (preg_match ('#album\\/([a-z0-9]+)\\/?#iu', $album_id, $parts)) {\n $album_id = $parts[1];\n }\n }\n\n $url = sprintf (Request::ALBUMS_URL, $album_id);\n\n $this->_request($url, CurlClient::GET);\n\n if ( ! $this->_raw_output) {\n $this->_populate_album ($this->_body);\n }\n\n return $this->_body;\n }", "public function getRecord($id = null);", "public function get_albums_by_id($id)\n {\n $this->db->where('id', $id);\n $this->db->where('num_song >', 0);\n $data_album = $this->db->get('album_song')->row_array();\n\n return $data_album;\n }", "public function fetch_albums_id($id)\n {\n \t\t\n\t\t$this->db->select('*');\n $this->db->from(\"album_song\");\n\t\t$this->db->where('num_song >', 0);\n $this->db->where(\"user_id\", $id);\n $query = $this->db->get();\n \t\treturn $query->result();\n }", "public function getAlbum($id)\n {\n if (($id != '') && ctype_digit((string)$id)) {\n $query = 'SELECT albums.id, category_id, title, artist\n FROM albums \n LEFT JOIN categories \n ON categories.id = category_id \n WHERE albums.id= ?';\n return $this->_db->fetchAssoc($query, array((int)$id));\n } else {\n return array();\n }\n }", "public function show($id)\n {\n return BandArtist::where('id', '=', $id)\n ->first();\n }", "public function getAlbumAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n $albums = $em->getRepository(Album::class)->find($id);\n if (!$albums){\n //no blog entry is found so we set the view\n //to no content and set the staus code to 404\n $view = $this->view(null, 404);\n }\n else{\n //the blog entry exists, so we pass it to the view\n //and the status code defaults to 200 \"OK\"\n $view = $this->view($albums);\n }\n return $this->handleView($view);\n }", "public function getOne($id)\n {\n return $this->find(\"id\", $id);\n }", "public function find($id, $params = array())\n\t{\n\t\t$that = $this;\n\t\treturn $this->cache->load(\"album-$id\", function(&$dependencies) use ($that, $id, $params) {\n\t\t\t$dependencies[Cache::TAGS] = [\"album-$id\"];\n\t\t\treturn $that->doFind($id, $params);\n\t\t});\n\t}", "public function getOne($id)\n {\n return $this->repository->find($id);\n }", "public function getPhoto($id);", "public function get(string $id);", "public function fetch($albumId) \n\t{\t\t\n\t\t$select = $this->select();\n\t\t$select->where('albumId = ?', (int) $albumId);\t\t\n\t\t\n\t\treturn $this->fetchRow($select);\t\t\t\n\t}", "public function get( $id );", "public function getById( $id );", "public function show($id)\n {\n $user = JWTAuth::parseToken()->authenticate();\n $album = $this->albumRepository->find($id);\n\n if (Gate::forUser($user)->allows('albums-show', $album)) {\n\n $records = $this->albumRepository->findSongs($album);\n\n return response()->json([\n 'success' => true,\n 'album' => $this->prepareAlbumData($album, $records)\n ]);\n }else{\n return response()->json([\n 'success' => false,\n 'errors' => [\"Access denied, you don't have access to this album\"]\n ],403);\n }\n }", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function getMedia($aid) {\n\t\t$this->Media->recursive = -1;\n\t\treturn $this->Media->find('all', array('conditions' => array('Media.model' => 'album' , 'Media.model_id' => Sanitize::clean(intval($aid)))));\n\t}", "public function getById(string $id);", "public function findById($id)\n {\n return DogsGallery::where(\"id\", $id)\n ->first()\n ->format();\n }", "public function getAlbum(string $albumId): mixed\n {\n return $this->request(\"/v1/albums/{$albumId}\");\n }", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function get($id) {\r\n\treturn $this->getRepository()->find($id);\r\n }", "public function getRecord($id){\n\t\t$req = \"SELECT * FROM $this->table WHERE mdr_id = '$id' LIMIT 1\";\n\t\t$res = $this->select($req);\n\t\treturn $res[0];\n\t}", "public function getById(int $id);", "public function show($id)\n {\n $photos = PhotoManager::getPhotos($id, 24);\n\n if ($photos) return view('photos.album', ['photos' => $photos]);\n\n abort(404, 'Album not found.');\n }", "public function getByID($id)\n {\n $sql=\"CALL SP_APODERADOS_SELECT_BY_ID(?)\";\n return $this->mysqli->find($sql, $id);\n }", "public function getMediaItem($id);", "public static function find_photo($id){\n global $db;\n $message = null;\n $sql = \"SELECT * FROM photos WHERE photo_id = '\".$id.\"' LIMIT 1\";\n try {\n $result = $db->query($sql);\n $row = $result->fetch();\n return $row;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function getPhoto($id)\n {\n $res = $this->db->select(\"SELECT * FROM `{$this->domainPhoto}` WHERE itemName()='{$id}'\", array('ConsistentRead' => 'true'));\n $this->logErrors($res);\n if(isset($res->body->SelectResult->Item))\n return self::normalizePhoto($res->body->SelectResult->Item);\n else\n return false;\n }", "public function find($id)\n {\n $query=\"SELECT id,\".\n \"gid,\".\n \"name,\".\n \"artist_credit,\".\n \"length,\".\n \"comment,\".\n \"edits_pending,\".\n \"last_updated,\".\n \"video \". \t\t \n\t \"FROM recording \".\n\t \"WHERE id=\".$id;\n\n return($this->selectDB($query, \"Recording\"));\n }", "public function getArtist($id);", "public function get( $id ){}", "public function retrieveById($id);", "public function getById($id)\n {\n return self::where('id', (int) $id)->first();\n }", "public function one($id);", "public function load($id)\n {\n $album = $this->album->with('artist')->findOrFail($id);\n\n if ($this->needsUpdating($album)) {\n $this->updateAlbum($album);\n }\n\n return $album->fresh(['artist', 'tracks']);\n }", "public function retrieve(int $id);", "public function id($id)\n\t{\n\t\treturn $this->media($id);\n\t}", "public function getOne($id) {\n\n }", "public function byId($id)\n\t{\n\t\treturn $this->find('id', $id)->first();\n\t}", "static function getOne($id)\n {\n $data = static::find($id);\n return $data;\n }", "public static function get($id) {\n\t\treturn self::_getDao()->get(intval($id));\n\t}", "public static function findAlbumModel($id)\n {\n if (($model = Album::find()->where(['ID'=>$id])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "function get_by_id($id)\n {\n $this->db2->where($this->id, $id);\n return $this->db2->get($this->table)->row();\n }", "public function getItem($id)\n {\n return $this->where('id', $id)->first();\n }", "public static function getById($id)\n {\n return self::where('id', $id)->first();\n }", "public function get($id)\n {\n return $this->repository->find($id);\n }", "public function get($id)\n {\n return $this->repository->find($id);\n }", "public function get($id)\n {\n return $this->repository->find($id);\n }", "public function getAlbumToView($id)\n {\n if (($id != '') && ctype_digit((string)$id)) {\n $query = 'SELECT name, title, artist\n FROM albums, categories\n WHERE categories.id = category_id\n AND albums.id = ?';\n return $this->_db->fetchAssoc($query, array((int)$id));\n } else {\n return array();\n }\n }", "public function getById($id){\n return $this->_query->getById(\"id\", $id);\n }", "public function getRecord($id, $raw = false)\n {\n $this->debugPrint(\"Get Record: $id\");\n\n // Query String Parameters\n $options = array('s.q' => sprintf('ID:\"%s\"', $id));\n $options['s.role'] = $this->authedUser ? 'authenticated' : 'none';\n return $this->call($options, 'search', 'GET', $raw);\n }", "public function getById(ObjectId $anId);", "public static function getById($id) {\n\t \treturn PHDB::findOne( self::COLLECTION,array(\"_id\"=>new MongoId($id)));\n\t}", "public function fetchById($id)\n {\n return $this->prepareResult($this->galleryMapper->fetchById($id));\n }" ]
[ "0.7680586", "0.72639537", "0.7205902", "0.70213443", "0.69304967", "0.6917413", "0.6840376", "0.6812104", "0.67668647", "0.6688652", "0.66814816", "0.6677233", "0.6639389", "0.6615663", "0.65420336", "0.65393364", "0.651851", "0.65160537", "0.6485858", "0.6460096", "0.6459213", "0.6440473", "0.64203167", "0.6415502", "0.64054596", "0.6402731", "0.6394489", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63804424", "0.63568735", "0.635413", "0.6332915", "0.6329536", "0.63217", "0.63217", "0.63217", "0.63217", "0.63217", "0.63217", "0.63217", "0.63217", "0.63217", "0.63217", "0.63217", "0.63217", "0.63217", "0.63217", "0.63217", "0.6309558", "0.63055295", "0.63008356", "0.62849844", "0.62692076", "0.6259119", "0.62464726", "0.62429327", "0.62376857", "0.62232333", "0.6220345", "0.62164736", "0.62126786", "0.6206965", "0.6206712", "0.61998045", "0.6191709", "0.61873627", "0.6163681", "0.6145267", "0.6145145", "0.61331755", "0.61276823", "0.6118089", "0.6116203", "0.611281", "0.611281", "0.611281", "0.6111774", "0.60969037", "0.6089908", "0.6079345", "0.6077029", "0.60735667" ]
0.62354475
75
Gets album records specified by their IDs
public function getAlbumsByIds($albumIds, array $fetchOptions = array()) { $db = $this->_getDb(); $joinOptions = $this->prepareAlbumFetchOptions($fetchOptions); return $this->fetchAllKeyed(' SELECT album.* ' . $joinOptions['selectFields'] . ' FROM xengallery_album AS album ' . $joinOptions['joinTables'] . ' WHERE album.album_id IN (' . $db->quote($albumIds) . ') ', 'album_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAlbums($id = null, $params)\n {\n\t\t\n\t\t//Lets do a check to see if we have data. If not, then load albums.\n\t\t$sql = \"SELECT count(*) AS total FROM albums\";\n $result = $this->db->query($sql);\n $total = $result->fetch(PDO::FETCH_ASSOC);\n \n if($total['total'] == 0) {\n\t\t\t$this->loadAlbums();\n\t\t}\n \n $where = '';\n if($id !== null) {\n\t\t\t$where = 'WHERE album_id = '. $this->db->quote($id);\n\t\t}\n \n if(isset($params['order_col'])) {\n\t\t\tswitch($params['order_dir']) {\n\t\t\t\tcase 'asc':\n\t\t\t\tcase 'ascending':\n\t\t\t\t $direction = 'asc';\n\t\t\t\t break;\n\t\t\t\tcase 'desc':\n\t\t\t\tcase 'descending':\n\t\t\t\tdefault:\n\t\t\t\t $direction = 'desc';\n\t\t\t}\n\t\t\t\n\t\t\t$order = 'ORDER BY '. $this->db->quote($params['order_col']) . ' '. $direction;\n\t\t} else {\n\t\t\t$order = 'ORDER BY rank';\n\t\t}\n\t\t\n\t\tif(isset($params['limit'])) {\n\t\t\t$limit = 'LIMIT '. intval($params['limit']);\n\t\t} else {\n\t\t\t$limit = '';\n\t\t}\n\t\t$sql = \"SELECT * FROM albums {$where} {$order} {$limit}\";\n \n $result = $this->db->query($sql);\n \n $results = [];\n\n while ($row = $result->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t//Lets get album art.\n\t\t\t$row['art'] = $this->getAlbumArt($row['album_id']);\n\t\t\t\n\t\t\t//lets get category info as well\n\t\t\t$row['category'] = $this->getAlbumCategory($row['category_id']);\n\t\t\t\n $results[] = $row;\n }\n\n return $results;\n }", "public function getAlbums($id){\n $artist = Artist::find($id);\n return $artist->albums;\n }", "function get_albums($mysqli, $albumIDs)\n{\n\t$keys = array(\n\t\t\"al.albumID\",\n\t\t\"al.album_code\",\n\t\t\"al.album_name\",\n\t\t\"ar.artist_name\",\n\t\t\"g.genre AS general_genre\",\n\t\t\"al.genre\",\n\t\t\"r.review\",\n\t\t\"u.preferred_name AS reviewer\"\n\t);\n\n\t$q = \"SELECT \" . implode(\",\", $keys) . \" FROM `libalbum` AS al \"\n\t\t. \"INNER JOIN `libartist` AS ar ON ar.artistID=al.artistID \"\n\t\t. \"INNER JOIN `def_general_genres` AS g ON g.general_genreID=al.general_genreID \"\n\t\t. \"INNER JOIN `libreview` AS r ON r.albumID=al.albumID \"\n\t\t. \"INNER JOIN `users` AS u ON u.username=r.username \"\n\t\t. \"WHERE al.albumID IN ('\" . implode(\"', '\", $albumIDs) . \"')\";\n\t$result = exec_query($mysqli, $q);\n\n\t$albums = array();\n\twhile ( ($a = $result->fetch_assoc()) ) {\n\t\t$q = \"SELECT disc_num, track_num, track_name, airabilityID FROM `libtrack` \"\n\t\t\t. \"WHERE albumID = '$a[albumID]';\";\n\t\t$result_tracks = exec_query($mysqli, $q);\n\n\t\t$a[\"tracks\"] = array();\n\t\twhile ( ($t = $result_tracks->fetch_assoc()) ) {\n\t\t\t$a[\"tracks\"][] = $t;\n\t\t}\n\n\t\t$albums[] = $a;\n\t}\n\n\treturn $albums;\n}", "public function getByIds(array $ids);", "public function getAlbums()\n {\n return GalleryAlbum::get()->filter('ParentID', $this->ID);\n }", "public function getAlbums()\n\t{\n\t\treturn Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'azgallery_album`');\n\t}", "public function getAlbums($id, $site, $userId)\n\t{\n\t\tif (true === isset($id)) {\n\t\t\t// get by uniq id\n\t\t\t$exec = \"SELECT\n a.id, a.title\n\t\t\t FROM\n\t\t\t albums a\n\t\t\t INNER JOIN \n\t\t\t sites s ON s.id = a.site_id\n\t\t\t WHERE\n\t\t\t \ts.url = :site\n\t\t\t AND\n\t\t\t \ta.id = :id\n\t\t\t ORDER BY a.id DESC\";\n\t\t\t$db = DB::query(Database::SELECT, $exec);\n\t\t\t$db->param(':id', $id);\n\t\t\t$db->param(':site', $site);\n\t\t} elseif (true === isset($userId)) {\n\t\t\t$exec = \"SELECT\n a.id, a.title\n\t\t\t FROM\n\t\t\t albums a\n\t\t\t INNER JOIN \n\t\t\t sites s ON s.id = a.site_id\n\t\t\t INNER JOIN\n\t\t\t user_album ua ON ua.album_id = a.id\n\t\t\t WHERE\n\t\t\t \tua.user_id = :userid\n\t\t\t ORDER BY a.id DESC\";\n\t\t\t$db = DB::query(Database::SELECT, $exec);\n\t\t\t$db->param(':userid', $userId);\n\t\t} elseif (true === isset($site)) {\n\t\t\t// get by by site category\n\t\t\t$exec = \"SELECT\n a.id, a.title\n\t\t\t FROM\n\t\t\t albums a\n\t\t\t INNER JOIN \n\t\t\t sites s ON s.id = a.site_id\n\t\t\t WHERE\n\t\t\t \ts.url = :site\n\t\t\t ORDER BY a.id DESC\";\n\t\t\t$db = DB::query(Database::SELECT, $exec);\n\t\t\t$db->param(':site', $site);\n\t\t}\n\n\t\t$albums = $db->execute()\n\t\t\t ->as_array();\n\t\t\n\t\treturn $albums;\n\t\t\n\t\tprint_r($albums);\n\n\t\treturn array();\n\t}", "public function get_albums_by_id($id)\n {\n $this->db->where('id', $id);\n $this->db->where('num_song >', 0);\n $data_album = $this->db->get('album_song')->row_array();\n\n return $data_album;\n }", "public function getAlbumPhotos($albumId){\n return DB::select('select * from photos where album_id = ?', array($albumId));\n }", "public function getalbumbyID( $id, $sort = false )\n\t{\n\t\t$albums = array();\n\n\t\tif( is_array( $id ) )\n\t\t{\n\t\t\t$result = $this->db->query( \"SELECT * FROM \" . $this->table_prefix . \"_album WHERE id IN(\" . implode( \",\", $id ) . \")\" );\n\n\t\t\twhile( $row = $result->fetch() )\n\t\t\t{\n\t\t\t\t$albums[$row['id']] = $row;\n\t\t\t}\n\n\t\t\tif( $sort === true ) $albums = $this->sortArrayFromArrayKeys( $id, $albums );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->db->query( \"SELECT * FROM \" . $this->table_prefix . \"_album WHERE id=\" . $id );\n\t\t\t$albums = $result->fetch();\n\t\t}\n\n\t\treturn $albums;\n\t}", "public function get_album_suite()\n {\n $results = array();\n\n $catalog_where = \"\";\n $catalog_join = \"LEFT JOIN `catalog` ON `catalog`.`id` = `song`.`catalog`\";\n if ($catalog) {\n $catalog_where .= \" AND `catalog`.`id` = '$catalog'\";\n }\n if (AmpConfig::get('catalog_disable')) {\n $catalog_where .= \" AND `catalog`.`enabled` = '1'\";\n }\n\n $sql = \"SELECT DISTINCT `album`.`id` FROM album LEFT JOIN `song` ON `song`.`album`=`album`.`id` $catalog_join \" .\n \"WHERE `album`.`mbid`='$this->mbid' $catalog_where ORDER BY `album`.`disk` ASC\";\n\n $db_results = Dba::read($sql);\n\n while ($r = Dba::fetch_assoc($db_results)) {\n $results[] = $r['id'];\n }\n\n return $results;\n\n }", "public function getImages( $id_album = 0 )\n\t{\n\t\treturn Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'azgallery` WHERE `id_album`='.$id_album);\n\t}", "function getPictures($fb, $ids) {\n $fql = \"SELECT uid, pic_square FROM user WHERE uid IN (\" . implode(\",\", $ids) . \")\";\n \n $response = $fb->api(array(\n 'method' => 'fql.query',\n 'query' => $fql,\n ));\n \n $picture_by_id = array();\n foreach ($response as $r) {\n $picture_by_id[$r['uid']] = $r['pic_square'];\n }\n \n return $picture_by_id;\n}", "public function fetch_albums_id($id)\n {\n \t\t\n\t\t$this->db->select('*');\n $this->db->from(\"album_song\");\n\t\t$this->db->where('num_song >', 0);\n $this->db->where(\"user_id\", $id);\n $query = $this->db->get();\n \t\treturn $query->result();\n }", "public function getAlbums()\n {\n $url = str_replace(\"[:action]\", \"albums\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n $_albums = '';\n\n foreach ($result['data'] as $item) {\n $_album = new ImgUrAlbum();\n $_album->setAttributes($item);\n $_albums[] = $_album;\n }\n\n return $_albums;\n }", "public function get_ids($ids){\n $params = array();\n if(is_array($ids)){\n $params[\"ids\"] = implode(\",\", $ids);\n }else{\n $params[\"ids\"] = $ids;\n }\n if(!empty($this->access_token)){\n $params[\"access_token\"] = $this->access_token;\n }\n $url = self::GraphUrl.\"?\".OAuthUtil::build_http_query($params);\n $response = $this->http($url, self::$METHOD_GET);\n return $this->decode_JSON ? json_decode($response) : $response;\n }", "function showAllAlbum() {\n $sql = \"SELECT * FROM `itf_album`\";\n return $this->dbcon->FetchAllResults($sql);\n }", "public function getAllUserAlbums($userId){\n $albums = DB::select('\n select albums.*\n from albums\n where albums.user_id = ?\n order by album_created_at', array($userId));\n return $albums;\n }", "function get_album() {\n $sql = \"SELECT * FROM album\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function &getAlbums($uid = null, $aids = null)\n {\n // Requires a session_key\n if (!$skey = $this->_facebook->auth->getSessionKey()) {\n throw new Horde_Service_Facebook_Exception(\n 'photos.addTag requires a session_key',\n Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);\n }\n\n $results = $this->_facebook->callMethod(\n 'facebook.photos.getAlbums',\n array('uid' => $uid,\n 'aids' => $aids));\n\n return $results;\n }", "function getAlbumSongIDs($conn, $albumID) {\n // used to index $idArray\n $resultCount = 0;\n // will be used to return all ID's from the query\n $idArray = array();\n \n $query = \"SELECT song_id, song_track_number FROM album_song WHERE album_id = ${albumID} ORDER BY song_track_number\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = array(\n 'song_id' => $row['song_id'],\n 'track_number' => $row['song_track_number']\n );\n $resultCount++;\n }\n return $idArray;\n } else {\n // error\n return array(); // results of function must implement countable, so return empty array\n }\n }", "public function fetchByIds(array $ids);", "public function getArtists($id){\n $album = Album::find($id);\n return $album->artists;\n }", "function getAlbumsById($parameter) //récupère les infos de l'Album correspondant à l'album_id passé en paramètre\n\t\t{\n\t\t\t//$tabParameter = explode(\" \", $parameter);\n\t\t\t$request = \" albums 0 1000 album_id:$parameter tags:Itj\\n\";\n\t\t\t//echo \" contenu de request:$request\";\n\t\t\t$mySqueezeCLI = new SqueezeCLI($request);\n\t\t\t$response = $mySqueezeCLI->receiveCLI();\n\t\t\treturn $response;\n\t\t}", "public function getList($ids=null, $order_by = null, $order = null, $limit = null) {\r\n\t\t\r\n\t\t$query = \"SELECT * FROM $this->att\";\r\n\t\t\t\r\n\t\tif(count($ids) != 0) {\r\n\t\t\t\r\n\t\t\t$query .= \" WHERE \";\r\n\t\t\t\r\n\t\t\twhile (list($ind, $val) = each($ids)) {\r\n\t\t\t\t\r\n\t\t\t\tif($ind != 0) $query .= \" OR \";\r\n\t\t\t\tif($val != \"\") $query .= \" $this->att.attachment_id = $val\";\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t}\t\r\n\t\t\t\t\t\r\n\t\tif($order_by != null && $order != null) $query .= \" ORDER BY \" . $order_by . \" $order\";\r\n\t\t\r\n\t\tif($limit != null) $query .= \" LIMIT \" . $limit;\t\t\t\r\n\t\t\t\t\t\r\n\t\treturn $this->executeQuery($query);\r\n\t\t\t\t\r\n\t}", "public function show($id)\n {\n $sql = 'select * FROM albums WHERE id=:id';\n return DB::select($sql, ['id' => $id]);\n }", "function getUserPhotoAlbums($user_id=null,$profile_picture_album=false){\r\n\t\tif($user_id==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('user_id'=>$user_id));\r\n\t\tif($profile_picture_album==true)\r\n\t\t{\r\n\t\t\t$this->db->where(array('title'=>PROFILE_PICTURES));\t\t\r\n\t\t}\r\n\t\t$recordSet = $this->db->get(TBL_PHOTO_ALBUMS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "public function getAlbums(array $conditions = array(), array $fetchOptions = array())\n\t{\n\t\t$bind = array();\n\t\t\n\t\t$whereClause = $this->prepareAlbumConditions($conditions, $fetchOptions);\n\t\t\n\t\t$joinOptions = $this->prepareAlbumFetchOptions($fetchOptions, $conditions);\n\t\t$limitOptions = $this->prepareLimitFetchOptions($fetchOptions);\n\t\t$sqlClauses = $this->prepareAlbumFetchOptions($fetchOptions, $conditions);\n\n\t\t$albums = $this->fetchAllKeyed($this->limitQueryResults('\n\t\t\tSELECT album.*\n\t\t\t\t' . $joinOptions['selectFields'] . '\n\t\t\tFROM xengallery_album AS album\n\t\t\t\t' . $joinOptions['joinTables'] . '\n\t\t\t\tWHERE ' . $whereClause . '\n\t\t\t\t' . $sqlClauses['orderClause'] . '\t\t\t\n\t\t\t', $limitOptions['limit'], $limitOptions['offset']\n\t\t), 'album_id', $bind);\n\t\t\n\t\treturn $albums;\n\t}", "function getAlbumIDsFromAlbumSong($conn, $songID) {\n // used to index $idArray\n $resultCount = 0;\n // stores returned IDs from the query\n $idArray = array();\n \n $query = \"SELECT album_id FROM album_song WHERE song_id = ${songID}\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = $row['album_id'];\n $resultCount++;\n }\n return $idArray;\n } else {\n return NULL;\n }\n }", "public function find($id, $params = array())\n\t{\n\t\t$that = $this;\n\t\treturn $this->cache->load(\"album-$id\", function(&$dependencies) use ($that, $id, $params) {\n\t\t\t$dependencies[Cache::TAGS] = [\"album-$id\"];\n\t\t\treturn $that->doFind($id, $params);\n\t\t});\n\t}", "function getSongIDsFromAlbumSong($conn, $albumID) {\n // used to index $idArray\n $resultCount = 0;\n // stores returned IDs from the query\n $idArray = array();\n \n $query = \"SELECT song_id FROM album_song WHERE album_id = ${albumID}\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = $row['song_id'];\n $resultCount++;\n }\n return $idArray;\n } else {\n return NULL;\n }\n }", "public function getByIds($ids){\r\n\t\t$pfx = $this->c->dbprefix;\r\n\t\t$conn = $this->conn();\r\n\r\n\t\t$sql = \"select\r\n\t\t\tid,type,title,optionlength,\r\n\t\t\toption1,option2,option3,option4,option5,option6,option7,\r\n\t\t\tdescription,cent,id_quiz,id_parent,layout,path_listen\r\n\t\t\t from \".$pfx.\"wls_question where id in (\".$ids.\") or (id_parent !=0 and id_parent in (\".$ids.\")) order by id; \";\r\n\r\n\t\t$res = mysql_query($sql,$conn);\r\n\t\tif($res==false)die($sql);\r\n\t\t$data = array();\r\n\t\twhile($temp = mysql_fetch_assoc($res)){\r\n\t\t\tif($temp==false)die($sql);\r\n\t\t\t$temp['title'] = str_replace(\"__IMAGEPATH__\",$this->c->filePath.\"images/\",$temp['title']);\r\n\t\t\t$data[] = $temp;\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "public abstract function get_ids();", "public function getAlbum($id)\n {\n if (($id != '') && ctype_digit((string)$id)) {\n $query = 'SELECT albums.id, category_id, title, artist\n FROM albums \n LEFT JOIN categories \n ON categories.id = category_id \n WHERE albums.id= ?';\n return $this->_db->fetchAssoc($query, array((int)$id));\n } else {\n return array();\n }\n }", "public function getMedia($aid) {\n\t\t$this->Media->recursive = -1;\n\t\treturn $this->Media->find('all', array('conditions' => array('Media.model' => 'album' , 'Media.model_id' => Sanitize::clean(intval($aid)))));\n\t}", "public function mediaByAlbums($albums, $options = []){\n $order = isset($options['order']) && $options['order'] ? $options['order'] : null;\n $limit = isset($options['limit']) && $options['limit'] ? $options['limit'] : null;\n $offset = isset($options['offset']) && $options['offset'] ? $options['offset'] : null;\n \n $album = \\FlexCMS\\BasicCMS\\Models\\Item::where('item_type', '=', 'album');//->where('name', '=', $album)->first();\n // foreach ($albums as $key => $value) {\n // $album = $album->orWhere('name', '=', $value);\n // }\n $album = $album->whereIn('name', $albums);\n $album = $album->get();\n foreach ($album as $key => $value) {\n $album[$key]->media = \\FlexCMS\\BasicCMS\\Models\\Media::where('album_id', '=', $value->id);\n if ($order){\n $album[$key]->media = $album[$key]->media->orderByRaw($order);\n }\n $album[$key]->media = $album[$key]->media->get()->toArray();\n }\n \n return $album->toArray();\n }", "public function getAlbumAndArtistIds($albums = [])\n {\n if (!$albums) {\n return false;\n }\n\n $spotify_ids = [];\n\n foreach ($albums as $album) {\n $search = $this->searchAlbums($album);\n\n if (isset($search[0])) {\n $spotify_ids['albums'][] = $search[0]['id'];\n $spotify_ids['artists'][] = $search[0]['artists'][0]['id'];\n }\n\n // play nicely with rate limitation\n sleep(1);\n }\n\n return $spotify_ids;\n }", "private function getAlbums($aData)\n {\n /**\n * @var string\n */\n $sAction = (isset($aData['sAction']) && $aData['sAction'] == 'new') ? 'new' : 'more';\n /**\n * @var int\n */\n $iLastTimeStamp = isset($aData['iLastTimeStamp']) ? (int) $aData['iLastTimeStamp'] : 0;\n /**\n * @var string\n */\n $sView = isset($aData['sView']) ? $aData['sView'] : '';\n /**\n * @var int\n */\n $iAmountOfAlbum = isset($aData['iAmountOfAlbum']) ? (int) $aData['iAmountOfAlbum'] : 10;\n /**\n * @var string\n */\n $sSearch = isset($aData['sSearch']) ? $aData['sSearch'] : '';\n /**\n * @var array\n */\n $aCond = array();\n\n if (!empty($sSearch))\n {\n $aCond[] = 'm.name LIKE \"' . Phpfox::getLib('parse.input')->clean('%' . $sSearch . '%') . '\"';\n }\n switch ($sView) {\n case 'my':\n $aCond[] = 'm.user_id = ' . Phpfox::getUserId();\n break;\n\n case 'all':\n default:\n $aCond[] = 'm.view_id = 0';\n $aCond[] = 'm.privacy IN(0)';\n break;\n }\n if ($iLastTimeStamp > 0)\n {\n if ($sAction == 'more')\n {\n $aCond[] = 'm.time_stamp < ' . $iLastTimeStamp;\n }\n else\n {\n $aCond[] = 'm.time_stamp > ' . $iLastTimeStamp;\n }\n }\n $this->database()\n ->select('COUNT(*)')\n ->from(Phpfox::getT('music_album'), 'm');\n /**\n * @var int\n */\n $iCount = $this->database()\n ->where(implode(' AND ', $aCond))\n ->limit(1)\n ->execute('getField');\n if ($iCount == 0)\n {\n return array();\n }\n /**\n * @var array\n */\n $aAlbums = $this->database()\n ->select('lik.like_id AS is_liked, m.*, u.user_id, u.profile_page_id, u.server_id AS user_server_id, u.user_name, u.full_name, u.gender, u.user_image, u.is_invisible, u.user_group_id, u.language_id')\n ->from(Phpfox::getT('music_album'), 'm')\n ->leftJoin(Phpfox::getT('like'), 'lik', 'lik.type_id = \\'music_album\\' AND lik.item_id = m.album_id AND lik.user_id = ' . Phpfox::getUserId())\n ->join(Phpfox::getT('user'), 'u', 'u.user_id = m.user_id')\n ->where(implode(' AND ', $aCond))\n ->order('m.time_stamp DESC')\n ->limit(0, $iAmountOfAlbum, $iCount)\n ->execute('getRows');\n /**\n * @var array\n */\n $aResult = array();\n foreach ($aAlbums as $aAlbum)\n {\n $aResult[] = array(\n 'bIsLiked' => isset($aAlbum['is_liked']) ? (bool) $aAlbum['is_liked'] : false,\n 'iAlbumId' => $aAlbum['album_id'],\n 'iViewId' => $aAlbum['view_id'],\n 'iPrivacy' => $aAlbum['privacy'],\n 'iPrivacyComment' => $aAlbum['privacy_comment'],\n 'bIsFeatured' => (bool) $aAlbum['is_featured'],\n 'bIsSponsor' => (bool) $aAlbum['is_sponsor'],\n 'iUserId' => $aAlbum['user_id'],\n 'sName' => $aAlbum['name'],\n 'iYear' => $aAlbum['year'],\n 'sImagePath' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['server_id'],\n 'path' => 'music.url_image',\n 'file' => $aAlbum['image_path'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'iTotalTrack' => $aAlbum['total_track'],\n 'iTotalPlay' => $aAlbum['total_play'],\n 'iTotalComment' => $aAlbum['total_comment'],\n 'iTotalLike' => $aAlbum['total_like'],\n 'iTotalDislike' => $aAlbum['total_dislike'],\n 'iTotalScore' => $aAlbum['total_score'],\n 'iTotalRating' => $aAlbum['total_rating'],\n 'iTimeStamp' => $aAlbum['time_stamp'],\n 'sTimeStamp' => date('l, F j', $aAlbum['time_stamp']),\n 'sFullTimeStamp' => date('l, F j', $aAlbum['time_stamp']) . ' at ' . date('g:i a', $aAlbum['time_stamp']),\n 'sModuleId' => isset($aAlbum['module_id']) ? $aAlbum['module_id'] : 0,\n 'iItemId' => $aAlbum['item_id'],\n 'iProfilePageId' => $aAlbum['profile_page_id'],\n 'iUserServerId' => $aAlbum['user_server_id'],\n 'sUsername' => $aAlbum['user_name'],\n 'sFullname' => $aAlbum['full_name'],\n 'iGender' => $aAlbum['gender'],\n 'sUserImage' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['user_server_id'],\n 'path' => 'core.url_user',\n 'file' => $aAlbum['user_image'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'bIsInvisible' => $aAlbum['is_invisible'],\n 'iUserGroupId' => $aAlbum['user_group_id'],\n 'iLanguageId' => isset($aAlbum['language_id']) ? $aAlbum['language_id'] : 0\n );\n }\n return $aResult;\n }", "private function getAlbumArt($album_id)\n {\n\t\t$art_sql = \"SELECT album_image, image_size FROM album_art WHERE album_id = :album_id\";\n $stmt= $this->db->prepare($art_sql);\n\t\t\t\n\t\t$data = [\n\t\t\t'album_id' => $album_id,\n\t\t];\n\t\t\t\n\t\t$stmt->execute($data);\n\t\t\n\t\t\n\t\t$results = [];\n\t\twhile ($art = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$results[] = $art;\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "public function findByIds(array $ids);", "public function getPhotos($album_id)\n {\n $client = new Client();\n\n // get JSON from the webservice and convert it into an assoc. array\n return json_decode($client->get(\"http://jsonplaceholder.typicode.com/album/${album_id}/photos\")->getBody(), true);\n\n }", "public function getAlbumsAction()\n {\n $em = $this->getDoctrine()->getManager();\n $albums = $em->getRepository(Album::class)->findAll();\n\n return $this->handleView($this->view($albums));\n }", "public static function listByIds($ids) {\n $condition = array('`id` IN ('.implode(',', $ids).')');\n $start = 0;\n $limit = count($ids);\n $result = DB_Verify_Gems::getList($condition,$start, $limit);\n $list = array();\n foreach($result as $item) {\n $list[$item['id']] = $item;\n }\n return $list;\n }", "function getAlbums() {\n\n $ro = new GetAlbumsRO();\n $files = glob('Pics/*');\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $onefile = $files[$i];\n $imgs_in_album = glob(\"$onefile/*.[jJ][pP][gG]\");\n if (count($imgs_in_album) > 0)\n $album_image = $imgs_in_album[0];\n else\n $album_image = \"res/GenericAlbum.jpg\";\n $album_name = basename($onefile);\n\n $oneAlbum = new AlbumInfo($album_name, $album_image);\n array_push($ro->albums, $oneAlbum);\n }\n\n return $ro;\n}", "public function get_songs_by_album($id_album)\n {\n $this->db->where('album_id', $id_album);\n $this->db->order_by('id', 'DESC');\n $data_album = $this->db->get('audio_song')->result_array();\n\n return $data_album;\n }", "public function getMultiple($_ids, $_containerIds = NULL) {\n }", "function get_single_album($pid) {\n $sql = \"SELECT * FROM album WHERE id='$pid'\";\n $res = $this->mysqli->query($sql);\n return $res->fetch_array(MYSQLI_ASSOC);\n }", "public static function getSongs()\n {\n $songs = Song::with('album:id,name')->get();\n return $songs;\n }", "public function get_songs($limit = 0,$artist='')\n {\n $results = array();\n\n $sql = \"SELECT `song`.`id` FROM `song` \";\n if (AmpConfig::get('catalog_disable')) {\n $sql .= \"LEFT JOIN `catalog` ON `catalog`.`id` = `song`.`catalog` \";\n }\n $sql .= \"WHERE `song`.`album` = ? \";\n $params = array($this->id);\n if (strlen($artist)) {\n $sql .= \"AND `artist` = ? \";\n $params[] = $artist;\n }\n if (AmpConfig::get('catalog_disable')) {\n $sql .= \"AND `catalog`.`enabled` = '1' \";\n }\n $sql .= \"ORDER BY `song`.`track`, `song`.`title`\";\n if ($limit) {\n $sql .= \" LIMIT \" . intval($limit);\n }\n $db_results = Dba::read($sql, $params);\n\n while ($r = Dba::fetch_assoc($db_results)) {\n $results[] = $r['id'];\n }\n\n return $results;\n\n }", "function getUserAlbumPhotos($album_id=null,$profile_picture=false){\r\n\t\tif($album_id==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('photo_albums_id'=>$album_id));\r\n\t\tif($profile_picture==true)\r\n\t\t{\r\n\t\t\t$this->db->where(array('is_profile_picture'=>true));\t\t\r\n\t\t}\t\t\r\n\t\t$recordSet = $this->db->get(TBL_ALBUM_HAS_PHOTOS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "function getAlbumIDsFromArtistAlbum($conn, $artistID) {\n // used to index $idArray\n $resultCount = 0;\n // stores returned IDs from the query\n $idArray = array();\n \n $query = \"SELECT album_id FROM artist_album WHERE artist_id = ${artistID}\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = $row['album_id'];\n $resultCount++;\n }\n return $idArray;\n } else {\n return array();\n }\n }", "public function getByIds($ids)\n {\n return $this->model->whereIn('posts.id', $ids);\n }", "public static function getAlbumsForDropdown()\n\t{\n\t\treturn BackendModel::getDB()->getPairs('SELECT i.id, d.title FROM pictures_albums AS i\n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN pictures_albums_data AS d ON d.album_id = i.id AND d.language = ?', BackendLanguage::getInterfaceLanguage());\n\t}", "public function getByIds($ids)\n {\n $sql = \"SELECT * FROM `%s` WHERE `%s` IN (%s)\";\n $array = array_fill(0, count($ids), \"?\");\n $places = implode(\",\", $array);\n $this->_sql[] = sprintf($sql, $this->_table, $this->_key, $places);\n\n $parameters = array();\n foreach ($ids as $id) {\n $parameters[] = array($this->_key => $id);\n }\n $this->_parameters[] = $this->parameterize($parameters);\n }", "public function GetAlbums()\n {\n if ($handle = opendir('albums')) {\n # Loop thrue all entries in the directory handle untill it reads boolean FALSE\n while (false !== ($entry = readdir($handle))) {\n # Check to not display root and return links\n if ($entry != \".\" && $entry != \"..\") {\n # Display entry link\n include \"../private_html/templates/albumCell.php\";\n }\n }\n closedir($handle);\n }\n }", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function show($id)\n {\n return albumdetail::findOrFail($id);\n }", "public function getMulti( $ids ){\n\n // $IdPlaceholders = trim( str_repeat('?,', count($ids) ), ',' );\n\n $ids = join(',', $ids);\n\n $sql = \"\n SELECT\n tc.*,\n tcp.id AS challenge_id,\n tcp.user_id AS challenger_id,\n tcp.img AS challenger_img,\n tcp.joined as joined\n FROM `hotornot-dev`.tblChallenges AS tc\n LEFT JOIN `hotornot-dev`.tblChallengeParticipants AS tcp\n ON tc.id = tcp.challenge_id\n WHERE tc.id IN ( $ids )\n ORDER BY tcp.joined\";\n\n $stmt = $this->prepareAndExecute( $sql );\n\n //$params = array( $ids );\n //$stmt = $this->prepareAndExecute( $sql, $params );\n\n $data = $stmt->fetchAll( PDO::FETCH_CLASS, 'stdClass' );\n }", "public function getAlbums()\n {\n return $this->albums;\n }", "function getallalbumsindb(&$album_array)\r\n{\r\n global $xoopsDB;\r\n\r\n $sql = \"SELECT aid, title \".\r\n \"FROM \".$xoopsDB->prefix(\"xcgal_albums\").\" \".\r\n \"WHERE 1\";\r\n $result = $xoopsDB->query($sql);\r\n\r\n while ($row = $xoopsDB->fetchArray($result)) {\r\n $album_array[$row['aid']]= $row['title'];\r\n }\r\n $xoopsDB->freeRecordSet($result);\r\n}", "private function filterAlbumsOnly($records)\n {\n $type = 'album';\n $items = array_filter($records, function ($var) use ($type) {\n return ($var['album_type'] == $type);\n });\n\n return $items;\n }", "public function getAlbumElements($id)\n {\n return false;\n }", "public function moreFromAlbum($album_id)\n {\n return SongResource::collection(\\App\\Album::find($album_id)->songs()->orderBy('created_at')->get());\n }", "public function getAlbumsForArtist($artist_id,$artist_role){\r\n\t\tif($artist_id){\r\n\t\t\t$container = new container_db_dto();\r\n\t\t\t\r\n\t\t\t$limit = (int)$this->messenger[\"query\"][\"limit\"];\r\n\t\t\t$start = (int)$this->messenger[\"query\"][\"start\"];\r\n\t\t\t$orderBy = \"\";\r\n\t\t\tif(\t$this->messenger['query']['sf'] != '' ){\r\n\t\t\t\t$orderBy = \" ORDER BY am.\".$this->messenger['query']['sf'].\" \".$this->messenger['query']['so'];\r\n\t\t\t}\r\n\t\t\t$where = ' where am.status = 1 and aa.artist_id = '.$artist_id;\r\n\t\t\tif($artist_role!=null && key_exists($artist_role,$this->aConfig['artist_type'])){\r\n\t\t\t\t$artist_role_id = $this->aConfig['artist_type'][$artist_role];\r\n\t\t\t\tif($artist_role_id)\r\n\t\t\t\t\t$where = $where.\" and aa.artist_role & \".$artist_role_id.\"=\".$artist_role_id;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$this->apply_where_criteria($where);\r\n\t\t\t$this->sSql = \"select count(aa.album_id) as cnt\r\n\t\t\t\t\t\tfrom artist_album aa left join album_mstr am on am.album_id=aa.album_id\r\n\t\t\t\t\t\tleft join language_mstr lm on lm.language_id=am.language_id \r\n\t\t\t\t\t\tLEFT JOIN label_mstr lb ON lb.label_id=am.label_id \r\n\t\t\t\t\t\t\".$where;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$res = $this->oMysqli->query($this->sSql);\r\n\t\t\tif($res!=-1 and sizeof($res)>0){\r\n\t\t\t\t$container->settotal_count($res[0]->cnt);\r\n\t\t\t\t$this->sSql = \"SELECT am.broadcast_year,am.content_type,am.film_rating,am.grade,lm.language_id,\r\n\t\t\t\t\t\tam.music_release_date,am.album_id,am.album_name,lm.language_name,am.music_release_date,am.title_release_date,am.album_image,\r\n\t\t\t\t\tam.album_type,lb.label_name @@@album_desc@@@ @@@album_excerpt@@@\r\n\t\t\t\t\tfrom artist_album aa left join album_mstr am on am.album_id=aa.album_id\r\n\t\t\t\t\t\tleft join language_mstr lm on lm.language_id=am.language_id \r\n\t\t\t\t\t\tLEFT JOIN label_mstr lb ON lb.label_id=am.label_id \r\n\t\t\t\t\t\t\".$where.\" \".$orderBy .\" LIMIT $start, $limit\";\r\n\t\t\t\t$this->apply_includes();\r\n\t\t\t\t$res = $this->oMysqli->query($this->sSql);\r\n\t\t\t\t$data = array();\r\n\t\t\t\t$album_ids_arr = array();\r\n\t\t\t\tif(sizeof($res)>0 && $res!=-1){\r\n\t\t\t\t\tforeach ($res as $resValue){\r\n\t\t\t\t\t\t$album = new album_db_dto();\r\n\t\t\t\t\t\t$album->setalbum_id($resValue->album_id);\r\n\t\t\t\t\t\t$album_ids_arr[] = $resValue->album_id;\r\n\t\t\t\t\t\t$album->setalbum_name($resValue->album_name);\r\n\t\t\t\t\t\t$album->setalbum_language($resValue->language_name);\r\n\t\t\t\t\t\t$album->setalbum_language_id($resValue->language_id);\r\n\t\t\t\t\t\t$album->setalbum_music_rel_dt($resValue->music_release_date);\r\n\t\t\t\t\t\t$album->setalbum_label($resValue->label_name);\r\n\t\t\t\t\t\t$album->setalbum_type($this->oCommon->getalbumtype($resValue->album_type));\r\n\t\t\t\t\t\t$album->setalbum_title_rel_dt($resValue->title_release_date);\r\n\t\t\t\t\t\t$album->setalbum_df_image($resValue->album_image);\r\n\t\t\t\t\t\t$album->setalbum_broadcast_year($resValue->broadcast_year);\r\n\t\t\t\t\t\t$album->setalbum_content_type($this->oCommon->getalbumcontenttype($resValue->content_type));\r\n\t\t\t\t\t\t$album->setalbum_film_rating($resValue->film_rating);\r\n\t\t\t\t\t\t$album->setalbum_grade($resValue->grade);\r\n\t\t\t\t\t\tif(in_array(\"album_description\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t\t$album->setalbum_description($resValue->album_desc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(in_array(\"album_excerpt\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t\t$album->setalbum_excerpt($resValue->album_excerpt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$data[]=$album;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$artist_album_map=array();\r\n\t\t\t\t\t$artist_album_map = $this->oCommon->getArtistForAlbum($album_ids_arr);\r\n\t\t\t\t\t$album_tag_map = array();\r\n\t\t\t\t\tif(in_array(\"album_tags\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t$album_tag_map = $this->oCommon->getAlbumTags($album_ids_arr);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\tforeach($data as $album){\r\n\t\t\t\t\t\t$id = $album->getalbum_id();\r\n\t\t\t\t\t\tif(key_exists($id,$artist_album_map))\r\n\t\t\t\t\t\t\t$album->setalbum_artist($artist_album_map[$id]);\r\n\t\t\t\t\t\tif(key_exists($id,$album_tag_map))\r\n\t\t\t\t\t\t\t$album->setalbum_tags($album_tag_map[$id]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$container->setdata($data);\r\n\t\t\t\t\r\n\t\t\t\treturn $container->to_array();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "function get_detail_files_by_id($params) {\n $sql = \"SELECT * FROM fa_files WHERE data_id = ? AND ref_id = ?\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->row_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "public function getAllIds();", "public function getAllThePhotosAccordingTolAlbum($offset,$photo_per_page,$albumId){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myQuery=\"SELECT photo FROM photo WHERE album_id='\".$albumId.\"' LIMIT $offset,$photo_per_page\";\n\t\t\t $result=$conn->query($myQuery);\n\t\t\t foreach($result as $image){\n\t\t\t\t array_push($this->photos,$image['photo']);\n\t\t\t }\n\t\t\t $conn=null;\n\t\t\t return $this->photos;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "public function getByIds(): GetByIdsRequestBuilder {\n return new GetByIdsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function show($id)\n {\n $album = Album::with('photos')->findOrFail($id);\n return new AlbumsResource($album);\n }", "public function getListItems()\n {\n return $this->getAlbums();\n }", "public function getAlbum($id)\n {\n $key = md5($id);\n if($this->cache->hasItem($key)){\n return unserialize($this->cache->getItem($key));\n }\n\n $results = $this->realSpotifyApi->getAlbum($id);\n\n $this->cache->setItem($key, serialize($results));\n return $results;\n }", "function getAlbums($operator_id, $page_no = 1) {\n\t\treturn $this->getResponse ( $this->getXmlApi (), 'getAlbums', array ('operator_id' => $operator_id, 'page_no' => $page_no ) );\n\t}", "public function getUserAlbums($user_id, $start, $page_size) {\n $query_params = array(\n 'columns' => 'id, name, description',\n 'where' => 'user_id = ?',\n 'orderby' => 'create_date DESC',\n 'limit' => '?, ?'\n );\n \n $bind_params = array($user_id, $start, $page_size);\n $albums = $this->find($query_params, $bind_params);\n \n return $albums;\n }", "public function get_data_songs_epk($album_id){\n return $this->db->where('album_id', $album_id)\n ->order_by('id', 'DESC')\n ->get('audio_song')->result_array();\n }", "public function getAlbumToView($id)\n {\n if (($id != '') && ctype_digit((string)$id)) {\n $query = 'SELECT name, title, artist\n FROM albums, categories\n WHERE categories.id = category_id\n AND albums.id = ?';\n return $this->_db->fetchAssoc($query, array((int)$id));\n } else {\n return array();\n }\n }", "function get_songs() { \n\n\t\t$results = array();\n\n\t\t$sql = \"SELECT * FROM `playlist_data` WHERE `playlist`='\" . Dba::escape($this->id) . \"' ORDER BY `track`\";\n\t\t$db_results = Dba::query($sql);\n\n\t\twhile ($r = Dba::fetch_assoc($db_results)) { \n\t\t\tif ($r['dyn_song']) { \n\t\t\t\t$array = $this->get_dyn_songs($r['dyn_song']);\n\t\t\t\t$results = array_merge($array,$results);\n\t\t\t}\n\t\t\telse { \n\t\t\t\t$results[] = $r['object_id'];\n\t\t\t} \n\n\t\t} // end while\n\n\t\treturn $results;\n\n\t}", "private function getItemsById(array $dealIds): array\n\t{\n\t\tif (empty($dealIds))\n\t\t{\n\t\t\treturn [];\n\t\t}\n\t\t$deals = [];\n\n\t\t$dealQuery = \\Bitrix\\Crm\\DealTable::query();\n\t\t$dealQuery->whereIn('ID', $dealIds);\n\t\t$dealQuery\n\t\t\t->addSelect('ID')\n\t\t\t->addSelect('TITLE')\n\t\t\t->addSelect('COMPANY.LOGO', 'COMPANY_LOGO')\n\t\t\t->addSelect('COMPANY.TITLE', 'COMPANY_TITLE')\n\t\t\t->addSelect('CONTACT.NAME', 'CONTACT_NAME')\n\t\t\t->addSelect('CONTACT.LAST_NAME', 'CONTACT_LAST_NAME')\n\t\t\t->addSelect('CONTACT.PHOTO', 'CONTACT_PHOTO')\n\t\t;\n\n\t\t$dealList = $dealQuery->exec();\n\t\twhile ($dealItem = $dealList->fetch())\n\t\t{\n\t\t\t$deal = [\n\t\t\t\t'id' => $dealItem['ID'],\n\t\t\t\t'title' => $dealItem['TITLE'],\n\t\t\t];\n\t\t\tif ($dealItem['CONTACT_NAME'] <> '' || $dealItem['CONTACT_LAST_NAME'] <> '')\n\t\t\t{\n\t\t\t\t$deal['client'] = \\CCrmContact::GetFullName(['NAME' => $dealItem['CONTACT_NAME'], 'LAST_NAME' => $dealItem['CONTACT_LAST_NAME']]);\n\t\t\t}\n\t\t\telseif ($dealItem['COMPANY_TITLE'] <> '')\n\t\t\t{\n\t\t\t\t$deal['client'] = $dealItem['COMPANY_TITLE'];\n\t\t\t}\n\n\t\t\t$photoId = null;\n\t\t\tif ($dealItem['CONTACT_PHOTO'] > 0)\n\t\t\t{\n\t\t\t\t$photoId = $dealItem['CONTACT_PHOTO'];\n\t\t\t}\n\t\t\telseif ($dealItem['COMPANY_LOGO'] > 0)\n\t\t\t{\n\t\t\t\t$photoId = $dealItem['COMPANY_LOGO'];\n\t\t\t}\n\t\t\tif ($photoId > 0)\n\t\t\t{\n\t\t\t\t$resizedPhoto = \\CFile::ResizeImageGet($photoId, ['width' => 100, 'height' => 100], BX_RESIZE_IMAGE_PROPORTIONAL);\n\t\t\t\tif ($resizedPhoto)\n\t\t\t\t{\n\t\t\t\t\tif (mb_substr($resizedPhoto['src'], 0, 1) === '/')\n\t\t\t\t\t{\n\t\t\t\t\t\t$deal['photo'] = \\CHTTP::URN2URI($resizedPhoto['src']);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$deal['photo'] = $resizedPhoto['src'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$deals[$deal['id']] = $deal;\n\t\t}\n\t\t$activityBindings = array_map(\n\t\t\tfunction($dealId) {\n\t\t\t\treturn [\n\t\t\t\t\t'OWNER_ID' => $dealId,\n\t\t\t\t\t'OWNER_TYPE_ID' => \\CCrmOwnerType::Deal,\n\t\t\t\t];\n\t\t\t},\n\t\t\tarray_keys($deals)\n\t\t);\n\n\t\t$dealActivities = [];\n\t\t$activitiesList = \\CCrmActivity::GetList(\n\t\t\t[],\n\t\t\t[\n\t\t\t\t'=COMPLETED' => 'N',\n\t\t\t\t'CHECK_PERMISSIONS' => 'N',\n\t\t\t\t'BINDINGS' => $activityBindings,\n\t\t\t\t'=TYPE_ID' => \\CCrmActivityType::Provider,\n\t\t\t\t'=PROVIDER_ID' => \\Bitrix\\Crm\\Activity\\Provider\\CallTracker::PROVIDER_ID,\n\t\t\t\t'=RESPONSIBLE_ID' => $this->getCurrentUser()->getId()\n\t\t\t],\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t[\n\t\t\t\t'OWNER_ID',\n\t\t\t\t'CREATED',\n\t\t\t\t'DEADLINE',\n\t\t\t\t'SETTINGS',\n\t\t\t\t'DIRECTION',\n\t\t\t]\n\t\t);\n\t\t$deadlineTs = (new \\Bitrix\\Main\\Type\\DateTime)\n\t\t\t->toUserTime()\n\t\t\t->setTime(23, 59, 59)\n\t\t\t->getTimestamp()\n\t\t;\n\n\t\twhile ($activityItem = $activitiesList->Fetch())\n\t\t{\n\t\t\tif (!isset($dealActivities[$activityItem['OWNER_ID']]))\n\t\t\t{\n\t\t\t\t$dealActivities[$activityItem['OWNER_ID']] = [\n\t\t\t\t\t'COUNT' => 0,\n\t\t\t\t\t'LAST_CREATED' => 0,\n\t\t\t\t\t'SETTINGS' => [],\n\t\t\t\t\t'DIRECTION' => \\CCrmActivityDirection::Undefined,\n\t\t\t\t];\n\t\t\t}\n\t\t\t$activityDeadlineTs = (new \\Bitrix\\Main\\Type\\DateTime($activityItem['DEADLINE']))->getTimestamp();\n\t\t\tif ($activityDeadlineTs <= $deadlineTs)\n\t\t\t{ // overdue\n\t\t\t\t$dealActivities[$activityItem['OWNER_ID']]['COUNT']++;\n\t\t\t}\n\n\t\t\t$dateCreate = (new \\Bitrix\\Main\\Type\\DateTime($activityItem['CREATED']))\n\t\t\t\t->toUserTime()\n\t\t\t\t->getTimestamp()\n\t\t\t;\n\t\t\tif ($dealActivities[$activityItem['OWNER_ID']]['LAST_CREATED'] < $dateCreate)\n\t\t\t{ // get data from last activity\n\t\t\t\t$dealActivities[$activityItem['OWNER_ID']]['LAST_CREATED'] = $dateCreate;\n\t\t\t\t$dealActivities[$activityItem['OWNER_ID']]['SETTINGS'] = $activityItem['SETTINGS'];\n\t\t\t}\n\t\t\t$dealActivities[$activityItem['OWNER_ID']]['DIRECTION'] = $activityItem['DIRECTION'];\n\t\t}\n\n\t\t$culture = \\Bitrix\\Main\\Application::getInstance()->getContext()->getCulture();\n\t\t$dateFormat = $culture->getShortDateFormat();\n\t\t$timeFormat = $culture->getShortTimeFormat();\n\t\t$todayTs = (new \\Bitrix\\Main\\Type\\DateTime())\n\t\t\t->toUserTime()\n\t\t\t->setTime(0, 0, 0)\n\t\t\t->getTimestamp()\n\t\t;\n\n\t\t$items = [];\n\t\tforeach ($dealIds as $dealId)\n\t\t{\n\t\t\t$deal = $deals[$dealId];\n\t\t\tif (!$deal)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$activity = $dealActivities[$dealId];\n\t\t\tif ($activity['COUNT'])\n\t\t\t{\n\t\t\t\t$deal['activityCount'] = (string)$activity['COUNT'];\n\t\t\t}\n\t\t\tif ($activity['LAST_CREATED'])\n\t\t\t{\n\t\t\t\t$deal['date'] = date(\n\t\t\t\t\t$activity['LAST_CREATED'] < $todayTs ? $dateFormat : $timeFormat,\n\t\t\t\t\t$activity['LAST_CREATED']\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ($activity['DIRECTION'] != \\CCrmActivityDirection::Undefined)\n\t\t\t{\n\t\t\t\t$deal['direction'] = $activity['DIRECTION'];\n\t\t\t}\n\t\t\tif ($activity['SETTINGS'] && isset($activity['SETTINGS']['DURATION']) && $activity['SETTINGS']['DURATION'] > 0)\n\t\t\t{\n\t\t\t\t$minutes = (int)($activity['SETTINGS']['DURATION'] / 60);\n\t\t\t\t$seconds = (int)($activity['SETTINGS']['DURATION'] % 60);\n\t\t\t\t$deal['duration'] = $minutes > 0 ?\n\t\t\t\t\tLoc::getMessage('CRM_CALL_TRACKER_DURATION_LONG', ['#MIN#' => $minutes, '#SEC#' => $seconds]) :\n\t\t\t\t\tLoc::getMessage('CRM_CALL_TRACKER_DURATION_SHORT', ['#SEC#' => $seconds]);\n\t\t\t}\n\n\t\t\t$items[] = $deal;\n\t\t}\n\n\t\treturn $items;\n\t}", "public function getAllIds(): array;", "function getArtistIDsFromArtistAlbum($conn, $albumID) {\n // used to index $idArray\n $resultCount = 0;\n // stores returned IDs from the query\n $idArray = array();\n \n $query = \"SELECT artist_id FROM artist_album WHERE album_id = ${albumID}\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = $row['artist_id'];\n $resultCount++;\n }\n return $idArray;\n } else {\n return NULL;\n }\n }", "public function ids( array $params = array() );", "public function byId(array $ids) {\n return $this->addSearchParam('id', implode(',', $ids))->get();\n }", "public function get_data_songs($album_id)\n {\n $data_songs = $this->db->where('album_id', $album_id)->get('audio_song')->result_array();\n\n return $data_songs;\n }", "public function getMediaIdsFromAlbum($albumId)\n\t{\n\t\treturn $this->_getDb()->fetchCol('\n\t\t\tSELECT media_id\n\t\t\tFROM xengallery_media\n\t\t\tWHERE album_id = ?\n\t\t', $albumId);\n\t}", "function readByIds($ids){\r\n\r\n\t$ids_arr = str_repeat('?,', count($ids) - 1) . '?';\r\n\r\n\t// query to select products\r\n\t$query = \"SELECT id, name, price FROM \" . $this->table_name . \" WHERE id IN ({$ids_arr}) ORDER BY name\";\r\n\r\n\t// prepare query statement\r\n\t$stmt = $this->conn->prepare($query);\r\n\r\n\t// execute query\r\n\t$stmt->execute($ids);\r\n\r\n\t// return values from database\r\n\treturn $stmt;\r\n}", "function getAlbumImages($args)\n{\n global $_zp_current_image;\n if (is_object($login_state = authorize($args))) {\n return $login_state;\n }\n $args = decode64($args);\n logger('getAlbumImages', ($args['loglevel']));\n $albumobject = getItemByID('albums', $args['id']);\n $images = $albumobject->getImages();\n if (!($albumobject || !$args['id'])) {\n return new ZEN_Error(-1, 'No folder with database ID '.$args['id'].' found!');\n }\n makeAlbumCurrent($albumobject);\n $list = [];\n while (next_image(true)) {\n $meta = $_zp_current_image->getmetadata();\n if ($meta['EXIFDateTimeOriginal']) {\n $imagedate = $meta['EXIFDateTimeOriginal'];\n } else {\n $imagedate = false;\n }\n $list[] = entitysave([\n 'id' => $_zp_current_image->getID(),\n 'albumid' => $_zp_current_image->getAlbum()->getID(),\n 'name' => $_zp_current_image->filename,\n 'shortdate' => date('Y-m-d', (strtotime(str_replace(' ', '', (str_replace(':', '', $imagedate)))))),\n 'longdate' => $imagedate,\n 'url' => WEBPATH.'index.php?album='.urlencode($_zp_current_image->album->name).'&image='.urlencode($_zp_current_image->filename),\n 'folder' => $_zp_current_image->getAlbum()->getFolder(),\n // added by monta\n 'thumbnail' => $_zp_current_image->getThumbImageFile(),\n 'description' => $_zp_current_image->getDesc(),\n 'commentcount' => count($_zp_current_image->getComments()),\n ]);\n } //next_image( true )\n //writelog((var_export($list, true)));\n return $list;\n}", "function findByIds($ids) {\n return IncomingMails::find(array(\n 'conditions' => array('id IN (?)', $ids),\n 'order' => 'created_on DESC',\n ));\n }", "public function loadAlbums()\n {\n\t\t$json = file_get_contents('https://itunes.apple.com/us/rss/topalbums/limit=100/json');\n \n $albums = json_decode($json, true);\n $category_sql = \"INSERT IGNORE INTO categories (name, category_id, link) VALUES (:name, :category_id, :link)\";\n\t\t$album_sql = \"INSERT IGNORE INTO albums (album_id, name, artist, artist_link, category_id, release_date, rank) VALUES (:album_id, :name, :artist, :artist_link, :category_id, :release_date, :rank)\";\n\t\t$images_sql = \"INSERT IGNORE INTO album_art (album_id, album_image, image_size) VALUES (:album_id, :album_image, :image_size)\";\n\n\t\t//Lets delete whatever is in these tables before adding to them.\n\t\t$this->purgeTables();\n \n foreach($albums['feed']['entry'] as $rank=>$album) {\n\t\t\t\n\t\t\t//Insterts categories\n\t\t\t$stmt= $this->db->prepare($category_sql);\n\t\t\t\n\t\t\t$data = [\n\t\t\t\t'name' => $album['category']['attributes']['label'],\n\t\t\t\t'category_id' => $album['category']['attributes']['im:id'],\n\t\t\t\t'link' => $album['category']['attributes']['scheme'],\n\t\t\t];\n\t\t\t\n\t\t\t$stmt->execute($data);\n\t\t\t\n\t\t\t//Insterts album info\n\t\t\t$stmt= $this->db->prepare($album_sql);\n\t\t\t\n\t\t\t$data = [\n\t\t\t\t'album_id' => $album['id']['attributes']['im:id'],\n\t\t\t\t'name' => $album['title']['label'],\n\t\t\t\t'artist' => $album['im:artist']['label'],\n\t\t\t\t'artist_link' => (isset($album['im:artist']['attributes'])) ? $album['im:artist']['attributes']['href'] : '',\n\t\t\t\t'category_id' => $album['category']['attributes']['im:id'],\n\t\t\t\t'release_date' => $album['im:releaseDate']['label'],\n\t\t\t\t'rank' => $rank,\n\t\t\t];\n\n\t\t\t$stmt->execute($data);\n\t\t\t\n\t\t\t//inserts album images\n\t\t\t$stmt= $this->db->prepare($images_sql);\n\t\t\t\n\t\t\tforeach($album['im:image'] as $image){\n\t\t\t\t$data = [\n\t\t\t\t\t'album_id' => $album['id']['attributes']['im:id'],\n\t\t\t\t\t'album_image' => $image['label'],\n\t\t\t\t\t'image_size' => $image['attributes']['height'],\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\t$stmt->execute($data);\n\t\t\t}\n\t\t}\n\t}", "public function getAlbumSongs($albumID, $limit = null)\r\n {\r\n if (!is_numeric($albumID)) {\r\n return array();\r\n }\r\n\r\n $args = array('albumID' => (int)$albumID);\r\n if (!empty($limit)) {\r\n $args['limit'] = (int)$limit;\r\n }\r\n\r\n //todo: remove this once we everything is forced dynamically\r\n $sessionID = false;\r\n if (isset($this) && !empty($this->sessionID)) {\r\n $sessionID = $this->sessionID;\r\n }\r\n return self::makeCall('getAlbumSongs', $args, 'songs', false, $sessionID);\r\n }", "public function fetchById($id)\n {\n return $this->prepareResult($this->galleryMapper->fetchById($id));\n }", "public function getAlbumDataByAlbumId($albumId){\n $albums = DB::select('SELECT albums . * , users.username, COUNT( photos.photo_id ) AS album_photos_count\n FROM albums\n LEFT JOIN users ON albums.user_id = users.id\n LEFT JOIN photos ON albums.album_id = photos.album_id\n WHERE albums.album_id = ?\n GROUP BY albums.album_id', array($albumId));\n\n return $albums;\n }", "function _read($criteria, $ids, $owner, $fields)\n {\n $results = $this->_getEntry($ids, $fields);\n return $results;\n }", "public function getAlbumsId()\n {\n $url = str_replace(\"[:action]\", \"albums/ids\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n return isset($result['data']) && !empty($result['data']) ? $result['data'] : null;\n }", "public function get_songs_by_playlist_amp($id_album)\n {\n $data_album = $this->db\n ->select('audio_song.*, audio_amp.id as ID')\n ->where('playlist_amp_id', $id_album)\n ->join('audio_song', 'audio_song.id = audio_amp.audio_song_id ')\n ->get('audio_amp')\n ->result_array();\n\n return $data_album;\n }", "public function getAlbums($feuser_uid) {\r\n\t\t$res = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_albums WHERE cruser_id = \"'.intval($feuser_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1;');\r\n\t\treturn $res;\r\n\t}", "private function _get_records($tag_ids, $page_size, $offset, $sort_field, $sort_direction, $search_type, $include_albums) {\n\n $items_model = ORM::factory(\"item\");\n if ($search_type == \"AND\") {\n // For some reason, if I do 'select(\"*\")' the item ids all have values that are 1000+\n // higher then they should be. So instead, I'm manually selecting each column that I need.\n $items_model->select(\"items.id\");\n $items_model->select(\"items.name\");\n $items_model->select(\"items.title\");\n $items_model->select(\"items.view_count\");\n $items_model->select(\"items.owner_id\");\n $items_model->select(\"items.rand_key\");\n $items_model->select(\"items.type\");\n $items_model->select(\"items.thumb_width\");\n $items_model->select(\"items.thumb_height\");\n $items_model->select(\"items.left_ptr\");\n $items_model->select(\"items.right_ptr\");\n $items_model->select(\"items.relative_path_cache\");\n $items_model->select(\"items.relative_url_cache\");\n $items_model->select('COUNT(\"*\") AS result_count');\n }\n $items_model->viewable();\n $items_model->join(\"items_tags\", \"items.id\", \"items_tags.item_id\");\t\t\n $items_model->open();\n $items_model->where(\"items_tags.tag_id\", \"=\", $tag_ids[0]);\n $counter = 1;\n while ($counter < count($tag_ids)) {\n $items_model->or_where(\"items_tags.tag_id\", \"=\", $tag_ids[$counter]);\n $counter++;\n }\n $items_model->close();\n if ($include_albums == false) {\n $items_model->and_where(\"items.type\", \"!=\", \"album\");\n }\n $items_model->order_by($sort_field, $sort_direction);\n $items_model->group_by(\"items.id\");\n if ($search_type == \"AND\") {\n $items_model->having(\"result_count\", \"=\", count($tag_ids));\n }\n\n return $items_model->find_all($page_size, $offset);\n }", "public function getIds();", "public function getIds();", "public function fetchAll($params = [])\n {\n\t\t\\Requests::register_autoloader();\n\t\t$request = \\Requests::get(\"https://api.spotify.com/v1\" . \"/me/playlists?limit=50&offset=0\", array('authorization'=> 'Bearer '\n\t\t\t\t. $_SERVER['HTTP_TOKEN']));\n\t\tif ($request->status_code == 200) {\n\t\t\t$infosPlaylists = json_decode($request->body, true);\n\t\t\t$listePlaylist = array();\n\t\t\t$listeIdPLaylist = array();\n\t\t\t$listeIdUSer = array();\n\t\t\tforeach ($infosPlaylists['items'] as $playlist){\n\t\t\t\t\n\t\t\t\t$listePlaylist[$playlist['id']] = array(\n\t\t\t\t\t\t'id'\t\t=> $playlist['id'],\n\t\t\t\t\t\t'title'\t\t=> $playlist['name'],\n\t\t\t\t\t\t'url_Image'\t=> $playlist['images'][0]['url'] ?? null,\n\t\t\t\t\t\t'id_user'\t=> $playlist['owner']['id'],\n\t\t\t\t\t\t'nb_track'\t=> ($playlist['tracks']['total'] > 100 ? 100 : $playlist['tracks']['total'])\n\t\t\t\t);\n\t\t\t\t$listeIdPLaylist[] = $playlist['id'];\n\t\t\t\t$listeIdUSer[] = $playlist['owner']['id'];\n\t\t\t}\n\t\t\t$this->mapper->createAllPlaylist($listePlaylist, $listeIdPLaylist, $listeIdUSer);\n\t\t\t\n\t\t\treturn $listePlaylist;\n\t\t} else{\n\t\t\n\t\t\treturn new ApiProblem($request->status_code, json_decode($request->body));\n\t\t}\n }", "public final function findAll(){\n\n //Récupère la méthode de connection à la Base de donnée\n $dbc = Application::getInstance()->getDBConnection();\n\n //Variable où la requête est enregistrée\n $query = \"select * from Album\";\n\n //Requête en dur, prends la bdd et y exécute la requête\n $stmt = $dbc->query($query);\n\n /*Récupère tout les tuples de Album, et les transpose dans des instances de classe Album\n Et fini par enregistrer le résultat dans $results, FALSE est retourné s'ya erreur */\n $results = $stmt->fetchALL(PDO::FETCH_CLASS, 'Album');\n\n //Retourne le résultat de $results\n return $results;\n }", "public function getPhoto($id);" ]
[ "0.6963483", "0.69035167", "0.66454595", "0.652936", "0.64436555", "0.63796324", "0.6309666", "0.62913924", "0.6249941", "0.6211603", "0.61848205", "0.6179421", "0.61719173", "0.61085486", "0.6090378", "0.60691005", "0.6057127", "0.6051881", "0.6036797", "0.6029593", "0.6010385", "0.59987515", "0.59583664", "0.5947314", "0.5928427", "0.5921287", "0.59033906", "0.5894569", "0.5889236", "0.58875185", "0.5872143", "0.58691144", "0.5863277", "0.58539504", "0.5853615", "0.58466846", "0.5838798", "0.58301103", "0.5823159", "0.5821739", "0.582081", "0.58039635", "0.58012503", "0.5789934", "0.57888937", "0.57848555", "0.5772913", "0.5769258", "0.5751351", "0.57413524", "0.5724659", "0.57034487", "0.5703339", "0.5689608", "0.5686291", "0.56832093", "0.56821036", "0.5666503", "0.56633294", "0.56622136", "0.56415564", "0.5641087", "0.56391925", "0.5630884", "0.5622198", "0.5610349", "0.5609942", "0.5608339", "0.5606891", "0.56037456", "0.55987", "0.55971503", "0.5592561", "0.55901295", "0.55846983", "0.55827105", "0.5578473", "0.55723757", "0.55547035", "0.5553902", "0.55537045", "0.5545873", "0.55450916", "0.5531325", "0.5522926", "0.55138814", "0.55123", "0.5507801", "0.55043024", "0.5502384", "0.5499868", "0.5487804", "0.54866755", "0.54786575", "0.54728454", "0.54699427", "0.54699427", "0.54651403", "0.54642975", "0.54579437" ]
0.5967942
22
Gets albums based on various criteria
public function getAlbums(array $conditions = array(), array $fetchOptions = array()) { $bind = array(); $whereClause = $this->prepareAlbumConditions($conditions, $fetchOptions); $joinOptions = $this->prepareAlbumFetchOptions($fetchOptions, $conditions); $limitOptions = $this->prepareLimitFetchOptions($fetchOptions); $sqlClauses = $this->prepareAlbumFetchOptions($fetchOptions, $conditions); $albums = $this->fetchAllKeyed($this->limitQueryResults(' SELECT album.* ' . $joinOptions['selectFields'] . ' FROM xengallery_album AS album ' . $joinOptions['joinTables'] . ' WHERE ' . $whereClause . ' ' . $sqlClauses['orderClause'] . ' ', $limitOptions['limit'], $limitOptions['offset'] ), 'album_id', $bind); return $albums; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAlbums()\n {\n $url = str_replace(\"[:action]\", \"albums\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n $_albums = '';\n\n foreach ($result['data'] as $item) {\n $_album = new ImgUrAlbum();\n $_album->setAttributes($item);\n $_albums[] = $_album;\n }\n\n return $_albums;\n }", "public function getAlbums()\n {\n return GalleryAlbum::get()->filter('ParentID', $this->ID);\n }", "function getAlbums($type='LATEST')\n{\n\t$data = array();\n\t$condition = '';\n\tswitch($type)\n\t{\n\t\tcase 'LATEST':\n\t\t\t$condition = '';\n\t\tbreak;\n\t\t\n\t\tcase 'USER':\n\t\t\t$condition = 'AND a.album_type=3 ';\n\t\tbreak;\n\t\t\n\t\tcase 'EVENTS':\n\t\t\t$condition = 'AND a.album_type=1 ';\n\t\tbreak;\n\t\t\n\t\tcase 'MATCHES':\n\t\t\t$condition = 'AND a.album_type=2 ';\n\t\tbreak;\n\t}\n\t$q = 'SELECT a.album_id, a.name, at.name, u.username, a.user_id, a.date, p.thumb '.\n\t\t\t'FROM albums AS a, album_type AS at, users AS u, pictures AS p '.\n\t\t\t'WHERE a.user_id = u.user_id '.\n\t\t\t'AND a.album_type = at.type_id '.\n\t\t\t'AND a.cover_id = p.picture_id '.\n\t\t\t$condition.\n\t\t\t'ORDER BY a.date DESC';\n\t\n\t$res = mysql_query($q)\n\t\tor die(mysql_error());\n\twhile($row = mysql_fetch_array($res))\n\t{\n\t\t$data[] = array('id'=>$row['album_id'],\n\t\t\t\t\t\t'album_name'=>$row[1],\n\t\t\t\t\t\t'type_name'=>$row[2],\n\t\t\t\t\t\t'username'=>$row['username'],\n\t\t\t\t\t\t'date'=>$row['date'],\n\t\t\t\t\t\t'user_id'=>$row['user_id'],\n\t\t\t\t\t\t'pic_count'=>countPictures($row['album_id']),\n\t\t\t\t\t\t'cover'=>$row['thumb']);\n\t}\n\tSmartyPaginate::setTotal(count($data));\n\treturn array_slice($data, SmartyPaginate::getCurrentIndex(),SmartyPaginate::getLimit());\n}", "private function getAlbums($aData)\n {\n /**\n * @var string\n */\n $sAction = (isset($aData['sAction']) && $aData['sAction'] == 'new') ? 'new' : 'more';\n /**\n * @var int\n */\n $iLastTimeStamp = isset($aData['iLastTimeStamp']) ? (int) $aData['iLastTimeStamp'] : 0;\n /**\n * @var string\n */\n $sView = isset($aData['sView']) ? $aData['sView'] : '';\n /**\n * @var int\n */\n $iAmountOfAlbum = isset($aData['iAmountOfAlbum']) ? (int) $aData['iAmountOfAlbum'] : 10;\n /**\n * @var string\n */\n $sSearch = isset($aData['sSearch']) ? $aData['sSearch'] : '';\n /**\n * @var array\n */\n $aCond = array();\n\n if (!empty($sSearch))\n {\n $aCond[] = 'm.name LIKE \"' . Phpfox::getLib('parse.input')->clean('%' . $sSearch . '%') . '\"';\n }\n switch ($sView) {\n case 'my':\n $aCond[] = 'm.user_id = ' . Phpfox::getUserId();\n break;\n\n case 'all':\n default:\n $aCond[] = 'm.view_id = 0';\n $aCond[] = 'm.privacy IN(0)';\n break;\n }\n if ($iLastTimeStamp > 0)\n {\n if ($sAction == 'more')\n {\n $aCond[] = 'm.time_stamp < ' . $iLastTimeStamp;\n }\n else\n {\n $aCond[] = 'm.time_stamp > ' . $iLastTimeStamp;\n }\n }\n $this->database()\n ->select('COUNT(*)')\n ->from(Phpfox::getT('music_album'), 'm');\n /**\n * @var int\n */\n $iCount = $this->database()\n ->where(implode(' AND ', $aCond))\n ->limit(1)\n ->execute('getField');\n if ($iCount == 0)\n {\n return array();\n }\n /**\n * @var array\n */\n $aAlbums = $this->database()\n ->select('lik.like_id AS is_liked, m.*, u.user_id, u.profile_page_id, u.server_id AS user_server_id, u.user_name, u.full_name, u.gender, u.user_image, u.is_invisible, u.user_group_id, u.language_id')\n ->from(Phpfox::getT('music_album'), 'm')\n ->leftJoin(Phpfox::getT('like'), 'lik', 'lik.type_id = \\'music_album\\' AND lik.item_id = m.album_id AND lik.user_id = ' . Phpfox::getUserId())\n ->join(Phpfox::getT('user'), 'u', 'u.user_id = m.user_id')\n ->where(implode(' AND ', $aCond))\n ->order('m.time_stamp DESC')\n ->limit(0, $iAmountOfAlbum, $iCount)\n ->execute('getRows');\n /**\n * @var array\n */\n $aResult = array();\n foreach ($aAlbums as $aAlbum)\n {\n $aResult[] = array(\n 'bIsLiked' => isset($aAlbum['is_liked']) ? (bool) $aAlbum['is_liked'] : false,\n 'iAlbumId' => $aAlbum['album_id'],\n 'iViewId' => $aAlbum['view_id'],\n 'iPrivacy' => $aAlbum['privacy'],\n 'iPrivacyComment' => $aAlbum['privacy_comment'],\n 'bIsFeatured' => (bool) $aAlbum['is_featured'],\n 'bIsSponsor' => (bool) $aAlbum['is_sponsor'],\n 'iUserId' => $aAlbum['user_id'],\n 'sName' => $aAlbum['name'],\n 'iYear' => $aAlbum['year'],\n 'sImagePath' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['server_id'],\n 'path' => 'music.url_image',\n 'file' => $aAlbum['image_path'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'iTotalTrack' => $aAlbum['total_track'],\n 'iTotalPlay' => $aAlbum['total_play'],\n 'iTotalComment' => $aAlbum['total_comment'],\n 'iTotalLike' => $aAlbum['total_like'],\n 'iTotalDislike' => $aAlbum['total_dislike'],\n 'iTotalScore' => $aAlbum['total_score'],\n 'iTotalRating' => $aAlbum['total_rating'],\n 'iTimeStamp' => $aAlbum['time_stamp'],\n 'sTimeStamp' => date('l, F j', $aAlbum['time_stamp']),\n 'sFullTimeStamp' => date('l, F j', $aAlbum['time_stamp']) . ' at ' . date('g:i a', $aAlbum['time_stamp']),\n 'sModuleId' => isset($aAlbum['module_id']) ? $aAlbum['module_id'] : 0,\n 'iItemId' => $aAlbum['item_id'],\n 'iProfilePageId' => $aAlbum['profile_page_id'],\n 'iUserServerId' => $aAlbum['user_server_id'],\n 'sUsername' => $aAlbum['user_name'],\n 'sFullname' => $aAlbum['full_name'],\n 'iGender' => $aAlbum['gender'],\n 'sUserImage' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['user_server_id'],\n 'path' => 'core.url_user',\n 'file' => $aAlbum['user_image'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'bIsInvisible' => $aAlbum['is_invisible'],\n 'iUserGroupId' => $aAlbum['user_group_id'],\n 'iLanguageId' => isset($aAlbum['language_id']) ? $aAlbum['language_id'] : 0\n );\n }\n return $aResult;\n }", "public function getAlbums()\n\t{\n\t\treturn Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'azgallery_album`');\n\t}", "function getAlbums() {\n\n $ro = new GetAlbumsRO();\n $files = glob('Pics/*');\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $onefile = $files[$i];\n $imgs_in_album = glob(\"$onefile/*.[jJ][pP][gG]\");\n if (count($imgs_in_album) > 0)\n $album_image = $imgs_in_album[0];\n else\n $album_image = \"res/GenericAlbum.jpg\";\n $album_name = basename($onefile);\n\n $oneAlbum = new AlbumInfo($album_name, $album_image);\n array_push($ro->albums, $oneAlbum);\n }\n\n return $ro;\n}", "public function get_album_suite()\n {\n $results = array();\n\n $catalog_where = \"\";\n $catalog_join = \"LEFT JOIN `catalog` ON `catalog`.`id` = `song`.`catalog`\";\n if ($catalog) {\n $catalog_where .= \" AND `catalog`.`id` = '$catalog'\";\n }\n if (AmpConfig::get('catalog_disable')) {\n $catalog_where .= \" AND `catalog`.`enabled` = '1'\";\n }\n\n $sql = \"SELECT DISTINCT `album`.`id` FROM album LEFT JOIN `song` ON `song`.`album`=`album`.`id` $catalog_join \" .\n \"WHERE `album`.`mbid`='$this->mbid' $catalog_where ORDER BY `album`.`disk` ASC\";\n\n $db_results = Dba::read($sql);\n\n while ($r = Dba::fetch_assoc($db_results)) {\n $results[] = $r['id'];\n }\n\n return $results;\n\n }", "public function getAlbums()\n {\n return $this->albums;\n }", "function showAllAlbum() {\n $sql = \"SELECT * FROM `itf_album`\";\n return $this->dbcon->FetchAllResults($sql);\n }", "function get_top_albums() {\n\t\t$data = $this->_request_data('topalbums');\n\n\t\tif (!$data) return false;\n\n\t\tforeach ($data->album as $album) {\n\t\t\t$album = new LastfmAlbum($album, $this->_connection);\n\t\t\t//$album->artist = $this->name;\n\t\t\t$result[] = $album;\n\t\t}\n\n\t\treturn $result;\n\n\t}", "public function get_albums()\r\n\t{\r\n\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=album&alt=rss&prettyprint=true\");\r\n\t\treturn $xml;\r\n\t}", "public function getAlbums($id){\n $artist = Artist::find($id);\n return $artist->albums;\n }", "public function mediaByAlbums($albums, $options = []){\n $order = isset($options['order']) && $options['order'] ? $options['order'] : null;\n $limit = isset($options['limit']) && $options['limit'] ? $options['limit'] : null;\n $offset = isset($options['offset']) && $options['offset'] ? $options['offset'] : null;\n \n $album = \\FlexCMS\\BasicCMS\\Models\\Item::where('item_type', '=', 'album');//->where('name', '=', $album)->first();\n // foreach ($albums as $key => $value) {\n // $album = $album->orWhere('name', '=', $value);\n // }\n $album = $album->whereIn('name', $albums);\n $album = $album->get();\n foreach ($album as $key => $value) {\n $album[$key]->media = \\FlexCMS\\BasicCMS\\Models\\Media::where('album_id', '=', $value->id);\n if ($order){\n $album[$key]->media = $album[$key]->media->orderByRaw($order);\n }\n $album[$key]->media = $album[$key]->media->get()->toArray();\n }\n \n return $album->toArray();\n }", "public function getAlbums($id = null, $params)\n {\n\t\t\n\t\t//Lets do a check to see if we have data. If not, then load albums.\n\t\t$sql = \"SELECT count(*) AS total FROM albums\";\n $result = $this->db->query($sql);\n $total = $result->fetch(PDO::FETCH_ASSOC);\n \n if($total['total'] == 0) {\n\t\t\t$this->loadAlbums();\n\t\t}\n \n $where = '';\n if($id !== null) {\n\t\t\t$where = 'WHERE album_id = '. $this->db->quote($id);\n\t\t}\n \n if(isset($params['order_col'])) {\n\t\t\tswitch($params['order_dir']) {\n\t\t\t\tcase 'asc':\n\t\t\t\tcase 'ascending':\n\t\t\t\t $direction = 'asc';\n\t\t\t\t break;\n\t\t\t\tcase 'desc':\n\t\t\t\tcase 'descending':\n\t\t\t\tdefault:\n\t\t\t\t $direction = 'desc';\n\t\t\t}\n\t\t\t\n\t\t\t$order = 'ORDER BY '. $this->db->quote($params['order_col']) . ' '. $direction;\n\t\t} else {\n\t\t\t$order = 'ORDER BY rank';\n\t\t}\n\t\t\n\t\tif(isset($params['limit'])) {\n\t\t\t$limit = 'LIMIT '. intval($params['limit']);\n\t\t} else {\n\t\t\t$limit = '';\n\t\t}\n\t\t$sql = \"SELECT * FROM albums {$where} {$order} {$limit}\";\n \n $result = $this->db->query($sql);\n \n $results = [];\n\n while ($row = $result->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t//Lets get album art.\n\t\t\t$row['art'] = $this->getAlbumArt($row['album_id']);\n\t\t\t\n\t\t\t//lets get category info as well\n\t\t\t$row['category'] = $this->getAlbumCategory($row['category_id']);\n\t\t\t\n $results[] = $row;\n }\n\n return $results;\n }", "function getAlbums($operator_id, $page_no = 1) {\n\t\treturn $this->getResponse ( $this->getXmlApi (), 'getAlbums', array ('operator_id' => $operator_id, 'page_no' => $page_no ) );\n\t}", "function getSubAlbums($album)\n{\n $list = [];\n $albumObj = new Album($album);\n $albumID = $albumObj->getID();\n $parentID = getItemByID('albums', $albumID);\n if ($albumObj->isDynamic() || !$albumID) {\n return $list;\n }\n $subalbums = $albumObj->getAlbums(null, null, null, null, true);\n $subalbums = $parentID->getAlbums(null, null, null, null, true);\n if (is_array($subalbums)) {\n foreach ($subalbums as $subalbum) {\n $list[] = $subalbum;\n $list = array_merge($list, getSubAlbums($subalbum));\n } //$subalbums as $subalbum\n } //is_array($subalbums)\n return $list;\n}", "public static function getAlbumsForDropdown()\n\t{\n\t\treturn BackendModel::getDB()->getPairs('SELECT i.id, d.title FROM pictures_albums AS i\n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN pictures_albums_data AS d ON d.album_id = i.id AND d.language = ?', BackendLanguage::getInterfaceLanguage());\n\t}", "public function GetAlbums()\n {\n if ($handle = opendir('albums')) {\n # Loop thrue all entries in the directory handle untill it reads boolean FALSE\n while (false !== ($entry = readdir($handle))) {\n # Check to not display root and return links\n if ($entry != \".\" && $entry != \"..\") {\n # Display entry link\n include \"../private_html/templates/albumCell.php\";\n }\n }\n closedir($handle);\n }\n }", "public function testGetAllAlbums()\n {\n for($i = 1; self::ALBUMS_TO_MOCK >= $i; $i++) {\n // First, mock the object to be used in the test\n $album = $this->createMock(Album::class);\n $albums[] = $album;\n }\n\n // Now, mock the repository so it returns the mock of the album\n $albumRepository = $this\n ->getMockBuilder(AlbumRepository::class)\n ->disableOriginalConstructor()\n ->getMock();\n $albumRepository->expects($this->once())\n ->method('findAll')\n ->will($this->returnValue($albums));\n\n // Last, mock the EntityManager to return the mock of the repository\n $entityManager = $this\n ->getMockBuilder(ObjectManager::class)\n ->disableOriginalConstructor()\n ->getMock();\n $entityManager->expects($this->once())\n ->method('getRepository')\n ->will($this->returnValue($albumRepository));\n\n $albumFatsManager = new AlbumManagerService($entityManager, self::$paginator, self::$serializer);\n\n $result = json_decode( $albumFatsManager->getAllAlbums(), true);\n $this->assertArrayHasKey('items', $result);\n }", "public function getPhotoAlbums($iPage, $iLimit = 2) {\n \t$bIsUserProfile = false;\n \t\n \tif (defined('PHPFOX_IS_USER_PROFILE')) {\n \t\t$bIsUserProfile = true;\n \t\t$aUser = Phpfox::getService('user')->get($this->_aParams['user_id']); \t\t\t\n \t}\n \t\n \t$oLibSearch = Phpfox::getLib('search');\n \tPhpfox::getLib('request')->set('page', $iPage);\n \t\n \t\n $aBrowseParams = array(\n\t\t\t'module_id' => 'photo.album',\n\t\t\t'alias' => 'pa',\n\t\t\t'field' => 'album_id',\n\t\t\t'table' => Phpfox::getT('photo_album'),\n\t\t\t'hide_view' => array('pending', 'myalbums')\n\t\t);\t\t\n\t\t\n\t\t$oLibSearch->set(array(\n\t\t\t\t'type' => 'photo.album',\n\t\t\t\t'field' => 'pa.album_id',\t\t\t\t\n\t\t\t\t'search_tool' => array(\n\t\t\t\t\t'table_alias' => 'pa',\n\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t'default_value' => Phpfox::getPhrase('photo.search_photo_albums'),\n\t\t\t\t\t\t'name' => 'search',\n\t\t\t\t\t\t'field' => 'pa.name'\n\t\t\t\t\t),\n\t\t\t\t\t'sort' => array(\n\t\t\t\t\t\t'latest' => array('pa.time_stamp', Phpfox::getPhrase('photo.latest')),\n\t\t\t\t\t\t'most-talked' => array('pa.total_comment', Phpfox::getPhrase('photo.most_discussed'))\n\t\t\t\t\t),\n\t\t\t\t\t'show' => array($iLimit)\n\t\t\t\t)\n\t\t\t)\n\t\t);\t\t\t\n\t\tif ($bIsUserProfile)\n\t\t{\n\t\t\t$oLibSearch->setCondition('AND pa.view_id ' . ($aUser['user_id'] == Phpfox::getUserId() ? 'IN(0,2)' : '= 0') . ' AND pa.privacy IN(' . (Phpfox::getParam('core.section_privacy_item_browsing') ? '%PRIVACY%' : Phpfox::getService('core')->getForBrowse($aUser)) . ') AND pa.user_id = ' . (int) $aUser['user_id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->request()->get('view') == 'myalbums')\n\t\t\t{\n\t\t\t\tPhpfox::isUser(true);\n\n\t\t\t\t$oLibSearch->setCondition('AND pa.user_id = ' . Phpfox::getUserId());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$oLibSearch->setCondition('AND pa.view_id = 0 AND pa.privacy IN(%PRIVACY%) AND pa.total_photo > 0');\n\t\t\t}\n\t\t}\n\t\t$aParentModule = $this->_aParams;\n \tif ($aParentModule !== null && !empty($aParentModule['item_id']))\n\t\t{\n\t\t\t$this->search()->setCondition('AND pa.module_id = \\'' . $aParentModule['module_id']. '\\' AND pa.group_id = ' . (int) $aParentModule['item_id']);\n\t\t}\n\t\t\n $oLibSearch->browse()->params($aBrowseParams)->execute();\n\t\t\n\t\t$aAlbums = $oLibSearch->browse()->getRows();\n\t\t$iCnt = $oLibSearch->browse()->getCount();\t\n\n\t\tforeach ($aAlbums as $iKey => $aAlbum) {\n\t\t\t$aAlbums[$iKey] = $this->processAlbum($aAlbum);\n\t\t}\n\n\t\tPhpfox::getLib('pager')->set(array('page' => $iPage, 'size' => $oLibSearch->getDisplay(), 'count' => $oLibSearch->browse()->getCount()));\n\t\t\n return array($iCnt, $aAlbums);\n }", "public function getAlbumsForArtist($artist_id,$artist_role){\r\n\t\tif($artist_id){\r\n\t\t\t$container = new container_db_dto();\r\n\t\t\t\r\n\t\t\t$limit = (int)$this->messenger[\"query\"][\"limit\"];\r\n\t\t\t$start = (int)$this->messenger[\"query\"][\"start\"];\r\n\t\t\t$orderBy = \"\";\r\n\t\t\tif(\t$this->messenger['query']['sf'] != '' ){\r\n\t\t\t\t$orderBy = \" ORDER BY am.\".$this->messenger['query']['sf'].\" \".$this->messenger['query']['so'];\r\n\t\t\t}\r\n\t\t\t$where = ' where am.status = 1 and aa.artist_id = '.$artist_id;\r\n\t\t\tif($artist_role!=null && key_exists($artist_role,$this->aConfig['artist_type'])){\r\n\t\t\t\t$artist_role_id = $this->aConfig['artist_type'][$artist_role];\r\n\t\t\t\tif($artist_role_id)\r\n\t\t\t\t\t$where = $where.\" and aa.artist_role & \".$artist_role_id.\"=\".$artist_role_id;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$this->apply_where_criteria($where);\r\n\t\t\t$this->sSql = \"select count(aa.album_id) as cnt\r\n\t\t\t\t\t\tfrom artist_album aa left join album_mstr am on am.album_id=aa.album_id\r\n\t\t\t\t\t\tleft join language_mstr lm on lm.language_id=am.language_id \r\n\t\t\t\t\t\tLEFT JOIN label_mstr lb ON lb.label_id=am.label_id \r\n\t\t\t\t\t\t\".$where;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$res = $this->oMysqli->query($this->sSql);\r\n\t\t\tif($res!=-1 and sizeof($res)>0){\r\n\t\t\t\t$container->settotal_count($res[0]->cnt);\r\n\t\t\t\t$this->sSql = \"SELECT am.broadcast_year,am.content_type,am.film_rating,am.grade,lm.language_id,\r\n\t\t\t\t\t\tam.music_release_date,am.album_id,am.album_name,lm.language_name,am.music_release_date,am.title_release_date,am.album_image,\r\n\t\t\t\t\tam.album_type,lb.label_name @@@album_desc@@@ @@@album_excerpt@@@\r\n\t\t\t\t\tfrom artist_album aa left join album_mstr am on am.album_id=aa.album_id\r\n\t\t\t\t\t\tleft join language_mstr lm on lm.language_id=am.language_id \r\n\t\t\t\t\t\tLEFT JOIN label_mstr lb ON lb.label_id=am.label_id \r\n\t\t\t\t\t\t\".$where.\" \".$orderBy .\" LIMIT $start, $limit\";\r\n\t\t\t\t$this->apply_includes();\r\n\t\t\t\t$res = $this->oMysqli->query($this->sSql);\r\n\t\t\t\t$data = array();\r\n\t\t\t\t$album_ids_arr = array();\r\n\t\t\t\tif(sizeof($res)>0 && $res!=-1){\r\n\t\t\t\t\tforeach ($res as $resValue){\r\n\t\t\t\t\t\t$album = new album_db_dto();\r\n\t\t\t\t\t\t$album->setalbum_id($resValue->album_id);\r\n\t\t\t\t\t\t$album_ids_arr[] = $resValue->album_id;\r\n\t\t\t\t\t\t$album->setalbum_name($resValue->album_name);\r\n\t\t\t\t\t\t$album->setalbum_language($resValue->language_name);\r\n\t\t\t\t\t\t$album->setalbum_language_id($resValue->language_id);\r\n\t\t\t\t\t\t$album->setalbum_music_rel_dt($resValue->music_release_date);\r\n\t\t\t\t\t\t$album->setalbum_label($resValue->label_name);\r\n\t\t\t\t\t\t$album->setalbum_type($this->oCommon->getalbumtype($resValue->album_type));\r\n\t\t\t\t\t\t$album->setalbum_title_rel_dt($resValue->title_release_date);\r\n\t\t\t\t\t\t$album->setalbum_df_image($resValue->album_image);\r\n\t\t\t\t\t\t$album->setalbum_broadcast_year($resValue->broadcast_year);\r\n\t\t\t\t\t\t$album->setalbum_content_type($this->oCommon->getalbumcontenttype($resValue->content_type));\r\n\t\t\t\t\t\t$album->setalbum_film_rating($resValue->film_rating);\r\n\t\t\t\t\t\t$album->setalbum_grade($resValue->grade);\r\n\t\t\t\t\t\tif(in_array(\"album_description\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t\t$album->setalbum_description($resValue->album_desc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(in_array(\"album_excerpt\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t\t$album->setalbum_excerpt($resValue->album_excerpt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$data[]=$album;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$artist_album_map=array();\r\n\t\t\t\t\t$artist_album_map = $this->oCommon->getArtistForAlbum($album_ids_arr);\r\n\t\t\t\t\t$album_tag_map = array();\r\n\t\t\t\t\tif(in_array(\"album_tags\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t$album_tag_map = $this->oCommon->getAlbumTags($album_ids_arr);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\tforeach($data as $album){\r\n\t\t\t\t\t\t$id = $album->getalbum_id();\r\n\t\t\t\t\t\tif(key_exists($id,$artist_album_map))\r\n\t\t\t\t\t\t\t$album->setalbum_artist($artist_album_map[$id]);\r\n\t\t\t\t\t\tif(key_exists($id,$album_tag_map))\r\n\t\t\t\t\t\t\t$album->setalbum_tags($album_tag_map[$id]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$container->setdata($data);\r\n\t\t\t\t\r\n\t\t\t\treturn $container->to_array();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public function getAlbums($feuser_uid) {\r\n\t\t$res = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_albums WHERE cruser_id = \"'.intval($feuser_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1;');\r\n\t\treturn $res;\r\n\t}", "function getAllTagsFromAlbum($albumname,$subalbums=false,$mode='images') {\n\tglobal $_zp_gallery;\n\t$passwordcheck = '';\n\t$imageWhere = '';\n\t$tagWhere = \"\";\n\t$albumname = sanitize($albumname);\n\tif(empty($albumname)) {\n\t\treturn FALSE;\n\t}\n\t$albumobj = new Album($_zp_gallery,$albumname);\n\tif(!$albumobj->exists) {\n\t\treturn FALSE;\n\t}\n\tif (zp_loggedin()) {\n\t\t$albumWhere = \"WHERE `dynamic`=0\";\n\t} else {\n\t\t$albumscheck = query_full_array(\"SELECT * FROM \" . prefix('albums'). \" ORDER BY title\");\n\t\tforeach($albumscheck as $albumcheck) {\n\t\t\tif(!checkAlbumPassword($albumcheck['folder'])) {\n\t\t\t\t$albumpasswordcheck= \" AND id != \".$albumcheck['id'];\n\t\t\t\t$passwordcheck = $passwordcheck.$albumpasswordcheck;\n\t\t\t}\n\t\t}\n\t\t$albumWhere = \"WHERE `dynamic`=0 AND `show`=1\".$passwordcheck;\n\t}\n\tif($subalbums) {\n\t\t$albumWhere .= \" AND `folder` LIKE \".db_quote($albumname.\"%\");\n\t} else {\n\t\t$albumWhere .= \" AND `folder` = \".db_quote($albumname);\n\t}\n\t$albumids = query_full_array(\"SELECT id, folder FROM \" . prefix('albums'). $albumWhere);\n\tswitch($mode) {\n\t\tcase \"images\":\n\t\t\tif(count($albumids) == 0) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$imageWhere = \" WHERE \";\n\t\t\t\t$count = \"\";\n\t\t\t\tforeach($albumids as $albumid) {\n\t\t\t\t\t$count++;\n\t\t\t\t\t$imageWhere .= 'albumid='. $albumid['id'];\n\t\t\t\t\tif($count != count($albumids)) $imageWhere .= \" OR \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$imageids = query_full_array(\"SELECT id, albumid FROM \" . prefix('images').$imageWhere);\n\t\t\t// if the album has no direct images and $subalbums is set to false\n\t\t\tif(count($imageids) == 0) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$count = \"\";\n\t\t\t\t$tagWhere = \" WHERE \";\n\t\t\t\tforeach($imageids as $imageid) {\n\t\t\t\t\t$count++;\n\t\t\t\t\t$tagWhere .= '(o.objectid ='. $imageid['id'].\" AND o.tagid = t.id AND o.type = 'images')\";\n\t\t\t\t\tif($count != count($imageids)) $tagWhere .= \" OR \";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(empty($tagWhere)) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$tags = query_full_array(\"SELECT DISTINCT t.name, t.id, (SELECT DISTINCT COUNT(*) FROM \". prefix('obj_to_tag'). \" WHERE tagid = t.id AND type = 'images') AS count FROM \". prefix('obj_to_tag'). \" AS o,\". prefix('tags'). \" AS t\".$tagWhere.\" ORDER BY t.name\");\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"albums\":\n\t\t\t$count = \"\";\n\t\t\tif(count($albumids) == 0) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$tagWhere = \" WHERE \";\n\t\t\t\tforeach($albumids as $albumid) {\n\t\t\t\t\t$count++;\n\t\t\t\t\t$tagWhere .= '(o.objectid ='. $albumid['id'].\" AND o.tagid = t.id AND o.type = 'albums')\";\n\t\t\t\t\tif($count != count($albumids)) $tagWhere .= \" OR \";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(empty($tagWhere)) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$tags = query_full_array(\"SELECT DISTINCT t.name, t.id, (SELECT DISTINCT COUNT(*) FROM \". prefix('obj_to_tag'). \" WHERE tagid = t.id AND o.type = 'albums') AS count FROM \". prefix('obj_to_tag'). \" AS o,\". prefix('tags'). \" AS t\".$tagWhere.\" ORDER BY t.name\");\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn $tags;\n}", "function albums_get_albums($only_return_title = FALSE) {\n\t$files = read_dir_contents(ALBUMS_DIR, 'files');\n\n\tif ($files) {\n\t\tnatcasesort($files);\n\t\tforeach ($files as $album) {\n\t\t\tinclude(ALBUMS_DIR.'/'.$album);\n\t\t\tif ($only_return_title == TRUE)\n\t\t\t\t$albums[] = $album_name;\n\t\t\telse {\n\t\t\t\t$albums[] = array(\n\t\t\t\t\t'title' => $album_name,\n\t\t\t\t\t'seoname' => str_replace('.php', '', $album)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tunset($album);\n\n\t\treturn $albums;\n\t}\n\n\telse\n\t\treturn false;\n}", "public function getAllThePhotosAccordingTolAlbum($offset,$photo_per_page,$albumId){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myQuery=\"SELECT photo FROM photo WHERE album_id='\".$albumId.\"' LIMIT $offset,$photo_per_page\";\n\t\t\t $result=$conn->query($myQuery);\n\t\t\t foreach($result as $image){\n\t\t\t\t array_push($this->photos,$image['photo']);\n\t\t\t }\n\t\t\t $conn=null;\n\t\t\t return $this->photos;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "function getUserPhotoAlbums($user_id=null,$profile_picture_album=false){\r\n\t\tif($user_id==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('user_id'=>$user_id));\r\n\t\tif($profile_picture_album==true)\r\n\t\t{\r\n\t\t\t$this->db->where(array('title'=>PROFILE_PICTURES));\t\t\r\n\t\t}\r\n\t\t$recordSet = $this->db->get(TBL_PHOTO_ALBUMS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "function get_albums($mysqli, $albumIDs)\n{\n\t$keys = array(\n\t\t\"al.albumID\",\n\t\t\"al.album_code\",\n\t\t\"al.album_name\",\n\t\t\"ar.artist_name\",\n\t\t\"g.genre AS general_genre\",\n\t\t\"al.genre\",\n\t\t\"r.review\",\n\t\t\"u.preferred_name AS reviewer\"\n\t);\n\n\t$q = \"SELECT \" . implode(\",\", $keys) . \" FROM `libalbum` AS al \"\n\t\t. \"INNER JOIN `libartist` AS ar ON ar.artistID=al.artistID \"\n\t\t. \"INNER JOIN `def_general_genres` AS g ON g.general_genreID=al.general_genreID \"\n\t\t. \"INNER JOIN `libreview` AS r ON r.albumID=al.albumID \"\n\t\t. \"INNER JOIN `users` AS u ON u.username=r.username \"\n\t\t. \"WHERE al.albumID IN ('\" . implode(\"', '\", $albumIDs) . \"')\";\n\t$result = exec_query($mysqli, $q);\n\n\t$albums = array();\n\twhile ( ($a = $result->fetch_assoc()) ) {\n\t\t$q = \"SELECT disc_num, track_num, track_name, airabilityID FROM `libtrack` \"\n\t\t\t. \"WHERE albumID = '$a[albumID]';\";\n\t\t$result_tracks = exec_query($mysqli, $q);\n\n\t\t$a[\"tracks\"] = array();\n\t\twhile ( ($t = $result_tracks->fetch_assoc()) ) {\n\t\t\t$a[\"tracks\"][] = $t;\n\t\t}\n\n\t\t$albums[] = $a;\n\t}\n\n\treturn $albums;\n}", "function albumsList($albums=array(), $startnum=-1, $modvars=array(), $albumsCount=null)\n\t{\n\t\t// Create output object\n\t\t$pnRender = pnRender :: getInstance('crpCasa');\n\n\t\t$pnRender->assign('startnum',$startnum);\n\t\t$pnRender->assign($modvars);\n\t\t$pnRender->assign('albums',$albums);\n\t\t// Assign the information required to create the pager\n\t\t$pnRender->assign('pager', array (\n\t\t\t'numitems' => $albumsCount,\n\t\t\t'itemsperpage' => $modvars['albumsperpage']\n\t\t));\n\n\t\t// Return the output that has been generated by this function\n\t\treturn $pnRender->fetch('crpcasa_user_albums_list.htm');\n\t}", "function get_album() {\n $sql = \"SELECT * FROM album\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function loadAlbums()\n {\n\t\t$json = file_get_contents('https://itunes.apple.com/us/rss/topalbums/limit=100/json');\n \n $albums = json_decode($json, true);\n $category_sql = \"INSERT IGNORE INTO categories (name, category_id, link) VALUES (:name, :category_id, :link)\";\n\t\t$album_sql = \"INSERT IGNORE INTO albums (album_id, name, artist, artist_link, category_id, release_date, rank) VALUES (:album_id, :name, :artist, :artist_link, :category_id, :release_date, :rank)\";\n\t\t$images_sql = \"INSERT IGNORE INTO album_art (album_id, album_image, image_size) VALUES (:album_id, :album_image, :image_size)\";\n\n\t\t//Lets delete whatever is in these tables before adding to them.\n\t\t$this->purgeTables();\n \n foreach($albums['feed']['entry'] as $rank=>$album) {\n\t\t\t\n\t\t\t//Insterts categories\n\t\t\t$stmt= $this->db->prepare($category_sql);\n\t\t\t\n\t\t\t$data = [\n\t\t\t\t'name' => $album['category']['attributes']['label'],\n\t\t\t\t'category_id' => $album['category']['attributes']['im:id'],\n\t\t\t\t'link' => $album['category']['attributes']['scheme'],\n\t\t\t];\n\t\t\t\n\t\t\t$stmt->execute($data);\n\t\t\t\n\t\t\t//Insterts album info\n\t\t\t$stmt= $this->db->prepare($album_sql);\n\t\t\t\n\t\t\t$data = [\n\t\t\t\t'album_id' => $album['id']['attributes']['im:id'],\n\t\t\t\t'name' => $album['title']['label'],\n\t\t\t\t'artist' => $album['im:artist']['label'],\n\t\t\t\t'artist_link' => (isset($album['im:artist']['attributes'])) ? $album['im:artist']['attributes']['href'] : '',\n\t\t\t\t'category_id' => $album['category']['attributes']['im:id'],\n\t\t\t\t'release_date' => $album['im:releaseDate']['label'],\n\t\t\t\t'rank' => $rank,\n\t\t\t];\n\n\t\t\t$stmt->execute($data);\n\t\t\t\n\t\t\t//inserts album images\n\t\t\t$stmt= $this->db->prepare($images_sql);\n\t\t\t\n\t\t\tforeach($album['im:image'] as $image){\n\t\t\t\t$data = [\n\t\t\t\t\t'album_id' => $album['id']['attributes']['im:id'],\n\t\t\t\t\t'album_image' => $image['label'],\n\t\t\t\t\t'image_size' => $image['attributes']['height'],\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\t$stmt->execute($data);\n\t\t\t}\n\t\t}\n\t}", "public function filter($aData)\n {\n return $this->getAlbums($aData);\n }", "public function allAlbums()\n {\n return $this\n ->select(\"*\", \"artists.slug as slugArtist\", \"albums.slug as slugAlbum\", 'albums.created_at as created_at')\n ->join('artists', 'albums.artist', '=', 'artists.id')\n ->orderBy('albums.released', 'desc')\n ->paginate(10);\n }", "function search_album() {\r\n\tglobal $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;\r\n\r\n\t// CONSTRUCT QUERY\r\n\t$album_query = \"\r\n\t(\r\n\tSELECT\r\n '1' AS sub_type,\r\n\t se_media.media_album_id AS album_id,\r\n\t se_media.media_title AS title,\r\n\t se_media.media_desc AS description,\r\n\t se_media.media_id AS media_id,\r\n\t se_media.media_ext AS media_ext,\r\n\t se_users.user_id,\r\n\t se_users.user_username,\r\n\t se_users.user_photo,\r\n\t se_users.user_fname,\r\n\t se_users.user_lname\r\n\tFROM\r\n\t se_media,\r\n\t se_albums,\r\n\t se_users,\r\n\t se_levels\r\n\tWHERE\r\n\t se_media.media_album_id=se_albums.album_id AND\r\n\t se_albums.album_user_id=se_users.user_id AND\r\n\t se_users.user_level_id=se_levels.level_id AND\r\n\t (\r\n\t se_albums.album_search='1' OR\r\n\t se_levels.level_album_search='0'\r\n\t )\r\n\t AND\r\n\t (\r\n\t se_media.media_title LIKE '%{$search_text}%' OR\r\n\t se_media.media_desc LIKE '%{$search_text}%'\r\n\t )\r\n\tORDER BY media_id DESC\r\n\t)\r\n\tUNION ALL\r\n\t(\r\n\tSELECT\r\n\t '2' AS sub_type,\r\n\t se_albums.album_id AS album_id,\r\n\t se_albums.album_title AS title,\r\n\t se_albums.album_desc AS description,\r\n\t se_albums.album_cover AS media_id,\r\n\t se_media.media_ext AS media_ext,\r\n\t se_users.user_id,\r\n\t se_users.user_username,\r\n\t se_users.user_photo,\r\n\t se_users.user_fname,\r\n\t se_users.user_lname\r\n\tFROM\r\n\t se_albums,\r\n\t se_users,\r\n\t se_levels,\r\n\t se_media\r\n\tWHERE\r\n\t se_albums.album_user_id=se_users.user_id AND\r\n\t se_users.user_level_id=se_levels.level_id AND\r\n\t se_albums.album_cover=se_media.media_id AND \r\n\t (\r\n\t se_albums.album_search='1' OR\r\n\t se_levels.level_album_search='0'\r\n\t )\r\n\t AND\r\n\t (\r\n\t se_albums.album_title LIKE '%{$search_text}%' OR\r\n\t se_albums.album_desc LIKE '%{$search_text}%'\r\n\t )\r\n\tORDER BY album_id DESC\r\n\t)\"; \r\n\r\n\t// GET TOTAL RESULTS\r\n\t$total_albums = $database->database_num_rows($database->database_query($album_query.\" LIMIT 201\"));\r\n\r\n\t// IF NOT TOTAL ONLY\r\n\tif($t == \"album\")\r\n {\r\n\t // MAKE ALBUM PAGES\r\n\t $start = ($p - 1) * $results_per_page;\r\n\t $limit = $results_per_page+1;\r\n\r\n\t // SEARCH ALBUMS\r\n\t $albums = $database->database_query($album_query.\" ORDER BY album_id DESC LIMIT $start, $limit\");\r\n\t while($album_info = $database->database_fetch_assoc($albums)) {\r\n\r\n\t // CREATE AN OBJECT FOR USER\r\n\t $profile = new se_user();\r\n\t $profile->user_info['user_id'] = $album_info['user_id'];\r\n\t $profile->user_info['user_username'] = $album_info['user_username'];\r\n\t $profile->user_info['user_fname'] = $album_info['user_fname'];\r\n\t $profile->user_info['user_lname'] = $album_info['user_lname'];\r\n\t $profile->user_info['user_photo'] = $album_info['user_photo'];\r\n\t $profile->user_displayname();\r\n\r\n\t // RESULT IS A MEDIA\r\n\t if($album_info[sub_type] == 1) {\r\n\t $result_url = $url->url_create('album_file', $album_info['user_username'], $album_info['album_id'], $album_info['media_id']);\r\n\t $result_name = 1000119;\r\n\t $result_desc = 1000121;\r\n\r\n\t // RESULT IS AN ALBUM\r\n\t } else {\r\n\t $result_url = $url->url_create('album', $album_info['user_username'], $album_info['album_id']);\r\n\t $result_name = 1000120;\r\n\t $result_desc = 1000122;\r\n\t }\r\n\r\n\t // SET THUMBNAIL, IF AVAILABLE\r\n\t switch($album_info['media_ext']) {\r\n\t\tcase \"jpeg\": case \"jpg\": case \"gif\": case \"png\": case \"bmp\":\r\n\t\t $thumb_path = $url->url_userdir($album_info['user_id']).$album_info['media_id'].\"_thumb.jpg\";\r\n\t\t break;\r\n\t\tcase \"mp3\": case \"mp4\": case \"wav\":\r\n\t\t $thumb_path = \"./images/icons/audio_big.gif\";\r\n\t\t break;\r\n\t\tcase \"mpeg\": case \"mpg\": case \"mpa\": case \"avi\": case \"swf\": case \"mov\": case \"ram\": case \"rm\":\r\n\t\t $thumb_path = \"./images/icons/video_big.gif\";\r\n\t\t break;\r\n\t\tdefault:\r\n\t\t $thumb_path = \"./images/icons/file_big.gif\";\r\n\t }\r\n\r\n\t if(!file_exists($thumb_path)) { $thumb_path = \"./images/icons/file_big.gif\"; }\r\n\r\n\t // IF NO TITLE\r\n\t if($album_info['title'] == \"\") { SE_Language::_preload(589); SE_Language::load(); $album_info['title'] = SE_Language::_get(589); }\r\n\r\n\t // IF DESCRIPTION IS LONG\r\n\t if(strlen($album_info['description']) > 150) { $album_info['description'] = substr($album_info['description'], 0, 147).\"...\"; }\r\n\r\n\t $results[] = Array('result_url' => $result_url,\r\n\t\t\t\t'result_icon' => $thumb_path,\r\n\t\t\t\t'result_name' => $result_name,\r\n\t\t\t\t'result_name_1' => $album_info['title'],\r\n\t\t\t\t'result_desc' => $result_desc,\r\n\t\t\t\t'result_desc_1' => $url->url_create('profile', $album_info['user_username']),\r\n\t\t\t\t'result_desc_2' => $profile->user_displayname,\r\n\t\t\t\t'result_desc_3' => $album_info['description']);\r\n\t }\r\n\r\n\t // SET TOTAL RESULTS\r\n\t $total_results = $total_albums;\r\n\r\n\t}\r\n\r\n\t// SET ARRAY VALUES\r\n\tSE_Language::_preload_multi(1000118, 1000119, 1000120, 1000121, 1000122);\r\n\tif($total_albums > 200) { $total_albums = \"200+\"; }\r\n\t$search_objects[] = Array('search_type' => 'album',\r\n\t\t\t\t'search_lang' => 1000118,\r\n\t\t\t\t'search_total' => $total_albums);\r\n\r\n}", "function getFacebookAlbums_neases($value = '', $limit = '500', $after = '') {\n $facebook = $this->facebook;\n $access_token = $facebook->getAccessToken();\n\n $params = array('access_token' => $access_token);\n\n if ($this->nowUserId == 0)\n {\n return\n array(\"data\" => array(\n array(\n 'id' => '1',\n 'name' => 'test album'\n )\n )\n );\n }\n\n $albums = $facebook->api('' . $this->nowUserId . '/albums?limit=100');\n\n $pics = array();\n foreach($albums['data'] as $album):\n $pic = $facebook->api('' . $album['id'] . '/picture?redirect=false');\n $pics[] = $pic['data']['url'];\n endforeach;\n\n $albums['cover'] = $pics;\n return $albums;\n }", "public function getAlbumPhotos($albumId){\n return DB::select('select * from photos where album_id = ?', array($albumId));\n }", "public function getAlbumsForRole($feuser_uid) {\r\n\t\t$loggedIn = tx_cwtcommunity_lib_common::getLoggedInUserUID();\r\n\t\t// Check if we have an owner or not\r\n\t\tif ($feuser_uid == $loggedIn) {\r\n\t\t\t// OWNER\r\n\t\t\treturn tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_albums WHERE cruser_id = \"'.intval($feuser_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1;');\r\n\t\t} else {\r\n\t\t\tif (tx_cwtcommunity_lib_common::isBuddy($feuser_uid, $loggedIn)){\r\n\t\t\t\t// FRIEND\r\n\t\t\t\treturn tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_albums WHERE cruser_id = \"'.intval($feuser_uid).'\" AND access_policy IN (1,2) AND NOT deleted = \"1\" AND NOT hidden = 1;');\t\r\n\t\t\t} else {\r\n\t\t\t\t// NORMAL USER\r\n\t\t\t\treturn tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_albums WHERE cruser_id = \"'.intval($feuser_uid).'\" AND access_policy IN (2) AND NOT deleted = \"1\" AND NOT hidden = 1;');\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $res;\r\n\t}", "public function getUserAlbums($user_id, $start, $page_size) {\n $query_params = array(\n 'columns' => 'id, name, description',\n 'where' => 'user_id = ?',\n 'orderby' => 'create_date DESC',\n 'limit' => '?, ?'\n );\n \n $bind_params = array($user_id, $start, $page_size);\n $albums = $this->find($query_params, $bind_params);\n \n return $albums;\n }", "public function search($aData)\n {\n return $this->getAlbums($aData);\n }", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "function getUserAlbumPhotos($album_id=null,$profile_picture=false){\r\n\t\tif($album_id==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('photo_albums_id'=>$album_id));\r\n\t\tif($profile_picture==true)\r\n\t\t{\r\n\t\t\t$this->db->where(array('is_profile_picture'=>true));\t\t\r\n\t\t}\t\t\r\n\t\t$recordSet = $this->db->get(TBL_ALBUM_HAS_PHOTOS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "public function getAlbum(): Album;", "public function getAlbums($album = NULL)\n {\n if(is_null($album))\n {\n //Si cargue todos los albums\n if(is_null($this->album_loaded))\n {\n return $this->albums;\n }\n //Si cargue un album en particular\n else\n {\n return $this->albums[$this->hashMap[$this->album_loaded]];\n }\n }\n else\n {\n if(array_key_exists($album, $this->hashMap))\n {\n return $this->albums[$this->hashMap[$album]];\n }\n else\n {\n throw new Exception('The album ' . $album . ' is not loaded', 102);\n }\n }\n }", "public function albums()\n {\n return $this\n ->hasMany('App\\Album', 'artist')\n ->selectRaw('*, albums.title as album_title, albums.slug as album_slug, count(songs.id) as song_total')\n ->leftJoin('songs', 'albums.id', '=', 'songs.album')\n ->orderBy('released', 'asc')\n ->groupBy('albums.id');\n }", "public function albumsFromList(Request $request)\n { \n $collection = collect([]);\n foreach(array_unique($request->artists) as $artist){\n\n $albums = Artist::find($artist)->albums;\n\n foreach($albums as $album){\n $condition = TRUE;\n foreach(array_unique($request->artists) as $artistAux){\n if(!($album->artists->contains('id', $artistAux))){\n $condition = false; \n }\n }\n if($condition){\n $collection->push($album);\n }\n }\n }\n return $collection->unique('id');\n }", "public function getAlbumsAction()\n {\n $em = $this->getDoctrine()->getManager();\n $albums = $em->getRepository(Album::class)->findAll();\n\n return $this->handleView($this->view($albums));\n }", "public function getListItems()\n {\n return $this->getAlbums();\n }", "public function getAllUserAlbums($userId){\n $albums = DB::select('\n select albums.*\n from albums\n where albums.user_id = ?\n order by album_created_at', array($userId));\n return $albums;\n }", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "function prepare_albums(?Collection $albums)\n\t{\n\n\t\t$return = array();\n\n\t\tif ($albums != null) {\n\t\t\t// For each album\n\t\t\tforeach ($albums as $album_model) {\n\n\t\t\t\t// Turn data from the database into a front-end friendly format\n\t\t\t\t$album = $album_model->prepareData();\n\t\t\t\t$album['albums'] = $album_model->get_albums();\n\n\t\t\t\t// Thumbs\n\t\t\t\tif ((!Session::get('login') && $album_model->password === null) ||\n\t\t\t\t\t(Session::get('login'))) {\n\n\t\t\t\t\t$album['sysstamp'] = $album_model['created_at'];\n\t\t\t\t\t$album = $album_model->gen_thumbs($album);\n\t\t\t\t}\n\n\t\t\t\t// Add to return\n\t\t\t\t$return[] = $album;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "function getAlbumImages($args)\n{\n global $_zp_current_image;\n if (is_object($login_state = authorize($args))) {\n return $login_state;\n }\n $args = decode64($args);\n logger('getAlbumImages', ($args['loglevel']));\n $albumobject = getItemByID('albums', $args['id']);\n $images = $albumobject->getImages();\n if (!($albumobject || !$args['id'])) {\n return new ZEN_Error(-1, 'No folder with database ID '.$args['id'].' found!');\n }\n makeAlbumCurrent($albumobject);\n $list = [];\n while (next_image(true)) {\n $meta = $_zp_current_image->getmetadata();\n if ($meta['EXIFDateTimeOriginal']) {\n $imagedate = $meta['EXIFDateTimeOriginal'];\n } else {\n $imagedate = false;\n }\n $list[] = entitysave([\n 'id' => $_zp_current_image->getID(),\n 'albumid' => $_zp_current_image->getAlbum()->getID(),\n 'name' => $_zp_current_image->filename,\n 'shortdate' => date('Y-m-d', (strtotime(str_replace(' ', '', (str_replace(':', '', $imagedate)))))),\n 'longdate' => $imagedate,\n 'url' => WEBPATH.'index.php?album='.urlencode($_zp_current_image->album->name).'&image='.urlencode($_zp_current_image->filename),\n 'folder' => $_zp_current_image->getAlbum()->getFolder(),\n // added by monta\n 'thumbnail' => $_zp_current_image->getThumbImageFile(),\n 'description' => $_zp_current_image->getDesc(),\n 'commentcount' => count($_zp_current_image->getComments()),\n ]);\n } //next_image( true )\n //writelog((var_export($list, true)));\n return $list;\n}", "public function getPhotos($album_id)\n {\n $client = new Client();\n\n // get JSON from the webservice and convert it into an assoc. array\n return json_decode($client->get(\"http://jsonplaceholder.typicode.com/album/${album_id}/photos\")->getBody(), true);\n\n }", "public function getArtistWithAlbum()\n {\n return $this\n ->selectRaw('artists.id, artists.name, avatar, artists.slug, title, cover, count(*) as album_total')\n ->leftJoin('albums', 'artists.id', '=', 'albums.artist')\n ->groupBy('artists.id')\n ->orderBy('artists.name', 'asc')\n ->paginate(15);\n }", "function albums_get_images($album) {\n\t$files = read_dir_contents(ALBUMS_DIR.'/'.$album, 'files');\n\tif (!$files)\n\t\treturn FALSE;\n\n\telseif ($files) {\n\t\tnatcasesort($files);\n\t\tforeach ($files as $file) {\n\t\t\t$parts = explode('.', $file);\n\t\t\tif (count($parts) == 4) {\n\t\t\t\tlist($number, $fdirname, $ext, $php) = $parts;\n\t\t\t\tinclude_once (ALBUMS_DIR.'/'.$album.'/'.$file);\n\t\t\t\t$images[] = array(\n\t\t\t\t\t'title' => $name,\n\t\t\t\t\t'info' => $info,\n\t\t\t\t\t'seoname' => $fdirname,\n\t\t\t\t\t'filename' => $file,\n\t\t\t\t\t'filename_image' => $fdirname.'.'.$ext\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tunset($file);\n\n\t\treturn $images;\n\t}\n}", "public function mediaByAlbum($album, $options = []){\n $order = isset($options['order']) && $options['order'] ? $options['order'] : null;\n $limit = isset($options['limit']) && $options['limit'] ? $options['limit'] : null;\n $offset = isset($options['offset']) && $options['offset'] ? $options['offset'] : null;\n \n $album = \\FlexCMS\\BasicCMS\\Models\\Item::where('item_type', '=', 'album')->where('name', '=', $album)->first();\n if ($album){\n $media = \\FlexCMS\\BasicCMS\\Models\\Media::with('album')->where('album_id', '=', $album->id);\n if ($order){\n $media = $media->orderByRaw($order);\n }\n if ($limit){\n $media = $media->take($limit);\n }\n if ($offset){\n $media = $media->offset($offset);\n }\n $media = $media->get();\n return $media->toArray();\n }\n else{\n return [];\n }\n }", "private function filterAlbumsOnly($records)\n {\n $type = 'album';\n $items = array_filter($records, function ($var) use ($type) {\n return ($var['album_type'] == $type);\n });\n\n return $items;\n }", "public function getAlbum($album_name) {\n $query = \"SELECT\n al.id,\n al.name,\n al.year,\n al.version,\n al.location,\n al.sport,\n al.event_type,\n al.manufacturer,\n al.url\n FROM \" . $this->__schema . \".album al\n WHERE al.name = \" . $this->db()->quote($album_name);\n $data = $this->db()->getRow($query);\n if ($data) {\n return [\n 'success' => TRUE,\n 'payload' => $data,\n ];\n }\n else {\n return [\n 'success' => FALSE,\n 'payload' => NULL,\n ];\n }\n }", "public final function findAll(){\n\n //Récupère la méthode de connection à la Base de donnée\n $dbc = Application::getInstance()->getDBConnection();\n\n //Variable où la requête est enregistrée\n $query = \"select * from Album\";\n\n //Requête en dur, prends la bdd et y exécute la requête\n $stmt = $dbc->query($query);\n\n /*Récupère tout les tuples de Album, et les transpose dans des instances de classe Album\n Et fini par enregistrer le résultat dans $results, FALSE est retourné s'ya erreur */\n $results = $stmt->fetchALL(PDO::FETCH_CLASS, 'Album');\n\n //Retourne le résultat de $results\n return $results;\n }", "public function gather_folder($limit = 5) {\n\n\t\t$media = new Album($this->uid);\n\t\t$songs = $media->get_songs();\n\t\t$results = array();\n\t\t$preferred = false;\n\t\t// For storing which directories we've already done\n\t\t$processed = array();\n\n\t\t/* See if we are looking for a specific filename */\n\t\t$preferred_filename = Config::get('album_art_preferred_filename');\n\n\t\t// Array of valid extensions\n\t\t$image_extensions = array(\n\t\t\t'bmp',\n\t\t\t'gif',\n\t\t\t'jp2',\n\t\t\t'jpeg',\n\t\t\t'jpg',\n\t\t\t'png'\n\t\t);\n\n\t\tforeach ($songs as $song_id) {\n\t\t\t$data = array();\n\t\t\t$song = new Song($song_id);\n\t\t\t$dir = dirname($song->file);\n\n\t\t\tif (isset($processed[$dir])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdebug_event('folder_art', \"Opening $dir and checking for Album Art\", 3);\n\n\t\t\t/* Open up the directory */\n\t\t\t$handle = opendir($dir);\n\n\t\t\tif (!$handle) {\n\t\t\t\tError::add('general', T_('Error: Unable to open') . ' ' . $dir);\n\t\t\t\tdebug_event('folder_art', \"Error: Unable to open $dir for album art read\", 2);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$processed[$dir] = true;\n\n\t\t\t// Recurse through this dir and create the files array\n\t\t\twhile ($file = readdir($handle)) {\n\t\t\t\t$extension = pathinfo($file);\n\t\t\t\t$extension = $extension['extension'];\n\n\t\t\t\t// Make sure it looks like an image file\n\t\t\t\tif (!in_array($extension, $image_extensions)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$full_filename = $dir . '/' . $file;\n\n\t\t\t\t// Make sure it's got something in it\n\t\t\t\tif (!filesize($full_filename)) {\n\t\t\t\t\tdebug_event('folder_art', \"Empty file, rejecting $file\", 5);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Regularise for mime type\n\t\t\t\tif ($extension == 'jpg') {\n\t\t\t\t\t$extension = 'jpeg';\n\t\t\t\t}\n\n\t\t\t\t// Take an md5sum so we don't show duplicate\n\t\t\t\t// files.\n\t\t\t\t$index = md5($full_filename);\n\n\t\t\t\tif ($file == $preferred_filename) {\n\t\t\t\t\t// We found the preferred filename and\n\t\t\t\t\t// so we're done.\n\t\t\t\t\tdebug_event('folder_art', \"Found preferred image file: $file\", 5);\n\t\t\t\t\t$preferred[$index] = array(\n\t\t\t\t\t\t'file' => $full_filename,\n\t\t\t\t\t\t'mime' => 'image/' . $extension\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdebug_event('folder_art', \"Found image file: $file\", 5);\n\t\t\t\t$results[$index] = array(\n\t\t\t\t\t'file' => $full_filename,\n\t\t\t\t\t'mime' => 'image/' . $extension\n\t\t\t\t);\n\n\t\t\t} // end while reading dir\n\t\t\tclosedir($handle);\n\n\t\t} // end foreach songs\n\n\t\tif (is_array($preferred)) {\n\t\t\t// We found our favourite filename somewhere, so we need\n\t\t\t// to dump the other, less sexy ones.\n\t\t\t$results = $preferred;\n\t\t}\n\n\t\tdebug_event('folder_art', 'Results: ' . json_encode($results), 5);\n\t\tif ($limit && count($results) > $limit) {\n\t\t\t$results = array_slice($results, 0, $limit);\n\t\t}\n\n\t\treturn array_values($results);\n\n\t}", "public function get_album_list( $max_album_results, $album_thumb_size ) {\t\t\t\t\n\t\n\t\t\ttry\t{\n\t\t\t\t// Create an instance of the service\n\t\t\t\t$this->service = new Zend_Gdata_Photos();\n\t\t\t\n\t\t\t} catch( Zend_Gdata_App_Exception $ex ) {\n\t\t\t\t\n\t\t\t\t$this->errors[] = $ex->getMessage();\n\t\t\t\t$this->get_errors( $this->errors );\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\ttry {\n\t\t\t\n\t\t\t\t$query = new Zend_Gdata_Photos_UserQuery();\n\t\t\t\n\t\t\t} catch( Zend_Gdata_App_Exception $ex ) {\n\t\t\t\t\n\t\t\t\t$this->errors[] = $ex->getMessage();\n\t\t\t\t$this->get_errors( $this->errors );\n\t\t\t}\n\t\t\t\n\t\t\t// Construct the query\t\n\t\t\t$query->setUser( $this->user );\n\t\t $query->setThumbSize( $album_thumb_size . 'c' );\n\t\t $query->setMaxResults( $max_album_results );\n\t\t \t\t\n\t\t\ttry\t{\n\t\t\t\t$userFeed = $this->service->getUserFeed( null, $query );\n\t\t\t} catch( Zend_Gdata_App_Exception $ex ) {\n\t\t\t\t\n\t\t\t\t$this->errors[] = $ex->getMessage();\n\t\t\t\t$this->get_errors( $this->errors );\n\t\t\t}\n\t\t\t\n\t\t\tif( count( $this->errors ) > 0 ) {\n\t\t\t\t// Display any errors in error log.\n\t\t\t\t$this->get_errors( $this->errors );\n\t\t\t\treturn false;\t\t\t\n\t\t\t} else { \n\t\t\t\treturn $userFeed;\t\n\t\t\t}\n\t\t\n\t\t}", "public function get_albums($page_id=null, $cover_photo=true) {\n\t\t$albums = $this->get($page_id, 'fields=albums');\n\t\tif (empty($albums['albums']['data']) || !$cover_photo) {\n\t\t\treturn $albums['albums']['data'];\n\t\t}\n\n\t\t$data = array();\n\t\tforeach ($albums['albums']['data'] as $item) {\n\t\t\tif (empty($item['cover_photo'])) continue;\n\t\t\t$item['cover_photo_data'] = $this->get($item['cover_photo']);\n\t\t\t$data[] = $item;\n\t\t}\n\t\treturn $data;\n\t}", "public function index(Albums $album)\n {\n return SongsResource::collection($album->songs);\n }", "function listAlbums($parameter)\n\t\t{\n\t\t\t//$parameter = substr($parameter, 0,strpos($parameter, 'count'));\n\t\t\t//$parameter = substr($parameter, strrpos($parameter, 'genres 0 '));\n\t\t\t$tabParameter = split(\" id:\", $parameter);\n\t\t\t//print_r($tabParameter);\n\t\t\t$i = 2;\n\t\t\t$len = count($tabParameter);\n\t\t\t//print_r($tabParameter);\n\n\t\t\tforeach ($tabParameter as $key => $value) \n\t\t\t{\n\t\t\t\tif ($key > 0 && $i < $len ) \n\t\t\t\t{\n\t\t\t\t\t//$id = get_string_between($value,\"id:\",\" artwork_track_id\");\n\t\t\t\t\t$id = substr($value, 0,strpos($value, \" \"));\n\t\t\t\t\t$artwork = get_string_between($value,\"artwork_track_id:\",\" title:\");\n\t\t\t\t\t$title = substr($value,strpos($value, \"title:\"));\n\t\t\t\t\t//echo \"contenu de title: $title\";\n\t\t\t\t\t//$title = substr_replace($title, '', strpos($title, ' count:'));\n\t\t\t\t\t//echo \"titre après replace: $title\";\n\t\t\t\t\t//$title = substr_replace($value, '', strpos($value, \"count\"));\n\t\t\t\t\t\n\n\n\t\t\t\t//list($id,$genre)=explode(\" genre:\", $tabParameter[$key]);\n\t\t\t\t\techo \"<li id=\\\"$title$id\\\">$title</li>\";\n\t\t\t\t\techo \"<img id=\\\"$artwork\\\" src=\\\"http://\".$_SESSION['LMS']['server'].\":9000/music/$artwork/cover_96x96_p.png\\\"/>\";\n\t\t\t\t\t$i++;\n\t\t\t\t\t//echo \"i et len : $i $len\";\n\t\t\t\t}\n\n\t\t\t\telseif ($i == $len)\n\t\t\t\t {\n\t\t\t\t\t//$id = get_string_between($value,\"id:\",\" artwork_track_id\");\n\t\t\t\t\t$id = substr($value, 0,strpos($value, \" \"));\n\t\t\t\t\t$artwork = get_string_between($value,\"artwork_track_id:\",\" title:\");\n\t\t\t\t\t$title = substr($value,strpos($value, \"title:\"));\n\t\t\t\t\t\n\t\t\t\t\t//echo \"contenu de title: $title\";\n\n\n\t\t\t\t//list($id,$genre)=explode(\" genre:\", $tabParameter[$key]);\n\t\t\t\t\techo \"<li class=\\\"album\\\" id=\\\"$title|$id\\\">$title</li>\";\n\t\t\t\t\techo \"<img class=\\\"album\\\" id=\\\"$artwork\\\" src=\\\"http://\".$_SESSION['LMS']['server'].\":9000/music/$artwork/cover_96x96_p.png\\\"/>\";\n\t\t\t\t\t$i++;\n\t\t\t\t }\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "private function getAlbums($albums)\n {\n $formatted = [];\n\n if (empty($albums)) return $formatted;\n\n foreach($albums as $album) {\n $artist = [\n 'name' => $album['artists'][0]['name'],\n 'spotify_id' => $album['artists'][0]['id'],\n 'fully_scraped' => 0\n ];\n\n $formatted[] = [\n 'name' => $album['name'],\n 'popularity' => null,\n 'artist' => $artist,\n 'image' => isset($album['images'][1]['url']) ? $album['images'][1]['url'] : null,\n 'fully_scraped' => 0\n ];\n }\n\n return $formatted;\n }", "public function get_album_display( $max_album_results, $album_thumb_size, $resultsPage, $show_albums = null) {\t\t\t\n\n\t\t\tif( !is_numeric( $max_album_results ) ) { $max_album_results = $this->max_album_results; }\n\t\t\tif( !is_numeric( $album_thumb_size ) ) { $album_thumb_size = $this->album_thumb_size; }\n\n\t\t\t// Check we are authenticated \n\t\t\tif( $this->check_auth( $this->client ) ) {\n\t\t\t\n\t\t\t\tif( $resultsPage != '' ? $resultsPage = '/' . $resultsPage : $resultsPage );\n\t\t\t\t\n\t\t\t\t$get_album_list \t= $this->get_album_list( $max_album_results, $album_thumb_size );\n\t\t\t\t\n\t\t\t\tif( $get_album_list ) {\n\t\t\t\t\ttry\t{\n\t\t\t\t\t\t$numResults = $get_album_list->getTotalResults()->text;\n\t\t\t\t\t}\n\t\t\t\t\tcatch( Zend_Gdata_App_Exception $ex ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->errors[] = $ex->getMessage();\n\t\t\t\t\t\t$this->get_errors( $this->errors );\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t//$get_album_list->getTitle();\n\t\t\t\t\n\t\t\t\t\t$html[] = '<div id=\"nak-gpv\" class=\"grid-container\">';\n\t\t\t\t\t$html[] = '<div class=\"grid grid_gallery\" >';\n\t\t\t\t\n\t\t\t\t\t$bloginfo = get_bloginfo('url' ) ;\n\t\t\t\t\t$resultsPage = $bloginfo . $resultsPage;\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tforeach( $get_album_list as $album ) {\n\t\t\t\t\t\n\t\t\t\t\t\tif ( $album instanceof Zend_Gdata_Photos_AlbumEntry ) {\n\n\t\t\t\t\t\t\t$thumbnail = $album->getMediaGroup()->getThumbnail();\n\t\t\t\t\t\t\t$title = $album->getMediaGroup()->getTitle();\n\t\t\t\t\t\t\t// error_log($bloginfo . $resultsPage . '?album_id=' . $album->getGphotoId());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// error_log('album id = ' . $album->getGphotoId());\n\t\t\t\t\t\t\t//$show_albums = array('5193636718112667841', '5218507736478682657');\n\t\t\t\t\t\t\t// var_dump( $show_albums ); die();\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( count ( $show_albums ) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ( in_array( $album->getGphotoId(), $show_albums) )\n\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t$html[] = '<a title=\"' . $title . '\" href=\"' . $resultsPage . '?album_id=' . $album->getGphotoId() . '\"><img alt=\"' . $title . '\" src=\"' . $thumbnail[0]->getUrl() . '\"></a>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$html[] = '<div style=\"width:100px;height:220px;text-align:center;float:left;margin-right:20px;margin-left:20px;\"><a title=\"' . $title . '\" href=\"' . $resultsPage . '?album_id=' . $album->getGphotoId() . '\"><img alt=\"' . $title . '\" src=\"' . $thumbnail[0]->getUrl() . '\"><br /><b style=\"padding:5px\">'.$title.'</b></a></div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t$html[] = '</div><div style=\"clear:both\"></div>';\n\t\t\t\t\t$html[] = '</div>';\n\t\t\t\t\t\n\t\t\t\t\treturn implode(\"\\n\", $html);\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}", "public function testGetAlbumImages($albumId = 1, $page = 1)\n {\n for($i = 1; 25 >= $i; $i++) {\n // First, mock the object to be used in the test\n $image = $this->createMock(Image::class);\n $images[] = $image;\n }\n\n $paginatorEvent = $this\n ->getMockBuilder(SlidingPagination::class)\n ->setMethods(array('getPageCount', 'getItems'))\n ->disableOriginalConstructor()\n ->getMock();\n $paginatorEvent->expects($this->once())\n ->method('getPageCount')\n ->will($this->returnValue(count($images)/Album::MAX_IMAGES_PER_PAGE));\n $paginatorEvent->expects($this->once())\n ->method('getItems')\n ->will($this->returnValue(array_slice($images, ($page-1)*Album::MAX_IMAGES_PER_PAGE, ($page-1)*Album::MAX_IMAGES_PER_PAGE+Album::MAX_IMAGES_PER_PAGE)));\n \n $paginator = $this\n ->getMockBuilder(Paginator::class)\n ->setMethods(array('paginate'))\n ->disableOriginalConstructor()\n ->getMock();\n $paginator->expects($this->once())\n ->method('paginate')\n ->will($this->returnValue($paginatorEvent));\n\n // Use the Abstract query, which has nearly all needed Methods as the Query.\n $query = $this\n ->getMockBuilder(AbstractQuery::class)\n ->setMethods(array('setParameter', 'getResult'))\n ->disableOriginalConstructor()\n ->getMockForAbstractClass();\n\n $imageRepository = $this\n ->getMockBuilder(ImageRepository::class)\n ->disableOriginalConstructor()\n ->getMock();\n $imageRepository->expects($this->once())\n ->method('getAlbumImagesQuery')\n ->will($this->returnValue($query));\n \n $entityManager = $this\n ->getMockBuilder(ObjectManager::class)\n ->disableOriginalConstructor()\n ->getMock();\n $entityManager->expects($this->once())\n ->method('getRepository')\n ->will($this->returnValue($imageRepository));\n\n $albumFatsManager = new AlbumManagerService($entityManager, $paginator, self::$serializer);\n $result = json_decode($albumFatsManager->getAlbumImages($albumId, $page), true);\n \n $this->assertArrayHasKey('items', $result);\n $this->assertArrayHasKey('paging', $result);\n }", "public function get(): TopAlbumsResource\n\t{\n\t\tif (Configs::getValueAsBool('SA_enabled')) {\n\t\t\t// Do not eagerly load the relation `photos` for each smart album.\n\t\t\t// On the albums overview, we only need a thumbnail for each album.\n\t\t\t/** @var BaseCollection<BaseSmartAlbum> $smartAlbums */\n\t\t\t$smartAlbums = $this->albumFactory\n\t\t\t\t->getAllBuiltInSmartAlbums(false)\n\t\t\t\t->map(\n\t\t\t\t\tfn ($smartAlbum) => Gate::check(AlbumPolicy::CAN_SEE, $smartAlbum) ? $smartAlbum : null\n\t\t\t\t)->reject(fn ($smartAlbum) => $smartAlbum === null);\n\t\t} else {\n\t\t\t$smartAlbums = new BaseCollection();\n\t\t}\n\n\t\t$tagAlbumQuery = $this->albumQueryPolicy\n\t\t\t->applyVisibilityFilter(TagAlbum::query()->with(['access_permissions', 'owner']));\n\t\t/** @var BaseCollection<TagAlbum> $tagAlbums */\n\t\t$tagAlbums = (new SortingDecorator($tagAlbumQuery))\n\t\t\t->orderBy($this->sorting->column, $this->sorting->order)\n\t\t\t->get();\n\n\t\t/** @var NsQueryBuilder $query */\n\t\t$query = $this->albumQueryPolicy\n\t\t\t->applyVisibilityFilter(Album::query()->with(['access_permissions', 'owner'])->whereIsRoot());\n\n\t\t$userID = Auth::id();\n\t\tif ($userID !== null) {\n\t\t\t// For authenticated users we group albums by ownership.\n\t\t\t/** @var BaseCollection<Album> $albums */\n\t\t\t$albums = (new SortingDecorator($query))\n\t\t\t\t->orderBy(ColumnSortingType::OWNER_ID, OrderSortingType::ASC)\n\t\t\t\t->orderBy($this->sorting->column, $this->sorting->order)\n\t\t\t\t->get();\n\n\t\t\t/**\n\t\t\t * @var BaseCollection<Album> $a\n\t\t\t * @var BaseCollection<Album> $b\n\t\t\t */\n\t\t\tlist($a, $b) = $albums->partition(fn ($album) => $album->owner_id === $userID);\n\n\t\t\treturn new TopAlbumsResource($smartAlbums, $tagAlbums, $a->values(), $b->values());\n\t\t} else {\n\t\t\t// For anonymous users we don't want to implicitly expose\n\t\t\t// ownership via sorting.\n\t\t\t$albums = (new SortingDecorator($query))\n\t\t\t\t->orderBy($this->sorting->column, $this->sorting->order)\n\t\t\t\t->get();\n\n\t\t\treturn new TopAlbumsResource($smartAlbums, $tagAlbums, $albums);\n\t\t}\n\t}", "function getallalbumsindb(&$album_array)\r\n{\r\n global $xoopsDB;\r\n\r\n $sql = \"SELECT aid, title \".\r\n \"FROM \".$xoopsDB->prefix(\"xcgal_albums\").\" \".\r\n \"WHERE 1\";\r\n $result = $xoopsDB->query($sql);\r\n\r\n while ($row = $xoopsDB->fetchArray($result)) {\r\n $album_array[$row['aid']]= $row['title'];\r\n }\r\n $xoopsDB->freeRecordSet($result);\r\n}", "public function getAlbums($id, $site, $userId)\n\t{\n\t\tif (true === isset($id)) {\n\t\t\t// get by uniq id\n\t\t\t$exec = \"SELECT\n a.id, a.title\n\t\t\t FROM\n\t\t\t albums a\n\t\t\t INNER JOIN \n\t\t\t sites s ON s.id = a.site_id\n\t\t\t WHERE\n\t\t\t \ts.url = :site\n\t\t\t AND\n\t\t\t \ta.id = :id\n\t\t\t ORDER BY a.id DESC\";\n\t\t\t$db = DB::query(Database::SELECT, $exec);\n\t\t\t$db->param(':id', $id);\n\t\t\t$db->param(':site', $site);\n\t\t} elseif (true === isset($userId)) {\n\t\t\t$exec = \"SELECT\n a.id, a.title\n\t\t\t FROM\n\t\t\t albums a\n\t\t\t INNER JOIN \n\t\t\t sites s ON s.id = a.site_id\n\t\t\t INNER JOIN\n\t\t\t user_album ua ON ua.album_id = a.id\n\t\t\t WHERE\n\t\t\t \tua.user_id = :userid\n\t\t\t ORDER BY a.id DESC\";\n\t\t\t$db = DB::query(Database::SELECT, $exec);\n\t\t\t$db->param(':userid', $userId);\n\t\t} elseif (true === isset($site)) {\n\t\t\t// get by by site category\n\t\t\t$exec = \"SELECT\n a.id, a.title\n\t\t\t FROM\n\t\t\t albums a\n\t\t\t INNER JOIN \n\t\t\t sites s ON s.id = a.site_id\n\t\t\t WHERE\n\t\t\t \ts.url = :site\n\t\t\t ORDER BY a.id DESC\";\n\t\t\t$db = DB::query(Database::SELECT, $exec);\n\t\t\t$db->param(':site', $site);\n\t\t}\n\n\t\t$albums = $db->execute()\n\t\t\t ->as_array();\n\t\t\n\t\treturn $albums;\n\t\t\n\t\tprint_r($albums);\n\n\t\treturn array();\n\t}", "public function getAlbumsFromCurrentSeason($currentSeason)\n {\n $currentSeasonSplited = preg_split( '/ - /', $currentSeason );\n $seasonStart = $currentSeasonSplited[0];\n $seasonEnd = $currentSeasonSplited[1];\n // ******** Get limiting dates ********\n $beginingDate = $seasonStart.'-08-01';\n $endingDate = $seasonEnd.'-05-31';\n // ******** Get albums from current season ********\n $albums = DB::table('albums') -> whereBetween('created_at', array($beginingDate, $endingDate)) -> get();\n // ******** Convert string into array ********\n $album = new Album;\n $albums = $album->convertPhotosValueToArray($albums);\n\n return $albums;\n }", "function getAllAlbums($typ) {\r\r\n\t$PView = new PView;\r\r\n\tglobal $tp;\r\r\n\t\r\r\n\t$details = $PView->getPView_config(\"gal_details\");\r\r\n\t$showDetails = explode(\"|\",$details);\r\r\n\t\r\r\n\tif ($typ == \"root\"){\r\r\n\t\t$AllAlbumData = $PView -> getRootAlbumData();\r\r\n\t} else {\r\r\n\t\tif (!$PView -> getSubAlbumsCount()) { return \"\"; }// exit if no subalbums\r\r\n\t\t$AllAlbumData = $PView -> getSubAlbumData();\t\r\r\n\t}\r\r\n\r\r\n\t$out_AllAlbums = \"<tr><td colspan='2' style='padding-top:5px;'><table style='width:100%'>\";\r\r\n\tforeach ($AllAlbumData as $dataset) {\r\r\n\t\t//PERMISSION!!!\r\r\n\t\tif ($PView -> getPermission(\"album\",$dataset['albumId'],\"View\")) {\r\r\n\t\t\t$out_AllAlbums .= \"<tr><td><div style='background-image:url(\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/ringbuch_650.jpg); background-repeat:no-repeat; width:660px; height:400px;'>\";\r\r\n\t\t\t$out_AllAlbums .= \"<table style='width:550px;'><tr style='height:300px;'><td style='text-align:left;padding-top:30px; width:40%;'>\";\r\r\n\t\t\tif (array_search(\"name\",$showDetails) !== FALSE) {\r\r\n\t\t\t\t$out_AllAlbums .= \"<a href='pviewgallery.php?album=\".$dataset['albumId'].\"'>\". $tp -> toHTML($dataset['name']).\"</a>\";\r\r\n\t\t\t}\r\r\n\t\t\tif (array_search(\"descr\",$showDetails) !== FALSE) {\r\r\n\t\t\t\t$out_AllAlbums .= \"<br><br>\". $tp -> toHTML($dataset['description']);\r\r\n\t\t\t}\r\r\n\t\t\t$out_AllAlbums .= \"</td><td style='text-align:right;padding-top:30px;width:60%;'><a href='pviewgallery.php?album=\".$dataset['albumId'].\"'><img src='\".$PView -> getAlbumImage($dataset['albumId']).\"' border='0px'></a></td></tr>\";\r\r\n\t\t\t$out_AllAlbums .= \"<tr><td style='text-align:left;'>\";\r\r\n\t\t\tif (array_search(\"edit\",$showDetails) !== FALSE && $PView -> getPermission(\"album\",$dataset['albumId'],\"Edit\")) {\r\r\n\t\t\t\t$out_AllAlbums .= \"<a href='pview_actions.php?album=\".$dataset['albumId'].\"&action=edit'>\".LAN_ALBUM_7.\"</a>\";\r\r\n\t\t\t}\r\r\n\t\t\t$out_AllAlbums .= \"</td><td style='text-align:right;'>\";\r\r\n\t\t\tif (array_search(\"info\",$showDetails) !== FALSE) {\r\r\n\t\t\t\t$out_AllAlbums .= LAN_ALBUM_1.\": \".$PView -> getAlbumImageCount($dataset['albumId']).\" / \".LAN_ALBUM_2.\": \".$PView -> getSubAlbumsCount($dataset['albumId']);\r\r\n\t\t\t}\r\r\n\t\t\t$out_AllAlbums .\"</td></tr>\";\r\r\n\t\t\t$out_AllAlbums .= \"</table> \";\r\r\n\t\t\t$out_AllAlbums .= \"</div></td></tr>\";\r\r\n\t\t}\r\r\n\t}\r\r\n\t\r\r\n\t$out_AllAlbums .= \"</table></td></tr>\";\r\r\n\tif (!strip_tags($out_AllAlbums)) {\r\r\n\t$out_AllAlbums = \"<tr><td colspan='2' style='padding:10px;'>\".LAN_GALLERY_4.\"</td></tr>\";\r\r\n\t}\r\r\nreturn $out_AllAlbums;\r\r\n}", "public static function getSongs()\n {\n $songs = Song::with('album:id,name')->get();\n return $songs;\n }", "public function getPackAlbumMap( array $a = array() ){\r\n\t\tif($a){\r\n\t\t\t$where=\"\";\r\n\t\t\tif($a['where']){\r\n\t\t\t\t$where=$a['where'];\r\n\t\t\t}\r\n\t\t\t\t$this->sSql = \"SELECT * FROM pack_album WHERE 1 $where\";\r\n\t\t\t\treturn $res = $this->oMysqli->query($this->sSql);\r\n\t\t}\r\n\t}", "function setup_album()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'id, name, member_id, public_album', 'from' => 'gallery_albums', 'where' => \"id={$this->ipsclass->input['album']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $info = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this album?\n if( $info['member_id'] == $this->ipsclass->member['id'] )\n {\n $own = true;\n }\n\n if( ! $info['public_album'] && ! $own )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );\n }\n\n return $info;\n }", "function getAlbumsById($parameter) //récupère les infos de l'Album correspondant à l'album_id passé en paramètre\n\t\t{\n\t\t\t//$tabParameter = explode(\" \", $parameter);\n\t\t\t$request = \" albums 0 1000 album_id:$parameter tags:Itj\\n\";\n\t\t\t//echo \" contenu de request:$request\";\n\t\t\t$mySqueezeCLI = new SqueezeCLI($request);\n\t\t\t$response = $mySqueezeCLI->receiveCLI();\n\t\t\treturn $response;\n\t\t}", "public function getAlbumSearchResults($query, $limit = null, $page = null)\r\n {\r\n if (empty($query)){\r\n return array();\r\n }\r\n\r\n $args = array('query' => $query);\r\n if (!empty($limit)) {\r\n $args['limit'] = (int)$limit;\r\n }\r\n if (!empty($page)) {\r\n $args['page'] = (int)$page;\r\n }\r\n\r\n //todo: remove this once we everything is forced dynamically\r\n $sessionID = false;\r\n if (isset($this) && !empty($this->sessionID)) {\r\n $sessionID = $this->sessionID;\r\n }\r\n return self::makeCall('getAlbumSearchResults', $args, 'albums', false, $sessionID);\r\n }", "function get_listing_data( $params )\n\t{\n\t\tif( $params['allow_albums'] == -1 && $params['allow_cats'] == -1 )\n\t\t{\n\t\t\t$this->total_images = 0;\n\t\t\treturn;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Are we listing images from a category?\n\t\t// ------------------------------------------------------\n\t\tif( $params['category'] == 'no' )\n\t\t{\n\t\t\t$where = \"category_id=0 \";\n\t\t}\n\t\telse if( $params['category'] )\n\t\t{\n\t\t\t$where = \"category_id={$params['category']} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Is this an album?\n\t\t// ------------------------------------------------------\n\t\tif( $params['album'] == 'no' )\n\t\t{\n\t\t\t$where = \"album_id=0 \";\n\t\t}\n\t\telse if( $params['album'] > 0 )\n\t\t{\n\t\t\t$where = \"album_id={$params['album']} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Is this a favorte?\n\t\t// ------------------------------------------------------\n\t\tif( $params['favorite'] )\n\t\t{\n\t\t\t$fav_tbl = ', ibf_gallery_favorites f';\n\t\t\t$where = \" f.member_id={$params['favorite']} AND i.id=f.img_id \";\n\t\t\t$this->favorite = true;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Pin Images?\n\t\t// ------------------------------------------------------\n\t\tif( $params['pinned'] )\n\t\t{\n\t\t\t$pin = \"pinned DESC,\";\n\t\t\t$this->pin = 1;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Restrict which categories images are pulled from?\n\t\t// ------------------------------------------------------\n\t\tif( is_array( $params['allow_cats'] ) && $params['category'] != 'no' )\n\t\t{\n\t\t\t$cats = implode( \",\", $params['allow_cats'] );\n\t\t\t$cat_restrict = \" i.category_id IN ( {$cats} ) \";\n\t\t}\n\t\telse if( $params['allow_cats'] == -1 )\n\t\t{\n\t\t\t$cat_restrict = \"category_id=0\";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Restrict which albums images are pulled from?\n\t\t// ------------------------------------------------------\n\t\tif( is_array( $params['allow_albums'] ) && $params['album'] != 'no' )\n\t\t{\n\t\t\t$album = implode( \",\", $params['allow_albums'] );\n\t\t\t$album_restrict = \" i.album_id IN ( {$album} ) \";\n\t\t}\n\t\telse if( $params['allow_albums'] == -1 )\n\t\t{\n\t\t\t$album_restrict = \"album_id=0 \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Format the restrict sql\n\t\t// ------------------------------------------------------\n\t\tif( $album_restrict && $cat_restrict )\n\t\t{\n\t\t\t$restrict = \" ( {$cat_restrict} OR {$album_restrict} ) \";\n\t\t}\n\t\telse if( $album_restrict || $cat_restrict )\n\t\t{\n\t\t\t$restrict = \" {$album_restrict} {$cat_restrict} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Only show a certain members images?\n\t\t// ------------------------------------------------------\n\t\tif( $params['member'] )\n\t\t{\n\t\t\t$where = \"i.member_id={$params['member']} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// How many rows are we getting?\n\t\t// ------------------------------------------------------\n\t\tif( isset( $params['st'] ) && isset( $params['show'] ) )\n\t\t{\n\t\t\t$limit = \"LIMIT {$params['st']}, {$params['show']}\";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Show unapproved images?\n\t\t// ------------------------------------------------------\n\t\t$params['approve'] = ( $params['approve'] ) ? ' i.approved=1' : \"\";\n\t\t//$this->mod = ( $params['approve'] ) ? 0 : 1 ;\n\n\t\t/*\n\t\t* Recheck mod status */\n\t\t//$this->mod = $this->ipsclass->member['is_mod'];\n\t\t/*\n\t\t* If input['unapproved'] is set, show only unapproved images */\n\t\t$params['approve'] = ( isset( $this->ipsclass->input['unapproved'] ) ) ? 'i.approved=0' : $params['approve'];\n\t\t\n\t\t// ------------------------------------------------------\n\t\t// Image Sorting\n\t\t// ------------------------------------------------------\n\t\t$sort_key = ( $params['sort_key'] ) ? $params['sort_key'] : 'date';\n\t\t$order_key = ( $params['order_key'] ) ? $params['order_key'] : 'DESC';\n\t\t$prune_key = ( $params['prune_key'] ) ? $params['prune_key'] : '30';\n\t\t\n\t\tif( $sort_key == 'rating' )\n\t\t{\n\t\t\t$sort_key = '(ratings_total/ratings_count)';\t\n\t\t}\n\n\t\tif( $sort_key == 'date' )\n\t\t{\n\t\t\t$sort_extra = \", i.id {$order_key} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Final SQL Formatting\n\t\t// ------------------------------------------------------\n\t\tif( $where )\n\t\t{\n\t\t\t$str = \"{$where} \";\n\t\t}\n\n\t\tif( !empty( $params['approve'] ) )\n\t\t{\n\t\t\t$str = ( $str ) ? \" {$str} AND {$params['approve']} \" : $params['approve'];\n\t\t}\n\n\t\tif( $restrict )\n\t\t{\n\t\t\t$str = ( $str ) ? \" {$str} AND {$restrict} \" : $restrict;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Query the images\n\t\t// ------------------------------------------------------\n\t\t$this->ipsclass->DB->cache_add_query( 'get_images', array( 'fav_tbl' => $fav_tbl,\n\t\t'member_id' => $this->ipsclass->member['id'],\n\t\t'where' => $str,\n\t\t'pin' => $pin,\n\t\t'sort_key' => $sort_key,\n\t\t'order_key' => $order_key,\n\t\t'sort_xtra' => $sort_extra,\n\t\t'limit' => $limit ), 'gallery_sql_queries' );\n\n\t\t// ------------------------------------------------------\n\t\t// Store the results?\n\t\t// ------------------------------------------------------\n\t\t$this->res = $this->ipsclass->DB->simple_exec();\n\n\t\t// ------------------------------------------------------\n\t\t// Store the total images found\n\t\t// ------------------------------------------------------\n\t\t$this->total_images = $this->ipsclass->DB->get_num_rows( $this->res );\n\t}", "function getAlbums($dom) {\n $albumURLs = array();\n $albumNames = array();\n $albums = $dom->find('ul.album_list',0);\n foreach($albums->find('li a') as $data){\n #print $data->href. \"\\n\";\n $albumURLs[] = $data->href;\n $albumNames[] = $data->plaintext;\n }\n return array(\"urls\"=>$albumURLs, \"names\"=>$albumNames);\n}", "function getAlbums($dom) {\n $albumURLs = array();\n $albumNames = array();\n $albums = $dom->find('ul.album_list',0);\n foreach($albums->find('li a') as $data){\n #print $data->href. \"\\n\";\n $albumURLs[] = $data->href;\n $albumNames[] = $data->plaintext;\n }\n return array(\"urls\"=>$albumURLs, \"names\"=>$albumNames);\n}", "function getAlbumImages($operator_id, $album_name, $page_no = 1) {\n\t\treturn $this->getResponse ( $this->getXmlApi (), 'getAlbumImages', array ('operator_id' => $operator_id, 'album_name' => $album_name, 'page_no' => $page_no ) );\n\t}", "public function getPhotos();", "public function gallery_albums()\n {\n $lang = $this->data['lang'];\n $user_id = $this->user_id;\n\n $this->data['page'] = 'gallery' ;\n $this->data['gallery_albums'] = $this->home_m->get_data('gallery_albums')->result_array();\n\n $body = 'gallery_albums' ;\n\n $this->load_pages($body,$this->data);\n }", "public function album()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" album ?\");\n\t}", "public function getTopAlbums(string $tag, int $limit = 50, int $page = 1): array;", "public function gather_musicbrainz($limit = 5) {\n\t\t$images\t= array();\n\t\t$num_found = 0;\n\n\t\tif ($this->type == 'album') {\n\t\t\t$album = new Album($this->uid);\n\t\t}\n\t\telse {\n\t\t\treturn $images;\n\t\t}\n\n\t\tif ($album->mbid) {\n\t\t\tdebug_event('mbz-gatherart', \"Album MBID: \" . $album->mbid, '5');\n\t\t}\n\t\telse {\n\t\t\treturn $images;\n\t\t}\n\n\t\t$mbquery = new MusicBrainzQuery();\n\t\t$includes = new mbReleaseIncludes();\n\t\ttry {\n\t\t\t$release = $mbquery->getReleaseByID($album->mbid, $includes->urlRelations());\n\t\t} catch (Exception $e) {\n\t\t\treturn $images;\n\t\t}\n\n\t\t$asin = $release->getAsin();\n\n\t\tif ($asin) {\n\t\t\tdebug_event('mbz-gatherart', \"Found ASIN: \" . $asin, '5');\n\t\t\t$base_urls = array(\n\t\t\t\t\"01\" => \"ec1.images-amazon.com\",\n\t\t\t\t\"02\" => \"ec1.images-amazon.com\",\n\t\t\t\t\"03\" => \"ec2.images-amazon.com\",\n\t\t\t\t\"08\" => \"ec1.images-amazon.com\",\n\t\t\t\t\"09\" => \"ec1.images-amazon.com\",\n\t\t\t);\n\t\t\tforeach ($base_urls as $server_num => $base_url) {\n\t\t\t\t// to avoid complicating things even further, we only look for large cover art\n\t\t\t\t$url = 'http://' . $base_url . '/images/P/' . $asin . '.' . $server_num . '.LZZZZZZZ.jpg';\n\t\t\t\tdebug_event('mbz-gatherart', \"Evaluating Amazon URL: \" . $url, '5');\n\t\t\t\t$snoopy = new Snoopy();\n\t\t\t\tif(Config::get('proxy_host') AND Config::get('proxy_port')) {\n\t\t\t\t\t$snoopy->proxy_user = Config::get('proxy_host');\n\t\t\t\t\t$snoopy->proxy_port = Config::get('proxy_port');\n\t\t\t\t\t$snoopy->proxy_user = Config::get('proxy_user');\n\t\t\t\t\t$snoopy->proxy_pass = Config::get('proxy_pass');\n\t\t\t\t}\n\t\t\t\tif ($snoopy->fetch($url)) {\n\t\t\t\t\t$num_found++;\n\t\t\t\t\tdebug_event('mbz-gatherart', \"Amazon URL added: \" . $url, '5');\n\t\t\t\t\t$images[] = array(\n\t\t\t\t\t\t'url' => $url,\n\t\t\t\t\t\t'mime' => 'image/jpeg',\n\t\t\t\t\t);\n\t\t\t\t\tif ($num_found >= $limit) {\n\t\t\t\t\t\treturn $images;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// The next bit is based directly on the MusicBrainz server code\n\t\t// that displays cover art.\n\t\t// I'm leaving in the releaseuri info for the moment, though\n\t\t// it's not going to be used.\n\t\t$coverartsites[] = array(\n\t\t\t'name' => \"CD Baby\",\n\t\t\t'domain' => \"cdbaby.com\",\n\t\t\t'regexp' => '@http://cdbaby\\.com/cd/(\\w)(\\w)(\\w*)@',\n\t\t\t'imguri' => 'http://cdbaby.name/$matches[1]/$matches[2]/$matches[1]$matches[2]$matches[3].jpg',\n\t\t\t'releaseuri' => 'http://cdbaby.com/cd/$matches[1]$matches[2]$matches[3]/from/musicbrainz',\n\t\t);\n\t\t$coverartsites[] = array(\n\t\t\t'name' => \"CD Baby\",\n\t\t\t'domain' => \"cdbaby.name\",\n\t\t\t'regexp' => \"@http://cdbaby\\.name/([a-z0-9])/([a-z0-9])/([A-Za-z0-9]*).jpg@\",\n\t\t\t'imguri' => 'http://cdbaby.name/$matches[1]/$matches[2]/$matches[3].jpg',\n\t\t\t'releaseuri' => 'http://cdbaby.com/cd/$matches[3]/from/musicbrainz',\n\t\t);\n\t\t$coverartsites[] = array(\n\t\t\t'name' => 'archive.org',\n\t\t\t'domain' => 'archive.org',\n\t\t\t'regexp' => '/^(.*\\.(jpg|jpeg|png|gif))$/',\n\t\t\t'imguri' => '$matches[1]',\n\t\t\t'releaseuri' => '',\n\t\t);\n\t\t$coverartsites[] = array(\n\t\t\t'name' => \"Jamendo\",\n\t\t\t'domain' => \"www.jamendo.com\",\n\t\t\t'regexp' => '/http://www\\.jamendo\\.com/(\\w\\w/)?album/(\\d+)/',\n\t\t\t'imguri' => 'http://img.jamendo.com/albums/$matches[2]/covers/1.200.jpg',\n\t\t\t'releaseuri' => 'http://www.jamendo.com/album/$matches[2]',\n\t\t);\n\t\t$coverartsites[] = array(\n\t\t\t'name' => '8bitpeoples.com',\n\t\t\t'domain' => '8bitpeoples.com',\n\t\t\t'regexp' => '/^(.*)$/',\n\t\t\t'imguri' => '$matches[1]',\n\t\t\t'releaseuri' => '',\n\t\t);\n\t\t$coverartsites[] = array(\n\t\t\t'name' => 'Encyclopédisque',\n\t\t\t'domain' => 'encyclopedisque.fr',\n\t\t\t'regexp' => '/http://www.encyclopedisque.fr/images/imgdb/(thumb250|main)/(\\d+).jpg/',\n\t\t\t'imguri' => 'http://www.encyclopedisque.fr/images/imgdb/thumb250/$matches[2].jpg',\n\t\t\t'releaseuri' => 'http://www.encyclopedisque.fr/',\n\t\t);\n\t\t$coverartsites[] = array(\n\t\t\t'name' => 'Thastrom',\n\t\t\t'domain' => 'www.thastrom.se',\n\t\t\t'regexp' => '/^(.*)$/',\n\t\t\t'imguri' => '$matches[1]',\n\t\t\t'releaseuri' => '',\n\t\t);\n\t\t$coverartsites[] = array(\n\t\t\t'name' => 'Universal Poplab',\n\t\t\t'domain' => 'www.universalpoplab.com',\n\t\t\t'regexp' => '/^(.*)$/',\n\t\t\t'imguri' => '$matches[1]',\n\t\t\t'releaseuri' => '',\n\t\t);\n\t\tforeach ($release->getRelations(mbRelation::TO_URL) as $ar) {\n\t\t\t$arurl = $ar->getTargetId();\n\t\t\tdebug_event('mbz-gatherart', \"Found URL AR: \" . $arurl , '5');\n\t\t\tforeach ($coverartsites as $casite) {\n\t\t\t\tif (strpos($arurl, $casite['domain']) !== false) {\n\t\t\t\t\tdebug_event('mbz-gatherart', \"Matched coverart site: \" . $casite['name'], '5');\n\t\t\t\t\tif (preg_match($casite['regexp'], $arurl, $matches)) {\n\t\t\t\t\t\t$num_found++;\n\t\t\t\t\t\teval(\"\\$url = \\\"$casite[imguri]\\\";\");\n\t\t\t\t\t\tdebug_event('mbz-gatherart', \"Generated URL added: \" . $url, '5');\n\t\t\t\t\t\t$images[] = array(\n\t\t\t\t\t\t\t'url' => $url,\n\t\t\t\t\t\t\t'mime' => 'image/jpeg',\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ($num_found >= $limit) {\n\t\t\t\t\t\t\treturn $images;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // end foreach coverart sites\n\t\t} // end foreach\n\n\t\treturn $images;\n\n\t}", "public function &getAlbums($uid = null, $aids = null)\n {\n // Requires a session_key\n if (!$skey = $this->_facebook->auth->getSessionKey()) {\n throw new Horde_Service_Facebook_Exception(\n 'photos.addTag requires a session_key',\n Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);\n }\n\n $results = $this->_facebook->callMethod(\n 'facebook.photos.getAlbums',\n array('uid' => $uid,\n 'aids' => $aids));\n\n return $results;\n }", "public function global_get_photos($id, $type = 'user',$user_id=null, $offset = 0, $pass_check = true)\n {\n global $db, $system;\n $photos = [];\n switch ($type) {\n case 'album':\n $offset *= $system['max_results_even'];\n if (!$pass_check) {\n /* check the album */\n $album = $this->global_get_album($id, false);\n if (!$album) {\n return $photos;\n }\n }\n // echo'<pre>'; print_r($user_id);die;\n if(!empty($user_id)){\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s And posts.user_id= %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($user_id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n }else{\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n }\n \n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n /* check the photo privacy */\n if ($photo['privacy'] == \"public\" || $photo['privacy'] == \"custom\") {\n $photos[] = $photo;\n } else {\n /* check the photo privacy */\n if ($this->check_privacy($photo['privacy'], $photo['user_id'])) {\n $photos[] = $photo;\n }\n }\n }\n }\n break;\n\n case 'user':\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_photos FROM users WHERE user_id = %s\", secure($id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_photos'], $id)) {\n return $photos;\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->_data['user_id'] == $id) {\n $manage_photos = true;\n }\n }\n /* get all user photos (except photos from groups or events) */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'user' AND posts.in_group = '0' AND posts.in_event = '0' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n if ($this->check_privacy($photo['privacy'], $id)) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n }\n break;\n\n case 'page':\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_page_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all page photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'page' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'group':\n if (!$pass_check) {\n /* check if the viewer is group member (approved) */\n if ($this->check_group_membership($this->_data['user_id'], $id) != \"approved\") {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_group_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all group photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.group_id = %s AND posts.in_group = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'event':\n if (!$pass_check) {\n /* check if the viewer is event member (approved) */\n if (!$this->check_event_membership($this->_data['user_id'], $id)) {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_event_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all event photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.event_id = %s AND posts.in_event = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n }\n return $photos;\n }", "public function get_songs($limit = 0,$artist='')\n {\n $results = array();\n\n $sql = \"SELECT `song`.`id` FROM `song` \";\n if (AmpConfig::get('catalog_disable')) {\n $sql .= \"LEFT JOIN `catalog` ON `catalog`.`id` = `song`.`catalog` \";\n }\n $sql .= \"WHERE `song`.`album` = ? \";\n $params = array($this->id);\n if (strlen($artist)) {\n $sql .= \"AND `artist` = ? \";\n $params[] = $artist;\n }\n if (AmpConfig::get('catalog_disable')) {\n $sql .= \"AND `catalog`.`enabled` = '1' \";\n }\n $sql .= \"ORDER BY `song`.`track`, `song`.`title`\";\n if ($limit) {\n $sql .= \" LIMIT \" . intval($limit);\n }\n $db_results = Dba::read($sql, $params);\n\n while ($r = Dba::fetch_assoc($db_results)) {\n $results[] = $r['id'];\n }\n\n return $results;\n\n }", "public function load($album = NULL, $options = array())\n {\n try\n {\n $this->filter = ((empty ($options) || !array_key_exists(\"order\", $options)) ? mdMediaManager::MD_FILTER_PRIORITY : $options[\"order\"]);\n\n if(is_null($album))\n {\n //Cargo todos los albums\n $mdMediaAlbums = $this->mdObject->retrieveMdMedia()->retrieveAlbums($this->key);\n $this->count_albums = count($mdMediaAlbums);\n $counter_comments = 0;\n\n foreach($mdMediaAlbums as $mdAlbum)\n {\n\n $this->hashMap[$mdAlbum['title']] = (int)$mdAlbum['id'];\n $this->albums[(int)$mdAlbum['id']] = new stdClass();\n $this->albums[(int)$mdAlbum['id']]->id = (int)$mdAlbum['id'];\n try\n {\n $this->albums[(int)$mdAlbum['id']]->avatarId= (is_null($mdAlbum['md_media_content_id']) ? NULL : (int)$mdAlbum['md_media_content_id']);\n $this->albums[(int)$mdAlbum['id']]->avatar = NULL;\n if($this->albums[(int)$mdAlbum['id']]->avatarId != NULL)\n {\n $this->albums[(int)$mdAlbum['id']]->avatar = mdMediaAlbum::retrieveMdContentConcrete((int)$mdAlbum['md_media_content_id']);\n }\n }catch(Exception $e){\n $this->albums[(int)$mdAlbum['id']]->avatar = NULL;\n }\n $this->albums[(int)$mdAlbum['id']]->title = $mdAlbum['title'];\n $this->albums[(int)$mdAlbum['id']]->description = $mdAlbum['description'];\n $this->albums[(int)$mdAlbum['id']]->contentIds = array();\n $this->albums[(int)$mdAlbum['id']]->count = mysqlMdMediaAlbum::retrieveCountCache($mdAlbum['id']);\n if( sfConfig::get( 'sf_plugins_media_commentable', false ) )\n {\n $this->albums[(int)$mdAlbum['id']]->count_comments = mdCommentsHandler::retrieveCountComments(\"mdMediaAlbum\", (int)$mdAlbum['id']);\n $counter_comments+= $this->albums[(int)$mdAlbum['id']]->count_comments;\n }\n $this->albums[(int)$mdAlbum['id']]->contents = array();\n\n //Sino se carga a demanda, cargo todos los objetos para cada album\n if(!self::$LOAD_ON_DEMAND_CONTENT)\n {\n $mdItemIds = MdMediaAlbum::retrieveContentIds($mdAlbum['id'], $this->filter);\n $this->albums[(int)$mdAlbum['id']]->contentIds = $mdItemIds;\n $limit = (!is_null(sfConfig::get('app_objectsByPage'))) ? sfConfig::get('app_objectsByPage') : self::ITEMS_BY_PAGE;\n $this->albums[(int)$mdAlbum['id']]->contents = $this->loadItems($mdAlbum['title'], 1, $limit);\n }\n }\n $this->count_comments_albums = $counter_comments;\n }\n else\n {\n// Doctrine::getTable('mdMediaAlbum')->findAlbums($this->mdObject->retrieveMdMedia()->getId(), mdMediaManager::IMAGES);\n //Cargo los datos del album $album\n $mdAlbum = Doctrine::getTable('mdMediaAlbum')->retrieveAlbum($this->mdObject->retrieveMdMedia()->getId(), $album);\n\n if($mdAlbum)\n {\n $this->hashMap[$mdAlbum['title']] = (int)$mdAlbum['id'];\n $this->albums[(int)$mdAlbum['id']] = new stdClass();\n $this->albums[(int)$mdAlbum['id']]->id = (int)$mdAlbum['id'];\n try\n {\n $this->albums[(int)$mdAlbum['id']]->avatarId= (is_null($mdAlbum['md_media_content_id']) ? NULL : (int)$mdAlbum['md_media_content_id']);\n $this->albums[(int)$mdAlbum['id']]->avatar = NULL;\n if($this->albums[(int)$mdAlbum['id']]->avatarId != NULL)\n {\n $this->albums[(int)$mdAlbum['id']]->avatar = MdMediaAlbum::retrieveMdContentConcrete((int)$mdAlbum['md_media_content_id']);\n }\n }catch(Exception $e){\n $this->albums[(int)$mdAlbum['id']]->avatar = NULL;\n }\n $this->albums[(int)$mdAlbum['id']]->title = $mdAlbum['title'];\n $this->albums[(int)$mdAlbum['id']]->description = $mdAlbum['description'];\n $this->albums[(int)$mdAlbum['id']]->contentIds = array();\n $this->albums[(int)$mdAlbum['id']]->count = mysqlMdMediaAlbum::retrieveCountCache($mdAlbum['id']);\n if( sfConfig::get( 'sf_plugins_media_commentable', false ) )\n {\n $this->albums[(int)$mdAlbum['id']]->count_comments = mdCommentsHandler::retrieveCountComments(\"mdMediaAlbum\", (int)$mdAlbum['id']);\n }\n $this->albums[(int)$mdAlbum['id']]->contents = array();\n\n //Sino se carga a demanda, cargo todos los objetos para el album\n if(!self::$LOAD_ON_DEMAND_CONTENT)\n {\n $mdItemIds = MdMediaAlbum::retrieveContentIds($mdAlbum['id'], $this->filter);\n $this->albums[(int)$mdAlbum['id']]->contentIds = $mdItemIds;\n $limit = (!is_null(sfConfig::get('app_objectsByPage')) ? sfConfig::get('app_objectsByPage') : self::ITEMS_BY_PAGE);\n $this->albums[(int)$mdAlbum['id']]->contents = $this->loadItems($mdAlbum['title'], 1, $limit);\n }\n $this->album_loaded = $mdAlbum['title'];\n }\n else\n {\n throw new Exception('The album ' . $album . ' not exist for the object of id ' . $this->mdObject->getId(), 103);\n }\n }\n }\n catch(Exception $e)\n {\n throw $e;\n }\n\n return $this;\n }", "function albums_site_show_images($album) {\n\tglobal $lang;\n\n\tif (!file_exists(ALBUMS_DIR.'/'.$album))\n\t\techo '<p>'.$lang['albums']['doesnt_exist'].'</p>';\n\n\telse {\n\t\t$images = albums_get_images($album);\n\t\tif ($images != FALSE) {\n\t\t\tforeach ($images as $image) {\n\t\t\t\t?>\n\t\t\t\t<div class=\"album\">\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<a href=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/<?php echo $image['filename_image']; ?>\" rel=\"lytebox[album]\" title=\"<?php echo $image['title']; ?>\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/thumb/<?php echo $image['filename_image']; ?>\" alt=\"<?php echo $image['title']; ?>\" title=\"<?php echo $image['title']; ?>\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<span class=\"albuminfo\"><?php echo $image['title']; ?></span>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<i><?php echo $image['info']; ?></i>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t\t}\n\t\t\tunset($image);\n\t\t}\n\t}\n}", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function get_albums_by_id($id)\n {\n $this->db->where('id', $id);\n $this->db->where('num_song >', 0);\n $data_album = $this->db->get('album_song')->row_array();\n\n return $data_album;\n }", "public function findMediaBy(array $criteria);", "public function getAllPhotos();", "function getAuctions($conditions = null, $limit = null, $order = 'Auction.end_time DESC', $exclude = false, $folder = 'thumbs') {\r\n\t\t$excludeId = array();\r\n\t\tif(!empty($exclude)){\r\n\t\t\tforeach($exclude as $excludeAuction){\r\n\t\t\t\t$excludeId[] = $excludeAuction['Auction']['id'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t\t\t\tif(!empty($conditions) && !empty($excludeId)){\r\n\t\t\t\t\t\tif(is_array($conditions)){\r\n\t\t\t\t\t\t\t$conditions[] = 'Auction.id NOT IN (' . implode(',', $excludeId) .')';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$this->contain(array('Product' => array('Image' => 'ImageDefault', 'Limit')), 'Winner');\r\n\t\t\t\t\t$auctions = $this->find('all', array('conditions' => $conditions, 'order' => $order, 'limit' => $limit));\r\n\r\n\t\t\t\t\t// process any translations\r\n\t\t\t\t\tApp::import('model','User');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tforeach($auctions as $key => $auction) {\r\n\t\t\t\t\t\t// Check if auction already started\r\n\t\t\t\t\t\tif(strtotime($auction['Auction']['start_time']) > time()) {\r\n\t\t\t\t\t\t\t$auctions[$key]['Auction']['isFuture'] = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$auctions[$key]['Auction']['isClosed'] = $auction['Auction']['closed'];\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$tempMod = new User();\r\n\t\t\t\t\t\t$user=$tempMod->find('first', array(\r\n\t\t\t\t\t'conditions' => array('User.id' => $auction['Auction']['leader_id']),\r\n\t\t\t\t\t'fields'\t => array('username', 'avatar'),\r\n\t\t\t\t\t'contain'\t => false\r\n\t\t\t\t\t\t));\r\n\r\n\t\t\t\t\t\t$auctions[$key]['User']=$user['User'];\r\n\r\n\t\t\t\t\t\t// Put it back into the array\r\n\t\t\t\t\t\t$auctions[$key]['Auction']['end_time'] = strtotime($auction['Auction']['end_time']);\r\n\r\n\t\t\t\t\t\t// Get savings\r\n\t\t\t\t\t\tif($auction['Product']['rrp'] > 0) {\r\n\t\t\t\t\t\t\tif(!empty($auction['Product']['fixed'])) {\r\n\t\t\t\t\t\t\t\tif($auction['Product']['fixed_price'] > 0) {\r\n\t\t\t\t\t\t\t\t\t$auctions[$key]['Auction']['savings']['percentage'] = round(100 - ($auction['Product']['fixed_price'] / $auction['Product']['rrp'] * 100), 2);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$auctions[$key]['Auction']['savings']['percentage'] = 100;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$auctions[$key]['Auction']['savings']['price'] = $auction['Product']['rrp'] - $auction['Product']['fixed_price'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$auctions[$key]['Auction']['savings']['percentage'] = round(100 - ($auction['Auction']['price'] / $auction['Product']['rrp'] * 100), 2);\r\n\t\t\t\t\t\t\t\t$auctions[$key]['Auction']['savings']['price'] = $auction['Product']['rrp'] - $auction['Auction']['price'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$auctions[$key]['Auction']['savings']['percentage'] = 0;\r\n\t\t\t\t\t\t\t$auctions[$key]['Auction']['savings']['price'] = 0;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(!empty($auction['Product']['Image'])) {\r\n\t\t\t\t\t\t\tif(!empty($auction['Product']['Image'][0]['ImageDefault'])) {\r\n\t\t\t\t\t\t\t\t$auctions[$key]['Auction']['image'] = 'default_images/'.Configure::read('App.serverName').'/'.$folder.'/'.$auction['Product']['Image'][0]['ImageDefault']['image'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$auctions[$key]['Auction']['image'] = 'product_images/'.$folder.'/'.$auction['Product']['Image'][0]['image'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$lastBid = $this->Bid->lastBid($auction['Auction']['id']);\r\n\t\t\t\t\t\t//var_dump($lastBid);\r\n\t\t\t\t\t\tif(!empty($lastBid)) {\r\n\t\t\t\t\t\t\t$auctions[$key]['LastBid'] = $lastBid;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$temp = explode(\"@\", $auctions[$key]['LastBid']['username']);\r\n\t\t\t\t\t\t\t$auctions[$key]['LastBid']['username'] = $temp[0];\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(strlen($auctions[$key]['LastBid']['username'])>12){\r\n\t\t\t\t\t\t\t\t$auctions[$key]['LastBid']['username'] = substr($auctions[$key]['LastBid']['username'], 0, 12).\"...\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$auctions[$key]['LastBid']['username'] = __('No bids placed yet', true);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$auction['Auction']['serverTimestamp'] = time();\r\n\r\n\t\t\t\t\t\t//$auctions[$key]['Histories'] = $this->Bid->histories($auction['Auction']['id'], $this->appConfigurations['bidHistoryLimit'], $historiesOptions);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif($limit == 1){\r\n\t\t\t\t\t\tif(!empty($auctions[0])){\r\n\t\t\t\t\t\t\treturn $auctions[0];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn $auctions;\r\n\t\t\t\t}", "public function getAlbumDataByAlbumId($albumId){\n $albums = DB::select('SELECT albums . * , users.username, COUNT( photos.photo_id ) AS album_photos_count\n FROM albums\n LEFT JOIN users ON albums.user_id = users.id\n LEFT JOIN photos ON albums.album_id = photos.album_id\n WHERE albums.album_id = ?\n GROUP BY albums.album_id', array($albumId));\n\n return $albums;\n }", "public function getImages( $id_album = 0 )\n\t{\n\t\treturn Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'azgallery` WHERE `id_album`='.$id_album);\n\t}", "public function getPlayersByAlbum($album_id, $options = []) {\n $query = \"SELECT\n pl.nick,\n pa.missing_count\n FROM \" . $this->__schema . \".player_album pa\n INNER JOIN \" . $this->__schema . \".album al ON pa.album_id = al.id\n INNER JOIN \" . $this->__schema . \".player pl ON pa.player_id = pl.id\n WHERE pa.album_id = \" . $this->db()->quote($album_id)\n . \" ORDER BY pl.nick\";\n// INNER JOIN \" . $this->__schema . \".player_sitcker ps ON pa.player_id = ps.player_id\n// INNER JOIN \" . $this->__schema . \".sticker st ON ps.sticker_id = st.id\n foreach ($options as $an_option) {\n $query .= \" AND \" . $an_option;\n }\n $data = $this->db()->getCollection($query);\n if ($data) {\n $album_info = $this->getAlbumById($album_id);\n $album_name = ($album_info['success'] ? $album_info['payload']['name'] : '');\n return [\n 'success' => TRUE,\n 'album_id' => $album_id,\n 'album_name' => $album_name,\n 'payload' => $data,\n ];\n }\n else {\n return [\n 'success' => FALSE,\n 'album_id' => NULL,\n 'album_id' => NULL,\n 'payload' => NULL,\n ];\n }\n }", "public function getAlbumAndArtistIds($albums = [])\n {\n if (!$albums) {\n return false;\n }\n\n $spotify_ids = [];\n\n foreach ($albums as $album) {\n $search = $this->searchAlbums($album);\n\n if (isset($search[0])) {\n $spotify_ids['albums'][] = $search[0]['id'];\n $spotify_ids['artists'][] = $search[0]['artists'][0]['id'];\n }\n\n // play nicely with rate limitation\n sleep(1);\n }\n\n return $spotify_ids;\n }", "public function index(Request $request)\n {\n $user = JWTAuth::parseToken()->authenticate();\n\n if (Gate::forUser($user)->allows('albums', $user)) {\n //if is an admin and \"others\" param present, return all albums\n if($user->admin && $request->others){\n $records = $this->albumRepository->latests($request->page,$request->published,$request->search);\n $total = $this->albumRepository->latestsCount($request->search,$request->published);\n }else{\n $records = $this->albumRepository->latestsByUser($user,$request->published);\n $total = $user->albums()->count();\n }\n\n $albums = [];\n foreach($records as $record){\n $album = $this->prepareAlbumData($record,[]);\n array_push($albums,$album);\n }\n\n return response()->json([\n 'success' => true,\n 'meta' => [\n 'total' => $total,\n ],\n 'albums' => $albums\n ]);\n }else{\n return response()->json([\n 'success' => false,\n 'errors' => ['Not authorized to read albums'],\n ],403);\n }\n }", "public function setAlbums($albums)\n {\n $this->albums = $albums;\n\n return $this;\n }" ]
[ "0.7127258", "0.712155", "0.7085461", "0.7031973", "0.6957698", "0.6861965", "0.67514575", "0.6740309", "0.6597653", "0.6577265", "0.6547528", "0.65147936", "0.6481528", "0.64783186", "0.64535767", "0.6430826", "0.6426433", "0.6425407", "0.6410433", "0.6393424", "0.63818413", "0.6363946", "0.63258773", "0.62932914", "0.62913704", "0.628369", "0.62797713", "0.6268935", "0.6260452", "0.6260332", "0.62471193", "0.6235083", "0.62277263", "0.6188006", "0.6151021", "0.61427194", "0.61119366", "0.6097891", "0.6097248", "0.60923904", "0.60827637", "0.6078704", "0.60677874", "0.6053984", "0.60475975", "0.598455", "0.5967981", "0.5937306", "0.59165627", "0.59106946", "0.5906976", "0.58939433", "0.588775", "0.5848415", "0.5840062", "0.58373237", "0.5834467", "0.58328325", "0.58228576", "0.58061427", "0.58016837", "0.57906055", "0.57768005", "0.5770795", "0.5767295", "0.5748487", "0.5743223", "0.5730307", "0.5680271", "0.56659967", "0.56613266", "0.5656181", "0.56524175", "0.5648583", "0.56476843", "0.5635228", "0.5628933", "0.5628933", "0.5618978", "0.5612141", "0.5599491", "0.5584043", "0.5574138", "0.5563948", "0.55482465", "0.5546316", "0.55395555", "0.5538333", "0.5512163", "0.550483", "0.549415", "0.54929936", "0.5458814", "0.5456903", "0.54525983", "0.54501426", "0.544825", "0.5447486", "0.54473835", "0.5442375" ]
0.6904509
5
Gets a list of media Ids based on the album Id
public function getMediaIdsFromAlbum($albumId) { return $this->_getDb()->fetchCol(' SELECT media_id FROM xengallery_media WHERE album_id = ? ', $albumId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAlbumsId()\n {\n $url = str_replace(\"[:action]\", \"albums/ids\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n return isset($result['data']) && !empty($result['data']) ? $result['data'] : null;\n }", "public function getMedia($aid) {\n\t\t$this->Media->recursive = -1;\n\t\treturn $this->Media->find('all', array('conditions' => array('Media.model' => 'album' , 'Media.model_id' => Sanitize::clean(intval($aid)))));\n\t}", "public function getMediaId();", "public function getAlbums($id){\n $artist = Artist::find($id);\n return $artist->albums;\n }", "function getSongIDsFromAlbumSong($conn, $albumID) {\n // used to index $idArray\n $resultCount = 0;\n // stores returned IDs from the query\n $idArray = array();\n \n $query = \"SELECT song_id FROM album_song WHERE album_id = ${albumID}\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = $row['song_id'];\n $resultCount++;\n }\n return $idArray;\n } else {\n return NULL;\n }\n }", "public function get_album_suite()\n {\n $results = array();\n\n $catalog_where = \"\";\n $catalog_join = \"LEFT JOIN `catalog` ON `catalog`.`id` = `song`.`catalog`\";\n if ($catalog) {\n $catalog_where .= \" AND `catalog`.`id` = '$catalog'\";\n }\n if (AmpConfig::get('catalog_disable')) {\n $catalog_where .= \" AND `catalog`.`enabled` = '1'\";\n }\n\n $sql = \"SELECT DISTINCT `album`.`id` FROM album LEFT JOIN `song` ON `song`.`album`=`album`.`id` $catalog_join \" .\n \"WHERE `album`.`mbid`='$this->mbid' $catalog_where ORDER BY `album`.`disk` ASC\";\n\n $db_results = Dba::read($sql);\n\n while ($r = Dba::fetch_assoc($db_results)) {\n $results[] = $r['id'];\n }\n\n return $results;\n\n }", "function getAlbumIDsFromAlbumSong($conn, $songID) {\n // used to index $idArray\n $resultCount = 0;\n // stores returned IDs from the query\n $idArray = array();\n \n $query = \"SELECT album_id FROM album_song WHERE song_id = ${songID}\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = $row['album_id'];\n $resultCount++;\n }\n return $idArray;\n } else {\n return NULL;\n }\n }", "public function getAlbumAndArtistIds($albums = [])\n {\n if (!$albums) {\n return false;\n }\n\n $spotify_ids = [];\n\n foreach ($albums as $album) {\n $search = $this->searchAlbums($album);\n\n if (isset($search[0])) {\n $spotify_ids['albums'][] = $search[0]['id'];\n $spotify_ids['artists'][] = $search[0]['artists'][0]['id'];\n }\n\n // play nicely with rate limitation\n sleep(1);\n }\n\n return $spotify_ids;\n }", "function getAlbumSongIDs($conn, $albumID) {\n // used to index $idArray\n $resultCount = 0;\n // will be used to return all ID's from the query\n $idArray = array();\n \n $query = \"SELECT song_id, song_track_number FROM album_song WHERE album_id = ${albumID} ORDER BY song_track_number\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = array(\n 'song_id' => $row['song_id'],\n 'track_number' => $row['song_track_number']\n );\n $resultCount++;\n }\n return $idArray;\n } else {\n // error\n return array(); // results of function must implement countable, so return empty array\n }\n }", "public function getAlbumPhotos($albumId){\n return DB::select('select * from photos where album_id = ?', array($albumId));\n }", "public function fetch_albums_id($id)\n {\n \t\t\n\t\t$this->db->select('*');\n $this->db->from(\"album_song\");\n\t\t$this->db->where('num_song >', 0);\n $this->db->where(\"user_id\", $id);\n $query = $this->db->get();\n \t\treturn $query->result();\n }", "public function mediaByAlbums($albums, $options = []){\n $order = isset($options['order']) && $options['order'] ? $options['order'] : null;\n $limit = isset($options['limit']) && $options['limit'] ? $options['limit'] : null;\n $offset = isset($options['offset']) && $options['offset'] ? $options['offset'] : null;\n \n $album = \\FlexCMS\\BasicCMS\\Models\\Item::where('item_type', '=', 'album');//->where('name', '=', $album)->first();\n // foreach ($albums as $key => $value) {\n // $album = $album->orWhere('name', '=', $value);\n // }\n $album = $album->whereIn('name', $albums);\n $album = $album->get();\n foreach ($album as $key => $value) {\n $album[$key]->media = \\FlexCMS\\BasicCMS\\Models\\Media::where('album_id', '=', $value->id);\n if ($order){\n $album[$key]->media = $album[$key]->media->orderByRaw($order);\n }\n $album[$key]->media = $album[$key]->media->get()->toArray();\n }\n \n return $album->toArray();\n }", "public function getAlbums()\n {\n $url = str_replace(\"[:action]\", \"albums\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n $_albums = '';\n\n foreach ($result['data'] as $item) {\n $_album = new ImgUrAlbum();\n $_album->setAttributes($item);\n $_albums[] = $_album;\n }\n\n return $_albums;\n }", "function getAlbumIDsFromArtistAlbum($conn, $artistID) {\n // used to index $idArray\n $resultCount = 0;\n // stores returned IDs from the query\n $idArray = array();\n \n $query = \"SELECT album_id FROM artist_album WHERE artist_id = ${artistID}\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = $row['album_id'];\n $resultCount++;\n }\n return $idArray;\n } else {\n return array();\n }\n }", "function getArtistIDsFromArtistAlbum($conn, $albumID) {\n // used to index $idArray\n $resultCount = 0;\n // stores returned IDs from the query\n $idArray = array();\n \n $query = \"SELECT artist_id FROM artist_album WHERE album_id = ${albumID}\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = $row['artist_id'];\n $resultCount++;\n }\n return $idArray;\n } else {\n return NULL;\n }\n }", "public function get_songs_by_playlist_amp($id_album)\n {\n $data_album = $this->db\n ->select('audio_song.*, audio_amp.id as ID')\n ->where('playlist_amp_id', $id_album)\n ->join('audio_song', 'audio_song.id = audio_amp.audio_song_id ')\n ->get('audio_amp')\n ->result_array();\n\n return $data_album;\n }", "public function get_albums_by_id($id)\n {\n $this->db->where('id', $id);\n $this->db->where('num_song >', 0);\n $data_album = $this->db->get('album_song')->row_array();\n\n return $data_album;\n }", "public function mediaByAlbum($album, $options = []){\n $order = isset($options['order']) && $options['order'] ? $options['order'] : null;\n $limit = isset($options['limit']) && $options['limit'] ? $options['limit'] : null;\n $offset = isset($options['offset']) && $options['offset'] ? $options['offset'] : null;\n \n $album = \\FlexCMS\\BasicCMS\\Models\\Item::where('item_type', '=', 'album')->where('name', '=', $album)->first();\n if ($album){\n $media = \\FlexCMS\\BasicCMS\\Models\\Media::with('album')->where('album_id', '=', $album->id);\n if ($order){\n $media = $media->orderByRaw($order);\n }\n if ($limit){\n $media = $media->take($limit);\n }\n if ($offset){\n $media = $media->offset($offset);\n }\n $media = $media->get();\n return $media->toArray();\n }\n else{\n return [];\n }\n }", "public function getPhotos($album_id)\n {\n $client = new Client();\n\n // get JSON from the webservice and convert it into an assoc. array\n return json_decode($client->get(\"http://jsonplaceholder.typicode.com/album/${album_id}/photos\")->getBody(), true);\n\n }", "public function getImages( $id_album = 0 )\n\t{\n\t\treturn Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'azgallery` WHERE `id_album`='.$id_album);\n\t}", "public function get_songs_by_album($id_album)\n {\n $this->db->where('album_id', $id_album);\n $this->db->order_by('id', 'DESC');\n $data_album = $this->db->get('audio_song')->result_array();\n\n return $data_album;\n }", "public function getAlbums()\n\t{\n\t\treturn Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'azgallery_album`');\n\t}", "private function getAlbumArt($album_id)\n {\n\t\t$art_sql = \"SELECT album_image, image_size FROM album_art WHERE album_id = :album_id\";\n $stmt= $this->db->prepare($art_sql);\n\t\t\t\n\t\t$data = [\n\t\t\t'album_id' => $album_id,\n\t\t];\n\t\t\t\n\t\t$stmt->execute($data);\n\t\t\n\t\t\n\t\t$results = [];\n\t\twhile ($art = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$results[] = $art;\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "public function getMediaId()\n {\n return $this->media->getId();\n }", "public function getMediaItem($id);", "public function getArtists($id){\n $album = Album::find($id);\n return $album->artists;\n }", "public function getAlbums()\n {\n return GalleryAlbum::get()->filter('ParentID', $this->ID);\n }", "public function getEntityId()\n {\n return $this->albumId;\n }", "public function getAlbumID()\n {\n $albumID = $this->id;\n return $albumID;\n }", "static function idsFromPhotos($photos) {\n $ids = array();\n foreach ($photos as $photo) {\n $ids[] = $photo->getId();\n }\n return $ids;\n }", "function hmg_get_gallery_ids( $post_id = null ) {\n\n\tif( null == $post_id ) \n\t\t$post_id = get_the_id(); \n\t\t\n\treturn array_filter( (array) get_post_meta( $post_id, '_hmg_gallery_images', true ) );\n\t\n}", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "function get_album() {\n $sql = \"SELECT * FROM album\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "function post_ids() {\n\n\t\t$media_location = $this->media_location();\n\n\t\tif ( ! $media_location )\n\t\t\treturn array();\n\n\t\t$media_files = $media_location->media_files();\n\n\t\tif ( ! count( $media_files ) )\n\t\t\treturn array();\n\n\t\t// fetch releases\n\t\t$episode_ids = array_map( function ( $v ) { return $v->episode_id; }, $media_files );\n\t\t$episodes = Episode::find_all_by_where( \"id IN (\" . implode( ',', $episode_ids ) . \")\" );\n\n\t\treturn array_map( function ( $v ) { return $v->post_id; }, $episodes );\n\t}", "public function getAllIds();", "function getMedia($mediaId)\n{\n\tglobal $db;\n if(is_array($mediaId))\n {\n // first check the array\n if(empty($mediaId))\n return false;\n\n $mediaIdArray = array();\n\n foreach($mediaId as $mediaIdEntry)\n {\n // numeric entries only\n if(is_numeric($mediaIdEntry))\n $mediaIdArray[] = $mediaIdEntry;\n }\n\n $where = \" media.id in (\".implode(', ',$mediaIdArray).\")\";\n }\n else\n {\n //single id\n $where = \" media.id = \".(0+$mediaId);\n }\n\n\n\n\t$query = \"\n\t\t SELECT\n media.*,\n media_type.content_type\n FROM\n\t\t `\".$GLOBALS['dataBaseToUse'].\"`.`media`\n LEFT JOIN `\".$GLOBALS['dataBaseToUse'].\"`.`media_type` ON media.id_media_type = media_type.id\n\t\t WHERE\n\t\t \".$where.\"\n AND media.deleted = 0\n\t \";\n\n\t$result = $db -> query($query);\n\n // initializing returndata\n $return = array();\n\n while($row = mysqli_fetch_assoc($result))\n {\n $return[$row['id']] = $row;\n }\n\n if(!empty($return))\n {\n //get context information for media entry\n\n $query = \"\n SELECT\n media_context.*\n FROM\n `\".$GLOBALS['dataBaseToUse'].\"`.`media_context`\n WHERE\n id_media in (\".implode(', ',array_keys($return)).\")\n AND id_media_cluster = 0\n AND deleted = 0\n \";\n\n $result = $db -> query($query);\n while($row = mysqli_fetch_assoc($result))\n {\n $return[$row['id_media']]['contextInformation'][$row['id_language']] = $row;\n }\n\t }\n\n\t return $return;\n}", "public function getIds();", "public function getIds();", "function getPhotosOfMedia($idMedia){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\r\n\t\t$result = mysql_query(\"select * from media_photos, media where FK_ID_MEDIA = ID_MEDIA and ID_MEDIA = \" . $idMedia);\r\n\t\t$tab = new Data();\r\n\t\tif(mysql_num_rows($result)==0){\r\n\t\t\t// on liste le repertoire\r\n\t\t\t$result = mysql_query(\"select * from media where ID_MEDIA = \" . $idMedia);\r\n\t\t\t$nb = mysql_num_rows($result);\r\n\t\t\tif($nb==0){\r\n\t\t\t\t$connectService->close();\r\n\t\t\t\treturn $tab;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$tab->addInfo(\"root\",$this->directory . mysql_result($result,0,\"DIR_MEDIA\"));\r\n\t\t\t\t$tab->addInfo(\"titre\",mysql_result($result,0,\"DESCRIPTION\"));\r\n\t\t\t\t$tab->addInfo(\"group\",mysql_result($result,0,\"FK_ID_GROUP\"));\r\n\t\t\t\t$connectService->close();\r\n\t\t\t\t$tab->addInfo(\"photos\",$this->getPhotosOfDir($tab->getInfo(\"root\")));\r\n if($idMedia == 617){\r\n $tab->addInfo(\"root\",\"http://chaines.cardans.s3-website-eu-west-1.amazonaws.com/PHOTOS/2012_11_24-FONTAINEBLEAU\");\r\n }\r\n\t\t\t\t$tab->addInfo(\"type\",\"scan\");\r\n\t\t\t\treturn $tab;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function get_single_album($pid) {\n $sql = \"SELECT * FROM album WHERE id='$pid'\";\n $res = $this->mysqli->query($sql);\n return $res->fetch_array(MYSQLI_ASSOC);\n }", "public abstract function get_ids();", "public function getalbumbyID( $id, $sort = false )\n\t{\n\t\t$albums = array();\n\n\t\tif( is_array( $id ) )\n\t\t{\n\t\t\t$result = $this->db->query( \"SELECT * FROM \" . $this->table_prefix . \"_album WHERE id IN(\" . implode( \",\", $id ) . \")\" );\n\n\t\t\twhile( $row = $result->fetch() )\n\t\t\t{\n\t\t\t\t$albums[$row['id']] = $row;\n\t\t\t}\n\n\t\t\tif( $sort === true ) $albums = $this->sortArrayFromArrayKeys( $id, $albums );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->db->query( \"SELECT * FROM \" . $this->table_prefix . \"_album WHERE id=\" . $id );\n\t\t\t$albums = $result->fetch();\n\t\t}\n\n\t\treturn $albums;\n\t}", "public function getAlbums($id = null, $params)\n {\n\t\t\n\t\t//Lets do a check to see if we have data. If not, then load albums.\n\t\t$sql = \"SELECT count(*) AS total FROM albums\";\n $result = $this->db->query($sql);\n $total = $result->fetch(PDO::FETCH_ASSOC);\n \n if($total['total'] == 0) {\n\t\t\t$this->loadAlbums();\n\t\t}\n \n $where = '';\n if($id !== null) {\n\t\t\t$where = 'WHERE album_id = '. $this->db->quote($id);\n\t\t}\n \n if(isset($params['order_col'])) {\n\t\t\tswitch($params['order_dir']) {\n\t\t\t\tcase 'asc':\n\t\t\t\tcase 'ascending':\n\t\t\t\t $direction = 'asc';\n\t\t\t\t break;\n\t\t\t\tcase 'desc':\n\t\t\t\tcase 'descending':\n\t\t\t\tdefault:\n\t\t\t\t $direction = 'desc';\n\t\t\t}\n\t\t\t\n\t\t\t$order = 'ORDER BY '. $this->db->quote($params['order_col']) . ' '. $direction;\n\t\t} else {\n\t\t\t$order = 'ORDER BY rank';\n\t\t}\n\t\t\n\t\tif(isset($params['limit'])) {\n\t\t\t$limit = 'LIMIT '. intval($params['limit']);\n\t\t} else {\n\t\t\t$limit = '';\n\t\t}\n\t\t$sql = \"SELECT * FROM albums {$where} {$order} {$limit}\";\n \n $result = $this->db->query($sql);\n \n $results = [];\n\n while ($row = $result->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t//Lets get album art.\n\t\t\t$row['art'] = $this->getAlbumArt($row['album_id']);\n\t\t\t\n\t\t\t//lets get category info as well\n\t\t\t$row['category'] = $this->getAlbumCategory($row['category_id']);\n\t\t\t\n $results[] = $row;\n }\n\n return $results;\n }", "public function getAlbumDataByAlbumId($albumId){\n $albums = DB::select('SELECT albums . * , users.username, COUNT( photos.photo_id ) AS album_photos_count\n FROM albums\n LEFT JOIN users ON albums.user_id = users.id\n LEFT JOIN photos ON albums.album_id = photos.album_id\n WHERE albums.album_id = ?\n GROUP BY albums.album_id', array($albumId));\n\n return $albums;\n }", "function getSongIDsFromArtistSong($conn, $artistID) {\n // used to index $idArray\n $resultCount = 0;\n // stores returned IDs from the query\n $idArray = array();\n \n $query = \"SELECT song_id FROM artist_song WHERE artist_id = ${artistID}\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = $row['song_id'];\n $resultCount++;\n }\n return $idArray;\n } else {\n return NULL;\n }\n }", "function lc_grab_ids_from_gallery()\n{\n global $post;\n\n if ($post instanceof WP_Post === false) {\n return array();\n }\n\n $pattern = get_shortcode_regex();\n $ids = array();\n\n if (preg_match_all('/' . $pattern . '/s', $post->post_content, $matches)) { //finds the \"gallery\" shortcode and puts the image ids in an associative array at $matches[3]\n\n $count = count($matches[3]); //in case there is more than one gallery in the post.\n for ($i = 0; $i < $count; $i++) {\n $atts = shortcode_parse_atts($matches[3][$i]);\n if (isset($atts['ids'])) {\n $ids = array_merge($ids, explode(',', $atts['ids']));\n }\n }\n }\n return $ids;\n}", "function getArtistIDsFromArtistSong($conn, $songID) {\n // used to index $idArray\n $resultCount = 0;\n // stores returned IDs from the query\n $idArray = array();\n \n $query = \"SELECT artist_id FROM artist_song WHERE song_id = ${songID}\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n while ($row = mysqli_fetch_assoc($result)) {\n $idArray[$resultCount] = $row['artist_id'];\n $resultCount++;\n }\n return $idArray;\n } else {\n return NULL;\n }\n }", "public function get_data_songs($album_id)\n {\n $data_songs = $this->db->where('album_id', $album_id)->get('audio_song')->result_array();\n\n return $data_songs;\n }", "public function getAlbum($id)\n {\n if (($id != '') && ctype_digit((string)$id)) {\n $query = 'SELECT albums.id, category_id, title, artist\n FROM albums \n LEFT JOIN categories \n ON categories.id = category_id \n WHERE albums.id= ?';\n return $this->_db->fetchAssoc($query, array((int)$id));\n } else {\n return array();\n }\n }", "private function extractIdsArray($data)\n {\n return array_pluck($data['photoset'], 'id');\n }", "public function getAlbums()\n {\n return $this->albums;\n }", "private function getAlbums($aData)\n {\n /**\n * @var string\n */\n $sAction = (isset($aData['sAction']) && $aData['sAction'] == 'new') ? 'new' : 'more';\n /**\n * @var int\n */\n $iLastTimeStamp = isset($aData['iLastTimeStamp']) ? (int) $aData['iLastTimeStamp'] : 0;\n /**\n * @var string\n */\n $sView = isset($aData['sView']) ? $aData['sView'] : '';\n /**\n * @var int\n */\n $iAmountOfAlbum = isset($aData['iAmountOfAlbum']) ? (int) $aData['iAmountOfAlbum'] : 10;\n /**\n * @var string\n */\n $sSearch = isset($aData['sSearch']) ? $aData['sSearch'] : '';\n /**\n * @var array\n */\n $aCond = array();\n\n if (!empty($sSearch))\n {\n $aCond[] = 'm.name LIKE \"' . Phpfox::getLib('parse.input')->clean('%' . $sSearch . '%') . '\"';\n }\n switch ($sView) {\n case 'my':\n $aCond[] = 'm.user_id = ' . Phpfox::getUserId();\n break;\n\n case 'all':\n default:\n $aCond[] = 'm.view_id = 0';\n $aCond[] = 'm.privacy IN(0)';\n break;\n }\n if ($iLastTimeStamp > 0)\n {\n if ($sAction == 'more')\n {\n $aCond[] = 'm.time_stamp < ' . $iLastTimeStamp;\n }\n else\n {\n $aCond[] = 'm.time_stamp > ' . $iLastTimeStamp;\n }\n }\n $this->database()\n ->select('COUNT(*)')\n ->from(Phpfox::getT('music_album'), 'm');\n /**\n * @var int\n */\n $iCount = $this->database()\n ->where(implode(' AND ', $aCond))\n ->limit(1)\n ->execute('getField');\n if ($iCount == 0)\n {\n return array();\n }\n /**\n * @var array\n */\n $aAlbums = $this->database()\n ->select('lik.like_id AS is_liked, m.*, u.user_id, u.profile_page_id, u.server_id AS user_server_id, u.user_name, u.full_name, u.gender, u.user_image, u.is_invisible, u.user_group_id, u.language_id')\n ->from(Phpfox::getT('music_album'), 'm')\n ->leftJoin(Phpfox::getT('like'), 'lik', 'lik.type_id = \\'music_album\\' AND lik.item_id = m.album_id AND lik.user_id = ' . Phpfox::getUserId())\n ->join(Phpfox::getT('user'), 'u', 'u.user_id = m.user_id')\n ->where(implode(' AND ', $aCond))\n ->order('m.time_stamp DESC')\n ->limit(0, $iAmountOfAlbum, $iCount)\n ->execute('getRows');\n /**\n * @var array\n */\n $aResult = array();\n foreach ($aAlbums as $aAlbum)\n {\n $aResult[] = array(\n 'bIsLiked' => isset($aAlbum['is_liked']) ? (bool) $aAlbum['is_liked'] : false,\n 'iAlbumId' => $aAlbum['album_id'],\n 'iViewId' => $aAlbum['view_id'],\n 'iPrivacy' => $aAlbum['privacy'],\n 'iPrivacyComment' => $aAlbum['privacy_comment'],\n 'bIsFeatured' => (bool) $aAlbum['is_featured'],\n 'bIsSponsor' => (bool) $aAlbum['is_sponsor'],\n 'iUserId' => $aAlbum['user_id'],\n 'sName' => $aAlbum['name'],\n 'iYear' => $aAlbum['year'],\n 'sImagePath' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['server_id'],\n 'path' => 'music.url_image',\n 'file' => $aAlbum['image_path'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'iTotalTrack' => $aAlbum['total_track'],\n 'iTotalPlay' => $aAlbum['total_play'],\n 'iTotalComment' => $aAlbum['total_comment'],\n 'iTotalLike' => $aAlbum['total_like'],\n 'iTotalDislike' => $aAlbum['total_dislike'],\n 'iTotalScore' => $aAlbum['total_score'],\n 'iTotalRating' => $aAlbum['total_rating'],\n 'iTimeStamp' => $aAlbum['time_stamp'],\n 'sTimeStamp' => date('l, F j', $aAlbum['time_stamp']),\n 'sFullTimeStamp' => date('l, F j', $aAlbum['time_stamp']) . ' at ' . date('g:i a', $aAlbum['time_stamp']),\n 'sModuleId' => isset($aAlbum['module_id']) ? $aAlbum['module_id'] : 0,\n 'iItemId' => $aAlbum['item_id'],\n 'iProfilePageId' => $aAlbum['profile_page_id'],\n 'iUserServerId' => $aAlbum['user_server_id'],\n 'sUsername' => $aAlbum['user_name'],\n 'sFullname' => $aAlbum['full_name'],\n 'iGender' => $aAlbum['gender'],\n 'sUserImage' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['user_server_id'],\n 'path' => 'core.url_user',\n 'file' => $aAlbum['user_image'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'bIsInvisible' => $aAlbum['is_invisible'],\n 'iUserGroupId' => $aAlbum['user_group_id'],\n 'iLanguageId' => isset($aAlbum['language_id']) ? $aAlbum['language_id'] : 0\n );\n }\n return $aResult;\n }", "public function getAllIds(): array;", "public function getAlbumById($album_id) {\n $query = \"SELECT\n al.id,\n al.name,\n al.year,\n al.version,\n al.location,\n al.sport,\n al.event_type,\n al.manufacturer,\n al.url\n FROM \" . $this->__schema . \".album al\n WHERE al.id = \" . $this->db()->quote($album_id);\n $data = $this->db()->getRow($query);\n if ($data) {\n return [\n 'success' => TRUE,\n 'payload' => $data,\n ];\n }\n else {\n return [\n 'success' => FALSE,\n 'payload' => NULL,\n ];\n }\n }", "function get_albums($mysqli, $albumIDs)\n{\n\t$keys = array(\n\t\t\"al.albumID\",\n\t\t\"al.album_code\",\n\t\t\"al.album_name\",\n\t\t\"ar.artist_name\",\n\t\t\"g.genre AS general_genre\",\n\t\t\"al.genre\",\n\t\t\"r.review\",\n\t\t\"u.preferred_name AS reviewer\"\n\t);\n\n\t$q = \"SELECT \" . implode(\",\", $keys) . \" FROM `libalbum` AS al \"\n\t\t. \"INNER JOIN `libartist` AS ar ON ar.artistID=al.artistID \"\n\t\t. \"INNER JOIN `def_general_genres` AS g ON g.general_genreID=al.general_genreID \"\n\t\t. \"INNER JOIN `libreview` AS r ON r.albumID=al.albumID \"\n\t\t. \"INNER JOIN `users` AS u ON u.username=r.username \"\n\t\t. \"WHERE al.albumID IN ('\" . implode(\"', '\", $albumIDs) . \"')\";\n\t$result = exec_query($mysqli, $q);\n\n\t$albums = array();\n\twhile ( ($a = $result->fetch_assoc()) ) {\n\t\t$q = \"SELECT disc_num, track_num, track_name, airabilityID FROM `libtrack` \"\n\t\t\t. \"WHERE albumID = '$a[albumID]';\";\n\t\t$result_tracks = exec_query($mysqli, $q);\n\n\t\t$a[\"tracks\"] = array();\n\t\twhile ( ($t = $result_tracks->fetch_assoc()) ) {\n\t\t\t$a[\"tracks\"][] = $t;\n\t\t}\n\n\t\t$albums[] = $a;\n\t}\n\n\treturn $albums;\n}", "public static function getAlbumsForDropdown()\n\t{\n\t\treturn BackendModel::getDB()->getPairs('SELECT i.id, d.title FROM pictures_albums AS i\n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN pictures_albums_data AS d ON d.album_id = i.id AND d.language = ?', BackendLanguage::getInterfaceLanguage());\n\t}", "public function testMediaFileIdGet()\n {\n $client = static::createClient();\n\n $path = '/media/file/{id}';\n $pattern = '{id}';\n $data = $this->genTestData('\\d+');\n $path = str_replace($pattern, $data, $path);\n\n $crawler = $client->request('GET', $path);\n }", "public function getAlbumToView($id)\n {\n if (($id != '') && ctype_digit((string)$id)) {\n $query = 'SELECT name, title, artist\n FROM albums, categories\n WHERE categories.id = category_id\n AND albums.id = ?';\n return $this->_db->fetchAssoc($query, array((int)$id));\n } else {\n return array();\n }\n }", "public function get_songs($limit = 0,$artist='')\n {\n $results = array();\n\n $sql = \"SELECT `song`.`id` FROM `song` \";\n if (AmpConfig::get('catalog_disable')) {\n $sql .= \"LEFT JOIN `catalog` ON `catalog`.`id` = `song`.`catalog` \";\n }\n $sql .= \"WHERE `song`.`album` = ? \";\n $params = array($this->id);\n if (strlen($artist)) {\n $sql .= \"AND `artist` = ? \";\n $params[] = $artist;\n }\n if (AmpConfig::get('catalog_disable')) {\n $sql .= \"AND `catalog`.`enabled` = '1' \";\n }\n $sql .= \"ORDER BY `song`.`track`, `song`.`title`\";\n if ($limit) {\n $sql .= \" LIMIT \" . intval($limit);\n }\n $db_results = Dba::read($sql, $params);\n\n while ($r = Dba::fetch_assoc($db_results)) {\n $results[] = $r['id'];\n }\n\n return $results;\n\n }", "public function getAlbumElements($id)\n {\n return false;\n }", "public function albumdelete($id) {\n $album = Album::findOrFail($id);\n $albumImages = $album->photos;\n $imageNames = array();\n foreach ($albumImages as $albumImage) {\n array_push($imageNames, 'public/images/'.$albumImage->photo);\n }\n return $imageNames;\n\n\n }", "public function getListItems()\n {\n return $this->getAlbums();\n }", "public function get_data_songs_epk($album_id){\n return $this->db->where('album_id', $album_id)\n ->order_by('id', 'DESC')\n ->get('audio_song')->result_array();\n }", "function getMediaByCampaignId ( $id )\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/campaigns/{$id}/media.json\");\n return $this->createResponse($result,'get MetaData','Campaign Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "function getUserAlbumPhotos($album_id=null,$profile_picture=false){\r\n\t\tif($album_id==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('photo_albums_id'=>$album_id));\r\n\t\tif($profile_picture==true)\r\n\t\t{\r\n\t\t\t$this->db->where(array('is_profile_picture'=>true));\t\t\r\n\t\t}\t\t\r\n\t\t$recordSet = $this->db->get(TBL_ALBUM_HAS_PHOTOS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "function bandcamp_album_id($url) {\n\n $content = file_get_contents($url, false, null, -1);\n\n if (preg_match('/<!-- album id ([0-9]*) -->/UimsS', $content, $match)) {\n\n if (isset($match[1])) {\n return $match[1];\n } else {\n return false;\n }\n\n } else {\n\n return false;\n\n }\n\n }", "public function setAlbumId(int $value): GetAllComments\n {\n $this->albumId = $value;\n return $this;\n }", "public function id($id)\n\t{\n\t\treturn $this->media($id);\n\t}", "function getPhotosOfMedia($idMedia){\r\n\t\t$tab = $this->dao->getPhotosOfMedia($idMedia);\r\n\t\tif($tab == null){\r\n\t\t\techo \"{\\\"message\\\":\\\"Pas de données\\\"}\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$json = $this->writePhotosJSON($tab);\r\n\t\techo $json;\r\n\t}", "public function getAlbumsForArtist($artist_id,$artist_role){\r\n\t\tif($artist_id){\r\n\t\t\t$container = new container_db_dto();\r\n\t\t\t\r\n\t\t\t$limit = (int)$this->messenger[\"query\"][\"limit\"];\r\n\t\t\t$start = (int)$this->messenger[\"query\"][\"start\"];\r\n\t\t\t$orderBy = \"\";\r\n\t\t\tif(\t$this->messenger['query']['sf'] != '' ){\r\n\t\t\t\t$orderBy = \" ORDER BY am.\".$this->messenger['query']['sf'].\" \".$this->messenger['query']['so'];\r\n\t\t\t}\r\n\t\t\t$where = ' where am.status = 1 and aa.artist_id = '.$artist_id;\r\n\t\t\tif($artist_role!=null && key_exists($artist_role,$this->aConfig['artist_type'])){\r\n\t\t\t\t$artist_role_id = $this->aConfig['artist_type'][$artist_role];\r\n\t\t\t\tif($artist_role_id)\r\n\t\t\t\t\t$where = $where.\" and aa.artist_role & \".$artist_role_id.\"=\".$artist_role_id;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$this->apply_where_criteria($where);\r\n\t\t\t$this->sSql = \"select count(aa.album_id) as cnt\r\n\t\t\t\t\t\tfrom artist_album aa left join album_mstr am on am.album_id=aa.album_id\r\n\t\t\t\t\t\tleft join language_mstr lm on lm.language_id=am.language_id \r\n\t\t\t\t\t\tLEFT JOIN label_mstr lb ON lb.label_id=am.label_id \r\n\t\t\t\t\t\t\".$where;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$res = $this->oMysqli->query($this->sSql);\r\n\t\t\tif($res!=-1 and sizeof($res)>0){\r\n\t\t\t\t$container->settotal_count($res[0]->cnt);\r\n\t\t\t\t$this->sSql = \"SELECT am.broadcast_year,am.content_type,am.film_rating,am.grade,lm.language_id,\r\n\t\t\t\t\t\tam.music_release_date,am.album_id,am.album_name,lm.language_name,am.music_release_date,am.title_release_date,am.album_image,\r\n\t\t\t\t\tam.album_type,lb.label_name @@@album_desc@@@ @@@album_excerpt@@@\r\n\t\t\t\t\tfrom artist_album aa left join album_mstr am on am.album_id=aa.album_id\r\n\t\t\t\t\t\tleft join language_mstr lm on lm.language_id=am.language_id \r\n\t\t\t\t\t\tLEFT JOIN label_mstr lb ON lb.label_id=am.label_id \r\n\t\t\t\t\t\t\".$where.\" \".$orderBy .\" LIMIT $start, $limit\";\r\n\t\t\t\t$this->apply_includes();\r\n\t\t\t\t$res = $this->oMysqli->query($this->sSql);\r\n\t\t\t\t$data = array();\r\n\t\t\t\t$album_ids_arr = array();\r\n\t\t\t\tif(sizeof($res)>0 && $res!=-1){\r\n\t\t\t\t\tforeach ($res as $resValue){\r\n\t\t\t\t\t\t$album = new album_db_dto();\r\n\t\t\t\t\t\t$album->setalbum_id($resValue->album_id);\r\n\t\t\t\t\t\t$album_ids_arr[] = $resValue->album_id;\r\n\t\t\t\t\t\t$album->setalbum_name($resValue->album_name);\r\n\t\t\t\t\t\t$album->setalbum_language($resValue->language_name);\r\n\t\t\t\t\t\t$album->setalbum_language_id($resValue->language_id);\r\n\t\t\t\t\t\t$album->setalbum_music_rel_dt($resValue->music_release_date);\r\n\t\t\t\t\t\t$album->setalbum_label($resValue->label_name);\r\n\t\t\t\t\t\t$album->setalbum_type($this->oCommon->getalbumtype($resValue->album_type));\r\n\t\t\t\t\t\t$album->setalbum_title_rel_dt($resValue->title_release_date);\r\n\t\t\t\t\t\t$album->setalbum_df_image($resValue->album_image);\r\n\t\t\t\t\t\t$album->setalbum_broadcast_year($resValue->broadcast_year);\r\n\t\t\t\t\t\t$album->setalbum_content_type($this->oCommon->getalbumcontenttype($resValue->content_type));\r\n\t\t\t\t\t\t$album->setalbum_film_rating($resValue->film_rating);\r\n\t\t\t\t\t\t$album->setalbum_grade($resValue->grade);\r\n\t\t\t\t\t\tif(in_array(\"album_description\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t\t$album->setalbum_description($resValue->album_desc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(in_array(\"album_excerpt\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t\t$album->setalbum_excerpt($resValue->album_excerpt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$data[]=$album;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$artist_album_map=array();\r\n\t\t\t\t\t$artist_album_map = $this->oCommon->getArtistForAlbum($album_ids_arr);\r\n\t\t\t\t\t$album_tag_map = array();\r\n\t\t\t\t\tif(in_array(\"album_tags\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t$album_tag_map = $this->oCommon->getAlbumTags($album_ids_arr);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\tforeach($data as $album){\r\n\t\t\t\t\t\t$id = $album->getalbum_id();\r\n\t\t\t\t\t\tif(key_exists($id,$artist_album_map))\r\n\t\t\t\t\t\t\t$album->setalbum_artist($artist_album_map[$id]);\r\n\t\t\t\t\t\tif(key_exists($id,$album_tag_map))\r\n\t\t\t\t\t\t\t$album->setalbum_tags($album_tag_map[$id]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$container->setdata($data);\r\n\t\t\t\t\r\n\t\t\t\treturn $container->to_array();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public function gallery($album_id=\"\")\n {\n $lang = $this->data['lang'];\n $user_id = $this->user_id;\n\n $this->data['page'] = 'gallery' ;\n\n $where['album_id'] = $album_id;\n $this->data['gallery'] = $this->home_m->get_data('gallery',$where)->result_array();\n\n $body = 'gallery' ;\n\n $this->load_pages($body,$this->data);\n }", "public function getId($album = NULL)\n {\n if(is_null($album))\n {\n //Si cargue todos los albums\n if(is_null($this->album_loaded))\n {\n if(array_key_exists(mdMedia::$default, $this->hashMap))\n {\n return $this->albums[$this->hashMap[mdMedia::$default]]->id;\n }\n else\n {\n throw new Exception('The album ' . mdMedia::$default . ' is not loaded', 102);\n }\n }\n //Si cargue un album en particular\n else\n {\n return $this->albums[$this->hashMap[$this->album_loaded]]->id;\n }\n }\n else\n {\n if(array_key_exists($album, $this->hashMap))\n {\n return $this->albums[$this->hashMap[$album]]->id;\n }\n else\n {\n throw new Exception('The album ' . $album . ' is not loaded', 102);\n }\n }\n }", "public function getMediaFolder($id){\n return MediaFolder::find($id);\n\t\t\n }", "function getAlbumImages($args)\n{\n global $_zp_current_image;\n if (is_object($login_state = authorize($args))) {\n return $login_state;\n }\n $args = decode64($args);\n logger('getAlbumImages', ($args['loglevel']));\n $albumobject = getItemByID('albums', $args['id']);\n $images = $albumobject->getImages();\n if (!($albumobject || !$args['id'])) {\n return new ZEN_Error(-1, 'No folder with database ID '.$args['id'].' found!');\n }\n makeAlbumCurrent($albumobject);\n $list = [];\n while (next_image(true)) {\n $meta = $_zp_current_image->getmetadata();\n if ($meta['EXIFDateTimeOriginal']) {\n $imagedate = $meta['EXIFDateTimeOriginal'];\n } else {\n $imagedate = false;\n }\n $list[] = entitysave([\n 'id' => $_zp_current_image->getID(),\n 'albumid' => $_zp_current_image->getAlbum()->getID(),\n 'name' => $_zp_current_image->filename,\n 'shortdate' => date('Y-m-d', (strtotime(str_replace(' ', '', (str_replace(':', '', $imagedate)))))),\n 'longdate' => $imagedate,\n 'url' => WEBPATH.'index.php?album='.urlencode($_zp_current_image->album->name).'&image='.urlencode($_zp_current_image->filename),\n 'folder' => $_zp_current_image->getAlbum()->getFolder(),\n // added by monta\n 'thumbnail' => $_zp_current_image->getThumbImageFile(),\n 'description' => $_zp_current_image->getDesc(),\n 'commentcount' => count($_zp_current_image->getComments()),\n ]);\n } //next_image( true )\n //writelog((var_export($list, true)));\n return $list;\n}", "public function getMediaFolders(){\n return MediaFolder::all();\n\t\t\n }", "function retrieveImageIds($folderId, $apiKey){\n $fileArray = retrieveFilesArray($folderId, $apiKey);\n $filteredFileArray = orderImagesByTime(filterByMimeType($fileArray, \"image/\"));\n return getfileIds($filteredFileArray);\n}", "function showAllAlbum() {\n $sql = \"SELECT * FROM `itf_album`\";\n return $this->dbcon->FetchAllResults($sql);\n }", "private function loadItems($album, $page, $limit)\n {\n $contentIds = array();\n $array_contents = array_chunk($this->albums[$this->hashMap[$album]]->contentIds, $limit);\n\n if(array_key_exists(($page-1), $array_contents))\n {\n $contentIds = $array_contents[$page-1];\n }\n else\n {\n return $contentIds;\n }\n\n $itemsOrdered = MdMediaAlbum::retrieveItems($contentIds, $this->key);\n\n switch ($this->filter){\n case mdMediaManager::MD_FILTER_PRIORITY:\n usort($itemsOrdered, \"cmpMdMediaContentPriority\");\n break;\n case mdMediaManager::MD_FILTER_ID:\n usort($itemsOrdered, \"cmpMdMediaContentId\");\n break;\n }\n\n return $itemsOrdered;\n }", "function get_songs() { \n\n\t\t$results = array();\n\n\t\t$sql = \"SELECT * FROM `playlist_data` WHERE `playlist`='\" . Dba::escape($this->id) . \"' ORDER BY `track`\";\n\t\t$db_results = Dba::query($sql);\n\n\t\twhile ($r = Dba::fetch_assoc($db_results)) { \n\t\t\tif ($r['dyn_song']) { \n\t\t\t\t$array = $this->get_dyn_songs($r['dyn_song']);\n\t\t\t\t$results = array_merge($array,$results);\n\t\t\t}\n\t\t\telse { \n\t\t\t\t$results[] = $r['object_id'];\n\t\t\t} \n\n\t\t} // end while\n\n\t\treturn $results;\n\n\t}", "public function getItemIds();", "public function album ($album_id = '')\n {\n if (preg_match('#^http#iu', $album_id)) {\n $album_id = parse_url ($album_id, PHP_URL_PATH);\n $album_id = trim ($album_id, '/');\n\n if (preg_match ('#album\\/([a-z0-9]+)\\/?#iu', $album_id, $parts)) {\n $album_id = $parts[1];\n }\n }\n\n $url = sprintf (Request::ALBUMS_URL, $album_id);\n\n $this->_request($url, CurlClient::GET);\n\n if ( ! $this->_raw_output) {\n $this->_populate_album ($this->_body);\n }\n\n return $this->_body;\n }", "function getMediaData($storyid){\r\n\r\n\t\t\t$result\t= array();\r\n\r\n\t\t\t$res \t= array();\r\n\r\n\t\t\t$ci \t= & get_instance();\r\n\r\n\t\t\t$ci->db->select('images, videos, audios, attachments, demovideos, demoaudios, demoattachments');\r\n\r\n\t\t\t$ci->db->where_in('story_id',$storyid);\r\n\r\n\t\t\t$query = $ci->db->get('buzz_media_master');\r\n\r\n\t\t\t$res \t= $query->result_array();\r\n\r\n\t\t\tif(count($res)>0){\r\n\r\n\t\t\t\t$result = $res[0];\r\n\r\n\t\t\t}\r\n\r\n\t\t\t//echo $ci->db->last_query();exit;\r\n\r\n\t\t\treturn $result; \r\n\r\n\t\t}", "public function getAllThePhotosAccordingTolAlbum($offset,$photo_per_page,$albumId){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myQuery=\"SELECT photo FROM photo WHERE album_id='\".$albumId.\"' LIMIT $offset,$photo_per_page\";\n\t\t\t $result=$conn->query($myQuery);\n\t\t\t foreach($result as $image){\n\t\t\t\t array_push($this->photos,$image['photo']);\n\t\t\t }\n\t\t\t $conn=null;\n\t\t\t return $this->photos;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "function listAlbums($parameter)\n\t\t{\n\t\t\t//$parameter = substr($parameter, 0,strpos($parameter, 'count'));\n\t\t\t//$parameter = substr($parameter, strrpos($parameter, 'genres 0 '));\n\t\t\t$tabParameter = split(\" id:\", $parameter);\n\t\t\t//print_r($tabParameter);\n\t\t\t$i = 2;\n\t\t\t$len = count($tabParameter);\n\t\t\t//print_r($tabParameter);\n\n\t\t\tforeach ($tabParameter as $key => $value) \n\t\t\t{\n\t\t\t\tif ($key > 0 && $i < $len ) \n\t\t\t\t{\n\t\t\t\t\t//$id = get_string_between($value,\"id:\",\" artwork_track_id\");\n\t\t\t\t\t$id = substr($value, 0,strpos($value, \" \"));\n\t\t\t\t\t$artwork = get_string_between($value,\"artwork_track_id:\",\" title:\");\n\t\t\t\t\t$title = substr($value,strpos($value, \"title:\"));\n\t\t\t\t\t//echo \"contenu de title: $title\";\n\t\t\t\t\t//$title = substr_replace($title, '', strpos($title, ' count:'));\n\t\t\t\t\t//echo \"titre après replace: $title\";\n\t\t\t\t\t//$title = substr_replace($value, '', strpos($value, \"count\"));\n\t\t\t\t\t\n\n\n\t\t\t\t//list($id,$genre)=explode(\" genre:\", $tabParameter[$key]);\n\t\t\t\t\techo \"<li id=\\\"$title$id\\\">$title</li>\";\n\t\t\t\t\techo \"<img id=\\\"$artwork\\\" src=\\\"http://\".$_SESSION['LMS']['server'].\":9000/music/$artwork/cover_96x96_p.png\\\"/>\";\n\t\t\t\t\t$i++;\n\t\t\t\t\t//echo \"i et len : $i $len\";\n\t\t\t\t}\n\n\t\t\t\telseif ($i == $len)\n\t\t\t\t {\n\t\t\t\t\t//$id = get_string_between($value,\"id:\",\" artwork_track_id\");\n\t\t\t\t\t$id = substr($value, 0,strpos($value, \" \"));\n\t\t\t\t\t$artwork = get_string_between($value,\"artwork_track_id:\",\" title:\");\n\t\t\t\t\t$title = substr($value,strpos($value, \"title:\"));\n\t\t\t\t\t\n\t\t\t\t\t//echo \"contenu de title: $title\";\n\n\n\t\t\t\t//list($id,$genre)=explode(\" genre:\", $tabParameter[$key]);\n\t\t\t\t\techo \"<li class=\\\"album\\\" id=\\\"$title|$id\\\">$title</li>\";\n\t\t\t\t\techo \"<img class=\\\"album\\\" id=\\\"$artwork\\\" src=\\\"http://\".$_SESSION['LMS']['server'].\":9000/music/$artwork/cover_96x96_p.png\\\"/>\";\n\t\t\t\t\t$i++;\n\t\t\t\t }\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "function getPictures($fb, $ids) {\n $fql = \"SELECT uid, pic_square FROM user WHERE uid IN (\" . implode(\",\", $ids) . \")\";\n \n $response = $fb->api(array(\n 'method' => 'fql.query',\n 'query' => $fql,\n ));\n \n $picture_by_id = array();\n foreach ($response as $r) {\n $picture_by_id[$r['uid']] = $r['pic_square'];\n }\n \n return $picture_by_id;\n}", "public function getIdArray()\n {\n $idArray = array();\n\n foreach ($this as $importedVideo) {\n $idArray[] = $importedVideo->id;\n }\n\n return $idArray;\n }", "function getMediaById ( $id )\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/media/{$id}.json\");\n return $this->createResponse($result,'get MetaData','Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "function getAlbums() {\n\n $ro = new GetAlbumsRO();\n $files = glob('Pics/*');\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $onefile = $files[$i];\n $imgs_in_album = glob(\"$onefile/*.[jJ][pP][gG]\");\n if (count($imgs_in_album) > 0)\n $album_image = $imgs_in_album[0];\n else\n $album_image = \"res/GenericAlbum.jpg\";\n $album_name = basename($onefile);\n\n $oneAlbum = new AlbumInfo($album_name, $album_image);\n array_push($ro->albums, $oneAlbum);\n }\n\n return $ro;\n}", "public function getPlaysIds(): array\n {\n return $this->playsIds;\n }", "public static function getSongs()\n {\n $songs = Song::with('album:id,name')->get();\n return $songs;\n }", "private function get_fileids($cmid) {\n global $DB;\n $googledriverepo = $DB->get_record('repository', array ('type' => 'googledrive'), 'id');\n $id = $googledriverepo->id;\n if (empty($id)) {\n debugging('Could not find any instance of the repository');\n return false;\n }\n\n $sql = \"SELECT DISTINCT r.reference\n FROM {files_reference} r\n LEFT JOIN {files} f\n ON r.id = f.referencefileid\n LEFT JOIN {context} c\n ON f.contextid = c.id\n LEFT JOIN {course_modules} cm\n ON c.instanceid = cm.id\n WHERE cm.id = :cmid\n AND r.repositoryid = :repoid\n AND f.referencefileid IS NOT NULL\n AND NOT (f.component = :component1 AND f.component = :component2 AND f.filearea = :filearea)\";\n\n $filerecords = $DB->get_records_sql($sql,\n array('component1' => 'user', 'component2' => 'tool_recyclebin', 'filearea' => 'draft', 'repoid' => $id, 'cmid' => $cmid));\n\n if ($filerecords) {\n $fileids = array();\n foreach ($filerecords as $filerecord) {\n $fileids[] = $filerecord->reference;\n }\n return $fileids;\n }\n\n return false;\n }", "public function getAlbum($id)\n {\n $key = md5($id);\n if($this->cache->hasItem($key)){\n return unserialize($this->cache->getItem($key));\n }\n\n $results = $this->realSpotifyApi->getAlbum($id);\n\n $this->cache->setItem($key, serialize($results));\n return $results;\n }", "public function getImagesId()\n {\n $ids = array();\n foreach ($this->images as $image) {\n $ids[] = $image->getId();\n }\n return $ids;\n }", "public function getFeedRedirectAlbum($iId)\n\t{\n /**\n * @var array\n */\n\t\t$aRow = $this->database()->select('m.album_id, name')\n\t\t\t->from(Phpfox::getT('music_album'), 'm')\n\t\t\t->where('m.album_id = ' . (int) $iId)\n\t\t\t->execute('getSlaveRow');\n\t\tif (!isset($aRow['album_id']))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn array(\n 'sModule' => 'music.album',\n 'iAlbumId' => $aRow['album_id'],\n 'sTitle' => $aRow['name'],\n 'sCommentType' => 'music_album'\n );\n\t}", "public function nestedListAction($mediaAlbum = 0)\n {\n $mediaAlbums = null;\n $mediaAlbum = (int)$mediaAlbum ?: null;\n $showBackLink = true;\n\n $this->setAlbumUidRestrictions();\n\n // Single view\n if ($mediaAlbum) {\n /** @var MediaAlbum $mediaAlbum */\n $mediaAlbum = $this->mediaAlbumRepository->findByUid($mediaAlbum);\n if (!$mediaAlbum) {\n $this->pageNotFound(LocalizationUtility::translate('no_album_found', $this->extensionName));\n }\n }\n\n /**\n * No album selected and album restriction set, find all \"root\" albums\n * Albums without parent or with parent not selected as allowed\n */\n if ($mediaAlbum === null && $this->mediaAlbumRepository->getAlbumUids() !== []) {\n $mediaAlbums = [];\n $all = $this->mediaAlbumRepository->findAll((bool)$this->settings['list']['hideEmptyAlbums'], $this->settings['list']['orderBy'], $this->settings['list']['orderDirection']);\n /** @var MediaAlbum $album */\n foreach ($all as $album) {\n $parent = $album->getParentalbum();\n if ($parent === null\n || (!$this->mediaAlbumRepository->getUseAlbumUidsAsExclude() && !in_array($parent->getUid(),\n $this->mediaAlbumRepository->getAlbumUids()))\n || ($this->mediaAlbumRepository->getUseAlbumUidsAsExclude() && in_array($parent->getUid(),\n $this->mediaAlbumRepository->getAlbumUids()))\n ) {\n $mediaAlbums[] = $album;\n }\n }\n } else {\n $mediaAlbums = $this->mediaAlbumRepository->findByParentalbum($mediaAlbum,\n $this->settings['list']['hideEmptyAlbums'], $this->settings['list']['orderBy'],\n $this->settings['list']['orderDirection']);\n }\n\n // when only 1 album skip gallery view\n if ($mediaAlbum === null && !empty($this->settings['list']['skipListWhenOnlyOneAlbum']) && count($mediaAlbums) === 1) {\n $mediaAlbum = $mediaAlbums[0];\n $mediaAlbums = $this->mediaAlbumRepository->findByParentalbum($mediaAlbum,\n $this->settings['list']['hideEmptyAlbums'], $this->settings['list']['orderBy'],\n $this->settings['list']['orderDirection']);\n $showBackLink = false;\n }\n\n if ($mediaAlbum && $mediaAlbum->getParentalbum() && (\n $this->mediaAlbumRepository->getAlbumUids() === []\n ||\n (!$this->mediaAlbumRepository->getUseAlbumUidsAsExclude() && in_array($mediaAlbum->getParentalbum()->getUid(),\n $this->mediaAlbumRepository->getAlbumUids()))\n ||\n ($this->mediaAlbumRepository->getUseAlbumUidsAsExclude() && !in_array($mediaAlbum->getParentalbum()->getUid(),\n $this->mediaAlbumRepository->getAlbumUids()))\n )\n ) {\n $this->view->assign('parentAlbum', $mediaAlbum->getParentalbum());\n }\n\n $this->view->assign('showBackLink', $showBackLink);\n $this->view->assign('mediaAlbums', $mediaAlbums);\n $this->view->assign('mediaAlbum', $mediaAlbum);\n }", "function get_video_id_list($section_id, $content_id) {\n\n global $data_base;\n\n $request = $data_base->prepare(\"\n SELECT *\n FROM imago_info_video \n WHERE section_id = ?\n AND content_id = ? \n \");\n\n $request->execute(array($section_id, $content_id));\n\n return $request->fetchAll(PDO::FETCH_ASSOC);\n }", "public function moreFromAlbum($album_id)\n {\n return SongResource::collection(\\App\\Album::find($album_id)->songs()->orderBy('created_at')->get());\n }", "function getSubAlbums($album)\n{\n $list = [];\n $albumObj = new Album($album);\n $albumID = $albumObj->getID();\n $parentID = getItemByID('albums', $albumID);\n if ($albumObj->isDynamic() || !$albumID) {\n return $list;\n }\n $subalbums = $albumObj->getAlbums(null, null, null, null, true);\n $subalbums = $parentID->getAlbums(null, null, null, null, true);\n if (is_array($subalbums)) {\n foreach ($subalbums as $subalbum) {\n $list[] = $subalbum;\n $list = array_merge($list, getSubAlbums($subalbum));\n } //$subalbums as $subalbum\n } //is_array($subalbums)\n return $list;\n}", "function getMediaByTagId ( $id )\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/tags/{$id}/media.json\");\n return $this->createResponse($result,'get MetaData','Tag Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "function getMedias($idGroup){\r\n\t\t$data = $this->dao->getByGroup($idGroup);\r\n\t\t$photos = $data->getInfo(\"photos\");\r\n\r\n\t\t$dates = \"\";\r\n\t\t$startDate = null;\r\n\t\t$first = true;\r\n\t\t$lgDate = 10;\t// On renvoie les dates au format heure\r\n\t\tif($idGroup!=null && $idGroup!=33){\r\n\t\t\t$lgDate = 19;\r\n\t\t}\r\n\t\tforeach($photos as $p){\r\n\t\t\tif($startDate == null || $this->compareDate($startDate,$p->getInfo(\"date\"))){\r\n\t\t\t\t$startDate = $p->getInfo(\"date\");\r\n\t\t\t}\r\n\t\t\t$dates.=(($first!=true)?\",\":\"\") . sprintf(\"{\\\"startDate\\\":\\\"%s\\\",\\\"endDate\\\":\\\"%s\\\",\\\"headline\\\":\\\"%s\\\",\\\"data\\\":\\\"%s\\\",\\\"isTimeline\\\":\\\"%s\\\"}\",\r\n\t\t\t\t$this->formatTMDate($p->getInfo(\"date\"),$lgDate),$this->formatTMDate($p->getInfo(\"date\"),$lgDate),$p->getInfo(\"name\"),$p->getInfo(\"id\"),\r\n\t\t\t\t($p->getInfo(\"timeline\")!=null)?$p->getInfo(\"timeline\"):\"false\");\r\n\t\t\t$first = false;\r\n\t\t}\r\n\t\t\r\n\t\t$json = sprintf(\"{\\\"timeline\\\":{\\\"type\\\":\\\"default\\\",\\\"title\\\":\\\"%s\\\",\\\"folder\\\":\\\"%s\\\",\\\"headline\\\":\\\" \\\",\\\"text\\\":\\\"\\\",\\\"startDate\\\":\\\"%s\\\",\\\"date\\\":[%s]}}\",\r\n\t\t\t$data->getInfo(\"titre\"),$data->getInfo(\"folder\"),$this->formatTMDate($startDate,$lgDate),$dates);\r\n\t\techo $json;\r\n\t}" ]
[ "0.68725383", "0.66453755", "0.66122794", "0.65980357", "0.6502136", "0.64452106", "0.6408033", "0.63810414", "0.6371872", "0.62860227", "0.62450606", "0.6176374", "0.61749524", "0.61286473", "0.6114676", "0.61142856", "0.6093773", "0.6084627", "0.605648", "0.60428625", "0.60188097", "0.599259", "0.59888124", "0.5961942", "0.59240234", "0.59232473", "0.5916365", "0.5896602", "0.5853995", "0.58374953", "0.58054423", "0.57746667", "0.57553047", "0.5747226", "0.5698198", "0.56933796", "0.5691338", "0.5691338", "0.5688766", "0.5684181", "0.5674835", "0.5661198", "0.5657497", "0.5656008", "0.56556076", "0.56523883", "0.56507516", "0.5642932", "0.56352085", "0.5630669", "0.5625322", "0.5613171", "0.5611386", "0.5607861", "0.56038177", "0.5601547", "0.55850655", "0.5547707", "0.55457765", "0.5542839", "0.5530327", "0.55280524", "0.55029064", "0.549876", "0.54910517", "0.5481239", "0.5472958", "0.54603946", "0.5442546", "0.54386985", "0.54326504", "0.54284203", "0.54215705", "0.5417611", "0.5404473", "0.5397914", "0.5391683", "0.5378353", "0.53780043", "0.53538597", "0.53449756", "0.5342545", "0.53410244", "0.5332288", "0.53277135", "0.5323493", "0.5315868", "0.5310369", "0.5291415", "0.5283069", "0.52798826", "0.5271168", "0.5258863", "0.52548134", "0.52530473", "0.52484626", "0.5247988", "0.52297074", "0.5219621", "0.52184606" ]
0.78352004
0
Gets the average rating based on the sum and count stored.
public function getRatingAverage($sum, $count, $round = false) { if ($count == 0) { return 0; } $average = $sum / $count; if ($round) { $average = round($average / 0.5, 0) * 0.5; } return $average; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAvgRating(){\n if($this->ratings){\n return $this->ratings->avg('rating');\n }\n }", "public function computeAvgRating()\n {\n return Doctrine_Query::create()\n ->select('AVG(value) as avg_val')\n ->from('Rate')\n ->where('record_model = ? AND record_id = ?', array(\n $this->getModel(),\n $this->getItemId(),\n ))\n ->fetchOne()\n ->avg_val;\n }", "public function average(){\n $i = 0;\n $total = 0;\n for($i = 0; $i < count($this->collection); $i++){\n $total += $this->collection[$i]->amount;\n }\n if($i == 0)\n return 3;\n return (int)round($total/$i);\n }", "public function averageRating() : float\n {\n return $this->ratings()->exists() ? $this->ratings()->avg('rating') : 0;\n }", "public function averageRate()\n {\n $movie = $this->getKey();\n return DB::table('movies_reviews')\n ->where('movies_id', '=', $movie)\n ->average('rate');\n }", "public function averageRating()\n {\n $total = 0;\n $average = null;\n\n foreach ($this->notes as $n) {\n $total += $n->note;\n }\n\n $nbNotes = $this->notes->count();\n if ($total > 0 && $nbNotes > 0) {\n $average = $total / $nbNotes;\n }\n\n return $average;\n }", "public function fetchAvgRating()\n {\n return number_format($this->ratings()->avg('rating'), 1);\n }", "public function getAvgRating()\n {\n $sum =0;\n foreach($this->comments as $comment)\n {\n $sum = $sum + $comment->getRating() ;\n }\n\n if(count($this->comments)) return $sum/count($this->comments);\n\n return 0 ;\n }", "public function average()\n {\n return $this->getSum() / count($this->values);\n }", "public function average(): float\n {\n return $this->sum() / $this->count();\n }", "public function rating()\n {\n $rating = Review::where('product_id', $this->id)->avg('rating');\n if ($rating) {\n $rating = (float)$rating;\n $rating = round($rating, 2);\n } else {\n $rating = 0;\n }\n return $rating;\n }", "public function getAggregateRating()\n {\n $collection = Mage::getModel('rating/rating_option_vote')\n ->getResourceCollection()\n ->setEntityPkFilter($this->getProduct()->getId())\n ->setStoreFilter(Mage::app()->getStore()->getId());\n return $this->getAverageRatingByCollection($collection);\n }", "public function getAvgRate()\n {\n $avg = 0;\n $nb = 0;\n if (!empty($this->getRates())) {\n foreach($this->getRates() as $rate) {\n $avg += $rate->getNbStar();\n $nb++;\n }\n $avg /= $nb;\n }\n return $avg;\n }", "function average() {\n $total = 0;\n foreach ($this->grades as $value) // goes through grades using foreach\n $total += $value;\n return $total / count($this->grades);\n }", "public function getAverageRating($rid){\n $comments = $this->getAllComments($rid);\n $sum = 0;\n if(sizeof($comments)!=0){\n foreach($comments as $comment){\n $sum += $comment->rating;\n }\n return $sum/sizeof($comments);\n } else {\n return $sum;\n }\n }", "public function getCustomRatingAttribute(){\n return $this->reviews->avg('rating');\n }", "public function evalAvg()\n {\n $users = User::students()->get();\n $marks = [];\n foreach ( $users as $user )\n {\n if ($this->evalGradeExists($user))\n {\n array_push($marks,$this->userPercentage($user));\n }\n }\n $count = count($marks); //total numbers in array\n $total = 0;\n foreach ($marks as $mark) {\n $total += $mark; // total value of array numbers\n }\n $average = ($total/$count); // get average value\n return round($average,2);\n\n }", "public function calculateAverageRating($data)\n {\n return ($data['product_rating'] + $data['operator_rating']\n + $data['marker_rating'] + $data['reliability_rating']) / 4;\n }", "function bbconnect_kpi_calculate_average($count, $amount) {\n return $count > 0 ? $amount/$count : 0;\n}", "public function getavgstarratebyproductid($productID){\n\t\t$count5star=0;\n\t\t$count4star=0;\n\t\t$count3star=0;\n\t\t$count2star=0;\n\t\t$count1star=0;\n\t\t$this->db->where('ProductId', $productID);\n\t\t$this->db->select('Rate');\n\t\t$this->db->from('tbl_review');\n\t\t$query=$this->db->get();\n\n\t\tforeach ($query->result() as $key) {\n\t\t\tswitch ($key->Rate) {\n\t\t\t\tcase '5':\n\t\t\t\t$count5star++;\n\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t$count4star++;\n\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t$count3star++;\n\t\t\t\tbreak;\n\t\t\t\tcase '2':\n\t\t\t\t$count2star++;\n\t\t\t\tbreak;\n\t\t\t\tcase '1':\n\t\t\t\t$count1star++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$totalstar=$count5star+$count4star+$count3star+$count2star+$count1star;\n\t\t$totalpoint=($count5star*5)+($count4star*4)+($count3star*3)+($count2star*2)+($count1star*1);\n\t\tif($totalstar!=0)\n\t\t\t$percent=$totalpoint/$totalstar;\n\t\telse\n\t\t\t$percent=0;\n\t\techo number_format($percent,1);\n\t}", "protected function getCriterionsAverageScore(\\SimpleXMLElement $rating)\n {\n $criterions = array('criterion1', 'criterion2', 'criterion3', 'criterion4', 'criterion5', 'criterion6');\n $sum = 0;\n $divider = 0;\n foreach ($criterions as $criterion) {\n $criterionValue = (float) $rating->$criterion;\n if ($criterionValue > 0) {\n ++$divider;\n $sum += $criterionValue;\n }\n }\n $divider = (0 == $divider) ? count($criterions) : $divider;\n\n return $sum / $divider;\n }", "public function getAverageRatingAttribute() : float\n {\n return $this->averageRating();\n }", "public function getAvg(): float\n {\n return $this->avg;\n }", "public function getAverageReviews()\n {\n /* code goes here */\n }", "public function getAverageRating($visual, $rating)\n {\n Redis::hset('visual.' . $visual, 'user.' . auth()->id(), $rating);\n $ratings = collect(Redis::hvals('visual.' . $visual))->avg();\n\n return Redis::zadd('visuals-rating', $ratings, $visual);\n }", "public function sumRating() : float\n {\n return $this->ratings()->sum('rating');\n }", "public function calculateStarRating($ratings)\n {\n // $array = [$ratings->quality, $ratings->price, $ratings->value];\n //Calculate the average.\n return round(array_sum($ratings) / count($ratings), 2);\n }", "function get_average_rating($product_id)\r\n\t{\r\n\t\t$product_id_as_int = (int)$product_id;\r\n\t\t\r\n\t\treturn ceil($this->_db->get_first_cell('SELECT AVG(rating) FROM product_review WHERE product_id = ' . $product_id_as_int));\r\n\t}", "public function studentAverageCalculation($sum_total, $no_of_items){\n\t\t\t$average=$sum_total/$no_of_items;\n\t\t\treturn $average;\n\t\t}", "public function averageRatingAsPercentage() : float\n {\n $range = config('rateable.minimum') > 0 ? config('rateable.maximum') - config('rateable.minimum') : config('rateable.maximum');\n return ($this->ratings()->count() * $range) != 0 ? $this->sumRating() / ($this->ratings()->count() * $range) * 100 : 0;\n }", "public function averageUserRatings($params = array()) {\n\n $averageUserRatings = $this->select()\n ->from($this->info('name'), array('AVG(rating) AS avg_rating'))\n ->where(\"event_id = ?\", $params['event_id'])\n ->where(\"user_id = ?\", $params['user_id'])\n ->query()\n ->fetchColumn();\n return $averageUserRatings;\n }", "public function _getAverageScore() {\n\t\treturn $this->_averageScore;\n\t}", "public function getAverage(): float\n {\n return $this->average;\n }", "public function getAverageShopRating($userId)\n {\n $verifiedUserIds = UserEntity::find()->select('id')->where(['status' => UserEntity::STATUS_VERIFIED]);\n $reviews = ShopFeedbackEntity::find()->where(['shop_id' => $userId, 'created_by' => $verifiedUserIds])->all();\n\n $count = 0;\n if ($reviews) {\n $sumProductRating = 0; $sumReliabilityRating = 0;\n $sumOperatorRating = 0; $sumMarkerRating = 0; $sumAverageRating = 0;\n\n /** @var $item ShopFeedbackEntity.php */\n foreach ($reviews as $item) {\n $count++;\n $sumProductRating += $item->product_rating;\n $sumReliabilityRating += $item->reliability_rating;\n $sumOperatorRating += $item->operator_rating;\n $sumMarkerRating += $item->marker_rating;\n $sumAverageRating += $item->average_rating;\n }\n\n return [\n 'average_product_rating' => round($sumProductRating / $count, 1),\n 'average_reliability_rating' => round($sumReliabilityRating / $count, 1),\n 'average_operator_rating' => round($sumOperatorRating / $count, 1),\n 'average_marker_rating' => round($sumMarkerRating / $count, 1),\n 'average_rating' => round($sumAverageRating / $count, 1)\n ];\n }\n return false;\n }", "public function mean() {\n $count = count($this->value);\n $sum = array_sum($this->value);\n return ((float) $sum) / $count;\n }", "public function getAverage()\n {\n $total = 0;\n $nb = 0;\n foreach ($this->evaluationSessions as $evaluationSession) {\n if ($evaluationSession->getStatus() === Status::CLOSED) {\n $total += $evaluationSession->getGlobalScore();\n $nb++;\n }\n }\n if ($nb > 0) {\n return floatval($total / $nb);\n }\n return -1;\n }", "public function getCompanyAverageRatings($ratings){\n\n\t\t$total=count($ratings);\n\t\t$culture=$management=$work_live_balance=$career_development=0;\n\n\t\tforeach($ratings as $rating){\n\t\t\t$culture += $rating['culture'];\n\t\t $management += $rating['management'];\n\t\t\t$work_live_balance += $rating['work_live_balance'];\n\t\t\t$career_development += $rating['career_development'];\t\n\t\t}\t\n\t\t\n\t\t$avgCulture = $culture/$total;\n\t\t$avgManagement = $management/$total;\n\t\t$avgWork_live = $work_live_balance/$total;\n\t\t$avgCareer_dev = $career_development/$total;\n\n\t\treturn array('culture'=>$avgCulture, 'management'=>$avgManagement, 'work_live_balance'=>$avgWork_live, 'career_development'=>$avgCareer_dev);\n\t}", "public function getAverageAndNumberRatings (): array\n {\n /**\n * Hier verwenden wir $this->_buffer, damit der nachfolgende MySQL Query nicht jedes mal aufgerufen werden muss,\n * sondern wir das Ergebnis zwischenspeichern.\n */\n if (empty($this->_buffer)) {\n\n /**\n * Datenbankverbindung herstellen.\n */\n $database = new Database();\n\n /**\n * Query abschicken.\n *\n * Hier verwenden wir die AVG()-Funktion von MySQL um einen Durchschnitt aller ratings zu berechnen. Diese\n * Berechnung könnten wir in PHP auch machen, dazu müssten wir aber alle Einträge aus der Datenbank laden\n * und manuell drüber iterieren. In MySQL brauchen wir nur einen einzigen Query und kriegen alles, was wir\n * brauchen.\n */\n $result = $database->query(\"SELECT AVG(rating) as average, COUNT(*) as count FROM comments WHERE post_id = ? AND rating IS NOT NULL\", [\n 'i:post_id' => $this->id\n ]);\n\n /**\n * Daten aus dem Result holen und Datentypen konvertieren.\n */\n $numberOfRatings = (int)$result[0]['count'];\n $average = (float)$result[0]['average'];\n\n /**\n * Cache anlegen.\n */\n $this->_buffer = [\n 'average' => $average,\n 'numberOfRatings' => $numberOfRatings\n ];\n\n }\n\n /**\n * Werte zurückgeben.\n */\n return $this->_buffer;\n }", "public function getAverage()\r\n {\r\n $fSum = 0.0;\r\n foreach ($this->aNotes as $fNote) {\r\n $fSum += $fNote;\r\n }\r\n $fAverage = $fSum / count($this->aNotes);\r\n // get only 2 digits after comma\r\n $fAverage = floatval(number_format($fAverage, 2));\r\n return $fAverage;\r\n }", "public function rating()\n {\n return $this->hasOne('App\\Review')\n ->selectRaw('user_id, count(*) as count, avg(would_recommend) as avg, avg(communication) as communication, avg(as_described) as as_described')\n ->groupBy('user_id');\n }", "public function getRating();", "public function getRating();", "public function getAvgNotePresse()\n {\n $result = DB::table('movies')\n ->select(DB::raw('ROUND(AVG(note_presse)) as avgpress'))\n ->first();\n\n return $result;\n }", "public function averageWatchedPerWeek()\n {\n// $totals = array_pluck(\\DB::table('films')\n// ->where('watched', true)\n// ->select(\\DB::raw('count(title) AS count, WEEK(watched_on, 2) AS `week`'))\n// ->groupBy('week')\n// ->get(), 'count');\n\n $total = $this->model->watched()->count();\n\n return number_format($total / floor(\\Carbon\\Carbon::now()->dayOfYear / 7 + 1), 1);\n }", "function average($arr){\n return ($arr) ? array_sum($arr)/count($arr) : 0;\n }", "public function averageRate()\n {\n $this->quotes = (isset($this->quotes) && (is_array($this->quotes))) ? array_slice($this->quotes, 0, $this->totalCarriers) : [];\n $rateList = $this->enArrayColumn($this->quotes, 'cost');\n $count = count($this->quotes);\n $count = $count > 0 ? $count : 1;\n $rateSum = array_sum($rateList) / $count;\n $quotesReset = reset($this->quotes);\n\n $rate[] = [\n 'id' => $this->randString(),\n 'carrier_scac' => (isset($quotesReset['carrier_scac'])) ? $quotesReset['carrier_scac'] : \"\",\n 'label' => (isset($quotesReset['label'])) ? $quotesReset['label'] : \"\",\n 'cost' => $rateSum,\n 'markup' => (isset($quotesReset['markup'])) ? $quotesReset['markup'] : \"\",\n 'appendLabel' => (isset($quotesReset['appendLabel'])) ? $quotesReset['appendLabel'] : \"\",\n ];\n return $rate;\n }", "public function avgRating(Request $request)\n{\n $service_id = $request->service_id;\n $id = $service_id;\n $num_of_ratings= Rating::orderBy('id','asc')->where('service_id',$service_id)->get();\n $service = services::find($id);\n // dd($service);\n // exit();\n //echo $service_id;\n //dd($num_of_ratings);\n $avg= 0;\n // for($i=0; $i<count($num_of_ratings);$i++){\n // $avg=$avg+\n // }\n if(count($num_of_ratings)>0){\n foreach ($num_of_ratings as $num_of_stars) {\n $avg= $avg+ $num_of_stars->stars_rated;\n\n }\n //echo \"average rating is \". $avg/count($num_of_ratings);\n $service->avg_rating = $avg/count($num_of_ratings);\n $service->save();\n return view('average_rating_page',compact('service'));\n }\n else{\n return view('average_rating_page',compact('service'));\n }\n}", "public function averageRating()\n {\n return $this->hasOne('App\\StoreAverageRating');\n }", "public function calculateAverage()\n {\n return 0.0;\n }", "public function getRatingValue()\n {\n\n if ($this->_dRatingValue === null) {\n $this->_dRatingValue = (double) 0;\n if ($this->isReviewActive() && ($oDetailsProduct = $this->getProduct())) {\n $blShowVariantsReviews = $this->getConfig()->getConfigParam('blShowVariantReviews');\n $this->_dRatingValue = round($oDetailsProduct->getArticleRatingAverage($blShowVariantsReviews), 1);\n }\n }\n\n return (double) $this->_dRatingValue;\n }", "public function avgViews()\n {\n $query = \"SELECT AVG(views) FROM blog_post \n WHERE deleted = 0\";\n\n $stmt = static::$dbh->query($query);\n\n $views = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $views;\n }", "public function getRating()\n\t{\n\t\treturn $this->ratings['rating'];\n\t}", "public function getRestaurantRating($id){\n $query=$this->db->query(\"SELECT COUNT(review_id) AS num_review,ROUND(AVG(rating),0) AS rating FROM reviews WHERE restaurant_id=\".$id);\n if($query->num_rows){\n $restaurant['num_review']=$query->rows[0]['num_review'];\n if($restaurant['num_review']!=0)\n $restaurant['rating']=$query->rows[0]['rating'];\n else\n $restaurant['rating']=0;\n }\n else{\n $restaurant['num_review']=0;\n $restaurant['rating']=0;\n }\n\n return $restaurant;\n }", "function getTaskRating() {\n\t\t$rating = -$this -> missed * 0.5;\n\t\tforeach ($this->data as $i => $row) {\n\t\t\t//if a event does belong to a ground truth event take the calculated value. Otherwise set its rating to -0.5\n\t\t\tif (!is_null($row['EventId'])) {\n\t\t\t\tif (array_key_exists($i, $this -> rating)) {\n\t\t\t\t\t$rating = $rating + $this -> rating[$i];\n\t\t\t\t} else {\n\t\t\t\t\t$rating = $rating - 0.5;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $rating;\n\t}", "public function getAverageRating($connection,$userID){\n $userID = $this->e($connection,$userID);\n \n $ratings = [];\n //get sold and giverName\n $query_sold = \"SELECT feedback.rating FROM feedback \";\n $query_sold .=\" LEFT JOIN ( \";\n $query_sold .=\" SELECT b1.auctionID,b1.highestBid as currentBid,b2.buyerID as winnerID \";\n $query_sold .=\" FROM ( \";\n $query_sold .=\" SELECT bid.auctionID,MAX(bid.bidValue) AS highestBid \";\n $query_sold .=\" FROM bid \";\n $query_sold .=\" GROUP BY bid.auctionID \";\n $query_sold .=\" ) AS b1 \";\n $query_sold .=\" LEFT JOIN ( \";\n $query_sold .=\" SELECT bid.auctionID, bid.bidValue, bid.buyerID \";\n $query_sold .=\" FROM bid \";\n $query_sold .=\" ) AS b2 \";\n $query_sold .=\" ON b2.auctionID = b1.auctionID AND b2.bidValue = b1.highestBid \";\n $query_sold .=\" ) AS winner ON winner.auctionID = feedback.auctionID \";\n $query_sold .= \"INNER JOIN user ON user.id = winner.winnerID \";\n $query_sold .= \"INNER JOIN auction ON auction.id = feedback.auctionID \";\n $query_sold .= \"WHERE auction.sellerID = {$userID} \";\n $query_sold .= \"AND feedback.giverID = winner.winnerID\";\n\n $result = mysqli_query($connection,$query_sold);\n if ($result){\n while ($row = mysqli_fetch_assoc($result)){\n $ratings[] = $row[\"rating\"];\n }\n }else {\n die( \"Database query failed (get feedbacks 1). \" . mysqli_error( $connection ) );\n }\n\n\n\n //get bought \n $query_bought =\" SELECT feedback.rating FROM feedback \";\n $query_bought .= \"INNER JOIN user ON user.id = feedback.giverID \";\n $query_bought .=\" LEFT JOIN ( \";\n $query_bought .=\" SELECT b1.auctionID,b1.highestBid as currentBid,b2.buyerID as winnerID \";\n $query_bought .=\" FROM ( \";\n $query_bought .=\" SELECT bid.auctionID,MAX(bid.bidValue) AS highestBid \";\n $query_bought .=\" FROM bid \";\n $query_bought .=\" GROUP BY bid.auctionID \";\n $query_bought .=\" ) AS b1 \";\n $query_bought .=\" LEFT JOIN ( \";\n $query_bought .=\" SELECT bid.auctionID, bid.bidValue, bid.buyerID \";\n $query_bought .=\" FROM bid \";\n $query_bought .=\" ) AS b2 \";\n $query_bought .=\" ON b2.auctionID = b1.auctionID AND b2.bidValue = b1.highestBid \";\n $query_bought .=\" ) AS winner \";\n $query_bought .=\" ON winner.auctionID = feedback.auctionID WHERE winner.winnerID={$userID} \";\n $query_bought .=\" AND feedback.giverID <> {$userID}\";\n\n\n $result2 = mysqli_query($connection,$query_bought);\n if ($result2){\n while ($row2 = mysqli_fetch_assoc($result2)){\n $ratings[] = $row2[\"rating\"];\n }\n }else {\n die( \"Database query failed (get feedbacks 2). \" . mysqli_error( $connection ));\n }\n\n $avg = 0;\n if (count($ratings)>0){\n $avg = array_sum($ratings) / count($ratings); \n }\n\n return $avg;\n \n }", "public function getRatingAttribute()\n {\n return (int) $this->ratings()->sum('rate');\n }", "private function _calculateTotalsByRating()\n {\n $sql = new SqlStatement();\n $sql->select(array(\n 'id' => 'ROUND(total)',\n 'val' => 'ROUND(total)',\n 'c' => 'COUNT(*)',\n 'type' => \"'RATING'\"))\n ->from(array('p' => self::RESULTS_TABLE))\n ->group(array('ROUND(total)'));\n \n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $sql->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $sql->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n $res = $this->db->query($sql);\n// echo $sql;\n return $res->rows;\n }", "public function getAverageRevenueConversion()\n {\n $resource = Mage::getModel('abandonment/orderflag')->getResource();\n $average = 0;\n\n $nbConvertedCarts = $resource->getSumNbConvertedCarts($this->_getFilterStartingPeriod(), $this->_getFilterEndingPeriod());\n if ($nbConvertedCarts > 0) {\n $sumAmout = $resource->getSumAmountConvertedCarts(\n $this->_getFilterStartingPeriod(), $this->_getFilterEndingPeriod()\n );\n $average = $sumAmout / $nbConvertedCarts;\n }\n\n return $average;\n }", "public function getCountRating($product,$count)\n {\n\n $reviews = DB::table('feedbacks')\n ->where(['approved'=>'1','feedbackable_type'=>'App\\Inventory','feedbackable_id'=>$product])\n ->select('rating', DB::raw('count(*) as total'))\n ->groupBy('rating')\n ->orderBy('rating','desc')\n ->get();\n\n $totalReviews = $count;\n \n for ($i = 5; $i >= 1; $i--) {\n if (! $reviews->isEmpty()) {\n foreach ($reviews as $review) {\n if ($review->rating == $i) {\n $percentage[$i] = $review->total;\n\n break;\n } else {\n $percentage[$i]=0;\n }\n }\n } else {\n $percentage[$i]=0;\n }\n }\n\n return $percentage;\n }", "public function getSumRatingAttribute() : float\n {\n return $this->sumRating();\n }", "public function getPercentageRating($product,$count)\n {\n\n $reviews = DB::table('feedbacks')\n ->where(['approved'=>'1','feedbackable_type'=>'App\\Inventory','feedbackable_id'=>$product])\n ->select('rating', DB::raw('count(*) as total'))\n ->groupBy('rating')\n ->orderBy('rating','desc')\n ->get();\n\n $totalReviews = $count;\n\n for ($i = 5; $i >= 1; $i--) {\n if (! $reviews->isEmpty()) {\n foreach ($reviews as $review) {\n if ($review->rating == $i) {\n $percentage[$i] = round(($review->total / $totalReviews) * 100);\n\n break;\n } else {\n $percentage[$i] = 0;\n }\n }\n } else {\n $percentage[$i] = 0;\n }\n }\n return $percentage;\n }", "public function getAvgRating($idUser, $idPost){\n $result = $this->getRating($idUser, $idPost);\n if($result != null){\n $return = ($result[\"originality\"] + $result[\"topic\"] + $result[\"language_level\"])/3;\n return number_format($return, 2);\n }\n return null;\n }", "public function getAverageRatingByCollection(Mage_Rating_Model_Resource_Rating_Option_Vote_Collection $collection)\n {\n if (!$collection->count()) {\n return false;\n }\n\n $ratingValue = 0;\n $count = 0;\n /** @var Mage_Rating_Model_Rating_Option_Vote $rating */\n while ($rating = $collection->fetchItem()) :\n $ratingValue += $rating->getValue();\n $count++;\n endwhile;\n\n return $this->formaRatingtNumber($ratingValue/$count);\n }", "public function getRating(){\r\n\t\treturn $this->rating;\r\n\t}", "public function GetRating(){\n\t\treturn $this->rating;\n\t}", "public function getVisitorAvgTransValue()\r\n\t{\r\n\t\t$value = 0;\r\n\t\t$count = 0;\r\n\t\r\n\t\tforeach ($this->getOrders() as $order)\r\n\t\t{\r\n\t\t\t$value += $order->getGrandTotal();\r\n\t\t\t\t\r\n\t\t\t$count++;\r\n\t\t}\r\n\t\t\r\n\t\tif ($value && $count)\r\n\t\t{\r\n\t\t\treturn round($value/$count,2);\r\n\t\t}\r\n\t\t\r\n\t\treturn 0;\r\n\t}", "public function getAverageRatingByReview(Mage_Review_Model_Review $review)\n {\n $collection = Mage::getModel('rating/rating_option_vote')\n ->getResourceCollection()\n ->setReviewFilter($review->getId())\n ->setStoreFilter(Mage::app()->getStore()->getId());\n\n $rating = $this->getAverageRatingByCollection($collection);\n if (!$rating) {\n return false;\n }\n return $this->formaRatingtNumber($rating);\n }", "public function getAverage() : float\n {\n if (is_array($this->numbers) && count($this->numbers)) {\n $sum = singleNumberMathFactory(0, 'sum');\n foreach ($this->numbers as $number) {\n $sum = (singleNumberMathFactory($sum->operate($number), 'sum'));\n }\n\n return singleNumberMathFactory($sum->operate(0), 'divide')->operate(count($this->numbers));\n }\n\n return 0;\n }", "function calculateAverage($values,$averageType='simple'){\n $average=array_sum($values)/count($values);\n return $average;\n}", "function average($array)\n{\n $avg = array_sum($array) / (count($array));\n return $avg;\n}", "public function avg($avg=null)\n {\n $avg = LambdaUtils::toSelectCallable($avg);\n return ($this->sum($avg)/$this->length());\n }", "function avg($s)\n{\n\tif (!$this->getSql()) return 0;\n\t$rows = $this->getClone()->select(\"avg($s) as n\");\n\treturn +$rows[0]['n'];\n}", "public function getRating()\n {\n return $this->rating;\n }", "public function getRating()\n {\n return $this->rating;\n }", "public function getRating()\n {\n return $this->rating;\n }", "public static function AvgRatingsPerAttraction($attractionName)\n\t{\n\t\t$avgRating= DB::table('Reviews')->select(DB::raw(\"avg(ratings) as AttractionAvg\"))->where('AttractionName','=',$attractionName)->get();\n\t\treturn $avgRating;\n\t}", "function getAvgAuthor($a_id)\n{\n $sql = \"SELECT ROUND(AVG(CAST(CAST (review_author.rating AS char)AS INT)),2) FROM review_author WHERE a_id = $a_id\";\n $result = pg_query($sql);\n $avgscore = pg_fetch_row($result);\n if ($avgscore[0]!=0) echo \"&nbsp; <label class=\\\"label label-warning\\\"><span class=\\\"glyphicon glyphicon-star\\\"></span> \".$avgscore[0].\"</label>\"; \n}", "public function getTotalAverageRevenueConversion()\n {\n $resource = Mage::getModel('abandonment/orderflag')->getResource();\n $average = 0;\n\n $nbConvertedCarts= $resource->getSumNbConvertedCarts();\n if ($nbConvertedCarts) {\n $average = $resource->getSumAmountConvertedCarts() / $nbConvertedCarts;\n }\n\n return $average;\n }", "function getAverageStats() {\n return $this->averageNpsStats;\n }", "function ros_get_grades_average($grads)\n{\n $povprecje = array();\n $cnt = count($grads);\n $povprecje['mistakes'] = 0;\n $povprecje['timeinseconds'] = 0;\n $povprecje['hitsperminute'] = 0;\n $povprecje['precision'] = 0;\n foreach($grads as $grade)\n {\n $povprecje['mistakes'] = $povprecje['mistakes'] + $grade->mistakes; \n $povprecje['timeinseconds'] = $povprecje['timeinseconds'] + $grade->timeinseconds;\n }\n if($cnt != 0){\n $povprecje['mistakes'] = $povprecje['mistakes'] / $cnt;\n $povprecje['timeinseconds'] = $povprecje['timeinseconds'] / $cnt;\n }\n return $povprecje;\n}", "protected static function getAverageRating($a_wiki_id, $a_page_id = null)\n\t{\t\t\t\t\n\t\tinclude_once \"Services/Rating/classes/class.ilRating.php\";\n\t\t\n\t\tif(!$a_page_id)\n\t\t{\n\t\t\treturn ilRating::getOverallRatingForObject(\n\t\t\t\t$a_wiki_id,\n\t\t\t\t\"wiki\");\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ilRating::getOverallRatingForObject(\n\t\t\t\t$a_wiki_id,\n\t\t\t\t\"wiki\",\n\t\t\t\t$a_page_id,\n\t\t\t\t\"wpg\");\t\t\n\t\t}\t\t\n\t}", "public function getRating(){\n return $this->film['rating'];\n }", "public function avg($matcher = null);", "public function recalculateRating($rating)\n {\n $reviews = $this->reviews();\n $avgRating = $reviews->avg('rating');\n $this->rating_cache = round($avgRating,1);\n $this->rating_count = $reviews->count();\n $this->save();\n }", "function getAverageAge($input) {\n global $sum; //'sum' was global gedeclareerd\n for($i=0; $i<count($input); $i++) { //$i moest '0' inhouden\n $sum += $input[$i];\n }\n\n return $sum / $i; //moest nog delen door aantal values van het array\n }", "public function calcSnowAvg() {\n\t\t$min = $this->snow['base'];\n\t\t$max = $this->snow['upperbase'];\n\t\treturn ($min + $max)/2;\n\t}", "public function getRating()\n {\n if (!$this->getRatingCollection()) {\n $ratingCollection = $this->_voteFactory->create()->getResourceCollection()->setReviewFilter(\n $this->getReviewId()\n )->addRatingInfo(\n $this->_storeManager->getStore()->getId()\n )->setStoreFilter(\n $this->_storeManager->getStore()->getId()\n )->load();\n\n $this->setRatingCollection($ratingCollection->getSize() ? $ratingCollection : false);\n }\n\n return $this->getRatingCollection();\n }", "function getRating()\n {\n return $this->rating;\n }", "public function getRating()\n {\n return $this->rating;\n }", "function findRating($data)\n {\n $result = array();\n for ($i = 0; $i< count($data);$i++){\n\n $obj = $data[$i];\n $roomID = $data[$i][\"roomId\"];\n\n $obj[\"rating\"] = \"0\";\n\n //query and get the average rating for the user reviews for meeting room given by usres\n $query = $this->db->query(\"SELECT AVG(rating) as rating FROM room_reviews where roomID = $roomID\");\n if($query->num_rows()>0)\n {\n $obj[\"rating\"] = !$query->result_array()[0][\"rating\"]? \"0.0\" :$query->result_array()[0][\"rating\"];\n }\n else\n {\n $obj[\"rating\"] = \"0\";\n\n }\n\n array_push($result, $obj);\n }\n //return the result\n return $result;\n\n }", "public static function average()\n {\n //retrieve the arguments passed to the function, and extracts the reference to the execution environment\n $args = func_get_args();\n $self = array_shift($args);\n\n //return the average of the array\n return array_sum($args) / count($args); \n }", "function avgT($a){\n\t\t\treturn array_sum($a) / count($a);\t\n\t\t}", "public function average() {\n $avgEmployees = Employee::avg(\"age\");\n\n return response()->json([\"age\"=>round($avgEmployees, 0)]);\n }", "public static function employer_rating_score($employer_id) {\n global $wpdb;\n $sql = \"SELECT AVG(M.meta_value) as rate_point, COUNT(C.comment_ID) as count\n FROM $wpdb->posts as p \n join $wpdb->comments as C \n ON p.ID = c.comment_post_ID \n join $wpdb->commentmeta as M \n ON C.comment_ID = M.comment_id\n WHERE \n p.post_author = $employer_id\n AND p.post_status ='complete'\n AND p.post_type ='\" . PROJECT . \"' \n AND M.meta_key = 'et_rate'\n AND C.comment_type ='fr_review'\n AND C.comment_approved = 1\";\n \n $results = $wpdb->get_results($sql);\n if($results) {\n return array('rating_score' => $results[0]->rate_point , 'review_count' => $results[0]->count );\n }else {\n return array('rating_score' => 0 , 'review_count' => 0 ); \n }\n }", "public function averageImportant()\n {\n return $this->setImportance(self::IMPORTANCE_AVERAGE);\n }", "public function getAveragePointsFor()\n {\n return number_format((float) $this->getPointsFor() / $this->teams->count(), 2, '.', '');\n }", "function count_rating($product_id,$connect) {\r\n $output = 0;\r\n $query = \"SELECT AVG(rating) as rating FROM rating WHERE product_id = '$product_id'\";\r\n $statement = $connect->prepare($query);\r\n $statement->execute();\r\n $result = $statement->fetchAll();\r\n $total_row = $statement->rowCount();\r\n if($total_row > 0) {\r\n foreach ($result as $row) {\r\n $output = round($row['rating']);\r\n }\r\n }\r\n return $output;\r\n }", "public function scopeAverageRate($query, $type, $id)\n {\n // return $query->where('rateble_type', $type)\n // ->where('rateble_id', $id)\n // ->avg('star');\n\n return $query->where('rateble_type', $type)\n ->where('rateble_id', $id)\n ->selectRaw('CAST(AVG(star) AS DECIMAL(2,1)) AS star_avg')->first()->star_avg;\n // ->selectRaw('AVG(CAST(star AS FLOAT)) AS star_avg')->first()->star_avg;\n\n }", "public function getRating($user_id, $driver_id) {\n $stmt = $this->conn->prepare(\"SELECT COUNT(rating) as num, AVG(rating) as average FROM rating WHERE customer_id = ? AND driver_id = ?\");\n $stmt->bind_param(\"ii\", $user_id, $driver_id);\n\n if ($stmt->execute()) {\n\n $stmt->bind_result($num, $average);\n $stmt->fetch();\n $rating = array();\n $rating['num'] = $num; \n if($num == 0){\n $rating['average'] = 0;\n } else {\n $rating['average'] = $average;\n }\n $stmt->close();\n return $rating;\n } else {\n return NULL;\n }\n }", "public function average(Query $query, string $field): float;" ]
[ "0.7789809", "0.75187725", "0.7428851", "0.7422182", "0.74026006", "0.73367256", "0.73261535", "0.73139924", "0.71653897", "0.7078755", "0.70677274", "0.69061226", "0.687273", "0.67900264", "0.677696", "0.6717049", "0.6651417", "0.66481405", "0.66474855", "0.6581198", "0.65659106", "0.65235645", "0.6510512", "0.649269", "0.64718294", "0.6452893", "0.63828397", "0.6347317", "0.6337634", "0.62995243", "0.6298037", "0.62941647", "0.62925905", "0.62422425", "0.6197246", "0.6181092", "0.6179588", "0.6176505", "0.6167384", "0.6164876", "0.6154953", "0.6154953", "0.61070746", "0.6104147", "0.6098052", "0.6097487", "0.60966396", "0.6082822", "0.6070792", "0.6066535", "0.60549325", "0.6049919", "0.6040941", "0.6019647", "0.6005166", "0.60030955", "0.60026956", "0.6001754", "0.59965223", "0.5991564", "0.59825367", "0.59747076", "0.5961803", "0.59570605", "0.59173816", "0.5911008", "0.59030277", "0.5883371", "0.5881684", "0.588162", "0.587914", "0.5875138", "0.58676165", "0.58676165", "0.58676165", "0.5867082", "0.586618", "0.58541036", "0.58248746", "0.58243096", "0.5819929", "0.58132344", "0.5811042", "0.5808547", "0.5802031", "0.5792437", "0.5789107", "0.57867897", "0.5766507", "0.5752844", "0.575228", "0.57417035", "0.57369494", "0.57298607", "0.5728137", "0.57271016", "0.5725615", "0.5720912", "0.5709978", "0.5709906" ]
0.7788075
1
Shares an album and rebuilds the permissions cache
public function share(array $users, array $album) { $db = $this->_getDb(); XenForo_Db::beginTransaction($db); $shareUsers = @unserialize($album['album_share_users']); if (!$shareUsers) { $shareUsers = array(); } if (isset($users['user_id'])) { $data = array( 'shared_user_id' => $users['user_id'], 'album_id' => $album['album_id'] ); $shareUsers[$users['user_id']] = $data; $this->_db->query(' INSERT IGNORE INTO xengallery_shared_map (album_id, shared_user_id) VALUES (?, ?) ', $data); } else { foreach ($users AS $userId => $user) { $data = array( 'shared_user_id' => $userId, 'album_id' => $album['album_id'] ); $shareUsers[$userId] = $data; $this->_db->query(' INSERT IGNORE INTO xengallery_shared_map (album_id, shared_user_id) VALUES (?, ?) ', $data); } } XenForo_Db::commit($db); $albumWriter = XenForo_DataWriter::create('XenGallery_DataWriter_Album'); $albumWriter->setExistingData($album['album_id']); $albumWriter->set('album_share_users', $shareUsers); $albumWriter->save(); return $albumWriter->getMergedData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function share($sk, $api_sig, $recipient, $album, $artist, $public = null, $message = null)\n {\n return $this->getClient()->call('album.share', array(\n 'sk' => $sk,\n 'api_sig' => $api_sig,\n 'recipient' => $recipient,\n 'album' => $album,\n 'artist' => $artist,\n 'public' => $public,\n 'message' => $message,\n ));\n }", "function doFacebook() {\n\n session_start();\n $facebook = new FacebookPhotos($GLOBALS['FB_API_KEY'],\n $GLOBALS['FB_SECRET']);\n\n if ($_REQUEST['fb'] == 'auth') {\n $album = $_SESSION['album'];\n if (!file_exists(\"a_$album\")) {\n print \"Please navigate here from the main album page\";\n exit(0);\n }\n $desc = getAlbumDescription($album);\n $fb_sig_user = $_REQUEST['fb_sig_user'];\n\n # First create the album\n $create_album_response = $facebook->api_client->photos_createAlbum(\n $desc, '', '', '', $fb_sig_user);\n $album_link = $create_album_response['link'];\n $aid = $create_album_response['aid'];\n\n print \"Created album <a href='$album_link'>$desc</a><br/>\\n\";\n flush();\n\n $photos = getPhotoList($album);\n $num_photos = count($photos);\n print \"Found $num_photos photos<br/>\\n\";\n flush();\n\n foreach ($photos as $photo) {\n try {\n $file = \"a_$album/m/m_$photo\";\n $photo_desc = getPhotoDescription($album, $photo);\n \n if (file_exists($file)) {\n\t $upload_response = $facebook->api_client->photos_upload(\n $file, $aid, $photo_desc, $fb_sig_user);\n $photo_link = $upload_response['link'];\n print \"Uploaded photo <a href='$photo_link'>$photo</a><br/>\\n\";\n flush();\n } else {\n\t print \"Skipping nonexistant file $file<br/>\\n\";\n\t flush();\n }\n } catch (Exception $e) {\n print \"Caught exception uploading $photo<br/>\\n\";\n\tflush();\n }\n } \n print \"Done<br/>\";\n } else {\n $_SESSION['album'] = $_REQUEST['fb'];\n $facebook->require_frame();\n }\n}", "protected function preparePhotosInSharedAndPrivateAndRequireLinkAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->albumID3 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_3)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->photoID3 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_SUNSET_IMAGE), $this->albumID3)->offsetGet('id');\n\t\t$this->sharing_tests->add([$this->albumID1, $this->albumID3], [$this->userID]);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID3, is_link_required: true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "protected function prepareThreeAlbumsWithMixedSharingAndPasswordProtection(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->albumID3 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_3)->offsetGet('id');\n\t\t// The mis-order of photos by there title (N, T, M) is on purpose such that\n\t\t// we first receive the result (N, T) as long as album 3 is locked and\n\t\t// then (M, N, T) after album 3 has been unlocked, with album 3\n\t\t// being in the front position.\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_NIGHT_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->photoID3 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID3)->offsetGet('id');\n\t\t$this->sharing_tests->add([$this->albumID1, $this->albumID2], [$this->userID]);\n\t\t// Sic! We use the same password for both albums here, because we want\n\t\t// to ensure that incidentally \"unlocking\" an album which is also\n\t\t// shared has no negative side effect.\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID2, is_nsfw: true, password: TestConstants::ALBUM_PWD_1);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID3, is_nsfw: true, password: TestConstants::ALBUM_PWD_1);\n\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "protected function preparePhotoInSharedPublicPasswordProtectedAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID1, password: TestConstants::ALBUM_PWD_1);\n\t\t$this->sharing_tests->add([$this->albumID1], [$this->userID]);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "function album_put( $request, $user ) {\r\n global $hook;\r\n $owner = \\Profile\\profileHandler::getProfileId( $request );\r\n\r\n if (preg_match(\"@{$owner->username}/*$@\", join('/',$request->getRequestVars()) )) {\r\n // profile page\r\n $album = new \\AlbumObject();\r\n $parent = $album->initAlbumById( $owner->albumid )->getParent();\r\n /*\r\n ->getParent();\r\n $path = $album->path();\r\n */\r\n\r\n } elseif ($request->getResource() == 'albums') {\r\n // album page\r\n $album = new \\AlbumObject();\r\n $parent = $album->initAlbumByPath( $request->getRequestVars() )->getParent();\r\n /*\r\n ->getParent();\r\n $path = $album->path();\r\n */\r\n\r\n }\r\n\r\n // get submit data\r\n $json = $request->getData();\r\n\r\n // get item\r\n $item = new \\ItemObject();\r\n $item->getId($json->Id);\r\n\r\n // Check that the user is the owner of the object\r\n if ($item->get('uid') != $user->uid) {\r\n throw new \\Exception(\"You are not authorized to change this item.\", 403);\r\n }\r\n\r\n // check if item and parent match\r\n if ($item->get('parentid') != $parent->get('itemid')) {\r\n throw new \\Exception(\"item does not exist in this space\", 404);\r\n }\r\n //$item->set('path', $path);\r\n //print \"path: \".$item->get('path').\"\\n\";\r\n\r\n $response = new \\stdClass();\r\n\r\n $response->data = $hook->execute('put_article_albums_action', $json, $item, $album);\r\n // perform requested action \r\n switch($json->Item) { // <----- this should be at the favorites section\r\n case 'addFavorite':\r\n break;\r\n case 'removeFavorite':\r\n break;\r\n /*default:\r\n throw new \\Exception(\"Unsupported action\", 404);\r\n break;*/\r\n\r\n }\r\n\r\n $response->Success = true;\r\n print json_encode($response);\r\n //print_r($item);\r\n \r\n}", "public function saveAlbumsToLibrary($album_chunk)\n {\n $ids = $album_chunk;\n\n // if array given, make it commma separated sring\n if (is_array($album_chunk)) {\n $ids = implode(',', $album_chunk);\n }\n\n $accessToken = Session::get('spotify_access_token');\n\n $request = $this->client()->request('PUT', 'me/albums', [\n 'query' => [\n 'ids' => $ids,\n ],\n 'headers' => [\n 'Authorization' => sprintf('Bearer %s', $accessToken),\n ]\n ]);\n\n if($request->getStatusCode() == 200) {\n return true;\n }\n\n return false;\n }", "static function set_sharing_permissions_by_sharing_id($user_id, $id, $permissions) {\n global $con;\n\n $sql = \"\n\t\tUPDATE `share`, `list`\n\t\tSET `share`.`permissions` = \".$permissions.\", `share`.`time` = \".time().\"\n\t\tWHERE `share`.`id` = \".$id.\" AND (`list`.`id` = `share`.`list` AND `list`.`creator` = \".$user_id.\" OR `share`.`user` = \".$user_id.\");\";\n $query = mysqli_query($con, $sql);\n return 1;\n }", "public function setMusicAlbum($attributes = []);", "function album($album_id, $json = false){\n\t\tif(!empty($album_id) && $album_id>0){\n\t\t\t$albuminfo = $this->db->get_where(DB_MEDIA,array('id'=>$album_id))->row()->id;\n\t\t\tif(empty($albuminfo)){\n\t\t\t\tredirect('user/albums');\n\t\t\t}\n\t\t $timeline_id =\t$this->db->get_where(DB_MEDIA,array('id'=>$album_id))->row()->timeline_id;\n\t\t\t$query_one = \"SELECT id,name,descr,timeline_id,album_privacy,user_album_type FROM \" . DB_MEDIA . \" WHERE id=\" . $album_id . \" AND `type`='album' AND temp=0 AND active=1\";\n\t\t\t$sql_query_one = $this->db->query($query_one);\n\t\t\tif ($sql_query_one->num_rows == 1){\n\t\t\t\t$sk = array();\n\t\t\t\t$uid = $this->session->userdata('user_id');\n\t\t\t\t// Login verification and user stats update\n\t\t\t\t$sk['logged'] = false;\n\t\t\t\t$user = null;\n\t\t\t\t$config['site_url'] = base_url();\n\t\t\t\t$config['theme_url'] = '';\n\t\t\t\t$config['script_path'] = str_replace('index.php', '', $_SERVER['PHP_SELF']);\n\t\t\t\t$config['ajax_path'] = base_url() . 'ajax/socialAjax';\n\t\t\t\t$sk['config'] = $config;\n\t\t\t\tif ($this->socialkit->SK_isLogged()) {\n\t\t\t\t\t$user = $this->socialkit->SK_getUser($uid, true);\n\t\t\t\t\tif (!empty($user['id']) && $user['type'] == \"user\") {\n\t\t\t\t\t\t$sk['user'] = $user;\n\t\t\t\t\t\t$sk['timeline'] = $user;\n\t\t\t\t\t\t$sk['timeline']['wall_user_id'] = false;\n\t\t\t\t\t\t$sk['logged'] = true;\n\t\t\t\t\t}\n\t\t\t\t\t$album = $sql_query_one->result();\n\t\t\t\t\t$sk['album'] = (array) $album[0];\n\t\t\t\t\t$sk['privacyArray'] = $this->model_user->getPrivacyOptions();\n\t\t\t\t\tif($timeline_id ==$uid){\n\t\t\t\t\t//$sk['photos'] = $this->socialkit->SK_getAlbumPhotos($album_id);\n\t\t\t\t\t$all_photos=$this->db->query(\"SELECT a.id as post_id,a.post_privacy, a.post_id as postid,b.id FROM posts AS a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN \". constant('DB_MEDIA') .\" AS b on a.media_id=b.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE b.album_id='\".$album_id.\"' AND b.type='photo' AND a.active ='1'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY a.id DESC \")->result_array();\n\t\t\t\t\t\tforeach($all_photos as $key=>&$photo){\n\t\t\t\t\t\t $photo['complete_url'] = $this->module->getImageNow($photo['id'], 320, 's');\n\t\t\t\t\t\t $sk['photos'][] = $photo;\n\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t redirect('user/albums'); \n\t\t\t\t\t}\n\t\t\t\t\t$data['sk'] = $sk;\n\t\t\t\t\tif($json == true) {\n\t\t\t\t\t\theader('Content-type: text/json');\n\t\t\t\t\t\theader('Content-type: application/json');\n\t\t\t\t\t\tforeach($sk['photos'] as $key=>$photos){\n\t\t\t\t\t\t\t$sk['photos'][$key]['complete_url']=$this->module->getImageNow($photos['id'],150,'s'); \n\t\t\t\t\t\t}\n\t\t\t\t\t\techo json_encode($sk);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->load->view('user/album', $data); \n\t\t\t\t\t}\n\t\t\t\t} else{\n\t\t\t\t\tredirect(base_url('login').'?url='.base64_encode(uri_string()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif($json == true) {\n\t\t\t\t\t$error = array(\n\t\t\t\t\t\t\t'status'=>417,\n\t\t\t\t\t\t\t'message'=>'Album id not exist'\n\t\t\t\t\t);\n\t\t\t\t\theader('Content-type: text/json');\n\t\t\t\t\theader('Content-type: application/json');\n\t\t\t\t\techo json_encode($error);\n\t\t\t\t} else {\n\t\t\t\t\tredirect('user/albums'); \n\t\t\t\t} \n\t\t\t}\n\t\t} else {\n\t\t\tif($json == true) {\n\t\t\t\t$error = array(\n\t\t\t\t\t\t'status'=>417,\n\t\t\t\t\t\t'message'=>'Album is mandatory'\n\t\t\t\t);\n\t\t\t\theader('Content-type: text/json');\n\t\t\t\theader('Content-type: application/json');\n\t\t\t\techo json_encode($error);\n\t\t\t} else {\n\t\t\t\tredirect('user/albums'); \n\t\t\t} \n\t\t}\n }", "function setup_album()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'id, name, member_id, public_album', 'from' => 'gallery_albums', 'where' => \"id={$this->ipsclass->input['album']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $info = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this album?\n if( $info['member_id'] == $this->ipsclass->member['id'] )\n {\n $own = true;\n }\n\n if( ! $info['public_album'] && ! $own )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );\n }\n\n return $info;\n }", "public function setAlbum($value)\n {\n return $this->set('Album', $value);\n }", "public function setAlbum($value)\n {\n return $this->set('Album', $value);\n }", "public function setAlbum($value)\n {\n return $this->set('Album', $value);\n }", "public function setAlbum($value)\n {\n return $this->set('Album', $value);\n }", "public function setAlbum($value)\n {\n return $this->set('Album', $value);\n }", "public function setAlbum($value)\n {\n return $this->set('Album', $value);\n }", "public function setAlbum($value)\n {\n return $this->set('Album', $value);\n }", "public function setAlbum($value)\n {\n return $this->set('Album', $value);\n }", "public function setAlbum($value)\n {\n return $this->set('Album', $value);\n }", "protected function preparePublicAlbumAndPasswordProtectedAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID1, password: TestConstants::ALBUM_PWD_1);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID2);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "public function getShares() {\n\t\tif (!$this->shareManager->shareApiEnabled()) {\n\t\t\treturn new \\OC\\OCS\\Result();\n\t\t}\n\n\t\t$sharedWithMe = $this->request->getParam('shared_with_me', null);\n\t\t$reshares = $this->request->getParam('reshares', null);\n\t\t$subfiles = $this->request->getParam('subfiles');\n\t\t$path = $this->request->getParam('path', null);\n\n\t\t$includeTags = $this->request->getParam('include_tags', false);\n\n\t\tif ($path !== null) {\n\t\t\t$userFolder = $this->rootFolder->getUserFolder($this->currentUser->getUID());\n\t\t\ttry {\n\t\t\t\t$path = $userFolder->get($path);\n\t\t\t\t$path->lock(ILockingProvider::LOCK_SHARED);\n\t\t\t} catch (\\OCP\\Files\\NotFoundException $e) {\n\t\t\t\treturn new \\OC\\OCS\\Result(null, 404, $this->l->t('Wrong path, file/folder doesn\\'t exist'));\n\t\t\t} catch (LockedException $e) {\n\t\t\t\treturn new \\OC\\OCS\\Result(null, 404, $this->l->t('Could not lock path'));\n\t\t\t}\n\t\t}\n\n\t\tif ($sharedWithMe === 'true') {\n\t\t\t$stateFilter = $this->request->getParam('state', \\OCP\\Share::STATE_ACCEPTED);\n\t\t\tif ($stateFilter === '') {\n\t\t\t\t$stateFilter = \\OCP\\Share::STATE_ACCEPTED;\n\t\t\t} elseif ($stateFilter === 'all') {\n\t\t\t\t$stateFilter = null; // which means all\n\t\t\t} else {\n\t\t\t\t$stateFilter = (int)$stateFilter;\n\t\t\t}\n\t\t\t$result = $this->getSharedWithMe($path, $includeTags, $stateFilter);\n\t\t\tif ($path !== null) {\n\t\t\t\t$path->unlock(ILockingProvider::LOCK_SHARED);\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\n\t\tif ($subfiles === 'true') {\n\t\t\t$result = $this->getSharesInDir($path);\n\t\t\tif ($path !== null) {\n\t\t\t\t$path->unlock(ILockingProvider::LOCK_SHARED);\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\n\t\tif ($reshares === 'true') {\n\t\t\t$reshares = true;\n\t\t} else {\n\t\t\t$reshares = false;\n\t\t}\n\n\t\t// Get all shares\n\t\t$userShares = $this->shareManager->getSharesBy($this->currentUser->getUID(), \\OCP\\Share::SHARE_TYPE_USER, $path, $reshares, -1, 0);\n\t\t$groupShares = $this->shareManager->getSharesBy($this->currentUser->getUID(), \\OCP\\Share::SHARE_TYPE_GROUP, $path, $reshares, -1, 0);\n\t\t$linkShares = $this->shareManager->getSharesBy($this->currentUser->getUID(), \\OCP\\Share::SHARE_TYPE_LINK, $path, $reshares, -1, 0);\n\t\t$shares = \\array_merge($userShares, $groupShares, $linkShares);\n\n\t\tif ($this->shareManager->outgoingServer2ServerSharesAllowed()) {\n\t\t\t$federatedShares = $this->shareManager->getSharesBy($this->currentUser->getUID(), \\OCP\\Share::SHARE_TYPE_REMOTE, $path, $reshares, -1, 0);\n\t\t\t$shares = \\array_merge($shares, $federatedShares);\n\t\t}\n\n\t\t$formatted = [];\n\t\tforeach ($shares as $share) {\n\t\t\ttry {\n\t\t\t\t$formatted[] = $this->formatShare($share);\n\t\t\t} catch (NotFoundException $e) {\n\t\t\t\t//Ignore share\n\t\t\t}\n\t\t}\n\n\t\tif ($includeTags) {\n\t\t\t$formatted = \\OCA\\Files\\Helper::populateTags($formatted, 'file_source');\n\t\t}\n\n\t\tif ($path !== null) {\n\t\t\t$path->unlock(ILockingProvider::LOCK_SHARED);\n\t\t}\n\n\t\treturn new \\OC\\OCS\\Result($formatted);\n\t}", "public function onUserProfilePhotoUpload($event)\n {\n\t\tif(Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('album'))\n\t\t\treturn;\n $payload = $event->getPayload();\n if( empty($payload['user']) || !($payload['user'] instanceof Core_Model_Item_Abstract) ) {\n return;\n }\n if( empty($payload['file']) || !($payload['file'] instanceof Storage_Model_File) ) {\n return;\n }\n $viewer = $payload['user'];\n $file = $payload['file'];\n // Get album\n $table = Engine_Api::_()->getDbtable('albums', 'sesalbum');\n $album = $table->getSpecialAlbum($viewer, 'profile');\n $photoTable = Engine_Api::_()->getDbtable('photos', 'sesalbum');\n $photo = $photoTable->createRow();\n $photo->setFromArray(array(\n 'owner_type' => 'user',\n 'owner_id' => Engine_Api::_()->user()->getViewer()->getIdentity()\n ));\n $photo->save();\n $photo->setPhoto($file);\n $photo->album_id = $album->album_id;\n $photo->save();\n if( !$album->photo_id ) {\n $album->photo_id = $photo->getIdentity();\n $album->save();\n }\n $auth = Engine_Api::_()->authorization()->context;\n $auth->setAllowed($photo, 'everyone', 'view', true);\n $auth->setAllowed($photo, 'everyone', 'comment', true);\n $auth->setAllowed($album, 'everyone', 'view', true);\n $auth->setAllowed($album, 'everyone', 'comment', true);\n $event->addResponse($photo);\n }", "public function process()\n {\n Phpfox::getLib('setting')->setParam('musicsharing.url_image', Phpfox::getParam('core.url_pic') . 'musicsharing' . PHPFOX_DS);\n phpFox::isUser(true);\n $aParentModule = $this->getParam('aParentModule');\n if ($aParentModule)\n {\n phpFox::getLib('session')->set('pages_msf', $aParentModule);\n if (!phpFox::getService('pages')->hasPerm($aParentModule['item_id'], 'musicsharing.can_manage_album'))\n {\n $this->url()->send(\"subscribe\");\n }\n }\n else\n {\n phpFox::getLib('session')->remove('pages_msf');\n }\n $this->template()->setBreadCrumb(phpFox::getPhrase('musicsharing.music_sharing'), null);\n $prefix = phpFox::getParam(array('db', 'prefix'));\n $settings = phpFox::getService('musicsharing.music')->getUserSettings(phpFox::getUserId());\n \n $this->template()->assign(array('settings' => $settings)); {\n if (isset($_POST['task']) && $_POST['task'] == \"dodelete\")\n {\n foreach ($_POST['delete_album'] as $aid)\n {\n phpFox::getService('musicsharing.music')->deleteAlbum($aid);\n }\n }\n }\n if ($this->request()->get(\"orderalbum\"))\n {\n $id_album = $this->request()->get(\"orderalbum\");\n $album_current = phpFox::getService('musicsharing.music')->getAlbums_Id($id_album, phpFox::getUserId());\n $order_album_current = $album_current[\"order_id\"];\n $album_before = phpFox::getService('musicsharing.music')->getAlbumsBefore_Id($id_album, phpFox::getUserId());\n $order_album_before = $album_before[\"order_id\"];\n if ($order_album_before)\n {\n $id_album_before = $album_before[\"album_id\"];\n phpFox::getService('musicsharing.music')->updateAlbum($id_album, $order_album_before);\n phpFox::getService('musicsharing.music')->updateAlbum($id_album_before, $order_album_current);\n }\n if ($this->request()->get('page') > 0)\n $this->url()->send('musicsharing.myalbums.page_' . $this->request()->get('page'), null, null, null);\n else\n $this->url()->send('musicsharing.myalbums', null, null, null);\n }\n else if ($this->request()->get(\"orderalbumdown\"))\n {\n $id_album = $this->request()->get(\"orderalbumdown\");\n $album_current = phpFox::getService('musicsharing.music')->getAlbums_Id($id_album, phpFox::getUserId());\n $order_album_current = $album_current[\"order_id\"];\n $album_after = phpFox::getService('musicsharing.music')->getAlbumsAfter_Id($id_album, phpFox::getUserId());\n $order_album_after = $album_after[\"order_id\"];\n if ($order_album_after)\n {\n $id_album_after = $album_after[\"album_id\"];\n phpFox::getService('musicsharing.music')->updateAlbum($id_album, $order_album_after);\n phpFox::getService('musicsharing.music')->updateAlbum($id_album_after, $order_album_current);\n }\n if ($this->request()->get('page') > 0)\n $this->url()->send('musicsharing.myalbums.page_' . $this->request()->get('page'), null, null, null);\n else\n $this->url()->send('musicsharing.myalbums', null, null, null);\n }\n $user_id = phpFox::getUserId();\n $where = \" \" . $prefix . \"m2bmusic_album.user_id = $user_id\";\n $list_total = phpFox::getService('musicsharing.music')->get_total_album($where);\n \n $aGlobalSettings = phpFox::getService('musicsharing.music')->getUserSettings(phpFox::getUserId(), false);\n $iPageSize = isset($aGlobalSettings['number_album_per_page']) ? $aGlobalSettings['number_album_per_page'] : 5;\n $iPage = $this->request()->get(\"page\");\n if (!$iPage)\n $iPage = 1;\n $max_page = floor($list_total / $iPageSize) + 1;\n if ($iPage > $max_page)\n $iPage = $max_page;\n $sort_by = $prefix . 'm2bmusic_album.order_id';\n $list_info = phpFox::getService('musicsharing.music')->getAlbums(($iPage - 1) * $iPageSize, $iPageSize, null, null, $where);\n phpFox::getLib('pager')->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $list_total));\n\n $this->template()->assign(array('iPage' => $iPage, 'aRows' => $list_info, 'iCnt' => $list_total))\n ->setHeader('cache', array(\n 'pager.css' => 'style_css'));\n $this->template()->assign(array(\n 'sDeleteBlock' => 'dashboard',\n 'list_info' => $list_info,\n 'core_path' => phpFox::getParam('core.path'),\n 'user_id' => phpFox::getUserId(),\n 'total_album' => $list_total,\n 'cur_page' => $this->request()->get('page') <= 0 ? 1 : $this->request()->get('page')\n ));\n $this->template()->setHeader(array(\n 'm2bmusic_tabcontent.js' => 'module_musicsharing',\n 'm2bmusic_class.js' => 'module_musicsharing',\n 'music.css' => 'module_musicsharing',\n 'musicsharing_style.css' => 'module_musicsharing',\n 'mobile.css' => 'module_musicsharing'\n ));\n\n //modified section (v 300b1)\n //build filter menu\n phpFox::getService('musicsharing.music')->getSectionMenu($aParentModule);\n $catitle = $this->template()->getBreadCrumb();\n\n if (!$aParentModule)\n {\n $satitle = isset($catitle[1][0]) ? $catitle[1][0] : $catitle[0][0];\n $this->template()->clearBreadCrumb();\n $this->template()\n ->setBreadCrumb(phpFox::getPhrase('musicsharing.music_sharing'), $this->url()->makeUrl('musicsharing'))\n ->setBreadCrumb($satitle, null)\n ->setBreadCrumb($satitle, null, true);\n }\n else\n {\n $this->template()->clearBreadCrumb();\n $this->template()\n ->setBreadCrumb(phpFox::getPhrase('musicsharing.music_sharing'), $this->url()->makeUrl('musicsharing'), false);\n }\n ///modified section (v 300b1)\n }", "public function updateAlbum($idArtista = NULL,$idAlbum = NULL){\n\t\tif($this->autenticado(/* parametro? */)){\n\t\t\t$camposAlbum = $this->getCamposAlbum($idArtista, $idAlbum);\n\t\t\t$this->actualizarAlbum($camposAlbum, false, false, '');\n\t\t}else{\n\t\t\techo \"Directory access is forbidden.\";\n\t\t}\n\t}", "static function set_sharing_permissions($user_id, $word_list_id, $email, $permissions) {\n $share_with_id = self::email2id($email);\n if ($share_with_id == $user_id) return -1;\n\n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `share` WHERE `user` = '\".$share_with_id.\"' AND `list` = '\".$word_list_id.\"';\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 0) {\n $sql = \"INSERT INTO `share` (`user`, `list`, `permissions`, `time`) VALUES (\".$share_with_id.\", \".$word_list_id.\", \".$permissions.\", \".time().\");\";\n $query = mysqli_query($con, $sql);\n return 1;\n } else {\n $sql = \"UPDATE `share` SET `permissions` = $permissions, `time` = \".time().\" WHERE `list` = \".$word_list_id.\" AND (`user` = \".$share_with_id.\");\";\n $query = mysqli_query($con, $sql);\n return 2;\n }\n return 0;\n }", "public function createAlbum($options = array())\n {\n if($this->hasAlbum($options['title']))\n {\n throw new Exception(\"The album \" . $options['title'] . \" already exist for object of id \" . $this->mdObject->getId() . \" and classname \" . $this->mdObject->getObjectClass() , 200);\n }\n else\n {\n return $this->mdObject->retrieveMdMedia()->createAlbum($options);\n //Borro el cache APC correspondiente\n //update local collection album\n //return $album;\n }\n }", "function album($id) {\n\n // Get nickname\n if (isset($_SESSION['nickname'])) $nn = $_SESSION['nickname'];\n else $nn = 'nobody';\n\n $this->pager->limit = $this->per_page;\n\n // Start pager\n $this->pager->setStart();\n\n // \"Cache Groups\" using a vertical bar |\n $cache_id = \"$nn|album|{$id}|\" . $this->pager->start;\n $this->tpl->caching = 1;\n\n if (!$this->tpl->isCached('album.tpl', $cache_id)) {\n\n $this->pager->setPages($this->photo->countPhotos($id));\n $this->r->text['pager'] = $this->pager->pageList(suxFunct::makeUrl(\"/photos/album/{$id}\"));\n $this->r->arr['photos'] = $this->photo->getPhotos($this->pager->limit, $this->pager->start, $id);\n $this->r->arr['album'] = $this->photo->getAlbumByID($id);\n\n if ($this->r->arr['album'] && $this->r->arr['photos'] && (is_countable($this->r->arr['photos']) ? count($this->r->arr['photos']) : 0))\n {\n $tmp = $this->user->getByID($this->r->arr['album']['users_id']);\n $this->r->arr['album']['nickname'] = $tmp['nickname'];\n $this->r->title .= \" | {$this->r->gtext['photos']} | {$this->r->arr['album']['title']}\";\n }\n\n else {\n $this->tpl->caching = 0; // Nothing to cache, avoid writing to disk\n }\n\n }\n\n $this->tpl->display('album.tpl', $cache_id);\n\n }", "protected function preparePublicAlbumAndHiddenAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID1);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID2, is_link_required: true);\n\t\t$this->photos_tests->set_star([$this->photoID2], true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "public function update(Request $request, $id)\n {\n $user = JWTAuth::parseToken()->authenticate();\n $record = $this->albumRepository->find($id);\n $createActivity = false;\n\n if (Gate::forUser($user)->allows('albums-update', $record)) {\n\n //validate\n $validator = Validator::make($request->all(), $this->validations);\n\n if ($validator->fails()) {\n return response()->json([\n 'success'=> false,\n 'errors' => $validator->errors()->all()\n ],400);\n }\n\n // Anything else other than 1 should be false\n if ($request->published != 'true') {\n $record->published = false;\n }\n\n //updata data\n if (!$record->published && $request->published == 'true') {\n $record->published = true;\n $record->created_at = date('Y-m-d H:i:s');\n $createActivity = true;\n }\n\n $record->fill($request->all());\n\n $record->save();\n $songs = $this->albumRepository->findSongs($record);\n\n $album = $this->prepareAlbumData($record, $songs);\n\n if($request->hasFile('image')){\n //delete old file if already exist\n //we only need one at the time\n if($record->image){\n try {\n $record->image->delete();\n } catch(\\Exception $error) {}\n }\n\n $image = $request->file('image');\n\n // Make sure to upload the image to the author's folder\n $author = $user;\n if ($record->user_id != $author->id) {\n $author = $record->author;\n }\n\n $img = $this->createImage($author, $record, $image);\n\n $album['image'] = $this->getFileURL((Object)[\n 'file_id' => $img->id,\n 'name' => $img->name,\n 'path' => $img->path,\n 'public' => true,\n ]);\n }\n\n if($createActivity){\n $activity = new Activity();\n $activity->fill([\n 'action' => 'published-album',\n 'user_id' => $record->user_id,\n 'reference_type' => 'App\\\\Album',\n 'reference_id' => $record->id\n ]);\n $activity->save();\n }\n\n return response()->json([\n 'success' => true,\n 'album' => $album,\n 'message' => 'Album successfully updated'\n ]);\n }else{\n return response()->json([\n 'success' => false,\n 'errors' => [\"Access denied, you can't update this album\"]\n ],403);\n }\n }", "public function load($album = NULL, $options = array())\n {\n try\n {\n $this->filter = ((empty ($options) || !array_key_exists(\"order\", $options)) ? mdMediaManager::MD_FILTER_PRIORITY : $options[\"order\"]);\n\n if(is_null($album))\n {\n //Cargo todos los albums\n $mdMediaAlbums = $this->mdObject->retrieveMdMedia()->retrieveAlbums($this->key);\n $this->count_albums = count($mdMediaAlbums);\n $counter_comments = 0;\n\n foreach($mdMediaAlbums as $mdAlbum)\n {\n\n $this->hashMap[$mdAlbum['title']] = (int)$mdAlbum['id'];\n $this->albums[(int)$mdAlbum['id']] = new stdClass();\n $this->albums[(int)$mdAlbum['id']]->id = (int)$mdAlbum['id'];\n try\n {\n $this->albums[(int)$mdAlbum['id']]->avatarId= (is_null($mdAlbum['md_media_content_id']) ? NULL : (int)$mdAlbum['md_media_content_id']);\n $this->albums[(int)$mdAlbum['id']]->avatar = NULL;\n if($this->albums[(int)$mdAlbum['id']]->avatarId != NULL)\n {\n $this->albums[(int)$mdAlbum['id']]->avatar = mdMediaAlbum::retrieveMdContentConcrete((int)$mdAlbum['md_media_content_id']);\n }\n }catch(Exception $e){\n $this->albums[(int)$mdAlbum['id']]->avatar = NULL;\n }\n $this->albums[(int)$mdAlbum['id']]->title = $mdAlbum['title'];\n $this->albums[(int)$mdAlbum['id']]->description = $mdAlbum['description'];\n $this->albums[(int)$mdAlbum['id']]->contentIds = array();\n $this->albums[(int)$mdAlbum['id']]->count = mysqlMdMediaAlbum::retrieveCountCache($mdAlbum['id']);\n if( sfConfig::get( 'sf_plugins_media_commentable', false ) )\n {\n $this->albums[(int)$mdAlbum['id']]->count_comments = mdCommentsHandler::retrieveCountComments(\"mdMediaAlbum\", (int)$mdAlbum['id']);\n $counter_comments+= $this->albums[(int)$mdAlbum['id']]->count_comments;\n }\n $this->albums[(int)$mdAlbum['id']]->contents = array();\n\n //Sino se carga a demanda, cargo todos los objetos para cada album\n if(!self::$LOAD_ON_DEMAND_CONTENT)\n {\n $mdItemIds = MdMediaAlbum::retrieveContentIds($mdAlbum['id'], $this->filter);\n $this->albums[(int)$mdAlbum['id']]->contentIds = $mdItemIds;\n $limit = (!is_null(sfConfig::get('app_objectsByPage'))) ? sfConfig::get('app_objectsByPage') : self::ITEMS_BY_PAGE;\n $this->albums[(int)$mdAlbum['id']]->contents = $this->loadItems($mdAlbum['title'], 1, $limit);\n }\n }\n $this->count_comments_albums = $counter_comments;\n }\n else\n {\n// Doctrine::getTable('mdMediaAlbum')->findAlbums($this->mdObject->retrieveMdMedia()->getId(), mdMediaManager::IMAGES);\n //Cargo los datos del album $album\n $mdAlbum = Doctrine::getTable('mdMediaAlbum')->retrieveAlbum($this->mdObject->retrieveMdMedia()->getId(), $album);\n\n if($mdAlbum)\n {\n $this->hashMap[$mdAlbum['title']] = (int)$mdAlbum['id'];\n $this->albums[(int)$mdAlbum['id']] = new stdClass();\n $this->albums[(int)$mdAlbum['id']]->id = (int)$mdAlbum['id'];\n try\n {\n $this->albums[(int)$mdAlbum['id']]->avatarId= (is_null($mdAlbum['md_media_content_id']) ? NULL : (int)$mdAlbum['md_media_content_id']);\n $this->albums[(int)$mdAlbum['id']]->avatar = NULL;\n if($this->albums[(int)$mdAlbum['id']]->avatarId != NULL)\n {\n $this->albums[(int)$mdAlbum['id']]->avatar = MdMediaAlbum::retrieveMdContentConcrete((int)$mdAlbum['md_media_content_id']);\n }\n }catch(Exception $e){\n $this->albums[(int)$mdAlbum['id']]->avatar = NULL;\n }\n $this->albums[(int)$mdAlbum['id']]->title = $mdAlbum['title'];\n $this->albums[(int)$mdAlbum['id']]->description = $mdAlbum['description'];\n $this->albums[(int)$mdAlbum['id']]->contentIds = array();\n $this->albums[(int)$mdAlbum['id']]->count = mysqlMdMediaAlbum::retrieveCountCache($mdAlbum['id']);\n if( sfConfig::get( 'sf_plugins_media_commentable', false ) )\n {\n $this->albums[(int)$mdAlbum['id']]->count_comments = mdCommentsHandler::retrieveCountComments(\"mdMediaAlbum\", (int)$mdAlbum['id']);\n }\n $this->albums[(int)$mdAlbum['id']]->contents = array();\n\n //Sino se carga a demanda, cargo todos los objetos para el album\n if(!self::$LOAD_ON_DEMAND_CONTENT)\n {\n $mdItemIds = MdMediaAlbum::retrieveContentIds($mdAlbum['id'], $this->filter);\n $this->albums[(int)$mdAlbum['id']]->contentIds = $mdItemIds;\n $limit = (!is_null(sfConfig::get('app_objectsByPage')) ? sfConfig::get('app_objectsByPage') : self::ITEMS_BY_PAGE);\n $this->albums[(int)$mdAlbum['id']]->contents = $this->loadItems($mdAlbum['title'], 1, $limit);\n }\n $this->album_loaded = $mdAlbum['title'];\n }\n else\n {\n throw new Exception('The album ' . $album . ' not exist for the object of id ' . $this->mdObject->getId(), 103);\n }\n }\n }\n catch(Exception $e)\n {\n throw $e;\n }\n\n return $this;\n }", "function ciniki_gallery_albumDelete(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'album_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Album'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'gallery', 'private', 'checkAccess');\n $rc = ciniki_gallery_checkAccess($ciniki, $args['tnid'], 'ciniki.gallery.albumDelete', 0); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Get the existing image information\n //\n $strsql = \"SELECT ciniki_gallery_albums.id, ciniki_gallery_albums.uuid, \"\n . \"COUNT(ciniki_gallery.id) AS num_images \"\n . \"FROM ciniki_gallery_albums \"\n . \"LEFT JOIN ciniki_gallery ON (ciniki_gallery_albums.id = ciniki_gallery.album_id \"\n . \"AND ciniki_gallery.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"WHERE ciniki_gallery_albums.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND ciniki_gallery_albums.id = '\" . ciniki_core_dbQuote($ciniki, $args['album_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.gallery', 'album');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['album']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.gallery.5', 'msg'=>'Gallery album does not exist'));\n }\n $album = $rc['album'];\n\n if( $album['num_images'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.gallery.6', 'msg'=>'The album still has images in it. Please remove all images before deleting the album.'));\n }\n \n //\n // Remove the album\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n return ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.gallery.album', $args['album_id'], $album['uuid'], 0x07);\n}", "private function getAlbums($aData)\n {\n /**\n * @var string\n */\n $sAction = (isset($aData['sAction']) && $aData['sAction'] == 'new') ? 'new' : 'more';\n /**\n * @var int\n */\n $iLastTimeStamp = isset($aData['iLastTimeStamp']) ? (int) $aData['iLastTimeStamp'] : 0;\n /**\n * @var string\n */\n $sView = isset($aData['sView']) ? $aData['sView'] : '';\n /**\n * @var int\n */\n $iAmountOfAlbum = isset($aData['iAmountOfAlbum']) ? (int) $aData['iAmountOfAlbum'] : 10;\n /**\n * @var string\n */\n $sSearch = isset($aData['sSearch']) ? $aData['sSearch'] : '';\n /**\n * @var array\n */\n $aCond = array();\n\n if (!empty($sSearch))\n {\n $aCond[] = 'm.name LIKE \"' . Phpfox::getLib('parse.input')->clean('%' . $sSearch . '%') . '\"';\n }\n switch ($sView) {\n case 'my':\n $aCond[] = 'm.user_id = ' . Phpfox::getUserId();\n break;\n\n case 'all':\n default:\n $aCond[] = 'm.view_id = 0';\n $aCond[] = 'm.privacy IN(0)';\n break;\n }\n if ($iLastTimeStamp > 0)\n {\n if ($sAction == 'more')\n {\n $aCond[] = 'm.time_stamp < ' . $iLastTimeStamp;\n }\n else\n {\n $aCond[] = 'm.time_stamp > ' . $iLastTimeStamp;\n }\n }\n $this->database()\n ->select('COUNT(*)')\n ->from(Phpfox::getT('music_album'), 'm');\n /**\n * @var int\n */\n $iCount = $this->database()\n ->where(implode(' AND ', $aCond))\n ->limit(1)\n ->execute('getField');\n if ($iCount == 0)\n {\n return array();\n }\n /**\n * @var array\n */\n $aAlbums = $this->database()\n ->select('lik.like_id AS is_liked, m.*, u.user_id, u.profile_page_id, u.server_id AS user_server_id, u.user_name, u.full_name, u.gender, u.user_image, u.is_invisible, u.user_group_id, u.language_id')\n ->from(Phpfox::getT('music_album'), 'm')\n ->leftJoin(Phpfox::getT('like'), 'lik', 'lik.type_id = \\'music_album\\' AND lik.item_id = m.album_id AND lik.user_id = ' . Phpfox::getUserId())\n ->join(Phpfox::getT('user'), 'u', 'u.user_id = m.user_id')\n ->where(implode(' AND ', $aCond))\n ->order('m.time_stamp DESC')\n ->limit(0, $iAmountOfAlbum, $iCount)\n ->execute('getRows');\n /**\n * @var array\n */\n $aResult = array();\n foreach ($aAlbums as $aAlbum)\n {\n $aResult[] = array(\n 'bIsLiked' => isset($aAlbum['is_liked']) ? (bool) $aAlbum['is_liked'] : false,\n 'iAlbumId' => $aAlbum['album_id'],\n 'iViewId' => $aAlbum['view_id'],\n 'iPrivacy' => $aAlbum['privacy'],\n 'iPrivacyComment' => $aAlbum['privacy_comment'],\n 'bIsFeatured' => (bool) $aAlbum['is_featured'],\n 'bIsSponsor' => (bool) $aAlbum['is_sponsor'],\n 'iUserId' => $aAlbum['user_id'],\n 'sName' => $aAlbum['name'],\n 'iYear' => $aAlbum['year'],\n 'sImagePath' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['server_id'],\n 'path' => 'music.url_image',\n 'file' => $aAlbum['image_path'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'iTotalTrack' => $aAlbum['total_track'],\n 'iTotalPlay' => $aAlbum['total_play'],\n 'iTotalComment' => $aAlbum['total_comment'],\n 'iTotalLike' => $aAlbum['total_like'],\n 'iTotalDislike' => $aAlbum['total_dislike'],\n 'iTotalScore' => $aAlbum['total_score'],\n 'iTotalRating' => $aAlbum['total_rating'],\n 'iTimeStamp' => $aAlbum['time_stamp'],\n 'sTimeStamp' => date('l, F j', $aAlbum['time_stamp']),\n 'sFullTimeStamp' => date('l, F j', $aAlbum['time_stamp']) . ' at ' . date('g:i a', $aAlbum['time_stamp']),\n 'sModuleId' => isset($aAlbum['module_id']) ? $aAlbum['module_id'] : 0,\n 'iItemId' => $aAlbum['item_id'],\n 'iProfilePageId' => $aAlbum['profile_page_id'],\n 'iUserServerId' => $aAlbum['user_server_id'],\n 'sUsername' => $aAlbum['user_name'],\n 'sFullname' => $aAlbum['full_name'],\n 'iGender' => $aAlbum['gender'],\n 'sUserImage' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['user_server_id'],\n 'path' => 'core.url_user',\n 'file' => $aAlbum['user_image'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'bIsInvisible' => $aAlbum['is_invisible'],\n 'iUserGroupId' => $aAlbum['user_group_id'],\n 'iLanguageId' => isset($aAlbum['language_id']) ? $aAlbum['language_id'] : 0\n );\n }\n return $aResult;\n }", "protected function preparePublicUnsortedPhotoAndPhotoInSharedAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE))->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->sharing_tests->add([$this->albumID1], [$this->userID]);\n\t\t$this->photos_tests->set_public($this->photoID1, true);\n\t\t$this->photos_tests->set_star([$this->photoID1, $this->photoID2], true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "function albums($timeLineId = false){ \n $config['site_url'] = base_url();\n $config['theme_url'] = '';\n $config['script_path'] = str_replace('index.php', '', $_SERVER['PHP_SELF']);\n $config['ajax_path'] = base_url() . 'ajax/socialAjax';\n $user = null;\n $leftBarSide = array();\n if($timeLineId==false){\n $uid = $this->session->userdata('user_id'); \n $layoutView = 'user/albums';\n // Login verification and user stats update\n $sk = array();\n $sk['logged'] = false;\n $sk['config'] = $config;\n $cond = \"timeline_id='\".$uid.\"'\";\n } else {\n $uid = $timeLineId;\n $layoutView = 'user/timelineUserAlbums';\n // Login verification and user stats update\n $userInfo = array();\n $userInfo['logged'] = false;\n $userInfo['config'] = $config;\n $cond = \"md5(md5(timeline_id))='\".$uid.\"'\";\n }\n \n if ($this->socialkit->SK_isLogged()) {\n $user = $this->socialkit->SK_getUser($uid, true);\n if (!empty($user['id']) && $user['type'] == \"user\") {\n $sk['user'] = $userInfo['user'] = $user;\n $sk['timeline'] = $user;\n $sk['timeline']['wall_user_id'] = false;\n $sk['logged'] = $userInfo['logged'] = true;\n $userInfo['timeline']['wall_user_id'] = $uid;//TIMELINE ID IS USER_ID and is double md5 ed\n\t\t\t\t $userInfo['user'] = $user; \n $leftBarSide = $this->commonTimelineQry($uid);\n $sk['timeline_id'] = $user['id'];\n }\n\t /*(\n SELECT CONCAT_WS('.', url, extension) photo \n FROM media \n WHERE album_id=m.id AND `type`='photo' AND temp=0 \n ORDER BY id DESC LIMIT 1 \n )*/\n\t \n $sqlAlbum = \"SELECT id,name,descr,album_id,album_privacy, \n (\n\t\t\t\t\t\t\tSELECT CONCAT_WS('.', b.url, b.extension) photo FROM posts AS a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN \". constant('DB_MEDIA') .\" AS b on a.media_id=b.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE b.album_id=m.id AND b.type='photo' AND a.active ='1'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY a.id DESC LIMIT 1 \n ) photo\n FROM \" . DB_MEDIA . \" m\n WHERE \".$cond.\" AND `type`='album' AND temp=0 AND active=1\";\n $sql_query_one = $this->db->query($sqlAlbum);\n if ($sql_query_one->num_rows >= 1) {\n $albums = $sql_query_one->result_array();\n // pr($albums);die;\n\t\t\t\t$sk['albums']= (array) $albums; \n }\n \n $data = array('sk'=>$sk, 'title'=>'List of Albums', 'userInfo'=>$userInfo);\n //pr($data); die; \n $this->load->view($layoutView, $data);\n } else {\n redirect(base_url('login').'?url='.base64_encode(uri_string()));\n }\n \n }", "function mediatag_album() {\r\n\tglobal $photo_query, $tag_query, $owner, $user;\r\n\r\n\tif($photo_query != \"\") { $photo_query .= \" UNION ALL \"; }\r\n\r\n\t$photo_query .= \"(SELECT 'media' \t\tAS type,\r\n\t\t\t\t'media_id'\t\tAS type_id,\r\n\t\t\t\t''\t\t\tAS type_prefix,\r\n\t\t\t\tmediatag_media_id \tAS media_id,\r\n\t\t\t\tmediatag_date\t\tAS mediatag_date,\r\n\t\t\t\tCONCAT('album.php?user=', user_username, '&album_id=[media_parent_id]')\tAS media_parent_url,\r\n\t\t\t\tmedia_album_id\t\tAS media_parent_id,\r\n\t\t\t\talbum_title\t\tAS media_parent_title,\r\n\t\t\t\talbum_user_id\t\tAS owner_user_id,\r\n\t\t\t\tuser_id\t\t\tAS user_id,\r\n\t\t\t\tuser_username\t\tAS user_username,\r\n\t\t\t\tuser_fname\t\tAS user_fname,\r\n\t\t\t\tuser_lname\t\tAS user_lname,\r\n\t\t\t\tCONCAT('./uploads_user/', user_id+999-((user_id-1)%1000), '/', user_id, '/') AS media_dir,\r\n\t\t\t\tmedia_date\t\tAS media_date,\r\n\t\t\t\tmedia_title\t\tAS media_title,\r\n\t\t\t\tmedia_desc\t\tAS media_desc,\r\n\t\t\t\tmedia_ext\t\tAS media_ext,\r\n\t\t\t\tmedia_filesize\t\tAS media_filesize,\r\n\t\t\t\tCASE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_REGISTERED) AND '{$user->user_exists}'<>0)\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_ANONYMOUS) AND '{$user->user_exists}'=0)\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_SELF) AND se_albums.album_user_id='{$user->user_info['user_id']}')\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_FRIEND) AND (SELECT TRUE FROM se_friends WHERE friend_user_id1=se_albums.album_user_id AND friend_user_id2='{$user->user_info['user_id']}' AND friend_status='1' LIMIT 1))\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_SUBNET) AND se_users.user_subnet_id='{$user->user_info['user_subnet_id']}')\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_FRIEND2) AND se_users.user_subnet_id='{$user->user_info['user_subnet_id']}' AND (SELECT TRUE FROM se_friends AS friends_primary LEFT JOIN se_friends AS friends_secondary ON friends_primary.friend_user_id2=friends_secondary.friend_user_id1 WHERE friends_primary.friend_user_id1=se_albums.album_user_id AND friends_secondary.friend_user_id2='{$user->user_info['user_id']}' LIMIT 1))\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t ELSE FALSE\r\n\t\t\t\tEND\r\n\t\t\t\tAS allowed_to_tag,\r\n\t\t\t\tCASE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_REGISTERED) AND '{$user->user_exists}'<>0)\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_ANONYMOUS) AND '{$user->user_exists}'=0)\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_SELF) AND se_albums.album_user_id='{$user->user_info['user_id']}')\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_FRIEND) AND (SELECT TRUE FROM se_friends WHERE friend_user_id1=se_albums.album_user_id AND friend_user_id2='{$user->user_info['user_id']}' AND friend_status='1' LIMIT 1))\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_SUBNET) AND se_users.user_subnet_id='{$user->user_info['user_subnet_id']}')\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_FRIEND2) AND se_users.user_subnet_id='{$user->user_info['user_subnet_id']}' AND (SELECT TRUE FROM se_friends AS friends_primary LEFT JOIN se_friends AS friends_secondary ON friends_primary.friend_user_id2=friends_secondary.friend_user_id1 WHERE friends_primary.friend_user_id1=se_albums.album_user_id AND friends_secondary.friend_user_id2='{$user->user_info['user_id']}' LIMIT 1))\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t ELSE FALSE\r\n\t\t\t\tEND\r\n\t\t\t\tAS allowed_to_comment\r\n\t\t\tFROM se_mediatags\r\n\t\t\tLEFT JOIN se_media\r\n\t\t\t\tON se_mediatags.mediatag_media_id=se_media.media_id\r\n\t\t\tLEFT JOIN se_albums\r\n\t\t\t\tON se_media.media_album_id=se_albums.album_id\r\n\t\t\tLEFT JOIN se_users\r\n\t\t\t\tON se_albums.album_user_id=se_users.user_id\r\n\t\t\tWHERE se_mediatags.mediatag_user_id='{$owner->user_info['user_id']}'\r\n\t\t\t)\";\r\n\r\n\t$tag_query['media'] = \"SELECT se_mediatags.*, se_users.user_id, se_users.user_username, se_users.user_fname, se_users.user_lname FROM se_mediatags LEFT JOIN se_users ON se_mediatags.mediatag_user_id=se_users.user_id WHERE mediatag_media_id='[media_id]' ORDER BY mediatag_id ASC\";\r\n\r\n}", "public function share($alias);", "protected function prepareThreePhotosInPublicAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID3 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_SUNSET_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->albums_tests->set_protection_policy($this->albumID1);\n\t\t$this->photos_tests->set_star([$this->photoID1], true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "public function sharePhotofeedFromWallAction()\n {\n \t$prms = $this->getRequest()->getParams();\n \t\n \t$zend_filter_obj = Zend_Registry::get('Zend_Filter_StripTags');\n \t$photo_text_filtered = $zend_filter_obj->filter( $this->getRequest()->getParam(\"photo_text\") );\n \t\n \t$logged_in_user_id = Auth_UserAdapter::getIdentity()->getId();\n \n //getting paths to user default album directory to store images.\n $userDirectory = REL_IMAGE_PATH.'\\\\albums\\\\user_'.$logged_in_user_id;\n $userAlbumDirectory = REL_IMAGE_PATH.'\\\\albums\\\\user_'.$logged_in_user_id.'\\\\album_default';\n $galleryDirectory = REL_IMAGE_PATH.'\\\\albums\\\\user_'.$logged_in_user_id.'\\\\album_default\\\\gallery_thumbnails';\n $wallDirectory = REL_IMAGE_PATH.'\\\\albums\\\\user_'.$logged_in_user_id.'\\\\album_default\\\\wall_thumbnails';\n $popupDirectory = REL_IMAGE_PATH.'\\\\albums\\\\user_'.$logged_in_user_id.'\\\\album_default\\\\popup_thumbnails';\n $originalDirecory = REL_IMAGE_PATH.'\\\\albums\\\\user_'.$logged_in_user_id.'\\\\album_default\\\\original_photos';\n \n // Creating directories\n if ( !file_exists( $userDirectory ) )\n {\n mkdir( $userDirectory, 0777, true );\n mkdir( $userAlbumDirectory, 0777, true );\n mkdir( $originalDirecory, 0777, true );\n mkdir( $popupDirectory, 0777, true );\n mkdir( $wallDirectory, 0777, true );\n mkdir( $galleryDirectory, 0777, true );\n }\n else\n {\n \t//This case will occur when user directory exists but album dir does not.\n if ( !file_exists( $userAlbumDirectory ) )\n {\n mkdir( $userAlbumDirectory, 0777, true );\n mkdir( $originalDirecory, 0777, true );\n mkdir( $wallDirectory, 0777, true );\n mkdir( $popupDirectory, 0777, true );\n mkdir( $galleryDirectory, 0777, true );\n }\n }\n\n //===================================================================\n //share in case of single photo i.e. share photo on photo detail page\n //===================================================================\n if( $prms['shared_from_photodetail_to_wall'] == 1 )\n {\n \t\n \t//Create photo group for these photos.\n \t$photo_group_id = \\Extended\\photo_group::addPhotoGroup( Auth_UserAdapter::getIdentity()->getId() );\n \t\n \t$imgObj = \\Extended\\socialise_photo::getRowObject($prms['photo_id']);\n \t$album_owner_id = $imgObj->getSocialise_photosSocialise_album()->getSocialise_albumIlook_user()->getId();\n \t \n \t$album_name = $imgObj->getSocialise_photosSocialise_album()->getAlbum_name();\n \t$album_timestamp = $imgObj->getSocialise_photosSocialise_album()->getCreated_at_timestamp()->getTimestamp();\n \t$img_id = $imgObj->getId();\n \t \n \tif( strtolower($album_name)== strtolower(\\Extended\\socialise_album::DEFAULT_ALBUM_NAME) )\n \t{\n \t\t$albName = \\Extended\\socialise_album::DEFAULT_ALBUM_NAME;\n \t}\n \telse if(strtolower($album_name)== strtolower(\\Extended\\socialise_album::PROFILE_PHOTOS_ALBUM_NAME ))\n \t{\n \t\t$albName = \\Extended\\socialise_album::PROFILE_PHOTOS_ALBUM_NAME;\n \t}\n \telse if(strtolower($album_name)== strtolower(\\Extended\\socialise_album::COVER_PHOTOS_ALBUM_NAME ))\n \t{\n \t\t$albName = \\Extended\\socialise_album::COVER_PHOTOS_ALBUM_NAME;\n \t}\n \telse\n \t{\n \t\t$albName = $album_name.\"_\".$album_timestamp;\n \t}\n \t \n \t$image_path = IMAGE_PATH.\"/albums/user_\".$album_owner_id.\"/album_\".$albName.\"/wall_thumbnails/thumbnail_\".$imgObj->getImage_name();\n \t$gallery_image_path = IMAGE_PATH.\"/albums/user_\".$album_owner_id.\"/album_\".$albName.\"/gallery_thumbnails/thumbnail_\".$imgObj->getImage_name();\n \t$original_image_path = IMAGE_PATH.\"/albums/user_\".$album_owner_id.\"/album_\".$albName.\"/original_photos/\".$imgObj->getImage_name();\n \t$popup_image_path = IMAGE_PATH.\"/albums/user_\".$album_owner_id.\"/album_\".$albName.\"/popup_thumbnails/thumbnail_\".$imgObj->getImage_name();\n \n \t$unique_image_name = Helper_common::getUniqueNameForFile($imgObj->getImage_name());\n \t$new_image_name = 'thumbnail_'.$unique_image_name;\n\n \t// copy image in gallery thumbnails directory\n \tcopy( $gallery_image_path, $galleryDirectory.\"/\".$new_image_name);\n \t\n \t// copy image in original photos directory\n \tcopy( $original_image_path, $originalDirecory.\"/\".$unique_image_name);\n \t\n \t// copy image in popup thumbnails directory\n \tcopy( $popup_image_path, $popupDirectory.\"/\".$new_image_name);\n \t\n \t//copy image in wall thumbnails directory\n \tif( copy( $image_path, $wallDirectory.\"/\".$new_image_name ) )\n \t\n\n \t//Getting the id of default album.\n \t$default_album_id = \\Extended\\socialise_album::isThisTypeOfAlbumExists( Auth_UserAdapter::getIdentity()->getId(), \\Extended\\socialise_album::DEFAULT_ALBUM_NAME );\n \t\n \tif( !$default_album_id )\n \t{\n \t\t//Making entry to DB.\n \t\t$album_data = \\Extended\\socialise_album::addAlbum(\n \t\t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\t\t\\Extended\\socialise_album::DEFAULT_ALBUM_NAME,\n \t\t\t\t\\Extended\\socialise_album::VISIBILITY_CRITERIA_PUBLIC,\n \t\t\t\t1,\n \t\t\t\t\\Extended\\socialise_album::DEFAULT_ALBUM_NAME );\n \t\t$album_id = $album_data['id'];\n \t}\n \telse\n \t{\n \t\t$album_id = $default_album_id;\n \t}\n \t\n \t\n \t//get photo details\n \t$photo_detail = \\Extended\\socialise_photo::getPhotoInfo($img_id);\n \t\n \t\n \t//Adding entry to wallpost table for sharing photos\n \t$wall_post_id = \\Extended\\wall_post::post_photo(\n \t\t\t$photo_text_filtered,\n \t\t\t$this->getRequest()->getParam(\"privacy\"),\n \t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\t$imgObj->getSocialise_photosPosted_by()->getId(),\n \t\t\t\\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM_BY_SHARING,\n \t\t\t\\Extended\\wall_post::POST_TYPE_MANUAL,\n \t\t\t\\Extended\\wall_post::WALL_TYPE_SOCIALISE,\n \t\t\t$photo_group_id,\n \t\t\t$album_id,\n \t\t\tnull,\n \t\t\t$photo_detail['wallpost_text'] );\n \t\n \tif($album_id)\n \t{\n \t\t//adding entry to socialise photo table\n \t\t$photo_info = \\Extended\\socialise_photo::addPhotos(\n \t\t\t\t$album_id,\n \t\t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\t\t$unique_image_name,\n \t\t\t\t$this->getRequest()->getParam(\"privacy\"),\n \t\t\t\t'',\n \t\t\t\t$photo_group_id,\n \t\t\t\t1\n \t\t);\n \t\t\n\n \t\tif( $photo_info )\n \t\t{\n \t\t\t\n \t\t\t$return_r['wall_post_id'] = $wall_post_id;\n \t\t\t$return_r['album_id'] = $album_id;\n \t\t\t$return_r['user_id'] = Auth_UserAdapter::getIdentity()->getId();\n \t\t\t$return_r['user_type'] = Auth_UserAdapter::getIdentity()->getUser_type();\n \t\t\t$return_r['user_gender'] = Auth_UserAdapter::getIdentity()->getGender();\n \t\t\t$return_r['user_name'] = Auth_UserAdapter::getIdentity()->getFirstname().\" \".Auth_UserAdapter::getIdentity()->getLastname();\n \t\t\t$return_r['user_image'] = Helper_common::getUserProfessionalPhoto( Auth_UserAdapter::getIdentity()->getId(), 3 );\n \t\t\n \t\t\t//Get photos of the new group, created just above.\n \t\t\t$em = \\Zend_Registry::get('em');\n \t\t\t$em->refresh( \\Extended\\photo_group::getRowObject($photo_group_id) );\n \t\t\t$photo_group_obj = \\Extended\\photo_group::getRowObject($photo_group_id);\n \n \t\t\t//Get obj of photo that is shared.\n \t\t\t$shared_photo_obj = \\Extended\\socialise_photo::getRowObject($img_id);\n \t\t\t\n \t\t\t\n \t\t\t\n \t\t\t$share_info_id = \\Extended\\share::addShareInfo(\n \t\t\t\t\t$logged_in_user_id,\n \t\t\t\t\tnull,\n \t\t\t\t\t$img_id\n \t\t\t\t\t);\n \t\t\t\n \t\t\t//The image belongs to a group and it is single inside it.\n \t\t\t//Insert share record for its wallpost also.\n \t\t\tif( $imgObj->getPhotoGroup() )\n \t\t\t{\n \t\t\t\tif( $imgObj->getPhotoGroup()->getSocialisePhoto()->count() == 1 )\n \t\t\t\t{\n \t\t\t\t\t$share_info_id = \\Extended\\share::addShareInfo(\n \t\t\t\t\t\t\t$logged_in_user_id,\n \t\t\t\t\t\t\t$imgObj->getPhotoGroup()->getWallPost()->getId()\n \t\t\t\t\t);\n \t\t\t\t\t$return_r['source_wall_post_id'] = $imgObj->getPhotoGroup()->getWallPost()->getId();\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t \n \t\t\t$share_count_of_album = '';\n \t\t\t$share_count_of_photo = $shared_photo_obj->getSocialise_photosShare()->count();\n \t\n \t\t\t$k = 0;\n \t\t\tforeach ( $photo_group_obj->getSocialisePhoto() as $photo )\n \t\t\t{\n \t\t\t\t$return_r['collage'][$k]['image_path'] = IMAGE_PATH.\"/albums/user_\".$logged_in_user_id.\"/album_default/wall_thumbnails/thumbnail_\".$photo->getImage_name();\n \t\t\t\t$return_r['collage'][$k]['image_id'] = $photo->getId();\n \t\t\t\t$k++;\n \t\t\t}\n \t\t\n \t\t\t\n \t\t\t$current_datetime_obj = new \\DateTime();\n \t\t\t$return_r['collage_description'] = $photo_text_filtered;\n \t\t\t$return_r['collage_description_when_shared'] = $photo_detail['wallpost_text'];\n \t\t\t\n \t\t\t// original user data\n \t\t\t$return_r['original_user_id'] = $photo_detail['original_user_id'];\n \t\t\t$return_r['original_user_full_name'] = $photo_detail['original_user_full_name'];\n \t\t\t$return_r['original_user_type'] = $photo_detail['original_user_type'];\n \t\t\t$return_r['original_user_prof_pic'] = Helper_common::getUserProfessionalPhoto( $album_owner_id,3);\n \t\t\t\n \t\t\t\n \t\t\t$return_r['original_user_post_created_at'] = \\Helper_common::nicetime($imgObj->getCreated_at()->format(\"Y-m-d H:i\"));\n \t\t\t// original user data ends.\n \t\t\t\n \t\t\t\n \t\t\t$return_r['collage_created_at'] = \\Helper_common::nicetime( $current_datetime_obj->format(\"Y-m-d H:i\") );\n \t\t\t$return_r['is_ok_comment_share_pannel_visible'] = \\Helper_common::is_ok_comment_share_pannel_visible( $this->getRequest()->getParam(\"privacy\"), Auth_UserAdapter::getIdentity()->getId(), array(Auth_UserAdapter::getIdentity()->getId()), Auth_UserAdapter::getIdentity()->getId() );\n \t\t\t$return_r['privacy'] = $this->getRequest()->getParam(\"privacy\");\n \t\t\t$return_r['post_update_type'] = \\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM_BY_SHARING;\n \t\t\t$return_r['is_success'] = 1;\n \t\t\t$return_r['msg'] = \"Photo uploaded successfully.\";\n \t\t\t$return_r['share_count_of_photo'] = $share_count_of_photo;\n \t\t\t\n \t\t\techo Zend_Json::encode( $return_r );\n \t\t\tdie;\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$return_r['is_success'] = 0;\n \t\t\t$return_r['msg'] = \"Oops! An error occured while posting your photos. Please try again.\";\n \t\t\techo Zend_Json::encode( $return_r );\n \t\t\tdie;\n \t\t}\n \t}\n \telse\n \t{\n \t\t$return_r['is_success'] = 0;\n \t\t$return_r['msg'] = \"Oops! An error occured while posting your photos. Please try again.\";\n \t\techo Zend_Json::encode( $return_r );\n \t\tdie;\n \t}\n \n }\n \n /*===================================================================\n sharing wallpost from socialise wall.\n It covers following cases:\n POST_UPDATE_TYPE_ALBUM\n POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM\n POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM_BY_SHARING\n POST_UPDATE_TYPE_PROFILE_PHOTO_CHANGED\n ===================================================================*/\n if( $prms['shared_from_wall_to_wall'] )\n {\n \t\n \t//get record from database\n \t$wallpost_info = \\Extended\\wall_post::getWallpostInfo( $prms['wallpost_id'] );\n \t\n \t\n \t$post_update_type = $wallpost_info['post_update_type'];\n \n \t//Create photo group for these photos.\n \t$photo_group_id = \\Extended\\photo_group::addPhotoGroup( Auth_UserAdapter::getIdentity()->getId() );\n \n \t// case when post update type is 14 i.e profile picture is shared\n \tif(\n $wallpost_info['post_update_type'] == \\Extended\\wall_post::POST_UPDATE_TYPE_PROFILE_PHOTO_CHANGED\n && isset($wallpost_info['image_name'])\n )\n \t{\n \t\t$unique_image_name = Helper_common::getUniqueNameForFile($wallpost_info['image_name']);\n \t\t$new_image_name = 'thumbnail_'.$unique_image_name;\n \t\t$image_path = $wallpost_info['image_path'];\n \t\t$gallery_image_path = $wallpost_info['gallery_image_path'];\n \t\t$original_image_path = $wallpost_info['original_image_path'];\n \t\t$popup_image_path = $wallpost_info['popup_image_path'];\n \t\t \n \t\t// copy image in gallery thumbnails directory\n \t\tcopy( $gallery_image_path, $galleryDirectory.\"/\".$new_image_name);\n \t\t \n \t\t// copy image in original photos directory\n \t\tcopy( $original_image_path, $originalDirecory.\"/\".$unique_image_name);\n \t\t \n \t\t// copy image in popup thumbnails directory\n \t\tcopy( $popup_image_path, $popupDirectory.\"/\".$new_image_name);\n \t\t \n \t\t//copy image in wall thumbnails directory\n \t\tif( copy( $image_path, $wallDirectory.\"/\".$new_image_name ) )\n \t\t{\n \t\t\t//Getting the id of default album.\n \t\t\t$default_album_id = \\Extended\\socialise_album::isThisTypeOfAlbumExists( Auth_UserAdapter::getIdentity()->getId(), \\Extended\\socialise_album::DEFAULT_ALBUM_NAME );\n \t\t\n \t\t\tif( !$default_album_id )\n \t\t\t{\n \t\t\t\t//Making entry to DB.\n \t\t\t\t$album_data = \\Extended\\socialise_album::addAlbum(\n \t\t\t\t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\t\t\t\t\\Extended\\socialise_album::DEFAULT_ALBUM_NAME,\n \t\t\t\t\t\t\\Extended\\socialise_album::VISIBILITY_CRITERIA_PUBLIC,\n \t\t\t\t\t\t1,\n \t\t\t\t\t\t\\Extended\\socialise_album::DEFAULT_ALBUM_NAME );\n \t\t\t\t$album_id = $album_data['id'];\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$album_id = $default_album_id;\n \t\t\t}\n \t\t}\n \t\t\n \t}\n \telse \n \t{\n \t\t$unique_image_name_db = array();\n\t \tforeach( $wallpost_info['collage'] as $single_image )\n\t \t{\n\t \t\t$unique_image_name = Helper_common::getUniqueNameForFile($single_image['image_name']);\n\t \t\t$unique_image_name_db[] = Helper_common::getUniqueNameForFile($single_image['image_name']);\n\t \t\t$new_image_name = 'thumbnail_'.$unique_image_name;\n\t \t\t//$new_image_name = 'thumbnail_'.$single_image['image_name'];\n\t \t\t$image_path = $single_image['image_path'];\n\t \t\t$gallery_image_path = $single_image['gallery_image_path'];\n\t \t\t$original_image_path = $single_image['original_image_path'];\n\t \t\t$popup_image_path = $single_image['popup_image_path'];\n\t \t\t\n\t \t\t// copy image in gallery thumbnails directory\n\t \t\tcopy( $gallery_image_path, $galleryDirectory.\"/\".$new_image_name);\n\t \t\t\n\t \t\t// copy image in original photos directory\n\t \t\tcopy( $original_image_path, $originalDirecory.\"/\".$unique_image_name);\n\t \t\t\n\t \t\t// copy image in popup thumbnails directory\n\t \t\tcopy( $popup_image_path, $popupDirectory.\"/\".$new_image_name);\n\t \t\t\n\t \t\t//copy image in wall thumbnails directory\n\t \t\tif( copy( $image_path, $wallDirectory.\"/\".$new_image_name ) )\n\t \t\t{\t\t\n\t \t\t\t//Getting the id of default album.\n\t \t\t\t$default_album_id = \\Extended\\socialise_album::isThisTypeOfAlbumExists( Auth_UserAdapter::getIdentity()->getId(), \\Extended\\socialise_album::DEFAULT_ALBUM_NAME );\n\t \n\t \t\t\t if( !$default_album_id )\n\t \t\t\t {\n\t\t \t\t\t//Making entry to DB.\n\t \t\t\t \t$album_data = \\Extended\\socialise_album::addAlbum(\n\t \t\t\t \t\t\tAuth_UserAdapter::getIdentity()->getId(),\n\t \t\t\t \t\t\t\\Extended\\socialise_album::DEFAULT_ALBUM_NAME,\n\t \t\t\t \t\t\t\\Extended\\socialise_album::VISIBILITY_CRITERIA_PUBLIC,\n\t \t\t\t \t\t\t1,\n\t \t\t\t \t\t\t\\Extended\\socialise_album::DEFAULT_ALBUM_NAME );\n\t \t\t\t \t$album_id = $album_data['id'];\n\t \t\t\t }\n\t \t\t\t else\n\t \t\t\t {\n\t \t\t\t \t$album_id = $default_album_id;\t\n\t \t\t\t }\n\t \t\t} \n\t \t}\n \t}\n \n \t//Adding entry to wallpost table for sharing photos\n \t$wall_post_id = \\Extended\\wall_post::post_photo(\n \t\t\t$photo_text_filtered,\n \t\t\t$this->getRequest()->getParam(\"privacy\"),\n \t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\t$wallpost_info['wallpost_user_id'],\n \t\t\t\\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM_BY_SHARING,\n \t\t\t\\Extended\\wall_post::POST_TYPE_MANUAL,\n \t\t\t\\Extended\\wall_post::WALL_TYPE_SOCIALISE,\n \t\t\t$photo_group_id,\n \t\t\t$album_id,\n \t\t\tnull,\n \t\t\t$wallpost_info['wallpost_text'],\n \t\t\t$prms['wallpost_id'] );\n \n \tif( $album_id )\n \t{\n \t\tif($wallpost_info['post_update_type'] == \\Extended\\wall_post::POST_UPDATE_TYPE_PROFILE_PHOTO_CHANGED)\n \t\t{\n \t\t\t$photo_names_arr = $unique_image_name;\n \t\t}\n \t\telse \n \t\t{\n\t \t\t$photo_names_arr = array();\n\t \t\tforeach ( $unique_image_name_db as $photo_name )\n\t \t\t{\n\t \t\t\t$photo_names_arr[] = $photo_name;\n\t \t\t}\t\n \t\t}\n \t\t\n \t\n \t\t//adding entry to socialise photo table\n \t\t$photo_info = \\Extended\\socialise_photo::addPhotos(\n \t\t\t\t$album_id,\n \t\t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\t\t$photo_names_arr,\n \t\t\t\t$this->getRequest()->getParam(\"privacy\"),\n \t\t\t\t'',\n \t\t\t\t$photo_group_id\n \t\t);\n \t\n \t\tif( $photo_info )\n \t\t{\n \t\t\t$return_r['wall_post_id'] = $wall_post_id;\n \t\t\t$return_r['album_id'] = $album_id;\n \t\t\t$return_r['user_id'] = Auth_UserAdapter::getIdentity()->getId();\n \t\t\t$return_r['user_gender'] = Auth_UserAdapter::getIdentity()->getGender();\n \t\t\t$return_r['user_name'] = Auth_UserAdapter::getIdentity()->getFirstname().\" \".Auth_UserAdapter::getIdentity()->getLastname();\n \t\t\t$return_r['user_image'] = Helper_common::getUserProfessionalPhoto( Auth_UserAdapter::getIdentity()->getId(), 3 );\n \t\t\t \n \t\t\t//Get photos of the new group, created just above.\n \t\t\t$em = \\Zend_Registry::get('em');\n \t\t\t$em->refresh( \\Extended\\photo_group::getRowObject($photo_group_id) );\n \t\t\t$photo_group_obj = \\Extended\\photo_group::getRowObject($photo_group_id);\n \t\t\t\n \t\t\t//====================================================================\n \t\t\t// Adding data for share table\n \t\t\t//====================================================================\n \t\t\t\n \t\t\t//Get obj of obj of wallpost that is shared.\n\t\t\t\t\t$shared_wallpost_obj = \\Extended\\wall_post::getRowObject($prms['wallpost_id']);\n \t\t\t\n \t\n \t\t\tif( $shared_wallpost_obj->getPost_update_type() == \\Extended\\wall_post::POST_UPDATE_TYPE_ALBUM )\n \t\t\t{\n \t\t\t\t$share_info_id = \\Extended\\share::addShareInfo(\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$logged_in_user_id, \n\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t$prms['wallpost_id'], \n\t\t\t\t\t\t\t\t\t \t\t\t\t\t\tnull, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$shared_wallpost_obj->getWall_postsSocialise_album()->getId());\n \t\t\t\t$share_count_of_album = $shared_wallpost_obj->getWall_postsSocialise_album()->getShare()->count();\n \t\t\t\t$share_count_of_post = $shared_wallpost_obj->getWall_postsShare()->count();\n \t\t\t}\n \t\t\telseif ($shared_wallpost_obj->getPost_update_type() == \\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM \n \t\t\t\t\t|| $shared_wallpost_obj->getPost_update_type() == \\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM_BY_SHARING )\n \t\t\t{\n \t\t\t\t$share_info_id = \\Extended\\share::addShareInfo(\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t$logged_in_user_id, \n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t$prms['wallpost_id'], \n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\tnull, \n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\tnull);\n \t\t\t\t$share_count_of_album = '';\n \t\t\t\t$share_count_of_post = $shared_wallpost_obj->getWall_postsShare()->count();\n \t\t\t}\t\n \t\t\telseif($shared_wallpost_obj->getPost_update_type() == \\Extended\\wall_post::POST_UPDATE_TYPE_PROFILE_PHOTO_CHANGED)\n \t\t\t{\n \t\t\t\t$share_info_id = \\Extended\\share::addShareInfo(\n \t\t\t\t\t\t$logged_in_user_id,\n \t\t\t\t\t\t$prms['wallpost_id'],\n \t\t\t\t\t\tnull,\n \t\t\t\t\t\tnull);\n \t\t\t\t$share_count_of_album = '';\n \t\t\t\t$share_count_of_post = $shared_wallpost_obj->getWall_postsShare()->count();\n \t\t\t\t\n \t\t\t}\n \t\t\t//====================================================================\n \t\t\t//Adding data for share table Ends\n \t\t\t//====================================================================\n \t\t\n\t\t \t\t\t$k = 0;\n\t\t \t\t\tforeach ( $photo_group_obj->getSocialisePhoto() as $photo )\n\t\t \t\t\t{\n\t\t \t\t\t\t$return_r['collage'][$k]['image_path'] = IMAGE_PATH.\"/albums/user_\".$logged_in_user_id.\"/album_default/wall_thumbnails/thumbnail_\".$photo->getImage_name();\n\t\t \t\t\t\t$return_r['collage'][$k]['image_id'] = $photo->getId();\n\t\t \t\t\t\t$size = getimagesize( $return_r['collage'][$k]['image_path'] );\n\t\t \t\t\t\t$k++;\n\t\t \t\t\t\t$width = $size[0];\n\t\t \t\t\t\t$height = $size[1];\n\t\t \t\t\t\t$aspect = $height / $width;\n\t\t \t\t\t\tif ($aspect >= 1)\n\t\t \t\t\t\t{\n\t\t \t\t\t\t//vertical\n\t\t \t\t\t\t$return_r['first_img_portrait_or_landscape'] = 1;\n\t\t \t\t\t\t}\n\t\t \t\t\t\telse\n\t\t \t\t\t\t{\n\t\t \t\t\t\t//horizontal\n\t\t \t\t\t\t$return_r['first_img_portrait_or_landscape'] = 2;\n\t\t \t\t\t\t} \n\t\t \t\t\t}\n\t\t \t\t\n \n \t\t\t$return_r['collage_description'] = $photo_text_filtered;\n \t\t\t$return_r['collage_description_when_shared'] = $wallpost_info['wallpost_text'];\n \t\t\t$current_datetime_obj = new \\DateTime();\n \t\t\t$return_r['collage_created_at'] = \\Helper_common::nicetime( $current_datetime_obj->format(\"Y-m-d H:i\") );\n \t\t\t$return_r['is_ok_comment_share_pannel_visible'] = \\Helper_common::is_ok_comment_share_pannel_visible( $this->getRequest()->getParam(\"privacy\"), Auth_UserAdapter::getIdentity()->getId(), array(Auth_UserAdapter::getIdentity()->getId()), Auth_UserAdapter::getIdentity()->getId() );\n \t\t\t$return_r['privacy'] = $this->getRequest()->getParam(\"privacy\");\n \t\t\t$return_r['post_update_type'] = \\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM_BY_SHARING;\n \t\t\t$return_r['is_success'] = 1;\n \t\t\t$return_r['msg'] = \"Photo uploaded successfully.\";\n \t\t\t$return_r['original_user_id'] = $wallpost_info['original_user_id'];\n \t\t\t$return_r['original_user_full_name'] = $wallpost_info['original_user_full_name'];\n \t\t\t$return_r['original_user_type'] = $wallpost_info['original_user_type'];\n \t\t\t$return_r['original_user_prof_pic'] = Helper_common::getUserProfessionalPhoto( $wallpost_info['original_user_id'],3);\n \t\t\t$return_r['original_user_post_created_at'] = $wallpost_info['wallpost_created_at'];\n// \t\t\t$return_r['original_user']['id'] = $wallpost_info['original_user_id'];\n// \t\t\t$return_r['original_user']['fullname'] = $wallpost_info['original_user_full_name'];\n \t\t\t$return_r['share_count_of_album'] = $share_count_of_album;\n \t\t\t$return_r['share_count_of_post'] = $share_count_of_post;\n \t\t\t$return_r['sharers_string']['string'] = Helper_common::getSharerStringforPost($wall_post_id,$logged_in_user_id);\n\t\t\t\t\t$return_r['sharers_string']['shared_from_wallpost_exist'] = true;\n \t \t\n \t\t\t\n \t\t\techo Zend_Json::encode( $return_r );\n \t\t\tdie;\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$return_r['is_success'] = 0;\n \t\t\t$return_r['msg'] = \"Oops! An error occured while posting your photos. Please try again.\";\n \t\t\techo Zend_Json::encode( $return_r );\n \t\t\tdie;\n \t\t}\n \t}\n \telse\n \t{\n \t\t$return_r['is_success'] = 0;\n \t\t$return_r['msg'] = \"Oops! An error occured while posting your photos. Please try again.\";\n \t\techo Zend_Json::encode( $return_r );\n \t\tdie;\n \t}\n\t\n }\n \n //==============================================================================\n // Sharing albums from albums section, which does not has associated wallpost [ no wallpost id ]. \n // i.e. albums like default, profile pictures and cover photo etc.\n //==============================================================================\n else if($prms['sharing_album_only'])\n {\n \t//get record from database\n \t$album_info = \\Extended\\socialise_album::getSocialiseAlbumInfo($prms['album_id']);\n \t\n \t//Create photo group for these photos.\n \t$photo_group_id = \\Extended\\photo_group::addPhotoGroup( Auth_UserAdapter::getIdentity()->getId() );\n \t\n \tforeach( $album_info['collage'] as $single_image )\n \t{\n \t\t$unique_image_name = Helper_common::getUniqueNameForFile($single_image['image_name']);\n \t\t$unique_image_name_db[] = Helper_common::getUniqueNameForFile($single_image['image_name']);\n \t\t$new_image_name = 'thumbnail_'.$unique_image_name;\n \t\t$image_path = $single_image['image_path'];\n \t\t$gallery_image_path = $single_image['gallery_image_path'];\n \t\t$original_image_path = $single_image['original_image_path'];\n \t\t$popup_image_path = $single_image['popup_image_path'];\n \t\t\n \t\t\n \t\t// copy image in gallery thumbnails directory\n \t\tcopy( $gallery_image_path, $galleryDirectory.\"/\".$new_image_name);\n \t\n \t\t// copy image in original photos directory\n \t\tcopy( $original_image_path, $originalDirecory.\"/\".$unique_image_name);\n \t\n \t\t// copy image in popup thumbnails directory\n \t\tcopy( $popup_image_path, $popupDirectory.\"/\".$new_image_name);\n \t\n \t\t//copy image in wall thumbnails directory\n \t\tif( copy( $image_path, $wallDirectory.\"/\".$new_image_name ) )\n \t\t{\n \t\t\t//Getting the id of default album.\n \t\t\t$default_album_id = \\Extended\\socialise_album::isThisTypeOfAlbumExists( Auth_UserAdapter::getIdentity()->getId(), \\Extended\\socialise_album::DEFAULT_ALBUM_NAME );\n \t\t\t \n \t\t\tif( !$default_album_id )\n \t\t\t{\n \t\t\t\t//Making entry to DB.\n \t\t\t\t$album_data = \\Extended\\socialise_album::addAlbum(\n \t\t\t\t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\t\t\t\t\\Extended\\socialise_album::DEFAULT_ALBUM_NAME,\n \t\t\t\t\t\t\\Extended\\socialise_album::VISIBILITY_CRITERIA_PUBLIC,\n \t\t\t\t\t\t1,\n \t\t\t\t\t\t\\Extended\\socialise_album::DEFAULT_ALBUM_NAME );\n \t\t\t\t$album_id = $album_data['id'];\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$album_id = $default_album_id;\n \t\t\t}\n \t\t}\n \t}\n \t\n \t//Adding entry to wallpost table for sharing photos\n \t$wall_post_id = \\Extended\\wall_post::post_photo(\n \t\t\t$photo_text_filtered,\n \t\t\t$this->getRequest()->getParam(\"privacy\"),\n \t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\t$album_info[\"original_user_id\"],\n \t\t\t\\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM_BY_SHARING,\n \t\t\t\\Extended\\wall_post::POST_TYPE_MANUAL,\n \t\t\t\\Extended\\wall_post::WALL_TYPE_SOCIALISE,\n \t\t\t$photo_group_id,\n \t\t\t$album_id,\n \t\t\tnull,\n \t\t\tnull );\n \t\n \tif( $album_id )\n \t{\n \t\t$photo_names_arr = array();\n \t\tforeach ( $unique_image_name_db as $unique_image_name )\n \t\t{\n \t\t\t$photo_names_arr[] = $unique_image_name;\n \t\t}\n \t\n \t\t//adding entry to socialise photo table\n \t\t$photo_info = \\Extended\\socialise_photo::addPhotos(\n \t\t\t\t$album_id,\n \t\t\t\tAuth_UserAdapter::getIdentity()->getId(),\n \t\t\t\t$photo_names_arr,\n \t\t\t\t$this->getRequest()->getParam(\"privacy\"),\n \t\t\t\t'',\n \t\t\t\t$photo_group_id\n \t\t);\n \t\n \t\n \t\tif( $photo_info )\n \t\t{\n \t\t\t$return_r['wall_post_id'] = $wall_post_id;\n \t\t\t$return_r['album_id'] = $album_id;\n \t\t\t$return_r['user_id'] = Auth_UserAdapter::getIdentity()->getId();\n \t\t\t$return_r['user_gender'] = Auth_UserAdapter::getIdentity()->getGender();\n \t\t\t$return_r['user_name'] = Auth_UserAdapter::getIdentity()->getFirstname().\" \".Auth_UserAdapter::getIdentity()->getLastname();\n \t\t\t$return_r['user_image'] = Helper_common::getUserProfessionalPhoto( Auth_UserAdapter::getIdentity()->getId(), 3 );\n \t\n \t\t\t//Get photos of the new group, created just above.\n \t\t\t$em = \\Zend_Registry::get('em');\n \t\t\t$em->refresh( \\Extended\\photo_group::getRowObject($photo_group_id) );\n \t\t\t$photo_group_obj = \\Extended\\photo_group::getRowObject($photo_group_id);\n \t\t\t \n \t\t\t//====================================================================\n \t\t\t// Adding data for share table\n \t\t\t//====================================================================\n \t\t\t \n \t\t\t//Get obj of obj of wallpost that is shared.\n \t\t\t$shared_album_obj = \\Extended\\socialise_album::getRowObject($prms['album_id'] );\n \t\t\t \n \t\t\t \n \t\t\t\t$share_info_id = \\Extended\\share::addShareInfo(\n \t\t\t\t\t\t$logged_in_user_id,\n \t\t\t\t\t\tnull,\n \t\t\t\t\t\tnull,\n \t\t\t\t\t\t$prms['album_id']);\n \t\t\t\t$share_count_of_album = $shared_album_obj->getShare()->count();\n \t\t\t//====================================================================\n \t\t\t//Adding data for share table Ends\n \t\t\t//====================================================================\n \t\t\t$k = 0;\n \t\t\tforeach ( $photo_group_obj->getSocialisePhoto() as $photo )\n \t\t\t{\n \t\t\t\t$return_r['collage'][$k]['image_path'] = IMAGE_PATH.\"/albums/user_\".$logged_in_user_id.\"/album_default/wall_thumbnails/thumbnail_\".$photo->getImage_name();\n \t\t\t\t$return_r['collage'][$k]['image_id'] = $photo->getId();\n \t\t\t\t$size = getimagesize( $return_r['collage'][$k]['image_path'] );\n \t\t\t\t$k++;\n \t\t\t\t$width = $size[0];\n \t\t\t\t$height = $size[1];\n \t\t\t\t$aspect = $height / $width;\n \t\t\t\tif ($aspect >= 1)\n \t\t\t\t{\n \t\t\t\t\t//vertical\n \t\t\t\t\t$return_r['first_img_portrait_or_landscape'] = 1;\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\t//horizontal\n \t\t\t\t\t$return_r['first_img_portrait_or_landscape'] = 2;\n \t\t\t\t}\n \t\t\t}\n \t\n \t\t\t$return_r['collage_description'] = $photo_text_filtered;\n// \t\t\t$return_r['collage_description_when_shared'] = $wallpost_info['wallpost_text'];\n \t\t\t$current_datetime_obj = new \\DateTime();\n \t\t\t$return_r['collage_created_at'] = \\Helper_common::nicetime( $current_datetime_obj->format(\"Y-m-d H:i\") );\n \t\t\t$return_r['is_ok_comment_share_pannel_visible'] = \\Helper_common::is_ok_comment_share_pannel_visible( $this->getRequest()->getParam(\"privacy\"), Auth_UserAdapter::getIdentity()->getId(), array(Auth_UserAdapter::getIdentity()->getId()), Auth_UserAdapter::getIdentity()->getId() );\n \t\t\t$return_r['privacy'] = $this->getRequest()->getParam(\"privacy\");\n \t\t\t$return_r['post_update_type'] = \\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM_BY_SHARING;\n \t\t\t$return_r['is_success'] = 1;\n \t\t\t$return_r['msg'] = \"Photo uploaded successfully.\";\n \t\t\t$return_r['original_user_id'] = $album_info['original_user_id'];\n \t\t\t$return_r['original_user_full_name'] = $album_info['original_user_full_name'];\n \t\t\t$return_r['share_count_of_album'] = $share_count_of_album;\n \t\t\t$return_r['share_count_of_post'] = '';\n \t\t\techo Zend_Json::encode( $return_r );\n \t\t\tdie;\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$return_r['is_success'] = 0;\n \t\t\t$return_r['msg'] = \"Oops! An error occured while posting your photos. Please try again.\";\n \t\t\techo Zend_Json::encode( $return_r );\n \t\t\tdie;\n \t\t}\n \t}\n \telse\n \t{\n \t\t$return_r['is_success'] = 0;\n \t\t$return_r['msg'] = \"Oops! An error occured while posting your photos. Please try again.\";\n \t\techo Zend_Json::encode( $return_r );\n \t\tdie;\n \t}\n }\n \n}", "public function unshare($userId, array $album)\n\t{\n\t\t$shareUsers = unserialize($album['album_share_users']);\n\t\t\n\t\tif ($shareUsers !== false)\n\t\t{\n\t\t\t$db = $this->_getDb();\n\n\t\t\tXenForo_Db::beginTransaction($db);\n\n\t\t\t$db->delete('xengallery_shared_map', \"album_id = $album[album_id] AND shared_user_id = $userId\");\n\n\t\t\tXenForo_Db::commit($db);\n\n\t\t\tunset($shareUsers[$userId]);\n\n\t\t\t$albumWriter = XenForo_DataWriter::create('XenGallery_DataWriter_Album');\n\n\t\t\t$albumWriter->setExistingData($album['album_id']);\n\t\t\t$albumWriter->set('album_share_users', serialize($shareUsers));\n\n\t\t\t$albumWriter->save();\n\t\t}\n\t}", "public function import()\n {\n if ($this->status == 1) return ;\n \t\n \t\ttry {\n \t\t\t$archive = ezcArchive::open( \"var/archives/{$this->filename}\" ); \n \t\t} catch (Exception $e){\n \t\t\t$this->cleanup();\n \t\t\treturn ;\n \t\t}\t\n \t\t\n \t\tif (!$archive->valid()) {\n \t\t\t$this->cleanup();\n \t\t\treturn ;\n \t\t}\n \t\t\n \t\t// Mark archive as in progress\n \t\t$this->status = 1;\n \t\terLhcoreClassGallery::getSession()->update($this);\n \t\t\n \t\t$wwwUser = erConfigClassLhConfig::getInstance()->getSetting( 'site', 'default_www_user' );\n \t\t$wwwUserGroup = erConfigClassLhConfig::getInstance()->getSetting( 'site', 'default_www_group' );\n \t\t$publicCategoryID = erConfigClassLhConfig::getInstance()->getSetting( 'site', 'public_category_id' );\n \t\t \t\t\n \t\t$session = erLhcoreClassGallery::getSession();\n \t\t\n \t\tif ($this->album_name != '')\n \t\t{\n \t\t\t$album = new erLhcoreClassModelGalleryAlbum();\n \t\t\t\n \t\t\tif ($this->user_id == 0 || $this->user_id == erConfigClassLhConfig::getInstance()->getSetting( 'user_settings','anonymous_user_id')) {\n \t\t\t\t$album->category = $publicCategoryID;\n \t\t\t} else {\n \t\t\t\t$album->category = erLhcoreClassModelGalleryCategory::fetchCategoryColumn(array('filter' => array('owner_id' => $this->user_id)),'cid');\n \t\t\t}\n \t\t\t\n \t\t\tif ($album->category == 0) {\n \t\t\t $album->category = $publicCategoryID;\n \t\t\t}\n \t\t\t \t\t\t\n \t\t\t$album->title = $this->album_name;\n \t\t\t$album->description = $this->description; \t\t\t\n \t\t\t$album->owner_id = $this->user_id;\n \t\t\t$album->keyword = $this->keywords;\n \t\t\t\n \t\t\t$session->save($album);\n \t\t\t\n \t\t} else { \n \t\t if ($this->album_id > 0){\n \t\t\t $album = erLhcoreClassModelGalleryAlbum::fetch($this->album_id); \n \t\t } else {\n \t\t $this->cleanup();\n \t\t return ;\n \t\t }\n \t\t}\n \t\t\n \t\t$config = erConfigClassLhConfig::getInstance();\n \t\t\n \t\t// Auto approvement\n \t\t$userOwner = erLhcoreClassUser::instance();\n\t $userOwner->setLoggedUser($this->user_id);\n\t \n\t $canApproveSelfImages = $userOwner->hasAccessTo('lhgallery','auto_approve_self_photos');\n $canApproveAllImages = $userOwner->hasAccessTo('lhgallery','auto_approve'); \n $approved = ($album->owner_id == $this->user_id && $canApproveSelfImages) || ($canApproveAllImages == true); \t \n\t \t\t\t \n \t\twhile( $archive->valid() )\n\t\t{\n\t\t\t// Returns the current entry (ezcArchiveEntry).\n\t\t\t$entry = $archive->current();\n\t\t\t\n\t\t\t// ezcArchiveEntry has an __toString() method.\n\t\t\tif ($entry->isFile())\n\t\t\t{\n\t\t\t\tif (!file_exists(\"var/tmpfiles/\".$this->id))\n\t\t\t\tmkdir(\"var/tmpfiles/\".$this->id,$config->getSetting( 'site', 'StorageDirPermissions' ));\n\t\t\t\t \t\t\t\t\t\n\t\t\t\t$pathExtracted = \"var/tmpfiles/{$this->id}/\" . $entry->getPath();\t\n\t\t\t\ttry {\t\t\t\t\t\t\t\n\t\t\t\t $archive->extractCurrent( \"var/tmpfiles/{$this->id}/\" );\n\t\t\t\t} catch (Exception $e){\n\t\t\t\t \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (($filetype = erLhcoreClassModelGalleryFiletype::isValidLocal($pathExtracted)) !== false) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$image = new erLhcoreClassModelGalleryImage();\n\t\t\t\t $image->aid = $album->aid;\t\t\t\t \t\t\t\t \t\n\t\t\t\t $session->save($image);\n\n\t\t\t\t try {\t\t\t\t \t\n\t\t\t\t \t\t\t\t\t \t\n\t\t\t\t \t$photoDir = 'albums/userpics/'.date('Y').'y/'.date('m').'/'.date('d').'/'.$this->user_id.'/'.$album->aid;\n\t \t $photoDirPhoto = 'userpics/'.date('Y').'y/'.date('m').'/'.date('d').'/'.$this->user_id.'/'.$album->aid.'/';\n\t \t erLhcoreClassImageConverter::mkdirRecursive($photoDir,true);\n\t \t \n\t\t\t\t \t$pathElements = explode('/',$pathExtracted);\n\t\t\t\t \tend($pathElements);\n\n\t\t\t\t \t$fileNamePhysic = erLhcoreClassImageConverter::sanitizeFileName(current($pathElements));\n\n\t\t\t\t \tif (file_exists($photoDir.'/'.$fileNamePhysic)) {\n\t\t\t\t \t\t$fileNamePhysic = erLhcoreClassModelForgotPassword::randomPassword(5).time().'-'.$fileNamePhysic;\n\t\t\t\t \t}\n\t\t\t\t \t\n\t\t\t\t \t$filetype->processLocal($image,array(\n \t 'photo_dir' => $photoDir,\n \t 'photo_dir_photo' => $photoDirPhoto,\n \t 'file_name_physic' => $fileNamePhysic,\n \t 'post_file_name' => $pathExtracted,\n \t 'file_session' => $this,\n \t 'album' => $album,\n \t ));\n\t \t\t\t \n\t\t\t\t \t$image->ctime = time();\n\t\t\t\t \t$image->owner_id = $this->user_id;\n\t\t\t\t \t$image->pic_rating = 0;\n\t\t\t\t \t$image->votes = 0;\n\n\t\t\t\t \t$image->title = '';\n\t\t\t\t \t$image->caption = '';\n\t\t\t\t \t$image->keywords = '';\n\t\t\t\t \t$image->approved = $approved;\n\t\t\t\t \t$image->filename = $fileNamePhysic;\n\n\t\t\t\t \t$session->update($image);\n\t\t\t\t \t$image->clearCache();\n\t\t\t\t \t\n\t\t\t\t \t// Index colors\n\t erLhcoreClassPalleteIndexImage::indexImage($image,true);\n\n\t // Index face if needed\n\t erLhcoreClassModelGalleryFaceData::indexImage($image,true);\n\t \n\t // Index in search table\n\t erLhcoreClassModelGallerySphinxSearch::indexImage($image,true);\n\t \t \n\t // Index in imgseek service\n\t erLhcoreClassModelGalleryImgSeekData::indexImage($image,true);\n\t \n\t erLhcoreClassModelGalleryAlbum::updateAddTime($image);\n\t \n\t\t\t\t \t\n\t\t\t\t } catch (Exception $e) {\t\t\t\t \t\n\t\t\t\t \terLhcoreClassLog::writeCronjob('Exception during archive image import'.$e);\n\t\t\t\t \t$session->delete($image);\n\t\t\t\t \tunlink($pathExtracted);\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tunlink($pathExtracted);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\t\t\t\n\t\t\t$archive->next();\n\t\t} \n\t\t\n\t\t$album->clearAlbumCache();\n\t\t\n\t\t// Expires last uploads shard index\n\t erLhcoreClassGallery::expireShardIndexByIdentifier(array('last_uploads','last_commented'));\n\t \n \t\t$this->cleanup(); \t\t \t \n }", "static public function markread($mode, $album_id = false)\n\t{\n\t\tglobal $db, $user, $table_prefix, $phpbb_container;\n\n\t\t$gallery_user = $phpbb_container->get('phpbbgallery.core.user');\n\t\t$gallery_user->set_user_id($user->data['user_id']);\n\n\t\t// Sorry, no guest support!\n\t\tif ($user->data['user_id'] == ANONYMOUS)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($mode == 'all')\n\t\t{\n\t\t\tif ($album_id === false || !sizeof($album_id))\n\t\t\t{\n\t\t\t\t// Mark all albums read (index page)\n\t\t\t\t$sql = 'DELETE FROM ' . $table_prefix . 'gallery_albums_track\n\t\t\t\t\tWHERE user_id = ' . $user->data['user_id'];\n\t\t\t\t$db->sql_query($sql);\n\n\t\t\t\t$gallery_user->update_data(array(\n\t\t\t\t\t\t'user_lastmark'\t\t=> time(),\n\t\t\t\t));\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\telse if ($mode == 'albums')\n\t\t{\n\t\t\t// Mark album read\n\t\t\tif (!is_array($album_id))\n\t\t\t{\n\t\t\t\t$album_id = array($album_id);\n\t\t\t}\n\n\t\t\t$sql = 'SELECT album_id\n\t\t\t\tFROM ' . $table_prefix . \"gallery_albums_track\n\t\t\t\tWHERE user_id = {$user->data['user_id']}\n\t\t\t\t\tAND \" . $db->sql_in_set('album_id', $album_id);\n\t\t\t$result = $db->sql_query($sql);\n\n\t\t\t$sql_update = array();\n\t\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t$sql_update[] = $row['album_id'];\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\n\t\t\tif (sizeof($sql_update))\n\t\t\t{\n\t\t\t\t$sql = 'UPDATE ' . $table_prefix . 'gallery_albums_track\n\t\t\t\t\tSET mark_time = ' . time() . \"\n\t\t\t\t\tWHERE user_id = {$user->data['user_id']}\n\t\t\t\t\t\tAND \" . $db->sql_in_set('album_id', $sql_update);\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\n\t\t\tif ($sql_insert = array_diff($album_id, $sql_update))\n\t\t\t{\n\t\t\t\t$sql_ary = array();\n\t\t\t\tforeach ($sql_insert as $a_id)\n\t\t\t\t{\n\t\t\t\t\t$sql_ary[] = array(\n\t\t\t\t\t\t'user_id'\t=> (int) $user->data['user_id'],\n\t\t\t\t\t\t'album_id'\t=> (int) $a_id,\n\t\t\t\t\t\t'mark_time'\t=> time()\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$db->sql_multi_insert($table_prefix . 'gallery_albums_track', $sql_ary);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\telse if ($mode == 'album')\n\t\t{\n\t\t\tif ($album_id === false)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$sql = 'UPDATE ' . $table_prefix . 'gallery_albums_track\n\t\t\t\tSET mark_time = ' . time() . \"\n\t\t\t\tWHERE user_id = {$user->data['user_id']}\n\t\t\t\t\tAND album_id = $album_id\";\n\t\t\t$db->sql_query($sql);\n\n\t\t\tif (!$db->sql_affectedrows())\n\t\t\t{\n\t\t\t\t$db->sql_return_on_error(true);\n\n\t\t\t\t$sql_ary = array(\n\t\t\t\t\t'user_id'\t\t=> (int) $user->data['user_id'],\n\t\t\t\t\t'album_id'\t\t=> (int) $album_id,\n\t\t\t\t\t'mark_time'\t\t=> time(),\n\t\t\t\t);\n\n\t\t\t\t$db->sql_query('INSERT INTO ' . $table_prefix . 'gallery_albums_track ' . $db->sql_build_array('INSERT', $sql_ary));\n\n\t\t\t\t$db->sql_return_on_error(false);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t}", "function getAlbums() {\n\n $ro = new GetAlbumsRO();\n $files = glob('Pics/*');\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $onefile = $files[$i];\n $imgs_in_album = glob(\"$onefile/*.[jJ][pP][gG]\");\n if (count($imgs_in_album) > 0)\n $album_image = $imgs_in_album[0];\n else\n $album_image = \"res/GenericAlbum.jpg\";\n $album_name = basename($onefile);\n\n $oneAlbum = new AlbumInfo($album_name, $album_image);\n array_push($ro->albums, $oneAlbum);\n }\n\n return $ro;\n}", "public function setTrack(SetAlbumTrackRequest $request): void\n\t{\n\t\t$request->album()->setTrack($request->file);\n\t}", "function getAllTagsFromAlbum($albumname,$subalbums=false,$mode='images') {\n\tglobal $_zp_gallery;\n\t$passwordcheck = '';\n\t$imageWhere = '';\n\t$tagWhere = \"\";\n\t$albumname = sanitize($albumname);\n\tif(empty($albumname)) {\n\t\treturn FALSE;\n\t}\n\t$albumobj = new Album($_zp_gallery,$albumname);\n\tif(!$albumobj->exists) {\n\t\treturn FALSE;\n\t}\n\tif (zp_loggedin()) {\n\t\t$albumWhere = \"WHERE `dynamic`=0\";\n\t} else {\n\t\t$albumscheck = query_full_array(\"SELECT * FROM \" . prefix('albums'). \" ORDER BY title\");\n\t\tforeach($albumscheck as $albumcheck) {\n\t\t\tif(!checkAlbumPassword($albumcheck['folder'])) {\n\t\t\t\t$albumpasswordcheck= \" AND id != \".$albumcheck['id'];\n\t\t\t\t$passwordcheck = $passwordcheck.$albumpasswordcheck;\n\t\t\t}\n\t\t}\n\t\t$albumWhere = \"WHERE `dynamic`=0 AND `show`=1\".$passwordcheck;\n\t}\n\tif($subalbums) {\n\t\t$albumWhere .= \" AND `folder` LIKE \".db_quote($albumname.\"%\");\n\t} else {\n\t\t$albumWhere .= \" AND `folder` = \".db_quote($albumname);\n\t}\n\t$albumids = query_full_array(\"SELECT id, folder FROM \" . prefix('albums'). $albumWhere);\n\tswitch($mode) {\n\t\tcase \"images\":\n\t\t\tif(count($albumids) == 0) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$imageWhere = \" WHERE \";\n\t\t\t\t$count = \"\";\n\t\t\t\tforeach($albumids as $albumid) {\n\t\t\t\t\t$count++;\n\t\t\t\t\t$imageWhere .= 'albumid='. $albumid['id'];\n\t\t\t\t\tif($count != count($albumids)) $imageWhere .= \" OR \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$imageids = query_full_array(\"SELECT id, albumid FROM \" . prefix('images').$imageWhere);\n\t\t\t// if the album has no direct images and $subalbums is set to false\n\t\t\tif(count($imageids) == 0) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$count = \"\";\n\t\t\t\t$tagWhere = \" WHERE \";\n\t\t\t\tforeach($imageids as $imageid) {\n\t\t\t\t\t$count++;\n\t\t\t\t\t$tagWhere .= '(o.objectid ='. $imageid['id'].\" AND o.tagid = t.id AND o.type = 'images')\";\n\t\t\t\t\tif($count != count($imageids)) $tagWhere .= \" OR \";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(empty($tagWhere)) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$tags = query_full_array(\"SELECT DISTINCT t.name, t.id, (SELECT DISTINCT COUNT(*) FROM \". prefix('obj_to_tag'). \" WHERE tagid = t.id AND type = 'images') AS count FROM \". prefix('obj_to_tag'). \" AS o,\". prefix('tags'). \" AS t\".$tagWhere.\" ORDER BY t.name\");\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"albums\":\n\t\t\t$count = \"\";\n\t\t\tif(count($albumids) == 0) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$tagWhere = \" WHERE \";\n\t\t\t\tforeach($albumids as $albumid) {\n\t\t\t\t\t$count++;\n\t\t\t\t\t$tagWhere .= '(o.objectid ='. $albumid['id'].\" AND o.tagid = t.id AND o.type = 'albums')\";\n\t\t\t\t\tif($count != count($albumids)) $tagWhere .= \" OR \";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(empty($tagWhere)) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$tags = query_full_array(\"SELECT DISTINCT t.name, t.id, (SELECT DISTINCT COUNT(*) FROM \". prefix('obj_to_tag'). \" WHERE tagid = t.id AND o.type = 'albums') AS count FROM \". prefix('obj_to_tag'). \" AS o,\". prefix('tags'). \" AS t\".$tagWhere.\" ORDER BY t.name\");\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn $tags;\n}", "public function getPhotoAlbums($iPage, $iLimit = 2) {\n \t$bIsUserProfile = false;\n \t\n \tif (defined('PHPFOX_IS_USER_PROFILE')) {\n \t\t$bIsUserProfile = true;\n \t\t$aUser = Phpfox::getService('user')->get($this->_aParams['user_id']); \t\t\t\n \t}\n \t\n \t$oLibSearch = Phpfox::getLib('search');\n \tPhpfox::getLib('request')->set('page', $iPage);\n \t\n \t\n $aBrowseParams = array(\n\t\t\t'module_id' => 'photo.album',\n\t\t\t'alias' => 'pa',\n\t\t\t'field' => 'album_id',\n\t\t\t'table' => Phpfox::getT('photo_album'),\n\t\t\t'hide_view' => array('pending', 'myalbums')\n\t\t);\t\t\n\t\t\n\t\t$oLibSearch->set(array(\n\t\t\t\t'type' => 'photo.album',\n\t\t\t\t'field' => 'pa.album_id',\t\t\t\t\n\t\t\t\t'search_tool' => array(\n\t\t\t\t\t'table_alias' => 'pa',\n\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t'default_value' => Phpfox::getPhrase('photo.search_photo_albums'),\n\t\t\t\t\t\t'name' => 'search',\n\t\t\t\t\t\t'field' => 'pa.name'\n\t\t\t\t\t),\n\t\t\t\t\t'sort' => array(\n\t\t\t\t\t\t'latest' => array('pa.time_stamp', Phpfox::getPhrase('photo.latest')),\n\t\t\t\t\t\t'most-talked' => array('pa.total_comment', Phpfox::getPhrase('photo.most_discussed'))\n\t\t\t\t\t),\n\t\t\t\t\t'show' => array($iLimit)\n\t\t\t\t)\n\t\t\t)\n\t\t);\t\t\t\n\t\tif ($bIsUserProfile)\n\t\t{\n\t\t\t$oLibSearch->setCondition('AND pa.view_id ' . ($aUser['user_id'] == Phpfox::getUserId() ? 'IN(0,2)' : '= 0') . ' AND pa.privacy IN(' . (Phpfox::getParam('core.section_privacy_item_browsing') ? '%PRIVACY%' : Phpfox::getService('core')->getForBrowse($aUser)) . ') AND pa.user_id = ' . (int) $aUser['user_id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->request()->get('view') == 'myalbums')\n\t\t\t{\n\t\t\t\tPhpfox::isUser(true);\n\n\t\t\t\t$oLibSearch->setCondition('AND pa.user_id = ' . Phpfox::getUserId());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$oLibSearch->setCondition('AND pa.view_id = 0 AND pa.privacy IN(%PRIVACY%) AND pa.total_photo > 0');\n\t\t\t}\n\t\t}\n\t\t$aParentModule = $this->_aParams;\n \tif ($aParentModule !== null && !empty($aParentModule['item_id']))\n\t\t{\n\t\t\t$this->search()->setCondition('AND pa.module_id = \\'' . $aParentModule['module_id']. '\\' AND pa.group_id = ' . (int) $aParentModule['item_id']);\n\t\t}\n\t\t\n $oLibSearch->browse()->params($aBrowseParams)->execute();\n\t\t\n\t\t$aAlbums = $oLibSearch->browse()->getRows();\n\t\t$iCnt = $oLibSearch->browse()->getCount();\t\n\n\t\tforeach ($aAlbums as $iKey => $aAlbum) {\n\t\t\t$aAlbums[$iKey] = $this->processAlbum($aAlbum);\n\t\t}\n\n\t\tPhpfox::getLib('pager')->set(array('page' => $iPage, 'size' => $oLibSearch->getDisplay(), 'count' => $oLibSearch->browse()->getCount()));\n\t\t\n return array($iCnt, $aAlbums);\n }", "public function create_album($args)\r\n\t{\r\n\t\t$date = explode(\"/\", $args['date']);\r\n\r\n\t\t// timestamp has to be multiplied by 1000 as the Picasa API requires milliseconds\r\n\t\t// and mktime returns seconds. Also need to add 1 to the day for some reason\r\n\t\t$timestamp = mktime(0, 0, 0, $date[1], (int)$date[0] + 1, $date[2]) * 1000;\r\n\r\n $entry = \"<entry xmlns='http://www.w3.org/2005/Atom'\r\n\t\t\txmlns:media='http://search.yahoo.com/mrss/'\r\n\t\t\txmlns:gphoto='http://schemas.google.com/photos/2007'>\r\n\t\t\t<title type='text'>\" . $args['name'] . \"</title>\r\n\t\t\t<summary type='text'>\" . $args['summary'] . \"</summary>\r\n\t\t\t<gphoto:location>\" . $args['location'] . \"</gphoto:location>\r\n\t\t\t<gphoto:access>\" . $args['access'] . \"</gphoto:access>\r\n\t\t\t<gphoto:timestamp>\" . $timestamp . \"</gphoto:timestamp>\r\n\t\t\t<media:group>\r\n\t\t\t\t<media:keywords>\" . $args['keywords'] . \"</media:keywords>\r\n\t\t\t</media:group>\r\n\t\t\t<category scheme='http://schemas.google.com/g/2005#kind'\r\n\t\t\t\t\t\t\t\tterm='http://schemas.google.com/photos/2007#album'></category>\r\n\t\t</entry>\";\r\n\t\r\n\r\n\t\t$result = $this->call(PicasaAPI::$QUERY_URLS['picasa'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'method' => 'POST',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'http_headers' => array('Content-Type' => 'application/atom+xml')),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$entry);\r\n\r\n\t\tif(Error::is_error($result))\r\n\t\t\treturn $result->get();\r\n\t\telse\r\n\t\t\treturn \"Album successfuly created\";\r\n\t}", "function updateShares(array $add, array $remove);", "function getAlbumImages($args)\n{\n global $_zp_current_image;\n if (is_object($login_state = authorize($args))) {\n return $login_state;\n }\n $args = decode64($args);\n logger('getAlbumImages', ($args['loglevel']));\n $albumobject = getItemByID('albums', $args['id']);\n $images = $albumobject->getImages();\n if (!($albumobject || !$args['id'])) {\n return new ZEN_Error(-1, 'No folder with database ID '.$args['id'].' found!');\n }\n makeAlbumCurrent($albumobject);\n $list = [];\n while (next_image(true)) {\n $meta = $_zp_current_image->getmetadata();\n if ($meta['EXIFDateTimeOriginal']) {\n $imagedate = $meta['EXIFDateTimeOriginal'];\n } else {\n $imagedate = false;\n }\n $list[] = entitysave([\n 'id' => $_zp_current_image->getID(),\n 'albumid' => $_zp_current_image->getAlbum()->getID(),\n 'name' => $_zp_current_image->filename,\n 'shortdate' => date('Y-m-d', (strtotime(str_replace(' ', '', (str_replace(':', '', $imagedate)))))),\n 'longdate' => $imagedate,\n 'url' => WEBPATH.'index.php?album='.urlencode($_zp_current_image->album->name).'&image='.urlencode($_zp_current_image->filename),\n 'folder' => $_zp_current_image->getAlbum()->getFolder(),\n // added by monta\n 'thumbnail' => $_zp_current_image->getThumbImageFile(),\n 'description' => $_zp_current_image->getDesc(),\n 'commentcount' => count($_zp_current_image->getComments()),\n ]);\n } //next_image( true )\n //writelog((var_export($list, true)));\n return $list;\n}", "public function setAlbumId($value)\n {\n return $this->set('AlbumId', $value);\n }", "public function getShares($url);", "public function photoPublish($src, $album = null) {\n $this->setFileUploadSupport(true);\n if (is_null($album)) {\n $result = $this->api('/me/photos', 'POST', array(\n 'source' => \"@\" . $src\n ));\n } elseif (is_numeric($album)) {\n $result = $this->api('/' . $album . '/photos', 'POST', array(\n 'source' => \"@\" . $src\n ));\n } else {\n $album_name = strval($album);\n $album_id = null;\n $albums = $this->api('/me/albums');\n foreach ($albums['data'] as $album) {\n if ($album['name'] == $album_name) {\n $album_id = $album['id'];\n break;\n }\n }\n if ($album_id == null) {\n $result = $this->api('/me/albums', 'POST', array(\n 'name' => $album_name\n ));\n if (!empty($result['id'])) {\n $album_id = $result['id'];\n }\n }\n $result = $album_id ? $this->api('/' . $album_id . '/photos', 'POST', array(\n 'source' => \"@\" . $src\n )) : false;\n }\n if (!empty($result['id'])) {\n return $result['id'];\n } else {\n return false;\n }\n }", "public function getAlbums()\n {\n $url = str_replace(\"[:action]\", \"albums\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n $_albums = '';\n\n foreach ($result['data'] as $item) {\n $_album = new ImgUrAlbum();\n $_album->setAttributes($item);\n $_albums[] = $_album;\n }\n\n return $_albums;\n }", "function CreatePhotoAlbumDirectory($album_id){\r\n\t\t$showamerica_user_id=$this->session->userdata('showamerica_user_id');\r\n\t\t$user_home_dir=sprintf(USER_UPLOAD_HOME_PATH,$showamerica_user_id);\r\n\t\tif(!is_dir($user_home_dir)){\r\n\t\t\t\t$old = umask(0); \r\n\t\t\t\tif(mkdir($user_home_dir,DIR_WRITE_MODE)){\t\t//Create the folder if not exist and give permission\r\n\t\t\t\t\tumask($old); \r\n\t\t\t\t}\r\n\t\t}\r\n\t\t//its album path created with user id\r\n\t\t$album_path=sprintf(USER_UPLOAD_PATH_ALBUMS,$showamerica_user_id);\r\n\t\tif(!is_dir($album_path)){\r\n\t\t\t\t$old = umask(0); \r\n\t\t\t\tif(mkdir($album_path,DIR_WRITE_MODE)){\t\t//Create the folder if not exist and give permission\r\n\t\t\t\t\tumask($old); \r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n//\t\tthats create album folder with user id\r\n\t\t$album_path=sprintf(USER_UPLOAD_PATH_ALBUMS.'/'.$album_id.'/',$showamerica_user_id);\r\n\t\tif(!is_dir($album_path)){\r\n\t\t\t\t$old = umask(0); \r\n\t\t\t\tif(mkdir($album_path,DIR_WRITE_MODE)){\t\t//Create the folder if not exist and give permission\r\n\t\t\t\t\tumask($old); \r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t$album_thumbnail_path=$album_path.'/thumbnails/';\r\n\t\tif(!is_dir($album_thumbnail_path)){\r\n\t\t\t\t$old = umask(0); \r\n\t\t\t\tif(mkdir($album_thumbnail_path,DIR_WRITE_MODE)){\t\t//Create the folder if not exist and give permission\r\n\t\t\t\t\tumask($old); \r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn $options=array('upload_dir'=>$album_path,'upload_url'=>base_url().$album_path,'accept_file_types' => '/^.*\\.(jpg|jpeg|png|gif)$/i',\r\n\t\t\t\t\t\t'image_versions'=>array(\r\n\t\t\t\t\t\t\t\t\t\t\t'thumbnail'=>array('upload_dir'=>$album_thumbnail_path,'upload_url'=>base_url().$album_thumbnail_path)) \t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t );\r\n\t}", "function mediashare_external_finditem($args)\r\n{\r\n // FIXME access check\r\n\r\n $albumId = mediashareGetIntUrl('aid', $args, 1);\r\n $mediaId = mediashareGetIntUrl('mid', $args, 0);\r\n $mode = pnVarCleanFromInput('mode');\r\n $cmd = pnVarCleanFromInput('cmd');\r\n $onlyMine = mediashareGetIntUrl('onlymine', $args, 0);\r\n\r\n $uploadFailed = false;\r\n\r\n if ($cmd == 'selectAlbum')\r\n $mediaId = 0;\r\n else if (isset($_POST['selectButton']))\r\n {\r\n $file = (isset($_FILES['upload']) ? $_FILES['upload'] : null);\r\n\r\n if (!empty($file) && $file['error'] == 0 && mediashareAccessAlbum($albumId, mediashareAccessRequirementEditAlbum))\r\n {\r\n pnModAPILoad('mediashare', 'source_browser');\r\n $result = pnModAPIFunc('mediashare', 'source_browser', 'addMediaItem',\r\n array( 'albumId' => $albumId,\r\n 'uploadFilename' => $file['tmp_name'],\r\n 'fileSize' => $file['size'],\r\n 'filename' => $file['name'],\r\n 'mimeType' => $file['type'],\r\n 'title' => null,\r\n 'keywords' => null,\r\n 'description' => null,\r\n 'width' => 0,\r\n 'height' => 0));\r\n if ($result === false)\r\n $uploadFailed = true;\r\n else\r\n $mediaId = $result['mediaId'];\r\n }\r\n\r\n if (!$uploadFailed)\r\n {\r\n $url = pnModUrl('mediashare', 'external', 'pasteitem',\r\n array('aid' => $albumId,\r\n 'mid' => $mediaId,\r\n 'mode' => $mode));\r\n pnRedirect($url);\r\n return true;\r\n }\r\n }\r\n\r\n $mediaItem = pnModAPIFunc('mediashare', 'user', 'getMediaItem',\r\n array('mediaId' => $mediaId));\r\n\r\n\r\n $render = new elfiskRender('mediashare');\r\n mediashareExternalLoadTheme($render);\r\n $render->caching = false;\r\n $render->assign('albumId', $albumId);\r\n $render->assign('mediaId', $mediaId);\r\n $render->assign('mediaItem', $mediaItem);\r\n $render->assign('mode', $mode);\r\n $render->assign('onlyMine', $onlyMine);\r\n $render->assign('hasEditAccess', mediashareAccessAlbum($albumId, mediashareAccessRequirementEditAlbum));\r\n\r\n if ($uploadFailed)\r\n $render->assign('uploadErrorMessage', mediashareErrorAPIGet());\r\n\r\n echo $render->fetch('mediashare_external_finditem.html');\r\n return true;\r\n}", "function havp_set_file_access($dir, $owner, $mod) {\n\tif (file_exists($dir)) {\n\t\tmwexec(\"/usr/bin/chgrp -R -v $owner $dir\");\n\t\tmwexec(\"/usr/sbin/chown -R -v $owner $dir\");\n\t\tif (!empty($mod)) {\n\t\t\tmwexec( \"/bin/chmod -R -v $mod $dir\");\n\t\t}\n\t}\n}", "function photos_setPerms ($photo_id, $is_public = 1, $is_friend = 0, $is_family = 0, $perm_comment = 3, $perm_addmeta = 3) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.setPerms', 'photo_id' => $photo_id, 'is_public' => $is_public, 'is_friend' => $is_friend, 'is_family' => $is_family, 'perm_comment' => $perm_comment, 'perm_addmeta' => $perm_addmeta));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "protected function syncSharedFolders()\n\t{\n\t\t$shared = (array) $this->rocketeer->getOption('remote.shared');\n\t\tforeach ($shared as $file) {\n\t\t\t$this->share($file);\n\t\t}\n\t}", "public function setShares($val)\n {\n $this->_propDict[\"shares\"] = $val;\n return $this;\n }", "public function linkPlayerAlbum($player_id, $album_id, $missing_count = 0) {\n // We need to add all stickers from $album_id. We need first to check if we have data\n $query = \"SELECT plal.player_id, plal.album_id\n FROM \" . $this->__schema . \".player_album plal\n WHERE plal.player_id = \" . $this->db()->quote($player_id)\n . \" AND plal.album_id = \" . $this->db()->quote($album_id);\n $data = $this->db()->getRow($query);\n\n // By default, operation is INSERT\n $operation = 'INSERT';\n if ($data) {\n // Ok we have data\n if (in_array('reset', $this->input->params)) {\n // We need to reset all album data\n $operation = 'UPDATE';\n }\n else {\n $operation = 'NONE';\n }\n }\n\n $return_result = [\n 'success' => TRUE,\n 'operation' => $operation,\n ];\n\n switch ($operation) {\n case 'NONE':\n default:\n // Do nothing return gracefully\n break;\n\n case 'UPDATE':\n // In this case, we need to reset all stickers data\n $all_stickers = $this->getStickersByAlbum($album_id);\n $query = \"UPDATE \" . $this->__schema . \".player_sticker ps\n SET owned = FALSE, trading_capacity = 0\n WHERE ps.player_id = \" . $this->db()->quote($player_id)\n . \" AND sicker_id IN (\"\n . \" SELECT st.id FROM \" . $this->__schema . \".sticker st WHERE st.album_id = \" . $this->db()->quote($album_id)\n . \" )\";\n $result = $this->db()->exec($query);\n $this->wd->watchdog('linkPlayerAlbum', 'Operation @o, result as @r', ['@o' => $operation, '@r' => print_r($result, TRUE)]);\n if ($all_stickers['success']) {\n $query = \"UPDATE \" . $this->__schema . \".player_album\n SET missing_count = \" . count($all_stickers['payload'])\n . \" WHERE player_id = \" . $this->db()->quote($player_id)\n . \" AND album_id = \" . $this->db()->quote($album_id);\n $result = $this->db()->exec($query);\n }\n break;\n\n case 'INSERT':\n // We need to setup the album\n $query = \"INSERT INTO \" . $this->__schema . \".player_sticker \"\n . \" SELECT \" . $player_id . \" as player_id, st.id as sticker_id, false as owned, 0 as trading_capacity FROM \" . $this->__schema . \".sticker st WHERE st.album_id = \" . $this->db()->quote($album_id);\n $result = $this->db()->exec($query);\n $this->wd->watchdog('linkPlayerAlbum', 'Operation @o, result as @r', ['@o' => $operation, '@r' => print_r($result, TRUE)]);\n // Now make sure there is data in the player_album table\n $query = \"INSERT INTO \" . $this->__schema . \".player_album (player_id, album_id, missing_count)\n VALUES ( \" . $player_id . ', ' . $album_id . ', ' . $missing_count\n . \" )\";\n $result = $this->db()->exec($query);\n break;\n }\n return $return_result;\n }", "public function getAlbum(): Album;", "function createAlbum($inputArr) {\n \n $ro = new BaseRO();\n $aname = $inputArr[\"name\"];\n\n $oldumask = umask(0); \n $ro->success = mkdir(\"Pics/$aname\", 0777);\n if (!($ro->success)) {\n $ro->retcode = 2;\n }\n umask($oldumask); \n\n return $ro;\n}", "public function setAlbumID($value)\n {\n return $this->set('AlbumID', $value);\n }", "public function setAlbumID($value)\n {\n return $this->set('AlbumID', $value);\n }", "public function setAlbumID($value)\n {\n return $this->set('AlbumID', $value);\n }", "public function setAlbumID($value)\n {\n return $this->set('AlbumID', $value);\n }", "public function setAlbumID($value)\n {\n return $this->set('AlbumID', $value);\n }", "public function media_upload_picasa_upload()\n\t{\n\t\t$this->api->check_authentication();\n\n\t\tif($_GET['login_successful'] == 'true')\n\t\t\treturn wp_iframe(array(&$this, 'display_login_successful'));\n\n\t\tif(isset($_FILES['picasa_file']))\n\t\t{\n\t\t\t$temp_name = $_FILES['picasa_file']['tmp_name'];\n\t\t\t$name = $_FILES['picasa_file']['name'];\n\n\t\t\t$result = $this->api->add_photo($temp_name, $name, $_POST['album']);\n\t\t}\n\n\t\treturn wp_iframe(array(&$this, 'media_upload_picasa_upload_content'), $result);\n\t}", "public function &getAlbums($uid = null, $aids = null)\n {\n // Requires a session_key\n if (!$skey = $this->_facebook->auth->getSessionKey()) {\n throw new Horde_Service_Facebook_Exception(\n 'photos.addTag requires a session_key',\n Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);\n }\n\n $results = $this->_facebook->callMethod(\n 'facebook.photos.getAlbums',\n array('uid' => $uid,\n 'aids' => $aids));\n\n return $results;\n }", "public function insertAlbum($idArtista = NULL){\n\t\tif($this->autenticado(/* parametro? */)){\n\t\t\t$camposAlbum = $this->getCamposAlbum($idArtista, NULL);\n\t\t\t$this->actualizarAlbum($camposAlbum, true, false, '');\n\t\t}else{\n\t\t\techo \"Directory access is forbidden.\";\n\t\t}\n\t}", "function getShares();", "private function cachePermissions(): void\n {\n Cache::put($this->cacheKey(), [\n 'isPayor' => $this->isPayor,\n 'isAgencyBankAccountSetup' => $this->isAgencyBankAccountSetup,\n 'canViewDocumentation' => $this->canViewDocumentation,\n ]);\n }", "function figshareCall($method, $uri, $action, $data, $token=\"\") {\n\t$curl = curl_init($uri.$action);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\tif ($method == \"POST\") {\n\t\tcurl_setopt($curl, CURLOPT_POST, true);\n\t} else {\n\t\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);\n\t}\n\tcurl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n\tif ($token != \"\") {\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, [\n\t\t 'Content-Type: application/json',\n\t\t 'Authorization: token '.$token\n\t\t]);\n\t} else {\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, [\n\t\t 'Content-Type: application/json'\n\t\t]);\n\t}\n\t$return = curl_exec($curl);\n\t// check if the HTTP request failed\n\tif (curl_errno($curl)) {\n\t\t$error = curl_error($curl);\n\t} else {\n\t\t$error = false;\n\t}\n\tif ($return === false) {\n\t\t$response = [];\n\t\t$statuscode = 0;\n\t} else {\n\t\t$response = json_decode($return, true);\n\t\t$statuscode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n\t}\n\tcurl_close($curl);\n\treturn array( $response, $error, $statuscode );\n}", "public function putAlbum($id, $params)\n {\n return false;\n }", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new LastFm_Album_Share_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "public function permissions(Storable $storable, Acl $acl): void;", "function fm_user_has_shared($original=0, $link=0, $ownertype) {\r\n\tglobal $USER, $CFG;\r\n\r\n\tif ($link == 0) {\r\n\t\tif (!$sharedfiles = (count_records('fmanager_shared', \"owner\", $original, \"ownertype\", $ownertype,\"userid\", $USER->id) + count_records('fmanager_shared', \"owner\", $original, \"ownertype\", $ownertype,\"userid\", 0))) {\t\r\n\t\t\terror(get_string(\"errnoshared\", 'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\tif (!$sharedfiles = (count_records('fmanager_shared',\"owner=$original AND ownertype\", $ownertype,\"userid\",$USER->id,\"sharedlink\",$link) + count_records('fmanager_shared',\"owner=$original AND ownertype\", $ownertype,\"userid\",0,\"sharedlink\",$link))) {\r\n\t\t\terror(get_string(\"errnoshared\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "public function mapPackAlbum( array $a = array() ){\r\n\t\tif($a){\r\n\t\t\t$packId=(int)$a['packId'];\r\n\t\t\t$albumIds=$a['albumIds'];\r\n\t\t\tif($packId){\r\n\t\t\t\t$this->sSql = \"DELETE FROM pack_album WHERE pack_id='\".$packId.\"'\";\r\n\t\t\t\t$resDel = $this->oMysqli->query($this->sSql);\r\n\t\t\t}\r\n\t\t\tif(!empty($albumIds)){\r\n\t\t\t\tforeach($albumIds as $kR=>$vR){ \r\n\t\t\t\t\t$this->sSql = \"INSERT IGNORE INTO pack_album (`pack_id`,`album_id`) VALUES ('\".$packId.\"','\".$vR.\"')\";\r\n\t\t\t\t\t$res = $this->oMysqli->query($this->sSql);\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}", "function rt_import_album_data_to_mediabp($rt_importdetails) {\n global $kaltura_validation_data,$bp,$wpdb;\n $site_url = get_option('siteurl');\n $split_data = split('#', $rt_importdetails);\n\n try {\n $imported_pic_ids = get_option('rt_bp_media_imported_media');\n $to_be_imported_pic_ids = array();\n for($i = 0 ;$i<count($rt_importdetails);$i++) {\n //1. add to kaltura server\n //2. insert the album/title/description\n //3. add title and description accordingly\n //4. add to media data table accordingly\n //5. use serialied data\n $split_data = split('#', $rt_importdetails[$i]);\n $user_id = $split_data[0];\n $pic_title = $split_data[1];\n $pic_desc = $split_data[2];\n $pic_url = $site_url.$split_data[3];\n $pic_date = $split_data[4];\n $pic_id = $split_data[5];\n\n // form data as per requirement\n $entry = new KalturaMediaEntry();\n $entry->name = $pic_title;\n if($pic_desc == ' ' || $pic_desc == '')\n $entry->description = \"\";\n else\n $entry->description = $pic_desc;\n\n if($pic_title == ' ' || $pic_title == '')\n $entry->name = \"No Title\";\n else\n $entry->name = $pic_title;\n\n/* $entry->name = $pic_title; */\n $entry->mediaType = 2;\n $entry->createdAt = $pic_date;\n\n if($kaltura_validation_data)\n $kaltura_data = $kaltura_validation_data['client']-> media ->addFromUrl($entry, $pic_url);\n\n if(!empty($kaltura_data)) {\n $media_type = 2;\n $total_rating = 1;\n $rating_counter = 1;\n $rating = 1;\n $views = 1;\n $group_id = 0;\n $album_id = 1;\n $service_type = 'kaltura';\n\n $query = \"INSERT INTO {$bp->media->table_media_data} (entry_id, user_id, service_type, media_type, total_rating, rating_counter, rating, views, group_id, album_id, date_uploaded)\n VALUES (\n '$kaltura_data->id',\n '$user_id',\n '$service_type',\n '$media_type',\n '$total_rating',\n '$rating_counter',\n '$rating',\n '$views',\n '$group_id',\n '$album_id',\n '$pic_date'\n )\";\n\n\n if ($wpdb->query($query)) {\n $to_be_imported_pic_ids[] = $pic_id;\n }\n\n }\n\n }\n $to_be_imported_pic_ids = implode(',', $to_be_imported_pic_ids);\n if (!empty($imported_pic_ids)) {\n $imported_pic_ids .= ','.$to_be_imported_pic_ids;\n }\n else {\n $imported_pic_ids = $to_be_imported_pic_ids;\n }\n update_option('rt_bp_media_imported_media', $imported_pic_ids);\n }\n catch(Exception $e) {\n echo $e. 'Oops Kaltura Server responded badly';\n }\n\n\n\n return $kaltura_data;\n\n}", "public function editAlbum($currentAlbumId, $albumName, $shortDescription, $fullDescription, $placeTaken, $titlePhotoFile, $moreModeratorsToAdd, $moderatorsToDelete){\n\n DB::table('albums')\n ->where('album_id', $currentAlbumId)\n ->update(array(\n 'album_name' => $albumName,\n 'album_short_description' => $shortDescription,\n 'album_full_description' => $fullDescription,\n 'album_place' => $placeTaken\n )\n );\n\n UserAction::add('Album \"' . $albumName . '\" was updated');\n\n //add more moderators\n if ($moreModeratorsToAdd != null && !empty($moreModeratorsToAdd)){\n foreach($moreModeratorsToAdd as $i) {\n $isAdded = DB::table('album_moderators')->insert(\n array(\n 'album_id' => $currentAlbumId,\n 'user_id' => $i,\n )\n );\n }\n }\n\n //delete current moderators\n if ($moderatorsToDelete != null && !empty($moderatorsToDelete)){\n foreach($moderatorsToDelete as $i) {\n DB::delete('DELETE FROM album_moderators WHERE album_id = ? AND user_id = ?', array($currentAlbumId, $i));\n }\n }\n\n if ($titlePhotoFile != null){\n $file = $titlePhotoFile;\n\n $filename = $file->getClientOriginalName();\n $extension = $file->getClientOriginalExtension();\n if ($extension == 'jpeg') {\n $extension = 'jpg';\n }\n $fileSize = $file->getSize();\n\n if($extension == 'jpeg' || $extension == 'jpg' || $extension == 'bmp' || $extension == 'png' || $extension == 'gif')\n //max is 3MG\n if($fileSize <= 1024*1024*3){\n\n //make: if this albumId exist in albums table do this insert\n $isAlbumIdExist = DB::select('select album_id from albums where album_id = ?', array($currentAlbumId));\n if($isAlbumIdExist){\n\n $titleDestinationPath = 'uploads/albums/'.$currentAlbumId;\n\n //creates album directory if not exist\n if(!is_dir('uploads'))\n mkdir('uploads', 0777, true);\n if(!is_dir('uploads/albums'))\n mkdir('uploads/albums', 0777, true);\n if(!is_dir('uploads/albums/'.$currentAlbumId))\n mkdir('uploads/albums/'.$currentAlbumId, 0777, true);\n\n //gets old title url\n $titlePhoto = DB::table('albums')->where('album_id', $currentAlbumId)->get();\n\n //if album exist\n if($titlePhoto != null){\n\n //deletes old title photo if exists from directory\n $oldAlbumTitlePhoto = null;\n $oldAlbumTitlePhoto = $titlePhoto[0]->album_title_photo_url;\n if($oldAlbumTitlePhoto != null ){\n if(is_file($oldAlbumTitlePhoto))\n File::delete($oldAlbumTitlePhoto);\n }\n //deletes old title photo thumb if exists from directory\n $oldAlbumTitlePhotoThumb = null;\n $oldAlbumTitlePhotoThumb = $titlePhoto[0]->album_title_photo_thumb_url;\n if($oldAlbumTitlePhotoThumb != null )\n if(is_file($oldAlbumTitlePhotoThumb))\n File::delete($oldAlbumTitlePhotoThumb);\n }\n\n //new title photo url\n $newTitlePhotoUrl = $titleDestinationPath.\"/title_\".$currentAlbumId.\".\".$extension;\n\n //upload file to directory\n $upload_success = $file->move($titleDestinationPath, \"title_\".$currentAlbumId.\".\".$extension);\n if($upload_success){\n App::make('phpthumb')\n ->create('resize', array($newTitlePhotoUrl, 200, 200, 'adaptive'))\n ->save($titleDestinationPath.\"/\", \"title_\".$currentAlbumId.\"_thumb.\".$extension);\n\n $photoThumb = $titleDestinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$extension;\n\n //insert uploaded/unuploded files to database\n DB::table('albums')\n ->where('album_id', $currentAlbumId)\n ->update(array(\n 'album_title_photo_url' => $newTitlePhotoUrl,\n 'album_title_photo_thumb_url' => $photoThumb\n ));\n }\n }\n }\n }\n\n }", "public function __construct(Temboo_Session $session)\n {\n parent::__construct($session, '/Library/LastFm/Album/Share/');\n }", "public function album($albumID, bool $obeyHidden = false)\n\t{\n\t\tif (in_array($albumID, array(\n\t\t\t'f',\n\t\t\t's',\n\t\t\t'r',\n\t\t\t'0',\n\t\t))) {\n\t\t\treturn 1; // access granted\n\t\t}\n\n\t\t$album = Album::find($albumID);\n\t\tif ($album == null) {\n\t\t\treturn 0; // Does not exist\n\t\t}\n\n\t\tif ($this->sessionFunctions->is_current_user($album->owner_id)) {\n\t\t\treturn 1; // access granted\n\t\t}\n\n\t\t// Check if the album is shared with us\n\t\tif ($this->sessionFunctions->is_logged_in() &&\n\t\t\t$album->shared_with->map(function ($user) {\n\t\t\t\treturn $user->id;\n\t\t\t})->contains($this->sessionFunctions->id())) {\n\t\t\treturn 1; // access granted\n\t\t}\n\n\t\tif ($album->public != 1 ||\n\t\t\t($obeyHidden && $album->visible_hidden !== 1)) {\n\t\t\treturn 2; // Warning: Album private!\n\t\t}\n\n\t\tif ($album->password == '') {\n\t\t\treturn 1; // access granted\n\t\t}\n\n\t\tif ($this->sessionFunctions->has_visible_album($albumID)) {\n\t\t\treturn 1; // access granted\n\t\t}\n\n\t\treturn 3; // Please enter password first. // Warning: Wrong password!\n\t}", "public function mediaByAlbums($albums, $options = []){\n $order = isset($options['order']) && $options['order'] ? $options['order'] : null;\n $limit = isset($options['limit']) && $options['limit'] ? $options['limit'] : null;\n $offset = isset($options['offset']) && $options['offset'] ? $options['offset'] : null;\n \n $album = \\FlexCMS\\BasicCMS\\Models\\Item::where('item_type', '=', 'album');//->where('name', '=', $album)->first();\n // foreach ($albums as $key => $value) {\n // $album = $album->orWhere('name', '=', $value);\n // }\n $album = $album->whereIn('name', $albums);\n $album = $album->get();\n foreach ($album as $key => $value) {\n $album[$key]->media = \\FlexCMS\\BasicCMS\\Models\\Media::where('album_id', '=', $value->id);\n if ($order){\n $album[$key]->media = $album[$key]->media->orderByRaw($order);\n }\n $album[$key]->media = $album[$key]->media->get()->toArray();\n }\n \n return $album->toArray();\n }", "public function getAlbums()\n\t{\n\t\treturn Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'azgallery_album`');\n\t}", "public function store(Request $request)\n {\n $user = JWTAuth::parseToken()->authenticate();\n\n if (Gate::forUser($user)->allows('albums-create', $user)) {\n $validator = Validator::make($request->all(), $this->validations);\n\n if ($validator->fails()) {\n return response()->json([\n 'success'=> false,\n 'errors' => $validator->errors()->all()\n ],400);\n }\n\n $record = $user->albums()->create($request->all());\n $album = $this->prepareAlbumData($record,[]);\n\n if($request->hasFile('image')){\n $image = $request->file('image');\n $this->createImage($user,$record,$image);\n\n $album['image'] = $this->getFileURL($record->image);\n }\n\n return response()->json([\n 'success' => true,\n 'album' => $album,\n 'message' => 'Album successfully created'\n ]);\n }else{\n return response()->json([\n 'success' => false,\n 'errors' => [\"Access denied. You can't create albums, you need to be an author.\"]\n ],403);\n }\n }", "public function loadAlbums()\n {\n\t\t$json = file_get_contents('https://itunes.apple.com/us/rss/topalbums/limit=100/json');\n \n $albums = json_decode($json, true);\n $category_sql = \"INSERT IGNORE INTO categories (name, category_id, link) VALUES (:name, :category_id, :link)\";\n\t\t$album_sql = \"INSERT IGNORE INTO albums (album_id, name, artist, artist_link, category_id, release_date, rank) VALUES (:album_id, :name, :artist, :artist_link, :category_id, :release_date, :rank)\";\n\t\t$images_sql = \"INSERT IGNORE INTO album_art (album_id, album_image, image_size) VALUES (:album_id, :album_image, :image_size)\";\n\n\t\t//Lets delete whatever is in these tables before adding to them.\n\t\t$this->purgeTables();\n \n foreach($albums['feed']['entry'] as $rank=>$album) {\n\t\t\t\n\t\t\t//Insterts categories\n\t\t\t$stmt= $this->db->prepare($category_sql);\n\t\t\t\n\t\t\t$data = [\n\t\t\t\t'name' => $album['category']['attributes']['label'],\n\t\t\t\t'category_id' => $album['category']['attributes']['im:id'],\n\t\t\t\t'link' => $album['category']['attributes']['scheme'],\n\t\t\t];\n\t\t\t\n\t\t\t$stmt->execute($data);\n\t\t\t\n\t\t\t//Insterts album info\n\t\t\t$stmt= $this->db->prepare($album_sql);\n\t\t\t\n\t\t\t$data = [\n\t\t\t\t'album_id' => $album['id']['attributes']['im:id'],\n\t\t\t\t'name' => $album['title']['label'],\n\t\t\t\t'artist' => $album['im:artist']['label'],\n\t\t\t\t'artist_link' => (isset($album['im:artist']['attributes'])) ? $album['im:artist']['attributes']['href'] : '',\n\t\t\t\t'category_id' => $album['category']['attributes']['im:id'],\n\t\t\t\t'release_date' => $album['im:releaseDate']['label'],\n\t\t\t\t'rank' => $rank,\n\t\t\t];\n\n\t\t\t$stmt->execute($data);\n\t\t\t\n\t\t\t//inserts album images\n\t\t\t$stmt= $this->db->prepare($images_sql);\n\t\t\t\n\t\t\tforeach($album['im:image'] as $image){\n\t\t\t\t$data = [\n\t\t\t\t\t'album_id' => $album['id']['attributes']['im:id'],\n\t\t\t\t\t'album_image' => $image['label'],\n\t\t\t\t\t'image_size' => $image['attributes']['height'],\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\t$stmt->execute($data);\n\t\t\t}\n\t\t}\n\t}", "public static function shareFacebook($condition,$data)\n {\n $result = array();\n $data = (is_array($data->attributes))?$data->attributes: array();\n foreach($data as $key=>$value){\n $result['{'.$key.'}'] = $value;\n }\n $setting = self::findByCondition($condition,self::SETTING_SHARE_FACEBOOK);\n if(isset($setting->value) && $setting->status == self::STATUS_YES) {\n ClsFacebookShare::app()->url($setting->link)->content(Yii::t('setting_share',$setting->content,$result))->share();\n }\n }", "public function processAlbum($aAlbum) {\n \t$aSizes = Phpfox::getParam('photo.photo_pic_sizes');\n \t$aAlbum['photo_sizes'] = array();\n \tforeach ($aSizes as $iSize) {\n \t\t$aAlbum['photo_sizes'][$iSize] = Phpfox::getLib('image.helper')->display(array(\n\t \t\t\t'server_id' => $aAlbum['server_id'],\n\t \t\t\t'file' => $aAlbum['destination'],\n\t \t\t\t'path' => 'photo.url_photo',\n\t\t\t 'suffix' => '_'. $iSize,\n\t\t\t 'return_url' => true\n\t \t\t)\n \t\t);\n \t}\n \t$aAlbum['time_phrase'] = Phpfox::getLib('date')->convertTime($aAlbum['time_stamp'], 'photo.photo_image_details_time_stamp');\n \t\n \treturn $aAlbum;\n }", "function albums_admin_show_albums() {\n\tglobal $lang;\n\t$albums = albums_get_albums();\n\n\tif ($albums == FALSE)\n\t\techo '<span class=\"kop4\">'.$lang['general']['nothing_yet'].'</span>';\n\n\telse {\n\t\tforeach ($albums as $album) {\n\t\t\t?>\n\t\t\t\t<div class=\"menudiv\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<img src=\"<?php echo MODULE_DIR; ?>/images/albums.png\" alt=\"\" />\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"title-page\"><?php echo $album['title']; ?></span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=editalbum&amp;var1=<?php echo $album['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/edit.png\" title=\"<?php echo $lang['albums']['edit_album']; ?>\" alt=\"<?php echo $lang['albums']['edit_album']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=deletealbum&amp;var1=<?php echo $album['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/delete_from_trash.png\" title=\"<?php echo $lang['albums']['delete_album']; ?>\" alt=\"<?php echo $lang['albums']['delete_album']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t\tunset($albums);\n\t}\n}", "public function getAlbum()\n {\n return $this->album;\n }", "public function getAlbum()\n {\n return $this->album;\n }", "public function UpdateShares($brandstatistic)\n\t\t{\n\t\t\t$tContext = new AppTransaction();\n\t\t\t$brandstatisticDAL = new BrandStatisticDAL($this->_userinfo);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$tContext->BeginTransaction();\n\t\t\t\t$brandstatisticDAL->UpdateShares($brandstatistic, $tContext);\n\t\t\t\t$tContext->CommitTransaction();\n\t\t\t}\n\t\t\tcatch (Exception $ex)\n\t\t\t{\n\t\t\t\t$tContext->RollbackTransaction();\n\t\t\t\tthrow $ex;\n\t\t\t}\n\t\t}", "function createAlbumZip($albumname){\n\tglobal $_zp_zip_list, $zip_gallery;\n\tif (!checkAlbumPassword($albumname, $hint)) {\n\t\tpageError(403, gettext(\"Forbidden\"));\n\t\texit();\n\t}\n\t$zip_gallery = new Gallery();\n\t$album = new Album($zip_gallery, $albumname);\n\tif (!$album->exists) {\n\t\tpageError(404, gettext('Album not found'));\n\t\texit();\n\t}\n\t$persist = getOption('persistent_archive');\n\t$dest = $album->localpath.'.zip';\n\tif (!$persist || !file_exists($dest)) {\n\t\tinclude_once('archive.php');\n\t\t$curdir = getcwd();\n\t\tchdir($album->localpath);\n\t\t$_zp_zip_list = array();\n\t\t$z = new zip_file($dest);\n\t\t$z->set_options(array('basedir' => realpath($album->localpath.'/'), 'inmemory' => 0, 'recurse' => 0, 'storepaths' => 1));\n\t\tzipAddAlbum($album, strlen($albumname), $z);\n\t\t$z->add_files($_zp_zip_list);\n\t\t$z->create_archive();\n\t\tunset($_zp_zip_list);\n\t\tchdir($curdir);\n\t}\n\theader('Content-Type: application/zip');\n\theader('Content-Disposition: attachment; filename=\"' . pathurlencode($albumname) . '.zip\"');\n\theader(\"Content-Length: \" . filesize($dest));\n\tprintLargeFileContents($dest);\n\tif (!$persist) {\n\t\tunlink($dest);\n\t}\n\tunset($zip_gallery);\n\tunset($album);\n\tunset($persist);\n\tunset($dest);\n}", "public function testUpdatePermissionSet()\n {\n }", "public function getAlbums()\n {\n return $this->albums;\n }", "public function reorderAlbums(string $access_token, array $params = [], int $apiTokenType = VKApiTokenTypes::USER)\n\t{\n\t\treturn $this->request->post('video.reorderAlbums', $access_token, $params, $apiTokenType);\n\t}", "public function edit($aData)\n {\n if (!Phpfox::getUserParam('music.can_access_music') || !Phpfox::getUserParam('music.can_upload_music_public'))\n {\n return array('result' => 0, 'error_code' => 1, 'message' => 'You don\\'t have permission to access music module!');\n }\n\n /**\n * @var int\n */\n $iAlbumId = isset($aData['iAlbumId']) ? (int) $aData['iAlbumId'] : 0;\n\n /**\n * @var array\n */\n $aVals = array(\n 'name' => isset($aData['sName']) ? $aData['sName'] : '',\n 'year' => isset($aData['sYear']) ? $aData['sYear'] : '',\n 'text' => isset($aData['sText']) ? $aData['sText'] : '',\n 'privacy' => isset($aData['iPrivacy']) ? (int) $aData['iPrivacy'] : 0,\n 'privacy_comment' => isset($aData['iPrivacyComment']) ? (int) $aData['iPrivacyComment'] : 0,\n 'privacy_list' => isset($aData['sPrivacyList']) ? explode(',', $aData['sPrivacyList']) : array()\n );\n /**\n * @var array\n */\n $aValidation = array(\n 'name' => Phpfox::getPhrase('music.provide_a_name_for_this_album'),\n 'year' => array(\n 'def' => 'year'\n )\n );\n\n /**\n * @var Phpfox_Validator\n */\n $oValidator = Phpfox::getLib('validator')->set(array(\n 'sFormName' => 'js_album_form',\n 'aParams' => $aValidation\n )\n );\n\n if ($oValidator->isValid($aVals))\n {\n if ($this->update($iAlbumId, $aVals))\n {\n return array('result' => 1, 'error_code' => 0, 'message' => Phpfox::getPhrase('music.album_successfully_updated'), 'iAlbumId' => $iAlbumId);\n }\n }\n\n return array('result' => 0, 'error_code' => 1, 'message' => Phpfox_Error::get());\n }", "function IsAccessAllowed($album)\n {\n if($this->access_locked)\n {\n //Access restricted\n if($this->IsRule($album->GetPath()))\n {\n //Custom access rules\n $accessList = $this->GetRule($album->GetPath());\n if(count($accessList) == 0){\n //Access forbidden for all\n return false;\n }\n if(count($accessList) == 1 && $accessList[0] == 'public'){\n //Access allowed for all\n return true;\n }\n $accessLogin = $this->ExpandGroups($accessList);\n if(in_array($this->login,$accessLogin)){\n //Login found\n return true;\n }else{\n //Login not match\n return false;\n }\n }else{\n \n if($album->GetPath() == '.'){\n //Use default access\n if(count($this->loginList) > 0) {\n //Need login\n if($this->login == 'public'){\n //Not logged\n return false;\n }else{\n if(in_array($this->login,$this->loginList)){\n //Login found\n return true;\n }else{\n //Login not match\n return false;\n }\n }\n \n }else{\n //Nobody can acess\n return false;\n }\n }else{\n //Use the parent access rules\n return $this->IsAccessAllowed($album->GetParent());\n }\n }\n }else{\n //Public Access\n return true;\n }\n }", "function fm_get_all_shared_by_folder($original, $foldid) {\r\n\t$tmpvar = get_records('fmanager_link',\"owner=$original AND folder\",$foldid);\r\n\r\n\treturn $tmpvar;\t\r\n}", "function imageUpload($args)\n{\n if (is_object($login_state = authorize($args))) {\n return $login_state;\n }\n $args = decode64($args);\n logger('uploadJSON', ($args['loglevel']));\n if (!($album = getItemByID('albums', $args['id']))) {\n return new ZEN_Error(-1, 'No folder with database ID '.$args['id'].' found!');\n }\n $filepath = getAlbumFolder().($args['parentFolder'] ? $args['parentFolder'].'/' : '').$args['folder'];\n $filename = $args['filename'];\n //$filepath = utf8_decode( $filepath );\n //$filename = utf8_decode( $filename );\n $filepath = $filepath;\n $filename = $filename;\n // save file\n $fp = fopen($filepath.'/'.$filename, 'wb');\n if (!$fp) {\n return new ZEN_Error(-1, 'Cannot open '.$filepath.'/'.$filename);\n }\n //fwrite( $fp, base64_decode( $args[ 'file' ] ) );\n if ($fw = fwrite($fp, base64_decode($args['file'])) === false) {\n return new ZEN_Error(-1, 'Cannot write to file '.$filename);\n }\n\n fclose($fp);\n $img = newImage($album, $filename);\n $img->setOwner($args['loginUsername']);\n //addZenPubData( $args[ 'id' ], $img->filename . '=' . $args[ $img->filename ] );\n return entitysave([\n 'status' => 'success',\n 'id' => $img->getID(),\n 'name' => $img->filename,\n 'url' => WEBPATH.'index.php?album='.urlencode($img->album->name).'&image='.urlencode($img->filename),\n ]);\n}" ]
[ "0.61731464", "0.6080777", "0.57638866", "0.5462034", "0.54261154", "0.5366065", "0.5357367", "0.52168953", "0.52019113", "0.5173662", "0.51727176", "0.51250154", "0.51250154", "0.51250154", "0.51250154", "0.51250154", "0.51250154", "0.51250154", "0.51250154", "0.51250154", "0.5122013", "0.50855863", "0.50687814", "0.50644326", "0.5022061", "0.5013727", "0.50000787", "0.4984826", "0.49774608", "0.49697196", "0.49658448", "0.49642318", "0.49207702", "0.4920514", "0.489646", "0.48895738", "0.4857086", "0.4839437", "0.48386937", "0.48239017", "0.48216894", "0.4811144", "0.47782826", "0.47749808", "0.47728756", "0.47675362", "0.47518775", "0.47461686", "0.474118", "0.47292", "0.47207886", "0.47192347", "0.471616", "0.47120792", "0.47040766", "0.46961096", "0.4695542", "0.469044", "0.4686729", "0.46772623", "0.4672176", "0.4669227", "0.465682", "0.4656308", "0.4656308", "0.4656308", "0.46558458", "0.46543086", "0.46523654", "0.4651377", "0.4646518", "0.4646025", "0.46397367", "0.46387443", "0.46281317", "0.46212822", "0.46094698", "0.45920926", "0.45898873", "0.45878333", "0.45846295", "0.45759767", "0.45704928", "0.4563684", "0.45592585", "0.4558433", "0.45578358", "0.45565686", "0.45501572", "0.45462137", "0.45462137", "0.45445165", "0.4537054", "0.45360917", "0.45358977", "0.45323843", "0.45288846", "0.4521985", "0.45147252", "0.45078093" ]
0.518686
9
Unshares an album and rebuilds the permissions cache
public function unshare($userId, array $album) { $shareUsers = unserialize($album['album_share_users']); if ($shareUsers !== false) { $db = $this->_getDb(); XenForo_Db::beginTransaction($db); $db->delete('xengallery_shared_map', "album_id = $album[album_id] AND shared_user_id = $userId"); XenForo_Db::commit($db); unset($shareUsers[$userId]); $albumWriter = XenForo_DataWriter::create('XenGallery_DataWriter_Album'); $albumWriter->setExistingData($album['album_id']); $albumWriter->set('album_share_users', serialize($shareUsers)); $albumWriter->save(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function unshare($user, $filename) {\n $stmt = $this->pdo->prepare('delete from share where owner_id = :id and file_id = (select id from file where user_id = :id and filename = :filename)');\n $stmt->bindValue(':id', $this->id);\n $stmt->bindValue(':filename', $filename);\n return $stmt->execute();\n }", "function clean_project_permissions_cache($project) {\n \tclean_permissions_cache();\n }", "public function uninstallFallbackAcl();", "public function unlink() {\n $this->credential->setAccessToken(null);\n $this->credential->setTokenType(null);\n }", "public function destroy($albumId)\n {\n \n }", "public function removeAccessToken();", "private function deduplicateShareTarget(IShare $share) {\n\t\t$userFolder = $this->rootFolder->getUserFolder($this->currentUser->getUID());\n\t\t$mountPoint = \\basename($share->getTarget());\n\t\t$parentDir = \\dirname($share->getTarget());\n\t\tif (!$userFolder->nodeExists($parentDir)) {\n\t\t\t$parentDir = Helper::getShareFolder();\n\t\t\t$pathAttempt = \\OC\\Files\\Filesystem::normalizePath($parentDir . '/' . $share->getTarget());\n\t\t} else {\n\t\t\t$pathAttempt = \\OC\\Files\\Filesystem::normalizePath($share->getTarget());\n\t\t}\n\n\t\t$pathinfo = \\pathinfo($pathAttempt);\n\t\t$ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : '';\n\t\t$name = $pathinfo['filename'];\n\n\t\t$i = 2;\n\t\twhile ($userFolder->nodeExists($pathAttempt)) {\n\t\t\t$pathAttempt = \\OC\\Files\\Filesystem::normalizePath($parentDir . '/' . $name . ' ('.$i.')' . $ext);\n\t\t\t$i++;\n\t\t}\n\n\t\t$share->setTarget($pathAttempt);\n\n\t\treturn $share;\n\t}", "function clean_permissions_cache() {\n cache_remove_by_pattern('visible_types_filter_for_*');\n \tcache_remove_by_pattern('visible_project_types_filter_for_*');\n \tcache_remove_by_pattern('visible_project_types_for_*');\n }", "function the_champ_unlink(){\r\n\tif(isset($_POST['provider'])){\r\n\t\tglobal $user_ID;\r\n\t\t$linkedAccounts = get_user_meta($user_ID, 'thechamp_linked_accounts', true);\r\n\t\t$primarySocialNetwork = get_user_meta($user_ID, 'thechamp_provider', true);\r\n\t\tif($linkedAccounts || $primarySocialNetwork){\r\n\t\t\t$socialNetworkToUnlink = sanitize_text_field($_POST['provider']);\r\n\t\t\t$linkedAccounts = maybe_unserialize($linkedAccounts);\r\n\t\t\t$currentSocialId = get_user_meta($user_ID, 'thechamp_current_id', true);\r\n\t\t\tif($primarySocialNetwork == $socialNetworkToUnlink){\r\n\t\t\t\tif($currentSocialId == get_user_meta($user_ID, 'thechamp_social_id', true)){\r\n\t\t\t\t\tdelete_user_meta($user_ID, 'thechamp_current_id');\r\n\t\t\t\t}\r\n\t\t\t\tdelete_user_meta($user_ID, 'thechamp_social_id');\r\n\t\t\t\tdelete_user_meta($user_ID, 'thechamp_provider');\r\n\t\t\t\tdelete_user_meta($user_ID, 'thechamp_large_avatar');\r\n\t\t\t\tdelete_user_meta($user_ID, 'thechamp_avatar');\r\n\t\t\t}else{\r\n\t\t\t\tif($currentSocialId == $linkedAccounts[$socialNetworkToUnlink]){\r\n\t\t\t\t\tdelete_user_meta($user_ID, 'thechamp_current_id');\r\n\t\t\t\t}\r\n\t\t\t\tunset($linkedAccounts[$socialNetworkToUnlink]);\t\r\n\t\t\t\tupdate_user_meta($user_ID, 'thechamp_linked_accounts', maybe_serialize($linkedAccounts));\r\n\t\t\t}\r\n\t\t\tthe_champ_ajax_response(array('status' => 1, 'message' => ''));\r\n\t\t}\r\n\t}\r\n\tdie;\r\n}", "public function unshare($optParams = [])\n {\n $params = [];\n $params = array_merge($params, $optParams);\n return $this->call('unshare', [$params], BooksEmpty::class);\n }", "function deleteuser_album($user_id) {\r\n\tglobal $database;\r\n\r\n\t// DELETE ALBUMS, MEDIA, AND COMMENTS\r\n\t$database->database_query(\"DELETE FROM se_albums, se_media, se_mediacomments, se_mediatags USING se_albums LEFT JOIN se_media ON se_albums.album_id=se_media.media_album_id LEFT JOIN se_mediacomments ON se_media.media_id=se_mediacomments.mediacomment_media_id LEFT JOIN se_mediatags ON se_media.media_id=se_mediatags.mediatag_media_id WHERE se_albums.album_user_id='{$user_id}'\");\r\n\r\n\t// DELETE TAGS OF USER\r\n\t$database->database_query(\"UPDATE se_mediatags SET mediatag_user_id='0' WHERE mediatag_user_id='{$user_id}'\");\r\n\r\n\t// DELETE STYLE\r\n\t$database->database_query(\"DELETE FROM se_albumstyles WHERE albumstyle_user_id='{$user_id}'\");\r\n}", "function ciniki_gallery_albumDelete(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'album_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Album'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'gallery', 'private', 'checkAccess');\n $rc = ciniki_gallery_checkAccess($ciniki, $args['tnid'], 'ciniki.gallery.albumDelete', 0); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Get the existing image information\n //\n $strsql = \"SELECT ciniki_gallery_albums.id, ciniki_gallery_albums.uuid, \"\n . \"COUNT(ciniki_gallery.id) AS num_images \"\n . \"FROM ciniki_gallery_albums \"\n . \"LEFT JOIN ciniki_gallery ON (ciniki_gallery_albums.id = ciniki_gallery.album_id \"\n . \"AND ciniki_gallery.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"WHERE ciniki_gallery_albums.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND ciniki_gallery_albums.id = '\" . ciniki_core_dbQuote($ciniki, $args['album_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.gallery', 'album');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['album']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.gallery.5', 'msg'=>'Gallery album does not exist'));\n }\n $album = $rc['album'];\n\n if( $album['num_images'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.gallery.6', 'msg'=>'The album still has images in it. Please remove all images before deleting the album.'));\n }\n \n //\n // Remove the album\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n return ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.gallery.album', $args['album_id'], $album['uuid'], 0x07);\n}", "public function forgetCachedPermissions()\n {\n app(PermissionRegistrar::class)->forgetCachedPermissions();\n }", "function media_cleanup() { \r\n global $media;\r\n global $avatars;\r\n global $photoalbumsmedia;\r\n \r\n $query1 = \"SELECT `media_id` , `media_userid` FROM `$media`s;\";\r\n $sqlr1 = bcsql_query( $query1 );\r\n $mediaids = bcsql_fetch_array( $sqlr1 );\r\n $num_rows1 = bcsql_num_rows( $mediaids );\r\n for( $i = 0; $i<$num_rows1; $i++ ) {\r\n $thismedia = $mediaids[ $i ];\r\n $thismediaid = $thismedia[ \"media_id\" ];\r\n $mediaclass = New media( $thismediaid );\r\n $userid = $mediaclass->userid();\r\n $userfile = $uploaddir . $userid .\"/\". $thismediaid;\r\n if( !file_exists( $userfile ) ) {\r\n $sql = \"DELETE FROM `$media` WHERE `media_id` = '$thismediaid';\"; \r\n bcsql_query( $sql );\r\n $sql = \"DELETE FROM `$avatars` WHERE `avatar_mediaid` = '$thismediaid';\";\r\n bcsql_query( $sql );\r\n $sql = \"DELETE FROM `$photoalbumsmedia` WHERE `pamedia_mediaid` = '$thismediaid';\";\r\n bcsql_query( $sql );\r\n }\r\n }\r\n //the oposite thing remains to be done\r\n }", "public function revokeAllPermissions();", "public function revokeAllPermissions();", "public function revoke_access() {\r\n // Nothing to do!\r\n }", "public function unarchive()\n {\n if ($this->canArchive()) {\n\n $this->archived = 0;\n $this->save();\n }\n }", "public function unShare($class)\n {\n if (array_key_exists($class, $this->stack)) {\n $this->__unset($class);\n }\n }", "public function delete($aData)\n {\n if (!Phpfox::getUserParam('music.can_access_music'))\n {\n return array('result' => 0, 'error_code' => 1, 'message' => 'You don\\'t have permission to access music module!');\n }\n /**\n * @var int\n */\n $iAlbumId = isset($aData['iAlbumId']) ? (int) $aData['iAlbumId'] : 0;\n /**\n * @var array\n */\n $aAlbum = Phpfox::getService('music.album')->getAlbum($iAlbumId);\n\n if (!isset($aAlbum['album_id']))\n {\n return array('result' => 0, 'error_code' => 1, 'message' => 'Unable to find the album you want to delete!');\n }\n\n // Check privacy.\n if (Phpfox::isModule('privacy') && !Phpfox::getService('privacy')->check('music_album', $aAlbum['album_id'], $aAlbum['user_id'], $aAlbum['privacy'], $aAlbum['is_friend'], true))\n {\n return array('result' => 0, 'error_code' => 1, 'message' => Phpfox::getPhrase('privacy.the_item_or_section_you_are_trying_to_view_has_specific_privacy_settings_enabled_and_cannot_be_viewed_at_this_time'));\n }\n\n if (Phpfox::getService('music.album.process')->delete($iAlbumId))\n {\n return array('result' => 1, 'error_code' => 0, 'message' => Phpfox::getPhrase('music.album_successfully_deleted'));\n }\n\n return array('result' => 0, 'error_code' => 1, 'message' => Phpfox_Error::get());\n }", "protected function forgetCachedPermissions()\n {\n app(PermissionRegistrar::class)->forgetCachedPermissions();\n }", "public function destroy(Album $album)\n {\n $this->authorize('delete', $album);\n $user = User::find(Auth::id());\n $album->user()->dissociate($user);\n\n $album->delete($album->id);\n\n return redirect()->route('archivo.index');\n }", "public function deleteAlbum()\n {\n if (Auth::user()->cannot('delete', Album::class)) {\n redirect()->to('artist.list');\n }\n \n // get album\n $album = Album::find($this->albumId);\n $album->delete();\n\n // reset\n $this->albumId = null;\n $this->album = null;\n $this->modalMessage = null;\n\n // event\n $this->emit('albumDeleted');\n $this->dispatchBrowserEvent('albumDeleted');\n }", "public function unlinkFacebook() {\n $this->setFacebookId(NULL);\n $this->setFbTokenExpireDate(NULL);\n $this->setAccessToken(NULL);\n }", "function uninstall()\n {\n \t// For now nothing in unistall, because we don't want user lose the data. \n }", "protected function resetStatuses()\n {\n $this->pubDirectory->delete($this->getRelativeFilePath(self::IMPORT_STATUS_READY));\n $this->pubDirectory->delete($this->getRelativeFilePath(self::IMPORT_STATUS_BUSY));\n $this->pubDirectory->delete($this->getRelativeFilePath(self::IMPORT_STATUS_FAILED));\n }", "public function deleteAlbum($albumId){\n\n //deletes all album likes\n DB::delete('delete from likes where album_id = ?', array($albumId));\n\n //deletes all album comments\n DB::delete('delete from comments where album_id = ?', array($albumId));\n\n //deletes all album moderators\n DB::delete('delete from album_moderators where album_id = ?', array($albumId));\n\n $photos = DB::table('photos')->where('album_id', $albumId)->get();\n\n $albums = DB::table('albums')->where('album_id', $albumId)->get();\n UserAction::add('Album \"' . ($albums[0]->album_name) . '\" was deleted');\n\n //if exist photos in this album\n if($photos){\n //deletes album directory\n $userId = $albums[0]->user_id;\n\n File::deleteDirectory('uploads/'.$userId.'/albums/'.$albumId);\n\n //deletes all album photo likes\n foreach($photos as $photo)\n DB::delete('delete from likes where photo_id = ?', array($photo->photo_id));\n\n //deletes all album photo comments\n foreach($photos as $photo)\n DB::delete('delete from comments where photo_id = ?', array($photo->photo_id));\n\n //delete all added album photo tags\n $photoTagsIds = DB::select('SELECT photo_tags.photo_tag_id\n FROM photos\n LEFT JOIN albums ON photos.album_id = albums.album_id\n LEFT JOIN photo_tags ON photos.photo_id = photo_tags.photo_id\n WHERE albums.album_id = ?\n GROUP BY photo_tags.photo_tag_id',array($albumId));\n foreach($photoTagsIds as $photoTagsId)\n //delete all added album photos tags\n DB::table('photo_tags')->where('photo_tag_id', $photoTagsId->photo_tag_id)->delete();\n\n //deletes all album photos data from database\n DB::table('photos')->where('album_id', $albumId)->delete();\n }\n //deletes album data from database\n DB::table('albums')->where('album_id', $albumId)->delete();\n\n return 'Deleted';\n }", "public function unsetMetadata(): void\n {\n $this->metadata = [];\n }", "public function deleteAlbumCascading($album_uid) {\r\n\t\t// Delete album\r\n\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('DELETE FROM tx_cwtcommunity_albums WHERE uid = \"'.intval($album_uid).'\";');\r\n\t\t// Delete comments for photos \r\n\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('DELETE FROM tx_cwtcommunity_photo_comments WHERE photo_uid IN (SELECT uid FROM tx_cwtcommunity_photos WHERE album_uid = \"'.intval($album_uid).'\");');\t\t\r\n\t\t// Delete photos\r\n\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('DELETE FROM tx_cwtcommunity_photos WHERE album_uid = \"'.intval($album_uid).'\";');\r\n\t}", "public function removeFromCache()\n {\n Cache::tags('file')->forget(strtolower($this->alias));\n }", "public function deleteUnused()\n\t{\n\t\t/*$file = Engine_Api::_()->getItem('storage_file', $this->file_id);\n\t\t if ($file) {\n\t\t $table = Engine_Api::_()->getDbtable('albumSongs', 'mp3music');\n\t\t $select = $table->select()\n\t\t ->where('file_id = ?', $file->getIdentity())\n\t\t ->limit(1);\n\t\t $count = count( $table->fetchAll($select) );\n\t\t if ($count >= 0)\n\t\t $file->delete();\n\t\t }\n\t\t $this->delete();*/\n\t\t$table = Engine_Api::_() -> getDbtable('albumSongs', 'mp3music');\n\t\t$data = array('is_delete' => 1, );\n\t\t$where = $table -> getAdapter() -> quoteInto('song_id = ?', $this -> song_id);\n\t\t$table -> update($data, $where);\n\t}", "public function clearFacebookCache()\n {\n $owner = $this->owner;\n if (!$owner->hasMethod('AbsoluteLink')) {\n return false;\n }\n $anonymousUser = Member::create();\n if ($owner->can('View', $anonymousUser)) {\n $curlRequest = curl_init();\n curl_setopt_array(\n $curlRequest,\n array(\n CURLOPT_URL => 'https://graph.facebook.com/v1.0/?id='. urlencode($owner->AbsoluteLink()). '&scrape=1',\n CURLOPT_POST => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_SSL_VERIFYPEER => false,\n )\n );\n $response = curl_exec($curlRequest);\n $headers = curl_getinfo($curlRequest);\n if(!$response || $headers['http_code'] !== 200) {\n return false;\n }\n return $response;\n }\n }", "function unarchive() {\n try {\n DB::beginWork('Unarchiving company @ ' . __CLASS__);\n \n parent::unarchive();\n\n $users = Users::findByCompany($this->object, null, STATE_ARCHIVED);\n if (is_foreachable($users)) {\n foreach ($users as $user) {\n if ($user->getState() == STATE_ARCHIVED) {\n if ($user instanceof IActivityLogs) {\n $user->activityLogs()->gag();\n } // if\n $user->state()->unarchive();\n } // if\n } // foreach\n } // if\n\n AngieApplication::cache()->removeByModel('users');\n \n DB::commit('Company unarchived @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to unarchive company @ ' . __CLASS__);\n \n throw $e;\n } // try\n }", "public function reset() {\n\n\t\t$type = Dba::escape($this->type);\n\t\t$uid = Dba::escape($this->uid);\n\n\t\t$sql = \"DELETE FROM `image` WHERE `object_id`='$uid' AND `object_type`='$type'\";\n\t\t$db_results = Dba::write($sql);\n\n\t}", "public function removeMirrors() {}", "public static function unfollow(){\n\n\t}", "public function unpinFiles()\r\n {\r\n // check permission\r\n $gid = $this->input->get_post('gid') ?: '-1';\r\n if ( ! $this->_is_group_owner($gid))\r\n {\r\n $this->_outputPermissionDeniedJSON();\r\n return;\r\n }\r\n\r\n $crumb = $this->input->get_post('crumb');\r\n if ( ! $this->login->validate_crumb($crumb, 'unpinFiles'))\r\n {\r\n $format = $this->input->get_post('format');\r\n if ($format == 'json' || (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest'))\r\n {\r\n $this->_outputCrubmErrorJSON();\r\n }\r\n show_error('Token invalid!', 403);\r\n }\r\n\r\n $fids = $this->input->get_post('fid');\r\n $rtn = $this->files_model->unpin_files($gid, $fids);\r\n $format = $this->input->get_post('format');\r\n if ($format == 'json' || (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest'))\r\n {\r\n $this->_outputJSON($rtn);\r\n }\r\n\r\n // return to pin list\r\n $folder_url = '/files/pins?' . $this->files_model->build_query_string();\r\n header('Location: ' . $folder_url);\r\n }", "public function deAuthorizeFacebookAccessToken($social_item_id, $uid){\n\t\t\t$properties = ['token_access'];\n\t\t\t$network_properties = $this->getKabbodeNetworkStatusProperty($social_item_id, $uid, $properties);\n\t\t\t$facebookHelper = new FacebookHelperFunction();\n $fb = $facebookHelper->getFBObject();\n\t\t\t$tkn = $network_properties['token_access']; \n\t\t\t// validate token, if not validated simply emove token fron DB else remove from fb\n\t\t\t $oAuth2Client = $fb->getOAuth2Client($tkn);\n $tokenMetadataObject = $oAuth2Client->debugToken();\n $validToken =$tokenMetadataObject->getProperty('is_valid');\n if(!$validToken ){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t$fb_permissions_list = ['pages_manage_posts','pages_manage_engagement','pages_manage_metadata', 'pages_read_engagement', 'pages_read_user_content']; \n\t\t\t$insta_permissions_list = ['instagram_basic', 'instagram_content_publish', 'instagram_manage_comments'];\n\t\t\t$insta_fb_common_permissions_list = ['pages_show_list', 'public_profile'];\n\t\t\t$permissionToRemove = [];\n\n $response = $fb->get('me/permissions', $tkn);\n\t\t\t$graphNode = $response->getDecodedBody();\n\t\t\t$is_flag = 0;\n\t\t\tif($social_item_id == 166){\n\t\t\t\t$current_permission_list = $fb_permissions_list;\n\t\t\t}\n\t\t\telseif($social_item_id == 168){\n\t\t\t\t$current_permission_list = $insta_permissions_list;\n\t\t\t}\n\t\t\t\n\t\t\tforeach($graphNode['data'] as $index=>$perm){\n\t\t\t if($perm['status'] == 'granted'){\n\t\t\t\tif(in_array($perm['permission'], $current_permission_list)){\n\t\t\t\t // prepare single permission list to remove here\n\t\t\t\t $permissionToRemove[] = $perm['permission']; \n\t\t\t\t //$is_flag = 1;\n\t\t\t\t // $response2 = $fb->delete('me/permissions/'.$perm['permission'], array(), $tkn);\n\t\t\t\t}\n\t\t\t\telseif(in_array($perm['permission'], $insta_fb_common_permissions_list)){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$is_flag = 1;\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n \n\t\t\tif($is_flag == 0){\n\t\t\t//remove complete permission\n\t\t\t $response3 = $fb->delete('me/permissions', array(), $tkn);\n\t\t\t} \n else{\n\t\t\t\t foreach($permissionToRemove as $key=>$val){\n\t\t\t\t\t $response2 = $fb->delete('me/permissions/'.$val, array(), $tkn); \n\t\t\t\t }\n\t\t\t }\n\t\t \n\t }", "public function detachPermissions($permissions);", "public function clearPermissionsCollection(): void\n {\n $this->permissions = null;\n }", "function doFacebook() {\n\n session_start();\n $facebook = new FacebookPhotos($GLOBALS['FB_API_KEY'],\n $GLOBALS['FB_SECRET']);\n\n if ($_REQUEST['fb'] == 'auth') {\n $album = $_SESSION['album'];\n if (!file_exists(\"a_$album\")) {\n print \"Please navigate here from the main album page\";\n exit(0);\n }\n $desc = getAlbumDescription($album);\n $fb_sig_user = $_REQUEST['fb_sig_user'];\n\n # First create the album\n $create_album_response = $facebook->api_client->photos_createAlbum(\n $desc, '', '', '', $fb_sig_user);\n $album_link = $create_album_response['link'];\n $aid = $create_album_response['aid'];\n\n print \"Created album <a href='$album_link'>$desc</a><br/>\\n\";\n flush();\n\n $photos = getPhotoList($album);\n $num_photos = count($photos);\n print \"Found $num_photos photos<br/>\\n\";\n flush();\n\n foreach ($photos as $photo) {\n try {\n $file = \"a_$album/m/m_$photo\";\n $photo_desc = getPhotoDescription($album, $photo);\n \n if (file_exists($file)) {\n\t $upload_response = $facebook->api_client->photos_upload(\n $file, $aid, $photo_desc, $fb_sig_user);\n $photo_link = $upload_response['link'];\n print \"Uploaded photo <a href='$photo_link'>$photo</a><br/>\\n\";\n flush();\n } else {\n\t print \"Skipping nonexistant file $file<br/>\\n\";\n\t flush();\n }\n } catch (Exception $e) {\n print \"Caught exception uploading $photo<br/>\\n\";\n\tflush();\n }\n } \n print \"Done<br/>\";\n } else {\n $_SESSION['album'] = $_REQUEST['fb'];\n $facebook->require_frame();\n }\n}", "public function unSetInheritance(){\n\t\t$pdo = Env::getDbConnectionForShare();\n\t\t$this->delete($pdo);\n\t\tself::updateInheritancesCache();\n\t}", "function apc_cache_unlock_click_index() {\n\tapc_delete(APC_CACHE_CLICK_INDEX_LOCK);\n}", "public function removeUsageRights() {}", "public function shareRemoveCallback(Horde_Share_Object $share)\n {\n try {\n Horde::callHook('share_remove', array($share));\n } catch (Horde_Exception_HookNotSet $e) {\n }\n }", "public function remove_packlink_meta_data() {\n\t\t$query = \"DELETE FROM `{$this->db->postmeta}` WHERE `meta_key` LIKE \\\"%_packlink_%\\\"\";\n\n\t\t$this->db->query( $query );\n\t}", "function __clear_multi_author_cache()\n {\n }", "public function deleteAvatar(): self\n {\n return $this->clearMediaCollection(self::MEDIA_AVATARS_COLLECTION);\n }", "private function clearSharedCache() {\n\t if( $this->mId ) {\n\t\t global $wgMemc;\n\t\t $wgMemc->delete( wfMemcKey( 'cedar_user', 'id', $this->mId ) );\n\t }\n }", "public function destroy($id){\n\n $user = JWTAuth::parseToken()->authenticate();\n $album = Album::find($id);\n\n if(Gate::forUser($user)->allows('albums-delete', $album)){\n\n $success = $this->albumRepository->deleteAlbum($album);\n\n if($success){\n return response()->json([\n 'success' => true,\n 'message' => 'Album successfully removed'\n ]);\n }else{\n return response()->json([\n 'success' => false,\n 'message' => \"We can't remove this album, please contact the administrator for support. For now try to unpublish the album to make it private.\"\n ],500);\n }\n }else{\n return response()->json([\n 'success' => false,\n 'errors' => [\"Access denied. You can't delete this album.\"]\n ],403);\n }\n }", "public function revokePermissions()\n {\n return $this->permissions()->detach();\n }", "public function imageUnlink($imgdata){\r\n $about_us_team_member_id = $imgdata['team_member_id'];\r\n $sql = \"SELECT member_image FROM tbl_aboutus_team WHERE team_member_id='$about_us_team_member_id'\";\r\n $query_result = mysqli_query($this->db_connect, $sql);\r\n $member_image = mysqli_fetch_assoc($query_result);\r\n return unlink($member_image['member_image']);\r\n }", "private function doCleanup($unchecked)\n {\n $tracker = $this->tracker;\n /* @var \\PhpGuard\\Listen\\Resource\\TrackedObject $tracked */\n foreach($unchecked as $id=>$tracked){\n $origin = $tracked->getResource();\n if(!$origin->isExists()){\n $tracker->addChangeSet($tracked,FilesystemEvent::DELETE);\n $tracker->remove($tracked);\n }\n unset($unchecked[$id]);\n }\n }", "function fm_update_shared_cats($catid) {\r\n\r\n\tif ($sharedlinks = get_records('fmanager_shared', \"sharedlink=$catid AND type\", STYPE_CAT)) {\r\n\t\tforeach ($sharedlinks as $sl) {\t\t\r\n\t\t\tif (!delete_records('fmanager_shared', \"id\", $sl->id)) {\r\n\t\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "public function unpublish( Location $location );", "public function purgeUrl($without = 0,$cache_url = null)\n {\n $zone_id = $this->apiClient('purge'); \n $cache = $this->getCacheConnection();\n if($without==1)\n {\n if(!$cache_url == null)\n { \n $files = array($cache_url);\n $purge_cache=$cache->purge_files($zone_id,$files);\n $purge_cache = (array) $purge_cache;\n if(isset($purge_cache['error']))\n {\n return 3;\n }\n else\n {\n return 2;\n }\n \n }\n else\n {\n return 0;\n }\n }\n else\n {\n $purge_cache=$cache->purge($zone_id);\n $purge_cache = (array) $purge_cache;\n if(isset($purge_cache['error']))\n {\n return 3;\n }\n else\n {\n return 2;\n }\n return 2;\n }\n\n }", "public function delete_all_photos() {\r\n return Foto::where('albums_id', '=', $this->id)->delete();\r\n }", "function photosets_removePhoto ($photoset_id, $photo_id) {\n\t\t$params['method'] = 'flickr.photosets.orderSets';\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.removePhoto', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function destroy($id)\n\t{\n\t\t\n\t\t$album = Album::find($id);\n\t\tif ($album->system == false) {\n\t\t\t$no_album = Album::find(1);\n\t\t\t$images = $album->images;\n\t\t\tforeach($images as $image){\n\t\t\t\t$image->album()->associate($no_album);\n\t\t\t\t$image->save();\n\t\t\t}\n\t\t\tif (empty($album))\n\t\t\t\treturn Response::json(array('success' => false));\n\t\t\t$album->delete();\n\t\t\treturn Response::json(array('success' => true));\n\t\t}\n\t\treturn Response::json(array('success' => false));\n\t}", "public function removeBasicCache()\n {\n $this->deleteDirectory($this->varCache);\n $this->deleteDirectory($this->varPageCache);\n }", "public function uninstall() {\n\t\t$this->load->model( 'user/user_group' );\n\t\t// access - modify pavomenu edit\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'access', 'extension/module/pavomenu/menu' );\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'modify', 'extension/module/pavomenu/menu' );\n\t\t// END REMOVE USER PERMISSION\n\t}", "public function removeUpload()\n {\n $this->picture = null;\n }", "public function destroy($id)\n {\n $album=Album::find($id);\n //finding the photos related to that model\n $photos=DB::table('photos')->where('album_id',$id)->get();\n //fetching each photos to the variable photo\n foreach($photos as $photo)\n {\n //finding the photo in photo model\n $p=Photo::find($photo->id);\n //deleting photo from the storage as well as form the database \n if(Storage::delete('public/photos/'.$photo->album_id.'/'.$photo->photo));\n $p->delete();\n }\n //deleting the album\n if(Storage::delete('public/photos/'.$album->album_id.'/'.$album->cover_image));\n $album->delete();\n return redirect('/')->with('success','Album Deleted Sucessfully'); \n }", "public function revokeAllPermissions(){\n\n $this->permissions()->detach();\n return $this;\n }", "function uninstall(){}", "public function onAfterPublish()\n {\n $this->owner->clearFacebookCache();\n }", "public function delMetadata() {}", "public function delMetadata() {}", "public function delMetadata() {}", "public static function remove_jetpack_share() {\n\n\t\t\tremove_filter( 'the_excerpt', 'sharing_display', 19 );\n\t\t\tremove_filter( 'the_content', 'sharing_display', 19 );\n\t\t}", "public function uninstall();", "public function uninstall();", "public function unlinkAccount()\n {\n }", "public function clearRelationCache();", "public function unshare(Request $request, int $id)\n {\n $canvas = Canvas::findOrFail($id);\n\n if ($request->ajax() || $request->wantsJson()) {\n if ($canvas->user_id != Auth::id()) {\n $response = array(\n 'status' => 'KO',\n 'msg' => 'Unauthorized action',\n );\n return Response::json($response);\n } else {\n $canvas->share = '';\n $canvas->save();\n\n $response = array(\n 'status' => 'OK'\n );\n return Response::json($response);\n }\n } else {\n if ($canvas->user_id != Auth::id()) {\n abort(403, 'Unauthorized action.');\n }\n\n $canvas->share = '';\n $canvas->save();\n\n return redirect()->route('canvas.show', ['id' => $id]);\n }\n }", "public function unlock(UnlockAlbumRequest $request, Unlock $unlock): void\n\t{\n\t\t$unlock->do($request->album(), $request->password());\n\t}", "function unsetImage($uid,$table,$data,$path) {\n\t\n\t $this->db->select($data);\n $this->db->from($table);\n\t\t$this->db->where('uid',$uid);\n $query=$this->db->get();\t\t\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t $query=$query->result();\n\t\t $img=$query[0]->$data;\n @unlink($path.$img);\n\t\t}\t\n return true;\t\t\n\t}", "public function resetExtensionCopyStorage() {}", "function onUninstall(){\n\tdelete_option( 'stackoverflowUser' );\n\tdelete_option( 'StackoverflowData' );\n}", "function updateShares(array $add, array $remove);", "public function excluirAlbumPorId($idAlbum){\r\n \r\n $sql = mysql_query(\"DELETE FROM video_album WHERE id_album='$idAlbum'\") or die(mysql_error());\r\n \r\n if($sql == true){\r\n\t\r\n\treturn true; \r\n\t\r\n }else{\r\n\t\r\n\treturn false; \r\n }\r\n\t\r\n}", "abstract protected function clearCache();", "public function setMusicAlbum($attributes = []);", "function unlockCacheObject ()\n {\n return unlink($this->cacheObjectId.'.lock');\n }", "function removeHard()\r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$userid = ($this->user) ? $this->user->id : $this->owner_id;\r\n\r\n\t\tUserFilesRemoveFile($dbh, $this->id, $userid, false, true);\r\n\t}", "public static function flushBackendCache()\n {\n sugar_cache_clear('SugarFeedModules');\n if (file_exists($cachefile = sugar_cached('modules/SugarFeed/moduleCache.php'))) {\n unlink($cachefile);\n }\n\n sugar_cache_clear('SugarFeedLinkType');\n if (file_exists($cachefile = sugar_cached('modules/SugarFeed/linkTypeCache.php'))) {\n unlink($cachefile);\n }\n }", "function delete_album($pid) {\n $sql = \"DELETE FROM album WHERE id='$pid'\";\n $this->mysqli->query($sql);\n }", "public function deleteAlbum($id)\n {\n return DB::table('albums')->where(['id' => $id])->delete();\n }", "public function deleteAlbum(string $access_token, array $params = [], int $apiTokenType = VKApiTokenTypes::USER)\n\t{\n\t\treturn $this->request->post('video.deleteAlbum', $access_token, $params, $apiTokenType);\n\t}", "function studio_remove_share() {\n if ( function_exists( 'sharing_display' ) ) {\n remove_filter( 'the_content', 'sharing_display',19 );\n remove_filter( 'the_excerpt', 'sharing_display',19 );\n }\n if ( class_exists( 'Jetpack_Likes' ) ) {\n remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );\n }\n}", "public function unlike()\n {\n $this->likes()->where('user_id', auth()->id())->delete();\n }", "function untrash() {\n try {\n DB::beginWork('Restoring company from a trash @ ' . __CLASS__);\n \n parent::untrash();\n\n $users = Users::findByCompany($this->object, null, STATE_TRASHED);\n if (is_foreachable($users)) {\n foreach ($users as $user) {\n if ($user->getState() == STATE_TRASHED) {\n if ($user instanceof IActivityLogs) {\n $user->activityLogs()->gag();\n } // if\n $user->state()->untrash();\n } // if\n } // foreach\n } // if\n\n AngieApplication::cache()->removeByModel('users');\n \n DB::commit('Company restored from a trash @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to restore company from trash @ ' . __CLASS__);\n \n throw $e;\n } // try\n }", "public function unsetFileAndFolderNameFilters() {}", "public function unlike(){\n $this->likes()->where([\n 'user_id' => auth()->id()\n ])->delete();\n }", "public function testUnlink()\n {\n $filename = static::$baseFile . '/fs/tmp.txt';\n\n file_put_contents($filename, 'It works!');\n $this->assertTrue(file_exists($filename));\n\n $this->assertTrue(unlink($filename));\n\n clearstatcache();\n $this->assertFalse(file_exists($filename));\n }", "function heateor_ss_clear_share_count_cache(){\r\n\tglobal $wpdb;\r\n\t$wpdb->query( \"DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_heateor_ss_share_count_%'\" );\r\n\tdie;\r\n}", "public function clearMetas(): void\n {\n $this->metas()->delete();\n }", "function getViewAlbumDelete($album_uid){\n\t\t// Get Smarty Instance\n \t$smartyInstance = tx_cwtcommunity_lib_common::getSmartyInstance();\n $conf = tx_cwtcommunity_lib_common::getConfArray();\n $tplPath = tx_cwtcommunity_lib_common::getTemplatePath($conf['template_album_admin']);\n \n $albumData = self::getAlbum($album_uid);\n\t $form_action = tx_cwtcommunity_lib_common::getPageLink($conf['pid_gallery'],'', array(tx_cwtcommunity_lib_constants::CONST_ACTION => tx_cwtcommunity_lib_constants::ACTION_GALLERY_SHOW_ALBUM_DELETE, tx_cwtcommunity_lib_constants::CONST_ALBUM_UID => $albumData['uid']));\n \n $smartyInstance->assign('form_action', $form_action);\n $smartyInstance->assign('albumData', $albumData);\n \n $content .= $smartyInstance->display($tplPath);\n return $content;\n\t}", "public function clearRespizrImageCache()\n {\n $mediaPath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA);\n $resizedDirPath = $mediaPath . DS\n . Mage::getSingleton('respizr/config')->getRespizrDirName();\n\n if (is_dir($resizedDirPath)) {\n $io = new Varien_Io_File();\n $io->rmdir($resizedDirPath, true);\n }\n }", "public function purge()\n {\n $this->owner()->where('current_organization_id', $this->id)\n ->update(['current_organization_id' => null]);\n\n $this->users()->where('current_organization_id', $this->id)\n ->update(['current_organization_id' => null]);\n\n $this->users()->detach();\n\n $this->delete();\n }" ]
[ "0.54190344", "0.5298676", "0.5288068", "0.5280691", "0.52740175", "0.51574475", "0.5131263", "0.5127461", "0.50230503", "0.50160027", "0.5010798", "0.49887234", "0.49778366", "0.49481207", "0.4928026", "0.4928026", "0.49277896", "0.4915486", "0.4904108", "0.48433042", "0.48418176", "0.4836921", "0.4833802", "0.48096597", "0.48066697", "0.47906685", "0.47817758", "0.4781178", "0.47748038", "0.4766603", "0.47590825", "0.47552484", "0.4739219", "0.47308296", "0.4709255", "0.46920472", "0.46915993", "0.4679552", "0.46681842", "0.46651018", "0.46644595", "0.46605375", "0.46602812", "0.46502244", "0.4625698", "0.46223956", "0.45990202", "0.45833817", "0.4580586", "0.45733857", "0.4571423", "0.45651326", "0.45573202", "0.4555234", "0.4554482", "0.45543987", "0.45534056", "0.45531976", "0.45508328", "0.45471868", "0.4544022", "0.45412403", "0.4533805", "0.453343", "0.45208448", "0.45183218", "0.45177603", "0.45177603", "0.45177603", "0.45136714", "0.45131323", "0.45131323", "0.45081306", "0.4505726", "0.45043978", "0.44944268", "0.44892985", "0.44874603", "0.44862035", "0.44843715", "0.4482807", "0.44815874", "0.44725052", "0.44616193", "0.44601497", "0.44594964", "0.44592333", "0.4458353", "0.44560963", "0.4454611", "0.44488642", "0.44451153", "0.44438237", "0.44223332", "0.44112873", "0.4401016", "0.4400534", "0.43976495", "0.43913662", "0.43877408" ]
0.6329976
0
Logs the viewing of an album.
public function logAlbumView($albumId) { $this->_getDb()->query(' INSERT ' . (XenForo_Application::get('options')->enableInsertDelayed ? 'DELAYED' : '') . ' INTO xengallery_album_view (album_id) VALUES (?) ', $albumId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Album $album)\n {\n //\n }", "public function log_view() {\n \\filter_embedquestion\\event\\question_viewed::create(['context' => $this->embedlocation->context,\n 'objectid' => $this->current_question()->id])->trigger();\n }", "public function viewAction()\n\t{\n\t\t$log = $this->_initLog();\n\t\t\n if (!$log->getId()) {\n $this->_getSession()->addError(Mage::helper('logging')->__('This log no longer exists.'));\n $this->_redirect('*/*/');\n return;\n }\n\n $this->_title( Mage::helper('logging')->__('Showing log entry') );\n\n\t\t$this->loadLayout();\n\t\t\n\t\t$this->getLayout()->getBlock('head')->setCanLoadExtJs(false);\n\t\t$this->renderLayout();\n\t}", "public function logs()\n {\n $this->_display('logs');\n }", "public function actionView($id)\r\n {\r\n unset($_GET['id']);\r\n $_GET['album'] = $id;\r\n $this->forward('photo/member');\r\n /*\r\n $this->render('view', array(\r\n 'model' => $this->loadModel($id),\r\n ));\r\n */\r\n }", "public function indexAction() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return $this->setNoRender();\n }\n\n // Must be able to create albums\n if (!Engine_Api::_()->authorization()->isAllowed('album', $viewer, 'create')) {\n return $this->setNoRender();\n }\n\n $this->view->upload_button = $this->_getParam('upload_button', 0);\n $this->view->upload_button_title = $this->_getParam('upload_button_title', 'Add New Photos');\n }", "public function create()\n\t{\n //Cache::forget('google.access_token');\n\t\treturn view('log.albums');\n\t}", "public function showAlbumByConfigAction()\n {\n $mediaAlbum = $this->mediaAlbumRepository->findByUid((int)$this->settings['mediaAlbum'], false);\n if ($mediaAlbum) {\n // get all request arguments (e.g. pagination widget)\n $arguments = $this->request->getArguments();\n // set album id from settings\n $arguments['mediaAlbum'] = $this->settings['mediaAlbum'];\n\n $this->forward('showAlbum', null, null, $arguments);\n }\n }", "public function show($item_id, $tag_id, $album_id) {\n // As of Gallery 3.0.3, it is no longer needed, now it just\n // redirects to the photo's primary URL to avoid breaking older links.\n item::set_display_context_callback(\"tag_albums_Controller::get_display_context\", $tag_id, $album_id);\n $item = ORM::factory(\"item\", $item_id);\n url::redirect(url::abs_site(\"{$item->type}s/{$item->id}\"));\n }", "public function show(Album $album)\n {\n $this->authorize('show', $album);\n $albumes = User::find(Auth::id())->albums;\n return view('albums.show', [\n 'album' => $album,\n 'albumes' => $albumes,\n ]);\n //return $albumes;\n }", "public function log() {\r\n\t\t$this->resource->log();\r\n\t}", "public function testAuditLogNavigationLinksOpensAuditLogPage()\n {\n $user = User::find(User::JANITOR_USER_ID);\n\n $this->browse(function ($browser) use ($user) {\n $browser->loginAs($user)\n ->visit(new HomePage)\n ->click('@nav-cog')\n ->clickLink('Audit Log')\n ->on(new AuditLogPage);\n });\n }", "public function showAlbumAction($mediaAlbum = null)\n {\n $mediaAlbum = (int)$mediaAlbum ?: null;\n if (empty($mediaAlbum)) {\n $mediaAlbum = (int)$this->settings['mediaAlbum'];\n }\n // if album uid is set through settings (typoscript or flexform) we skip the storage check\n $respectStorage = true;\n if ((int)$this->settings['mediaAlbum'] === (int)$mediaAlbum) {\n $respectStorage = false;\n }\n $mediaAlbum = $this->mediaAlbumRepository->findByUid($mediaAlbum, $respectStorage);\n if (!$mediaAlbum) {\n $this->pageNotFound(LocalizationUtility::translate('no_album_found', $this->extensionName));\n }\n $this->view->assign('mediaAlbum', $mediaAlbum);\n $this->view->assign('showBackLink', false);\n }", "public function log()\n {\n $output = new Output(Output::MODE_FILE, $this->getLogPath());\n $output->open();\n foreach (func_get_args() as $argument) {\n $output->dump($argument);\n }\n $output->close();\n }", "public function show($album_id, $id)\n {\n $album = Album::find($album_id);\n\n if (!$album)\n {\n return Redirect::home()->with('error_message', 'الرجاء التأكّد من طلب معرّف ألبوم صحيح.');\n }\n\n $album->views_count++;\n $album->save();\n\n // Get the chosen or the latest photo.\n if ($id == null)\n {\n $photo = Photo::where('album_id', '=', $album->id)->orderBy('position', 'DESC')->first();\n }\n else\n {\n $photo = Photo::where('album_id', '=', $album->id)->where('id', '=', $id)->orderBy('position', 'DESC')->first();\n }\n\n if ($photo == null)\n {\n return Redirect::home()->with('error_message', 'لم يتم إضافة صور حتّى الآن أو أن معرّف الصورة غير صحيح.');\n }\n\n // Update the views count.\n $photo->views_count++;\n $photo->save();\n\n // Get the previous photos.\n $previous_photos = Photo::where('album_id', '=', $album->id)->where('position', '<', $photo->position)->orderBy('position', 'DESC')->limit(Photo::PHOTOS_PER_PAGE/2)->get();\n\n // Get the next photos.\n $next_photos = Photo::where('album_id', '=', $album->id)->where('position', '>', $photo->position)->orderBy('position', 'ASC')->limit(Photo::PHOTOS_PER_PAGE/2)->get();\n\n // Set the related photos.\n $related_photos = $previous_photos->merge($next_photos);\n\n return View::make(\"photos.show\")\n ->with('album', $album)\n ->with('photo', $photo)\n ->with('previous_photos', $previous_photos)\n ->with('next_photos', $next_photos)\n ->with('related_photos', $related_photos);\n }", "public function album($id)\r\n\t{\r\n\t\t//check for admin\r\n\t\tif($this->session->userdata('logged_in'))\r\n\t\t{\r\n\t\t\t$session_data = $this->session->userdata('logged_in');\r\n\t\t\t$data['username'] = $session_data['username'];\r\n\t\t\t$data['admin'] = $session_data['admin'];\r\n\t\t}\r\n\t\telse\r\n\t\t\t$data['username'] = '';\r\n\t\t\t\r\n\t\t// set active tab\r\n\t\t$data['welcome_active'] = \"\";\r\n\t\t$data['host_active'] = \"\";\r\n\t\t$data['event_active'] = \"active\";\r\n\t\t\r\n\t\t// get list of photos\r\n\t\t$data['photos'] = $this->caifmodel->get_photos_by_album($id);\r\n\t\t$data['albums'] = $this->caifmodel->get_albums();\r\n\t\t$data['album_id'] = $id;\r\n\t\t\r\n\t\t// load views\r\n\t\t$this->load->view('include/header',$data);\r\n\t\t$this->load->view('include/tabs',$data);\r\n\t\t$this->load->view('album',$data);\r\n\t\t$this->load->view('include/footer');\r\n\t}", "public function log()\n {\n $this->appendLog('log', \\func_get_args());\n }", "public function show(){\n\t\t$data['segmento'] = $this->uri->segment(3);\n\t\t\t$data['imgs'] = $this->album_model->fotosAlbum($data['segmento'])->result();\n \n\t\t\t$data['Albums'] = $this->album_model->obtenerAlbum($data['segmento']);\n\n\t\tif ($data['Albums']!= null) {\n\t\t\t$this->load->view('header', array ('pagina' => 'Album'));\n\t\t\t$this->load->view('Upload/upload_form', $data);\n\t\t\t$this->load->view('Album/mostrar',$data);\n\t\t\t$this->load->view('footer.php');\n\n\t\t}else{\n\t\t\t$this->load->view('404');\t \t\n\t\t}\n\t}", "public function show(PhotoGalary $photoGalary)\n {\n //\n }", "function album($id) {\n\n // Get nickname\n if (isset($_SESSION['nickname'])) $nn = $_SESSION['nickname'];\n else $nn = 'nobody';\n\n $this->pager->limit = $this->per_page;\n\n // Start pager\n $this->pager->setStart();\n\n // \"Cache Groups\" using a vertical bar |\n $cache_id = \"$nn|album|{$id}|\" . $this->pager->start;\n $this->tpl->caching = 1;\n\n if (!$this->tpl->isCached('album.tpl', $cache_id)) {\n\n $this->pager->setPages($this->photo->countPhotos($id));\n $this->r->text['pager'] = $this->pager->pageList(suxFunct::makeUrl(\"/photos/album/{$id}\"));\n $this->r->arr['photos'] = $this->photo->getPhotos($this->pager->limit, $this->pager->start, $id);\n $this->r->arr['album'] = $this->photo->getAlbumByID($id);\n\n if ($this->r->arr['album'] && $this->r->arr['photos'] && (is_countable($this->r->arr['photos']) ? count($this->r->arr['photos']) : 0))\n {\n $tmp = $this->user->getByID($this->r->arr['album']['users_id']);\n $this->r->arr['album']['nickname'] = $tmp['nickname'];\n $this->r->title .= \" | {$this->r->gtext['photos']} | {$this->r->arr['album']['title']}\";\n }\n\n else {\n $this->tpl->caching = 0; // Nothing to cache, avoid writing to disk\n }\n\n }\n\n $this->tpl->display('album.tpl', $cache_id);\n\n }", "protected function log() {\n }", "public function getAlbumInfoAction()\n {\n \t$params = $this->getRequest()->getParams();\n\n \t$result = \\Extended\\socialise_album::getSocialiseAlbumInfo( $params['album_id'] );\n \n \tif( $result ):\n \techo Zend_Json::encode( $result );\n \telse:\n \t//Wallpost doesnot exist anymore.\n \techo Zend_Json::encode( 2 );\n \tendif;\n \tdie;\n }", "public function afficherAlbum() {\n\t\tsession_start();\n\t\t$idAl = $this->route[\"params\"][\"id\"];\n\t\tif(isset($_POST['commentaire'])) {\n\t\t\t$comment = $_POST['commentaire'];\n\t\t\t$idU = $_SESSION['id'];\n\t\t\tCommentaire::ajouterCommentaire($idAl,$idU,$comment);\n\t\t}\n\t\tif(isset($_POST['note'])){\n\t\t\t$note = $_POST['note'];\n\t\t\t$idU = $_SESSION['id'];\n\t\t\tNote::ajouterNote($idAl,$idU,$note);\n\t\t}\n\t\t//$this->view->note = Note::CalculMoyFromId($idAl);\n\t\t$this->view->album = Album::getFromId($idAl);\n\t\t$this->view->com = Commentaire::getListeFromAlbum($idAl);\n\t\t$this->view->display();\n\t}", "function showUploadPhoto() {\n\t\t$this->setCacheLevelNone();\n\t\t$event = $this->getModel()->getEvent();\n\t\t$source = $this->getModel()->getSource();\n\t\t\n\t\tif ( $event->getID() == $source->getEventID() ) {\n\t\t\t$this->getEngine()->assign('event', utilityOutputWrapper::wrap($event));\n\t\t\t$this->getEngine()->assign('source', utilityOutputWrapper::wrap($source));\n\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('multifile', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/jquery.MultiFile.js'));\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('photoupload', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/mofilmphotoupload.js'));\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('blockui', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/jquery.blockUI.js'));\n\t\t\t$this->getEngine()->assign('error', FALSE);\n\t\t} else {\n\t\t\t$this->getEngine()->assign('error', TRUE);\n\t\t}\n\t\t\n\t\t$this->render($this->getTpl('uploadPhoto', '/account'));\n\t}", "public function actionIndex()\n {\n $searchModel = new AlbumSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public static function logging()\n {\n }", "public function logStatus()\n {\n //piece to handle the login/logout\n $u = $this->isAuth();\n $lstr = ($u) ? '<a href=\"/user/main\">' . $u .\n '</a> <a href=\"/user/logout\">[logout]</a>' :\n '<a href=\"/user/login\">login</a>';\n $this->template->write('logged', $lstr);\n }", "static public function log($op, $owner) {\n logger(\"LOG: user($owner), '$op'\", true);\n return;\n }", "function action_track() {\n if(model_user::userLoggedIn()) {\n // Include view for this page.\n @include_once APP_PATH . 'view/track_page.tpl.php';\n } else {\n header('Location: /home/login');\n }\n }", "public function setTrack(SetAlbumTrackRequest $request): void\n\t{\n\t\t$request->album()->setTrack($request->file);\n\t}", "function setup_album()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'id, name, member_id, public_album', 'from' => 'gallery_albums', 'where' => \"id={$this->ipsclass->input['album']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $info = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this album?\n if( $info['member_id'] == $this->ipsclass->member['id'] )\n {\n $own = true;\n }\n\n if( ! $info['public_album'] && ! $own )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );\n }\n\n return $info;\n }", "public function albumbyLocationsAction() {\n\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('album')) {\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('album_main', array(), 'sitetagcheckin_main_albumlocation');\n $this->_helper->content->setEnabled();\n } /* elseif ( Engine_Api::_()->getDbtable( 'modules' , 'core' )->isModuleEnabled( 'advgroup' )) {\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('advgroup_main', array(), 'sitetagcheckin_main_groupbylocation');\n $this->_helper->content->setEnabled();\n } */ else {\n return $this->_forward('notfound', 'error', 'core');\n }\n }", "private function _logAnalytics($subject) {\n $clientIP = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ?\n $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];\n $analyticsData = array();\n $principalValues = array_values($subject->getPrincipal());\n if(count($principalValues) > 0)\n $analyticsData['user'] = $principalValues[0]; \n //$subject->getPrincipal(); // Get the user from the principal\n $analyticsData['time'] = time(); \n $analyticsData['session'] = session_id(); \n $analyticsData['page'] = 'login'; \n $analyticsData['UA'] = $_SERVER['HTTP_USER_AGENT'];\n $analyticsData['ip'] = $clientIP;\n $GLOBALS['routeLogger']->info(json_encode($analyticsData));\n }", "public function log()\n {\n $this->fetchFields();\n Log::console($this);\n }", "public function testAuditLogNavigationLinksIsPresent()\n {\n $user = User::find(User::JANITOR_USER_ID);\n\n $this->browse(function ($browser) use ($user) {\n $browser->loginAs($user)\n ->visit(new HomePage)\n ->click('@nav-cog')\n ->assertSee('Audit Log');\n });\n }", "public function updateAlbumViews()\n\t{\n\t\t$db = $this->_getDb();\n\n\t\t$updates = $db->fetchPairs('\n\t\t\tSELECT album_id, COUNT(*)\n\t\t\tFROM xengallery_album_view\n\t\t\tGROUP BY album_id\n\t\t');\n\n\t\tXenForo_Db::beginTransaction($db);\n\n\t\t$db->query('TRUNCATE TABLE xengallery_album_view');\n\n\t\tforeach ($updates AS $albumId => $views)\n\t\t{\n\t\t\t$db->query('\n\t\t\t\tUPDATE xengallery_album SET\n\t\t\t\t\talbum_view_count = album_view_count + ?\n\t\t\t\tWHERE album_id = ?\n\t\t\t', array($views, $albumId));\n\t\t}\n\n\t\tXenForo_Db::commit($db);\n\t}", "public function show(Photo $photo)\n {\n //\n }", "public function show(Photo $photo)\n {\n //\n }", "public function show(Photo $photo)\n {\n //\n }", "function show_log()\n\t{\n\t\t$options = array();\n\t\tif($this->input->get_post(\"kTeach\")){\n\t\t\t$options[\"kTeach\"] = $this->input->get_post(\"kTeach\");\n\t\t}\n\n\t\tif($this->input->get_post(\"username\")){\n\t\t\t$options[\"username\"] = $this->input->get_post(\"username\");\n\t\t}\n\n\t\tif($this->input->get_post(\"action\")){\n\t\t\t$options[\"action\"] = $this->input->get_post(\"action\");\n\t\t}\n\n\t\tif($this->input->get_post(\"time_start\") && $this->input->get_post(\"time_end\")){\n\t\t\t$time_start = $this->input->get_post(\"time_start\");\n\t\t\t$time_end = $this->input->get_post(\"time_end\");\n\t\t\t$time_end .= \" 23:59:59\";// make the end time the end of the same day\n\t\t\t$options[\"date_range\"][\"time_start\"] = $time_start;\n\t\t\t$options[\"date_range\"][\"time_end\"] = $time_end;\n\t\t}\n\n\t\t$data[\"header\"] = array(\"username\",\"timestamp\",\"action\");\n\t\t$data[\"logs\"] = $this->auth_model->get_log($options);\n\t\t$data[\"options\"] = $options;\n\t\t$data[\"target\"] = \"admin/log\";\n\t\t$data[\"title\"] = \"User Log\";\n\t\t$this->load->view(\"page/index\",$data);\n\t}", "public function logs($id);", "public function index()\n {\n $albums = User::find(Auth::id())->albums;\n return view('albums.index', [\n 'albums' => $albums\n ]);\n }", "public function process()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('photo.component_controller_album__1')) ? eval($sPlugin) : false);\n\t\t\n\t\tPhpfox::getUserParam('photo.can_view_photo_albums', true);\n\t\tPhpfox::getUserParam('photo.can_view_photos', true);\n\t\t\n\t\t// Get the user details (person we are viewing)\n\t\t$aUser = $this->getParam('aUser');\t\t\t\t\n\t\t\n\t\tif (Phpfox::isUser() && Phpfox::isModule('notification'))\n\t\t{\n\t\t\tPhpfox::getService('notification.process')->delete('comment_photo_album', $this->request()->getInt('req3'), Phpfox::getUserId());\n\t\t\tPhpfox::getService('notification.process')->delete('photo_album_like', $this->request()->getInt('req3'), Phpfox::getUserId());\n\t\t}\t\t\n\t\t\n\t\t(($sPlugin = Phpfox_Plugin::get('photo.component_controller_album_process_start')) ? eval($sPlugin) : false);\t\t\n\t\t\n\t\t$bIsProfilePictureAlbum = false;\n\t\tif ($this->request()->getInt('req3') == 'profile')\n\t\t{\n\t\t\t$bIsProfilePictureAlbum = true;\n\t\t\t$aAlbum = Phpfox::getService('photo.album')->getForProfileView($this->request()->getInt('req4'));\n\t\t\t$aAlbum['name'] = Phpfox::getPhrase('photo.profile_pictures');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Get the current album we are trying to view\n\t\t\t$aAlbum = Phpfox::getService('photo.album')->getForView($this->request()->getInt('req3'));\t\t\t\n\t\t\tif ($aAlbum['profile_id'] > 0)\n\t\t\t{\n\t\t\t\t$bIsProfilePictureAlbum = true;\n\t\t\t\t$aAlbum['name'] = Phpfox::getPhrase('photo.profile_pictures');\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Make sure this is a valid album\n\t\tif ($aAlbum === false)\n\t\t{\n\t\t\treturn Phpfox_Error::display(Phpfox::getPhrase('photo.invalid_photo_album'));\n\t\t}\t\t\n\t\t\n\t\t$aCallback = null;\n\t\tif (!empty($aAlbum['module_id']))\n\t\t{\t\t\t\n\t\t\tif ($aCallback = Phpfox::callback($aAlbum['module_id'] . '.getPhotoDetails', $aAlbum))\n\t\t\t{\n\t\t\t\t$this->template()->setBreadcrumb($aCallback['breadcrumb_title'], $aCallback['breadcrumb_home']);\n\t\t\t\t$this->template()->setBreadcrumb($aCallback['title'], $aCallback['url_home']);\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\tif (!$bIsProfilePictureAlbum)\n\t\t{\n\t\t\tPhpfox::getService('core.redirect')->check($aAlbum['name'], 'req4');\n\t\t}\n\t\t\n\t\tif (Phpfox::isModule('privacy'))\n\t\t{\n\t\t\tPhpfox::getService('privacy')->check('photo_album', $aAlbum['album_id'], $aAlbum['user_id'], $aAlbum['privacy'], $aAlbum['is_friend']);\t\t\n\t\t}\n\t\t\n\t\t(($sPlugin = Phpfox_Plugin::get('photo.component_controller_album_process_album')) ? eval($sPlugin) : false);\n\t\t\n\t\t// Store the album details so we can use it in a block later on\n\t\t$this->setParam('aAlbum', $aAlbum);\n\n\t\t// Setup the page data\n\t\t$iPage = $this->request()->getInt('page');\n\t\t$iPageSize = Phpfox::getUserParam('photo.total_photo_display_profile');\n\n\t\t// Create the SQL condition array\n\t\t$aConditions = array();\n\t\t$aConditions[] = 'p.album_id = ' . $aAlbum['album_id'] . '';\n\t\t\n\t\t(($sPlugin = Phpfox_Plugin::get('photo.component_controller_album_process_conditions')) ? eval($sPlugin) : false);\n\t\t\n\t\t// Get the photos based on the conditions\n\t\tlist($iCnt, $aPhotos) = Phpfox::getService('photo')->get($aConditions, 'p.photo_id DESC', $iPage, $iPageSize);\n\t\t\n\t\t// Set the pager for the photos\n\t\tPhpfox::getLib('pager')->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));\t\t\n\n\t\tforeach ($aPhotos as $aPhoto)\n\t\t{\n\t\t\t$this->template()->setMeta('keywords', $this->template()->getKeywords($aPhoto['title']));\t\t\n\t\t\tif ($aPhoto['is_cover'])\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->template()->setMeta('og:image', Phpfox::getLib('image.helper')->display(array(\n\t\t\t\t\t\t\t'server_id' => $aPhoto['server_id'],\n\t\t\t\t\t\t\t'path' => 'photo.url_photo',\n\t\t\t\t\t\t\t'file' => $aPhoto['destination'],\n\t\t\t\t\t\t\t'suffix' => '_150',\n\t\t\t\t\t\t\t'return_url' => true\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\t\n\t\t\n\t\tif (Phpfox::getUserBy('profile_page_id'))\n\t\t{\n\t\t\tPhpfox::getService('pages')->setIsInPage();\n\t\t}\t\t\n\t\t\n\t\t$this->setParam('aFeed', array(\n\t\t\t\t'comment_type_id' => 'photo_album',\n\t\t\t\t'privacy' => $aAlbum['privacy'],\n\t\t\t\t'comment_privacy' => $aAlbum['privacy_comment'],\n\t\t\t\t'like_type_id' => 'photo_album',\n\t\t\t\t'feed_is_liked' => $aAlbum['is_liked'],\n\t\t\t\t'feed_is_friend' => $aAlbum['is_friend'],\n\t\t\t\t'item_id' => $aAlbum['album_id'],\n\t\t\t\t'user_id' => $aAlbum['user_id'],\n\t\t\t\t'total_comment' => $aAlbum['total_comment'],\n\t\t\t\t'total_like' => $aAlbum['total_like'],\n\t\t\t\t'feed_link' => $this->url()->permalink('photo.album', $aAlbum['album_id'], $aAlbum['name']),\n\t\t\t\t'feed_title' => $aAlbum['name'],\n\t\t\t\t'feed_display' => 'view',\n\t\t\t\t'feed_total_like' => $aAlbum['total_like'],\n\t\t\t\t'report_module' => 'photo_album',\n\t\t\t\t'report_phrase' => Phpfox::getPhrase('photo.report_this_photo_album')\n\t\t\t)\n\t\t);\n\n\t\t// Assign the template vars\n\t\t$this->template()->setTitle($aAlbum['name'])\n\t\t\t\t->setBreadcrumb(Phpfox::getPhrase('photo.photos'), ($aCallback === null ? $this->url()->makeUrl('photo') : $this->url()->makeUrl($aCallback['url_home_photo'])))\n\t\t\t\t->setBreadcrumb($aAlbum['name'], $this->url()->permalink('photo.album', $aAlbum['album_id'], $aAlbum['name']), true)\n\t\t\t\t->setMeta('description', (empty($aAlbum['description']) ? $aAlbum['name'] : $aAlbum['description']))\n\t\t\t\t->setMeta('keywords', $this->template()->getKeywords($aAlbum['name']))\n\t\t\t\t->setMeta('keywords', Phpfox::getParam('photo.photo_meta_keywords'))\n\t\t\t\t->setPhrase(array(\n\t\t\t\t\t\t'photo.updating_album',\n\t\t\t\t\t\t'photo.none_of_your_files_were_uploaded_please_make_sure_you_upload_either_a_jpg_gif_or_png_file'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t->setEditor()\n\t\t\t\t->setHeader('cache', array(\n\t\t\t\t\t'jquery/plugin/jquery.highlightFade.js' => 'static_script',\t\n\t\t\t\t\t'jquery/plugin/jquery.scrollTo.js' => 'static_script',\n\t\t\t\t\t'jquery/plugin/imgnotes/jquery.tag.js' => 'static_script',\t\t\t\t\t\t\n\t\t\t\t\t'quick_edit.js' => 'static_script',\n\t\t\t\t\t'comment.css' => 'style_css',\n\t\t\t\t\t'pager.css' => 'style_css',\n\t\t\t\t\t'view.js' => 'module_photo',\n\t\t\t\t\t'photo.js' => 'module_photo',\n\t\t\t\t\t'switch_legend.js' => 'static_script',\n\t\t\t\t\t'switch_menu.js' => 'static_script',\n\t\t\t\t\t'view.css' => 'module_photo',\n\t\t\t\t\t'feed.js' => 'module_feed',\n\t\t\t\t\t'browse.css' => 'module_photo',\n\t\t\t\t\t'edit.css' => 'module_photo'\n\t\t\t\t)\n\t\t\t)\n\t\t\t->assign(array(\n\t\t\t\t'aPhotos' => $aPhotos,\n\t\t\t\t'aForms' => $aAlbum,\n\t\t\t\t'aAlbum' => $aAlbum,\n\t\t\t\t'aCallback' => null,\n\t\t\t\t'bIsInAlbumMode' => true,\n\t\t\t\t'iForceAlbumId' => $aAlbum['album_id']\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this->setParam('global_moderation', array(\n\t\t\t\t'name' => 'photo',\n\t\t\t\t'ajax' => 'photo.moderation',\n\t\t\t\t'menu' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'phrase' => Phpfox::getPhrase('photo.delete'),\n\t\t\t\t\t\t'action' => 'delete'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'phrase' => Phpfox::getPhrase('photo.approve'),\n\t\t\t\t\t\t'action' => 'approve'\n\t\t\t\t\t)\t\t\t\t\t\n\t\t\t\t)\n\t\t\t)\n\t\t);\t\t\n\t\t\n\t\t(($sPlugin = Phpfox_Plugin::get('photo.component_controller_album_process_end')) ? eval($sPlugin) : false);\n\t}", "public function album($id) {\n // tagged with one or more tags.\n\n // Load the specified ID to make sure it exists.\n $album_tags = ORM::factory(\"tags_album_id\")\n ->where(\"id\", \"=\", $id)\n ->find_all();\n\n // If it doesn't exist, redirect to the modules root page.\n if (count($album_tags) == 0) {\n url::redirect(\"tag_albums/\");\n }\n\n // If it does exist, and is set to *, load a list of all tags.\n if ($album_tags[0]->tags == \"*\") {\n $this->index($id, \"\");\n } else {\n // Otherwise, populate this page with the specified items.\n\n // Inherit permissions, title and description from the album that linked to this page.\n $album = ORM::factory(\"item\", $album_tags[0]->album_id);\n access::required(\"view\", $album);\n $page_title = $album->title;\n $page_description = $album->description;\n\n // URL to this page\n $str_page_url = \"tag_albums/album/\" . $id . \"/\" . urlencode($album->name);\n\n // Determine page sort order.\n $sort_page_field = $album->sort_column;\n $sort_page_direction = $album->sort_order;\n\n // Determine search type (AND/OR) and generate an array of the tag ids.\n $tag_ids = Array();\n foreach (explode(\",\", $album_tags[0]->tags) as $tag_name) {\n $tag = ORM::factory(\"tag\")->where(\"name\", \"=\", trim($tag_name))->find();\n if ($tag->loaded()) {\n $tag_ids[] = $tag->id;\n }\n }\n $album_tags_search_type = $album_tags[0]->search_type;\n\n // Figure out how many items to display on each page.\n $page_size = module::get_var(\"gallery\", \"page_size\", 9);\n\n // If this page was reached from a breadcrumb, figure out what page to load from the show id.\n $show = Input::instance()->get(\"show\");\n if ($show) {\n $child = ORM::factory(\"item\", $show);\n $index = $this->_get_position($child->$sort_page_field, $child->id, $tag_ids, \"items.\" . $sort_page_field, $sort_page_direction, $album_tags_search_type, true);\n if ($index) {\n $page = ceil($index / $page_size);\n if ($page == 1) {\n url::redirect($str_page_url);\n } else {\n url::redirect($str_page_url . \"?page=$page\");\n }\n }\n }\n\n // Figure out how many items are in this \"virtual album\"\n $count = $this->_count_records($tag_ids, $album_tags_search_type, true);\n\n // Figure out which page # the visitor is on and\n // don't allow the visitor to go below page 1.\n $page = Input::instance()->get(\"page\", 1);\n if ($page < 1) {\n url::redirect($str_page_url);\n }\n\n // First item to display.\n $offset = ($page - 1) * $page_size;\n\n // Figure out what the highest page number is.\n $max_pages = ceil($count / $page_size);\n\n // Don't let the visitor go past the last page.\n if ($max_pages && $page > $max_pages) {\n url::redirect($str_page_url . \"/?page=$max_pages\");\n }\n\n // Figure out which items to display on this page and store their details in $children.\n $tag_children = $this->_get_records($tag_ids, $page_size, $offset, \"items.\" . $sort_page_field, $sort_page_direction, $album_tags_search_type, true); \n\n // Set up the previous and next page buttons.\n if ($page > 1) {\n $previous_page = $page - 1;\n $view->previous_page_link = url::site($str_page_url . \"/?page={$previous_page}\");\n }\n if ($page < $max_pages) {\n $next_page = $page + 1;\n $view->next_page_link = url::site($str_page_url . \"/?page={$next_page}\");\n }\n\n // Set up breadcrumbs.\n $tag_album_breadcrumbs = array();\n $counter = 0;\n $tag_album_breadcrumbs[] = Breadcrumb::instance($album->title, $album->url())->set_last();\n $parent_item = ORM::factory(\"item\", $album->parent_id);\n while ($parent_item->id != 1) {\n $tag_album_breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url());\n $parent_item = ORM::factory(\"item\", $parent_item->parent_id);\n }\n $tag_album_breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url())->set_first();\n $tag_album_breadcrumbs[1]->url .= \"?show=\" . $album->id;\n\t \n $tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true);\n\n // Set up and display the actual page.\n $template = new Theme_View(\"page.html\", \"collection\", \"Tag Albums\");\n $template->set_global(\n array(\"page\" => $page,\n \"max_pages\" => $max_pages,\n \"page_size\" => $page_size,\n \"children\" => $tag_children,\n \"breadcrumbs\" => $tag_album_breadcrumbs,\n \"children_count\" => $count));\n $template->page_title = $page_title;\n $template->content = new View(\"dynamic.html\");\n $template->content->title = $page_title;\n $template->content->description = $page_description;\n\n $template->set_global(\"all_siblings\", $this->_get_records($tag_ids, $count, 0, \"items.\" . $sort_page_field, $sort_page_direction, $album_tags_search_type, false));\n print $template;\n\n // Set breadcrumbs on the photo pages to point back to the calendar day view.\n item::set_display_context_callback(\"tag_albums_Controller::get_display_context\", 0, $id);\n }\n }", "public function show(Album $album)\n {\n $album->load('photos');\n // dd($album);\n \n // $photos = Album::with('photos')->where('slug',$id)->first();\n \n\n return view('albums.show')->with('album', $album);\n }", "public function show($id) \n {\n $album = Album::findOrFail($id);\n\n if($album->user_id == Auth::id()){\n \n $images = Images::where('album_id', $id)->with('user')->paginate(9);\n \n return view('album.show', compact('album', 'images'));\n }else{\n abort(403, 'Unauthorized action!');\n }\n\n }", "function albums_admin_show_albums() {\n\tglobal $lang;\n\t$albums = albums_get_albums();\n\n\tif ($albums == FALSE)\n\t\techo '<span class=\"kop4\">'.$lang['general']['nothing_yet'].'</span>';\n\n\telse {\n\t\tforeach ($albums as $album) {\n\t\t\t?>\n\t\t\t\t<div class=\"menudiv\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<img src=\"<?php echo MODULE_DIR; ?>/images/albums.png\" alt=\"\" />\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"title-page\"><?php echo $album['title']; ?></span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=editalbum&amp;var1=<?php echo $album['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/edit.png\" title=\"<?php echo $lang['albums']['edit_album']; ?>\" alt=\"<?php echo $lang['albums']['edit_album']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=deletealbum&amp;var1=<?php echo $album['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/delete_from_trash.png\" title=\"<?php echo $lang['albums']['delete_album']; ?>\" alt=\"<?php echo $lang['albums']['delete_album']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t\tunset($albums);\n\t}\n}", "function albums_site_show_images($album) {\n\tglobal $lang;\n\n\tif (!file_exists(ALBUMS_DIR.'/'.$album))\n\t\techo '<p>'.$lang['albums']['doesnt_exist'].'</p>';\n\n\telse {\n\t\t$images = albums_get_images($album);\n\t\tif ($images != FALSE) {\n\t\t\tforeach ($images as $image) {\n\t\t\t\t?>\n\t\t\t\t<div class=\"album\">\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<a href=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/<?php echo $image['filename_image']; ?>\" rel=\"lytebox[album]\" title=\"<?php echo $image['title']; ?>\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/thumb/<?php echo $image['filename_image']; ?>\" alt=\"<?php echo $image['title']; ?>\" title=\"<?php echo $image['title']; ?>\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<span class=\"albuminfo\"><?php echo $image['title']; ?></span>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<i><?php echo $image['info']; ?></i>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t\t}\n\t\t\tunset($image);\n\t\t}\n\t}\n}", "public function log() {\n // data we are going to log\n $variables = func_get_args();\n $trace = debug_backtrace(null, 1);\n Yii::info(VarDumper::dump($this));\n $this->debugInternal($variables, $trace);\n }", "public function onUserProfilePhotoUpload($event)\n {\n\t\tif(Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('album'))\n\t\t\treturn;\n $payload = $event->getPayload();\n if( empty($payload['user']) || !($payload['user'] instanceof Core_Model_Item_Abstract) ) {\n return;\n }\n if( empty($payload['file']) || !($payload['file'] instanceof Storage_Model_File) ) {\n return;\n }\n $viewer = $payload['user'];\n $file = $payload['file'];\n // Get album\n $table = Engine_Api::_()->getDbtable('albums', 'sesalbum');\n $album = $table->getSpecialAlbum($viewer, 'profile');\n $photoTable = Engine_Api::_()->getDbtable('photos', 'sesalbum');\n $photo = $photoTable->createRow();\n $photo->setFromArray(array(\n 'owner_type' => 'user',\n 'owner_id' => Engine_Api::_()->user()->getViewer()->getIdentity()\n ));\n $photo->save();\n $photo->setPhoto($file);\n $photo->album_id = $album->album_id;\n $photo->save();\n if( !$album->photo_id ) {\n $album->photo_id = $photo->getIdentity();\n $album->save();\n }\n $auth = Engine_Api::_()->authorization()->context;\n $auth->setAllowed($photo, 'everyone', 'view', true);\n $auth->setAllowed($photo, 'everyone', 'comment', true);\n $auth->setAllowed($album, 'everyone', 'view', true);\n $auth->setAllowed($album, 'everyone', 'comment', true);\n $event->addResponse($photo);\n }", "function display_album($img_in_album, $title, $width, $height) {\n echo '<img id=\"imgFromAlbum\" src=\"uploads/' . $img_in_album . '\" title=\"' . $title . '\" height=\"' . $height .'\" width=\"' . $width .'\" />';\n\t}", "public function index()\n {\n $albums = Ablum::with('photos')->get();\n return view('albums.index')->with('albums', $albums);\n }", "public function countViews($albumId){\n DB::update('update albums set views = views+1 where album_id = ?', array($albumId));\n }", "public function showMeTheWayAction()\n {\n $em = $this->get('doctrine.orm.entity_manager');\n // first check our log entries\n $repo = $em->getRepository('Gedmo\\Loggable\\Entity\\LogEntry'); // we use default log entry class\n $client = $em->find('AppBundle:Client', 10 /*article id*/);\n dump($client->getFullname()); // prints \"my title\"\n $logs = $repo->getLogEntries($client);\n dump($logs);\n /* $logs contains 2 logEntries */\n // lets revert to first version\n //$repo->revert($client, 1/*version*/);\n // notice article is not persisted yet, you need to persist and flush it\n //$em->persist($client);\n //$em->flush();\n }", "static public function markread($mode, $album_id = false)\n\t{\n\t\tglobal $db, $user, $table_prefix, $phpbb_container;\n\n\t\t$gallery_user = $phpbb_container->get('phpbbgallery.core.user');\n\t\t$gallery_user->set_user_id($user->data['user_id']);\n\n\t\t// Sorry, no guest support!\n\t\tif ($user->data['user_id'] == ANONYMOUS)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($mode == 'all')\n\t\t{\n\t\t\tif ($album_id === false || !sizeof($album_id))\n\t\t\t{\n\t\t\t\t// Mark all albums read (index page)\n\t\t\t\t$sql = 'DELETE FROM ' . $table_prefix . 'gallery_albums_track\n\t\t\t\t\tWHERE user_id = ' . $user->data['user_id'];\n\t\t\t\t$db->sql_query($sql);\n\n\t\t\t\t$gallery_user->update_data(array(\n\t\t\t\t\t\t'user_lastmark'\t\t=> time(),\n\t\t\t\t));\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\telse if ($mode == 'albums')\n\t\t{\n\t\t\t// Mark album read\n\t\t\tif (!is_array($album_id))\n\t\t\t{\n\t\t\t\t$album_id = array($album_id);\n\t\t\t}\n\n\t\t\t$sql = 'SELECT album_id\n\t\t\t\tFROM ' . $table_prefix . \"gallery_albums_track\n\t\t\t\tWHERE user_id = {$user->data['user_id']}\n\t\t\t\t\tAND \" . $db->sql_in_set('album_id', $album_id);\n\t\t\t$result = $db->sql_query($sql);\n\n\t\t\t$sql_update = array();\n\t\t\twhile ($row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\t$sql_update[] = $row['album_id'];\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\n\t\t\tif (sizeof($sql_update))\n\t\t\t{\n\t\t\t\t$sql = 'UPDATE ' . $table_prefix . 'gallery_albums_track\n\t\t\t\t\tSET mark_time = ' . time() . \"\n\t\t\t\t\tWHERE user_id = {$user->data['user_id']}\n\t\t\t\t\t\tAND \" . $db->sql_in_set('album_id', $sql_update);\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\n\t\t\tif ($sql_insert = array_diff($album_id, $sql_update))\n\t\t\t{\n\t\t\t\t$sql_ary = array();\n\t\t\t\tforeach ($sql_insert as $a_id)\n\t\t\t\t{\n\t\t\t\t\t$sql_ary[] = array(\n\t\t\t\t\t\t'user_id'\t=> (int) $user->data['user_id'],\n\t\t\t\t\t\t'album_id'\t=> (int) $a_id,\n\t\t\t\t\t\t'mark_time'\t=> time()\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$db->sql_multi_insert($table_prefix . 'gallery_albums_track', $sql_ary);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\telse if ($mode == 'album')\n\t\t{\n\t\t\tif ($album_id === false)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$sql = 'UPDATE ' . $table_prefix . 'gallery_albums_track\n\t\t\t\tSET mark_time = ' . time() . \"\n\t\t\t\tWHERE user_id = {$user->data['user_id']}\n\t\t\t\t\tAND album_id = $album_id\";\n\t\t\t$db->sql_query($sql);\n\n\t\t\tif (!$db->sql_affectedrows())\n\t\t\t{\n\t\t\t\t$db->sql_return_on_error(true);\n\n\t\t\t\t$sql_ary = array(\n\t\t\t\t\t'user_id'\t\t=> (int) $user->data['user_id'],\n\t\t\t\t\t'album_id'\t\t=> (int) $album_id,\n\t\t\t\t\t'mark_time'\t\t=> time(),\n\t\t\t\t);\n\n\t\t\t\t$db->sql_query('INSERT INTO ' . $table_prefix . 'gallery_albums_track ' . $db->sql_build_array('INSERT', $sql_ary));\n\n\t\t\t\t$db->sql_return_on_error(false);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t}", "public function log() {\n $_SESSION['dblog_overview_filter'] = array(\n 'type' => array(\n 'bc_subsites' => 'bc_subsites',\n ),\n 'severity' => array(),\n );\n return RedirectResponse::create(Url::fromRoute('dblog.overview', [\n 'type[]' => 'bc_subsites',\n ])->toString());\n }", "function print_gallery(){\n $gallery = new GalleryView();\n $gallery->print_gallery();\n }", "public function show($id)\n {\n $album = Ablum::with('photos')->find($id);\n return view('albums.show')->with('album', $album);\n }", "function log()\n\t{\n\t\tcall_user_func_array(array($this->server, 'log'), func_get_args());\n\t}", "public function log()\r\n {\r\n echo $this->message.PHP_EOL;\r\n }", "function showAllAlbum() {\n $sql = \"SELECT * FROM `itf_album`\";\n return $this->dbcon->FetchAllResults($sql);\n }", "private function isAlbumCoverVisible($album)\n {\n if(isset($album['cover']) && !empty($album['cover']))\n {\n // get photo permission via API call\n $photoResp = $this->api->invoke(\"/photo/{$album['cover']['id']}/view.json\", EpiRoute::httpGet);\n if($photoResp['code'] === 200)\n return true;\n }\n return false;\n }", "public function log($treebank_id)\n {\n $treebank = $this->get_or_404($treebank_id);\n $this->check_is_owner($treebank->user_id);\n\n $importrun = $this->importrun_model->get_last_importrun_by_treebank($treebank_id);\n\n $data['page_title'] = sprintf(lang('treebank_log'), $treebank->title);\n $data['importlogs'] = !$importrun ? array() : $this->importlog_model->get_importlogs_by_importrun($importrun->id);\n\n $this->load->view('header', $data);\n $this->load->view('treebank_log', $data);\n $this->load->view('footer');\n }", "public function show() {\n Logger::debug(\"url:{$this->header}, replace: {$this->replace}, responseCode: {$this->responseCode}\");\n }", "public function getAlbumsAction()\n {\n $em = $this->getDoctrine()->getManager();\n $albums = $em->getRepository(Album::class)->findAll();\n\n return $this->handleView($this->view($albums));\n }", "function publishLog() {\n\t\t$id = $this->current_log;\t\t\n\t\t$res = $this->query(\"SELECT event_id FROM $this->table_log WHERE id=$id\");\n\t\t$row = $res->fetch_assoc();\n\t\t$cal_id = explode(\",\",$row['event_id']);\n\t\t$calEvent = $this->calendar_instance->getEventDetails($row['event_id']);\n\t\t$topic = $calEvent['caption'];\n\t\t$year = $calEvent['year'];\n\t\t$slug = $calEvent['slug'];\n\t\t$url = $this->generateCoolURL(\"/$year/$slug\");\n\t\t$this->addToActivityLog(\"publiserte logg fra <a href=\\\"$url\\\">$topic</a>.\",false,\"major\");\n\t}", "public function authDoView(){\n if(!$this->authUser()){\n echo '{\"status\":-1,\"result\":\"/user/login?prePage='.$_SERVER['HTTP_REFERER'].'\"}';\n exit();\n }\n }", "function onView () {\n\n switch (parent::getAction()) {\n case \"edit\":\n if (Context::hasRole(\"user.image.edit\")) {\n $this->printEditView();\n }\n break;\n case \"crop\":\n if (Context::hasRole(\"user.image.view\")) {\n $this->printCropImageView();\n }\n break;\n case \"upload\":\n if (Context::hasRole(\"user.image.view\")) {\n $this->printUploadImage();\n }\n break;\n default:\n if (Context::hasRole(\"user.image.view\")) {\n $this->printSelectImageView();\n }\n break;\n }\n }", "public function logPackage() {\n\t\t\t$this->package->logPackage();\n\t\t}", "public function flatListAction($mediaAlbum = 0)\n {\n $showBackLink = true;\n if ($mediaAlbum) {\n // if an album is given, display it\n $mediaAlbum = $this->mediaAlbumRepository->findByUid($mediaAlbum);\n if (!$mediaAlbum) {\n $this->pageNotFound(LocalizationUtility::translate('no_album_found', $this->extensionName));\n }\n $this->view->assign('displayMode', 'album');\n $this->view->assign('mediaAlbum', $mediaAlbum);\n } else {\n // display the album list\n $mediaAlbums = $this->mediaAlbumRepository->findAll($this->settings['list']['hideEmptyAlbums'],\n $this->settings['list']['orderBy'], $this->settings['list']['orderDirection']);\n $this->view->assign('displayMode', 'flatList');\n $this->view->assign('mediaAlbums', $mediaAlbums);\n $showBackLink = false;\n }\n $this->view->assign('showBackLink', $showBackLink);\n }", "function view_logs()\n{\n\t$jinput = JFactory::getApplication()->input;\n\t$jinput->set('view', 'logs');\n\t$jinput->set('hidemainmenu', 1);\n\n\tparent::display(); \n}", "public function show(CallLog $callLog)\n {\n //\n }", "public function run () {\n $session = Session::getInstance ();\n $user = $session->getUser ();\n\n if (!$user || !$user->isAdmin ()) {\n $session->setMessage (\"Do not have permission to access\", Session::MESSAGE_ERROR);\n header (\"Location: \" . BASE_URL);\n return;\n }\n\n $albumDAO = AlbumDAO::getInstance ();\n $album = null;\n $form_errors = array ();\n $form_values = array (\"id\" => \"\", \"title\" => \"\");\n\n if (!empty ($_POST)) {\n $form_values[\"id\"] = (isset ($_POST[\"id\"]) && is_numeric ($_POST[\"id\"])) ? intval ($_POST[\"id\"]) : \"\";\n $form_values[\"title\"] = isset ($_POST[\"title\"]) ? trim ($_POST[\"title\"]) : \"\";\n\n if (empty ($form_values[\"id\"])) {\n $form_errors[\"id\"] = \"No id specified\";\n }\n if (empty ($form_values[\"title\"])) {\n $form_errors[\"title\"] = \"No title specified\";\n }\n\n if (empty ($form_errors)) {\n $album = $albumDAO->load ($form_values[\"id\"]);\n if ($album) {\n $album->setTitle ($form_values[\"title\"]);\n\n if ($albumDAO->save ($album)) {\n $session->setMessage (\"Album saved\");\n header (\"Location: edit_album.php?id={$album->id}\");\n return;\n }\n else {\n $session->setMessage (\"Album not saved\");\n }\n }\n }\n else if (empty ($form_errors[\"id\"])) {\n $album = $albumDAO->load ($form_values[\"id\"]);\n }\n }\n else if (!empty ($_GET)) {\n $form_values[\"id\"] = isset ($_GET[\"id\"]) ? $_GET[\"id\"] : \"\";\n\n if (empty ($form_values[\"id\"])) {\n header (\"Location: \" . BASE_URL);\n return;\n }\n else {\n $album = $albumDAO->load ($form_values[\"id\"]);\n // Album does not exist. Pass null to template\n if (!$album) {\n }\n // Only admin can access. Fill form data\n else {\n $form_values[\"id\"] = $album->getId ();\n $form_values[\"title\"] = $album->getTitle ();\n }\n }\n }\n\n \n $this->template->render (array (\n \"title\" => \"Edit Album\",\n \"session\" => $session,\n \"main_page\" => \"edit_album_tpl.php\",\n \"album\" => $album,\n \"form_values\" => $form_values,\n \"form_errors\" => $form_errors,\n ));\n }", "function viewAction() {\r\n\r\n $photo_id = $this->_getParam('photo_id', false);\r\n if (!$photo_id)\r\n return $this->_forward('requireauth', 'error', 'core');\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $this->view->photo = $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $this->view->chanel = $chanel = $photo->getChanel();\r\n Engine_Api::_()->core()->setSubject($photo);\r\n if (!$viewer || !$viewer->getIdentity() || !$chanel->isOwner($viewer)) {\r\n $photo->view_count = new Zend_Db_Expr('view_count + 1');\r\n $photo->save();\r\n }\r\n if (!$this->_helper->requireAuth()->setAuthParams('sesvideo_chanelphoto', null, 'view')->isValid())\r\n return;\r\n $checkchanel = Engine_Api::_()->getItem('sesvideo_chanel', $this->_getParam('chanel_id'));\r\n if (!($checkchanel instanceof Core_Model_Item_Abstract) || !$checkchanel->getIdentity() || $checkchanel->chanel_id != $photo->chanel_id) {\r\n $this->_forward('requiresubject', 'error', 'core');\r\n return;\r\n }\r\n // Render\r\n $this->_helper->content->setEnabled();\r\n }", "function logevent($action) {\n require 'mgstats.php';\n //Pull the username or enter \"Not Logged In\"\n if($_SESSION['username']) { $remoteUN = $_SESSION['username']; } else { $remoteUN = \"Not Logged In\"; } \n $logTime = date('Y-m-d H:i:s'); //Establish Log time.\n $sid = session_id(); //Session ID\n $entry = $logTime.\"|\".$action.\"|\".$_SERVER['REMOTE_ADDR'].\"|\".$_SERVER['HTTP_USER_AGENT'].\"|\".$remoteUN.\"|\".$sid.\"\\n\"; //Create the variable for log entry\n $filename = \"logs/\".date('Y-m-d').\".log\"; //Build filename, changes by day.\n file_put_contents($filename,$entry, FILE_APPEND); //Appends the entry to the log file.\n return;\n}", "public function index(){\n\n\t\t$data['base'] = base_url();\n\t\t$data ['error'] = 'No se pudo realizar su petision';\n\t \t// Obtenerel segmento de la url\n\t\t$this->load->view('header', array ('pagina' => 'Albums'));\n\n\n\t \t\t// obtener todos los albums\n\t\t$data['Albums'] = $this->album_model->imgAlbum();\n\n\t\t$this->load->view('Album/index', $data);\n\t\t$this->load->view('footer.php');\n\t}", "public function show( Track $track )\n {\n //\n }", "function generateAlbumView($userId,$showEditImages,$rel,$albumName){\n\t$images_profile\t=$GLOBALS['cn']->query('\n\t\tSELECT i.id,i.image_path\n\t\tFROM images i\n\t\tJOIN album a ON a.id_user=i.id_user\n\t\tWHERE\n\t\t\ti.id_user='.$userId.' AND\n\t\t\ti.id_images_type=2 AND\n\t\t\ta.name=\"'.$albumName.'\" AND\n\t\t\ta.id_image_cover!=i.id\n\t\tORDER BY i.id DESC\n\t');\n\techo '<div style=\"display:none;\">';\n\twhile($image=mysql_fetch_assoc($images_profile)){\n\t\t$img_full_src=FILESERVER.'img/users/'.$image['image_path'];\n\t\t$showEditImages=($showEditImages?'&showMenu':'');\n\t\techo\n\t\t\t'<a id=\"'.md5($img_full_src).'\" class=\"grouped_PP\" rel=\"'.$rel.'\"'.\n\t\t\t\t'href=\"views/photos/picture.view.php?src='.$img_full_src.'&id_photo='.md5($image['id']).'&id_user='.$userId.$showEditImages.'\">'.\n\t\t\t\t'<img src=\"'.$img_full_src.'\" alt=\"\"/>'.\n\t\t\t'</a>';\n\t}\n\techo '</div>';\n}", "protected function doRedirectOnSingleAlbum()\n {\n\n if (TL_MODE == 'BE')\n {\n return false;\n }\n //if all albums are published\n $objAlb = $this->Database->prepare('SELECT count(id) AS countPublishedAlbums FROM tl_gallery_creator_albums WHERE published=?')\n ->execute('1');\n if ($this->gc_publish_all_albums && $objAlb->countPublishedAlbums == 1)\n {\n $singleAlbum = true;\n }\n if ($this->gc_publish_all_albums && $objAlb->countPublishedAlbums > 1)\n {\n return false;\n }\n //wahr, wenn im gc-Inhaltselement nur 1 Album selektiert wurde\n $arrAlbId = deserialize($this->gc_publish_albums);\n if (count($arrAlbId) == 1)\n {\n $singleAlbum = true;\n }\n\n //wahr wenn: weniger als zwei gc Inhaltselemente auf aktueller Seite && Galerie enthaelt nur 1 Album && Weiterleitung in den Elementeinstellungen aktiviert ist\n if ($this->countGcContentElementsOnPage() == 1 && $singleAlbum && $this->gc_redirectSingleAlb)\n {\n return true;\n }\n\n return false;\n }", "public final function withLog ()\n {\n\n $this->withLog = true;\n\n }", "function onView () {\n\n switch (parent::getAction()) {\n \n case \"edit\":\n $this->printEditView();\n break;\n default:\n $userId = $this->getModeUserId();\n $user = UsersModel::getUser($userId);\n if (RolesModel::hasModuleRole($userId,\"user.files.owner\")) {\n if (empty($user->directoryid)) {\n $user->directoryid = UsersModel::setupUserDirectory($userId);\n }\n parent::onView($user->directoryid);\n }\n }\n }", "public function show(UserLog $userLog)\n {\n //\n }", "public function __construct() {\n\t\t$view_event = ( isset( \\REALTY_BLOC_LOG::$option['view_event'] ) ? \\REALTY_BLOC_LOG::$option['view_event'] : array() );\n\n\t\t// Property Page view log\n\t\tif ( isset( $view_event['property'] ) and $view_event['property'] == \"on\" ) {\n\t\t\tadd_action( 'rb_page_view_property_log', array( $this, 'save_property' ), 10, 5 );\n\t\t}\n\n\t\t// building Page View log\n\t\tif ( isset( $view_event['building'] ) and $view_event['building'] == \"on\" ) {\n\t\t\tadd_action( 'rb_page_view_building_log', array( $this, 'save_building' ), 10, 5 );\n\t\t}\n\t}", "public function show($id)\n {\n $photos = PhotoManager::getPhotos($id, 24);\n\n if ($photos) return view('photos.album', ['photos' => $photos]);\n\n abort(404, 'Album not found.');\n }", "public function index()\n {\n // $albums = Album::get();\n // $albums = Album::where('created_by_id',auth()->id())->get();\n // $albums = auth()->user()->load('albums');\n // dd($albums);\n\n $albums = auth()->user()->albums()->withCount('photos')->get();\n // dd($albums);\n return view('albums.create')->with('albums', $albums);\n }", "function generateAlbumView($userId,$showEditImages,$rel,$albumName){\n\t$images_profile\t=$GLOBALS['cn']->query('\n\t\tSELECT i.id,i.image_path\n\t\tFROM images i\n\t\tJOIN album a ON a.id_user=i.id_user\n\t\tWHERE\n\t\t\ti.id_user='.$userId.' AND\n\t\t\ti.id_images_type=2 AND\n\t\t\ta.name=\"'.$albumName.'\" AND\n\t\t\ta.id_image_cover!=i.id\n\t\tORDER BY i.id DESC\n\t');\n\techo '<div style=\"display:none;\">';\n\twhile($image=mysql_fetch_assoc($images_profile)){\n\t\t$img_full_src=FILESERVER.'img/users/'.$image['image_path'];\n\t\t$showEditImages=($showEditImages?'&showMenu':'');\n\t\techo\n\t\t\t'<a id=\"'.md5($img_full_src).'\" class=\"grouped_PP\" rel=\"'.$rel.'\"'.\n\t\t\t\t'href=\"'.$GLOBALS['config']->main_server.'views/photos/picture.view.php?src='.$img_full_src.'&id_photo='.md5($image['id']).'&id_user='.$userId.$showEditImages.'\">'.\n\t\t\t\t'<img src=\"'.$img_full_src.'\" alt=\"\"/>'.\n\t\t\t'</a>';\n\t}\n\techo '</div>';\n}", "public function getLog();", "public function logView($id)\n {\n if ($GLOBALS['browser']->isRobot()) {\n exit;\n }\n\n /* We already read this story? */\n if (isset($_COOKIE['news_viewed_news']) &&\n strpos($_COOKIE['news_viewed_news'], ':' . $id . '|') !== false) {\n return false;\n }\n\n /* Rembember when we see a story */\n if (!isset($_COOKIE['news_viewed_news'])) {\n $_COOKIE['news_viewed_news'] = ':';\n }\n $_COOKIE['news_viewed_news'] .= $id . '|' . $_SERVER['REQUEST_TIME'] . ':';\n\n setcookie('news_viewed_news', $_COOKIE['news_viewed_news'], $_SERVER['REQUEST_TIME'] + 22896000, $GLOBALS['conf']['cookie']['path'],\n $GLOBALS['conf']['cookie']['domain'], $GLOBALS['conf']['use_ssl'] == 1 ? 1 : 0);\n\n /* Update the count */\n $sql = 'UPDATE ' . $this->prefix . ' SET view_count = view_count + 1 WHERE id = ?';\n $result = $this->write_db->query($sql, array($id));\n if ($result instanceof PEAR_Error) {\n return $result;\n }\n\n /* Log it */\n $sql = 'INSERT INTO ' . $this->prefix . '_user_reads (id,user,ip,useragent,readdate) VALUES (?, ?, ? , ?, NOW())';\n $result = $this->write_db->query($sql, array($id, Horde_Auth::getAuth(), $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']));\n if ($result instanceof PEAR_Error) {\n return $result;\n }\n\n return true;\n }", "public function index()\n {\n try{\n\n $albums = Input::get('q') ? Album::with('artist', 'categories', 'language')->where('title', 'like', '%'.Input::get('q').'%')->orderBy('created_at', 'desc')->paginate(20) : Album::with('artist', 'categories', 'language')->orderBy('created_at', 'desc')->paginate(20);\n\n //print_r($albums);\n //dd(DB::getQueryLog());\n //die;\n return View::make('admin.album.index', array('albums' => $albums));\n }catch (Exception $ex){\n echo $ex->getMessage();\n }\n /*$files = PATH::asset('assets/mp3/01 - Aanewala Pal-(MyMp3Singer.net).mp3');\n\n echo $files;\n $getID3 = new \\getID3;\n $info = $getID3->analyze($files);\n print_r($info);\n die;*/\n\n\n\n\n //return View::make('admin.album.index', array('albums' => $albums));\n }", "public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }", "public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }", "public function index()\n {\n $albums = PhotoManager::getAlbums(24);\n\n return view('photos.list', ['albums' => $albums]);\n }", "public function showChangelog()\n {\n $news_view = ee('Model')->get('MemberNewsView')\n ->filter('member_id', ee()->session->userdata('member_id'))\n ->first();\n\n if (! $news_view) {\n $news_view = ee('Model')->make(\n 'MemberNewsView',\n ['member_id' => ee()->session->userdata('member_id')]\n );\n }\n\n $news_view->version = APP_VER;\n $news_view->save();\n\n ee()->functions->redirect(\n ee()->cp->makeChangelogLinkForVersion(APP_VER)\n );\n }", "function doFacebook() {\n\n session_start();\n $facebook = new FacebookPhotos($GLOBALS['FB_API_KEY'],\n $GLOBALS['FB_SECRET']);\n\n if ($_REQUEST['fb'] == 'auth') {\n $album = $_SESSION['album'];\n if (!file_exists(\"a_$album\")) {\n print \"Please navigate here from the main album page\";\n exit(0);\n }\n $desc = getAlbumDescription($album);\n $fb_sig_user = $_REQUEST['fb_sig_user'];\n\n # First create the album\n $create_album_response = $facebook->api_client->photos_createAlbum(\n $desc, '', '', '', $fb_sig_user);\n $album_link = $create_album_response['link'];\n $aid = $create_album_response['aid'];\n\n print \"Created album <a href='$album_link'>$desc</a><br/>\\n\";\n flush();\n\n $photos = getPhotoList($album);\n $num_photos = count($photos);\n print \"Found $num_photos photos<br/>\\n\";\n flush();\n\n foreach ($photos as $photo) {\n try {\n $file = \"a_$album/m/m_$photo\";\n $photo_desc = getPhotoDescription($album, $photo);\n \n if (file_exists($file)) {\n\t $upload_response = $facebook->api_client->photos_upload(\n $file, $aid, $photo_desc, $fb_sig_user);\n $photo_link = $upload_response['link'];\n print \"Uploaded photo <a href='$photo_link'>$photo</a><br/>\\n\";\n flush();\n } else {\n\t print \"Skipping nonexistant file $file<br/>\\n\";\n\t flush();\n }\n } catch (Exception $e) {\n print \"Caught exception uploading $photo<br/>\\n\";\n\tflush();\n }\n } \n print \"Done<br/>\";\n } else {\n $_SESSION['album'] = $_REQUEST['fb'];\n $facebook->require_frame();\n }\n}", "public function log($obj);", "public function show(AccessLog $accessLog)\n {\n return $accessLog->load(['snapshots']);\n }", "function ciniki_gallery_albumHistory($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'album_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Album'), \n 'field'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Field'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n ciniki_core_loadMethod($ciniki, 'ciniki', 'gallery', 'private', 'checkAccess');\n $rc = ciniki_gallery_checkAccess($ciniki, $args['tnid'], 'ciniki.gallery.albumHistory');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbGetModuleHistory');\n return ciniki_core_dbGetModuleHistory($ciniki, 'ciniki.gallery', 'ciniki_gallery_history', $args['tnid'], 'ciniki_gallery_albums', $args['album_id'], $args['field']);\n}", "public function show(RunningLog $runningLog)\n {\n //\n }", "public function show($id)\n {\n $user = JWTAuth::parseToken()->authenticate();\n $album = $this->albumRepository->find($id);\n\n if (Gate::forUser($user)->allows('albums-show', $album)) {\n\n $records = $this->albumRepository->findSongs($album);\n\n return response()->json([\n 'success' => true,\n 'album' => $this->prepareAlbumData($album, $records)\n ]);\n }else{\n return response()->json([\n 'success' => false,\n 'errors' => [\"Access denied, you don't have access to this album\"]\n ],403);\n }\n }", "private static function logging()\n {\n $files = ['Handler', 'Exception', 'Log'];\n $folder = static::$root.'Logging'.'/';\n\n self::call($files, $folder);\n }" ]
[ "0.6210364", "0.58306056", "0.5727966", "0.54060036", "0.5374187", "0.5339339", "0.5310528", "0.52682835", "0.5262001", "0.522922", "0.52074826", "0.5088836", "0.50838107", "0.5071526", "0.5027372", "0.50220454", "0.50057524", "0.49953705", "0.49837622", "0.49573395", "0.49298242", "0.4928525", "0.49164325", "0.490249", "0.4899543", "0.48949", "0.48837027", "0.4882459", "0.48709542", "0.48664638", "0.48614407", "0.48537043", "0.48285532", "0.4828045", "0.48160747", "0.4814287", "0.4813092", "0.4813092", "0.4813092", "0.47994423", "0.47989926", "0.47822368", "0.47784176", "0.4776758", "0.47667244", "0.47633284", "0.4735694", "0.4735079", "0.47323555", "0.4727478", "0.47192815", "0.47169462", "0.47108912", "0.47087058", "0.4700258", "0.46945268", "0.4689659", "0.46888268", "0.46878287", "0.46819988", "0.4676072", "0.46742475", "0.46739292", "0.4669557", "0.46690592", "0.46570322", "0.46519265", "0.46505868", "0.4645182", "0.46404532", "0.46342418", "0.46325743", "0.46310243", "0.46294144", "0.46289313", "0.46263075", "0.46176672", "0.46158805", "0.4613719", "0.4607548", "0.4606274", "0.46061978", "0.459972", "0.4597326", "0.45960343", "0.45921454", "0.45908025", "0.45881197", "0.45871413", "0.45847", "0.45847", "0.45834565", "0.45807296", "0.45769393", "0.4573266", "0.45692492", "0.45673573", "0.4557556", "0.45564002", "0.45559457" ]
0.6657525
0
Updates album views in bulk.
public function updateAlbumViews() { $db = $this->_getDb(); $updates = $db->fetchPairs(' SELECT album_id, COUNT(*) FROM xengallery_album_view GROUP BY album_id '); XenForo_Db::beginTransaction($db); $db->query('TRUNCATE TABLE xengallery_album_view'); foreach ($updates AS $albumId => $views) { $db->query(' UPDATE xengallery_album SET album_view_count = album_view_count + ? WHERE album_id = ? ', array($views, $albumId)); } XenForo_Db::commit($db); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _updateViews($data)\n { \n $rs = false;\n if (isset($data['id']) && isset($data['id_youtube_metadata'])) {\n $id = $data['id'];\n $metadata = json_decode($data['id_youtube_metadata']);\n //SQL \n $this->db->where('id', $id);\n $rs = $this->db->update($this->tb_video, array('id_youtube_view' => $metadata->viewCount));\n }\n\n return $rs;\n }", "public function updateViews()\r\n {\r\n if ($this->isViewTimelimit()) {\r\n return -1;\r\n }\r\n\r\n $this->views_seen++;\r\n $this->last_viewed_at = JFactory::getDate()->toSql();\r\n\r\n if ($this->views_bought > 0 && $this->views_seen == $this->views_bought) {\r\n $this->active = 0;\r\n }\r\n\r\n return $this->store();\r\n }", "public function countViews($albumId){\n DB::update('update albums set views = views+1 where album_id = ?', array($albumId));\n }", "public function bulkUpdate(Request $request)\n {\n $data = $request->get('data');\n foreach ($data as $key => $item) {\n Guest::where('id', $key)->update($item);\n }\n return $this->index(request());\n }", "public function massUpdate()\n {\n $contentIds = explode(',', request()->input('indexes'));\n \n $updateOption = request()->input('update-options');\n\n foreach ($contentIds as $contentId) {\n $content = $this->contentRepository->find($contentId);\n\n $content->update(['status' => $updateOption]);\n }\n\n session()->flash('success', trans('velocity::app.admin.contents.mass-update-success'));\n\n return redirect()->back();\n }", "public function modifyUnderLay(){\n// DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n// DB::statement('SET PRIMARY_KEY_CHECKS = 0');\n DB::table('underlays')->orderBy('id','desc')->chunkById(300,function($queries){\n\n foreach ($queries as $key=>$query){\n DB::table('underlays')->where('id',$query->id)->update(['id'=>$key+1]);\n }\n });\n\n dd('done!');\n }", "protected function updateViews($model)\n {\n $cookieName = 'page-view-views';\n $shouldCount = false;\n $views = Yii::$app->request->cookies->getValue($cookieName);\n\n if ($views !== null) {\n if (is_array($views)) {\n if (!in_array($model->id, $views)) {\n $views[] = $model->id;\n $shouldCount = true;\n }\n } else {\n $views = [$model->id];\n $shouldCount = true;\n }\n } else {\n $views = [$model->id];\n $shouldCount = true;\n }\n\n if ($shouldCount === true) {\n if ($model->updateViews()) {\n Yii::$app->response->cookies->add(new Cookie([\n 'name' => $cookieName,\n 'value' => $views,\n 'expire' => time() + 86400 * 365\n ]));\n }\n }\n }", "public function increaseViews($album, $amount) {\n $album->viewed += $amount;\n $album->save();\n\n return $album;\n }", "function updatetags($tags,$ids,$user)\n{\n $i = 0;\n foreach ($ids as $id)\n {\n $data = '{ \"doc\" : { \"tag\" : '.json_encode($tags[$i]).' } }';\n $req = curl_init();\n\n curl_setopt_array($req, [\n CURLOPT_URL => \"http://localhost:9200/\".$user.\"/email/\".$id.\"/_update?refresh=true&pretty\",\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => $data,\n CURLOPT_HTTPHEADER => [ \"Content-Type: application/json\" ],\n CURLOPT_RETURNTRANSFER => true,\n ]);\n \n $response = json_decode(curl_exec($req));\n \n curl_close($req);\n \n $i++;\n }\n\n}", "public function setShowTags(SetAlbumTagsRequest $request): void\n\t{\n\t\t$request->album()->show_tags = $request->tags();\n\t\t$request->album()->save();\n\t}", "public function update(Request $request, $configName, $albumId)\n {\n $idArray = explode(\",\", $_POST['ids']);\n \n $config = config($configName);\n \n foreach ($idArray as $order => $id) {\n DB::table($config['db_table'])\n ->where('id', intval($id))\n ->update([$config['order'] => $order]);\n }\n }", "public function UpdateAllHistoriqueToViewed() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n if (isset($_REQUEST['data'])) {\n $idSociete = $_REQUEST['data'][\"idSociete\"];\n // Input validations\n if (!empty($idSociete)) {\n try {\n $sql = $this->db->prepare(\"UPDATE historique SET vue = 1 WHERE idSociete = :idSociete\");\n $sql->bindParam('idSociete', $idSociete, PDO::PARAM_INT);\n $sql->execute();\n\n if ($sql) {\n $success = array('status' => \"Success\", \"msg\" => \"Successfully updated\");\n $this->response($this->json($success), 200);\n }\n \n } catch (Exception $ex) {\n $this->response('', $ex->getMessage());\n }\n }\n }\n }", "public function actionBatchUpdate() {\n// assuming each item is of model class 'Item'\n $items = $this->getItemsToUpdate();\n if (Model::loadMultiple($items, Yii::$app->request->post()) &&\n Model::validateMultiple($items)) {\n $count = 0;\n foreach ($items as $item) {\n// populate and save records for each model\n if ($item->save()) {\n// do something here after saving\n $count++;\n }\n }\n Yii::$app->session->setFlash('success', \"Processed {$count} records successfully.\");\n return $this->redirect(['index']); // redirect to your next desired page\n } else {\n return $this->render('update', [\n 'items' => $items,\n ]);\n }\n }", "public function setTrack(SetAlbumTrackRequest $request): void\n\t{\n\t\t$request->album()->setTrack($request->file);\n\t}", "public function incrementViews(){\r\n $query=$this->con->prepare(\"UPDATE videos SET views = views+1 WHERE id = :id\");\r\n $query->bindParam(\":id\",$videoId);\r\n $videoId = $this->getId();\r\n $query->execute();\r\n //povecavanje broja u samoj sql koloni\r\n $this->sqlData['views'] = $this->sqlData['views'] +1;\r\n\r\n }", "public function updateView(): void\n {\n if (!$this->special) {\n $this->_builder->submitUpdate();\n }\n $this->_data = $this->_entity->fetch($_GET['id'])[0];\n\n require VF . \"{$this->route}/update.php\";\n }", "public function updateAll($section_rating_view)\n\t{\n\t\treturn false;\n\t}", "public function update(Request $request)\n { \n $validator = $this->getUpdateValidator($request);\n $validator->validate();\n\n $album = Album::find($request->album);\n $album->name = $request->name;\n $album->year = $request->year;\n\n if($request->has('cover')){\n $album->image = $this->fileToBase64($request->file('cover')); \n }\n\n if($this->checkDiffArtist($album, $request->artists)){\n return Redirect::back()->with('artistsError', 'You have some songs that dont match these artists');\n }\n else{\n $album->artists()->detach();\n $album->artists()->attach($request->artists);\n $album->save();\n return Redirect::back()->with('successUpdateAlbum', 'Album Updated!');\n }\n }", "public function update(Request $request, Album $album)\n {\n // METODO 1\n // $res = Album::where('id',$album->id)\n // ->update(\n // [\n // 'album_name' => request()->input('albumname'),\n // 'album_description' => request()->input('albumdescription')\n // ]\n // );\n\n // METODO 2\n $album = Album::find($album->id);\n $album->album_name = request()->input('albumname');\n $album->album_description = request()->input('albumdescription');\n\n if($request->hasFile('album_thumb')){\n $file = $request->file('album_thumb');\n $filename = $album->id.'.'.$file->extension();\n $filename = $file->storeAs(env('ALBUM_THUMB_DIR'), $filename);\n $album->album_thumb = $filename;\n }\n $res = $album->save();\n\n\n $mess = $res ? 'Album '.$album->id.' updated' : 'Error updating album';\n\n session()->flash('message',$mess);\n return redirect()->route('albums.index');\n }", "public function update($models): void\n {\n if ($models->isEmpty()) {\n return;\n }\n\n $index = $models->first()->searchableAs();\n\n if ($this->usesSoftDelete($models->first()) && $this->softDelete) {\n $models->each->pushSoftDeleteMetadata();\n }\n\n $objects = $models->map(function ($model) {\n if (empty($searchableData = $model->toSearchableArray())) {\n return;\n }\n\n return array_merge(\n $searchableData,\n $model->scoutMetadata(),\n ['objectID' => $model->getScoutKey()],\n );\n })->filter()->values();\n\n if (! empty($objects)) {\n $this->openSearch->bulkUpdate($index, $objects);\n }\n }", "public function doMultiAction( array $a = array() ){\r\n\t\t$limit = count($a['contentIds']);\r\n\t\t$this->sSql = \"UPDATE `pack_mstr` SET `status`='\".(int)$a['contentActionValue'].\"' WHERE status!='-1' AND pack_id IN(\".implode(',', $a['contentIds']).\") LIMIT $limit\";\r\n\t\t$res = $this->oMysqli->query( $this->sSql );\r\n\t}", "public function updateView()\n {\n \n }", "public function jsonUpdateSort()\n {\n $this->request->allowMethod(['post']);\n $data = $this->request->data;\n $itemCounter = 1;\n foreach($data['view'] as $key => $value){\n $slide = $this->Slides->get($value);\n $slide->sorting = $itemCounter; \n $this->Slides->save($slide);\n $itemCounter++; \n } \n exit; \n }", "public function increaseViews(Request $request, $id) {\n $this->requirePermission('album.increase-views');\n\n $this->validate($request, [\n 'amount' => 'numeric|min:1'\n ]);\n\n $album = $this->controller->getAlbum($id);\n\n $album = $this->controller->increaseViews($album, $request->input('amount', 1));\n\n return $this->response($album);\n }", "public function update(Request $request, Album $album)\n {\n //\n }", "public function updateMultiple_data()\n {\n \n }", "public function updatePictureViews($p_pet_id, $p_pic_id) {\n $stmt = $this->adapter->conn->prepare(\n \"UPDATE PICTURES SET views = views + 1 \". \n \"WHERE pic_id=? and pet_id=?\");\n $stmt->bindParam(1,$p_pic_id);\n $stmt->bindParam(2,$p_pet_id);\n\n $result=null;\n try{\n $result = $this->adapter->executeUpdatePrepared($stmt);\n }catch(PDOException $e){\n return false;\n }\n if($result > 0) {\n return true;\n }\n\n return false;\n }", "private function updatePoints($query)\n {\n $post = $query->first();\n $post->increment('view');\n $this->updatePoint($post, PointEnum::POINT_VIEW);\n $this->updatePoint($post->user, PointEnum::POINT_VIEW);\n $hashTags = $post->hashTags;\n foreach ($hashTags as $hashTag) {\n $this->updatePoint($hashTag, PointEnum::POINT_VIEW);\n }\n }", "public function update(Request $request, $id)\n {\n $user = JWTAuth::parseToken()->authenticate();\n $record = $this->albumRepository->find($id);\n $createActivity = false;\n\n if (Gate::forUser($user)->allows('albums-update', $record)) {\n\n //validate\n $validator = Validator::make($request->all(), $this->validations);\n\n if ($validator->fails()) {\n return response()->json([\n 'success'=> false,\n 'errors' => $validator->errors()->all()\n ],400);\n }\n\n // Anything else other than 1 should be false\n if ($request->published != 'true') {\n $record->published = false;\n }\n\n //updata data\n if (!$record->published && $request->published == 'true') {\n $record->published = true;\n $record->created_at = date('Y-m-d H:i:s');\n $createActivity = true;\n }\n\n $record->fill($request->all());\n\n $record->save();\n $songs = $this->albumRepository->findSongs($record);\n\n $album = $this->prepareAlbumData($record, $songs);\n\n if($request->hasFile('image')){\n //delete old file if already exist\n //we only need one at the time\n if($record->image){\n try {\n $record->image->delete();\n } catch(\\Exception $error) {}\n }\n\n $image = $request->file('image');\n\n // Make sure to upload the image to the author's folder\n $author = $user;\n if ($record->user_id != $author->id) {\n $author = $record->author;\n }\n\n $img = $this->createImage($author, $record, $image);\n\n $album['image'] = $this->getFileURL((Object)[\n 'file_id' => $img->id,\n 'name' => $img->name,\n 'path' => $img->path,\n 'public' => true,\n ]);\n }\n\n if($createActivity){\n $activity = new Activity();\n $activity->fill([\n 'action' => 'published-album',\n 'user_id' => $record->user_id,\n 'reference_type' => 'App\\\\Album',\n 'reference_id' => $record->id\n ]);\n $activity->save();\n }\n\n return response()->json([\n 'success' => true,\n 'album' => $album,\n 'message' => 'Album successfully updated'\n ]);\n }else{\n return response()->json([\n 'success' => false,\n 'errors' => [\"Access denied, you can't update this album\"]\n ],403);\n }\n }", "public function bulkAction()\r\n {\r\n $this->checkIfDemo();\r\n $this->AdminInterviewCategoryModel->bulkAction();\r\n }", "public static function updateNumberOfViews($id, $numberOfViews) {\n $numberOfViews++;\n $db = Db::getInstance();\n $req = $db->prepare(\"Update blogPost set noOfViews = $numberOfViews WHERE blogPostID=:id\");\n $req->bindParam(':id', $id);\n $req->execute();\n}", "public function updateAll(Request $request)\n {\n try {\n $images = json_decode($request->getContent(), true)['images'];\n foreach ($images as $image) {\n unset($image['created_at']);\n unset($image['updated_at']);\n\n AsideImage::where('id', $image['id'])\n ->update($image);\n }\n return response('Panel lateral actualizado exitosamente', 200);\n } catch (Exception $err) {\n return response($err->getMessage(), 500);\n }\n }", "function pnh_deals_bulk_update()\r\n\t\t{\r\n\t\t\t$user=$this->auth(DEAL_MANAGER_ROLE);\r\n\t\t\tif($_FILES)\r\n\t\t\t{\r\n\t\t\t\t$this->erpm->do_pnh_deals_bulk_update();\r\n\t\t\t}\r\n\t\t\t$data['page']=\"pnh_deals_bulk_update\";\r\n\t\t\t$this->load->view(\"admin\",$data);\r\n\t\t}", "protected function update(){\n\t\t$this->aggregations = array();\n\t\t\n\t\t// also update any groups\n\t\tforeach($this->getGroups() as $group){\n\t\t\t$group->update();\n\t\t}\n\t}", "public function editAlbum($currentAlbumId, $albumName, $shortDescription, $fullDescription, $placeTaken, $titlePhotoFile, $moreModeratorsToAdd, $moderatorsToDelete){\n\n DB::table('albums')\n ->where('album_id', $currentAlbumId)\n ->update(array(\n 'album_name' => $albumName,\n 'album_short_description' => $shortDescription,\n 'album_full_description' => $fullDescription,\n 'album_place' => $placeTaken\n )\n );\n\n UserAction::add('Album \"' . $albumName . '\" was updated');\n\n //add more moderators\n if ($moreModeratorsToAdd != null && !empty($moreModeratorsToAdd)){\n foreach($moreModeratorsToAdd as $i) {\n $isAdded = DB::table('album_moderators')->insert(\n array(\n 'album_id' => $currentAlbumId,\n 'user_id' => $i,\n )\n );\n }\n }\n\n //delete current moderators\n if ($moderatorsToDelete != null && !empty($moderatorsToDelete)){\n foreach($moderatorsToDelete as $i) {\n DB::delete('DELETE FROM album_moderators WHERE album_id = ? AND user_id = ?', array($currentAlbumId, $i));\n }\n }\n\n if ($titlePhotoFile != null){\n $file = $titlePhotoFile;\n\n $filename = $file->getClientOriginalName();\n $extension = $file->getClientOriginalExtension();\n if ($extension == 'jpeg') {\n $extension = 'jpg';\n }\n $fileSize = $file->getSize();\n\n if($extension == 'jpeg' || $extension == 'jpg' || $extension == 'bmp' || $extension == 'png' || $extension == 'gif')\n //max is 3MG\n if($fileSize <= 1024*1024*3){\n\n //make: if this albumId exist in albums table do this insert\n $isAlbumIdExist = DB::select('select album_id from albums where album_id = ?', array($currentAlbumId));\n if($isAlbumIdExist){\n\n $titleDestinationPath = 'uploads/albums/'.$currentAlbumId;\n\n //creates album directory if not exist\n if(!is_dir('uploads'))\n mkdir('uploads', 0777, true);\n if(!is_dir('uploads/albums'))\n mkdir('uploads/albums', 0777, true);\n if(!is_dir('uploads/albums/'.$currentAlbumId))\n mkdir('uploads/albums/'.$currentAlbumId, 0777, true);\n\n //gets old title url\n $titlePhoto = DB::table('albums')->where('album_id', $currentAlbumId)->get();\n\n //if album exist\n if($titlePhoto != null){\n\n //deletes old title photo if exists from directory\n $oldAlbumTitlePhoto = null;\n $oldAlbumTitlePhoto = $titlePhoto[0]->album_title_photo_url;\n if($oldAlbumTitlePhoto != null ){\n if(is_file($oldAlbumTitlePhoto))\n File::delete($oldAlbumTitlePhoto);\n }\n //deletes old title photo thumb if exists from directory\n $oldAlbumTitlePhotoThumb = null;\n $oldAlbumTitlePhotoThumb = $titlePhoto[0]->album_title_photo_thumb_url;\n if($oldAlbumTitlePhotoThumb != null )\n if(is_file($oldAlbumTitlePhotoThumb))\n File::delete($oldAlbumTitlePhotoThumb);\n }\n\n //new title photo url\n $newTitlePhotoUrl = $titleDestinationPath.\"/title_\".$currentAlbumId.\".\".$extension;\n\n //upload file to directory\n $upload_success = $file->move($titleDestinationPath, \"title_\".$currentAlbumId.\".\".$extension);\n if($upload_success){\n App::make('phpthumb')\n ->create('resize', array($newTitlePhotoUrl, 200, 200, 'adaptive'))\n ->save($titleDestinationPath.\"/\", \"title_\".$currentAlbumId.\"_thumb.\".$extension);\n\n $photoThumb = $titleDestinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$extension;\n\n //insert uploaded/unuploded files to database\n DB::table('albums')\n ->where('album_id', $currentAlbumId)\n ->update(array(\n 'album_title_photo_url' => $newTitlePhotoUrl,\n 'album_title_photo_thumb_url' => $photoThumb\n ));\n }\n }\n }\n }\n\n }", "function articleViews($id, $views,$connection){\n\t$new_views = $views + 1;\n\t$sql = \"UPDATE articles SET views_article='$new_views' WHERE id_article='$id'\";\t\n\t$update_views = mysqli_query($connection, $sql);\n}", "public function multi_update()\n\t{\n\t\t//menangkap variabel inputan\n\t\t$guru_id = $this->input->post('guru_id');\n\t\t$guru = $this->input->post('guru');\n\t\n\t\tfor($i =0;$i < count($guru_id); $i++)\n\t\t{\n\t\t\t$query = \"update tb_guru set guru='$guru[$i]' WHERE guru_id = \".$guru_id[$i];\n\t\t\t$this->db->query($query);\n\t\t\t\n\t\t}\n\t\t\n\t\tredirect('guru');\n\t\t\n\t}", "public function testUpdateModelSet()\n {\n }", "public function massUpdateVisibility($answerIds, $visibility)\n {\n foreach ($answerIds as $answerId) {\n $this->load((int) $answerId)->setAnswerVisibilityId((int) $visibility)->save();\n }\n }", "public function incViewCount()\n {\n $incView = (int) $this->attribute( 'view_count' );\n $incView++;\n $this->setAttribute( 'view_count', $incView );\n $this->store();\n }", "public function editAction(Request $request, Album $album)\n {\n $user = $this->getUser();\n if (!is_object($user) || !$user instanceof UserInterface) {\n throw new AccessDeniedException('This user does not have access to this section.');\n }\n\n/*\n $originalPhotographies = new ArrayCollection();\n foreach ($album->getPhotographies() as $photography) {\n $originalPhotographies->add($photography);\n }\n*/\n $editForm = $this->createForm('FotoJoin\\ControlPanelBundle\\Form\\AlbumType', $album);\n $editForm->handleRequest($request);\n\n if ($editForm->isSubmitted() && $editForm->isValid()) {\n $em = $this->getDoctrine()->getManager();\n/*\n $newPhotographies = $album->getPhotographies();\n foreach ($originalPhotographies as $originalPhotography) {\n if (false === $newPhotographies->contains($originalPhotography)) {\n $em->remove($originalPhotography);\n }\n }\n*/\n $em->persist($album);\n $em->flush();\n $request->getSession()->getFlashBag()->add( 'success', 'album.edit.flash' );\n\n return $this->redirectToRoute('album_edit', array('id' => $album->getId()));\n }\n\n// $em = $this->getDoctrine()->getManager();\n// $photographies = $em->getRepository('FotoJoinControlPanelBundle:Photography')->findByAlbum($album);\n// $files = array();\n// foreach ($photographies as $key => $photography) { $files[] = $photography->getFile(); }\n// $photographyCollectionForm = $this->createForm('FotoJoin\\ControlPanelBundle\\Form\\PhotographyCollectionType', $files);\n// $editForm->get('file')->setData($files);\n\n $albums = $user->getAlbums();\n return $this->render('FotoJoinControlPanelBundle:Album:edit.html.twig', array(\n 'album' => $album,\n 'albums' => $albums,\n 'edit_form' => $editForm->createView(),\n 'user' => $user,\n ));\n }", "public function postBulk($album_id)\n {\n\n $photos = Input::file('photos');\n\n // Validate and all.\n foreach ($photos as $photo)\n {\n $validator = Validator::make([\n 'photo' => $photo,\n ], [\n 'photo' => 'required|image',\n ]);\n\n if ($validator->fails())\n {\n // Update the error language to be in Arabic.\n return Redirect::back()->withInput()->with('error_message', 'الرجاء التأكد من اختيار ملفات صور.');\n }\n }\n\n $failed_photos_count = 0;\n\n // Try to upload the photos.\n foreach ($photos as $photo)\n {\n // Create a new photo table record.\n try\n {\n // Create the two photos, large and thumb.\n $photo_name = Str::random(40) . '.png';\n\n // Make the large photo first.\n $large_photo = Image::make($photo->getRealPath());\n\n $large_photo->widen(Photo::PHOTO_LARGE_WIDTH, function ($constraint) {\n $constraint->upsize();\n });\n\n $large_photo->save(public_path() . '/photos/large/' . $photo_name);\n\n // Make the thumb photo secondly.\n $thumb_photo = Image::make($photo->getRealPath());\n\n $thumb_photo->widen(Photo::PHOTO_THUMB_WIDTH, function ($constraint) {\n $constraint->upsize();\n });\n\n $thumb_photo->save(public_path() . '/photos/thumb/' . $photo_name);\n\n // Set the URLs for both, large and thumb.\n $large_photo_url = url('/photos/large/' . $photo_name);\n $thumb_photo_url = url('/photos/thumb/' . $photo_name);\n\n // After everything, save the photo in photos table.\n $_photo = new Photo();\n $_photo->album_id = $album_id;\n $_photo->title = $photo->getClientOriginalName();\n $_photo->large_url = $large_photo_url;\n $_photo->thumb_url = $thumb_photo_url;\n $_photo->save();\n }\n catch (Exception $exception)\n {\n // Log about the error.\n Log::error($exception);\n $failed_photos_count++;\n }\n }\n\n if ($failed_photos_count > 0)\n {\n return Redirect::route(\"admin_photos_index\", [$album_id])->with('warning_message', 'تمّ إضافة الصور بنجاح مع تعذّر ' . $failed_photos_count . ' صور عن الرفع.');\n }\n\n return Redirect::route(\"admin_photos_index\", [$album_id])->with('success_message', 'تمّ إضافة الصور بنجاح.');\n }", "public function updateAll() {\n $this->Corporations->update();\n $this->MemberTracking->update();\n $this->Facilities->update();\n $this->Industry->update();\n $this->Markets->update();\n $this->Contracts->update();\n $this->Wallet->update();\n $this->Assets->update();\n $this->Killmails->update();\n }", "public function do(?Album $targetAlbum, Collection $albums): void\n\t{\n\t\t// Move source albums into target\n\t\tif ($targetAlbum !== null) {\n\t\t\t/** @var Album $album */\n\t\t\tforeach ($albums as $album) {\n\t\t\t\t// Don't set attribute `parent_id` manually, but use specialized\n\t\t\t\t// methods of the nested set `NodeTrait` to keep the enumeration\n\t\t\t\t// of the tree consistent\n\t\t\t\t// `appendNode` also internally calls `save` on the model\n\t\t\t\t$targetAlbum->appendNode($album);\n\t\t\t}\n\t\t\t$targetAlbum->fixOwnershipOfChildren();\n\t\t} else {\n\t\t\t/** @var Album $album */\n\t\t\tforeach ($albums as $album) {\n\t\t\t\t// Don't set attribute `parent_id` manually, but use specialized\n\t\t\t\t// methods of the nested set `NodeTrait` to keep the enumeration\n\t\t\t\t// of the tree consistent\n\t\t\t\t$album->saveAsRoot();\n\t\t\t}\n\t\t}\n\t}", "public function doMultiAction( array $a = array() ){\r\n\t\t$limit = count($a['contentIds']);\r\n\t\t$sSql = \"UPDATE `region_mstr` SET `status`='\".(int)$a['contentActionValue'].\"' WHERE status!='-1' AND region_id IN(\".implode(',', $a['contentIds']).\") LIMIT $limit\";\r\n\t\t$res = $this->oMysqli->query($sSql);\r\n\t}", "private function updateChunk($updates){\n\t\t$ids = [];\n\t\tforeach ($updates as $upd) {\n\t\t\t$ids[] = $upd['collection']->id;\n\t\t}\n\n\t\t//buat array parameter update\n\t\t$update_parameter = [];\n\t\tforeach ($updates as $up) {\n\t\t\tforeach (array_keys( $up['updates'] ) as $k) {\n\t\t\t\t$update_parameter[ $k ][] = [\n\t\t\t\t\t'value' => $up['updates'][$k],\n\t\t\t\t\t'id' => $up['collection']->id\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\t$table = $updates[0]['collection']->getTable();\n\t\t$query = \"update \";\n\t\t$query .= $table . \" \";\n\t\t$kedua = false;\n\t\t$timestamp = date('Y-m-d H:i:s');\n\t\tforeach ($update_parameter as $key => $upd) {\n\t\t\tif ($kedua) {\n\t\t\t\t$query .= \",\" . $key . \" = ( CASE id \";\n\t\t\t} else {\n\t\t\t\t$query .= \"SET \" . $key . \" = ( CASE id \";\n\t\t\t}\n\t\t\tforeach ($upd as $up) {\n\t\t\t\t$query .= \"WHEN '\" . $up['id'] . \"' THEN '\" . $up['value'] . \"' \";\n\t\t\t}\n\t\t\t$query .= \"END) \";\n\t\t\t$kedua = true;\n\t\t}\n\n\t\t$query .= \", updated_at = '$timestamp' \";\n\t\t$query .= \"WHERE id in \";\n\t\tforeach ($ids as $k => $id) {\n\t\t\tif ($k == 0) {\n\t\t\t\t$query .= \"('\" . $id . \"'\";\n\t\t\t} else {\n\t\t\t\t$query .= \" ,'\" . $id .\"'\";\n\t\t\t}\n\t\t}\n\t\t$query .= \")\";\n\t\tDB::statement($query);\n\t}", "function album_put( $request, $user ) {\r\n global $hook;\r\n $owner = \\Profile\\profileHandler::getProfileId( $request );\r\n\r\n if (preg_match(\"@{$owner->username}/*$@\", join('/',$request->getRequestVars()) )) {\r\n // profile page\r\n $album = new \\AlbumObject();\r\n $parent = $album->initAlbumById( $owner->albumid )->getParent();\r\n /*\r\n ->getParent();\r\n $path = $album->path();\r\n */\r\n\r\n } elseif ($request->getResource() == 'albums') {\r\n // album page\r\n $album = new \\AlbumObject();\r\n $parent = $album->initAlbumByPath( $request->getRequestVars() )->getParent();\r\n /*\r\n ->getParent();\r\n $path = $album->path();\r\n */\r\n\r\n }\r\n\r\n // get submit data\r\n $json = $request->getData();\r\n\r\n // get item\r\n $item = new \\ItemObject();\r\n $item->getId($json->Id);\r\n\r\n // Check that the user is the owner of the object\r\n if ($item->get('uid') != $user->uid) {\r\n throw new \\Exception(\"You are not authorized to change this item.\", 403);\r\n }\r\n\r\n // check if item and parent match\r\n if ($item->get('parentid') != $parent->get('itemid')) {\r\n throw new \\Exception(\"item does not exist in this space\", 404);\r\n }\r\n //$item->set('path', $path);\r\n //print \"path: \".$item->get('path').\"\\n\";\r\n\r\n $response = new \\stdClass();\r\n\r\n $response->data = $hook->execute('put_article_albums_action', $json, $item, $album);\r\n // perform requested action \r\n switch($json->Item) { // <----- this should be at the favorites section\r\n case 'addFavorite':\r\n break;\r\n case 'removeFavorite':\r\n break;\r\n /*default:\r\n throw new \\Exception(\"Unsupported action\", 404);\r\n break;*/\r\n\r\n }\r\n\r\n $response->Success = true;\r\n print json_encode($response);\r\n //print_r($item);\r\n \r\n}", "function update(array $values)\n{\n\tforeach ($this as $model) {\n\t\t$model->setValues($values);\n\t\t$model->save();\n\t}\n}", "public function updateCollection(BaseCollection $collection)\n {\n if ($collection->isEmpty()) {\n return [];\n }\n\n $this->validateModelClass($collection->first());\n\n $params = [];\n $this->addGenericWriteParams($params);\n\n foreach ($collection->all() as $item) {\n $doc = $item->getChangedIndexDocument();\n\n if (! empty($doc)) {\n $params[ 'body' ][] = ['update' => $this->getEntityBulkParams($item)];\n $params[ 'body' ][] = ['doc' => $doc];\n }\n }\n\n $results = $this->client->bulk($params);\n $this->checkBulkResults($results, $collection);\n\n return $results;\n }", "public function updateRevisionAll()\n {\n foreach (get_class_methods(get_class($this)) as $method) {\n if (stripos($method, 'updateRevision') !== false && $method != __FUNCTION__) {\n $this->$method();\n }\n }\n }", "public function update_views_counts($add_id=null,$view_count=0,$user_id)\n\t{\n\t\t$view_count=1+$view_count;\n\t\t$data=array('view_count'=>$view_count);\n\t\t$this->db->where('id', $add_id);\n\t\t$this->db->update('advertisements', $data);\n\t\t$this->advertisment_view_count($add_id,$user_id);\n\t}", "public function update(Request $request, ViewUnits $viewUnits)\n {\n //\n }", "public function update()\n {\n $arg = func_get_args();\n\n foreach ($this->group as $form) {\n if (! is_object($form)) {\n $form = new $form();\n }\n\n if (method_exists($form, 'update')) {\n $form->save(...$arg);\n }\n }\n }", "public function updatePostPageViews(Post $post)\n {\n $post->setPageViews($post->getPageViews()+1);\n $this->save($post);\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function viewify($views)\n {\n foreach ($views as $views) {\n foreach ($this->add($views) as $view) {\n $this->di->get(\"view\")->add($view[\"view\"], $view[\"content\"], $view[\"region\"]);\n }\n }\n }", "public function update($models)\n {\n // reset keys, with php artisan scout:import \"Syscover\\...\" command get a object with objects\n // need call to values method to change object to array\n $models = $models->values();\n\n $this->setProperties($models);\n\n if (Storage::exists($this->fileRoute))\n {\n // transform json to collection\n $data = collect(json_decode(Storage::get($this->fileRoute), true));\n\n foreach ($models as $model)\n {\n $match = false;\n\n foreach ($data as $key => $item)\n {\n if (\n (isset($model['ix']) && $item['ix'] === $model->ix) ||\n (isset($model['id']) && $item['id'] === $model->id)\n )\n {\n $match = true;\n $data[$key] = $model->toSearchableArray();\n }\n }\n\n if(!$match) $data->push($model->toSearchableArray());\n }\n }\n else\n {\n $data = $models->map(function($model) {\n return $model->toSearchableArray();\n });\n }\n\n Storage::disk('local')->put($this->fileRoute, $data);\n }", "public function executeBatchMaj(sfWebRequest $request)\n {\n $videos = VideoPeer::doSelect(new criteria());\n foreach ($videos as $video)\n {\n\t\t$video->updateLuceneIndex();\n\t}\n $this->getUser()->setFlash('notice', 'L index des '.$request->getParameter('type').'s a ete mis a jour');\n\t$this->redirect('video');\n }", "public function execute(string $setName, TablesList $tableCollection, ViewsList $viewCollection): void\n {\n foreach ($tableCollection->getTables() as $table => $sampler) {\n try {\n $this->ensureEmptyTargetTable($table, $this->sourceConnection, $this->destConnection);\n $sampler->setTableName($table);\n $sampler->setSourceConnection($this->sourceConnection);\n $sampler->setDestConnection($this->destConnection);\n $rows = $sampler->execute();\n $this->logger->info(\"$setName: migrated '$table' with '\" . $sampler->getName() . \"': $rows rows\");\n } catch (\\Exception $e) {\n $this->logger->error(\n \"$setName: failed to migrate '$table' with '\" . $sampler->getName() . \"': \" . $e->getMessage()\n );\n throw $e;\n }\n }\n\n foreach ($viewCollection->getViews() as $view) {\n $this->migrateView($view, $setName);\n }\n\n $this->migrateTableTriggers($setName, $tableCollection);\n }", "public function update()\n {\n if ($this->getState()->getStatus() == View\\StateInterface::STATUS_IDLE) {\n try {\n $currentVersionId = $this->getChangelog()->getVersion();\n } catch (ChangelogTableNotExistsException $e) {\n return;\n }\n $lastVersionId = (int) $this->getState()->getVersionId();\n $action = $this->actionFactory->get($this->getActionClass());\n\n try {\n $this->getState()->setStatus(View\\StateInterface::STATUS_WORKING)->save();\n\n $versionBatchSize = self::$maxVersionQueryBatch;\n $batchSize = isset($this->changelogBatchSize[$this->getChangelog()->getViewId()])\n ? $this->changelogBatchSize[$this->getChangelog()->getViewId()]\n : self::DEFAULT_BATCH_SIZE;\n\n for ($vsFrom = $lastVersionId; $vsFrom < $currentVersionId; $vsFrom += $versionBatchSize) {\n // Don't go past the current version for atomicy.\n $versionTo = min($currentVersionId, $vsFrom + $versionBatchSize);\n $ids = $this->getChangelog()->getList($vsFrom, $versionTo);\n\n // We run the actual indexer in batches.\n // Chunked AFTER loading to avoid duplicates in separate chunks.\n $chunks = array_chunk($ids, $batchSize);\n foreach ($chunks as $ids) {\n $action->execute($ids);\n }\n }\n\n $this->getState()->loadByView($this->getId());\n $statusToRestore = $this->getState()->getStatus() == View\\StateInterface::STATUS_SUSPENDED\n ? View\\StateInterface::STATUS_SUSPENDED\n : View\\StateInterface::STATUS_IDLE;\n $this->getState()->setVersionId($currentVersionId)->setStatus($statusToRestore)->save();\n } catch (\\Exception $exception) {\n $this->getState()->loadByView($this->getId());\n $statusToRestore = $this->getState()->getStatus() == View\\StateInterface::STATUS_SUSPENDED\n ? View\\StateInterface::STATUS_SUSPENDED\n : View\\StateInterface::STATUS_IDLE;\n $this->getState()->setStatus($statusToRestore)->save();\n throw $exception;\n }\n }\n }", "public function updatebulk(\n string $token,\n string $query,\n array $metadata,\n ?bool $async = false)\n {\n // Form updatebulk parameters\n $updateBulk = array(\n 'q' => $query,\n 'async' => $async,\n );\n\n // Do the query\n $response = Elvis::query($token, 'updatebulk', $updateBulk, $metadata);\n\n return $response;\n }", "public static function updateAll()\r\n\t{\r\n\t}", "function manage_wp_posts_using_bulk_quick_save_bulk_edit() {\n\t$post_ids = ( isset( $_POST[ 'post_ids' ] ) && !empty( $_POST[ 'post_ids' ] ) ) ? $_POST[ 'post_ids' ] : NULL;\n\t\t\n\t// if we have post IDs\n\tif ( ! empty( $post_ids ) && is_array( $post_ids ) ) {\n\t\n\t\t// get the custom fields\n\t\t$custom_fields = array( 'release_date', 'coming_soon', 'film_rating' );\n\t\t\n\t\tforeach( $custom_fields as $field ) {\n\t\t\t\n\t\t\t// if it has a value, doesn't update if empty on bulk\n\t\t\tif ( isset( $_POST[ $field ] ) && !empty( $_POST[ $field ] ) ) {\n\t\t\t\n\t\t\t\t// update for each post ID\n\t\t\t\tforeach( $post_ids as $post_id ) {\n\t\t\t\t\tupdate_post_meta( $post_id, $field, $_POST[ $field ] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n}", "public function loadAlbums()\n {\n\t\t$json = file_get_contents('https://itunes.apple.com/us/rss/topalbums/limit=100/json');\n \n $albums = json_decode($json, true);\n $category_sql = \"INSERT IGNORE INTO categories (name, category_id, link) VALUES (:name, :category_id, :link)\";\n\t\t$album_sql = \"INSERT IGNORE INTO albums (album_id, name, artist, artist_link, category_id, release_date, rank) VALUES (:album_id, :name, :artist, :artist_link, :category_id, :release_date, :rank)\";\n\t\t$images_sql = \"INSERT IGNORE INTO album_art (album_id, album_image, image_size) VALUES (:album_id, :album_image, :image_size)\";\n\n\t\t//Lets delete whatever is in these tables before adding to them.\n\t\t$this->purgeTables();\n \n foreach($albums['feed']['entry'] as $rank=>$album) {\n\t\t\t\n\t\t\t//Insterts categories\n\t\t\t$stmt= $this->db->prepare($category_sql);\n\t\t\t\n\t\t\t$data = [\n\t\t\t\t'name' => $album['category']['attributes']['label'],\n\t\t\t\t'category_id' => $album['category']['attributes']['im:id'],\n\t\t\t\t'link' => $album['category']['attributes']['scheme'],\n\t\t\t];\n\t\t\t\n\t\t\t$stmt->execute($data);\n\t\t\t\n\t\t\t//Insterts album info\n\t\t\t$stmt= $this->db->prepare($album_sql);\n\t\t\t\n\t\t\t$data = [\n\t\t\t\t'album_id' => $album['id']['attributes']['im:id'],\n\t\t\t\t'name' => $album['title']['label'],\n\t\t\t\t'artist' => $album['im:artist']['label'],\n\t\t\t\t'artist_link' => (isset($album['im:artist']['attributes'])) ? $album['im:artist']['attributes']['href'] : '',\n\t\t\t\t'category_id' => $album['category']['attributes']['im:id'],\n\t\t\t\t'release_date' => $album['im:releaseDate']['label'],\n\t\t\t\t'rank' => $rank,\n\t\t\t];\n\n\t\t\t$stmt->execute($data);\n\t\t\t\n\t\t\t//inserts album images\n\t\t\t$stmt= $this->db->prepare($images_sql);\n\t\t\t\n\t\t\tforeach($album['im:image'] as $image){\n\t\t\t\t$data = [\n\t\t\t\t\t'album_id' => $album['id']['attributes']['im:id'],\n\t\t\t\t\t'album_image' => $image['label'],\n\t\t\t\t\t'image_size' => $image['attributes']['height'],\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\t$stmt->execute($data);\n\t\t\t}\n\t\t}\n\t}", "public function setItems(string $view): void\n {\n\n $this->items = match($view)\n {\n CONTENT => [\n // YOUTUBE => Playlist::navigation()\n ]\n };\n }", "function sys_view_row_update($rows, $result_total){\r\n // $ids is combi: id form # id row\r\n $ids = $_POST[\"id\"];\r\n $id_arr = explode(\"-\", $ids);\r\n $id_view = $id_arr[0];\r\n $id_row = $id_arr[1];\r\n $result = f_m_get_txt_data(\"model/data/d_sys_view.txt\", \"\", \"id='$id_view'\", \"\", \"\", \"form_row1\");\r\n $ref_id_db = \"id\";\r\n $ref_id_form = \"id_org\";\r\n $_POST[\"id_org\"] = $id_row;\r\n // get columnnames\r\n $column = f_m_get_columns_view_model(\"model/data/d_sys_view.txt\", \"\");\r\n // first always the same\r\n $store_id_db = \"id,\";\r\n $store_id_form = \"id_org,\";\r\n // add others\r\n $column_str = \"\";\r\n for($i = 1; $i < count($column); $i++){\r\n $column_str .= $column[$i] . \",\";\r\n }\r\n $column_str = substr($column_str, 0, strlen($column_str) - 1);\r\n $store_id_db .= $column_str;\r\n $store_id_form .= $column_str;\r\n s_m_put_txt_data(\"put_sys_view_row_update\", \"update\", $result[0][\"map_file\"], $ref_id_db, $ref_id_form, $store_id_db, $store_id_form);\r\n return $result_total;\r\n}", "public function bulkSet(array $args = array()) {\n foreach ($args as $argName => $arg) {\n $this->__set($argName, $arg);\n }\n }", "function index($id = null){\r\n\t\t$this->checkSession();\r\n\t\tif($id == null){\r\n\t\t\t$datas = $this->Album->findAll();\r\n\t\t\t$this->set('viewtype', \"multiview\");\r\n\t\t}else{\r\n\t\t\t# string $conditions\r\n\t\t\t# array $fields\r\n\t\t\t# string $order\r\n\t\t\t# int $limit\r\n\t\t\t# int $page\r\n\t\t\t# int $recursive\r\n\r\n\t\t\t$this->Album->id = $id;\r\n\t\t\t$datas = $this->Album->read();\r\n\t\t\t$this->set('viewtype',\"singleview\");\r\n\t\t}\r\n\t\tvendor('JSON');\r\n\t\t$allist = $this->Album->findAll();\r\n\t\t$js = new Services_JSON();\r\n\t\t$this->set('alist',$js->encode($allist));\r\n\t\t$this->set('datas', $datas);\r\n\t\t$this->render('editview','ajax');\t\t\r\n\t}", "public function run()\n {\n foreach(DB::table('content_kinds')->get() as $d){\n \tDB::table('content_kinds')->where('id', $d->id)->update([\n \t\t'url' => str_slug($d->name)\n \t]);\n }\n }", "function __reimportPhotos(){\n\t\t$this->Asset->disablePermissionable();\n\t\t$this->Asset->recursive=0;\n\t\t$json = $this->Asset->find('all', array('fields'=>'json_src'));\n\t\t$json =Set::extract($json, '/Asset/json_src');\n\t\tforeach ($json as $row) {\n\t\t\t$imgSrc = json_decode($row);\n\t\t\t$src = \"Summer2009/\".basename($imgSrc->orig);\n\t\t\t$dest = $imgSrc->preview;\n\t\t\t$src_baseurl = Configure::read('path.local.preview');\n\t\t\t$dest_baseurl = Configure::read('stageroot.basepath');\n\t\t\t$shell_cmd[] =\"cp {$src_baseurl}/{$src} {$dest_baseurl}/{$dest}\";\n\t\t\t//\t\t\tmkdir(dirname(Configure::read('stageroot.basepath').\"/{$dest}\"), 0777, $recursive=true);\n\t\t\t//\t\t\tcopy( Configure::read('path.local.preview').\"/{$src}\", Configure::read('stageroot.basepath').\"/{$dest}\");\n\t\t}\n\t\tdebug($shell_cmd);\n\t}", "public static function renumberPostionsToAccountForNewlyDeletedPhotos()\n {\n $position = 1;\n $photos = parent::whereUserId(auth()->id())->orderBy('position')->orderBy('updated_at')->get();\n foreach ($photos as $photo) {\n $photo->update(['position' => $position]);\n $position++;\n }\n }", "public function update($models)\n {\n $index = new Index($this->RedisClientInterface, $models->first()->searchableAs());\n\n $models\n ->map(function ($model) {\n $array = $model->toSearchableArray();\n if (empty($array)) {\n return;\n }\n return array_merge(['id' => $model->getKey()], $array);\n })\n ->filter()\n ->values()\n ->each(function ($item) use ($index) {\n $index->add($item);\n });\n }", "function update_post_counts($response){\r\n \t$count_key = 'post_views_count';\r\n \t$success = 0;\r\n \t$failure = 0;\r\n \tforeach ($response as $item){\r\n\t \t$post_id = $item[\"post_id\"];\r\n\t \tif(update_post_meta($post_id, $count_key, $item[\"views\"])) {\r\n\t \t\t$success++;\r\n\t \t} else {\r\n\t \t\t$failure++;\r\n\t \t}\r\n\t\t}\r\n\r\n\t\treturn array('success' => $success, 'failure' => $failure);\r\n\t}", "function updateProjectObjects() {\n try {\n $project_objects_table = TABLE_PREFIX . 'project_objects';\n\n DB::execute(\"ALTER TABLE $project_objects_table ADD label_id SMALLINT UNSIGNED NULL DEFAULT NULL AFTER category_id\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD INDEX (label_id)\");\n DB::execute(\"ALTER TABLE $project_objects_table DROP has_time\");\n DB::execute(\"ALTER TABLE $project_objects_table DROP comments_count\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD varchar_field_3 VARCHAR(255) NULL DEFAULT NULL AFTER varchar_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD integer_field_3 INT(11) NULL DEFAULT NULL AFTER integer_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD float_field_3 FLOAT NULL DEFAULT NULL AFTER float_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD text_field_3 LONGTEXT NULL AFTER text_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD date_field_3 DATE NULL DEFAULT NULL AFTER date_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD datetime_field_3 DATETIME NULL DEFAULT NULL AFTER datetime_field_2\");\n DB::execute(\"ALTER TABLE $project_objects_table ADD boolean_field_3 TINYINT(1) UNSIGNED NULL DEFAULT NULL AFTER boolean_field_2\");\n\n DB::execute('DROP TABLE ' . TABLE_PREFIX . 'project_object_views');\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function update(Request $request, Fotos $fotos)\n {\n //\n }", "public function execute($ids)\n {\n $this->reindex($ids);\n }", "public function updateTweetsData() \n {\n $tweets = Tweet::all();\n if ($tweets->count()) {\n foreach ($tweets as $tweet) {\n $tweetData = $this->getTweetDataFromApi($tweet->tweet_id);\n $attributes = $this->prepareAttributes($tweetData);\n $tweet->update($attributes);\n }\n }\t\n }", "public function albums(){\n $albums = Album::all();\n return view('admin.albums')->with('albums', $albums);\n }", "public function rep_update_page(){\n\n $shops_by_sale = self::make_uploadList(1,0,0);\n $shops_by_standard = self::make_uploadList(0,1,0);\n $shops_by_custom = self::make_uploadList(0,0,1);\n\n return view('stock_out/update_to_branch',compact('shops_by_sale','shops_by_standard','shops_by_custom'));\n }", "public function updateall()\n\t{\n\t\t$this->cleanup();\n\n\t\t//get only 15 feeds at a time\n\t\t$feeds = Feed::orderBy('updated_at', 'asc')->take(15)->get();\n\n\t\t$count = 0;\n\n\t\tif (!empty($feeds)) {\n\t\t\tforeach ($feeds as $feed) {\n\t\t\t\t//update feed, see update function\n\t\t\t\t$count = $count + $this->update($feed);\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json([\n\t\t\t'code' => '200',\n\t\t\t'count' => $count,\n\t\t\t'message' => $count . ' new messages have been added to the database',\n\t\t], 200);\n\t}", "public function setViewed(ViewCountable $entity): void;", "private function executeExtraUpdates()\n {\n foreach ($this->extraUpdates as $oid => $update) {\n list ($entity, $changeset) = $update;\n $this->entityChangeSets[$oid] = $changeset;\n $this->getEntityPersister(get_class($entity))->update($entity);\n }\n $this->extraUpdates = [];\n }", "function quasar_set_post_views(){\n\tglobal $post;\n\tif(!$post) return;\n\t\n\tif(!is_single()) return;\n\t\n\t$count_key = 'post_views_count';\n\t$count = get_post_meta($post->ID, $count_key, true);\n\tif ($count == '') {\n\t\t$count = 0;\n\t\tdelete_post_meta($post->ID, $count_key);\n\t\tadd_post_meta($post->ID, $count_key, '0');\n\t} else {\n\t\t$count++;\n\t\tupdate_post_meta($post->ID, $count_key, $count);\n\t}\n}", "public function update_pagination( $args, $assoc_args ) {\n\t\tlist( $id ) = $args;\n\n\t\t$defaults = array(\n\t\t\t\"count\" => 'default',\n\t\t\t\"type\" => 'paged'\n\t\t);\n\n\t\t$pagination_args = wp_parse_args( $assoc_args, $defaults );\n\n\t\tif ( !is_numeric($id) ) {\n\t\t\t\\WP_CLI::error( __( 'Please provide a View id', 'toolset-cli' ) );\n\t\t}\n\n\t\ttry {\n\n\t\t\t$view = WPV_View::get_instance( (int) $id );\n\n\t\t\tif ( $view !== null ) {\n\t\t\t\t$view_settings = $view->get_postmeta( WPV_View::POSTMETA_VIEW_SETTINGS );\n\n\t\t\t\t$view_settings['pagination']['posts_per_page'] = $pagination_args['count'];\n\t\t\t\t$view_settings['pagination']['type'] = $pagination_args['type'];\n\n\t\t\t\t$result = $view->update_postmeta( WPV_View::POSTMETA_VIEW_SETTINGS, $view_settings );\n\n\t\t\t\tif ( !empty($result) ) {\n\t\t\t\t\t\\WP_CLI::success( __( 'Updated pagination settings', 'toolset-cli' ) );\n\t\t\t\t} else {\n\t\t\t\t\t\\WP_CLI::error( __( 'Could not update the pagination settings', 'toolset-cli' ) );\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t\\WP_CLI::error( __( 'There was an error while creating new Views instance.', 'toolset-cli' ) );\n\t\t\t}\n\n\t\t} catch ( \\Exception $e ) {\n\t\t\t\\WP_CLI::error( __( 'There was an error while creating new Views instance.', 'toolset-cli' ) );\n\t\t}\n\t}", "public function updateTotalViews($season)\n {\n $season->total_views = $season->views()->count();\n\n $season->save();\n\n return $season;\n }", "function amo_update($entity, $data, $search_similiar = false, $need_prepare = true)\n{\n if (substr($entity, -1) == 's') {\n $link = $entity;\n $many_items = true;\n } else {\n if ($entity == 'company') {\n $link = 'companies';\n } else {\n $link = $entity . 's';\n }\n }\n\n if (isset($data['search']) && !empty($data['search'])) {\n $search_similiar = true;\n }\n\n if ($need_prepare) {\n $item = prepare_data($entity, $data, $search_similiar);\n } else {\n $item = $data;\n }\n\n if ($item) {\n if (!$many_items) {\n $items = [$item];\n } else {\n $items = $item;\n }\n\n foreach ($items as $key => $item) {\n if (isset($item['id'])) {\n\n // no_update ставится в случае когда данные контакта совпадают с данными в амо.\n if ($item['no_update']) {\n return $item['id'];\n }\n\n $action_msg = 'Обновлён ';\n $ids_to_update[] = $item['id'];\n $item['updated_at'] = time(); // + 1000\n $sorted_data['update'][] = $item;\n\n } else {\n $ids_to_add[] = $item['id'];\n $action_msg = 'Добавлен ';\n $sorted_data['add'][] = $item;\n }\n }\n\n/* if (!empty($ids_to_update)) {\nlogw('Обновляем ' . $entity . ' id ' . implode(', ', $ids_to_update));\n}\n\nif (!empty($ids_to_add)) {\nlogw('Добавляем ' . $entity);\n}*/\n\n $output = run_curl($link, $sorted_data);\n\n if (!empty($output['_embedded']['items'])) {\n foreach ($output['_embedded']['items'] as $key => $value) {\n $updated_id[] = $value['id'];\n }\n } else {\n logw('Ошибка обновления');\n logw($output);\n return false;\n }\n\n if (!empty($updated_id)) {\n $updated_id_msg = implode(', ', $updated_id);\n } else {\n logw('Ошибка обновления ' . $entity);\n logw($output);\n return false;\n }\n\n if ($many_items) {\n logw('Обновлены ' . $entity . ' id ' . $updated_id_msg);\n return $updated_id;\n } else {\n logw($action_msg . $entity . ' id ' . $updated_id_msg);\n return $updated_id[0];\n }\n\n } else {\n logw('Ошибка: не получены данные от prepare_data');\n return false;\n }\n}", "public function setCover(SetAlbumCoverRequest $request): void\n\t{\n\t\t$request->album()->cover_id = $request->photo()?->id;\n\t\t$request->album()->save();\n\t}", "private function updateRows()\n {\n $path = $this->getVar('upload_folder');\n $rows = $this->entityManager->getRepository('Downloads_Entity_Download')->findAll();\n $count = 0;\n foreach ($rows as $row) {\n $parts = explode('.', $row->getUrl());\n if (is_numeric($parts[0]) && ((int)$parts[0] == (int)$row->getLid())) {\n // this section renames numeric filenames to strings and attempts to\n // rename the actual file it also corrects the url for local files\n $filenameParts = explode('.', $row->getFilename());\n $newname = DataUtil::formatForURL($filenameParts[0]) . '.' . array_pop($filenameParts);\n $newurl = \"$path/$newname\";\n $oldurl = $path . '/' . $row->getUrl();\n if (@rename(DataUtil::formatForOS($oldurl), DataUtil::formatForOS($newurl))) {\n // update DB\n $row->setUrl($newurl);\n $row->setFilename($newname);\n } else {\n // update DB\n $row->setUrl($oldurl);\n $row->setFilename($newname);\n }\n } else {\n // this section simply renames filenames to only have one extension\n // old versions of the module somehow added double extensions\n $filenameParts = explode('.', $row->getFilename());\n if (count($filenameParts) > 2) {\n $newname = DataUtil::formatForURL($filenameParts[0]) . '.' . array_pop($filenameParts);\n // update DB\n $row->setFilename($newname);\n }\n }\n $this->entityManager->persist($row);\n if ($count > 20) {\n $this->entityManager->flush();\n $count = 0;\n } else {\n $count++;\n }\n }\n // clean up leftovers\n $this->entityManager->flush();\n }", "public function setView($id) {\n\t\t\tif($this->isConnected()) {\n\t\t\t\t$count = $this->getView($id);\n\t\t\t\t$count++;\n\t\t\t\t$SQL = \"UPDATE $this->table SET view_count='$count' WHERE id=$id\";\n\t\t\t\tmysqli_query($this->conn, $SQL);\n\t\t\t}\n\t\t}", "public function actionMassupdate()\n {\n if (Yii::$app->request->isPost && (Yii::$app->request->post('Picture') !== NULL)) {\n $model = $this->findModelOwn(Yii::$app->request->post('Picture')['id']);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // Model has been saved => we can reload!\n $model = NULL;\n }\n } else {\n $model = NULL;\n }\n\n $searchModel = new PictureSearch(['scenario' => 'private']);\n $dataProvider = $searchModel->search(Yii::$app->request->get());\n $dataProvider->query->ownerScope();\n $dataProvider->sort->defaultOrder = ['id' => SORT_ASC,];\n $dataProvider->pagination->pageSize = 1;\n\n return $this->render('massupdate', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n 'updatedmodel' => $model,\n ]);\n }", "public function performMultipleAction(){\r\n\t\tif(Request::ajax()){\r\n\t\t\t$actionType = ((Input::get('type'))) ? Input::get('type') : '';\r\n\t\t\tif(!empty($actionType) && !empty(Input::get('ids'))){\r\n\t\t\t\tif($actionType\t==\t'active'){\r\n\t\t\t\t\tBlog::whereIn('id', Input::get('ids'))->update(array('status' => ACTIVE));\r\n\t\t\t\t}\r\n\t\t\t\telseif($actionType\t==\t'inactive'){\r\n\t\t\t\t\tBlog::whereIn('id', Input::get('ids'))->update(array('status' => 0));\r\n\t\t\t\t}\r\n\t\t\t\telseif($actionType\t==\t'delete'){\r\n\t\t\t\t\tBlog::whereIn('id', Input::get('ids'))->delete();\r\n\t\t\t\t}\r\n\t\t\t\tSession::flash('success', trans(\"messages.global.action_performed_message\")); \r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function bulk_update(Request $request)\n {\n $data = $request->all();\n $validatedData = $request->validate([\n \"listing_id\" => \"required\",\n \"images\" => \"required\"\n ]);\n if(!empty($data['images']))\n {\n $saved_array = [];\n foreach ($data['images'] as $key) {\n $new_data = [\n 'listing_id' => $data['listing_id'],\n 'amenity_id' => $key\n ];\n if(!self::check_if_exist($new_data))\n {\n $saved = self::store($new_data);\n }\n array_push($saved_array, $new_data);\n }\n //return $saved_array;\n }\n return response()->json(['status' => 'ok', 'data'=> $saved_array, 'msg' => 'Data added successfully']); \n }", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"public_folder\";\n $destination_path = \"uploads/albums\";\n $album_originalName = $_POST['name'];\n // ******** Generate unique album name ********\n $album_name = md5( $album_originalName . time() );\n \n foreach ( $value as $file ) {\n // 0. Generate new size file\n $image = \\Image::make( $file );\n $image_350 = \\Image::make( $file ) -> widen( 350 );\n \n // 1. Generate new file names\n $new_file_name = md5( $file -> getClientOriginalName() . time() ).'.'.$file->getClientOriginalExtension();\n $new_file_name_350 = md5( $file -> getClientOriginalName() . time() ).'_350.'.$file->getClientOriginalExtension();\n \n // 2. Move new files to the correct path\n $file_path = $destination_path . '/' . $album_name . '/' . $new_file_name;\n $file_path_350 = $destination_path . '/' . $album_name . '/' . $new_file_name_350;\n \\Storage::disk( $disk )->put( $file_path, $image -> stream() );\n \\Storage::disk( $disk )->put( $file_path_350, $image_350 -> stream() );\n \n // 3. Add the public path to the database\n $attribute_value[] = [ $file_path, $file_path_350 ];\n }\n $this->attributes[$attribute_name] = str_replace( '\\\\', '', json_encode($attribute_value) );\n }", "public function updateTest(Request $request){\n $data = array();\n foreach ($request->all() as $item){\n DB::table('tests')\n ->where('id', $item['id'])\n ->update(['result'=>$item['result']]);\n }\n return Response::json($data);\n }", "public function rebuild()\n\t{\n\t\t$id=3;\n\t\t$dataAlbum = $this->admin->data_album($id);\n\t\t$namaAlbum = $dataAlbum->row()->nama_album;\n\t\t$albumKey = $dataAlbum->row()->kode_album;\n\t\t$data['title'] = \"Dashboard | FaceVoting Versi 1.0\";\n\t\t$data['getRebuild']= $this->_prosesRebuild($namaAlbum,$albumKey);\n\t\t$view ='v_rebuildalbum';\n\t\t$this->_template($data,$view);\n\t}", "public function articleIncViews($id) {\n\t\t$this->id = $id;\n\t\t$nb_views = $this->field('views');\n\t\t$nb_views ++;\n\n\t\t// set datas (field views) for update\n\t\t$data = array(\n\t\t\t\t\t\t'id' => $id,\n\t\t\t\t\t\t'views' => $nb_views,\n\t\t\t\t\t\t'modified' => false\n\t\t\t\t\t);\n\n\t\t// save datas\n\t\t$this->save($data);\n\t}", "public function entry_order_update()\n {\n $ids = explode(',', $this->input->post('order'));\n\n // Set the count by the offset for\n // paginated lists\n $order_count = $this->input->post('offset')+1;\n\n foreach ($ids as $id)\n {\n $this->db\n ->where('choice_id', $id)\n ->update('choices', array('ordering_count' => $order_count));\n\n ++$order_count;\n }\n }", "public function UpdatePageViews($brandstatistic)\n\t\t{\n\t\t\t$tContext = new AppTransaction();\n\t\t\t$brandstatisticDAL = new BrandStatisticDAL($this->_userinfo);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$tContext->BeginTransaction();\n\t\t\t\t$brandstatisticDAL->UpdatePageViews($brandstatistic, $tContext);\n\t\t\t\t$tContext->CommitTransaction();\n\t\t\t}\n\t\t\tcatch (Exception $ex)\n\t\t\t{\n\t\t\t\t$tContext->RollbackTransaction();\n\t\t\t\tthrow $ex;\n\t\t\t}\n\t\t}", "public function updateImageIndex() {\n $lastUpdatedId = intval(DB::table('settings')\n ->where('setting_key', 'indexInsert_lastId')\n ->first()->value);\n\n $cards = DB::table('cards')\n ->select('id', 'card_id')\n ->orderBy('id', 'ASC')\n ->skip($lastUpdatedId - 1)\n ->take(PHP_INT_MAX)\n ->get();\n\n $counter = 0;\n\n if (ob_get_level() == 0) ob_start();\n foreach ($cards as $card) {\n $uuid = $card->id;\n $cardId = $card->card_id;\n\n $imgCardId = str_replace('/', '_', $cardId);\n if ($this->flysystem->has(\"$imgCardId.png\")) {\n $img = (string) Image::make($this->flysystem->read(\"$imgCardId.png\"))->encode('jpg', 100);\n } else if ($this->flysystem->has(\"$imgCardId.gif\")) {\n $img = (string) Image::make($this->flysystem->read(\"$imgCardId.gif\"))->encode('jpg', 100);\n }\n\n if (!empty($img)) {\n $url = \"http://localhost:4212/index/images/$uuid\";\n $header = [\n 'Accept: application/json',\n ];\n $ch = curl_init();\n $timeout = 10;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $img);\n $result = json_decode(curl_exec($ch), true);\n curl_close($ch);\n\n if (!empty($result)) {\n echo \"$uuid complete.<br>\";\n } else {\n echo \"Something went wrong with $uuid\";\n }\n\n ob_flush();\n flush(); \n }\n\n $counter++;\n if ($counter >= 50) {\n $this->saveImageIndex();\n\n DB::table('settings')->updateOrInsert([\n 'setting_key' => 'indexInsert_lastId'\n ], [\n 'setting_key' => 'indexInsert_lastId',\n 'value' => $uuid,\n ]);\n\n $counter = 0;\n }\n }\n\n ob_end_flush();\n return;\n }", "function set_views($views)\n\t{\n\t\t$this->views = $views;\n\t\treturn OP_SUCCESSFUL;\n\t}" ]
[ "0.543585", "0.539819", "0.5386923", "0.5291097", "0.52498895", "0.5209907", "0.5143953", "0.5061777", "0.50389886", "0.50014615", "0.49921796", "0.49910492", "0.4908368", "0.4873928", "0.4842603", "0.48293564", "0.4825143", "0.48172027", "0.47930467", "0.47900572", "0.4781967", "0.47762904", "0.47710598", "0.47395074", "0.4731824", "0.47309133", "0.47222874", "0.4690838", "0.46897092", "0.46803468", "0.46399346", "0.46245304", "0.4623045", "0.46074563", "0.45979118", "0.4578583", "0.45769653", "0.45753923", "0.45724767", "0.45705616", "0.45681977", "0.45634687", "0.45602015", "0.4546865", "0.45380768", "0.45360857", "0.45355806", "0.45185623", "0.45106506", "0.44945076", "0.44934148", "0.44799232", "0.4474412", "0.4466831", "0.4452219", "0.44511744", "0.44493112", "0.4449146", "0.44388554", "0.44384485", "0.44353834", "0.4431457", "0.4431322", "0.44312057", "0.44254607", "0.44212407", "0.4407596", "0.4404029", "0.4403705", "0.43999094", "0.43940207", "0.43916267", "0.43895784", "0.43884394", "0.43803027", "0.43683058", "0.43472382", "0.4346047", "0.43443504", "0.4327068", "0.43249696", "0.4323255", "0.43194386", "0.43193084", "0.43136877", "0.43132013", "0.43059278", "0.42947647", "0.42927566", "0.4289953", "0.42877215", "0.42857248", "0.42856008", "0.4285462", "0.42840803", "0.4283223", "0.42800868", "0.4280052", "0.42794237", "0.427857" ]
0.7736703
0
Prepares joinrelated fetch options.
public function prepareAlbumFetchOptions(array $fetchOptions, array $conditions = array()) { $selectFields = ''; $joinTables = ''; $orderBy = ''; if (!empty($fetchOptions['order'])) { $orderBySecondary = ''; switch ($fetchOptions['order']) { case 'rand': $orderBy = 'RAND()'; break; case 'album_create_date': case 'new': default: $orderBy = 'album.album_create_date'; break; case 'album_id': $orderBy = 'album.album_create_date'; $orderBySecondary = ', album.album_id DESC'; break; case 'rating_avg': $orderBy = 'album.album_rating_avg'; $orderBySecondary = ', album.album_create_date DESC'; break; case 'comment_count': $orderBy = 'album.album_comment_count'; $orderBySecondary = ', album.album_create_date DESC'; break; case 'view_count': $orderBy = 'album.album_view_count'; $orderBySecondary = ', album.album_create_date DESC'; break; case 'media_count': $orderBy = 'album.album_media_count'; $orderBySecondary = ', album.album_media_count DESC'; break; case 'rating_count': $orderBy = 'album.album_rating_count'; $orderBySecondary = ', album.album_create_date DESC'; break; case 'likes': $orderBy = 'album.album_likes'; $orderBySecondary = ', album.album_create_date DESC'; break; } if (!isset($fetchOptions['orderDirection']) || $fetchOptions['orderDirection'] == 'desc') { $orderBy .= ' DESC'; } else { $orderBy .= ' ASC'; } $orderBy .= $orderBySecondary; } if (!empty($fetchOptions['join'])) { if (($fetchOptions['join'] & self::FETCH_PRIVACY) && isset($conditions['privacyUserId']) ) { $selectFields .= ', shared.shared_user_id, private.private_user_id'; $joinTables .= ' LEFT JOIN xengallery_shared_map AS shared ON (shared.album_id = album.album_id AND shared.shared_user_id = ' . $this->_getDb()->quote($conditions['privacyUserId']) . ') LEFT JOIN xengallery_private_map AS private ON (private.album_id = album.album_id AND private.private_user_id = ' . $this->_getDb()->quote($conditions['privacyUserId']) .')'; } if ($fetchOptions['join'] & self::FETCH_USER) { $selectFields .= ', user.*, user_profile.*, IF(user.username IS NULL, album.username, user.username) AS username'; $joinTables .= ' LEFT JOIN xf_user AS user ON (user.user_id = album.user_id) LEFT JOIN xf_user_profile AS user_profile ON (user_profile.user_id = album.user_id)'; } if ($fetchOptions['join'] & self::FETCH_USER_OPTION) { $selectFields .= ', user_option.*'; $joinTables .= ' LEFT JOIN xf_user_option AS user_option ON (user_option.user_id = album.user_id)'; } } return array( 'selectFields' => $selectFields, 'joinTables' => $joinTables, 'orderClause' => ($orderBy ? "ORDER BY $orderBy" : '') ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _preparePaidContentItemFetchOptions(array &$fetchOptions, &$selectFields, &$joinTables, &$orderBy)\r\n {\r\n }", "public function basic_join_setup()\r\n {\r\n \r\n }", "abstract protected function _manageFetchOptions($select, $options);", "public function getFetchJoinCollection()\n {\n $this->fetchJoinCollection;\n }", "public function preparePaidContentItemFetchOptions(array &$fetchOptions)\r\n {\r\n $selectFields = '';\r\n $joinTables = '';\r\n $orderBy = 'paid_content.priority ASC,\r\n paid_content.end_date = 0,\r\n paid_content.end_date ASC,\r\n paid_content.start_date = 0,\r\n paid_content.start_date ASC';\r\n \r\n $this->_preparePaidContentItemFetchOptions($fetchOptions, $selectFields, $joinTables, $orderBy);\r\n \r\n return array(\r\n 'selectFields' => $selectFields,\r\n 'joinTables' => $joinTables,\r\n 'orderClause' => ($orderBy ? \"ORDER BY $orderBy\" : '')\r\n );\r\n }", "protected function _getFetchJoins() {\n\t\treturn 'LEFT JOIN series se ON se.series_id = s.series_id\n\t\t\tLEFT JOIN series_settings stpl ON (se.series_id = stpl.series_id AND stpl.setting_name = ? AND stpl.locale = ?)\n\t\t\tLEFT JOIN series_settings stl ON (se.series_id = stl.series_id AND stl.setting_name = ? AND stl.locale = ?)\n\t\t\tLEFT JOIN series_settings sapl ON (se.series_id = sapl.series_id AND sapl.setting_name = ? AND sapl.locale = ?)\n\t\t\tLEFT JOIN series_settings sal ON (se.series_id = sal.series_id AND sal.setting_name = ? AND sal.locale = ?)';\n\t}", "private function _hookup_joins($include_phone=FALSE)\n {\n $select = TBL_HOOKUPS.'.*,';\n \n $select .= TBL_HOOKUP_REQUESTS.'.user_id,'; \n $select .= TBL_HOOKUP_REQUESTS.'.hookup_id,'; \n $select .= TBL_HOOKUP_REQUESTS.'.is_accepted,'; \n $select .= TBL_HOOKUP_REQUESTS.'.date_requested,'; \n\n $select .= TBL_PAYMENTS.'.*';\n\n $this->db->select($select);\n $this->db->from(TBL_HOOKUPS);\n $this->db->join(TBL_HOOKUP_REQUESTS,TBL_HOOKUPS.'.request_id = '.TBL_HOOKUP_REQUESTS.'.id');\n $this->db->join(TBL_PAYMENTS,TBL_HOOKUPS.'.payment_id = '.TBL_PAYMENTS.'.id');\n }", "function joinQuery()\n {\n }", "public function beforeFetch(array &$args) {\n $select = $args[1];\n $this->addOrderClause($select);\n }", "function dt_core_join_left_filter( $parts ) {\n\tif( isset($parts['join']) && !empty($parts['join']) ) {\n\t\t$parts['join'] = str_replace( 'INNER', 'LEFT', $parts['join']);\n\t}\n\treturn $parts;\n}", "function contentjoiner($what, $from, $contenttojoin, $rid){\n\t$sql='SELECT ids.*';\n\t//everything is connected to a story\n\tif($what=='all' || $what=='stories' || ($what=='tags' && $from!='story' && $from!='comment') || ($what=='comments' && $from!='story' && $from!='comment')){\n\t\t$sql=<<<SQL\n\t\t\t$sql, stories.CreationTime AS SCreation, stories.LastActionTime AS SAction, stories.URL,\n\t\t\tstories.Title, stories.InternalLink,\tstories.TheText AS SText, stories.Extra,\n\t\t\tstories.Privacy AS SPrivacy, stories.NSFW AS SNSFW, sauth.DisplayName AS SDName, sauth.UserName AS SUName\nSQL;\n\t\tif($rid){\n\t\t\t$sql.=', svotes.Sig AS SSig';\n\t\t\tif($_SESSION['IsFollowing'])$sql.=', sfollow.following AS SF';\n\t\t}//end rid\n\t}//end all stories tags....\n\t//do the comments if we need to \n\tif($what=='all' || $what=='comments'){\n\t\t$sql=<<<SQL\n\t\t\t$sql, comments.CreationTime AS CCreation, comments.LastActionTime AS CAction, commenttext.TheText AS CText,\n\t\t\tcomments.Privacy AS CPrivacy, comments.NSFW AS CNSFW, cauth.DisplayName AS CDName, cauth.UserName AS CUName \nSQL;\n\t\tif($rid){\n\t\t\t$sql.=', cvotes.Sig AS CSig';\n\t\t\tif($_SESSION['IsFollowing'])$sql.=', cfollow.Following AS CF';\n\t\t}//end rid\n\t}//end all comments\n\n\t//We've got the initial select statememt now lets get the from information\n\t$sql.=\" FROM ($contenttojoin) AS ids \";\n\n\tif($what=='all' || $what=='stories' || ($what=='tags' && $from!='story' && $from!='comment') || ($what=='comments' && $from!='story' && $from!='comment')){\n\t\t$sql.=<<<SQL\n\t\t\tLEFT JOIN stories ON stories.ID = ids.SID\n\t\t\tLEFT JOIN users AS sauth ON sauth.ID = stories.UserID \nSQL;\n\t\tif($rid){\n\t\t\t$sql.=<<<SQL\n\t\t\t\tLEFT JOIN (SELECT *\n\t\t\t\tFROM votes\n\t\t\t\tWHERE votes.UserID = $rid AND ContentType=0) AS svotes ON svotes.ContentID = stories.ID \nSQL;\n\t\t\tif($_SESSION['IsFollowing']){\n\t\t\t\t$sql.=<<<SQL\n\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\tSELECT FollowedID, 1 AS Following\n\t\t\t\t\t\tFROM following\n\t\t\t\t\t\tWHERE FollowerID = $rid\n\t\t\t\t\t) AS sfollow ON sfollow.FollowedID = stories.UserID \nSQL;\n\t\t\t}//end $_SESSION\n\t\t}//end rid\n\t}//end all stories\n\tif($what=='all' || $what=='comments'){\n\t\t$sql.=<<<SQL\n\t\t\tLEFT JOIN comments ON comments.ID = ids.CID\n\t\t\tLEFT JOIN users AS cauth on cauth.ID = comments.UserID\n\t\t\tLEFT JOIN commenttext ON commenttext.ID = comments.ID \nSQL;\n\t\tif($rid){\n\t\t\t$sql.=<<<SQL\n\t\t\t\tLEFT JOIN (\n\t\t\t\t\tSELECT *\n\t\t\t\t\tFROM votes\n\t\t\t\t\tWHERE votes.UserID = $rid AND ContentType=1) AS cvotes ON cvotes.ContentID = comments.ID \nSQL;\n\t\t\tif($_SESSION['IsFollowing']){\n\t\t\t\t$sql.=<<<SQL\n\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\tSELECT FollowedID, 1 AS Following\n\t\t\t\t\t\tFROM following\n\t\t\t\t\t\tWHERE FollowerID = $rid) AS cfollow ON cfollow.FollowedID = comments.UserID \nSQL;\n\t\t\t}//end $_SESSION\n\t\t}//end rid\n\t}//end all comments\n\n\treturn $sql;\n}", "protected function _preSaveRelatedRecords(AdapterInterface $connection, $related) {}", "private function set_relation_joins() {\n if(!$this->use_relations) return;\n $relations = [];\n foreach ($this->colmodel as $i => $col) {\n if (!isset($col['relation']))\n continue;\n foreach (explode('>', $col['relation']) as $relation) {\n if (!str_contains($relation, '.'))\n continue;\n list($model_name, $relation_name) = explode('.', $relation);\n if ($relation_name != '' && !in_array($relation, $relations)) {\n $this->set_relation_join($model_name, $relation_name);\n $relations[] = $relation;\n }\n }\n }\n }", "public function fetchJoinList($join=null, $where=null, $order=null, $count=null, $offset=null)\n {\n $select = $this->getDbTable()->getAdapter()->select()\n ->from(array('table1' => 'link'),\n array('id' => 'table1.id',\n 'nome' => 'table1.nome' ,\n 'descricao' => 'table1.descricao' ,\n 'url' => 'table1.url' ,\n 'validadeInicio' => 'table1.validade_inicio' ,\n 'validadeTermino' => 'table1.validade_termino' ,\n 'dataDesativacao' => 'table1.data_desativacao' ,\n 'dataAutoReativar' => 'table1.data_auto_reativar' ,\n 'motivoDesativacao' => 'table1.motivo_desativacao' ,\n 'menu' => 'table1.menu)' ,\n 'rowinfo' => 'table1.rowinfo' ))\n ->joinInner($join[0])\n ->where($where)\n ->order($order)\n ->limit($count, $offset);\n $stmt = $this->getDbTable()->getAdapter()->query($select);\n $resultSet = $stmt->fetchAll();\n $entries = array();\n foreach ($resultSet as $row) \n {\n $entry = new GC_Model_Link();\n $entry->setId($row['id'])\n ->setNome($row['nome'])\n ->setDescricao($row['descricao'])\n ->setUrl($row['url'])\n ->setValidadeInicio($row['validade_inicio'])\n ->setValidadeTermino($row['validade_termino'])\n ->setDataDesativacao($row['data_desativacao'])\n ->setDataAutoReativar($row['data_auto_reativar'])\n ->setMotivoDesativacao($row['motivo_desativacao'])\n ->setMenu($row['menu'])\n ->setRowinfo($row['rowinfo'])\n ->setMapper($this);\n $entries[] = $entry;\n \n }\n return $entries;\n }", "public function posts_join_request( $join ) {\n global $wpdb;\n\n $join .= \" inner join {$wpdb->postmeta} as metalat on {$wpdb->posts}.ID = metalat.post_id and metalat.meta_key = 'dokan_geo_latitude'\";\n $join .= \" inner join {$wpdb->postmeta} as metalong on {$wpdb->posts}.ID = metalong.post_id and metalong.meta_key = 'dokan_geo_longitude'\";\n $join .= \" inner join {$wpdb->postmeta} as metaaddr on {$wpdb->posts}.ID = metaaddr.post_id and metaaddr.meta_key = 'dokan_geo_address'\";\n\n remove_filter( 'posts_join_request', array( $this, 'posts_join_request' ) );\n\n return $join;\n }", "protected function _buildListJoin($options)\n\t{\n\t\t$join = array();\n\n\t\t// get the layout option from params\n\t\t$layout = $this->_getOption('layout', $options);\n\t\t$getMetaData = $this->_getOption('getMetaData', $options, false);\n\t\t$getPageId = $this->_getOption('getPageId', $options, false);\n\t\t$simpleUrlList = $this->_getOption('simpleUrlList', $options, false);\n\n\t\tif ($simpleUrlList)\n\t\t{\n\t\t\tif ($getPageId)\n\t\t\t{\n\t\t\t\t$join[] = 'left join ' . $this->_db->quoteName('#__sh404sef_urls') . ' as u1 on p.newurl=u1.newurl';\n\t\t\t}\n\t\t\telse if ($getMetaData)\n\t\t\t{\n\t\t\t\t$join[] = 'left join ' . $this->_db->quoteName('#__sh404sef_metas') . ' as m on m.newurl=u1.newurl';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// various cases of layouts\n\t\t\tswitch ($layout)\n\t\t\t{\n\t\t\t\tcase 'view404':\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$join[] = 'left join ' . $this->_db->quoteName('#__sh404sef_metas') . ' as m on m.newurl=u1.newurl';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// aggregate clauses\n\t\t$join = (count($join) ? ' ' . implode(' ', $join) : '');\n\n\t\treturn $join;\n\t}", "private function prepare()\n {\n $this->selectFields[$this->tableName][] = $this->rootEntityIdentifier;\n\n $sColumns = explode(',', $this->requestParams['sColumns']);\n\n for ($i = 0; $i < $this->iColumns; $i++) {\n\n if ($this->requestParams['mDataProp_' . $i] != null) {\n\n $field = $this->requestParams['mDataProp_' . $i];\n\n if ($sColumns[$i] != '') {\n if ($field != $sColumns[$i]) {\n $field = $sColumns[$i];\n }\n }\n\n // association delimiter found\n if (strstr($field, '.') !== false) {\n\n // separate fields\n $fieldsArray = explode('.', $field);\n // set associations in selectFields[]\n $this->setAssociations($fieldsArray, 0, $this->metadata);\n\n } else {\n\n // no association found\n if ($field !== $this->rootEntityIdentifier) {\n array_push($this->selectFields[$this->tableName], $field);\n }\n\n $this->allFields[] = $this->tableName . '.' . $field;\n\n }\n\n } else {\n\n $this->allFields[] = '';\n\n }\n }\n\n return $this;\n }", "private function makeJoins(ParseLoop $parse, $join)\n {\n $model = ModelTools::buildModelName($join['REFERENCED_TABLE_NAME']);\n $parse->setData('joins', [\n 'tablejoin' => $model,\n 'table' => $model . '::TABLE',\n 'leftcol' => $this->classname . '::' . ModelTools::getFieldConstant($this->table, $join['COLUMN_NAME']),\n 'rightcol' => $model . '::' . ModelTools::getFieldConstant($join['REFERENCED_TABLE_NAME'], $join['REFERENCED_COLUMN_NAME'])\n \n ]);\n }", "function carton_exclude_order_comments_from_feed_join( $join ) {\n\tglobal $wpdb;\n\n if ( ! $join )\n \t$join = \" LEFT JOIN $wpdb->posts ON $wpdb->comments.\\\"comment_post_ID\\\" = $wpdb->posts.\\\"ID\\\" \";\n\n return $join;\n}", "public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\t\t$criteria = clone $criteria;\n\n\t\t// Set the correct dbName if it has not been overridden\n\t\tif ($criteria->getDbName() == Propel::getDefaultDB()) {\n\t\t\t$criteria->setDbName(self::DATABASE_NAME);\n\t\t}\n\n\t\tTbprofessorPeer::addSelectColumns($criteria);\n\t\t$startcol2 = (TbprofessorPeer::NUM_COLUMNS - TbprofessorPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbnecesespecialPeer::addSelectColumns($criteria);\n\t\t$startcol3 = $startcol2 + (TbnecesespecialPeer::NUM_COLUMNS - TbnecesespecialPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbcursoPeer::addSelectColumns($criteria);\n\t\t$startcol4 = $startcol3 + (TbcursoPeer::NUM_COLUMNS - TbcursoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbproftipovinculoPeer::addSelectColumns($criteria);\n\t\t$startcol5 = $startcol4 + (TbproftipovinculoPeer::NUM_COLUMNS - TbproftipovinculoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbformacaoPeer::addSelectColumns($criteria);\n\t\t$startcol6 = $startcol5 + (TbformacaoPeer::NUM_COLUMNS - TbformacaoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbprofessorsituacaoPeer::addSelectColumns($criteria);\n\t\t$startcol7 = $startcol6 + (TbprofessorsituacaoPeer::NUM_COLUMNS - TbprofessorsituacaoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbsetorPeer::addSelectColumns($criteria);\n\t\t$startcol8 = $startcol7 + (TbsetorPeer::NUM_COLUMNS - TbsetorPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_NECES_ESPECIAL, TbnecesespecialPeer::ID_NECES_ESPECIAL, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::COD_CURSO, TbcursoPeer::COD_CURSO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_TIPO_VINCULO, TbproftipovinculoPeer::ID_TIPO_VINCULO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_FORMACAO, TbformacaoPeer::ID_FORMACAO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_PROF_SIT, TbprofessorsituacaoPeer::ID_SITUACAO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_SETOR, TbsetorPeer::ID_SETOR, $join_behavior);\n\n\t\t// symfony_behaviors behavior\n\t\tforeach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook)\n\t\t{\n\t\t call_user_func($sf_hook, 'BaseTbprofessorPeer', $criteria, $con);\n\t\t}\n\n\t\t$stmt = BasePeer::doSelect($criteria, $con);\n\t\t$results = array();\n\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$key1 = TbprofessorPeer::getPrimaryKeyHashFromRow($row, 0);\n\t\t\tif (null !== ($obj1 = TbprofessorPeer::getInstanceFromPool($key1))) {\n\t\t\t\t// We no longer rehydrate the object, since this can cause data loss.\n\t\t\t\t// See http://propel.phpdb.org/trac/ticket/509\n\t\t\t\t// $obj1->hydrate($row, 0, true); // rehydrate\n\t\t\t} else {\n\t\t\t\t$cls = TbprofessorPeer::getOMClass(false);\n\n\t\t\t\t$obj1 = new $cls();\n\t\t\t\t$obj1->hydrate($row);\n\t\t\t\tTbprofessorPeer::addInstanceToPool($obj1, $key1);\n\t\t\t} // if obj1 already loaded\n\n\t\t\t// Add objects for joined Tbnecesespecial rows\n\n\t\t\t$key2 = TbnecesespecialPeer::getPrimaryKeyHashFromRow($row, $startcol2);\n\t\t\tif ($key2 !== null) {\n\t\t\t\t$obj2 = TbnecesespecialPeer::getInstanceFromPool($key2);\n\t\t\t\tif (!$obj2) {\n\n\t\t\t\t\t$cls = TbnecesespecialPeer::getOMClass(false);\n\n\t\t\t\t\t$obj2 = new $cls();\n\t\t\t\t\t$obj2->hydrate($row, $startcol2);\n\t\t\t\t\tTbnecesespecialPeer::addInstanceToPool($obj2, $key2);\n\t\t\t\t} // if obj2 loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj2 (Tbnecesespecial)\n\t\t\t\t$obj2->addTbprofessor($obj1);\n\t\t\t} // if joined row not null\n\n\t\t\t// Add objects for joined Tbcurso rows\n\n\t\t\t$key3 = TbcursoPeer::getPrimaryKeyHashFromRow($row, $startcol3);\n\t\t\tif ($key3 !== null) {\n\t\t\t\t$obj3 = TbcursoPeer::getInstanceFromPool($key3);\n\t\t\t\tif (!$obj3) {\n\n\t\t\t\t\t$cls = TbcursoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj3 = new $cls();\n\t\t\t\t\t$obj3->hydrate($row, $startcol3);\n\t\t\t\t\tTbcursoPeer::addInstanceToPool($obj3, $key3);\n\t\t\t\t} // if obj3 loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj3 (Tbcurso)\n\t\t\t\t$obj3->addTbprofessor($obj1);\n\t\t\t} // if joined row not null\n\n\t\t\t// Add objects for joined Tbproftipovinculo rows\n\n\t\t\t$key4 = TbproftipovinculoPeer::getPrimaryKeyHashFromRow($row, $startcol4);\n\t\t\tif ($key4 !== null) {\n\t\t\t\t$obj4 = TbproftipovinculoPeer::getInstanceFromPool($key4);\n\t\t\t\tif (!$obj4) {\n\n\t\t\t\t\t$cls = TbproftipovinculoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj4 = new $cls();\n\t\t\t\t\t$obj4->hydrate($row, $startcol4);\n\t\t\t\t\tTbproftipovinculoPeer::addInstanceToPool($obj4, $key4);\n\t\t\t\t} // if obj4 loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj4 (Tbproftipovinculo)\n\t\t\t\t$obj4->addTbprofessor($obj1);\n\t\t\t} // if joined row not null\n\n\t\t\t// Add objects for joined Tbformacao rows\n\n\t\t\t$key5 = TbformacaoPeer::getPrimaryKeyHashFromRow($row, $startcol5);\n\t\t\tif ($key5 !== null) {\n\t\t\t\t$obj5 = TbformacaoPeer::getInstanceFromPool($key5);\n\t\t\t\tif (!$obj5) {\n\n\t\t\t\t\t$cls = TbformacaoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj5 = new $cls();\n\t\t\t\t\t$obj5->hydrate($row, $startcol5);\n\t\t\t\t\tTbformacaoPeer::addInstanceToPool($obj5, $key5);\n\t\t\t\t} // if obj5 loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj5 (Tbformacao)\n\t\t\t\t$obj5->addTbprofessor($obj1);\n\t\t\t} // if joined row not null\n\n\t\t\t// Add objects for joined Tbprofessorsituacao rows\n\n\t\t\t$key6 = TbprofessorsituacaoPeer::getPrimaryKeyHashFromRow($row, $startcol6);\n\t\t\tif ($key6 !== null) {\n\t\t\t\t$obj6 = TbprofessorsituacaoPeer::getInstanceFromPool($key6);\n\t\t\t\tif (!$obj6) {\n\n\t\t\t\t\t$cls = TbprofessorsituacaoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj6 = new $cls();\n\t\t\t\t\t$obj6->hydrate($row, $startcol6);\n\t\t\t\t\tTbprofessorsituacaoPeer::addInstanceToPool($obj6, $key6);\n\t\t\t\t} // if obj6 loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj6 (Tbprofessorsituacao)\n\t\t\t\t$obj6->addTbprofessor($obj1);\n\t\t\t} // if joined row not null\n\n\t\t\t// Add objects for joined Tbsetor rows\n\n\t\t\t$key7 = TbsetorPeer::getPrimaryKeyHashFromRow($row, $startcol7);\n\t\t\tif ($key7 !== null) {\n\t\t\t\t$obj7 = TbsetorPeer::getInstanceFromPool($key7);\n\t\t\t\tif (!$obj7) {\n\n\t\t\t\t\t$cls = TbsetorPeer::getOMClass(false);\n\n\t\t\t\t\t$obj7 = new $cls();\n\t\t\t\t\t$obj7->hydrate($row, $startcol7);\n\t\t\t\t\tTbsetorPeer::addInstanceToPool($obj7, $key7);\n\t\t\t\t} // if obj7 loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj7 (Tbsetor)\n\t\t\t\t$obj7->addTbprofessor($obj1);\n\t\t\t} // if joined row not null\n\n\t\t\t$results[] = $obj1;\n\t\t}\n\t\t$stmt->closeCursor();\n\t\treturn $results;\n\t}", "public function fetchJoinThreeAdoptedDesc($table, $join = NULL, $on = NULL, $join2 = NULL, $on2 = NULL, $where = NULL) {\n if (!empty($where)) {\n $this->db->where($where);\n }\n if (!(empty($join) || empty($on))) {\n $this->db->join($join, $on, \"left outer\");\n }\n if (!(empty($join2) || empty($on2))) {\n $this->db->join($join2, $on2, \"left outer\");\n }\n $this->db->order_by('adoption_adopted_at', 'desc');\n $query = $this->db->get($table);\n return ($query->num_rows() > 0 ) ? $query->result() : FALSE;\n }", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "public function loadRelated()\n {\n return;\n }", "function kvell_edge_woocommerce_related_products_args( $args ) {\n\t\t$related = kvell_edge_options()->getOptionValue( 'edgtf_woo_related_products_columns' );\n\t\t\n\t\tif ( ! empty( $related ) ) {\n\t\t\tswitch ( $related ) {\n\t\t\t\tcase 'edgtf-woocommerce-columns-4':\n\t\t\t\t\t$args['posts_per_page'] = 4;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'edgtf-woocommerce-columns-3':\n\t\t\t\t\t$args['posts_per_page'] = 3;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$args['posts_per_page'] = 3;\n\t\t\t}\n\t\t} else {\n\t\t\t$args['posts_per_page'] = 4;\n\t\t}\n\t\t\n\t\treturn $args;\n\t}", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "private function _set_relationships()\n {\n if(empty($this->_relationships))\n {\n $options = array('has_one','has_many','has_many_pivot');\n foreach($options as $option)\n {\n if(isset($this->{$option}) && !empty($this->{$option}))\n {\n foreach($this->{$option} as $key => $relation)\n {\n $foreign_model = (is_array($relation)) ? $relation[0] : $relation;\n $foreign_model_name = strtolower($foreign_model);\n $this->load->model($foreign_model_name);\n $foreign_table = $this->{$foreign_model_name}->table;\n if($option=='has_many_pivot')\n {\n $tables = array($this->table, $foreign_table);\n sort($tables);\n $pivot_table = $tables[0].'_'.$tables[1];\n $foreign_key = (is_array($relation)) ? $relation[1] : $this->{$foreign_model_name}->primary;\n $local_key = (is_array($relation) && isset($relation[2])) ? $relation[2] : $this->primary;\n }\n else\n {\n $foreign_key = (is_array($relation)) ? $relation[1] : singular($this->table) . '_id';\n $local_key = (is_array($relation) && isset($relation[2])) ? $relation[2] : $this->primary;\n }\n $this->_relationships[$key] = array('relation' => $option, 'relation_key' => $key, 'foreign_model' => $foreign_model_name, 'foreign_table' => $foreign_table, 'foreign_key' => $foreign_key, 'local_key' => $local_key);\n ($option == 'has_many_pivot') ? ($this->_relationships[$key]['pivot_table'] = $pivot_table) : FALSE;\n\n }\n }\n }\n }\n }", "function setExtraJoins($extraJoins) {\n $this->extraJoins = $extraJoins;\n }", "function build_context_rel() {\n \n global $db;\n $savedb = $db->debug;\n \n // total number of records\n $total = count_records('context');\n // processed records\n $done = 0;\n print_progress($done, $total, 10, 0, 'Processing context relations');\n $db->debug = false;\n if ($contexts = get_records('context')) {\n foreach ($contexts as $context) {\n // no need to delete because it's all empty\n insert_context_rel($context, false, false);\n $db->debug = true;\n print_progress(++$done, $total, 10, 0, 'Processing context relations');\n $db->debug = false;\n }\n }\n \n $db->debug = $savedb;\n}", "function test_getJoin()\n {\n $question = new MDB_QT(TABLE_QUESTION);\n $joinOn1 = TABLE_QUESTION.'.id='.TABLE_ANSWER.'.question_id';\n $question->setJoin(TABLE_ANSWER, $joinOn1);\n\n $all = array(\n 'default' => array(TABLE_ANSWER => $joinOn1),\n );\n $tables = array(TABLE_ANSWER);\n $right = array();\n $left = array();\n\n $this->assertEqual($all, $question->getJoin());\n $this->assertEqual($tables, $question->getJoin('tables'));\n $this->assertEqual($right, $question->getJoin('right'));\n $this->assertEqual($left, $question->getJoin('left'));\n\n //--------------------------------------------------------\n\n $joinOn2 = TABLE_USER.'.id='.TABLE_ANSWER.'.question_id';\n $question->setRightJoin(TABLE_USER, $joinOn2);\n\n $all = array(\n 'default' => array(TABLE_ANSWER => $joinOn1),\n 'right' => array(TABLE_USER => $joinOn2),\n );\n $tables = array(TABLE_ANSWER, TABLE_USER);\n $right = array(TABLE_USER => $joinOn2);\n $left = array();\n\n $this->assertEqual($all, $question->getJoin());\n $this->assertEqual($tables, $question->getJoin('tables'));\n $this->assertEqual($right, $question->getJoin('right'));\n $this->assertEqual($left, $question->getJoin('left'));\n }", "public function joinFields()\n {\n if (!$this->_joinedFields) {\n $this->getSelect()->join(\n array('related' => $this->getTable('oggetto_news/category_news')),\n 'related.news_id = main_table.entity_id',\n array('position')\n );\n $this->_joinedFields = true;\n }\n return $this;\n }", "public function initialize()\n {\n $this->belongsTo(\n 'users_id',\n Users::class,\n 'id',\n ['alias' => 'user']\n );\n\n $this->belongsTo(\n 'companies_id',\n Companies::class,\n 'id',\n ['alias' => 'company']\n );\n\n $this->setSource('users_associated_company');\n }", "protected function setupPdoQueries()\n {\n $this->conf['select-user'] = sprintf('\n\t\t\tSELECT username as user, name, email as mail, password as hash, id as uid\n\t\t\tFROM %s WHERE username = :user',\n $this->getTableName('users'));\n\n $this->conf['select-user-groups'] = sprintf('\n\t\t\tSELECT title as `group` FROM %s as groups\n\t\t\tLEFT JOIN %s as groupmap ON groups.id = groupmap.group_id\n\t\t\tLEFT JOIN %s as user ON groupmap.user_id = user.id\n\t\t\tWHERE user.username = :user OR user.id = :uid ',\n $this->getTableName('usergroups'),\n $this->getTableName('user_usergroup_map'),\n $this->getTableName('users'));\n\n $this->conf['select-groups'] = sprintf('\n\t\t\tSELECT title as `group`, id as gid FROM %s',\n $this->getTableName('usergroups'));\n }", "protected abstract function prepareConstructOption($options);", "public function prev_next_join( $join ) {\n\t\tglobal $wpdb;\n\t\t$join .= \" LEFT JOIN $wpdb->postmeta AS m ON ( p.ID = m.post_id AND m.meta_key = 'wpex_post_link' )\";\n\t\treturn $join;\n\t}", "public function initOptions()\n {\n $this->setOption('className', '%CLASS%' . $this->getRelationName());\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('solutionpartner/partner')->getCollection();\n $collection->getSelect()->joinLeft(\n array('order' => $collection->getTable('sales/order')),\n 'main_table.email = order.customer_email AND order.status = \"complete\"',\n array(\n 'order_id' => 'entity_id',\n 'order_status' => 'order.status',\n 'number_qtys' => 'count(order.entity_id)'\n ))\n ->group('main_table.solutionpartner_id');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function joinResources()\n {\n $this->builder->join('resources', 'rs_id', '=', 'add_resource');\n }", "public static function doSelectJoinAllExceptTbsetor(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\t\t$criteria = clone $criteria;\n\n\t\t// Set the correct dbName if it has not been overridden\n\t\t// $criteria->getDbName() will return the same object if not set to another value\n\t\t// so == check is okay and faster\n\t\tif ($criteria->getDbName() == Propel::getDefaultDB()) {\n\t\t\t$criteria->setDbName(self::DATABASE_NAME);\n\t\t}\n\n\t\tTbprofessorPeer::addSelectColumns($criteria);\n\t\t$startcol2 = (TbprofessorPeer::NUM_COLUMNS - TbprofessorPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbnecesespecialPeer::addSelectColumns($criteria);\n\t\t$startcol3 = $startcol2 + (TbnecesespecialPeer::NUM_COLUMNS - TbnecesespecialPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbcursoPeer::addSelectColumns($criteria);\n\t\t$startcol4 = $startcol3 + (TbcursoPeer::NUM_COLUMNS - TbcursoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbproftipovinculoPeer::addSelectColumns($criteria);\n\t\t$startcol5 = $startcol4 + (TbproftipovinculoPeer::NUM_COLUMNS - TbproftipovinculoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbformacaoPeer::addSelectColumns($criteria);\n\t\t$startcol6 = $startcol5 + (TbformacaoPeer::NUM_COLUMNS - TbformacaoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbprofessorsituacaoPeer::addSelectColumns($criteria);\n\t\t$startcol7 = $startcol6 + (TbprofessorsituacaoPeer::NUM_COLUMNS - TbprofessorsituacaoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_NECES_ESPECIAL, TbnecesespecialPeer::ID_NECES_ESPECIAL, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::COD_CURSO, TbcursoPeer::COD_CURSO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_TIPO_VINCULO, TbproftipovinculoPeer::ID_TIPO_VINCULO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_FORMACAO, TbformacaoPeer::ID_FORMACAO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_PROF_SIT, TbprofessorsituacaoPeer::ID_SITUACAO, $join_behavior);\n\n\t\t// symfony_behaviors behavior\n\t\tforeach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook)\n\t\t{\n\t\t call_user_func($sf_hook, 'BaseTbprofessorPeer', $criteria, $con);\n\t\t}\n\n\n\t\t$stmt = BasePeer::doSelect($criteria, $con);\n\t\t$results = array();\n\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$key1 = TbprofessorPeer::getPrimaryKeyHashFromRow($row, 0);\n\t\t\tif (null !== ($obj1 = TbprofessorPeer::getInstanceFromPool($key1))) {\n\t\t\t\t// We no longer rehydrate the object, since this can cause data loss.\n\t\t\t\t// See http://propel.phpdb.org/trac/ticket/509\n\t\t\t\t// $obj1->hydrate($row, 0, true); // rehydrate\n\t\t\t} else {\n\t\t\t\t$cls = TbprofessorPeer::getOMClass(false);\n\n\t\t\t\t$obj1 = new $cls();\n\t\t\t\t$obj1->hydrate($row);\n\t\t\t\tTbprofessorPeer::addInstanceToPool($obj1, $key1);\n\t\t\t} // if obj1 already loaded\n\n\t\t\t\t// Add objects for joined Tbnecesespecial rows\n\n\t\t\t\t$key2 = TbnecesespecialPeer::getPrimaryKeyHashFromRow($row, $startcol2);\n\t\t\t\tif ($key2 !== null) {\n\t\t\t\t\t$obj2 = TbnecesespecialPeer::getInstanceFromPool($key2);\n\t\t\t\t\tif (!$obj2) {\n\t\n\t\t\t\t\t\t$cls = TbnecesespecialPeer::getOMClass(false);\n\n\t\t\t\t\t$obj2 = new $cls();\n\t\t\t\t\t$obj2->hydrate($row, $startcol2);\n\t\t\t\t\tTbnecesespecialPeer::addInstanceToPool($obj2, $key2);\n\t\t\t\t} // if $obj2 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj2 (Tbnecesespecial)\n\t\t\t\t$obj2->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbcurso rows\n\n\t\t\t\t$key3 = TbcursoPeer::getPrimaryKeyHashFromRow($row, $startcol3);\n\t\t\t\tif ($key3 !== null) {\n\t\t\t\t\t$obj3 = TbcursoPeer::getInstanceFromPool($key3);\n\t\t\t\t\tif (!$obj3) {\n\t\n\t\t\t\t\t\t$cls = TbcursoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj3 = new $cls();\n\t\t\t\t\t$obj3->hydrate($row, $startcol3);\n\t\t\t\t\tTbcursoPeer::addInstanceToPool($obj3, $key3);\n\t\t\t\t} // if $obj3 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj3 (Tbcurso)\n\t\t\t\t$obj3->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbproftipovinculo rows\n\n\t\t\t\t$key4 = TbproftipovinculoPeer::getPrimaryKeyHashFromRow($row, $startcol4);\n\t\t\t\tif ($key4 !== null) {\n\t\t\t\t\t$obj4 = TbproftipovinculoPeer::getInstanceFromPool($key4);\n\t\t\t\t\tif (!$obj4) {\n\t\n\t\t\t\t\t\t$cls = TbproftipovinculoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj4 = new $cls();\n\t\t\t\t\t$obj4->hydrate($row, $startcol4);\n\t\t\t\t\tTbproftipovinculoPeer::addInstanceToPool($obj4, $key4);\n\t\t\t\t} // if $obj4 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj4 (Tbproftipovinculo)\n\t\t\t\t$obj4->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbformacao rows\n\n\t\t\t\t$key5 = TbformacaoPeer::getPrimaryKeyHashFromRow($row, $startcol5);\n\t\t\t\tif ($key5 !== null) {\n\t\t\t\t\t$obj5 = TbformacaoPeer::getInstanceFromPool($key5);\n\t\t\t\t\tif (!$obj5) {\n\t\n\t\t\t\t\t\t$cls = TbformacaoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj5 = new $cls();\n\t\t\t\t\t$obj5->hydrate($row, $startcol5);\n\t\t\t\t\tTbformacaoPeer::addInstanceToPool($obj5, $key5);\n\t\t\t\t} // if $obj5 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj5 (Tbformacao)\n\t\t\t\t$obj5->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbprofessorsituacao rows\n\n\t\t\t\t$key6 = TbprofessorsituacaoPeer::getPrimaryKeyHashFromRow($row, $startcol6);\n\t\t\t\tif ($key6 !== null) {\n\t\t\t\t\t$obj6 = TbprofessorsituacaoPeer::getInstanceFromPool($key6);\n\t\t\t\t\tif (!$obj6) {\n\t\n\t\t\t\t\t\t$cls = TbprofessorsituacaoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj6 = new $cls();\n\t\t\t\t\t$obj6->hydrate($row, $startcol6);\n\t\t\t\t\tTbprofessorsituacaoPeer::addInstanceToPool($obj6, $key6);\n\t\t\t\t} // if $obj6 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj6 (Tbprofessorsituacao)\n\t\t\t\t$obj6->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t$results[] = $obj1;\n\t\t}\n\t\t$stmt->closeCursor();\n\t\treturn $results;\n\t}", "public function onSelectPrefetchAllData();", "function getJoinCondition() ;", "protected function _prepareCollection() {\n $collection = Config::get()->collectionTransaction();\n $asTrnx = 'main_table';\n $collection->addFieldToSelect(Transaction::ATTR_ID, self::AS_TRAN_ID);\n $collection->addFieldToSelect(Transaction::ATTR_DATE_APPLIED, self::AS_DATE_APPLIED);\n $collection->addFieldToSelect(Transaction::ATTR_VALUE, self::AS_VALUE);\n /* LEFT JOIN prxgt_bonus_operation oper ON trnx.operation_id = oper.id */\n $asOper = 'oper';\n $tbl = array( $asOper => Config::ENTITY_OPERATION );\n $cond = $asTrnx . '.' . Transaction::ATTR_OPERATION_ID . '=' . $asOper . '.' . Operation::ATTR_ID;\n $cols = array(\n self::AS_OPER_ID => Operation::ATTR_ID,\n self::AS_DATE_PERFORMED => Operation::ATTR_DATE_PERFORMED\n );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_account credit ON trnx.credit_acc_id = credit.id */\n $asCredit = 'credit';\n $tbl = array( $asCredit => Config::ENTITY_ACCOUNT );\n $cond = $asTrnx . '.' . Transaction::ATTR_CREDIT_ACC_ID . '=' . $asCredit . '.' . Account::ATTR_ID;\n $cols = array();\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_account debit ON trnx.debit_acc_id = debit.id */\n $asDebit = 'debit';\n $tbl = array( $asDebit => Config::ENTITY_ACCOUNT );\n $cond = $asTrnx . '.' . Transaction::ATTR_DEBIT_ACC_ID . '=' . $asDebit . '.' . Account::ATTR_ID;\n $cols = array();\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN customer_entity custCred ON credit.customer_id = custCred.entity_id */\n $asCreditCust = 'creditCust';\n $tbl = array( $asCreditCust => 'customer/entity' );\n $cond = $asCredit . '.' . Account::ATTR_CUSTOMER_ID . '=' . $asCreditCust . '.' . Eav::DEFAULT_ENTITY_ID_FIELD;\n $cols = array( self::AS_CREDIT_CUST => ConfigCore::ATTR_CUST_MLM_ID );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN customer_entity custDeb ON debit.customer_id = custDeb.entity_id */\n $asDebitCust = 'debitCust';\n $tbl = array( $asDebitCust => 'customer/entity' );\n $cond = $asDebit . '.' . Account::ATTR_CUSTOMER_ID . '=' . $asDebitCust . '.' . Eav::DEFAULT_ENTITY_ID_FIELD;\n $cols = array( self::AS_DEBIT_CUST => ConfigCore::ATTR_CUST_MLM_ID );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_type_asset asset ON credit.asset_id = asset.id */\n $asAsset = 'asset';\n $tbl = array( $asAsset => Config::ENTITY_TYPE_ASSET );\n $cond = $asCredit . '.' . Account::ATTR_ASSET_ID . '=' . $asAsset . '.' . TypeAsset::ATTR_ID;\n $cols = array( self::AS_ASSET_CODE => TypeAsset::ATTR_CODE );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_type_oper operType ON oper.type_id = operType.id */\n $asOperType = 'operType';\n $tbl = array( $asOperType => Config::ENTITY_TYPE_OPER );\n $cond = $asOper . '.' . Operation::ATTR_TYPE_ID . '=' . $asOperType . '.' . TypeOper::ATTR_ID;\n $cols = array( self::AS_OPER_CODE => TypeOper::ATTR_CODE );\n $collection->join($tbl, $cond, $cols);\n /* prepare collection */\n $sql = $collection->getSelectSql(true);\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "public function fetchJoin($jointable=null, $joinby, $where=null, $order=null)\n {\n $select = $this->getDbTable()->select();\n $select->join($jointable, $joinby, array());\n $select->where($where, array());\n $resultSet = $this->getDbTable()->fetchAll($select);\n $entries = array();\n foreach ($resultSet as $row)\n {\n $entry = new GC_Model_Link();\n $entry->setId($row->id)\n\t\t\t\t->setNome($row->nome)\n\t\t\t\t->setDescricao($row->descricao)\n\t\t\t\t->setUrl($row->url)\n\t\t\t\t->setValidadeInicio($row->validade_inicio)\n\t\t\t\t->setValidadeTermino($row->validade_termino)\n\t\t\t\t->setDataDesativacao($row->data_desativacao)\n\t\t\t\t->setDataAutoReativar($row->data_auto_reativar)\n\t\t\t\t->setMotivoDesativacao($row->motivo_desativacao)\n ->setMenu($row->menu)\n ->setRowinfo($row->rowinfo)\n ->setMapper($this);\n $entries[] = $entry;\n }\n return $entries;\n }", "public function isJoin() {\n return (0 < sizeof(array_keys($this->fetchmode, 'join')));\n }", "public static function add_wp_query_join( $join, $wp_query ) {\n\t\tglobal $wpdb;\n\n\t\t$search = $wp_query->get( 'search' );\n\t\tif ( $search ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->postmeta} AS attr_search_meta\n\t\t\t\t\t\tON {$wpdb->posts}.ID = attr_search_meta.post_id\n\t\t\t\t\t\tAND attr_search_meta.meta_key LIKE 'attribute_%' \";\n\t\t}\n\n\t\tif ( wc_product_sku_enabled() && ! strstr( $join, 'wc_product_meta_lookup' ) ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup\n\t\t\t\t\t\tON $wpdb->posts.ID = wc_product_meta_lookup.product_id \";\n\t\t}\n\n\t\treturn $join;\n\t}", "public static function doSelectJoinAllExceptTbcurso(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\t\t$criteria = clone $criteria;\n\n\t\t// Set the correct dbName if it has not been overridden\n\t\t// $criteria->getDbName() will return the same object if not set to another value\n\t\t// so == check is okay and faster\n\t\tif ($criteria->getDbName() == Propel::getDefaultDB()) {\n\t\t\t$criteria->setDbName(self::DATABASE_NAME);\n\t\t}\n\n\t\tTbprofessorPeer::addSelectColumns($criteria);\n\t\t$startcol2 = (TbprofessorPeer::NUM_COLUMNS - TbprofessorPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbnecesespecialPeer::addSelectColumns($criteria);\n\t\t$startcol3 = $startcol2 + (TbnecesespecialPeer::NUM_COLUMNS - TbnecesespecialPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbproftipovinculoPeer::addSelectColumns($criteria);\n\t\t$startcol4 = $startcol3 + (TbproftipovinculoPeer::NUM_COLUMNS - TbproftipovinculoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbformacaoPeer::addSelectColumns($criteria);\n\t\t$startcol5 = $startcol4 + (TbformacaoPeer::NUM_COLUMNS - TbformacaoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbprofessorsituacaoPeer::addSelectColumns($criteria);\n\t\t$startcol6 = $startcol5 + (TbprofessorsituacaoPeer::NUM_COLUMNS - TbprofessorsituacaoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbsetorPeer::addSelectColumns($criteria);\n\t\t$startcol7 = $startcol6 + (TbsetorPeer::NUM_COLUMNS - TbsetorPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_NECES_ESPECIAL, TbnecesespecialPeer::ID_NECES_ESPECIAL, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_TIPO_VINCULO, TbproftipovinculoPeer::ID_TIPO_VINCULO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_FORMACAO, TbformacaoPeer::ID_FORMACAO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_PROF_SIT, TbprofessorsituacaoPeer::ID_SITUACAO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_SETOR, TbsetorPeer::ID_SETOR, $join_behavior);\n\n\t\t// symfony_behaviors behavior\n\t\tforeach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook)\n\t\t{\n\t\t call_user_func($sf_hook, 'BaseTbprofessorPeer', $criteria, $con);\n\t\t}\n\n\n\t\t$stmt = BasePeer::doSelect($criteria, $con);\n\t\t$results = array();\n\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$key1 = TbprofessorPeer::getPrimaryKeyHashFromRow($row, 0);\n\t\t\tif (null !== ($obj1 = TbprofessorPeer::getInstanceFromPool($key1))) {\n\t\t\t\t// We no longer rehydrate the object, since this can cause data loss.\n\t\t\t\t// See http://propel.phpdb.org/trac/ticket/509\n\t\t\t\t// $obj1->hydrate($row, 0, true); // rehydrate\n\t\t\t} else {\n\t\t\t\t$cls = TbprofessorPeer::getOMClass(false);\n\n\t\t\t\t$obj1 = new $cls();\n\t\t\t\t$obj1->hydrate($row);\n\t\t\t\tTbprofessorPeer::addInstanceToPool($obj1, $key1);\n\t\t\t} // if obj1 already loaded\n\n\t\t\t\t// Add objects for joined Tbnecesespecial rows\n\n\t\t\t\t$key2 = TbnecesespecialPeer::getPrimaryKeyHashFromRow($row, $startcol2);\n\t\t\t\tif ($key2 !== null) {\n\t\t\t\t\t$obj2 = TbnecesespecialPeer::getInstanceFromPool($key2);\n\t\t\t\t\tif (!$obj2) {\n\t\n\t\t\t\t\t\t$cls = TbnecesespecialPeer::getOMClass(false);\n\n\t\t\t\t\t$obj2 = new $cls();\n\t\t\t\t\t$obj2->hydrate($row, $startcol2);\n\t\t\t\t\tTbnecesespecialPeer::addInstanceToPool($obj2, $key2);\n\t\t\t\t} // if $obj2 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj2 (Tbnecesespecial)\n\t\t\t\t$obj2->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbproftipovinculo rows\n\n\t\t\t\t$key3 = TbproftipovinculoPeer::getPrimaryKeyHashFromRow($row, $startcol3);\n\t\t\t\tif ($key3 !== null) {\n\t\t\t\t\t$obj3 = TbproftipovinculoPeer::getInstanceFromPool($key3);\n\t\t\t\t\tif (!$obj3) {\n\t\n\t\t\t\t\t\t$cls = TbproftipovinculoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj3 = new $cls();\n\t\t\t\t\t$obj3->hydrate($row, $startcol3);\n\t\t\t\t\tTbproftipovinculoPeer::addInstanceToPool($obj3, $key3);\n\t\t\t\t} // if $obj3 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj3 (Tbproftipovinculo)\n\t\t\t\t$obj3->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbformacao rows\n\n\t\t\t\t$key4 = TbformacaoPeer::getPrimaryKeyHashFromRow($row, $startcol4);\n\t\t\t\tif ($key4 !== null) {\n\t\t\t\t\t$obj4 = TbformacaoPeer::getInstanceFromPool($key4);\n\t\t\t\t\tif (!$obj4) {\n\t\n\t\t\t\t\t\t$cls = TbformacaoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj4 = new $cls();\n\t\t\t\t\t$obj4->hydrate($row, $startcol4);\n\t\t\t\t\tTbformacaoPeer::addInstanceToPool($obj4, $key4);\n\t\t\t\t} // if $obj4 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj4 (Tbformacao)\n\t\t\t\t$obj4->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbprofessorsituacao rows\n\n\t\t\t\t$key5 = TbprofessorsituacaoPeer::getPrimaryKeyHashFromRow($row, $startcol5);\n\t\t\t\tif ($key5 !== null) {\n\t\t\t\t\t$obj5 = TbprofessorsituacaoPeer::getInstanceFromPool($key5);\n\t\t\t\t\tif (!$obj5) {\n\t\n\t\t\t\t\t\t$cls = TbprofessorsituacaoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj5 = new $cls();\n\t\t\t\t\t$obj5->hydrate($row, $startcol5);\n\t\t\t\t\tTbprofessorsituacaoPeer::addInstanceToPool($obj5, $key5);\n\t\t\t\t} // if $obj5 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj5 (Tbprofessorsituacao)\n\t\t\t\t$obj5->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbsetor rows\n\n\t\t\t\t$key6 = TbsetorPeer::getPrimaryKeyHashFromRow($row, $startcol6);\n\t\t\t\tif ($key6 !== null) {\n\t\t\t\t\t$obj6 = TbsetorPeer::getInstanceFromPool($key6);\n\t\t\t\t\tif (!$obj6) {\n\t\n\t\t\t\t\t\t$cls = TbsetorPeer::getOMClass(false);\n\n\t\t\t\t\t$obj6 = new $cls();\n\t\t\t\t\t$obj6->hydrate($row, $startcol6);\n\t\t\t\t\tTbsetorPeer::addInstanceToPool($obj6, $key6);\n\t\t\t\t} // if $obj6 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj6 (Tbsetor)\n\t\t\t\t$obj6->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t$results[] = $obj1;\n\t\t}\n\t\t$stmt->closeCursor();\n\t\treturn $results;\n\t}", "protected function _manageFetchParams($select, $params) {\r\n \tif($params['order'] !== null) {\r\n \t\t$select->order($params['order']);\r\n \t}\r\n \tif($params['limit'] !== null) {\r\n \t\tif($params['page'] !== null) {\r\n \t\t\t$select->limitPage($params['page'], $params['limit']);\r\n \t\t}\r\n \t\telse {\r\n \t\t\t$select->limit($params['limit']);\r\n \t\t}\r\n \t}\r\n }", "function __construct(\\entity $e, array $foreigns, $type='INNER JOIN'){\n //\n //Every join must have a type which is a string i.e inner join \n //outer join etc\n $this->type=$type;\n //\n //Get the join \n $this->entity= $e;\n //\n $this->foreigns=$foreigns;\n //\n //Formulate the on clauses \n $this->ons= $this->get_ons();\n }", "function cf_search_join( $join ) {\n\t global $wpdb;\n\n\t if ( is_search() ) { \n\t $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t }\n\t \n\t return $join;\n\t}", "public function setFetchMode($fetchMode);", "protected function joinProgressTable() {\n $until = CRM_Utils_Array::value('effective_date_value', $this->_params);\n $untilClause = '';\n if ($until) {\n $untilClause = ' AND c.receive_date <=\"' . CRM_Utils_Type::validate(CRM_Utils_Date::processDate($until, 235959), 'Integer') . '\"';\n }\n $this->_from .= \" LEFT JOIN\n\n (\n SELECT CONCAT('p', p.id) as id, contact_id, campaign_id, financial_type_id,\n COALESCE(amount, 0) - COALESCE(cancelled_amount, 0) as total_amount,\n currency,\n COALESCE(paid_amount, 0) as paid_amount,\n COALESCE(amount - paid_amount, 0) - COALESCE(cancelled_amount, 0) as balance_amount,\n 1 as is_pledge\n\nFROM civicrm_pledge p\nLEFT JOIN\n (SELECT pledge_id,\n sum(if(status_id = 1 $untilClause , actual_amount, 0)) as paid_amount,\n sum(if(status_id = 3 $untilClause , scheduled_amount, 0)) as cancelled_amount\n\n FROM civicrm_pledge_payment\n LEFT JOIN civicrm_contribution c ON c.id = contribution_id\n GROUP BY pledge_id\n ) as pp\n ON pp.pledge_id = p.id\n WHERE p.is_test = 0\n \";\n if ($until) {\n $this->_from .= ' AND p.create_date <=\"' . CRM_Utils_Type::validate(CRM_Utils_Date::processDate($until, 235959), 'Integer') . '\"';\n }\n\n $this->_from .= \" UNION\n\n SELECT CONCAT('c', c.id) as id, contact_id, campaign_id, financial_type_id,\n COALESCE(total_amount, 0) as total_amount, c.currency,\n COALESCE(total_amount, 0) as paid_amount,\n 0 as balance_amount,\n 0 as is_pledge\n FROM civicrm_contribution c\n LEFT JOIN civicrm_pledge_payment pp ON pp.contribution_id = c.id\n WHERE c.contribution_status_id = 1\n AND pp.id IS NULL \";\n if ($until) {\n $this->_from .= ' AND c.receive_date <= \"' . CRM_Utils_Type::validate(CRM_Utils_Date::processDate($until, 235959), 'Integer') . '\"';\n }\n\n $this->_from .= \") as progress ON progress.campaign_id = {$this->_aliases['civicrm_campaign']}.id\n \";\n }", "function rocket_dns_prefetch( $hints, $relation_type ) {\n $domains = rocket_get_dns_prefetch_domains();\n \n if ( (bool) $domains ) {\n foreach ( $domains as $domain ) {\n if ( 'dns-prefetch' === $relation_type ) {\n $hints[] = $domain;\n }\n }\n }\n\n return $hints;\n}", "public function join_quiz_master_and_postmeta( $join ) {\n\t\t\tglobal $wpdb;\n\n\t\t\treturn $join;\n\t\t}", "public static function doSelectJoinAll(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\n foreach (sfMixer::getCallables('BaseMissionPhotoPeer:doSelectJoinAll:doSelectJoinAll') as $callable)\n {\n call_user_func($callable, 'BaseMissionPhotoPeer', $c, $con);\n }\n\n\n\t\t$c = clone $c;\n\n\t\t// Set the correct dbName if it has not been overridden\n\t\tif ($c->getDbName() == Propel::getDefaultDB()) {\n\t\t\t$c->setDbName(self::DATABASE_NAME);\n\t\t}\n\n\t\tMissionPhotoPeer::addSelectColumns($c);\n\t\t$startcol2 = (MissionPhotoPeer::NUM_COLUMNS - MissionPhotoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tMissionPeer::addSelectColumns($c);\n\t\t$startcol3 = $startcol2 + (MissionPeer::NUM_COLUMNS - MissionPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tMissionLegPeer::addSelectColumns($c);\n\t\t$startcol4 = $startcol3 + (MissionLegPeer::NUM_COLUMNS - MissionLegPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\t$c->addJoin(array(MissionPhotoPeer::MISSION_ID,), array(MissionPeer::ID,), $join_behavior);\n\t\t$c->addJoin(array(MissionPhotoPeer::LEG_ID,), array(MissionLegPeer::ID,), $join_behavior);\n\t\t$stmt = BasePeer::doSelect($c, $con);\n\t\t$results = array();\n\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$key1 = MissionPhotoPeer::getPrimaryKeyHashFromRow($row, 0);\n\t\t\tif (null !== ($obj1 = MissionPhotoPeer::getInstanceFromPool($key1))) {\n\t\t\t\t// We no longer rehydrate the object, since this can cause data loss.\n\t\t\t\t// See http://propel.phpdb.org/trac/ticket/509\n\t\t\t\t// $obj1->hydrate($row, 0, true); // rehydrate\n\t\t\t} else {\n\t\t\t\t$omClass = MissionPhotoPeer::getOMClass();\n\n\t\t\t\t$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);\n\t\t\t\t$obj1 = new $cls();\n\t\t\t\t$obj1->hydrate($row);\n\t\t\t\tMissionPhotoPeer::addInstanceToPool($obj1, $key1);\n\t\t\t} // if obj1 already loaded\n\n\t\t\t// Add objects for joined Mission rows\n\n\t\t\t$key2 = MissionPeer::getPrimaryKeyHashFromRow($row, $startcol2);\n\t\t\tif ($key2 !== null) {\n\t\t\t\t$obj2 = MissionPeer::getInstanceFromPool($key2);\n\t\t\t\tif (!$obj2) {\n\n\t\t\t\t\t$omClass = MissionPeer::getOMClass();\n\n\n\t\t\t\t\t$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);\n\t\t\t\t\t$obj2 = new $cls();\n\t\t\t\t\t$obj2->hydrate($row, $startcol2);\n\t\t\t\t\tMissionPeer::addInstanceToPool($obj2, $key2);\n\t\t\t\t} // if obj2 loaded\n\n\t\t\t\t// Add the $obj1 (MissionPhoto) to the collection in $obj2 (Mission)\n\t\t\t\t$obj2->addMissionPhoto($obj1);\n\t\t\t} // if joined row not null\n\n\t\t\t// Add objects for joined MissionLeg rows\n\n\t\t\t$key3 = MissionLegPeer::getPrimaryKeyHashFromRow($row, $startcol3);\n\t\t\tif ($key3 !== null) {\n\t\t\t\t$obj3 = MissionLegPeer::getInstanceFromPool($key3);\n\t\t\t\tif (!$obj3) {\n\n\t\t\t\t\t$omClass = MissionLegPeer::getOMClass();\n\n\n\t\t\t\t\t$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);\n\t\t\t\t\t$obj3 = new $cls();\n\t\t\t\t\t$obj3->hydrate($row, $startcol3);\n\t\t\t\t\tMissionLegPeer::addInstanceToPool($obj3, $key3);\n\t\t\t\t} // if obj3 loaded\n\n\t\t\t\t// Add the $obj1 (MissionPhoto) to the collection in $obj3 (MissionLeg)\n\t\t\t\t$obj3->addMissionPhoto($obj1);\n\t\t\t} // if joined row not null\n\n\t\t\t$results[] = $obj1;\n\t\t}\n\t\t$stmt->closeCursor();\n\t\treturn $results;\n\t}", "protected function _joinFields()\n {\n $reviewTable = $this->_resource->getTableName('review');\n $reviewDetailTable = $this->_resource->getTableName('review_detail');\n\n $this->addAttributeToSelect('name')->addAttributeToSelect('sku');\n\n $this->getSelect()->join(\n ['rt' => $reviewTable],\n 'rt.entity_pk_value = e.entity_id',\n ['rt.review_id', 'review_created_at' => 'rt.created_at', 'rt.entity_pk_value', 'rt.status_id', 'rt.vendor_id']\n )->join(\n ['rdt' => $reviewDetailTable],\n 'rdt.review_id = rt.review_id',\n ['rdt.title', 'rdt.nickname', 'rdt.detail', 'rdt.customer_id', 'rdt.store_id']\n );\n return $this;\n }", "public function prepareVars()\n {\n $this->vars['relationManageId'] = $this->manageId;\n $this->vars['relationLabel'] = $this->config->label ?: $this->field;\n $this->vars['relationManageTitle'] = $this->manageTitle;\n $this->vars['relationField'] = $this->field;\n $this->vars['relationType'] = $this->relationType;\n $this->vars['relationSearchWidget'] = $this->searchWidget;\n $this->vars['relationToolbarWidget'] = $this->toolbarWidget;\n $this->vars['relationManageMode'] = $this->manageMode;\n $this->vars['relationManageWidget'] = $this->manageWidget;\n $this->vars['relationToolbarButtons'] = $this->toolbarButtons;\n $this->vars['relationViewMode'] = $this->viewMode;\n $this->vars['relationViewWidget'] = $this->viewWidget;\n $this->vars['relationViewModel'] = $this->viewModel;\n $this->vars['relationPivotWidget'] = $this->pivotWidget;\n $this->vars['relationSessionKey'] = $this->relationGetSessionKey();\n $this->vars['relationExtraConfig'] = $this->extraConfig;\n }", "public function prepareAlbumConditions(array $conditions, array &$fetchOptions)\n\t{\n\t\t$db = $this->_getDb();\n\t\t$sqlConditions = array();\n\n\t\tif (!empty($fetchOptions['join']))\n\t\t{\n\t\t\tif ($fetchOptions['join'] & self::FETCH_PRIVACY)\n\t\t\t{\n\t\t\t\t$viewingUser = $this->standardizeViewingUserReference();\n\n\t\t\t\tif (!XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'viewOverride'))\n\t\t\t\t{\n\t\t\t\t\t$userId = 0;\n\t\t\t\t\tif (isset($conditions['privacyUserId']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$userId = $conditions['privacyUserId'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$sqlConditions[] = '\n\t\t\t\t\t\tprivate.private_user_id IS NOT NULL\n\t\t\t\t\t\t\tOR shared.shared_user_id IS NOT NULL\n\t\t\t\t\t\t\tOR album.album_privacy = \\'public\\'\n\t\t\t\t\t\t\tOR IF(album.album_privacy = \\'members\\', EXISTS(SELECT user_id FROM xf_user WHERE user_id = ' . $db->quote($userId) . '), NULL)\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($conditions['user_id']))\n\t\t{\n\t\t\tif (is_array($conditions['user_id']))\n\t\t\t{\n\t\t\t\t$sqlConditions[] = 'album.user_id IN (' . $db->quote($conditions['user_id']) . ')';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sqlConditions[] = 'album.user_id = ' . $db->quote($conditions['user_id']);\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($conditions['album_media_count']))\n\t\t{\n\t\t\t$sqlConditions[] = 'album.album_media_count ' . $conditions['album_media_count'];\n\t\t}\n\t\t\n\t\tif (!empty($conditions['shared_user_id']))\n\t\t{\n\t\t\tif (is_array($conditions['shared_user_id']))\n\t\t\t{\n\t\t\t\t$sqlConditions[] = 'shared.shared_user_id IN (' . $db->quote($conditions['shared_user_id']) . ')';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sqlConditions[] = 'shared.shared_user_id = ' . $db->quote($conditions['shared_user_id']);\n\t\t\t}\n\n\t\t\tif (!is_array($conditions['shared_user_id']))\n\t\t\t{\n\t\t\t\t$sqlConditions[] = 'album.user_id != ' . $db->quote($conditions['shared_user_id']);\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($conditions['album_id']))\n\t\t{\n\t\t\tif (is_array($conditions['album_id']))\n\t\t\t{\n\t\t\t\t$sqlConditions[] = 'album.album_id IN (' . $db->quote($conditions['album_id']) . ')';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sqlConditions[] = 'album.album_id = ' . $db->quote($conditions['album_id']);\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($conditions['album_privacy']))\n\t\t{\n\t\t\tif (is_array($conditions['album_privacy']))\n\t\t\t{\n\t\t\t\t$sqlConditions[] = 'album.album_privacy IN (' . $db->quote($conditions['album_privacy']) . ')';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sqlConditions[] = 'album.album_privacy = ' . $db->quote($conditions['album_privacy']);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!empty($conditions['public']))\n\t\t{\n\t\t\t$sqlConditions[] = \"album.album_privacy = 'public'\";\n\t\t}\n\n\t\treturn $this->getConditionsForClause($sqlConditions);\n\t}", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "function superfood_elated_woocommerce_related_products_args($args) {\n\n\t\tif (superfood_elated_options()->getOptionValue('eltdf_woo_product_list_columns')) {\n\n\t\t\t$related = superfood_elated_options()->getOptionValue('eltdf_woo_product_list_columns');\n\t\t\tswitch ($related) {\n\t\t\t\tcase 'eltdf-woocommerce-columns-4':\n\t\t\t\t\t$args['posts_per_page'] = 4;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'eltdf-woocommerce-columns-3':\n\t\t\t\t\t$args['posts_per_page'] = 3;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$args['posts_per_page'] = 3;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$args['posts_per_page'] = 3;\n\t\t}\n\n\t\treturn $args;\n\t}", "public function onFetchComplex(Zend_Db_Select $select)\n {\n $mapperTable = $this->getMapper()->getTable();\n foreach ($this->_fields as $field) {\n $joinSelectFields = array(\n 'resource_'.$field.'_'.'id' => 'resource_'.$field.'.rc_id',\n 'resource_'.$field.'_'.'filename' => 'resource_'.$field.'.rc_filename',\n 'resource_'.$field.'_'.'source_filename' => 'resource_'.$field.'.rc_source_filename',\n 'resource_'.$field.'_'.'size' => 'resource_'.$field.'.rc_size',\n 'resource_'.$field.'_'.'mime' => 'resource_'.$field.'.rc_mime',\n 'resource_'.$field.'_'.'width' => 'resource_'.$field.'.rc_width',\n 'resource_'.$field.'_'.'height' => 'resource_'.$field.'.rc_height',\n 'resource_'.$field.'_'.'preview' => 'resource_'.$field.'.rc_preview',\n 'resource_'.$field.'_'.'prv_width' => 'resource_'.$field.'.rc_prv_width',\n 'resource_'.$field.'_'.'prv_height' => 'resource_'.$field.'.rc_prv_height',\n );\n for ($i = 2; $i<= (int) $this->_previewCount; $i++) {\n $suffix = $this->_getPreviewSuffix($i);\n $joinSelectFields['resource_'.$field.'_'.'preview'.$suffix] = 'resource_'.$field.'.rc_preview'.$suffix;\n $joinSelectFields['resource_'.$field.'_'.'prv'.$suffix.'_width'] = 'resource_'.$field.'.rc_prv'.$suffix.'_width';\n $joinSelectFields['resource_'.$field.'_'.'prv'.$suffix.'_height'] = 'resource_'.$field.'.rc_prv'.$suffix.'_height';\n }\n $select -> joinLeft(\n array('resource_'.$field => $this->getTable()->getTableName()),\n $mapperTable->getTableName().'.'.$mapperTable->getColumnPrefix().'_'.$field.'= resource_'.$field.'.rc_id',\n $joinSelectFields\n );\n }\n\n return $select;\n }", "function editor_joins(){\n //\n //begin with an empty collection of joins \n $joins=[];\n //\n //Push the editor joins also\n foreach ($this->editor_joins as $join){\n array_push($joins, $join);\n }\n //\n //Set the new joins \n $this->joins=new joins($joins);\n }", "protected function _addJoinTables()\n {\n $this->addTable('gems__respondents', array('gap_id_user' => 'grs_id_user'));\n\n if ($this->has('gap_id_organization')) {\n $this->addTable(\n 'gems__organizations',\n array('gap_id_organization' => 'gor_id_organization'),\n 'gor',\n false\n );\n }\n if ($this->has('gap_id_attended_by')) {\n $this->addLeftTable(\n 'gems__agenda_staff',\n array('gap_id_attended_by' => 'gas_id_staff'),\n 'gas',\n false\n );\n }\n /*\n if ($this->has('gap_id_referred_by')) {\n $this->addLeftTable(\n array('ref_staff' => 'gems__agenda_staff'),\n array('gap_id_referred_by' => 'ref_staff.gas_id_staff')\n );\n } // */\n if ($this->has('gap_id_activity')) {\n $this->addLeftTable(\n 'gems__agenda_activities',\n array('gap_id_activity' => 'gaa_id_activity'),\n 'gap',\n false\n );\n }\n if ($this->has('gap_id_procedure')) {\n $this->addLeftTable(\n 'gems__agenda_procedures',\n array('gap_id_procedure' => 'gapr_id_procedure'),\n 'gapr',\n false\n );\n }\n if ($this->has('gap_id_location')) {\n $this->addLeftTable(\n 'gems__locations',\n array('gap_id_location' => 'glo_id_location'),\n 'glo',\n false\n );\n }\n }", "public function custom_attachments_join( $join, $query ){\n\t\tglobal $wpdb;\n\n\t\t//if we are not on admin or the current search is not on attachment return\n\t\tif(!is_admin() || (!isset($query->query['post_type']) || $query->query['post_type'] != 'attachment')){\n\t\t\treturn $join;\n\t\t}\n\n\t\t// if current query is the main query and a search...\n\t\tif( is_main_query() && is_search() ){\n\t\t\t$join .= \"\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->term_relationships} ON {$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->terms} ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id \";\n\t\t}\n\n\t\treturn $join;\n\t}", "private function init_consolidationAndSelect()\n {\n // RETURN : there isn't any filter\n if ( !$this->bool_isFilter )\n {\n return;\n }\n // RETURN : there isn't any filter\n // Add tableUids to the consolidation array\n $this->init_consolidationAndSelect_setArrayConsolidation();\n\n // Add tableFields to the ts property SELECT\n $this->init_consolidationAndSelect_setTsSelect();\n }", "public function getJoinCondition() {}", "public function getarchives_join( $join, $r ) {\n\t\tglobal $wpdb;\n\t\t$this->get_archives_where_r = $r;\n\t\tif(isset($r['taxonomy']) && is_array($r['taxonomy']) )\n\t\t$join = $join . \" INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)\";\n\n\t\treturn $join;\n\t}", "public function makeSearchJoin($join)\n {\n global $wpdb;\n\n if (is_search()) {\n\n $join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\n foreach ($this->getAvailableMetaKeysForFilters() as $values) {\n if (isset($_GET[$values]) && !empty($_GET[$values])) {\n $join .= \" LEFT JOIN $wpdb->postmeta as $values ON $wpdb->posts.ID = $values.post_id\";\n\n }\n }\n\n }\n\n return $join;\n }", "public function SetPdoFetchMode($mode = PDO::FETCH_ASSOC)\n {\n $this->pdoFetch = $mode;\n }", "public function setFetchMode($mode, $classNameObject = null, $ctor_args = null): void\n {\n $driverMode = ResultSet::FETCH_OBJECT;\n\n // \\PDO::FETCH_ASSOC\n if ($mode === 2) {\n $driverMode = ResultSet::FETCH_ASSOC;\n }\n\n $this->fetchMode = $driverMode;\n }", "function cf_search_join( $join ) {\n\t\tglobal $wpdb;\n\n\t\tif ( is_search() ) {\n\t\t\t$join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t\t}\n\n\t\treturn $join;\n\t}", "public static function doSelectJoinTbnecesespecial(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\t\t$criteria = clone $criteria;\n\n\t\t// Set the correct dbName if it has not been overridden\n\t\tif ($criteria->getDbName() == Propel::getDefaultDB()) {\n\t\t\t$criteria->setDbName(self::DATABASE_NAME);\n\t\t}\n\n\t\tTbprofessorPeer::addSelectColumns($criteria);\n\t\t$startcol = (TbprofessorPeer::NUM_COLUMNS - TbprofessorPeer::NUM_LAZY_LOAD_COLUMNS);\n\t\tTbnecesespecialPeer::addSelectColumns($criteria);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_NECES_ESPECIAL, TbnecesespecialPeer::ID_NECES_ESPECIAL, $join_behavior);\n\n\t\t// symfony_behaviors behavior\n\t\tforeach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook)\n\t\t{\n\t\t call_user_func($sf_hook, 'BaseTbprofessorPeer', $criteria, $con);\n\t\t}\n\n\t\t$stmt = BasePeer::doSelect($criteria, $con);\n\t\t$results = array();\n\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$key1 = TbprofessorPeer::getPrimaryKeyHashFromRow($row, 0);\n\t\t\tif (null !== ($obj1 = TbprofessorPeer::getInstanceFromPool($key1))) {\n\t\t\t\t// We no longer rehydrate the object, since this can cause data loss.\n\t\t\t\t// See http://propel.phpdb.org/trac/ticket/509\n\t\t\t\t// $obj1->hydrate($row, 0, true); // rehydrate\n\t\t\t} else {\n\n\t\t\t\t$cls = TbprofessorPeer::getOMClass(false);\n\n\t\t\t\t$obj1 = new $cls();\n\t\t\t\t$obj1->hydrate($row);\n\t\t\t\tTbprofessorPeer::addInstanceToPool($obj1, $key1);\n\t\t\t} // if $obj1 already loaded\n\n\t\t\t$key2 = TbnecesespecialPeer::getPrimaryKeyHashFromRow($row, $startcol);\n\t\t\tif ($key2 !== null) {\n\t\t\t\t$obj2 = TbnecesespecialPeer::getInstanceFromPool($key2);\n\t\t\t\tif (!$obj2) {\n\n\t\t\t\t\t$cls = TbnecesespecialPeer::getOMClass(false);\n\n\t\t\t\t\t$obj2 = new $cls();\n\t\t\t\t\t$obj2->hydrate($row, $startcol);\n\t\t\t\t\tTbnecesespecialPeer::addInstanceToPool($obj2, $key2);\n\t\t\t\t} // if obj2 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to $obj2 (Tbnecesespecial)\n\t\t\t\t$obj2->addTbprofessor($obj1);\n\n\t\t\t} // if joined row was not null\n\n\t\t\t$results[] = $obj1;\n\t\t}\n\t\t$stmt->closeCursor();\n\t\treturn $results;\n\t}", "protected function _loadRelatedData()\n {\n return array(\n 'UCmsAlbumI18n' => UCmsAlbumI18n::model()->findByPk(array(\n 'u_cms_album_id' => $_GET['album'], 'i18n_id' => Yii::app()->language\n ))\n );\n }", "function SetupListOptions() {\r\n\t\tglobal $Security, $fs_multijoin_v;\r\n\r\n\t\t// Call ListOptions_Load event\r\n\t\t$this->ListOptions_Load();\r\n\t\tif ($fs_multijoin_v->Export <> \"\" ||\r\n\t\t\t$fs_multijoin_v->CurrentAction == \"gridadd\" ||\r\n\t\t\t$fs_multijoin_v->CurrentAction == \"gridedit\")\r\n\t\t\t$this->ListOptions->HideAllOptions();\r\n\t}", "public function fetchAllOptionsProvider()\n {\n $modelsData = array(\n array(\n 'id' => 'prj1',\n 'name' => 'project a',\n 'members' => array('foo', 'bar'),\n ),\n array(\n 'id' => 'prj2',\n 'name' => 'project b',\n 'members' => array('foo', 'baz', 'xyz'),\n ),\n array(\n 'id' => 'prj3',\n 'name' => 'project x',\n 'members' => array('bar', 'xyz', 'abc'),\n ),\n array(\n 'id' => 'prj4',\n 'name' => 'project y',\n 'members' => array('abc', 'bar', 'baz'),\n ),\n array(\n 'id' => 'prj5',\n 'name' => 'project c',\n 'members' => array('foo', 'xyz', 'abc'),\n ),\n array(\n 'id' => 'prj6',\n 'name' => 'project q',\n 'members' => array('foo'),\n 'deleted' => true\n ),\n array(\n 'id' => 'prj7',\n 'name' => 'project w',\n 'members' => array('abc'),\n 'deleted' => true\n )\n );\n\n return array(\n array(\n $modelsData,\n array(),\n array('prj1', 'prj2', 'prj3', 'prj4', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('ids' => null),\n array('prj1', 'prj2', 'prj3', 'prj4', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('ids' => array()),\n array(),\n null\n ),\n array(\n $modelsData,\n array('ids' => array('prj2', 'prj5', 'prj1')),\n array('prj1', 'prj2', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('ids' => array('prj2', 'prj5', 'prj1'), 'noCache' => true),\n array('prj1', 'prj2', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('member' => 'foo'),\n array('prj1', 'prj2', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('noCache' => true),\n array('prj1', 'prj2', 'prj3', 'prj4', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('includeDeleted' => true),\n array('prj1', 'prj2', 'prj3', 'prj4', 'prj5', 'prj6', 'prj7'),\n null\n ),\n array(\n $modelsData,\n array('member' => 'foo', 'includeDeleted' => true),\n array('prj1', 'prj2', 'prj5', 'prj6'),\n null\n ),\n array(\n $modelsData,\n array('ids' => array('prj1', 'prj6', 'prj7')),\n array('prj1'),\n null\n ),\n array(\n $modelsData,\n array('ids' => array('prj1', 'prj6', 'prj7'), 'includeDeleted' => true),\n array('prj1', 'prj6', 'prj7'),\n null\n ),\n array(\n $modelsData,\n array('ids' => array('prj-noexist'), 'includeDeleted' => true),\n array(),\n null\n ),\n array(\n $modelsData,\n array('search' => '123=ABC'),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: search.\"\n )\n ),\n array(\n $modelsData,\n array('keywords' => 'foo bar baz'),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: keywords.\"\n )\n ),\n array(\n $modelsData,\n array('maximum' => 3),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: maximum.\"\n )\n ),\n array(\n $modelsData,\n array('totalCount' => true),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: totalCount.\"\n )\n ),\n array(\n $modelsData,\n array('after' => 'prj1', 'ids' => array('prj3', 'prj5')),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: after.\"\n )\n ),\n array(\n $modelsData,\n array('totalCount' => true, 'ids' => array('prj1', 'prj2'), 'after' => 'prj1'),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: totalCount, after.\"\n )\n ),\n array(\n $modelsData,\n array('member' => 'foo', 'flagMember' => 'bar'),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: flagMember.\"\n )\n ),\n );\n }", "public function initialize()\n {\n $this->belongsTo(\n 'companies_id',\n Companies::class,\n 'id',\n ['alias' => 'company']\n );\n\n $this->belongsTo(\n 'apps_id',\n Apps::class,\n 'id',\n ['alias' => 'app']\n );\n\n $this->belongsTo(\n 'users_id',\n Users::class,\n 'id',\n ['alias' => 'user']\n );\n\n $this->setSource('users_associated_apps');\n }", "function xiliml_adjacent_join_filter( $join, $in_same_cat, $excluded_categories ) {\n\t\tglobal $post, $wpdb;\n\t\t$curlang = xiliml_get_lang_object_of_post( $post->ID );\n\n\t\tif ( $curlang ) { // only when language is defined !\n\t\t\t$join .= \" LEFT JOIN $wpdb->term_relationships as xtr ON (p.ID = xtr.object_id) LEFT JOIN $wpdb->term_taxonomy as xtt ON (xtr.term_taxonomy_id = xtt.term_taxonomy_id) \";\n\t\t}\n\t\treturn $join;\n\t}", "protected function join_temporary_results($data)\n {\n $data = json_decode(json_encode($data), TRUE);\n if(array_key_exists($this->primary,$data))\n {\n $data = array($data);\n }\n foreach($this->_requested as $requested_key => $request)\n {\n $pivot_table = NULL;\n $relation = $this->_relationships[$request];\n $this->load->model($relation['foreign_model']);\n $foreign_key = $relation['foreign_key'];\n $local_key = $relation['local_key'];\n (isset($relation['pivot_table'])) ? $pivot_table = $relation['pivot_table'] : FALSE;\n $foreign_table = $relation['foreign_table'];\n $type = $relation['relation'];\n $relation_key = $relation['relation_key'];\n $local_key_values = array();\n foreach($data as $key => $element)\n {\n if(isset($element[$local_key]))\n {\n $id = $element[$local_key];\n $local_key_values[$key] = $id;\n }\n }\n if(!isset($pivot_table))\n {\n $sub_results = $this->{$relation['foreign_model']}->as_array()->where($foreign_key, $local_key_values)->get_all();\n }\n else\n {\n $this->_database->join($pivot_table, $foreign_table.'.'.$foreign_key.' = '.$pivot_table.'.'.singular($foreign_table).'_'.$foreign_key, 'right');\n $this->_database->join($this->table, $pivot_table.'.'.singular($this->table).'_'.$local_key.' = '.$this->table.'.'.$local_key,'right');\n $this->_database->where_in($this->table.'.'.$local_key,$local_key_values);\n $sub_results = $this->_database->get($foreign_table)->result_array();\n }\n\n if(isset($sub_results) && !empty($sub_results)) {\n $subs = array();\n foreach ($sub_results as $result) {\n $subs[$result[$foreign_key]][] = $result;\n }\n $sub_results = $subs;\n foreach($local_key_values as $key => $value)\n {\n if(array_key_exists($value,$sub_results))\n {\n if ($type == 'has_one')\n {\n $data[$key][$relation_key] = $sub_results[$value][0];\n }\n else\n {\n $data[$key][$relation_key] = $sub_results[$value];\n }\n }\n }\n }\n unset($this->_requested[$requested_key]);\n }\n if(sizeof($data)==1) $data = $data[0];\n return ($this->return_as == 'object') ? json_decode(json_encode($data), FALSE) : $data;\n }", "function SetUpSortOrder() {\r\n\t\tglobal $fs_multijoin_v;\r\n\r\n\t\t// Check for \"order\" parameter\r\n\t\tif (@$_GET[\"order\"] <> \"\") {\r\n\t\t\t$fs_multijoin_v->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\r\n\t\t\t$fs_multijoin_v->CurrentOrderType = @$_GET[\"ordertype\"];\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->id); // id\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->mount); // mount\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->path); // path\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->parent); // parent\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->deprecated); // deprecated\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->name); // name\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->snapshot); // snapshot\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->tapebackup); // tapebackup\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->diskbackup); // diskbackup\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->type); // type\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->CONTACT); // CONTACT\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->CONTACT2); // CONTACT2\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->RESCOMP); // RESCOMP\r\n\t\t\t$fs_multijoin_v->setStartRecordNumber(1); // Reset start position\r\n\t\t}\r\n\t}", "abstract public function prepareSelect();", "function getClientWithRelatedOffers($clientId, $offerId, $layoutType)\n\n\t{\n\t\t$query = \"SELECT pd.pd_id AS prodId, pd.pd_image AS pdImage, pd.`pd_price` AS pdPrice, pd.`pd_name` AS `prodName`, \n\n\t\tpd.client_id, cl.id AS clientId, cl.name, cl.background_color, cl.light_color, cl.dark_color, `ofr`.relatedto_id, \n\n\t\t`ofr`.relatedfrom_id, `ofr`.relatedto_prodid, IFNULL(pd.pd_short_description, 'null' ) AS pd_short_description, \n\n\t\tIFNULL(cl.url, 'null' ) AS clientUrl, \n\n\t\tCASE WHEN cl.logo IS NULL or cl.logo = '' THEN 'null' ELSE cl.logo END AS clientLogo, \n\n\t\tCASE WHEN cl.background_image IS NULL or cl.background_image = '' THEN 'null' ELSE cl.background_image END AS background_image, \n\n\t\tCASE WHEN pd.pd_url IS NULL or pd.pd_url = '' THEN 'null' ELSE pd.pd_url END AS productUrl, \n\t\t\n\t\tCASE WHEN pd.pd_button_name IS NULL or pd.pd_button_name = '' THEN 'null' ELSE pd.pd_button_name END AS pd_button_name,\n\t\tIFNULL(pd.pd_istryon, '0' ) AS pd_istryon, of.offer_id, of.offer_name, of.offer_image, of.offer_type_id, \n\t\tof.offer_discount_type_id, of.offer_short_description, of.offer_description, of.offer_valid_from, of.offer_valid_to, \n\t\tof.offer_is_location_based, of.offer_is_calendar_based, odt.offer_discount_value,odt.offer_discount_type,\n\t\tCASE WHEN of.offer_purchase_url IS NULL or of.offer_purchase_url = '' THEN 'null' ELSE of.offer_purchase_url END AS offer_purchase_url, \t\t\t\n\t\tCASE WHEN of.offer_button_name IS NULL or of.offer_button_name = '' THEN 'null' ELSE of.offer_button_name END AS offer_button_name, of.client_id AS offerClientId \";\n\t\t/*if($layoutType==\"financial\"){\n\t\t\t$query .= \", of.offer_id, of.offer_name, of.offer_image \";\n\t\t}*/\n\t\t\n\t\t$query .= \"\n\t\tFROM offers_related AS `ofr`\n\n\t\tLEFT JOIN offers AS of ON of.offer_id=`ofr`.relatedto_id AND of.client_id='\".$clientId.\"' AND of.offer_status=1 AND of.offer_id!='\".$offerId.\"' \t\n\t\t\n\t\tLEFT JOIN `offers_info` AS oi ON oi.client_id=of.client_id AND oi.offer_id=of.offer_id \n\n\t\tLEFT JOIN `offers_discount_type` AS odt ON odt.client_id=of.client_id AND odt.offer_discount_status =1 \tAND odt.offer_discount_type_id =of. offer_discount_type_id\t\n\t\tLEFT JOIN products AS pd ON pd.pd_id=`ofr`.relatedto_prodid AND pd.client_id=\".$clientId.\" AND pd.pd_status=1 \n\n\t\tLEFT JOIN client AS cl ON (cl.id=of.client_id OR cl.id=pd.client_id ) AND cl.active=1 \";\n\t\t\n\t\t/*if($layoutType==\"financial\"){\n\t\t\t$query .= \"LEFT JOIN offers AS of ON of.offer_id=pdr.relatedto_offerid AND of.offer_status=1 \";\n\t\t}\n*/\n\t\t$query .= \"WHERE `ofr`.relatedfrom_id=\".$offerId;\n\t\tif($layoutType!=\"financial\"){\n\t\t\t$query .= \" AND of.offer_id!=''\";\n\t\t}\n\t\t$query .= \" GROUP BY of.offer_id DESC LIMIT 0,5\";\n\t\t\n\t//echo $query;\n\t\t$result = $this->selectQueryForAssoc($query);\n\n\t\treturn $result;\n\n\t}", "public function setFetchMode($mode, $fetch_arga = NULL, $fetch_argb = NULL)\r\n\t{\r\n\t\tswitch($mode)\r\n\t\t{\r\n\t\t\tcase LikePDO::FETCH_ASSOC :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_ASSOC;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_BOTH :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_BOTH;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_BOUND :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_BOUND;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_CLASS :\r\n\t\t\t\tif(!class_exists($fetch_arga))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new LikePDOException(\"No fetch class specified\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif($fetch_argb)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!is_array($fetch_argb))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthrow new LikePDOException(\"Warning: LikePDOStatement::setFetchMode() expects parameter 3 to be array on parameter 1 is FETCH_CLASS, \".gettype($fetch_argb).\" given\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->fetchModeArguments = $fetch_argb;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_CLASS;\r\n\t\t\t\t$this->fetchModeDefinition = $fetch_arga;\r\n\t\t\tbreak;\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_INTO :\r\n\t\t\t\tif(!is_object($fetch_arga))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new LikePDOException(\"No fetch class specified\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_INTO;\r\n\t\t\t\t$this->fetchModeDefinition = $fetch_arga;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_LAZY :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_LAZY;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_NAMED :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_NAMED;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_NUM :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_NUM;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_OBJ :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_OBJ;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\tthrow new LikePDOException(\"Invalid fetch mode\");\r\n\t\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "protected function _preparePage(){\n if (!Mage::helper('easylife_gridenhancer/customer')->getIsDisabled()) {\n $collection = $this->getCollection();\n $settings = $this->_getAdminSettings();\n if ($settings->getId()){\n $configuration = $settings->getConfiguration();\n if (is_array($configuration)){\n foreach ($configuration as $attribute=>$position){\n $parts = explode('__', $attribute, 2);\n if (count($parts) != 2){\n continue;\n }\n if ($parts[0] == 'customer'){\n $collection->addAttributeToSelect($parts[1]);\n }\n elseif ($parts[0] == 'customer_address'){\n //check if attribute is already joined\n //again - ugly way of doing it\n //but I cannot access it in a different way\n $reflection = new ReflectionClass($collection);\n $property = $reflection->getProperty('_joinAttributes');\n $property->setAccessible(true);\n $value = $property->getValue($collection);\n if (!isset($value['billing_'.$parts[1]])){\n $collection->joinAttribute('billing_'.$parts[1], 'customer_address/'.$parts[1], 'default_billing', null, 'left');\n }\n }\n }\n }\n }\n }\n return parent::_preparePage();\n }", "protected function fetchQuery(&$params)\n {\n $query = $this->db->from('classified')->select(['site.site_id','site.site_name AS site_name',\n 'species.option_name as species_name','classified.species'])\n ->leftJoin('photo ON photo.photo_id = classified.photo_id')\n ->leftJoin('site ON photo.site_id = site.site_id')\n ->leftJoin('options AS species ON classified.species = species.option_id')\n ->limit(10000);\n\n $this->addFetchQuery($query);\n }", "public function setFetchMode(int $mode, mixed ...$args);", "public function buildSelect()\n {\n $this->query->select(\"DISTINCT(p.id),p.*,\n u.first_name as owner_first_name,u.last_name as owner_last_name,\n c.id as company_id,c.name as company_name,IF(p.id=d2.primary_contact_id, 1, 0) AS is_primary_contact\");\n\n $this->query->from(\"#__people AS p\");\n $this->query->leftJoin(\"#__people_cf as cf ON cf.person_id = p.id\");\n $this->query->leftJoin(\"#__users AS u ON u.id = p.owner_id\");\n $this->query->leftJoin(\"#__companies AS c ON c.id = p.company_id\");\n $this->query->leftJoin(\"#__deals AS d ON d.id = cf.association_id AND cf.association_type = 'deal'\");\n $this->query->leftJoin(\"#__deals AS d2 ON d2.primary_contact_id = p.id\");\n\n }", "function mergeRelatedInfo($results,$curArr) \n{\n\n\tglobal $DB;\n\t\n\t//merge the collection values in for these\n\t$sql = \"SELECT object_id,related_id,name,object_type FROM docmgr.dm_view_related WHERE object_id IN (\".implode(\",\",$curArr).\")\";\n\t$colarr = $DB->fetch($sql,1);\n\n\t//merge our collection values in\n\tfor ($i=0;$i<$results[\"count\"];$i++) {\n\t\t$keys = @array_keys($colarr[\"object_id\"],$results[$i][\"id\"]);\n\t\tif (count($keys) > 0) {\n\t\t\t$c = 0;\n\t\t\tforeach ($keys AS $key) {\n\t\t\t\t$results[$i][\"related\"][$c][\"id\"] = $colarr[\"related_id\"][$key];\t\t\t\n\t\t\t\t$results[$i][\"related\"][$c][\"name\"] = $colarr[\"name\"][$key];\t\t\t\n\t\t\t\t$results[$i][\"related\"][$c][\"object_type\"] = $colarr[\"object_type\"][$key];\t\t\t\n\t\t\t\t$c++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $results;\n\n}", "public static function doSelectJoinAllExceptTbnecesespecial(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\t\t$criteria = clone $criteria;\n\n\t\t// Set the correct dbName if it has not been overridden\n\t\t// $criteria->getDbName() will return the same object if not set to another value\n\t\t// so == check is okay and faster\n\t\tif ($criteria->getDbName() == Propel::getDefaultDB()) {\n\t\t\t$criteria->setDbName(self::DATABASE_NAME);\n\t\t}\n\n\t\tTbprofessorPeer::addSelectColumns($criteria);\n\t\t$startcol2 = (TbprofessorPeer::NUM_COLUMNS - TbprofessorPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbcursoPeer::addSelectColumns($criteria);\n\t\t$startcol3 = $startcol2 + (TbcursoPeer::NUM_COLUMNS - TbcursoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbproftipovinculoPeer::addSelectColumns($criteria);\n\t\t$startcol4 = $startcol3 + (TbproftipovinculoPeer::NUM_COLUMNS - TbproftipovinculoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbformacaoPeer::addSelectColumns($criteria);\n\t\t$startcol5 = $startcol4 + (TbformacaoPeer::NUM_COLUMNS - TbformacaoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbprofessorsituacaoPeer::addSelectColumns($criteria);\n\t\t$startcol6 = $startcol5 + (TbprofessorsituacaoPeer::NUM_COLUMNS - TbprofessorsituacaoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbsetorPeer::addSelectColumns($criteria);\n\t\t$startcol7 = $startcol6 + (TbsetorPeer::NUM_COLUMNS - TbsetorPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\t$criteria->addJoin(TbprofessorPeer::COD_CURSO, TbcursoPeer::COD_CURSO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_TIPO_VINCULO, TbproftipovinculoPeer::ID_TIPO_VINCULO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_FORMACAO, TbformacaoPeer::ID_FORMACAO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_PROF_SIT, TbprofessorsituacaoPeer::ID_SITUACAO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_SETOR, TbsetorPeer::ID_SETOR, $join_behavior);\n\n\t\t// symfony_behaviors behavior\n\t\tforeach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook)\n\t\t{\n\t\t call_user_func($sf_hook, 'BaseTbprofessorPeer', $criteria, $con);\n\t\t}\n\n\n\t\t$stmt = BasePeer::doSelect($criteria, $con);\n\t\t$results = array();\n\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$key1 = TbprofessorPeer::getPrimaryKeyHashFromRow($row, 0);\n\t\t\tif (null !== ($obj1 = TbprofessorPeer::getInstanceFromPool($key1))) {\n\t\t\t\t// We no longer rehydrate the object, since this can cause data loss.\n\t\t\t\t// See http://propel.phpdb.org/trac/ticket/509\n\t\t\t\t// $obj1->hydrate($row, 0, true); // rehydrate\n\t\t\t} else {\n\t\t\t\t$cls = TbprofessorPeer::getOMClass(false);\n\n\t\t\t\t$obj1 = new $cls();\n\t\t\t\t$obj1->hydrate($row);\n\t\t\t\tTbprofessorPeer::addInstanceToPool($obj1, $key1);\n\t\t\t} // if obj1 already loaded\n\n\t\t\t\t// Add objects for joined Tbcurso rows\n\n\t\t\t\t$key2 = TbcursoPeer::getPrimaryKeyHashFromRow($row, $startcol2);\n\t\t\t\tif ($key2 !== null) {\n\t\t\t\t\t$obj2 = TbcursoPeer::getInstanceFromPool($key2);\n\t\t\t\t\tif (!$obj2) {\n\t\n\t\t\t\t\t\t$cls = TbcursoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj2 = new $cls();\n\t\t\t\t\t$obj2->hydrate($row, $startcol2);\n\t\t\t\t\tTbcursoPeer::addInstanceToPool($obj2, $key2);\n\t\t\t\t} // if $obj2 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj2 (Tbcurso)\n\t\t\t\t$obj2->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbproftipovinculo rows\n\n\t\t\t\t$key3 = TbproftipovinculoPeer::getPrimaryKeyHashFromRow($row, $startcol3);\n\t\t\t\tif ($key3 !== null) {\n\t\t\t\t\t$obj3 = TbproftipovinculoPeer::getInstanceFromPool($key3);\n\t\t\t\t\tif (!$obj3) {\n\t\n\t\t\t\t\t\t$cls = TbproftipovinculoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj3 = new $cls();\n\t\t\t\t\t$obj3->hydrate($row, $startcol3);\n\t\t\t\t\tTbproftipovinculoPeer::addInstanceToPool($obj3, $key3);\n\t\t\t\t} // if $obj3 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj3 (Tbproftipovinculo)\n\t\t\t\t$obj3->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbformacao rows\n\n\t\t\t\t$key4 = TbformacaoPeer::getPrimaryKeyHashFromRow($row, $startcol4);\n\t\t\t\tif ($key4 !== null) {\n\t\t\t\t\t$obj4 = TbformacaoPeer::getInstanceFromPool($key4);\n\t\t\t\t\tif (!$obj4) {\n\t\n\t\t\t\t\t\t$cls = TbformacaoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj4 = new $cls();\n\t\t\t\t\t$obj4->hydrate($row, $startcol4);\n\t\t\t\t\tTbformacaoPeer::addInstanceToPool($obj4, $key4);\n\t\t\t\t} // if $obj4 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj4 (Tbformacao)\n\t\t\t\t$obj4->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbprofessorsituacao rows\n\n\t\t\t\t$key5 = TbprofessorsituacaoPeer::getPrimaryKeyHashFromRow($row, $startcol5);\n\t\t\t\tif ($key5 !== null) {\n\t\t\t\t\t$obj5 = TbprofessorsituacaoPeer::getInstanceFromPool($key5);\n\t\t\t\t\tif (!$obj5) {\n\t\n\t\t\t\t\t\t$cls = TbprofessorsituacaoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj5 = new $cls();\n\t\t\t\t\t$obj5->hydrate($row, $startcol5);\n\t\t\t\t\tTbprofessorsituacaoPeer::addInstanceToPool($obj5, $key5);\n\t\t\t\t} // if $obj5 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj5 (Tbprofessorsituacao)\n\t\t\t\t$obj5->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbsetor rows\n\n\t\t\t\t$key6 = TbsetorPeer::getPrimaryKeyHashFromRow($row, $startcol6);\n\t\t\t\tif ($key6 !== null) {\n\t\t\t\t\t$obj6 = TbsetorPeer::getInstanceFromPool($key6);\n\t\t\t\t\tif (!$obj6) {\n\t\n\t\t\t\t\t\t$cls = TbsetorPeer::getOMClass(false);\n\n\t\t\t\t\t$obj6 = new $cls();\n\t\t\t\t\t$obj6->hydrate($row, $startcol6);\n\t\t\t\t\tTbsetorPeer::addInstanceToPool($obj6, $key6);\n\t\t\t\t} // if $obj6 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj6 (Tbsetor)\n\t\t\t\t$obj6->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t$results[] = $obj1;\n\t\t}\n\t\t$stmt->closeCursor();\n\t\treturn $results;\n\t}", "protected function _prepareCollection() {\r\n $store = $this->_getStore();\r\n $collection = Mage::getModel('catalog/product')->getCollection()\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('attribute_set_id')\r\n ->addAttributeToSelect('type_id');\r\n\r\n if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) {\r\n $collection->joinField('qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id', '{{table}}.stock_id=1', 'left');\r\n }\r\n if ($store->getId()) {\r\n $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;\r\n $collection->addStoreFilter($store);\r\n $collection->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner', $adminStore);\r\n $collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId());\r\n $collection->joinAttribute('reqcoupon_status', 'catalog_product/reqcoupon_status', 'entity_id', null, 'left');\r\n } else {\r\n $collection->addAttributeToSelect('price');\r\n $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');\r\n $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');\r\n $collection->joinAttribute('reqcoupon_status', 'catalog_product/reqcoupon_status', 'entity_id', null, 'left');\r\n }\r\n\r\n $this->setCollection($collection);\r\n\r\n parent::_prepareCollection();\r\n $this->getCollection()->addWebsiteNamesToResult();\r\n return $this;\r\n }", "public function build_relationship()\n {\n $joins = array();\n\n $main_table = strtolower($this->_model->clean_table());\n\n foreach ($this->associations as $one) {\n\n if (!!$one) {\n $table = strtolower(DB_SUFFIX.'_'.$one);\n\n $clean_one = str_replace( DB_SUFFIX .'_', '', $table );\n\n $joins[] = 'LEFT JOIN '.$table.' ON '.DB_SUFFIX.'_'.$main_table.'.'.$clean_one.'_id = '.$table.'.id';\n\n // Set the columns within the one loop\n $this->get_has_one_columns($one);\n }\n }\n\n if ( count($joins) > 0 ) {\n $result = implode( ' ', $joins );\n } else {\n $result = false;\n }\n\n return $result;\n }", "function qode_woo_related_products_args( $args ) {\n global $qode_options_proya;\n\n\t\t$args['posts_per_page'] = 4;\n\n if(isset($qode_options_proya['woo_products_list_number']) && $qode_options_proya['woo_products_list_number'] != ''){\n switch($qode_options_proya['woo_products_list_number']){\n case('columns-3') :\n $args['posts_per_page'] = 3;\n break;\n case('columns-4') :\n $args['posts_per_page'] = 4;\n break;\n default :\n $args['posts_per_page'] = 4;\n break;\n }\n }\n\n\t\treturn $args;\n\t}", "protected function fetchEmbed($embed)\n {\n //checks if the main model's primary key is set in settings\n if (empty($this->settings[self::SETTING_MAIN_MODEL_PRIMARY_KEY])){\n throw new \\Exception('No primary key detected for main model');\n }\n //checking if any main model data was fetched\n $primary_keys = array_keys($this->result);\n if (empty($primary_keys)){\n return;\n }\n\n $embed_arr = explode('.', $embed);\n\n $primary_key = $this->settings[self::SETTING_MAIN_MODEL_PRIMARY_KEY];\n $innermost_embed = $embed_arr[count($embed_arr) - 1];\n $columns = [\"$this->main_model.$primary_key\", \"{$innermost_embed}.*\"];\n\n $this->main_model_obj = new $this->main_model();\n $manager = $this->main_model_obj->getModelsManager();\n\n //checking if $embed is a valid relation of the main model\n $relation = $this->getValidRelation($embed_arr);\n if (empty($relation)){\n return;\n }\n\n //forming the builder\n $builder = $manager->createBuilder()\n ->columns($columns)\n ->from($this->main_model);\n\n $this->join_models = [];\n $this->formJoins($builder, $embed_arr);\n\n //using the primary keys of the main model to fetch the relevant related data\n $filters[] = [\n self::FILTER_PARAM_FIELD => \"$this->main_model.$primary_key\",\n self::FILTER_PARAM_VALUE => $primary_keys,\n self::FILTER_PARAM_COMPARATOR => self::CMP_EQUALS,\n self::FILTER_PARAM_CONDITION => self::COND_AND,\n ];\n $this->formConditions($builder, $filters);\n\n $result_set = $builder->getQuery()->execute();\n\n $is_array = in_array($relation->getType(), [Relation::HAS_MANY, Relation::HAS_MANY_THROUGH]);\n\n //Add init data for the embeds in the result\n foreach ($this->result as $key => $item){\n $this->result[$key][$embed] = ($is_array) ? [] : null;\n }\n\n //Fill in data\n foreach ($result_set as $result_obj){\n if ($is_array){\n $this->result[$result_obj[$primary_key]][$embed][] = $result_obj[lcfirst($innermost_embed)]->toArray();\n } else {\n $this->result[$result_obj[$primary_key]][$embed] = $result_obj[lcfirst($innermost_embed)]->toArray();\n }\n }\n }", "protected static function define_related() {\n return [\n 'capabilitymanager' => 'mod_forum\\local\\managers\\capability',\n 'readreceiptcollection' => 'mod_forum\\local\\entities\\post_read_receipt_collection?',\n 'urlfactory' => 'mod_forum\\local\\factories\\url',\n 'forum' => 'mod_forum\\local\\entities\\forum',\n 'discussion' => 'mod_forum\\local\\entities\\discussion',\n 'author' => 'mod_forum\\local\\entities\\author',\n 'authorcontextid' => 'int?',\n 'user' => 'stdClass',\n 'context' => 'context',\n 'authorgroups' => 'stdClass[]',\n 'attachments' => '\\stored_file[]?',\n 'tags' => '\\core_tag_tag[]?',\n 'rating' => 'rating?',\n 'includehtml' => 'bool'\n ];\n }", "public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }", "public static function doSelectJoinAllExceptTbproftipovinculo(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\t\t$criteria = clone $criteria;\n\n\t\t// Set the correct dbName if it has not been overridden\n\t\t// $criteria->getDbName() will return the same object if not set to another value\n\t\t// so == check is okay and faster\n\t\tif ($criteria->getDbName() == Propel::getDefaultDB()) {\n\t\t\t$criteria->setDbName(self::DATABASE_NAME);\n\t\t}\n\n\t\tTbprofessorPeer::addSelectColumns($criteria);\n\t\t$startcol2 = (TbprofessorPeer::NUM_COLUMNS - TbprofessorPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbnecesespecialPeer::addSelectColumns($criteria);\n\t\t$startcol3 = $startcol2 + (TbnecesespecialPeer::NUM_COLUMNS - TbnecesespecialPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbcursoPeer::addSelectColumns($criteria);\n\t\t$startcol4 = $startcol3 + (TbcursoPeer::NUM_COLUMNS - TbcursoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbformacaoPeer::addSelectColumns($criteria);\n\t\t$startcol5 = $startcol4 + (TbformacaoPeer::NUM_COLUMNS - TbformacaoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbprofessorsituacaoPeer::addSelectColumns($criteria);\n\t\t$startcol6 = $startcol5 + (TbprofessorsituacaoPeer::NUM_COLUMNS - TbprofessorsituacaoPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\tTbsetorPeer::addSelectColumns($criteria);\n\t\t$startcol7 = $startcol6 + (TbsetorPeer::NUM_COLUMNS - TbsetorPeer::NUM_LAZY_LOAD_COLUMNS);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_NECES_ESPECIAL, TbnecesespecialPeer::ID_NECES_ESPECIAL, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::COD_CURSO, TbcursoPeer::COD_CURSO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_FORMACAO, TbformacaoPeer::ID_FORMACAO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_PROF_SIT, TbprofessorsituacaoPeer::ID_SITUACAO, $join_behavior);\n\n\t\t$criteria->addJoin(TbprofessorPeer::ID_SETOR, TbsetorPeer::ID_SETOR, $join_behavior);\n\n\t\t// symfony_behaviors behavior\n\t\tforeach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook)\n\t\t{\n\t\t call_user_func($sf_hook, 'BaseTbprofessorPeer', $criteria, $con);\n\t\t}\n\n\n\t\t$stmt = BasePeer::doSelect($criteria, $con);\n\t\t$results = array();\n\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$key1 = TbprofessorPeer::getPrimaryKeyHashFromRow($row, 0);\n\t\t\tif (null !== ($obj1 = TbprofessorPeer::getInstanceFromPool($key1))) {\n\t\t\t\t// We no longer rehydrate the object, since this can cause data loss.\n\t\t\t\t// See http://propel.phpdb.org/trac/ticket/509\n\t\t\t\t// $obj1->hydrate($row, 0, true); // rehydrate\n\t\t\t} else {\n\t\t\t\t$cls = TbprofessorPeer::getOMClass(false);\n\n\t\t\t\t$obj1 = new $cls();\n\t\t\t\t$obj1->hydrate($row);\n\t\t\t\tTbprofessorPeer::addInstanceToPool($obj1, $key1);\n\t\t\t} // if obj1 already loaded\n\n\t\t\t\t// Add objects for joined Tbnecesespecial rows\n\n\t\t\t\t$key2 = TbnecesespecialPeer::getPrimaryKeyHashFromRow($row, $startcol2);\n\t\t\t\tif ($key2 !== null) {\n\t\t\t\t\t$obj2 = TbnecesespecialPeer::getInstanceFromPool($key2);\n\t\t\t\t\tif (!$obj2) {\n\t\n\t\t\t\t\t\t$cls = TbnecesespecialPeer::getOMClass(false);\n\n\t\t\t\t\t$obj2 = new $cls();\n\t\t\t\t\t$obj2->hydrate($row, $startcol2);\n\t\t\t\t\tTbnecesespecialPeer::addInstanceToPool($obj2, $key2);\n\t\t\t\t} // if $obj2 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj2 (Tbnecesespecial)\n\t\t\t\t$obj2->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbcurso rows\n\n\t\t\t\t$key3 = TbcursoPeer::getPrimaryKeyHashFromRow($row, $startcol3);\n\t\t\t\tif ($key3 !== null) {\n\t\t\t\t\t$obj3 = TbcursoPeer::getInstanceFromPool($key3);\n\t\t\t\t\tif (!$obj3) {\n\t\n\t\t\t\t\t\t$cls = TbcursoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj3 = new $cls();\n\t\t\t\t\t$obj3->hydrate($row, $startcol3);\n\t\t\t\t\tTbcursoPeer::addInstanceToPool($obj3, $key3);\n\t\t\t\t} // if $obj3 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj3 (Tbcurso)\n\t\t\t\t$obj3->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbformacao rows\n\n\t\t\t\t$key4 = TbformacaoPeer::getPrimaryKeyHashFromRow($row, $startcol4);\n\t\t\t\tif ($key4 !== null) {\n\t\t\t\t\t$obj4 = TbformacaoPeer::getInstanceFromPool($key4);\n\t\t\t\t\tif (!$obj4) {\n\t\n\t\t\t\t\t\t$cls = TbformacaoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj4 = new $cls();\n\t\t\t\t\t$obj4->hydrate($row, $startcol4);\n\t\t\t\t\tTbformacaoPeer::addInstanceToPool($obj4, $key4);\n\t\t\t\t} // if $obj4 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj4 (Tbformacao)\n\t\t\t\t$obj4->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbprofessorsituacao rows\n\n\t\t\t\t$key5 = TbprofessorsituacaoPeer::getPrimaryKeyHashFromRow($row, $startcol5);\n\t\t\t\tif ($key5 !== null) {\n\t\t\t\t\t$obj5 = TbprofessorsituacaoPeer::getInstanceFromPool($key5);\n\t\t\t\t\tif (!$obj5) {\n\t\n\t\t\t\t\t\t$cls = TbprofessorsituacaoPeer::getOMClass(false);\n\n\t\t\t\t\t$obj5 = new $cls();\n\t\t\t\t\t$obj5->hydrate($row, $startcol5);\n\t\t\t\t\tTbprofessorsituacaoPeer::addInstanceToPool($obj5, $key5);\n\t\t\t\t} // if $obj5 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj5 (Tbprofessorsituacao)\n\t\t\t\t$obj5->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t\t// Add objects for joined Tbsetor rows\n\n\t\t\t\t$key6 = TbsetorPeer::getPrimaryKeyHashFromRow($row, $startcol6);\n\t\t\t\tif ($key6 !== null) {\n\t\t\t\t\t$obj6 = TbsetorPeer::getInstanceFromPool($key6);\n\t\t\t\t\tif (!$obj6) {\n\t\n\t\t\t\t\t\t$cls = TbsetorPeer::getOMClass(false);\n\n\t\t\t\t\t$obj6 = new $cls();\n\t\t\t\t\t$obj6->hydrate($row, $startcol6);\n\t\t\t\t\tTbsetorPeer::addInstanceToPool($obj6, $key6);\n\t\t\t\t} // if $obj6 already loaded\n\n\t\t\t\t// Add the $obj1 (Tbprofessor) to the collection in $obj6 (Tbsetor)\n\t\t\t\t$obj6->addTbprofessor($obj1);\n\n\t\t\t} // if joined row is not null\n\n\t\t\t$results[] = $obj1;\n\t\t}\n\t\t$stmt->closeCursor();\n\t\treturn $results;\n\t}", "public static function doSelectJoinMission(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\n foreach (sfMixer::getCallables('BaseMissionPhotoPeer:doSelectJoin:doSelectJoin') as $callable)\n {\n call_user_func($callable, 'BaseMissionPhotoPeer', $c, $con);\n }\n\n\n\t\t$c = clone $c;\n\n\t\t// Set the correct dbName if it has not been overridden\n\t\tif ($c->getDbName() == Propel::getDefaultDB()) {\n\t\t\t$c->setDbName(self::DATABASE_NAME);\n\t\t}\n\n\t\tMissionPhotoPeer::addSelectColumns($c);\n\t\t$startcol = (MissionPhotoPeer::NUM_COLUMNS - MissionPhotoPeer::NUM_LAZY_LOAD_COLUMNS);\n\t\tMissionPeer::addSelectColumns($c);\n\n\t\t$c->addJoin(array(MissionPhotoPeer::MISSION_ID,), array(MissionPeer::ID,), $join_behavior);\n\t\t$stmt = BasePeer::doSelect($c, $con);\n\t\t$results = array();\n\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$key1 = MissionPhotoPeer::getPrimaryKeyHashFromRow($row, 0);\n\t\t\tif (null !== ($obj1 = MissionPhotoPeer::getInstanceFromPool($key1))) {\n\t\t\t\t// We no longer rehydrate the object, since this can cause data loss.\n\t\t\t\t// See http://propel.phpdb.org/trac/ticket/509\n\t\t\t\t// $obj1->hydrate($row, 0, true); // rehydrate\n\t\t\t} else {\n\n\t\t\t\t$omClass = MissionPhotoPeer::getOMClass();\n\n\t\t\t\t$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);\n\t\t\t\t$obj1 = new $cls();\n\t\t\t\t$obj1->hydrate($row);\n\t\t\t\tMissionPhotoPeer::addInstanceToPool($obj1, $key1);\n\t\t\t} // if $obj1 already loaded\n\n\t\t\t$key2 = MissionPeer::getPrimaryKeyHashFromRow($row, $startcol);\n\t\t\tif ($key2 !== null) {\n\t\t\t\t$obj2 = MissionPeer::getInstanceFromPool($key2);\n\t\t\t\tif (!$obj2) {\n\n\t\t\t\t\t$omClass = MissionPeer::getOMClass();\n\n\t\t\t\t\t$cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1);\n\t\t\t\t\t$obj2 = new $cls();\n\t\t\t\t\t$obj2->hydrate($row, $startcol);\n\t\t\t\t\tMissionPeer::addInstanceToPool($obj2, $key2);\n\t\t\t\t} // if obj2 already loaded\n\n\t\t\t\t// Add the $obj1 (MissionPhoto) to $obj2 (Mission)\n\t\t\t\t$obj2->addMissionPhoto($obj1);\n\n\t\t\t} // if joined row was not null\n\n\t\t\t$results[] = $obj1;\n\t\t}\n\t\t$stmt->closeCursor();\n\t\treturn $results;\n\t}", "private function addJoinsFromRelatedModel($relationship)\n {\n /** @var Loupe $model */\n foreach ($this->relationships as $model) {\n if (method_exists($model, $relationship)) {\n $model->$relationship();\n $statement = $this->getStatement();\n\n foreach ($model->getStatement()->getJoins() as $join) {\n $statement->setJoinString($join);\n }\n }\n }\n }", "public function buildRelations()\n {\n $this->addRelation('CiOptionsRelatedByIdOptionTipoAsociado', '\\\\CiOptions', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':id_option_tipo_asociado',\n 1 => ':id_option',\n ),\n), null, null, null, false);\n $this->addRelation('CiOptionsRelatedByIdOptionNivelAsociado', '\\\\CiOptions', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':id_option_nivel_asociado',\n 1 => ':id_option',\n ),\n), null, null, null, false);\n $this->addRelation('CiUsuariosRelatedByInvitadoPor', '\\\\CiUsuarios', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':invitado_por',\n 1 => ':id_usuario',\n ),\n), null, null, null, false);\n $this->addRelation('CiOptionsRelatedByIdOpcionRole', '\\\\CiOptions', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':id_opcion_role',\n 1 => ':id_option',\n ),\n), null, null, null, false);\n $this->addRelation('HbfTurnosRelatedByIdTurno', '\\\\HbfTurnos', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':id_turno',\n 1 => ':id_turno',\n ),\n), null, null, null, false);\n $this->addRelation('HbfSesionesRelatedByIdSesion', '\\\\HbfSesiones', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':id_sesion',\n 1 => ':id_sesion',\n ),\n), null, null, null, false);\n $this->addRelation('CiOptionsRelatedByIdTipoUsuario', '\\\\CiOptions', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':id_tipo_usuario',\n 1 => ':id_option',\n ),\n), null, null, null, false);\n $this->addRelation('HbfClubsRelatedByIdClub', '\\\\HbfClubs', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':id_club',\n 1 => ':id_club',\n ),\n), null, null, null, false);\n $this->addRelation('CiModulosRelatedByIdUserCreated', '\\\\CiModulos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'CiModulossRelatedByIdUserCreated', false);\n $this->addRelation('CiModulosRelatedByIdUserModified', '\\\\CiModulos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'CiModulossRelatedByIdUserModified', false);\n $this->addRelation('CiOptionsRelatedByIdUserCreated', '\\\\CiOptions', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'CiOptionssRelatedByIdUserCreated', false);\n $this->addRelation('CiOptionsRelatedByIdUserModified', '\\\\CiOptions', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'CiOptionssRelatedByIdUserModified', false);\n $this->addRelation('CiSessions', '\\\\CiSessions', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_usuario',\n 1 => ':id_usuario',\n ),\n), null, null, 'CiSessionss', false);\n $this->addRelation('CiSettingsRelatedByIdUserCreated', '\\\\CiSettings', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'CiSettingssRelatedByIdUserCreated', false);\n $this->addRelation('CiSettingsRelatedByIdUserModified', '\\\\CiSettings', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'CiSettingssRelatedByIdUserModified', false);\n $this->addRelation('CiUsuariosRelatedByIdUsuario', '\\\\CiUsuarios', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':invitado_por',\n 1 => ':id_usuario',\n ),\n), null, null, 'CiUsuariossRelatedByIdUsuario', false);\n $this->addRelation('HbfClubsRelatedByIdUserCreated', '\\\\HbfClubs', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfClubssRelatedByIdUserCreated', false);\n $this->addRelation('HbfClubsRelatedByIdUserModified', '\\\\HbfClubs', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfClubssRelatedByIdUserModified', false);\n $this->addRelation('HbfComandasRelatedByIdUserCreated', '\\\\HbfComandas', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfComandassRelatedByIdUserCreated', false);\n $this->addRelation('HbfComandasRelatedByIdUserModified', '\\\\HbfComandas', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfComandassRelatedByIdUserModified', false);\n $this->addRelation('HbfComandasRelatedByIdCliente', '\\\\HbfComandas', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_cliente',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfComandassRelatedByIdCliente', false);\n $this->addRelation('HbfDetallesPedidosRelatedByIdUserCreated', '\\\\HbfDetallesPedidos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfDetallesPedidossRelatedByIdUserCreated', false);\n $this->addRelation('HbfDetallesPedidosRelatedByIdUserModified', '\\\\HbfDetallesPedidos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfDetallesPedidossRelatedByIdUserModified', false);\n $this->addRelation('HbfEgresosRelatedByIdUserCreated', '\\\\HbfEgresos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfEgresossRelatedByIdUserCreated', false);\n $this->addRelation('HbfEgresosRelatedByIdUserModified', '\\\\HbfEgresos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfEgresossRelatedByIdUserModified', false);\n $this->addRelation('HbfEgresosRelatedByIdCliente', '\\\\HbfEgresos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_cliente',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfEgresossRelatedByIdCliente', false);\n $this->addRelation('HbfIngresosRelatedByIdUserCreated', '\\\\HbfIngresos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfIngresossRelatedByIdUserCreated', false);\n $this->addRelation('HbfIngresosRelatedByIdUserModified', '\\\\HbfIngresos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfIngresossRelatedByIdUserModified', false);\n $this->addRelation('HbfIngresosRelatedByIdCliente', '\\\\HbfIngresos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_cliente',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfIngresossRelatedByIdCliente', false);\n $this->addRelation('HbfPorcionesRelatedByIdUserCreated', '\\\\HbfPorciones', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfPorcionessRelatedByIdUserCreated', false);\n $this->addRelation('HbfPorcionesRelatedByIdUserModified', '\\\\HbfPorciones', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfPorcionessRelatedByIdUserModified', false);\n $this->addRelation('HbfPrepagosRelatedByIdCliente', '\\\\HbfPrepagos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_cliente',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfPrepagossRelatedByIdCliente', false);\n $this->addRelation('HbfPrepagosRelatedByIdUserCreated', '\\\\HbfPrepagos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfPrepagossRelatedByIdUserCreated', false);\n $this->addRelation('HbfPrepagosRelatedByIdUserModified', '\\\\HbfPrepagos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfPrepagossRelatedByIdUserModified', false);\n $this->addRelation('HbfProductosRelatedByIdUserCreated', '\\\\HbfProductos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfProductossRelatedByIdUserCreated', false);\n $this->addRelation('HbfProductosRelatedByIdUserModified', '\\\\HbfProductos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfProductossRelatedByIdUserModified', false);\n $this->addRelation('HbfSesionesRelatedByIdUserCreated', '\\\\HbfSesiones', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfSesionessRelatedByIdUserCreated', false);\n $this->addRelation('HbfSesionesRelatedByIdUserModified', '\\\\HbfSesiones', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfSesionessRelatedByIdUserModified', false);\n $this->addRelation('HbfSesionesRelatedByIdAsociado', '\\\\HbfSesiones', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_asociado',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfSesionessRelatedByIdAsociado', false);\n $this->addRelation('HbfTurnosRelatedByIdUserCreated', '\\\\HbfTurnos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfTurnossRelatedByIdUserCreated', false);\n $this->addRelation('HbfTurnosRelatedByIdUserModified', '\\\\HbfTurnos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfTurnossRelatedByIdUserModified', false);\n $this->addRelation('HbfTurnosRelatedByIdAsociado', '\\\\HbfTurnos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_asociado',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfTurnossRelatedByIdAsociado', false);\n $this->addRelation('HbfVasosRelatedByIdUserModified', '\\\\HbfVasos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), 'CASCADE', 'CASCADE', 'HbfVasossRelatedByIdUserModified', false);\n $this->addRelation('HbfVasosRelatedByIdUserCreated', '\\\\HbfVasos', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), 'CASCADE', 'CASCADE', 'HbfVasossRelatedByIdUserCreated', false);\n $this->addRelation('HbfVentasRelatedByIdUserCreated', '\\\\HbfVentas', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_created',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfVentassRelatedByIdUserCreated', false);\n $this->addRelation('HbfVentasRelatedByIdUserModified', '\\\\HbfVentas', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_user_modified',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfVentassRelatedByIdUserModified', false);\n $this->addRelation('HbfVentasRelatedByIdCliente', '\\\\HbfVentas', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':id_cliente',\n 1 => ':id_usuario',\n ),\n), null, null, 'HbfVentassRelatedByIdCliente', false);\n }", "protected function _buildListJoin($options)\n\t{\n\t\t$join = array();\n\n\t\t// aggregate clauses\n\t\t$join = (count($join) ? ' ' . implode(' ', $join) : '');\n\n\t\treturn $join;\n\t}", "public static function adjacent_post_link_join( $join) {\n $post = get_post();\n // only make changes if we are talking about event posts\n if ( self::$o->core_post_type == $post->post_type ) {\n $wpdb='';\n // using start date as the sorter not the post_date\n $join .= $wpdb->prepare( ' inner join ' . $wpdb->postmeta . ' as qspm on qspm.post_id = p.ID AND qspm.meta_key = %s', '_start' );\n }\n\n return $join;\n }", "public function prepareQuery()\n {\n $query = $this->model->newQuery();\n $primaryTable = $this->model->getTable();\n $selects = [$primaryTable.'.*'];\n $joins = [];\n $withs = [];\n\n /**\n * @event backend.list.extendQueryBefore\n * Provides an opportunity to modify the `$query` object before the List widget applies its scopes to it.\n *\n * Example usage:\n *\n * Event::listen('backend.list.extendQueryBefore', function($listWidget, $query) {\n * $query->whereNull('deleted_at');\n * });\n *\n * Or\n *\n * $listWidget->bindEvent('list.extendQueryBefore', function ($query) {\n * $query->whereNull('deleted_at');\n * });\n *\n */\n $this->fireSystemEvent('backend.list.extendQueryBefore', [$query]);\n\n /*\n * Prepare searchable column names\n */\n $primarySearchable = [];\n $relationSearchable = [];\n\n $columnsToSearch = [];\n if (!empty($this->searchTerm) && ($searchableColumns = $this->getSearchableColumns())) {\n foreach ($searchableColumns as $column) {\n /*\n * Related\n */\n if ($this->isColumnRelated($column)) {\n $table = $this->model->makeRelation($column->relation)->getTable();\n $columnName = isset($column->sqlSelect)\n ? DbDongle::raw($this->parseTableName($column->sqlSelect, $table))\n : $table . '.' . $column->valueFrom;\n\n $relationSearchable[$column->relation][] = $columnName;\n }\n /*\n * Primary\n */\n else {\n $columnName = isset($column->sqlSelect)\n ? DbDongle::raw($this->parseTableName($column->sqlSelect, $primaryTable))\n : DbDongle::cast(Db::getTablePrefix() . $primaryTable . '.' . $column->columnName, 'TEXT');\n\n $primarySearchable[] = $columnName;\n }\n }\n }\n\n /*\n * Prepare related eager loads (withs) and custom selects (joins)\n */\n foreach ($this->getVisibleColumns() as $column) {\n\n // If useRelationCount is enabled, eager load the count of the relation into $relation_count\n if ($column->relation && @$column->config['useRelationCount']) {\n $query->withCount($column->relation);\n }\n\n if (!$this->isColumnRelated($column) || (!isset($column->sqlSelect) && !isset($column->valueFrom))) {\n continue;\n }\n\n if (isset($column->valueFrom)) {\n $withs[] = $column->relation;\n }\n\n $joins[] = $column->relation;\n }\n\n /*\n * Add eager loads to the query\n */\n if ($withs) {\n $query->with(array_unique($withs));\n }\n\n /*\n * Apply search term\n */\n $query->where(function ($innerQuery) use ($primarySearchable, $relationSearchable, $joins) {\n\n /*\n * Search primary columns\n */\n if (count($primarySearchable) > 0) {\n $this->applySearchToQuery($innerQuery, $primarySearchable, 'or');\n }\n\n /*\n * Search relation columns\n */\n if ($joins) {\n foreach (array_unique($joins) as $join) {\n /*\n * Apply a supplied search term for relation columns and\n * constrain the query only if there is something to search for\n */\n $columnsToSearch = array_get($relationSearchable, $join, []);\n\n if (count($columnsToSearch) > 0) {\n $innerQuery->orWhereHas($join, function ($_query) use ($columnsToSearch) {\n $this->applySearchToQuery($_query, $columnsToSearch);\n });\n }\n }\n }\n\n });\n\n /*\n * Custom select queries\n */\n foreach ($this->getVisibleColumns() as $column) {\n if (!isset($column->sqlSelect)) {\n continue;\n }\n\n $alias = $query->getQuery()->getGrammar()->wrap($column->columnName);\n\n /*\n * Relation column\n */\n if (isset($column->relation)) {\n\n // @todo Find a way...\n $relationType = $this->model->getRelationType($column->relation);\n if ($relationType == 'morphTo') {\n throw new ApplicationException('The relationship morphTo is not supported for list columns.');\n }\n\n $table = $this->model->makeRelation($column->relation)->getTable();\n $sqlSelect = $this->parseTableName($column->sqlSelect, $table);\n\n /*\n * Manipulate a count query for the sub query\n */\n $relationObj = $this->model->{$column->relation}();\n $countQuery = $relationObj->getRelationExistenceQuery($relationObj->getRelated()->newQueryWithoutScopes(), $query);\n\n $joinSql = $this->isColumnRelated($column, true)\n ? DbDongle::raw(\"group_concat(\" . $sqlSelect . \" separator ', ')\")\n : DbDongle::raw($sqlSelect);\n\n $joinSql = $countQuery->select($joinSql)->toSql();\n\n $selects[] = Db::raw(\"(\".$joinSql.\") as \".$alias);\n }\n /*\n * Primary column\n */\n else {\n $sqlSelect = $this->parseTableName($column->sqlSelect, $primaryTable);\n $selects[] = DbDongle::raw($sqlSelect . ' as '. $alias);\n }\n }\n\n /*\n * Apply sorting\n */\n if (($sortColumn = $this->getSortColumn()) && !$this->showTree) {\n if (($column = array_get($this->allColumns, $sortColumn)) && $column->valueFrom) {\n $sortColumn = $this->isColumnPivot($column)\n ? 'pivot_' . $column->valueFrom\n : $column->valueFrom;\n }\n\n // Set the sorting column to $relation_count if useRelationCount enabled\n if (isset($column->relation) && @$column->config['useRelationCount']) {\n $sortColumn = $column->relation . '_count';\n }\n\n $query->orderBy($sortColumn, $this->sortDirection);\n }\n\n /*\n * Apply filters\n */\n foreach ($this->filterCallbacks as $callback) {\n $callback($query);\n }\n\n /*\n * Add custom selects\n */\n $query->addSelect($selects);\n\n /**\n * @event backend.list.extendQuery\n * Provides an opportunity to modify and / or return the `$query` object after the List widget has applied its scopes to it and before it's used to get the records.\n *\n * Example usage:\n *\n * Event::listen('backend.list.extendQuery', function($listWidget, $query) {\n * $newQuery = MyModel::newQuery();\n * return $newQuery;\n * });\n *\n * Or\n *\n * $listWidget->bindEvent('list.extendQuery', function ($query) {\n * $query->whereNull('deleted_at');\n * });\n *\n */\n if ($event = $this->fireSystemEvent('backend.list.extendQuery', [$query])) {\n return $event;\n }\n\n return $query;\n }", "protected function performJoins()\n {\n $query = $this->query;\n\n $predecessor = $this->related;\n\n $this->through_parents->each(function ($model) use ($query, &$predecessor) {\n $first = $predecessor->getQualifiedKeyName();\n $joined = $model->qualifyColumn($this->getForeignKeyName($predecessor));\n\n $query->join($model->getTable(), $first, '=', $joined);\n\n if ($this->hasSoftDeletes($model)) {\n $this->query->whereNull($model->getQualifiedDeletedAtColumn());\n }\n\n $predecessor = $model;\n });\n }" ]
[ "0.7175714", "0.62025326", "0.581619", "0.5640511", "0.54304636", "0.54155344", "0.5397928", "0.533658", "0.52564746", "0.5173649", "0.5170302", "0.51318073", "0.51253426", "0.5124503", "0.51053363", "0.50987583", "0.50969017", "0.50929284", "0.50205624", "0.5015671", "0.49824086", "0.49017128", "0.48819405", "0.48462886", "0.48331538", "0.47928935", "0.47923848", "0.4789491", "0.47341558", "0.47256085", "0.47226503", "0.47208145", "0.47072563", "0.4698487", "0.46963158", "0.46946067", "0.468928", "0.4685954", "0.46633407", "0.46587428", "0.46582747", "0.4654689", "0.4647503", "0.46451515", "0.46442664", "0.4643526", "0.4636348", "0.46278068", "0.4617084", "0.46161255", "0.46160367", "0.46113855", "0.46050137", "0.4602677", "0.45987353", "0.4595701", "0.45915377", "0.45911223", "0.45811656", "0.4578668", "0.45721838", "0.45714423", "0.45611385", "0.45594534", "0.45339224", "0.45317826", "0.4530209", "0.4525427", "0.4523365", "0.45208427", "0.45201933", "0.45183682", "0.4515123", "0.44990018", "0.44976732", "0.4495735", "0.44865015", "0.44829753", "0.44810003", "0.44794154", "0.4479292", "0.44767153", "0.4475247", "0.44722828", "0.44705585", "0.4469806", "0.4468381", "0.44643798", "0.4461298", "0.44584045", "0.44564366", "0.445501", "0.44539517", "0.4445789", "0.44456798", "0.44435188", "0.44425473", "0.44352582", "0.44348678", "0.44340044" ]
0.59096897
2
Prepares a set of conditions against which to select albums.
public function prepareAlbumConditions(array $conditions, array &$fetchOptions) { $db = $this->_getDb(); $sqlConditions = array(); if (!empty($fetchOptions['join'])) { if ($fetchOptions['join'] & self::FETCH_PRIVACY) { $viewingUser = $this->standardizeViewingUserReference(); if (!XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'viewOverride')) { $userId = 0; if (isset($conditions['privacyUserId'])) { $userId = $conditions['privacyUserId']; } $sqlConditions[] = ' private.private_user_id IS NOT NULL OR shared.shared_user_id IS NOT NULL OR album.album_privacy = \'public\' OR IF(album.album_privacy = \'members\', EXISTS(SELECT user_id FROM xf_user WHERE user_id = ' . $db->quote($userId) . '), NULL) '; } } } if (!empty($conditions['user_id'])) { if (is_array($conditions['user_id'])) { $sqlConditions[] = 'album.user_id IN (' . $db->quote($conditions['user_id']) . ')'; } else { $sqlConditions[] = 'album.user_id = ' . $db->quote($conditions['user_id']); } } if (!empty($conditions['album_media_count'])) { $sqlConditions[] = 'album.album_media_count ' . $conditions['album_media_count']; } if (!empty($conditions['shared_user_id'])) { if (is_array($conditions['shared_user_id'])) { $sqlConditions[] = 'shared.shared_user_id IN (' . $db->quote($conditions['shared_user_id']) . ')'; } else { $sqlConditions[] = 'shared.shared_user_id = ' . $db->quote($conditions['shared_user_id']); } if (!is_array($conditions['shared_user_id'])) { $sqlConditions[] = 'album.user_id != ' . $db->quote($conditions['shared_user_id']); } } if (!empty($conditions['album_id'])) { if (is_array($conditions['album_id'])) { $sqlConditions[] = 'album.album_id IN (' . $db->quote($conditions['album_id']) . ')'; } else { $sqlConditions[] = 'album.album_id = ' . $db->quote($conditions['album_id']); } } if (!empty($conditions['album_privacy'])) { if (is_array($conditions['album_privacy'])) { $sqlConditions[] = 'album.album_privacy IN (' . $db->quote($conditions['album_privacy']) . ')'; } else { $sqlConditions[] = 'album.album_privacy = ' . $db->quote($conditions['album_privacy']); } } if (!empty($conditions['public'])) { $sqlConditions[] = "album.album_privacy = 'public'"; } return $this->getConditionsForClause($sqlConditions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareAlbumCommentConditionsCustomized(array &$sqlConditions, array $conditions, array $fetchOptions)\n {\n }", "public function prepareAlbumFetchOptions(array $fetchOptions, array $conditions = array())\n\t{\n\t\t\t\t\n\t\t$selectFields = '';\n\t\t$joinTables = '';\t\t\n\t\t$orderBy = '';\n\t\t\n\t\tif (!empty($fetchOptions['order']))\n\t\t{\n\t\t\t$orderBySecondary = '';\n\n\t\t\tswitch ($fetchOptions['order'])\n\t\t\t{\n\t\t\t\tcase 'rand':\n\t\t\t\t\t$orderBy = 'RAND()';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'album_create_date':\n\t\t\t\tcase 'new':\n\t\t\t\tdefault:\n\t\t\t\t\t$orderBy = 'album.album_create_date';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'album_id':\n\t\t\t\t\t$orderBy = 'album.album_create_date';\n\t\t\t\t\t$orderBySecondary = ', album.album_id DESC';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'rating_avg':\n\t\t\t\t\t$orderBy = 'album.album_rating_avg';\n\t\t\t\t\t$orderBySecondary = ', album.album_create_date DESC';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'comment_count':\n\t\t\t\t\t$orderBy = 'album.album_comment_count';\n\t\t\t\t\t$orderBySecondary = ', album.album_create_date DESC';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'view_count':\n\t\t\t\t\t$orderBy = 'album.album_view_count';\n\t\t\t\t\t$orderBySecondary = ', album.album_create_date DESC';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'media_count':\n\t\t\t\t\t$orderBy = 'album.album_media_count';\n\t\t\t\t\t$orderBySecondary = ', album.album_media_count DESC';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'rating_count':\n\t\t\t\t\t$orderBy = 'album.album_rating_count';\n\t\t\t\t\t$orderBySecondary = ', album.album_create_date DESC';\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tcase 'likes':\n\t\t\t\t\t$orderBy = 'album.album_likes';\n\t\t\t\t\t$orderBySecondary = ', album.album_create_date DESC';\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\tif (!isset($fetchOptions['orderDirection']) || $fetchOptions['orderDirection'] == 'desc')\n\t\t\t{\n\t\t\t\t$orderBy .= ' DESC';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$orderBy .= ' ASC';\n\t\t\t}\n\t\t\t\n\t\t\t$orderBy .= $orderBySecondary;\n\t\t}\n\n\t\tif (!empty($fetchOptions['join']))\n\t\t{\n\t\t\tif (($fetchOptions['join'] & self::FETCH_PRIVACY)\n\t\t\t\t&& isset($conditions['privacyUserId'])\n\t\t\t)\n\t\t\t{\n\t\t\t\t$selectFields .= ',\n\t\t\t\t\tshared.shared_user_id, private.private_user_id';\n\t\t\t\t$joinTables .= '\n\t\t\t\t\tLEFT JOIN xengallery_shared_map AS shared ON\n\t\t\t\t\t\t(shared.album_id = album.album_id AND shared.shared_user_id = ' . $this->_getDb()->quote($conditions['privacyUserId']) . ')\n\t\t\t\t\tLEFT JOIN xengallery_private_map AS private ON\n\t\t\t\t\t\t(private.album_id = album.album_id AND private.private_user_id = ' . $this->_getDb()->quote($conditions['privacyUserId']) .')';\n\t\t\t}\n\t\t\t\n\t\t\tif ($fetchOptions['join'] & self::FETCH_USER)\n\t\t\t{\n\t\t\t\t$selectFields .= ',\n\t\t\t\t\tuser.*, user_profile.*, IF(user.username IS NULL, album.username, user.username) AS username';\n\t\t\t\t$joinTables .= '\n\t\t\t\t\tLEFT JOIN xf_user AS user ON\n\t\t\t\t\t\t(user.user_id = album.user_id)\n\t\t\t\t\tLEFT JOIN xf_user_profile AS user_profile ON\n\t\t\t\t\t\t(user_profile.user_id = album.user_id)';\n\t\t\t}\n\t\t\t\n\t\t\tif ($fetchOptions['join'] & self::FETCH_USER_OPTION)\n\t\t\t{\n\t\t\t\t$selectFields .= ',\n\t\t\t\t\tuser_option.*';\n\t\t\t\t$joinTables .= '\n\t\t\t\t\tLEFT JOIN xf_user_option AS user_option ON\n\t\t\t\t\t\t(user_option.user_id = album.user_id)';\n\t\t\t}\n\t\t}\n\n\t\treturn array(\n\t\t\t'selectFields' => $selectFields,\n\t\t\t'joinTables' => $joinTables,\n\t\t\t'orderClause' => ($orderBy ? \"ORDER BY $orderBy\" : '')\n\t\t);\n\t}", "function prepare_albums(?Collection $albums)\n\t{\n\n\t\t$return = array();\n\n\t\tif ($albums != null) {\n\t\t\t// For each album\n\t\t\tforeach ($albums as $album_model) {\n\n\t\t\t\t// Turn data from the database into a front-end friendly format\n\t\t\t\t$album = $album_model->prepareData();\n\t\t\t\t$album['albums'] = $album_model->get_albums();\n\n\t\t\t\t// Thumbs\n\t\t\t\tif ((!Session::get('login') && $album_model->password === null) ||\n\t\t\t\t\t(Session::get('login'))) {\n\n\t\t\t\t\t$album['sysstamp'] = $album_model['created_at'];\n\t\t\t\t\t$album = $album_model->gen_thumbs($album);\n\t\t\t\t}\n\n\t\t\t\t// Add to return\n\t\t\t\t$return[] = $album;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "protected function _preparePaidContentItemConditions(array $conditions, array &$fetchOptions, array &$sqlConditions)\r\n {\r\n }", "protected function prepareFilters()\n {\n if(count($this->api_query) === 0){\n return;\n }\n\n // Matched WHERE filters would be all\n // that are not KEYWORDS (count, page, embed...)\n foreach($this->api_query as $column => $value) {\n if(in_array($column, $this->api_keyword_filters)){\n continue;\n }\n\n $this->where_filters[$column]= $value;\n }\n }", "abstract public function prepareFilters();", "protected function preparePublicAlbumAndHiddenAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID1);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID2, is_link_required: true);\n\t\t$this->photos_tests->set_star([$this->photoID2], true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "public function getAlbums(array $conditions = array(), array $fetchOptions = array())\n\t{\n\t\t$bind = array();\n\t\t\n\t\t$whereClause = $this->prepareAlbumConditions($conditions, $fetchOptions);\n\t\t\n\t\t$joinOptions = $this->prepareAlbumFetchOptions($fetchOptions, $conditions);\n\t\t$limitOptions = $this->prepareLimitFetchOptions($fetchOptions);\n\t\t$sqlClauses = $this->prepareAlbumFetchOptions($fetchOptions, $conditions);\n\n\t\t$albums = $this->fetchAllKeyed($this->limitQueryResults('\n\t\t\tSELECT album.*\n\t\t\t\t' . $joinOptions['selectFields'] . '\n\t\t\tFROM xengallery_album AS album\n\t\t\t\t' . $joinOptions['joinTables'] . '\n\t\t\t\tWHERE ' . $whereClause . '\n\t\t\t\t' . $sqlClauses['orderClause'] . '\t\t\t\n\t\t\t', $limitOptions['limit'], $limitOptions['offset']\n\t\t), 'album_id', $bind);\n\t\t\n\t\treturn $albums;\n\t}", "protected function setAlbumUidRestrictions()\n {\n $mediaAlbumsUids = GeneralUtility::trimExplode(',', $this->settings['mediaAlbumsUids'], true);\n $this->mediaAlbumRepository->setAlbumUids($mediaAlbumsUids);\n $this->mediaAlbumRepository->setUseAlbumUidsAsExclude(!empty($this->settings['useAlbumFilterAsExclude']));\n }", "protected function setConditions() {\r\n if( count($this->sqlConditions) ) {\r\n $this->sql .= ' WHERE ' . $this->sqlStrConditions;\r\n }\r\n }", "protected function _prepareSubset() {}", "protected function prepareThreePhotosInPublicAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID3 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_SUNSET_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->albums_tests->set_protection_policy($this->albumID1);\n\t\t$this->photos_tests->set_star([$this->photoID1], true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "public function setConditions(array $conditions);", "protected function prepareFilterQuery()\n\t{\n\t\t$filterQuery = array();\n\n\t\t$storeid = $this->getParam('storeid');\n\n\t\t$config = $this->getConfig();\n\n\t\t$websiteid = isset($config['stores'][$storeid]['website_id'])?$config['stores'][$storeid]['website_id']:0;\n\n\t\t$checkInstock = (int) $this->getConfigValue('check_instock');\n\n\t\t$filterQuery = array_merge($filterQuery, array(\n\t\t\t\t'store_id' => array($storeid),\n\t\t\t\t'website_id' => array($websiteid),\n\t\t\t\t'product_status' => array(1)\n\t\t));\n\n\t\tif ($checkInstock > 0) {\n\t\t\t$filterQuery['instock_int'] = array(1);\n\t\t}\n\n\t\t$filterQueryArray = array();\n\n\t\tforeach($filterQuery as $key=>$filterItem)\n\t\t{\n\n\t\t\tif(count($filterItem) > 0){\n\t\t\t\t$query = '';\n\t\t\t\tforeach($filterItem as $value){\n\t\t\t\t\t\t$query .= $key.':%22'.urlencode(trim(addslashes($value))).'%22+OR+';\n\t\t\t\t}\n\n\t\t\t\t$query = trim($query, '+OR+');\n\n\t\t\t\t$filterQueryArray[] = $query;\n\t\t\t}\n\t\t}\n\n\t\t$filterQueryString = '';\n\n\t\tif(count($filterQueryArray) > 0) {\n\t\t\tif(count($filterQueryArray) < 2) {\n\t\t\t\t$filterQueryString .= $filterQueryArray[0];\n\t\t\t}else{\n\t\t\t\t$filterQueryString .= '%28'.@implode('%29+AND+%28', $filterQueryArray).'%29';\n\t\t\t}\n\t\t}\n\n\t\t$this->filterQuery = $filterQueryString;\n\t}", "public function getConditionsHook()\n\t{\n\t\t$conditions = array();\n\t\t\n\t\t$conditions['select'] = '`bid` AS id, `cid`, `type`, `name`, `alias`, `imptotal`, `impmade`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`clicks`, `imageurl`, `clickurl`, `date`, `showBanner` AS state, `checked_out`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`checked_out_time`, `editor`, `custombannercode`, `catid`, `description`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`sticky`, `ordering`, `publish_up`, `publish_down`, `tags`, `params`'\t;\n\t\t\n\t\t$conditions['where'] = array();\n\t\t\n\t\treturn $conditions;\n\t}", "protected function _buildCondition(){\n \t$aryCondition = array();\n \t\n \tif(!empty($this->postData)){\n \t\t //search\n\t\t\t \t\t\t\n\t\t\tif($this->postData['title']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.title\"=>$this->postData['title']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['page']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.page\"=>$this->postData['page']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['code']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.code\"=>$this->postData['code']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['status']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.status\"=>$this->postData['status']);\n \t\t }\t\t\t\n\n \t}\n \treturn $aryCondition;\n }", "function build_sql_conditions( $args = array() ){\r\n\t\tglobal $wpdb;\r\n\t\t$events_table = $wpdb->prefix . EM_EVENTS_TABLE;\r\n\t\t$locations_table = $wpdb->prefix . EM_LOCATIONS_TABLE;\r\n\t\t\r\n\t\t$conditions = parent::build_sql_conditions($args);\r\n\t\t//eventful locations\r\n\t\tif( true == $args['eventful'] ){\r\n\t\t\t$conditions[] = \"{$events_table}.event_id IS NOT NULL\";\r\n\t\t}elseif( true == $args['eventless'] ){\r\n\t\t\t$conditions[] = \"{$events_table}.event_id IS NULL\";\r\n\t\t}\r\n\t\treturn $conditions;\r\n\t}", "protected function merge_conditions() {\n $args = func_get_args();\n $conditions = array_shift($args);\n foreach ($args as $otherconditions) {\n foreach ($otherconditions as $pageid => $pageconditions) {\n if (array_key_exists($pageid, $conditions)) {\n $conditions[$pageid] = array_merge($conditions[$pageid], $pageconditions);\n } else {\n $conditions[$pageid] = $pageconditions;\n }\n }\n }\n return $conditions;\n }", "function custom_conds( $conds = array())\n\t{\n\t\t// rating_id condition\n\t\tif ( isset( $conds['id'] )) {\n\t\t\t$this->db->where( 'id', $conds['id'] );\n\t\t}\n\n\t\t// user_id condition\n\t\tif ( isset( $conds['user_id'] )) {\n\t\t\t$this->db->where( 'user_id', $conds['user_id'] );\n\t\t}\n\n\t\t// shop_id condition\n\t\tif ( isset( $conds['shop_id'] )) {\n\t\t\t$this->db->where( 'shop_id', $conds['shop_id'] );\n\t\t}\n\n\t\t// rating condition\n\t\tif ( isset( $conds['rating'] )) {\n\t\t\t$this->db->where( 'rating', $conds['rating'] );\n\t\t}\n\n\t\t// title condition\n\t\tif ( isset( $conds['title'] )) {\n\t\t\t$this->db->where( 'title', $conds['title'] );\n\t\t}\n\n\t\t// description condition\n\t\tif ( isset( $conds['description'] )) {\n\t\t\t$this->db->where( 'description', $conds['description'] );\n\t\t}\n\n\t\t$this->db->order_by( 'added_date', 'desc' );\n\t}", "protected function preparePublicAlbumAndPasswordProtectedAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID1, password: TestConstants::ALBUM_PWD_1);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID2);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "protected function prepareThreeAlbumsWithMixedSharingAndPasswordProtection(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->albumID3 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_3)->offsetGet('id');\n\t\t// The mis-order of photos by there title (N, T, M) is on purpose such that\n\t\t// we first receive the result (N, T) as long as album 3 is locked and\n\t\t// then (M, N, T) after album 3 has been unlocked, with album 3\n\t\t// being in the front position.\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_NIGHT_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->photoID3 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID3)->offsetGet('id');\n\t\t$this->sharing_tests->add([$this->albumID1, $this->albumID2], [$this->userID]);\n\t\t// Sic! We use the same password for both albums here, because we want\n\t\t// to ensure that incidentally \"unlocking\" an album which is also\n\t\t// shared has no negative side effect.\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID2, is_nsfw: true, password: TestConstants::ALBUM_PWD_1);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID3, is_nsfw: true, password: TestConstants::ALBUM_PWD_1);\n\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "protected function prepare($conditions) {\n\t\tif(is_array($conditions) && !empty($conditions)) {\n\t\t\t$result = array(0 => \"\");\n\t\t\tforeach($conditions as $key=>$value) {\n\t\t\t\t$join = \"\";\n\t\t\t\tif(!empty($result[0])) { $join = \" AND \"; }\n\t\t\t\tif(!empty($result[0])) { $result[0] .= $join; }\n\n\t\t\t\t//Change from IN to single if only one element\n\t\t\t\tif(is_array($value) && sizeof($value) == 1) { $value = array_values($value); $value = $value[0]; } \n\t\t\t\t//Handle empty arrays\n\t\t\t\tif(is_array($value) && empty($value)) { continue; } \t\t\t\t\t\n\n\t\t\t\t//Handle special cases\n\t\t\t\tif(!is_array($value) && preg_match('!IS (NOT )?NULL!sim',$value)) {\n\t\t\t\t\t$result[0] .= \"$key $value\";\n\t\t\t\t}\n\t\t\t\t//Handle array of values\n\t\t\t\telse if(is_array($value)) {\n\t\t\t\t\t$instr = str_repeat('?,', count($value) - 1) . '?';\n\t\t\t\t\t$result[0] .= \"$key IN ($instr)\";\n\t\t\t\t\tforeach($value as $v) { $result[] = $v; }\n\t\t\t\t//Handle single value\n\t\t\t\t} else {\n\t\t\t\t\t$result[0] .= \"$key = ?\";\n\t\t\t\t\t$result[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(empty($result[0])) { return array(); }\n\t\t\treturn $result;\n\t\t}\n\t\treturn $conditions;\n\t}", "protected function preparePhotosInSharedAndPrivateAndRequireLinkAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->albumID3 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_3)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->photoID3 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_SUNSET_IMAGE), $this->albumID3)->offsetGet('id');\n\t\t$this->sharing_tests->add([$this->albumID1, $this->albumID3], [$this->userID]);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID3, is_link_required: true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "public function addConditions(array $conditions);", "public function preparePaidContentItemConditions(array $conditions, array &$fetchOptions)\r\n {\r\n $db = $this->_getDb();\r\n $sqlConditions = array();\r\n \r\n if (isset($conditions['paid_content_ids']) && !empty($conditions['paid_content_ids'])) {\r\n $sqlConditions[] = 'paid_content.paid_content_id IN (' . $db->quote($conditions['paid_content_ids']) . ')';\r\n } elseif (isset($conditions['paid_content_id'])) {\r\n $sqlConditions[] = 'paid_content.paid_content_id = ' . $db->quote($conditions['paid_content_id']);\r\n }\r\n \r\n if (isset($conditions['content_ids']) && !empty($conditions['content_ids'])) {\r\n $sqlConditions[] = 'paid_content.content_id IN (' . $db->quote($conditions['content_ids']) . ')';\r\n } elseif (isset($conditions['content_id'])) {\r\n $sqlConditions[] = 'paid_content.content_id = ' . $db->quote($conditions['content_id']);\r\n }\r\n \r\n if (isset($conditions['content_types']) && !empty($conditions['content_types'])) {\r\n $sqlConditions[] = 'paid_content.content_type IN (' . $db->quote($conditions['content_types']) . ')';\r\n } elseif (isset($conditions['content_type'])) {\r\n $sqlConditions[] = 'paid_content.content_type = ' . $db->quote($conditions['content_type']);\r\n }\r\n \r\n if (isset($conditions['start_date']) && is_array($conditions['start_date'])) {\r\n $isZero = '';\r\n if ($conditions['start_date'][0] == '>' || $conditions['start_date'][0] == '>=') {\r\n $isZero = 'paid_content.start_date = 0 OR ';\r\n }\r\n $sqlConditions[] = $isZero . $this->getCutOffCondition(\"paid_content.start_date\", $conditions['start_date']);\r\n }\r\n \r\n if (isset($conditions['end_date']) && is_array($conditions['end_date'])) {\r\n $isZero = '';\r\n if ($conditions['end_date'][0] == '>' || $conditions['end_date'][0] == '>=') {\r\n $isZero = 'paid_content.end_date = 0 OR ';\r\n }\r\n $sqlConditions[] = $isZero . $this->getCutOffCondition(\"paid_content.end_date\", $conditions['end_date']);\r\n }\r\n \r\n $this->_preparePaidContentItemConditions($conditions, $fetchOptions, $sqlConditions);\r\n \r\n return $this->getConditionsForClause($sqlConditions);\r\n }", "public static function getConditionsHook()\n\t{\n\t\t$conditions = array();\n\n\t\t$conditions['select'] = '`id`, `id` AS sid, `title`, \\'\\' AS `alias`, 1 AS parent_id, `section` AS extension, `description`, `published`, `checked_out`, `checked_out_time`, `access`, `params`, `section`';\n\n\t\t$where_or = array();\n\t\t$where_or[] = \"section REGEXP '^[\\\\-\\\\+]?[[:digit:]]*\\\\.?[[:digit:]]*$'\";\n\t\t$where_or[] = \"section IN ('com_banner', 'com_contact', 'com_contact_details', 'com_content', 'com_newsfeeds', 'com_sections', 'com_weblinks' )\";\n\t\t$conditions['where_or'] = $where_or;\n\n\t\t$conditions['order'] = \"id ASC, section ASC, ordering ASC\";\t\n\n\t\treturn $conditions;\n\t}", "protected function prepareSortCategories()\n {\n $queries = array();\n $queries[] = \"UPDATE oxcategories set OXSORT = (OXSORT+500)\";\n $queries[] = \"UPDATE oxcategories set OXSORT = 1 WHERE oxid = 'testcategory0'\";\n $queries[] = \"UPDATE oxcategories set OXSORT = 2 WHERE oxid = 'testcat3'\";\n $queries[] = \"UPDATE oxcategories set OXSORT = 3 WHERE oxid = 'testcat5'\";\n $queries[] = \"UPDATE oxcategories set OXSORT = 4 WHERE oxid = 'testcategory1'\";\n $queries[] = \"UPDATE oxcategories set OXSORT = 5 WHERE oxid = 'testcat1'\";\n $queries[] = \"UPDATE oxcategories set OXSORT = 6 WHERE oxid = 'testcat9'\";\n\n foreach ($queries as $query) {\n $this->executeSql($query);\n }\n }", "public function processOrCombination($collection, $conditions)\n {\n $fieldsConditions = [];\n $multiFieldsConditions = [];\n foreach ($conditions as $condition) {\n $attribute = $condition['attribute'];\n $cond = $condition['conditions'];\n $value = $condition['cvalue'];\n\n //ignore condition if value is null or empty\n if ($value == '' || $value == null) {\n continue;\n }\n\n if ($this->ruleType == self::REVIEW && isset($this->attributeMapForQuote[$attribute])) {\n $attribute = $this->attributeMapForOrder[$attribute];\n } elseif ($this->ruleType == self::ABANDONED && isset($this->attributeMapForOrder[$attribute])) {\n $attribute = $this->attributeMapForQuote[$attribute];\n } else {\n $this->productAttribute[] = $condition;\n continue;\n }\n\n if ($cond == 'null') {\n if ($value == '1') {\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = ['notnull' => true];\n continue;\n }\n $fieldsConditions[$attribute] = ['notnull' => true];\n } elseif ($value == '0') {\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = [$cond => true];\n continue;\n }\n $fieldsConditions[$attribute] = [$cond => true];\n }\n } else {\n if ($cond == 'like' || $cond == 'nlike') {\n $value = '%' . $value . '%';\n }\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = [$this->conditionMap[$cond] => $value];\n continue;\n }\n $fieldsConditions[$attribute]\n = [$this->conditionMap[$cond] => $value];\n }\n }\n /**\n * All rule conditions are combined into an array to yield an OR when passed\n * to `addFieldToFilter`. The exception is any 'like' or 'nlike' conditions,\n * which must be added as separate filters in order to have the AND logic.\n */\n if (!empty($fieldsConditions)) {\n $column = $cond = [];\n foreach ($fieldsConditions as $key => $fieldsCondition) {\n $type = key($fieldsCondition);\n if ($type == 'like' || $type == 'nlike') {\n $collection->addFieldToFilter(\n (string) $key,\n $fieldsCondition\n );\n } else {\n $column[] = (string) $key;\n $cond[] = $fieldsCondition;\n }\n if (!empty($multiFieldsConditions[$key])) {\n foreach ($multiFieldsConditions[$key] as $multiFieldsCondition) {\n $type = key($multiFieldsCondition);\n if ($type == 'like' || $type == 'nlike') {\n $collection->addFieldToFilter(\n (string) $key,\n $multiFieldsCondition\n );\n } else {\n $column[] = (string) $key;\n $cond[] = $multiFieldsCondition;\n }\n }\n }\n }\n if (!empty($column) && !empty($cond)) {\n $collection->addFieldToFilter(\n $column,\n $cond\n );\n }\n }\n return $this->processProductAttributes($collection);\n }", "function beforeFind($queryData) {\r\n\t\t\t\t\tif (is_array($queryData['conditions'])) {\r\n\t\t\t\t\t\t$queryData['conditions']['Auction.deleted']=0;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$queryData['conditions'].=' AND Auction.deleted=0';\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn $queryData;\r\n\t\t\t\t}", "function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"engine\",\n\t\t\t\"text\",\n\t\t);\n\t}", "function custom_conds( $conds = array()) {\n\n\t}", "protected function _prepareCollection()\n {\n $currentCampaign = Mage::getSingleton('adminhtml/session')->getCurrentCampaign();\n $collection = Mage::getModel('campaign/bannerslider')->getCollection();\n $collection->getSelect()\n ->joinLeft(array('campaign'=>$collection->getTable('campaign/campaign')),\n 'main_table.campaign_id = campaign.campaign_id', '')\n ->columns(array('campaign_name'=>'IF(main_table.campaign_id = \"'.$currentCampaign->getId().'\", \"Current\", campaign.name)'))\n ->group('main_table.bannerslider_id');\n $filter = Mage::registry('banner_reloaded_ids');\n if(!isset($filter)){//if reset no filter\n $selected_id = $this->_selectedId();\n if(!empty($selected_id)){\n $collection->addFieldToFilter('bannerslider_id', array('in'=>$selected_id));\n }\n }\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function prepareQuery()\n {\n //prepare where conditions\n foreach ($this->where as $where) {\n $this->prepareWhereCondition($where);\n }\n\n //prepare where not conditions\n foreach ($this->whereNot as $whereNot) {\n $this->prepareWhereNotCondition($whereNot);\n }\n\n // Add a basic range clause to the query\n foreach ($this->inRange as $inRange) {\n $this->prepareInRangeCondition($inRange);\n }\n\n // Add a basic not in range clause to the query\n foreach ($this->notInRange as $notInRange) {\n $this->prepareNotInRangeCondition($notInRange);\n }\n\n // add Terms to main query\n foreach ($this->whereTerms as $term) {\n $this->prepareWhereTermsCondition($term);\n }\n\n // add exists constrains to the query\n foreach ($this->exist as $exist) {\n $this->prepareExistCondition($exist);\n }\n\n // add matcher queries\n foreach ($this->match as $match) {\n $this->prepareMatchQueries($match);\n }\n\n $this->query->addFilter($this->filter);\n\n return $this->query;\n }", "protected function preparePublicUnsortedPhotoAndPhotoInSharedAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE))->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->sharing_tests->add([$this->albumID1], [$this->userID]);\n\t\t$this->photos_tests->set_public($this->photoID1, true);\n\t\t$this->photos_tests->set_star([$this->photoID1, $this->photoID2], true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "public function filterConditions($conditions)\n {\n $filter_fileds = array(\n 'order',\n 'limit',\n 'offset',\n 'page',\n );\n\n if ($conditions)\n {\n foreach ($conditions as $key => $val)\n {\n if (preg_match(\"/^_/\", $key))\n {\n unset($conditions[$key]);\n }\n\n if (in_array($key, $filter_fileds))\n {\n unset($conditions[$key]);\n }\n }\n }\n\n return $conditions;\n }", "function custom_conds( $conds = array())\n\t{\n\t\t// default where clause\n\t\tif ( !isset( $conds['no_publish_filter'] )) {\n\t\t\t$this->db->where( 'status', 1 );\n\t\t}\n\t\t\n\t\t// order by\n\t\tif ( isset( $conds['order_by'] )) {\n\t\t\t$order_by_field = $conds['order_by_field'];\n\t\t\t$order_by_type = $conds['order_by_type'];\n\t\t\t\n\t\t\t$this->db->order_by( 'rt_products.'.$order_by_field, $order_by_type);\n\t\t}\n\t\t// product id condition\n\t\tif ( isset( $conds['id'] )) {\n\t\t\t$this->db->where( 'id', $conds['id'] );\t\n\t\t}\n\n\t\t// category id condition\n\t\tif ( isset( $conds['cat_id'] )) {\n\t\t\t\n\t\t\tif ($conds['cat_id'] != \"\") {\n\t\t\t\tif($conds['cat_id'] != '0'){\n\t\t\t\t\t$this->db->where( 'cat_id', $conds['cat_id'] );\t\n\t\t\t\t}\n\n\t\t\t}\t\t\t\n\t\t}\n\n\t\t// sub category id condition \n\t\tif ( isset( $conds['sub_cat_id'] )) {\n\t\t\t\n\t\t\tif ($conds['sub_cat_id'] != \"\") {\n\t\t\t\tif($conds['sub_cat_id'] != '0'){\n\t\t\t\t\n\t\t\t\t\t$this->db->where( 'sub_cat_id', $conds['sub_cat_id'] );\t\n\t\t\t\t}\n\n\t\t\t}\t\t\t\n\t\t}\n\n\t\n\t\t// cat_ordering condition\n\t\tif ( isset( $conds['shop_id'] )) {\n\t\t\t$this->db->where( 'shop_id', $conds['shop_id'] );\n\t\t}\n\n\t\t// product_name condition\n\t\tif ( isset( $conds['name'] )) {\n\t\t\t$this->db->where( 'name', $conds['name'] );\n\t\t}\n\n\t\tif ( isset( $conds['desc'] )) {\n\t\t\t$this->db->where( 'description', $conds['desc'] );\n\t\t}\n\n\t\t// product keywords\n\t\tif ( isset( $conds['search_tag'] )) {\n\t\t\t$this->db->where( 'search_tag', $conds['search_tag'] );\n\t\t}\n\n\t\t// product highlight information condition\n\t\tif ( isset( $conds['info'] )) {\n\t\t\t$this->db->where( 'highlight_information', $conds['info'] );\n\t\t}\n\n\t\t// product code\n\t\tif ( isset( $conds['code'] )){\n\t\t\t$this->db->where( 'code', $conds['code'] );\n\t\t}\n\n\t\t// product unit_value condition\n\t\tif ( isset( $conds['product_unit_value'] )) {\n\t\t\t$this->db->where( 'product_unit_value', $conds['product_unit_value'] );\n\t\t}\n\n\t\t// product unit condition\n\t\tif ( isset( $conds['product_unit'] )) {\n\t\t\t$this->db->where( 'product_unit', $conds['product_unit'] );\n\t\t}\n\n\t\t// product minimum_order\n\t\tif ( isset( $conds['minimum_order'] )){\n\t\t\t$this->db->where( 'minimum_order', $conds['minimum_order'] );\n\t\t}\n\n\t\t// product maximum_order\n\t\tif ( isset( $conds['maximum_order'] )){\n\t\t\t$this->db->where( 'maximum_order', $conds['maximum_order'] );\n\t\t}\n\n\t\t// point condition\n\t\tif ( isset( $conds['price_min'] ) || isset( $conds['price_max'] )) {\n\t\t\t$this->db->where( 'unit_price >= ', $conds['price_min'] );\n\t\t\t$this->db->where( 'unit_price <= ', $conds['price_max'] );\n\t\t}\n\n\t\t// feature products\n\t\tif ( isset( $conds['is_featured'] )) {\n\t\t\t$this->db->where( 'is_featured', $conds['is_featured'] );\n\t\t}\n\n\t\t// rating condition\n\t\tif ( isset( $conds['rating_value'] ) ) {\n\t\t\t// For Rating value with comma 3,4,5\n\t\t\t// $rating_value = explode(',', $conds['rating_value']);\n\t\t\t// $this->db->where_in( 'overall_rating', $rating_value);\n\n\t\t\t// For single rating value\n\t\t\t$this->db->where( 'overall_rating >=', $conds['rating_value'] );\n\t\t}\n\t\t\n\t\t// discount products\n\t\tif ( $this->is_filter_discount( $conds )) {\n\t\t\t$this->db->where( 'is_discount', '1' );\t\n\t\t}\n\n\t\t// available products\n\t\tif ( isset( $conds['is_available'] )) {\n\t\t\t$this->db->where( 'is_available', $conds['is_available'] );\n\t\t}\n\n\t\t// searchterm\n\t\tif ( isset( $conds['searchterm'] )) {\n\t\t\t$this->db->like( 'name', $conds['searchterm'] );\n\t\t}\n\n\n\t\tif( isset($conds['min_price'])) {\n\n\t\t\t\n\t\t\tif( $conds['min_price'] != 0 ) {\n\t\t\t\t$this->db->where( 'unit_price >=', $conds['min_price'] );\n\t\t\t}\n\n\t\t}\n\n\t\tif( isset($conds['max_price'])) {\n\t\t\tif( $conds['max_price'] != 0 ) {\n\t\t\t\t$this->db->where( 'unit_price <=', $conds['max_price'] );\n\t\t\t}\t\n\n\t\t}\n\n\t\t// product shop_status\n\t\tif ( isset( $conds['shop_status'] )){\n\t\t\t$this->db->where( 'shop_status', $conds['shop_status'] );\n\t\t}\n\n\t\t$this->db->order_by('added_date', 'desc' );\n\n\n\t}", "function prepareCriteria ($criteria = []) {\n $defaultCriteria = config('main.criteria');\n\n if (!empty($criteria)) {\n switch (gettype($criteria)) {\n case 'array':\n $criteria = array_merge($defaultCriteria, (array) $criteria);\n\n if (!empty($criteria['fs'])){\n $criteria['fs'] = array_filter($criteria['fs']);\n }\n\n if (!empty($criteria['disp'])){\n $criteria['disp'] = array_filter($criteria['disp']);\n }\n\n if (empty($criteria['r']) || (int) $criteria['r'] <= 0){\n $criteria['r'] = config('main.criteria.r');\n } else {\n $criteria['r'] = (int) $criteria['r'];\n }\n\n if (empty($criteria['o'])){\n $criteria['o'] = config('main.criteria.o');\n }\n\n if (isset($criteria['d']) && ((int) $criteria['d'] !== 1 && (int) $criteria['d'] !== 0)){\n $criteria['d'] = config('main.criteria.d');\n }\n\n break;\n case 'string':\n $criteria = json_decode($criteria, true);\n\n if (empty($criteria['o'])){\n $criteria['o'] = config('main.criteria.o');\n }\n\n if (empty($criteria['r']) || (int) $criteria['r'] <= 0){\n $criteria['r'] = config('main.criteria.r');\n } else {\n $criteria['r'] = (int) $criteria['r'];\n }\n\n if (isset($criteria['d']) && ((int) $criteria['d'] !== 1 && (int) $criteria['d'] !== 0)){\n $criteria['d'] = config('main.criteria.d');\n }\n\n if (!empty($criteria['fs'])) {\n $criteria['fs'] = array_filter($criteria['fs']);\n } else {\n $criteria['fs'] = config('main.criteria.fs');\n }\n\n if (!empty($criteria['disp'])) {\n $criteria['disp'] = array_filter($criteria['disp']);\n } else {\n $criteria['disp'] = config('main.criteria.disp');\n }\n\n break;\n default:\n $criteria = $defaultCriteria;\n break;\n }\n } else {\n $criteria = $defaultCriteria;\n }\n\n // url-Decoding values of 'fs' key in Criteria recursively\n if (isset($criteria['fs']) && !empty($criteria['fs'])) {\n foreach ($criteria['fs'] as $key => $fs) {\n if (is_array($fs)) {\n foreach ($fs as $i => $f) {\n $criteria['fs'][$key][$i] = rawurldecode($f);\n }\n } else {\n $criteria['fs'][$key] = rawurldecode($fs);\n }\n }\n }\n\n return json_decode(json_encode($criteria));\n }", "private function filterAlbumsOnly($records)\n {\n $type = 'album';\n $items = array_filter($records, function ($var) use ($type) {\n return ($var['album_type'] == $type);\n });\n\n return $items;\n }", "protected function setConditions($conditions = [])\n {\n if ($conditions instanceof Closure || is_array($conditions)) {\n $this->conditions = $conditions;\n } else {\n $this->conditions = [$conditions];\n }\n }", "public static function getAlbumsForDropdown()\n\t{\n\t\treturn BackendModel::getDB()->getPairs('SELECT i.id, d.title FROM pictures_albums AS i\n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN pictures_albums_data AS d ON d.album_id = i.id AND d.language = ?', BackendLanguage::getInterfaceLanguage());\n\t}", "private function defineFilters() {\n\n // init local filters variable as empty array\n $filters = [];\n\n // parse each filter to apply\n // and add the valid once to filters\n\n // filters by name\n if (isset($_GET['s'])) {\n\n $filters['name'] = $_GET['s'];\n\n }\n\n // filter by categories\n if (isset($_GET['c'])) {\n\n $categories = explode(\"_\", $_GET['c']);\n foreach ($categories as $key => $value) {\n if (is_numeric($value)) {\n $filters['categories'][] = $value;\n }\n }\n\n }\n\n // filter by areas\n if (isset($_GET['a'])) {\n\n $areas = explode(\"_\", $_GET['a']);\n foreach ($areas as $key => $value) {\n if (is_numeric($value)) {\n $filters['areas'][] = $value;\n }\n }\n\n }\n\n // Check if any filter has been set\n\n if (count($filters)>0) {\n\n $this->filters = $filters;\n return true;\n\n }\n\n\n return false;\n\n }", "function setup_album()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'id, name, member_id, public_album', 'from' => 'gallery_albums', 'where' => \"id={$this->ipsclass->input['album']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $info = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this album?\n if( $info['member_id'] == $this->ipsclass->member['id'] )\n {\n $own = true;\n }\n\n if( ! $info['public_album'] && ! $own )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );\n }\n\n return $info;\n }", "protected function prepareGalleryData() {}", "public function testEmptyConditions()\n {\n $this->specify(\n 'The Model::find with empty conditions + bind and limit return wrong result',\n function () {\n $album = Albums::find([\n 'conditions' => '',\n 'bind' => [],\n 'limit' => 10\n ]);\n\n expect($album)->isInstanceOf(Simple::class);\n expect(ini_get('opcache.enable_cli'))->equals(1);\n\n expect($album->getFirst())->isInstanceOf(Albums::class);\n\n expect($album->getFirst()->toArray())->equals([\n 'id' => 1,\n 'artists_id' => 1,\n 'name' => 'Born to Die',\n ]);\n }\n );\n }", "public function setSorting(SetAlbumSortingRequest $request): void\n\t{\n\t\t$request->album()->sorting = $request->sortingCriterion();\n\t\t$request->album()->save();\n\t}", "public function buildConditionQuery()\n\t\t\t{\n\t\t\t\t$this->sql_condition = ' user_id='.$this->CFG['user']['user_id'];\n\t\t\t}", "function conditions( $conds = array())\n\t{\n\t\t// if condition is empty, return true\n\t\tif ( empty( $conds )) return true;\n\t}", "public static function build_sql_conditions( $args = array() ){\n\t\t$conditions = apply_filters( 'em_bookings_build_sql_conditions', parent::build_sql_conditions($args), $args );\n\t\tif( is_numeric($args['status']) ){\n\t\t\t$conditions['status'] = 'booking_status='.$args['status'];\n\t\t}elseif( self::array_is_numeric($args['status']) && count($args['status']) > 0 ){\n\t\t\t$conditions['status'] = 'booking_status IN ('.implode(',',$args['status']).')';\n\t\t}elseif( !is_array($args['status']) && preg_match('/^([0-9],?)+$/', $args['status']) ){\n\t\t\t$conditions['status'] = 'booking_status IN ('.$args['status'].')';\n\t\t}\n\t\tif( is_numeric($args['person']) ){\n\t\t\t$conditions['person'] = EM_BOOKINGS_TABLE.'.person_id='.$args['person'];\n\t\t}\n\t\tif( EM_MS_GLOBAL && !empty($args['blog']) && is_numeric($args['blog']) ){\n\t\t\tif( is_main_site($args['blog']) ){\n\t\t\t\t$conditions['blog'] = \"(\".EM_EVENTS_TABLE.\".blog_id={$args['blog']} OR \".EM_EVENTS_TABLE.\".blog_id IS NULL)\";\n\t\t\t}else{\n\t\t\t\t$conditions['blog'] = \"(\".EM_EVENTS_TABLE.\".blog_id={$args['blog']})\";\n\t\t\t}\n\t\t}\n\t\tif( empty($conditions['event']) && $args['event'] === false ){\n\t\t $conditions['event'] = EM_BOOKINGS_TABLE.'.event_id != 0';\n\t\t}\n\t\tif( is_numeric($args['ticket_id']) ){\n\t\t $EM_Ticket = new EM_Ticket($args['ticket_id']);\n\t\t if( $EM_Ticket->can_manage() ){\n\t\t\t\t$conditions['ticket'] = EM_BOOKINGS_TABLE.'.booking_id IN (SELECT booking_id FROM '.EM_TICKETS_BOOKINGS_TABLE.\" WHERE ticket_id='{$args['ticket_id']}')\";\n\t\t }\n\t\t}\n\t\treturn apply_filters('em_bookings_build_sql_conditions', $conditions, $args);\n\t}", "function getAlbums($type='LATEST')\n{\n\t$data = array();\n\t$condition = '';\n\tswitch($type)\n\t{\n\t\tcase 'LATEST':\n\t\t\t$condition = '';\n\t\tbreak;\n\t\t\n\t\tcase 'USER':\n\t\t\t$condition = 'AND a.album_type=3 ';\n\t\tbreak;\n\t\t\n\t\tcase 'EVENTS':\n\t\t\t$condition = 'AND a.album_type=1 ';\n\t\tbreak;\n\t\t\n\t\tcase 'MATCHES':\n\t\t\t$condition = 'AND a.album_type=2 ';\n\t\tbreak;\n\t}\n\t$q = 'SELECT a.album_id, a.name, at.name, u.username, a.user_id, a.date, p.thumb '.\n\t\t\t'FROM albums AS a, album_type AS at, users AS u, pictures AS p '.\n\t\t\t'WHERE a.user_id = u.user_id '.\n\t\t\t'AND a.album_type = at.type_id '.\n\t\t\t'AND a.cover_id = p.picture_id '.\n\t\t\t$condition.\n\t\t\t'ORDER BY a.date DESC';\n\t\n\t$res = mysql_query($q)\n\t\tor die(mysql_error());\n\twhile($row = mysql_fetch_array($res))\n\t{\n\t\t$data[] = array('id'=>$row['album_id'],\n\t\t\t\t\t\t'album_name'=>$row[1],\n\t\t\t\t\t\t'type_name'=>$row[2],\n\t\t\t\t\t\t'username'=>$row['username'],\n\t\t\t\t\t\t'date'=>$row['date'],\n\t\t\t\t\t\t'user_id'=>$row['user_id'],\n\t\t\t\t\t\t'pic_count'=>countPictures($row['album_id']),\n\t\t\t\t\t\t'cover'=>$row['thumb']);\n\t}\n\tSmartyPaginate::setTotal(count($data));\n\treturn array_slice($data, SmartyPaginate::getCurrentIndex(),SmartyPaginate::getLimit());\n}", "function _dotgo_filter_prepare() {\n\n}", "private function _buildQuery($filters = array())\n\t{\n\t\t// var to hold conditions\n\t\t$where = array();\n\t\t$sql = '';\n\n\t\t// scope\n\t\tif (isset($filters['scope']))\n\t\t{\n\t\t\t$where[] = \"scope=\" . $this->_db->quote($filters['scope']);\n\t\t}\n\n\t\t// scope_id\n\t\tif (isset($filters['scope_id']))\n\t\t{\n\t\t\t$where[] = \"scope_id=\" . $this->_db->quote($filters['scope_id']);\n\t\t}\n\n\t\t// calendar_id\n\t\tif (isset($filters['calendar_id']))\n\t\t{\n\t\t\tif ($filters['calendar_id'] == '0')\n\t\t\t{\n\t\t\t\t$where[] = \"(calendar_id IS NULL OR calendar_id=0)\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$where[] = \"calendar_id=\" . $this->_db->quote($filters['calendar_id']);\n\t\t\t}\n\t\t}\n\n\t\t// published\n\t\tif (isset($filters['state']) && is_array($filters['state']))\n\t\t{\n\t\t\t$where[] = \"state IN (\" . implode(',', $filters['state']) . \")\";\n\t\t}\n\n\t\t// publish up/down\n\t\tif (isset($filters['publish_up']) && isset($filters['publish_down']))\n\t\t{\n\t\t\t$q = \"(publish_up >=\" . $this->_db->quote($filters['publish_up']);\n\t\t\t$q .= \" OR (publish_down IS NOT NULL AND publish_down != '0000-00-00 00:00:00' AND publish_down <=\" . $this->_db->quote($filters['publish_down']) . \")\";\n\t\t\t$q .= \" OR (publish_up IS NOT NULL AND publish_up <= \" . $this->_db->quote($filters['publish_up']) . \" AND publish_down >=\" . $this->_db->quote($filters['publish_down']) . \"))\";\n\t\t\t$where[] = $q;\n\t\t}\n\n\t\t// repeating event?\n\t\tif (isset($filters['repeating']))\n\t\t{\n\t\t\t$where[] = \"(repeating_rule IS NOT NULL AND repeating_rule<>'')\";\n\t\t}\n\n\t\t// only non-repeating events?\n\t\tif (isset($filters['non_repeating']))\n\t\t{\n\t\t\t$where[] = \"(repeating_rule IS NULL OR repeating_rule = '')\";\n\t\t}\n\n\t\t// if we have and conditions\n\t\tif (count($where) > 0)\n\t\t{\n\t\t\t$sql .= \" WHERE \" . implode(\" AND \", $where);\n\t\t}\n\n\t\t// specify order?\n\t\tif (isset($filters['orderby']))\n\t\t{\n\t\t\t$sql .= \" ORDER BY \" . $filters['orderby'];\n\t\t}\n\n\t\t// limit and start\n\t\tif (isset($filters['limit']))\n\t\t{\n\t\t\t$start = (isset($filters['start'])) ? $filters['start'] : 0;\n\t\t\t$sql .= \" LIMIT \" . $start . \", \" . $filters['limit'];\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function __construct(array $conditions) {\n $this->conditions= $conditions;\n }", "public function setConditions( $conditions )\n\t\t{\n\t\t\t$this->_conditions = $conditions;\n\t\t}", "public function setMusicAlbum($attributes = []);", "public function _testConstructorConditions($di)\n\t{\n\t\t// ------------- test for setters(classic) way ----------------\n\n\t\t$standardSelectBuilder = new SelectBuilder();\n\t\t$standardSelectBuilder->from('Robots')\n\t\t\t->where(\n\t\t\t\t\"year > :min: AND year < :max:\",\n\t\t\t\tarray(\"min\" => '2013-01-01', 'max' => '2100-01-01'),\n\t\t\t\tarray(\"min\" => PDO::PARAM_STR, 'max' => PDO::PARAM_STR)\n\t\t\t);\n\n\t\t$standardResult = $standardSelectBuilder->getQuery()->execute();\n\n\t\t// --------------- test for single condition ------------------\n\t\t$params = array(\n\t\t\t'models' => 'Robots',\n\t\t\t'conditions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t\"year > :min: AND year < :max:\",\n\t\t\t\t\tarray(\"min\" => '2013-01-01', 'max' => '2100-01-01'),\n\t\t\t\t\tarray(\"min\" => PDO::PARAM_STR, 'max' => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$builderWithSingleCondition = new SelectBuilder($params);\n\t\t$singleConditionResult = $builderWithSingleCondition->getQuery()->execute();\n\n\t\t// ------------- test for multiple conditions ----------------\n\n\t\t$params = array(\n\t\t\t'models' => 'Robots',\n\t\t\t'conditions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t\"year > :min:\",\n\t\t\t\t\tarray(\"min\" => '2000-01-01'),\n\t\t\t\t\tarray(\"min\" => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t\"year < :max:\",\n\t\t\t\t\tarray('max' => '2100-01-01'),\n\t\t\t\t\tarray(\"max\" => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// conditions are merged!\n\t\t$builderMultipleConditions = new SelectBuilder($params);\n\t\t$multipleConditionResult = $builderMultipleConditions->getQuery()->execute();\n\n\t\t$expectedPhql = \"SELECT [Robots].* FROM [Robots] \"\n\t\t\t. \"WHERE year > :min: AND year < :max:\";\n\n\t\t/* ------------ ASSERTING --------- */\n\n\t\t$this->assertEquals($expectedPhql, $standardSelectBuilder->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $standardResult);\n\n\t\t$this->assertEquals($expectedPhql, $builderWithSingleCondition->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $singleConditionResult);\n\n\t\t$this->assertEquals($expectedPhql, $builderMultipleConditions->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $multipleConditionResult);\n }", "private function buildQuery($filters, $limit, $offset)\n {\n // TODO: support logic for multiple conditions\n $where = '';\n $sortBy = null;\n if(!empty($filters) && is_array($filters))\n {\n foreach($filters as $name => $value)\n {\n switch($name)\n {\n case 'hash':\n $where = $this->buildWhere($where, \"hash='{$value}')\");\n break;\n case 'groups':\n $where = $this->buildWhere($where, \"(groups IN('\" . implode(\"','\", $value) . \"') OR permission='1')\");\n break;\n case 'page':\n if($value > 1)\n {\n $value = min($value, 40); // 40 pages at max of 2,500 recursion limit means 100k photos\n $offset = ($limit * $value) - $limit;\n $page = $value;\n }\n break;\n case 'permission':\n $where = $this->buildWhere($where, \"permission='1'\");\n break;\n case 'sortBy':\n $sortBy = 'ORDER BY ' . str_replace(',', ' ', $value);\n $field = substr($value, 0, strpos($value, ','));\n $where = $this->buildWhere($where, \"{$field} IS NOT NULL\");\n break;\n case 'tags':\n if(!is_array($value))\n $value = (array)explode(',', $value);\n $where = $this->buildWhere($where, \"tags IN('\" . implode(\"','\", $value) . \"')\");\n break;\n case 'type': // type for activities\n $value = $this->_($value);\n $where = $this->buildWhere($where, \"type='{$value}'\");\n break;\n }\n }\n }\n\n if(!empty($offset))\n {\n $iterator = max(1, intval($offset - 1));\n $nextToken = null;\n $params = array('ConsistentRead' => 'true');\n if(!isset($page))\n $page = 1;\n $currentPage = 1;\n $thisLimit = min($iterator, $offset);\n do\n {\n $res = $this->db->select(\"SELECT * FROM `{$this->domainPhoto}` {$where} {$sortBy} LIMIT {$iterator}\", $params);\n if(!$res->body->SelectResult->NextToken)\n break;\n\n $nextToken = $res->body->SelectResult->NextToken;\n $params['NextToken'] = $nextToken;\n $currentPage++;\n }while($currentPage < $page);\n }\n\n $params = array('ConsistentRead' => 'true');\n if(isset($nextToken) && !empty($nextToken))\n $params['NextToken'] = $nextToken;\n\n return array('params' => $params, 'where' => $where, 'sortBy' => $sortBy, 'limit' => $limit);\n }", "public function set_conditional_args( $args ) {\n\t\t\tif ( ! empty( $this->args['quality'] ) ) {\n\t\t\t\t$args['quality'] = $this->args['quality'];\n\t\t\t}\n\t\t\t// Remove cropping if crop is false.\n\t\t\tif ( isset( $this->args['crop'] ) && false === $this->args['crop'] ) {\n\t\t\t\tunset( $args['crop'] );\n\t\t\t}\n\t\t\treturn $args;\n\t\t}", "protected function prepareFilter()\n\t{\n\t\tglobal $USER;\n\t\tglobal $DB;\n\n\t\t$arFilter = array();\n\t\t$arFilter[\"USER_ID\"] = $USER->GetID();\n\t\t$arFilter[\"LID\"] = SITE_ID;\n\n\t\tif (strlen($_REQUEST[\"filter_id\"]))\n\t\t{\n\t\t\tif ($this->options['USE_ACCOUNT_NUMBER'])\n\t\t\t\t$arFilter[\"ACCOUNT_NUMBER\"] = $_REQUEST[\"filter_id\"];\n\t\t\telse\n\t\t\t\t$arFilter[\"ID\"] = intval($_REQUEST[\"filter_id\"]);\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_date_from\"]))\n\t\t\t$arFilter[\"DATE_FROM\"] = trim($_REQUEST[\"filter_date_from\"]);\n\t\tif (strlen($_REQUEST[\"filter_date_to\"]))\n\t\t{\n\t\t\t$arFilter[\"DATE_TO\"] = trim($_REQUEST[\"filter_date_to\"]);\n\n\t\t\tif ($arDate = ParseDateTime(trim($_REQUEST[\"filter_date_to\"]), $this->dateFormat))\n\t\t\t{\n\t\t\t\tif (StrLen(trim($_REQUEST[\"filter_date_to\"])) < 11)\n\t\t\t\t{\n\t\t\t\t\t$arDate[\"HH\"] = 23;\n\t\t\t\t\t$arDate[\"MI\"] = 59;\n\t\t\t\t\t$arDate[\"SS\"] = 59;\n\t\t\t\t}\n\n\t\t\t\t$arFilter[\"DATE_TO\"] = date($DB->DateFormatToPHP($this->dateFormat), mktime($arDate[\"HH\"], $arDate[\"MI\"], $arDate[\"SS\"], $arDate[\"MM\"], $arDate[\"DD\"], $arDate[\"YYYY\"]));\n\t\t\t}\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_status\"]))\n\t\t\t$arFilter[\"STATUS_ID\"] = trim($_REQUEST[\"filter_status\"]);\n\n\t\tif (strlen($_REQUEST[\"filter_payed\"]))\n\t\t\t$arFilter[\"PAYED\"] = trim($_REQUEST[\"filter_payed\"]);\n\n\t\tif(!isset($_REQUEST['show_all']) || $_REQUEST['show_all'] == 'N')\n\t\t{\n\t\t\tif($_REQUEST[\"filter_history\"]!=\"Y\")\n\t\t\t\t$arFilter[\"!@COMPLETE_ORDERS\"] = $this->arParams['HISTORIC_STATUSES'];\n\n\t\t\tif(isset($_REQUEST[\"filter_history\"]) && $_REQUEST[\"filter_history\"] == \"Y\")\n\t\t\t\t$arFilter[\"@COMPLETE_ORDERS\"] = $this->arParams['HISTORIC_STATUSES'];\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_canceled\"]))\n\t\t\t$arFilter[\"CANCELED\"] = trim($_REQUEST[\"filter_canceled\"]);\n\n\t\t$this->filter = $arFilter;\n\t}", "function clean(array $conditions): void;", "function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Prepare boxes\n\t\t$this->_boxes = array_merge((array)$this->_boxes, array(\n\t\t\t\"status\"\t\t=> 'select_box(\"status\",\t\t$this->_articles_statuses2,\t$selected, 0, 2, \"\", false)',\n\t\t\t\"account_type\"\t=> 'select_box(\"account_type\",\t$this->_account_types2,\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_by\"\t\t=> 'select_box(\"sort_by\",\t\t$this->_sort_by,\t\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_order\"\t=> 'select_box(\"sort_order\",\t$this->_sort_orders,\t\t$selected, 0, 2, \"\", false)',\n\t\t));\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Get user account type\n\t\t$this->_account_types2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_account_types as $k => $v) {\n\t\t\t$this->_account_types2[$k]\t= $v;\n\t\t}\n\t\t// Get user account type\n\t\t$this->_articles_statuses2[\" \"]\t= t(\"-- All --\");\n\t\tforeach ((array)$this->_articles_statuses as $k => $v) {\n\t\t\t$this->_articles_statuses2[$k]\t= $v;\n\t\t}\n\t\t// Sort orders\n\t\t$this->_sort_orders = array(\"DESC\" => \"Descending\", \"ASC\" => \"Ascending\");\n\t\t// Sort fields\n\t\t$this->_sort_by = array(\n\t\t\t\"\",\n\t\t\t\"id\",\n\t\t\t\"cat_id\",\n\t\t\t\"user_id\",\n\t\t\t\"add_date\",\n\t\t);\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"id_min\",\n\t\t\t\"id_max\",\n\t\t\t\"date_min\",\n\t\t\t\"date_max\",\n\t\t\t\"nick\",\n\t\t\t\"user_id\",\n\t\t\t\"title\",\n\t\t\t\"summary\",\n\t\t\t\"text\",\n\t\t\t\"account_type\",\n\t\t\t\"status\",\n\t\t\t\"cat_id\",\n\t\t\t\"sort_by\",\n\t\t\t\"sort_order\",\n\t\t);\n\t}", "function _prepareConditions($conditions, $pExtendingModuleID = null)\n{\n $debug_prefix = debug_indent(\"Module-_prepareConditions() {$this->ModuleID}:\");\n print \"$debug_prefix\\n\";\n $parentRecordConditions = array();\n $whereConditions = array();\n $protectJoinAliases = array();\n $SQL = '';\n\n $use_parent = true;\n if(empty($parentModuleID)){\n if(empty($this->parentModuleID)){\n $use_parent = false;\n } else {\n $parentModuleID = $this->parentModuleID;\n }\n }\n\n if($use_parent){\n $parentModule =& GetModule($parentModuleID);\n $parentPK = end($parentModule->PKFields);\n }\n\n if(! empty($pExtendingModuleID )){\n print \"extending module conditions: $pExtendingModuleID, {$this->ModuleID}\\n\";\n $extendingModule = GetModule($pExtendingModuleID);\n if(!empty( $extendingModule->extendsModuleFilterField )){\n $conditions[$extendingModule->extendsModuleFilterField] = $extendingModule->extendsModuleFilterValue;\n print \"added extended condition:\\n\";\n print_r($conditions);\n }\n }\n\n if(count($conditions) > 0){\n foreach($conditions as $conditionField => $conditionValue){\n print \"$debug_prefix Condition $conditionField => $conditionValue\\n\";\n\n $conditionModuleField = $this->ModuleFields[$conditionField];\n if(empty($conditionModuleField)){\n die(\"field {$this->ModuleID}.$conditionModuleField is empty\\n\");\n }\n $qualConditionField = $conditionModuleField->getQualifiedName($this->ModuleID);\n $conditionJoins = $conditionModuleField->makeJoinDef($this->ModuleID);\n if(count($conditionJoins) > 0){\n foreach(array_keys($conditionJoins) as $conditionJoinAlias){\n $protectJoinAliases[] = $conditionJoinAlias;\n }\n }\n\n if($use_parent){\n if(preg_match('/\\[\\*([\\w]+)\\*\\]/', $conditionValue, $match[1])){\n if($match[1][1] == $parentPK){\n $whereConditions[$qualConditionField] = '/**RecordID**/';\n } else {\n print \"SM found match $match[1][0]\\n\";\n $parentRecordConditions[$qualConditionField] = $match[1][1];\n }\n } else {\n $whereConditions[$qualConditionField] = $conditionValue;\n }\n } else {\n $whereConditions[$qualConditionField] = $conditionValue;\n }\n }\n }\n\n if($use_parent){\n $needParentSubselect = false;\n if(count($parentRecordConditions) > 0){\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n if(empty($parentModuleField)){\n die(\"field {$this->parentModuleID}.$parentConditionField is empty\\n\");\n }\n if(strtolower(get_class($parentModuleField)) != 'tablefield'){\n $needParentSubselect = true;\n }\n }\n if($needParentSubselect){\n $parentJoins = array();\n $parentSelects = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n $parentSelects[] = $parentModuleField->makeSelectDef('iparent');\n $parentJoins = array_merge($parentJoins, $parentModuleField->makeJoinDef('iparent'));\n }\n\n $subSQL = 'SELECT ';\n $subSQL .= implode(\",\\n\", $parentSelects);\n $subSQL .= \"\\nFROM `{$this->parentModuleID}` AS `iparent`\\n\";\n $parentJoins = SortJoins($parentJoins);\n $subSQL .= implode(\"\\n \", $parentJoins);\n $subSQL .= \"\\nWHERE `iparent`.$parentPK = '/**RecordID**/' \\n\";\n\n $SQL = \"\\n INNER JOIN ($subSQL) AS `parent` ON (\\n\";\n $parentConditionStrings = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentConditionStrings[] = \"`parent`.$parentConditionField = $localConditionField\";\n }\n $SQL .= implode(\"\\n AND \", $parentConditionStrings);\n $SQL .= \")\\n\";\n } else {\n $SQL = \"\\n INNER JOIN `{$this->parentModuleID}` AS `parent` ON (\\n\";\n $parentConditionStrings = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n $qualParentConditionField = $parentModuleField->getQualifiedName('parent');\n $parentConditionStrings[] = \"$localConditionField = $qualParentConditionField\";;\n }\n $SQL .= implode(\"\\n AND \", $parentConditionStrings);\n $SQL .= \")\\n\";\n\n $whereConditions[\"`parent`.$parentPK\"] = '/**RecordID**/';\n }\n\n }\n }\n\n debug_unindent();\n return array(\n 'parentJoinSQL' => $SQL,\n 'whereConditions' => $whereConditions,\n 'protectJoinAliases' => $protectJoinAliases\n );\n}", "public function get_filters($vars=array()) {\n\n if(!empty($vars))\n { \n $activities = (isset($vars['activities']) && ($vars['activities']!=\"\")) ? $vars['activities'] : \"\";\n $environment = (isset($vars['environment']) && ($vars['environment']!=\"\")) ? $vars['environment'] : \"\";\n $weather = (isset($vars['weather']) && ($vars['weather']!=\"\")) ? $vars['weather'] : \"\"; \n $season = (isset($vars['season']) && ($vars['season']!=\"\")) ? $vars['season'] : \"\";\n $continent = (isset($vars['destination_continent']) && ($vars['destination_continent']!=\"\")) ? $vars['destination_continent'] : \"\";\n $destination = (isset($vars['destination_city']) && ($vars['destination_city']!=\"\")) ? $vars['destination_city'] : \"\";\n \n $age_group = (isset($vars['age_group']) && ($vars['age_group']!=\"\")) ? $vars['age_group'] : \"\";\n $price_from = (isset($vars['price_from']) && ($vars['price_from']!=\"\")) ? $vars['price_from'] : 0;\n $price_to = (isset($vars['price_to']) && ($vars['price_to']!=\"\")) ? $vars['price_to'] : 0;\n $departure_date = (isset($vars['departure_date']) && ($vars['departure_date']!=\"\")) ? $vars['departure_date'] : \"\";\n $return_date = (isset($vars['return_date']) && ($vars['return_date']!=\"\")) ? $vars['return_date'] : \"\";\n \n if(($season != \"\") || ($destination != \"\") || ($environment != \"\") || ($continent != \"\") || \n ($age_group != \"\") || ($price_from != \"\") || ($weather != \"\") || ($activities != \"\"))\n { \n $condition = \"1=1\";\n if($season != \"\")\n { \n $condition .=\" AND (Season LIKE '%$season%')\";\n }\n if($destination != \"\")\n { \n $condition .=\" AND (City LIKE '%$destination%')\";\n }\n if($environment != \"\")\n { \n $condition .=\" AND (Environment LIKE '%$environment%')\";\n }\n if($continent != \"\")\n { \n $condition .=\" AND (Continent LIKE '%$continent%')\";\n }\n if($age_group != \"\")\n { \n $condition .=\" AND (Age = '$age_group')\";\n }\n if( ($price_from >= 0) && ($price_to > 0) )\n { \n $condition .=\" AND (ActivityPrice BETWEEN '$price_from' AND '$price_to' )\";\n }\n \n if( ($departure_date != \"\" && $return_date != \"\") )\n { \n $condition .=\" AND ( (date1 BETWEEN '$departure_date' AND '$return_date') )\";\n }\n /* \n if( ($return_date != \"\") )\n { \n $condition .=\" AND (data2 <z= '$return_date') \";\n }\n \n if($activities != \"\")\n { \n $condition .=\" OR (city LIKE '%$activities%') \";\n }*/\n if($weather != \"\")\n { \n $condition .= \" AND (MATCH(Weather) AGAINST('$weather' IN BOOLEAN MODE))\";\n }\n /*\n if($activities != \"\")\n { \n $condition .= \"(MATCH(weather) AGAINST('$activities' IN BOOLEAN MODE)) OR \";\n }\n if($activities != \"\")\n { \n $condition .= \"(MATCH(environment) AGAINST('$activities' IN BOOLEAN MODE)) OR \";\n }*/\n if($activities != \"\")\n { \n //prepare condition using MYSQL NATURAL LANGUAGE MODE\n $condition .= \" AND (MATCH(Activities) AGAINST('$activities' IN BOOLEAN MODE)) \";\n }\n }else\n { \n return false;\n \n } // end if(($season != \"\") || ($destination != \"\") || \n \n }else\n { \n return false;\n $condition = \" 1='1' \"; \n }\n\n //echo $condition; //die();\n $this->db->select('*');\n $this->db->from('filter');\n $this->db->where($condition);\n $query = $this->db->get(); //print_r($this->db); die();\n if ($query->num_rows() > 0) {\n return $query->result();\n } else {\n return false;\n }\n}", "function mediatag_album() {\r\n\tglobal $photo_query, $tag_query, $owner, $user;\r\n\r\n\tif($photo_query != \"\") { $photo_query .= \" UNION ALL \"; }\r\n\r\n\t$photo_query .= \"(SELECT 'media' \t\tAS type,\r\n\t\t\t\t'media_id'\t\tAS type_id,\r\n\t\t\t\t''\t\t\tAS type_prefix,\r\n\t\t\t\tmediatag_media_id \tAS media_id,\r\n\t\t\t\tmediatag_date\t\tAS mediatag_date,\r\n\t\t\t\tCONCAT('album.php?user=', user_username, '&album_id=[media_parent_id]')\tAS media_parent_url,\r\n\t\t\t\tmedia_album_id\t\tAS media_parent_id,\r\n\t\t\t\talbum_title\t\tAS media_parent_title,\r\n\t\t\t\talbum_user_id\t\tAS owner_user_id,\r\n\t\t\t\tuser_id\t\t\tAS user_id,\r\n\t\t\t\tuser_username\t\tAS user_username,\r\n\t\t\t\tuser_fname\t\tAS user_fname,\r\n\t\t\t\tuser_lname\t\tAS user_lname,\r\n\t\t\t\tCONCAT('./uploads_user/', user_id+999-((user_id-1)%1000), '/', user_id, '/') AS media_dir,\r\n\t\t\t\tmedia_date\t\tAS media_date,\r\n\t\t\t\tmedia_title\t\tAS media_title,\r\n\t\t\t\tmedia_desc\t\tAS media_desc,\r\n\t\t\t\tmedia_ext\t\tAS media_ext,\r\n\t\t\t\tmedia_filesize\t\tAS media_filesize,\r\n\t\t\t\tCASE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_REGISTERED) AND '{$user->user_exists}'<>0)\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_ANONYMOUS) AND '{$user->user_exists}'=0)\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_SELF) AND se_albums.album_user_id='{$user->user_info['user_id']}')\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_FRIEND) AND (SELECT TRUE FROM se_friends WHERE friend_user_id1=se_albums.album_user_id AND friend_user_id2='{$user->user_info['user_id']}' AND friend_status='1' LIMIT 1))\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_SUBNET) AND se_users.user_subnet_id='{$user->user_info['user_subnet_id']}')\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_tag & @SE_PRIVACY_FRIEND2) AND se_users.user_subnet_id='{$user->user_info['user_subnet_id']}' AND (SELECT TRUE FROM se_friends AS friends_primary LEFT JOIN se_friends AS friends_secondary ON friends_primary.friend_user_id2=friends_secondary.friend_user_id1 WHERE friends_primary.friend_user_id1=se_albums.album_user_id AND friends_secondary.friend_user_id2='{$user->user_info['user_id']}' LIMIT 1))\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t ELSE FALSE\r\n\t\t\t\tEND\r\n\t\t\t\tAS allowed_to_tag,\r\n\t\t\t\tCASE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_REGISTERED) AND '{$user->user_exists}'<>0)\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_ANONYMOUS) AND '{$user->user_exists}'=0)\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_SELF) AND se_albums.album_user_id='{$user->user_info['user_id']}')\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_FRIEND) AND (SELECT TRUE FROM se_friends WHERE friend_user_id1=se_albums.album_user_id AND friend_user_id2='{$user->user_info['user_id']}' AND friend_status='1' LIMIT 1))\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_SUBNET) AND se_users.user_subnet_id='{$user->user_info['user_subnet_id']}')\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t WHEN ((se_albums.album_comments & @SE_PRIVACY_FRIEND2) AND se_users.user_subnet_id='{$user->user_info['user_subnet_id']}' AND (SELECT TRUE FROM se_friends AS friends_primary LEFT JOIN se_friends AS friends_secondary ON friends_primary.friend_user_id2=friends_secondary.friend_user_id1 WHERE friends_primary.friend_user_id1=se_albums.album_user_id AND friends_secondary.friend_user_id2='{$user->user_info['user_id']}' LIMIT 1))\r\n\t\t\t\t THEN TRUE\r\n\t\t\t\t ELSE FALSE\r\n\t\t\t\tEND\r\n\t\t\t\tAS allowed_to_comment\r\n\t\t\tFROM se_mediatags\r\n\t\t\tLEFT JOIN se_media\r\n\t\t\t\tON se_mediatags.mediatag_media_id=se_media.media_id\r\n\t\t\tLEFT JOIN se_albums\r\n\t\t\t\tON se_media.media_album_id=se_albums.album_id\r\n\t\t\tLEFT JOIN se_users\r\n\t\t\t\tON se_albums.album_user_id=se_users.user_id\r\n\t\t\tWHERE se_mediatags.mediatag_user_id='{$owner->user_info['user_id']}'\r\n\t\t\t)\";\r\n\r\n\t$tag_query['media'] = \"SELECT se_mediatags.*, se_users.user_id, se_users.user_username, se_users.user_fname, se_users.user_lname FROM se_mediatags LEFT JOIN se_users ON se_mediatags.mediatag_user_id=se_users.user_id WHERE mediatag_media_id='[media_id]' ORDER BY mediatag_id ASC\";\r\n\r\n}", "function sql_condition_statemment(array $criteria, int $totalCount)\n {\n // Init\n $sql = \"\";\n\n // Rendr base on condition\n $count = 0;\n foreach ($criteria as $filter => $value) {\n\n $str = (is_array($value)) \n ? objectSearchHandle($filter, $value)\n : \"$filter = '$value'\";\n \n $is_not_last = ($totalCount - 1 != $count);\n\n if($str):\n $sql .= $str;\n $sql .= ($is_not_last) ? \" AND \" : \"\";\n endif;\n\n $count ++;\n }\n // Return\n return $sql;\n }", "protected function resolveConditions()\n\t{\n\t\tif ($this->isEmpty()) return [ [], [] ];\n\n\t\t$conditions = array_filter([\n\t\t\t$this->resolveStringCondition([ 'type' ], $this->type),\n\t\t\t$this->resolveStringCondition([ 'uri', 'commandName', 'jobName', 'testName' ], array_merge($this->uri, $this->name)),\n\t\t\t$this->resolveStringCondition([ 'controller' ], $this->controller),\n\t\t\t$this->resolveExactCondition([ 'method' ], $this->method),\n\t\t\t$this->resolveNumberCondition([ 'responseStatus', 'commandExitCode', 'jobStatus', 'testStatus' ], $this->status),\n\t\t\t$this->resolveNumberCondition([ 'responseDuration' ], $this->time),\n\t\t\t$this->resolveDateCondition([ 'time' ], $this->received)\n\t\t]);\n\n\t\t$sql = array_map(function ($condition) { return $condition[0]; }, $conditions);\n\t\t$bindings = array_reduce($conditions, function ($bindings, $condition) {\n\t\t\treturn array_merge($bindings, $condition[1]);\n\t\t}, []);\n\n\t\treturn [ $sql, $bindings ];\n\t}", "private function constructCondStringStatic(&$tablesUsed, $conds)\n {\n $groupStrings = array();\n $andGroupStrings = array();\n\n foreach ($conds as $group => $conditions) {\n foreach ($conditions as &$condition) {\n $column = $this->canonicalizeColumn($condition[COND_COLUMN], false, $tablesUsed);\n $before = $after = '';\n if ($condition[COND_OPERATOR] == 'LIKE') {\n $before = '%';\n $after = '%';\n } elseif ($condition[COND_OPERATOR] == 'STARTSWITH') {\n $condition[COND_OPERATOR] = 'LIKE';\n $after = '%';\n }\n\n $condition = $column . ' ' . $condition[COND_OPERATOR] . \" '\" .\n $before . $this->connObj->escapeString($condition[1]) . $after . \"'\";\n }\n\n if ($group === 0) {\n $groupStrings[$group] = implode(' AND ', $conditions);\n } elseif (is_string($group) && substr($group, 0, 3) === 'AND') {\n // 'AND1', 'AND2' are a special type of groups\n $andGroupStrings[$group] = '(' . implode(' AND ', $conditions) . ')';\n } else {\n $groupStrings[$group] = '(' . implode(' OR ', $conditions) . ')';\n }\n }\n\n if (!empty($andGroupStrings)) {\n $groupStrings[] = '(' . implode(' OR ', $andGroupStrings) . ')';\n }\n\n $groupStrings = array_merge($groupStrings, $this->constructJoinString($tablesUsed));\n\n return implode(' AND ', $groupStrings);\n }", "static function createFilter(string $alias, array $types = [], array $homes = [], ?string $sqlConditions = null, bool $doCount = false): array\n {\n // columns\n $columns = \"{$alias}.id,{$alias}.type,{$alias}.home,{$alias}.xhome,{$alias}.subject,\n{$alias}.author,{$alias}.guest,{$alias}.time,{$alias}.text,{$alias}.flag,\nhome_page.title page_title,home_page.slug page_slug,\nhome_cat1.title cat_title,home_cat1.slug cat_slug,\nhome_art.title art_title,home_art.slug art_slug,\nhome_post.subject xhome_subject\";\n\n // conditions\n $conditions = [];\n\n if (!empty($types)) {\n $conditions[] = \"{$alias}.type IN(\" . DB::arr($types) . ')';\n }\n\n if (!empty($homes)) {\n $conditions[] = \"{$alias}.home IN(\" . DB::arr($homes) . ')';\n }\n\n $conditions[] = '(home_page.id IS NULL OR ' . (User::isLoggedIn() ? '' : 'home_page.public=1 AND ') . 'home_page.level<=' . User::getLevel() . ')\nAND (home_art.id IS NULL OR ' . (User::isLoggedIn() ? '' : 'home_art.public=1 AND ') . 'home_art.time<=' . time() . \" AND home_art.confirmed=1)\nAND ({$alias}.type!=\" . self::ARTICLE_COMMENT . ' OR (\n ' . (User::isLoggedIn() ? '' : '(home_cat1.public=1 OR home_cat2.public=1 OR home_cat3.public=1) AND') . '\n (home_cat1.level<=' . User::getLevel() . ' OR home_cat2.level<=' . User::getLevel() . ' OR home_cat3.level<=' . User::getLevel() . ')\n))';\n\n // custom conditions\n if (!empty($sqlConditions)) {\n $conditions[] = $sqlConditions;\n }\n\n // joins\n $joins = 'LEFT JOIN ' . DB::table('page') . \" home_page ON({$alias}.type IN(1,3,5) AND {$alias}.home=home_page.id)\nLEFT JOIN \" . DB::table('article') . \" home_art ON({$alias}.type=\" . self::ARTICLE_COMMENT . \" AND {$alias}.home=home_art.id)\nLEFT JOIN \" . DB::table('page') . \" home_cat1 ON({$alias}.type=\" . self::ARTICLE_COMMENT . ' AND home_art.home1=home_cat1.id)\nLEFT JOIN ' . DB::table('page') . \" home_cat2 ON({$alias}.type=\" . self::ARTICLE_COMMENT . ' AND home_art.home2!=-1 AND home_art.home2=home_cat2.id)\nLEFT JOIN ' . DB::table('page') . \" home_cat3 ON({$alias}.type=\" . self::ARTICLE_COMMENT . ' AND home_art.home3!=-1 AND home_art.home3=home_cat3.id)\nLEFT JOIN ' . DB::table('post') . \" home_post ON({$alias}.type=\" . self::FORUM_TOPIC . \" AND {$alias}.xhome!=-1 AND {$alias}.xhome=home_post.id)\";\n\n // extend\n Extend::call('posts.filter', [\n 'columns' => &$columns,\n 'joins' => &$joins,\n 'conditions' => &$conditions,\n 'alias' => $alias,\n ]);\n\n // result\n $result = [\n $columns,\n $joins,\n implode(' AND ', $conditions),\n ];\n\n // add count\n if ($doCount) {\n $result[] = (int) DB::result(DB::query(\"SELECT COUNT({$alias}.id) FROM \" . DB::table('post') . \" {$alias} {$joins} WHERE {$result[2]}\"));\n }\n\n return $result;\n }", "protected function prepare_items_query($prepared_args = array(), $request = \\null)\n {\n }", "protected function prepare_items_query($prepared_args = array(), $request = \\null)\n {\n }", "protected function prepare_items_query($prepared_args = array(), $request = \\null)\n {\n }", "protected function prepare_items_query($prepared_args = array(), $request = \\null)\n {\n }", "function getAllTagsFromAlbum($albumname,$subalbums=false,$mode='images') {\n\tglobal $_zp_gallery;\n\t$passwordcheck = '';\n\t$imageWhere = '';\n\t$tagWhere = \"\";\n\t$albumname = sanitize($albumname);\n\tif(empty($albumname)) {\n\t\treturn FALSE;\n\t}\n\t$albumobj = new Album($_zp_gallery,$albumname);\n\tif(!$albumobj->exists) {\n\t\treturn FALSE;\n\t}\n\tif (zp_loggedin()) {\n\t\t$albumWhere = \"WHERE `dynamic`=0\";\n\t} else {\n\t\t$albumscheck = query_full_array(\"SELECT * FROM \" . prefix('albums'). \" ORDER BY title\");\n\t\tforeach($albumscheck as $albumcheck) {\n\t\t\tif(!checkAlbumPassword($albumcheck['folder'])) {\n\t\t\t\t$albumpasswordcheck= \" AND id != \".$albumcheck['id'];\n\t\t\t\t$passwordcheck = $passwordcheck.$albumpasswordcheck;\n\t\t\t}\n\t\t}\n\t\t$albumWhere = \"WHERE `dynamic`=0 AND `show`=1\".$passwordcheck;\n\t}\n\tif($subalbums) {\n\t\t$albumWhere .= \" AND `folder` LIKE \".db_quote($albumname.\"%\");\n\t} else {\n\t\t$albumWhere .= \" AND `folder` = \".db_quote($albumname);\n\t}\n\t$albumids = query_full_array(\"SELECT id, folder FROM \" . prefix('albums'). $albumWhere);\n\tswitch($mode) {\n\t\tcase \"images\":\n\t\t\tif(count($albumids) == 0) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$imageWhere = \" WHERE \";\n\t\t\t\t$count = \"\";\n\t\t\t\tforeach($albumids as $albumid) {\n\t\t\t\t\t$count++;\n\t\t\t\t\t$imageWhere .= 'albumid='. $albumid['id'];\n\t\t\t\t\tif($count != count($albumids)) $imageWhere .= \" OR \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$imageids = query_full_array(\"SELECT id, albumid FROM \" . prefix('images').$imageWhere);\n\t\t\t// if the album has no direct images and $subalbums is set to false\n\t\t\tif(count($imageids) == 0) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$count = \"\";\n\t\t\t\t$tagWhere = \" WHERE \";\n\t\t\t\tforeach($imageids as $imageid) {\n\t\t\t\t\t$count++;\n\t\t\t\t\t$tagWhere .= '(o.objectid ='. $imageid['id'].\" AND o.tagid = t.id AND o.type = 'images')\";\n\t\t\t\t\tif($count != count($imageids)) $tagWhere .= \" OR \";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(empty($tagWhere)) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$tags = query_full_array(\"SELECT DISTINCT t.name, t.id, (SELECT DISTINCT COUNT(*) FROM \". prefix('obj_to_tag'). \" WHERE tagid = t.id AND type = 'images') AS count FROM \". prefix('obj_to_tag'). \" AS o,\". prefix('tags'). \" AS t\".$tagWhere.\" ORDER BY t.name\");\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"albums\":\n\t\t\t$count = \"\";\n\t\t\tif(count($albumids) == 0) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$tagWhere = \" WHERE \";\n\t\t\t\tforeach($albumids as $albumid) {\n\t\t\t\t\t$count++;\n\t\t\t\t\t$tagWhere .= '(o.objectid ='. $albumid['id'].\" AND o.tagid = t.id AND o.type = 'albums')\";\n\t\t\t\t\tif($count != count($albumids)) $tagWhere .= \" OR \";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(empty($tagWhere)) {\n\t\t\t\treturn FALSE;\n\t\t\t} else {\n\t\t\t\t$tags = query_full_array(\"SELECT DISTINCT t.name, t.id, (SELECT DISTINCT COUNT(*) FROM \". prefix('obj_to_tag'). \" WHERE tagid = t.id AND o.type = 'albums') AS count FROM \". prefix('obj_to_tag'). \" AS o,\". prefix('tags'). \" AS t\".$tagWhere.\" ORDER BY t.name\");\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn $tags;\n}", "protected function buildQuery()\n\t{\n\t\t$this->query = count($this->conditions) ? 'WHERE ' . implode(' AND ', $this->conditions) : '';\n\t}", "private function getAlbums($aData)\n {\n /**\n * @var string\n */\n $sAction = (isset($aData['sAction']) && $aData['sAction'] == 'new') ? 'new' : 'more';\n /**\n * @var int\n */\n $iLastTimeStamp = isset($aData['iLastTimeStamp']) ? (int) $aData['iLastTimeStamp'] : 0;\n /**\n * @var string\n */\n $sView = isset($aData['sView']) ? $aData['sView'] : '';\n /**\n * @var int\n */\n $iAmountOfAlbum = isset($aData['iAmountOfAlbum']) ? (int) $aData['iAmountOfAlbum'] : 10;\n /**\n * @var string\n */\n $sSearch = isset($aData['sSearch']) ? $aData['sSearch'] : '';\n /**\n * @var array\n */\n $aCond = array();\n\n if (!empty($sSearch))\n {\n $aCond[] = 'm.name LIKE \"' . Phpfox::getLib('parse.input')->clean('%' . $sSearch . '%') . '\"';\n }\n switch ($sView) {\n case 'my':\n $aCond[] = 'm.user_id = ' . Phpfox::getUserId();\n break;\n\n case 'all':\n default:\n $aCond[] = 'm.view_id = 0';\n $aCond[] = 'm.privacy IN(0)';\n break;\n }\n if ($iLastTimeStamp > 0)\n {\n if ($sAction == 'more')\n {\n $aCond[] = 'm.time_stamp < ' . $iLastTimeStamp;\n }\n else\n {\n $aCond[] = 'm.time_stamp > ' . $iLastTimeStamp;\n }\n }\n $this->database()\n ->select('COUNT(*)')\n ->from(Phpfox::getT('music_album'), 'm');\n /**\n * @var int\n */\n $iCount = $this->database()\n ->where(implode(' AND ', $aCond))\n ->limit(1)\n ->execute('getField');\n if ($iCount == 0)\n {\n return array();\n }\n /**\n * @var array\n */\n $aAlbums = $this->database()\n ->select('lik.like_id AS is_liked, m.*, u.user_id, u.profile_page_id, u.server_id AS user_server_id, u.user_name, u.full_name, u.gender, u.user_image, u.is_invisible, u.user_group_id, u.language_id')\n ->from(Phpfox::getT('music_album'), 'm')\n ->leftJoin(Phpfox::getT('like'), 'lik', 'lik.type_id = \\'music_album\\' AND lik.item_id = m.album_id AND lik.user_id = ' . Phpfox::getUserId())\n ->join(Phpfox::getT('user'), 'u', 'u.user_id = m.user_id')\n ->where(implode(' AND ', $aCond))\n ->order('m.time_stamp DESC')\n ->limit(0, $iAmountOfAlbum, $iCount)\n ->execute('getRows');\n /**\n * @var array\n */\n $aResult = array();\n foreach ($aAlbums as $aAlbum)\n {\n $aResult[] = array(\n 'bIsLiked' => isset($aAlbum['is_liked']) ? (bool) $aAlbum['is_liked'] : false,\n 'iAlbumId' => $aAlbum['album_id'],\n 'iViewId' => $aAlbum['view_id'],\n 'iPrivacy' => $aAlbum['privacy'],\n 'iPrivacyComment' => $aAlbum['privacy_comment'],\n 'bIsFeatured' => (bool) $aAlbum['is_featured'],\n 'bIsSponsor' => (bool) $aAlbum['is_sponsor'],\n 'iUserId' => $aAlbum['user_id'],\n 'sName' => $aAlbum['name'],\n 'iYear' => $aAlbum['year'],\n 'sImagePath' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['server_id'],\n 'path' => 'music.url_image',\n 'file' => $aAlbum['image_path'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'iTotalTrack' => $aAlbum['total_track'],\n 'iTotalPlay' => $aAlbum['total_play'],\n 'iTotalComment' => $aAlbum['total_comment'],\n 'iTotalLike' => $aAlbum['total_like'],\n 'iTotalDislike' => $aAlbum['total_dislike'],\n 'iTotalScore' => $aAlbum['total_score'],\n 'iTotalRating' => $aAlbum['total_rating'],\n 'iTimeStamp' => $aAlbum['time_stamp'],\n 'sTimeStamp' => date('l, F j', $aAlbum['time_stamp']),\n 'sFullTimeStamp' => date('l, F j', $aAlbum['time_stamp']) . ' at ' . date('g:i a', $aAlbum['time_stamp']),\n 'sModuleId' => isset($aAlbum['module_id']) ? $aAlbum['module_id'] : 0,\n 'iItemId' => $aAlbum['item_id'],\n 'iProfilePageId' => $aAlbum['profile_page_id'],\n 'iUserServerId' => $aAlbum['user_server_id'],\n 'sUsername' => $aAlbum['user_name'],\n 'sFullname' => $aAlbum['full_name'],\n 'iGender' => $aAlbum['gender'],\n 'sUserImage' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['user_server_id'],\n 'path' => 'core.url_user',\n 'file' => $aAlbum['user_image'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'bIsInvisible' => $aAlbum['is_invisible'],\n 'iUserGroupId' => $aAlbum['user_group_id'],\n 'iLanguageId' => isset($aAlbum['language_id']) ? $aAlbum['language_id'] : 0\n );\n }\n return $aResult;\n }", "protected function _prepareConditionBlock(Collection $collection)\n\t{\n\t\t$array = array();\n\t\t\n\t\t/* @var $condition t41_Condition */\n\t\tforeach ($collection->getConditions() as $condition) {\n\t\t\t\n\t\t\t/* get property id in backend */\n\t\t\t$key = $this->_mapper->propertyToDatastoreName($collection->getClass(), $condition[0]->getProperty()->getId());\n\n\t\t\t$array[$key] = array();\n\t\t\t\n\t\t\t$clauses = $condition[0]->getClauses();\n\t\t\t$value = array();\n\n\t\t\tforeach ($clauses as $clause) {\n\t\t\t\n\t\t\t\tif (! isset($mode)) $mode = isset($clause['mode']) ? $clause['mode'] : Backend\\Condition::MODE_AND;\n\t\t\t\t$ops = $this->_matchOperator($clause['operator']);\n\n\t\t\t\t$prefix = $suffix = null;\n\t\t\t\t\n\t\t\t\tforeach ($ops as $op) {\n\n\t\t\t\t\tswitch ($op) {\n\t\t\t\t\n\t\t\t\t\t\tcase Backend\\Condition::OPERATOR_BEGINSWITH:\n\t\t\t\t\t\t\t$prefix = '^'; \n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase Backend\\Condition::OPERATOR_ENDSWITH:\n\t\t\t\t\t\t\t$suffix = '$';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (is_array($clause['value'])) {\n\t\t\t\t\t\t\n\t\t\t\t\t$value[] = $prefix . '[' . implode(\",\", $clause['value']) . ']' . $suffix;\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t$value[] = $prefix . $clause['value'] . $suffix;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$array[$key][$mode] = $value;\n\t\t\t$mode = null;\n\t\t}\n\n\t\t$this->_conditionsBlock = $array;\n\t}", "private function init_consolidationAndSelect()\n {\n // RETURN : there isn't any filter\n if ( !$this->bool_isFilter )\n {\n return;\n }\n // RETURN : there isn't any filter\n // Add tableUids to the consolidation array\n $this->init_consolidationAndSelect_setArrayConsolidation();\n\n // Add tableFields to the ts property SELECT\n $this->init_consolidationAndSelect_setTsSelect();\n }", "public function setConditions(array $conditions)\n\t{\n\t\tforeach ($conditions as $key => $condition) {\n\t\t\tif (is_object($condition))\n\t\t\t\t$this->addCondition($condition);\n\t\t\telse {\n\t\t\t\tlist($name, $path, $type) = is_string($condition) ?\n\t\t\t\t\t[$key, $condition, ConditionInterface::TYPE_STRING] :\n\t\t\t\t\tarray_pad(array_merge([$key], $condition), 3, ConditionInterface::TYPE_STRING);\n\n\t\t\t\t$this->createCondition($name, $path, $type);\n\t\t\t}\n\t\t}\n\t}", "function search_album() {\r\n\tglobal $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;\r\n\r\n\t// CONSTRUCT QUERY\r\n\t$album_query = \"\r\n\t(\r\n\tSELECT\r\n '1' AS sub_type,\r\n\t se_media.media_album_id AS album_id,\r\n\t se_media.media_title AS title,\r\n\t se_media.media_desc AS description,\r\n\t se_media.media_id AS media_id,\r\n\t se_media.media_ext AS media_ext,\r\n\t se_users.user_id,\r\n\t se_users.user_username,\r\n\t se_users.user_photo,\r\n\t se_users.user_fname,\r\n\t se_users.user_lname\r\n\tFROM\r\n\t se_media,\r\n\t se_albums,\r\n\t se_users,\r\n\t se_levels\r\n\tWHERE\r\n\t se_media.media_album_id=se_albums.album_id AND\r\n\t se_albums.album_user_id=se_users.user_id AND\r\n\t se_users.user_level_id=se_levels.level_id AND\r\n\t (\r\n\t se_albums.album_search='1' OR\r\n\t se_levels.level_album_search='0'\r\n\t )\r\n\t AND\r\n\t (\r\n\t se_media.media_title LIKE '%{$search_text}%' OR\r\n\t se_media.media_desc LIKE '%{$search_text}%'\r\n\t )\r\n\tORDER BY media_id DESC\r\n\t)\r\n\tUNION ALL\r\n\t(\r\n\tSELECT\r\n\t '2' AS sub_type,\r\n\t se_albums.album_id AS album_id,\r\n\t se_albums.album_title AS title,\r\n\t se_albums.album_desc AS description,\r\n\t se_albums.album_cover AS media_id,\r\n\t se_media.media_ext AS media_ext,\r\n\t se_users.user_id,\r\n\t se_users.user_username,\r\n\t se_users.user_photo,\r\n\t se_users.user_fname,\r\n\t se_users.user_lname\r\n\tFROM\r\n\t se_albums,\r\n\t se_users,\r\n\t se_levels,\r\n\t se_media\r\n\tWHERE\r\n\t se_albums.album_user_id=se_users.user_id AND\r\n\t se_users.user_level_id=se_levels.level_id AND\r\n\t se_albums.album_cover=se_media.media_id AND \r\n\t (\r\n\t se_albums.album_search='1' OR\r\n\t se_levels.level_album_search='0'\r\n\t )\r\n\t AND\r\n\t (\r\n\t se_albums.album_title LIKE '%{$search_text}%' OR\r\n\t se_albums.album_desc LIKE '%{$search_text}%'\r\n\t )\r\n\tORDER BY album_id DESC\r\n\t)\"; \r\n\r\n\t// GET TOTAL RESULTS\r\n\t$total_albums = $database->database_num_rows($database->database_query($album_query.\" LIMIT 201\"));\r\n\r\n\t// IF NOT TOTAL ONLY\r\n\tif($t == \"album\")\r\n {\r\n\t // MAKE ALBUM PAGES\r\n\t $start = ($p - 1) * $results_per_page;\r\n\t $limit = $results_per_page+1;\r\n\r\n\t // SEARCH ALBUMS\r\n\t $albums = $database->database_query($album_query.\" ORDER BY album_id DESC LIMIT $start, $limit\");\r\n\t while($album_info = $database->database_fetch_assoc($albums)) {\r\n\r\n\t // CREATE AN OBJECT FOR USER\r\n\t $profile = new se_user();\r\n\t $profile->user_info['user_id'] = $album_info['user_id'];\r\n\t $profile->user_info['user_username'] = $album_info['user_username'];\r\n\t $profile->user_info['user_fname'] = $album_info['user_fname'];\r\n\t $profile->user_info['user_lname'] = $album_info['user_lname'];\r\n\t $profile->user_info['user_photo'] = $album_info['user_photo'];\r\n\t $profile->user_displayname();\r\n\r\n\t // RESULT IS A MEDIA\r\n\t if($album_info[sub_type] == 1) {\r\n\t $result_url = $url->url_create('album_file', $album_info['user_username'], $album_info['album_id'], $album_info['media_id']);\r\n\t $result_name = 1000119;\r\n\t $result_desc = 1000121;\r\n\r\n\t // RESULT IS AN ALBUM\r\n\t } else {\r\n\t $result_url = $url->url_create('album', $album_info['user_username'], $album_info['album_id']);\r\n\t $result_name = 1000120;\r\n\t $result_desc = 1000122;\r\n\t }\r\n\r\n\t // SET THUMBNAIL, IF AVAILABLE\r\n\t switch($album_info['media_ext']) {\r\n\t\tcase \"jpeg\": case \"jpg\": case \"gif\": case \"png\": case \"bmp\":\r\n\t\t $thumb_path = $url->url_userdir($album_info['user_id']).$album_info['media_id'].\"_thumb.jpg\";\r\n\t\t break;\r\n\t\tcase \"mp3\": case \"mp4\": case \"wav\":\r\n\t\t $thumb_path = \"./images/icons/audio_big.gif\";\r\n\t\t break;\r\n\t\tcase \"mpeg\": case \"mpg\": case \"mpa\": case \"avi\": case \"swf\": case \"mov\": case \"ram\": case \"rm\":\r\n\t\t $thumb_path = \"./images/icons/video_big.gif\";\r\n\t\t break;\r\n\t\tdefault:\r\n\t\t $thumb_path = \"./images/icons/file_big.gif\";\r\n\t }\r\n\r\n\t if(!file_exists($thumb_path)) { $thumb_path = \"./images/icons/file_big.gif\"; }\r\n\r\n\t // IF NO TITLE\r\n\t if($album_info['title'] == \"\") { SE_Language::_preload(589); SE_Language::load(); $album_info['title'] = SE_Language::_get(589); }\r\n\r\n\t // IF DESCRIPTION IS LONG\r\n\t if(strlen($album_info['description']) > 150) { $album_info['description'] = substr($album_info['description'], 0, 147).\"...\"; }\r\n\r\n\t $results[] = Array('result_url' => $result_url,\r\n\t\t\t\t'result_icon' => $thumb_path,\r\n\t\t\t\t'result_name' => $result_name,\r\n\t\t\t\t'result_name_1' => $album_info['title'],\r\n\t\t\t\t'result_desc' => $result_desc,\r\n\t\t\t\t'result_desc_1' => $url->url_create('profile', $album_info['user_username']),\r\n\t\t\t\t'result_desc_2' => $profile->user_displayname,\r\n\t\t\t\t'result_desc_3' => $album_info['description']);\r\n\t }\r\n\r\n\t // SET TOTAL RESULTS\r\n\t $total_results = $total_albums;\r\n\r\n\t}\r\n\r\n\t// SET ARRAY VALUES\r\n\tSE_Language::_preload_multi(1000118, 1000119, 1000120, 1000121, 1000122);\r\n\tif($total_albums > 200) { $total_albums = \"200+\"; }\r\n\t$search_objects[] = Array('search_type' => 'album',\r\n\t\t\t\t'search_lang' => 1000118,\r\n\t\t\t\t'search_total' => $total_albums);\r\n\r\n}", "public function _fetch_incidents_set_params()\n\t{\n\t\t$params = Event::$data;\n\t\t\n\t\t// Look for fake media type\n\t\tif ($filters = $this->_check_media_type())\n\t\t{\n\t\t\t\n\t\t\t$actionable_sql = array();\n\t\t\tforeach ($filters as $filter)\n\t\t\t{\n\t\t\t\t// Cast the $filter to int just in case\n\t\t\t\t$filter = intval($filter);\n\t\t\t\t\n\t\t\t\t// Add filter based on actionable status.\n\t\t\t\tswitch ($filter)\n\t\t\t\t{\n\t\t\t\t\tcase '101':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE (actionable = 1 OR actionable = 2 OR actionable = 0) AND (action_taken = 0 OR action_taken = 1))';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '102':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE (actionable = 1 OR actionable =2) AND action_taken = 0)';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '103':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE actionable = 2 AND action_taken = 0)';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '104':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE action_taken = 1)';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '105':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE action_taken = 2)';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '106':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE actionable = 0)';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (count($actionable_sql) > 0)\n\t\t\t{\n\t\t\t\t$actionable_sql = '('.implode(' OR ',$actionable_sql).')';\n\t\t\t\t$params[] = $actionable_sql;\n\t\t\t}\n\t\t}\n\n\t\tEvent::$data = $params;\n/*\n\t\techo \"<LEIF>\";\n\t\tvar_dump(Event::$data);\n\t\techo \"</LEIF>\";\n*/\n\t}", "public function dynamicFilters($filters)\n {\n if ( !$filters ) return;\n\n foreach ($filters as $item)\n {\n $this->whereHas('spec_data', function($query) use ($item) {\n \n $query->where('spec_row_id', $item['row_id'])->when( $item['values'] ?? false, function($query) use($item) {\n\n $query->whereHas('values', function($query) use ($item) {\n \n $query->whereIn('id', $item['values'] );\n });\n }, function($query) use($item) {\n\n $query->whereHas('translations', function($query) use ($item) {\n \n $query->where('data', $item['data'] ?? null);\n });\n });\n\n });\n }\n\n return;\n }", "private function processAndCombinationCondition($collection, $cond, $value, $attribute)\n {\n $condition = [];\n\n if ($cond == 'null') {\n if ($value == '1') {\n $condition = ['notnull' => true];\n } elseif ($value == '0') {\n $condition = [$cond => true];\n }\n } else {\n if ($cond == 'like' || $cond == 'nlike') {\n $value = '%' . $value . '%';\n }\n //condition with null values can't be filtered using string, include to filter null values\n $conditionMap = [$this->conditionMap[$cond] => $value];\n if ($cond == 'eq' || $cond == 'neq') {\n $conditionMap[] = ['null' => true];\n }\n\n $condition = $conditionMap;\n }\n\n //filter by quote attribute\n if ($attribute == 'items_qty' && $this->ruleType == self::REVIEW) {\n $collection = $this->filterCollectionByQuoteAttribute($collection, $attribute, $condition);\n } else {\n $collection->addFieldToFilter($attribute, $condition);\n }\n\n return $collection;\n }", "function defineCriterias($criterio,$PreparedStatement){\n\t\t\tif(isset ($criterio[\"consumo_id\"]) && trim($criterio[\"consumo_id\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_id = \".Connection::inject($criterio[\"consumo_id\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"socio_id\"]) && trim($criterio[\"socio_id\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND socio_id = \".Connection::inject($criterio[\"socio_id\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"nro_medidor\"]) && trim($criterio[\"nro_medidor\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND nro_medidor LIKE '%\".Connection::inject($criterio[\"nro_medidor\"]).\"%'\";\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_lectura\"]) && trim($criterio[\"fecha_lectura\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_lectura = \".Connection::inject($criterio[\"fecha_lectura\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_emision\"]) && trim($criterio[\"fecha_emision\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_emision = \".Connection::inject($criterio[\"fecha_emision\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"periodo_mes\"]) && trim($criterio[\"periodo_mes\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND periodo_mes = \".Connection::inject($criterio[\"periodo_mes\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"periodo_anio\"]) && trim($criterio[\"periodo_anio\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND periodo_anio = \".Connection::inject($criterio[\"periodo_anio\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"consumo_total_lectura\"]) && trim($criterio[\"consumo_total_lectura\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_total_lectura = \".Connection::inject($criterio[\"consumo_total_lectura\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"consumo_por_pagar\"]) && trim($criterio[\"consumo_por_pagar\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_por_pagar = \".Connection::inject($criterio[\"consumo_por_pagar\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"costo_consumo_por_pagar\"]) && trim($criterio[\"costo_consumo_por_pagar\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND costo_consumo_por_pagar = \".Connection::inject($criterio[\"costo_consumo_por_pagar\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"estado\"]) && trim($criterio[\"estado\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND estado = '\".Connection::inject($criterio[\"estado\"]).\"'\";\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_hora_pago\"]) && trim($criterio[\"fecha_hora_pago\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_hora_pago = \".Connection::inject($criterio[\"fecha_hora_pago\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"usuario_pago\"]) && trim($criterio[\"usuario_pago\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND usuario_pago = \".Connection::inject($criterio[\"usuario_pago\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"monto_pagado\"]) && trim($criterio[\"monto_pagado\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND monto_pagado = \".Connection::inject($criterio[\"monto_pagado\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"pagado_por\"]) && trim($criterio[\"pagado_por\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND pagado_por = \".Connection::inject($criterio[\"pagado_por\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"ci_pagado_por\"]) && trim($criterio[\"ci_pagado_por\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND ci_pagado_por = \".Connection::inject($criterio[\"ci_pagado_por\"]);\n\t\t\t}\n\t\t\treturn $PreparedStatement;\n\t\t}", "public function albumsFromList(Request $request)\n { \n $collection = collect([]);\n foreach(array_unique($request->artists) as $artist){\n\n $albums = Artist::find($artist)->albums;\n\n foreach($albums as $album){\n $condition = TRUE;\n foreach(array_unique($request->artists) as $artistAux){\n if(!($album->artists->contains('id', $artistAux))){\n $condition = false; \n }\n }\n if($condition){\n $collection->push($album);\n }\n }\n }\n return $collection->unique('id');\n }", "private function _buildQuery($filters = array())\n\t{\n\t\t// var to hold conditions\n\t\t$where = array();\n\t\t$sql = '';\n\n\t\t// gidnumber\n\t\tif (isset($filters['gidNumber']))\n\t\t{\n\t\t\t$where[] = \"gidNumber=\" . $this->_db->quote($filters['gidNumber']);\n\t\t}\n\n\t\t// action\n\t\tif (isset($filters['action']))\n\t\t{\n\t\t\t$where[] = \"action=\" . $this->_db->quote($filters['action']);\n\t\t}\n\n\t\t// if we have and conditions\n\t\tif (count($where) > 0)\n\t\t{\n\t\t\t$sql = \" WHERE \" . implode(\" AND \", $where);\n\t\t}\n\n\t\tif (isset($filters['orderby']))\n\t\t{\n\t\t\t$sql .= \" ORDER BY \" . $filters['orderby'];\n\t\t}\n\n\t\treturn $sql;\n\t}", "protected function setUp() {\n\t\t$this->object = QuerySubCondition::create();\n\t}", "function addConditionalsToQuery($query, $filledFormFields) {\n\t// Testing if we have to fill the conditional of our SQL statement\n\tif(count($filledFormFields) > 0) {\n\t\t$query .= \" WHERE \";\n\n\n\t\t// Adding the conditionals to the query\n\t\t$i = 0;\n\t\tforeach($filledFormFields as $fieldKey => $fieldValue) {\n\t\t\t// Appending the new conditional\n\t\t\t$queryAppendage = $fieldKey . \" LIKE :\" . $fieldKey . \" \";\n\n\t\t\t$query .= $queryAppendage;\n\t\t\t\n\t\t\t// If there's more conditionals after this, append an \"AND\" as well.\n\t\t\tif($i < count($filledFormFields) - 1) \n\t\t\t\t$query .= \" AND \";\n\n\t\t\t$i++;\n\t\t}\n\t}\n\n\treturn $query;\n}", "protected function prepareCriteria(array $criteria = [])\n {\n foreach ($criteria as $criteriaKey => &$criteriaValue) {\n if ('$or' === $criteriaKey) {\n $criteria[$criteriaKey] = $this->prepareCriteria($criteriaValue);\n continue;\n }\n if (false !== strpos($criteriaKey, ':')) {\n unset($criteria[$criteriaKey]);\n $this->prepareCompositeCriteria($criteriaKey, $criteriaValue);\n $criteria[$criteriaKey] = $criteriaValue;\n }\n }\n\n return $criteria;\n }", "public function append($conditions)\n {\n if(is_string($conditions)){\n $conditions = [ $conditions ];\n }\n $this->conditions = array_merge($this->conditions, $conditions);\n }", "function prepSelected($data){\n\t\n\t$current = 0;\n\t$count = count($data);\n\t\n\t$placeholders = ''; $selected = array(); $i = 0;\n\t$keys = array_keys($data); \n\t\n\tforeach($keys as $item){\n\t\tprint_r($data);\n\t\t\n\t\tswitch($item){\n\t\t\tcase $data[$i] == $keys[$i] : array_push($selected, $item);\n\t\t\tbreak;\n\t\t}\n\t\t$i++;\n\t}\n\tprint_r($selected);\n\t\t\n\t//While there are selected items\n\twhile($current < $count){\n\t\t//create the keys\t\n\t\tif($count == 1) { \n\t\t\t$keys .= $selected[$current];\n\t\t} else {\n\t\t\t$keys .= $selected[$current].',';\n\t\t} \t\n\t\t//create the placeholders\t\n\t\tif($count == 1) { \n\t\t\t$placeholders .= '?';\n\t\t} else {\n\t\t\t$placeholders .= '?,';\n\t\t} \t\n\t\t$current++; \n\t}\n\tif($count > 1){\n\t\t$keys = explode(',', $keys);\n\t\t$trash = array_pop($keys);\n\t\t$keys = implode(',', $keys);\n\t\t\t\n\t\t$placeholders = explode(',', $placeholders);\n\t\t$trash = array_pop($placeholders);\n\t\t$placeholders = implode(',', $placeholders);\n\t\t\t\n\t}\n\t\n\n\t\n\treturn $sql_vals = array($keys, $placeholders);\n}", "public function getPackAlbumMap( array $a = array() ){\r\n\t\tif($a){\r\n\t\t\t$where=\"\";\r\n\t\t\tif($a['where']){\r\n\t\t\t\t$where=$a['where'];\r\n\t\t\t}\r\n\t\t\t\t$this->sSql = \"SELECT * FROM pack_album WHERE 1 $where\";\r\n\t\t\t\treturn $res = $this->oMysqli->query($this->sSql);\r\n\t\t}\r\n\t}", "protected function ancestorsFetchConditions()\r\n {\r\n $filter_parent = $this->getState('filter.parent');\r\n if (!empty($filter_parent))\r\n {\r\n $this->setCondition('parent', new \\MongoId((string) $filter_parent));\r\n }\r\n \r\n $filter_path = $this->getState('filter.path');\r\n if (strlen($filter_path))\r\n {\r\n // if the path doesn't begin with /, prefix it with a /\r\n if (substr($filter_path, 0, 1) !== '/')\r\n {\r\n $filter_path = '/' . $filter_path;\r\n }\r\n $this->setCondition('path', $filter_path);\r\n }\r\n \r\n $filter_path_begins_with = $this->getState('filter.path_begins_with');\r\n if ($filter_path_begins_with && is_string($filter_path_begins_with))\r\n {\r\n $key = new \\MongoRegex('/^'.$filter_path_begins_with.'/i');\r\n \r\n $this->setCondition('path', $key);\r\n }\r\n \r\n return $this;\r\n }", "public function setCondition(array $condition = [])\n {\n $this->condition = [];\n if ([] === $condition) {\n return $this;\n }\n foreach($condition as $v) {\n if ($v instanceof FHIRCoding) {\n $this->addCondition($v);\n } else {\n $this->addCondition(new FHIRCoding($v));\n }\n }\n return $this;\n }", "public function loadAlbums()\n {\n\t\t$json = file_get_contents('https://itunes.apple.com/us/rss/topalbums/limit=100/json');\n \n $albums = json_decode($json, true);\n $category_sql = \"INSERT IGNORE INTO categories (name, category_id, link) VALUES (:name, :category_id, :link)\";\n\t\t$album_sql = \"INSERT IGNORE INTO albums (album_id, name, artist, artist_link, category_id, release_date, rank) VALUES (:album_id, :name, :artist, :artist_link, :category_id, :release_date, :rank)\";\n\t\t$images_sql = \"INSERT IGNORE INTO album_art (album_id, album_image, image_size) VALUES (:album_id, :album_image, :image_size)\";\n\n\t\t//Lets delete whatever is in these tables before adding to them.\n\t\t$this->purgeTables();\n \n foreach($albums['feed']['entry'] as $rank=>$album) {\n\t\t\t\n\t\t\t//Insterts categories\n\t\t\t$stmt= $this->db->prepare($category_sql);\n\t\t\t\n\t\t\t$data = [\n\t\t\t\t'name' => $album['category']['attributes']['label'],\n\t\t\t\t'category_id' => $album['category']['attributes']['im:id'],\n\t\t\t\t'link' => $album['category']['attributes']['scheme'],\n\t\t\t];\n\t\t\t\n\t\t\t$stmt->execute($data);\n\t\t\t\n\t\t\t//Insterts album info\n\t\t\t$stmt= $this->db->prepare($album_sql);\n\t\t\t\n\t\t\t$data = [\n\t\t\t\t'album_id' => $album['id']['attributes']['im:id'],\n\t\t\t\t'name' => $album['title']['label'],\n\t\t\t\t'artist' => $album['im:artist']['label'],\n\t\t\t\t'artist_link' => (isset($album['im:artist']['attributes'])) ? $album['im:artist']['attributes']['href'] : '',\n\t\t\t\t'category_id' => $album['category']['attributes']['im:id'],\n\t\t\t\t'release_date' => $album['im:releaseDate']['label'],\n\t\t\t\t'rank' => $rank,\n\t\t\t];\n\n\t\t\t$stmt->execute($data);\n\t\t\t\n\t\t\t//inserts album images\n\t\t\t$stmt= $this->db->prepare($images_sql);\n\t\t\t\n\t\t\tforeach($album['im:image'] as $image){\n\t\t\t\t$data = [\n\t\t\t\t\t'album_id' => $album['id']['attributes']['im:id'],\n\t\t\t\t\t'album_image' => $image['label'],\n\t\t\t\t\t'image_size' => $image['attributes']['height'],\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\t$stmt->execute($data);\n\t\t\t}\n\t\t}\n\t}", "public function __construct($conditions) {\n $this->sql = trim($this->proccessSQL($conditions));\n }", "private function getQueryConditions($sql, $profileIsp, $profileItemCond, $typeFieldName)\n {\n $itemDataType = $profileIsp['item_data_type'];\n if ($itemDataType == 'S') {\n $ispCatArray = array_column($profileIsp['category_type'], 'value');\n $inString = \"'\" . implode(\"','\", $ispCatArray) . \"'\";\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value IN (\" . $inString . \") $profileItemCond ) \";\n } elseif ($itemDataType == 'D') {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND STR_TO_DATE(metadata_value, \\\"%m/%d/%Y\\\") >= '\" . $profileIsp['start_date'] . \"' AND STR_TO_DATE(metadata_value, \\\"%m/%d/%Y\\\") <= '\" . $profileIsp['end_date'] . \"' $profileItemCond ) \";\n } elseif ($itemDataType == 'N') {\n if ($profileIsp['is_single']) {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value = '\" . $profileIsp['single_value'] . \"' $profileItemCond ) \";\n } else {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value >= \" . $profileIsp['min_digits'] . \" AND metadata_value <= \" . $profileIsp['max_digits'] . \" $profileItemCond) \";\n }\n }\n }", "protected function prepareGroupByPart()\n {\n $this->groupByQuery = 'GROUP BY ';\n $this->groupByQuery .= implode(', ', $this->groupByPart);\n $this->groupByQuery = \" {$this->groupByQuery} \";\n }", "protected function getAttributeSetConditions($conditions) \n\t{\n\t\t$categories = explode(\",\",$conditions);\n\t\t$attributeSetConds = array();\n\t\t$i=1;\n\t\tforeach($categories as $category):\n\t\t\t$attributeSetId = $this->_getAttributeSetId(trim($category));//Get Attribute Set Id\n\t\t\t$attributeSetConds[\"1--1--\".$i] = array(\n\t\t\t\t\t\"type\" => \"Magento\\SalesRule\\Model\\Rule\\Condition\\Product\",\n\t\t\t\t\t\"attribute\" => \"attribute_set_id\",\n\t\t\t\t\t\"operator\" => \"==\",\n\t\t\t\t\t\"value\" => $attributeSetId\n\t\t\t\t);\n\t\t\t$i++;\n\t\tendforeach;\n\t\treturn $attributeSetConds;\n\t}", "private function cartConditions() {\n\t\t$userId = $this->Session->read('Auth.User.id');\n\t\tif (!$userId == NULL) {\n\t\t\t$id_type = 'user_id';\n\t\t\t$id = $userId;\n\t\t} else {\n\t\t\t$id_type = 'session_id';\n\t\t\t$id = $this->Session->id();\n\t\t}\n\t\treturn array(\n\t\t\t\"Cart.$id_type\" => $id, \n\t\t\t'OR' => array (\n\t\t\t\tarray('Cart.state' => CART_STATE),\n\t\t\t\tarray('Cart.state' => CHECKOUT_STATE)\n\t\t\t));\n\t}", "protected function _prepareAttributeCollection($collection)\n {\n $availableFilter = Mage::helper('layeredcategory')->getAvailableFilter();\n \n $collection ->addFieldToFilter('attribute_code',array('in'=>$availableFilter))\n ->addIsFilterableInSearchFilter()\n ->addVisibleFilter();\n return $collection;\n }", "function buildOpts($vars) {\r\n // echo \"<pre>\";var_dump($vars);echo \"</pre>\";\r\n // Stock Filters\r\n $opts = array();\r\n $dependents = array( // checkbox names to input names\r\n 'stock_center' => 'stock_center',\r\n 'filter-developer' => 'filter-developer',\r\n 'filter-source' => 'filter-source',\r\n 'filter-country' => 'filter-country',\r\n 'filter-identifier' => 'name',\r\n 'filter-type' => 'type',\r\n 'filter-state' => 'filter-state',\r\n 'filter-line' => 'line', // TODO\r\n 'filter-linkage_groups' => 'linkage_groups',\r\n 'filter-genotypic_variation1' => 'genotypic_variation1',\r\n 'filter-karyotypic_variation' => 'karyotypic_variation'\r\n );\r\n //'num-states' => 'num-states',\r\n // 'state2' => 'state2'\r\n foreach ($dependents as $selected => $key) {\r\n if ((array_key_exists($selected, $vars) && $vars[$selected] == 'on')) {\r\n $opts[$key] = $vars[$key];\r\n }\r\n }\r\n \r\n // Filters passed as url params\r\n $dependentVals = array_values($dependents);\r\n foreach ($vars as $varKey => $varVal) {\r\n if (in_array($varKey, $dependentVals)) {\r\n $opts[$varKey] = $vars[$varKey];\r\n }\r\n }\r\n \r\n //Multiple selections from each of the below filters can now be made\r\n if (count($vars['states']) > 0) {\r\n $opts['num-states'] = count($vars['states']);\r\n for ($i=0; $i<$opts['num-states']; $i++) {\r\n $opts['state'.$i] = $vars['states'][$i];\r\n }\r\n }\r\n \r\n if (count($vars['developers']) > 0) {\r\n $opts['num-developers'] = count($vars['developers']);\r\n for ($i=0; $i<$opts['num-developers']; $i++) {\r\n $opts['developer'.$i] = $vars['developers'][$i];\r\n }\r\n }\r\n \r\n if (count($vars['sources']) > 0) {\r\n $opts['num-sources'] = count($vars['sources']);\r\n for ($i=0; $i<$opts['num-sources']; $i++) {\r\n $opts['source'.$i] = $vars['sources'][$i];\r\n }\r\n }\r\n \r\n if (count($vars['countries']) > 0) {\r\n $opts['num-countries'] = count($vars['countries']);\r\n for ($i=0; $i<$opts['num-countries']; $i++) {\r\n $opts['country'.$i] = $vars['countries'][$i];\r\n }\r\n }\r\n \r\n \r\n //return $vars;\r\n \r\n //echo \"<br><br>opts dump <br>\";\r\n // echo \"<pre>\";var_dump($opts);echo \"</pre><br><br>\";\r\n \r\n //return $vars; //TODO: Test this well to make sure this doesnt break anything\r\n return $opts; //original code\r\n }" ]
[ "0.65234613", "0.6399655", "0.5974639", "0.5733975", "0.57139575", "0.5670625", "0.5528833", "0.55064744", "0.54652643", "0.5464961", "0.54365945", "0.54023516", "0.53540486", "0.5334085", "0.5146293", "0.5141442", "0.5139051", "0.5123573", "0.5091132", "0.50798464", "0.5077521", "0.50596035", "0.5049656", "0.5049585", "0.5040557", "0.49904442", "0.49477568", "0.49367416", "0.49334192", "0.49309283", "0.4921537", "0.4879796", "0.48595378", "0.4837683", "0.48261747", "0.4804809", "0.48042685", "0.47928002", "0.47874928", "0.47718617", "0.47608256", "0.47552356", "0.4749919", "0.47464156", "0.4737334", "0.47335377", "0.4723211", "0.4718641", "0.47079575", "0.4696891", "0.46851316", "0.46803728", "0.46723652", "0.46722692", "0.46702167", "0.46692613", "0.4667682", "0.46667325", "0.46590042", "0.4646363", "0.4638517", "0.4632354", "0.4629573", "0.46251345", "0.46152723", "0.46098918", "0.46089724", "0.46031117", "0.4602933", "0.4602933", "0.4602933", "0.46024537", "0.459942", "0.45905432", "0.45884478", "0.45857102", "0.45678973", "0.45665112", "0.45656848", "0.45578167", "0.45383114", "0.45360082", "0.45349202", "0.4534216", "0.45334277", "0.4528555", "0.4519839", "0.4517118", "0.45151034", "0.4514794", "0.45142466", "0.45065543", "0.44989184", "0.44982603", "0.44956926", "0.44808486", "0.44805625", "0.44792944", "0.44719622", "0.446845" ]
0.71415025
0
Checks that the viewing user may managed a reported media item
public function canManageReportedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null) { $this->standardizeViewingUserReference($viewingUser); if (!$viewingUser['user_id']) { return false; } return ( XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny') || XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny') ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canManageModeratedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null)\n\t{\n\t\t$this->standardizeViewingUserReference($viewingUser);\n\t\t\n\t\tif (!$viewingUser['user_id'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tXenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny')\n\t\t\t|| XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'approveUnapprove')\t\t\t\n\t\t);\n\t}", "public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }", "function isRequested($user_id, $media_id)\n\t{\n\t\treturn $this->query->isRequested($user_id, $media_id);\n\t}", "public function can_manage() {\n\t\t$can_manage = false;\n\t\t\n\t\t// is the user the owner of the package\n\t\tif ( ( $this->get_user_id() == get_current_user_id() ) && ( $this->status < 6 ) && ( $this->status > 0 ) ) {\n\t\t\t$can_manage = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_manage_other_packages' ) ) {\n\t\t\t\t$can_manage = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_manage;\n\t}", "function publisher_userIsModerator($itemObj)\r\n{\r\n $publisher = PublisherPublisher::getInstance();\r\n $categoriesGranted = $publisher->getHandler('permission')->getGrantedItems('category_moderation');\r\n return (is_object($itemObj) && in_array($itemObj->categoryid(), $categoriesGranted));\r\n}", "public function need_media()\n\t{\n\t\treturn $this->need_media;\n\t}", "public function canManageTracking();", "function can_manage(){\r\n\t\treturn ( $this->get_booking()->can_manage() );\r\n\t}", "public static function checkOwnerExisting()\n {\n global $mainframe;\n $db = JFactory::getDbo();\n $db->setQuery(\"Select count(id) from #__osrs_agents where agent_type <> '0' and published = '1'\");\n $count = $db->loadResult();\n if ($count > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function canViewNewsFeedItem(array $item, $content, array $viewingUser)\n\t{\n\t\treturn $this->_mediaModel->canViewMedia();\n\t}", "public function hasPlayableResource($mm){\n return $mm->getFilteredTracksWithTags(['display']) || $mm->getProperty('opencast');\n }", "public function isOwner($item)\n {\n $roles = Session::get('roles');\n $userId = Auth::user()->externalId;\n\n $result = !empty(array_intersect($roles, ['Administrator','Accounting','Developer']));\n if ($result || in_array($userId,['34',\"55\",'155'])) { // allow mikker to see all forms\n return true;\n }\n\n //remove the user role. we don't care about it\n $roles = array_diff($roles, array('User'));\n $roles = array_values($roles);\n\n switch ($roles[0]){\n case \"Client Manager\":\n return $item->ClientAlias->Client->ClientManager_Id == null? true: $userId ? true:false;\n break;\n case \"Adwords\":\n case \"SEO\":\n // loop through all contracts and find if he has a contract assigned to him\n $owner = false;\n if(is_array($item->Contract)){\n foreach ($item->Contract as $contract){\n if($contract->Manager_Id == $userId){\n $owner = true;\n break;\n }\n }\n }\n return $owner;\n break;\n case \"Sales\":\n return $item->ClientAlias->User_Id == $userId ? true:false;\n break;\n default :\n break;\n }\n //default, we deny.\n return false;\n }", "public function hasPartsToIssue(): bool\n {\n return count($this->issuedItems) > 0;\n }", "function isMonitoring() {\n\t\tif (!session_loggedin() || !$this->ArtifactType->isPermitted()) {\n\t\t\treturn false;\n\t\t}\n\t\t$MonitorElementObject = new MonitorElement('artifact');\n\t\treturn $MonitorElementObject->isMonitoredByUserId($this->getID(), user_getid());\n\t}", "function otherUserIsWatchingIssue( $user, $issueID ) {\r\n\t\tif(empty($this->link)){\r\n\t\t\techo \"Not connected to database. Unexpected error. Contact your system administrator.\";\r\n\t\t\texit;\t\r\n\t\t}\r\n\t\t$query = \"SELECT issueid FROM issuewatch WHERE userid='$user' and issueid='$issueID'\";\r\n\t\t$result = mysql_query($query);\r\n\t\treturn mysql_num_rows($result) > 0;\r\n\t\t\r\n\t}", "public static function restrict_media_library_access() {\n\t\tglobal $pagenow;\n\t\tif (\n\t\t\t'upload.php' === $pagenow\n\t\t&&\n\t\t\t! current_user_can( get_post_type_object( 'post' )->cap->create_posts )\n\t\t) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to access the media library.', 'wporg-photos' ) );\n\t\t}\n\t}", "public function canMyLikes() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\treturn true;\n }", "public function canMycontentLikes() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\treturn true;\n }", "static function isTrackable()\n {\n if(!Auth::check())\n return true;\n $user = Auth::User();\n if(stristr($user->type, 'Employee') || stristr($user->type, 'Demo'))\n return false;\n return true;\n }", "public function accessMediasFolder()\n {\n return true;\n }", "public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "function rordb_can_user_view_items(){\n return current_user_can('rordb_view_items');\n}", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsProfileNotification::manage_process');\n }", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', app(Property::class));\n }", "public function isUsable(){\n return ($this->isValid() && $this->isEnabled() && !$this->isDeleted());\n }", "function CheckShowListAccess($item=array())\n {\n if (empty($item)) { return TRUE; }\n\n $res=$this->HasModuleAccess();\n \n return $res;\n }", "public function authorize()\n {\n $hackedRoute = 'admin.media.update';\n if ( ! is_null($this->segment(4))) {\n $hackedRoute = 'admin.media_category.media.update#####' .$this->segment(3);\n }\n return hasPermission($hackedRoute);\n }", "public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }", "public function ownsItem($ID)\n {\n $Item = $this->mysql->QUERY('SELECT ITEM_ID FROM player_equipment WHERE USER_ID = ? AND PLAYER_ID = ? AND ID = ?',\n [$this->user->USER_ID, $this->user->PLAYER_ID, $ID]);\n\n if (empty($Item) || $Item == null || !$Item || count($Item) < 1) {\n return false;\n } else {\n return true;\n }\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/emag_upload_invoice');\n }", "private function checkOwner() {\r\n if (!$this->model->isOwner()) {\r\n $this->api->redirect('contact/home?message=Cannot Be Accessed');\r\n }\r\n }", "function isAdmin() {\n\t\t$me = $_SESSION[\"me\"];\n\t\t$check = mf(mq(\"select `id`,`url` from `[p]musicplayer` where `id`='{$me}' limit 1\"));\n\t\tif ($check[\"url\"] == \"admin\") {\n\t\t\treturn true;\n\t\t}\n\t}", "public function get_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function viewableByOwnerOnly();", "public function privacyTest()\n {\n $this->prepareTestDB();\n \n $user_a = UNL_MediaHub_User::getByUid('test_a');\n $user_b = UNL_MediaHub_User::getByUid('test_b');\n \n //Logged out - most recent\n $list = new UNL_MediaHub_MediaList();\n $list->run();\n \n foreach ($list->items as $media) {\n $this->assertEquals('PUBLIC', $media->privacy, 'recent media for logged out users should be public');\n }\n\n //Logged in (user A) - most recent\n UNL_MediaHub_AuthService::getInstance()->setUser($user_a);\n \n //check with a caption requirement date set\n $original_requirement_date = UNL_MediaHub_Controller::$caption_requirement_date;\n UNL_MediaHub_Controller::$caption_requirement_date = '2015-09-24';\n \n $list = new UNL_MediaHub_MediaList();\n $list->run();\n $expected_ids = array(\n 1, //media_a because it is new and missing a text track, but user is part of its feed\n 2, //media_b because it is public (new and has text track)\n 3, //media_c because it is public (and old, missing text track)\n 4, //media_d because it is public (and old, missing text track)\n 5, //media_e because it is public (and old, missing text track)\n //NOT media_f because it is private\n //NOT media_g because it is unlisted\n );\n $found_ids = $this->getListIds($list);\n sort($found_ids);\n $this->assertEquals($expected_ids, $found_ids, 'users with access to media should see private and unlisted media');\n\n //Logged in (user B) - most recent\n UNL_MediaHub_AuthService::getInstance()->setUser($user_b);\n\n $list = new UNL_MediaHub_MediaList();\n $list->run();\n $expected_ids = array(\n //NOT media_a because it is new and missing a text track\n 2, //media_b because it is public (new and has text track)\n 3, //media_c because it is public (and old, missing text track)\n //4, //NOT media_d because it is private (and user is not a member of its feed)\n //5, //NOT media_e because it is unlisted (and user is not a member of its feed)\n 6, //media_f because it is private (because user_b in feed_b, which media_f is in)\n 7, //media_g because it is unlisted (because user_b in feed_b, which media_g is in)\n );\n $found_ids = $this->getListIds($list);\n sort($found_ids);\n $this->assertEquals($expected_ids, $found_ids, 'users with access to media should see private and unlisted media');\n\n //now check with a caption requirement date NOT set\n UNL_MediaHub_Controller::$caption_requirement_date = false;\n \n $list = new UNL_MediaHub_MediaList();\n $list->run();\n $expected_ids = array(\n 1, //media_a because it is new and missing a text track, but the caption requirement date is set to false\n 2, //media_b because it is public (new and has text track)\n 3, //media_c because it is public (and old, missing text track)\n //4, //NOT media_d because it is private (and user is not a member of its feed)\n //5, //NOT media_e because it is unlisted (and user is not a member of its feed)\n 6, //media_f because it is private (because user_b in feed_b, which media_f is in)\n 7, //media_g because it is unlisted (because user_b in feed_b, which media_g is in)\n );\n $found_ids = $this->getListIds($list);\n sort($found_ids);\n $this->assertEquals($expected_ids, $found_ids, 'users with access to media should see private and unlisted media');\n\n UNL_MediaHub_Controller::$caption_requirement_date = $original_requirement_date;\n }", "function storage_can_set($sv_user) {\n $allowed = ((api_is_platform_admin()) || ($sv_user == api_get_user_id()));\n if (!$allowed) {\n print \"ERROR : Not allowed\";\n }\n return $allowed;\n}", "function canDismiss($user) {\n \treturn $this->getUserId() == $user->getId();\n }", "public function hasInfluencedContent();", "protected function _isAllowed()\n {\n\t$session = Mage::getSingleton('admin/session');\n return ($session->isAllowed('iqnomy') || $session->isAllowed('system/iqnomy'));\n }", "public function allow_manage(stdClass $instance) {\n return false;\n }", "protected function isValidMediaItem(MediaItem $mediaItem) {\n return $mediaItem->isAudio();\n }", "function is_publishable($product_id){\n $by = json_decode($this->db->get_where('product',array('product_id'=>$product_id))->row()->added_by,true);\n if($by['type'] == 'admin'){\n return true;\n } else if($by['type'] == 'vendor'){\n $vendor_status = $this->db->get_where('vendor',array('vendor_id'=>$by['id']))->row()->status;\n if ($vendor_status == 'approved') {\n return true;\n } else {\n return false;\n }\n }\n }", "public function canDisplayAdminCards()\n {\n // Get the customer id\n $customerId = $this->adminQuote->getQuote()->getCustomer()->getId();\n\n // Return the check result\n return $this->config->getValue('saved_cards_enabled', 'checkoutcom_moto')\n && $this->config->getValue('active', 'checkoutcom_moto')\n && $this->vaultHandler->userHasCards($customerId);\n }", "public function canBeViewed() {}", "public function allow_manage(stdClass $instance) {\n return true;\n }", "public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', Actadmin::model('Page'));\n }", "private function userHasAccessToPages() {\n\t\t$configurationProxy = tx_oelib_configurationProxy::getInstance('realty');\n\n\t\t$objectsPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForRealtyObjectsAndImages'\n\t\t);\n\t\t$canWriteObjectsPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $objectsPid), 16\n\t\t);\n\n\t\t$auxiliaryPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForAuxiliaryRecords'\n\t\t);\n\t\t$canWriteAuxiliaryPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $auxiliaryPid), 16\n\t\t);\n\n\t\tif (!$canWriteObjectsPage) {\n\t\t\t$this->storeErrorMessage('objects_pid', $objectsPid);\n\t\t}\n\t\tif (!$canWriteAuxiliaryPage) {\n\t\t\t$this->storeErrorMessage('auxiliary_pid', $auxiliaryPid);\n\t\t}\n\n\t\treturn $canWriteObjectsPage && $canWriteAuxiliaryPage;\n\t}", "function otherUserCanWatchIssue( $user, $issueID ) {\r\n\t\treturn $this->otherUserCanViewIssue( $user, $issueID );\r\n\t}", "public function restore_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function hasUseradditem(){\n return $this->_has(24);\n }", "public function isOwned()\n {\n return Auth::user() && $this->recipient_id === Auth::id();\n }", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "public function currentUserHasManagerAccess()\n {\n $user = Service::getCurrentUser();\n \n if (!$user) {\n return false;\n }\n \n if ($this->userManagesSite($user)) {\n return true;\n }\n \n if ($user->isAdmin()) {\n return true;\n }\n \n return false;\n }", "function user_has_permission() {\r\n\tglobal $wp_query;\r\n\r\n\tif ( is_posttype( 'itinerary', POSTTYPE_ARCHIVEORSINGLE ) ) {\r\n\t\treturn current_user_can( 'ind_read_itinerary' );\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_SINGLEONLY ) ) {\r\n\t\t// Check if this is the most recent post somehow\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_ARCHIVEONLY ) ) {\r\n\t\treturn true;\r\n\t\t$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;\r\n\t\t$current = ( $paged == 1 && $wp_query->current_post == 0 );\r\n\t\treturn ( current_user_can( 'ind_read_magazine_archive' ) ||\r\n\t\t\t( $current /* && current_user_can( 'ind_read_magazine' ) */ ) );\r\n\t}\r\n\t\r\n\tif ( is_posttype( 'restaurant', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'shop', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'activity', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'article', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'insidertrip' ) ) {\r\n\t\tif ( current_user_can( 'ind_read_itinerary' ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t$counter_show = \\indagare\\cookies\\Counters::getPageCountGroup( 'restricted' );\r\n\t\tif ( $counter_show > INDG_PREVIEW_COUNT_MAX ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\treturn true;\r\n}", "function upload_is_user_over_quota($display_message = \\true)\n {\n }", "public function isGotPromotion()\n {\n return $this->promotion->checkCondition()?true:false;\n }", "public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "function userCanWatchIssue( $sessionID, $issueID ) {\r\n\t\treturn $this->userCanViewIssue( $sessionID, $issueID );\r\n\t}", "private function canManage(AdventureList $list, User $user)\n {\n if ($list->getUser()->getId() === $user->getId()) {\n return true;\n }\n\n return false;\n }", "function publisher_userIsAuthor($itemObj)\r\n{\r\n global $xoopsUser;\r\n return (is_object($xoopsUser) && is_object($itemObj) && ($xoopsUser->uid() == $itemObj->uid()));\r\n}", "function CheckShowAccess($item=array())\n {\n if (empty($item)) { return TRUE; }\n\n $res=$this->HasModuleAccess();\n \n if (preg_match('/^(Friend)$/',$this->Profile()))\n {\n if ($item[ \"Friend\" ]=$this->LoginData(\"ID\"))\n {\n $res=TRUE;\n }\n }\n\n return $res;\n }", "function allowed() {\n $this->model('invitation');\n \n if ($_SESSION['user']->guest) {\n $sql = \"SELECT * FROM invitations WHERE id = {$_SESSION['user']->id}\";\n $invite = $this->invitation->one($sql);\n if (!$invite) {\n $this->message('Ungültige Einladung');\n unset($_SESSION['user']);\n $this->redirect('/');\n }\n \n if ($_SESSION['user']->object_type == 'topic') { \n if (count($this->path) < 3) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n $photo_id = $this->path[2];\n \n $sql = \"SELECT * FROM photos WHERE id = {$photo_id} LIMIT 1\";\n $photo = $this->photo->one($sql);\n if (!$photo) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n \n if ($photo->topic_id != $_SESSION['user']->object_id) {\n $this->message('Sie haben kein Zugriff auf diese Inhalte');\n return FALSE;\n }\n \n return TRUE;\n }\n }\n return parent::allowed();\n }", "public function isCaptureAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/capture');\n }", "public function get_item_permissions_check( $request ) {\n\t\treturn current_user_can( 'manage_options' );\n\t}", "static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }", "function CheckEditorAccess () {\n global $zOLDAPPLE, $zLOCALUSER; \n\n // Check if user has ownership access to this page.\n if ($this->userAuth_uID != $zLOCALUSER->uID) {\n // Error out if user does not have access privileges.\n if ($zLOCALUSER->userAccess->e == FALSE) {\n return (FALSE);\n } // if\n } // if\n\n return (TRUE);\n }", "function userIsWatchingIssue( $sessionID, $issueID ) {\r\n\t\tif(empty($this->link)){\r\n\t\t\techo \"Not connected to database. Unexpected error. Contact your system administrator.\";\r\n\t\t\texit;\t\r\n\t\t}\r\n\t\t$user = $_SESSION['userid'];\r\n\t\t$query = \"SELECT issueid FROM issuewatch WHERE userid='$user' and issueid='$issueID'\";\r\n\t\t$result = mysql_query($query);\r\n\t\treturn mysql_num_rows($result) > 0;\r\n\t\t\r\n\t}", "public function isReported(User $user)\n {\n $userId = $user->getId();\n $redis = Yii::$app->redis;\n \n $key = 'postcomplains:'.$this->id;\n \n return($redis->sismember($key, $userId)); \n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/enterprise_rma_rma_statistics');\n }", "function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }", "public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }", "protected function isPowerUser()\n {\n return $this->user->can('sys_properties_edit', $this->app->modules[$this->area]);\n }", "public function canBeViewedBy($applicationName)\n {\n // if ($this->media->getHideToOthers()) {\n // if ($this->media->getApplicationName() === $applicationName) {\n // return true;\n // } else {\n // return false;\n // }\n // } else {\n // return true;\n // }\n return true;\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_material/bs_handover/handovertwo');\n }", "function _related_required($object, $model)\r\n\t{\r\n\t\treturn ($this->_count_related($model, $object) == 0) ? FALSE : TRUE;\r\n\t}", "public function accessMediasAll()\n {\n return true;\n }", "function have_social_media(){\n\t$social_media = get_social_media();\n\treturn !empty($social_media) && is_array($social_media);\n}", "public function view(User $user, Media $media)\n {\n return true;\n }", "public function hasMruPI() {\r\n if(!$this->userIsPI && $this->principalInvestigatorId > 0) {\r\n return true;\r\n }\r\n return false;\r\n }", "private function _validate_user() {\n\t\treturn (current_user_can(\"edit_posts\") && current_user_can(\"edit_pages\") && !empty($this->buttons));\n\t}", "public function getCanShareAttribute()\n {\n // Are you the owner if the note?\n return Auth::id() == $this->user_id;\n }", "public function if_item_is_in_list( $user_id, $list, $item ) {\n \n // Verify if list's meta exists\n $this->db->select('*');\n $this->db->from('lists_meta');\n $this->db->where(['user_id' => $user_id, 'list_id' => $list, 'body' => $item]);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n return true;\n \n } else {\n \n $this->db->select('*');\n $this->db->from($this->table);\n $this->db->where(['user_id' => $user_id, 'list_id' => $list]);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n return false;\n \n } else {\n \n return true;\n \n }\n \n }\n \n }", "function eman_can_view( $post, $user_id=false )\n{\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! $user_id ) $user_id = get_current_user_id();\n\n\t// Turner can view anything\n\tif ( eman_check_role('turner', $user_id) ) return true;\n\n\t// Pending can't view anything\n\tif ( eman_check_role('pending', $user_id) ) return false;\n\n\t// Test a post_type generally\n\tif ( is_string($post) && get_post_type_object($post) )\n\t{\n\t\t$post_type = $post;\n\t\t$is_post = false;\n\t}\n\t// Test a post specifically\n\telseif ( is_object($post) )\n\t{\n\t\t$post_type = $post->post_type;\n\t\t$is_post = true;\n\t\t// If BIC user, all set, they can view it\n\t\tif ( $user_id == emanager_bic::get_bic($post, 'ID') ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\n\t// Settings for post type\n\t$cpt = ( $settings = eman_post_types($post_type) ) ? $settings : array();\n\n\t// Test settings permissions\n\tif ( ! empty($cpt['access']) )\n\t{\n\t\t// Owners have no access to settings\n\t\tif ( eman_check_role('owner', $user_id) && ! in_array('owner', $cpt['access']) ) return false;\n\n\t\t// Subs have limited access to settings\n\t\tif ( eman_check_role('sub', $user_id) && ! in_array('sub', $cpt['access']) ) return false;\n\t}\n\telseif ( eman_check_role('owner', $user_id) && ( ($is_post && 'noc' === eman_pco_or_noc($post)) || ( ! $is_post && 'em_noc' == $post_type && ! get_query_var('pco')) ) )\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\n\tif ( $is_post )\n\t{\n\t\t// Test if user is in same company or created post\n\t\tif ( $is_post && (emanager_post::is_author($post) || emanager_post::same_company_as_post($post) || ('em_issue' == $post->post_type && eman_check_role('owner', $user_id)) | ('em_letter' == $post->post_type && eman_check_role('owner', $user_id)) ) ) return true;\n\n\t\t// If is NOC (not PCO), and is owner group, they can view\n\t\tif ( $is_post && 'pco' == eman_pco_or_noc($post) && eman_check_role('owner', $user_id) ) return true;\n\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "public static function canDisplayIssueTrackerMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ISSUE);\n\t}", "public function getWasMediaBypassed()\n {\n if (array_key_exists(\"wasMediaBypassed\", $this->_propDict)) {\n return $this->_propDict[\"wasMediaBypassed\"];\n } else {\n return null;\n }\n }", "public function canMemberLikes() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\t$like_profile_show = Engine_Api::_()->getApi( 'settings' , 'core' )->getSetting( 'like.profile.show' ) ;\n\t\tif ( empty( $like_profile_show ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }", "public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }", "public function hasOwnershipAccess ($store_id, $viewing_user_id) {\n\t \n\t $this->load->model('user/user');\n\t \t \n\t if ($this->model_user_user->isAdmin($viewing_user_id)) {\n\t return true;\n\t } \t \n\n // SPS:\n if ($this->user->isSPS()) {\n return $this->user->getSPS()->isAdmin();\n }\n\t \n\t $sql = \"\n\t \tSELECT\t\tS.store_id\n\t \tFROM\t\tstore as S,\n\t \t\t\t\tuser as U\n\t \tWHERE\t\t1\n\t \t\tAND\t\tS.user_id = U.user_id\n\t \t\tAND\t\tS.store_id = '{$store_id}'\n\t \t\tAND\t\tU.user_id = '{$viewing_user_id}'\n\t \";\n\t \n\t $result = $this->db->query($sql);\n\t \n\t return (boolean) $result->row;\n\t \n\t}", "public function hasAccess() {\n // This is the TokenAuthUser.\n // The Publisher role is not assigned to the user,\n // it is only used to scope the consumer.\n /** @var \\Drupal\\Core\\Session\\AccountProxyInterface $user */\n $userAccount = $this->currentUser();\n // Verify permission against User entity.\n $userEntity = User::load($userAccount->id());\n if ($userEntity->hasPermission('access publisher')) {\n return new JsonResponse([\n 'access' => TRUE,\n ], 200);\n }\n else {\n return new JsonResponse([\n 'access' => FALSE,\n ], 403);\n }\n }", "function dialogue_can_track_dialogue($user = false) {\n global $USER, $CFG;\n\n // return unless enabled at site level\n if (empty($CFG->dialogue_trackreadentries)) {\n return false;\n }\n\n // default to logged if no user passed as param\n if ($user === false) {\n $user = $USER;\n }\n\n // dont allow guests to track\n if (isguestuser($user) or empty($user->id)) {\n return false;\n }\n\n // finally if user has trackForums set then allow tracking\n return true && ! empty($user->trackforums);\n}", "function hasWriteAccess() {\r\n\t\treturn (\r\n\t\t\t\t$this->annonce->associationID == $this->extendedProfile->userID ||\r\n\t\t\t\t$this->extendedProfile instanceof ProfileNiceBenevolat);\r\n\t}", "function is_deal_booked_by_user($mobile,$deal_id){\n //check this deal is not booked by this user already\n $count = Db::rowCount(\"booked_deals\",array(\n \"mobile\" => $mobile,\n \"deal_id\" => $deal_id\n ),array(\"=\",\"=\"));\n return $count >= 1 ? true : false;\n}", "public function is_user_over_quota()\n {\n }", "protected function hasAccessOnPublished()\n\t{\n\t\treturn $this->User->hasAccess($GLOBALS['TL_DCA'][$this->strTable]['config']['ptable'] . '::published', 'alexf');\t\t\n\t}", "public function canBeManagedForCareerSubjectAllowed()\n {\n return $this->countCareerStudents() > 0;\n\n }", "public function beforeSave()\n {\n if (!$this->checkPermissions()) {\n return $this->modx->lexicon('access_denied');\n }\n return true;\n }" ]
[ "0.6033193", "0.60302764", "0.59820503", "0.59189206", "0.5881044", "0.5783707", "0.5782484", "0.57569164", "0.5742757", "0.57192993", "0.5679382", "0.5662858", "0.56491953", "0.56385374", "0.55927455", "0.5589109", "0.5548904", "0.5544749", "0.5532979", "0.5525159", "0.552115", "0.55171907", "0.5512048", "0.55068165", "0.55015504", "0.5500711", "0.54609317", "0.5459144", "0.5441518", "0.54274917", "0.5422865", "0.54199237", "0.5418813", "0.5406998", "0.5388025", "0.5378868", "0.5375512", "0.53747135", "0.5366132", "0.53658956", "0.5342568", "0.534231", "0.5336927", "0.533121", "0.53290385", "0.5315475", "0.5314076", "0.5312755", "0.53104603", "0.53021216", "0.5298778", "0.52976024", "0.5291254", "0.5286218", "0.5277903", "0.52713877", "0.5270516", "0.5263102", "0.52568185", "0.5252088", "0.52508867", "0.52495956", "0.5247443", "0.52474296", "0.52428097", "0.52423817", "0.52361435", "0.52307296", "0.523017", "0.5224761", "0.5220578", "0.5219224", "0.5214103", "0.5210976", "0.52107537", "0.52086115", "0.5204409", "0.520395", "0.5194387", "0.51869416", "0.5178599", "0.5175491", "0.51738054", "0.5173276", "0.51718557", "0.5171556", "0.51675314", "0.51643234", "0.5159092", "0.51569664", "0.5147053", "0.514329", "0.51422906", "0.5129188", "0.5127002", "0.5126332", "0.51254034", "0.5124173", "0.512167", "0.51197755" ]
0.6766468
0
Checks that the viewing user may manage a moderated media item
public function canManageModeratedMedia(array $media, &$errorPhraseKey = '', array $viewingUser = null) { $this->standardizeViewingUserReference($viewingUser); if (!$viewingUser['user_id']) { return false; } return ( XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'deleteAny') || XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'editAny') || XenForo_Permission::hasPermission($viewingUser['permissions'], 'xengallery', 'approveUnapprove') ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function publisher_userIsModerator($itemObj)\r\n{\r\n $publisher = PublisherPublisher::getInstance();\r\n $categoriesGranted = $publisher->getHandler('permission')->getGrantedItems('category_moderation');\r\n return (is_object($itemObj) && in_array($itemObj->categoryid(), $categoriesGranted));\r\n}", "public function isModerator()\n {\n }", "public function can_manage() {\n\t\t$can_manage = false;\n\t\t\n\t\t// is the user the owner of the package\n\t\tif ( ( $this->get_user_id() == get_current_user_id() ) && ( $this->status < 6 ) && ( $this->status > 0 ) ) {\n\t\t\t$can_manage = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_manage_other_packages' ) ) {\n\t\t\t\t$can_manage = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_manage;\n\t}", "function isModerated()\r\n {\r\n $ret = false;\r\n if ( $this->IsModerated == 1 )\r\n $ret = true;\r\n\r\n return $ret;\r\n }", "public function isModerated()\n {\n return $this->accepted !== null;\n }", "public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }", "public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }", "public function isModerated()\n {\n return $this->attribute('state') == self::STATUS_MODERATED;\n }", "public function allowModify($item)\n {\n if ($this->getAdminSession()->isAllowed('system/trashcan/all' === true)) {\n return true;\n }\n\n if ($this->getAdminSession()->isAllowed('system/trashcan/owner') === true) {\n if ($this->isCurrentAdminId($item->getData('trashed_by'))) {\n return true;\n }\n }\n\n return false;\n }", "function canEdit() {\r\n\t\tif($this->owner->ID == Member::currentUserID())\r\n\t\t\treturn true;\r\n\r\n\t\t$member = Member::currentUser();\r\n\t\tif($member)\r\n\t\t\treturn $member->isAdmin();\r\n\r\n\t\treturn false;\r\n\t}", "public static function isMod(): bool\n {\n $user = self::getUser();\n\n // Check if is logged in and (check if user is moderator in database - set to 1)\n if (!$user || !$user->moderator) {\n return false;\n }\n\n return true;\n }", "function canEdit() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\r\n\t\tif (!JAccess::check($user->id, 'core.admin', 'root.1')) {\r\n\t\t\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\t\t\t$id = $this->getState($this->getName().'.id');\r\n\t\t\t\tif ($id) {\r\n\t\t\t\t\t$rights \t= FlexicontentHelperPerm::checkAllItemAccess($uid, 'item', $id);\r\n\t\t\t\t\t$canEdit \t= in_array('flexicontent.editall', $rights) || $permission->CanEdit;\r\n\t\t\t\t\t$canEditOwn\t= (in_array('flexicontent.editown', $rights) && ($item->created_by == $user->id));\r\n\t\t\t\t\tif ($canEdit || $canEditOwn) return true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function allow_manage(stdClass $instance) {\n return false;\n }", "public function isModerator()\n\t{\n\t\tif( $this->permission != array_search( 'moderator', $this->permissions ) )\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "private function isNotModerator()\n {\n if (Auth::user() == null || Auth::user()->users_status != \"moderator\") {\n return true;\n }\n }", "public function isModerador(){ return false; }", "function isAdmin() {\n\t\t$me = $_SESSION[\"me\"];\n\t\t$check = mf(mq(\"select `id`,`url` from `[p]musicplayer` where `id`='{$me}' limit 1\"));\n\t\tif ($check[\"url\"] == \"admin\") {\n\t\t\treturn true;\n\t\t}\n\t}", "public function allow_manage(stdClass $instance) {\n return true;\n }", "public static function isModerator() {\n return (int)$_SESSION['user']['moderator'] === 1;\n }", "public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function isModerator()\n {\n return in_array(Role::MODERATORS_SYSTEM_ROLE, $this->getRoleNamesForCurrentViewer());\n }", "function rordb_can_user_view_items(){\n return current_user_can('rordb_view_items');\n}", "public function authorize()\n {\n $hackedRoute = 'admin.media.update';\n if ( ! is_null($this->segment(4))) {\n $hackedRoute = 'admin.media_category.media.update#####' .$this->segment(3);\n }\n return hasPermission($hackedRoute);\n }", "private function allowModify()\n { \n if($this->viewVar['loggedUserRole'] <= 40 )\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "public function canEdit() {\n\t\treturn $this->_perms->checkModuleItem ( $this->_tbl_module, 'edit' );\n\t}", "public function is_allowed_to_set_content_object_rights();", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }", "function admin()\n{\n return current_user_can('manage_options');\n}", "function _isModerator($a_ref_id, $a_usr_id)\n\t{\n\t\treturn in_array($a_usr_id, ilForum::_getModerators($a_ref_id));\n\t}", "public function isAdmin()\n {\n $p = User::getUser();\n if($p)\n {\n if($p->canAccess('Edit products') === TRUE)\n {\n return TRUE;\n }\n }\n return FALSE;\n }", "abstract public function canEdit($user_guid = 0);", "public function get_item_permissions_check( $request ) {\n\t\treturn current_user_can( 'manage_options' );\n\t}", "protected function _isAllowed()\r\n\t{\r\n\t\treturn Mage::getSingleton('admin/session')->isAllowed('system/tools/modulesmanager');\r\n\t}", "function CheckShowListAccess($item=array())\n {\n if (empty($item)) { return TRUE; }\n\n $res=$this->HasModuleAccess();\n \n return $res;\n }", "public function manage(User $user)\n {\n return $user->hasPermission('user-invite') ||\n $user->hasPermission('user-edit') ||\n $user->hasPermission('user-delete');\n }", "public function isModerator() : bool\n\t{\n\t\tif ($this->isSuperAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->loadUsergroups();\n\t\tif (in_array(App::USERGROUPS['moderators'], $this->usergroup_ids)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function get_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "function can_manage(){\r\n\t\treturn ( $this->get_booking()->can_manage() );\r\n\t}", "private function canManage(AdventureList $list, User $user)\n {\n if ($list->getUser()->getId() === $user->getId()) {\n return true;\n }\n\n return false;\n }", "function eman_can_view( $post, $user_id=false )\n{\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! $user_id ) $user_id = get_current_user_id();\n\n\t// Turner can view anything\n\tif ( eman_check_role('turner', $user_id) ) return true;\n\n\t// Pending can't view anything\n\tif ( eman_check_role('pending', $user_id) ) return false;\n\n\t// Test a post_type generally\n\tif ( is_string($post) && get_post_type_object($post) )\n\t{\n\t\t$post_type = $post;\n\t\t$is_post = false;\n\t}\n\t// Test a post specifically\n\telseif ( is_object($post) )\n\t{\n\t\t$post_type = $post->post_type;\n\t\t$is_post = true;\n\t\t// If BIC user, all set, they can view it\n\t\tif ( $user_id == emanager_bic::get_bic($post, 'ID') ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\n\t// Settings for post type\n\t$cpt = ( $settings = eman_post_types($post_type) ) ? $settings : array();\n\n\t// Test settings permissions\n\tif ( ! empty($cpt['access']) )\n\t{\n\t\t// Owners have no access to settings\n\t\tif ( eman_check_role('owner', $user_id) && ! in_array('owner', $cpt['access']) ) return false;\n\n\t\t// Subs have limited access to settings\n\t\tif ( eman_check_role('sub', $user_id) && ! in_array('sub', $cpt['access']) ) return false;\n\t}\n\telseif ( eman_check_role('owner', $user_id) && ( ($is_post && 'noc' === eman_pco_or_noc($post)) || ( ! $is_post && 'em_noc' == $post_type && ! get_query_var('pco')) ) )\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\n\tif ( $is_post )\n\t{\n\t\t// Test if user is in same company or created post\n\t\tif ( $is_post && (emanager_post::is_author($post) || emanager_post::same_company_as_post($post) || ('em_issue' == $post->post_type && eman_check_role('owner', $user_id)) | ('em_letter' == $post->post_type && eman_check_role('owner', $user_id)) ) ) return true;\n\n\t\t// If is NOC (not PCO), and is owner group, they can view\n\t\tif ( $is_post && 'pco' == eman_pco_or_noc($post) && eman_check_role('owner', $user_id) ) return true;\n\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "public function contentIsNotLockedForEditors()\n {\n return $this->getBackendUser()->isAdmin() || ($this->CALC_PERMS & Permission::CONTENT_EDIT) === Permission::CONTENT_EDIT && !$this->pageinfo['editlock'];\n }", "public function isOwner($item)\n {\n $roles = Session::get('roles');\n $userId = Auth::user()->externalId;\n\n $result = !empty(array_intersect($roles, ['Administrator','Accounting','Developer']));\n if ($result || in_array($userId,['34',\"55\",'155'])) { // allow mikker to see all forms\n return true;\n }\n\n //remove the user role. we don't care about it\n $roles = array_diff($roles, array('User'));\n $roles = array_values($roles);\n\n switch ($roles[0]){\n case \"Client Manager\":\n return $item->ClientAlias->Client->ClientManager_Id == null? true: $userId ? true:false;\n break;\n case \"Adwords\":\n case \"SEO\":\n // loop through all contracts and find if he has a contract assigned to him\n $owner = false;\n if(is_array($item->Contract)){\n foreach ($item->Contract as $contract){\n if($contract->Manager_Id == $userId){\n $owner = true;\n break;\n }\n }\n }\n return $owner;\n break;\n case \"Sales\":\n return $item->ClientAlias->User_Id == $userId ? true:false;\n break;\n default :\n break;\n }\n //default, we deny.\n return false;\n }", "public function hasAdminRights() {\n return in_array($this['user_type_id'], [3, 7]);\n }", "function user_can_access_admin_page()\n {\n }", "public function is_allowed_to_edit_content_object()\n {\n return $this->is_allowed(WeblcmsRights::EDIT_RIGHT, $this->publication) &&\n $this->publication->get_allow_collaboration();\n }", "public function check_admin() {\n return current_user_can('administrator');\n }", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }", "function publisher_userIsAdmin()\r\n{\r\n global $xoopsUser;\r\n $publisher = PublisherPublisher::getInstance();\r\n\r\n static $publisher_isAdmin;\r\n\r\n if (isset($publisher_isAdmin)) {\r\n return $publisher_isAdmin;\r\n }\r\n\r\n if (!$xoopsUser) {\r\n $publisher_isAdmin = false;\r\n } else {\r\n $publisher_isAdmin = $xoopsUser->isAdmin($publisher->getModule()->getVar('mid'));\r\n }\r\n\r\n return $publisher_isAdmin;\r\n}", "public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }", "private function validate()\r\n {\r\n if (!$this->user->hasPermission('modify', 'module/promotion')) {\r\n $this->error['warning'] = $this->language->get('error_permission');\r\n }\r\n\r\n if (!$this->error) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('MagicToolbox_MagicZoomPlus::magiczoomplus_settings_edit');\n }", "public function can_edit() {\n\t\t$can_edit = false;\n\t\t\n\t\t// is the user the owner of the package and the package is in edit mode?\n\t\tif ( ($this->get_user_id() == get_current_user_id()) && ($this->status == 1) ) {\n\t\t\t$can_edit = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_edit_other_packages' ) ) {\n\t\t\t\t$can_edit = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}", "function CheckShowAccess($item=array())\n {\n if (empty($item)) { return TRUE; }\n\n $res=$this->HasModuleAccess();\n \n if (preg_match('/^(Friend)$/',$this->Profile()))\n {\n if ($item[ \"Friend\" ]=$this->LoginData(\"ID\"))\n {\n $res=TRUE;\n }\n }\n\n return $res;\n }", "public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }", "public function canEdit()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'edit' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['member'] ) and static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column and $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['group'] ) and static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\t\t\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function eman_can_edit( $post, $user_id=false )\n{\n\t/**\n\t * If you can't view this post, then you can't edit it...\n\t */\n\tif ( ! eman_can_view($post, $user_id) ) return false;\n\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! is_object($post) ) return false;\n\tif ( ! $user_id ) $user_id = get_current_user_id();\n\t$user = get_user_by('id', $user_id);\n\t$status = emanager_post::status($post, 'slug');\n\t$bic_userlogin = emanager_bic::get_bic($post, 'user_login');\n\n\t/**\n\t * Test if user has capability to edit\n\t */\n\n\t// Issues have different criteria\n\tif ( 'em_issue' == $post->post_type )\n\t{\n\t\t// Original author\n\t\tif ( emanager_post::is_author($post) || emanager_post::same_company_as_post($post) || eman_check_role('turner') ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// PCO Request exception for allowances. Allow user to edit if in their court and status is before sent to owner.\n\tif ( 'em_noc' == $post->post_type )\n\t{\n\t\tif (($bic_userlogin === $user->user_login) && in_array($status, array('draft','manager','ready'))) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (eman_check_role('turner') && in_array($status, array('draft'))) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// If the post is editable\n\tif ( eman_post_editable($post) )\n\t{\n\t\t// Original author\n\t\tif ( emanager_post::is_author($post) ) {\n\t\t\treturn true;\n\t\t}\n\t\t// Same company as original author\n\t\telseif ( emanager_post::same_company_as_post($post) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "protected function isPowerUser()\n {\n return $this->user->can('sys_properties_edit', $this->app->modules[$this->area]);\n }", "public function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('shopgate_menu/manage');\n }", "protected function isCurrentUserAdmin() {}", "protected function _hasModPermission(){\n global $auth;\n return $auth->acl_get('m_inttree');\n }", "protected function isCurrentUserAdmin() {}", "public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function performPermission()\n {\n // User Role flags\n // Admin = 20\n // Editor = 40\n // Author = 60 (deprecated)\n // Webuser = 100 (deprecated)\n //\n // Webuser dont have access to edit node data\n //\n if($this->controllerVar['loggedUserRole'] > 40)\n {\n return false;\n }\n\n return true;\n }", "function auth_can_edit_user($user, $target)\n{\n global $min_user_editing_level;\n \n // Always allowed to modify your own stuff\n if(strcasecmp($user, $target) == 0)\n {\n return 1;\n }\n\n if(authGetUserLevel($user) >= $min_user_editing_level)\n {\n return 1;\n }\n\n // Unathorised access\n return 0;\n}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_kst/kstitem');\n }", "public function canManagePermissions()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn ( static::$permApp !== NULL and static::$permType !== NULL and static::restrictionCheck( 'permissions' ) );\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Codilar_Image360::image360_settings_edit');\n }", "function isModerator($moderator,$usertype='')\r\n\t{\r\n \t$my = JFactory::getUser();\r\n\r\n \tif (!$usertype)\r\n\t\t\treturn (in_array(JOSC_utils::getJOSCUserType($my->usertype), $moderator));\r\n\t\telse\r\n\t\t\treturn (in_array(JOSC_utils::getJOSCUserType($usertype), $moderator));\r\n\t}", "public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }", "public function isPermissible()\n {\n return !$this->invisible && (\n [] === $this->permissions || Wa::panel()->isAccessible(\n $this->module, $this->panel, $this->permissions));\n }", "public function isModerator() {\n if (!isset($this->groups)) {\n $this->groups = explode(',', $this->config['moderator']);\n array_walk($this->groups, 'trim');\n }\n\n return $this->modx->user->isMember($this->groups);\n }", "public function restore_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "function isAdmin(){\n$user = $this->loadUser(Yii::app()->user->user_id);\nreturn intval($user->user_role_id) == 1;\n}", "public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}", "function acf_current_user_can_admin()\n{\n}", "public static function restrict_media_library_access() {\n\t\tglobal $pagenow;\n\t\tif (\n\t\t\t'upload.php' === $pagenow\n\t\t&&\n\t\t\t! current_user_can( get_post_type_object( 'post' )->cap->create_posts )\n\t\t) {\n\t\t\twp_die( __( 'Sorry, you are not allowed to access the media library.', 'wporg-photos' ) );\n\t\t}\n\t}", "public function check_admin()\n {\n return current_user_can('administrator');\n }", "function storage_can_set($sv_user) {\n $allowed = ((api_is_platform_admin()) || ($sv_user == api_get_user_id()));\n if (!$allowed) {\n print \"ERROR : Not allowed\";\n }\n return $allowed;\n}", "protected function _isAllowed()\n {\n\t$session = Mage::getSingleton('admin/session');\n return ($session->isAllowed('iqnomy') || $session->isAllowed('system/iqnomy'));\n }", "function is_contest_modifiable($cid) {\n if (is_admins())\n return true;\n if (is_manager()) {\n // This is a manager. \n $contest = new ContestsTbl($cid);\n if (!$contest->Get())\n return false;\n if (!$contest->detail['avail'])\n return false;\n $perm = $contest->detail['perm'];\n if ($perm == \"user\" || $perm == 'manager' || $perm == 'temp') {\n global $login_uid;\n return ($contest->detail['owner'] == $login_uid);\n }\n }\n return false;\n}", "public function testAccessWithModerator(): void {\n $this->logInModerator();\n $this->getClient()->request(\"GET\", \"/sadmin/contact\");\n\n $this->assertEquals(403, $this->getClient()->getResponse()->getStatusCode(), \"The status code expected is not ok.\");\n }", "public function is_met() {\n\t\treturn \\is_admin();\n\t}", "public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('system/thetailor_workgroup_workflow');\r\n }", "public function canVote($item)\n {\n if ( !config('vote.canvote_rules.can_vote_owned_item') && $item->user_id == $this->user_id) {\n return false;\n } else if ($this->weight == 0) {\n return false;\n } else if (!config('vote.canvote_rules.can_vote_if_banned') && $this->isBanned()) {\n return false;\n }\n return true;\n }", "public function isAuthorized($user) {\n if ($this->action === 'add') {\n return true;\n }\n\n // The owner of a post can edit and delete it\n if (in_array($this->action, array('edit', 'delete'))) {\n $presupuestoId = $this->request->params['pass'][0];\n if ($this->Post->isOwnedBy($presupuestoId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}", "public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }", "protected function canEdit() {}", "function EditITEMPermissionCheck($link, $data){\n if ($data['admin'] == 1){\n //echo 'allowed';\n return;\n }\n $index = array_search ($data['club_year_id'], $data['permissions']['club_year_id_array']);\n if ( $index === FALSE ){\n $returnData['errcode'] = 4;\n //TODO proper code\n $returnData['errno'] = 4000;\n $returnData['errstr'] = \"User is not associated with Club\";\n exitfnc($returnData);\n }\n}", "public function manage(User $user)\n {\n return $user->isSuperAdmin() ? true : $this->isPrivilegeHolder($user);\n }", "public function canModifyVisibilityOfUsers();", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_logistics/equipment');\n }", "public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$this->User->hasAccess('image_sizes', 'themes'))\n\t\t{\n\t\t\t$this->log('Not enough permissions to access the image sizes module', __METHOD__, TL_ERROR);\n\t\t\t$this->redirect('contao/main.php?act=error');\n\t\t}\n\t}", "static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }", "function allowed() {\n $this->model('invitation');\n \n if ($_SESSION['user']->guest) {\n $sql = \"SELECT * FROM invitations WHERE id = {$_SESSION['user']->id}\";\n $invite = $this->invitation->one($sql);\n if (!$invite) {\n $this->message('Ungültige Einladung');\n unset($_SESSION['user']);\n $this->redirect('/');\n }\n \n if ($_SESSION['user']->object_type == 'topic') { \n if (count($this->path) < 3) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n $photo_id = $this->path[2];\n \n $sql = \"SELECT * FROM photos WHERE id = {$photo_id} LIMIT 1\";\n $photo = $this->photo->one($sql);\n if (!$photo) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n \n if ($photo->topic_id != $_SESSION['user']->object_id) {\n $this->message('Sie haben kein Zugriff auf diese Inhalte');\n return FALSE;\n }\n \n return TRUE;\n }\n }\n return parent::allowed();\n }", "public function checkForModerationRedirect() {\n $moderated = $this->checkForModeration();\n if (!empty($moderated)) {\n $moderatedResourceId = $this->controller->getProperty('moderatedResourceId','');\n if (!empty($moderatedResourceId)) {\n if ($this->controller->getProperty('redirectUnsetDefaultParams') == false) {\n $persistParams = array_merge($this->persistParams,array(\n 'username' => $this->user->get('username'),\n 'fullname' => $this->profile->get('fullname'),\n 'email' => $this->profile->get('email'),\n ));\n }\n $url = $this->modx->makeUrl($moderatedResourceId,'',$persistParams,'full');\n if (!$this->login->inTestMode) {\n $this->modx->sendRedirect($url);\n }\n return true;\n }\n }\n return false;\n }" ]
[ "0.7581745", "0.7150465", "0.68952036", "0.6865222", "0.67510986", "0.6738622", "0.67145514", "0.66755", "0.65278727", "0.64960325", "0.64832026", "0.6472874", "0.6447176", "0.64317936", "0.6420553", "0.63996965", "0.63956124", "0.63887286", "0.6357257", "0.63350934", "0.63073975", "0.6257083", "0.6249874", "0.6224352", "0.6218222", "0.6213613", "0.61936367", "0.6183633", "0.6167323", "0.6164365", "0.61620605", "0.61599493", "0.6156604", "0.61451596", "0.61447203", "0.61435217", "0.6138297", "0.61346185", "0.61121386", "0.6104155", "0.6077754", "0.6051961", "0.6042199", "0.6040162", "0.6016502", "0.6015224", "0.60070187", "0.6000448", "0.59981745", "0.5997429", "0.5995132", "0.5993278", "0.59883446", "0.5977373", "0.5975931", "0.5971417", "0.5967285", "0.5965453", "0.5960636", "0.5957737", "0.5956652", "0.5955746", "0.59330726", "0.5929424", "0.59239095", "0.59231514", "0.5921127", "0.5900658", "0.5890035", "0.5889801", "0.588688", "0.5885561", "0.588413", "0.58832884", "0.58788466", "0.5878205", "0.5875814", "0.5870665", "0.5867665", "0.5867114", "0.5861828", "0.58597684", "0.5855466", "0.5851599", "0.58502764", "0.58472764", "0.58439654", "0.58375937", "0.5836935", "0.5834305", "0.58322424", "0.58317137", "0.5829211", "0.5826785", "0.5826785", "0.58239925", "0.58091074", "0.58075386", "0.5806805", "0.5800913" ]
0.7009209
2
Run the database seeds.
public function run() { DB::table('products')->insert([ 'id' => 1, 'name' => "Test Product 1", 'quantity' => 10, 'unit_price' => 100, 'category'=>1, 'availability'=>true, ]); DB::table('products')->insert([ 'id' => 2, 'name' => "Test Product 2", 'quantity' => 100, 'unit_price' => 10.25, 'category'=>2, 'availability'=>true, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
/ gadgets.php are functions to be added to wordpress functions.php file for UI components
function group_of_gadgets_shortcode( $atts, $content = null ) { return '<div style="width:100%;float:left;">' . do_shortcode($content) . '</div>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gs_widgets_init() {\r\n\tregister_sidebar(\r\n\t array(\r\n\t 'name' => 'Homepage Widgets',\r\n\t 'id' => 'homepage-widgets',\r\n\t 'description' => '',\r\n\t 'before_widget' => '<div id=\"%1$s\" class=\"home-widget %2$s four columns\"><div class=\"widget-container\">',\r\n\t 'after_widget' => '</div></div>',\r\n\t 'before_title' => '<h4>',\r\n\t 'after_title' => '</h4>', \r\n\t ));\r\n\r\n\tregister_sidebar(\r\n\t array(\r\n\t 'name' => 'Page Sidebar',\r\n\t 'id' => 'page-sidebar',\r\n\t 'description' => '',\r\n\t 'before_widget' => '<div id=\"%1$s\" class=\"%2$s side-widget\">',\r\n\t 'after_widget' => '</div>',\r\n\t 'before_title' => '<h4>',\r\n\t 'after_title' => '</h4>', \r\n\t ));\r\n\r\n\tregister_sidebar(\r\n\t array(\r\n\t 'name' => 'Blog Sidebar',\r\n\t 'id' => 'blog-sidebar',\r\n\t 'description' => '',\r\n\t 'before_widget' => '<div id=\"%1$s\" class=\"%2$s side-widget\">',\r\n\t 'after_widget' => '</div>',\r\n\t 'before_title' => '<h4>',\r\n\t 'after_title' => '</h4>', \r\n\t ));\r\n}", "function portal_dashboard_overview_widget_function() {\n echo portal_populate_dashboard_widget();\n}", "function gp_widgets_init() {\n\n /**\n * Register sidebars.\n */\n\n $sidebar_main = array_merge(\n array( 'name' => __( 'General Sidebar', 'gp' ), 'id' => 'sidebar-main' ),\n gp_get_default_widget_params()\n );\n register_sidebar( $sidebar_main );\n\n // $sidebar_post = array_merge(\n // array( 'name' => __( 'Blog Sidebar', 'gp' ), 'id' => 'sidebar-blog' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $sidebar_post );\n\n\n // $sidebar_post = array_merge(\n // array( 'name' => __( 'Blog Post Sidebar', 'gp' ), 'id' => 'sidebar-post' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $sidebar_post );\n\n\n // $sidebar_portfolio = array_merge(\n // array( 'name' => __( 'Portfolio Sidebar', 'gp' ), 'id' => 'sidebar-portfolio' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $sidebar_portfolio );\n\n\n // $sidebar_portfolio_single = array_merge(\n // array( 'name' => __( 'Portfolio Project Sidebar', 'gp' ), 'id' => 'sidebar-portfolio-single' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $sidebar_portfolio_single );\n\n // $persy_fuer_kmu = array_merge(\n // array( 'name' => __( 'Persy für KMU', 'gp' ), 'id' => 'persy-fuer-kmu' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $persy_fuer_kmu );\n\n // $persy_fuer_pdl = array_merge(\n // array( 'name' => __( 'Persy für PDL', 'gp' ), 'id' => 'persy-fuer-pdl' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $persy_fuer_pdl );\n\n // $persy_support = array_merge(\n // array( 'name' => __( 'Persy Support', 'gp' ), 'id' => 'persy-support' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $persy_support );\n\n $template_with_subnav = array_merge(\n array( 'name' => __( 'Template with subnav', 'gp' ), 'id' => 'sidebar-template-with-subnav' ),\n gp_get_default_widget_params()\n );\n register_sidebar( $template_with_subnav );\n\n\n // Removes the default styles that are packaged with the Recent Comments widget.\n add_filter( 'show_recent_comments_widget_style', '__return_false' );\n\n}", "function gymfitness_widgets(){\n\n register_sidebar(array(\n 'name' => 'Sidebar 1', \n 'id' => 'sidebar_1',\n 'before_widget' => '<div class=\"\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"widget-title\">',\n 'after_title' => '</h2>'\n ));\n register_sidebar(array(\n 'name' => 'Sidebar 2', \n 'id' => 'sidebar_2',\n 'before_widget' => '<div class=\"\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"widget-title\">',\n 'after_title' => '</h2>'\n ));\n\n}", "function gphq_widgets_init() {\t\n\tregister_sidebar( array(\n\t\t'name' => 'Home Page Middle Sidebar',\n\t\t'id' => 'home-rss',\n\t\t'description' => 'Middle column of homepage above events',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t\t'after_widget' => '</li>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => 'Home Page Right Sidebar',\n\t\t'id' => 'homepage-widget-area',\n\t\t'description' => 'Main right column sidebar on homepage only',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t\t'after_widget' => '</li>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => 'Main Blog Sidebar',\n\t\t'id' => 'primary-widget-area',\n\t\t'description' => 'This widget area is for the sidebar on the blog only',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t\t'after_widget' => '</li>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => 'Footer Widget Area',\n\t\t'id' => 'first-footer-widget-area',\n\t\t'description' => 'Main footer area widget',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t\t'after_widget' => '</li>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => 'Secondary Widget Area',\n\t\t'id' => 'secondary-widget-area',\n\t\t'description' => 'The secondary widget area',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t\t'after_widget' => '</li>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n}", "function gdf_modern_setup()\n{\n\n // REMOVE BREADCRUMB\n remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);\n remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);\n remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);\n remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);\n remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);\n remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);\n // PUT BREADCRUMBS BACK EARLIER\n add_action('geodir_wrapper_open', 'gdf_modern_geodir_breadcrumb', 5);\n add_action('geodir_wrapper_open', 'gdf_modern_geodir_breadcrumb', 5);\n add_action('geodir_wrapper_open', 'gdf_modern_geodir_breadcrumb', 5);\n add_action('geodir_wrapper_open', 'gdf_modern_geodir_breadcrumb', 5);\n add_action('geodir_wrapper_open', 'gdf_modern_geodir_breadcrumb', 5);\n // CHANGE MAIN WRAPPER MARKUP\n remove_action('geodir_wrapper_open', 'gdf_action_wrapper_open', 9);\n add_action('geodir_wrapper_open', 'gdf_modern_action_wrapper_open', 9);\n // ENQUEUE GOOGLE FONTS\n add_action('wp_enqueue_scripts', 'gdfmodern_google_fonts');\n function gdfmodern_google_fonts()\n {\n\n wp_enqueue_style('google-fonts', '//fonts.googleapis.com/css?family=Lato:300,700|Roboto:700,300,400', array(), CHILD_THEME_VERSION);\n\n }\n\n}", "function parquesWidgets()\n{\n\t//add classes\n\tinclude_once(TEMPLATEPATH.'/widgets/widgettexto.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-social.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-home.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-progreso.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-categorias.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-banner.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-timelines.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-flickr.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/nav-menu-narrativas.php');\n\n\t//add widget\n \tregister_widget( 'Widget_Texto' );\n \tregister_widget( 'Widget_Social' );\n \tregister_widget( 'Widget_Home' );\n \tregister_widget( 'Widget_Progreso' );\n \tregister_widget( 'Widget_Categorias' );\n \tregister_widget( 'Widget_Banner' );\n \tregister_widget( 'Widget_Timelines' );\n \tregister_widget( 'Widget_Flickr' );\n \tregister_widget( 'Widget_Narrativas' );\n\n\n}", "function arphabet_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => 'Event Widget',\n\t\t'id' => 'event_widget',\n\t)\n \t);\n\tregister_sidebar( array(\n\t\t'name' => 'Landing Photo Widget',\n\t\t'id' => 'landingphoto_widget',\n\t)\n \t);\n\tregister_sidebar( array(\n\t\t'name' => 'Gallery Widget',\n\t\t'id' => 'gallery_widget',\n\t)\n\t );\n\t register_sidebar( array(\n\t\t'name' => 'About Widget',\n\t\t'id' => 'about_widget',\n\t)\n \t);\n}", "function gymfitness_widgets(){\n register_sidebar( array(\n 'name'=>'Sidebar 1',\n 'id' => 'sidebar_1',\n 'before-widget' => '<div class=\"widget\">', \n 'after-widget' => '</div>', \n 'before_title' => '<h3 class=\"text-center texto-primario\">',\n 'after_title' => '</h3>'\n\n\n ));\n register_sidebar( array(\n 'name'=>'Sidebar 2',\n 'id' => 'sidebar_2',\n 'before-widget' => '<div class=\"widget\">', \n 'after-widget' => '</div>', \n 'before_title' => '<h3 class=\"text-center texto-primario\">',\n 'after_title' => '</h3>'\n\n\n ));\n}", "public function private_theme_functions()\n {\n // Adds plus button\n add_action('in_admin_header', [ & $this, 'addParallaxBlock'], -200);\n\n // Replace the common scripts\n add_action('wp_default_scripts', [$this, 'changeCommonScript'], 11);\n }", "function agro_setup() {\n\t\tremove_action( 'wp_head', 'feed_links_extra', 3 );\n\t\tremove_action( 'wp_head', 'feed_links' );\n\t\tremove_action( 'wp_head', 'wp_shortlink_wp_head' );\n\t\tremove_action( 'wp_head', 'rsd_link' );\n\t\tremove_action( 'wp_head', 'rest_output_link_wp_head' );\n\t\tremove_action( 'wp_head', 'wp_oembed_add_discovery_links' );\n\t\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t\tremove_action( 'wp_head', 'wp_generator' );\n\n\t\t// REMOVE WP EMOJI\n\t\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\t\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\t\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\t\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\n\n\t\t// HTML5\n\t\tadd_theme_support( 'html5', array(\n\t\t\t'comment-form',\n\t\t\t'comment-list',\n\t\t\t'gallery',\n\t\t\t'caption',\n\t\t));\n\n\t\t// Logo\n\t\tadd_theme_support( 'custom-logo' );\n\n\t\t// Title Tag\n\t\tadd_theme_support( 'title-tag' );\n\n\t\t// Images\n\n\n\t\t// Shortkoder i widget\n\t\tadd_filter( 'widget_text', 'do_shortcode' );\n\n\t\t// Menu\n\t\tregister_nav_menus(array(\n\t\t\t'main-menu-1' => __( 'Main-Menu 1', 'agroaliancen-domain' ),\n\t\t\t'main-menu-2' => __( 'Main-Menu 2', 'agroaliancen-domain' ),\n\t\t\t'main-menu-3' => __( 'Main-Menu 3', 'agroaliancen-domain' ),\n\t\t\t'footer-menu-1' => __( 'Footer-Menu 1', 'agroaliancen-domain' ),\n\t\t\t'footer-menu-2' => __( 'Footer-Menu 2', 'agroaliancen-domain' ),\n\t\t\t'footer-menu-3' => __( 'Footer-Menu 3', 'agroaliancen-domain' ),\n\t\t));\n\n\t}", "function arphabet_widgets_init() {\r\n register_sidebar( array(\r\n 'name' => 'Below main content',\r\n 'id' => 'home_right_1',\r\n 'before_widget' => '<div class=\"widget\">',\r\n 'after_widget' => '</div>',\r\n 'before_title' => '<h2 class=\"widget-title\">',\r\n 'after_title' => '</h2>',\r\n ) );\r\n //gallery side bar\r\n register_sidebar( array(\r\n 'name' => 'Gallery Main Page',\r\n 'id' => 'home_right_2',\r\n 'before_widget' => '<div class=\"gallery-widget\">',\r\n 'after_widget' => '</div>',\r\n 'before_title' => '<h2 class=\"gallery-widget-title\">',\r\n 'after_title' => '</h2>',\r\n ) );\r\n}", "function fanwood_resources() {\n\n\twp_enqueue_script( 'jquery-ui-accordion' );\n\twp_enqueue_script( 'jquery-ui-tabs' );\n\twp_enqueue_script ( 'fanwood-scripts', trailingslashit ( THEME_URI ) . 'js/fanwood.js', array( 'jquery' ), '201200215', true );\n\twp_enqueue_script ( 'fanwood-ui', trailingslashit ( THEME_URI ) . 'js/fanwood-ui.js', array( 'jquery', 'jquery-ui-accordion', 'jquery-ui-tabs' ), '20120413', true );\n\t\n\t/* for bbPress. */\n\t\n\tif ( function_exists ( 'is_bbpress' ) ) {\n\t\n\t\twp_enqueue_style ( 'fanwood-bbpress', trailingslashit ( THEME_URI ) . 'css/bbpress.css', false, '20120228', 'all' );\n\t\n\t\tif ( function_exists( 'bbp_is_topic' ) ) {\n\t\t\tif ( bbp_is_topic() )\n\t\t\t\twp_enqueue_script( 'fanwood-bbpress-topic', trailingslashit( THEME_URI ) . 'js/bbpress-topic.js', array( 'wp-lists' ), false, true );\n\t\t}\n\t\t\t\t\n\t\tif( function_exists( 'bbp_is_single_user_edit' ) ) {\n\t\t\tif ( bbp_is_single_user_edit() )\n\t\t\t\twp_enqueue_script( 'user-profile' );\n\t\t}\n\t\n\t}\n\t\n\t/* for BuddyPress */\n\t\n\tif ( function_exists ( 'bp_is_active' ) ) {\n\n\t\twp_dequeue_style( 'bp' );\n\t\t\n\t\twp_enqueue_style ( 'fanwood-buddypress-admin-bar', trailingslashit ( THEME_URI ) . 'css/buddypress-admin-bar.css', array( 'bp-admin-bar' ), '20120308', 'all' );\n\n\t\t/* Load BuddyPress-specific styles. */\n\t\twp_enqueue_style ( 'fanwood-buddypress', trailingslashit ( THEME_URI ) . 'css/buddypress.css', false, '20120228', 'all' );\n\t\n\t}\n\t\n\t/* for Jigoshop */\n\t\n\tif( function_exists( 'is_jigoshop') ) {\n\t\twp_dequeue_style( 'jigoshop_frontend_styles' );\n\t\twp_enqueue_style ( 'fanwood-jigoshop', trailingslashit ( THEME_URI ) . 'css/jigoshop.css', false, '20120310', 'all' );\n\t}\n\t\n\t/* for Hybrid Tabs */\n\t\n\tif( function_exists( 'register_hybrid_tab') ) {\n\t\twp_enqueue_style ( 'fanwood-hybrid-tabs', trailingslashit ( THEME_URI ) . 'css/hybrid-tabs.css', false, '20120312', 'all' );\t\n\t}\n\t\n\t/* for Gravity Forms */\n\t\n\tif( class_exists( 'RGForms' ) && class_exists( 'RGFormsModel' )) {\n\t\t\n\t\twp_enqueue_style( 'fanwood-gravity-forms', trailingslashit (THEME_URI) . 'css/gravity-forms.css', false, '20120312', 'all' );\n\n\t}\n\n}", "function ozh_yourls_gsb_admin_page() {\n include_once dirname( __FILE__ ) . '/includes/admin-page.php';\n ozh_yourls_gsb_display_page();\n}", "function cp_load_bp_functions() {\n\t// least BuddyPress 1.5.\n\tif ( function_exists( 'bp_get_current_group_id' ) ) {\n\t\trequire_once( CP_PLUGIN_DIR . 'includes/cp-bp.php' );\n\t}else{\n\t\t//BuddyPress is older than 1.5, display a notice\n\t\tadd_action( 'admin_notices', create_function( '', 'echo \\'<div class=\"updated fade\"><p>CollabPress BuddyPress integration requires v1.5+ of BuddyPress to work. You can download a copy on the <a href=\"http://buddypress.org/blog/\" target=\"_blank\">BuddyPress site</a>.</p><p>Not ready to upgrade to BuddyPress 1.5? No problem. You can continue to use CollabPress - you just won&#39;t get any BuddyPress integration yet.</p></div>\\';' ) );\n\t}\n}", "function wp_dashboard_plugins()\n {\n }", "function myplugin_load_js()\r\n{\r\n\t\t\r\n\t/* FACEBOX: A facebook lightbox style pop-up window.\r\n\t * http://famspam.com/facebox\r\n\t*/\r\n\t\r\n\t## -- Start: Facebox ##\r\n\tif ( in_array( $_GET['page'], array( 'myplugin-submenu-options', 'myplugin-submenu-setup', 'myplugin-submenu-setup' ) ) ) { # load js for options page\r\n\t\twp_enqueue_script( 'facebox', plugins_url('widgets/facebox/facebox.js', MYPLUGIN_FILE_PATH), array( 'jquery' ) );\r\n\t\twp_localize_script('jquery','SlidePress', array(\r\n\t\t'sspurl' => plugins_url('', __FILE__) . '/'\r\n\t\t));\r\n\t}\r\n\t## -- End: Facebox ##\r\n\r\n\r\n\t/* FABRASTIC: Farbtastic is a jQuery plug-in that can add one or more color picker widgets into a page through JavaScript\r\n\t * Website: http://acko.net/dev/farbtastic\r\n\t*/\r\n\t\r\n\t## -- Start: Fabrastic Color Picker --\t\r\n\tif ( in_array( $_GET['page'], array( 'myplugin-submenu-options' ))) { # load js for options page\r\n\r\n\t\t## ------------------------------------------------------------------------------------------\r\n\t\t## Fabrastic is a circular color selector. It uses two JavaScript routines that are located in the\r\n\t\t## 'swpframework/widgets' directory: 1) rgbcolor.js and 2) farbtastic. It also uses HTML code which I\r\n\t\t## provided below under <!--\r\n\t\t## Website/Reference: ( http://acko.net/blog/farbtastic-color-picker-released )\r\n\r\n\t\twp_enqueue_script( 'myplugin_farbtastic', plugins_url('widgets/myplugin.farbtastic.js', __FILE__), array( 'jquery', 'farbtastic', 'rgbcolor' ) ); // this is very important\r\n\t\twp_enqueue_script( 'rgbcolor', plugins_url('widgets/rgbcolor.js', __FILE__) );\r\n\r\n\t\t## Do not remove the 'myplugin_insert_colorpicker' action or function unless you don't want to use farbastic.\r\n\r\n\t\tadd_action('admin_footer', 'myplugin_insert_colorpicker');\r\n\t\tfunction myplugin_insert_colorpicker()\r\n\t\t{\r\n\t\t\techo \"\\n\";\r\n\t\t\techo '<div id=\"myplugin_farbtastic\" style=\"display:none\"> </div>'.\"\\n\";\r\n\t\t\techo \"\\n\";\r\n\t\t}\r\n\t}\r\n\t## -- End: Fabrastic Color Picker --\r\n\r\n\t\r\n\t/*\tjQuery FORM VALIDATION: \r\n\t * Website: http://docs.jquery.com/Plugins/Validation#Validate_forms_like_you.27ve_never_been_validating_before.21\r\n\t * Website: http://docs.jquery.com/Plugins/Validation\r\n\t*/\r\n\t\r\n\t## -- Start: jQueryValidation ##\r\n\t## -- NOTE: Help is needed in setting up the jQueryValidation tool, if you know how to do it please send us an e-mail with explaining how it can be done.\r\n\t\r\n\tif ( in_array( $_GET['page'], array( 'myplugin-submenu-options', 'myplugin-submenu-setup') ) ) { # load js for options page\r\n\t\t//wp_enqueue_script( 'jquery_validate', plugins_url('widgets/jquery-validate/jquery.validate.js', MYPLUGIN_FILE_PATH), array( 'jquery' ) );\r\n\t\t//wp_enqueue_script( 'myplugin_jquery_validation', plugins_url('widgets/jquery-validate/myplugin.validate.js', MYPLUGIN_FILE_PATH), array( 'jquery' ) );\r\n\t}\r\n\t## -- End: jQueryValidation ##\r\n\r\n}", "function itstar_widget() {\n// register_widget( 'last_products_widget' );\n// register_widget( 'last_projects_widget' );\n register_widget( 'last_posts_by_cat_widget' );\n register_widget( 'contact_info_widget' );\n// register_widget( 'social_widget' );\n}", "function initiate_widgets() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer twitter',\n\t\t'id' => 'footer_twitter',\n\t\t'before_widget' => '<div class=\"c-twitter\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"o-twitter-header\">',\n\t\t'after_title' => '</h4>',\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer facebook',\n\t\t'id' => 'footer_facebook',\n\t\t'before_widget' => '<div class=\"c-twitter\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"o-twitter-header\">',\n\t\t'after_title' => '</h4>',\n\t) );\n\n}", "function LiangLeeThemeDesigner_lib(){\n/*\n * Register Global Variables for Topbar Background image.\n *\n * @access public\n */\nglobal $liangtopbar_bg;\n/*\n * Register Global Variables for Topbar Background color.\n *\n * @access public\n */\nglobal $liangtopbar_color;\n/*\n * Register Global Variables for Topbar height.\n *\n * @access public\n */\nglobal $liangtopbar_height;\n/*\n * Register Global Variables for Header Background Color.\n *\n * @access public\n */\nglobal $liangheader_color;\n/*\n * Register Global Variables for Head Logo.\n *\n * @access public\n */\nglobal $lianglogo;\n/*\n * Register Global Variables for Header Background image.\n *\n * @access public\n */\nglobal $liangheader_bgimg;\n/*\n * Register Global Variables for Search Bar Border Color.\n *\n * @access public\n */\nglobal $liangsearch_br;\n\n/*\n * Register Global Variables for Header Height.\n *\n * @access public\n */\nglobal $liangheader_height;\n/*\n * Register Global Variables for WalledGarden Image.\n *\n * @access public\n */\nglobal $liangwalledg_bgimg;\n\n/*\n * Fetch Settings for Header Height.\n *\n * @access public\n */\n$liang_walledg = elgg_get_plugin_setting(\"Leethemed_walledg_background\", \"LiangLeeThemeDesigner\");\nif (!elgg_get_plugin_setting(\"Leethemed_walledg_background\", \"LiangLeeThemeDesigner\")) {\n $liangwalledg_bgimg = '90px';\n } else { \n $liangwalledg_bgimg = $liang_walledg;\n}\n\n/*\n * Fetch Settings for Header Height.\n *\n * @access public\n */\n$liang_header_height = elgg_get_plugin_setting(\"Leethemed_header_height\", \"LiangLeeThemeDesigner\");\nif (!elgg_get_plugin_setting(\"Leethemed_header_height\", \"LiangLeeThemeDesigner\")) {\n $liangheader_height = '90px';\n } else { \n $liangheader_height = $liang_header_height;\n}\n/*\n * Fetch Settings for Topbar Background.\n *\n * @access public\n */\n$liang_topbar_bg = elgg_get_plugin_setting(\"Leethemed_background\", \"LiangLeeThemeDesigner\");\nif (!elgg_get_plugin_setting(\"Leethemed_background\", \"LiangLeeThemeDesigner\")) {\n $liangtopbar_bg = elgg_get_site_url().'_graphics/toptoolbar_background.gif';\n } else { \n $liangtopbar_bg = $liang_topbar_bg;\n}\n\n/*\n * Fetch Settings for Topbar Background Color.\n *\n * @access public\n */\n$liang_topbar_color = elgg_get_plugin_setting(\"Leethemed_tbar_bgcolor\", \"LiangLeeThemeDesigner\");\nif (!elgg_get_plugin_setting(\"Leethemed_tbar_bgcolor\", \"LiangLeeThemeDesigner\")) {\n $liangtopbar_color = '#333333';\n } else { \n $liangtopbar_color = $liang_topbar_color;\n}\n/*\n * Fetch Settings for Topbar Height.\n *\n * @access public\n */\n$liang_topbar_height = elgg_get_plugin_setting(\"Leethemed_tbar_height\", \"LiangLeeThemeDesigner\");\nif (!elgg_get_plugin_setting(\"Leethemed_tbar_height\", \"LiangLeeThemeDesigner\")) {\n $liangtopbar_height = '24';\n } else { \n $liangtopbar_height = $liang_topbar_height;\n}\n/*\n * Fetch Settings for Header Background image.\n *\n * @access public\n */\n$liang_header_bgimg = elgg_get_plugin_setting(\"Leethemed_header_bgimg\", \"LiangLeeThemeDesigner\");\nif (!elgg_get_plugin_setting(\"Leethemed_header_bgimg\", \"LiangLeeThemeDesigner\")) {\n $liangheader_bgimg = '#4690D6 url('.elgg_get_site_url().'_graphics/header_shadow.png) repeat-x bottom left';\n } else { \n $liangheader_bgimg = $liang_header_bgimg;\n}\n/*\n * Fetch Settings for Header Background Image.\n *\n * @access public\n */\n$liang_header_color = elgg_get_plugin_setting(\"Leethemed_header_bgcolor\", \"LiangLeeThemeDesigner\");\nif (!elgg_get_plugin_setting(\"Leethemed_header_bgcolor\", \"LiangLeeThemeDesigner\")) {\n $liangheader_color = '#4690D6';\n } else { \n $liangheader_color = $liang_header_color;\n}\n/*\n * Fetch Settings for Topbar Logo.\n * Display ($site->name) site name if logo not setup.\n * @access public\n */\n$liang_logo = elgg_get_plugin_setting(\"Leethemed_logo\", \"LiangLeeThemeDesigner\");\nif (!elgg_get_plugin_setting(\"Leethemed_logo\", \"LiangLeeThemeDesigner\")) {\n $site = elgg_get_site_entity();\n $site_name = $site->name;\n $lianglogo = $site_name;\n } else { \n $lianglogo = $liang_logo;\n}\n\n}", "function dfcg_help_quick() {\n?>\n\t<h3><?php _e( 'Dynamic Content Gallery - Quick Help - Getting Started', DFCG_DOMAIN ); ?></h3>\n\t\n\t<h4><?php _e( '90 second configuration', DFCG_DOMAIN ); ?></h4>\n\t\n\t<p><?php printf( '%s <a href=\"%s\">%s</a> %s', __( 'The following assumes that you have followed the', DFCG_DOMAIN ), '#tab-panel-dfcg-help-theme', __( 'Theme Integration', DFCG_DOMAIN ), __( 'instructions.', DFCG_DOMAIN ) ); ?></p>\n\t\n\t<p><?php _e( 'When first installed, the plugin is pre-configured with default settings designed to get you up and running very quickly. For simplicity, the Gallery Method is set to \"One category\" with 5 posts, and Image Management is set to \"Featured Images\".', DFCG_DOMAIN ); ?></p>\n\t<p><?php _e( 'Therefore, to quickly see if the DCG is properly installed and integrated with your theme, go to the <span class=\"bold-italic\">Gallery Method</span> tab and select a category which has 5 posts with Featured images, click Save, and then check the front end of your site to confirm that the DCG is displaying properly.', DFCG_DOMAIN ); ?></p>\n\t\n\t<p><?php _e( 'Now you have the DCG up and running, feel free to configure the options to suit your needs. In case of problems, refer to the Troubleshooting section of this Quick Help Guide.', DFCG_DOMAIN ); ?></p>\n\t<p>Still a little lost? Check out the <a class=\"off-site\" target=\"_blank\" href=\"<?php echo DFCG_HOME; ?>quick-start-guide/\"><?php _e('Quick Start', DFCG_DOMAIN); ?></a> guide.</p>\n\n<?php\n}", "function cheffism_widgets_init() {\n register_sidebar( array (\n 'name' => __( 'Sidebar', 'cheffism' ),\n 'id' => 'sidebar',\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\" role=\"complementary\">',\n 'after_widget' => \"</aside>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n ) );\n register_sidebar( array (\n 'name' => __( 'Header', 'cheffism' ),\n 'id' => 'header',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n ) );\n register_sidebar( array (\n 'name' => __( 'Footer', 'cheffism' ),\n 'id' => 'footer',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n ) );\n register_sidebar( array (\n 'name' => __( 'Homepage Content', 'cheffism' ),\n 'id' => 'homepage-content',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n ) ); \n}", "function gigx_dashboard_widget_function(){\n ?>\n <p>Enjoy your new website. If you've got any questions or encounter any bugs, please contact me at <a href=\"mailto:axel@gigx.co.uk\">axel@gigx.co.uk</a>.\n I will add a list of useful links and tutorials below, as well as any messages about updates.<br/><a href=\"http://axwax.de\" target=\"_blank\">Axel</a></p> \n <?php wp_widget_rss_output('http://www.axwax.de/category/support/history/feed/', array('items' => 5, 'show_author' => 0, 'show_date' => 1, 'show_summary' => 1));\n}", "function ourWidgetsInit(){\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Sidebar',\n\t\t\t'id' => 'sidebar1',\n\t\t\t'before_widget' => '<div class=\"widget-item\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h4 class=\"my-special-class\">',\n\t\t\t'after_title' => '</h4>'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 1',\n\t\t\t'id' => 'footer1'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 2',\n\t\t\t'id' => 'footer2'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 3',\n\t\t\t'id' => 'footer3'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 4',\n\t\t\t'id' => 'footer4'\n\t\t));\n\t}", "function add_some_widgets()\r\n{\r\n register_sidebar( array(\r\n 'name' => __( 'Sidebar', 'sidebar' ),\r\n 'id' => 'sidebar',\r\n 'description' => __( 'This will be displayed followed by the regular sidebar', 'spd' ),\r\n 'before_widget' => '<div id=\"sidebar-%i\" class=\"widget\"><div class=\"widgetcontent\">',\r\n 'after_widget' => '</div></div>',\r\n 'before_title' => '<h5>',\r\n 'after_title' => '</h5>',\r\n ) );\r\n}", "function pramble_widget_setup() {\n\t\t /**\n\t\t\t* Creates a sidebar\n\t\t\t* @param string|array Builds Sidebar based off of 'name' and 'id' values.\n\t\t\t*/\n\t\t\t$args = array(\n\t\t\t\t'name' => 'Sidebar',\n\t\t\t\t'id' => 'sidebar-1',\n\t\t\t\t'description' => 'standard sidebar',\n\t\t\t\t'class' => 'custom',\n\t\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t\t'after_widget' => '</aside>',\n\t\t\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t\t\t'after_title' => '</h2>',\n\t\t\t);\n\t\t\n\t\t\tregister_sidebar( $args );\n\t\n\t\t\t}", "function gucci_styles() {\n\t// Load main stylesheet\n\twp_enqueue_style('gucci-style', get_template_directory_uri() . '/library/dist/css/style.css');\n\t// Load main javascript\n\twp_enqueue_script('gucci-script', get_template_directory_uri() . '/library/dist/js/functions.min.js', array('jquery'), '1.0', true);\n}", "function my_admin_enqueue() {\n $screen = get_current_screen();\n if( $screen->id != 'settings_page_gazette1-icon-gallery') {\n return;\n }\n // Styles\n wp_register_style('gazette1_admin_styles', plugin_dir_url(__FILE__) . 'admin/css/gazette1_styles.css');\n wp_enqueue_style('gazette1_admin_styles');\n // WP doesn't include the necessary jquery-ui stylings. Google CDN ftw\n wp_enqueue_style('jquery_ui_styles', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css');\n // Scripts\n wp_enqueue_script('jquery');\n wp_enqueue_script('jquery-ui-sortable');\n wp_enqueue_script('jquery-ui-core');\n wp_enqueue_script('jquery-ui-widget');\n wp_enqueue_script('jquery-ui-mouse');\n wp_register_script('gazette1_admin_js', plugin_dir_url(__FILE__) . 'admin/js/gazette1_admin.js', array('jquery', 'jquery-ui-sortable', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse'));\n wp_enqueue_script('gazette1_admin_js');\n}", "function perusecretland_widgets_init() {\n // Top widgets\n $args = array(\n 'name' => 'Top Widgets',\n 'id' => 'top-widgets',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n );\n register_sidebar( $args );\n // Floating sidebar\n $args = array(\n 'name' => 'Floating Sidebar',\n 'id' => 'floating-sidebar',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n );\n register_sidebar( $args );\n}", "function add_wp_hooks(){\n\n\t\t$comments = new WordpressConnectComments();\n\t\t$like = new WordpressConnectLikeButton();\n\n\t}", "function FoodByNight_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer Right',\n\t\t'id' => 'footer_right',\n\t\t'before_widget' => '<ul class=\"list-inline\">',\n\t\t'after_widget' => '</ul>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Social_Link_Widget' );\n\n\tregister_sidebar( array(\n\t\t'name' => 'Popups',\n\t\t'id' => 'popups',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Contact_Popup_Widget' );\n\n}", "function dfcg_help_theme() {\n?>\n\t<h3><?php _e( 'Dynamic Content Gallery - Quick Help - Theme Integration', DFCG_DOMAIN ); ?></h3>\n\t\n\t<p><?php _e( 'Before doing anything else you need to integrate the DCG in your theme using either the DCG Widget or the DCG Template Tag.', DFCG_DOMAIN ); ?></p>\n\t\n\t<h4>DCG Widget</h4>\n\t\n\t<p><?php _e( 'Assuming your theme has widget areas on your home page, using the DCG Widget is the simplest method to use as no coding is required. Go to Dashboard > Appearance > Widgets and drag the DCG Widget to an appropriate widget area. You can then add a title (optional) and even some \"after\" text which will display below the DCG.', DFCG_DOMAIN ); ?> <em><?php _e( 'Note that even if using the DCG Widget, you must set up the various options on the DCG Settings page.', DFCG_DOMAIN ); ?></em></p>\n\t\n\t<h4><?php _e( 'DCG Template Tag', DFCG_DOMAIN ); ?></h4>\n\t\n\t<p><?php _e( 'Alternatively, you can use the template tag in a theme template, like this:', DFCG_DOMAIN ); ?></p>\n\t\n\t<code>&lt;php dynamic_content_gallery(); ?&gt;</code><br /><br />\n\t\n\t<p><?php _e( 'Check out this tutorial:', DFCG_DOMAIN ); ?> <a class=\"off-site\" target=\"_blank\" href=\"<?php echo DFCG_HOME; ?>configuration-guide/#template-code\"><?php _e( 'How to choose the correct theme template when using the DCG Template Tag', DFCG_DOMAIN ); ?></a></p>\n\n<?php\n}", "function TS_VCSC_Extensions_Front_Main() {\r\n\t\t\tglobal $post;\r\n\t\t\tglobal $wp_query;\r\n\t\t\t$url \t\t\t\t\t\t\t\t\t= plugin_dir_url( __FILE__ );\r\n\t\t\t$this->TS_VCSC_FilesRegistrations();\r\n\t\t\t// Check For Standard Frontend Page\r\n\t\t\tif (!is_404() && !is_search() && !is_archive()) {\r\n\t\t\t\t$TS_VCSC_StandardFrontendPage\t\t= \"true\";\r\n\t\t\t} else {\r\n\t\t\t\t$TS_VCSC_StandardFrontendPage\t\t= \"false\";\r\n\t\t\t}\r\n\t\t\t// Load Scripts As Needed\r\n\t\t\tif (!empty($post)){\r\n\t\t\t\t// Check for Standard Shortcodes\r\n\t\t\t\tif ((stripos($post->post_content, '[TS-VCSC-') !== FALSE) || (stripos($post->post_content, '[TS_VCSC_') !== FALSE)) {\r\n\t\t\t\t\t$TS_VCSC_StandardShorcodes\t\t= \"true\";\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$TS_VCSC_StandardShorcodes\t\t= \"false\";\r\n\t\t\t\t}\r\n\t\t\t\t// Check for EnlighterJS Shortcodes\r\n\t\t\t\tif (stripos($post->post_content, '[TS_EnlighterJS_') !== FALSE) {\r\n\t\t\t\t\t$TS_VCSC_EnlighterShorcodes\t\t= \"true\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$TS_VCSC_EnlighterShorcodes\t\t= \"false\";\r\n\t\t\t\t}\r\n\t\t\t\t// Define Ajax Path Variable\r\n\t\t\t\t/*if (stripos($post->post_content, '[TS_VCSC_Timeline_CSS_Container') !== FALSE) {\r\n\t\t\t\t\twp_enqueue_style('ts-visual-composer-extend-ajax', \t\t$url . '/css/ts-visual-composer-extend-ajax.css', null, false, 'all');\r\n\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-ajax', \t$url . '/js/ts-visual-composer-extend-ajax.js', array('jquery'), false, true);\r\n\t\t\t\t\twp_localize_script('ts-visual-composer-extend-ajax', \t'$TS_VCSC_AjaxData', array(\r\n\t\t\t\t\t\t'ajaxurl' \t\t=> admin_url('admin-ajax.php'),\r\n\t\t\t\t\t\t'queryvars' \t=> json_encode($wp_query->query)\r\n\t\t\t\t\t));\r\n\t\t\t\t}*/\r\n\t\t\t\tif ((($this->TS_VCSC_LoadFrontEndLightbox == \"true\") || ($this->TS_VCSC_UseLightboxPrettyPhoto == \"true\") || ($this->TS_VCSC_UseLightboxAutoMedia == \"true\")) && ($TS_VCSC_StandardFrontendPage == \"true\") && ($this->TS_VCSC_UseInternalLightbox == \"true\") && ($this->TS_VCSC_VCFrontEditMode == \"false\")) {\r\n\t\t\t\t\tif ((((array_key_exists('customscroll', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['customscroll'] : $this->TS_VCSC_Lightbox_Setting_Defaults['customscroll']) == 1 ? 'true' : 'false') == \"true\") {\r\n wp_enqueue_script('ts-extend-perfectscrollbar');\r\n wp_enqueue_style('ts-extend-perfectscrollbar');\r\n }\r\n wp_enqueue_script('ts-extend-krautlightbox');\r\n\t\t\t\t\twp_enqueue_style('ts-extend-krautlightbox');\r\n\t\t\t\t}\r\n\t\t\t\tif (($this->TS_VCSC_LoadFrontEndTooltips == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\") && ($this->TS_VCSC_VCFrontEditMode == \"false\")) {\r\n\t\t\t\t\twp_enqueue_style('ts-extend-tooltipster');\r\n\t\t\t\t\twp_enqueue_script('ts-extend-tooltipster');\t\r\n\t\t\t\t}\r\n\t\t\t\tif (get_option('ts_vcsc_extend_settings_loadFonts', 0) == 1) {\r\n\t\t\t\t\t// Add CSS for each enabled Font to WordPress Frontend\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(true);\r\n\t\t\t\t}\r\n\t\t\t\t/* Force Load of Core Files */\t\t\t\t\r\n\t\t\t\tif (($this->TS_VCSC_LoadFrontEndForcable == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\")) {\t\t\t\t\t\r\n\t\t\t\t\t// Load jQuery (if not already loaded)\r\n\t\t\t\t\tif (($this->TS_VCSC_LoadFrontEndJQuery == \"true\") && (!wp_script_is('jquery'))) {\r\n\t\t\t\t\t\twp_enqueue_script('jquery');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($this->TS_VCSC_VCFrontEditMode == \"false\") {\r\n\t\t\t\t\t\t// Load Waypoints\r\n\t\t\t\t\t\tif ($this->TS_VCSC_LoadFrontEndWaypoints == \"true\") {\r\n\t\t\t\t\t\t\tif (wp_script_is('waypoints', $list = 'registered')) {\r\n\t\t\t\t\t\t\t\twp_enqueue_script('waypoints');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\twp_enqueue_script('ts-extend-waypoints');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Add CSS for each enabled Icon Font to Page\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(false);\r\n\t\t\t\t\t// Load Other Required Files\r\n\t\t\t\t\tif ($this->TS_VCSC_VCFrontEditMode == \"false\") {\r\n\t\t\t\t\t\twp_enqueue_style('ts-extend-animations');\r\n\t\t\t\t\t\twp_enqueue_style('ts-extend-tooltipster');\r\n\t\t\t\t\t\twp_enqueue_script('ts-extend-tooltipster');\t\r\n\t\t\t\t\t\twp_enqueue_style('ts-visual-composer-extend-front');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-forms');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-galleries');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-backgrounds');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-front');\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/* Files if Shortcode Detected or Widgets Activated */\r\n\t\t\t\tif ((($TS_VCSC_StandardShorcodes == \"true\" || $TS_VCSC_EnlighterShorcodes == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\")) || (($this->TS_VCSC_CustomPostTypesWidgets == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\"))) { \r\n\t\t\t\t\t// Load jQuery (if not already loaded)\r\n\t\t\t\t\tif (($this->TS_VCSC_LoadFrontEndJQuery == \"true\") && (!wp_script_is('jquery'))) {\r\n\t\t\t\t\t\twp_enqueue_script('jquery');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Load MooTools (for EnlighterJS)\r\n\t\t\t\t\tif (($this->TS_VCSC_LoadFrontEndMooTools == \"true\") && ($TS_VCSC_EnlighterShorcodes == \"true\")) {\r\n\t\t\t\t\t\twp_enqueue_script('ts-library-mootools');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Load Google Charts API\r\n\t\t\t\t\tif ((TS_VCSC_CheckShortcode('TS-VCSC-Google-Charts') == \"true\") || (TS_VCSC_CheckShortcode('TS-VCSC-Google-Tables') == \"true\")) {\r\n\t\t\t\t\t\twp_enqueue_script('ts-extend-google-charts');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Add CSS for each enabled Icon Font to Page\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(false);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Add CSS for Each Enabled Font (Force Load)\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function simple_dashboard_widget()\n{\n ?>\n <h2> simple dashboard widget </h2>\n <h3> Im learning wordpress development </h3>\n<?php\n\n}", "function spreadshop_designer()\n{\ninclude(plugin_dir_path(__FILE__).'/spreaddesigner.php');\nadd_filter('wp_head', 'sources');\n}", "function msdlab_homepage_widgets(){\n\tprint '<div id=\"homepage-widgets\" class=\"widget-area\">';\n\tprint '<div class=\"wrap\"><div class=\"row\">';\n dynamic_sidebar('homepage-widgets');\n \tprint '</div></div>';\n\tprint '</div>';\n}", "public function my_front_end_stuff()\n {\n add_action('wp_enqueue_scripts', array($this, 'myScripts'));\n\n // Don't load the filters if the display option is toggled to NONE!\n if(get_option('grimage_display_options') != \"none\") {\n //add_filter('the_content', array($this, 'replaceImagesWithGrimages'));\n add_filter('the_content', array($this, 'replaceImagesWithGrimagesTwo'));\n add_action('wp_head', array($this, 'hook_js'));\n add_action('wp_head', array($this, 'hook_css'));\n add_action('wp_footer', array($this, 'grimage_modal'));\n }\n }", "private function add_hooks(){\n\t\n\t\tadd_action( 'plugin_action_links_' . UCLACOMPONENTSWP_PLUGIN_BASE, array( $this, 'add_plugin_action_link' ), 20 );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_backend_scripts_and_styles' ), 20 );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_public_scripts_and_styles' ), 20 );\n\t\n\t}", "function positive_panels_init(){\n\t/*$display_settings = get_option('siteorigin_panels_display', array());\n\tif( isset($display_settings['bundled-widgets'] ) && !$display_settings['bundled-widgets'] ) return;*/\n\n\tinclude 'widgets/widgets.php';\n}", "function gardenia_load_widget() {\n\tregister_widget( 'gardenia_widget' );\n}", "function ws_pack_system_expose_functions() {\n\telgg_ws_expose_function(\n\t\t\"system.api.register_push_notification_service\",\n\t\t\"ws_pack_system_api_register_push_notification_service\",\n\t\tarray(\n\t\t\t\"service_name\" => array(\n\t\t\t\t\"type\" => \"string\",\n\t\t\t\t\"required\" => true\n\t\t\t),\n\t\t\t\"settings\" => array(\n\t\t\t\t\"type\" => \"array\",\n\t\t\t\t\"required\" => true\n\t\t\t)\n\t\t),\n\t\telgg_echo(\"ws_pack:api:system:api:register_push_notification_service\"),\n\t\t\"POST\",\n\t\ttrue,\n\t\tfalse\n\t);\n\t\n\telgg_ws_expose_function(\n\t\t\"system.api.unregister_push_notification_service\",\n\t\t\"ws_pack_system_api_unregister_push_notification_service\",\n\t\tarray(\n\t\t\t\"service_name\" => array(\n\t\t\t\t\"type\" => \"string\",\n\t\t\t\t\"required\" => true\n\t\t\t)\n\t\t),\n\t\telgg_echo(\"ws_pack:api:system:api:unregister_push_notification_service\"),\n\t\t\"POST\",\n\t\ttrue,\n\t\tfalse\n\t);\n\t\n}", "function wptreehouse_badges_menu() {\n\n\t/*\n\t * \tUse the add_options_page function\n\t * \tadd_options_page( $page_title, $menu_title, $capability, $menu-slug, $function ) \n\t *\n\t*/\n\n\tadd_options_page(\n\t\t'Official Treehouse Badges Plugin',\n\t\t'Treehouse Badges',\n\t\t'manage_options',\n\t\t'wptreehouse-badges',\n\t\t'wptreehouse_badges_options_page'\n\t);\n\n}", "function dfcg_help_scripts() {\n?>\n\t<h3><?php _e( 'Dynamic Content Gallery - Quick Help - Javascript and Load Scripts', DFCG_DOMAIN ); ?></h3>\n\t\n\t<p><?php _e( 'Go to the DCG Settings > Javascript Options tab to set the choice of mootools (default) or jQuery scripts. Note that after changing this settings, click Save, then return to the Javascript Options tab to configure the other options in this tab. You have to do this because the javascript options are not identical for both scripts.', DFCG_DOMAIN ); ?></p>\n\t\n\t<p><?php _e( 'The DCG Settings > Load Scripts tab allows you to specify in which pages the javascript and gallery CSS are loaded. These settings ensure that the javascript and CSS are only loaded where needed, and therefore will not slow down the page load on all the other pages on your site.', DFCG_DOMAIN ); ?></p>\n\t\n\t<p><?php _e( 'In 99.9% of cases users will display the DCG on their home page. Therefore, if this is the case you for, select the Home page option in the DCG Settings > Load Scripts tab.', DFCG_DOMAIN ); ?></p>\n\n<?php\n}", "function genesis_child_gutenberg_support() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- using same in all child themes to allow action to be unhooked.\n require_once get_stylesheet_directory() . '/lib/gutenberg/init.php';\n}", "function dl_widget_init() {\n\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Página de Contacto',\n\t\t'id'\t\t\t=> 'contact-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Barra Lateral',\n\t\t'id'\t\t\t=> 'sidebar-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Search Menu',\n\t\t'id'\t\t\t=> 'menu-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\n}", "function genesis_child_gutenberg_support() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- using same in all child themes to allow action to be unhooked.\n require_once CHILD_DIR . '/lib/gutenberg/init.php';\n}", "function suhv_widgets()\n{\n register_widget( 'Suhv_Widgets' );\n}", "function arphabet_widgets_init() {\n\n register_sidebar( array(\n 'name' => 'Widget oben rechts',\n 'id' => 'widget_top_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Widget mitte rechts',\n 'id' => 'widget_center_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Widget unten rechts',\n 'id' => 'widget_bottom_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Newsletter Widget',\n 'id' => 'newsletter_widget',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Custom Footer Widget',\n 'id' => 'footer_widget',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n\n}", "function load_dashboard_widget() {\n\t\tadd_action('wp_dashboard_setup', array($this,'dashboard_widget'));\n\t}", "function happy_register_sidebars() {\n\n\tregister_sidebar( array( 'name' => __( 'Feature', hybrid_get_textdomain() ), 'id' => 'feature', 'description' => __( 'Displayed in the feature area.', hybrid_get_textdomain() ), 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s widget-%2$s\"><div class=\"widget-inside\">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class=\"widget-title\">', 'after_title' => '</h3>' ) );\n\n}", "public function widgets() {\r\n\t\t// Make sure the user has capability.\r\n\t\tif ( Permission::user_can( 'analytics' ) || ! is_admin() ) {\r\n\t\t\t// Most popular contents.\r\n\t\t\tregister_widget( Widgets\\Popular::instance() );\r\n\t\t}\r\n\t}", "function wp_dashboard_setup()\n {\n }", "function bones_register_sidebars() {\r\n register_sidebar(array(\r\n \t'id' => 'sidebar1',\r\n \t'name' => 'Page Sidebar',\r\n \t'description' => 'The first (primary) sidebar.',\r\n \t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\r\n \t'after_widget' => '</div>',\r\n \t'before_title' => '<h3 class=\"widget-title\">',\r\n \t'after_title' => '</h3>',\r\n ));\r\n\tregister_sidebar(array(\r\n\t\t'id' => 'sidebar2',\r\n\t\t'name' => 'Blog Sidebar',\r\n\t\t'description' => 'Secondary sidebar for pages.',\r\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\r\n\t\t'after_widget' => '</div>',\r\n\t\t'before_title' => '<h3 class=\"widget-title\">',\r\n\t\t'after_title' => '</h3>',\r\n\t));\r\n\tregister_sidebar(array(\r\n\t\t'id' => 'sidebar3',\r\n\t\t'name' => 'Footer Columns',\r\n\t\t'description' => 'Footer three columns.',\r\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s fourcol\">',\r\n\t\t'after_widget' => '</div>',\r\n\t\t'before_title' => '<h3 class=\"widgettitle\">',\r\n\t\t'after_title' => '</h3>',\r\n\t));\r\n \r\n /* \r\n to add more sidebars or widgetized areas, just copy\r\n and edit the above sidebar code. In order to call \r\n your new sidebar just use the following code:\r\n \r\n Just change the name to whatever your new\r\n sidebar's id is, for example:\r\n \r\n register_sidebar(array(\r\n \t'id' => 'sidebar2',\r\n \t'name' => 'Sidebar 2',\r\n \t'description' => 'The second (secondary) sidebar.',\r\n \t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\r\n \t'after_widget' => '</div>',\r\n \t'before_title' => '<h4 class=\"widgettitle\">',\r\n \t'after_title' => '</h4>',\r\n ));\r\n \r\n To call the sidebar in your template, you can just copy\r\n the sidebar.php file and rename it to your sidebar's name.\r\n So using the above example, it would be:\r\n sidebar-sidebar2.php\r\n \r\n */\r\n}", "function wporg_add_dashboard_widgets() {\r\n // Remove Welcome panel\r\n remove_action( 'welcome_panel', 'wp_welcome_panel' );\r\n // Remove the rest of the dashboard widgets\r\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\r\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\r\n remove_meta_box( 'health_check_status', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');\r\n remove_meta_box( 'dashboard_site_health', 'dashboard', 'normal');\r\n \r\n // Add function here\r\n wp_add_dashboard_widget( 'jerome-on-service-widget', 'Web Developer Service Tag', 'jerome_on_service_widget');\r\n}", "function dazzling_widgets_init() {\n register_sidebar( array(\n 'name' => __( 'Sidebar', 'dazzling' ),\n 'id' => 'sidebar-1',\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n register_sidebar(array(\n 'id' => 'home-widget-1',\n 'name' => __( 'Homepage Widget 1', 'dazzling' ),\n 'description' => __( 'Displays on the Home Page', 'dazzling' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widgettitle\">',\n 'after_title' => '</h3>',\n ));\n\n register_sidebar(array(\n 'id' => 'home-widget-2',\n 'name' => __( 'Homepage Widget 2', 'dazzling' ),\n 'description' => __( 'Displays on the Home Page', 'dazzling' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widgettitle\">',\n 'after_title' => '</h3>',\n ));\n\n register_sidebar(array(\n 'id' => 'home-widget-3',\n 'name' => __( 'Homepage Widget 3', 'dazzling' ),\n 'description' => __( 'Displays on the Home Page', 'dazzling' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widgettitle\">',\n 'after_title' => '</h3>',\n ));\n\n register_sidebar(array(\n 'id' => 'footer-widget-1',\n 'name' => __( 'Footer Widget 1', 'dazzling' ),\n 'description' => __( 'Used for footer widget area', 'dazzling' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widgettitle\">',\n 'after_title' => '</h3>',\n ));\n\n register_sidebar(array(\n 'id' => 'footer-widget-2',\n 'name' => __( 'Footer Widget 2', 'dazzling' ),\n 'description' => __( 'Used for footer widget area', 'dazzling' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widgettitle\">',\n 'after_title' => '</h3>',\n ));\n\n register_sidebar(array(\n 'id' => 'footer-widget-3',\n 'name' => __( 'Footer Widget 3', 'dazzling' ),\n 'description' => __( 'Used for footer widget area', 'dazzling' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widgettitle\">',\n 'after_title' => '</h3>',\n ));\n\n\n register_widget( 'dazzling_social_widget' );\n register_widget( 'dazzling_popular_posts_widget' );\n}", "function gbteddybear_widgets_init() {\n\n\t/********************** Sidebars ***********************/\n\n\tregister_sidebar( array(\n\t\t'name' => __( 'Default Sidebar', 'gbteddybear' ),\n\t\t'id' => 'default',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>',\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => __( 'Footer', 'gbteddybear' ),\n\t\t'id' => 'footer',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget span two equal-height %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h5 class=\"widget-title\">',\n\t\t'after_title' => '</h5>',\n\t) );\n\n\t/********************** Content ***********************/\n\n\tregister_sidebar( array(\n\t\t'name' => __( 'Homepage Content', 'gbteddybear' ),\n\t\t'id' => 'homepage_content',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget span one-third %2$s\">',\n\t\t'after_widget' => '</div></aside>',\n\t\t'before_title' => '<h5 class=\"widget-title text-center light-brown uppercase\">',\n\t\t'after_title' => '</h5><div class=\"inner equal-height\">',\n\t) );\n\n\n}", "function glio_widgets_init() {\n\n register_sidebar(\n array(\n 'name' => __('Home Page Left', 'WP-Glio'),\n 'id' => 'hp-one',\n 'description' => __('The first area in the footer on the home page', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n )\n );\n\n register_sidebar(\n array(\n 'name' => __('Home Page Middle', 'WP-Glio'),\n 'id' => 'hp-two',\n 'description' => __('The center area in the footer on the home page', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n )\n );\n\n register_sidebar(\n array(\n 'name' => __('Home Page Right', 'WP-Glio'),\n 'id' => 'hp-three',\n 'description' => __('The last area in the footer on the home page', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>'\n )\n );\n ///////\n register_sidebar(\n array(\n 'name' => __('Services', 'WP-Glio'),\n 'id' => 'company-services',\n 'description' => __('Add content below the \"What we do\" title', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n )\n );\n\n register_sidebar(\n array(\n 'name' => __('Team', 'WP-Glio'),\n 'id' => 'company-team',\n 'description' => __('Add content below the \"Team Glio\" title', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n )\n );\n\n register_sidebar(\n array(\n 'name' => __('Company Page Bottom', 'WP-Glio'),\n 'id' => 'company-bottom',\n 'description' => __('Add content below the team section on the company page', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"row %2$s\">',\n 'after_widget' => '</div><hr /></div>',\n 'before_title' => '<div class=\"col-md-5 side-title\">',\n 'after_title' => '</div><div class=\"col-md-7\">'\n )\n );\n ///////\n register_sidebar(\n array(\n 'name' => __('Footer Left', 'WP-Glio'),\n 'id' => 'footer-one',\n 'description' => __('The first area in the footer', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n )\n );\n\n register_sidebar(\n array(\n 'name' => __('Footer Middle', 'WP-Glio'),\n 'id' => 'footer-two',\n 'description' => __('The center area in the footer', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n )\n );\n\n register_sidebar(\n array(\n 'name' => __('Footer Right', 'WP-Glio'),\n 'id' => 'footer-three',\n 'description' => __('The last area in the footer', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>'\n )\n );\n ///////\n register_sidebar(\n array(\n 'name' => __('Contact Page Left', 'WP-Glio'),\n 'id' => 'contact-one',\n 'description' => __('The first area in the footer on the contact page', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n )\n );\n\n register_sidebar(\n array(\n 'name' => __('Contact Page Middle', 'WP-Glio'),\n 'id' => 'contact-two',\n 'description' => __('The center area in the footer on the contact page', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n )\n );\n\n register_sidebar(\n array(\n 'name' => __('Contact Page Right', 'WP-Glio'),\n 'id' => 'contact-three',\n 'description' => __('The last area in the footer on the contact page', 'WP-Glio'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>'\n )\n );\n\n}", "function yellow_widgets_init() {\n\n\tregister_sidebar( array(\n\t 'name' => 'Sidebar',\n\t 'id' => 'sidebar',\n\t 'before_widget' => '<div class=\"media-body\">',\n\t 'after_widget' => '</div>',\n\t 'before_title' => '<div class=\"card-header\">',\n\t 'after_title' => '</div>',\n\t));\n\tregister_sidebar( array(\n\t\t'name' => 'Footer',\n\t\t'id' => 'footer',\n\t\t'before_widget' => '',\n\t\t'after_widget' => '',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t ));\n\t\n \n }", "public function templ_dashboard_extends(){\r\n\t\t\t\r\n\t\tdo_action('templconnector_bundle_box');\r\n\t\t\t\r\n\t\t\r\n\t\t/* to get plugins */\t\r\n\t\r\n\t}", "function enqueue_scripts() {\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 21 );\n\t\tadd_action( 'admin_init', array( $this, 'add_pagination' ) );\n\t\tadd_action( \"bc_plugin_browser_content_{$this->page_slug}\", array( $this, 'display_plugins_browser' ), 10, 2 );\n\t}", "public function hook() {\n\t\tadd_action( 'admin_print_scripts', [ $this, 'admin_scripts' ] );\n\t\t// Elementor support.\n\t\tadd_action( 'elementor/editor/after_enqueue_scripts', [ $this, 'admin_scripts' ] );\n\t\t// UGH! Beaver Builder hack.\n\t\tif ( isset( $_GET['fl_builder'] ) ) { // phpcs:ignore\n\t\t\tadd_action( 'wp_enqueue_scripts', [ $this, 'admin_scripts' ] );\n\t\t}\n\n\t\tadd_action( 'advanced-sidebar-menu/widget/category/after-form', [ $this, 'init_widget_js' ], 1000 );\n\t\tadd_action( 'advanced-sidebar-menu/widget/page/after-form', [ $this, 'init_widget_js' ], 1000 );\n\t\tadd_action( 'advanced-sidebar-menu/widget/navigation-menu/after-form', [ $this, 'init_widget_js' ], 1000 );\n\t}", "function wpdocs_codex_Gallerie_init() {\r\n $labels = array(\r\n 'name' => _x( 'Mes Galleries', 'Post type general name', 'textdomain' ),\r\n 'singular_name' => _x( 'Gallerie', 'Post type singular name', 'textdomain' ),\r\n 'menu_name' => _x( 'Mes Galleries', 'Admin Menu text', 'textdomain' ),\r\n 'name_admin_bar' => _x( 'Gallerie', 'Ajouter une Gallerie', 'textdomain' ),\r\n 'add_new' => __( 'Ajouter une Gallerie', 'textdomain' ),\r\n 'add_new_item' => __( 'Ajouter une Gallerie', 'textdomain' ),\r\n 'new_item' => __( 'Nouvelle Gallerie', 'textdomain' ),\r\n 'edit_item' => __( 'Editer Gallerie', 'textdomain' ),\r\n 'view_item' => __( 'Voir mes Gallerie', 'textdomain' ),\r\n 'all_items' => __( 'Toutes Mes Galleries', 'textdomain' ),\r\n 'search_items' => __( 'Rechercher des Galleries', 'textdomain' ),\r\n 'parent_item_colon' => __( 'Parent Mes Galleries:', 'textdomain' ),\r\n 'not_found' => __( 'Pas de Galleries trouvé.', 'textdomain' ),\r\n 'not_found_in_trash' => __( 'Pas de Galleries trouvé dans la corbeille.', 'textdomain' ),\r\n 'featured_image' => _x( 'Gallerie Cover Image', 'Overrides the “Featured Image” phrase for this post type. Added in 4.3', 'textdomain' ),\r\n 'set_featured_image' => _x( 'Set cover image', 'Overrides the “Set featured image” phrase for this post type. Added in 4.3', 'textdomain' ),\r\n 'remove_featured_image' => _x( 'Remove cover image', 'Overrides the “Remove featured image” phrase for this post type. Added in 4.3', 'textdomain' ),\r\n 'use_featured_image' => _x( 'Use as cover image', 'Overrides the “Use as featured image” phrase for this post type. Added in 4.3', 'textdomain' ),\r\n 'archives' => _x( 'Gallerie archives', 'The post type archive label used in nav menus. Default “Post Archives”. Added in 4.4', 'textdomain' ),\r\n 'insert_into_item' => _x( 'Insert into Gallerie', 'Overrides the “Insert into post”/”Insert into page” phrase (used when inserting media into a post). Added in 4.4', 'textdomain' ),\r\n 'uploaded_to_this_item' => _x( 'Uploaded to this Gallerie', 'Overrides the “Uploaded to this post”/”Uploaded to this page” phrase (used when viewing media attached to a post). Added in 4.4', 'textdomain' ),\r\n 'filter_items_list' => _x( 'Filter Mes Galleries list', 'Screen reader text for the filter links heading on the post type listing screen. Default “Filter posts list”/”Filter pages list”. Added in 4.4', 'textdomain' ),\r\n 'items_list_navigation' => _x( 'Mes Galleries list navigation', 'Screen reader text for the pagination heading on the post type listing screen. Default “Posts list navigation”/”Pages list navigation”. Added in 4.4', 'textdomain' ),\r\n 'items_list' => _x( 'Mes Galleries list', 'Screen reader text for the items list heading on the post type listing screen. Default “Posts list”/”Pages list”. Added in 4.4', 'textdomain' ),\r\n );\r\n \r\n $args = array(\r\n 'labels' => $labels,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'show_ui' => true,\r\n 'show_in_menu' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => 'Gallerie' ),\r\n 'capability_type' => 'post',\r\n 'has_archive' => true,\r\n 'hierarchical' => false,\r\n 'menu_position' => null,\r\n 'supports' => array( 'title', 'author', 'thumbnail', 'excerpt', 'comments' ),\r\n );\r\n \r\n register_post_type( 'gallerie', $args );\r\n}", "function dfcg_plugin_help() {\n\t\n\tglobal $current_screen;\n\t\n\t$sidebar = dfcg_help_sidebar();\n\t\n\t$current_screen->set_help_sidebar( $sidebar );\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-general',\n\t\t'title' => __( 'General info', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_general'\n\t));\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-theme',\n\t\t'title' => __( 'Theme integration', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_theme'\n\t));\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-quick',\n\t\t'title' => __( 'Quick Start', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_quick'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-gallery',\n\t\t'title' => __( 'Gallery Method', DFCG_DOMAIN ),\n\t\t'callback' => \"dfcg_help_gallery\"\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-images',\n\t\t'title' => __( 'Image Management', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_images'\n\t));\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-desc',\n\t\t'title' => __( 'Descriptions', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_desc'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-css',\n\t\t'title' => __( 'Gallery CSS', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_css'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-scripts',\n\t\t'title' => __( 'Load Scripts', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_scripts'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-troubleshooting',\n\t\t'title' => __( 'Troubleshooting', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_trouble'\n\t));\n}", "function bp_ning_import_bp_init() {\n\trequire( dirname( __FILE__ ) . '/bp-functions.php' );\n}", "function wpcrfb_admin_init(){\n\t$options = get_option('wpcr_options');\n\tif (empty($options['facebook_apisecret']) || empty($options['facebook_apiappid'])) {\n\t\t//add_action('admin_notices', create_function( '', \"echo '<div class=\\\"error\\\"><p>\".sprintf(__('Flowline Customer Reviews - Facebook Connect needs configuration information on its <a href=\"%s\">settings</a> page.', 'sfc'), admin_url('options-general.php?page=wpcr_options')).\"</p></div>';\" ) );\n\t} else {\n\t\twpcr_featureloader();\n\t\tadd_action('admin_footer','wpcr_add_base_js',20);\n\t}\n}", "function widgets_init_now() {\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Текст вверху шапки'\n\t\t\t,'id' => 'header_top'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Несколько виджетов будут расположены в строчку. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок для виджета рассылки в подвале'\n\t\t\t,'id' => 'footer_mailings'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок контактов в подвале'\n\t\t\t,'id' => 'footer_contacts'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Подробнее о системе обучения в Linguamore'\n\t\t\t,'id' => 'homepage_education-feats'\n\t\t\t,'description' => 'Блок, расположенный на странице \"Преимущества\". Добавьте сюда виджет \"Rich Text\" из левой части страницы. Иконки можно добавить кнопкой \"Add Media\". Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t}", "private function register_hooks()\n {\n // Conditional\n add_shortcode('dr_conditional_devices', array($this, 'diviroids_conditional_devices'));\n add_shortcode('dr_conditional_roles', array($this, 'diviroids_conditional_roles'));\n\n // Add the menu/links shortcodes\n add_shortcode('dr_menu', array($this, 'diviroids_menu'));\n add_shortcode('dr_permalink', array($this, 'diviroids_permalink'));\n\n // Add the module shortcodes\n add_shortcode('dr_module', array($this, 'diviroids_module'));\n\n // Add the user shortcodes\n add_shortcode('dr_user_login', array($this, 'diviroids_user_login'));\n add_shortcode('dr_user_id', array($this, 'diviroids_user_id'));\n add_shortcode('dr_user_email', array($this, 'diviroids_user_email'));\n add_shortcode('dr_user_level', array($this, 'diviroids_user_level'));\n add_shortcode('dr_user_firstname', array($this, 'diviroids_user_firstname'));\n add_shortcode('dr_user_lastname', array($this, 'diviroids_user_lastname'));\n add_shortcode('dr_user_displayname', array($this, 'diviroids_user_displayname'));\n add_shortcode('dr_user_roles', array($this, 'diviroids_user_roles'));\n add_shortcode('dr_user_bio', array($this, 'diviroids_user_bio'));\n add_shortcode('dr_user_avatar', array($this, 'diviroids_user_avatar'));\n }", "function elhero_sidebar()\r\n{\r\n register_sidebar( array(\r\n 'name' => 'MainSidebar',\r\n 'id' => 'main-sidebar',\r\n 'description' => 'appear evry were',\r\n 'class' => 'main_sidebar',\r\n 'before_widget' => '<div class=\"widget-content\">',\r\n 'after_widget' => '</div>',\r\n 'before_title' => '<h3 class=\"widget-title\">',\r\n 'after_title' => '</h3>'\r\n ));\r\n}", "function cbp_display_front_page() {\n\t?>\n\t\t<h2>Chibipaint Integration</h2>\n\t\t<h3>Introduction</h3>\n\t\t<p>This plugin's purpose is to integrate the Chibipaint applet with Wordpress. The code was largely rewritten from the previous version back in 2010. Some of the notable differences are:</p>\n\t\t<ul class=\"ul-disc\">\n\t\t<li>Visibility &amp; Accessibility: Where you had to access the applet via the upload media section, it is now placed in a &quot;metabox&quot; above the WYSIWYG editor of any post type of your choosing</li>\n\t\t<li>Choice of location: You can choose where to place the files you save, but you are restricted to within the upload folder.</li>\n\t\t</ul>\n\t\t<p>If you feel I've missed any, feel free to let me know. The applet itself can be found at http://www.chibipaint.com/.</p>\n\t\t<h3>Known Limitations</h3>\n\t\t<ul class=\"ul-disc\">\n\t\t<li>Currently, you can only change the default dimensions. There are plans to allow users to add dimensions they commonly use and to pick them from a drop down list at the editor.</li>\n\t\t<li>There is currently no implementation of templates. The closest thing to it now is to upload an image to the post, select it in the list of images and click on Edit. There are also plans to implement a template feature for the plugin.</li>\n\t\t<li>The plugin cannot do a recursive search for wp-config.php.</li>\n\t\t<li>This plugin has not been tested with a multiuser wordpress install. It's certain it will not work since there are no filtering based on author, nor is the author of the image saved with the attachment.</li>\n\t\t<li>If the user saves the source file, all edits will be based on the source file. This is particularly troublesome for those who decide to save image only later on.</li>\n\t\t</ul>\n\t<?php\n}", "function arphabet_widgets_init() {\r\n\r\n\tregister_sidebar( array(\r\n\t\t'name' => 'left sidebar',\r\n\t\t'id' => 'left_1',\r\n\t\t'before_widget' => '<div id=\"genres_box\">',\r\n\t\t'after_widget' => '</div>',\r\n\t\t'before_title' => '',\r\n\t\t'after_title' => '',\r\n\t) );\r\n\r\n}", "private function hooks() {\n\n\t\t$plugin_admin = shortbuild_bu_hooks();\n add_filter( 'advanced_import_demo_lists', array( $plugin_admin, 'add_demo_lists' ), 10, 1 );\n add_filter( 'admin_menu', array( $plugin_admin, 'import_menu' ), 10, 1 );\n add_filter( 'wp_ajax_shortbuild_bu_getting_started', array( $plugin_admin, 'install_advanced_import' ), 10, 1 );\n add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_styles' ), 10, 1 );\n add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_scripts' ), 10, 1 );\n\n /*Replace terms and post ids*/\n add_action( 'advanced_import_replace_term_ids', array( $plugin_admin, 'replace_term_ids' ), 20 );\n }", "function register_my_sidebar(){\n \n register_sidebar( array(\n\t\t\"name\" => \"Sidebar widget\",\n \"id\" => \"sidebar1\", \n ));\n\n}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "function Wfc_Developer_Dashboard_Widget(){\n wp_add_dashboard_widget( \"wfc_developer_dashboard\", __( \"WFC Dashboard Widget\" ), \"wfc_developer_dashboard\" );\n }", "function our_widget_inits(){\n\tregister_sidebar(array(\n\t\t'name' => 'Sidebar',\n\t\t'id' => 'sidebar1',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s widget_area\">',\n\t\t'after_widget' => \"</div>\",\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n\tregister_sidebar(array(\n\t\t'name' => 'Footer area 1',\n\t\t'id' => 'footer1',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n\tregister_sidebar(array(\n\t\t'name' => 'Footer area 2',\n\t\t'id' => 'footer2',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n\tregister_sidebar(array(\n\t\t'name' => 'Footer area 3',\n\t\t'id' => 'footer3',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n}", "function dfcg_help_general() {\n?>\n\t<h3><?php _e( 'Dynamic Content Gallery - Quick Help', DFCG_DOMAIN ); ?></h3>\n\t\n\t<p><?php _e( 'This Quick Help provides basic tips, accessed via the menu on the left, to help you understand how the plugin works and how to set up the Settings page. Additionally, detailed guides to Documentation, Configuration and other resources can be found via the DCG Resources links in the sidebar ---->', DFCG_DOMAIN ); ?></p>\n\t\n\t<p><strong><?php _e( \"Inline Help: \", DFCG_DOMAIN ); ?></strong><?php _e( \"Many options in the Settings page have a helpful 'Tip' pop-up wherever you see this symbol:\", DFCG_DOMAIN ); ?> <img class=\"inline\" src=\"<?php echo DFCG_LIB_URL . '/admin-css-js/cluetip/images/help.png'; ?>\" alt=\"\" /></p>\n\t\n\n\t<h4><?php _e( 'Understanding the basics', DFCG_DOMAIN ); ?></h4>\n\t\n\t<p><?php _e( 'Each image in the DCG gallery is associated with a Post or a Page. The selection of posts/Pages is made in the Gallery Method tab. The Image Management options determine how the plugin selects the image for each Post/Page, either using the Featured Image or a manually chosen image URL entered in the in-post DCG Metabox.', DFCG_DOMAIN ); ?></p>\n\t\n\t<h4><?php _e( 'Please support future development!', DFCG_DOMAIN ); ?></h4>\n\t\n\t<p><?php _e( 'If you have found this plugin useful and wish to help support its future development, please consider making a donation via the link in the righthand sidebar. Thank you.', DFCG_DOMAIN ); ?></p>\n\n<?php\n}", "function init_setup() {\n require get_template_directory() . '/includes/navwalker.php';\n require get_template_directory() . '/includes/widget.php';\n require get_template_directory() . '/includes/options.php';\n require get_template_directory() . '/includes/plugin.php';\n add_filter('show_admin_bar', '__return_false');\n /**\n * Make theme available for translation.\n * Translations can be placed in the /languages/ directory.\n */\n load_theme_textdomain( 'initializr', get_template_directory() . '/languages' );\n \n /**\n * Add default posts and comments RSS feed links to <head>.\n */\n add_theme_support( 'automatic-feed-links' );\n \n /**\n * Enable support for post thumbnails and featured images.\n */\n add_theme_support( 'post-thumbnails' );\n \n /**\n * Add support for two custom navigation menus.\n */\n register_nav_menus( array(\n 'primary' => __( 'Primary Menu', 'initializr' ),\n 'secondary' => __('Secondary Menu', 'initializr' )\n ) );\n \n /**\n * Enable support for the following post formats:\n * aside, gallery, quote, image, and video\n */\n add_theme_support( 'post-formats', array ( 'aside', 'gallery', 'quote', 'image', 'video' ) );\n }", "function responsive_il_register_widgets() {\n\tregister_sidebar( array(\n\t\t'name' => 'Home half widget',\n\t\t'id' => 'main-half-sidebar',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => 'Footer bottom text area',\n\t\t'id' => 'footer-bottom',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => 'Single footer',\n\t\t'id' => 'single-footer-bottom',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => 'Single Top head',\n\t\t'id' => 'single-top-head',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n}", "function init_custom_widgets() {\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-top',\n\t\t'name' => __('Sidebar top', 'bonestheme'),\n\t\t'description' => __('Top sidebar area, present on all pages (default: Main Menu)', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-projects',\n\t\t'name' => __('Projects sidebar', 'bonestheme'),\n\t\t'description' => __('Active on single project pages only (default: Related People, Grants & Publications)', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-people',\n\t\t'name' => __('People sidebar', 'bonestheme'),\n\t\t'description' => __('Active on single people pages only.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-homepage',\n\t\t'name' => __('Homepage sidebar', 'bonestheme'),\n\t\t'description' => __('Active on homepage, lower side bar area.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-homepage-content',\n\t\t'name' => __('Homepage main', 'bonestheme'),\n\t\t'description' => __('Active on homepage, below main content area.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>'\n\t));\n\t\n\t\n\n\t/* Custom widget's */\n\t\n\tregister_widget( 'All_People_Widget' );\n\tregister_widget( 'Related_People_Widget' );\n\n\tregister_widget( 'All_Projects_Widget' );\n\tregister_widget( 'Related_Projects_Widget' );\n\tregister_widget( 'Related_Grants_Widget' );\n\tregister_widget( 'Related_Publications_Widget' );\n\n}", "function tom_Register_Widgets()\n{\n $settings = array(\n 'name' => 'Home Top Left',\n 'id' => 'home_top_left',\n 'before_widget' => '<div class=\"widget\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n );\n\n // different widget areas which I want to register.\n $widgets = array(\n 'Home Top Left'\n ,'Home Bottom Left'\n ,'Home Top Middle'\n ,'Home Bottom Middle'\n ,'Home Top Right'\n ,'Home Bottom Right'\n );\n\n // whizz through and register all the widget areas.\n foreach($widgets as $w)\n {\n $name = $w;\n $id = str_replace(' ','_',strtolower($w));\n $settings['name'] = $name;\n $settings['id'] = $id;\n register_sidebar($settings);\n } \n}", "function arphabet_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Page Sidebar',\n\t\t'id' => 'page-sidebar',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n\n}", "function hotpro_load_widget() {register_widget( 'data_hotpro_widget' );}", "function dfcg_help_sidebar() {\n\n\t$sidebar = '<h3>'.__( 'DCG Resources', DFCG_DOMAIN ) . '</h3>';\n\t\n\t$sidebar .= 'Version: ' . DFCG_VER;\n\t\n\t$sidebar .= '<ul>';\n\t$sidebar .= '<li><a target=\"_blank\" href=\"'.DFCG_HOME .'quick-start-guide/\">'. __( 'Quick Start', DFCG_DOMAIN ) .'</a></li>'; \n\t$sidebar .= '<li><a target=\"_blank\" href=\"'.DFCG_HOME .'configuration-guide/\">'. __( 'Configuration Guide', DFCG_DOMAIN ) . '</a></li>';\n\t$sidebar .= '<li><a target=\"_blank\" href=\"'.DFCG_HOME .'documentation/\">'. __( 'Documentation', DFCG_DOMAIN ) . '</a></li>';\n\t$sidebar .= '<li><a target=\"_blank\" href=\"'.DFCG_HOME .'faq/\">'. __( 'FAQ', DFCG_DOMAIN ) . '</a></li>';\n\t$sidebar .= '<li><a target=\"_blank\" href=\"'.DFCG_HOME .'error-messages/\">'. __( 'Error Messages', DFCG_DOMAIN ) . '</a></li>';\n\t$sidebar .= '<li><a target=\"_blank\" href=\"'.DFCG_HOME .'changelog/\">'. __( 'Change Log', DFCG_DOMAIN ) . '</a></li>';\n\t$sidebar .= '<li><a target=\"_blank\" href=\"http://www.studiograsshopper.ch/forum/\">'. __( 'Support Forum', DFCG_DOMAIN ) . '</a></li>';\n\t$sidebar .= '</ul>';\n\t\n\t\n\t$sidebar .= '<ul>';\n\t$sidebar .= '<li><a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=10131319\">';\n\t$sidebar .= __( 'Donate', DFCG_DOMAIN ) . '</a></li>';\n\t$sidebar .= '</ul>';\n\n\treturn $sidebar;\n}", "function add_widget_sidebar()\r\n{\r\n register_sidebar(\r\n array(\r\n 'name' => 'Sidebar',\r\n 'id' => 'main-sidebar',\r\n )\r\n );\r\n register_sidebar(\r\n array(\r\n 'name' => 'Sidebar du footer',\r\n 'id' => 'footer-sidebar',\r\n )\r\n );\r\n}", "function inhabitent_widget() {\nregister_sidebar(array(\n'name' => 'Sidebar Info',\n'id' => 'sidebar-info',\n'description' => 'Add a text block with your business hours',\n// 'before_widget' => '<aside id=\"%1$s\">',\n'before_widget' => '<aside>',\n'after_widget' => '</aside>',\n'before_title' => '<h2 class=\"widget-title\">',\n'after_title' => '</h2>'\n));\n\n// We registered a sidebar into the WP backend....so we could put widgets into it.\t\nregister_sidebar(array(\n\t'name' => 'Footer Info',\n\t'id' => 'footer-info',\n\t'description' => 'Add a text block for your footer',\n\t'before_widget' => '<aside class=\"%1$s\">',\n\t'after_widget' => '</aside>',\n\t'before_title' => '<h2 class=\"widget-title\">',\n\t'after_title' => '</h2>'\n\t));\n\n}", "public function myScripts()\n {\n //wp_register_script('angularjs',plugins_url('bower_components/angular/angular.min.js', __FILE__));\n wp_enqueue_style('grimagecss', plugins_url('style.css', __FILE__));\n //wp_enqueue_script('grimagescripts',plugins_url('/app.js',__FILE__));\n }", "function safed_widgets_init() {\n \n register_sidebar( array(\n 'name' => __( 'Widget Banner 1', 'safed' ),\n 'id' => 'banner_area_1',\n 'description' => __( 'Appears with [banner_one]', 'safed' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s safed__dynamic-module\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n \n register_sidebar( array(\n 'name' =>__( 'Widget Banner 2', 'safed'),\n 'id' => 'banner_area_2',\n 'description' => __( 'Appears with [banner_two]', 'safed' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s safed__dynamic-module\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n }", "function genesisawesome_custom_widgets() {\n\n\t/* Unregister Header Right widget area */\n\tunregister_sidebar( 'header-right' );\n\n\t/* Register Custom Widgets */\n\tregister_widget( 'GA_Facebook_Likebox_Widget' );\n\tregister_widget( 'GA_Flickr_Widget' );\n\n}", "function register_widget_sections() {\n register_sidebar(array(\n 'name' => __('Widget section one', 'rebootpress'),\n 'id' => 'widgetsleft',\n 'description' => __('left hand sidebar', 'rebootpress'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget clearfix %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4>',\n 'after_title' => '</h4>',\n ));\n\n register_sidebar(array(\n 'name' => __('Widget section two', 'rebootpress'),\n 'id' => 'widgetsright',\n 'description' => __('right hand sidebar (bottom on small screens)', 'rebootpress'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget clearfix %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4>',\n 'after_title' => '</h4>',\n ));\n\n register_sidebar(array(\n 'name' => __('Widget section three', 'rebootpress'),\n 'id' => 'widgetsfooter',\n 'description' => __('Widgets in the footer', 'rebootpress'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget clearfix %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4>',\n 'after_title' => '</h4>',\n ));\n}", "function bp_widgets_init() {\n // register_sidebar( array(\n // 'name' => __( 'Footer Widget Area', 'holstein' ),\n // 'id' => 'footer-widget',\n // 'description' => __( 'Appears on the bottom of every page.', 'holstein' ),\n // 'before_widget' => '<div class=\"col\">',\n // 'after_widget' => '</div>',\n // 'before_title' => '<h2>',\n // 'after_title' => '</h2>'\n // ) );\n\n register_sidebar( array(\n 'name' => __( 'Right Sidebar Widget Area', 'bp' ),\n 'id' => 'right-sidebar',\n 'description' => __( 'Appears on the right side of the blog index.', 'bp' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>'\n ) );\n\n // register_sidebar( array(\n // 'name' => __( 'Left Sidebar Widget Area', 'holstein' ),\n // 'id' => 'left-sidebar',\n // 'description' => __( 'Appears on the left side of pages', 'holstein' ),\n // 'before_widget' => '<div id=\"%1$s\" class=\"area %2$s\">',\n // 'after_widget' => '</div>',\n // 'before_title' => '<h3>',\n // 'after_title' => '</h3>'\n // ) ); \n}", "public function gallery_admin_init() \n\t\t{\n\t\t\tif(function_exists( 'wp_enqueue_media' ))\n\t\t\t{\n\t\t\t\twp_enqueue_media();\n\t\t\t}\n\t\t\t//wp_enqueue_script( 'custom-header' );\n\n\t\t\twp_enqueue_script('jquery');\n\t\t\twp_enqueue_script('jquery-ui-dialog');\n\t\t\twp_enqueue_script('jquery-ui-sortable');\n \n\t\t\twp_enqueue_script( 'wp-color-picker' );\n\t\t\twp_enqueue_style( 'wp-color-picker' );\n\n\t\t\twp_enqueue_script('media-upload');\n\t\t\twp_enqueue_script('thickbox');\n\n\t\t\twp_register_script('futurico', WP_PLUGIN_URL.'/mikado/admin/scripts/SCF.ui.js', array('jquery'));\n\t\t\twp_enqueue_script('futurico');\n\n\t\t\twp_register_style('futurico', WP_PLUGIN_URL.'/mikado/admin/bundle.css', array('colors'));\n\t\t\twp_enqueue_style('futurico');\n\n\t\t\twp_register_script('mikado', WP_PLUGIN_URL.'/mikado/admin/scripts/mikado-admin.js', array('jquery','media-upload','thickbox'));\n\t\t\twp_enqueue_script('mikado');\n\t\t\t\t\t\t\n\t\t\twp_enqueue_style('thickbox');\t\t\n\n\t\t\t$tg_db_version = '2.4';\n\t\t\t$installed_ver = get_option( \"Mikado_db_version\" );\n\t\t\t\n\t\t\tif($installed_ver != $tg_db_version )\n\t\t\t{\n\t\t\t\tmikado_create_db_tables();\n\t\t\t\tupdate_option( \"Mikado_db_version\", $tg_db_version );\n\t\t\t}\t\t\t\n\t\t}", "function register() {\n\tadd_action( 'admin_menu', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\add_menu' );\n\tadd_action( 'admin_init', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\action_handler' );\n\tadd_action( 'admin_enqueue_scripts', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\register_style' );\n\n\t\\Sgdd\\Admin\\SettingsPages\\Basic\\register();\n\t\\Sgdd\\Admin\\SettingsPages\\Advanced\\register();\n\t\\Sgdd\\Admin\\Editor\\register();\n}", "function setup() {\n\t$n = function( $function ) {\n\t\treturn __NAMESPACE__ . \"\\\\$function\";\n\t};\n\n\tadd_action( 'after_setup_theme', $n( 'i18n' ) );\n\tadd_action( 'wp_enqueue_scripts', $n( 'scripts' ) );\n\tadd_action( 'wp_enqueue_scripts', $n( 'styles' ) );\n\tadd_action( 'wp_head', $n( 'header_meta' ) );\n\tadd_action( 'after_setup_theme', $n( 'additive_navmenus' ) );\n\tadd_action( 'widgets_init', $n( 'additive_widgets_init' ));\n add_action( 'init', $n( 'register_fablabs_post_type' ) );\n\n add_filter( 'post_gallery', \t\t\t$n('additive_gallery'), 10, 3);\n\t/*\n\t * Switch default core markup for search form, comment form, and comments\n\t * to output valid HTML5.\n\t */\n\tadd_theme_support( 'html5', array(\n\t\t'search-form',\n\t\t'gallery',\n\t\t'caption',\n\t) );\n\n\t/*\n\t * Enable support for Post Formats.\n\t *\n\t * See: https://codex.wordpress.org/Post_Formats\n\t */\n\tadd_theme_support( 'post-formats', array(\n\t\t'aside',\n\t\t'image',\n\t\t'video',\n\t\t'quote',\n\t\t'link',\n\t\t'gallery',\n\t\t'status',\n\t\t'audio',\n\t\t'chat',\n\t) );\n\n\tadd_theme_support('post-thumbnails', array('post', 'page', 'additive_fab_lab'));\n\n}", "function register_sidebar_locations() {\n register_sidebar(\n array(\n 'id' => 'primary-sidebar',\n 'name' => __( 'Primary Sidebar' ),\n 'description' => __( 'A short description of the sidebar.' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n )\n );\n /* Repeat register_sidebar() code for additional sidebars. */\n // dit zijn zones die we aanmaken.\n register_sidebar(\n array(\n 'id' => 'secondary-sidebar',\n 'name' => __( 'Secondary Sidebar' ),\n 'description' => __( 'A short description of the sidebar.' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n )\n );\n}", "function ourWidgetsInit() {\n // register widget location\n register_sidebar( array(\n 'name' => 'Sidebarr',\n 'id' => 'sidebar1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"a-special-class\">',\n 'after_title' => '</h2>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 1',\n 'id' => 'footer1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 2',\n 'id' => 'footer2',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 3',\n 'id' => 'footer3',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 4',\n 'id' => 'footer4',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n}", "function kcsite_widgets_init() {\t\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Left sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-l',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Right sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-r',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\n/*\n\t\tregister_sidebar( array(\n\t\t\t'name' => __('Banners Before Footer', 'kcsite'),\n\t\t\t'id' => 'sidebar-banners-before-footer',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s help-inline\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t//'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t//'after_title' => '</h3>',\n\t\t) );*/\n\t}", "function add_dashboard_widgets() {\n\twp_add_dashboard_widget('dashboard_widget', 'Al-Zwaid FrameWork', 'dashboard_widget_function');\n}", "function bethel_register_widget_areas() {\n\tunregister_sidebar( 'header-right' ); // Remove the right header widget area\n\tgenesis_register_sidebar (array ('id' => 'header-right-top', 'name' => 'Header Right Top', 'description' => 'The upper widget to the right of the header image.'));\t\n\tgenesis_register_sidebar (array ('id' => 'footer-bottom', 'name' => 'Footer Bottom', 'description' => 'Full-width widget at the very bottom of the page.'));\t\n}", "private function define_admin_hooks() {\n\n add_action('init', array($this, 'image_sizes'), 10, 0);\n add_action('admin_init', array($this, 'get_to_demo_data'), 10);\n\n add_action('admin_enqueue_scripts', array($this, 'admin_style_scripts'));\n add_action('wp_enqueue_scripts', array($this, 'front_style_scripts'), 95);\n\n add_action('add_meta_boxes', 'careerfy_page_header_meta_boxes');\n add_action('add_meta_boxes', 'careerfy_page_subheader_meta_boxes');\n add_action('add_meta_boxes', 'careerfy_page_view_meta_boxes');\n add_action('add_meta_boxes', 'careerfy_page_title_meta_boxes');\n add_action('add_meta_boxes', 'careerfy_page_layout_meta_boxes');\n add_action('add_meta_boxes', 'careerfy_post_layout_meta_boxes');\n add_action('add_meta_boxes', 'careerfy_post_settings_meta_boxes');\n }", "function qrd_add_dashboard_widgets() {\n\twp_add_dashboard_widget('qrp_dashboard_widget', 'Quick REST Draft', 'qrd_widget_function');\n}" ]
[ "0.6554261", "0.64796937", "0.64610046", "0.6446723", "0.64322674", "0.64263237", "0.64066166", "0.63405055", "0.631174", "0.6304861", "0.62895435", "0.6231687", "0.6229031", "0.6224907", "0.62158155", "0.6206004", "0.61945254", "0.61765057", "0.6173613", "0.6168758", "0.6163442", "0.61614156", "0.6155862", "0.6155503", "0.61433893", "0.61394703", "0.6138943", "0.61345774", "0.61322594", "0.61246884", "0.6118602", "0.6118173", "0.61109966", "0.6109561", "0.6106967", "0.6103828", "0.6091653", "0.60868204", "0.6085769", "0.6083923", "0.60818946", "0.6080107", "0.60749936", "0.60666865", "0.6062367", "0.60582256", "0.60576904", "0.60567117", "0.60557514", "0.605437", "0.60401326", "0.60369307", "0.60329103", "0.60324866", "0.6030558", "0.6029798", "0.6026981", "0.60240674", "0.6021666", "0.602073", "0.60155034", "0.6013101", "0.60112363", "0.60107714", "0.6007766", "0.6004158", "0.60021836", "0.5999652", "0.59991795", "0.59960973", "0.59924394", "0.59921163", "0.5985153", "0.5985153", "0.5983583", "0.5983449", "0.59817195", "0.59747595", "0.59734744", "0.5968627", "0.5965448", "0.596543", "0.59622604", "0.5958839", "0.59581333", "0.59558684", "0.5952958", "0.59489995", "0.59432435", "0.59422624", "0.5941106", "0.59358805", "0.593195", "0.59299594", "0.5929517", "0.59290403", "0.59279597", "0.59275585", "0.5916077", "0.5915575", "0.59154266" ]
0.0
-1
this function is for mapping the data
public function map($params){ $this->id = (array_key_exists('id',$params)) ? $params['id'] :0; $this->email = (array_key_exists('email',$params)) ? $params['email'] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function map($data);", "public function getDataMapper() {}", "protected abstract function map();", "abstract protected function mapData($data, $tableObject);", "abstract protected function report_to_array_mapping();", "public function map() {\n\n $item = $this->item;\n $map = [];\n\n $map['id_inmueble'] = $item['id'];\n $map['referencia'] = $item['reference'];\n\n //Opcional Agency data\n $map['id_sucursal'] = ''; //site id?\n $map['propietario'] = '';\n $map['email_sucursal'] = '';\n $map['email_comercializadora'] = $this->config['email'];\n //Opcional\n\n $map['venta_01'] = $this->isSale() ? 1 : 0;\n $map['alquiler_01'] = $this->isRent() ? 1 : 0;\n $map['alquiler_opcion_venta_01'] = 0;\n $map['traspaso_01'] = $this->isTransfer() ? 1 : 0;\n $map['alquiler_temporada_01'] = 0;\n\n $map['precio_venta'] = $this->isSale() ? $item['price'] : 0;\n $map['precio_alquiler'] = $this->isRent() ? $item['price'] : 0;\n $map['precio_alquiler_opcion_compra'] = 0;\n $map['precio_traspaso'] = $this->isTransfer() ? $item['price'] : 0;\n $map['precio_alquiler_temporada'] = 0;\n\n list($tip_inm, $tipo, $tip_inm2, $subtipo) = $this->getTipos();\n $map['tipo'] = $tipo;\n $map['tip_inm'] = $tip_inm;\n $map['subtipo'] = $subtipo;\n $map['tip_inm2'] = $tip_inm2;\n\n list($provincia, $cod_prov) = $this->getProvincia();\n $map['provincia'] = $provincia;\n $map['cod_prov'] = $cod_prov;\n\n list($poblacion, $cod_pob) = $this->getPoblacion();\n $map['localidad'] = $poblacion;\n $map['cod_pob'] = $cod_pob;\n\n $map['ubicacion'] = $item['location']['address'];\n $map['cp'] = self::h($item['location']['zipcode']);\n\n list($zona, $cod_zona) = $this->getZone();\n $map['cod_zona'] = self::h($cod_zona);\n\n $map['banos'] = self::h($item['baths']);\n $map['aseos'] = self::h($item['toilettes']);\n $map['habitaciones'] = self::h($item['rooms']);\n\n $map['m2construidos'] = $item['size'] ? $this->convertSize($item['size']) : '';\n $map['m2utiles'] = $item['size_real'] ? $this->convertSize($item['size_real']) : '';\n $map['m2terraza'] = '';\n $map['m2jardin'] = '';\n $map['m2salon'] = '';\n\n $map['destacado'] = self::h($item['title'][$this->iso_lang]);\n $map['descripcion'] = self::h($item['description'][$this->iso_lang]);\n $map['calidades'] = '';\n $map['urbanizacion'] = '';\n $map['estadococina'] = '';\n $map['numeroplanta'] = '';\n $map['anoconstruccion'] = self::h($item['construction_year']);\n $map['gastoscomunidad'] = '';\n\n $map['garaje_01'] = self::b($item['features']['garage']);\n $map['terraza_01'] = self::b($item['features']['terrace']);\n $map['ascensor_01'] = self::b($item['features']['elevator']);\n $map['trastero_01'] = '';\n $map['piscina_01'] = self::b($item['features']['pool']);\n $map['buhardilla_01'] = '';\n $map['lavadero_01'] = '';\n $map['jardin_01'] = self::b($item['features']['garden']);\n $map['piscinacom_01'] = '';\n $map['eqdeportivos_01'] = '';\n $map['vistasalmar_01'] = '';\n $map['vistasalamontana_01'] = '';\n $map['vistasalaciudad_01'] = '';\n $map['cercatransportepub_01'] = '';\n $map['aireacondicionado_01'] = self::b($item['features']['air-conditioning']);\n $map['calefaccion_01'] = self::b($item['features']['heating']);\n $map['chimenea_01'] = '';\n $map['cocina_office'] = '';\n $map['despacho'] = '';\n $map['amueblado'] = self::b($item['features']['furnished']);\n $map['vigilancia'] = '';\n $map['escaparate'] = '';\n\n $map['m2_almacen'] = '';\n $map['m2_fachada'] = '';\n $map['centro_neg'] = '';\n $map['planta_diaf'] = '';\n $map['m2_terreno'] = $item['type'] == 'lot' ? $this->convertSize($item['size']) : '';\n $map['m2_industrial'] = $item['type'] == 'industrial' ? $this->convertSize($item['size']) : '';\n $map['m2_oficinas'] = '';\n $map['m_altura'] = '';\n $map['entrada_camion'] = '';\n $map['vestuarios'] = '';\n $map['edificable'] = '';\n $map['calif_energetica'] = self::h($item['ec']);\n $map['de_banco'] = '';\n\n $map['photos']['photo'] = $this->getImages();\n $map['videos'] = '';\n\n $map['videos_360']['video'] = $this->get_3d_url();\n\n $map['mapa']['latitud'] = self::h($item['location']['lat']);\n $map['mapa']['longitud'] = self::h($item['location']['lng']);\n $map['mapa']['zoom'] = 16; //14 15 16 17\n $map['mapa']['puntero'] = !empty($item['show_address']) && $item['show_address'] ? 1 : 0;\n\n $map['producto_premium'] = 0;\n $map['producto_destacado'] = 0;\n $map['producto_oportunidad'] = 0;\n\n return $map;\n }", "public function map()\n {\n $mappedData = [];\n\n foreach ($this->rawData as $key => $value) {\n if (is_array($value)) {\n foreach ($value as $index => $field) {\n if ($id = getVal($field, ['id'], null)) {\n $mappedData[$index]['id'] = $id;\n }\n\n $mappedData[$index]['transaction'] = $this->template;\n $mappedData[$index]['activity_id'] = getVal($this->rawData, ['activity_id'], null);\n $mappedData[$index]['transaction']['reference'] = getVal($field, ['reference'], null);\n $mappedData[$index]['transaction']['transaction_type'][0]['transaction_type_code'] = getVal($this->rawData, ['type'], null);\n $mappedData[$index]['transaction']['transaction_date'][0]['date'] = getVal($field, ['date'], null);\n $mappedData[$index]['transaction']['value'][0]['amount'] = getVal($field, ['amount'], null);\n $mappedData[$index]['transaction']['value'][0]['currency'] = getVal($field, ['currency'], null);\n $mappedData[$index]['transaction']['value'][0]['date'] = getVal($field, ['date'], null);\n $mappedData[$index]['transaction']['description'][0]['narrative'][0]['narrative'] = getVal($field, ['description'], null);\n $mappedData[$index]['transaction']['receiver_organization'][0]['narrative'][0]['narrative'] = getVal($field, ['organisation'], null);\n }\n }\n }\n\n return $mappedData;\n }", "abstract protected function getMapping();", "abstract protected function getMapping();", "function tagsmap_question2DB($data)\n\t {\n\t //todo:\n\t\t//for test\n\t\treturn $data;\n\t }", "public function getMapping() {}", "public function getDataMapping() {\n return [\n 'firstName' => 'firstName',\n 'lastName' => 'lastName',\n 'email' => 'email',\n 'address' => [\n 'street1' => 'street1',\n 'street2' => 'street2',\n 'city' => 'city',\n 'state' => 'state',\n 'zip' => 'zip'\n ],\n 'phone' => 'phone',\n 'payment' => [\n 'ccNum' => 'cc_number',\n 'exp' => 'cc_expiration',\n ],\n 'quantity' => 'qty',\n 'total' => 'total'\n ];\n }", "public abstract function toMap(): array;", "abstract protected function defineMapping();", "private function prepareResultMap() {\n $resultMap = [];\n foreach ($this->encodings as $encoding) {\n $map = \"_\" . $encoding . \"Map\";\n foreach ($this->$map as $ru => $fo) {\n $resultMap[$ru][] = $fo;\n }\n }\n $this->_resultMap = $resultMap;\n }", "public function mappingAction(){\n $params = $this->_request->getParams();\n $rows = array();\n \n foreach ($params['text00'] as $key => $val) {\n //if (($key > 0) && ($params['tChange'][$key])) {\n if ($params['tChange'][$key]) {\n $rows[$key]['CHANGE'] = $params['tChange'][$key]; // CHANGE \n $rows[$key]['ROW_ID'] = $params['text00'][$key]; // ROW ID\n $rows[$key]['PERIOD_BUDGET'] = $params['budgetperiod']; // PERIOD_BUDGET\n $rows[$key]['HCC_CC'] = $params['text02'][$key];\n $rows[$key]['HCC_COST_CENTER'] = $params['text03'][$key];\n $rows[$key]['HCC_COST_CENTER_HEAD'] = $params['text04'][$key];\n $rows[$key]['HCC_DIVISI'] = $params['text07'][$key];\n $rows[$key]['HCC_DIVISION_HEAD'] = $params['text06'][$key];\n \n //deklarasi var utk inherit module\n //$rows[$key]['key_find'] = $params['text06'][$key]; // BA_CODE\n //$rows[$key]['afd_code'] = $params['text04'][$key]; // AFD\n //$rows[$key]['block_code'] = $params['text05'][$key]; // BLOCK\n //$rows[$key]['src_afd'] = $params['text04'][$key]; // AFD\n //$rows[$key]['src_block'] = $params['text05'][$key]; // BLOCK\n }\n }\n return $rows;\n }", "public function mappingAction(){\n\t\t$params = $this->_request->getParams();\n $rows = array();\n\t\t\n foreach ($params['text00'] as $key => $val) {\n if (($key > 0) && ($params['tChange'][$key])) {\n\t\t\t\t$rows[$key]['CHANGE'] \t= $params['tChange'][$key]; // CHANGE\n\t\t\t\t$rows[$key]['ROW_ID'] \t= $params['text00'][$key]; // ROW ID\n\t\t\t\t$rows[$key]['PERIOD_BUDGET'] = $params['text02'][$key]; // PERIOD_BUDGET\n\t\t\t\t$rows[$key]['BA_CODE'] \t\t= $params['text03'][$key]; // BA_CODE\n\t\t\t\t$rows[$key]['ROTASI'] \t\t= $params['text09'][$key]; // ROTASI\n\t\t\t\t$rows[$key]['DOSIS'] \t= $params['text10'][$key]; // DOSIS\n\t\t\t\t$rows[$key]['PRICE'] \t\t= $params['text12'][$key]; // PRICE\n\t\t\t\t\n\t\t\t\t//deklarasi var utk inherit module\n\t\t\t\t$rows[$key]['key_find'] \t\t= $params['text03'][$key]; // BA_CODE\n }\n }\n\t\treturn $rows;\n\t}", "protected function preprocessData() {}", "public function map()\n {\n foreach ($this->rawData as $key => $value) {\n if (!empty($value) && array_key_exists($key, $this->mappedFields)) {\n $methodName = $this->mappedFields[$key];\n\n if (method_exists($this, $methodName)) {\n $this->resetIndex($this->mappedFields[$key]);\n $this->{$this->mappedFields[$key]}($key, $value, $this->getTemplateOf($key));\n }\n }\n }\n\n return $this->mappedData;\n }", "private function mapSet($data, $response_field) {\n // This method will handle values tagged with set keyword to indicate\n // the a response field expects an array of values. ie:\n // response field [\n // {\n // name 1,\n // age 1\n // },\n // {\n // name 2,\n // age 2\n // } ....\n // ]\n\n $map_data = [];\n\n foreach($data as $set_key => $set_value) {\n $set_ctr = 0;\n\n foreach($set_value as $set_item_value) {\n $map_data[ $set_key ][ $response_field[ $set_ctr ] ] = $set_item_value;\n $set_ctr++;\n }\n }\n\n return $map_data;\n }", "private function prepareDynamicMapping() {\n foreach ($this->getFieldMaping() as $field_mapping) {\n if ($this->isTranslatableField($field_mapping)) {\n\n $default_language_source = NULL;\n foreach ($this->getLanguages() as $language) {\n if ($language == NexteuropaNewsroomHelper::getDefaultLanguageUppercase()) {\n $default_language_source = $this->getXpathString();\n }\n else {\n $this->addNewsroomDefaultValueTamper($default_language_source);\n }\n\n if (!empty($field_mapping['query'])) {\n $this->addTranslatableQuery($field_mapping['query'], $language);\n }\n\n $this->addMapper($field_mapping, $language);\n }\n\n }\n else {\n $this->addTampers($field_mapping);\n if (!empty($field_mapping['query'])) {\n $this->addQuery($field_mapping['query']);\n }\n\n $this->addMapper($field_mapping);\n }\n }\n\n }", "static public function getDataMap()\n {\n return array(\n 'fields' => array(\n 'channel_code' => array(\n 'type' => 'string',\n ),\n 'time' => array(\n 'type' => 'date',\n ),\n ),\n 'references' => array(\n\n ),\n 'embeddeds' => array(\n\n ),\n 'relations' => array(\n\n ),\n );\n }", "function unit_map_function(&$data, $maps) {\n // idia symbash/paradoxh me to attendance_gradebook_activities_map_function()\n // des to ekei comment gia ta spasmena FKs\n list($document_map, $link_category_map, $link_map, $ebook_map, $section_map, $subsection_map, $video_map, $videolink_map, $video_category_map, $lp_learnPath_map, $wiki_map, $assignments_map, $exercise_map, $forum_map, $forum_topic_map, $poll_map) = $maps;\n if ($data['type'] == 'videolinks') {\n $data['type'] == 'videolink';\n }\n if (isset($data['course_weekly_view_id'])) {\n $data['unit_id'] = $data['course_weekly_view_id'];\n unset($data['unit_id']);\n }\n $type = $data['type'];\n if ($type == 'doc') {\n $data['res_id'] = @$document_map[$data['res_id']];\n } elseif ($type == 'linkcategory') {\n $data['res_id'] = @$link_category_map[$data['res_id']];\n } elseif ($type == 'link') {\n $data['res_id'] = @$link_map[$data['res_id']];\n } elseif ($type == 'ebook') {\n $data['res_id'] = @$ebook_map[$data['res_id']];\n } elseif ($type == 'section') {\n $data['res_id'] = @$section_map[$data['res_id']];\n } elseif ($type == 'subsection') {\n $data['res_id'] = @$subsection_map[$data['res_id']];\n } elseif ($type == 'description') {\n $data['res_id'] = intval($data['res_id']);\n } elseif ($type == 'video') {\n $data['res_id'] = @$video_map[$data['res_id']];\n } elseif ($type == 'videolink') {\n $data['res_id'] = @$videolink_map[$data['res_id']];\n } elseif ($type == 'videolinkcategory') {\n $data['res_id'] = @$video_category_map[$data['res_id']];\n } elseif ($type == 'lp') {\n $data['res_id'] = @$lp_learnPath_map[$data['res_id']];\n } elseif ($type == 'wiki') {\n $data['res_id'] = @$wiki_map[$data['res_id']];\n } elseif ($type == 'work') {\n if (isset($assignments_map[$data['res_id']])) {\n $data['res_id'] = @$assignments_map[$data['res_id']];\n } else {\n $data['res_id'] = $assignments_map[0];\n }\n } elseif ($type == 'exercise') {\n if (isset($exercise_map[$data['res_id']])) {\n $data['res_id'] = @$exercise_map[$data['res_id']];\n } else {\n $data['res_id'] = $exercise_map[0];\n }\n } elseif ($type == 'forum') {\n $data['res_id'] = @$forum_map[$data['res_id']];\n } elseif ($type == 'topic') {\n $data['res_id'] = @$forum_topic_map[$data['res_id']];\n } elseif ($type == 'poll') {\n $data['res_id'] = @$poll_map[$data['res_id']];\n }\n return true;\n}", "public function mapData(array $params, $entity);", "function _map_post_data_for_model()\n\t{\n\t\t// create map the abbreviate post data to database\n\t\t$post_data_map = array(\n 'id'\t=> 'device_id',\n 'h'\t\t=> 'heading',\n 'la'\t=> 'latitude',\n 'lo' \t=> 'longitude',\n 's' \t=> 'speed',\n 't' \t=> 'timestamp',\n \t);\n \t\n\t\t// create new array with full column names as keys to to be passed in\n\t\t// to model\n \t$event = array();\n \tforeach ($post_data_map as $key => $value) {\n \t\t$post_value = $this->input->post($key);\n\t\t\t\n\t\t\t// break and return NULL if any value is blank\n\t\t\tif (!isset($post_value) or $post_value == '') {\n\t\t\t\treturn NULL;\n\t\t\t} else {\n\t \t\t$event[$value] = $post_value;\n\t\t\t}\n\t\t}\n\t\treturn $event;\n\t}", "public function reverseMap()\n {\n $mappedData = [];\n\n foreach ($this->rawData as $index => $field) {\n $mappedData[$index]['id'] = getVal($field, ['id'], '');\n $mappedData[$index]['reference'] = getVal($field, ['transaction', 'reference'], '');\n $mappedData[$index]['date'] = getVal($field, ['transaction', 'transaction_date', 0, 'date'], '');\n $mappedData[$index]['amount'] = getVal($field, ['transaction', 'value', 0, 'amount'], '');\n $mappedData[$index]['currency'] = getVal($field, ['transaction', 'value', 0, 'currency'], '');\n $mappedData[$index]['description'] = getVal($field, ['transaction', 'description', 0, 'narrative', 0, 'narrative'], '');\n $mappedData[$index]['organisation'] = getVal($field, ['transaction', 'receiver_organization', 0, 'narrative', 0, 'narrative'], '');\n }\n\n return $mappedData;\n }", "public function reverseMap()\n {\n foreach ((array) $this->rawData as $index => $documentLink) {\n $documentCategory = $this->getDocumentCategory(getVal($documentLink, ['document_link', 'category', 0, 'code']), true);\n if (!$documentCategory) {\n return $this->mappedData;\n }\n\n if (!array_key_exists($documentCategory, $this->mappedData)) {\n $index = 0;\n }\n\n $this->mappedData[$documentCategory][$index]['document_title'] = getVal($documentLink, ['document_link', 'title', 0, 'narrative', 0, 'narrative']);\n $this->mappedData[$documentCategory][$index]['document_url'] = getVal($documentLink, ['document_link', 'url']);\n $this->mappedData[$documentCategory][$index]['document_link_id'] = getVal($documentLink, ['id']);\n }\n\n return $this->mappedData;\n }", "private function setupMapping()\n {\n $this->mapping = array();\n $fields = array();\n\n $aliases = array_keys($this->getJoinSettings());\n\n foreach ($aliases as $i => $alias) {\n $fields = array_merge($fields, $this->mapAlias($alias));\n }\n\n $this->mapping['fields'] = array_replace_recursive($fields, $this->getCustomMapping());\n $this->mapping['joins'] = $this->getJoinSettings();\n }", "static public function getDataMap()\n {\n return array(\n 'fields' => array(\n 'rev' => array(\n 'type' => 'integer',\n ),\n 'cover' => array(\n 'type' => 'string',\n ),\n 'wiki_id' => array(\n 'type' => 'integer',\n ),\n 'title' => array(\n 'type' => 'string',\n ),\n 'html_cache' => array(\n 'type' => 'string',\n ),\n 'content' => array(\n 'type' => 'string',\n ),\n 'tags' => array(\n 'type' => 'raw',\n ),\n 'comment_tags' => array(\n 'type' => 'raw',\n ),\n 'model' => array(\n 'type' => 'string',\n ),\n 'has_video' => array(\n 'type' => 'integer',\n ),\n 'like_num' => array(\n 'type' => 'integer',\n ),\n 'dislike_num' => array(\n 'type' => 'integer',\n ),\n 'watched_num' => array(\n 'type' => 'integer',\n ),\n 'admin_id' => array(\n 'type' => 'integer',\n ),\n 'do_date' => array(\n 'type' => 'date',\n ),\n 'source' => array(\n 'type' => 'raw',\n ),\n 'tvsou_id' => array(\n 'type' => 'string',\n ),\n 'first_letter' => array(\n 'type' => 'string',\n ),\n 'douban_id' => array(\n 'type' => 'string',\n ),\n 'verify' => array(\n 'type' => 'integer',\n ),\n 'created_at' => array(\n 'type' => 'date',\n ),\n 'updated_at' => array(\n 'type' => 'date',\n ),\n ),\n 'references' => array(\n\n ),\n 'embeddeds' => array(\n\n ),\n 'relations' => array(\n\n ),\n );\n }", "function input_mapping(array $mapping, $data)\n{\n $translated = array();\n\n foreach ($mapping as $from => $to) {\n if (array_key_exists($from, $data))\n {\n $translated[$to] = strlen(trim($data[$from])) > 0 ? trim($data[$from]) : null;\n }\n }\n\n return $translated;\n}", "public function mapDataToResponseField($data, $response_field) {\n $map_data = [];\n // Index, all top level keys from response field.\n $fld_index = array_keys($response_field);\n\n // Map data to response field when data array has elements.\n if (is_array($data) && count($data) > 0) {\n foreach($data as $data_ctr => $item) {\n $item = (array) $item;\n // Field counter used to access field index above.\n $fld_ctr = 0;\n\n foreach($item as $key => $value) {\n if (is_array($response_field) && count($response_field) > 0) {\n // Response field is a full array.\n\n // If it is the full count, key full_count, mark it as comment.\n // Comments # will be removed by response class and will only be used\n // for pagination at this point.\n if ($key == 'full_count') {\n $map_data[ $data_ctr ][ '#' . $key ] = $value;\n }\n else {\n if (isset($response_field[ $fld_index[ $fld_ctr ] ]) && $response_field[ $fld_index[ $fld_ctr ] ]) {\n // Data has matching response field item.\n $value_response_field = $response_field[ $fld_index[ $fld_ctr ] ];\n\n if (is_array($value_response_field)) {\n // The response field has items down the line.\n $l1_index = array_keys($value_response_field);\n\n $z = 0;\n foreach($value as $l1_key => $l1_value) {\n if (is_array($l1_value)) {\n // Items and response field in this item.\n $l2_response_field = $value_response_field[ $l1_index[ $z ] ];\n if (is_array($l2_response_field)) {\n $l2_index = array_keys($l2_response_field);\n }\n\n if ($l1_key === 'set') {\n if (is_array($response_field[ $fld_index[ $fld_ctr ] ])) {\n if (is_string($response_field[ $fld_index[ $fld_ctr ] ][ $l1_index[ $z ] ])) {\n $map_data[ $data_ctr ][ $fld_index[ $fld_ctr ] ]\n = $this->mapSet($l1_value, $response_field[ $fld_index[ $fld_ctr ] ]);\n }\n else {\n $map_data[ $data_ctr ][ $fld_index[ $fld_ctr ] ][ $l1_index[ $z ] ]\n = $this->mapSet($l1_value, $response_field[ $fld_index[ $fld_ctr ] ][ $l1_index[ $z ] ]);\n }\n }\n\n // Stay on this response field til all items in the set have been mapped.\n $z++; continue;\n }\n\n $a = 0;\n foreach($l1_value as $l2_key => $l2_value) {\n if (is_array($l2_value)) {\n // Items and response field in this item.\n $l3_response_field = $l2_response_field[ $l2_index[ $a ] ];\n $l3_index = array_keys($l3_response_field);\n\n if ($l2_key === 'set') {\n // Use $a since this key is equals to set.\n $map_data[ $data_ctr ][ $fld_index[ $fld_ctr ] ][ $l1_index[ $z ] ][ $l2_index[ $a ] ]\n = $this->mapSet($l2_value, $l2_response_field[ $l2_index[ $a ] ]);\n // Stay on this response field til all items in the set have been mapped.\n $a++; continue;\n }\n elseif ($l2_key === 'list') {\n // List of values in array..\n $map_data[ $data_ctr ][ $fld_index[ $fld_ctr ] ][ $l2_response_field ] = $l2_value;\n $a++; continue;\n }\n\n $b = 0;\n foreach($l2_value as $l3_key => $l3_value) {\n if (is_array($l3_value)) {\n // Items and response field in this item.\n $l4_response_field = $l3_response_field[ $l3_index[ $b ] ];\n $l4_index = array_keys($l4_response_field);\n\n if ($l3_key === 'set') {\n // Use $a and $b since this key is equals to set.\n $map_data[ $data_ctr ][ $fld_index[ $fld_ctr ] ][ $l1_index[ $z ] ][ $l2_index[ $a ] ][ $l3_index[ $b ] ]\n = $this->mapSet($l2_value, $l3_response_field[ $l3_index[ $b ] ]);\n // Stay on this response field til all items in the set have been mapped.\n $b++; continue;\n }\n elseif ($l3_key == 'list') {\n $map_data[ $data_ctr ][ $fld_index[ $fld_ctr ] ][ $l1_index[ $z ] ][ $l3_response_field ] = $l3_value;\n $b++; continue;\n }\n\n foreach($l3_value as $l4_key => $l4_value) {\n if (!is_array($l4_value)) {\n // $l1_index[ $l1_key ], $l2_index[ $l2_key ] and $l3_index[ $l3_key ] contain non numeric index number.\n $map_data[ $data_ctr ][ $fld_index[ $fld_ctr ] ][ $l1_index[ $z ] ][ $l2_index[ $a ] ][ $l3_index[ $b ] ]\n [ $l4_response_field[ $l4_index[ $l4_key ] ] ] = $l4_value;\n }\n }\n }\n else {\n // $l1_index[ $l1_key ] and $l2_index[ $l2_key ] contain non numeric index number.\n if (isset($l3_response_field[ $l3_index[ $b ] ])) {\n $map_data[ $data_ctr ][ $fld_index[ $fld_ctr ] ][ $l1_index[ $z ] ][ $l2_index[ $a ] ]\n [ $l3_response_field[ $l3_index[ $b ] ] ] = $l3_value;\n }\n }\n\n $b++;\n }\n }\n else {\n // $l1_index[ $l1_key ] contains non numeric index number.\n if (isset($l2_response_field[ $l2_index[ $a ] ])) {\n $map_data[ $data_ctr ][ $fld_index[ $fld_ctr ] ][ $l1_index[ $z ] ]\n [ $l2_response_field[ $l2_index[ $a ] ] ] = $l2_value;\n }\n }\n\n $a++;\n }\n }\n else {\n if (isset($value_response_field[ $l1_index[ $z ] ])) {\n $map_data[ $data_ctr ][ $fld_index[ $fld_ctr ] ][ $value_response_field[ $l1_index[ $z ] ] ] = $l1_value;\n }\n }\n\n $z++;\n }\n }\n else {\n // Flat string field - map response field to value.\n if (is_array($value)) {\n // List is given.\n $value_key = array_keys($value)[0];\n $value = ($value_key == 'list') ? $value['list'] : $value;\n }\n\n $map_data[ $data_ctr ][ $value_response_field ] = $value;\n }\n }\n }\n\n // Next value.\n $fld_ctr++;\n }\n else {\n // An empty array, ie in crops or commoncropnames.\n if ($key == 'full_count') {\n $map_data[ $data_ctr ][ '#' . $key ] = $value;\n }\n else {\n $map_data[ $data_ctr ] = $value;\n }\n }\n }\n }\n }\n\n return $map_data;\n }", "private function setValues()\n {\n foreach($this->data as $type => $values)\n if(!preg_match('/(library)/i', $type))\n foreach($values as $key => $value)\n $this->{strtolower($type)}[$key] = $value;\n }", "protected function _prepareData($data)\n {\n foreach ($this->_mapAttributes as $attributeAlias => $attributeCode) {\n if (isset($data[$attributeAlias])) {\n $data[$attributeCode] = $data[$attributeAlias];\n unset($data[$attributeAlias]);\n }\n }\n return $data;\n }", "public static function extract_mapping( $data ) {\n\t\t$mapping = [];\n\t\tforeach ( $data as $content ) {\n\t\t\t$mapping[ $content['key'] ] = $content['value'];\n\t\t}\n\n\t\treturn $mapping;\n\t}", "public function remapListedDBRecords() {}", "function changeDataKeysId2Name($data){\n\t\t/*\n\t\t$res = array();\n\t\tforeach ($this->OnlyById as $aid=>$attribute) {\n\t\t\tif(!isset($data[$aid])) continue;\n\t\t\t$res[$attribute['name']] = $data[$aid];\n\t\t}\n\t\treturn $res;\n\t\t*/\n\t\t\n\t\t$res = array();\n\t\tforeach ($data as $aid=>$val){\n\t\t\tif(isset($this->OnlyById[$aid])){\n\t\t\t\t$res[$this->OnlyById[$aid]->fieldName] = $val;\n\t\t\t} else {\n\t\t\t\t$res[$aid] = $val;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "abstract protected function _generateDataCollection();", "public function convertToSite($data){\n\t\tforeach($data as $fieldName => $value){\n\n\t\t\tif(isset($this -> convertMap[$fieldName])){\n\n\t\t\t\t$data[$fieldName] = $this -> getSiteId($this -> convertMap[$fieldName], $data[$fieldName]);\n\t\t\t}\n\n\t\t\tif(isset($this -> convertTimeMap[$fieldName])){\n\n\t\t\t\t$data[$fieldName] = $this -> getSiteTime($data[$fieldName]);\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "abstract protected function mapRow(array $row);", "abstract protected function mapRow(array $row);", "public function CreateMap($data){\n $this->name = htmlentities(ucwords(strtolower($data->name)));\n $this->description = htmlentities($data->description);\n $this->lat = htmlentities($data->lat);\n $this->long = htmlentities($data->long);\n $this->type = htmlentities(ucwords($data->type));\n $this->email = htmlentities(strtolower($data->email));\n $this->website = filter_var(strtolower($data->website), FILTER_SANITIZE_URL);\n $this->phone_number = htmlentities(str_replace(\" \", \"\", $data->phone_number));\n\n }", "protected function _buildFeedData() {\n\t\t$items = $this->_getItems();\n\t\t// array_map must be on an array - $items is a collection so need to get the\n\t\t// underlying array to pass to array_map\n\t\treturn array_map(array($this, '_applyMapping'), $items->getItems());\n\t}", "public function convertSaleItemsData();", "function ckan_map($server, $map, $dataset) {\n $type = $server['source_type'];\n\n //an empty new dataset\n $new_dataset = array(\n 'extras' => array(),\n );\n\n foreach ($map as $key => $value) {\n //skip resources fields\n if ($value[1] == 2) {\n continue;\n }\n\n //dataset from some sources (e.g. ckan) has some fields in extras.\n //flatten them to the root level.\n //hopefully no key collisions.\n if (isset($value[2]) && $value[2]) {\n $dataset[$value[0]] = _find_extras_value($dataset, $value[0]);\n }\n\n switch (\"$type:$key\") {\n\n case 'json:tags':\n case 'ckan:tags':\n $new_dataset[$key] = array();\n $tags = $dataset[$value[0]];\n if (is_string($tags)) {\n $tags = str_replace(array(\";\", \"\\r\\n\", \"\\r\", \"\\n\", \"\\t\"), ',', $dataset[$value[0]]);\n $tags = explode(',', $tags);\n }\n foreach ($tags as $tag) {\n $clean_tag = preg_replace('/[^a-zA-Z0-9_-]+/', ' ', $tag);\n $clean_tag = trim($clean_tag);\n $max_length = 100;\n if (strlen($clean_tag) > $max_length) {\n //cut at last space before 100th char.\n $clean_tag = preg_replace('/\\s+?(\\S+)?$/', '', substr($clean_tag, 0, $max_length));\n }\n if (strlen($clean_tag) > 1) {\n $new_dataset[$key][] = array('name' => $clean_tag);\n }\n }\n\n break;\n\n case 'json:temporal':\n $new_date = get_new_date($dataset[$value[0]]);\n $new_dataset[$key] = $new_date?$new_date:\"0000\";\n break;\n\n case 'ckan:temporal':\n $new_date = \"0000\";\n //do our best to get date out of the string, ideally into startdate/enddate\n $date_value = trim($dataset[$value[0]]);\n $ret = guess_new_date($date_value);\n if ($ret) {\n $new_date = $ret;\n }\n else {\n //it is string that php does not understand.\n //let us try to split it to see if it is two date in the format of \"start to end\".\n $split = str_replace(array('to', 'through'), \",\", $date_value);\n $split = explode(',', $split);\n if ($split && count($split) == 2) {\n $start_date = guess_new_date(trim($split[0]));\n $end_date = guess_new_date(trim($split[1]));\n if ($start_date && $end_date) {\n $new_date = $start_date . '/' . $end_date;\n }\n }\n else {\n //try again with splitting \"-\"\n $split = explode('-', $date_value);\n if ($split && count($split) == 2) {\n $start_date = guess_new_date(trim($split[0]));\n $end_date = guess_new_date(trim($split[1]));\n if ($start_date && $end_date) {\n $new_date = $start_date . '/' . $end_date;\n }\n }\n }\n }\n $new_dataset[$key] = $new_date;\n break;\n\n case 'json:release_date':\n $new_dataset[$key] = $new_date;\n if (empty($dataset[$value[0]])) {\n $new_dataset[$key] = '0000';\n }\n break;\n\n case 'json:homepage_url':\n case 'ckan:homepage_url':\n case 'json:system_of_records':\n // must be a valid url or nothing\n $url_value = trim($dataset[$value[0]]);\n if (filter_var($url_value, FILTER_VALIDATE_URL) !== FALSE) {\n $new_dataset[$key] = $url_value;\n }\n break;\n\n case 'json:data_dictionary':\n case 'ckan:data_dictionary':\n // must be a valid url\n $url_value = trim($dataset[$value[0]]);\n if (filter_var($url_value, FILTER_VALIDATE_URL) !== FALSE) {\n $new_dataset[$key] = $url_value;\n }\n else {\n $new_dataset[$key] = \"http://localdomain.local/\";\n }\n break;\n\n case 'json:data_quality':\n // cant left empty\n $quality_value = strtolower(trim($dataset[$value[0]]));\n if (in_array($quality_value, array('off', 'false', 'no', '0'))) {\n $quality_value = false;\n }\n else {\n $quality_value = true;\n }\n $new_dataset[$key] = $quality_value;\n break;\n\n case 'ckan:publisher':\n // TODO for now hard-coded to $dataset.organization.title\n $new_dataset[$key] = trim($dataset['organization']['title']);\n break;\n\n case 'ckan:public_access_level':\n // use default if missing value\n $new_dataset[$key] = trim($dataset[$value[0]])?trim($dataset[$value[0]]):'public';\n break;\n\n default:\n $new_dataset[$key] = $dataset[$value[0]];\n if (is_string($new_dataset[$key])) {\n $new_dataset[$key] = trim($new_dataset[$key]);\n }\n\n }\n }\n\n\n //create necessary new fields:\n // 1. name\n if ($type == 'ckan') {\n $new_dataset['name'] = $dataset['name'];\n }\n else {\n //replace anything weird with \"-\"\n $new_dataset['name'] = preg_replace('/[\\s\\W]+/', '-', strtolower($new_dataset['title']));\n $new_dataset['name'] = substr($new_dataset['name'], 0, 100);\n $new_dataset['name'] = trim($new_dataset['name'], '-');\n }\n // 2. owner_org\n if ($type == 'ckan' && $server['ckan_use_src_org'] && isset($dataset['organization']['name'])) {\n //use src org\n $org_name = $dataset['organization']['name'];\n if (isset($server['ckan_src_org_map'][$org_name]) && strlen($server['ckan_src_org_map'][$org_name]) !== 0) {\n $org_name = $server['ckan_src_org_map'][$org_name];\n }\n $new_dataset['owner_org'] = $org_name;\n }\n else {\n //use default org supplied by command argument\n $new_dataset['owner_org'] = $server['org'];\n }\n\n //clean up work.\n $new_dataset['publisher'] = strlen($new_dataset['publisher'])?$new_dataset['publisher']:\"N/A\";\n $new_dataset['publisher'] = substr($new_dataset['publisher'], 0, 300);\n $new_dataset['contact_name'] = strlen($new_dataset['contact_name'])?$new_dataset['contact_name']:\"N/A\";\n $new_dataset['contact_email'] = (strpos($new_dataset['contact_email'], \"@\")!==false)?$new_dataset['contact_email']:\"NA@localdomain.local\";\n\n //validator can goes here\n //\n\n //not sure what is with this ckan\n //but we have to replicate some keys in both root and extras\n foreach ($map as $key => $value) {\n\n switch ($key) {\n\n case 'publisher':\n case 'contact_email':\n case 'contact_name':\n case 'homepage_url':\n case 'system_of_records':\n case 'related_documents':\n case 'data_dictionary':\n if (isset($new_dataset[$key]) && !empty($new_dataset[$key])) {\n $new_dataset['extras'][] = array(\n 'key' => $key,\n 'value' => $new_dataset[$key],\n );\n }\n break;\n\n case 'accrual_periodicity':\n case 'category':\n case 'language':\n if (isset($new_dataset[$key]) && !empty($new_dataset[$key])) {\n $new_dataset['extras'][] = array(\n 'key' => $key,\n 'value' => $new_dataset[$key],\n );\n }\n //something additional to do. remove not used keys\n unset($new_dataset[$key]);\n break;\n\n default:\n //\n }\n }\n\n return $new_dataset;\n}", "public function getMappings();", "public function getMappings();", "function map_over_data($value,$scad){\r\n $s=WEB_ROOT;\r\n $map_over_data_html='<div class=\"row\">\r\n <div class=\"col-md-4\">\r\n <div class=\"sch-profile-pic\">\r\n <img src=\"'.$s.'assets/frontend/img/sch-profpic1.png\" style=\"width: 114px;height: 114px;\">\r\n </div>\r\n </div>\r\n <div class=\"col-md-8\">\r\n <div class=\"sch-profile-details\">\r\n <h4>'.$value[\"name\"].'</h4>\r\n <h5>Light Goods Vehicle</h5>\r\n <h6>'.$value[\"address\"].'</h6>\r\n </div>\r\n </div>\r\n </div>';\r\n $lat_lng = $scad->getLnt($value[\"zip\"]);\r\n $map_over_data_lat = $lat_lng['lat'];\r\n $map_over_data_lng = $lat_lng['lng'];\r\n $map_over_data_img = $s.'assets/frontend/img/01.png';\r\n\r\n return $map_over_data = [$map_over_data_html,$map_over_data_lat,$map_over_data_lng,$map_over_data_img];\r\n\r\n }", "abstract protected function buildMap();", "function notes_map_function(&$data, $maps) {\n // idia symbash/paradoxh me to attendance_gradebook_activities_map_function()\n // des to ekei comment gia ta spasmena FKs\n list($course_id, $agenda_map, $document_map, $link_map, $video_map,\n $videolink_map, $assignments_map, $exercise_map, $ebook_map,\n $lp_learnPath_map) = $maps;\n $type = $data['reference_obj_type'];\n switch ($type) {\n case 'course':\n $data['reference_obj_id'] = $course_id;\n break;\n case 'course_event':\n if (isset($agenda_map[$data['reference_obj_id']])) {\n $data['reference_obj_id'] = $agenda_map[$data['reference_obj_id']];\n } else {\n $data['reference_obj_id'] = $agenda_map[0];\n }\n break;\n case 'course_document':\n $data['reference_obj_id'] = $document_map[$data['reference_obj_id']];\n break;\n case 'course_link':\n $data['reference_obj_id'] = $link_map[$data['reference_obj_id']];\n break;\n case 'course_video':\n $data['reference_obj_id'] = $video_map[$data['reference_obj_id']];\n break;\n case 'course_videolink':\n $data['reference_obj_id'] = $videolink_map[$data['reference_obj_id']];\n break;\n case 'course_assignment':\n if (isset($assignments_map[$data['reference_obj_id']])) {\n $data['reference_obj_id'] = $assignments_map[$data['reference_obj_id']];\n } else {\n $data['reference_obj_id'] = $assignments_map[0];\n }\n break;\n case 'course_exercise':\n if (isset($exercise_map[$data['reference_obj_id']])) {\n $data['reference_obj_id'] = $exercise_map[$data['reference_obj_id']];\n } else {\n $data['reference_obj_id'] = $exercise_map[0];\n }\n break;\n case 'course_ebook':\n $data['reference_obj_id'] = $ebook_map[$data['reference_obj_id']];\n break;\n case 'course_learningpath':\n $data['reference_obj_id'] = $lp_learnPath_map[$data['reference_obj_id']];\n break;\n case 'course_learningpath':\n $data['reference_obj_id'] = $lp_learnPath_map[$data['reference_obj_id']];\n break;\n default:\n break;\n }\n return true;\n}", "public function getFieldMapping($field_name);", "abstract public function Convert($data);", "public function serialize() {\n\n // pega o mapeamentp\n $mapping = $this->mapping;\n\n // verifica se existe\n if ( !$mapping ) return;\n\n // seta os dados\n $data = [];\n foreach( $mapping as $atributo => $colunaTabela ) {\n $data[$colunaTabela] = $this->$atributo;\n }\n\n // volta os dados\n return $data;\n }", "private function maper(){\n\n\t\t$map = [];\n\n\t\tforeach($this::$tables as $table ){\n\n\t\t\t$tmp = explode(\"_\",$table);\n\n\t\t\tfor($i=0;$i<count($tmp);$i++){\n\n\t\t\t\t$tmp2 = array_slice($tmp,0,$i+1);\n\n\t\t\t\teval ('if(@ $map[\"'.implode('\"][\"',$tmp2).'\"]) true; else $map[\"'.implode('\"][\"',$tmp2).'\"]=[];');\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $map;\n\n\t}", "public function columnMaps();", "public static function mapValues($attendee){\n $mapped_values = array(\n 'event_id' => $attendee->eventId,\n 'order_id' => $attendee->orderId,\n 'attendee_id' => $attendee->attendeeId,\n 'ticket_class_id' => $attendee->ticketClassId,\n 'change_date' => $attendee->changeDate,\n 'create_date' => $attendee->createDate,\n 'email_address' => $attendee->emailAddress,\n 'last_name' => self::no_overflow($attendee->lastName,50),\n 'first_name' => self::no_overflow($attendee->firstName,50),\n 'category' => $attendee->category,\n 'category_nid' => $attendee->categoryNid,\n 'order_type' => $attendee->orderType,\n 'email_sent' => $attendee->emailSent,\n 'email_send_date' => $attendee->emailSendDate,\n 'reg_type' => $attendee->regType,\n 'region_name' => $attendee->regionName,\n 'region_nid' => $attendee->regionNid,\n 'contestant_last_name' => self::no_overflow($attendee->contestantLastName,50),\n 'contestant_first_name' => self::no_overflow($attendee->contestantFirstName,50),\n 'gender' => $attendee->gender,\n 'grade' => $attendee->grade,\n 'school' => self::no_overflow($attendee->school,255),\n 'year_of_birth' => $attendee->yearOfBirth,\n 'month_of_birth' => $attendee->monthOfBirth,\n 'day_of_birth' => $attendee->dayOfBirth,\n 'home_address_line_1' => self::no_overflow($attendee->homeAddressLine1,255),\n 'home_address_line_2' => self::no_overflow($attendee->homeAddressLine2,255),\n 'home_city' => self::no_overflow($attendee->homeCity,100),\n 'home_prov_state' => $attendee->homeProvState,\n 'home_postal_zip' => self::no_overflow($attendee->homePostalZip,20),\n 'home_phone_1' => self::no_overflow($attendee->homePhone1, 20),\n 'home_phone_2' => self::no_overflow($attendee->homePhone2, 20),\n 'email_consent' => $attendee->emailConsent,\n 'additional_info' => self::no_overflow($attendee->additionalInfo,2500),\n 'language' => $attendee->language,\n );\n\n // _eventbrite_sboc_debug_output($attendee);\n if (isset($attendee->passwordResetUrl)){\n $mapped_values['password_reset_url'] = $attendee->passwordResetUrl;\n }\n\n return $mapped_values;\n }", "function _getFieldData($fieldName){\n\n\t\t$SQLquery = \"SELECT `\"\n\t\t\t\t\t.$this->normalized[$fieldName]['tableKey'].\"` AS pkey\".\n\t\t\t\t\t\", `\"\n\t\t\t\t\t.$this->normalized[$fieldName]['tableValue'].\"` AS value \".\n\t\t\t\t\t\"FROM `\"\n\t\t\t\t\t.$this->normalized[$fieldName]['tableName'].\"` \".\n\t\t\t\t\t\"WHERE \"\n\t\t\t\t\t.$this->normalized[$fieldName]['whereClause'].\" \".\n\t\t\t\t\t\"ORDER BY \"\n\t\t\t\t\t.$this->normalized[$fieldName]['orderBy'];\n\n\t\t$retrievedData = $this->db->execute($SQLquery);\n\t\tif($this->db->error != \"\"){\n\t\t\techo \"ERROR: Unable to retrieve normalized data from '\".$this->normalized[$fieldName]['tableName'].\"'\".($this->db_errors?\"<br/>\".$this->db->error:\"\");\n\t\t\treturn false;\n\t\t}\n\t\t$this->normalized[$fieldName]['pairs'] = $numPairs;\n\t\t$i = 0;\n\t\tforeach($retrievedData as $set){\n\n\t\t\t#$set = $retrievedData;\n\t\t\t$this->normalized[$fieldName]['keys'][$i] = $set['pkey'];\n\t\t\t$this->normalized[$fieldName]['values'][$i] = $set['value'];\n\t\t\t$i++;\n\t\t}\n\n\t}", "public function convertToPhone($data){\n\n\t\t// remap site id's to phone id's\n\t\tforeach($data as $fieldName => $value){\n\n\t\t\tif(isset($this -> convertMap[$fieldName])){\n\n\t\t\t\t$data[$fieldName] = $this -> getPhoneId($this -> convertMap[$fieldName], $data[$fieldName]);\n\t\t\t}\n \n\t\t\tif(isset($this -> convertTimeMap[$fieldName])){\n\n\t\t\t\t$data[$fieldName] = $this -> getPhoneTime($data[$fieldName]);\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getDtdMapping();", "public static function mappings()\n {\n $map = [\n 'category' => Category::get()->pluck('name', 'slug')->toArray(),\n 'style' => Style::get()->pluck('name')->toArray(),\n 'technic' => Technic::get()->pluck('name')->toArray(),\n ];\ndd($map);\n\n return $map;\n }", "function mapper($res)\n{\n foreach ($res as $match)\n {\n /*\n * Here goes your business logic\n * BEGIN\n */\n foreach ($match[\"href\"] as $href)\n {\n if (reset(Finder::where(\"data\", \"href = '$href'\")) === false)\n {\n $row = R::dispense(\"data\");\n $row->href = $href;\n R::store($row);\n }\n }\n /*\n * Here ends your business logic\n * END\n */\n }\n}", "abstract protected function mapCode( $code );", "function list_to_map($list, $by_field = 'id'){\r\n $result = array();\r\n if(!is_array($list)) return null;\r\n foreach($list as $item){\r\n $result[$item[$by_field]] = $item;\r\n }\r\n return $result;\r\n}", "abstract protected function data();", "abstract public function prepareData();", "public static function getMap()\n {\n return array(\n 'ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true,\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_ID_FIELD'),\n ),\n 'TIMESTAMP_X' => new Main\\Entity\\DatetimeField('TIMESTAMP_X', array(\n 'default_value' => new Main\\Type\\DateTime(),\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_TIMESTAMP_X_FIELD'),\n )),\n 'LID' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateLid'),\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_LID_FIELD'),\n ),\n 'ACTIVE' => array(\n 'data_type' => 'boolean',\n 'values' => array('N', 'Y'),\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_ACTIVE_FIELD'),\n ),\n 'BONUS' => array(\n 'data_type' => 'float',\n 'required' => true,\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_BONUS_FIELD'),\n ),\n 'USERID' => array(\n 'data_type' => 'integer',\n 'required' => true,\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_USERID_FIELD'),\n ),\n 'ACTIVE_FROM' => array(\n 'data_type' => 'datetime',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_ACTIVE_FROM_FIELD'),\n ),\n 'ACTIVE_TO' => array(\n 'data_type' => 'datetime',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_ACTIVE_TO_FIELD'),\n ),\n 'NAME' => array(\n 'data_type' => 'string',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_NAME_FIELD'),\n ),\n 'PROMOCODE' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validatePromocode'),\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_PROMOCODE_FIELD'),\n ),\n 'DOMAINE' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateDomaine'),\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_DOMAINE_FIELD'),\n ),\n 'URL' => array(\n 'data_type' => 'text',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_URL_FIELD'),\n ),\n 'COMMISIA' => array(\n 'data_type' => 'string',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_COMMISIA_FIELD'),\n ),\n 'COMMISIAPROMO' => array(\n 'data_type' => 'string',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_COMMISIAPROMO_FIELD'),\n ),\n );\n }", "function __construct() {\n\t\t$this->map_data = array();\n\t}", "public static function getMap()\n { \n return array(\n 'ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_ID_FIELD'),\n ),\n 'DATE_CHANGE' => array(\n 'data_type' => 'datetime',\n 'required' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DATE_CHANGE_FIELD'),\n ),\n 'DATE_CREATE' => array(\n 'data_type' => 'datetime',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DATE_CREATE_FIELD'),\n ),\n 'ACTIVE' => array(\n 'data_type' => 'boolean',\n 'values' => array('N', 'Y'),\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_ACTIVE_FIELD'),\n ),\n 'SORT' => array(\n 'data_type' => 'integer',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_SORT_FIELD'),\n ),\n 'NAME' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateName'),\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_NAME_FIELD'),\n ),\n 'DESCRIPTION' => array(\n 'data_type' => 'text',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DESCRIPTION_FIELD'),\n ),\n 'PARENT_CATEGORY_ID' => array(\n 'data_type' => 'integer',\n 'required' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_PARENT_CATEGORY_ID_FIELD'),\n ), \n );\n }", "public function map($item);", "function get_data($map,$forExcel=false) {\n $result=array();\n $list = LangerieCard1Model::getCards();\n if(null!=$list){\n foreach($list as $card){\n $data=LangerieCard1Model::getStatisticsByCard($card['card_id'],$forExcel);\n if(null!=$data){\n $result=array_merge($result,$data);\n }\n }\n }\n return $result;\n }", "function resultSet($results) {\n $this->map = array();\n $numFields = $results->columnCount();\n $index = 0;\n $j = 0;\n\n while ($j < $numFields) {\n $column = $results->getColumnMeta($index);\n if (!empty($column['table'])) {\n $this->map[$index++] = array($column['table'], $column['name']);\n } else {\n if (strpos($column['name'], '__')) {\n $parts = explode('__', $column['name']);\n $this->map[$index++] = array($parts[0], $parts[1]);\n } else {\n $this->map[$index++] = array(0, $column['name']);\n }\n }\n $j++;\n }\n\n }", "protected function mapData(array $mapData)\n {\n foreach ($mapData as $key => $data) {\n if ('documents' === $key && $data) {\n $filter = new Filter();\n /** @var Query $query */\n $query = $this->getQuery();\n $mode = $query->getFilterMode();\n $ratio = $query->getFilterRatio();\n $data = $filter->filterDocuments($data, $mapData['maxscore'], $ratio, $mode);\n }\n $this->{$key} = $data;\n }\n }", "private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }", "protected function mapJson() {\n $post = json_decode(file_get_contents('php://input'), true);\n if(is_null($post)) return;\n foreach($post as $key => $value) {\n $this->data[$key] = $value;\n }\n }", "public function map()\n {\n return [\n 'full' => ['key' => 'address'],\n 'city' => ['key' => 'city'],\n 'state' => ['key' => 'state'],\n 'zip' => ['key' => 'zip'],\n 'country' => ['key' => 'country'],\n ];\n }", "public function transform($data)\n {\n $this->resolveFieldMapping($data, $this->field_map);\n return $data;\n }", "private function prepare_data(){\r\n\t\t\t$this->data_table['cols'] = array();\r\n\t\t\t\r\n\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\tswitch($column_info['type']){\r\n\t\t\t\t\tcase 'number':\r\n\t\t\t\t\tcase 'float':\r\n\t\t\t\t\tcase 'currency':\r\n\t\t\t\t\t\t$column_info['type'] = 'number';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$column_info['type'] = 'string';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['cols'][] = array_merge(array('id' => $column_id), $column_info);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$rows_count = sizeof(reset($this->data));\r\n\t\t\t\r\n\t\t\tfor($i = 0; $i < $rows_count; $i++){\r\n\t\t\t\t$c = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\t\t$value = $this->data[$column_id][$i];\r\n\t\t\t\t\t$c[] = array('v' => $value);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['rows'][] = array('c' => $c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->data_table = json_encode($this->data_table);\r\n\t\t}", "function getDatatypesMapping() {\n return ['Protein' => ['pdb','swissprot','datacitesbgrid'],\n 'Phenotype' => ['clinvar','dbgap','mpd','datacitemorphobank'],\n 'Gene Expression' => ['geo', 'arrayexpress', 'gemma','nursadatasets','lsdb','genenetwork','gtexldacc'],\n 'Nucleotide Sequence' => ['sra','datacitebgi'],\n 'Morphology'=>['neuromorpho'],\n 'Clinical Trials'=>['clinicaltrials','ctn'],\n 'Proteomics Data'=>['peptideatlas','proteomexchange','yped'],\n 'Physiological Signals'=>['physiobank'],\n 'Epigenetic Data'=>['epigenomics'],\n 'Data from Papers'=>['datacitepeerj','ndarpapers'],\n\n 'Omics Data'=>['omicsdi'],\n 'Survey Data'=> ['datacitefdz'],\n 'Cell Signaling'=>['datacitesdscsg'],\n 'Imaging Data'=>['cvrg','neuromorpho','cia','openfmri','cil','bmrb','retina','emdb', 'nitrcir','neurovaultatlases','neurovaultcols','neurovaultnidm','datacitecxidb','datacitembf','datacitecandi'],\n 'Unspecified' => ['lincs','bioproject','dryad','dataverse','niddkcr','icpsr','gdc','rgd','vectorbase','datacitegnd','datacitezenodo',\n 'datacitecrcns','immport','datacitedatabrary','datacitelshtm','datacitejhu',\n 'simtk',\n 'datacitebils',\n 'dataciteada',\n 'dataciteukda',\n 'dataciteadaptive',\n 'datacitemit',\n 'datacitectsi',\n 'datacitenimh',\n 'nsrr','naturedata','datacitethieme','datacitefigshare','dataciteccdc','wormbase','metabolomics'],\n ];\n}", "private function mappingInputData($input_data) {\n $lines = explode(\"\\n\", $input_data);\n $delimiter = $this->store->get('delimiter');\n $headers = str_getcsv(array_shift($lines), $delimiter);\n $header_value_array = [];\n foreach ($headers as $key_header => $header_value) {\n $header_value = $this->changeValueHeader($header_value);\n if (in_array($header_value, $header_value_array)) {\n $headers[$key_header] = $header_value . $key_header;\n $header_value_array[] = $headers[$key_header];\n }\n $header_value_array[] = $header_value;\n if (empty($header_value)) {\n $headers[$key_header] = $key_header;\n }\n }\n $mapping_form_results = [];\n $row = [];\n $data = [];\n foreach ($lines as $key_line => $line) {\n $output = [];\n foreach (str_getcsv($line, $delimiter) as $key => $field) {\n $row[$headers[$key]] = $field;\n if ($key_line < 3) {\n $columns[$headers[$key]][] = $field;\n $mapping_form_results['columns'][$headers[$key]] = [\n '#type' => 'container',\n 'rows_container' =>[\n '#type' => 'container',\n 'title' => [\n '#type' => 'label',\n '#title' => $headers[$key],\n ],\n '#attributes' => [\n 'class' => [\n 'csv-rows'\n ],\n ],\n ],\n '#attributes' => [\n 'class' => [\n 'csv-values-row'\n ],\n ],\n ];\n foreach ($columns[$headers[$key]] as $key_column => $column_value) {\n $output[$headers[$key]][] = '<div class=\"csv-value-record \">' . $column_value . '</div>';\n }\n $mapping_form_results['columns'][$headers[ $key ]]['rows_container'][$headers[ $key ]] = [\n '#markup' => '<div class=\"csv-values\" style=\"height: 100px; overflow: scroll; width: 700px;\">' . implode('',$output[$headers[$key]]) . '</div>',\n ];\n }\n }\n $data[] = $row;\n }\n $mapping_form_results['rows'] = $data;\n \n return $mapping_form_results;\n }", "public function columnMap()\n {\n return array(\n 'diaMesAno' => 'diaMesAno'\n );\n }", "public function getLookupTable() {}", "public function getMap() {\n return [\n 'sku' => 'itemNo',\n 'shortDescription' => 'description',\n 'longDescription' => 'description2',\n 'measurementUnit' => 'unitOfMeasure',\n 'mpn' => 'vendorItemNo',\n 'ean' => 'eanNo',\n ];\n }", "protected function dataMap($line)\n {\n return [\n 'RAILCARD_CODE' => 3,\n 'TICKET_CODE' => 3,\n 'END_DATE' => 8,\n 'START_DATE' => 8,\n 'MINIMUM_FARE' => 8,\n ];\n }", "public function convert($data);", "public function fetchMapped();", "function prepareData(){\n $this->ref = array();\n foreach($this->getIterator() as $junk=>$item){\n // current values\n $id = $item[$this->id_field];\n \n // save item\n $this->items[$id] = $item;\n \n // save relation\n if(isset($item[$this->parent_id_field])) {\n $this->ref[$item[$this->parent_id_field]][] = $id;\n } else {\n $this->ref[undefined][] = $id;\n }\n }\n }", "function get_map($source)\n{\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_json = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('person', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n 'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_datajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_socratajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'upload' => array('upload', 2),\n 'format' => array('format', 2),\n 'name' => array('name', 2),\n 'modified' => array('modified',1),\n );\n\n // 'dest_key' => array('source_key', dest_position, source_position)\n // 0/1/2 denotes root/extras/resources.\n $map_ckan = array(\n 'title' => array('title', 0, 0),\n 'notes' => array('notes', 0, 0),\n // hard-code publisher to orgnization.title in ckan_map for now.\n // todo: change this map structure.\n 'publisher' => array('place-holder', 1, 1),\n 'public_access_level' => array('access-level', 1, 1),\n 'contact_email' => array('contact-email', 1, 1),\n 'contact_name' => array('person', 1, 1),\n 'unique_id' => array('id', 1, 0),\n 'tags' => array('tags', 0, 1),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('data-dictiionary', 1, 1), // there is a typo.\n 'license_title' => array('license_title', 0, 0),\n 'spatial' => array('spatial-text', 1, 1),\n 'temporal' => array('dataset-reference-date', 1, 1),\n 'release_date' => array('issued', 1, 1),\n 'accrual_periodicity' => array('frequency-of-update', 1, 1),\n 'related_documents' => array('references', 1, 1),\n 'language' => array('metadata-language', 1, 1),\n 'homepage_url' => array('url', 1, 0),\n 'url' => array('url', 2, 2),\n 'name' => array('name', 2, 2),\n 'format' => array('format', 2, 2),\n );\n\n $ret_map = \"map_$source\";\n return isset($$ret_map) ? $$ret_map : null;\n}", "abstract public function data2Array($data);", "public function format_verinice_mapping($p_data)\n {\n\n if (is_object($p_data))\n {\n $l_xml = $this->m_xml['header'];\n\n while ($l_data = $p_data->get_row())\n {\n\n $l_xml .= str_replace(\n [\n '%intid%',\n '%extid%'\n ],\n [\n $l_data['isys_verinice_types__const'],\n _L($l_data['isys_obj_type__title'])\n ],\n $this->m_xml['content']\n );\n\n }\n\n return $l_xml . \"\\n\" . $this->m_xml['footer'];\n\n }\n\n throw new Exception('Error: Wrong data format provided');\n }", "function get_fancy_data($data)\n {\n /*\n * Initialize value\n */\n $collection = array();\n $basemodel = NULL;\n $i = 0;\n\n /*\n * Outer loop to run untill the data array end\n */\n foreach ($data as $k => $v) {\n /* Ndoe generator */\n $node = array();\n\n /*\n * Preserver first instance of the row in to a dummy variable\n */\n foreach ($v as $key => $val) {\n if (!is_numeric($key)) {\n $keys = explode(\".\", $key);\n $basemodel = isset($basemodel) ? $basemodel : $keys[0];\n $node[$keys[0]][$keys[1]] = $val;\n }\n }\n\n /*\n * Collect the first node baded model id\n */\n $key_cur = isset($key_cur) ? $key_cur : $v[\"$basemodel.id\"];\n\n /*\n * Set the values in correct place of the the node array\n */\n foreach ($node as $y => $z) {\n if ($y == $basemodel) {\n /* For princilple model it save in to a single array */\n $collection[$v[\"$basemodel.id\"]][$y] = $z;\n }\n else {\n if (implode(\"\", $z) != \"\") {\n /* For relational model it save in to a nulti dymantional array array */\n $collection[$v[\"$basemodel.id\"]][$y][] = $z;\n }\n else if (!isset($collection[$v[\"$basemodel.id\"]][$y])) {\n /* Create an empty array of no data found in a relational model */\n $collection[$v[\"$basemodel.id\"]][$y] = array();\n }\n }\n }\n\n /*\n * Reset the array index in a normal sequence\n */\n if ($key_cur != $v[\"$basemodel.id\"]) {\n $collection[$i++] = $collection[$key_cur];\n unset($collection[$key_cur]);\n $key_cur = $v[\"$basemodel.id\"];\n }\n }\n\n /* Reset the last node of the array */\n $collection[$i] = $collection[$key_cur];\n unset($collection[$key_cur]);\n\n return $collection;\n }", "public function columnMap()\n {\n //the values their names in the application\n return array(\n 'id' => 'code' ,\n 'the_name' => 'theName' ,\n 'the_type' => 'theType' ,\n 'the_year' => 'theYear'\n );\n }", "function map_title( $ra ){\n\t\t# otherwise you must reference by number, this is not a good pattern\n\t\t$ra['title'] = trim($ra[0]);\n\t\t$ra['year'] = trim($ra[1]);\n\t\t$ra['score'] = trim($ra[2]);\n\t\t$ra['total_reviews'] = trim($ra[3]);\n\t\treturn $ra;\n\t}", "protected function _setupMapperArray()\n\t{\n\t\t$this->mapperArray = array();\n\t\t\n\t\t$this->mapperArray['property_id'] = 'properties_id';\n\t\t$this->mapperArray['sort_order'] = 'sort_order';\n\t\t\n\t\t$this->mapperArray['name'] = 'properties_name';\n\t\t$this->mapperArray['admin_name'] = 'properties_admin_name';\n\t}", "protected function resolveFieldsMap()\n {\n $list = unserialize(Mage::helper('lapostaconnect')->config('map_fields'));\n\n if ($list === false) {\n return array();\n }\n\n $result = array();\n\n foreach ($list as $mapping) {\n $result[$mapping['magento']] = $mapping['laposta'];\n }\n\n return $result;\n }", "public function mapForExcel(Collection $collection)\n {\n return $collection->map(function ($item) {\n return [\n 'No' => @$item->id,\n 'Year' => @$item->year,\n 'Month' => $this->changeMonthFormat(@$item->month),\n 'Nip' => $this->exist(@$item['ba'], @$item['ba']['nik']),\n 'No Ktp' => $this->exist(@$item['ba'], @$item['ba']['no_ktp'] . ''),\n 'Provinsi' => @$item->store->city->province_name,\n 'Nama Ba' => $this->exist(@$item['ba'], @$item['ba']['name'], 'vacant'),\n 'No Hp' => $this->exist(@$item['ba'], @$item['ba']['no_hp']),\n 'Kota' => @$item->store->city->city_name,\n 'Cabang Arina' => $this->exist(@$item['ba'], @$item['ba']['arinaBrand']['cabang']),\n 'Nama Reo' => @$item['store']['reo']['user']['name'],\n 'Region' => @$item->store->region->name,\n 'Brand' => @$item->brand->name,\n 'Store_no' => @$item->store->store_no,\n 'Customer Id' => @$item->store->customer_id,\n 'Store Name 1' => @$item->store->store_name_1,\n 'Store Name 2' => @$item->store->store_name_2,\n 'Channel' => @$item->store->channel,\n 'Account' => @$item->store->account->name,\n 'Status' => $this->exist(@$item['ba'], @$item['ba']['status']),\n 'Join Date' => $this->exist(@$item['ba'], $this->readableDateFormat(@$item['ba']['join_date'])),\n 'Join Date MDS' => $this->exist(@$item['ba'], $this->joinDateMdsCheck(@$item['ba'])),\n 'Size Baju' => $this->exist(@$item['ba'], @$item['ba']['uniform_size']),\n 'Keterangan' => $this->defineStore(@$item),\n 'Masa Kerja' => (isset($item['ba'])) ? $this->exactTime(Carbon::now()->diff(new \\DateTime(@$item['ba']['join_date']))) : '-',\n 'Class' => $this->exist(@$item['ba'], @$item['ba']['class']),\n 'Jenis Kelamin' => $this->exist(@$item['ba'], @$item['ba']['genders']),\n 'Status Sp' => ($item['ba']['sp_approval'] == 'approve' && isset($item['ba'])) ? @$item['ba']['status_sp'] : '',\n 'Tanggal Sp' => ($item['ba']['sp_approval'] == 'approve' && isset($item['ba'])) ? $this->readableDateFormat(@$item['ba']['tanggal_sp']) : '',\n 'Hc' => ($item->store_count > 0) ? round(1 / $item->store_count, 2) : '-'\n ];\n });\n }", "abstract protected function initializeMappedTypes();", "public function exchangeArray(array $data, $mapping = false);", "public function get_arr_maps() {\r\n $arr = $this->app->model('article_indexs')->getList('*');\r\n $tmp = array();\r\n \r\n foreach( (array)$arr as $row ) {\r\n $tmp[] = array(\r\n 'url' => app::get('site')->router()->gen_url(array('app'=>'content', 'ctl'=>'site_article', 'act'=>'index', 'arg0'=>$row['article_id'], 'full'=>true) ),\r\n );\r\n }\r\n \r\n return $tmp;\r\n }", "public function generateMap()\n {\n $map = array();\n $database = $this->binding->getDatabase()->getData();\n\n foreach ($database->classes as $class) {\n $map[$class->name] = $class->clusters;\n }\n\n $this->map = $map;\n $this->cache->save($this->getCacheKey(), $map);\n }", "function loadData()\n\t{\n\t\tstatic $data;\n\t\t\n\t\tif(!$data)\n\t\t\t$data=self::getData();\n\n\t\tif(isset($data[$this->id]))\n\t\t\t$this->setValues((array)$data[$this->id]);\t\t\t\n\t}", "protected function _createCidToGidMap() {}" ]
[ "0.7506752", "0.71862614", "0.6888021", "0.6850152", "0.676118", "0.6727401", "0.66506976", "0.66424996", "0.66424996", "0.64254", "0.634845", "0.6303544", "0.6301133", "0.6295634", "0.6223065", "0.61932737", "0.615266", "0.6151758", "0.6136325", "0.6101523", "0.60634005", "0.6048249", "0.60313183", "0.6020457", "0.5946236", "0.594163", "0.5906044", "0.5902604", "0.5891735", "0.5826126", "0.5823027", "0.5810928", "0.57984185", "0.5782867", "0.5720421", "0.57177675", "0.5685301", "0.5666063", "0.5665597", "0.5665597", "0.5635606", "0.562498", "0.5621475", "0.5617745", "0.5615269", "0.5615269", "0.5600857", "0.5592642", "0.55906177", "0.5577602", "0.5571094", "0.5571021", "0.55559963", "0.55450225", "0.5521699", "0.55135673", "0.5503913", "0.54920566", "0.54834235", "0.54772675", "0.5462166", "0.54612607", "0.5457476", "0.545297", "0.5450732", "0.54472876", "0.54458183", "0.5432347", "0.54216564", "0.5418392", "0.541828", "0.54067385", "0.5403708", "0.5395349", "0.53945833", "0.53856933", "0.53840023", "0.5376544", "0.5366323", "0.53558886", "0.53501076", "0.53281003", "0.53239536", "0.5317582", "0.531612", "0.53152883", "0.53124636", "0.5306421", "0.5300409", "0.5273432", "0.5271274", "0.5269158", "0.5268647", "0.5263518", "0.5257492", "0.5256707", "0.5254027", "0.52522415", "0.52495444", "0.5248688" ]
0.53092325
87
end of function to get all location records
function get_all_records(){ global $db; $sql="SELECT * FROM $this->table order by id asc"; $db->query($sql); $row=$db->fetch_assoc_all(); return $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAllLocations() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM locations;'));\r\n\r\n\t}", "public function all_locations() {\n\t\t// Globals\n\t\tglobal $wpdb;\n\t\t\n\t\t// Load the location from the db\n\t\t$sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_locations` ORDER BY `location` ASC;\";\n\t\t$sqlret = $wpdb->get_results( $sql, ARRAY_A );\n\t\t\n\t\t// Set the return array\n\t\t$return = new StdClass();\n\t\t\n\t\t// Loop through each result and process\n\t\tforeach( $sqlret as $location ) {\n\t\t\t// Group IDs are stored as an array. Make sure it is actually an array.\n\t\t\t$location['groups'] = rpids_unserialize( $location['groups'] );\n\t\t\t\n\t\t\t// Add location info to an array\n\t\t\t$return->$location['id'] = new StdClass();\n\t\t\t$return->$location['id']->id = $location['id'];\n\t\t\t$return->$location['id']->name = $location['location'];\n\t\t\t$return->$location['id']->groups = (object) $location['groups'];\n\t\t\t$return->$location['id']->weather_id = $location['weather_id'];\n\t\t\t$return->$location['id']->layout_id = $location['layout_id'];\n\t\t}\n\t\t\n\t\t// Return everything as an object\n\t\treturn $return;\n\t}", "public function getall()\r\n {\r\n $locations = array();\r\n $count = 0;\r\n \r\n foreach($this->all() as $location)\r\n {\r\n $location = (array)$location;\r\n \r\n $locations[] = array('id' => $location['id'], 'name' => $location['name'],\r\n 'caption' => $location['caption'], 'description' => $location['description'],\r\n 'address' => $location['address'],\r\n 'contact' => $location['contact'],\r\n 'image1' => $location['image1'], 'image2' => $location['image2'],\r\n 'image3' => $location['image3'], 'image4' => $location['image4']);\r\n $count++;\r\n \r\n }\r\n \r\n if ($count > 0)\r\n {\r\n return $locations;\r\n }\r\n else\r\n {\r\n return null;\r\n } \r\n }", "public function getAllLocations()\n\t{\n\t\t$sCacheId = $this->cache()->set('gmap.locations');\n\t\n\t\tif (!($aRows = $this->cache()->get($sCacheId)))\n\t\t{\n\t\t\t$aRows = $this->database()->select('f.*, u.full_name, u.user_name, u.country_iso')\n\t\t\t\t->from(Phpfox::getT('gmap'), 'f')\t\t\n\t\t\t\t->join(Phpfox::getT('user'), 'u', 'u.user_id = f.user_id')\t\n\t\t\t\t->where('f.not_found = \\'0\\'')\n\t\t\t\t->execute('getSlaveRows');\n\t\t\t\t\n\t\t\t$this->cache()->save($sCacheId, $aRows);\n\t\t}\n\t\t\n\t\t$aOutput = array();\n\t\t\n\t\tif($aRows != null && is_array($aRows))\n\t\tforeach($aRows as $aRow)\n\t\t{\n\t\t\t$aOutput[$aRow['country_iso']][] = $aRow;\n\t\t}\n\t\treturn $aOutput;\n\t}", "public function getLocations(){\n $table = new Yourdelivery_Model_DbTable_Locations();\n $locationRows = $table->fetchAll(sprintf('companyId = %d AND deleted = 0' , $this->getId()));\n\n $locations = new SplObjectStorage();\n foreach($locationRows as $locationRow){\n try{\n $loc = new Yourdelivery_Model_Location($locationRow['id']);\n $locations->attach($loc);\n }catch(Yourdelivery_Exception_Database_Inconsistency $e){\n $this->logger->err(sprintf('Could not create location #', $locationRow['id']));\n continue;\n }\n }\n return $locations;\n }", "function GetLocations(){\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare(\"SELECT location_id, name FROM location\");\n\t$query->execute();\n\t$result = $query->fetchAll(); //Fetching it\n\treturn $result;\n}", "public function getAddresses() {\n $table = new Yourdelivery_Model_DbTable_Locations();\n return $table->fetchAll('companyId = ' . $this->getId());\n }", "public function get_locations() {\n $this->db->select('*');\n $this->db->from('locations');\n $query = $this->db->get();\n $query_result = $query->result();\n\n return $query_result;\n }", "public function get_locations()\n {\n $this->db->select('location_id,area');\n $query = $this->db->get($this->location);\n if ($query->num_rows() > 0) \n {\n return $query->result_array();\n }\n else\n {\n return FALSE;\n } \n \n }", "function get_locations() {\n $conn = database_connection();\n $sql = \"SELECT LOCATION_ID,INSTITUTION_ID ,LOCATION_NAME FROM CMS_GEM_CORE_MANAGEMNT.LOCATIONS WHERE IS_RECORD_DELETED = 'F'\"; //select data or insert data\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n\n// while ($row = oci_fetch_assoc($query)) {\n// //print_r($row);\n// echo $row['LOCATION_ID'];\n// echo $row['INSTITUTION_ID'];\n// echo $row['LOCATION_NAME'];\n// echo \"-----<br>\";\n// foreach ($row as $item) { //echo $item;\n// }\n// }\n// \n// exit;\n\n\n\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n echo '<li><a href=\"#\" class=\"location\" location-id=\"' . $row['LOCATION_ID'] . '\">' . $row['LOCATION_NAME'] . '</a></li>';\n// $temp['loc_id']= $row['LOCATION_ID'];\n// $temp['inst_id']= $row['INSTITUTION_ID'];\n// $temp['loc_name']= $row['LOCATION_NAME'];\n //foreach ($row as $item) {\n //echo \"<li>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \"&nbsp;\") . \"</li>\";\n// if ($item !== null)\n// return $item;\n //}\n $result_arr[] = $temp;\n }\n\n\n return $result_arr;\n}", "public function getListLoc()\n {\n $db = $this->dblocal;\n try\n {\n $stmt = $db->prepare(\"SELECT @rownum := @rownum + 1 AS urutan,t.* FROM m_location t, \n (SELECT @rownum := 0) r ORDER BY id_loc ASC\");\n $stmt->execute();\n $stat[0] = true;\n $stat[1] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $stat;\n }\n catch(PDOException $ex)\n {\n $stat[0] = false;\n $stat[1] = $ex->getMessage();\n return $stat;\n }\n }", "public function getLocations(): array\n {\n $arrLocations = array();\n $objLocations = ContaoEstateManager\\ProviderModel::findAll();\n\n if ($objLocations === null)\n {\n return $arrLocations;\n }\n\n while ($objLocations->next())\n {\n $arrLocations[ $objLocations->id ] = $objLocations->postleitzahl . ' ' . $objLocations->ort . ' (' . $objLocations->firma . ')';\n }\n\n return $arrLocations;\n }", "public function getAll()\n {\n return $this->apiRequest('application/locations');\n }", "function getAll () {\n \\trigger_error(\"Deprecated.\", \\E_USER_ERROR);\n global $pdo;\n $sql = \"select a6_locations.*, \"\n . \"a6_people.person_name, \"\n . \"a6_people.provider_number, \"\n . \"a6_subject.subject_label \"\n . \"FROM a6_locations \"\n . \"JOIN a6_people on a6_locations.locationID = a6_people.locationID \"\n . \"JOIN a6_people_subject ON a6_people.personID = a6_people_subject.personID \"\n . \"JOIN a6_subject ON a6_people_subject.subjectID = a6_subject.subjectID \"\n . \"ORDER BY locationID DESC\";\n return $pdo->query($sql);\n }", "public function getAllLocations() {\n\t\t$query = $this->db->select(\"\n\t\t\tRoom.RoomID,\n\t\t\tRoomAbbr,\n\t\t\tRoomName,\n\t\t\tBuildingAbbr,\n\t\t\tRoom.IsApproved,\n\t\t\tBuilding.MapURL,\n\t\t\tOperators\")->\n\t\tfrom('Room')->\n\t\tjoin('Building', 'Building.BuildingID = Room.BuildingID')->\n\t\tjoin(\"\n\t\t\t(SELECT r.RoomID, GROUP_CONCAT(CONCAT(UserFname, ' ', UserLname)) AS Operators\n\t\t\tFROM User u\n\t\t\t\tJOIN UserRole ur ON u.UserID = ur.UserID\n\t\t\t\tJOIN UserRoom urm ON ur.UserRoleID = urm.UserRoleID\n\t\t\t\tJOIN Room r ON r.RoomID = urm.RoomID\n\t\t\tGROUP BY r.RoomID) AS other\", 'other.RoomID = Room.RoomID', 'left')->\n\t\tget();\n\n\t\treturn $query->result_array();\n\t}", "function location_detail($location_id, $connection, $start = 0)\n{\n\t$db_selected = mysql_select_db(Secure::DB_DATABASE, $connection);\n\t$sql = \"select organization_location.address , organization_location.city , organization_location.state , organization_location.zip , organization_location.latitude , organization_location.longitude from organization_location where location_id = {$location_id}\";\n\t$sql = $sql.\" limit {$start},\".LIMIT;\n\tif(!($resource = @ mysql_query($sql, $connection)))\n\t\tshowerror();\n\t\t//echo $sql;\n\telse\n\t\treturn $resource;\n}", "public function findAll()\n {\n return $this->em\n ->getRepository('App:Location')\n ->findAll()\n ;\n }", "public function locations()\n {\n $data = $this->request('POST', 'api/v1/date/locations');\n return $data;\n }", "public function location_list(){\n\t\t$data = array();\n\t\t$data['status'] = 1;\n\t\t\n\t\t$offset = (int)$this->input->get('offset',0);\n\t\t$limit = (int)$this->input->get('limit',0);\n\t\t$user_id = $this->input->get('user_id');\n\t\t\n\t\t$notifications = $this->location_model->get_location_list($user_id,$offset,$limit);\n\t\t\n\t\t$data['data']['locations'] = $notifications;\n\t\t$this->json_response($data);\n\t}", "function getAllLeaflets(){\n\t\t//$queryEbsLeaflets = db_select('ebs_leaflets_final_static', 'elf')\n\t\t$queryEbsLeaflets = db_select('ebs_leaflets_final', 'elf')\n\t\t->fields('elf');\n\t\t//->condition('leaflet_code', 'L16302');//Plastering\n\t\t//->range(0,10);\n\t\t$results = $queryEbsLeaflets->execute();\n\t\t//dsm($results->rowCount());\n\t\t\n\t\tforeach ($results as $row) :\n\t\t\t$this->leaflets[$row->leaflet_code] = $row;\n\t\tendforeach;\n\t\t\n\t}", "public function getLocationList($return_active_only = TRUE);", "public function locations($params)\r\n {\r\n \t$_query = array('page' => isset($params['page']) ? $params['page'] : 1);\r\n\r\n return $this->curl_execute($method = 'locations', $_query);\r\n }", "public function main_locations(){\n $locations = Location::whereNull('parent_id')->get();\n }", "public function getAllRecords();", "function locationsAction() {\n\t $this->_helper->layout->disableLayout();\n\t $this->_helper->viewRenderer->setNoRender(TRUE);\n\t $conn = Doctrine_Manager::connection(); \n \t$session = SessionWrapper::getInstance();\n \t$formvalues = $this->_getAllParams();\n \t// debugMessage($formvalues);\n \t// debugMessage($this->_getAllParams());\n \t\n \t \t$feed = '';\n \t$hasall = true;\n \t$issearch = false;\n \t$iscount = false;\n \t$ispaged = false;\n \t$where_query = \" \";\n \t$type_query = \" \";\n \t$group_query = \" GROUP BY l.id \";\n \t$limit_query = \"\";\n \t$select_query = \" l.id, l.name as `Location`, l.locationtype as `Type`,\n \t\tCASE `locationtype` \n \t\t\tWHEN '1' THEN 'Region' \n \t\t\tWHEN '2' THEN 'District' \n \t\t\tWHEN '3' THEN 'County' \n \t\t\tWHEN '4' THEN 'SubCounty' \n \t\t\tWHEN '5' THEN 'Parish' \n \t\t\tWHEN '6' THEN 'Village' \n \t\tEND AS `TypeName` \";\n \t$join_query = \"\";\n \t\n \tif(isArrayKeyAnEmptyString('filter', $formvalues)){\n \t\techo \"NO_FILTER_SPECIFIED\";\n \t\texit();\n \t}\n \t\n \t$isregion = false; $isdistrict = false; $iscounty = false; $issubcounty = false; $isparish = false; $isvillage = false;\n \t$loc_type = '';\n \t# fetch commodities filtered by categoryid\n \tif($formvalues['filter'] == 'type'){\n \t\tswitch ($this->_getParam('category')) {\n \t\t\tcase 'region':\n \t\t\tcase 1:\n \t\t\t\t$where_query .= \" AND l.locationtype = 1 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$isregion = true;\n \t\t\t\tbreak;\n \t\t\tcase 'district':\n \t\t\tcase 2:\n \t\t\t\t$where_query .= \" AND l.locationtype = 2 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$isdistrict = true;\n\t\t\t \tif(!isArrayKeyAnEmptyString('regionid', $formvalues) || !isArrayKeyAnEmptyString('region', $formvalues)){\n\t\t\t \t\t\t$region = new Region();\n\t\t\t \t\t\tif(!isArrayKeyAnEmptyString('regionid', $formvalues)){\n\t\t\t\t \t\t$region->populate($formvalues['regionid']);\n\t\t\t\t \t\t// debugMessage(region->toArray());\n\t\t\t\t \t\tif(isEmptyString($region->getID()) || !is_numeric($formvalues['regionid'])){\n\t\t\t\t \t\t\techo \"REGION_INVALID\";\n\t\t\t\t \t\t\texit();\n\t\t\t\t \t\t}\n\t\t\t\t \t\t$regid = $formvalues['regionid'];\n\t\t\t \t\t\t}\n\t\t\t \t\tif(!isEmptyString($this->_getParam('region'))){\n\t\t\t \t\t\t\t$regid = $region->findByName($formvalues['region'], 1);\n\t\t\t \t\t\tif(isEmptyString($regid)){\n\t\t\t\t \t\t\techo \"REGION_INVALID\";\n\t\t\t\t \t\t\texit();\n\t\t\t\t \t\t}\n\t\t\t \t\t\t}\n\t\t\t \t\t$where_query .= \" AND l.regionid = '\".$regid.\"' \";\n\t\t\t \t}\n \t\t\t\tbreak;\n \t\t\tcase 'county':\n \t\t\tcase 3:\n \t\t\t\t$where_query .= \" AND l.locationtype = 3 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$iscounty = true;\n\t\t\t \tif(!isArrayKeyAnEmptyString('districtid', $formvalues) || !isArrayKeyAnEmptyString('district', $formvalues)){\n\t\t\t \t\t\t$district = new District();\n\t\t\t \t\t\tif(!isArrayKeyAnEmptyString('districtid', $formvalues)){\n\t\t\t\t \t\t$district->populate($formvalues['districtid']);\n\t\t\t\t \t\t// debugMessage($market->toArray());\n\t\t\t\t \t\tif(isEmptyString($district->getID()) || !is_numeric($formvalues['districtid'])){\n\t\t\t\t \t\t\techo \"DISTRICT_INVALID\";\n\t\t\t\t \t\t\texit();\n\t\t\t\t \t\t}\n\t\t\t\t \t\t$distid = $formvalues['districtid'];\n\t\t\t \t\t\t}\n\t\t\t \t\t\tif(!isArrayKeyAnEmptyString('district', $formvalues)){\n\t\t\t \t\t\t\t$distid = $district->findByName($formvalues['district'], 2);\n\t\t\t \t\t\tif(isEmptyString($distid)){\n\t\t\t\t \t\t\techo \"DISTRICT_INVALID\";\n\t\t\t\t \t\t\texit();\n\t\t\t\t \t\t}\n\t\t\t \t\t\t}\n\t\t\t \t\t$where_query .= \" AND l.districtid = '\".$distid.\"' \";\n\t\t\t \t}\n \t\t\t\tbreak;\n \t\t\tcase 'subcountry':\n \t\t\tcase 2:\n \t\t\t\t$where_query .= \" AND l.locationtype = 4 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$issubcounty = true;\n \t\t\t\tbreak;\n \t\t\tcase 'parish':\n \t\t\tcase 2:\n \t\t\t\t$where_query .= \" AND l.locationtype = 5 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$isparish = true;\n \t\t\t\tbreak;\n \t\t\tcase 'village':\n \t\t\tcase 2:\n \t\t\t\t$where_query .= \" AND l.locationtype = 6 \";\n\t \t\t\t$type_query .= \" \";\n\t \t\t\t$isvillage = true;\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\tbreak;\n \t\t}\n \t}\n \t\n \t// when fetching total results\n \tif(!isEmptyString($this->_getParam('fetch')) && $this->_getParam('fetch') == 'total'){\n \t\t$select_query = \" count(l.id) as records \";\n \t\t$group_query = \"\";\n \t\t$iscount = true;\n \t}\n \t\n \t// when fetching limited results via pagination \n \tif(!isEmptyString($this->_getParam('paged')) && $this->_getParam('paged') == 'Y'){\n \t\t$ispaged = true;\n \t\t$hasall = false;\n \t\t$start = $this->_getParam('start');\n \t\t$limit = $this->_getParam('limit');\n \t\tif(isEmptyString($start)){\n \t\t\techo \"RANGE_START_NULL\";\n\t \t\texit();\n \t\t}\n \t\tif(!is_numeric($limit)){\n \t\t\techo \"INVALID_RANGE_START\";\n\t \t\texit();\n \t\t}\n \t\tif(isEmptyString($start)){\n \t\t\techo \"RANGE_LIMIT_NULL\";\n\t \t\texit();\n \t\t}\n \t\tif(!is_numeric($limit)){\n \t\t\techo \"INVALID_RANGE_LIMIT\";\n\t \t\texit();\n \t\t}\n \t\t$limit_query = \" limit \".$start.\",\".$limit.\" \";\n \t}\n \t\n \t// \n \t$com_query = \"SELECT \".$select_query.\" FROM location l WHERE l.name <> '' \".$type_query.$where_query.\" \n \t\".$group_query.\" ORDER BY l.name ASC \".$limit_query;\n \tdebugMessage($com_query);\n \t\n \t$result = $conn->fetchAll($com_query);\n \t$comcount = count($result);\n \t// debugMessage($result); // exit();\n \t\n \tif($comcount == 0){\n \t\techo \"RESULT_NULL\";\n \t\texit();\n \t} else {\n \t\tif($iscount){\n \t\t\t$feed .= '<item>';\n\t \t\t$feed .= '<total>'.$result[0]['records'].'</total>';\n\t\t\t $feed .= '</item>';\n \t\t}\n \t\tif(!$iscount){\n\t \t\tforeach ($result as $line){\n\t\t\t \t$feed .= '<item>';\n\t\t \t\t$feed .= '<id>'.$line['id'].'</id>';\n\t\t \t\t$feed .= '<name>'.$line['Location'].'</name>';\n\t\t \t\t$feed .= '<type>'.$line['Type'].'</type>';\n\t\t\t \t$feed .= '<typename>'.$line['TypeName'].'</typename>';\n\t\t\t\t $feed .= '</item>';\n\t\t \t}\n \t\t}\n \t}\n \t\n \t# output the xml returned\n \tif(isEmptyString($feed)){\n \t\techo \"EXCEPTION_ERROR\";\n \t\texit();\n \t} else {\n \t\techo '<?xml version=\"1.0\" encoding=\"UTF-8\"?><items>'.$feed.'</items>';\n \t}\n }", "public function ddl_location()\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \"SELECT loc_name, \r\n\t\t\t\t\t\t\tloc_id,\r\n\t\t\t\t\t\t\taddress \r\n\t\t\t\t\t\tFROM location\";\r\n\t\t\t\t$result = mysqli_query($link, $query) or die(mysqli_error($link));\r\n\t\t\t\t$loc = array();\r\n\t\t\t\t$arr_loc = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($result)) {\r\n\t\t\t\t\t\t$loc['loc_name'] = $row[0];\r\n\t\t\t\t\t\t$loc['loc_id'] = $row[1];\r\n\t\t\t\t\t\t$loc['address'] = $row[2];\r\n\t\t\t\t\t\t$arr_loc[] = $loc;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $arr_loc;\r\n\t\t}", "public function findAllWithLocations()\n {\n $query = $this->createQuery();\n $fieldName = ((bool)ConfigurationUtility::getExtensionConfiguration()['enableFilterCategories']) ? 'filter_categories' : 'categories';\n $query->statement('\n SELECT DISTINCT\n sys_category.*\n FROM\n sys_category\n JOIN\n sys_category_record_mm\n ON sys_category_record_mm.uid_local = sys_category.uid\n WHERE\n sys_category_record_mm.tablenames = \"tx_locationmanager_domain_model_location\" AND\n sys_category_record_mm.fieldname = \"' . $fieldName . '\"\n GROUP BY\n sys_category.uid\n ');\n return $query->execute();\n }", "public function getLocations()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Location (Linnworks API)');\n\t\t}", "function &getAll( )\n {\n $db =& eZDB::globalDatabase();\n $address_array = 0;\n \n $db->array_query( $address_array, \"SELECT * FROM eZAddress_Address\" );\n \n return $address_array;\n }", "function erp_company_get_locations() {\n global $wpdb;\n\n $cache_key = 'erp_company-location';\n $locations = wp_cache_get( $cache_key, 'wp-erp' );\n\n if ( false === $locations ) {\n $locations = $wpdb->get_results( \"SELECT * FROM {$wpdb->prefix}erp_company_locations\" );\n wp_cache_set( $cache_key, $locations, 'wp-erp' );\n }\n\n return $locations;\n}", "function EZRA_Locations() {\n // mysql_pconnect removed (lib)\n\n $results = mysql_query (\"select * from ezra_loc_codes\",$db);\n while ($myrow = mysql_fetch_row($results)) {\n $loc_code = $myrow[0];\n $location = $myrow[1];\n $ezra[$loc_code] = $location;\n }\n return $ezra;\n}", "function getAddresses()\r\n\t{\r\n\t\t// connect to the database\r\n\t\t//$this->dbsetup();\r\n\t\t\r\n\t\t$query = \"SELECT address FROM \" . $this->table . \" WHERE latitude = '0' AND longitude = '0'\";\r\n\t\t\r\n\t\t$result = mysql_query($query);\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "function locations_search($lat, $lon, $connection, $start = 0)\n{\n\t$db_selected = mysql_select_db(Secure::DB_DATABASE, $connection);\n\t$sql = \"select organization_location.address , organization_location.city , organization_location.state , organization_location.zip , organization_location.latitude , organization_location.longitude from organization_location where latitude <= {$lat} + 0.1 and latitude >= {$lat} - 0.1 and longitude <= {$lon} + 0.1 and longitude >= {$lon} - 0.1 and remove_approved = 0\";\n\t$sql = $sql.\" limit {$start},\".LIMIT;\n\tif(!($resource = @ mysql_query($sql, $connection)))\n\t\tshowerror();\n\t\t//echo $sql;\n\telse\n\t\treturn $resource;\n}", "public final function get_all()\n {\n }", "function getDetailAllScheduleUpl($account_id_local,$DbConnection)\n{\n $query=\"select location_id,location_name FROM schedule_location_upl USE INDEX(schlupl_schluplaid_status) WHERE account_id='$account_id_local' and status='1'\";\t\t\n $result=mysql_query($query,$DbConnection); \t\t\t\t\t\t\t\n while($row=mysql_fetch_object($result))\n {\n /*$location_id=$row->location_id;\n $location_name=$row->location_name;*/\t\t\t\t\n $data[]=array('location_id'=>$row->location_id,'location_name'=>$row->location_name);\n }\n return $data;\n\t\n}", "public function actionLocation() {\n $term = trim($_GET['term']);\n $bGeonames = (isset($_GET['geonames'])) ? true : false;\n $results = array();\n $geonamesUrl = \"http://api.geonames.org/searchJSON?maxRows=10&lang=de&username=wkoller&style=medium\";\n\n if ($bGeonames) {\n // Construct service URL\n $geonamesUrl = $geonamesUrl . \"&q=\" . urlencode($term);\n // Fetch service response\n $service_response = file_get_contents($geonamesUrl);\n if ($service_response) {\n // Decode data\n $service_data = json_decode($service_response, true);\n\n // Save response data in location table\n foreach ($service_data['geonames'] as $geoname) {\n // Check if we already have any entry\n $model_location = null;\n $model_locationGeonames = LocationGeonames::model()->find('geonameId=:geonameId', array(':geonameId' => $geoname['geonameId']));\n if ($model_locationGeonames != null) {\n $model_location = Location::model()->findByPk($model_locationGeonames->id);\n\n // update model with new location description\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n } else {\n // Create location model & save it\n $model_location = new Location;\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n // Create according geonames model & save it as well\n $model_locationGeonames = new LocationGeonames;\n $model_locationGeonames->id = $model_location->id;\n $model_locationGeonames->service_data = serialize($geoname);\n $model_locationGeonames->geonameId = $geoname['geonameId'];\n $model_locationGeonames->countryCode = $geoname['countryCode'];\n $model_locationGeonames->save();\n }\n\n // Add response to results\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n \"countryCode\" => $model_locationGeonames->countryCode\n );\n }\n }\n } else {\n // Find all fitting entries in location table\n $models_location = Location::model()->findAll('location LIKE :location', array(':location' => $term . '%'));\n if ($models_location != NULL) {\n foreach ($models_location as $model_location) {\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n );\n }\n }\n }\n\n // Output results as service response\n $this->serviceOutput($results);\n }", "function location_data() //get all records from database \n\t {\n\t\t$result;\n\t\t $csrf_token=$this->security->get_csrf_hash();\n\t\t $this->load->model('Sup_admin');\n\t\t $level=$this->input->post('level');\n\t\t $district=$this->input->post('district');\n\t\t //$dat=array(\"user_type_id_fk\"=>$desig);\n\t\t$query=$this->Sup_admin->mapping($level,$district);\n\t\t //$query=$this->db->get_where(\"mpr_master_location_mapping\");\n\t\t $res=$query->result();\n\t\tif($res){\n\t\t\t$data;\n\t\t\t$i = 0;\n\t\t\t foreach($res as $r){\n\t\t\t $code = $r->location_code;\n\t\t\t $type = $r->location_area;\n\t\t\t $data[$i] = array('code'=>$code,'type'=>$type);\n\t\t\t $i = $i+1;\n\t\t }\n\t\t\t$result = array('status'=>1,'message'=>'data found','data'=>$data,'csrf_token'=>$csrf_token);\n\t\t\t}\n\t\t else{\n\t\t\t$result = array('status'=>0,'message'=>'no data found','csrf_token'=>$csrf_token);\n \n\t\t\t}\n\t\techo json_encode($result);\n\t }", "public function actionAddressListAll() \r\n {\r\n return $this->listing(0, true, Yii::$app->request->get('area_id'));\r\n }", "public function get_locations_officers()\n {\n $items = array();\n $scope = get_post('scope');\n \n if ($scope) {\n\n if ((int)$scope !== 1 && !get_post('location_code')) {\n\n $return_data = array(\n 'status' => false,\n 'message' => 'Location is required.'\n );\n\n } else {\n \n $departments = $this->getDepartment(get_post('keyword'));\n foreach ($departments as $department) {\n\n // get main department locations if has any\n // main has no sub department id\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => 0, \n 'LocationScope' => $scope\n );\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n $department['location'] = $location;\n\n $subDepartments = array();\n foreach ($department['subDepartment'] as $subDepartment) {\n // get sub department locations if has any\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => $subDepartment['id'], \n 'LocationScope' => $scope\n );\n\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n\n $subDepartment['location'] = $location;\n\n if (get_post('result_filter') == 1) {\n // all active\n if ($subDepartment['location'] != false && $subDepartment['location']['Status']) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] != false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] == false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($subDepartment['location'] == false || ($subDepartment['location'] != false && $subDepartment['location']['Status'] == 0)) {\n $subDepartments[] = $subDepartment;\n }\n } else {\n // show all\n $subDepartments[] = $subDepartment;\n }\n }\n\n $department['subDepartment'] = $subDepartments;\n\n $exclude = true;\n // if no sub department. also filter main department result\n if (get_post('result_filter') == 1) {\n // all active\n if ($department['location'] != false && $department['location']['Status']) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] != false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] == false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($department['location'] == false || ($department['location'] != false && $department['location']['Status'] == 0)) {\n $items[] = $department;\n $exclude = false;\n }\n } else {\n // show all\n $items[] = $department;\n $exclude = false;\n }\n\n if (count($subDepartments) && $exclude) {\n $department['hideParent'] = true;\n $items[] = $department;\n }\n\n }\n\n if (count($items)) {\n $return_data = array(\n 'status' => true,\n 'data' => $items\n );\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'No record found.'\n );\n }\n\n }\n\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Scope is required.'\n );\n }\n\n response_json($return_data);\n }", "function getDetailAllSchedule($account_id_local,$DbConnection)\n{\n $query=\"select * FROM schedule_location USE INDEX(schl_schlaid_status) WHERE account_id='$account_id_local' and status='1'\";\t\t\n $result=mysql_query($query,$DbConnection); \t\t\t\t\t\t\t\n while($row=mysql_fetch_object($result))\n {\n /*$location_id=$row->location_id;\n $location_name=$row->location_name;*/\t\t\t\t\n $data[]=array('location_id'=>$row->location_id,'location_name'=>$row->location_name);\n }\n return $data;\t\n}", "function getAll() {\n return array(\n 'name' => $this->get('name'),\n 'lat' => $this->get('lat'),\n 'lon' => $this->get('lon'),\n 'address' => $this->get('address'),\n 'id' => $this->get('id'),\n );\n }", "function queryAll() {\n\t$sql = \"select postcode,place_name,latitude,longitude FROM geo ORDER BY postcode\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->query($sql); \n\t\t$geoList = $stmt->fetchAll(PDO::FETCH_OBJ);\n\t\t$db = null;\n\t\techo '{\"geo\": ' . json_encode($geoList) . '}';\n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "public function get_all ();", "public function index(){\n\n $geo_data = Configure::read('paths.geo_data');\n $reader = new Reader($geo_data);\n $cquery = $this->request->getQuery();\n\n //__ Authentication + Authorization __\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $user_id = $user['id'];\n\n $query = $this->{$this->main_model}->find();\n\n $this->_build_common_query($query, $user);\n\n //===== PAGING (MUST BE LAST) ======\n $limit = 50; //Defaults\n $page = 1;\n $offset = 0;\n\n if(isset($cquery['limit'])){\n $limit = $cquery['limit'];\n $page = $cquery['page'];\n $offset = $cquery['start'];\n }\n\n $query->page($page);\n $query->limit($limit);\n $query->offset($offset);\n\n $total = $query->count();\n $q_r = $query->all();\n\n $items = [];\n\n foreach($q_r as $i){\n\n $country_code = '';\n $country_name = '';\n $city = '';\n $postal_code = '';\n $state_name = '';\n $state_code = '';\n\n if($i->last_contact_ip != ''){\n try {\n $location = $reader->city($i->last_contact_ip);\n } catch (\\Exception $e) {\n //Do Nothing\n }\n\n if(!empty($location)){\n $city = $location->city->name;\n $postal_code = $location->postal->code;\n $country_name = $location->country->name;\n $country_code = $location->country->isoCode;\n $state_name = $location->mostSpecificSubdivision->name;\n $state_code = $location->mostSpecificSubdivision->isoCode;\n }\n }\n\n $realms = [];\n //Realms\n foreach($i->dynamic_client_realms as $dcr){\n if(! $this->Aa->test_for_private_parent($dcr->realm, $user)){\n if(! isset($dcr->realm->id)){\n $r_id = \"undefined\";\n $r_n = \"undefined\";\n $r_s = false;\n }else{\n $r_id= $dcr->realm->id;\n $r_n = $dcr->realm->name;\n $r_s = $dcr->realm->available_to_siblings;\n }\n array_push($realms,\n [\n 'id' => $r_id,\n 'name' => $r_n,\n 'available_to_siblings' => $r_s\n ]);\n }\n }\n\n $owner_id = $i->user_id;\n\n $owner_tree = $this->{'Users'}->find_parents($owner_id);\n $action_flags = $this->_get_action_flags($owner_id,$user);\n\n\n $i->country_code = $country_code;\n $i->country_name = $country_name;\n $i->city = $city;\n $i->postal_code = $postal_code;\n if($i->last_contact != null){\n $i->last_contact_human = $this->TimeCalculations->time_elapsed_string($i->last_contact);\n }\n\n //Create notes flag\n $notes_flag = false;\n foreach($i->dynamic_client_notes as $dcn){\n if(! $this->Aa->test_for_private_parent($dcn->note,$user)){\n $notes_flag = true;\n break;\n }\n }\n \n /*\n if(isset($i->alive_current)){\n $i->alive_current->time_human = $this->TimeCalculations->time_elapsed_string($i->alive_current->time);\n $i->alive_current->sig = intval($i->alive_current->sig);\n $i->alive_current->pb = $i->alive_current->sig /31;\n //$i->alive_current->pb = bcdiv($i->alive_current->pb, 1, 2); \n }\n */\n\n $i->notes = $notes_flag;\n\n $i->owner = $owner_tree;\n $i->realms = $realms;\n $i->update = $action_flags['update'];\n $i->delete = $action_flags['delete'];\n \n //Check if there is data cap on unit\n if($i->data_limit_active){\n $d_limit_bytes = $this->_getBytesValue($i->data_limit_amount,$i->data_limit_unit);\n $i->data_cap = $d_limit_bytes;\n if($i->data_used >0){\n $i->perc_data_used = round($i->data_used /$d_limit_bytes,2) ;\n if($i->perc_data_used > 1){\n $i->perc_data_used = 1;\n }\n }else{\n $i->perc_data_used = 0;\n }\n }\n \n //Check if there is daily data cap on unit\n if($i->daily_data_limit_active){\n $daily_limit_bytes = $this->_getBytesValue($i->daily_data_limit_amount,$i->daily_data_limit_unit);\n $i->daily_data_cap = $daily_limit_bytes;\n if($i->daily_data_used >0){\n $i->daily_perc_data_used = round($i->daily_data_used /$daily_limit_bytes,2) ;\n if($i->daily_perc_data_used > 1){\n $i->daily_perc_data_used = 1;\n }\n }else{\n $i->daily_perc_data_used = 0;\n }\n } \n \n array_push($items,$i);\n }\n\n //___ FINAL PART ___\n $this->set([\n 'items' => $items,\n 'success' => true,\n 'totalCount' => $total,\n '_serialize' => ['items','success','totalCount']\n ]);\n }", "public function index()\n {\n $invlocations = InvLocation::getAllInvLocation();\n return InvLocationResource::collection($invlocations);\n }", "function get_locations_manage_table_data_rows($locations,$controller)\n{\n\t$CI =& get_instance();\n\t$table_data_rows='';\n\n\tforeach($locations->result() as $location)\n\t{\n\t\t$table_data_rows.=get_location_data_row($location,$controller);\n\t}\n\n\tif($locations->num_rows()==0)\n\t{\n\t\t$table_data_rows.=\"<tr><td colspan='7'><div class='warning_message' style='padding:7px;'>\".$CI->lang->line('location_no_have_locations').\"</div></tr></tr>\";\n\t}\n\n\treturn $table_data_rows;\n}", "function getMarketplace($location) //Returns array containing records of all campaigns in the marketplace.\n\t{\n\t\tglobal $mydb;\n\t\t$endDate = time()-(86400*360);\n\t\t$sql = \"SELECT id, refId, facebook, youtube, instagram, title, businessId, createdAt, startDate, endDate, tier1Price, tier2Price, tier3Price\n\t\t\tFROM jobs_campaign \n\t\t\tWHERE status = 'PUBLIC' AND isPrivate = 0 AND locationId = 1 AND acceptAt >= 1484571122 AND isRemoved IS null \n\t\t\tORDER BY createdAt DESC\";\n\n\t\t$query = $mydb->query($sql);\n\t\t$public_campaigns = $query->fetch_all(MYSQLI_ASSOC);\n\t\treturn $public_campaigns;\n\t}", "public function getLocations()\n {\n return $this->locations;\n }", "abstract public function getAll();", "abstract public function getAll();", "abstract public function getAll();", "public function listLocations(Request $request)\n {\n// $docs = TourLocation::orderBy('id', 'DESC');\n// $docs = $docs->paginate($limit);\n// $total = $docs->total();\n// $data = [\n// 'docs' => TourLocationResource::collection($docs),\n// 'total' => $total,\n// ];\n// return $this->jsonApi(ResponseStatusCode::OK, __('flash.list_tour_location'), $data);\n }", "public static function getCampaignLocations()\n {\n return self::$db->fetchAll(\n 'SELECT banner_location_id AS value, description AS text FROM website.banner_location'\n );\n }", "public static function getAll() {}", "public function getListings($location) {\r\n\r\n $stmt = NULL;\r\n $results = NULL;\r\n\r\n switch ($location) {\r\n\r\n case 'grid':\r\n\r\n $sql = \"SELECT t.pagetype AS type, c.id AS id, n.nickname AS nickname,\r\n IF(COUNT(c.id) > 0, TRUE, FALSE) AS validity, c.name AS name, u.url AS short_url,\r\n t.template_secure AS secure, c.slug AS slug, t.template_filename AS filename, c.id AS canonical,\r\n c.page_title AS title, c.meta_description AS meta_description, c.meta_keywords AS meta_keywords,\r\n c.page_heading AS heading, t.allow_target AS allow_target, t.requires_login AS requires_login,\r\n t.disallow_guests AS disallow_guests, c.sitemap_show AS visibility, c.sitemap_page_priority AS priority,\r\n c.sitemap_page_change_frequency AS change_frequency, c.* FROM bs_subcategories c JOIN bs_pagetypes t\r\n\t\t\t\t\t LEFT JOIN bs_page_urls u ON (u.id = c.canonical_page_url AND u.pagetype = t.pagetype AND u.pageid = c.id)\r\n\t\t\t\t\t LEFT JOIN bs_groupings grp ON (grp.id = c.grouping_id) LEFT JOIN bs_categories cat ON (cat.id = grp.category_id)\r\n\t\t\t\t\t LEFT JOIN bs_page_nicknames n ON (t.pagetype = n.pagetype AND c.id = n.pageid)\r\n\t\t\t\t\t WHERE cat.active = TRUE AND grp.active = TRUE AND c.active = TRUE AND grp.id = ? AND t.pagetype = 'subcategory'\r\n\t\t\t\t\t GROUP BY c.id ORDER BY c.position ASC, c.name ASC\";\r\n break;\r\n\r\n case 'sidebar':\r\n\r\n $sql = \"SELECT t.pagetype AS type, c.id AS id, n.nickname AS nickname, IF(COUNT(c.id) > 0, TRUE, FALSE) AS validity,\r\n c.name AS name, u.url AS short_url, t.template_secure AS secure, c.slug AS slug, t.template_filename AS filename,\r\n c.id AS canonical, c.page_title AS title, c.meta_description AS meta_description, c.meta_keywords AS meta_keywords,\r\n c.page_heading AS heading, t.allow_target AS allow_target, t.requires_login AS requires_login,\r\n t.disallow_guests AS disallow_guests, c.sitemap_show AS visibility, c.sitemap_page_priority AS priority,\r\n c.sitemap_page_change_frequency AS change_frequency, grp.accessory\r\n\t\t\t\t\t FROM bs_subcategories c JOIN bs_pagetypes t\r\n\t\t\t\t\t LEFT JOIN bs_page_urls u ON (u.id = c.canonical_page_url AND u.pagetype = t.pagetype AND u.pageid = c.id)\r\n\t\t\t\t\t LEFT JOIN bs_groupings grp ON (grp.id = c.grouping_id) LEFT JOIN bs_categories cat ON (cat.id = grp.category_id)\r\n\t\t\t\t\t LEFT JOIN bs_page_nicknames n ON (t.pagetype = n.pagetype AND c.id = n.pageid)\r\n\t\t\t\t\t WHERE cat.active = TRUE AND grp.active = TRUE AND c.active = TRUE AND grp.id = ? AND t.pagetype = 'subcategory'\r\n\t\t\t\t\t GROUP BY c.id ORDER BY c.name ASC\";\r\n break;\r\n }\r\n\r\n $stmt = Connection::getHandle()->prepare($sql);\r\n\r\n if( $stmt->execute(array ($this->getId())) ) {\r\n\r\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\r\n\r\n $results[] = $row;\r\n }\r\n }\r\n\r\n return $results;\r\n }", "function _location($rec){\n\t\treturn array(\n\t\t\t'id' => $rec['zip'],\n\t\t\t'city' => $rec['city'],\n\t\t\t'geolocation' => sprintf('%s,%s',trim($rec['latitude']),trim($rec['longitude'])),\n\t\t\t'latitude' => $rec['latitude'],\n\t\t\t'longitude' => $rec['longitude'],\n\t\t\t'postal' => $rec['zip'],\n\t\t\t'state' => $rec['state'],\n\t\t\t'county' => $rec['county'],\n\t\t\t'country' => $rec['country'],\n\t\t);\n\t}", "function LocationDropdownList()\n\t{\t$loc_list = array();\n\t\t\n\t\tif ($locations = $this->GetLocations())\n\t\t{\tforeach ($locations as $location)\n\t\t\t{\t$loc_list[$location->id] = $location->details[\"loctitle\"];\n\t\t\t}\n\t\t}\n\t\t//print_r($this);\n\t\treturn $loc_list;\n\t}", "public function getAllStores()\n {\n $sql = \"SELECT s.id, s.name, s.phone_number, s.address_id, a.province, a.city, a.district, a.address1, a.address2, \";\n $sql.= \"a.lat, a.lng FROM store as s, address as a \";\n $sql.= \"WHERE s.address_id=a.id\";\n $query = $this->db->prepare($sql);\n $query->execute();\n\n return $query->fetchAll();\n }", "protected function getAll() {}", "public abstract function getAll();", "function get_location_list ($perm = 1) \n{\n \n $query = 'SELECT * \n FROM locations \n WHERE permanent = '.$perm;\n $result = mysql_query ($query);\n while ($row = mysql_fetch_array($result)) $return[] = $row;\n return $return;\n}", "public function getLocations(){\n\n return response()->json( $this->locations );\n\n }", "function GetAllFireplaces()\r\n {\r\n return $this->fireplaceDAL->GetAllFireplaces();\r\n }", "public function prepareListingLocationData()\n {\n foreach ($GLOBALS['listing'] as $group) {\n foreach ($group['Fields'] as $field) {\n if (isset($this->geo_filter_data['location_listing_fields'][$field['Key']])) {\n $this->listing_location_data[] = $field['value'];\n }\n }\n }\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM patient_info';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "static function getLocation(LocationResult $p_data): Array\n {\n $l_id_parent = null;\n $l_location = null;\n $l_locations = [];\n foreach ($p_data->getLocationData() as $l_type => $l_name) {\n $l_location = self::getLocationModel($l_id_parent, $l_type, $l_name);\n $l_locations[] = $l_location;\n $l_id_parent = $l_location->id;\n }\n return $l_locations;\n }", "function LocationList()\n\t{\tif ($this->id)\n\t\t{\techo \"<table><tr class='newlink'><th colspan='2'><a href='locationedit.php?city=\", $this->id, \"'>add new location</a></th></tr>\\n<tr><th>Location name</th><th>Actions</th></tr>\\n\";\n\t\t\tif ($locations = $this->GetLocations())\n\t\t\t{\tforeach ($locations as $location)\n\t\t\t\t{\t\n\t\t\t\t\techo \"<tr>\\n<td>\", $this->InputSafeString($location->details[\"loctitle\"]), \"</td>\\n<td><a href='locationedit.php?id=\", $location->id, \"'>edit</a>\";\n\t\t\t\t\tif ($histlink = $this->DisplayHistoryLink(\"locations\", $location->id))\n\t\t\t\t\t{\techo \"&nbsp;|&nbsp;\", $histlink;\n\t\t\t\t\t}\n\t\t\t\t\tif ($location->CanDelete())\n\t\t\t\t\t{\techo \"&nbsp;|&nbsp;<a href='locationedit.php?id=\", $location->id, \"&delete=1'>delete</a>\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"</td>\\n</tr>\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\techo \"</table>\\n\";\n\t\t}\n\t}", "function &getAll( $as_object = true, $search = \"\", $offset = 0, $max = -1 )\n {\n $db =& eZDB::globalDatabase();\n\n $region_array = 0;\n $return_array = array();\n \n if ( $max >= 0 && is_numeric( $offset ) && is_numeric( $max ) )\n {\n $limit = array( \"Limit\" => $max,\n \"Offset\" => $offset );\n }\n\n if ( !empty( $search ) )\n {\n $query = new eZQuery( array( \"Name\", \"Abbreviation\" ), $search );\n $search_arg = \"AND \" . $query->buildQuery();\n// $search_arg = \"WHERE Name like '%$search%'\";\n }\n\n if ( $as_object )\n $select = \"*\";\n else\n $select = \"ID\";\n\n $db->array_query( $region_array, \"SELECT $select FROM eZAddress_Region\n WHERE Removed=0 $search_arg\n ORDER BY Name\", $limit );\n\t\t\n if ( $as_object )\n {\n foreach ( $region_array as $region )\n {\n $return_array[] = new eZRegion( $region[ $db->fieldName( \"ID\" ) ] );\n }\n }\n else\n {\n foreach ( $region_array as $region )\n {\n $return_array[] = $region[ $db->fieldName( \"ID\" ) ];\n }\n }\n\t\t\n return $return_array;\n\n }", "function getAllDataValues() {\n\t\t$conn = Doctrine_Manager::connection(); \n\t\t$resultvalues = $conn->fetchAll(\"SELECT * FROM lookuptypevalue WHERE lookuptypeid = '\".$this->getID().\"' order by lookupvaluedescription asc \");\n\t\treturn $resultvalues;\t\n\t}", "public function getAllCountriesLocations()\n\t{\n\t\t$sCacheId = $this->cache()->set('gmap.countries');\n\t\n\t\tif (!($aRows = $this->cache()->get($sCacheId)))\n\t\t{\n\t\t\t$aRows = $this->database()->select('fc.country_iso, c.name, c.phrase_var_name, fc.*, COUNT(u.user_id) as total_people')\n\t\t\t\t->from(Phpfox::getT('gmap_countries'), 'fc')\t\t\n\t\t\t\t->join(Phpfox::getT('country'), 'c', 'fc.country_iso = c.country_iso')\t\n\t\t\t\t->join(Phpfox::getT('user'), 'u', 'u.country_iso = fc.country_iso')\n\t\t\t\t->join(Phpfox::getT('gmap'), 'f', 'u.user_id = f.user_id')\n\t\t\t\t->group('u.country_iso')\n\t\t\t\t->where('f.not_found = \\'0\\'')\n\t\t\t\t->execute('getSlaveRows');\n\t\t\t\t\n\t\t\t$this->cache()->save($sCacheId, $aRows);\n\t\t}\n\t\t\n\t\tif($aRows != null && is_array($aRows))\n\t\t{\n\t\t\tforeach($aRows as $key => $aRow)\n\t\t\t{\n\t\t\t\tif(isset($aRow['phrase_var_name']) && $aRow['phrase_var_name'] != '')\n\t\t\t\t{\n\t\t\t\t\t$aRows[$key]['name'] = Phpfox::getPhrase($aRow['phrase_var_name']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$aRows = $this->sortByProperty($aRows, 'name');\n\t\t}\n\t\t\n\t\treturn $aRows;\n\t}", "public function getLocationWithScrapingResults() { return Location::query()\n ->leftJoin('my_business_terms_scraping_results', 'locations.id', '=', 'my_business_terms_scraping_results.location_id')\n ->whereJsonDoesntContain('states', LocationState::HAS_PROBLEM)\n ->where('my_business_terms_scraping_results.fetched_at', '<=', Carbon::today()->subDays(7))\n ->oldest('my_business_terms_scraping_results.fetched_at')\n ->first();\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM office';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public static function getAll();", "public static function getAll();", "public function showAll() {\n $qry = $this->db->prepare('SELECT DISTINCT NAME,ADDRESS,SUBURB,LATITUDE,LONGITUDE FROM n8598177.items;');\n $qry->execute();\n foreach ($qry as $hotspot) {\n include('server/includes/recentReview.tpl.php');\n }\n }", "public function getHotelLocation()\n {\n return $this->select('city')->groupBy('city')->orderBy('city', 'ASC')->findAll();\n }", "public function index()\n {\n try {\n $locations = Location::all();\n return (new LocationResourceCollection($locations))->response();\n } catch (Exception $e) {\n report($e);\n return false;\n }\n }", "public function getAllLocation($admin = false)\n {\n if ($admin) {\n return $this->deliveryLocation->all();\n }\n return $this->deliveryLocation->where('status', 1)->get();\n\n }", "public function getStateLocation(){\r\n\t $select=\"SELECT DISTINCT(`state`) FROM locations ORDER BY state\";\r\n\t global $pdo;\r\n\t $stmt = $pdo->query($select);\r\n\t\t$params = array();\r\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC)){\r\n\t\t\t$params[] = $row;\r\n\t\t}\r\n\t\treturn $params;\r\n\t}", "public function AllMemberLocations(){\n $curGroup = Group::whereHas('members',function($q){\n $q->where('user_id',Auth::id());\n })->get();\n\n $curGroup = $curGroup->pluck('id');\n \n $keys = Array();\n //add in keys[] the id of all members of group\n $groupId = Group::with('members')->whereIn('id',$curGroup)->get();\n $groupMemberDetail = $groupId->pluck('members');\n $groupMemberDetailId = $groupMemberDetail->pluck('id');\n foreach($groupMemberDetail as $group){\n foreach($group as $id){\n $keys[] = $id->id;\n }\n }\n\n $keys = array_unique($keys);\n\n $information = User::with('information')->whereIn('id',$keys)->get();\n $information = $information->pluck('information');\n\n $devInfo = User::with('information')->whereHas('devices',function($q) use($keys){\n $q->whereIn('id',$keys);\n })->get();\n $devInfo = $devInfo->pluck('information');\n\n //return Response::json(['no'=>$user_noDevice]);\n $user_noDevice = User::whereDoesntHave('devices')->whereIn('id',$keys)->pluck('id')->toArray();\n $dev = User::has('devices')->whereIn('id',$keys)->pluck('id')->toArray();\n $locations = Array();\n foreach ($dev as $key => $id) {\n $locations[] = Location::where('device_id',$id)->orderBy('created_at', 'desc')->get(['latitude','longitude','device_id'])->first()->toArray();\n }\n \n $history = Array();\n \n foreach($user_noDevice as $id){\n $history[] = History::where('user_id',$id)->orderBy('created_at', 'desc')->get(['latitude','longitude','user_id'])->first()->toArray();\n }\n\n // return Response::json(['location'=>$locations,'historys'=>$history,'information'=>$information,'deviceInfo'=>$devInfo]); \n return Response::json(['information'=>$information,'deviceInfo'=>$devInfo,'location'=>$locations,'historys'=>$history]);\n }", "private function listing($offset = 0, $listAll = false, $area_id = 0){\r\n\r\n $customer_id = Yii::$app->user->getId();\r\n $addresses = array();\r\n $limit = Yii::$app->params['limit'];\r\n $query = CustomerAddress::find()\r\n ->select('whitebook_city.city_name, whitebook_city.city_name_ar, whitebook_location.location,\r\n whitebook_location.location_ar, whitebook_customer_address.*')\r\n ->leftJoin('whitebook_location', 'whitebook_location.id = whitebook_customer_address.area_id')\r\n ->leftJoin('whitebook_city', 'whitebook_city.city_id = whitebook_customer_address.city_id')\r\n ->where('customer_id = :customer_id', [':customer_id' => $customer_id]);\r\n\r\n if($area_id) \r\n {\r\n $query->andWhere(['area_id' => $area_id]);\r\n }\r\n\r\n if(!$listAll)\r\n {\r\n $query->limit($limit)\r\n ->offset($offset);\r\n }\r\n \r\n $result = $query->asArray()\r\n ->orderBy('address_id DESC')\r\n ->all();\r\n\r\n if ($result) {\r\n foreach ($result as $row) {\r\n\r\n $row['questions'] = CustomerAddressResponse::find()\r\n ->select('aq.question_ar, aq.question, whitebook_customer_address_response.*')\r\n ->innerJoin('whitebook_address_question aq', 'aq.ques_id = address_type_question_id')\r\n ->where('address_id = :address_id', [':address_id' => $row['address_id']])\r\n ->asArray()\r\n ->all();\r\n\r\n $addresses[] = $row;\r\n }\r\n }\r\n return $addresses;\r\n }", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "function getAllStatesFromLocations(){\r\n\t$select = \"SELECT DISTINCT(state) FROM locations LEFT JOIN device_installations ON location_id=locations.id WHERE locations.name NOT LIKE '%Offline%' AND status=1 ORDER BY state\";\r\n\tglobal $pdo;\r\n\t$res = $pdo->query($select);\r\n\treturn $res->fetchAll(PDO::FETCH_ASSOC);\r\n}", "public function testGetAllValidLocations() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"location\");\n\n\t\t// create a new Location and insert to into mySQL\n\t\t$location = new Location(null, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Location::getAllLocations($this->getPDO());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"location\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\Rootstable\\\\Location\", $results);\n\n\t\t// grab the result from the array and validate it\n\t\t$pdoLocation = $results[0];\n\t\t$this->assertEquals($pdoLocation->getLocationProfileId(), $this->profile->getprofileId());\n\t\t$this->assertEquals($pdoLocation->getLocationAttention(), $this->payAttention);\n\t\t$this->assertEquals($pdoLocation->getLocationCity(), $this->sinCity);\n\t\t$this->assertEquals($pdoLocation->getLocationName(), $this->granjalada);\n\t\t$this->assertEquals($pdoLocation->getLocationState(), $this->stateOfMind);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetOne(), $this->warZone);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetTwo(), $this->aptTwo);\n\t\t$this->assertEquals($pdoLocation->getLocationZipCode(), $this->whatHood);\n\t}", "public function locations()\n {\n return $this->hasMany(Location::class, 'data_source_id');\n }", "public function the_locations() {\n\n // Verify if locations exists\n if ( self::$the_locations ) {\n\n // Set all locations\n return self::$the_locations;\n\n } else {\n\n return false;\n\n }\n\n }", "public function getAddressBooks();", "public function getLocationList($box_id,$start_date,$end_date){\r\n\t $where = 'a.box_id='.$box_id\r\n\t .\" and '\".$end_date.\"'>=b.start_date and '\".$start_date.\"'<=b.end_date and a.location_id!=0 and b.state!=2\";\r\n\t $data = $this->alias('a')\r\n\t ->field('a.location_id')\r\n\t ->join('savor_pub_ads b on a.pub_ads_id=b.id','left')\r\n\t ->where($where)\r\n\t ->select(); \r\n\t return $data;\r\n\t}", "function getDetailAllLandmark($account_id_local,$DbConnection)\n{\n\t$query=\"SELECT * FROM landmark USE INDEX(lnk_lnkaid_status) WHERE account_id='$account_id_local' and status='1'\";\n\t$result=mysql_query($query,$DbConnection); \t\t\t\t\t\t\t\n\twhile($row=mysql_fetch_object($result))\n\t{\n /*$landmark_id=$row->landmark_id;\n $landmark_name=$row->landmark_name;\n $zoom_level=$row->zoom_level;\n $distance_variable=$row->distance_variable;*/\t\t\n $data[]=array('landmark_id'=>$row->landmark_id,'landmark_name'=>$row->landmark_name,'zoom_level'=>$row->zoom_level,'distance_variable'=>$row->distance_variable);\t\n }\n\treturn $data;\n}", "public static function location_listing($location_id,$limit = 15)\n {\n \n \n\n $query = \"SELECT id, category_id,created_by, title,description, url, featured_image, create_time,primary_phone,primary_email,\n\n (SELECT name FROM 9jb_locations WHERE 9jb_listings.city = 9jb_locations.id) AS city_name,\n (SELECT fa_icon FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS icon,\n (SELECT color FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS color,\n (SELECT title FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS category_name,\n (SELECT name FROM 9jb_locations WHERE 9jb_listings.state = 9jb_locations.id) AS state_name,\n (SELECT count(*) FROM 9jb_reviews WHERE 9jb_reviews.listing_id = 9jb_listings.id) AS reviews\n\n FROM 9jb_listings\n WHERE (city = ? or state = ?) AND status='activated'\n ORDER BY create_time DESC LIMIT $limit \";\n\n return \\DB::select($query,[$location_id,$location_id]) ;\n }", "public function add_locations($data){\n\t\tforeach($data as $rec){\n\t\t\t$docs[] = $this->_location($rec);\n\t\t}\n\t\treturn $this->update_docs($docs);\n\t}", "private function getAddresses()\n\t{\n\t\t\n\t\t$userID = $this->session->userID;\n\t\t$addresses = $this->dbConnection->prepareRecordSet(\"SELECT * FROM b_user_address WHERE user_id = ? AND record_status = 'A'\", $userID);\n\n\t\treturn $addresses;\n\t\t\n\t}", "function getAll();", "function getAll();", "public function getPlaces();", "abstract function getBaseLocations();", "function retrieveAllRiver(){\n $data = $this->db->retrieveAllRiver();\n return $data;\n }" ]
[ "0.7502509", "0.7281981", "0.7191292", "0.71421576", "0.70082754", "0.69252145", "0.6887821", "0.67683196", "0.66860116", "0.6668606", "0.66367483", "0.6569222", "0.65674937", "0.6552547", "0.6504031", "0.6498346", "0.64901924", "0.6454202", "0.64021724", "0.6394422", "0.6379519", "0.6357178", "0.635388", "0.6353625", "0.63535106", "0.6303169", "0.6289372", "0.6243358", "0.6238747", "0.6237188", "0.62369114", "0.6228094", "0.62262535", "0.6212777", "0.61851704", "0.61831033", "0.6181898", "0.6171935", "0.61658925", "0.6146719", "0.6132236", "0.61230916", "0.61184764", "0.6107942", "0.6049557", "0.6019188", "0.60119754", "0.6010397", "0.59932876", "0.59932876", "0.59932876", "0.5980098", "0.5973774", "0.5970833", "0.59604853", "0.595191", "0.5948349", "0.592882", "0.5920271", "0.5919905", "0.59122264", "0.5906799", "0.58945185", "0.5894044", "0.5893054", "0.5885471", "0.58815354", "0.5864582", "0.5857584", "0.5855817", "0.58475566", "0.5846423", "0.58114773", "0.58114773", "0.5793381", "0.5784317", "0.57822555", "0.5774664", "0.5772039", "0.57714796", "0.57665974", "0.5758483", "0.5758483", "0.5758483", "0.5758193", "0.5758193", "0.5753112", "0.57513195", "0.57484055", "0.57452136", "0.57390946", "0.57307845", "0.5725962", "0.5719537", "0.5714655", "0.57088053", "0.5706791", "0.5706791", "0.5704587", "0.5697859", "0.56922376" ]
0.0
-1
end of fucntion to get the record by id
function get_data_by_id(){ global $db; $data=array(); if($this->id!=''){ $sql="SELECT * FROM $this->table where id = ? "; $db->query($sql, array($this->id)); $data=$db->fetch_assoc(); }else{ $data['id']='0'; $data['email']=''; } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRecord($id = null);", "abstract public function retrieve($id);", "public function retrieveById($id);", "function get_by_id($id)\n {\n $this->db2->where($this->id, $id);\n return $this->db2->get($this->table)->row();\n }", "public function getRecord($id){\n\t\t$req = \"SELECT * FROM $this->table WHERE mdr_id = '$id' LIMIT 1\";\n\t\t$res = $this->select($req);\n\t\treturn $res[0];\n\t}", "public function get( $id ){}", "public function returnDetailFindByPK($id);", "function get_by_id($id)\r\n {\r\n $this->db->where($this->id, $id);\r\n return $this->db->get($this->table)->row();\r\n }", "public function getById() {}", "public function getById( $id );", "public function findByID($id){\n return $this->Find(self::TABLE,$id);\n }", "public function retrieve(int $id);", "public function getRecord($id){\r\n\t\treturn $this->db->get_where('uqc',array('id'=>$id))->row();\r\n\t}", "function &getRecordByID($id){\n global $db;\n\n $sql = \"SELECT * \"\n .\"FROM products \"\n .\"WHERE id = $id\";\n //Basic::EventLog(\"Products->getRecordByID: \".$sql);\n $row =& $db->queryRow($sql);\n return $row;\n }", "abstract public function getById($id);", "abstract public function getById($id);", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "public function get( $id );", "function getRecord($id) {\n\t\t$result = $this->select('id',\"`id` = '$id'\");\n\t\tif($result) return 1;\n\t\treturn '';\n\t}", "function get_by_id($id)\n {\n\t\t\t\n\t\t$id_patner = $this->session->userdata('DX_id_patner');\n\t\tif($id_patner > 0){\n\t\t\t$this->db->where('id_patner', $id_patner);\n\t\t}\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_by_id($id) {\r\n $this->db->where('id', $id);\r\n return $this->db->get($this->tbl);\r\n }", "function get_by_id($id)\n\n {\n\n $this->db->where($this->id, $id);\n\n return $this->db->get($this->table)->row();\n\n }", "public abstract function getById($id);", "function get_by_id($id)\n {\n $db2 = $this->load->database('database_kedua', TRUE);\n\n $db2->where($this->id, $id);\n return $db2->get($this->table)->row();\n }", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "function find($id);", "function findById($id);", "public function fetch($id);", "public function fetch($id);", "public static function getRecord($id) {\r\n $connection = Database::getConnection();\r\n // Set up the query\r\n $query = 'SELECT `id`,`first_name`,`last_name`,`gender`,`avatar`,`bloodgroup`, `email`, `phone`,\r\n `user_name`, `access`\r\n FROM `persons` WHERE id=\"'. (int) $id.'\"';\r\n // Run the MySQL command \r\n $result_obj = ''; \r\n try {\r\n $result_obj = $connection->query($query);\r\n if (!$result_obj) {\r\n throw new Exception($connection->error);\r\n } else {\r\n $item = $result_obj->fetch_object('Person');\r\n if (!$item) {\r\n throw new Exception($connection->error);\r\n } else {\r\n // pass back the results\r\n return($item);\r\n }\r\n }\r\n }\r\n catch(Exception $e) {\r\n echo $e->getMessage();\r\n }\r\n }", "public function find($id){\n return $this->db->find($this->table,$id);\n }", "function getbyid($id){\n\t\t$this->db->where ('id', $id, \"=\");\n\t\t$res = $this->db->getOne('admin');\n\t\treturn $res;\n\t}", "abstract public function get($id);", "abstract public function get($id);", "abstract public function get($id);", "public function modelGetRecord(){\n $id = isset($_GET[\"id\"])&&$_GET[\"id\"] > 0 ? $_GET[\"id\"] : 0;\n $conn = Connection::getInstance();\n // thuc hien truy van\n $query = $conn->query(\"select * from inventory where id=$id\");\n // tra ve mot ban ghi\n return $query->fetch();\n }", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "function get(string $id);", "public function get_one($id)\n {\n }", "public function fetchSingleById($id);", "public function fetchSingleById($id);", "public function find(int $id) ;", "public abstract function get($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);" ]
[ "0.8352112", "0.7818417", "0.77975255", "0.7774239", "0.776948", "0.7753958", "0.7729069", "0.77088517", "0.7696676", "0.7665508", "0.76535434", "0.7632149", "0.7616402", "0.7613095", "0.758357", "0.758357", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.75754005", "0.7566227", "0.75603336", "0.755183", "0.75421894", "0.7529763", "0.7528855", "0.75287974", "0.75037336", "0.75037336", "0.75037336", "0.75037336", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7484571", "0.7448268", "0.7446575", "0.74312437", "0.74312437", "0.7420505", "0.7416477", "0.74040574", "0.7401905", "0.7401905", "0.7401905", "0.7397082", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7395775", "0.7386124", "0.73764294", "0.73621404", "0.73621404", "0.7360446", "0.7347904", "0.7336305", "0.7336305", "0.7336305", "0.7336305" ]
0.0
-1
end of function to add record
public function insertRecord(){ global $db; $data = array('email'=>$this->email); $user_email = $this->chk_user_exist(); if(!empty($user_email)){ $response['m'] = 'exist'; }else{ if($db->insert($this->table,$data)) $response['m'] = 'success'; } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dbase_add_record($dbase_identifier, $record)\n{\n}", "function add($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\n\t\t// update the DB table appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\t$this->_data[$key] = $record;\n\n\t\t$this->store();\n\t}", "public function pushRecord()\r\n {\r\n\r\n }", "function addNew($rec)\r\n\t\t{\r\n\t\t\t// Create associative array of key fields and data values\r\n\t\t\t$data = array(\"idMedicalRecord\"=>$rec[0],\"medicalRec_weight\"=>$rec[1],\"medicalRec_height\"=>$rec[2],\"medicalRec_bloodPressure\"=>$rec[3],\"medicalRec_temperature\"=>$rec[4],\"medicalRec_bloodIronLevel\"=>$rec[5],\"medicalRec_time\"=>$rec[6],\"medicalRec_date\"=>$rec[7],\"medicalRec_medicalHistory\"=>$rec[8],\"medicalRec_rejectionReason\"=>$rec[9]);\r\n\t\t\t// Bind values to object's attributes\r\n\t\t\t$this->bind($data);\r\n\t\t\t// Add new values to table in database\r\n\t\t\t$this->insert();\r\n\t\t}", "public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "public function createRecord();", "public function add()\r\n {\r\n $this->start();\r\n $this->write_to_db();\r\n }", "function add($record)\n {\n $data = get_object_vars($record);\n $this->rest->initialize(array('server' => REST_SERVER));\n $this->rest->option(CURLOPT_PORT, REST_PORT);\n $retrieved = $this->rest->post('recipe/maintenance/item/id/' . $record->menu_id.'-'.$record->inventory_id, $data);\n }", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "protected function SaveNewRecord()\n\t{\n\t\t//class\n\t\treturn false;\n\t}", "function addRecord()\n {\n global $invenArray;\n // Add the new information into the array\n $invenArray[] = array($_POST[\"empID\"],$_POST[\"fName\"],$_POST[\"lName\"],$_POST[\"truckNum\"],$_POST[\"phoneNum\"],$_POST[\"yrsOfSen\"]);\n // The sort will be on the first column (part number) so use this to re-order the displays\n sort($invenArray);\n // Save the updated array in its session variable\n $_SESSION[\"serializedArray\"] = urlencode(serialize($invenArray));\n }", "public function add(){\r\n\t\t//$this->auth->set_access('add');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "public function add()\n\t{\n\n\t}", "public function add()\n\t{\n\n\t}", "protected function add() {\n\t}", "public function Add(){\n $insert =[\n 'RankNo'=>32132,\n 'UserName'=>$UserName,\n 'NickName'=>123,\n 'MoneyNum'=>32131,\n 'Signature'=>32132131,\n 'WeChatID'=>3213123,\n 'Status'=>$Status,\n 'head_img'=>$head_img\n ];\n return $this->insert($insert);\n }", "public function add(Record $record)\n {\n $this->list[] = $record;\n }", "function add( $obj )\r\n\t{\r\n\t\tif ( $this->signUseID == true) {\r\n\t\t\t$pos = $obj->primary_key_value();\r\n\t\t\t$this->data[ $pos ] = $obj;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$this->data[] = $obj;\r\n\t\t}\r\n\t}", "public function newRecord($data,$module=\"Leads\") {\r\n \r\n \r\n //if(count($data)&lt;=0)return \"\";\r\n $records = [];\r\n try{\r\n \r\n $record = ZCRMRecord::getInstance( $module, null );\r\n foreach($data as $d=>$v)\r\n $record->setFieldValue($d, $v);\r\n \r\n\r\n $records[] = $record;\r\n \r\n $zcrmModuleIns = ZCRMModule::getInstance($module);\r\n $bulkAPIResponse=$zcrmModuleIns->createRecords($records); // $recordsArray - array of ZCRMRecord instances filled with required data for creation.\r\n $entityResponses = $bulkAPIResponse->getEntityResponses();\r\n \r\n foreach($entityResponses as $entityResponse){\r\n if(\"success\"==$entityResponse->getStatus()){\r\n $createdRecordInstance=$entityResponse->getData();\r\n return $createdRecordInstance->getEntityId();\r\n \r\n }\r\n else{\r\n $file_names = __DIR__.\"/zoho_ERROR_ADDNEW_log.txt\";\r\n \t\t\t\t file_put_contents($file_names, (json_encode($entityResponses)).PHP_EOL , FILE_APPEND | LOCK_EX);\t\r\n \t\t\t\t return \"-1\";\r\n }\r\n }\r\n \r\n \r\n }catch(Exception $e){\r\n $file_names = __DIR__.\"/zoho_ERROR_ADDNEW_log.txt\";\r\n\t\t\t\t file_put_contents($file_names, $e.PHP_EOL , FILE_APPEND | LOCK_EX);\t\r\n return \"\";\r\n }\r\n \r\n \r\n }", "public function addRecord()\n {\n $rec = new Record($this, true);\n $rec->markForInsert();\n $this->records[] = $rec;\n return $rec;\n }", "private function crud_post($record = null) {\n $key = $record['id'];\n\n if (!isset($key)) {\n $this->response(array('error' => 'Create: No supply specified'), 406);\n return;\n }\n\n if ($this->supplies->exists($key)) {\n $this->response(array('error' => 'Create: Supply ' . $key . ' already exists'), 406);\n return;\n }\n\n $this->supplies->add($record);\n\n $oops = $this->db->error();\n if (empty($oops['code']))\n $this->response(array('ok'), 200);\n else\n $this->response($oops, 400);\n }", "public function addRecord($pObject) {\r\n $this->records[] = $pObject;\r\n }", "public function testaddOneRecord()\n\t{\n\t\t$this->assertEquals(1,1);\n\t}", "function add_a_record()\n {\n /**\n * @var str IP Address for the A record\n * @var int TTL for the A record\n * @var str Hostname for the A record\n * @var str Regex to Validate IPv4 Addresses\n */\n $ip = Null;\n $ttl = Null;\n $host = Null;\n $hnregex = \"/(([a-zA-Z0-9](-*[a-zA-Z0-9]+)*).)+\" . $this->domainnames[$this->domain_id]['name'] . \"/\";\n $shnregex = \"/^(([a-zA-Z0-9](-*[a-zA-Z0-9]+)*).)/\";\n while (!is_string($ip)) {\n $ip = filter_var(readline(\"IP Address: \"), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);\n }\n while (!is_int($ttl)) {\n $ttl = filter_var(readline(\"TTL [300]: \"), FILTER_VALIDATE_INT);\n $ttl = (!is_bool($ttl)) ? $ttl : 300;\n }\n while (!is_string($host)) {\n $hosttmp = readline(\"Hostname for new A record: \");\n if (filter_var($hosttmp, FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $hnregex)))) {\n $host = $hosttmp;\n } elseif (filter_var($hosttmp, FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $shnregex)))) {\n $host = filter_var($hosttmp . \".\" . $this->domainnames[$this->domain_id]['name'], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $hnregex)));\n }\n }\n\n foreach ($this->domains as $d) {\n if ($d->name == $this->domainnames[$this->domain_id]['name']){\n $domain = $d;\n }\n }\n\n $record = array(\n 'name' => $host,\n 'type' => 'A',\n 'ttl' => $ttl,\n 'data' => $ip);\n\n printf(\"\\nYou would like to add the following record:\\n\");\n printf(\"Type: %s\\n\", $record['type']);\n printf(\"Name: %s\\n\", $record['name']);\n printf(\"IP: %s\\n\", $record['data']);\n printf(\"TTL: %s\\n\", $record['ttl']);\n\n $proceed = readline(\"Type \\\"Y\\\" or \\\"y\\\" to proceed: \");\n\n if (strtolower($proceed) === 'y') {\n $hostentry = $domain->record($record);\n try {\n $response = $hostentry->create();\n printf(\"Created!\\n\");\n } catch (Exception $e) {\n printf(\"%s\\n\", $e);\n }\n } else {\n printf(\"ABORTED!\\n\");\n }\n }", "public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }", "function add($_data = null)\n\t{\n\t\tif (empty($_data['fields']) AND empty($_data['table'])){\n\t\t return FALSE;\n\t\t}\n\t\t\n\t\t$data = array();\n\t\tforeach($_data['fields'] as $k => $d)\n\t\t{\n\t\t\t$data[$k] = $d;\n\t\t}\n\t\t\n\t\t$ret =\t$this->db->insert($_data['table'], $data);\n\t\n\t\t\n\t\tlog_message('info','SQL Query: ' . $this->db->last_query());\n\t\n\t\t$this->__insert_id = $this->db->insert_id();\n\t\treturn $ret;\n\t}", "public function add()\n {\n }", "public function add()\n {\n }", "public function add()\n {\n }", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "protected function _insert()\n\t{\n\t}", "function addPatientToDatabase($fileNumber, $name, $phoneNo, $dateOfBirth, $progressNotes = null)\n{\n $result = ['result' => false, 'message' => 'Unable to save patient !'];\n $isPatientDataValid = isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth);\n if (!$isPatientDataValid['result']) {\n $result['message'] = $isPatientDataValid['message'];\n return $result;\n }\n $patients = getPatients();\n $patientExists = false;\n // good for adding sorting before searching\n foreach ($patients as $patient) {\n $valuesExist = $patient['FileNumber'] === $fileNumber || ($patient['PatientNo'] === $phoneNo && $patient['PatientName'] === $name);\n if ($valuesExist) {\n $patientExists = true;\n break;\n }\n }\n if ($patientExists) {\n $result['message'] = \"Similar Patient Already Exists !\";\n return $result;\n }\n $data = [\n 'FileNumber' => $fileNumber,\n 'PatientName' => $name,\n 'PatientNo' => $phoneNo,\n 'DOB' => $dateOfBirth,\n ];\n\n if ($progressNotes) {\n $data['ProgressNotes'] = $progressNotes;\n $appObject = getAppointmentObject($data);\n $appObject = setAppointmentId($appObject);\n // $appObject['FirebaseId'] = null;\n $patientSaved = saveRecord(APPOINTMENTS_COLLECTION, $appObject, true);\n } else {\n $patientSaved = saveRecord(PATIENTS_COLLECTION, $data, true);\n }\n if ($patientSaved) {\n $result['message'] = \"Patient Saved Successfully\";\n $result['result'] = true;\n return $result;\n }\n return $result;\n}", "function add() {\n\n\t\t// assign values from $_POST to class variables\n\t\t$this -> personal_id = $this -> input -> post('personal_id', TRUE);\n\n\t\t$this -> movable_number = $this -> input -> post('movable_number', TRUE);\n\n\t\t$this -> series_number = $this -> input -> post('series_number', TRUE);\n\n\t\t$this -> unit = $this -> input -> post('unit', TRUE);\n\n\t\t$this -> comment = $this -> input -> post('comment', TRUE);\n\t\t//tr_date_add\n\n\t\t$this -> give_date = tr_date_add($this -> input -> post('give_date', TRUE));\n\n\t\t$this -> take_date = tr_date_add($this -> input -> post('take_date', TRUE));\n\n\t\t$ok = $this -> db -> insert('movable', $this);\n\n\t\tif ($ok) {\n\n\t\t\t$this -> res = $this -> db -> insert_id();\n\t\t\t//$data['lastid'] = $this->db->insert_id() ;\n\n\t\t}\n\n\t\treturn $this -> res;\n\n\t}", "public function add();", "public function add();", "public function add() {\n $fields_definition = '';\n $fields_values = '';\n foreach ($this->fields as $name => $value) {\n $fields_definition .= '`' . $name . '`, ';\n $fields_values .= '\\''. $value . '\\', ';\n }\n\n $fields_definition = chop($fields_definition, ', ');\n $fields_values = chop($fields_values, ', ');\n\n $query = 'INSERT INTO `' . $this->table . '`'\n . ' (' . $fields_definition\n . ' ) VALUES ( ' . $fields_values . ' )';\n\n return $this->connection->query($query);\n }", "function saveRecord()\n\t{\n\t\t$data['roleID'] = $this->roleID;\n\t\t$data['module'] = $this->module;\n\t\t$data['roleName'] = $this->roleName;\n\t\t$data['roleDesc'] = $this->roleDesc;\n\t\t\n\t\t$this->db->insert('roles', $data); \n\t\t\n\t\tif ($this->db->_error_message())\n\t\t\treturn false;\n\t\telse \n\t\t\treturn true;\n\t}", "function AfterAdd(&$values,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid= $keys['proid'];\n$bill_date=$values['bill_date'];\n$amount_bill=$values['amount'];\n$bill_no=$values['bill_no'];\n$item=$values['item'];\n$ProgramID = $values['ProgramID'];\n$BatchID = $values['BatchID'];\n\n//get related student according to intake , branch, and program\n$sql_student = \"select StudentID from student_info where DipID='$ProgramID' AND BatchID='$BatchID' AND Status='Active'\";\n$q_student = db_query($sql_student,$conn);\n\n//insert all program billing item to related student program bill\nwhile($row_student=db_fetch_array($q_student))\n{ \n$studentID=$row_student['StudentID'];\n$sql_insert=\"INSERT INTO student_billing (proid,date,amount,amount_balance,bill_no,item,studentID,status)\nVALUES ('$proid','$bill_date','$amount_bill','$amount_bill','$bill_no','$item','$studentID','Pending')\";\ndb_exec($sql_insert,$conn);\t\n}\n\n\n;\t\t\n}", "public function testRecord() {\n $this->markTestIncomplete('This test has not been implemented yet.');\n }", "protected function _insert()\n\t{\n\t\t$this->date_added = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->date_modified = $this->date_added;\n\t\t$this->last_online = $this->date_modified;\n\t\t$this->activity_open = $this->date_modified;\n\t\t$this->language_id = \\Core\\Base\\Action::getModule('Language')->getLanguageId();\n\t}", "public function add() {\n $insertData = $this->data;\n $keepNullFields = [\n 'estimator_id', 'date_requested', 'date_service', 'class_id',\n 'date_service', 'lat', 'lng'\n ];\n foreach ($keepNullFields as $field) {\n if (!$insertData[$field]) {\n $insertData[$field] = null;\n }\n }\n $model = new ReferralModel;\n $ref = $model->create();\n $ref->set($insertData);\n $ref->save();\n $this->renderJson([\n 'success' => true,\n 'message' => 'Job request created successfully',\n 'data' => $ref->asArray()\n ]);\n }", "function Add() \n\t{\n\t\tglobal $dal_info;\n\t\t\n\t\t$insertFields = \"\";\n\t\t$insertValues = \"\";\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\t\t$blobs = array();\n\t\t//\tprepare parameters\t\t\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\tif( isset($this->{$fld['varname']}) )\n\t\t\t{\n\t\t\t\t$this->Value[ $fieldname ] = $this->{$fld['varname']};\n\t\t\t}\n\t\t\t\n\t\t\tforeach($this->Value as $field => $value)\n\t\t\t{\n\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t$insertFields.= $this->_connection->addFieldWrappers( $fieldname ).\",\";\n\t\t\t\t$insertValues.= $this->PrepareValue($value,$fld[\"type\"]) . \",\";\n\t\t\t\t\n\t\t\t\tif( $this->_connection->dbType == nDATABASE_Oracle || $this->_connection->dbType == nDATABASE_DB2 || $this->_connection->dbType == nDATABASE_Informix )\n\t\t\t\t{\n\t\t\t\t\tif( IsBinaryType( $fld[\"type\"] ) )\n\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\n\t\t\t\t\t\t\n\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Informix && IsTextType( $fld[\"type\"] ) )\n\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//\tprepare and exec SQL\n\t\tif( $insertFields != \"\" && $insertValues != \"\" )\t\t\n\t\t{\n\t\t\t$insertFields = substr($insertFields, 0, -1);\n\t\t\t$insertValues = substr($insertValues, 0, -1);\n\t\t\t$dalSQL = \"insert into \".$this->_connection->addTableWrappers( $this->m_TableName ).\" (\".$insertFields.\") values (\".$insertValues.\")\";\n\t\t\t$this->Execute_Query($blobs, $dalSQL, $tableinfo);\n\t\t}\n\t\t//\tcleanup\t\t\n\t $this->Reset();\n\t}", "public function add() \n { // metodo add, complementar\n $str = \"insert into \".self::$tablename.\"(nitHotel, idCiudad, nomHotel, dirHotel, telHotel1, telHotel2, correoHotel, tipoHotel, Administrador, idRedes, aforo, tipoHabitaciones, status)\";\n $str.= \" values ('$this->nitHotel', $this->idCiudad, '$this->nomHotel', '$this->dirHotel', '$this->telHotel1', '$this->telHotel2', '$this->correoHotel', $this->tipoHotel, '$this->Administrador', $this->idRedes, $this->aforo, $this->tipoHabitaciones, $this->status);\";\n }", "public function onSaveNewRecord()\n {\n $this->created = $this->updated = new \\DateTime();\n $this->rev = 1;\n }", "public function add_information() \r\n {}", "public function add_information() \r\n {}", "public static function create_record() {\n\t\t$extension = self::get_extension();\n\t\t$sql = \"INSERT INTO photo_directory (user_id, time_uploaded, extension) VALUES ('{$_SESSION['user_id']}', NOW(), '{$extension}'); \";\n\t\t$do_it_bitch = mysql_query($sql);\n\n\t\t// Create record in photo_description\n\t\t$photo_id = self::max_photo_id();\n\t\t$description = $_POST['description'];\n\t\tif ($description == 'false') {\n\t\t\t$sql = \"INSERT INTO photo_descriptions (photo_id) VALUES ({$photo_id}); \";\n\t\t\t$do_it_bitch = mysql_query($sql);\n\t\t} else {\n\t\t\t$sql = \"INSERT INTO photo_descriptions (photo_id, photo_description) VALUES ({$photo_id}, '{$description}'); \";\n\t\t\t$do_it_bitch = mysql_query($sql);\n\t\t}\n\t}", "function addRecord($con, $inpTeam, $inpEnv, $inpTech, $inpType, $inpInitial, $inpFinal, $totSavings, $inpCause, $inpSteps, $inpDate, $inpProj, $userID)\n\t{\n\t\t$stmt_insert = $con->prepare(\"INSERT INTO costsavings (csCause, csSteps, csDate, csSavings, csInitial, csFinal, teamID, techID, envID, typeID, projectID, userID) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\");\n\t\t$stmt_insert->bind_param(\"sssdddiiiiii\", $inpCause, $inpSteps, $inpDate, $totSavings, $inpInitial, $inpFinal, $inpTeam, $inpTech, $inpEnv, $inpType, $inpProj, $userID);\n\t\t$stmt_insert->execute() or die(mysqli_error($con));\n\n\t\t$msgDisplay = successAlert(\"Successfully inserted a new record.\");\n\n\t\treturn $msgDisplay;\n\t}", "public function addData()\r\n {\r\n\t\t$this->datecreated = time();\r\n\r\n\r\n\t\t$sql = 'INSERT INTO ' . TABLE_PREFIX . 'access_ticket_type (\r\n\t\t\t\t\tatt_groupcontroller,\r\n\t\t\t\t\tatt_controller,\r\n\t\t\t\t\tatt_action,\r\n\t\t\t\t\tatt_name,\r\n\t\t\t\t\tatt_description,\r\n\t\t\t\t\tatt_status,\r\n\t\t\t\t\tatt_ipaddress,\r\n\t\t\t\t\tatt_datecreated,\r\n\t\t\t\t\tatt_datemodified\r\n\t\t\t\t\t)\r\n\t\t VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)';\r\n\t\t$rowCount = $this->db->query($sql, array(\r\n\t\t\t\t\t(string)$this->groupcontroller,\r\n\t\t\t\t\t(string)$this->controller,\r\n\t\t\t\t\t(string)$this->action,\r\n\t\t\t\t\t(string)$this->name,\r\n\t\t\t\t\t(string)$this->description,\r\n\t\t\t\t\t(int)$this->status,\r\n\t\t\t\t\t(int)Helper::getIpAddress(true),\r\n\t\t\t\t\t(int)$this->datecreated,\r\n\t\t\t\t\t(int)$this->datemodified\r\n\t\t\t\t\t))->rowCount();\r\n\r\n\t\t$this->id = $this->db->lastInsertId();\r\n\t\treturn $this->id;\r\n\t}", "public function recInsert($record) {\n $conn = Query::connect();\n $col = $conn->SelectLimit(\"select*from \".static::getTable(),1);\n $sql = $conn->GetInsertSQL($col,$record);\n $rs = $conn->Execute($sql);\n return $conn->ErrorNo();\n }", "private function _addTags()\n {\n $metadata = $this->getRecordMetadata();\n $this->_record->addTags($metadata[self::TAGS]);\n }", "public function add() {\n $this->usePostRequest();\n //$this->dbFileModel->add_file();\n }", "function insert_record () {\n // validate input\n $valid = true;\n if (empty($this->name)) {\n $this->nameError = 'Please enter Name';\n $valid = false;\n }\n\n if (empty($this->email)) {\n $this->emailError = 'Please enter Email Address';\n $valid = false;\n } \n\n if (empty($this->mobile)) {\n $this->mobileError = 'Please enter Mobile Number';\n $valid = false;\n }\n\n // insert data\n if ($valid) {\n $pdo = Database::connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"INSERT INTO customers (name,email,mobile) values(?, ?, ?)\";\n $q = $pdo->prepare($sql);\n $q->execute(array($this->name,$this->email,$this->mobile));\n Database::disconnect();\n header(\"Location: customer.php\");\n }\n else {\n $this->create_record();\n }\n }", "public function add_record()\n {\n $data['main_content'] = $this->type.'/'.$this->viewname.'/add';\n\t $this->load->view($this->type.'/assets/template',$data);\n }", "public function mass_add()\n {\n }", "public function create() //添加\n {\n\t\t//\n }", "public function addChild(Doctrine_Record $record);", "abstract public function insertRecord($tableName, $record);", "public function NewRecord()\n {\n global $g_BizSystem;\n $this->SetDisplayMode(MODE_N);\n $recArr = $this->GetNewRecord();\n if (!$recArr)\n return $this->ProcessDataObjError();\n $this->UpdateActiveRecord($recArr);\n // TODO: popup message of new record successful created\n return $this->ReRender();\n }", "public function record() {\n $data = array(\n \"name\" => $this->name,\n \"description\" => $this->description,\n \"image\" => $this->image,\n \"type\" => $this->type,\n \"discount\" => $this->discount_offer,\n \"code\" => $this->coupon_code,\n \"expiration\" => $this->expiration\n );\n return $this->db->insert(\"trade\", $data);\n }", "protected function saveInsert()\n {\n }", "public function add($data)\n {\n }", "function add_record(){\r\n\t\t//This is done because of the \"duplicate key\" issues due to multiple hits of PayPal return URL by PayPal\r\n\t\t$query = \"select id from risk_score where cart_id=$this->cart_id\";\r\n\t\t$result = mysql_query($query);\r\n\t\tif(mysql_error()!=\"\"){\r\n\t\t\treturn \"Error: An error occurred while checking if a record exists in risk_score for cart_id $cart_id. Error is: \".mysql_error();\r\n\t\t}\r\n\t\tif(mysql_num_rows($result)!=0){\r\n\t\t\t$row = mysql_fetch_assoc($result);\r\n\t\t\t$this->id = $row[\"id\"];\r\n\t\t\treturn $this->id;\r\n\t\t}\r\n\t\t\r\n\t\t$query = \"insert into risk_score(\r\n\t\t\t\t\t\torder_status, \r\n\t\t\t\t\t\tcart_id, \r\n\t\t\t\t\t\tip_address, \r\n\t\t\t\t\t\tip_location, \r\n\t\t\t\t\t\trisk_score, \r\n\t\t\t\t\t\thigh_purchase_activity, \r\n\t\t\t\t\t\tcountry_blacklisted, \r\n\t\t\t\t\t\tfree_provider_email, \r\n\t\t\t\t\t\tip_blacklisted, \r\n\t\t\t\t\t\tip_not_matches_country, \r\n\t\t\t\t\t\tfwd_num_not_match_site, \r\n\t\t\t\t\t\tmultiple_fwd_numbers, \r\n\t\t\t\t\t\tfwd_num_blacklisted, \r\n\t\t\t\t\t\tnew_member, \r\n\t\t\t\t\t\torder_over_20_dollars, \r\n\t\t\t\t\t\tover_2_nums_in_7_days, \r\n\t\t\t\t\t\tover_1_acct_credit_in_7_days,\r\n\t\t\t\t\t\tdocs_required\r\n\t\t\t\t\t)values(\r\n\t\t\t\t\t\t\".$this->order_status.\", \r\n\t\t\t\t\t\t\".$this->cart_id.\", \r\n\t\t\t\t\t\t'\".$this->ip_address.\"', \r\n\t\t\t\t\t\t'\".$this->ip_location.\"', \r\n\t\t\t\t\t\t\".$this->risk_score.\", \r\n\t\t\t\t\t\t'\".$this->high_purchase_activity.\"', \r\n\t\t\t\t\t\t'\".$this->country_blacklisted.\"', \r\n\t\t\t\t\t\t'\".$this->free_provider_email.\"', \r\n\t\t\t\t\t\t'\".$this->ip_blacklisted.\"', \r\n\t\t\t\t\t\t'\".$this->ip_not_matches_country.\"', \r\n\t\t\t\t\t\t'\".$this->fwd_num_not_match_site.\"', \r\n\t\t\t\t\t\t'\".$this->multiple_fwd_numbers.\"', \r\n\t\t\t\t\t\t'\".$this->fwd_num_blacklisted.\"', \r\n\t\t\t\t\t\t'\".$this->new_member.\"', \r\n\t\t\t\t\t\t'\".$this->order_over_20_dollars.\"', \r\n\t\t\t\t\t\t'\".$this->over_2_nums_in_7_days.\"', \r\n\t\t\t\t\t\t'\".$this->over_1_acct_credit_in_7_days.\"',\r\n\t\t\t\t\t\t'\".$this->docs_required.\"'\r\n\t\t\t\t\t)\";\r\n\t\t$result = mysql_query($query);\r\n\t\tif(mysql_error()==\"\"){\r\n\t\t\t$this->id = mysql_insert_id();\r\n\t\t\treturn $this->id;\r\n\t\t}else{\r\n\t\t\treturn \"Error: An error occurred while inserting Risk Score record.<br><br>\".mysql_error().\"<br><br>Query is: $query\";\r\n\t\t}\r\n\t\t\r\n\t}", "public function add() {\n\t\t\n\t\t$data = array(\n\t\t\t'user_id' => $this->_user_id,\n\t\t\t'date' => $this->_date,\n\t\t\t'time_of_day' => $this->_time_of_day,\n\t\t\t'type_id' => $this->_type_id,\n\t\t\t'route_id' => $this->_route_id,\n\t\t\t'distance' => $this->_distance,\n\t\t\t'time' => $this->_time,\n\t\t\t'shoe_id' => $this->_shoe_id,\n\t\t\t'quality' => $this->_quality,\n\t\t\t'effort' => $this->_effort,\n\t\t\t'weather_ids' => $this->_weather_ids,\n\t\t\t'temperature' => $this->_temperature,\n\t\t\t'notes' => $this->_notes,\n\t\t\t'field' => $this->_field,\n\t\t\t'placement' => $this->_placement,\n\t\t\t'group_min_age' => $this->_group_min_age,\n\t\t\t'group_max_age' => $this->_group_max_age,\n\t\t\t'group_age_size' => $this->_group_age_size,\n\t\t\t'group_age_placement' => $this->_group_age_placement,\n\t\t\t'group_gender_size' => $this->_group_gender_size,\n\t\t\t'group_gender_placement' => $this->_group_gender_placement,\n\t\t\t'active' => $this->_active\n\t\t);\n\t\t$this->db->insert($this->_table,$data);\n\t\t\n\t\treturn true;\n\t}", "function CustomAdd(&$values, &$keys, &$error, $inline, &$pageObject)\n{\n\n\t\tcalendar_AddRecord($values);\n\nreturn false;\n;\t\t\n}", "function insert_record($obj,$param_method=\"request\",$param_obj=\"\")\n\n\t{\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::insert_record() - PARAMETER LIST : ', $param_array);\n\n\t\t\n\n\t\t$initial_qry = \"insert into \" . $obj->cls_tbl . \" (\";\n\n\t\t\n\n\t\t$obj = set_values($obj,$param_method,$param_obj,\"insert\");\n\n\n\n\t\t$fld_arr = get_object_vars($obj);\n\n\n\n\t\t$qry_fld_list = \"\";\n\n\t\t$mid_qry = \") values (\";\n\n\t\t$qry_val_list = \"\";\n\n\t\t$file_attachment_status = 1;\n\n\t\t//added on 26-04-2007\n\n\t\t$del_file_name = array();\n\n\t\t//end\n\n\t\tforeach($fld_arr as $key => $value)\n\n\t\t{\n\n\t\t\n\n\t\t\tif(is_array($value) && strtolower($key) != \"image_copies\" && strtolower($key) != \"image_dimensions\" && strtolower($key) != \"upload_msgs\")\n\n\t\t\t{\n\n\t\t\t\t\n\n\t\t\t\t//print_r($_REQUEST);\n\n\t\t\t\t\n\n\t\t\t\t//if(1 == 1 || isset($GLOBALS['param_arr'][$value['frm_fldname']]) || (!isset($GLOBALS['param_arr'][$value['frm_fldname']]) && $value['save_todb'] == 'true'))\n\n\t\t\t\t//if(isset($value['value']) && !$value['save_todb'])\n\n\t\t\t\t{\n\n\t\t\t\t\t\n\n\t\t\t\t\t//27012007 - need to handle file fields. - Start\n\n\n\n\t\t\t\t\tif(strtolower($value['frm_fld_type']) == \"file\" && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['s'] > 0)\n\n\t\t\t\t\t\t\t$s = $obj->image_dimensions[$value['frm_fldname']]['s'];\n\n\t\t\t\t\t\telse if($obj->attachment_s > 0)\n\n\t\t\t\t\t\t\t$s = $obj->attachment_s;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$s = $GLOBALS['site_config']['files_allowed_size'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t$temp_file_name = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], \"s\", $s);\n\n\t\t\t\t\t\t$value['value'] = $temp_file_name;\n\n\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t$del_file_name[] = $value['value'];\n\n\t\t\t\t\t\t//end\n\n\t\t\t\t\t\tif($temp_file_name == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t$file_attachment_status = 0;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if((strtolower($value['frm_fld_type']) == \"img\" || strtolower($value['frm_fld_type']) == \"imgcopy\") && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['s'] > 0)\n\n\t\t\t\t\t\t\t$s = $obj->image_dimensions[$value['frm_fldname']]['s'];\n\n\t\t\t\t\t\telse if($obj->attachment_s > 0)\n\n\t\t\t\t\t\t\t$s = $obj->attachment_s;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$s = $GLOBALS['site_config']['files_allowed_size'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['h'] > 0)\n\n\t\t\t\t\t\t\t$h = $obj->image_dimensions[$value['frm_fldname']]['h'];\n\n\t\t\t\t\t\telse if($obj->attachment_h > 0)\n\n\t\t\t\t\t\t\t$h = $obj->attachment_h;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$h = $GLOBALS['site_config']['files_allowed_h'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['w'] > 0)\n\n\t\t\t\t\t\t\t$w = $obj->image_dimensions[$value['frm_fldname']]['w'];\n\n\t\t\t\t\t\telse if($obj->attachment_w > 0)\n\n\t\t\t\t\t\t\t$w = $obj->attachment_w;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$w = $GLOBALS['site_config']['files_allowed_w'];\n\n\n\n\t\t\t\t\t\tif(strtolower($value['frm_fld_type']) == \"imgcopy\" && $obj->image_copies[$value['frm_fldname']][0] > 0 && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$ret_val = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], \"s\", $s);\n\t\t\t\t\t\tif($ret_val == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t$file_attachment_status = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(strtolower($value['frm_fld_type']) == \"img\")\n\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t//$value['value'] = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], $obj->attachment_conditions, $s, $h, $w);\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$attach_cond = $obj->image_dimensions[$value['frm_fldname']]['chk_cond'];\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif(strlen(trim($attach_cond)) <= 0)\n\n\t\t\t\t\t\t\t$attach_cond = $obj->attachment_conditions;\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$temp_file_name = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], $attach_cond, $s, $h, $w);\n\n\t\t\t\t\t\t\t$value['value'] = $temp_file_name;\n\n\t\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t\t$del_file_name[] = $value['value'];\n\n\t\t\t\t\t\t\t//end\n\n\t\t\t\t\t\t\tif($temp_file_name == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t\t$file_attachment_status = 0;\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\t//27012007 - need to handle file fields. - End\n\n\n\n\t\t\t\t\tif((((strtolower($value['frm_fld_type']) == \"file\" || strtolower($value['frm_fld_type']) == \"img\") && $_FILES[$value['frm_fldname']]['size'] > 0 && trim($value['value']) != \"File Not Uploaded.\") || !(strtolower($value['frm_fld_type']) == \"file\" || strtolower($value['frm_fld_type']) == \"img\")) && $value['value'] != \"do_not_frame_in_sql\" && strtolower($value['frm_fld_type']) != \"imgcopy\")\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$qry_fld_list .= $key . \", \";\n\n\t\t\t\t\t\t$qry_val_list .= \"'\" . wrap_values($value['value']) . \"', \";\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(strtolower($value['frm_fld_type']) == \"imgcopy\" && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\tforeach($ret_val as $imgc_key => $imgc_val)\n\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$qry_fld_list .= $imgc_key . \", \";\n\n\t\t\t\t\t\t\t$qry_val_list .= \"'\" . wrap_values($imgc_val) . \"', \";\n\n\t\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t\t$del_file_name[] = $imgc_val;\n\n\t\t\t\t\t\t\t//end\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\n\n\n\t\t\t}\n\n\t\t\n\n\t\t}//end foreach\n\n\t\t\n\n\t\t$qry_fld_list = substr($qry_fld_list, 0, -2);\n\n\t\t$qry_val_list = substr($qry_val_list, 0, -2);\n\n\t\t\n\n\t\t$final_insert_query = $initial_qry . $qry_fld_list . $mid_qry . $qry_val_list . \")\";\n\n\t\t\n\n\t\tif($file_attachment_status == 1)//10042007\n\n\t\t\t$res = $this->execute_sql($final_insert_query,\"insert\");\n\n\t\telse\n\n\t\t{\n\n\t\t\t//added on 26-04-2006\n\n\t\t\tforeach($del_file_name as $key => $del_value)\n\n\t\t\t{\n\n\t\t\t\t$del_filename = $del_value;\n\n\t\t\t\t$del_filepath = $obj->attachment_path . $del_filename;\n\n\t\t\t\t\n\n\t\t\t\tif(file_exists($del_filepath) && is_file($del_filepath))\n\n\t\t\t\tunlink($del_filepath);\n\n\t\t\t}//end\n\n\t\t\t\n\n\t\t\t$res = array(\"insertion failed\");\n\n\t\t}\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::insert_record() - Return Value : ', $res);\n\n\t\t\n\n\t\treturn $res;\n\n\t\t\n\n\t}", "public function testAdd() {\n\t\t$data = $this->record;\n\t\tunset($data['CreditNote']['id']);\n\t\t$result = $this->CreditNote->add($data);\n\t\t$this->assertTrue($result);\n\t\t\n\t\ttry {\n\t\t\t$data = $this->record;\n\t\t\tunset($data['CreditNote']['id']);\n\t\t\t//unset($data['CreditNote']['title']);\n\t\t\t$result = $this->CreditNote->add($data);\n\t\t\t$this->fail('No exception');\n\t\t} catch (OutOfBoundsException $e) {\n\t\t\t$this->pass('Correct exception thrown');\n\t\t}\n\t\t\n\t}", "public function add()\n\t{\n\t\t$fake_id = $this->_get_id_cur();\n\t\t$form = array();\n\t\t$form['view'] = 'form';\n\t\t$form['validation']['params'] = $this->_get_params();\n\t\t$form['submit'] = function()use ($fake_id)\n\t\t{\n\t\t\t$data = $this->_get_inputs();\n\t\t\t$data['sort_order'] = $this->_model()->get_total() + 1;\n\t\t\t$id = 0;\n\t\t\t$this->_model()->create($data,$id);\n\t\t\t// Cap nhat lai table_id table file\n\t\t\tmodel('file')->update_table_id_of_mod($this->_get_mod(), $fake_id, $id);\n\t\t\tfake_id_del($this->_get_mod());\n\n\t\t\tset_message(lang('notice_add_success'));\n\t\t\t\n\t\t\treturn admin_url($this->_get_mod());\n\t\t};\n\t\t$form['form'] = function() use ($fake_id)\n\t\t{\n\t\t\t$this->_create_view_data($fake_id);\n\n\t\t\t$this->_display('form');\n\t\t};\n\t\t$this->_form($form);\n\t}", "function insertNewRecord($f){\n global $db;\n\n $sql= \"INSERT INTO products (partno,description) VALUES (\"\n .\"'\".$f['partno'].\"', \"\n .\"'\".$f['description'].\"')\";\n Basic::EventLog(\"Products->insertNewRecord: \".$sql);\n //Basic::EventLogDB(\"Product added - UID:\".$f['uid'].\", Modulo: \".$f['module'].\", Permiso: \".$f['perm']);\n $res =& $db->query($sql);\n return $res;\n }", "function cresponsable_add() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"responsable\"] = new cresponsable();\n\n\t\t// Initialize other table object\n\t\t$GLOBALS['usuario'] = new cusuario();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'add', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'responsable', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\t}", "function insert_record()\n\t{\n\t $dbname=$this->dbname;\n\t $DB1=$this->__connect($dbname,$this->table_name);\n $fields_data=$this->__list_fields_data($dbname,$this->table_name);\n // echo_array($fields_data);\n $index=$this->_get_primary($fields_data);\n //echo $index;\n //echo_array($_POST);\n \n \n //since we are coming from a form there\n //are $_POST values\n foreach ($fields_data->name as $key=>$value)\n {\n $data[$value['name']]=$_POST[$value['name']];\n }\n\n //needs checking if a FOREIGN FIELD\n //insert into database \n $this->db->insert($this->table_name, $data);\n\n $keys=(array_keys($data));\n $values=(array_values($data));\n\n //prepare some data for the form controls\n //in this case the Tdataset control\n \n $i=0;\n $num_fields=count($keys);\n for ($i=0;$i<$num_fields;$i++){\n $this->table->add_row($keys[$i],$values[$i]);\n }\n $this->table->set_heading('field','Value');\n $this->table->set_caption('Insert');\n $this->table->set_template($this->tmpl);\n $s=$this->table->generate();\n $s.='<a href=\"http://localhost/CodeIgniter/admin/dbutil/browse/'.$dbname.'/'.$this->table_name.'\">Click to Edit More</a>';\n return $s;\n\t}", "function log_record_add($rec, $sort, $type, $record) {\n $pid = $type.':'.$rec.'.'.$sort;\n if (strlen($record) > 0) {\n lr_set($pid, $record);\n } else {\n lr_clear($pid);\n }\n}", "public function add_payer_record($data){\n\t\t$this->db->insert('tat_finance_payers', $data);\n\t\tif ($this->db->affected_rows() > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function make_record($id, $patient, $doctor, $rad, $type, $p_date, $t_date, $diag, $desc){\n\t$conn = connect();\n\t$sql = \"insert into radiology_record values (\".(string)$id.\", \".(string)$patient.\", \".(string)$doctor.\", \".(string)$rad.\", '\".(string)$type.\"', TO_DATE('\".(string)$p_date.\"', 'YYYY-MM-DD'), TO_DATE('\".(string)$t_date.\"', 'YYYY-MM-DD'), '\".(string)$diag.\"', '\".(string)$desc.\"')\";\n\n\tif(($statement = oci_parse($conn, $sql)) == false){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$exec = oci_execute($statement);\n\n\tif(!$exec){\n\t\t$err = oci_error($statement);\n\t\toci_free_statement($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\toci_commit($conn);//_______________________________-----------------------------------------------------------------------------------------------\n\toci_free_statement($statement);\n\toci_close($conn);\n}", "public function insert() {\n \n }", "public function p_add() {\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\t\t\n\t\t# Unix timestamp of when this post was created / modified\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\t\t$_POST['created_by'] = $this->user['email'];\n\t\t$_POST['modified_by'] = $this->user['email'];\n\t\tunset($_POST['MAX_FILE_SIZE']);\n\n\t\t# Insert\n\t\t# Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n\t\tDB::instance(DB_NAME)->insert('teachers', $_POST);\n\n\t\t\n\t\t# Send them to the main page\n\t\tRouter::redirect(\"/\");\n\n\n\t}", "function addPatientNotesToDatabase($fileNumber, $name, $phoneNo, $dateOfBirth, $progressNotes, $dentist)\n{\n $result = ['result' => false, 'message' => 'Unable to save patient Notes !'];\n $isPatientDataValid = isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth);\n if (!$isPatientDataValid['result']) {\n $result['message'] = $isPatientDataValid['message'];\n return $result;\n }\n $data = [\n 'FileNumber' => $fileNumber,\n 'PatientName' => $name,\n 'PatientNo' => $phoneNo,\n 'DOB' => $dateOfBirth,\n 'DentistName' => $dentist,\n ];\n $data['AppointmentDate'] = getDefaultDate();\n $data['AppointmentTime'] = getDefaultDate(null, true);\n $isDentistAvailable = isDentistAvailable($data['DentistName'], $data['AppointmentTime']);\n if (!$isDentistAvailable['result']) {\n $result['message'] = $isDentistAvailable['message'];\n return $result;\n }\n $data['ProgressNotes'] = $progressNotes;\n $appObject = getAppointmentObject($data);\n $appObject = setAppointmentId($appObject);\n $patientSaved = saveRecord(APPOINTMENTS_COLLECTION, $appObject, true);\n\n if ($patientSaved) {\n $result['message'] = \"Patient Notes Saved Successfully\";\n $result['result'] = true;\n return $result;\n }\n return $result;\n}", "public function save_new_record() {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$db_data = $this->get_db_data();\r\n\r\n\t\t$table_name = $wpdb->prefix . CTF_POSTS_TABLE;\r\n\t\t$data = array(\r\n\t\t\t'twitter_id' => $db_data['twitter_id'],\r\n\t\t\t'created_on' => $db_data['created_on'],\r\n\t\t\t'last_requested' => $db_data['last_requested'],\r\n\t\t\t'time_stamp' => $db_data['time_stamp'],\r\n\t\t\t'json_data' => $db_data['json_data'],\r\n\t\t\t'media_id' => $db_data['media_id'],\r\n\t\t\t'sizes' => $db_data['sizes'],\r\n\t\t\t'aspect_ratio' => $db_data['aspect_ratio'],\r\n\t\t\t'images_done' => $db_data['images_done']\r\n\t\t);\r\n\t\t$format = array(\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%d',\r\n\t\t\t'%d'\r\n\t\t);\r\n\t\t$error = $wpdb->insert( $table_name, $data, $format );\r\n\r\n\t\tif ( $error !== false ) {\r\n\t\t\t$insert_id = $wpdb->insert_id;\r\n\r\n\t\t\t$this->db_id = $insert_id;\r\n\t\t\t$this->insert_ctf_feeds_posts();\r\n\t\t} else {\r\n\t\t\t// log error\r\n\t\t}\r\n\t}", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function add(){\n $tab = DB::table('student');\n $res = $tab -> insert(['name' => '小黑', 'age' => '18']);\n }", "private function addRecord( $objTable ){\r\n\r\n\t\t\t$tableName = $objTable->table_name;\r\n\t\t\tunset( $objTable->table_name );\r\n\r\n\t\t\tforeach( $objTable as $key => $value ){\r\n\t\t\t\t$objTable->$key = addslashes(trim($value));\r\n\t\t\t}\r\n\t\t\t$this->post( $objTable, $tableName );\r\n\r\n\t\t}", "public function add_record() {\n\n $b_n = $this->input->post('b_name');\n $this->db->where('b_name', $b_n);\n $query = $this->db->get('business');\n\n $b_id = $query->row(0)->b_id;\n\n $data = array(\n\n 'user_id' => $this->session->userdata('user_id'),\n 'b_id' => $b_id,\n 'type_id' => $this->input->post('type_id'),\n 'out_id' => $this->input->post('out_id'),\n 'entry_date' => $this->input->post('entry_date'),\n 'notes' => $this->input->post('notes')\n\n );\n\n $this->db->insert('entries', $data);\n\n redirect('index.php/Prospects');\n\n }", "function createRecord($array){\n parent::createRecord($array);\n }", "protected function initDatabaseRecord() {}", "abstract public function add_item();", "public function add($data)\n {\n // $this->db->insert($this->_table, $this);\n\t\t$this->db->insert('tb_event', $data);\n\t\t\treturn true;\n }", "public function save()\n\t {\n\t\tif (isset($this->_advert->date) === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$bigfile = new BigFile(\"base-\" . $this->_advert->phone, 10);\n\t\t\t$bigfile->addrecord($this->_advert->date);\n\t\t } //end if\n\n\t }", "public function addToDb()\n {\n\n // make sure this is a valid new entry\n if ($this->isValid()) {\n // check for duplicate\n $vals = sprintf(\"('%s',%d)\",$this->email,$this->level);\n $sql = \" insert into Admins values $vals\";\n Dbc::getReader()->Exec($sql);\n }\n else\n print \"<br> Invalid entry. STOP! ($sql)<br>\";\n }", "function onNewRecord($record, $oldRecord);", "protected function _postInsert()\n\t{\n\t}", "public function add(){\n\t\t\n\t\t// Open or create file\n\t\t$f = fopen($this->file, 'wb');\n\t\tfclose($f);\n\t}", "function add_newuser($user) {\n global $DB;\n $DB->insert_record('report_user_statistics', $user, false);\n}", "function OnAfterAdd(){\n //get keyfield value\n if (intval($this->item_id) == 0)\n $data = $this->Storage->GetRecord(null, array(\n $this->key_field => \"\"));\n $this->item_id = $data[$this->key_field];\n }", "public function createRecord($request){\n\t}", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "public function insert() {\n $this->data['creation_datetime']=date('Y-m-d H:i:s');\n $this->data['last_login_datetime']=date('Y-m-d H:i:s');\n if (array_key_exists('expiresIn', $this->rawData) && $this->rawData['expiresIn'] != '') {\n $this->data['expires_datetime']=date('Y-m-d H:i:s', time()+$this->rawData['expiresIn']); \n }\n parent::insert();\n }", "function insert_record($data){\n\t$this->db->insert('tblname', $data);\n\t}", "public function add($data) {\r\n\t \tglobal $wpdb;\r\n\t \t\r\n\t \tif ($wpdb->insert( $this->table, (array) $data ))\r\n\t \t\t$return = $wpdb->insert_id;\r\n\t \telse\r\n\t \t\t$return = FALSE;\r\n\t \t\r\n\t \treturn $return;\r\n\t }", "function add()\n {\n //-- 1. create a student record.(Number must be seven chars)\n $student = new stdClass();\n echo \"\\n Enter id:\";\n $student->student_id = trim(fgets(STDIN));\n $exists = 0;\n foreach ($students as $Student => $id) {\n if($student->student_id == $id)\n {\n $exists = 1;\n }\n };\n\n if( $exists == 0 && is_numeric($student->student_id) && strlen((string)$student->student_id)>7)\n {\n echo \" Enter name:\";\n $student->name = trim(fgets(STDIN));\n echo \" Enter surname:\";\n $student->surname = trim(fgets(STDIN));\n echo \" Enter age:\";\n $student->age = trim(fgets(STDIN));\n echo \" Enter curriculum:\";\n $student->curriculum = trim(fgets(STDIN));\n $content = json_encode($student);\n\n $dir = \"students/\".substr($student->student_id,0,2);\n mkdir($dir,0777,true);\n $record = fopen($_SERVER['DOCUMENT_ROOT'] . $dir .\"/\". $student->student_id. \".json\",\"wb\");\n if (!$record) {\n err(\"file already exists\");\n }\n\n fwrite($record,$content);\n fclose($record);\n\n echo \"\\n \\033[32m A student(\".$student->student_id.\") was just created succesfully in!!\\033[0m\";\n } else {\n if($exists == 1)\n err(\"A Student Id number\\033[0m already exists.\");\n elseif (!is_numeric($student->student_id))\n err(\"This Student Id number\\033[0m isn't a number.\");\n else\n err(\"A Student Id number\\033[0m must have more than 7 numeric characters\");\n\n }\n }" ]
[ "0.73360115", "0.7191746", "0.7143747", "0.709628", "0.6996979", "0.67771524", "0.67488796", "0.6684954", "0.6682076", "0.6638586", "0.6608946", "0.6603813", "0.6575016", "0.6556095", "0.6556095", "0.65030473", "0.64929545", "0.645569", "0.6448945", "0.6444162", "0.64316386", "0.6405842", "0.6402431", "0.63874", "0.63850343", "0.638281", "0.638158", "0.6327212", "0.6327212", "0.6327212", "0.6320658", "0.6320658", "0.631071", "0.63071406", "0.63017464", "0.6300208", "0.6300208", "0.6278612", "0.62776005", "0.6277092", "0.6264223", "0.62544495", "0.62466913", "0.62348217", "0.6223877", "0.62125576", "0.6203437", "0.6203437", "0.6203119", "0.6196485", "0.6195694", "0.61869156", "0.6180448", "0.6179853", "0.6177716", "0.61766404", "0.61643326", "0.6154622", "0.6154555", "0.61478114", "0.61416143", "0.6134783", "0.6133535", "0.610607", "0.6102029", "0.6099872", "0.60985637", "0.6095361", "0.60802037", "0.6071899", "0.6071853", "0.60660535", "0.6049713", "0.6049675", "0.6037464", "0.6033323", "0.60310066", "0.6029343", "0.60258013", "0.60255647", "0.6018503", "0.6015962", "0.6006252", "0.59995973", "0.5996543", "0.59913284", "0.59824693", "0.5981382", "0.59771293", "0.59702986", "0.596923", "0.59670717", "0.59628946", "0.59628415", "0.59581023", "0.5957368", "0.59566784", "0.59281635", "0.59230685", "0.59221035", "0.5921629" ]
0.0
-1
end of function to update record
public function updateRecord(){ global $db; $data = array('email'=>$this->email); $response = $db->update($this->table,$data,"id = $this->id"); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($record);", "protected function _update()\n\t{\n\t}", "public function updateRecord() \n {\n $str = \"Id = :Id\";\n array_walk($this->arrayKeysValues(), function ($value, $key) use (&$str) {\n $str .= \", $key = :$key\";\n });\n $sql = sprintf(\"UPDATE Cubans SET %s WHERE Id = :Id\", $str);\n $statement = $this->connect->prepare($sql);\n $statement->execute(array_merge([\":Id\" => $this->id], $this->arrayKeysValues()));\n }", "public function update(Tinebase_Record_Interface $_record) {\n }", "public function db_update() {}", "protected function saveUpdate()\n {\n }", "function update_record () {\n\t\t\n\t\t// validate input\n $valid = true;\n if (empty($this->name)) {\n $this->nameError = 'Please enter Name';\n $valid = false;\n }\n\n if (empty($this->email)) {\n $this->emailError = 'Please enter Email Address';\n $valid = false;\n } \n\n\n if (empty($this->mobile)) {\n $this->mobileError = 'Please enter Mobile Number';\n $valid = false;\n }\n\n // update data\n if ($valid) {\n $pdo = Database::connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"UPDATE customers SET name = ?, email = ?, mobile = ? WHERE id=\".$_GET['id'];\n $q = $pdo->prepare($sql);\n $q->execute(array($this->name,$this->email,$this->mobile));\n Database::disconnect();\n header(\"Location: customer.php\");\n }\n else {\n $this->update();\n }\n\t\n\t}", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "protected function update() {}", "public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }", "protected function _updatefields() {}", "function update($idMedicalRecord) // Implementation \r\n\t\t{\r\n\t\t\t$this->idMedicalRecord = $idMedicalRecord;\r\n\t\t\t$dbo = database::getInstance(); // pass back that database object already created perhaps\r\n\t\t\t$sql = $this->buildQuery('update'); // what we want to do (update records)\r\n\r\n\t\t\t$dbo->doQuery($sql); // execute query statement\r\n\t\t}", "abstract public function updateData();", "abstract protected function update ();", "public function SQL_UPDATE() {\r\n\t}", "public function commitUpdate();", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "abstract protected function updateModel();", "protected function performUpdate() {}", "abstract public function updateRecord($tableName, $record, $where = '');", "function update($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\t\t// update the collection appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\tif (isset($this->_data[$key]))\n\t\t{\n\t\t\t$this->_data[$key] = $record;\n\t\t\t$this->store();\n\t\t}\n\t}", "private function update(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check permission to update.\n\t\t$result = $this->clsAccessPermission->toUpdate();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to update!\");\n\t\t\treturn;\n\t\t}\n\t\t// Execute Update.\n\t\tif (! $this->objAccessCrud->update ()) {\n\t\t\t$this->msg->setError (\"There were issues on update the record!\");\n\t\t\treturn;\n\t\t}\n\t\t$this->msg->setSuccess (\"Updated the record with success!\");\n\t\treturn;\n\t}", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "public function update(){\r\n\t\tif (!$this->hasChanged) return self::RES_UNCHANGED;\r\n\t\t$table = $this->getTable();\r\n\t\tif ($this->new){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the record doesn't exist.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\tif (!$table->hasPrimaryKey()){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the table does not have a primary key.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$where = array();\r\n\t\t$changeCount = 0;\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\tif ($value->hasChanged()){\r\n\t\t\t\t$vals[] = \"`$name` = \".$value->getSQLValue();\r\n\t\t\t\t$changeCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\t$where[] = \"`$name` = \".$this->values[$name]->getSQLValue();\r\n\t\t}\r\n\t\t$sql = 'UPDATE '.$this->getFullTableName().' SET '.implode(', ',$vals).' WHERE '.implode(' AND ',$where).' LIMIT 1';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to update record in '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "public function update() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with id of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"UPDATE $this->sqlTable SET \";\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$sql .= \"lp_userid = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$sql .= \"lp_random = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$sql .= \"lp_deadline = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\r\n\t\t\t$sql = preg_replace ( '/, $/', '', $sql);\r\n\t\t\t$sql .= \" WHERE lp_id = ?\";\r\n\t\t\t$arrBindings[] = $this->id;\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }", "public function updateRecord() {\r\n\t\tif (isset($_POST['level']) && $_POST['level']=='header') $this->updateHeader();\r\n\t\tif (isset($_POST['level']) && $_POST['level']=='detail') $this->updateDetail();\r\n\t}", "function editRecord($rec)\r\n\t\t{\r\n\t\t\t// Create associative array of key fields and data values\r\n\t\t\t$data = array(\"idMedicalRecord\"=>$rec[0],\"medicalRec_weight\"=>$rec[1],\"medicalRec_height\"=>$rec[2],\"medicalRec_bloodPressure\"=>$rec[3],\"medicalRec_temperature\"=>$rec[4],\"medicalRec_bloodIronLevel\"=>$rec[5],\"medicalRec_time\"=>$rec[6],\"medicalRec_date\"=>$rec[7],\"medicalRec_medicalHistory\"=>$rec[8],\"medicalRec_rejectionReason\"=>$rec[9]);\r\n\t\t\t// Bind values to object's attributes\r\n\t\t\t$this->bind($data);\r\n\t\t\t// Add new updated values to table in database to location of given Primary key\r\n\t\t\t$this->update($rec[0]);\r\n\t\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",email1=\\\"$this->email1\\\",address1=\\\"$this->address1\\\",lastname=\\\"$this->lastname\\\",phone1=\\\"$this->phone1\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function DoUpdate()\n\t{\n\n\t\treturn db_update_records($this->fields, $this->tables, $this->values, $this->filters);\n\t}", "protected function _postUpdate()\n\t{\n\t}", "public function updateRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getEditRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('You are not the owner of the record');\n\t\t\t\t}\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// update\n\t\t\t\t$this->getHandler()->update($record);\n\n\n\t\t\t\t$msg = new Message('You have successful edit a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",lastname=\\\"$this->lastname\\\",username=\\\"$this->username\\\",email=\\\"$this->email\\\",kind=\\\"$this->kind\\\",status=\\\"$this->status\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function Do_update_Example1(){\n\n\t}", "private function crud_put($record = null)\n {\n $key = $record['id'];\n // Make sure the new record has an ID\n if (!isset($key))\n {\n $this->response(array('error' => 'Update: No item specified'), 406);\n return;\n }\n // make sure the item is real\n if (!$this->supplies->exists($key))\n {\n $this->response(array('error' => 'Update: Item ' . $key . ' not found'), 406);\n return;\n }\n // proceed with update\n $this->supplies->update($record);\n // check for DB errors\n $oops = $this->db->error();\n if (empty($oops['code']))\n $this->response(array('ok'), 200);\n else\n $this->response($oops, 400);\n }", "function update() {\n\t\t\t$updateQuery = \"UPDATE \".$this->table.\" SET \";\n\n\t\t\t$keysAR = array_keys($this->activeRecord);\n\n\t\t\tfor ($loopUp = 0; $loopUp < count($this->activeRecord); $loopUp++) {\n\n $updateQuery .= $keysAR[$loopUp] . \" = ?, \";\n $paramArray[] = $this->activeRecord[$keysAR[$loopUp]];\n\n\t\t\t}\n\n\t\t\t$updateQuery = substr($updateQuery, 0, -2); // Haal de laatste komma weg.\n\n\t\t\t$updateQuery .= \" WHERE \";\n\n\t\t\t// Fetch de primary key van de tabel.\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n $updateQuery .= $kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\n\t\t\t$this->lastQuery = $updateQuery;\n\n $updateTable = $this->mysqlConnection->prepare($this->lastQuery);\n $updateTable->execute($paramArray);\n\n\t\t}", "public function update($entity){ \n //TODO: Implement update record.\n }", "public function updaterecorddataAction()\n {\n \t$this->_helper->viewRenderer->setNoRender();\n \t\n \t$itemid = $this->getRequest()->getParam('itemID');\n \t$columnname = $this->getRequest()->getParam('column');\n \t$newvalue = $this->getRequest()->getParam('newdata');\n \t$group = GroupNamespace::getCurrentGroup();\n \t\n \tif (isset($itemid) && isset($group))\n \t{\n \t\t$records = $group->getRecords();\n \t\tif (isset($records[$itemid]))\n \t\t{\n \t\t\t$record = $records[$itemid];\n \t\t\t$updatedrecord = $this->updateRecord($record, $columnname, $newvalue);\n \t\t\tif ($this->isIdentification($columnname))\n \t\t\t{\n \t\t\t\t$itemid = ItemDAO::getItemDAO()->saveItemIdentification($updatedrecord, $record);\n \t\t\t}\n \t\t\telseif ($this->isProposal($columnname))\n \t\t\t{\n \t\t\t\t$proposalid = ProposalDAO::getProposalDAO()->saveItemProposal($updatedrecord->getFunctions()->getProposal(), $updatedrecord);\n \t\t\t\t//Set the itemid to null if the proposal update failed.\n \t\t\t\tif (is_null($proposalid))\n \t\t\t\t{\n \t\t\t\t\t$itemid = NULL;\n \t\t\t\t}\n \t\t\t}\n \t\t\telseif ($this->isReport($columnname))\n \t\t\t{\n \t\t\t\t$reportid = ReportDAO::getReportDAO()->saveItemReport($updatedrecord->getFunctions()->getReport(), $record->getFunctions()->getReport(), $updatedrecord);\n \t\t\t\t//Set the itemid to null if the report update failed.\n \t\t\t\tif (is_null($reportid))\n \t\t\t\t{\n \t\t\t\t\t$itemid = NULL;\n \t\t\t\t}\n \t\t\t}\n \t\t\t//If the save was successful, then update the namespace\n \t\t\tif (!is_null($itemid))\n \t\t\t{\n \t\t\t\t$records[$itemid] = $updatedrecord;\n \t\t\t\t$group->setRecords($records);\n \t\t\t\tGroupNamespace::setCurrentGroup($group);\n \t\t\t}\n \t\t\t//TODO: Otherwise, throw an error via json\n \t\t\telse\n \t\t\t{\n \t\t\t\tLogger::log('Update record did not save', Zend_Log::ERR);\n \t\t\t}\n \t\t}\n \t}\n }", "public function update() {\n global $DB;\n $record = array(\n 'sortorder' => $this->sortorder,\n 'criterion' => $this->criterion,\n 'addinfo' => json_encode($this->addinfo)\n );\n if ($this->id) {\n $record['id'] = $this->id;\n $DB->update_record($this->get_table_name(), $record);\n } else {\n $record['instantquizid'] = $this->instantquiz->id;\n $this->id = $DB->insert_record($this->get_table_name(), $record);\n }\n }", "private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }", "private function update()\n {\n $queryString = 'UPDATE ' . $this->table . ' SET ';\n foreach ($this->data as $column => $value) {\n if ($column != self::ID) {\n $queryString .= $column . ' =:' . $column . ',';\n }\n }\n $queryString .= ' updated_at = sysdate() WHERE 1 = 1 AND ' . self::ID . ' =:' . self::ID;\n $this->query = $this->pdo->prepare($queryString);\n }", "function updateRecord($table_name,$uid,$update_field,$update_value,$conn){\n\t\t$update_echo = '';\n\n\t\tfor($i=0;$i<count($update_field);$i++){\n\n\t\t\tif ($i==(count($update_field)-1)) {\n\t\t\t\t$update_echo = $update_echo.$update_field[$i].\"='\".$update_value[$i].\"'\";\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$update_echo = $update_echo.$update_field[$i].\"='\".$update_value[$i].\"', \";\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t$sql = \"UPDATE $table_name SET $update_echo WHERE uid=$uid\";\n\n\t\techo $sql;\n\t\t\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t echo \"Record updated successfully\";\n\t\t} else {\n\t\t echo \"Error updating record: \" . $conn->error;\n\t\t}\n\t}", "public function update_record($table, $dataobject, $bulk=false) {\n\nerror('todo');\n\n global $db, $CFG;\n\n if (! isset($dataobject->id) ) {\n return false;\n }\n\n /// Check we are handling a proper $dataobject\n if (is_array($dataobject)) {\n debugging('Warning. Wrong call to update_record(). $dataobject must be an object. array found instead', DEBUG_DEVELOPER);\n $dataobject = (object)$dataobject;\n }\n\n /// Temporary hack as part of phasing out all access to obsolete user tables XXX\n if (!empty($CFG->rolesactive)) {\n if (in_array($table, array('user_students', 'user_teachers', 'user_coursecreators', 'user_admins'))) {\n if (debugging()) { var_dump(debug_backtrace()); }\n print_error('This SQL relies on obsolete tables ('.$table.')! Your code must be fixed by a developer.');\n }\n }\n\n /// Begin DIRTY HACK\n if ($CFG->dbfamily == 'oracle') {\n oracle_dirty_hack($table, $dataobject); // Convert object to the correct \"empty\" values for Oracle DB\n }\n /// End DIRTY HACK\n\n /// Under Oracle, MSSQL and PostgreSQL we have our own update record process\n /// detect all the clob/blob fields and delete them from the record being updated\n /// saving them into $foundclobs and $foundblobs [$fieldname]->contents\n /// They will be updated later\n if (($CFG->dbfamily == 'oracle' || $CFG->dbfamily == 'mssql' || $CFG->dbfamily == 'postgres')\n && !empty($dataobject->id)) {\n /// Detect lobs\n $foundclobs = array();\n $foundblobs = array();\n db_detect_lobs($table, $dataobject, $foundclobs, $foundblobs, true);\n }\n\n // Determine all the fields in the table\n if (!$columns = $db->MetaColumns($CFG->prefix . $table)) {\n return false;\n }\n $data = (array)$dataobject;\n\n if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; };\n\n // Pull out data matching these fields\n $update = array();\n foreach ($columns as $column) {\n if ($column->name == 'id') {\n continue;\n }\n if (array_key_exists($column->name, $data)) {\n $key = $column->name;\n $value = $data[$key];\n if (is_null($value)) {\n $update[] = \"$key = NULL\"; // previously NULLs were not updated\n } else if (is_bool($value)) {\n $value = (int)$value;\n $update[] = \"$key = $value\"; // lets keep pg happy, '' is not correct smallint MDL-13038\n } else {\n $update[] = \"$key = '$value'\"; // All incoming data is already quoted\n }\n }\n }\n\n /// Only if we have fields to be updated (this will prevent both wrong updates +\n /// updates of only LOBs in Oracle\n if ($update) {\n $query = \"UPDATE {$CFG->prefix}{$table} SET \".implode(',', $update).\" WHERE id = {$dataobject->id}\";\n if (!$rs = $db->Execute($query)) {\n debugging($db->ErrorMsg() .'<br /><br />'.s($query));\n if (!empty($CFG->dblogerror)) {\n $debug=array_shift(debug_backtrace());\n error_log(\"SQL \".$db->ErrorMsg().\" in {$debug['file']} on line {$debug['line']}. STATEMENT: $query\");\n }\n return false;\n }\n }\n\n /// Under Oracle, MSSQL and PostgreSQL, finally, update all the Clobs and Blobs present in the record\n /// if we know we have some of them in the query\n if (($CFG->dbfamily == 'oracle' || $CFG->dbfamily == 'mssql' || $CFG->dbfamily == 'postgres') &&\n !empty($dataobject->id) &&\n (!empty($foundclobs) || !empty($foundblobs))) {\n if (!db_update_lobs($table, $dataobject->id, $foundclobs, $foundblobs)) {\n return false; //Some error happened while updating LOBs\n }\n }\n\n return true;\n }", "function action_update()\n {\n $record = $this->m_node->updateRecord();\n\n if ($this->m_postvars['atkcancel']==\"\")\n { \n\n // just before we validate the record we call the preUpdate() to check if the record needs to be modified\n $this->m_node->preUpdate($record);\n\n $this->m_node->validate($record, \"update\");\n\n $error = count($record['atkerror']) > 0;\n foreach (array_keys($record) as $key)\n $error = $error || (is_array($record[$key]) && count($record[$key]['atkerror']) > 0);\n\n if ($error)\n {\n $this->m_node->m_action=\"edit\";\n $page = &$this->getPage();\n $edithandler = $this->m_node->getHandler(\"edit\");\n $page->addContent($edithandler->invoke(\"editPage\", $record));\n }\n else\n {\n if(!$this->m_node->updateDb($record))\n {\n $this->m_node->m_db->rollback();\n if($this->m_node->m_db->getErrorType()==\"user\")\n {\n triggerError($record, 'Error', $this->m_node->m_db->getErrorMsg(), '', '');\n $this->m_node->m_action=\"edit\";\n $page = &$this->getPage();\n $edithandler = $this->m_node->getHandler(\"edit\");\n $page->addContent($edithandler->invoke(\"editPage\", $record));\n }\n else\n {\n $location = $this->m_node->feedbackUrl(\"update\",ACTION_FAILED, $record, $this->m_node->m_db->getErrorMsg());\n $this->m_node->redirect($location);\n }\n }\n else\n {\n $this->m_node->m_db->commit(); \n \n if ($this->m_postvars['atknoclose']==\"\")\n {\n // 'save and close' was clicked\n $location = $this->m_node->feedbackUrl(\"update\", ACTION_SUCCESS, $record, \"\");\n $this->m_node->redirect($location);\n }\n else\n {\n // 'save' was clicked\n $page = &$this->getPage();\n // $this->m_action=\"edit\";\n //update succesful, pk value might be changed so update m_orgkey\n $record[\"atkprimkey\"] = $this->m_node->primaryKey($record);\n \n if ($this->m_node->hasFlag(NF_LOCK))\n { \n $locked = true;\n }\n \n //$this->setOrgKeyValue($record);\n $this->m_node->m_action = \"edit\"; \n $edithandler = $this->m_node->getHandler(\"edit\");\n $editpage = $edithandler->invoke(\"editPage\", $record, $locked);\n $screen = $this->m_node->renderActionPage(\"edit\", $editpage);\n $page->addContent($screen);\n }\n\n }\n }\n }\n else\n {\n // Cancel was pressed\n $location = $this->m_node->feedbackUrl(\"update\", ACTION_CANCELLED, $record);\n $this->m_node->redirect($location);\n }\n }", "abstract public function update();", "abstract public function update();", "public function update()\n\t{\n\n\t}", "private function internalUpdate()\n {\n $param = array();\n\n // Run before update methods and stop here if the return bool false\n if ($this->runBefore('update') === false)\n return false;\n\n // Define fieldlist array\n $fieldlist = array();\n\n // Build updatefields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n $val = $this->checkFieldvalue($fld, $val);\n $type = $val == 'NULL' ? 'raw' : $this->getFieldtype($fld);\n\n $fieldlist[] = $this->alias . '.' . $fld . '={' . $type . ':' . $fld . '}';\n $param[$fld] = $val;\n }\n\n // Create filter\n $filter = ' WHERE ' . $this->alias . '.' . $this->pk . '={' . $this->getFieldtype($this->pk) . ':' . $this->pk . '}';\n\n // Even if the pk value is present in data, we set this param manually to prevent errors\n $param[$this->pk] = $this->data->{$this->pk};\n\n // Build fieldlist\n $fieldlist = implode(', ', $fieldlist);\n\n // Create complete sql string\n $sql = \"UPDATE {db_prefix}{$this->tbl} AS {$this->alias} SET {$fieldlist}{$filter}\";\n\n // Run query\n $this->db->query($sql, $param);\n\n // Run after update event methods\n if ($this->runAfter('update') === false)\n return false;\n }", "function updateRecord()\n\t{\n\t\t$data['roleName'] = $this->roleName;\n\t\t$data['roleDesc'] = $this->roleDesc;\n\t\t\n\t $this->db->where('roleID', $this->roleID);\n\t\t$this->db->update('roles', $data); \n\t\t\n\t\tif ($this->db->_error_message())\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "function AfterEdit(&$values,$where,&$oldvalues,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid= $keys['proid'];\n$date=$values['bill_date'];\n$amount=$values['amount'];\n$item=$values['item'];\n$bill_no=$values['bill_no'];\n\n\n$sql_update=\"UPDATE student_billing SET \nitem='$item',amount='$amount',amount_balance='$amount',\ndate='$date',\nbill_no='$bill_no'\nWHERE proid='$proid'\";\ndb_exec($sql_update,$conn);\n\n;\t\t\n}", "public function testUpdate(): void { }", "function update_record($obj, $where_condition, $param_method='request')\n\n\t{\n\n\t\t\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::update_record() - PARAMETER LIST : ', $param_array);\n\n\n\n\t\t$initial_qry = \"update \" . $obj->cls_tbl . \" set \";\n\n\t\t\n\n\t\t$obj = set_values($obj,$param_method);\n\n\n\n\t\t$fld_arr = get_object_vars($obj);\n\n\n\n\t\t$qry_fval_list = \"\";\n\n\t\t$file_attachment_status = 1;\n\n\t\tforeach($fld_arr as $key => $value)\n\n\t\t{\n\n\t\t\t\n\n\t\t\tif(is_array($value) && strtolower($key) != \"image_copies\" && strtolower($key) != \"image_dimensions\" && strtolower($key) != \"upload_msgs\")\n\n\t\t\t{\n\n\t\t\t\t//if(isset($GLOBALS['param_arr'][$value['frm_fldname']]) || (!isset($GLOBALS['param_arr'][$value['frm_fldname']]) && $value['save_todb'] == 'true'))\n\n\t\t\t\t{\n\n\n\n\t\t\t\t\t//27012007 - need to handle file fields. - Start\n\n\t\t\t\t\tif($value['frm_fld_type'] == \"file\" && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['s'] > 0)\n\n\t\t\t\t\t\t\t$s = $obj->image_dimensions[$value['frm_fldname']]['s'];\n\n\t\t\t\t\t\telse if($obj->attachment_s > 0)\n\n\t\t\t\t\t\t\t$s = $obj->attachment_s;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$s = $GLOBALS['site_config']['files_allowed_size'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t$temp_file_name = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], \"s\", $s);\n\n\t\t\t\t\t\t$value['value'] = $temp_file_name;\n\n\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t$del_file_name[] = $value['value'];\n\n\t\t\t\t\t\t//end\n\n\t\t\t\t\t\tif($temp_file_name == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t$file_attachment_status = 0;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if((strtolower($value['frm_fld_type']) == \"img\" || strtolower($value['frm_fld_type']) == \"imgcopy\") && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['s'] > 0)\n\n\t\t\t\t\t\t\t$s = $obj->image_dimensions[$value['frm_fldname']]['s'];\n\n\t\t\t\t\t\telse if($obj->attachment_s > 0)\n\n\t\t\t\t\t\t\t$s = $obj->attachment_s;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$s = $GLOBALS['site_config']['files_allowed_size'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['h'] > 0)\n\n\t\t\t\t\t\t\t$h = $obj->image_dimensions[$value['frm_fldname']]['h'];\n\n\t\t\t\t\t\telse if($obj->attachment_h > 0)\n\n\t\t\t\t\t\t\t$h = $obj->attachment_h;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$h = $GLOBALS['site_config']['files_allowed_h'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['w'] > 0)\n\n\t\t\t\t\t\t\t$w = $obj->image_dimensions[$value['frm_fldname']]['w'];\n\n\t\t\t\t\t\telse if($obj->attachment_w > 0)\n\n\t\t\t\t\t\t\t$w = $obj->attachment_w;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$w = $GLOBALS['site_config']['files_allowed_w'];\n\n\n\n\t\t\t\t\t\t\n\n//\t\t\t\t\t\t$value['value'] = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], $obj->attachment_conditions, $s, $h, $w);\n\n\n\n\t\t\t\t\t\tif(strtolower($value['frm_fld_type']) == \"imgcopy\" && $obj->image_copies[$value['frm_fldname']][0] > 0)\n\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$ret_val = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], \"s\", $s);\n\n\t\t\t\t\t\t\tif($ret_val == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t\t$file_attachment_status = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(strtolower($value['frm_fld_type']) == \"img\")\n\n\t\t\t\t\t\t{\n\n\n\n\t\t\t\t\t\t\t//$value['value'] = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], $obj->attachment_conditions, $s, $h, $w);attach_cond\n\n\n\n\t\t\t\t\t\t\t$attach_cond = $obj->image_dimensions[$value['frm_fldname']]['chk_cond'];\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif(strlen(trim($attach_cond)) <= 0)\n\n\t\t\t\t\t\t\t$attach_cond = $obj->attachment_conditions;\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$temp_file_name = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], $attach_cond, $s, $h, $w);\n\n\t\t\t\t\t\t\t$value['value'] = $temp_file_name;\n\n\t\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t\t$del_file_name[] = $value['value'];\n\n\t\t\t\t\t\t\t//end\n\n\t\t\t\t\t\t\tif($temp_file_name == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t\t$file_attachment_status = 0;\n\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\t\n\n\t\t\t\t\t//27012007 - need to handle file fields. - End\n\n\t\t\t\t\tif((((strtolower($value['frm_fld_type']) == \"file\" || strtolower($value['frm_fld_type']) == \"img\") && $_FILES[$value['frm_fldname']]['size'] > 0 && trim($value['value']) != \"File Not Uploaded.\") || !(strtolower($value['frm_fld_type']) == \"file\" || strtolower($value['frm_fld_type']) == \"img\")) && $value['value'] != \"do_not_frame_in_sql\" && strtolower($value['frm_fld_type']) != \"imgcopy\")\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$qry_fval_list .= $key . \" = '\" . wrap_values($value['value']) . \"', \";\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(strtolower($value['frm_fld_type']) == \"imgcopy\" && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\tforeach($ret_val as $imgc_key => $imgc_val)\n\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$qry_fval_list .= $imgc_key . \" = '\" . wrap_values($imgc_val) . \"', \";\n\n\t\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t\t$del_file_name[] = $imgc_val;\n\n\t\t\t\t\t\t\t//end\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\n\n\t\t}//end foreach\n\t\t\n\n\t\tif($file_attachment_status == 1)\n\n\t\t{//only if newer files are uploaded need to delete the older ones.\n\n\t\tforeach($fld_arr as $key => $value)\n\n\t\t{\n\n\t\t\tif((strtolower($value['frm_fld_type']) == \"file\" || strtolower($value['frm_fld_type']) == \"img\" || strtolower($value['frm_fld_type']) == \"imgcopy\") && $_FILES[$value['frm_fldname']]['size'] > 0 && strlen(trim($value['value'])) != \"File Not Uploaded.\")\n\n\t\t\t{\n\n\t\t\t\t$del_fld = $key;\n\n\t\t\t\tif(strtolower($value['frm_fld_type']) == \"imgcopy\")\n\n\t\t\t\t{\n\n\t\t\t\t\t\n\n\t\t\t\t\t$fld_arr = explode(\",\", $obj->image_copies[$value['frm_fldname']][1]);\n\n\t\t\t\t\t$flds = \"\";\n\n\t\t\t\t\tforeach($fld_arr as $d_k => $d_v)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$d_arr = explode(\"|\", $d_v);\n\n\t\t\t\t\t\t$flds .= $d_arr[0] . \",\";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\t$flds = substr($flds, 0, -1);\n\n\t\t\t\t\t\n\n\t\t\t\t\t$del_fld = $flds;\n\n\t\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t$del_fileres = $this->fetch_flds($obj->cls_tbl, $del_fld, $where_condition);\n\n\t\t\t\t\n\n\t\t\t\t$del_file_data = mysql_fetch_assoc($del_fileres[0]);\n\n\t\t\t\t\n\n\t\t\t\tforeach($del_file_data as $del_key => $del_value)\n\n\t\t\t\t{\n\n\t\t\t\t\n\n\t\t\t\t$del_filename = $del_value;\n\n\t\t\t\t$del_filepath = $obj->attachment_path . $del_filename;\n\n\t\t\t\t\n\n\t\t\t\tif(file_exists($del_filepath) && is_file($del_filepath))\n\n\t\t\t\tunlink($del_filepath);\n\n\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t}//end if\n\n\t\t\n\n\t\t$qry_fval_list = substr($qry_fval_list, 0, -2);\n\n\t\t\n\n\t\t$final_update_query = $initial_qry . $qry_fval_list . \" where \" . $where_condition;\n\n\t\t\n\n\t\tif($file_attachment_status == 1)\n\n\t\t\t$res = $this->execute_sql($final_update_query,\"update\");\n\n\t\telse\n\n\t\t{\n\n\t\t\t//added on 26-04-2006\n\n\t\t\tforeach($del_file_name as $key => $del_value)\n\n\t\t\t{\n\n\t\t\t\t$del_filename = $del_value;\n\n\t\t\t\t$del_filepath = $obj->attachment_path . $del_filename;\n\n\t\t\t\t\n\n\t\t\t\tif(file_exists($del_filepath) && is_file($del_filepath))\n\n\t\t\t\tunlink($del_filepath);\n\n\t\t\t}//end\n\n\t\t\t$res = array(\"updation failed\");\n\n\t\t}\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::update_record() - Return Value : ', $res);\n\n\t\t\n\n\t\treturn $res;\n\n\t\t\n\n\t}", "public function testUpdateEmployee()\n {\n }", "function update( \\gb\\domain\\DomainObject $object ) {\n //$this->updateStmt->execute( $values );\n }", "public function testUpdatePayrun()\n {\n }", "function EditRow() {\r\n\t\tglobal $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\r\n\t\t$conn = &$this->Connection();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$this->LoadDbValues($rsold);\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Nro_Serie\r\n\t\t\t$this->Nro_Serie->SetDbValueDef($rsnew, $this->Nro_Serie->CurrentValue, \"\", $this->Nro_Serie->ReadOnly || $this->Nro_Serie->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// SN\r\n\t\t\t$this->SN->SetDbValueDef($rsnew, $this->SN->CurrentValue, NULL, $this->SN->ReadOnly || $this->SN->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cant_Net_Asoc\r\n\t\t\t$this->Cant_Net_Asoc->SetDbValueDef($rsnew, $this->Cant_Net_Asoc->CurrentValue, NULL, $this->Cant_Net_Asoc->ReadOnly || $this->Cant_Net_Asoc->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Marca\r\n\t\t\t$this->Id_Marca->SetDbValueDef($rsnew, $this->Id_Marca->CurrentValue, 0, $this->Id_Marca->ReadOnly || $this->Id_Marca->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Modelo\r\n\t\t\t$this->Id_Modelo->SetDbValueDef($rsnew, $this->Id_Modelo->CurrentValue, 0, $this->Id_Modelo->ReadOnly || $this->Id_Modelo->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_SO\r\n\t\t\t$this->Id_SO->SetDbValueDef($rsnew, $this->Id_SO->CurrentValue, 0, $this->Id_SO->ReadOnly || $this->Id_SO->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Estado\r\n\t\t\t$this->Id_Estado->SetDbValueDef($rsnew, $this->Id_Estado->CurrentValue, 0, $this->Id_Estado->ReadOnly || $this->Id_Estado->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_Server\r\n\t\t\t$this->User_Server->SetDbValueDef($rsnew, $this->User_Server->CurrentValue, NULL, $this->User_Server->ReadOnly || $this->User_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_Server\r\n\t\t\t$this->Pass_Server->SetDbValueDef($rsnew, $this->Pass_Server->CurrentValue, NULL, $this->Pass_Server->ReadOnly || $this->Pass_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_TdServer\r\n\t\t\t$this->User_TdServer->SetDbValueDef($rsnew, $this->User_TdServer->CurrentValue, NULL, $this->User_TdServer->ReadOnly || $this->User_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_TdServer\r\n\t\t\t$this->Pass_TdServer->SetDbValueDef($rsnew, $this->Pass_TdServer->CurrentValue, NULL, $this->Pass_TdServer->ReadOnly || $this->Pass_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cue\r\n\t\t\t// Fecha_Actualizacion\r\n\r\n\t\t\t$this->Fecha_Actualizacion->SetDbValueDef($rsnew, ew_CurrentDate(), NULL);\r\n\t\t\t$rsnew['Fecha_Actualizacion'] = &$this->Fecha_Actualizacion->DbValue;\r\n\r\n\t\t\t// Usuario\r\n\t\t\t$this->Usuario->SetDbValueDef($rsnew, CurrentUserName(), NULL);\r\n\t\t\t$rsnew['Usuario'] = &$this->Usuario->DbValue;\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($EditRow) {\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\tif ($EditRow) {\r\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\r\n\t\t}\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}", "public function update(){\n\t\t$this->beforeSave();\n\t\t$tableName = $this->tableName();\n\t\t$fields = $this->fields();\n\t\t// Remove fields set as ignored by rules validation.\n\t\t$fields = $this->removeIgnored($fields);\n\t\t// Create PDO placeholders.\n\t\t$params = implode(', ', array_map(fn($name) => $name . ' = :' . $name, $fields));\n\t\t$primaryKey = $this->getPrimaryKey();\n\t\t$where = $primaryKey . ' = :' . $primaryKey;\n\t\t$statement = $this->db->prepare('UPDATE ' . $tableName . ' SET ' . $params . ' WHERE ' . $where);\n\t\t// Bind values to placeholders.\n\t\tforeach($fields as $field){\n\t\t\t$this->binder($statement, ':' . $field, $this->{$field});\n\t\t}\n\t\t$statement->bindValue(':' . $primaryKey, $this->{$primaryKey});\n\t\tif($statement->execute()){\n\t\t\t$this->afterSave();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function testUpdateMyContact()\n {\n\n }", "function my_update_record( $table_name , $primary_key , $data_id , $datas ){\r\n\r\n\tglobal $connection;\r\n\r\n\t$build_query = \" UPDATE `\".$table_name .\"` SET \" ;\r\n\tforeach( $datas as $field => $value ){\r\n\t\r\n\t\t$build_query .= \"`\".$field .\"` = \". $value . \", \";\r\n\t\r\n\t}\r\n\t\r\n\t$query = rtrim( trim($build_query) , \",\" );\r\n\t\r\n\t$update_query = $query .\" WHERE `\".$primary_key.\"` = \". $data_id ; \r\n \r\n\t$result = my_query( $update_query );\r\n\t \r\n\treturn $connection->affected_rows ; \r\n\r\n}", "function modify_record(&$_usr, &$_rec) {\r\n\t\t$query=\"update materials \";\r\n\t\tif(is_array($_rec)) {\r\n\t\t\t$spl=\"\";\r\n\t\t\t$query.=\" set \";\r\n\t\t\tforeach ($_rec as $k=>$v) {\r\n\t\t\t\t$query.=$spl.$k.\"='\".$v.\"'\";\r\n\t\t\t\t$spl=\", \";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$query.=\"where materials.user_id=matlinks.mat_id and matlinks.user_id=\".$_usr['user_id'];\r\n\t\t$mq = mysql_query($query);\r\n\t\treturn ( mysql_query($query) && mysql_affected_rows()==1 );\r\n\t}", "public function updateRecord ($sqlString);", "function UpdateRecord($values)\n {\n $databasename = $this->databasename;\n $tablename = $this->tablename;\n $path = $this->path;\n //dprint_r($_FILES);\n if ( !isset($values[$this->primarykey]) )\n return false;\n $unirecid = $values[$this->primarykey];\n return $this->UpdateRecordBypk($values,$this->primarykey,$values[$this->primarykey]);\n }", "function update() {\n\t\t$sql = \"UPDATE cost_detail \n\t\t\t\tSET\tcd_start_time=?, cd_end_time=?, cd_hour=?, cd_minute=?, cd_cost=?, cd_update=?, cd_user_update=? \n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\t\n\t\t$this->ffm->query($sql, array($this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update, $this->cd_fr_id, $this->cd_seq));\t\n\t}", "public function update($data) {}", "public function update($data) {}", "public function update()\r\n {\r\n \r\n }", "public function update() {\r\n\r\n\t}", "protected function _update()\n\t{\n\t\t$this->date_modified = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->last_online = $this->date_modified;\n\t}", "function adv_update($table, array $data, array $where);", "private function update(){\n\t\t$q = Queries::update($this->authkey);\n\t\t$this->internalQuery($q);\n\t}", "private function _update(){\n\t\tif($this->dao->update($this->user->getID(), $this->ident, $this->datahandler)){\n\t\t\t$this->read();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "function updateRecord($f){\n global $db;\n\n $sql= \"UPDATE products SET \"\n .\"description='\".$f['description'].\"' \"\n .\"WHERE id='\".$f['id'].\"'\";\n Basic::EventLog(\"Product->updateRecord: \".$sql);\n //Basic::EventLogDB(\"Usuario modificado - UID:\".$f['uid'].\", Modulo: \".$f['module'].\", Permiso: \".$f['perm']);\n $res =& $db->query($sql);\n return $res;\n }", "function update_record($dbc, $id, $item_name, $description, $location_id, $owner, $finder, $status) {\n\t$query = 'UPDATE stuff set id = '.$id.', set item_name = '.$item_name.', set description = '.$description.', set location_id = '.$location_id.', set create_date= '.$create_date.' , set owner= '.$owner.', set finder = '.$finder.', set status = '.$status.')' ;\n show_query($query);\n\n $results = mysqli_query($dbc,$query) ;\n check_results($results) ;\n\n return $results ;\n}", "function updateRecord($id, $name, $position, $team, $age, $dateofarticle, $projdraftround, $injsus, $href, $newssrc, $notes, $status)\n\t {\n\t\t //open database connection\n\t\t $conn = $this->openDBConnection();\n\t\t\t\n\t\t\t//update record in database\n\t\t\t$query = \"UPDATE players SET\n \t\tname='$name', \n\t\t\t\t\tposition='$position',\n\t\t\t\t\tteam='$team',\n\t\t\t\t\tage='$age',\n\t\t\t\t\tdateofarticle='$dateofarticle',\n\t\t\t\t\tprojdraftround='$projdraftround',\n\t\t\t\t\tinjsus='$injsus',\n\t\t\t\t\thref='$href',\n\t\t\t\t\tnewssrc='$newssrc',\n\t\t\t\t\tnotes='$notes',\n\t\t\t\t\tstatus='$status'\n\t\t WHERE id = {$id}\";\n\t\t\n\t\t \n\t\t\tif(mysqli_query($conn, $query))\n\t\t\t{\n\t\t\t\t//echo '<script type=\"text/javascript\">eval(alert(\"Success, '.$name.'\\'s record has been updated. You will be notified on '.$this->createTargetDate($timespan).' to contact this person!\"));</script>';\n\t\t\t\t//header('Location: http://localhost/FantasyFootballDraft/');\n\t\t\t} else {\n\t\t\t echo 'Error: '. mysqli_error($conn);\t\n\t\t\t}\n\t\t\t\n\t\t\t//close connection\n\t\t mysqli_close($conn);\n\t\t \n\t }", "public function update()\r\n {\r\n //\r\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",comments=\\\"$this->comments\\\",price=\\\"$this->price\\\",brand=\\\"$this->brand\\\",model=\\\"$this->model\\\",y=\\\"$this->y\\\",link=\\\"$this->link\\\",in_existence=\\\"$this->in_existence\\\",is_public=\\\"$this->is_public\\\",is_featured=\\\"$this->is_featured\\\",category_id=\\\"$this->category_id\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "protected function update()\n\t{\n\t\t//append ID to fields\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tupdate Booth\n\t\t\tset BoothNum = ?\n\t\t\twhere BoothID = ?\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "function update(){\n\t\t$this->model->update();\n\t}", "public function actionUpdate() {}", "public function actionUpdate() {}", "public function testUpdateStore()\n {\n\n }", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "public function testUpdatePerson()\n {\n }", "abstract public function mass_update();", "public function testUpdateExtraFields(): void { }", "public function update(){\n\t\techo $sql = \"update \".self::$tablename.\" set title=\\\"$this->title\\\",description=\\\"$this->description\\\",skills=\\\"$this->skills\\\",area_id=$this->area_id,jobtype_id=$this->jobtype_id,jobperiod_id=$this->jobperiod_id,duration=$this->duration,is_public=$this->is_public,is_finished=$this->is_finished,created_at=$this->created_at where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public abstract function update();", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$this->featured_image->OldUploadPath = \"../uploads/product/\";\n\t\t\t$this->featured_image->UploadPath = $this->featured_image->OldUploadPath;\n\t\t\t$rsnew = array();\n\n\t\t\t// cat_id\n\t\t\t$this->cat_id->SetDbValueDef($rsnew, $this->cat_id->CurrentValue, 0, $this->cat_id->ReadOnly || $this->cat_id->MultiUpdate <> \"1\");\n\n\t\t\t// company_id\n\t\t\t$this->company_id->SetDbValueDef($rsnew, $this->company_id->CurrentValue, 0, $this->company_id->ReadOnly || $this->company_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_model\n\t\t\t$this->pro_model->SetDbValueDef($rsnew, $this->pro_model->CurrentValue, NULL, $this->pro_model->ReadOnly || $this->pro_model->MultiUpdate <> \"1\");\n\n\t\t\t// pro_name\n\t\t\t$this->pro_name->SetDbValueDef($rsnew, $this->pro_name->CurrentValue, NULL, $this->pro_name->ReadOnly || $this->pro_name->MultiUpdate <> \"1\");\n\n\t\t\t// pro_description\n\t\t\t$this->pro_description->SetDbValueDef($rsnew, $this->pro_description->CurrentValue, NULL, $this->pro_description->ReadOnly || $this->pro_description->MultiUpdate <> \"1\");\n\n\t\t\t// pro_condition\n\t\t\t$this->pro_condition->SetDbValueDef($rsnew, $this->pro_condition->CurrentValue, NULL, $this->pro_condition->ReadOnly || $this->pro_condition->MultiUpdate <> \"1\");\n\n\t\t\t// pro_features\n\t\t\t$this->pro_features->SetDbValueDef($rsnew, $this->pro_features->CurrentValue, NULL, $this->pro_features->ReadOnly || $this->pro_features->MultiUpdate <> \"1\");\n\n\t\t\t// post_date\n\t\t\t$this->post_date->SetDbValueDef($rsnew, ew_CurrentDateTime(), NULL);\n\t\t\t$rsnew['post_date'] = &$this->post_date->DbValue;\n\n\t\t\t// ads_id\n\t\t\t$this->ads_id->SetDbValueDef($rsnew, $this->ads_id->CurrentValue, NULL, $this->ads_id->ReadOnly || $this->ads_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_base_price\n\t\t\t$this->pro_base_price->SetDbValueDef($rsnew, $this->pro_base_price->CurrentValue, NULL, $this->pro_base_price->ReadOnly || $this->pro_base_price->MultiUpdate <> \"1\");\n\n\t\t\t// pro_sell_price\n\t\t\t$this->pro_sell_price->SetDbValueDef($rsnew, $this->pro_sell_price->CurrentValue, NULL, $this->pro_sell_price->ReadOnly || $this->pro_sell_price->MultiUpdate <> \"1\");\n\n\t\t\t// featured_image\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->ReadOnly && strval($this->featured_image->MultiUpdate) == \"1\" && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->Upload->DbValue = $rsold['featured_image']; // Get original value\n\t\t\t\tif ($this->featured_image->Upload->FileName == \"\") {\n\t\t\t\t\t$rsnew['featured_image'] = NULL;\n\t\t\t\t} else {\n\t\t\t\t\t$rsnew['featured_image'] = $this->featured_image->Upload->FileName;\n\t\t\t\t}\n\t\t\t\t$this->featured_image->ImageWidth = 875; // Resize width\n\t\t\t\t$this->featured_image->ImageHeight = 665; // Resize height\n\t\t\t}\n\n\t\t\t// folder_image\n\t\t\t$this->folder_image->SetDbValueDef($rsnew, $this->folder_image->CurrentValue, \"\", $this->folder_image->ReadOnly || $this->folder_image->MultiUpdate <> \"1\");\n\n\t\t\t// pro_status\n\t\t\t$tmpBool = $this->pro_status->CurrentValue;\n\t\t\tif ($tmpBool <> \"Y\" && $tmpBool <> \"N\")\n\t\t\t\t$tmpBool = (!empty($tmpBool)) ? \"Y\" : \"N\";\n\t\t\t$this->pro_status->SetDbValueDef($rsnew, $tmpBool, \"N\", $this->pro_status->ReadOnly || $this->pro_status->MultiUpdate <> \"1\");\n\n\t\t\t// branch_id\n\t\t\t$this->branch_id->SetDbValueDef($rsnew, $this->branch_id->CurrentValue, NULL, $this->branch_id->ReadOnly || $this->branch_id->MultiUpdate <> \"1\");\n\n\t\t\t// lang\n\t\t\t$this->lang->SetDbValueDef($rsnew, $this->lang->CurrentValue, \"\", $this->lang->ReadOnly || $this->lang->MultiUpdate <> \"1\");\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->UploadPath = \"../uploads/product/\";\n\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t$file = $NewFiles[$i];\n\t\t\t\t\t\t\tif (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file)) {\n\t\t\t\t\t\t\t\t$OldFileFound = FALSE;\n\t\t\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\t\t\tfor ($j = 0; $j < $OldFileCount; $j++) {\n\t\t\t\t\t\t\t\t\t$file1 = $OldFiles[$j];\n\t\t\t\t\t\t\t\t\tif ($file1 == $file) { // Old file found, no need to delete anymore\n\t\t\t\t\t\t\t\t\t\tunset($OldFiles[$j]);\n\t\t\t\t\t\t\t\t\t\t$OldFileFound = TRUE;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($OldFileFound) // No need to check if file exists further\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$file1 = ew_UploadFileNameEx($this->featured_image->PhysicalUploadPath(), $file); // Get new file name\n\t\t\t\t\t\t\t\tif ($file1 <> $file) { // Rename temp file\n\t\t\t\t\t\t\t\t\twhile (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1) || file_exists($this->featured_image->PhysicalUploadPath() . $file1)) // Make sure no file name clash\n\t\t\t\t\t\t\t\t\t\t$file1 = ew_UniqueFilename($this->featured_image->PhysicalUploadPath(), $file1, TRUE); // Use indexed name\n\t\t\t\t\t\t\t\t\trename(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file, ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1);\n\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $file1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->featured_image->Upload->DbValue = empty($OldFiles) ? \"\" : implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $OldFiles);\n\t\t\t\t\t$this->featured_image->Upload->FileName = implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $NewFiles);\n\t\t\t\t\t$this->featured_image->SetDbValueDef($rsnew, $this->featured_image->Upload->FileName, \"\", $this->featured_image->ReadOnly || $this->featured_image->MultiUpdate <> \"1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t\t\t$NewFiles2 = array($rsnew['featured_image']);\n\t\t\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t\t\t$file = ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $NewFiles[$i];\n\t\t\t\t\t\t\t\t\tif (file_exists($file)) {\n\t\t\t\t\t\t\t\t\t\tif (@$NewFiles2[$i] <> \"\") // Use correct file name\n\t\t\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $NewFiles2[$i];\n\t\t\t\t\t\t\t\t\t\tif (!$this->featured_image->Upload->ResizeAndSaveToFile($this->featured_image->ImageWidth, $this->featured_image->ImageHeight, EW_THUMBNAIL_DEFAULT_QUALITY, $NewFiles[$i], TRUE, $i)) {\n\t\t\t\t\t\t\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UploadErrMsg7\"));\n\t\t\t\t\t\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$NewFiles = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\tfor ($i = 0; $i < $OldFileCount; $i++) {\n\t\t\t\t\t\t\tif ($OldFiles[$i] <> \"\" && !in_array($OldFiles[$i], $NewFiles))\n\t\t\t\t\t\t\t\t@unlink($this->featured_image->OldPhysicalUploadPath() . $OldFiles[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\n\t\t// featured_image\n\t\tew_CleanUploadTempPath($this->featured_image, $this->featured_image->Upload->Index);\n\t\treturn $EditRow;\n\t}", "public function update(){\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $fieldsList = \" SET \";\n foreach ($this->attributes as $column => $value) {\n $fieldsList.=$column.\"=\".'\\''.$value.'\\''.\", \";\n }\n $fieldsList = str_last_replace(\", \", \"\", $fieldsList);\n $sqlQuery = \"UPDATE \".$this->table.$fieldsList.\" WHERE \".$this->idName.\"=\".$this->attributes[$this->idName];\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n }\n }", "function RecordUpdate ($page, $table, $identifier, $tag, $assoc_table = NULL, $special_case = NULL)\r{\r\tif ($GLOBALS['feedback']) echo \"RecordUpdate ($page,$table,$identifier,$tag,$assoc_table)\\n\";\r\r\t$rec = (isset ($_GET['rec']) ? $_GET['rec'] : NULL);\r\r\tswitch ($rec)\r\t{\r\t\tcase 'insert':\r\t\t\t$id = Insert ($_POST, $table, $identifier, $special_case);\r\t\t\tif ($assoc_table)\r\t\t\t\tAssociate ($assoc_table, $identifier, $_GET['cid'], $id);\r\t\t\theader(\"Location: $page?\" . ($tag != 'cid' ? 'cid=' . $_GET['cid'] . '&' : '') . \"$tag=$id&rec=view\");\r\t\t\texit;\r\r\t\tcase 'update':\r\t\t\tUpdate ($_POST, $table, $identifier, $special_case) or exit ('<strong>Update failed:</strong> failure occurred for unknown reasons. [library.inc.php]');\r\t\t\theader(\"Location: $page?\" . ($tag != 'cid' ? 'cid=' . $_GET['cid'] . '&' : '') . \"$tag=\" . $_GET[$tag] . '&rec=view');\r\t\t\texit;\r\r\t\tcase 'delete':\r\t\t\tif ($assoc_table)\r\t\t\t\tDelete \t($assoc_table, \"`contact_id` = '\" . $_GET['cid'] . \"' AND `$identifier` = '\" . $_GET[$tag] . \"'\");\r\t\t\telse\r\t\t\t\tDelete ($table, \"`$identifier` = '\" . $_GET[$tag] . \"'\");\r\t\t\theader (\"Location: $page\" . ($tag != 'cid' ? '?cid=' . $_GET['cid'] : ''));\r\t\t\texit;\r\r\t\tcase 'create':\r\t\t\treturn false;\r\t\t\tbreak;\r\r\t\tcase 'view':\r\t\tcase 'revert':\r\t\tcase 'edit':\r\t\tdefault:\r\t\t\treturn true;\r\t\t\tbreak;\r\t}\r}", "public function testUpdateSuperfund()\n {\n }", "function updateRecord()\n{\n\n // Connect to DB\n require('connect.php');\n\n //User inputs for id, idiom, occurence and translation \n // in the record they'd like to edit \n\n $id = $_POST['update-id'];\n $idiom = $_POST['update-idiom'];\n $occurence = $_POST['update-occurence'];\n $translation = $_POST['update-translation'];\n\n // Update query\n $sql = \"UPDATE `meno` \n SET\n `idiom` = '$idiom',\n `occurence` = '$occurence',\n `translation` = '$translation',\n `commentary` = '$commentary'\n WHERE `id` = '$id' \";\n\n $update_query = mysqli_query($connection, $sql);\n\n if (!$update_query) {\n echo \"Error: \" . $sql . mysqli_error($connection);\n }\n\n mysqli_close($connection);\n\n header('Location: index.php');\n\n // check if save button has been clicked \n}", "function record_update(){\n\t\t\n\t\t$data=array();\n\t\t\n\t\t$data['status']=$this->uri->segment(3);\n\t\t\n\t\t$this->ObjM->update($data,'slc_mater','id',$this->uri->segment(4));\n\t\t\n\t\t$sts=$this->uri->segment(3);\n\t\t\n\t\tif($this->uri->segment(3)==\"Delete\"){\n\t\t\t\n\t\t\t$this->session->set_flashdata(\"show_msg\", \" <b>Sucess</b> Record Deleted successfully.....\");\n\t\t\t\n\t\t}\n\t\t\n\t\theader('Location: '.base_url().'index.php/'.$this->uri->segment(1));\n\t\t\n\t}", "public function update()\n {\n }", "function EditRecord($class, $id, $data)\r\n\t{\r\n\t\t$TotalArr = array();\r\n\t\tforeach($this->MyClasses[$class]['db'] as $key=>$value)\r\n\t\t{\r\n\t\t\tif(isset($data[$key]))\r\n\t\t\t{\r\n\t\t\t\t$TotalArr[$key] = $data[$key];\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->update($this->MyClasses[$class]['table'], $TotalArr, array(\"id\"=>$id));\t\r\n\t}", "public function updateData()\n {\n try {\n// echo \"<pre>\";\n// print_r($this->where);\n// print_r($this->insertUpdateArray);\n// exit;\n DB::table($this->dbTable)\n ->where($this->where)\n ->update($this->insertUpdateArray);\n } catch (Exception $ex) {\n throw new Exception($ex->getMessage(), 10024, $ex);\n }\n }", "function sql_updateEntryByRecord() {\n global $database;\n global $sql_result;\n $thisQuery = \"UPDATE \".TABLE_PREFIX.\"mod_dirlist SET \"\n .\"directory='\".$this->record['directory'].\"',\"\n .\"sort='\".$this->record['sort'].\"',\"\n .\"header='\".$this->record['header'].\"',\"\n .\"prefix='\".$this->record['prefix'].\"',\"\n .\"suffix='\".$this->record['suffix'].\"',\"\n .\"exclude='\".$this->record['exclude'].\"',\"\n .\"extensions='\".$this->record['extensions'].\"',\"\n .\"blank='\".$this->record['blank'].\"',\"\n .\"last_modified='\".time().\"'\"\n .\" WHERE section_id='\".$this->record['section_id'].\"' AND page_id='\".$this->record['page_id'].\"'\";\n $oldErrorReporting = error_reporting(0);\n $sql_result = $database->query($thisQuery);\n error_reporting($oldErrorReporting);\n if ($database->is_error()) {\n // SQL Fehler\n $this->errorPlace = 'sql_updateEntryByRecord()';\n $this->error = $database->get_error();\n return false; }\n else {\n return true; }\n }" ]
[ "0.7662824", "0.73388255", "0.72753716", "0.72386366", "0.7198051", "0.7106344", "0.70861447", "0.70664346", "0.70664346", "0.7035638", "0.6985049", "0.69446784", "0.69262123", "0.6885304", "0.68388075", "0.68354005", "0.6827027", "0.68145573", "0.67991364", "0.6785149", "0.67660934", "0.67444503", "0.6743066", "0.6732514", "0.67288077", "0.6724479", "0.67232776", "0.6714702", "0.67050636", "0.6699792", "0.6698484", "0.669797", "0.66978616", "0.6686986", "0.66528845", "0.6651973", "0.66453487", "0.66432136", "0.6620625", "0.6612662", "0.66085905", "0.6597331", "0.6591497", "0.65894324", "0.65690255", "0.6560806", "0.6560806", "0.65529597", "0.6535994", "0.65358776", "0.6534093", "0.651268", "0.65038997", "0.6485828", "0.6484265", "0.64780915", "0.64769834", "0.64622223", "0.64572835", "0.644404", "0.6440304", "0.64370245", "0.6434196", "0.6425092", "0.6422774", "0.6422774", "0.64198816", "0.6419195", "0.6410871", "0.64051723", "0.64023226", "0.63949573", "0.63933897", "0.6369827", "0.6369688", "0.6368219", "0.6367343", "0.63614595", "0.6354146", "0.6350087", "0.63374436", "0.63374436", "0.63334537", "0.63331866", "0.63331866", "0.63263255", "0.632291", "0.6321801", "0.6319552", "0.6318531", "0.63143367", "0.6310733", "0.63091385", "0.63019896", "0.6288026", "0.62864304", "0.62764984", "0.6275208", "0.6271468", "0.62691545" ]
0.72911936
2
end of function to delete record
public function delete(){ global $db; $response = array('success' => false); $response['success']=$db->delete($this->table, "id = $this->id"); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "function delete_record () { //deletes a record\n\t\t\n\t\t//deletes record\n\t\t$pdo = Database::connect();\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t$sql = \"DELETE FROM customers WHERE id = ?\";\n\t\t$q = $pdo->prepare($sql);\n\t\t$q->execute(array($_GET['id']));\n\t\tDatabase::disconnect();\n\t\theader(\"Location: customer.php\");\n\t\t\t\n\t}", "public function delete() {\n\t\ttry {\n\t\t\tif($this->_state == self::STATE_UNCHANGED) {\n\t\t\t\t$sql = 'DELETE FROM ' . self::sanitize($this->_table->getProperty('name')) . ' WHERE ' . self::sanitize($this->_key_primary->name) . ' = ' . self::sanitize($this->_data[$this->_key_primary->name]);\n\t\t\t\t\\Bedrock\\Common\\Logger::info('Deleting record with query: ' . $sql); echo $sql;\n\t\t\t\t$this->_connection->exec($sql);\n\t\t\t}\n\t\t\telseif($this->_state == self::STATE_CHANGED) {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Unsaved changes found, cannot delete record.');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Record not found in database.');\n\t\t\t}\n\t\t}\n\t\tcatch(\\PDOException $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('A database error was encountered, the record could not be deleted.');\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('The record could not be deleted.');\n\t\t}\n\t}", "function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "public function deleteRecord()\n { \n $sql = \"DELETE FROM Cubans WHERE Id = :Id\";\n $statement = $this->connect->prepare($sql);\n $statement->bindValue(':Id', $this->id);\n $statement->execute();\n }", "protected function delete() {\n\t}", "protected function _delete()\n\t{\n\t}", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "function delete()\n {\n }", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public static function delete() {\n\n\n\t\t}", "public function delete()\r\n\t{\r\n\t}", "function deleteRecord()\t{\n\t\tif ($this->conf['delete'])\t{\t// If deleting is enabled\n\t\n\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $this->recUid);\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ( $this->aCAuth($origArr)&& $this->conf['requireLogin'])||!$this->conf['requireLogin'])\t{\t// Must be logged in OR be authenticated by the aC code in order to delete\n\t\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\tif (is_array($origArr))\t{\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t// Display the form, if access granted.\n\t\t\t\t\t\tif (!$GLOBALS['TCA'][$this->theTable]['ctrl']['delete'])\t{\t// If the record is fully deleted... then remove the image (or any file) attached.\n\t\t\t\t\t\t\t$this->deleteFilesFromRecord($this->recUid);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->cObj->DBgetDelete($this->theTable, $this->recUid, TRUE);\n\t\t\t\t\t\t$this->currentArr = $origArr;\n\t\t\t\t\t\t$this->saved = 1;\n\t\t\t\t\t\t$this->userProcess_alt($conf['edit.']['userFunc_afterDelete'],$conf['edit.']['userFunc_afterDelete.'],array('rec'=>$this->currentArr, 'origRec'=>$origArr));\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->error = '###TEMPLATE_NO_PERMISSIONS###';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\t\t$this->error = '###TEMPLATE_NO_PERMISSIONS###';\n\t\t }\n\t\t}\n\t}", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "public function delete()\n\t{\n\t}", "public function deleteRecord($id){\n\t}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}", "public function deleting()\n {\n # code...\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function DELETE() {\n #\n }", "public abstract function delete();", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "public final function delete() {\n }", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "public static function delete() {\r\n\t\t\r\n\t}", "function doRealDelete()\n {\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }", "function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "public function delete() {\r\n }", "public function do_delete_record()\n {\n $v_list_delete = get_post_var('hdn_item_id_list','');\n $this->model->do_delete_record($v_list_delete);\n }", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "function delete() {\n \tglobal $mysql;\n \tif(empty($this->id)) return;\n \t$tablename = $this->class_name();\n \t$id = $this->id;\n \t$query = \"DELETE FROM $tablename WHERE id=$id\";\n \t$mysql->update($query);\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }", "public function delete() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with id of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$sql = \"DELETE FROM $this->sqlTable \";\r\n\t\t\t$sql .= \" WHERE lp_id = ?\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $this->id );\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql );\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "function delete() ;", "function delete() ;", "public function deleteRecord(){\n\t\t/* Variable initialization */\n\t\t$intEmailCode \t= ($this->input->post('txtDeleteRecordCode') !='') ? getDecyptionValue($this->input->post('txtDeleteRecordCode')) : 0;\n\n\t\t/* if email code is not pass then do needful */\n\t\tif($intEmailCode == 0){\n\t\t\t/* Return error message */\n\t\t\tjsonReturn(array('status'=>0,'message'=>\"Invalid email template code requested.\"), true);\n\t\t}\n\t\t/* Setting the updated array */\n\t\t$strUpdatedArr\t= array(\n\t\t\t\t\t\t\t\t\t'table'=>$this->_strPrimaryTableName,\n\t\t\t\t\t\t\t\t\t'data'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t'deleted'=>1,\n\t\t\t\t\t\t\t\t\t\t\t\t'updated_by'=>$this->getUserCode(),\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'where'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t'id'=>$intEmailCode\n\t\t\t\t\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\t\t);\n\t\t/* Updating the requested record set */\n\t\t$intNunberOfRecordUpdated = $this->_objDataOperation->setUpdateData($strUpdatedArr);\n\n\t\tif($intNunberOfRecordUpdated > 0){\n\t\t\tjsonReturn(array('status'=>1,'message'=>'Requested email template deleted successfully.'), true);\n\t\t}else{\n\t\t\tjsonReturn(array('status'=>0,'message'=>DML_ERROR), true);\n\t\t}\n\n\t\t/* removed variables */\n\t\tunset($strUpdatedArr);\n\t}", "public function deleteRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getDeleteRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('You are not the owner of the record');\n\t\t\t\t}\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// delete\n\t\t\t\t$this->getHandler()->delete($record);\n\n\n\t\t\t\t$msg = new Message('You have successful delete a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "function delete() {\n\t \t$sql = \"DELETE FROM evs_database.evs_identification\n\t \t\t\tWHERE idf_id=?\";\n\t \t$this->db->query($sql, array($this->idf_id));\n\t\t\n\t }", "public function DeleteRecord()\n {\n // TODO: support delete multiple records\n // read the id array from the check box list _REQUEST['row_selections']\n global $g_BizSystem;\n $values = $g_BizSystem->GetClientProxy()->GetFormInputs('row_selections',false);\n if ($values)\n {\n foreach ($values as $id)\n {\n $recArray = $this->GetDataObj()->FetchById($id);\n $dataRec = new DataRecord($recArray, $this->GetDataObj());\n // take care of exception\n try {\n $dataRec->Delete();\n }\n catch (BDOException $e)\n {\n // call $this->ProcessBDOException($e);\n $this->ProcessBDOException($e);\n return;\n }\n }\n }\n else // delete current focused record\n {\n $rec = $this->GetActiveRecord();\n if (!$rec) return;\n global $g_BizSystem;\n //$recId = $this->m_ActiveRecord[\"Id\"];\n $ok = $this->GetDataObj()->DeleteRecord($rec);\n if (!$ok)\n return $this->ProcessDataObjError($ok);\n }\n $this->m_RecordId = null; // clean the current record id\n // TODO: adjust current page. if current page return no record, goto prev page\n \n return $this->ReRender();\n }", "public function delete()\r\n {\r\n $recordId = $this->getRecId();\r\n $command = static::getDb()->newDeleteCommand(static::$defaultLayout, $recordId);\r\n try {\r\n $command->execute();\r\n return 1;\r\n } catch (FileMakerException $e) {\r\n $this->addError('delete', $e->getMessage());\r\n return 0;\r\n }\r\n }", "function delete()\r\n {\r\n\r\n }", "public function delete(){\n\t if(!isset($this->attributes['id'])) \n\t\t\tthrow new Exception(\"Cannot delete new objects\");\n\t\t$this->do_callback(\"before_delete\");\n\t\treturn self::do_query(\"DELETE FROM \".self::table_for(get_class($this)).\n\t\t \" WHERE id=\".self::make_value($this->attributes['id']));\t\n\t}", "public function deleteRecord ($id);", "public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }", "function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_person_detail\n\t\t\t\tWHERE psd_ps_id=?\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id));\n\t}", "abstract protected function delete ();", "public function delete() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\tif (! isset ( $this->id )) {\r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$dsh_id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with primary key of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$sql = \"DELETE FROM $this->sqlTable \";\r\n\t\t\t$sql .= \" WHERE dsh_id = ?\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $this->id );\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql );\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "abstract function delete();", "public function delete()\n {\n //\n }", "public function del()\n {\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function delete() {\n global $db;\n $this->_predelete();\n $result = $db->query(\"DELETE FROM \".$this->table.\" WHERE \".$this->id_field.\"=?\", array($this->{$this->id_field}));\n $this->_postdelete($result);\n return $result;\n }", "public function delete()\n {\n \n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "function deleteRecord($table,$where) \t{\n\t\t$query = \"DELETE FROM \".$this->tablePrefix .$table.' WHERE '.$where ;\n $res = $this->execute($query);\n\n\t}", "public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}", "function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $res[] = $db->query( \"DELETE FROM eZTrade_AlternativeCurrency WHERE ID='$this->ID'\" );\r\n\r\n eZDB::finish( $res, $db );\r\n\r\n \r\n }", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "function delete() \n {\n \n }", "public function delete()\n {\n // TODO: Implement delete() method.\n }", "public function delete()\n\t{\n\t\tDatabase::query(\"\n\t\t\tDELETE FROM\n\t\t\t\t\". $this->tableName .\"\n\t\t\tWHERE\n\t\t\t\tid = '\". $this->id .\"'\n\t\t\");\n\t}", "public static function delete(){\r\n }", "public function delete($entity){ \n //TODO: Implement remove record.\n }", "function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_amphur\n\t\t\t\tWHERE amph_id=?\";\n\t\t$this->hr->query($sql, array($this->amph_id));\n\t}", "public function destroy($id)\n {\n //delete specific record\n }", "public function delete()\n\t{\n\t\tif ($this->data['id'])\n\t\t{\n\t\t\treturn $this->db->delete($this->table_name, array('id' => $this->data['id']));\n\t\t}\n\t}" ]
[ "0.785043", "0.7778771", "0.7768707", "0.775848", "0.7751612", "0.7669801", "0.7591056", "0.7585993", "0.75655305", "0.7517936", "0.7513182", "0.75006664", "0.7488018", "0.74728984", "0.7463469", "0.7463469", "0.7463469", "0.7463469", "0.7427056", "0.74264455", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.74205905", "0.73920554", "0.73858464", "0.7366488", "0.7366488", "0.7366113", "0.736573", "0.73585254", "0.735478", "0.73533404", "0.7351626", "0.7350225", "0.73501325", "0.7336697", "0.73306024", "0.7325733", "0.7322407", "0.7316469", "0.73019224", "0.7285994", "0.72698075", "0.72672427", "0.72630334", "0.72605294", "0.72584385", "0.72584385", "0.7248002", "0.7229653", "0.72226197", "0.7214207", "0.71977025", "0.71654963", "0.7164236", "0.71640134", "0.7150028", "0.7149585", "0.7142086", "0.71398455", "0.7116471", "0.7113784", "0.71030545", "0.7102291", "0.7101631", "0.71004933", "0.7098762", "0.7088144", "0.7088144", "0.7088144", "0.7088144", "0.7088144", "0.7088144", "0.7088144", "0.7088144", "0.7088144", "0.7088144", "0.7082258", "0.70817554", "0.70561296", "0.70559055", "0.705354", "0.705279", "0.70523083", "0.7051805", "0.7051307", "0.7044778", "0.7042958", "0.70370525" ]
0.0
-1
Configuration form for administrative settings.
function restapi_admin_form($form, &$form_state) { $form['restapi_url_prefix'] = [ '#type' => 'textfield', '#title' => t('URL prefix'), '#size' => 15, '#description' => t('Prepend this value to all URLs defined in hook_restapi_resource(). (e.g. A resource with the URL "some/resource" will become "$prefix/some/resource").'), '#default_value' => variable_get('restapi_url_prefix'), ]; $form['restapi_api_name'] = [ '#type' => 'textfield', '#title' => t('API name'), '#size' => 15, '#description' => t('Used in the header that specifies the API version. (e.g. An API with the name "API-Name" will add the header "X-API-Name-Version").'), '#default_value' => variable_get('restapi_api_name', 'API'), ]; $form['restapi_current_version'] = [ '#type' => 'textfield', '#title' => t('Current API version'), '#size' => 15, '#description' => t('Specifies the current API version, which is used by default if a version is not provided. This should also be the most recent API version.)'), '#default_value' => variable_get('restapi_current_version', 1), '#element_validate' => ['element_validate_integer_positive'], ]; $form['restapi_minimum_version'] = [ '#type' => 'textfield', '#title' => t('Minimum API version'), '#size' => 15, '#description' => t('Specifies the minimum API version that clients may request.)'), '#default_value' => variable_get('restapi_minimum_version', 0), '#element_validate' => ['element_validate_integer_positive'], ]; $form['restapi_default_auth_class'] = [ '#type' => 'textfield', '#title' => t('Default authentication class'), '#size' => 40, '#description' => t('The full name of the class to use as the default authentication class. Defaults to "Drupal\restapi\Auth\DrupalAuthenticationService".'), '#default_value' => variable_get('restapi_default_auth_class'), ]; $form['restapi_debug'] = [ '#type' => 'checkbox', '#title' => t('Enable debug mode'), '#description' => t('Places the Rest API into debug mode. Additional diagnostic data, such as memory usage and execution time, will be set while in debug mode.'), '#default_value' => variable_get('restapi_debug', FALSE), ]; // We want to include our custom submission handler as well, to execute after // variables are saved via system_settings_form_submit(). $form = system_settings_form($form); $form['#submit'][] = __FUNCTION__ . '_submit'; return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initConfigurationForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\t\n\t\t$pl = $this->getPluginObject();\n\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\n\t\t// setting 1 (a checkbox)\n\t\t$cb = new ilCheckboxInputGUI($pl->txt(\"setting_1\"), \"setting_1\");\n\t\t$form->addItem($cb);\n\t\t\n\t\t// setting 2 (text)\n\t\t$ti = new ilTextInputGUI($pl->txt(\"setting_2\"), \"setting_2\");\n\t\t$ti->setRequired(true);\n\t\t$ti->setMaxLength(10);\n\t\t$ti->setSize(10);\n\t\t$form->addItem($ti);\n\t\n\t\t$form->addCommandButton(\"save\", $lng->txt(\"save\"));\n\t \n\t\t$form->setTitle($pl->txt(\"example_plugin_configuration\"));\n\t\t$form->setFormAction($ilCtrl->getFormAction($this));\n\t\t\n\t\treturn $form;\n\t}", "public function admin_options() {\n\n\t\t\t?>\n\t\t\t<h3>ATOS</h3>\n\t\t\t<p><?php _e('Acceptez les paiements par carte bleue grâce à Atos.', 'woothemes'); ?></p>\n\t\t\t<p><?php _e('Plugin créé par David Fiaty', 'woothemes'); ?> - <a href=\"http://www.cmsbox.fr\">http://www.cmsbox.fr</a></p>\n\t\t\t<table class=\"form-table\">\n\t\t\t<?php\n\t\t\t\t// Generate the HTML For the settings form.\n\t\t\t\t$this->generate_settings_html();\n\t\t\t?>\n\t\t\t</table><!--/.form-table-->\n\t\t\t<?php\n\t\t}", "function postageapp_admin_form() {\n $form = array();\n \n $form['settings'] = array(\n '#type' => 'fieldset',\n '#title' => t('Postageapp settings'),\n );\n \n $form['settings']['postageapp_api_key'] = array(\n '#type' => 'textfield',\n '#title' => t('PostageApp API Key'),\n '#required' => TRUE,\n '#default_value' => variable_get('postageapp_api_key', ''),\n '#description' => t('The API key for your PostageApp account. Get or generate a valid API key at your PostageApp dashboard which is available at yourusername.postageapp.com')\n );\n \n return system_settings_form($form);\n}", "public function admin_options() {\r\n echo '<h3>' . __('Mondido', 'mondido') . '</h3>';\r\n echo '<p>' . __('Mondido, Simple payments, smart functions', 'mondido') . '</p>';\r\n echo '<table class=\"form-table\">';\r\n // Generate the HTML For the settings form.\r\n $this->generate_settings_html();\r\n echo '</table>';\r\n }", "public function admin_options() { ?>\n <h3><?php _e( $this->pluginTitle(), 'midtrans-woocommerce' ); ?></h3>\n <p><?php _e($this->getSettingsDescription(), 'midtrans-woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }", "function mkConfigForm() {\r\n\t\tglobal $database;\r\n\r\n\t\t$database->setQuery(\t\"SELECT lft, rgt FROM #__core_acl_aro_groups WHERE name = 'Public Backend'\" );\r\n\t\t$borders\t\t\t=\t$database->loadRow();\r\n\t\t$database->setQuery(\t\"SELECT group_id AS id, name\" .\r\n\t\t\t\t\t\t\t\t\"\\n FROM #__core_acl_aro_groups\" .\r\n\t\t\t\t\t\t\t\t\"\\n WHERE lft > $borders[0]\" .\r\n\t\t\t\t\t\t\t\t\"\\n AND rgt < $borders[1]\" .\r\n\t\t\t\t\t\t\t\t\"\\n ORDER BY lft DESC\"\r\n\t\t);\r\n\t\t$groups = $database->loadObjectList();\r\n\r\n\t\t//load config values\r\n\t\t\t$database->setQuery(\t\"SELECT params FROM #__components WHERE link = 'ca=eventcal'\" );\r\n\t\t\t$text\t\t\t=\t$database->loadResult();\r\n\t\t\t$config_values\t=\tnew mosParameters( $text );\r\n\t\t\t\r\n\r\n\t\tHTML_admin_eventcal::configPage( $config_values, $groups );\r\n\t}", "function admin_configuration()\n{\n global $app;\n\n $app->render('admin_configuration.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 2),\n 'mailers' => mkMailers(),\n 'ttss' => mkTitleTimeSortOptions(),\n 'isadmin' => is_admin()]);\n}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show Website'),\n 'name' => $this->mod_prefix.'SHOW_WEBSITE',\n 'is_bool' => true,\n 'desc' => $this->l('Show Website structured data'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type'\t\t=> 'switch',\n 'label'\t\t=> $this->l('Show Website -> Sitelinks Searchbox '),\n 'name'\t\t=> $this->mod_prefix.'SHOW_WEBSITE_SEARCHBOX',\n 'is_bool'\t=> true,\n 'desc' \t\t=> $this->l('Show \"Website - Sitelinks Searchbox\" structured data?').'<br />'\n .$this->l('See:').'\n <a href=\"https://developers.google.com/search/docs/data-types/sitelinks-searchbox\" target=\"_blank\">\n https://developers.google.com/search/docs/data-types/sitelinks-searchbox\n </a>',\n 'values' \t=> array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type' => 'separator',\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show Organization'),\n 'name' => $this->mod_prefix.'SHOW_ORGANIZATION',\n 'is_bool' => true,\n 'desc' => $this->l('Show Organization structured data'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show Organization -> Logo'),\n 'name' => $this->mod_prefix.'SHOW_ORGANIZATION_LOGO',\n 'is_bool' => true,\n 'desc' => $this->l('Show Organization Logo.').'<br />'\n .$this->l('See more at:').' <a href =\"https://developers.google.com/search/docs/data-types/logo\" target=\"_blank\">https://developers.google.com/search/docs/data-types/logo</a> '\n .$this->l('or').'<a href=\"https://schema.org/logo\" target=\"_blank\">https://schema.org/logo</a>',\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show Organization -> Contact'),\n 'name' => $this->mod_prefix.'SHOW_ORGANIZATION_CONTACT',\n 'is_bool' => true,\n 'desc' => $this->l('Show Organization Contact structured data').'<br />'.$this->l('See more at:').' <a href=\"https://developers.google.com/search/docs/data-types/corporate-contact\">https://developers.google.com/search/docs/data-types/corporate-contact</a>',\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('email address, if other than main').': '.Configuration::get('PS_SHOP_EMAIL'),\n 'name' => $this->mod_prefix.'ORGANIZATION_CONTACT_EMAIL',\n 'label' => $this->l('Email'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-phone\"></i>',\n 'desc' => $this->l('Organization telephone number (optional)'),\n 'name' => $this->mod_prefix.'ORGANIZATION_CONTACT_TELEPHONE',\n 'label' => $this->l('Telephone:'),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show Organization -> Facebook page?'),\n 'name' => $this->mod_prefix.'SHOW_ORGANIZATION_FACEBOOK',\n 'is_bool' => true,\n 'desc' => $this->l('Show Facebook page URL in Organization structured data.'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-facebook\"></i>',\n 'desc' => $this->l('Facebook page full URL eg.:').' https://www.facebook.com/YourPage',\n 'name' => $this->mod_prefix.'ORGANIZATION_FACEBOOK',\n 'label' => $this->l('Facebook Fan page URL:'),\n ),\n array(\n 'type' => 'separator',\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show \"LocalBusiness\" data?'),\n 'name' => $this->mod_prefix.'SHOW_LOCALBUSINESS',\n 'is_bool' => true,\n 'desc' => $this->l('Show LocalBusiness structured data'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Select LocalBusiness type:'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_TYPE',\n 'desc' => $this->l(''),\n 'required' => true,\n //'disabled' => true,\n //'class' => '',\n 'options' => array(\n 'query' => array(\n array(\n 'option_id' => 'Store',\n 'option_name' => 'Store'\n ),\n array(\n 'option_id' => 'LocalBusiness',\n 'option_name' => 'LocalBusiness'\n )\n ),\n 'id' => 'option_id',\n 'name' => 'option_name'\n )\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_STORENAME',\n 'label' => $this->l('Name of store:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n 'desc' => $this->l('Short description of your business'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_DESC',\n 'label' => $this->l('Description:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_VAT',\n 'label' => $this->l('Tax id:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-money\"></i>',\n 'desc' => $this->l('Range of products prices in this shop from min to max.'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_PRANGE',\n 'label' => $this->l('Store price range:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n //\t'prefix' => '<i class=\"icon icon-address-book\"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_STREET',\n 'label' => $this->l('Street:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_COUNTRY',\n 'label' => $this->l('Country:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_REGION',\n 'label' => $this->l('Region:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_CODE',\n 'label' => $this->l('Postal code:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_LOCALITY',\n 'label' => $this->l('Locality:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-phone\"></i>',\n 'desc' => $this->l('telephone if other than main'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_PHONE',\n 'label' => $this->l('Telephone:'),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show priceRange?'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_PRANGE_SHOW',\n 'is_bool' => true,\n 'desc' => $this->l('Show Localbusiness priceRange?'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show \"LocalBusiness\" GPS lat , lon?'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_GPS_SHOW',\n 'is_bool' => true,\n 'desc' => $this->l('Show LocalBusiness GPS?'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-map-marker\"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_GPS_LAT',\n 'label' => $this->l('GPS lat:'),\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-map-marker\"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_GPS_LON',\n 'label' => $this->l('GPS lon:'),\n ),\n ),\n // Submit form\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "public function settings_page() {\n\t\tinclude_once( dirname( __FILE__ ) . '/class-vendor-admin-settings.php' );\n\t\tVendor_Admin_Settings::output();\n\t}", "public function admin_options() {\n\n ?>\n <h3>交通银行支付平台</h3>\n \n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }", "protected function getConfigForm()\n {\n // toDo: Add config to choose items showed by viewedItems\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Live mode'),\n 'name' => 'CAPTURELEADSXAVIER_LIVE_MODE',\n 'is_bool' => true,\n 'desc' => $this->l('Use this module in live mode'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a valid email address'),\n 'name' => 'CAPTURELEADSXAVIER_ACCOUNT_EMAIL',\n 'label' => $this->l('Email'),\n ),\n array(\n 'type' => 'password',\n 'name' => 'CAPTURELEADSXAVIER_ACCOUNT_PASSWORD',\n 'label' => $this->l('Password'),\n ),\n array(\n 'type' => 'radio',\n 'label' => $this->l('Column selector'),\n 'name' => 'CAPTURELEADSXAVIER_COL_SEL',\n 'required' => true,\n 'is_bool' => true,\n 'desc' => $this->l('Select on what column you want the module'),\n 'values' => array(\n array(\n 'id' => 'col_left',\n 'value' => \"left\",\n 'label' => $this->l('Left')\n ),\n array(\n 'id' => 'col_right',\n 'value' => \"right\",\n 'label' => $this->l('Right')\n )\n\n ),\n ),\n \n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n )\n )\n );\n }", "public function show_settings() {\n\n\t\twoocommerce_admin_fields( $this->get_settings() );\n\t}", "protected function form()\n {\n return Admin::form(Setting::class, function (Form $form) {\n\n $form->text('phone', '联系电话')->rules('required');\n $form->textarea('address', '联系地址')->rules('required');\n $form->text('email', 'Email')->rules('required');\n $form->text('copyright', '版权信息')->rules('required');\n $form->text('phone_2', '电话(侧边栏)')->rules('required');\n $form->image('wechat', 'Wechat')->rules('required')->removable();\n $form->textarea('intro', '简介')->rules('required');\n\n });\n }", "function storeConfigForm()\r\n\t{\r\n\t\t/*\tAdd the field for the store configuration\t*/\r\n\t\tadd_settings_field('wpklikandpay_store_tpe', __('Num&eacute;ro de TPE de la boutique', 'wpklikandpay'), array('wpklikandpay_option', 'storeTpe'), 'wpklikandpayStoreConfig', 'mainWKlikAndPayStoreConfig');\r\n\t\t// add_settings_field('wpklikandpay_store_rang', __('Num&eacute;ro de rang de la boutique', 'wpklikandpay'), array('wpklikandpay_option', 'storeRang'), 'wpklikandpayStoreConfig', 'mainWKlikAndPayStoreConfig');\r\n\t\t// add_settings_field('wpklikandpay_store_id', __('Identifiant de la boutique', 'wpklikandpay'), array('wpklikandpay_option', 'storeIdentifier'), 'wpklikandpayStoreConfig', 'mainWKlikAndPayStoreConfig');\r\n\t\tadd_settings_field('wpklikandpay_environnement', __('Environnement de la boutique', 'wpklikandpay'), array('wpklikandpay_option', 'environnement'), 'wpklikandpayStoreConfig', 'mainWKlikAndPayStoreConfig');\r\n\t}", "public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New', 'mailoptin'));\n $this->register_core_settings($instance);\n $instance->build(true, true);\n }", "public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New Optin', 'mailoptin'));\n $this->register_core_settings($instance, true);\n $instance->build(true);\n }", "public function admin_options() {\n\n echo '<h3>'.__('MTN Mobile Money Settings', 'woocommerce').'</h3>';\n echo '<table class=\"form-table\">';\n\n $this->generate_settings_html();\n echo '</table>';\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-user\"></i>',\n 'desc' => $this->l('Ingrese la llave pública'),\n 'name' => 'KUSHKIPAGOS_PUBLIC_KEY',\n 'label' => $this->l('Public key'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-user-secret\"></i>',\n 'desc' => $this->l('Ingrese la llave privada'),\n 'name' => 'KUSHKIPAGOS_PRIVATE_KEY',\n 'label' => $this->l('Private key'),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Entorno de pruebas'),\n 'name' => 'KUSHKIPAGOS_DEV',\n 'is_bool' => true,\n 'desc' => $this->l('Usar este módulo en entorno de pruebas'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n )\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "function osa_admin_settings() {\r\n $form = array();\r\n\r\n $form['osa'] = array(\r\n '#type' => 'fieldset',\r\n '#title' => t('OSA configuration'),\r\n '#collapsible' => FALSE,\r\n '#collapsed' => FALSE,\r\n );\r\n\r\n $form['osa']['osa_start_date'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Membership Start Date'),\r\n '#default_value' => variable_get('osa_start_date', 'first day of September'),\r\n '#description' => t('Set start date for new memberships. See PHP Supported Date and Time Formats (http://www.php.net/manual/en/datetime.formats.php)'),\r\n '#required' => TRUE,\r\n );\r\n\r\n $form['osa']['osa_discount_types'] = array(\r\n '#type' => 'textarea',\r\n '#title' => t('Discount types'),\r\n '#default_value' => variable_get('osa_discount_types'),\r\n '#description' => '<p>' . t('List all of the different Discount types offered.') . '<br />' .\r\n t('Enter one value per line. The amount of each discount is controlled by Pricing rules') . '<br />' .\r\n t('ONLY ADD TO THE END. Do not remove discount types or add new types into the middle of the list.') . '</p>',\r\n );\r\n \r\n return system_settings_form($form);\r\n}", "public function settings_view()\n {\n $this->register_handler('plugin.settingsform', array($this, 'settings_form'));\n $this->register_handler('plugin.settingslist', array($this, 'settings_list'));\n $this->register_handler('plugin.factoradder', array($this, 'settings_factoradder'));\n $this->register_handler('plugin.highsecuritydialog', array($this, 'settings_highsecuritydialog'));\n\n $this->include_script('kolab2fa.js');\n $this->include_stylesheet($this->local_skin_path() . '/kolab2fa.css');\n\n if ($this->check_secure_mode()) {\n $this->api->output->set_env('session_secured', $_SESSION['kolab_2fa_secure_mode']);\n }\n\n $this->api->output->add_label('save','cancel');\n $this->api->output->set_pagetitle($this->gettext('settingstitle'));\n $this->api->output->send('kolab_2fa.config');\n }", "function buildSettingsForm() {}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'col' => 6,\n 'type' => 'select',\n 'required' => true,\n 'label' => $this->l('Weather provider'),\n 'desc' => $this->l('Select your preferred Weather provider'),\n 'name' => 'WI_WEATHER_PROVIDER',\n 'options' => array(\n 'query' => $this->getProvidersAsOptions(),\n 'id' => 'id',\n 'name' => 'name',\n ),\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'required' => true,\n 'label' => $this->l('Provider API key'),\n 'desc' => $this->l('Enter your provider API key. Must be obtained from your provider account.'),\n 'name' => 'WI_WEATHER_KEY',\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'label' => $this->l('City for testing'),\n 'desc' => $this->l('Enter a city, only for test purpose.'),\n 'name' => 'WI_WEATHER_CITY',\n ),\n array(\n 'col' => 6,\n 'type' => 'switch',\n 'label' => $this->l('Enabled'),\n 'name' => 'WI_WEATHER_ENABLED',\n 'desc' => $this->l('Enable the weather block in your home.'),\n 'values' => array(\n array('value' => 1, 'name' => $this->l('Yes')),\n array('value' => 0, 'name' => $this->l('No')),\n ),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "function renderConfigForm() {\n\t}", "function SetAdminConfiguration() {\n\t\t\tadd_options_page(\"3B Meteo\", \"3B Meteo\", 8, basename(__FILE__), array(\"TreBiMeteo\",'DesignAdminPage'));\n\t\t}", "public function admin_options() {\n?>\n\t\t<h3><?php _e('Authorize SIM', WC_Authorize_SIM::TEXT_DOMAIN); ?></h3>\n \t<p><?php _e('Authorize SIM works by sending the user to Authorize to enter their payment information.', WC_Authorize_SIM::TEXT_DOMAIN); ?></p>\n \t<div class=\"updated\"><p>\n \t\t<strong><?php _e('Authorize.Net config:', WC_Authorize_SIM::TEXT_DOMAIN) ?></strong>\n \t\t<?php _e( 'Please login to Authorize and go to Account >> Settings >> Response/Receipt URLs' ); ?>\n \t\t<ol>\n\t \t\t<li><?php _e( 'Click \"Add URL\", and set this value for URL textbox: ') ?><strong><?php echo $this->notify_url ?></strong></li>\n\t \t\t<li><?php _e( 'Click \"Submit\" to complete', WC_Authorize_SIM::TEXT_DOMAIN ) ?></li>\n \t\t</ol>\n \t</p></div>\n \t<table class=\"form-table\">\n \t\t<?php $this->generate_settings_html(); ?>\n\t\t</table><!--/.form-table--> \t\n<?php\n }", "public function admin_options(){\r\n echo '<h3>'.__('Netgíró Payment Gateway', 'netgiro').'</h3>';\r\n echo '<p>'.__('Verslaðu á netinu með Netgíró á einfaldan hátt.').'</p>';\r\n echo '<table class=\"form-table\">';\r\n $this -> generate_settings_html();\r\n echo '</table>';\r\n }", "function DisplaySettings()\n {\n $this->DisplayBreadcrumb();\n PrintPluginSettings($this->pluginid, array('form_wizard_settings','form_export_settings'), $this->_page);\n }", "function settingsObject()\n\t{\n\t\tglobal $tpl, $ilCtrl, $lng;\n\t\t\n\t\t$editor = $this->object->_getRichTextEditor();\n\t\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$this->form = new ilPropertyFormGUI();\n\t\t$this->form->setFormAction($ilCtrl->getFormAction($this));\n\t\t$this->form->setTitle($lng->txt(\"adve_activation\"));\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_use_tiny_mce\"), \"use_tiny\");\n\t\tif ($editor == \"tinymce\")\n\t\t{\n\t\t\t$cb->setChecked(true);\n\t\t}\n\t\t$this->form->addItem($cb);\n\t\t$this->form->addCommandButton(\"saveSettings\", $lng->txt(\"save\"));\n\t\t\n\t\t$tpl->setContent($this->form->getHTML());\n\t}", "public function configuration()\n {\n if ($this->session->userdata('logged_in') == 1 && $this->session->userdata('user_type') != 'Admin') {\n redirect('home/login_page', 'location');\n }\n \n $data['body'] = \"admin/config/edit_config\";\n $data['time_zone'] = $this->_time_zone_list(); \n $data['language_info'] = $this->_language_list();\n $data[\"themes\"] = $this->_theme_list();\n $data['page_title'] = $this->lang->line('general settings');\n $this->_viewcontroller($data);\n }", "public function indexAction()\n\t{\n\t\t// Get the current configuration and\n\t\t// show a form for editing it\n\t\t$this->view->config = $this->adminService->getSystemConfig();\n\t\t$this->renderView('admin/config.php');\n\t}", "function gdata_admin_settings_form() {\n /*\n $form['oauth_google_default_scope'] = array(\n '#type' => 'textarea',\n '#title' => t('Scope'),\n '#default_value' => variable_get('oauth_google_default_scope', OAUTH_GOOGLE_DEFAULT_SCOPE),\n '#required' => TRUE,\n );\n $form['oauth_google_default_domain'] = array(\n '#type' => 'textfield',\n '#title' => t('Domain'),\n '#default_value' => variable_get('oauth_google_default_domain', 'default'),\n '#description' => t('Google Apps domain. Let default value to use regular Google accounts.'),\n );\n */\n $form['keys'] = array(\n '#type' => 'fieldset',\n '#title' => t('Private keys'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#description' => t('You need an RSA private key only to use AuthSub requests.'),\n );\n // http://code.google.com/apis/gdata/authsub.html#Registered\n $form['keys']['gdata_default_private_key'] = array(\n '#type' => 'textarea',\n '#title' => t('Private RSA key'),\n '#default_value' => variable_get('gdata_default_private_key', ''),\n );\n return system_settings_form($form);\n}", "public function initGeneralPageSettingsForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t\n\t\t$aset = new ilSetting(\"adve\");\n\n\t\t// use physical character styles\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_use_physical\"), \"use_physical\");\n\t\t$cb->setInfo($this->lng->txt(\"adve_use_physical_info\"));\n\t\t$cb->setChecked($aset->get(\"use_physical\"));\n\t\t$form->addItem($cb);\n\n\t\t// blocking mode\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_blocking_mode\"), \"block_mode_act\");\n\t\t$cb->setChecked($aset->get(\"block_mode_minutes\") > 0);\n\t\t$form->addItem($cb);\n\n\t\t\t// number of minutes\n\t\t\t$ni = new ilNumberInputGUI($this->lng->txt(\"adve_minutes\"), \"block_mode_minutes\");\n\t\t\t$ni->setMinValue(2);\n\t\t\t$ni->setMaxLength(5);\n\t\t\t$ni->setSize(5);\n\t\t\t$ni->setRequired(true);\n\t\t\t$ni->setInfo($this->lng->txt(\"adve_minutes_info\"));\n\t\t\t$ni->setValue($aset->get(\"block_mode_minutes\"));\n\t\t\t$cb->addSubItem($ni);\n\t\t\n\t\t$form->addCommandButton(\"saveGeneralPageSettings\", $lng->txt(\"save\"));\n\t \n\t\t$form->setTitle($lng->txt(\"adve_pe_general\"));\n\t\t$form->setFormAction($ilCtrl->getFormAction($this));\n\t \n\t\treturn $form;\n\t}", "function mda_settings_form() {\n\t$form['mda_resources_access'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => 'Page d\\'infos sur l\\'accès aux ressources MDA',\n\t\t\t'#description' => 'Information affichée à un utilisateur non connecté essayant de voir une ressource dont la visibilité est \"professionnels\".',\n\t);\n\t\n\t$default_text = \"<p>L'accès à cette ressource est réservée aux professionnels possédant un compte sur ce site.</p>\\n\";\n\t$default_text .= \"<p><a href=\" . \"/user\" . \">Accès au formulaire de connexion</a>.</p>\\n\";\n\t$default_text .= '<p>Si vous êtes un professionnel et que vous ne possédez pas de compte,';\n\t$default_text .= ' rendez-vous sur la page de création d\\'un <a href=\"/user/register\">nouveau compte</a>.';\n\n\t$form['mda_resources_access']['mda_restricted_access_text'] = array(\n\t\t\t'#type' => 'text_format',\n\t\t\t'#title' => 'Texte d\\'information',\n\t\t\t'#size' => 100,\n\t\t\t'#default_value' => variable_get('mda_restricted_access_text', $default_text),\n\t\t\t'#format'=> 'full_html',\n\t);\n\n\treturn system_settings_form($form);\n}", "public function setting_page() {\n\n\t\techo '<div class=\"wrap\">';\n\t\tsettings_errors();\n\n\t\t$this->setting->show_navigation();\n\t\t$this->setting->show_forms();\n\n\t\techo '</div>';\n\t}", "public function settingsPage()\n\t{\n\t\t$this->setForms();\n\t\tinclude( \\GFormProtected\\Helpers::view('settings/settings') );\n\t}", "public function action_article_settings()\n\t{\n\t\tglobal $context, $scripturl, $txt;\n\n\t\t// These are very likely to come in handy! (i.e. without them we're doomed!)\n\t\trequire_once(ADMINDIR . '/ManagePermissions.controller.php');\n\t\trequire_once(ADMINDIR . '/ManageServer.controller.php');\n\t\trequire_once(SUBSDIR . '/SettingsForm.class.php');\n\n\t\t// Initialize the form\n\t\t$this->_initArticleSettingsForm();\n\n\t\t// Save away\n\t\tif (isset($_GET['save']))\n\t\t{\n\t\t\tcheckSession();\n\n\t\t\t$this->_articleSettingsForm->setConfigValues($_POST);\n\t\t\t$this->_articleSettingsForm->save();\n\t\t\tredirectexit('action=admin;area=portalconfig;sa=articlesettings');\n\t\t}\n\n\t\t// Show the form\n\t\t$context['post_url'] = $scripturl . '?action=admin;area=portalconfig;sa=articlesettings;save';\n\t\t$context['settings_title'] = $txt['sp-adminArticleSettingsName'];\n\t\t$context['page_title'] = $txt['sp-adminArticleSettingsName'];\n\t\t$context['sub_template'] = 'show_settings';\n\n\t\t$this->_articleSettingsForm->prepare();\n\t}", "protected function form()\n {\n // 创建一个表单\n return Admin::form(SystemSetting::class, function (Form $form) {\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->text('title', '网站名称')->rules('required');\n $form->image('logo', '网站LOGO')->rules('required');\n $form->image('gongzhonghao', '公众号二维码');\n $form->image('xiaochengxu', '小程序二维码');\n $form->text('service', '在线客服');\n $form->text('icp', 'ICP 备案信息');\n $form->radio('is_login', '是否登录才能访问')->options(['1' => '是', '0' => '否'])->default('0');\n });\n }", "public function index()\n\t{\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\n\t\t$data['settings'] = $this->settings_model->adminSettings();\n\n\t\tif($this->input->post())\n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$this->form_validation->set_rules('default_email', 'Default Email', 'required|valid_email');\n\n\t\t\tif($this->form_validation->run())\n\t\t\t{\n\t\t\t\t$this->settings_model->updateSettings();\n\t\t\t}\n\t\t}\n\n\t\ttheme('admin_settings', $data);\n\t}", "public function admin_options() {\n\t\t\t?>\n\t \t<h3><?php _e('Payment Express', 'woothemes'); ?></h3>\n\t \t<p><?php _e('Allows credit card payments by Payment Express PX-Pay method', 'woothemes'); ?></p>\n\t \t<table class=\"form-table\">\n\t \t<?php\n\t\t\t\t// Generate the HTML For the settings form.\n\t\t\t\t$this->generate_settings_html();\n\t\t\t?>\n\t\t\t</table><!--/.form-table-->\n\t \t<?php\n\t\t}", "private function settings()\n\t{\n\t\tif($_POST)\n\t\t{\n\t\t\t// Available Vews\n config::set('s7n.views', $this->input->post('views'));\n\n\t\t\t// Default Sidebar Title\n config::set('s7n.default_sidebar_title', $this->input->post('default_sidebar_title'));\n\n\t\t\t// Default Sidebar Content\n config::set('s7n.default_sidebar_content', $this->input->post('default_sidebar_content'));\n\n\t\t\tmessage::info(__('Page Settings edited successfully'), 'admin/page/settings');\n\t\t}\n\n\t\t$this->head->title->append(__('Settings'));\n\n\t\t$this->template->title .= __('Settings');\n\t\t$this->template->content = View::factory('page/settings', array(\n\t\t\t'views' => config::get('s7n.page_views'),\n\t\t\t'default_sidebar_title' => config::get('s7n.default_sidebar_title'),\n\t\t\t'default_sidebar_content' => config::get('s7n.default_sidebar_content')\n\t\t));\n\t}", "function adminOptions() {\r\n\t\t\tTrackTheBookView::render('admin-options');\r\n\t\t}", "private function getConfigurationForm()\n {\n $form = array(\n 'form' => array(\n 'id_form' => 'module_config',\n 'legend' => array(\n 'title' => $this->l('Configuration'),\n 'icon' => 'icon-cogs'\n ),\n 'input' => array(\n array(\n 'label' => $this->l('Enable/Disable'),\n 'type' => 'switch',\n 'name' => 'kbpushnotification[enable]',\n 'values' => array(\n array(\n 'value' => 1,\n ),\n array(\n 'value' => 0,\n ),\n ),\n 'hint' => $this->l('Enable/Disable the plugin')\n ),\n array(\n 'label' => $this->l('Enable/Disable Order Status Update'),\n 'type' => 'switch',\n 'name' => 'kbpushnotification[enable_order_status]',\n 'values' => array(\n array(\n 'value' => 1,\n ),\n array(\n 'value' => 0,\n ),\n ),\n 'hint' => $this->l('Enable/Disable the order status update')\n ),\n array(\n 'label' => $this->l('Enable/Disable Abandoned Cart alert'),\n 'type' => 'switch',\n 'name' => 'kbpushnotification[enable_abandoned_cart]',\n 'values' => array(\n array(\n 'value' => 1,\n ),\n array(\n 'value' => 0,\n ),\n ),\n 'hint' => $this->l('Enable/Disable the abandoned cart alert')\n ),\n array(\n 'label' => $this->l('Enable/Disable Product Price alert'),\n 'type' => 'switch',\n 'name' => 'kbpushnotification[enable_product_price_alert]',\n 'values' => array(\n array(\n 'value' => 1,\n ),\n array(\n 'value' => 0,\n ),\n ),\n 'hint' => $this->l('Enable/Disable the product price alert')\n ),\n array(\n 'label' => $this->l('Enable/Disable Product back in stock alert'),\n 'type' => 'switch',\n 'name' => 'kbpushnotification[enable_product_stock_alert]',\n 'values' => array(\n array(\n 'value' => 1,\n ),\n array(\n 'value' => 0,\n ),\n ),\n 'hint' => $this->l('Enable/Disable the product back in stock alert')\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right kbph_general_btn'\n ),\n ),\n );\n return $form;\n }", "public function admin_options() { ?>\n <h3><?php _e( $this->pluginTitle(), 'midtrans-woocommerce' ); ?></h3>\n <p><?php _e('Allows payments using Midtrans.', 'midtrans-woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form. generated from `init_form_fields`\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }", "public function form()\n {\n $this->switch('footer_remove', Support::trans('main.footer_remove'))\n ->default(admin_setting('footer_remove'));\n $defaultColors = [\n 'default' => '墨蓝',\n 'blue' => '蓝',\n 'blue-light' => '亮蓝',\n 'green' => '墨绿',\n ];\n foreach (explode(\",\", ServiceProvider::setting('additional_theme_colors')) as $value) {\n if (!empty($value)) {\n [$k, $v] = explode(\":\", $value);\n $defaultColors[$k] = $v;\n }\n }\n\n $this->radio('theme_color', Support::trans('main.theme_color'))\n ->options($defaultColors)\n ->default(admin_setting('theme_color'));\n $this->radio('sidebar_style', Support::trans('main.sidebar_style'))\n ->options([\n 'default' => '默认',\n 'sidebar-separate' => '菜单分离',\n 'horizontal_menu' => '水平菜单'\n ])\n ->default(admin_setting('sidebar_style'));\n $this->switch('grid_row_actions_right', Support::trans('main.grid_row_actions_right'))\n ->help('启用后表格行操作按钮将永远贴着最右侧。')\n ->default(admin_setting('grid_row_actions_right'));\n }", "public function configure()\n\t{\n\t\t$ui = new FormUI( 'jambo_config' );\n\n\t\t// Add a text control for the address you want the email sent to\n\t\t$send_to = $ui->append( 'text', 'send_to', 'option:jambo__send_to', _t('Where To Send Email: ', 'jambo') );\n\t\t$send_to->add_validator( 'validate_required' );\n\n\t\t// Add a text control for email subject\n\t\t$subject = $ui->append( 'text', 'subject', 'option:jambo__subject', _t('Subject: ', 'jambo') );\n\t\t$subject->add_validator( 'validate_required' );\n\n\t\t// Add an explanation for the subject field. Shouldn't FormUI have an easier way to do this?\n\t\t$ui->append( 'static', 'subject_explanation', '<p>' . _t('An %s in the subject will be replaced with a subject provided by the user. If omitted, no subject will be requested.', 'jambo') . '</p>' );\n\n\t\t// Add a text control for the prefix to the success message\n\t\t$success_msg = $ui->append( 'textarea', 'success_msg', 'option:jambo__success_msg', _t('Success Message: ', 'jambo') );\n\n\t\t$ui->append( 'submit', 'save', _t('Save', 'jambo') );\n\t\treturn $ui;\n\t}", "protected function form()\n {\n // return Admin::form(Campaign_setting_form::class, function (Form $form) {\n // });\n }", "protected function settingForm()\n {\n return Administrator::form(function (Form $form) {\n $form->display('username', trans('admin.username'));\n $form->text('name', trans('admin.name'))->rules('required');\n $form->image('avatar', trans('admin.avatar'));\n $form->password('password', trans('admin.password'))->rules('confirmed|required');\n $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required')\n ->default(function ($form) {\n return $form->model()->password;\n });\n\n $form->setAction(admin_base_path('auth/setting'));\n\n $form->ignore(['password_confirmation']);\n\n $form->saving(function (Form $form) {\n if ($form->password && $form->model()->password !== $form->password) {\n $form->password = bcrypt($form->password);\n }\n });\n\n $form->saved(function () {\n admin_toastr(trans('admin.update_succeeded'));\n\n return redirect(admin_base_path('auth/setting'));\n });\n });\n }", "public function settings_page() {\n\n\t\t?>\n\n\t\t<div class=\"wrap schedule-a-visit-to-sherpa-settings\">\n\t\t\t\n\t\t\t<form id=\"schedule-a-visit-to-sherpa-form\" method=\"post\" action=\"options.php\">\n\t\t\t\t\n\t\t\t\t<?php echo wp_nonce_field( 'schedule_a_visit_to_sherpa_data', 'schedule_a_visit_to_sherpa_nonce' ); ?>\n\n\t\t\t\t<?php settings_fields( 'schedule_a_visit_to_sherpa_settings_section' ); ?>\n\n\t\t\t\t<?php do_settings_sections( 'schedule-a-visit-to-sherpa' ); ?>\n\t\t\t\t\n\t\t\t\t<?php submit_button(); ?>\n\n\t\t\t</form>\n\n </div>\n\n\t\t<?php\n\n\t}", "public function settingsPage() {\n require_once 'form.phtml';\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'col' => 2,\n 'type' => 'text',\n 'suffix' => '<i class=\"icon icon-euro\"></i>',\n 'required' => true,\n 'label' => $this->l('Customer must spent'),\n 'desc' => $this->l('Enter the amount which your customers have to sepent to receibe the coupon.'),\n 'name' => 'WI_SPENT_AMOUNT',\n ),\n array(\n 'col' => 2,\n 'type' => 'text',\n 'suffix' => '<i class=\"icon icon-euro\"></i>',\n 'required' => true,\n 'label' => $this->l('Amount of the coupon'),\n 'desc' => $this->l('Enter the amount of the coupon for gift to your customers.'),\n 'name' => 'WI_SPENT_COUPON',\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'required' => true,\n 'label' => $this->l('Coupon validity in days'),\n 'desc' => $this->l('Enter the number of days while the coupon will be valid.'),\n 'name' => 'WI_SPENT_DAYS',\n ),\n array(\n 'col' => 6,\n 'type' => 'switch',\n 'label' => $this->l('Enabled'),\n 'name' => 'WI_SPENT_ENABLED',\n 'desc' => $this->l('Enable or disable this feature.'),\n 'values' => array(\n array('value' => 1, 'name' => $this->l('Yes')),\n array('value' => 0, 'name' => $this->l('No')),\n ),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "public function admin_options() { ?>\n <h3><?php _e( 'Veritrans', 'woocommerce' ); ?></h3>\n <p><?php _e('Allows payments using Veritrans.', 'woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }", "function admin_options() {\r\n ?>\r\n <h3><?php _e('Bitcoin Payment','Bitcoin_Payment'); ?></h3>\r\n <table class=\"form-table\">\r\n <?php $this->generate_settings_html(); ?>\r\n </table> <?php\r\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Show manufacturer name'),\n 'name' => 'MF_TITLE',\n 'label' => $this->l('Enable Manufacturers Name'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Show manufacturer description'),\n 'name' => 'MF_DESCRIPTION',\n 'label' => $this->l('Provide a description for the heading'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Number of manufacturers to display (Enter 0 to display all)'),\n 'name' => 'MF_MAN_NUMBER',\n 'label' => $this->l('Number of Manufacturers'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on desktops'),\n 'name' => 'MF_PER_ROW_DESKTOP',\n 'label' => $this->l('Logo\\'s per row (Desktop)'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on tablets'),\n 'name' => 'MF_PER_ROW_TABLET',\n 'label' => $this->l('Logo\\'s per row (Tablet)'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on mobiles'),\n 'name' => 'MF_PER_ROW_MOBILE',\n 'label' => $this->l('Logo\\'s per row (Mobile)'),\n 'required' => true,\n ),\n array(\n 'type' => 'select',\n 'desc' => 'How the logo\\'s should be sorted',\n 'name' => 'MF_MAN_ORDER',\n 'label' => $this->l('Order by'),\n 'options' => array(\n 'query' => array(\n array(\n 'id_option' => 'name_asc',\n 'name' => $this->l('Name ASC'),\n ),\n array(\n 'id_option' => 'name_desc',\n 'name' => $this->l('Name DESC'),\n ),\n array(\n 'id_option' => 'manu_asc',\n 'name' => $this->l('Manufacturer ID ASC'),\n ),\n array(\n 'id_option' => 'manu_desc',\n 'name' => $this->l('Manufacturer ID DESC'),\n ),\n ),\n 'id' => 'id_option',\n 'name' => 'name',\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable Manufacturers Name'),\n 'name' => 'MF_SHOW_MAN_NAME',\n 'is_bool' => true,\n 'desc' => $this->l('Use this module in live mode'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes'),\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No'),\n )\n ),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "public static function config() {\n\t\t$username = ( isset( $_POST['username'] ) ) ? stripslashes( $_POST['username'] ) : self::get_dashboard_widget_option(self::wid, 'username');\n\t\t$apikey = ( isset( $_POST['apikey'] ) ) ? stripslashes( $_POST['apikey'] ) : self::get_dashboard_widget_option(self::wid, 'apikey');\n\t\t$project_id = ( isset( $_POST['project_id'] ) ) ? stripslashes( $_POST['project_id'] ) : self::get_dashboard_widget_option(self::wid, 'project_id');\n\t\t\n\t\tself::update_dashboard_widget_options(\n\t\t\tself::wid, //The widget id\n\t\t\tarray( //Associative array of options & default values\n\t\t\t\t'username' => $username,\n\t\t\t\t'apikey' => $apikey,\n\t\t\t\t'project_id' => $project_id,\n\t\t\t)\n\t\t);\n ?>\n\t\t<p><label for=\"username\"><?php _e('Benutzername:', 'affiliatetheme-backend'); ?></label> <input type=\"text\" name=\"username\" value=\"<?php echo $username; ?>\" /></p>\n\t\t<p><label for=\"apikey\"><?php _e('API Key:', 'affiliatetheme-backend'); ?></label> <input type=\"text\" name=\"apikey\" value=\"<?php echo $apikey; ?>\" ></p>\n\t\t<p><label for=\"project_id\"><?php _e('Projekt ID:', 'affiliatetheme-backend'); ?></label> <input type=\"text\" name=\"project_id\" value=\"<?php echo $project_id; ?>\" ></p>\n\n <p><?php _e('Kein API Key vorhanden? Bitte wende dich an den Rankalyst Support: support@rankalyst.de', 'affiliatetheme-backend'); ?></p>\n\t\t<?php\n }", "public function settings_view() {\n?>\n\t\t<div class=\"wrap\">\n\t\t\t<h2><?php _e('Google Analytics Options', 'wp-google-analytics') ?></h2>\n\t\t\t<form action=\"options.php\" method=\"post\" id=\"wp_google_analytics\">\n\t\t\t\t<?php\n\t\t\t\t\tsettings_fields( 'wga' );\n\t\t\t\t\tdo_settings_sections( 'wga' );\n\t\t\t\t\tsubmit_button( __( 'Update Options', 'wp-google-analytics' ) );\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n<?php\n\t}", "public function admin_options()\n {\n ?>\n <h3><?php _e('PAYSTO', 'woocommerce'); ?></h3>\n <p><?php _e('Settings payment recieve from PAYSTO system.', 'woocommerce'); ?></p>\n\n <?php if ($this->is_valid_for_use()): ?>\n\n <table class=\"form-table\">\n\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n\n <?php else: ?>\n <div class=\"inline error\"><p>\n <strong><?php _e('Gate swich off', 'woocommerce'); ?></strong>:\n <?php _e('PAYSTO not support currency used in your store.', 'woocommerce'); ?>\n </p></div>\n <?php\n endif;\n\n }", "public function getConfigForm() {\r\n\t\treturn parent::getConfigForm()->addElementPath(dirname(__FILE__));\r\n\t}", "public function adminPluginOptionsPage()\n {\n echo $this->_loadView('admin-settings-page');\n }", "private function _initGeneralSettingsForm()\n\t{\n\t\tglobal $txt, $context;\n\n\t\t// Instantiate the form\n\t\t$this->_generalSettingsForm = new Settings_Form(Settings_Form::DB_ADAPTER);\n\n\t\t$config_vars = array(\n\t\t\tarray('select', 'sp_portal_mode', explode('|', $txt['sp_portal_mode_options'])),\n\t\t\tarray('check', 'sp_maintenance'),\n\t\t\tarray('text', 'sp_standalone_url'),\n\t\t\t'',\n\t\t\tarray('select', 'portaltheme', $context['SPortal']['themes']),\n\t\t\tarray('check', 'sp_disableColor'),\n\t\t\tarray('check', 'sp_disableForumRedirect'),\n\t\t\tarray('check', 'sp_disable_random_bullets'),\n\t\t\tarray('check', 'sp_disable_php_validation', 'subtext' => $txt['sp_disable_php_validation_desc']),\n\t\t\tarray('check', 'sp_disable_side_collapse'),\n\t\t\tarray('check', 'sp_resize_images'),\n\t\t\tarray('check', 'sp_disableMobile'),\n\t\t);\n\n\t\t$this->_generalSettingsForm->setConfigVars($config_vars);\n\t}", "protected function getConfigForm()\n {\n // TODO : add default blog text per lang ?\n $employees = Employee::getEmployeesByProfile(\n 1,\n true\n );\n $default_snippet = array(\n array(\n 'snippet' => 'Article',\n 'name' => $this->l('Simple article')\n ),\n array(\n 'snippet' => 'NewsArticle',\n 'name' => $this->l('News article')\n ),\n );\n $layouts = array(\n array(\n 'layout' => 'layouts/layout-full-width.tpl',\n 'name' => $this->l('Full width')\n ),\n array(\n 'layout' => 'layouts/layout-left-column.tpl',\n 'name' => $this->l('Left column')\n ),\n array(\n 'layout' => 'layouts/layout-right-column.tpl',\n 'name' => $this->l('Right column')\n ),\n array(\n 'layout' => 'layouts/layout-both-columns.tpl',\n 'name' => $this->l('Both columns')\n ),\n );\n $trash_days = array(\n array(\n 'id_trash' => 0,\n 'name' => $this->l('Do not empty trash')\n ),\n array(\n 'id_trash' => 1,\n 'name' => $this->l('One day')\n ),\n array(\n 'id_trash' => 2,\n 'name' => $this->l('Two days')\n ),\n array(\n 'id_trash' => 3,\n 'name' => $this->l('Three days')\n ),\n array(\n 'id_trash' => 4,\n 'name' => $this->l('Four days')\n ),\n array(\n 'id_trash' => 5,\n 'name' => $this->l('Five days')\n ),\n array(\n 'id_trash' => 6,\n 'name' => $this->l('Six days')\n ),\n array(\n 'id_trash' => 7,\n 'name' => $this->l('One week')\n ),\n );\n $css_files = array(\n array(\n 'id_file' => 'default',\n 'name' => $this->l('default.css file')\n ),\n array(\n 'id_file' => 'red',\n 'name' => $this->l('red.css file')\n ),\n array(\n 'id_file' => 'green',\n 'name' => $this->l('green.css file')\n ),\n array(\n 'id_file' => 'yellow',\n 'name' => $this->l('yellow.css file')\n ),\n array(\n 'id_file' => 'white',\n 'name' => $this->l('white.css file')\n ),\n );\n $post_status = array(\n array(\n 'id_status' => 'draft',\n 'name' => $this->l('draft')\n ),\n array(\n 'id_status' => 'pending',\n 'name' => $this->l('pending')\n ),\n array(\n 'id_status' => 'published',\n 'name' => $this->l('published')\n ),\n array(\n 'id_status' => 'trash',\n 'name' => $this->l('trash')\n ),\n array(\n 'id_status' => 'planned',\n 'name' => $this->l('planned')\n ),\n );\n $form_fields = [];\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Blog default Settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'text',\n 'label' => $this->l('Blog base route'),\n 'name' => 'EVERPSBLOG_ROUTE',\n 'desc' => $this->l('Leaving empty will set \"blog\"'),\n 'hint' => $this->l('Use a keyword associated to your shop'),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Post content excerpt'),\n 'name' => 'EVERPSBLOG_EXCERPT',\n 'desc' => $this->l('Post excerpt length for content on listing'),\n 'hint' => $this->l('Please set post content excerpt'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Post title length'),\n 'name' => 'EVERPSBLOG_TITLE_LENGTH',\n 'desc' => $this->l('Post title length for content on listing'),\n 'hint' => $this->l('Please set post title length'),\n 'required' => true,\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Extends TinyMCE on blog management ?'),\n 'desc' => $this->l('Set yes to extends TinyMCE on blog management pages'),\n 'hint' => $this->l('Else TinyMCE will be default'),\n 'required' => false,\n 'name' => 'EVERBLOG_TINYMCE',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show post views count ?'),\n 'desc' => $this->l('Set yes to show views count'),\n 'hint' => $this->l('Else will only be shown on admin'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_POST_COUNT',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show post on homepage ?'),\n 'desc' => $this->l('Set yes to show posts on homepage'),\n 'hint' => $this->l('Else posts won\\'t be shown on homepage'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_HOME',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Number of posts for home'),\n 'name' => 'EVERPSBLOG_HOME_NBR',\n 'desc' => $this->l('Leaving empty will set 4 posts'),\n 'hint' => $this->l('Posts are 4 per row'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Number of posts for product'),\n 'name' => 'EVERPSBLOG_PRODUCT_NBR',\n 'desc' => $this->l('Leaving empty will set 4 posts'),\n 'hint' => $this->l('Posts are 4 per row'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Posts per page'),\n 'name' => 'EVERPSBLOG_PAGINATION',\n 'desc' => $this->l('Leaving empty will set 10 posts per page'),\n 'hint' => $this->l('Will add pagination'),\n 'required' => true,\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Admin email'),\n 'desc' => $this->l('Will receive new comments notification by email'),\n 'hint' => $this->l('You can set a new account on your shop'),\n 'required' => true,\n 'name' => 'EVERBLOG_ADMIN_EMAIL',\n 'options' => array(\n 'query' => $employees,\n 'id' => 'id_employee',\n 'name' => 'email'\n )\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Allow comments on posts ?'),\n 'desc' => $this->l('Set yes to allow comments'),\n 'hint' => $this->l('You can check them before publishing'),\n 'required' => false,\n 'name' => 'EVERBLOG_ALLOW_COMMENTS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Check comments on posts before they are published ?'),\n 'desc' => $this->l('Set yes to check comments before publishing'),\n 'hint' => $this->l('In order to avoid spam'),\n 'required' => false,\n 'name' => 'EVERBLOG_CHECK_COMMENTS',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Allow only registered customers to comment ?'),\n 'desc' => $this->l('Set yes to allow only registered customers to comment'),\n 'hint' => $this->l('Else everyone will be able to comment'),\n 'required' => false,\n 'name' => 'EVERBLOG_ONLY_LOGGED_COMMENT',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Empty trash'),\n 'desc' => $this->l('Please choose auto empty trash in days'),\n 'hint' => $this->l('Will auto delete trashed posts on CRON task'),\n 'required' => true,\n 'name' => 'EVERBLOG_EMPTY_TRASH',\n 'options' => array(\n 'query' => $trash_days,\n 'id' => 'id_trash',\n 'name' => 'name',\n ),\n 'lang' => false,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Default blog SEO title'),\n 'name' => 'EVERBLOG_TITLE',\n 'desc' => $this->l('Max 65 characters for SEO'),\n 'hint' => $this->l('Will impact SEO'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog SEO meta description'),\n 'name' => 'EVERBLOG_META_DESC',\n 'desc' => $this->l('Max 165 characters for SEO'),\n 'hint' => $this->l('Will impact SEO'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default blog type'),\n 'desc' => $this->l('Will be used for structured metadatas'),\n 'hint' => $this->l('Select blog type depending on your posts'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_TYPE',\n 'options' => array(\n 'query' => $default_snippet,\n 'id' => 'snippet',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog top text'),\n 'name' => 'EVERBLOG_TOP_TEXT',\n 'desc' => $this->l('Will be shown on blog top default page'),\n 'hint' => $this->l('Explain your blog purpose'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n 'autoload_rte' => true\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog bottom text'),\n 'name' => 'EVERBLOG_BOTTOM_TEXT',\n 'desc' => $this->l('Will be shown on blog bottom default page'),\n 'hint' => $this->l('Explain your blog purpose'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n 'autoload_rte' => true\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Use RSS feed ?'),\n 'desc' => $this->l('Will add a link to RSS feed on blog and each tag, category, author'),\n 'hint' => $this->l('Else feed wont be used'),\n 'required' => false,\n 'name' => 'EVERBLOG_RSS',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show author ?'),\n 'desc' => $this->l('Will show author name and avatar on posts'),\n 'hint' => $this->l('Else author name and avatar will be hidden'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_AUTHOR',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Banned users'),\n 'name' => 'EVERBLOG_BANNED_USERS',\n 'desc' => $this->l('Add banned users typing their emails, one per line'),\n 'hint' => $this->l('Unwanted users won\\'t be able to post comments'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Banned IP'),\n 'name' => 'EVERBLOG_BANNED_IP',\n 'desc' => $this->l('Add banned users typing their IP addresses, one per line'),\n 'hint' => $this->l('Unwanted users won\\'t be able to post comments'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show parent categories list on left/right columns ?'),\n 'desc' => $this->l('Set yes show a list of all parent categories on left or right columns'),\n 'hint' => $this->l('Will show ordered parent categories on left/right columns'),\n 'name' => 'EVERBLOG_CATEG_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show tags list on left/right columns ?'),\n 'desc' => $this->l('Set yes to activate cool stuff'),\n 'hint' => $this->l('Set yes show a tags cloud on left or right columns'),\n 'required' => false,\n 'name' => 'EVERBLOG_TAG_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show archives list on left/right columns ?'),\n 'desc' => $this->l('Set yes show links for monthly posts on left or right columns'),\n 'hint' => $this->l('Will show yearly and monthly posts'),\n 'required' => false,\n 'name' => 'EVERBLOG_ARCHIVE_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show related posts on products pages ?'),\n 'desc' => $this->l('Set yes show related posts on product pages footer'),\n 'hint' => $this->l('Will show related posts on product page footer'),\n 'required' => false,\n 'name' => 'EVERBLOG_RELATED_POST',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show featured images on categories ?'),\n 'desc' => $this->l('Set yes to show each category featured image'),\n 'hint' => $this->l('Else category featured image won\\'t be shown'),\n 'name' => 'EVERBLOG_SHOW_FEAT_CAT',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show featured images on tags ?'),\n 'desc' => $this->l('Set yes to show each tag featured image'),\n 'hint' => $this->l('Else tag featured image won\\'t be shown'),\n 'name' => 'EVERBLOG_SHOW_FEAT_TAG',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Activate cool CSS animations ?'),\n 'desc' => $this->l('Set yes to activate cool stuff'),\n 'hint' => $this->l('Will add animations on posts, images, etc'),\n 'name' => 'EVERBLOG_ANIMATE',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable Fancybox'),\n 'hint' => $this->l('Set no if your theme already uses it'),\n 'desc' => $this->l('Use Fancybox for popups on post images'),\n 'name' => 'EVERBLOG_FANCYBOX',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Featured category on blog default page'),\n 'name' => 'EVERBLOG_CAT_FEATURED',\n 'desc' => $this->l('Featured category'),\n 'hint' => $this->l('Will show category products on blog page'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n ),\n 'buttons' => array(\n 'generateBlogSitemap' => array(\n 'name' => 'submitGenerateBlogSitemap',\n 'type' => 'submit',\n 'class' => 'btn btn-default pull-right',\n 'icon' => 'process-icon-refresh',\n 'title' => $this->l('Generate sitemaps')\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Blog layout settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Default blog layout'),\n 'desc' => $this->l('Will add or remove columns from blog page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_BLOG_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default post layout'),\n 'desc' => $this->l('Will add or remove columns from post page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_POST_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default category layout'),\n 'desc' => $this->l('Will add or remove columns from category page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_CAT_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default author layout'),\n 'desc' => $this->l('Will add or remove columns from author page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_AUTHOR_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default tag layout'),\n 'desc' => $this->l('Will add or remove columns from tag page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_TAG_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('WordPress XML import settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Default post state on XML import'),\n 'desc' => $this->l('Will set default post state on XML import'),\n 'hint' => $this->l('Please select default post state on XML file import'),\n 'required' => true,\n 'name' => 'EVERBLOG_IMPORT_POST_STATE',\n 'options' => array(\n 'query' => $post_status,\n 'id' => 'id_status',\n 'name' => 'name',\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress authors from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress authors'),\n 'hint' => $this->l('Else no authors will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_AUTHORS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress categories from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress categories'),\n 'hint' => $this->l('Else no categories will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_CATS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress tags from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress tags'),\n 'hint' => $this->l('Else no tags will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_TAGS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress authors from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress authors'),\n 'hint' => $this->l('Else no authors will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_AUTHORS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress categories from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress categories'),\n 'hint' => $this->l('Else no categories will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_CATS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress tags from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress tags'),\n 'hint' => $this->l('Else no tags will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_TAGS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'file',\n 'label' => $this->l('Import WordPress XML file'),\n 'desc' => $this->l('Import WordPress XML posts file'),\n 'hint' => $this->l('Will import posts from WordPress XML file'),\n 'name' => 'wordpress_xml',\n 'required' => false\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save and import'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Design settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Custom CSS file'),\n 'desc' => $this->l('You can change here default CSS file'),\n 'hint' => $this->l('By changing CSS file, you will change blog colors'),\n 'required' => true,\n 'name' => 'EVERBLOG_CSS_FILE',\n 'options' => array(\n 'query' => $css_files,\n 'id' => 'id_file',\n 'name' => 'name',\n ),\n 'lang' => false,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Custom CSS for blog'),\n 'desc' => $this->l('Add here your custom CSS rules'),\n 'hint' => $this->l('Webdesigners here can manage CSS rules for blog'),\n 'name' => 'EVERBLOG_CSS',\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n return $form_fields;\n }", "public function getConfigForm()\r\n {\r\n $form = parent::getConfigForm();\r\n $form->addElementPath(dirname(__FILE__) . '/fields');\r\n return $form;\r\n }", "function pp_btw2017_uu_admin_settings_form() {\n\t// form\n\t\t$form = array();\n\n\t\t$form['landesliste'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Landesliste'),\n\t\t\t'#description' => t(\"Der UU-Sammelbalken kann am Ende oder am Anfang angezeigt werden.\"),\n\t\t);\n\n\t\t$form['landesliste']['pp_btw2017_landesliste_start'] = array(\n\t\t\t'#type' => 'checkbox',\n\t\t\t'#title' => t('Am Anfang anzeigen'),\n\t\t\t'#default_value' => variable_get('pp_btw2017_landesliste_start', NULL),\n\t\t);\n\n\t\t$form['landesliste']['pp_btw2017_landesliste_end'] = array(\n\t\t\t'#type' => 'checkbox',\n\t\t\t'#title' => t('Am Ende anzeigen'),\n\t\t\t'#default_value' => variable_get('pp_btw2017_landesliste_end', NULL),\n\t\t);\n\n\n\t\t$form['kreiswahlvorschlaege'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Kreiswahlvorschläge'),\n\t\t\t'#description' => t(\"Die UU-Sammelbalken können pro Wahlkreis zur Anzeige ausgewählt werden.\"),\n\t\t);\n\n\t\t$wks = array(\n\t\t\t\t\"167\"\t=>\t\"Waldeck\",\n\t\t\t\t\"168\"\t=>\t\"Kassel\",\n\t\t\t\t\"169\"\t=>\t\"Werra-Meißner – Hersfeld-Rotenburg\",\n\t\t\t\t\"170\"\t=>\t\"Schwalm-Eder\",\n\t\t\t\t\"171\"\t=>\t\"Marburg\",\n\t\t\t\t\"172\"\t=>\t\"Lahn-Dill\",\n\t\t\t\t\"173\"\t=>\t\"Gießen\",\n\t\t\t\t\"174\"\t=>\t\"Fulda\",\n\t\t\t\t\"175\"\t=>\t\"Main-Kinzig – Wetterau II – Schotten\",\n\t\t\t\t\"176\"\t=>\t\"Hochtaunus\",\n\t\t\t\t\"177\"\t=>\t\"Wetterau I\",\n\t\t\t\t\"178\"\t=>\t\"Rheingau-Taunus – Limburg\",\n\t\t\t\t\"179\"\t=>\t\"Wiesbaden\",\n\t\t\t\t\"180\"\t=>\t\"Hanau\",\n\t\t\t\t\"181\"\t=>\t\"Main-Taunus\",\n\t\t\t\t\"182\"\t=>\t\"Frankfurt am Main I\",\n\t\t\t\t\"183\"\t=>\t\"Frankfurt am Main II\",\n\t\t\t\t\"184\"\t=>\t\"Groß-Gerau\",\n\t\t\t\t\"185\"\t=>\t\"Offenbach\",\n\t\t\t\t\"186\"\t=>\t\"Darmstadt\",\n\t\t\t\t\"187\"\t=>\t\"Odenwald\",\n\t\t\t\t\"188\"\t=>\t\"Bergstraße\",\n\t\t);\n\n\t\tforeach ($wks as $wk => $name) {\n\t\t\t$form['kreiswahlvorschlaege']['pp_btw2017_wk'.$wk] = array(\n\t\t\t\t'#type' => 'checkbox',\n\t\t\t\t'#title' => t(\"WK \".$wk.\" (\".$name.\")\"),\n\t\t\t\t'#default_value' => variable_get('pp_btw2017_wk'.$wk, NULL),\n\t\t\t);\n\t\t}\n\n\t// return\n\t\treturn system_settings_form($form);\n}", "public function settings_page() { ?>\n\n <div class=\"wrap\">\n <?php $this->settings_api->settings_html(); ?>\n </div><?php\n }", "function resources_admin_config($form, $form_state) {\n\n // Get all the available file types and build an array.\n $file_types = file_type_load_all(TRUE);\n $available_file_types = array();\n foreach ($file_types as $type => $info) {\n $available_file_types[$type] = $info->label;\n }\n\n // Get all the resource types and build the settings form for one resource\n // each.\n $resource_types = resources_get_info();\n foreach ($resource_types as $resource_type => $resource_type_info) {\n // Provide a wrapper for the resource.\n $form[$resource_type] = array(\n '#type' => 'fieldset',\n '#title' => $resource_type_info['label'],\n '#collapsible' => FALSE,\n '#collapsed' => FALSE,\n );\n\n $resource_type_default = variable_get('resources_' . $resource_type . '_file_type', array());\n\n // Add the file type selection.\n $form[$resource_type]['resources_' . $resource_type . '_file_type'] = array(\n '#type' => 'select',\n '#title' => t('Associated File Type'),\n '#options' => $available_file_types,\n '#required' => FALSE,\n '#default_value' => $resource_type_default,\n );\n\n $entity_info = entity_get_info();\n $view_mode_info = $entity_info['file']['view modes'];\n\n // Get all the view modes for the bundle.\n $view_mode_settings = field_view_mode_settings('file', $resource_type_default);\n\n $view_modes = array();\n\n // Loop through each view mode to see if they are enabled.\n foreach ($view_mode_settings as $view_mode => $settings) {\n if ($settings['custom_settings']) {\n $view_modes[$view_mode] = $view_mode_info[$view_mode]['label'];\n }\n }\n\n // Add the file type selection.\n $form[$resource_type]['resources_' . $resource_type . '_view_modes'] = array(\n '#type' => 'select',\n '#title' => t('Views Modes'),\n '#options' => $view_modes,\n '#required' => FALSE,\n '#multiple' => TRUE,\n '#default_value' => variable_get('resources_' . $resource_type . '_view_modes', array()),\n );\n\n // Only add settings if a callback has been specified for this type.\n if (!empty($resource_type_info['settings callback'])) {\n // Get the specified form elements.\n $form_info = call_user_func($resource_type_info['settings callback']);\n\n // If we have elements then add the settings wrapper and the form\n // elements.\n if ($form_info) {\n $form[$resource_type]['settings'] = array(\n '#type' => 'fieldset',\n '#title' => t('Settings'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n\n $form[$resource_type]['settings'] += $form_info;\n }\n }\n }\n\n // Fieldset and Textfield for setting the 'Browser Preview View Mode'\n\n $form['resources_browser_preview_view_mode_fieldset'] = array(\n '#type' => 'fieldset',\n '#title' => 'Browser Preview',\n '#collapsible' => FALSE,\n '#collapsed' => FALSE,\n );\n\n $form['resources_browser_preview_view_mode_fieldset']['resources_browser_preview_view_mode'] = array(\n '#type' => 'select',\n '#title' => t('Views Modes'),\n '#options' => $view_modes,\n '#required' => FALSE,\n '#multiple' => FALSE,\n '#default_value' => variable_get('resources_browser_preview_view_mode', 'resource_browser_preview'),\n );\n\n return system_settings_form($form);\n}", "public function admin_options() {\n\n\t\t?>\n\t\t<h3><?php _e( 'PayU standard', 'woocommerce' ); ?></h3>\n\t\t<p><?php _e( 'PayU standard works by sending the user to PayU to enter their payment information.', 'woocommerce' ); ?></p>\n\n \t<?php if ( $this->is_valid_for_use() ) : ?>\n\n\t\t\t<table class=\"form-table\">\n\t\t\t<?php $this->generate_settings_html(); ?>\n\t\t\t</table><!--/.form-table-->\n\n\t\t<?php else : ?>\n <div class=\"inline error\"><p><strong><?php _e( 'Gateway Disabled', 'woocommerce' ); ?></strong>: <?php _e( 'PayU does not support your store currency.', 'woocommerce' ); ?></p></div>\n\t\t<?php\n\t\t\tendif;\n\t}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'textarea',\n 'label' => $this->l('CGV'),\n 'name' => 'MYETICKETS_CGV',\n 'desc' => $this->l('Set the CGV that will be print to e-tckets.'),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Number of days to use e-tickets'),\n 'name' => 'MYETICKETS_PERIOD',\n 'class' => 'fixed-width-xs',\n 'desc' => $this->l('Set the number of days to use and check e-tckets.'),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "function room_reservations_admin_settings_page($form, &$form_state) {\n $default_calendar_text = _room_reservations_get_variable('calendar_text');\n $default_reserve_room_instructions_text\n = _room_reservations_get_variable('reserve_instructions');\n $default_reserve_form_instructions_text\n = _room_reservations_get_variable('reserve_form_instructions');\n $default_policies = _room_reservations_get_variable('policies');\n $form['calendar_text'] = array(\n '#title' => t('Calendar page text'),\n '#type' => 'textarea',\n '#rows' => 5,\n '#description' => t('Text displayed at the top of the reservation\n calendar page.'),\n '#default_value' => $default_calendar_text,\n '#weight' => -90,\n );\n $form['reserve_instructions_text'] = array(\n '#title' => t('Reserve a room instructions text'),\n '#type' => 'textarea',\n '#rows' => 2,\n '#description' => t('Text displayed just above the words Reservation\n Calendar on the reservation calendar page.'),\n '#default_value' => $default_reserve_room_instructions_text,\n '#weight' => -80,\n );\n $form['form_instructions_text'] = array(\n '#title' => t('Reservation form instructions text'),\n '#type' => 'textarea',\n '#rows' => 2,\n '#description' => t('Text displayed at the top of the reservation form.'),\n '#default_value' => $default_reserve_form_instructions_text,\n '#weight' => -70,\n );\n $form['policies'] = array(\n '#title' => t('Policies'),\n '#type' => 'textarea',\n '#rows' => 10,\n '#description' => t('Policies displayed on the reservation policies page.'),\n '#default_value' => $default_policies,\n '#weight' => -60,\n );\n $form['save'] = array(\n '#type' => 'submit',\n '#value' => t('Save configuration'),\n '#weight' => 100,\n );\n $form['reset'] = array(\n '#type' => 'submit',\n '#value' => t('Reset to defaults'),\n '#weight' => 101,\n );\n return $form;\n}", "function siteimprove_admin_settings_form($form, &$form_state) {\n $form = array();\n\n $form['siteimprove_settings'] = array(\n '#type' => 'fieldset',\n '#title' => t('Settings'),\n '#collapsible' => FALSE,\n '#collapsed' => FALSE,\n );\n\n $form['siteimprove_settings']['dimpact_siteimprove_id'] = array(\n '#type' => 'textfield',\n '#title' => t('Account ID'),\n '#description' => t('The ID of the Siteimprove account.'),\n '#default_value' => variable_get('dimpact_siteimprove_id'),\n );\n \n return system_settings_form($form);\n}", "public function admin_options() {\n\t\t\t?>\n\t\t\t<img style=\"float:right\" src=\"<?php echo plugin_dir_url(__FILE__); ?>coinsimple.png\" />\n\t\t\t<h3><?php _e('CoinSimple', 'woocommerce');?></h3>\n\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<?php $this->generate_settings_html(); ?>\n\t\t\t</table><!--/.form-table-->\n\t\t\t<?php\n\t\t}", "public function settingsForm()\n {\n return 'forecastio-form-settings';\n }", "function jen_panels_book_top_ctools_access_settings($form, &$form_state, $conf) { \n // @todo: do I need any settings?\n return $form;\n}", "public function invoice_settings() {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n \n // Get statistics template\n $this->body = 'admin/invoice-settings';\n \n // Load the admin layout\n $this->admin_layout();\n \n }", "public function lp_rating_settings_html() {\n // check user capabilities\n if (!current_user_can('manage_options')) {\n return;\n }\n \n ?>\n <div class=\"wrap\">\n <h1><?php echo esc_html(get_admin_page_title()); ?></h1>\n <form action=\"options.php\" method=\"post\">\n <?php\n // output security fields for the registered setting \"lp_rating_settings\"\n settings_fields('lp_rating_settings');\n \n // output setting sections and their fields\n do_settings_sections('lp_rating_settings');\n \n // output save settings button\n submit_button('Save Settings');\n ?>\n </form>\n </div>\n <?php\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'radio',\n 'name' => 'ORDERREF_MODE',\n 'label' => $this->l('How to generate order references'),\n 'desc' => $this->l('Choose between generation methods'),\n 'values' => array(\n array(\n 'id' => 'ORDERREF_MODE_RANDOM',\n 'value' => self::ORDERREF_MODE_RANDOM,\n 'label' => $this->l('Random numbers'),\n ),\n array(\n 'id' => 'ORDERREF_MODE_CONSEQUENT',\n 'value' => self::ORDERREF_MODE_CONSEQUENT,\n 'label' => $this->l('Consequent'),\n ),\n array(\n 'id' => 'ORDERREF_MODE_PS',\n 'value' => self::ORDERREF_MODE_PS,\n 'label' => $this->l('Don\\'t change an order reference'),\n ),\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'name' => 'ORDERREF_LENGTH',\n 'label' => $this->l('Length of reference'),\n 'desc' => $this->l('Length of generated reference value'),\n 'required' => true,\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "public function adsettingsAction() {\n\n //GET NAVIGATION\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_adsettings');\n\n //FORM\n $this->view->form = $form = new Sitestore_Form_Admin_Adsettings();\n\n //CHECK THAT COMMUNITY AD PLUGIN IS ENABLED OR NOT\n $communityadEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('communityad');\n if ($communityadEnabled) {\n $this->view->ismoduleenabled = $ismoduleenabled = 1;\n } else {\n $this->view->ismoduleenabled = $ismoduleenabled = 0;\n }\n\n //CHECK THAT SITESTORE DOCUMENT PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoredocument') && $ismoduleenabled) {\n $this->view->isdocumentenabled = 1;\n } else {\n $this->view->isdocumentenabled = 0;\n }\n\n //CHECK THAT SITESTORE NOTE PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorenote') && $ismoduleenabled) {\n $this->view->isnoteenabled = 1;\n } else {\n $this->view->isnoteenabled = 0;\n }\n\n //CHECK THAT SITESTORE ALBUM PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorealbum') && $ismoduleenabled) {\n $this->view->isalbumenabled = 1;\n } else {\n $this->view->isalbumenabled = 0;\n }\n\n //CHECK THAT SITESTORE VIDEO PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorevideo') && $ismoduleenabled) {\n $this->view->isvideoenabled = 1;\n } else {\n $this->view->isvideoenabled = 0;\n }\n\n //CHECK THAT SITESTORE EVENT PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoreevent') && $ismoduleenabled) {\n $this->view->iseventenabled = 1;\n } else {\n $this->view->iseventenabled = 0;\n }\n\n //CHECK THAT SITESTORE DISCUSSION PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorediscussion') && $ismoduleenabled) {\n $this->view->isdiscussionenabled = 1;\n } else {\n $this->view->isdiscussionenabled = 0;\n }\n\n //CHECK THAT SITESTORE POLL PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorepoll') && $ismoduleenabled) {\n $this->view->ispollenabled = 1;\n } else {\n $this->view->ispollenabled = 0;\n }\n\n //CHECK THAT SITESTORE REVIEW PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorereview') && $ismoduleenabled) {\n $this->view->isreviewenabled = 1;\n } else {\n $this->view->isreviewenabled = 0;\n }\n\n //CHECK THAT SITESTORE OFFER PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoreoffer') && $ismoduleenabled) {\n $this->view->isofferenabled = 1;\n } else {\n $this->view->isofferenabled = 0;\n }\n\n //CHECK THAT SITESTORE FORM PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoreform') && $ismoduleenabled) {\n $this->view->isformenabled = 1;\n } else {\n $this->view->isformenabled = 0;\n }\n\n //CHECK THAT SITESTORE INVITE PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoreinvite') && $ismoduleenabled) {\n $this->view->isinviteenabled = 1;\n } else {\n $this->view->isinviteenabled = 0;\n }\n\n //CHECK THAT SITESTORE BADGE PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorebadge') && $ismoduleenabled) {\n $this->view->isbadgeenabled = 1;\n } else {\n $this->view->isbadgeenabled = 0;\n }\n\n //CHECK THAT SITESTORE NOTE PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoremusic') && $ismoduleenabled) {\n $this->view->ismusicenabled = 1;\n } else {\n $this->view->ismusicenabled = 0;\n }\n\n //START FOR INRAGRATION WORK WITH OTHER PLUGIN.\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoreintegration') &&\n $ismoduleenabled) {\n $this->view->mixSettingsResults = Engine_Api::_()->getDbtable('mixsettings', 'sitestoreintegration')->getIntegrationItems();\n $this->view->issitestoreintegrationenabled = 1;\n } else {\n $this->view->issitestoreintegrationenabled = 0;\n }\n //END FOR INRAGRATION WORK WITH OTHER PLUGIN.\n\n //CHECK THAT SITESTORE TWITTER PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoretwitter') && $ismoduleenabled) {\n $this->view->istwitterenabled = 1;\n } else {\n $this->view->istwitterenabled = 0;\n }\n\n //CHECK THAT SITESTORE TWITTER PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoremember') && $ismoduleenabled) {\n $this->view->ismemberenabled = 1;\n } else {\n $this->view->ismemberenabled = 0;\n }\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n }\n }", "public function admin_options() {\n\t\t\t?>\n\t\t\t\t<h3><?php esc_html_e('Cointopay Checkout', 'Cointopay'); ?></h3>\n\n\t\t\t\t<div id=\"wc_get_started\">\n\t\t\t\t<span class=\"main\"><?php esc_html_e('Provides a secure way to accept crypto currencies.', 'Cointopay'); ?></span>\n\t\t\t\t<p><a href=\"https://app.cointopay.com/index.jsp?#Register\" target=\"_blank\" class=\"button button-primary\"><?php esc_html_e('Join free', 'Cointopay'); ?></a> <a href=\"https://cointopay.com\" target=\"_blank\" class=\"button\"><?php esc_html_e('Learn more about WooCommerce and Cointopay', 'Cointopay'); ?></a></p>\n\t\t\t\t</div>\n\n\t\t\t\t<table class=\"form-table\">\n\t\t\t <?php $this->generate_settings_html(); ?>\n\t\t\t\t</table>\n\t\t\t\t<?php\n\n\t\t}", "public function plugin_settings_page() {\r\n\t\t\tif ( ! current_user_can( 'manage_options' ) ) {\r\n\t\t\t\twp_die( esc_html( 'You do not have sufficient permissions to access this page.' ) );\r\n\t\t\t}\r\n\r\n\t\t\t// Render the settings template.\r\n\t\t\tinclude( sprintf( '%s/templates/settings.php', dirname( __FILE__ ) ) );\r\n\t\t}", "function settings_page() { include($this->plugin_basename . '/core/admin/settings.php'); }", "public function settings() {\n\n\t\tdo_settings_sections( 'wpbgdc' );\n\n\t\tsubmit_button();\n\n\t\techo '<div class=\"clear\"></div>';\n\n\t}", "public function render_settings_page() {\n\t\tinclude( get_inc_dir() . '/templates/admin-settings.php' );\n\t}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n\n\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter an image'),\n 'name' => 'title',\n 'label' => $this->l('Titre'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter an image'),\n 'name' => 'description',\n 'label' => $this->l('Description'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter an image'),\n 'name' => 'legend',\n 'label' => $this->l('Légende'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter an image'),\n 'name' => 'url',\n 'label' => $this->l('Url'),\n ), \n array(\n 'col' => 6,\n 'type' => 'file',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter an image'),\n 'name' => 'image',\n 'label' => $this->l('Image_up'),\n ),\n array(\n 'col' => 4,\n 'type' => 'date',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a start date'),\n 'name' => 'debut',\n 'label' => $this->l('Debut'),\n ),\n array(\n 'col' => 4,\n 'type' => 'date',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a end date'),\n 'name' => 'fin',\n 'label' => $this->l('Fin'),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "public function optionsdemo_settings_content() { ?>\n <div class=\"wrap\">\n <div id=\"icon-themes\" class=\"icon32\"><br/></div>\n <h1>Options Demo</h1>\n <form action=\"options.php\" method=\"POST\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\tsettings_fields( \"optionsdemo_general\" );\n\t\t\t\t\t\tdo_settings_sections( \"optionsdemo_general\" );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tsubmit_button( esc_html__( 'Save Setting', 'optionsdemo' ) )\n\t\t\t\t\t?>\n </form>\n </div>\n\t\t<?php }", "function hosting_task_jenkins_settings_form() {\n\n $form['hosting_task_jenkins_url'] = array(\n '#type' => 'textfield',\n '#title' => t('Jenkins Server URL'),\n '#description' => t('The URL of your Jenkins server.'),\n '#default_value' => variable_get('hosting_task_jenkins_url', 'http://username:password@localhost:8080'),\n );\n return system_settings_form($form);\n}", "protected function getConfigForm()\n {\n $config_form = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Equivalence surcharge'),\n 'name' => 'PROFITMARGIN_EQUIVALENCE_SURCHARGE_ENABLED',\n 'is_bool' => true,\n 'desc' => $this->l('Enable equivalence surcharge when calculating profit'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n\n\n $available_taxes = $this->getAvailableTaxes();\n foreach ($available_taxes as $tax) {\n $config_form['form']['input'][] = array(\n 'type' => 'text',\n 'name' => \"PROFITMARGIN_EQUIVALENCE_SURCHARGE_{$tax['id_tax']}\",\n 'label' => $this->l($tax['name']),\n 'desc' => $this->l('Equivalence surcharge'),\n 'suffix' => '%', \n 'col' => 1,\n );\n }\n\n $config_form['form']['input'][] = array( // @TODO: Default shipping cost for each carrier\n 'type' => 'text',\n 'name' => 'PROFITMARGIN_DEFAULT_SHIPPING_COST',\n 'label' => $this->l('Default shipping cost'),\n 'suffix' => '€', \n 'col' => 1,\n );\n\n $config_form['form']['input'][] = array(\n 'type' => 'radio',\n 'name' => 'PROFITMARGIN_SHIPPING_COST_TAX',\n 'label' => $this->l('Shipping cost tax'),\n 'values' => array()\n );\n \n foreach ($available_taxes as $tax) {\n $shipping_cost_tax = &$config_form['form']['input'];\n $shipping_cost_tax[array_key_last($shipping_cost_tax)]['values'][] = array(\n 'id' => \"tax_{$tax['id_tax']}\",\n 'value' => $tax['id_tax'],\n 'label' => $this->l($tax['name'])\n );\n }\n \n foreach ($this->getAvailablePaymentModules() as $payment_module) {\n $config_form['form']['input'][] = array(\n 'type' => 'text',\n 'name' => \"PROFITMARGIN_PAYMENT_FEE_BASE_{$payment_module['id_module']}\",\n 'label' => $this->l($payment_module['name']),\n 'desc' => $this->l('Base fee'),\n 'suffix' => '€', \n 'col' => 1,\n );\n $config_form['form']['input'][] = array(\n 'type' => 'text',\n 'name' => \"PROFITMARGIN_PAYMENT_FEE_PERCENTAGE_{$payment_module['id_module']}\",\n 'desc' => $this->l('Percentage fee'),\n 'suffix' => '%',\n 'col' => 1,\n );\n }\n\n return $config_form;\n }", "public function settings()\n\t{\n\t\tif(defined(\"CMS_BACKEND\"))\n\t\t{\n\t\t\tAuthUser::load();\n\t\t\tif ( ! AuthUser::isLoggedIn()) {\n\t\t\t\tredirect(get_url('login'));\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_POST['save']) && $_POST['save'] == 'Save Settings')\n\t\t\t{\n\t\t\t\tPlugin::setAllSettings($_POST['setting'], 'mbblog');\n\t\t\t\tFlash::setNow('success', __('Settings have been saved!'));\t\t \t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t$this->display('mbblog/views/admin/settings', array('settings' => Plugin::getAllSettings('mbblog')));\n\t\t} else\n\t\t{\n\t\t\tFlash::set('error', __('You do not have permission to access the requested page!'));\n\t\t\tredirect(get_url());\n\t\t}\n\t}", "public function settings( &$form )\n\t{\n\t\t$settings = json_decode( $this->settings, TRUE );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Text( 'zarinpal_merchant_id', $this->id ?$settings['merchant_id']:'', TRUE ) );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\YesNo( 'zarinpal_zarin_gate', $this->id ?$settings['zarin_gate']:'', TRUE ) );\n\t}", "public function settingsPage()\n {\n include 'views/admin.php';\n }", "function show_settings_tab(){\n woocommerce_admin_fields($this->get_settings());\n }", "public function pluginSettingsPage()\n {\n // check permission.\n if (!current_user_can('manage_options')) {\n wp_die(__('You do not have permission to access this page.'));\n }\n\n // load config values to get settings config file.\n $loader = new \\RundizableWpFeatures\\App\\Libraries\\Loader();\n $config_values = $loader->loadConfig();\n if (is_array($config_values) && array_key_exists('rundiz_settings_config_file', $config_values)) {\n $settings_config_file = $config_values['rundiz_settings_config_file'];\n } else {\n echo 'Settings configuration file was not set.';\n die('Settings configuration file was not set.');\n exit;\n }\n unset($config_values, $loader);\n\n $RundizSettings = new \\RundizableWpFeatures\\App\\Libraries\\RundizSettings();\n $RundizSettings->settings_config_file = $settings_config_file;\n\n $options_values = $this->getOptions();\n\n // if form submitted\n if (isset($_POST) && !empty($_POST)) {\n if (!wp_verify_nonce((isset($_POST['_wpnonce']) ? $_POST['_wpnonce'] : ''))) {\n wp_nonce_ays('-1');\n }\n\n // populate form field values.\n $options_values = $RundizSettings->getSubmittedData();\n\n // you may validate form here first.\n // then save data.\n $result = $this->saveOptions($options_values);\n\n if ($result === true) {\n $output['form_result_class'] = 'notice-success';\n $output['form_result_msg'] = __('Settings saved.');\n } else {\n $output['form_result_class'] = 'notice-success';\n $output['form_result_msg'] = __('Settings saved.');\n }\n }// endif $_POST\n\n $output['settings_page'] = $RundizSettings->getSettingsPage($options_values);\n unset($RundizSettings, $options_values);\n\n $Loader = new \\RundizableWpFeatures\\App\\Libraries\\Loader();\n $Loader->loadView('admin/settings_v', $output);\n unset($Loader, $output);\n }", "function config_form($config, $err, $user_fields) {\n global $OUTPUT;\n \n //deserialize in case the form is being initialized with config from db\n if ( !isset( $config->hosts ) ) {\n $config = $this->deserialize_configuration( $config );\n \n }\n \n $config = $this->set_defaults( $config );\n // display one extra fieldset\n array_push($config->hosts, 'extra');\n \n include \"config.html\";\n }", "private function loadForm()\n {\n // init settings form\n $this->frm = new Form('settings');\n\n // add festival year\n $this->frm->addText('year', $this->get('fork.settings')->get($this->URL->getModule(), 'year'));\n\n // add fields for pagination\n $this->frm->addDropdown(\n 'overview_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'overview_num_items', 10)\n );\n $this->frm->addDropdown(\n 'recent_festival_list_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'recent_festival_list_num_items', 5)\n );\n\n // add functions fields\n $this->frm->addCheckbox('cover_image_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_enabled', false));\n $this->frm->addCheckbox('cover_image_required', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_required', false));\n $this->frm->addCheckbox('multi_images_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'multi_images_enabled', false));\n\n // add god user only fields\n if ($this->godUser) {\n $this->frm->addText('image_size_limit', (float) $this->get('fork.settings')->get($this->URL->getModule(), 'image_size_limit', 10));\n }\n }", "function admin_config(){\n \n if(!acf_current_user_can_admin())\n return;\n \n global $plugin_page;\n \n if(!$plugin_page)\n return;\n \n $page = acf_get_options_page($plugin_page);\n \n if(!acf_maybe_get($page, 'menu_slug'))\n return;\n \n // Get Dynamic Options Page\n $acfe_dop_options_page = get_posts(array(\n 'post_type' => $this->post_type,\n 'posts_per_page' => 1,\n 'name' => $page['menu_slug']\n ));\n \n if(empty($acfe_dop_options_page))\n return;\n \n $acfe_dop_options_page = $acfe_dop_options_page[0];\n \n ?>\n <script type=\"text/html\" id=\"tmpl-acfe-dop-title-config\">\n <a href=\"<?php echo admin_url('post.php?post=' . $acfe_dop_options_page->ID . '&action=edit'); ?>\" class=\"page-title-action acfe-dop-admin-config\"><span class=\"dashicons dashicons-admin-generic\"></span></a>\n </script>\n\n <script type=\"text/javascript\">\n (function($){\n\n // Add button\n $('.wrap h1').append($('#tmpl-acfe-dop-title-config').html());\n\n })(jQuery);\n </script>\n <?php\n \n }", "protected function getConfigFormCOP()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-user\"></i>',\n 'desc' => $this->l('Ingrese la llave pública'),\n 'name' => 'KUSHKIPAGOS_PUBLIC_KEY',\n 'label' => $this->l('Public key'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-user-secret\"></i>',\n 'desc' => $this->l('Ingrese la llave privada'),\n 'name' => 'KUSHKIPAGOS_PRIVATE_KEY',\n 'label' => $this->l('Private key'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-address-card\"></i>',\n 'desc' => $this->l('Ingrese la razón social'),\n 'name' => 'KUSHKIPAGOS_RAZON_SOCIAL',\n 'label' => $this->l('Razon Social'),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Permitir transferencia'),\n 'name' => 'KUSHKIPAGOS_TRANSFER',\n 'is_bool' => true,\n 'desc' => $this->l('Usar transferencia como forma de pago'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Entorno de pruebas'),\n 'name' => 'KUSHKIPAGOS_DEV',\n 'is_bool' => true,\n 'desc' => $this->l('Usar este módulo en entorno de pruebas'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n ),\n\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n\n ),\n\n );\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'col' => 6,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-key\"></i>',\n 'desc' => $this->l('Ingrese un token de empresa - Vea la documentación'),\n 'name' => 'APISFACT_PRESTASHOP_TOKEN',\n 'label' => $this->l('Token'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-circle text-success\"></i>',\n 'desc' => $this->l('Ingrese la serie para las facturas'),\n 'name' => 'APISFACT_PRESTASHOP_SERIEF',\n 'label' => $this->l('Serie Factura'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-circle text-success\"></i>',\n 'desc' => $this->l('Ingrese el número inicial para las facturas'),\n 'name' => 'APISFACT_PRESTASHOP_NUMEROF',\n 'label' => $this->l('Numero de Factura'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-circle\"></i>',\n 'desc' => $this->l('Ingrese la serie para las boletas'),\n 'name' => 'APISFACT_PRESTASHOP_SERIEB',\n 'label' => $this->l('Serie Boleta'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-circle\"></i>',\n 'desc' => $this->l('Ingrese el número inicial para las boletas'),\n 'name' => 'APISFACT_PRESTASHOP_NUMEROB',\n 'label' => $this->l('Numero de Boleta'),\n )\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "public function optionsdemo_settings_content() { ?>\n\t\t\t<div class=\"wrap\">\t\t\t\t\n\t\t\t\t<form method=\"POST\" action=\"options.php\">\n\t\t\t\t\t<?php\n\t\t\t\t\tsettings_fields( 'optionsdemo' );\n\t\t\t\t\tdo_settings_sections( 'optionsdemo' );\n\t\t\t\t\tsubmit_button();\n\t\t\t\t\t?>\n\t\t\t\t</form>\n\t\t\t</div> <?php\n\t\t}", "public function settings_page() {\n\t\tTheme_My_Login_Admin::settings_page( array(\n\t\t\t'title' => __( 'Theme My Login reCAPTCHA Settings', 'theme-my-login' ),\n\t\t\t'options_key' => $this->options_key\n\t\t) );\n\t}", "function buildSettingsForm() {\n $form = parent::buildSettingsForm();\n\n $form['entity:file']['show_scheme'] = array(\n '#title' => t('Show file scheme'),\n '#type' => 'checkbox',\n '#default_value' => isset($this->conf['show_scheme']) ? $this->conf['show_scheme'] : array()\n );\n\n $form['entity:file']['group_by_scheme'] = array(\n '#title' => t('Group files by scheme'),\n '#type' => 'checkbox',\n '#default_value' => isset($this->conf['group_by_scheme']) ? $this->conf['group_by_scheme'] : array(),\n );\n\n $image_extra_info_options = array(\n 'thumbnail' => t('Show thumbnails <em>(using the image style !linkit_thumb_link)</em>', array('!linkit_thumb_link' => l('linkit_thumb', 'admin/config/media/image-styles/edit/linkit_thumb'))),\n 'dimensions' => t('Show pixel dimensions'),\n );\n\n $form['entity:file']['image_extra_info'] = array(\n '#title' => t('Images'),\n '#type' => 'checkboxes',\n '#options' => $image_extra_info_options,\n '#default_value' => isset($this->conf['image_extra_info']) ? $this->conf['image_extra_info'] : array('thumbnail', 'dimensions'),\n );\n\n return $form;\n }", "public function frontend_configuration()\n {\n if ($this->session->userdata('logged_in') == 1 && $this->session->userdata('user_type') != 'Admin') {\n redirect('home/login_page', 'location');\n }\n \n $data['body'] = \"admin/config/frontend_config\";\n $data['time_zone'] = $this->_time_zone_list(); \n $data['language_info'] = $this->_language_list();\n $data['page_title'] = $this->lang->line('front-end settings');\n $this->_viewcontroller($data);\n }", "public function form()\n {\n if ( ! auth()->guard('admin')->user()->can('access form ' . $this->table)) {\n return redirect()->route('admin.setting.index')->with('alert-danger', __($this->noPermission));\n }\n $view = [\n 'back' => route('admin.setting.index'),\n 'title' => __('Form Settings'),\n 'breadcrumbs' => [\n route('admin.setting.index') => __('Setting'),\n route('admin.setting.role.index') => __('Form'),\n null => __('Edit')\n ],\n 'subtitle' => __('All About Form Settings'),\n 'description' => __('You can adjust all form settings here'),\n 'navs' => $this->settings,\n 'setting' => $this->settings->where('slug', 'form')->first(),\n 'forms' => json_decode(setting('form_settings')),\n 'formLimiters' => [\n 'None' => __('None'),\n 'Quota' => __('Quota'),\n 'Datetime' => __('Datetime'),\n 'Both' => __('Both'),\n ]\n ];\n return view('admin.setting.form.index', $view);\n }", "public function site_settings()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$data['form_submit_message'] = '';\n\t\t\t$this->load->model('settings_model', 'sm');\n\t\t\t\n\t\t\tif(count($_POST) > 0)\n\t\t\t{\n\t\t\t\tforeach($_POST as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$settings_data['value'] = $value;\n\t\t\t\t\t$this->sm->update($key, $settings_data);\n\t\t\t\t}\n\t\t\t\t$data['form_submit_message'] = '<div style=\"font-weight:bold;color:#0000FF;\">'.lang('msg_settings_saved') .'</div>';\n\t\t\t}\n\t\t\t\n\t\t\t$settings_raw_data = $this->sm->get_all();\n\t\t\t$settings_data = array();\n\t\t\tforeach($settings_raw_data as $raw_settings)\n\t\t\t\t$settings_data[$raw_settings->name] = $raw_settings->value;\n\t\t\t$data['settings'] = $settings_data;\n\t\t\t$this->load->view('settings-admin', $data);\n\t\t}", "function commerce_virtualmerchant_admin_settings() {\r\n $form = array();\r\n\r\n $form['commerce_virtualmerchant'] = array(\r\n '#type' => 'fieldset',\r\n '#title' => t('Converge Virtual Merchant settings'),\r\n '#collapsible' => TRUE,\r\n '#collapsed' => FALSE,\r\n );\r\n\r\n $form['commerce_virtualmerchant']['commerce_virtualmerchant_title'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Title'),\r\n '#default_value' => variable_get('commerce_virtualmerchant_title', 'Converge Virtual Merchant'),\r\n '#description' => t('Override the display title of the Converge Virtual Merchant Form Method.'),\r\n );\r\n \r\n $form['commerce_virtualmerchant']['commerce_virtualmerchant_server'] = array(\r\n '#type' => 'radios',\r\n '#title' => t('Converge Server'),\r\n '#options' => array(\r\n 0 => t('Test / Demo'),\r\n 1 => t('Production / Live'),\r\n 2 => t('None (reply with dummy acceptance)'),\r\n ),\r\n '#default_value' => variable_get('commerce_virtualmerchant_server', 0),\r\n '#required' => TRUE,\r\n );\r\n\r\n $form['commerce_virtualmerchant']['commerce_virtualmerchant_merchant_id'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Merchant ID'),\r\n '#default_value' => variable_get('commerce_virtualmerchant_merchant_id', ''),\r\n '#required' => TRUE,\r\n );\r\n\r\n $form['commerce_virtualmerchant']['commerce_virtualmerchant_user_id'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('User ID'),\r\n '#default_value' => variable_get('commerce_virtualmerchant_user_id', ''),\r\n '#required' => TRUE,\r\n );\r\n\r\n $form['commerce_virtualmerchant']['commerce_virtualmerchant_pin'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('PIN'),\r\n '#default_value' => variable_get('commerce_virtualmerchant_pin', ''),\r\n '#required' => TRUE,\r\n );\r\n\r\n $form['commerce_virtualmerchant']['vmform'] = array(\r\n '#type' => 'fieldset',\r\n '#title' => t('Converge Virtual Merchant Form Settings'),\r\n '#collapsible' => TRUE,\r\n '#collapsed' => FALSE,\r\n );\r\n \r\n $form['commerce_virtualmerchant']['vmform']['commerce_virtualmerchant_form_height'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Form Height'),\r\n '#description' => t('Height of the Converge Virtual Merchant Payment Form.'),\r\n '#default_value' => variable_get('commerce_virtualmerchant_form_height', '300px'),\r\n );\r\n\r\n $form['commerce_virtualmerchant']['vmform']['commerce_virtualmerchant_form_width'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Form Width'),\r\n '#description' => t('Width of the Converge Virtual Merchant Payment Form.'),\r\n '#default_value' => variable_get('commerce_virtualmerchant_form_width', '100%'),\r\n );\r\n\r\n $form['commerce_virtualmerchant']['ssl'] = array(\r\n '#type' => 'fieldset',\r\n '#title' => t('Converge SSL Settings'),\r\n '#collapsible' => TRUE,\r\n '#collapsed' => TRUE,\r\n );\r\n\r\n $form['commerce_virtualmerchant']['ssl']['commerce_virtualmerchant_verify_peer'] = array(\r\n '#type' => 'checkbox',\r\n '#title' => t('Validate Converge SSL Certificate'),\r\n '#default_value' => variable_get('commerce_virtualmerchant_verify_peer', 0),\r\n );\r\n\r\n $form['commerce_virtualmerchant']['ssl']['commerce_virtualmerchant_cert_path'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Certificate'),\r\n '#description' => t('Path to the Converge SSL Certificate cacert.pem file.'),\r\n '#default_value' => variable_get('commerce_virtualmerchant_cert_path', ''),\r\n );\r\n\r\n return system_settings_form($form);\r\n}" ]
[ "0.7584197", "0.7530868", "0.747252", "0.74178964", "0.7304319", "0.7295024", "0.7292996", "0.72555596", "0.7246344", "0.7240466", "0.7217252", "0.71888363", "0.71817154", "0.7179559", "0.7167459", "0.7153758", "0.7134698", "0.7126811", "0.7113482", "0.7109756", "0.71083975", "0.7086753", "0.70860314", "0.7081255", "0.7058299", "0.70452404", "0.70443106", "0.7041722", "0.7039463", "0.703543", "0.7034356", "0.7025023", "0.70227885", "0.70194197", "0.7016415", "0.70159906", "0.699711", "0.69948274", "0.6990533", "0.6982146", "0.69619685", "0.6960096", "0.6942248", "0.69421214", "0.69405663", "0.693642", "0.6904338", "0.6895284", "0.68920714", "0.6876797", "0.68632025", "0.68603307", "0.68558687", "0.6846451", "0.68330455", "0.6821784", "0.6814071", "0.6808666", "0.68057746", "0.67925096", "0.67844635", "0.67780524", "0.67654234", "0.67637306", "0.67588735", "0.6758258", "0.67516786", "0.67481774", "0.6746626", "0.6736688", "0.67312133", "0.6730317", "0.67144126", "0.67118955", "0.6708021", "0.6707542", "0.6705653", "0.66844255", "0.668368", "0.66732794", "0.66639453", "0.66519314", "0.6643788", "0.66425914", "0.6642461", "0.66384226", "0.66351634", "0.6624177", "0.66210365", "0.6619668", "0.6615876", "0.66083527", "0.6603327", "0.66004527", "0.6595741", "0.65837747", "0.6578465", "0.65604913", "0.65594685", "0.6559432", "0.65579385" ]
0.0
-1
Validation handler for restapi administrative settings.
function restapi_admin_form_validate($form, &$form_state) { $class = isset($form_state['values']['restapi_default_auth_class']) ? $form_state['values']['restapi_default_auth_class'] : NULL; $prefix = isset($form_state['values']['restapi_url_prefix']) ? $form_state['values']['restapi_url_prefix'] : NULL; if ($class && !class_exists($class)) { form_set_error('restapi_default_auth_class', t('The class "@class" does not seem to exist, or is not callable.', [ '@class' => $class, ])); } if ($prefix != variable_get('restapi_url_prefix')) { $form_state['storage']['restapi_url_prefix_changed'] = TRUE; $prefix = trim($prefix); $prefix = rtrim($prefix, '/'); $prefix = ltrim($prefix, '/'); $form_state['values']['restapi_url_prefix'] = $prefix; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _validate_settings()\n\t{\n\n\t\treturn TRUE;\n\t}", "public function validateSettings()\n {\n if (empty($this->validator)) {\n return true;\n }\n \n return $this->validator->validate($this, $this->context);\n }", "protected function setupValidation()\n {\n }", "function redmine_sso_admin_settings_validate($form, $form_state) {\n /**\n * TODO\n * check url\n * check if group exsists\n * check if project exsists\n */\n}", "protected function configureValidations()\n {\n }", "public function admin_options(){\r\n \r\n if(!get_option('woocommerce_flow_api_key_valid'))\r\n $this->add_error('La llave de api es obligatoria.');\r\n\r\n if(!get_option('woocommerce_flow_secret_key_valid')){\r\n $this->add_error('La llave secreta es obligatoria.');\r\n }\r\n\r\n if($this->is_valid_for_use()){\r\n $this->display_errors();\r\n parent::admin_options();\r\n }\r\n else{\r\n ?>\r\n <div class=\"inline error\">\r\n <p>\r\n <strong><?php esc_html_e( 'Gateway disabled', 'woocommerce' ); ?></strong>: <?php esc_html_e( 'Flow no soporta el tipo de moneda (' .get_woocommerce_currency() .').', 'woocommerce' ); ?>\r\n </p>\r\n </div>\r\n <?php\r\n }\r\n \r\n }", "function ValidateAdmin()\n\t{\n\t}", "function validateApiCredentials() { \n if( $this->options['api_type'] == \"\" || $this->options['api_path'] == \"\" ) {\n $this->error_handler( 'Repository url not valid' );\n } elseif($this->options['username'] == \"\") {\n $this->error_handler( 'Username Required' );\n } else if($this->options['password'] == \"\") {\n $this->error_handler( 'Password Required' );\n }\n }", "protected function _validate() {\n\t}", "function validateSetting($name, $value)\n{\n if (in_array($name, ['title', 'keywords', 'description']) && empty($value)) {\n redirect()->withError('Please enter all fields')->withInput()->back();\n } else if ($name == 'default_theme' && !app()->theme_manager->hasTheme($value)) {\n redirect()->withError('Cannot find that theme!');\n }\n}", "function validateSetting(request $request): mixed {\n\t\t$rules = [\n\t\t\t'id' \t=> 'required_without:title',\n\t\t\t'value' => 'required',\n\t\t];\n\t\t$messages = [\n\t\t\t'id.required_without' => 'The id field is required when title is not present.',\n\t\t\t'value.required' => 'The value field is required.'\n\t\t];\n\n\t\t$validator = Validator::make($request->all(), $rules, $messages);\n\n\t\tif ($validator->fails()) {\n\t\t\tif ($validator->messages()->get('id'))\n\t\t\t\tthrow new Exception(92020);\n\t\t\telse\n\t\t\t\tthrow new Exception(92021);\n\t\t}\n\t}", "function postGeneral(Request $request)\n {\n $validator = Validators::backendValidate($request,\"settings_general\");\n // Check the validator if there's no error\n if ($validator === true) {\n $config = Configuration::UpdateGeneral($request);\n $admin = User::changeCredentials($request);\n return response()->json([\"result\" => 'success']);\n }\n return response()->json([\"result\" => 'failed', \"errors\" => $validator->errors()->messages()]);\n }", "function fccpod_set_validation_boolean() {\n\t$api_validation = fccpod_jw_account_verify_api_key_secret();\n\n\tif ( $api_validation ) {\n\t\tupdate_option( 'fccpod_jw_api_authorized', 1 );\n\t} else {\n\t\tupdate_option( 'fccpod_jw_api_authorized', 0 );\n\t}\n\n}", "public function backendExtraValidate(){\n \n }", "public abstract function validateConfig($config);", "private function adminRules()\n {\n return [\n 'country' => 'required_with_all:region,city|required_if:status,Enable',\n 'region' => 'required_with_all:country,city',\n 'city' => 'required_with_all:country,region',\n 'address' => 'nullable|string|between:0,255',\n 'firm' => 'nullable|integer',\n 'status' => 'required|integer',\n ];\n }", "public function settings_fields() {\n\t\t$this->create_sections();\n\t\t$this->create_fields();\n\t\tregister_setting( $this->token, $this->token, array( $this, 'validate_fields' ) );\n\t}", "public function _validate_settings( $settings ) {\n global $zendesk_support;\n\n // Check for SSL activity and keep the version.\n $settings['ssl'] = $zendesk_support->api->is_ssl( $settings['account'] );\n $settings['version'] = $zendesk_support->default_settings['version'];\n\n // Validate the Zendesk Account\n if ( ( ! preg_match( '/^[a-zA-Z0-9][a-zA-Z0-9\\-]{0,}[a-zA-Z0-9]$/', $settings['account'] ) && ! preg_match( '/^[a-zA-Z0-9]{1}$/', $settings['account'] ) ) || ( strlen( $settings['account'] ) > 63 ) ) {\n unset( $settings['account'] );\n }\n\n // Dashboard widgets visibility\n foreach ( array( 'administrator', 'editor', 'author', 'contributor', 'subscriber' ) as $role ) {\n if ( isset( $settings[ 'dashboard_' . $role ] ) && ! array_key_exists( $settings[ 'dashboard_' . $role ], $this->_available_dashboard_widget_options() ) ) {\n unset( $settings[ 'dashboard_' . $role ] );\n }\n }\n\n // Clean up contact form title and others\n foreach (\n array(\n 'contact_form_title',\n 'contact_form_summary',\n 'contact_form_details',\n 'contact_form_submit'\n ) as $key\n ) {\n $settings[ $key ] = empty( $settings[ $key ] ) ? $zendesk_support->default_settings[ $key ] : htmlspecialchars( trim( $settings[ $key ] ) );\n }\n\n // Anonymous contact form (checkbox)\n if ( ! isset( $settings['contact_form_anonymous'] ) ) {\n $settings['contact_form_anonymous'] = false;\n }\n\n\n // Nuke login credentials and web widget snippet if account has changed.\n if ( $settings['account'] !== $zendesk_support->settings['account'] ) {\n // Running a direct SQL query is *way* faster than meta querying users one by one.\n global $wpdb;\n $wpdb->query( \"DELETE FROM $wpdb->usermeta WHERE meta_key = 'zendesk_user_options';\" );\n\n // Clear the web widget code so it gets generated again using the new account\n $settings['webwidget_code'] = '';\n }\n\n // If the Web Widget has just been switched on, hide the Feedback Tab\n if ( $settings['webwidget_display'] != 'none' && $zendesk_support->settings['webwidget_display'] == 'none' ) {\n $settings['dropbox_display'] = 'none';\n }\n\n // Merge the submitted settings with the defaults. Second\n // argument will overwrite the first.\n if ( is_array( $zendesk_support->settings ) ) {\n $settings = array_merge( $zendesk_support->settings, $settings );\n } else {\n $settings = array_merge( $zendesk_support->default_settings, $settings );\n }\n\n return $settings;\n }", "function postageapp_admin_form_validate($form, &$form_state) { \n //\n $api_key = $form_state['values']['postageapp_api_key'];\n \n if ($api_key) {\n $postage = new PostageApp($api_key);\n $valid_key = $postage->get_project_info();\n \n if ($valid_key->response->status == 'ok') {\n drupal_set_message(t('Your API key is valid. Welcome to PostageApp.'), \"status\");\n drupal_set_message(t('To complete settings add \"$conf[\\'mail_system\\'][\\'default-system\\'] = \\'PostageappDrupalMail\\';\" to settings.php (without duoble quotes). This settings override default mail system in Drupal to use Postageapp as mail delivery service.'), 'info');\n }\n else {\n form_set_error('postageapp_api_key', t($valid_key->response->message));\n }\n }\n}", "protected function validate()\n {\n }", "protected function mainValidation()\n {\n $this->validator->add(\n 'title',\n new StringLength([\n 'max' => 50\n ])\n );\n\n $this->validator->add(\n 'description',\n new StringLength([\n 'max' => 200,\n 'allowEmpty' => true\n ])\n );\n }", "public function validation();", "protected function additionalValidation() {\n return true;\n }", "public function validateConfig()\n\t{\n\t\t$schemaContent = @file_get_contents(Config::$schemaFile);\n\t\tif($schemaContent === FALSE) {\n\t\t\t$this->errors['File not found'][] = [\n\t\t\t\t'property' => Config::$schemaFile,\n\t\t\t\t'message' => 'Schema file not found.'\n\t\t\t];\n\t\t\treturn;\n\t\t}\n\n\t\t$schema = Json::decode($schemaContent);\n\n\t\t$this->schemaValidator->check($this->config, $schema);\n\n\t\tif (!$this->schemaValidator->isValid()) {\n\t\t\t$this->errors['schema'] = $this->schemaValidator->getErrors();\n\t\t}\n\t}", "public function validateRequest();", "public static function get_allowed_settings()\n {\n }", "public function validate_settings_fields( $_ = false ) {\n\t\tparent::validate_settings_fields();\n\n\t\t// remove our section 'field' so it doesn't get saved to the database\n\t\tforeach ( $this->form_fields as $k => $v ) {\n\t\t\tif ( isset( $v['type'] ) && $v['type'] == 'section' ) {\n\n\t\t\t\tunset( $this->sanitized_fields[$k] );\n\t\t\t}\n\t\t}\n\t}", "public function validateReuest()\r\n {\r\n //echo $_SERVER['CONTENT_TYPE']; exit;\r\n\r\n if($_SERVER['CONTENT_TYPE'] !== 'application/json')\r\n {\r\n $this->throwError(REQUEST_CONTENTTYPE_NOT_VALID, 'Request Content-Type is not Valid');\r\n }\r\n\r\n // decode it into array format.\r\n $data = json_decode($this->request, true);\r\n // to check the data in array.\r\n //print_r($data);\r\n\r\n\r\n // check if api name is reuired or not\r\n if(!isset($data['name']) || $data['name'] == \"\")\r\n {\r\n $this->throwError(API_NAME_REQUIRED, \"API Name is Required.\");\r\n }\r\n $this->serviceName = $data['name'];\r\n\r\n\r\n // check if parameters name is reuired or not\r\n if(!is_array($data['param']))\r\n {\r\n $this->throwError(API_PARAM_REQUIRED, \"API PARAM is Required.\");\r\n }\r\n $this->param = $data['param'];\r\n }", "public function setupValidatorRules()\n { }", "function bg_AddAdminSettings(){\n global $bg_optionGroup, $bg_optionName, $bg_page, $bg_sectionId, $bg_opts_apiKey;\n \n register_setting( $bg_optionGroup, $bg_optionName, 'bg_ValidateOptions' );\n add_settings_section($bg_sectionId, 'License Settings', 'bg_AddSettingsSectionHtml', $bg_page);\t\n add_settings_field($bg_opts_apiKey, 'Api Key', 'bg_AddApiKeySettingsFieldHtml', $bg_page, $bg_sectionId);\n}", "function restapi_admin_form($form, &$form_state) {\n\n $form['restapi_url_prefix'] = [\n '#type' => 'textfield',\n '#title' => t('URL prefix'),\n '#size' => 15,\n '#description' => t('Prepend this value to all URLs defined in hook_restapi_resource(). (e.g. A resource with the URL \"some/resource\" will become \"$prefix/some/resource\").'),\n '#default_value' => variable_get('restapi_url_prefix'),\n ];\n\n $form['restapi_api_name'] = [\n '#type' => 'textfield',\n '#title' => t('API name'),\n '#size' => 15,\n '#description' => t('Used in the header that specifies the API version. (e.g. An API with the name \"API-Name\" will add the header \"X-API-Name-Version\").'),\n '#default_value' => variable_get('restapi_api_name', 'API'),\n ];\n\n $form['restapi_current_version'] = [\n '#type' => 'textfield',\n '#title' => t('Current API version'),\n '#size' => 15,\n '#description' => t('Specifies the current API version, which is used by default if a version is not provided. This should also be the most recent API version.)'),\n '#default_value' => variable_get('restapi_current_version', 1),\n '#element_validate' => ['element_validate_integer_positive'],\n ];\n\n $form['restapi_minimum_version'] = [\n '#type' => 'textfield',\n '#title' => t('Minimum API version'),\n '#size' => 15,\n '#description' => t('Specifies the minimum API version that clients may request.)'),\n '#default_value' => variable_get('restapi_minimum_version', 0),\n '#element_validate' => ['element_validate_integer_positive'],\n ];\n\n $form['restapi_default_auth_class'] = [\n '#type' => 'textfield',\n '#title' => t('Default authentication class'),\n '#size' => 40,\n '#description' => t('The full name of the class to use as the default authentication class. Defaults to \"Drupal\\restapi\\Auth\\DrupalAuthenticationService\".'),\n '#default_value' => variable_get('restapi_default_auth_class'),\n ];\n\n $form['restapi_debug'] = [\n '#type' => 'checkbox',\n '#title' => t('Enable debug mode'),\n '#description' => t('Places the Rest API into debug mode. Additional diagnostic data, such as memory usage and execution time, will be set while in debug mode.'),\n '#default_value' => variable_get('restapi_debug', FALSE),\n ];\n\n // We want to include our custom submission handler as well, to execute after\n // variables are saved via system_settings_form_submit().\n $form = system_settings_form($form);\n $form['#submit'][] = __FUNCTION__ . '_submit';\n\n return $form;\n\n}", "public function validate() {\n parent::validate();\n\n // Check that the partner opt-ins also have a partner code\n if (isset($this['action.opt-ins.partner']) && !isset($this['partner.code'])) {\n\t throw new SignupValidationException(array('partner opt-in requires a partner code'));\n }\n }", "function room_reservations_admin_settings_validate($form_id, &$form_state) {\n if ($form_state['clicked_button']['#value'] == t('Save configuration')) {\n // Open reservations per user.\n $data = $form_state['values']['room_reservations_reservations_per_user'];\n if (!ctype_digit($data)) {\n $field = 'room_reservations_reservations_per_user';\n $message = t('Open reservations per user must be numeric.');\n form_set_error($field, check_plain($message));\n }\n // Reservations per day.\n $data = $form_state['values']['room_reservations_reservations_per_day'];\n if (!ctype_digit($data)) {\n $field = 'room_reservations_reservations_per_day';\n $message = t('Reservations per day must be numeric.');\n form_set_error($field, check_plain($message));\n }\n }\n}", "function shorthand_admin_settings_validate($form, &$form_state) {\n $user_id = $form_state['values']['shorthand_user_id'];\n $token = $form_state['values']['shorthand_token'];\n if (!is_numeric($user_id)) {\n form_set_error('shorthand_user_id', t('User ID must be an integer.'));\n }\n else {\n $data = sh_get_profile($user_id, $token);\n if (!isset($data->username)) {\n form_set_error('shorthand_token', t('Invalid token.'));\n }\n }\n}", "public function validateDev()\n {\n return parent::validate();\n }", "public function _validate()\n {\n\t\t$data = array();\n\t\t$data['error_string'] = array();\n\t\t$data['inputerror'] = array();\n\t\t$data['status'] = TRUE;\n\n\t\tif($this->input->post('status') === 'SelecteerStatus')\n\t\t{\n $data['inputerror'][] = 'status';\n $data['error_string'][] = 'Status is verplicht!';\n $data['status'] = FALSE;\n\t\t}\n\t\t\n\t\tif($this->input->post('prioriteit') === 'SelecteerPrioriteit')\n\t\t{\n\t\t\t$data['inputerror'][] = 'prioriteit';\n\t\t\t$data['error_string'][] = 'Prioriteit is verplicht!';\n\t\t\t$data['status'] = FALSE;\n\t\t}\n\n\t\tif(empty($this->input->post('Categorie')))\n\t\t{\n\t\t\t$data['inputerror'][] = 'categorie';\n\t\t\t$data['error_string'][] = 'Categorie is verplicht!';\n\t\t\t$data['status'] = FALSE;\n\t\t}\n if($this->input->post('werkman') === 'Selecteer')\n {\n $data['inputerror'][] = 'werkman';\n $data['error_string'][] = 'Werkman toewijzen is verplicht!';\n $data['status'] = FALSE;\n }\n\n\t\tif($data['status'] === FALSE)\n\t\t{\n\t\t\techo json_encode($data);\n\t\t\texit();\n\t\t}\n }", "public function validate_settings( $input ) {\r\n\t\t$valid_input = array();\r\n\t\t\r\n\t\t/* General Settings */\r\n\t\t$valid_input['options']['timeline_nav'] = ( $input['options']['timeline_nav'] == 1 ? 1 : 0 );\r\n\t\t$valid_input['db_version'] = $input['db_version'];\r\n\t\t\r\n\t\t/* Wordpress */\r\n\t\tif( !empty( $input['options']['wp']['content'] ) || !empty( $input['options']['wp']['filter'] ) ) {\r\n\t\t\t// Content\r\n\t\t\tforeach( $input['options']['wp']['content'] as $key=>$value ) {\r\n\t\t\t\t$valid_input['options']['wp']['content'][$key] = (int) ( $value == 1 ? 1 : 0 );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Filters\r\n\t\t\tforeach( $input['options']['wp']['filter'] as $filter=>$value ) {\r\n\t\t\t\tforeach( $value as $id=>$val ) {\r\n\t\t\t\t\tswitch( $filter ) {\r\n\t\t\t\t\t\tcase 'taxonomy' :\r\n\t\t\t\t\t\t\t$valid_input['options']['wp']['filter']['taxonomy'][$id] = (int) ( $val == 1 ? 1 : 0 );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t\t$valid_input['options']['wp']['filter'][$filter][$id] = wp_filter_nohtml_kses( $val );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/* Twitter */\r\n\t\tif( !empty( $input['options']['twitter']['content']) || !empty($input['options']['twitter']['filter'] ) ) {\r\n\t\t\t// Content\r\n\t\t\tforeach( $input['options']['twitter']['content'] as $key=>$value ) {\r\n\t\t\t\tswitch( $key ) {\r\n\t\t\t\t\tcase 'username' :\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['content']['username'] = wp_filter_nohtml_kses( str_replace( '@', '', $value ) );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase 'timeline' :\r\n\t\t\t\t\t\t$valid_options = array( '1', '2' );\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['content']['timeline'] = ( in_array( $value, $valid_options ) == true ? $value : null );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['content'][$key] = wp_filter_nohtml_kses( $value );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Filters\r\n\t\t\tforeach( $input['options']['twitter']['filter'] as $filter=>$value ) {\r\n\t\t\t\tswitch($filter) {\r\n\t\t\t\t\tcase 'tags' :\r\n\t\t\t\t\t\t$valid_input['options']['twitter']['filter']['tags'] = wp_filter_nohtml_kses( str_replace('#', '', $value ) );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $valid_input;\r\n\t}", "public abstract function validation();", "public function beforeSave()\n {\n $this->setParams([\n 'url' => $this->getValue(),\n 'apiKey' => $this->getFieldsetDataValue('api_key'),\n 'version' => $this->getFieldsetDataValue('api_version')\n ]);\n\n if (!$this->isUrl($this->getValue())) {\n throw new \\Magento\\Framework\\Exception\\ValidatorException(__('Invalid CRM url'));\n }\n\n if (!$this->isHttps($this->getValue())) {\n $this->schemeEdit($this->getValue());\n }\n\n if ($this->validateApiUrl($this->api)) {\n $this->setValue($this->getValue());\n }\n\n parent::beforeSave();\n }", "public function validate($configData);", "public function validateConfig() {\n\t\t\t$two_step_id = $this->config['l_id'];\n\t\t\tif ( empty( $two_step_id ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$two_step = tve_leads_get_form_type( $two_step_id, array( 'get_variations' => false ) );\n\t\t\tif ( empty( $two_step ) || $two_step->post_status === 'trash' || $two_step->post_type != TVE_LEADS_POST_TWO_STEP_LIGHTBOX ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "public function registerAdminRules()\n {\n return [\n 'com_name' => ['required', 'string', 'max:255'],\n 'com_email' => ['required', 'string', 'email', 'max:255','unique:organization_gen_infos,email'],\n 'com_password' => 'required',\n 'password_confirmation' => 'required|same:com_password',\n 'term-2' =>'required'\n ];\n }", "public function validationAction() {\n\n $video_type = $this->_getParam('type');\n $code = $this->_getParam('code');\n $ajax = $this->_getParam('ajax', false);\n $valid = false;\n\n //CHECK WHICH API SHOULD BE USED\n if ($video_type == \"youtube\") {\n $valid = $this->checkYouTube($code);\n }\n\n if ($video_type == \"vimeo\") {\n $valid = $this->checkVimeo($code);\n }\n\n $this->view->code = $code;\n $this->view->ajax = $ajax;\n $this->view->valid = $valid;\n }", "public function validate()\n {\n // Tipo de validación\n $type = $this->request->get('type');\n $type = ($type == 'email') ? 'email' : 'username';\n \n Core::getService('account.validate')->$type($this->request->get('value'));\n $status = 'taken';\n \n if (Core_Error::isPassed())\n {\n $status = 'ok'; \n }\n \n $this->call(\"var obj = $('#\" . $this->request->get('obj') . \"'); signup.show_status(obj, '{$status}');\");\n }", "protected function _setting_handle() {}", "function admin_options_validate($input) {\n\t\n\t// Like escape all text fields\n\t$input['admin_validate_ad'] = like_escape($input['admin_validate_ad']);\n\t// Add slashes to all text fields\n\t$input['admin_validate_ad'] = esc_sql($input['admin_validate_ad']);\n\n\t/**\n\t * Make sure that unchecked checkboxes are stored as empty strings\n\t *\n\t * nrelate_admin_options doesn't have a \"defaults\" global array\n\t * so let's keep an array of checkbox settings here, the only place\n\t * it's required by now\n\t */\n\t$empty_settings_array = array( \n\t\t'admin_email_address' => ''\n\t);\n\t\n\t$input = wp_parse_args( $input, $empty_settings_array );\n\t\n\t\n\treturn $input; // return validated input\n}", "function validateSetup()\n\t{\n\t\tforeach ($this->setup->getClient()->status as $key => $val)\n\t\t{\n\t\t\tif ($key != \"finish\" and $key != \"access\")\n\t\t\t{\n\t\t\t\tif ($val[\"status\"] != true)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n//$this->setup->getClient()->setSetting(\"zzz\", \"V\");\n\t\t$clientlist = new ilClientList($this->setup->db_connections);\n//$this->setup->getClient()->setSetting(\"zzz\", \"W\");\n\t\t$list = $clientlist->getClients();\n//$this->setup->getClient()->setSetting(\"zzz\", \"X\");\n\t\tif (count($list) == 1)\n\t\t{\n\t\t\t$this->setup->ini->setVariable(\"clients\",\"default\",$this->setup->getClient()->getId());\n\t\t\t$this->setup->ini->write();\n\n\t\t\t$this->setup->getClient()->ini->setVariable(\"client\",\"access\",1);\n\t\t\t$this->setup->getClient()->ini->write();\n\t\t}\n//$this->setup->getClient()->setSetting(\"zzz\", \"Y\");\n\t\treturn true;\n\t}", "public function register_settings()\n\t\t{\n\t\t\tregister_setting('mailgun', 'mailgun', array(&$this, 'validation'));\n\t\t}", "public function __construct()\n {\n $this->authorizeResource(UserSetting::class, 'setting');\n }", "function validate_admin($admin, $options=[]){\n $password_required = isset($options['password_required']) ? $options['password_required']:true;\n $errors = [];\n $current_id = isset($admin['id']) ? $admin['id']:'0';\n\n //first_name\n //cannot be blank and must be betweeen 2-255 characters\n if(!has_presence($admin['first_name'])){\n $errors[] = \"First name cannot be blank\";\n }\n if(!has_length($admin['first_name'], ['min' => 2, 'max' => 255])){\n $errors[] = \"First name must be between 2 and 255 characters.\";\n }\n\n //last_name\n //cannot be blank and must be betweeen 2-255 characters\n if(!has_presence($admin['last_name'])){\n $errors[] = \"Last name cannot be blank\";\n }\n if(!has_length($admin['last_name'], ['min' => 2, 'max' => 255])){\n $errors[] = \"Last name must be between 2 and 255 characters.\";\n }\n\n //email\n //cannot be blank, must be valid email format, max 255 characters\n if(!has_presence($admin['email'])){\n $errors[] = \"Email cannot be blank\";\n }\n if(!has_valid_email_format($admin['email'])){\n $errors[] = \"Email must be of valid format.\";\n }\n if(!has_length_less_than($admin['email'],255)){\n $errors[] = \"Email cannot exceed 255 characters\";\n }\n\n //username\n //cannot be blank, 8-255 characters, must be unique\n if(!has_presence($admin['username'])){\n $errors[] = \"Username cannot be blank\";\n }\n if(!has_length($admin['username'], ['min' => 8, 'max' => 255])){\n $errors[] = \"Username must be between 2 and 255 characters.\";\n }\n\n if(!has_unique_admin_username($admin['username'],$current_id)){\n $errors[] = \"Username is already in use.\";\n }\n\n if($password_required){\n //password\n //cannot be blank, 12+ characters, max 255 characters, 1 uppercase, 1 lowercase, 1 number, 1 symbol\n if(!has_length($admin['password'], ['min' => 12, 'max' => 255])){\n $errors[] = \"Password must be between 12 and 255 characters.\";\n }\n if(!has_valid_password_requirements($admin['password'])){\n $errors[] = \"Password must contain at least 1 uppercase, 1 lowercase, 1 number, and 1 symbol.\";\n }\n if($admin['password'] !== $admin['confirm_password']){\n $errors[] = \"Please confirm password.\";\n }\n }\n\n return $errors;\n }", "public function checkConfig();", "function acf_validate_setting($name = '')\n{\n}", "public function validate() {\n\n if (empty($this->config['default_pool_read'])) {\n throw new neoform\\config\\exception('\"default_pool_read\" must be set');\n }\n\n if (empty($this->config['default_pool_write'])) {\n throw new neoform\\config\\exception('\"default_pool_write\" must be set');\n }\n\n if (empty($this->config['pools']) || ! is_array($this->config['pools']) || ! $this->config['pools']) {\n throw new neoform\\config\\exception('\"pools\" must contain at least one server');\n }\n }", "function wtr_validate_options( $input ) {\r\n\r\n\t\t\tswitch( $_POST['submitControl'] ){\r\n\r\n\t\t\t\t//restore default settings\r\n\t\t\t\tcase 'default-settings':\r\n\t\t\t\t\tupdate_option( $this->settings->get_WP_ERROR(), 'default' );\r\n\t\t\t\t\tupdate_option( $this->settings->get_WP_REWRITE_FLUSH(), 1 );\r\n\t\t\t\t\tdo_action( 'wtr_default_settings' );\r\n\t\t\t\t\treturn null;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t// writing by ajax\r\n\t\t\t\tcase 'ajax':\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t// restore settings from the backup system\r\n\t\t\t\tcase 'import-auto':\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\t\t$input = wtr_get_export_theme_settings( $_POST[ 'wtr_export_theme_settings' ] );\r\n\t\t\t\t\t$status = 'import_data' ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t// restore settings from text\r\n\t\t\t\tcase 'import-text':\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\t\t$input = wtr_decode_theme_settings( wp_remote_fopen( $_POST[ 'wtr_admin_import_settings_text' ] ) );\r\n\t\t\t\t\t$status = 'import_data' ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t$flaga\t\t\t= false;\r\n\t\t\t$new_opt\t\t= array();\r\n\t\t\t$status_flush\t= 0;\r\n\t\t\t$opt\t\t\t= $this->settings->get( 'opt' );\r\n\r\n\r\n\t\t\tforeach ( $opt as $group ) {\r\n\t\t\t\tforeach ( (array ) $group->get('sections') as $section ) {\r\n\t\t\t\t\tforeach ( ( array ) $section->get('fields') as $field ) {\r\n\r\n\t\t\t\t\t\t$id_field\t= $field->get( 'id' );\r\n\t\t\t\t\t\t$allow\t\t= $field->get( 'allow' );\r\n\t\t\t\t\t\t$value\t\t= $field->get( 'value' );\r\n\r\n\t\t\t\t\t\tif( isset( $input[ $id_field ] ) ){\r\n\t\t\t\t\t\t\t$new_value = ( ! is_array( $input[ $id_field ] ) ) ? trim ( $input[ $id_field ] ) : $input[ $id_field ];\r\n\r\n\t\t\t\t\t\t\tif( $allow == 'between' ){\r\n\t\t\t\t\t\t\t\t$min\t\t\t= $field->get( 'min' );\r\n\t\t\t\t\t\t\t\t$max\t\t\t= $field->get( 'max' );\r\n\t\t\t\t\t\t\t\t$has_attr\t\t= $field->get( 'has_attr' );\r\n\t\t\t\t\t\t\t\t//$input[ $key ]\t= trim( $input[ $key ] );\r\n\r\n\t\t\t\t\t\t\t\t$flaga = WTR_Validate::check( $allow, $new_value, $max, $min, $has_attr );\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$flaga = WTR_Validate::check( $allow, $new_value ) ;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//default value\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$new_value\t= $field->get( 'default_value' );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$new_opt[ $id_field ]\t= $new_value;\r\n\t\t\t\t\t\t$new_opt\t\t\t\t= $this->settings->set_opt_a( $new_opt, $field, $new_value );\r\n\r\n\t\t\t\t\t\t//checking slug\r\n\t\t\t\t\t\tif( $status_flush != 1 AND strpos( $id_field, '_Slug' ) AND $value != $new_value ){\r\n\t\t\t\t\t\t\t$status_flush = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( ! $flaga ){\r\n\t\t\t\t\t\t\tbreak 3;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif( ! $flaga ){\r\n\r\n\t\t\t\t$new_opt = $this->settings->get( 'opt_a' );\r\n\r\n\t\t\t\tif( isset( $status ) AND 'import_data' == $status ) {\r\n\t\t\t\t\tupdate_option( $this->settings->get_WP_ERROR(), 'import_error' );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif( empty( $status ) OR 'import_data' != $status ){\r\n\t\t\t\t\techo 'wtr_save_option_error';\r\n\t\t\t\t\texit;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ( isset( $status ) ){\r\n\r\n\t\t\t\tupdate_option( $this->settings->get_WP_ERROR(), $status );\r\n\t\t\t\tdo_action( 'wtr_import_data', $input );\r\n\t\t\t}\r\n\r\n\t\t\tif( $flaga AND isset( $status_flush ) ){\r\n\t\t\t\tupdate_option( $this->settings->get_WP_REWRITE_FLUSH(), $status_flush );\r\n\t\t\t}\r\n\r\n\t\t\treturn base64_encode( serialize( $new_opt ) );\r\n\t\t}", "function ghactivity_settings_validate( $input ) {\n\t$input['username'] = sanitize_text_field( $input['username'] );\n\t$input['access_token'] = sanitize_key( $input['access_token'] );\n\t$input['display_private'] = (bool) $input['display_private'];\n\t$input['repos'] = sanitize_text_field( $input['repos'] );\n\treturn $input;\n}", "public function require_admin()\n {\n //{\n // Errors::show_404();\n //}\n }", "protected function postValidation()\n {\n if (Tools::isSubmit('btnSubmit')) {\n if (!Tools::getValue('SEND_SMS_API')) {\n $this->postErrors[] = $this->l('API Key is required.');\n }\n if (Tools::getValue('SEND_SMS_API')) {\n $isapiKey = $this->isValidAPIKey(Tools::getValue('SEND_SMS_API'));\n if ($isapiKey->status != 'success') {\n $this->postErrors[] = $this->l('API Key is not valid.');\n }\n }\n if (!Tools::getValue('ADMIN_MOBILE')) {\n $this->postErrors[] = $this->l('Admin Mobile Number is required.');\n }\n if (Tools::getValue('ADMIN_MOBILE')) {\n $isvalid = preg_match('/^[0-9]*$/', Tools::getValue('ADMIN_MOBILE'));\n if ($isvalid == false) {\n $this->postErrors[] = $this->l('Admin Mobile Number is not valid.');\n }\n }\n }\n }", "public function validation()\n {\n\n }", "public function validate()\n\t{\n\t\t$this->errors = [];\n\n\t\t$this->validateConfig();\n\n\t\t// there is no point to continue if config is not valid against the schema\n\t\tif($this->isValid()) {\n\t\t\t$this->validateRepetitions();\n\t\t\t$this->validateMode();\n\t\t\t$this->validateClasses();\n\t\t\t$this->validateTestData();\n\t\t}\n\t}", "protected function preValidate() {}", "function routes() {\n\t\t\t$route_namespace = $this->api_route . '/' . $this->api_version;\n\n\t\t\tregister_rest_route(\n\t\t\t\t$route_namespace, '/settings', array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::EDITABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'create' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::READABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'read' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_route(\n\t\t\t\t$route_namespace, '/settings/(?P<id>\\d+)', array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::READABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'read_single' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::EDITABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'update_single' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::DELETABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'delete' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_route(\n\t\t\t\t$route_namespace, '/settings/slug/(?P<slug>\\S+)', array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::READABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'read_single_by_slug' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_route(\n\t\t\t\t$route_namespace, '/group/(?P<slug>\\S+)', array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::READABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'read_by_group' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function subway_settings_api_init() {\n\n\t// Add new 'Pages Visibility Settings'.\n\tadd_settings_section(\n\t\t'subway_setting_section',\n\t\t__( 'Pages Visibility Settings', 'subway' ),\n\t\t'subway_setting_section_callback_function',\n\t\t'reading'\n\t);\n\n\t// WP Options 'subway_public_post'.\n\tadd_settings_field(\n\t\t'subway_public_post',\n\t\t__( 'Public Posts IDs', 'subway' ),\n\t\t'subway_setting_callback_function',\n\t\t'reading',\n\t\t'subway_setting_section'\n\t);\n\n\t// WP Options 'subway_is_public'.\n\tadd_settings_field(\n\t\t'subway_is_public',\n\t\t__( 'Public Website', 'subway' ),\n\t\t'subway_is_public_form',\n\t\t'reading',\n\t\t'subway_setting_section'\n\t);\n\n\t// WP Options 'subway_login_page'.\n\tadd_settings_field(\n\t\t'subway_login_page',\n\t\t__( 'Login Page', 'subway' ),\n\t\t'subway_login_page_form',\n\t\t'reading',\n\t\t'subway_setting_section'\n\t);\n\n\t// WP Options 'subway_redirect_type'.\n\tadd_settings_field(\n\t\t'subway_redirect_type',\n\t\t__( 'Redirect Type', 'subway' ),\n\t\t'subway_redirect_option_form',\n\t\t'reading',\n\t\t'subway_setting_section'\n\t);\n\n\t// WP Options 'subway_bypassing_info'.\n\tadd_settings_field(\n\t\t'subway_bypassing_info',\n\t\t__( 'Bypassing Redirect', 'subway' ),\n\t\t'subway_bypassing_option_form',\n\t\t'reading',\n\t\t'subway_setting_section'\n\t);\n\n\t// Register all the callback settings id.\n\tregister_setting( 'reading', 'subway_public_post' );\n\tregister_setting( 'reading', 'subway_is_public' );\n\tregister_setting( 'reading', 'subway_login_page' );\n\tregister_setting( 'reading', 'subway_redirect_type' );\n\n\tregister_setting( 'reading', 'subway_redirect_page_id' );\n\tregister_setting( 'reading', 'subway_redirect_custom_url' );\n\n}", "public function validate_config_on_save($host) {\n\t\t\tif($host->free_shipping_enabled && !strlen($host->free_shipping_min_amount))\n\t\t\t\t$host->validation->setError('Please specify minimum order amount for free shipping or disable the free shipping option', 'free_shipping_min_amount', true);\n\t\t\t\t\n\t\t\t$hash_value = trim($host->api_key_password); \n\t\t\t\n\t\t\tif(!strlen($hash_value)) { \n\t\t\t\tif(!isset($host->fetched_data['api_key_password']) || !strlen($host->fetched_data['api_key_password'])) \n\t\t\t\t\t$host->validation->setError('Please enter your API key password', 'api_key_password', true); \n\n\t\t\t\t$host->api_key_password = $host->fetched_data['api_key_password']; \n\t\t\t}\n\t\t}", "function handle_app_notifier_settings() {\n $ips = ( get_option('restriction_allowed_ips') ) ? get_option('restriction_allowed_ips') : [];\n update_option('notifier_endpoint', $_POST['endpoint']);\n update_option('enable_notification', $_POST['enable_notification']);\n update_option( 'enable_api_restriction', $_POST['enable_api_restriction'] );\n\n if ( isset( $_POST['restriction_allowed_ips'] ) && !empty( $_POST['restriction_allowed_ips'] ) ) {\n array_push($ips, $_POST['restriction_allowed_ips'] );\n update_option('restriction_allowed_ips', $ips);\n }\n wp_redirect(admin_url('/admin.php?page=notifier'));\n}", "function _terminatur_settings_validate($settings_file) {\n // Check for the terminatur signature\n $settings = file_get_contents($settings_file);\n if (strpos($settings, TERMINATUR_VALIDATION_STRING) !== false) {\n // Settings have been touched by the terminatur before\n // But let's verify they still work\n $databases = array();\n $drupal_6 = FALSE;\n // Get Drupal 6 stuff\n if (strpos($settings, \"db_url\") !== false) {\n $drupal_6 = TRUE;\n $db_url = '';\n $db_prefix = '';\n }\n \n //Stub function to avoid error on validations.\n function drupal_fast_404(){} \n \n // Load settings file\n require $settings_file;\n // Parse drupal 6\n if ($drupal_6) {\n $databases = _terminatur_data_parse_db_url($db_url, $db_prefix);\n }\n // Return false if there are no DB settings to be found\n if (!isset($databases)) {\n return FALSE;\n }\n return _terminatur_data_test_db_connection($databases);\n }\n return FALSE;\n}", "public function validateSystemConfig()\n {\n if ($this->hasRequestedScopeAccess()) {\n return;\n }\n\n $redirectPath = 'adminhtml/system_config/edit';\n\n $section = $this->_request->getParam('section');\n if ($section) {\n $redirectPath .= '/section/' . $section;\n }\n\n // redirect to first allowed website or store scope\n if ($this->_role->getWebsiteIds()) {\n $this->_redirect(\n $this->_backendUrl->getUrl(\n $redirectPath,\n ['website' => $this->getAnyStoreView()->getWebsite()->getCode()]\n )\n );\n return;\n }\n\n $store = $this->getAnyAccessibleStoreView();\n if ($store instanceof \\Magento\\Store\\Api\\Data\\StoreInterface) {\n $this->_redirect(\n $this->_backendUrl->getUrl(\n $redirectPath,\n ['store' => $store->getId()]\n )\n );\n } else {\n $this->_redirect('admin/noroute');\n }\n }", "public function validate($settings)\n {\n return $settings;\n }", "public function bootingCallback()\n {\n BaseField::$configKeys[] = 'validations';\n OptionManager::$configKeys[] = 'validations';\n\n $this->setMacros();\n\n Validation::extendValidatorOptions();\n }", "public function options_update() {\n\t\tregister_setting( $this->plugin_name, $this->plugin_name, array($this, 'validate', 'default' => array( \"url_nerd_instance\" => \"\", \"category_weight\" => \"0.04\", \"entity_weight\" => \"0.7\" ) ) );\n\t}", "public function validate()\n\t{\n\t\tswitch ($_REQUEST[STR_URL_QUERY_STRING]) {\n\t\t/**\n\t\t\t * If we're on the Logout page, logout by clearing sessions and cookies.\n\t\t\t * Redirect to the login page.\n\t\t\t */\n\t\t\tcase FILE_LOGOUT:\n\t\t\t\t$this->logout();\n\t\t\t\tROCKETS_HTTP::redirect(RPATH_ROOT . \"/\" . FILE_LOGIN);\n\t\t\t\tbreak;\n\t\t\t/**\n\t\t\t * If we're on the Register page, logout (clear sessions and cookies)\n\t\t\t * Don't redirect: allow user to stay on this page so he/she can register\n\t\t\t */\n\t\t\tcase FILE_REGISTER:\n\t\t\t\t$this->logout();\n\t\t\t\tbreak;\n\t\t\t/**\n\t\t\t * If we're on the login page, run ->login();\n\t\t\t */\n\t\t\tcase FILE_LOGIN:\n\t\t\tcase \"/\" .FILE_LOGIN:\n\t\t\t\t$this->login();\n\t\t\t\tbreak;\n\t\t\t/**\n\t\t\t * If we're creating a new user, \"pass through\" - \n\t\t\t */\n\t\t\tcase FILE_CREATE_USER:\n\t\t\t\treturn;\n\t\t\t/**\n\t\t\t * On any other page....see if a user is logged in\n\t\t\t */\n\t\t\tdefault:\n\t\t\t\tif (!$this->is_logged_in())\n\t\t\t\t{\n\t\t\t\t\tROCKETS_HTTP::redirect(RPATH_ROOT . \"/\" . FILE_LOGIN);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function rules()\n {\n return [\n 'account'=>'required|unique:admin',\n 'password'=>'required',\n 'phone'=>'required|numeric|unique:admin_info',\n 'isAdmin'=>'in:0,1',\n 'status'=>'in:0,1',\n 'email'=>'required|email|unique:admin_info'\n ];\n }", "public function testConfig()\n {\n if (\n ! is_super_admin() ||\n empty($_POST['pcf_enable_type']) ||\n ! isset($_POST['pcf_rollbar_token']) ||\n ! isset($_POST['pcf_notification_email'])\n ) {\n wp_send_json_error('Something wrong with your configuration...');\n }\n\n $this->notificationEmail = $_POST['pcf_notification_email'];\n $this->rollbarToken = $_POST['pcf_rollbar_token'];\n $this->loggingType = (int)$_POST['pcf_enable_type'];\n\n try {\n $this->send(new PostmanError([\n 'post_excerpt' => 'Test PostmanCanFail error',\n 'post_title' => 'Test PostmanCanFail message',\n 'post_content' => 'Test PostmanCanFail message content'\n ]));\n } catch (Exception $e) {\n wp_send_json_error(ucfirst($e->getMessage()) . '!');\n }\n\n wp_send_json_success('The test was run successfully!');\n }", "function register_clix_uppe_admin_settings() {\r\n\t//register our settings\r\n\tregister_setting( 'clix_uppe_settings', 'clix_content_fail' );\r\n\tregister_setting( 'clix_uppe_settings', 'clix_rss_fail' );\r\n}", "public function validateAction() {\n parent::validateAction();\n }", "public function settings()\r\n {\r\n if ($this->request->is('post')) {\r\n\r\n $settingsChanged = false;\r\n\r\n $userId = $this->Session->read('Auth.User.id');\r\n\r\n $this->User->id = $userId;\r\n\r\n if ($this->request->data['User']['Clear All']) {\r\n $this->User->Reminder->deleteAll(\r\n array('Reminder.user_id' => $this->Session->read('Auth.User.id'), false)\r\n );\r\n }\r\n\r\n if (!empty($this->request->data['User']['email'])) {\r\n\r\n $this->User->set($this->request->data);\r\n $this->OpauthUser->set($this->request->data);\r\n\r\n $validUser = $this->User->validates(array('fieldList' => array('email')));\r\n $validOpauth = $this->OpauthUser->validates(array('fieldList' => array('email')));\r\n\r\n if ($this->Session->read('User.authType') == 'opauth') {\r\n\r\n $this->OpauthUser->id = $userId;\r\n\r\n if ($validOpauth && $validUser) {\r\n $this->OpauthUser->saveField('email', $this->request->data['User']['email'], false);\r\n $settingsChanged = true;\r\n }\r\n\r\n } else {\r\n\r\n if ($validUser && $validOpauth) {\r\n $this->User->saveField('email', $this->request->data['User']['email'], false);\r\n $settingsChanged = true;\r\n }\r\n }\r\n }\r\n\r\n if (!empty($this->request->data['User']['password'])) {\r\n\r\n if ($this->User->saveField('password', $this->request->data['User']['password'], true)) {\r\n $settingsChanged = true;\r\n }\r\n }\r\n\r\n if ($this->request->data['User']['timezone'] !== \"empty\") {\r\n\r\n if ($this->Session->read('User.authType') == 'opauth') {\r\n\r\n $this->OpauthUser->id = $userId;\r\n\r\n if ($this->OpauthUser->saveField('timezone', $this->request->data['User']['timezone'], false)) {\r\n $this->Session->write('Auth.User.timezone', $this->request->data['User']['timezone']);\r\n $settingsChanged = true;\r\n }\r\n\r\n } else {\r\n if ($this->User->saveField('timezone', $this->request->data['User']['timezone'], true)) {\r\n $this->Session->write('Auth.User.timezone', $this->request->data['User']['timezone']);\r\n $settingsChanged = true;\r\n }\r\n }\r\n }\r\n\r\n if ($this->request->data['User']['Clear All']) {\r\n $settingsChanged = true;\r\n $this->Session->setFlash('Cleared all reminders', 'successFlash');\r\n }\r\n\r\n if ($settingsChanged) {\r\n $this->Session->setFlash('Settings Changed', 'successFlash');\r\n\r\n } else {\r\n $this->Session->setFlash('Nothing to update', 'failureFlash');\r\n }\r\n }\r\n }", "function _eventbrite_sboc_config_form_validate($form, &$form_state){\n $eventbrite_api_key = $form_state['values']['eventbrite_api_key'];\n $eventbrite_api_user_key = $form_state['values']['eventbrite_api_user_key'];\n \n if (empty($eventbrite_app_key) || empty($eventbrite_api_user_key)) {\n\t form_set_error('API Credentials', t('Eventbrite API Key and API Usere Keys are required.'));\n } \n }", "protected function settingsValidate( $settings ) {\n\n\t\t\tif ( !isset( $_POST['initial_save'] ) || !$_POST['initial_save'] ) {\n\n\t\t\t\t$boolean_settings = apply_filters( 'muut_boolean_settings', array(\n\t\t\t\t\t'replace_comments',\n\t\t\t\t\t'use_threaded_commenting',\n\t\t\t\t\t'override_all_comments',\n\t\t\t\t\t'is_threaded_default',\n\t\t\t\t\t'show_online_default',\n\t\t\t\t\t'allow_uploads_default',\n\t\t\t\t\t'subscription_use_signed_setup',\n\t\t\t\t\t'use_custom_s3_bucket',\n\t\t\t\t\t'subscription_use_sso',\n\t\t\t\t\t'website_uses_caching',\n\t\t\t\t\t'enable_proxy_rewrites',\n\t\t\t\t\t'use_webhooks',\n\t\t\t\t) );\n\n\t\t\t\tforeach ( $boolean_settings as $boolean_setting ) {\n\t\t\t\t\t$settings[$boolean_setting] = isset( $settings[$boolean_setting] ) ? $settings[$boolean_setting] : '0';\n\t\t\t\t}\n\n\t\t\t\tif ( ( isset( $settings['forum_name'] ) && $settings['forum_name'] != muut()->getForumName() )\n\t\t\t\t\t|| ( isset( $settings['enable_proxy_rewrites'] ) && $settings['enable_proxy_rewrites'] != muut()->getOption( 'enable_proxy_rewrites' ) )\n\t\t\t\t\t|| ( isset( $settings['use_custom_s3_bucket'] ) && $settings['use_custom_s3_bucket'] != muut()->getOption( 'use_custom_s3_bucket' ) )\n\t\t\t\t\t|| ( isset( $settings['custom_s3_bucket_name'] ) && $settings['custom_s3_bucket_name'] != muut()->getOption( 'custom_s3_bucket_name' ) )\n\t\t\t\t\t|| ( isset( $settings['use_webhooks'] ) && $settings['use_webhooks'] != muut()->getOption( 'use_webhooks' ) )\n\t\t\t\t) {\n\t\t\t\t\tflush_rewrite_rules( true );\n\t\t\t\t\t$home_path = get_home_path();\n\t\t\t\t\t$htaccess_file = $home_path.'.htaccess';\n\n\t\t\t\t\tif ( ( !file_exists( $htaccess_file ) && !is_writable( $home_path ) ) || !is_writable( $htaccess_file ) ) {\n\t\t\t\t\t\tif ( get_option( 'permalink_structure', '') != '' ) {\n\t\t\t\t\t\t\t$error = array( 'field' => '', 'new_value' => '', 'name' => 'htaccess_permissions', 'message' => sprintf( __( 'It looks like the %sMuut Plugin%s doesn\\'t have permission to edit your .htaccess file. If you want to have content indexable under your website\\'s domain, you should head over to the bottom of your site\\'s %sPermalinks%s settings and copy the new code there to your .htaccess file.', 'muut' ), '<b>', '</b>', '<a href=\"' . admin_url( 'options-permalink.php' ) . '\">', '</a>' ) );\n\t\t\t\t\t\t\t$this->errorQueue[$error['name']] = $error;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the Secret Key setting does not get submitted (i.e. is disabled), make sure to erase its value.\n\t\t\t\t$settings['subscription_secret_key'] = isset( $settings['subscription_secret_key'] ) ? $settings['subscription_secret_key'] : '';\n\t\t\t} else {\n\t\t\t\t$settings = apply_filters( 'muut_settings_initial_save', $settings );\n\t\t\t}\n\n\t\t\tforeach ( $settings as $name => &$value ) {\n\t\t\t\t$value = apply_filters( 'muut_validate_setting_' . $name, $value );\n\t\t\t\t$value = apply_filters( 'muut_validate_setting', $value, $name );\n\t\t\t}\n\n\t\t\treturn apply_filters( 'muut_settings_validated', $settings );\n\t\t}", "public function validate() {\n }", "public function validate() {\n }", "function settingsIsValid($key)\n {\n return app('Padosoft\\Laravel\\Settings\\SettingsManager')->isValid($key);\n }", "public function dx_validate_settings( $input ) {\n\t\t\n\t\treturn $input;\n\t}", "function validate() {\n $errors = parent::validate();\n // Verify that search fields are set up.\n $style_options = $this->get_option('style_options');\n if (!isset($style_options['search_fields'])) {\n $errors[] = t('Display \"@display\" needs a selected search fields to work properly. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title));\n }\n else {\n // Verify that the search fields used actually exist.\n //$fields = array_keys($this->view->get_items('field'));\n $fields = array_keys($this->handlers['field']);\n foreach ($style_options['search_fields'] as $field_alias => $enabled) {\n if ($enabled && !in_array($field_alias, $fields)) {\n $errors[] = t('Display \"@display\" uses field %field as search field, but the field is no longer present. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title, '%field' => $field_alias));\n }\n }\n }\n return $errors;\n }", "function form_backend_validation()\r\n {\r\n return true ;\r\n }", "public function checkAdmin();", "private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }", "public function rules()\n {\n return [\n 'email' => 'required|email|exists:api_consumers',\n 'api_token' => 'required|valid_api_credentials:' . $this->get('email')\n ];\n }", "public function validation()\n {\n $this->assertFalse($this->denyValidator->validate(123));\n $this->assertFalse($this->denyValidator->validate('1234'));\n $this->assertFalse($this->denyValidator->validate(true));\n $this->assertFalse($this->denyValidator->validate(null));\n $this->assertFalse($this->denyValidator->validate(new stdClass()));\n }", "function bdpp_validate_settings( $input ) {\n\t\n\tglobal $bdpp_options;\n\t\n\tif ( empty( $_POST['_wp_http_referer'] ) ) {\n\t\treturn $input;\n\t}\n\t\n\t$input = $input ? $input : array();\n\t\n\tparse_str( $_POST['_wp_http_referer'], $referrer );\n\t$tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';\n\t\n\t// Sanitize filter according to tab\n\tif( $tab ) {\n\t\t$input = apply_filters( 'bdpp_validate_settings_' . $tab, $input );\n\t}\n\t\n\t// General sanitize filter\n\t$input = apply_filters( 'bdpp_validate_settings', $input );\n\t\n\t// Merge our new settings with the existing\n\t$output = array_merge( $bdpp_options, $input );\n\n\tdo_action( 'bdpp_validate_settings', $input, $tab );\n\tdo_action( 'bdpp_validate_common_settings', $input, $tab, 'bdpp' );\n\n\treturn $output;\n}", "function _bindValidation() {\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->validate[$fields['username']]['isUnique'])) {\n\t\t\t$this->model->validate[$fields['username']]['isUnique'] = array(\n\t\t\t\t'rule' => 'isUnique',\n\t\t\t\t'message' => 'The ' . Inflector::humanize($fields['username']) . ' has already been taken.',\n\t\t\t);\n\t\t}\n\t\tif (!isset($this->model->validate[$fields['confirm_password']]['confirmPassword'])) {\n\t\t\t$this->model->validate[$fields['confirm_password']]['confirmPassword'] = array(\n\t\t\t\t'rule' => 'confirmPassword',\n\t\t\t\t'message' => Inflector::humanize(Inflector::pluralize($fields['password'])) . ' do not match.'\n\t\t\t);\n\t\t}\n\t\tif (!isset($this->model->validate[$fields['old_password']]['oldPassword'])) {\n\t\t\t$this->model->validate[$fields['old_password']]['oldPassword'] = array(\n\t\t\t\t'rule' => 'oldPassword',\n\t\t\t\t'message' => 'The old ' . Inflector::humanize($fields['password']) . ' is incorrect.'\n\t\t\t);\n\t\t}\n\t}", "function siteInformation_validate() {\n return true;\n}", "public function adminUserConditionDoesNotMatchRegularUser() {}", "private function validateRequest()\n {\n //verify there is a valid access token and it matches our config. Bail if not present\n $incoming_access_token = $this->request->token();\n if ($incoming_access_token !== $this->config->access_token && ! empty($this->config->access_token)) {\n $msg = 'Access denied due to invalid token.';\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 403 Access Denied.');\n exit();\n }\n\n //verify we have a valid request\n if (! $this->request->isValid()) {\n $msg = 'Invalid package received.';\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 400 Bad Request');\n exit($msg);\n }\n }", "public function testValidatorSettings() {\n // Access the Adobe analytics form.\n $this->drupalGet('/admin/config/adobe_analytics/validation_config');\n $this->assertSession()->statusCodeEquals(200);\n\n $edit = [\n 'cloud_provider' => $this->randomGenerator->string(),\n 'cloud_domain' => $this->randomGenerator->string(),\n 'tag_manager_provider' => $this->randomGenerator->string(),\n 'tag_manager_domain' => $this->randomGenerator->string(),\n ];\n\n // Save settings form.\n $this->submitForm($edit, t('Save configuration'));\n $this->assertSession()\n ->pageTextContains('The configuration options have been saved.');\n }", "public function validator()\n {\n }", "public function validate()\n {\n $messages = array();\n\n // ID\n if (!Validator::validateField($this->id, 'intVal')) {\n $messages[] = 'ID is invalid.';\n }\n\n // Email\n if (!Validator::validateField($this->email, 'email', array('notEmpty' => array(), 'required' => true))) {\n $messages[] = 'Email address is invalid.';\n }\n\n // Password - no need to validate as it is validated on set and isn't required for an update\n\n // First name\n if (!Validator::validateField($this->first_name, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'First name is required.';\n }\n\n // Last name\n if (!Validator::validateField($this->last_name, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'Last name is required.';\n }\n\n // Role\n if (!Validator::validateField($this->role, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'Role is required.';\n }\n\n // Status\n if (!Validator::validateField($this->status, 'slug', array(\n 'notEmpty' => array(),\n 'length' => array(1, 20),\n 'required' => true\n ))) {\n $messages[] = 'Status is not valid.';\n }\n\n if (!empty($messages)) {\n throw new ValidationException($messages);\n }\n }", "protected function type_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('type_name', translate('name'), 'trim|required|callback_unique_type');\n }", "function app_settings()\n\t{\n\t\t\t\t\n\t$this->data['message'] \t= ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message'));\n\t\tif ($this->input->post()) \n\t\t{\n\t\t\t$this->check_isdemo(URL_SITE_SETTINGS);\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'site_title', \n\t\t\t$this->phrases['site title'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'sitename', \n\t\t\t$this->phrases['site name'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'address', \n\t\t\t$this->phrases['address'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'city', \n\t\t\t$this->phrases['city'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'state', \n\t\t\t$this->phrases['state'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'country', \n\t\t\t$this->phrases['country'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'latitude', \n\t\t\t$this->phrases['latitude'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'longitude', \n\t\t\t$this->phrases['longitude'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'zip', \n\t\t\t$this->phrases['zip code'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'phone', \n\t\t\t$this->phrases['phone'], \n\t\t\t'required|min_length[10])|max_length[11]');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'portal_email', \n\t\t\t$this->phrases['contact email'], \n\t\t\t'required|valid_email');\n\t\t\t\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'language_id', \n\t\t\t$this->phrases['select language'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'design_by', \n\t\t\t$this->phrases['design by'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'rights_reserved_content', \n\t\t\t$this->phrases['rights reserved'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'ios_url', \n\t\t\t$this->phrases['ios url'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'android_url', \n\t\t\t$this->phrases['android url'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'from_time', \n\t\t\t$this->phrases['from time'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'to_time', \n\t\t\t$this->phrases['to time'], \n\t\t\t'required');\n\t\t\t\n\t\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t\t\n\t\t\tif (!empty($_FILES['userfile']['name'])) {\n\t\t\t\t$ext = pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION);\n\t\t\t\t\n\t\t\t\tif (($ext != \"gif\") && ($ext != \"jpg\") && ($ext != \"png\") && ($ext != \"jpeg\")) {\n\t\t\t\t\t$msg = (isset($this->phrases['invalid file'])) ? $this->phrases['invalid file'] : \"Invalid File\";\n\t\t\t\t\t$this->prepare_flashmessage($msg, 1);\n\t\t\t\t\tredirect(URL_SITE_SETTINGS);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($this->form_validation->run() \t== TRUE\t) {\n\t\t\t\t\n\t\t\t\t$inputdata['site_title'] \t\t= $this->input->post('site_title');\n\t\t\t\t$inputdata['site_name'] \t\t= $this->input->post('sitename');\n\t\t\t\t$inputdata['address'] \t\t\t= $this->input->post('address');\n\t\t\t\t$inputdata['city'] \t\t\t\t= $this->input->post('city');\n\t\t\t\t$inputdata['state'] \t\t\t= $this->input->post('state');\n\t\t\t\t$inputdata['country'] \t\t\t= $this->input->post('country');\n\t\t\t\t$inputdata['longitude'] \t\t= $this->input->post('longitude');\n\t\t\t\t$inputdata['latitude'] \t\t\t= $this->input->post('latitude');\n\t\t\t\t$inputdata['zip'] \t\t\t\t= $this->input->post('zip');\n\t\t\t\t$inputdata['phone'] \t\t\t= $this->input->post('phone');\n\t\t\t\t$inputdata['from_time'] \t\t= $this->input->post('from_time');\n\t\t\t\t$inputdata['to_time'] \t\t\t= $this->input->post('to_time');\n\t\t\t\t$inputdata['land_line'] \t\t= $this->input->post('land_line');\n\t\t\t\t$inputdata['fax'] \t\t\t\t= $this->input->post('fax');\n\t\t\t\t$inputdata['portal_email'] \t\t= $this->input->post('portal_email');\n\t\t\t\t$inputdata['language_id'] \t\t= $this->input->post('language_id');\n\t\t\t\t$inputdata['currency'] \t\t\t= $this->input->post('currency');\n\t\t\t\t$inputdata['currency_symbol'] \t= $this->input->post('currency_symbol');\n\t\t\t\t$inputdata['country_code'] \t\t= $this->input->post('country_code');\n\t\t\t\t$inputdata['ios_url'] \t\t\t= $this->input->post('ios_url');\n\t\t\t\t$inputdata['android_url'] \t\t= $this->input->post('android_url');\n\t\t\t\t$inputdata['design_by'] \t\t= $this->input->post('design_by');\n\t\t\t\t$inputdata['rights_reserved_content'] = $this->input->post(\n\t\t\t\t'rights_reserved_content');\n\t\t\t\t\t\t\t\n\t\t\t\t$inputdata['facebook_api'] \t\t= $this->input->post('facebook_api');\n\t\t\t\t$inputdata['google_api'] \t\t= $this->input->post('google_api');\n\t\t\t\t\n\t\t\t\t$sms_notifications = 'No';\n\t\t\t\tif($this->input->post('sms_notifications')=='on'){\n\t\t\t\t\t$sms_notifications = 'Yes';\t\n\t\t\t\t}\n\t\t\t\t$inputdata['sms_notifications'] \t\t= $sms_notifications;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$push_notifications = 'No';\n\t\t\t\tif($this->input->post('fcm_push_notifications')=='on'){\n\t\t\t\t\t$push_notifications = 'Yes';\t\n\t\t\t\t}\n\t\t\t\t$inputdata['fcm_push_notifications'] \t\t= $push_notifications;\n\t\t\t\t\n\t\t\t\t$where['id'] \t\t\t\t\t= $this->input->post('update_record_id');\n\t\t\t\t\n\t\t\t\tif ($this->base_model->update_operation(\n\t\t\t\t$inputdata, TBL_SITE_SETTINGS, $where)) \n\t\t\t\t{\n\t\t\t\t\tif (!empty($_FILES['userfile']['name'])) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$config['upload_path'] \t = IMG_SITE_LOGO;\n\t\t\t\t\t\t$config['allowed_types'] = ALLOWED_TYPES;\n\t\t\t\t\t\t$config['overwrite'] = TRUE;\n\t\t\t\t\t\t$config['file_name'] \t = 'site_logo.'. $ext;\n\t\t\t\t\t\t$this->load->library('upload', $config);\n\t\t\t\t\t\t$this->upload->initialize($config);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!$this->upload->do_upload()) {\n\t\t\t\t\t\t\t$this->prepare_flashmessage(\n\t\t\t\t\t\t\t$this->upload->display_errors() , 1);\n\t\t\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$input1['site_logo']= 'site_logo.'. $ext;\n\t\t\t\t\t\t\t$this->base_model->update_operation(\n\t\t\t\t\t\t\t$input1, TBL_SITE_SETTINGS, $where);\n\t\t\t\t\t\t\t$msg = (isset($this->phrases['updated successfully'])) ? $this->phrases['updated successfully'] : \"Updated Successfully\";\n\t\t\t\t\t\t\t$this->prepare_flashmessage($msg, 0);\n\t\t\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$msg = (isset($this->phrases['updated successfully'])) ? $this->phrases['updated successfully'] : \"Updated Successfully\";\n\t\t\t\t\t$this->prepare_flashmessage($msg, 0);\n\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$msg = (isset($this->phrases['unable to update'])) ? $this->phrases['unable to update'] : \"Unable to update\";\n\t\t\t\t\t$this->prepare_flashmessage($msg, 1);\n\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->prepare_flashmessage(validation_errors(),1);\n\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$site_settings \t= $this->base_model->fetch_records_from(TBL_SITE_SETTINGS);\n\t\tif (count($site_settings) > 0) \n\t\t\t$this->data['site_settings'] \t\t= $site_settings[0];\n\t\telse \n\t\t\t$this->data['site_settings'] \t\t= array();\n\t\t\n\t\t// LANGUAGE OPTIONS\n\t\t$lang_options \t\t\t\t\t\t\t= array('' => $this->phrases['select language']);\n\t\t$languages \t\t\t\t\t\t\t\t= $this->base_model->fetch_records_from(TBL_LANGUAGES,array('status'=>'Active'));\n\t\tforeach($languages as $row):\n\t\t\t$lang_options[$row->id] \t\t\t= ucfirst($row->lang_name);\n\t\tendforeach;\n\t\t\n\t\t// CURRENCY OPTIONS\n\t\t\n\t\t$currency_options = array(''=>$this->phrases['select currency']);\n\t\t\n\t\t$currencies = $this->base_model->fetch_records_from(TBL_CURRENCY);\n\t\tforeach($currencies as $row):\n\t\t\t$currency_options[$row->currency_code_alpha] = ucfirst($row->currency_name);\n\t\tendforeach;\n\t\t\n\t\t//echo \"<pre>\";\n\t\t//print_r($this->data['site_settings']); die();\n\t\t$this->data['lang_options'] \t\t\t= $lang_options;\n\t\t$this->data['currency_options'] \t\t= $currency_options;\n\t\t$this->data['active_class'] \t\t\t= ACTIVE_MASTER_SETTINGS;\n\t\t$this->data['title'] \t\t\t\t\t= (isset($this->phrases['app settings'])) ? $this->phrases['app settings'] : \"App Settings\";\n\t\t$this->data['content'] \t\t\t\t\t= 'site_settings';\n\t\t$this->_render_page(TEMPLATE_ADMIN, $this->data);\n\t}", "public function admin_init()\n\t\t{\n\t\t\t$this->register_settings();\n\t\t\t$region = $this->get_option('region');\n\t\t\t$apiKey = $this->get_option('apiKey');\n\t\t\t$useAPI = $this->get_option('useAPI');\n\t\t\t$password = $this->get_option('password');\n\n\t\t\tadd_action('admin_notices', array(&$this, 'admin_notices'));\n\t\t}", "public function admin_init() {\n\t\t// Maybe connect with SocialFlow.\n\t\t$this->maybe_authorize();\n\n\t\t// Register our settings in the global \"whitelist_settings\".\n\t\tregister_setting( 'socialflow', 'socialflow', array( $this, 'save_settings' ) );\n\t}", "public function validateConfig() {\n // Validate the site has default content configuration.\n if (empty($this->defaultContentConfig)) {\n throw new \\Exception(\"No default content configuration exists for current site.\");\n }\n\n // Validate the configuration specifies a valid path.\n if (isset($this->defaultContentConfig['path']) && !is_dir($this->defaultContentConfig['path'])) {\n throw new \\Exception(\"Configured default content path is not a valid directory. Check the site's configuration.\");\n }\n\n // Validate that default entities to export are given.\n if (empty($this->defaultContentConfig['default-entities']) || !is_array($this->defaultContentConfig['default-entities'])) {\n throw new \\Exception(\"Default entities are not properly configured. Ensure entity types are listed.\");\n }\n\n // Validate a proper default_author value is passed.\n if (isset($this->defaultContentConfig['default_author']) && $this->defaultContentConfig['default_author'] != self::DEFAULT_AUTHOR_PRESERVE) {\n if (!is_numeric($this->defaultContentConfig['default_author'])) {\n throw new \\Exception(\"Assigned default_author value is not an integer. Assign to a valid UID.\");\n }\n }\n }" ]
[ "0.6740751", "0.63384986", "0.62953085", "0.6293405", "0.6240787", "0.6229866", "0.6172661", "0.6146737", "0.5993352", "0.59797466", "0.59287465", "0.5899268", "0.58966935", "0.58945346", "0.5891229", "0.58542216", "0.5836963", "0.58332175", "0.5808781", "0.57578415", "0.5748818", "0.5727814", "0.5721926", "0.5719924", "0.5718965", "0.5716748", "0.5691837", "0.56883883", "0.5681824", "0.5651717", "0.5645115", "0.5631748", "0.5626888", "0.56117857", "0.56009966", "0.55889547", "0.55816543", "0.55736953", "0.55728346", "0.5561487", "0.55614537", "0.5557029", "0.55560666", "0.55526406", "0.5548071", "0.5527574", "0.5520716", "0.551573", "0.5511811", "0.5511077", "0.55098486", "0.5502909", "0.5501942", "0.54983264", "0.5486328", "0.54853", "0.5471409", "0.54662126", "0.546137", "0.5452239", "0.5448075", "0.54466337", "0.54459447", "0.5442294", "0.5429216", "0.54280514", "0.5426778", "0.54193795", "0.54173017", "0.54171073", "0.54105175", "0.5404835", "0.5402964", "0.53978205", "0.5397416", "0.53938514", "0.5381197", "0.53807896", "0.53807896", "0.53774035", "0.53768045", "0.537607", "0.5374784", "0.5374643", "0.53739214", "0.5369328", "0.53633964", "0.5363018", "0.5360896", "0.53604704", "0.5354284", "0.5353981", "0.5351463", "0.5351257", "0.5350961", "0.53490406", "0.5342345", "0.5342157", "0.5332441", "0.53313696" ]
0.61374456
8
Submission handler for restapi administrative settings.
function restapi_admin_form_submit($form, &$form_state) { // Ensure the menu system picks up the changes due to the prefix update. if (!empty($form_state['storage']['restapi_url_prefix_changed'])) { menu_rebuild(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save_settings()\n {\n if(isset($_POST) && isset($_POST['api_settings'])) {\n $data = $_POST['api_settings'];\n update_option('api_settings', json_encode($data));\n }\n }", "public function settings_page() {\n if (isset($_POST['rsfa_hostname']) && isset($_POST['rsfa_username']) && isset($_POST['rsfa_password']) && isset($_POST['rsfa_client_secret']) && isset($_POST['rsfa_client_id'])) {\n $_POST = filter_var_array($_POST, FILTER_SANITIZE_STRING);\n $this->settings->hostname = $_POST['rsfa_hostname'];\n $this->settings->username = $_POST['rsfa_username'];\n $this->settings->password = $_POST['rsfa_password'];\n $this->settings->client_id = $_POST['rsfa_client_id'];\n $this->settings->client_secret = $_POST['rsfa_client_secret'];\n update_option('rsfa_settings', json_encode($this->settings));\n }\n ?>\n <style type=\"text/css\">\n .rsfa-container label {\n display: block;\n margin-bottom: 10px;\n }\n .rsfa-container input {\n display: block;\n }\n .rsfa-container button {\n margin-top: 10px;\n }\n </style>\n <div class=\"rsfa-container\">\n <h1>ShareFile API Settings</h1>\n <form method=\"POST\" enctype=\"multipart/form-data\">\n <label>\n Hostname\n <input type=\"text\" name=\"rsfa_hostname\" value=\"<?php echo $this->settings->hostname; ?>\" />\n </label>\n <label>\n Username\n <input type=\"text\" name=\"rsfa_username\" value=\"<?php echo $this->settings->username; ?>\" />\n </label>\n <label>\n Password\n <input type=\"password\" name=\"rsfa_password\" value=\"<?php echo $this->settings->password; ?>\" />\n </label>\n <label>\n Client ID\n <input type=\"text\" name=\"rsfa_client_id\" value=\"<?php echo $this->settings->client_id; ?>\" />\n </label>\n <label>\n Client Secret\n <input type=\"text\" name=\"rsfa_client_secret\" value=\"<?php echo $this->settings->client_secret; ?>\" />\n </label>\n <button type=\"submit\">Save Settings</button>\n </form>\n </div>\n <?php\n }", "public function settings_screen() {\n\t\tglobal ${class_name};\n\t\tdo_action( ${class_name}->token . '_before_settings' );\n\t\tdo_action( $this->token . '_before_settings' );\n\t\tsettings_fields( $this->token );\n\t\tdo_settings_sections( $this->token );\n\t\tdo_action( $this->token . '_after_settings' );\n\t\tdo_action( ${class_name}->token . '_after_settings' );\n\t\tsubmit_button();\n\t}", "public function action() {\r\n parent::action();\r\n\r\n\r\n switch (SQ_Tools::getValue('action')) {\r\n\r\n case 'sq_settings_update':\r\n if (SQ_Tools::getIsset('sq_post_types')) {\r\n SQ_Tools::$options['sq_post_types'] = array();\r\n foreach (SQ_Tools::getValue('sq_post_types') as $key) {\r\n array_push(SQ_Tools::$options['sq_post_types'], $key);\r\n }\r\n\r\n if (!in_array('product', get_post_types())) {\r\n array_push(SQ_Tools::$options['sq_post_types'], 'product');\r\n }\r\n }\r\n\r\n SQ_Tools::saveOptions('sq_google_country', SQ_Tools::getValue('sq_google_country'));\r\n SQ_Tools::saveOptions('sq_google_country_strict', SQ_Tools::getValue('sq_google_country_strict'));\r\n SQ_Tools::saveOptions('sq_google_ranksperhour', SQ_Tools::getValue('sq_google_ranksperhour'));\r\n\r\n SQ_Tools::saveOptions('sq_keyword_help', (int) SQ_Tools::getValue('sq_keyword_help'));\r\n SQ_Tools::saveOptions('sq_keyword_information', (int) SQ_Tools::getValue('sq_keyword_information'));\r\n SQ_Tools::saveOptions('sq_sla', (int) SQ_Tools::getValue('sq_sla'));\r\n SQ_Tools::saveOptions('sq_keywordtag', (int) SQ_Tools::getValue('sq_keywordtag'));\r\n SQ_Tools::saveOptions('sq_local_images', (int) SQ_Tools::getValue('sq_local_images'));\r\n\r\n\r\n SQ_Tools::saveOptions('sq_google_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkGoogleWTCode(SQ_Tools::getValue('sq_google_wt','',true)));\r\n SQ_Tools::saveOptions('sq_bing_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_bing_wt','',true)));\r\n SQ_Tools::saveOptions('sq_alexa', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_alexa','',true)));\r\n\r\n\r\n SQ_Action::apiCall('sq/user/settings', array('settings' => json_encode(SQ_Tools::getBriefOptions())), 10);\r\n SQ_Tools::emptyCache();\r\n break;\r\n }\r\n }", "public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New Optin', 'mailoptin'));\n $this->register_core_settings($instance, true);\n $instance->build(true);\n }", "public function action() {\r\n parent::action();\r\n switch (SQ_Classes_Tools::getValue('action')) {\r\n case 'sq_settingsseo_option':\r\n SQ_Classes_Tools::setHeader('json');\r\n\r\n if (!current_user_can('manage_options')) {\r\n echo json_encode(array('error' => __(\"You don't have enough pemission to activate this feature\", _SQ_PLUGIN_NAME_)));\r\n exit();\r\n }\r\n\r\n $option = SQ_Classes_Tools::getValue('option');\r\n $value = (int)SQ_Classes_Tools::getValue('value');\r\n SQ_Classes_Tools::saveOptions($option, $value);\r\n\r\n echo json_encode(array('saved' => true));\r\n exit();\r\n case 'sq_settingsseo_update':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n if (!SQ_Classes_Tools::getIsset('sq_use')) {\r\n return;\r\n }\r\n SQ_Classes_Tools::saveOptions('sq_use', (int)SQ_Classes_Tools::getValue('sq_use'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_title', (int)SQ_Classes_Tools::getValue('sq_auto_title'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_description', (int)SQ_Classes_Tools::getValue('sq_auto_description'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_keywords', (int)SQ_Classes_Tools::getValue('sq_auto_keywords'));\r\n SQ_Classes_Tools::saveOptions('sq_keywordtag', (int)SQ_Classes_Tools::getValue('sq_keywordtag'));\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_canonical', (int)SQ_Classes_Tools::getValue('sq_auto_canonical'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_noindex', (int)SQ_Classes_Tools::getValue('sq_auto_noindex'));\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_amp', (int)SQ_Classes_Tools::getValue('sq_auto_amp'));\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_meta', (int)SQ_Classes_Tools::getValue('sq_auto_meta'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_favicon', (int)SQ_Classes_Tools::getValue('sq_auto_favicon'));\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////SOCIAL OPTION\r\n SQ_Classes_Tools::saveOptions('sq_auto_facebook', (int)SQ_Classes_Tools::getValue('sq_auto_facebook'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_twitter', (int)SQ_Classes_Tools::getValue('sq_auto_twitter'));\r\n SQ_Classes_Tools::saveOptions('sq_og_locale', SQ_Classes_Tools::getValue('sq_og_locale'));\r\n\r\n $socials = array_merge(SQ_Classes_Tools::getOption('socials'), SQ_Classes_Tools::getValue('sq_socials', array()));\r\n\r\n if (isset($socials['twitter_site'])) $socials['twitter_site'] = $this->model->checkTwitterAccount($socials['twitter_site']);\r\n if (isset($socials['twitter_site'])) $socials['twitter'] = $this->model->checkTwitterAccountName($socials['twitter_site']);\r\n if (isset($socials['facebook_site'])) $socials['facebook_site'] = $this->model->checkFacebookAccount($socials['facebook_site']);\r\n if (isset($socials['google_plus_url'])) $socials['google_plus_url'] = $this->model->checkGoogleAccount($socials['google_plus_url']);\r\n if (isset($socials['pinterest_url'])) $socials['pinterest_url'] = $this->model->checkPinterestAccount($socials['pinterest_url']);\r\n if (isset($socials['instagram_url'])) $socials['instagram_url'] = $this->model->checkInstagramAccount($socials['instagram_url']);\r\n if (isset($socials['linkedin_url'])) $socials['linkedin_url'] = $this->model->checkLinkeinAccount($socials['linkedin_url']);\r\n if (isset($socials['myspace_url'])) $socials['myspace_url'] = $this->model->checkMySpaceAccount($socials['myspace_url']);\r\n if (isset($socials['youtube_url'])) $socials['youtube_url'] = $this->model->checkYoutubeAccount($socials['youtube_url']);\r\n\r\n $fb_admins = SQ_Classes_Tools::getValue('sq_fb_admins', array());\r\n $socials['fb_admins'] = array();\r\n if (!empty($fb_admins)) {\r\n $fb_admins = array_unique($fb_admins);\r\n foreach ($fb_admins as $index => $value) {\r\n if (isset($value) && $value == '') {\r\n unset($socials['fb_admins'][$index]);\r\n } else {\r\n $socials['fb_admins'][$index]['id'] = $this->model->checkFavebookAdminCode($value);\r\n }\r\n }\r\n }\r\n\r\n //get the facebook app id for sharing\r\n if (SQ_Classes_Tools::getIsset('sq_fbadminapp')) $socials['fbadminapp'] = SQ_Classes_Tools::getValue('sq_fbadminapp');\r\n if (SQ_Classes_Tools::getIsset('twitter_card_type')) $socials['twitter_card_type'] = SQ_Classes_Tools::getValue('twitter_card_type');\r\n\r\n\r\n SQ_Classes_Tools::saveOptions(\"socials\", $socials);\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////FIRST PAGE OPTIMIZATION\r\n if ($pageId = get_option('page_on_front')) {\r\n $sq_hash = md5($pageId);\r\n } elseif ($post_id = get_option('page_for_posts')) {\r\n $sq_hash = md5($pageId);\r\n } else {\r\n $sq_hash = md5('wp_homepage');\r\n }\r\n\r\n if ($sq_hash <> '') {\r\n $url = home_url();\r\n $sq = SQ_Classes_ObjController::getClass('SQ_Models_Frontend')->getSqSeo($sq_hash);\r\n\r\n $sq->doseo = 1;\r\n $sq->title = urldecode(SQ_Classes_Tools::getValue('sq_fp_title', false));\r\n $sq->description = urldecode(SQ_Classes_Tools::getValue('sq_fp_description', false));\r\n $sq->keywords = SQ_Classes_Tools::getValue('sq_fp_keywords', false);\r\n $sq->og_media = SQ_Classes_Tools::getValue('sq_fp_ogimage', false);\r\n\r\n $this->model->db_insert(\r\n $url,\r\n $sq_hash,\r\n (int)$pageId,\r\n maybe_serialize($sq->toArray()),\r\n gmdate('Y-m-d H:i:s')\r\n );\r\n }\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////SITEMAP OPTION\r\n SQ_Classes_Tools::saveOptions('sq_auto_sitemap', (int)SQ_Classes_Tools::getValue('sq_auto_sitemap'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_feed', (int)SQ_Classes_Tools::getValue('sq_auto_feed'));\r\n SQ_Classes_Tools::saveOptions('sq_sitemap_frequency', SQ_Classes_Tools::getValue('sq_sitemap_frequency'));\r\n SQ_Classes_Tools::saveOptions('sq_sitemap_ping', (int)SQ_Classes_Tools::getValue('sq_sitemap_ping'));\r\n SQ_Classes_Tools::saveOptions('sq_sitemap_perpage', (int)SQ_Classes_Tools::getValue('sq_sitemap_perpage'));\r\n\r\n\r\n foreach (SQ_Classes_Tools::$options['sq_sitemap'] as $key => $value) {\r\n if ($key == 'sitemap') {\r\n continue;\r\n }\r\n SQ_Classes_Tools::$options['sq_sitemap'][$key][1] = 0;\r\n if ($key == 'sitemap-product' && !$this->model->isEcommerce()) {\r\n SQ_Classes_Tools::$options['sq_sitemap'][$key][1] = 2;\r\n }\r\n }\r\n if (SQ_Classes_Tools::getIsset('sq_sitemap')) {\r\n foreach (SQ_Classes_Tools::getValue('sq_sitemap') as $key) {\r\n if (isset(SQ_Classes_Tools::$options['sq_sitemap'][$key][1])) {\r\n SQ_Classes_Tools::$options['sq_sitemap'][$key][1] = 1;\r\n }\r\n }\r\n }\r\n\r\n foreach (SQ_Classes_Tools::$options['sq_sitemap_show'] as $key => $value) {\r\n SQ_Classes_Tools::$options['sq_sitemap_show'][$key] = 0;\r\n }\r\n if (SQ_Classes_Tools::getIsset('sq_sitemap_show')) {\r\n foreach (SQ_Classes_Tools::getValue('sq_sitemap_show') as $key) {\r\n if (isset(SQ_Classes_Tools::$options['sq_sitemap_show'][$key])) {\r\n SQ_Classes_Tools::$options['sq_sitemap_show'][$key] = 1;\r\n }\r\n }\r\n }\r\n\r\n ///////////////////////////////////////////\r\n ///////SAVE THE CODE\r\n $codes = array_merge(SQ_Classes_Tools::getOption('codes'), SQ_Classes_Tools::getValue('sq_codes', array()));\r\n\r\n if (!empty($codes)) {\r\n //if (isset($codes['facebook_pixel'])) $codes['facebook_pixel'] = $codes['facebook_pixel'];\r\n if (isset($codes['google_analytics'])) $codes['google_analytics'] = $this->model->checkGoogleAnalyticsCode($codes['google_analytics']);\r\n if (isset($codes['pinterest_verify'])) $codes['pinterest_verify'] = $this->model->checkPinterestCode($codes['pinterest_verify']);\r\n if (isset($codes['google_wt'])) $codes['google_wt'] = $this->model->checkGoogleWTCode($codes['google_wt']);\r\n if (isset($codes['bing_wt'])) $codes['bing_wt'] = $this->model->checkBingWTCode($codes['bing_wt']);\r\n if (isset($codes['alexa_verify'])) $codes['alexa_verify'] = $this->model->checkBingWTCode($codes['alexa_verify']);\r\n\r\n SQ_Classes_Tools::saveOptions(\"codes\", $codes);\r\n }\r\n\r\n\r\n ///////////////////////////////////////////JSONLD\r\n SQ_Classes_Tools::saveOptions('sq_auto_jsonld', (int)SQ_Classes_Tools::getValue('sq_auto_jsonld'));\r\n if (SQ_Classes_Tools::getIsset('sq_jsonld_type') && isset(SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')])) {\r\n\r\n foreach (SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')] as $key => $value) {\r\n if (isset(SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')][$key])) {\r\n SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')][$key] = SQ_Classes_Tools::getValue('sq_jsonld_' . $key);\r\n }\r\n }\r\n if (isset(SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone']) &&\r\n SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone'] <> ''\r\n ) {\r\n SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone'] = '+' . SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone'];\r\n }\r\n }\r\n SQ_Classes_Tools::saveOptions('sq_jsonld_type', SQ_Classes_Tools::getValue('sq_jsonld_type'));\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////FAVICON OPTION\r\n\r\n /* if there is an icon to upload */\r\n if (!empty($_FILES['favicon'])) {\r\n\r\n $return = $this->model->addFavicon($_FILES['favicon']);\r\n if ($return['favicon'] <> '') {\r\n SQ_Classes_Tools::saveOptions('favicon', strtolower(basename($return['favicon'])));\r\n }\r\n if ($return['message'] <> '') {\r\n define('SQ_MESSAGE_FAVICON', $return['message']);\r\n SQ_Classes_Error::setError(SQ_MESSAGE_FAVICON . \" <br /> \");\r\n }\r\n }\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n if (SQ_Classes_Tools::isAjax()) {\r\n SQ_Classes_Tools::setHeader('json');\r\n echo json_encode(array('saved' => true));\r\n exit();\r\n } else {\r\n //Update the rewrite rules with the new options\r\n add_filter('rewrite_rules_array', array($this, 'rewrite_rules'), 999, 1);\r\n //Flush the rewrite with the new favicon and sitemap\r\n flush_rewrite_rules();\r\n //empty the cache on settings changed\r\n SQ_Classes_Tools::emptyCache();\r\n\r\n }\r\n break;\r\n case 'sq_setstickysla':\r\n SQ_Classes_Tools::saveUserMeta('sq_auto_sticky', (int)SQ_Classes_Tools::getValue('sq_auto_sticky'));\r\n\r\n break;\r\n case 'sq_checkissues':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_checkedissues', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n /* Load the error class */\r\n SQ_Classes_Tools::checkErrorSettings();\r\n\r\n break;\r\n case 'sq_fixautoseo':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_use', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fixprivate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n update_option('blog_public', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fixcomments':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n update_option('comments_notify', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fixpermalink':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n $GLOBALS['wp_rewrite'] = new WP_Rewrite();\r\n global $wp_rewrite;\r\n $permalink_structure = ((get_option('permalink_structure') <> '') ? get_option('permalink_structure') : '/') . \"%postname%/\";\r\n $wp_rewrite->set_permalink_structure($permalink_structure);\r\n $permalink_structure = get_option('permalink_structure');\r\n\r\n flush_rewrite_rules();\r\n break;\r\n case 'sq_fix_ogduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_facebook', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fix_tcduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_twitter', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fix_titleduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_title', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fix_descduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_description', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_active_help' :\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('active_help', SQ_Classes_Tools::getValue('active_help'));\r\n break;\r\n case 'sq_warnings_off':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('ignore_warn', 1);\r\n break;\r\n case 'sq_copyright_agreement':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_copyright_agreement', 1);\r\n break;\r\n case 'sq_get_snippet':\r\n\r\n if (SQ_Classes_Tools::getValue('url') <> '') {\r\n $url = SQ_Classes_Tools::getValue('url');\r\n } else {\r\n $url = get_bloginfo('url');\r\n }\r\n $snippet = SQ_Classes_Tools::getSnippet($url);\r\n\r\n SQ_Classes_Tools::setHeader('json');\r\n echo json_encode($snippet);\r\n exit();\r\n case 'sq_backup':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::setHeader('text');\r\n header(\"Content-Disposition: attachment; filename=squirrly-settings-\" . gmdate('Y-m-d') . \".txt\");\r\n\r\n if (function_exists('base64_encode')) {\r\n echo base64_encode(json_encode(SQ_Classes_Tools::$options));\r\n } else {\r\n echo json_encode(SQ_Classes_Tools::$options);\r\n }\r\n exit();\r\n break;\r\n case 'sq_restore':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n if (!empty($_FILES['sq_options']) && $_FILES['sq_options']['tmp_name'] <> '') {\r\n $fp = fopen($_FILES['sq_options']['tmp_name'], 'rb');\r\n $options = '';\r\n while (($line = fgets($fp)) !== false) {\r\n $options .= $line;\r\n }\r\n try {\r\n if (function_exists('base64_encode') && base64_decode($options) <> '') {\r\n $options = @base64_decode($options);\r\n }\r\n $options = json_decode($options, true);\r\n if (is_array($options) && isset($options['sq_api'])) {\r\n if (SQ_Classes_Tools::getOption('sq_api') <> '') {\r\n $options['sq_api'] = SQ_Classes_Tools::getOption('sq_api');\r\n }\r\n SQ_Classes_Tools::$options = $options;\r\n SQ_Classes_Tools::saveOptions();\r\n\r\n //Check if there is an old backup from Squirrly\r\n SQ_Classes_Tools::getOptions();\r\n SQ_Classes_Tools::checkUpgrade();\r\n\r\n //Update the rewrite rules with the new options\r\n add_filter('rewrite_rules_array', array($this, 'rewrite_rules'), 999, 1);\r\n //Flush the rewrite with the new favicon and sitemap\r\n flush_rewrite_rules();\r\n\r\n SQ_Classes_Error::setError(__('Great! The backup is restored.', _SQ_PLUGIN_NAME_) . \" <br /> \", 'success');\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } catch (Exception $e) {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! You have to enter a previous saved backup file.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n break;\r\n case 'sq_backup_sql':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n header('Content-Type: application/octet-stream');\r\n header(\"Content-Transfer-Encoding: Binary\");\r\n header(\"Content-Disposition: attachment; filename=squirrly-seo-\" . gmdate('Y-m-d') . \".sql\");\r\n\r\n if (function_exists('base64_encode')) {\r\n echo base64_encode($this->model->createTableBackup());\r\n } else {\r\n echo $this->model->createTableBackup();\r\n }\r\n exit();\r\n break;\r\n case 'sq_restore_sql':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n if (!empty($_FILES['sq_sql']) && $_FILES['sq_sql']['tmp_name'] <> '') {\r\n $fp = fopen($_FILES['sq_sql']['tmp_name'], 'rb');\r\n $sql_file = '';\r\n while (($line = fgets($fp)) !== false) {\r\n $sql_file .= $line;\r\n }\r\n\r\n if (function_exists('base64_encode')) {\r\n $sql_file = @base64_decode($sql_file);\r\n }\r\n\r\n if ($sql_file <> '' && strpos($sql_file, 'CREATE TABLE IF NOT EXISTS') !== false) {\r\n try {\r\n $queries = explode(\";\\n\", $sql_file);\r\n $this->model->executeSql($queries);\r\n SQ_Classes_Error::setError(__('Great! The SEO backup is restored.', _SQ_PLUGIN_NAME_) . \" <br /> \", 'success');\r\n\r\n } catch (Exception $e) {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! You have to enter a previous saved backup file.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n break;\r\n case 'sq_dataupgrade':\r\n //Check if there is an old backup from Squirrly\r\n SQ_Classes_Tools::getOptions();\r\n SQ_Classes_Tools::checkUpgrade();\r\n SQ_Classes_Error::setError(__('Great! Squirrly Data Settings is up to date now.', _SQ_PLUGIN_NAME_) . \" <br /> \", 'success');\r\n\r\n break;\r\n case 'sq_resetsettings':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::$options = SQ_Classes_Tools::getOptions('reset');\r\n SQ_Classes_Tools::saveOptions();\r\n break;\r\n }\r\n }", "private function _submitHandler() {\n // Checking if this is a valid settings submit handler.\n if (!empty($_POST) && isset($_POST['type']) && $_POST['type'] == 'pii_settings' && (isset( $_POST['pii_settings_nonce'] ) \n || wp_verify_nonce( $_POST['pii_settings_nonce'], 'pii_settings' )) ) {\n update_option('pii_fields', $_POST['options']);\n $encryption = new EncryptDecrypt();\n $encryption->updateFields($_POST['options']);\n }\n // Meta fields saving.\n else if (!empty($_POST) && isset($_POST['type']) && $_POST['type'] == 'pii_custom_meta_fields' && (isset( $_POST['pii_custom_meta_fields_nonce'] ) \n || wp_verify_nonce( $_POST['pii_custom_meta_fields_nonce'], 'pii_custom_meta_fields' )) ) {\n update_option('pii_custom_meta_fields', trim($_POST['pii_custom_meta_fields'])); \n }\n }", "public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New', 'mailoptin'));\n $this->register_core_settings($instance);\n $instance->build(true, true);\n }", "public function perform()\n {\n // assign header var with css definitions\n $this->viewVar['htmlHeaderData'] .= $this->controllerLoader->defaultMainCss();\n $this->viewVar['htmlTitle'] .= ' Articles general settings';\n // select advanced link\n $this->viewVar['selectedMenuItem'] = 'advanced';\n\n $this->viewVar['error'] = array();\n $this->viewVar['status'] = array();\n\n $this->fields = array();\n\n $updateOptions = $this->httpRequest->getParameter('updateOptions', 'post', 'alnum');\n $cancel = $this->httpRequest->getParameter('cancel', 'post', 'alnum');\n $save = $this->httpRequest->getParameter('save', 'post', 'alnum');\n $status = $this->httpRequest->getParameter('status', 'get', 'alnum');\n\n if(!empty($updateOptions) || !empty($save))\n {\n if(true == $this->validatePostData())\n {\n $this->model->action( 'common','setConfigVar',\n array('data' => $this->fields,\n 'module' => 'article'));\n\n if(!empty($updateOptions))\n {\n $this->router->redirect( $this->controllerVar['adminWebController'].'/mod/default/cntr/advancedMain' );\n }\n else\n {\n $this->router->redirect( $this->controllerVar['adminWebController'].'/mod/article/cntr/options/status/saved' );\n }\n }\n }\n elseif(!empty($cancel))\n {\n // redirect to the parent node of my site\n $this->router->redirect($this->viewVar['adminWebController'].'/mod/default/cntr/advancedMain');\n }\n elseif(!empty($status))\n {\n $this->viewVar['htmlTitle'] .= '. Status: updated settings';\n $this->viewVar['status'][] = 'Updated settings';\n }\n\n // assign view vars of options\n $this->viewVar['option'] = $this->config->getModuleArray( 'article' );\n }", "public function settingsAction ()\n {\n $this->_pageTitle = ['Healthcheck', 'Settings'];\n $this->_navigation->setActiveStep(HealthCheckStepsModel::STEP_SETTINGS);\n\n if ($this->getRequest()->isPost())\n {\n $postData = $this->getRequest()->getPost();\n\n if (!isset($postData['goBack']))\n {\n $this->saveClientSettingsForm($postData);\n $this->saveHealthcheck();\n\n if (isset($postData['saveAndContinue']))\n {\n $this->updateHealthcheckStepName();\n $this->saveHealthcheck();\n $this->gotoNextNavigationStep($this->_navigation);\n }\n }\n else\n {\n $this->gotoPreviousNavigationStep($this->_navigation);\n }\n }\n else\n {\n $this->showClientSettingsForm();\n }\n }", "private function settings()\n\t{\n\t\tif($_POST)\n\t\t{\n\t\t\t// Available Vews\n config::set('s7n.views', $this->input->post('views'));\n\n\t\t\t// Default Sidebar Title\n config::set('s7n.default_sidebar_title', $this->input->post('default_sidebar_title'));\n\n\t\t\t// Default Sidebar Content\n config::set('s7n.default_sidebar_content', $this->input->post('default_sidebar_content'));\n\n\t\t\tmessage::info(__('Page Settings edited successfully'), 'admin/page/settings');\n\t\t}\n\n\t\t$this->head->title->append(__('Settings'));\n\n\t\t$this->template->title .= __('Settings');\n\t\t$this->template->content = View::factory('page/settings', array(\n\t\t\t'views' => config::get('s7n.page_views'),\n\t\t\t'default_sidebar_title' => config::get('s7n.default_sidebar_title'),\n\t\t\t'default_sidebar_content' => config::get('s7n.default_sidebar_content')\n\t\t));\n\t}", "protected function _setting_handle() {}", "function afap_form_action() {\n\n if (!empty($_POST) && wp_verify_nonce($_POST['afap_form_nonce'], 'afap_form_action')) {\n\n include('inc/cores/save-settings.php');\n\n } else {\n\n die('No script kiddies please!!');\n\n }\n\n }", "public function post_action() {\n\t\tcheck_ajax_referer( self::POST_ACTION_ID );\n\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\twp_die( esc_html__( 'You are not allowed to do that.', 'autowpdb-example-plugin' ), '', 403 );\n\t\t}\n\n\t\t$add_entry = filter_input( INPUT_POST, 'add_entry', FILTER_SANITIZE_STRING );\n\t\t$delete_entry = filter_input( INPUT_POST, 'delete_entry', FILTER_SANITIZE_STRING );\n\n\t\tif ( null !== $add_entry ) {\n\t\t\t// Insert a new entry into the table.\n\t\t\t$result = $this->action_insert_entry();\n\n\t\t\t$this->action_insert_entry_message( $result );\n\t\t} elseif ( null !== $delete_entry ) {\n\t\t\t// Delete the oldest entry.\n\t\t\t$result = $this->action_delete_entry();\n\n\t\t\t$this->action_delete_entry_message( $result );\n\t\t} else {\n\t\t\t$this->invalid_action_message();\n\t\t}\n\n\t\tset_transient( 'settings_errors', get_settings_errors( self::POST_ACTION_ID ), 30 );\n\n\t\t$goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() );\n\t\twp_safe_redirect( esc_url_raw( $goback ) );\n\t\texit;\n\t}", "public function handle_actions() {\n if ( !empty( $_REQUEST[ 'yith-wcbk-google-calendar-action' ] ) && $this->check_nonce() ) {\n $credentials_options = array( 'client-id', 'client-secret' );;\n switch ( $_REQUEST[ 'yith-wcbk-google-calendar-action' ] ) {\n case 'save-options':\n $options = array( 'calendar-id' );\n foreach ( $options as $option ) {\n $value = !empty( $_REQUEST[ $option ] ) ? $_REQUEST[ $option ] : '';\n $this->set_option( $option, $value );\n }\n break;\n case 'save-settings':\n $settings = !empty( $_REQUEST[ 'settings' ] ) ? $_REQUEST[ 'settings' ] : array();\n $default_settings = array(\n 'debug' => 'no',\n 'add-note-on-sync' => 'no',\n 'booking-events-to-synchronize' => array(),\n );\n $settings = wp_parse_args( $settings, $default_settings );\n foreach ( $settings as $option => $value ) {\n $this->set_option( $option, $value );\n }\n break;\n case 'save-credentials':\n foreach ( $credentials_options as $option ) {\n $value = !empty( $_REQUEST[ $option ] ) ? $_REQUEST[ $option ] : '';\n $this->set_option( $option, $value );\n }\n break;\n\n case 'delete-client-secret':\n foreach ( $credentials_options as $option ) {\n $this->set_option( $option, '' );\n }\n break;\n\n case 'logout':\n $this->set_option( 'access-token', '' );\n $this->set_option( 'refresh-token', '' );\n delete_transient( 'yith-wcbk-gcal-access-token' );\n break;\n }\n }\n }", "function postGeneral(Request $request)\n {\n $validator = Validators::backendValidate($request,\"settings_general\");\n // Check the validator if there's no error\n if ($validator === true) {\n $config = Configuration::UpdateGeneral($request);\n $admin = User::changeCredentials($request);\n return response()->json([\"result\" => 'success']);\n }\n return response()->json([\"result\" => 'failed', \"errors\" => $validator->errors()->messages()]);\n }", "function bg_AddAdminSettings(){\n global $bg_optionGroup, $bg_optionName, $bg_page, $bg_sectionId, $bg_opts_apiKey;\n \n register_setting( $bg_optionGroup, $bg_optionName, 'bg_ValidateOptions' );\n add_settings_section($bg_sectionId, 'License Settings', 'bg_AddSettingsSectionHtml', $bg_page);\t\n add_settings_field($bg_opts_apiKey, 'Api Key', 'bg_AddApiKeySettingsFieldHtml', $bg_page, $bg_sectionId);\n}", "public function updraft_ajax_savesettings() {\n\t\ttry {\n\t\t\tif (empty($_POST) || empty($_POST['subaction']) || 'savesettings' != $_POST['subaction'] || !isset($_POST['nonce']) || !is_user_logged_in() || !UpdraftPlus_Options::user_can_manage() || !wp_verify_nonce($_POST['nonce'], 'updraftplus-settings-nonce')) die('Security check');\n\t\n\t\t\tif (empty($_POST['settings']) || !is_string($_POST['settings'])) die('Invalid data');\n\t\n\t\t\tparse_str(stripslashes($_POST['settings']), $posted_settings);\n\t\t\t// We now have $posted_settings as an array\n\t\t\tif (!empty($_POST['updraftplus_version'])) $posted_settings['updraftplus_version'] = $_POST['updraftplus_version'];\n\t\t\t\n\t\t\techo json_encode($this->save_settings($posted_settings));\n\t\t} catch (Exception $e) {\n\t\t\t$log_message = 'PHP Fatal Exception error ('.get_class($e).') has occurred during save settings. Error Message: '.$e->getMessage().' (Code: '.$e->getCode().', line '.$e->getLine().' in '.$e->getFile().')';\n\t\t\terror_log($log_message);\n\t\t\techo json_encode(array(\n\t\t\t\t'fatal_error' => true,\n\t\t\t\t'fatal_error_message' => $log_message\n\t\t\t));\n\t\t// @codingStandardsIgnoreLine\n\t\t} catch (Error $e) {\n\t\t\t$log_message = 'PHP Fatal error ('.get_class($e).') has occurred during save settings. Error Message: '.$e->getMessage().' (Code: '.$e->getCode().', line '.$e->getLine().' in '.$e->getFile().')';\n\t\t\terror_log($log_message);\n\t\t\techo json_encode(array(\n\t\t\t\t'fatal_error' => true,\n\t\t\t\t'fatal_error_message' => $log_message\n\t\t\t));\n\t\t}\n\t\tdie;\n\t}", "public function index()\n\t{\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\n\t\t$data['settings'] = $this->settings_model->adminSettings();\n\n\t\tif($this->input->post())\n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$this->form_validation->set_rules('default_email', 'Default Email', 'required|valid_email');\n\n\t\t\tif($this->form_validation->run())\n\t\t\t{\n\t\t\t\t$this->settings_model->updateSettings();\n\t\t\t}\n\t\t}\n\n\t\ttheme('admin_settings', $data);\n\t}", "function ecapi_admin_intercept() {\r\n\tif( $_SERVER['REQUEST_METHOD'] === 'POST' \r\n\t\t&& array_key_exists('page', $_POST) && 'ecapi-config' === $_POST['page'] ) \r\n\t\tecapi_config_page();\r\n}", "public function postProcess()\n {\n if (Tools::isSubmit('saveSettings')) {\n ConfPPM::setConf(\n 'paysto_merchant_id',\n Tools::getValue(ConfPPM::formatConfName('paysto_merchant_id'))\n );\n ConfPPM::setConf(\n 'paysto_secret',\n Tools::getValue(ConfPPM::formatConfName('paysto_secret'))\n );\n ConfPPM::setConf('server_list', Tools::getValue(ConfPPM::formatConfName('server_list')));\n ConfPPM::setConf('ip_only_from_server_list',\n Tools::getValue(ConfPPM::formatConfName('ip_only_from_server_list')));\n ConfPPM::setConf('disable_tax_shop',\n Tools::getValue(ConfPPM::formatConfName('disable_tax_shop')));\n ConfPPM::setConf('tax_delivery', Tools::getValue(ConfPPM::formatConfName('tax_delivery')));\n Tools::redirectAdmin(ToolsModulePPM::getModuleTabAdminLink() . '&conf=6');\n }\n }", "function handle_options()\r\n {\r\n $options = $this->get_options();\r\n \r\n if (isset($_POST['submitted'])) {\r\n \t\t\r\n \t\t//check security\r\n \t\tcheck_admin_referer('snazzy-nonce');\r\n \t\t\r\n $options = array();\r\n \r\n $options['years'] = htmlspecialchars($_POST['years']);\r\n $options['mini'] = $_POST['mini'];\r\n $options['posts'] = $_POST['posts'];\r\n $options['pages'] = $_POST['pages'];\r\n \r\n update_option($this->db_option, $options);\r\n \r\n echo '<div class=\"updated fade\"><p>Plugin settings saved.</p></div>';\r\n }\r\n \r\n $layout = $options['layout'];\r\n $years = stripslashes($options['years']);\r\n $mini = $options['mini'] == 'on' ? 'checked' : '';\r\n $posts = $options['posts'] == 'on' ? 'checked' : '';\r\n $pages = $options['pages'] == 'on' ? 'checked' : '';\r\n \r\n // URL for form submit, equals our current page\r\n $action_url = $_SERVER['REQUEST_URI'];\r\n \r\n include('snazzy-archives-options.php');\r\n }", "function mindscope_webint_api_handle_save() \r\n{\r\n $url = (!empty($_POST[\"api_url\"])) ? $_POST[\"api_url\"] : NULL;\r\n $account_id = (!empty($_POST[\"api_account_id\"])) ? $_POST[\"api_account_id\"] : NULL;\r\n $key = (!empty($_POST[\"api_key\"])) ? $_POST[\"api_key\"] : NULL;\r\n $job_desc_page = (!empty($_POST[\"api_job_desc_page\"])) ? $_POST[\"api_job_desc_page\"] : NULL;\r\n $job_app_page = (!empty($_POST[\"api_job_app_page\"])) ? $_POST[\"api_job_app_page\"] : NULL;\r\n $recaptcha_site_key = (!empty($_POST[\"recaptcha_site_key\"])) ? $_POST[\"recaptcha_site_key\"] : NULL;\r\n $recaptcha_site_secret = (!empty($_POST[\"recaptcha_site_secret\"])) ? $_POST[\"recaptcha_site_secret\"] : NULL;\r\n $company_name = (!empty($_POST[\"company_name\"])) ? $_POST[\"company_name\"] : NULL;\r\n $website_url = (!empty($_POST[\"website_url\"])) ? $_POST[\"website_url\"] : NULL;\r\n $logo_url = (!empty($_POST[\"logo_url\"])) ? $_POST[\"logo_url\"] : NULL;\r\n $auth_filename = (!empty($_POST[\"auth_filename\"])) ? $_POST[\"auth_filename\"] : NULL;\r\n $sitemap_url = (!empty($_POST[\"sitemap_url\"])) ? $_POST[\"sitemap_url\"] : NULL;\r\n \r\n // Update the values\r\n update_option( \"mindscope_webtint_api_url\", $url, TRUE );\r\n update_option( \"mindscope_webtint_api_accountid\", $account_id, TRUE );\r\n update_option( \"mindscope_webtint_api_key\", $key, TRUE );\r\n update_option( \"mindscope_webint_api_job_desc_page\", $job_desc_page, TRUE );\r\n update_option( \"mindscope_webint_api_job_app_page\", $job_app_page, TRUE );\r\n update_option( \"mindscope_webtint_api_recaptcha_site_key\", $recaptcha_site_key, TRUE );\r\n update_option( \"mindscope_webtint_api_recaptcha_site_secret\", $recaptcha_site_secret, TRUE );\r\n update_option( \"mindscope_webint_api_company_name\", $company_name, TRUE );\r\n update_option( \"mindscope_webint_api_website_url\", $website_url, TRUE );\r\n update_option( \"mindscope_webint_api_logo_url\", $logo_url, TRUE );\r\n update_option( \"mindscope_webint_api_google_auth_filename\", $auth_filename, TRUE );\r\n update_option( \"mindscope_webint_api_sitemap_url\", $sitemap_url, TRUE );\r\n \r\n // Redirect back to settings page\r\n // The ?page=github corresponds to the \"slug\" \r\n // set in the fourth parameter of add_submenu_page() above.\r\n $redirect_url = get_bloginfo(\"url\") . \"/wp-admin/options-general.php?page=mindscope-webint-api&status=success\";\r\n header(\"Location: \".$redirect_url);\r\n exit;\r\n}", "public function handleDataSubmission() {}", "public function pluginSettingsPage()\n {\n // check permission.\n if (!current_user_can('manage_options')) {\n wp_die(__('You do not have permission to access this page.'));\n }\n\n // load config values to get settings config file.\n $loader = new \\RundizableWpFeatures\\App\\Libraries\\Loader();\n $config_values = $loader->loadConfig();\n if (is_array($config_values) && array_key_exists('rundiz_settings_config_file', $config_values)) {\n $settings_config_file = $config_values['rundiz_settings_config_file'];\n } else {\n echo 'Settings configuration file was not set.';\n die('Settings configuration file was not set.');\n exit;\n }\n unset($config_values, $loader);\n\n $RundizSettings = new \\RundizableWpFeatures\\App\\Libraries\\RundizSettings();\n $RundizSettings->settings_config_file = $settings_config_file;\n\n $options_values = $this->getOptions();\n\n // if form submitted\n if (isset($_POST) && !empty($_POST)) {\n if (!wp_verify_nonce((isset($_POST['_wpnonce']) ? $_POST['_wpnonce'] : ''))) {\n wp_nonce_ays('-1');\n }\n\n // populate form field values.\n $options_values = $RundizSettings->getSubmittedData();\n\n // you may validate form here first.\n // then save data.\n $result = $this->saveOptions($options_values);\n\n if ($result === true) {\n $output['form_result_class'] = 'notice-success';\n $output['form_result_msg'] = __('Settings saved.');\n } else {\n $output['form_result_class'] = 'notice-success';\n $output['form_result_msg'] = __('Settings saved.');\n }\n }// endif $_POST\n\n $output['settings_page'] = $RundizSettings->getSettingsPage($options_values);\n unset($RundizSettings, $options_values);\n\n $Loader = new \\RundizableWpFeatures\\App\\Libraries\\Loader();\n $Loader->loadView('admin/settings_v', $output);\n unset($Loader, $output);\n }", "private function process_adminpanel_actions() {\n\n\t\tif(is_admin()) {\n\t\t\t\n\t\t\trequire_once($this->get_plugin_path() . 'settings-panel.php');\n\t\t\t\n\t\t\t// the settings page has detected an error and asked to abort\n\t\t\tif( isset($_POST['wpudisable']) && check_ajax_referer( 'wp-united-disable') ) {\n\t\t\t\t$this->ajax_auto_disable();\n\t\t\t}\t\n\n\t\t\t// the user wants to manually disable\n\t\t\tif( isset($_POST['wpudisableman']) && check_ajax_referer( 'wp-united-disable') ) {\n\t\t\t\t$this->ajax_manual_disable();\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tif($this->is_working() && is_object($this->extras)) {\n\t\t\t\t$this->extras->admin_load_actions();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public function admin_ajax() {\n\n\t\t// Check Nonce\n\t\tif ( ! isset( $_REQUEST['nonce'] ) || ! isset( $_REQUEST['reqID'] ) ) {\n\t\t\tdie(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t'msg' => __( 'Security Error!', 'publisher' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$_nonce = wp_verify_nonce( $_REQUEST['nonce'], 'bf_nonce' );\n\n\t\t// Check Nonce\n\t\tif ( $_nonce === false ) {\n\t\t\tdie(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t'msg' => __( 'Security Error!', 'publisher' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\ttry {\n\n\t\t\tswitch ( $_REQUEST['reqID'] ) {\n\n\t\t\t\t// Option Panel, Save Settings\n\t\t\t\tcase( 'save_admin_panel_options' ):\n\n\t\t\t\t\t$options = bf_parse_str( ltrim( rtrim( stripslashes( $_REQUEST['data'] ), '&' ), '&' ) );\n\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'id' => $_REQUEST['panelID'],\n\t\t\t\t\t\t'lang' => $_REQUEST['lang'],\n\t\t\t\t\t\t'data' => $options\n\t\t\t\t\t);\n\n\t\t\t\t\tdo_action( 'better-framework/panel/save', $data );\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Ajax Image Uploader\n\t\t\t\tcase( 'image_upload' ):\n\t\t\t\t\t$data = $_FILES[ $_REQUEST['file_id'] ];\n\t\t\t\t\tdo_action( 'better-framework/panel/image-upload', $data, $_REQUEST['file_id'] );\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Add Custom Icon\n\t\t\t\tcase( 'add_custom_icon' ):\n\t\t\t\t\tdo_action( 'better-framework/icons/add-custom-icon', $_REQUEST['icon'] );\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Remove Custom Icon\n\t\t\t\tcase( 'remove_custom_icon' ):\n\t\t\t\t\tdo_action( 'better-framework/icons/remove-custom-icon', $_REQUEST['icon'] );\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Option Panel, Reset Settings\n\t\t\t\tcase( 'reset_options_panel' ):\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Fires for handling panel reset\n\t\t\t\t\t *\n\t\t\t\t\t * @param string $args reset panel data\n\t\t\t\t\t *\n\t\t\t\t\t * @since 1.0.0\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tdo_action( 'better-framework/panel/reset', array(\n\t\t\t\t\t\t'id' => $_REQUEST['panelID'],\n\t\t\t\t\t\t'lang' => $_REQUEST['lang'],\n\t\t\t\t\t\t'options' => $_REQUEST['to_reset']\n\t\t\t\t\t) );\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Option Panel, Ajax Action\n\t\t\t\tcase( 'ajax_action' ):\n\n\t\t\t\t\t$callback = isset( $_REQUEST['callback'] ) ? $_REQUEST['callback'] : '';\n\n\t\t\t\t\t$args = isset( $_REQUEST['args'] ) ? $_REQUEST['args'] : '';\n\n\t\t\t\t\t$error_message = isset( $_REQUEST['error-message'] ) ? $_REQUEST['error-message'] : __( 'An error occurred while doing action.', 'publisher' );\n\n\t\t\t\t\t//Security issue fix\n\t\t\t\t\tif ( empty( $_REQUEST['bf_call_token'] ) || self::callback_token( $callback ) !== $_REQUEST['bf_call_token'] ) {\n\n\t\t\t\t\t\techo json_encode(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t\t\t\t'msg' => __( 'the security token is not valid!', 'publisher' )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! empty( $callback ) && is_callable( $callback ) ) {\n\n\t\t\t\t\t\tif ( is_array( $args ) ) {\n\n\t\t\t\t\t\t\t$to_return = call_user_func_array( $callback, $args );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$to_return = call_user_func( $callback, $args );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( is_array( $to_return ) ) {\n\t\t\t\t\t\t\techo json_encode( $to_return );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo json_encode(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t\t\t\t\t'msg' => $error_message\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo json_encode(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t\t\t\t'msg' => $error_message\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\tbreak;\n\n\t\t\t\t// Option Panel, Ajax Field\n\t\t\t\tcase( 'ajax_field' ):\n\n\t\t\t\t\tif ( isset( $_REQUEST['callback'] ) && is_callable( $_REQUEST['callback'] ) ) {\n\n\t\t\t\t\t\t$cb = $_REQUEST['callback'];\n\n\t\t\t\t\t\t$cb_args = array(\n\t\t\t\t\t\t\t! empty( $_REQUEST['key'] ) ? $_REQUEST['key'] : '',\n\t\t\t\t\t\t\t! empty( $_REQUEST['exclude'] ) ? $_REQUEST['exclude'] : ''\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$to_return = call_user_func_array( $cb, $cb_args );\n\n\t\t\t\t\t\tif ( is_array( $to_return ) ) {\n\t\t\t\t\t\t\techo count( $to_return ) === 0 ? - 1 : json_encode( $to_return );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Option Panel, Import Settings\n\t\t\t\tcase( 'import' ):\n\n\t\t\t\t\t$data = $_FILES['bf-import-file-input'];\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Fires for handling panel import\n\t\t\t\t\t *\n\t\t\t\t\t * @param string $data contain import file data\n\t\t\t\t\t * @param string $args contain import arguments\n\t\t\t\t\t *\n\t\t\t\t\t * @since 1.1.0\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tdo_action( 'better-framework/panel/import', $data, $_REQUEST );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'fetch-deferred-field':\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! empty( $_REQUEST['sectionID'] ) &&\n\t\t\t\t\t\t! empty( $_REQUEST['panelID'] ) &&\n\t\t\t\t\t\tis_string( $_REQUEST['sectionID'] )\n\t\t\t\t\t) { // panel field\n\n\t\t\t\t\t\tdo_action( 'better-framework/panel/ajax-panel-field', $_REQUEST['panelID'], $_REQUEST['sectionID'] );\n\t\t\t\t\t} elseif ( ! empty( $_REQUEST['sectionID'] ) &&\n\t\t\t\t\t ! empty( $_REQUEST['metabox'] ) &&\n\t\t\t\t\t ! empty( $_REQUEST['metabox_id'] ) &&\n\t\t\t\t\t is_string( $_REQUEST['sectionID'] )\n\t\t\t\t\t) { // metabox field\n\n\t\t\t\t\t\t$type = isset( $_REQUEST['type'] ) ? $_REQUEST['type'] : '';\n\t\t\t\t\t\t$object_id = isset( $_REQUEST['object_id'] ) ? $_REQUEST['object_id'] : '';\n\n\n\t\t\t\t\t\tif ( $type === 'taxonomy' ) {\n\n\t\t\t\t\t\t\t$hook = 'better-framework/taxonomy/metabox/ajax-tab';\n\n\t\t\t\t\t\t} elseif ( $type === 'users' ) {\n\n\t\t\t\t\t\t\t$hook = 'better-framework/user-metabox/ajax-tab';\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$hook = 'better-framework/metabox/ajax-tab';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdo_action( $hook, $_REQUEST['sectionID'], $_REQUEST['metabox_id'], $object_id );\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'fetch-mce-view-fields':\n\n\t\t\t\t\tif ( ! empty( $_REQUEST['shortcode'] ) ) {\n\n\t\t\t\t\t\tdo_action( 'better-framework/shortcodes/tinymce-fields', wp_unslash( $_REQUEST['shortcode'] ), $_REQUEST );\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'fetch-mce-view-shortcode':\n\n\t\t\t\t\tif ( ! empty( $_REQUEST['shortcodes'] ) ) {\n\t\t\t\t\t\tdo_action( 'better-framework/shortcodes/tinymce-view-shortcode', wp_unslash( $_REQUEST['shortcodes'] ), $_REQUEST );\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'term_select_items':\n\n\n\t\t\t\t\tif ( ! empty( $_REQUEST['data'] ) ) {\n\n\t\t\t\t\t\tdo_action( 'better-framework/fields/term-select-items', $_REQUEST['data'] );\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'field_template':\n\n\t\t\t\t\t/**\n\t\t\t\t\t * @var BF_Assets_Manager\n\t\t\t\t\t */\n\t\t\t\t\tif ( ! empty( $_REQUEST['field'] ) ) {\n\n\t\t\t\t\t\t$template = apply_filters( 'better-framework/fields/ajax-load-template', '', $_REQUEST['field'] );\n\n\t\t\t\t\t\twp_send_json_success( $template );\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\n\t\t\t$result = array(\n\t\t\t\t'error_message' => $e->getMessage(),\n\t\t\t\t'error_code' => $e->getCode(),\n\t\t\t\t'is_error' => true,\n\t\t\t);\n\n\t\t\techo json_encode( compact( 'result' ) );\n\t\t}\n\n\t\tdie;\n\t}", "function skcw_request_handler() {\n\tif (current_user_can('manage_options') && !empty($_POST['sk_action'])) {\n\t\tswitch ($_POST['sk_action']) {\n\t\t\tcase 'update_code_widget':\n\t\t\t\tif (check_admin_referer('skcw_update_settings')) {\n\t\t\t\t\tupdate_option('skcw_template_directory', stripslashes($_POST['skcw_template_directory']));\n\t\t\t\t\twp_redirect(admin_url('options-general.php?page=code-to-widget&skcw_message=updated'));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\twp_redirect(admin_url('options-general.php?page=code-to-widget&skcw_message=failure'));\n\t\t\t\t}\n\t\t\t\tdie();\n\t\t\t\tbreak;\n\t\t\tcase 'check_directory':\n\t\t\t\tif (!empty($_POST['directory'])) {\n\t\t\t\t\techo intval(skcw_check_directory(stripslashes($_POST['directory'])));\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t\techo intval(false);\n\t\t\t\tdie();\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "function run_user_action() {\n\tglobal $wpdb;\n\n if ( ! empty( $_POST['delete_data'])) {\n clean_out_dictionary_data();\n }\n if ( ! empty( $_POST['save_settings'])) {\n \tupdate_option(\"publicationStatus\", $_POST['publicationStatus']);\n \tupdate_option(\"include_partial_words\", $_POST['include_partial_words']);\n \t$displaySubentriesAsMainEntries = 'no';\n \tif(isset($_POST['DisplaySubentriesAsMainEntries']))\n \t{\n \t\t$displaySubentriesAsMainEntries = 1;\n \t}\n \tupdate_option(\"DisplaySubentriesAsMainEntries\", $displaySubentriesAsMainEntries);\n \tupdate_option(\"languagecode\", $_POST['languagecode']);\n \tupdate_option(\"vernacular_alphabet\", $_POST['vernacular_alphabet']);\n \t\n \t$IncludeCharactersWithDiacritics = 'no';\n \tif(isset($_POST['IncludeCharactersWithDiacritics']))\n \t{\n \t\t$IncludeCharactersWithDiacritics = 1;\n \t}\n \tupdate_option(\"IncludeCharactersWithDiacritics\", $IncludeCharactersWithDiacritics);\n \t\n \tupdate_option(\"reversal1_langcode\", $_POST['reversal1_langcode']);\n \tupdate_option(\"reversal1_alphabet\", $_POST['reversal1_alphabet']);\n \tupdate_option(\"reversal2_alphabet\", $_POST['reversal2_alphabet']);\n \tupdate_option(\"reversal2_langcode\", $_POST['reversal2_langcode']);\n\n \tif(trim(strlen($_POST['txtVernacularName'])) == 0)\n \t{\n \t\techo \"<br><span style=\\\"color:red\\\">Please fill out the textfields for the language names, as they will appear in a dropdown below the searcbhox.</span><br>\";\n \t}\n\n \t$arrLanguages[0]['name'] = \"txtVernacularName\";\n \t$arrLanguages[0]['code'] = \"languagecode\";\n \t$arrLanguages[1]['name'] = \"txtReversalName\";\n \t$arrLanguages[1]['code'] = \"reversal_langcode\";\n \t$arrLanguages[2]['name'] = \"txtReversal2Name\";\n \t$arrLanguages[2]['code'] = \"reversal2_langcode\";\n\n \tforeach($arrLanguages as $language)\n \t{\n \t\tif(strlen(trim($_POST[$language['code']])) != 0)\n \t\t{\n\t\t \t$sql = \"INSERT INTO $wpdb->terms (name,slug) VALUES ('\" . $_POST[$language['name']] . \"','\" . $_POST[$language['code']] . \"')\n\t\t \t\tON DUPLICATE KEY UPDATE name = '\" . $_POST[$language['name']] . \"'\";\n\n\t\t \t$wpdb->query( $sql );\n\n\t\t \t$lastid = $wpdb->insert_id;\n\n\t\t \tif($lastid != 0)\n\t\t \t{\n\t\t\t \t$sql = \"INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy,description,count) VALUES (\" . $lastid . \", 'sil_writing_systems', '\" . $_POST[$language['name']] . \"',999999)\n\t\t\t \t\tON DUPLICATE KEY UPDATE description = '\" . $_POST[$language['name']] . \"'\";\n\n\t\t \t\t$wpdb->query( $sql );\n\t\t \t}\n \t\t}\n \t}\n\n \techo \"<br>\" . _e('Settings saved');\n }\n}", "public function handleUserEntry()\n {\n $sessionClass = ReporticoSession();\n\n // First look for a parameter beginning \"submit_\". This will identify\n // What the user wanted to do.\n\n $hide_area = false;\n $show_area = false;\n $maintain_sql = false;\n $xmlsavefile = false;\n $xmldeletefile = false;\n if (($k = $this->getMatchingPostItem(\"/^submit_/\"))) {\n // Strip off \"_submit\"\n preg_match(\"/^submit_(.*)/\", $k, $match);\n\n // Now we should be left with a field element and an action\n // Lets strip the two\n $match1 = preg_split('/_/', $match[0]);\n $fld = $match1[1];\n $action = $match1[2];\n\n switch ($action) {\n case \"ADD\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->addMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"DELETE\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->deleteMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"MOVEUP\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->moveupMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"MOVEDOWN\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->movedownMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"SET\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->updateMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"REPORTLINK\":\n case \"REPORTLINKITEM\":\n // Link in an item from another report\n $this->linkInReportFields(\"link\", $fld, $action);\n $show_area = $fld;\n break;\n\n case \"REPORTIMPORT\":\n case \"REPORTIMPORTITEM\":\n // Link in an item from another report\n $this->linkInReportFields(\"import\", $fld, $action);\n $show_area = $fld;\n break;\n\n case \"SAVE\":\n $xmlsavefile = $this->query->xmloutfile;\n if (!$xmlsavefile) {\n trigger_error(ReporticoLang::templateXlate(\"UNABLE_TO_SAVE\") . ReporticoLang::templateXlate(\"SPECIFYXML\"), E_USER_ERROR);\n }\n\n break;\n\n case \"PREPARESAVE\":\n $xmlsavefile = $this->query->xmloutfile;\n $sessionClass::setReporticoSessionParam(\"execute_mode\", \"PREPARE\");\n\n if (!$xmlsavefile) {\n header(\"HTTP/1.0 404 Not Found\", true);\n echo '<div class=\"reportico-error-box\">' . ReporticoLang::templateXlate(\"UNABLE_TO_SAVE\") . ReporticoLang::templateXlate(\"SPECIFYXML\") . \"</div>\";\n die;\n }\n\n break;\n\n case \"DELETEREPORT\":\n $xmldeletefile = $this->query->xmloutfile;\n break;\n\n case \"HIDE\":\n $hide_area = $fld;\n break;\n\n case \"SHOW\":\n $show_area = $fld;\n break;\n\n case \"SQL\":\n $show_area = $fld;\n if ($fld == \"mainquerqury\") {\n // Main Query SQL Generation.\n $sql = stripslashes($_REQUEST[\"mainquerqury_SQL\"]);\n\n $maintain_sql = $sql;\n if (Authenticator::login()) {\n $p = new SqlParser($sql);\n if ($p->parse()) {\n $p->importIntoQuery($qr);\n if ($this->query->datasource->connect()) {\n $p->testQuery($this->query, $sql);\n }\n\n }\n }\n } else {\n // It's a lookup\n if (preg_match(\"/mainquercrit(.*)qury/\", $fld, $match1)) {\n $lookup = (int) $match1[1];\n $lookup_char = $match1[1];\n\n // Access the relevant crtieria item ..\n $qc = false;\n $ak = array_keys($this->query->lookup_queries);\n if (array_key_exists($lookup, $ak)) {\n $q = $this->query->lookup_queries[$ak[$lookup]]->lookup_query;\n } else {\n $q = new Reportico();\n }\n\n // Parse the entered SQL\n $sqlparm = $fld . \"_SQL\";\n $sql = $_REQUEST[$sqlparm];\n $q->maintain_sql = $sql;\n $q = new Reportico();\n $p = new SqlParser($sql);\n if ($p->parse()) {\n if ($p->testQuery($this->query, $sql)) {\n $p->importIntoQuery($q);\n $this->query->setCriteriaLookup($ak[$lookup], $q, \"WHAT\", \"NOW\");\n }\n }\n }\n }\n\n break;\n\n }\n }\n\n // Now work out what the maintainance screen should be showing by analysing\n // whether user pressed a SHOW button a HIDE button or keeps a maintenance item\n // show by presence of a shown value\n if (!$show_area) {\n // User has not pressed SHOW_ button - this would have been picked up in previous submit\n // So look for longest shown item - this will allow us to draw the maintenace screen with\n // the correct item maximised\n foreach ($_REQUEST as $k => $req) {\n if (preg_match(\"/^shown_(.*)/\", $k, $match)) {\n $containee = \"/^\" . $hide_area . \"/\";\n $container = $match[1];\n if (!preg_match($containee, $container)) {\n if (strlen($match[1]) > strlen($show_area)) {\n $show_area = $match[1];\n }\n }\n }\n }\n\n }\n\n if (!$show_area) {\n $show_area = \"mainquer\";\n }\n\n $xmlout = new XmlWriter($this->query);\n $xmlout->prepareXmlData();\n\n // If Save option has been used then write data to the named file and\n // use this file as the defalt input for future queries\n if ($xmlsavefile) {\n if ($this->query->allow_maintain != \"SAFE\" && $this->query->allow_maintain != \"DEMO\" && ReporticoApp::getConfig('allow_maintain')) {\n $xmlout->writeFile($xmlsavefile);\n $sessionClass::setReporticoSessionParam(\"xmlin\", $xmlsavefile);\n $sessionClass::unsetReporticoSessionParam(\"xmlintext\");\n } else {\n trigger_error(ReporticoLang::templateXlate(\"SAFENOSAVE\"), E_USER_ERROR);\n }\n\n }\n\n // If Delete Report option has been used then remove the file\n // use this file as the defalt input for future queries\n if ($xmldeletefile) {\n if ($this->query->allow_maintain != \"SAFE\" && $this->query->allow_maintain != \"DEMO\" && ReporticoApp::getConfig('allow_maintain')) {\n $xmlout->removeFile($xmldeletefile);\n $sessionClass::setReporticoSessionParam(\"xmlin\", false);\n $sessionClass::unsetReporticoSessionParam(\"xmlintext\");\n } else {\n trigger_error(ReporticoLang::templateXlate(\"SAFENODEL\"), E_USER_ERROR);\n }\n\n }\n\n $xml = $xmlout->getXmldata();\n $this->query->xmlintext = $xml;\n\n $this->query->xmlin = new XmlReader($this->query, false, $xml);\n $this->query->xmlin->show_area = $show_area;\n $this->query->maintain_sql = false;\n }", "public function admin_init() {\n\n\t\t// set the settings\n\n\t\t$this->setting_api->set_sections( $this->get_settings_sections());\n\t\t$this->setting_api->set_fields( $this->get_settings_fields() );\n\n\t\t// initialize settings\n\t\t$this->setting_api->admin_init();\n\t}", "function nrelate_admin_do_page() { ?> \n\n\t\t<div id=\"nr-admin-settings\" class=\"postbox\">\n\t\t\t<h3 class=\"hndle\"><span><?php _e('Common settings for all nrelate products:')?></span></h3>\n\t\t\t\t<ul class=\"inside\">\n\t\t\t\t\t<?php $connectionstatus = update_nrelate_admin_data();\n\t\t\t\t\tif($connectionstatus !=\"Success\"){\n\t\t\t\t\t\techo \"<h1 style='color:red;font-size:16px;'>\".$connectionstatus.\"</h1>\";\n\t\t\t\t\t} ?>\n\t\t\t\t\t<form name=\"settings\" action=\"options.php\" method=\"post\" enctype=\"multipart/form-action\">\n\t\t\t\t\t\t<?php settings_fields('nrelate_admin_options'); ?>\n\t\t\t\t\t\t<?php do_settings_sections(__FILE__);?>\n\t\t\t\t\t\t<p class=\"submit\">\n\t\t\t\t\t\t\t<input name=\"Submit\" type=\"submit\" class=\"button-primary\" value=\"<?php esc_attr_e('Save Changes','nrelate'); ?>\" <?php echo NRELATE_API_ONLINE ? '' : 'disabled=\"disabled\" title=\"Sorry nrelate\\'s api server is not available. Please try again later\"'; ?> />\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</form>\n\t\t\t\t</ul><!-- .inside -->\n\t\t</div><!-- #nr-admin-settings -->\n\t\t<script type=\"text/javascript\">getnrcode(\"<?php echo NRELATE_BLOG_ROOT; ?>\",\"<?php echo NRELATE_LATEST_ADMIN_VERSION; ?>\",\"<?php echo get_option('nrelate_key');?>\");</script>\n<?php\n\t\n\tupdate_nrelate_admin_data();\n}", "function routes() {\n\t\t\t$route_namespace = $this->api_route . '/' . $this->api_version;\n\n\t\t\tregister_rest_route(\n\t\t\t\t$route_namespace, '/settings', array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::EDITABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'create' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::READABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'read' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_route(\n\t\t\t\t$route_namespace, '/settings/(?P<id>\\d+)', array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::READABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'read_single' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::EDITABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'update_single' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::DELETABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'delete' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_route(\n\t\t\t\t$route_namespace, '/settings/slug/(?P<slug>\\S+)', array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::READABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'read_single_by_slug' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tregister_rest_route(\n\t\t\t\t$route_namespace, '/group/(?P<slug>\\S+)', array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => \\WP_REST_Server::READABLE,\n\t\t\t\t\t\t'callback' => array( $this->settings_api, 'read_by_group' ),\n\t\t\t\t\t\t'permission_callback' => function () {\n\t\t\t\t\t\t\treturn current_user_can( 'manage_options' );\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}", "public function settings_page() {\n\n\t\t?>\n\n\t\t<div class=\"wrap schedule-a-visit-to-sherpa-settings\">\n\t\t\t\n\t\t\t<form id=\"schedule-a-visit-to-sherpa-form\" method=\"post\" action=\"options.php\">\n\t\t\t\t\n\t\t\t\t<?php echo wp_nonce_field( 'schedule_a_visit_to_sherpa_data', 'schedule_a_visit_to_sherpa_nonce' ); ?>\n\n\t\t\t\t<?php settings_fields( 'schedule_a_visit_to_sherpa_settings_section' ); ?>\n\n\t\t\t\t<?php do_settings_sections( 'schedule-a-visit-to-sherpa' ); ?>\n\t\t\t\t\n\t\t\t\t<?php submit_button(); ?>\n\n\t\t\t</form>\n\n </div>\n\n\t\t<?php\n\n\t}", "public function ajax_form_settings() {\n\n if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'swpm_form_builder_form_settings') {\n $form_id = absint($_REQUEST['form']);\n $status = isset($_REQUEST['status']) ? $_REQUEST['status'] : 'opened';\n $accordion = isset($_REQUEST['accordion']) ? $_REQUEST['accordion'] : 'general-settings';\n $current_user = wp_get_current_user();\n $user_id = $current_user->ID;\n\n $form_settings = get_user_meta($user_id, 'swpm-form-settings', true);\n\n $array = array(\n 'form_setting_tab' => $status,\n 'setting_accordion' => $accordion\n );\n\n // Set defaults if meta key doesn't exist\n if (!$form_settings || $form_settings == '') {\n $meta_value[$form_id] = $array;\n\n update_user_meta($user_id, 'swpm-form-settings', $meta_value);\n } else {\n $form_settings[$form_id] = $array;\n\n update_user_meta($user_id, 'swpm-form-settings', $form_settings);\n }\n }\n\n die(1);\n }", "public function process_admin_options() {\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_enabled'] ) ) update_option( 'jigoshop_tgm_custom_gateway_enabled', jigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_enabled'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_enabled' );\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_title'] ) ) update_option( 'jigoshop_tgm_custom_gateway_title', jigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_title'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_title' );\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_description'] ) ) update_option( 'jigoshop_tgm_custom_gateway_description', \tjigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_description'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_description' );\n \t}", "public function save_settings_fields() {\n\n\t\t\tif ( isset( $_POST[ $this->setting_field_prefix ] ) ) {\n\t\t\t\tif ( ( isset( $_POST[ $this->setting_field_prefix ]['nonce'] ) ) && ( wp_verify_nonce( $_POST[ $this->setting_field_prefix ]['nonce'], 'learndash_permalinks_nonce' ) ) ) {\n\n\t\t\t\t\t$post_fields = $_POST[ $this->setting_field_prefix ];\n\n\t\t\t\t\tif ( ( isset( $post_fields['courses'] ) ) && ( ! empty( $post_fields['courses'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['courses'] = $this->esc_url( $post_fields['courses'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['lessons'] ) ) && ( ! empty( $post_fields['lessons'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['lessons'] = $this->esc_url( $post_fields['lessons'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['topics'] ) ) && ( ! empty( $post_fields['topics'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['topics'] = $this->esc_url( $post_fields['topics'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['quizzes'] ) ) && ( ! empty( $post_fields['quizzes'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['quizzes'] = $this->esc_url( $post_fields['quizzes'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['nested_urls'] ) ) && ( ! empty( $post_fields['nested_urls'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['nested_urls'] = $this->esc_url( $post_fields['nested_urls'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// We check the Course Options > Course Builder setting. If this is set to 'yes' then we MUST keep the nested URLs set to true.\n\t\t\t\t\t\tif ( ! isset( $this->setting_option_values['nested_urls'] ) ) {\n\t\t\t\t\t\t\t$this->setting_option_values['nested_urls'] = 'no';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( 'yes' !== $this->setting_option_values['nested_urls'] ) {\n\t\t\t\t\t\t\t$learndash_settings_courses_builder = get_option( 'learndash_settings_courses_management_display', array() );\n\t\t\t\t\t\t\tif ( ! isset( $learndash_settings_courses_builder['course_builder_shared_steps'] ) ) {\n\t\t\t\t\t\t\t\t$learndash_settings_courses_builder['course_builder_shared_steps'] = 'no';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( 'yes' === $learndash_settings_courses_builder['course_builder_shared_steps'] ) {\n\t\t\t\t\t\t\t\t$this->setting_option_values['nested_urls'] = 'yes';\n\n\t\t\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tupdate_option( $this->settings_section_key, $this->setting_option_values );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function admin_page_action() {\n\n\t\tif ( $this->is_admin_request_for_users_forget() ) {\n\t\t\t$this->users_forget();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_send_email() ) {\n\t\t\t$this->users_send_email();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_remove() ) {\n\t\t\t$this->users_remove_from_list();\n\t\t}\n\n\t\t/* Default settings page */\n\t\t$this->add_view_option( 'data', $this->get_all_requested_users_data( $confirmed_only = true ) );\n\n\t}", "public function save_schedule_settings() {\n //get your POST parameter\n $action = \\Drupal::request()->get('action');\n $media_kit_id = \\Drupal::request()->get('media_kit_id');\n $social_media_name = \\Drupal::request()->get('social_media_name');\n $text = \\Drupal::request()->get('text');\n $uid = \\Drupal::request()->get('uid');\n $status = \\Drupal::request()->get('status');\n $page_id = \\Drupal::request()->get('page_id');\n $ufid = \\Drupal::request()->get('ufid');\n $user = \\Drupal::currentUser();\n // default un-published\n $is_published = 0;\n if ($action == 'schedule') {\n // save schedule form\n $schedule_type = \\Drupal::request()->get('schedule_type');\n $manual_datetime = \\Drupal::request()->get('manual_datetime');\n //convert manual_datetime to utc timestamp\n if ($manual_datetime) {\n $date = new DrupalDateTime($manual_datetime, new \\DateTimeZone($user->getTimeZone()));\n $date->setTimezone(new \\DateTimeZone('utc'));\n $manual_datetime = strtotime($date->format('Y-m-d H:i:s'));\n }\n $result = \\Drupal::database()->merge('social_media')->key(['uid' => $uid, 'ufid' => $ufid, 'social_media_name' => $social_media_name, ])->fields(['page_id' => $page_id, 'media_kit_id' => $media_kit_id, 'status' => $status, 'is_published' => $is_published, 'text' => $text, 'schedule_type' => $schedule_type, 'scheduled_timestamp' => $manual_datetime, 'created' => time(), ])->execute();\n $output['result'] = 'done';\n } else {\n //save main form\n $scheduled_bubble = \\Drupal::request()->get('scheduled_bubble');\n $mids = $_POST['mid'];\n $sm_post_id = NULL;\n $post_data = [];\n $post_data['message'] = $text;\n $post_data['mids'] = $mids;\n $sm = \\Drupal::database()->select('social_media', 'sm')->fields('sm', ['id', 'scheduled_timestamp'])->condition('sm.uid', $uid, '=')->condition('sm.ufid', $ufid, '=')->condition('sm.social_media_name', $social_media_name, '=')->execute()->fetchObject();\n if (!empty($sm)) {\n // scheduling found so post,draft and schedule operation would take place here.\n // if status is posted immediatelly published_date\n if ($status == 'Post') {\n $user = \\Drupal::currentUser();\n $date = new DrupalDateTime('now', new \\DateTimeZone($user->getTimeZone()));\n $date->setTimezone(new \\DateTimeZone('utc'));\n $manual_datetime = strtotime($date->format('Y-m-d H:i:s'));\n if ($social_media_name == 'Facebook') {\n $post_data['scheduled_publish_time'] = 0;\n $response = $this->facebook_post_publish($page_id, $post_data, $uid);\n if (array_key_exists(\"id\", $response)) {\n $is_published = 1;\n $sm_post_id = $response['id'];\n }\n }\n if ($social_media_name == 'Twitter') {\n $response = $this->twitter_tweet_publish($post_data, $uid);\n if ($response) {\n $is_published = 1;\n $sm_post_id = $response;\n } else {\n $response_message = \"error\";\n \\Drupal::logger('Social media twitter')->error('<pre><code>' . print_r($response_message, true) . '</code></pre>');\n }\n }\n if ($social_media_name == 'Instagram') {\n $response = $this->instagram_publish_media($page_id, $post_data, $uid);\n if (array_key_exists(\"id\", $response)) {\n $is_published = 1;\n $sm_post_id = $response['id'];\n }\n }\n \\Drupal::database()->update('social_media')->fields(['page_id' => $page_id, 'text' => $text, 'status' => $status, 'media_kit_id' => $media_kit_id, 'is_published' => $is_published, 'mids' => implode(',', $mids), 'sm_post_id' => $sm_post_id, 'scheduled_timestamp' => $manual_datetime, 'scheduled_bubble' => $scheduled_bubble])->condition('uid', $uid, '=')->condition('ufID', $ufid, '=')->condition('social_media_name', $social_media_name, '=')->execute();\n } elseif ($status == 'Scheduled') {\n if ($social_media_name == 'Facebook') {\n $date = new DrupalDateTime(date('d-m-Y h:i A', $sm->scheduled_timestamp), new \\DateTimeZone('utc'));\n $date->setTimezone(new \\DateTimeZone($user->getTimeZone()));\n $user_timestamp = strtotime($date->format('Y-m-d H:i:s'));\n $post_data['scheduled_publish_time'] = $user_timestamp;\n $response = $this->facebook_post_publish($page_id, $post_data, $uid);\n if (array_key_exists(\"id\", $response)) {\n $sm_post_id = $response['id'];\n }\n }\n \\Drupal::database()->update('social_media')->fields(['page_id' => $page_id, 'text' => $text, 'status' => $status, 'media_kit_id' => $media_kit_id, 'is_published' => $is_published, 'mids' => implode(',', $mids), 'sm_post_id' => $sm_post_id, 'scheduled_bubble' => $scheduled_bubble])->condition('uid', $uid, '=')->condition('ufID', $ufid, '=')->condition('social_media_name', $social_media_name, '=')->execute();\n } else {\n \\Drupal::database()->update('social_media')->fields(['page_id' => $page_id, 'text' => $text, 'status' => $status, 'media_kit_id' => $media_kit_id, 'is_published' => $is_published, 'mids' => implode(',', $mids), 'sm_post_id' => $sm_post_id, 'scheduled_bubble' => $scheduled_bubble])->condition('uid', $uid, '=')->condition('ufID', $ufid, '=')->condition('social_media_name', $social_media_name, '=')->execute();\n }\n $output['result'] = 'done';\n } else {\n // no settings for scheduling , so draft and post operation would take place in this block\n if ($status == 'Post') {\n if ($social_media_name == 'Facebook') {\n $post_data['scheduled_publish_time'] = 0;\n $response = $this->facebook_post_publish($page_id, $post_data, $uid);\n if (array_key_exists(\"id\", $response)) {\n $is_published = 1;\n $sm_post_id = $response['id'];\n }\n }\n if ($social_media_name == 'Twitter') {\n $response = $this->twitter_tweet_publish($post_data, $uid);\n if ($response) {\n $is_published = 1;\n $sm_post_id = $response;\n } else {\n $response_message = \"error\";\n \\Drupal::logger('Social media twitter')->error('<pre><code>' . print_r($response_message, true) . '</code></pre>');\n }\n }\n if ($social_media_name == 'Instagram') {\n $response = $this->instagram_publish_media($page_id, $post_data, $uid);\n if (array_key_exists(\"id\", $response)) {\n $is_published = 1;\n $sm_post_id = $response['id'];\n }\n }\n }\n // schedule data\n $user = \\Drupal::currentUser();\n $date = new DrupalDateTime('now', new \\DateTimeZone($user->getTimeZone()));\n $date->setTimezone(new \\DateTimeZone('utc'));\n $manual_datetime = strtotime($date->format('Y-m-d H:i:s'));\n $result = \\Drupal::database()->merge('social_media')->key(['uid' => $uid, 'ufid' => $ufid, 'social_media_name' => $social_media_name, 'scheduled_bubble' => $scheduled_bubble])->fields(['page_id' => $page_id, 'media_kit_id' => $media_kit_id, 'status' => $status, 'is_published' => $is_published, 'text' => $text, 'schedule_type' => 'manual_check', 'scheduled_timestamp' => $manual_datetime, 'created' => time(), 'mids' => implode(',', $mids), 'sm_post_id' => $sm_post_id])->execute();\n $output['result'] = 'done';\n }\n }\n $json_response = json_encode($output);\n return new JsonResponse($json_response);\n }", "public function settings()\n\t{\n\t\tif(defined(\"CMS_BACKEND\"))\n\t\t{\n\t\t\tAuthUser::load();\n\t\t\tif ( ! AuthUser::isLoggedIn()) {\n\t\t\t\tredirect(get_url('login'));\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_POST['save']) && $_POST['save'] == 'Save Settings')\n\t\t\t{\n\t\t\t\tPlugin::setAllSettings($_POST['setting'], 'mbblog');\n\t\t\t\tFlash::setNow('success', __('Settings have been saved!'));\t\t \t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t$this->display('mbblog/views/admin/settings', array('settings' => Plugin::getAllSettings('mbblog')));\n\t\t} else\n\t\t{\n\t\t\tFlash::set('error', __('You do not have permission to access the requested page!'));\n\t\t\tredirect(get_url());\n\t\t}\n\t}", "function printAdminPageSettings() {\r\n \r\n wpscSupportTickets_saveSettings(); // Action hook for saving\r\n\r\n $devOptions = $this->getAdminOptions();\r\n\r\n echo '<div class=\"wrap\">';\r\n\r\n $this->adminHeader();\r\n\r\n if (@isset($_POST['update_wpscSupportTicketsSettings'])) {\r\n\r\n if (isset($_POST['wpscSupportTicketsmainpage'])) {\r\n $devOptions['mainpage'] = esc_sql($_POST['wpscSupportTicketsmainpage']);\r\n }\r\n if (isset($_POST['turnwpscSupportTicketsOn'])) {\r\n $devOptions['turnon_wpscSupportTickets'] = esc_sql($_POST['turnwpscSupportTicketsOn']);\r\n }\r\n if (isset($_POST['email'])) {\r\n $devOptions['email'] = esc_sql($_POST['email']);\r\n }\r\n if (isset($_POST['email_new_ticket_subject'])) {\r\n $devOptions['email_new_ticket_subject'] = esc_sql($_POST['email_new_ticket_subject']);\r\n }\r\n if (isset($_POST['email_new_ticket_body'])) {\r\n $devOptions['email_new_ticket_body'] = esc_sql($_POST['email_new_ticket_body']);\r\n }\r\n if (isset($_POST['email_new_reply_subject'])) {\r\n $devOptions['email_new_reply_subject'] = esc_sql($_POST['email_new_reply_subject']);\r\n }\r\n if (isset($_POST['email_new_reply_body'])) {\r\n $devOptions['email_new_reply_body'] = esc_sql($_POST['email_new_reply_body']);\r\n }\r\n if (isset($_POST['disable_inline_styles'])) {\r\n $devOptions['disable_inline_styles'] = esc_sql($_POST['disable_inline_styles']);\r\n }\r\n if (isset($_POST['allow_guests'])) {\r\n $devOptions['allow_guests'] = esc_sql($_POST['allow_guests']);\r\n }\r\n if (isset($_POST['custom_field_position'])) {\r\n $devOptions['custom_field_position'] = esc_sql($_POST['custom_field_position']);\r\n } \r\n if (isset($_POST['custom_field_frontend_position'])) {\r\n $devOptions['custom_field_frontend_position'] = esc_sql($_POST['custom_field_frontend_position']);\r\n } \r\n if (isset($_POST['use_ticket_in_email'])) {\r\n $devOptions['use_ticket_in_email'] = esc_sql($_POST['use_ticket_in_email']);\r\n } \r\n if (isset($_POST['use_reply_in_email'])) {\r\n $devOptions['use_reply_in_email'] = esc_sql($_POST['use_reply_in_email']);\r\n } \r\n if (isset($_POST['display_severity_on_create'])) {\r\n $devOptions['display_severity_on_create'] = esc_sql($_POST['display_severity_on_create']);\r\n }\r\n if(isset($_POST['email_name'])) {\r\n $devOptions['email_name'] = esc_sql($_POST['email_name']);\r\n }\r\n if(isset($_POST['hide_email_on_frontend_list'])) {\r\n $devOptions['hide_email_on_frontend_list'] = esc_sql($_POST['hide_email_on_frontend_list']);\r\n } \r\n if(isset($_POST['email_encoding'])) {\r\n $devOptions['email_encoding'] = esc_sql($_POST['email_encoding']);\r\n } \r\n if(isset($_POST['hide_email_on_support_tickets'])) {\r\n $devOptions['hide_email_on_support_tickets'] = esc_sql($_POST['hide_email_on_support_tickets']);\r\n } \r\n if(isset($_POST['enable_beta_testing'])) {\r\n $devOptions['enable_beta_testing'] = esc_sql($_POST['enable_beta_testing']);\r\n } \r\n if(isset($_POST['disable_all_emails'])) {\r\n $devOptions['disable_all_emails'] = esc_sql($_POST['disable_all_emails']);\r\n } \r\n if(isset($_POST['override_wordpress_email'])) {\r\n $devOptions['override_wordpress_email'] = esc_sql($_POST['override_wordpress_email']);\r\n }\r\n if(isset($_POST['overrides_email'])) {\r\n $devOptions['overrides_email'] = esc_sql($_POST['overrides_email']);\r\n } \r\n if(isset($_POST['custom_title'])) {\r\n $devOptions['custom_title'] = esc_sql($_POST['custom_title']);\r\n }\r\n if(isset($_POST['custom_message'])) {\r\n $devOptions['custom_message'] = esc_sql($_POST['custom_message']);\r\n } \r\n if(isset($_POST['show_login_text'])) {\r\n $devOptions['show_login_text'] = esc_sql($_POST['show_login_text']);\r\n } \r\n if(isset($_POST['override_mysql_timezone'])) {\r\n $devOptions['override_mysql_timezone'] = esc_sql($_POST['override_mysql_timezone']);\r\n }\r\n if(isset($_POST['show_advanced_options'])) {\r\n $devOptions['show_advanced_options'] = esc_sql($_POST['show_advanced_options']);\r\n }\r\n if(isset($_POST['custom_new_ticket_button_text'])) {\r\n $devOptions['custom_new_ticket_button_text'] = esc_sql($_POST['custom_new_ticket_button_text']);\r\n } \r\n \r\n if(isset($_POST['cc_all_new_tickets'])) {\r\n $devOptions['cc_all_new_tickets'] = esc_sql($_POST['cc_all_new_tickets']);\r\n } \r\n if(isset($_POST['cc_all_new_tickets_to_email'])) {\r\n $devOptions['cc_all_new_tickets_to_email'] = esc_sql($_POST['cc_all_new_tickets_to_email']);\r\n } \r\n if(isset($_POST['cc_all_user_replies'])) {\r\n $devOptions['cc_all_user_replies'] = esc_sql($_POST['cc_all_user_replies']);\r\n } \r\n if(isset($_POST['cc_all_user_replies_to_email'])) {\r\n $devOptions['cc_all_user_replies_to_email'] = esc_sql($_POST['cc_all_user_replies_to_email']);\r\n } \r\n if(isset($_POST['cc_all_admin_replies'])) {\r\n $devOptions['cc_all_admin_replies'] = esc_sql($_POST['cc_all_admin_replies']);\r\n } \r\n if(isset($_POST['cc_all_admin_replies_to_email'])) {\r\n $devOptions['cc_all_admin_replies_to_email'] = esc_sql($_POST['cc_all_admin_replies_to_email']);\r\n } \r\n if(isset($_POST['allow_search'])) {\r\n $devOptions['allow_search'] = esc_sql($_POST['allow_search']);\r\n } \r\n update_option($this->adminOptionsName, $devOptions);\r\n\r\n echo '<div class=\"updated\"><p><strong>';\r\n _e('Settings Updated.', 'wpsc-support-tickets');\r\n echo '</strong></p></div>';\r\n }\r\n\r\n echo '\r\n \r\n <script type=\"text/javascript\">\r\n jQuery(function() {\r\n jQuery( \"#wst_tabs\" ).tabs();\r\n setTimeout(function(){ jQuery(\".updated\").fadeOut(); },3000);\r\n });\r\n </script>\r\n\r\n <form method=\"post\" action=\"' , $_SERVER[\"REQUEST_URI\"] , '\">\r\n \r\n\r\n <div id=\"wst_tabs\" style=\"padding:5px 5px 0px 5px;font-size:1.1em;border-color:#DDD;border-radius:6px;\">\r\n <ul>\r\n <li><a href=\"#wst_tabs-1\">' , __('General', 'wpsc-support-tickets') , '</a></li>\r\n <li><a href=\"#wst_tabs-3\">' , __('Email', 'wpsc-support-tickets') , '</a></li>\r\n <li><a href=\"#wst_tabs-4\">' , __('Styling', 'wpsc-support-tickets') , '</a></li> \r\n <li><a href=\"#wst_tabs-5\">' , __('Guests', 'wpsc-support-tickets') , '</a></li> \r\n <li><a href=\"#wst_tabs-6\">' , __('Custom Fields', 'wpsc-support-tickets') , '</a></li> \r\n <li><a href=\"#wst_tabs-2\">' , __('PRO', 'wpsc-support-tickets') , '</a></li>\r\n </ul> \r\n \r\n \r\n <div id=\"wst_tabs-1\">\r\n\r\n <br />\r\n <h1>' , __('General', 'wpsc-support-tickets') , '</h1>\r\n <table class=\"widefat\" style=\"background:#FFF;\"><tr><td>\r\n\r\n <p><strong>' , __('Main Page', 'wpsc-support-tickets') , ':</strong> ' , __('You need to use a Page as the base for wpsc Support Tickets.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"wpscSupportTicketsmainpage\">\r\n <option value=\"\">';\r\n esc_attr(__('Select page', 'wpsc-support-tickets'));\r\n echo '</option>';\r\n\r\n $pages = get_pages();\r\n foreach ($pages as $pagg) {\r\n $option = '<option value=\"' . $pagg->ID . '\"';\r\n if ($pagg->ID == $devOptions['mainpage']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg->post_title;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n \r\n echo '\r\n </select>\r\n </p>';\r\n\r\n echo '<p><strong>' , __('Allow user to select Severity on ticket creation?', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true if you want the user to select the severity of their ticket when creating it.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"display_severity_on_create\">\r\n ';\r\n\r\n $pagesYXX[0] = 'true';\r\n $pagesYXX[1] = 'false';\r\n foreach ($pagesYXX as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['display_severity_on_create']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p> \r\n \r\n <p><strong>' , __('Show Advanced Settings?', 'wpsc-support-tickets') , ':</strong> ' , __('By default, some advanced settings are hidden that are either rarely used or that can problems. Set this to true if you want to enable Advanced Settings. Note that you will need to save your settings before any change will occur.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"show_advanced_options\">\r\n ';\r\n\r\n $pagesYXX[0] = 'true';\r\n $pagesYXX[1] = 'false';\r\n foreach ($pagesYXX as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['show_advanced_options']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p> ';\r\n\r\n if($devOptions['show_advanced_options']=='true') {\r\n \r\n echo '\r\n <p><strong>' , __('Enabled & Test Beta Features?', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true ONLY ON TEST websites. This will enable new beta features as they are released. ', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"enable_beta_testing\">\r\n ';\r\n\r\n $pagesYXX[0] = 'true';\r\n $pagesYXX[1] = 'false';\r\n foreach ($pagesYXX as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['enable_beta_testing']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p> \r\n\r\n <p style=\"padding:5px;border:1px dotted black;\">\r\n '; \r\n\r\n // New search system, now in beta \r\n if ($devOptions['enable_beta_testing'] == 'true') {\r\n echo '<br />\r\n <strong>', __('BETA', 'wpsc-support-tickets') ,': ' , __('Enable Ticket Search?', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to \"true\" to show a ticket search box on the \"Main Page\" you set. If you have \"Allow Guests\" set to \"false\" and \"Allow everyone to see all tickets\" (PRO only) set to \"false\", then search will only work for registered users and they can only search their own tickets. If you have \"Allow Guests\" set to \"true\", but \"Allow everyone to see all tickets\" (PRO only) set to \"false\", then users and guests can search, but are limited to their own tickets. If you have \"Allow Guests\" set to \"true\", and \"Allow everyone to see all tickets\" (PRO only) set to \"true\", then users and guests can search everyone\\'s tickets, making everything publicly searchable. ', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"allow_search\">\r\n ';\r\n\r\n $pagesYXX[0] = 'true';\r\n $pagesYXX[1] = 'false';\r\n foreach ($pagesYXX as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['allow_search']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n <br /><br /> '; \r\n } \r\n \r\n echo ' \r\n <img src=\"' , plugins_url() , '/wpsc-support-tickets/images/bug_report.png\" alt=\"' , __('Warning', 'wpsc-support-tickets') , '\" style=\"float:left;\" /> <strong style=\"font-size:1.2em;\">' , __('Warning', 'wpsc-support-tickets') , ' - ' , __('This may fix issues on incorrectly configured servers, but it comes at a performance cost of an additional database connection and an additional query on every page load. Generally, you should only turn this on if tickets do not change who replied last, and always say the Last Poster was the ticket creator, no matter how many times an admin makes a reply. You should not change this setting unless you believe that your PHP timezone and MySQL are not set to the same thing, as evidence by the Last Poster issue. If you turn this on when it is not needed, you will only slow down the performance of your website with no benefits. ', 'wpsc-support-tickets') , '</strong><br style=\"clear:both;\" /><br />\r\n <strong>' , __('Force Sync MySQL timezone to PHP timezone?', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true if you want to make emails come from your wpsc Support Ticket admin email below, and to change your sent from name to your Blog\\'s name.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"override_mysql_timezone\">\r\n ';\r\n\r\n $pagesY[0] = 'true';\r\n $pagesY[1] = 'false';\r\n foreach ($pagesY as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['override_mysql_timezone']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n <br />\r\n </p>';\r\n }\r\n \r\n echo '\r\n\r\n </td></tr></table>\r\n <br /><br /><br />\r\n </div>\r\n <div id=\"wst_tabs-3\"> \r\n <h1>' , __('Email', 'wpsc-support-tickets') , '</h1>\r\n <table class=\"widefat\" style=\"background:#FFF;\"><tr><td> \r\n\r\n <strong>' , __('Email', 'wpsc-support-tickets') , ':</strong> ' , __('The admin email where all new ticket &amp; reply notification emails will be sent', 'wpsc-support-tickets') , '<br /><input name=\"email\" value=\"' . $devOptions['email'] . '\" style=\"width:95%;\" /><br /><br />\r\n \r\n <strong>' , __('New Ticket Email', 'wpsc-support-tickets') , '</strong> ' , __('The subject &amp; body of the email sent to the customer when creating a new ticket.', 'wpsc-support-tickets') , '<br /><input name=\"email_new_ticket_subject\" value=\"' , stripslashes(stripslashes($devOptions['email_new_ticket_subject'])) , '\" style=\"width:95%;\" />\r\n <textarea style=\"width:95%;\" name=\"email_new_ticket_body\">' , stripslashes(stripslashes($devOptions['email_new_ticket_body'])) , '</textarea>\r\n <br /><br />\r\n \r\n <p><strong>' , __('Include the ticket in New Ticket Email', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true if you want the content of the ticket included in the new ticket email.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"use_ticket_in_email\">\r\n ';\r\n\r\n $pagesY[0] = 'true';\r\n $pagesY[1] = 'false';\r\n foreach ($pagesY as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['use_ticket_in_email']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n\r\n <strong>' , __('New Reply Email', 'wpsc-support-tickets') , '</strong> ' , __('The subject &amp; body of the email sent to the customer when there is a new reply.', 'wpsc-support-tickets') , '<br /><input name=\"email_new_reply_subject\" value=\"' , stripslashes(stripslashes($devOptions['email_new_reply_subject'])) , '\" style=\"width:95%;\" />\r\n <textarea style=\"width:95%;\" name=\"email_new_reply_body\">' , stripslashes(stripslashes($devOptions['email_new_reply_body'])) , '</textarea>\r\n <br /><br />\r\n \r\n <p><strong>' , __('Include the reply in New Reply Email', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true if you want the content of the reply included in the new reply email.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"use_reply_in_email\">\r\n ';\r\n\r\n $pagesY[0] = 'true';\r\n $pagesY[1] = 'false';\r\n foreach ($pagesY as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['use_reply_in_email']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n \r\n <p><strong>' , __('Email Charset Encoding', 'wpsc-support-tickets') , ':</strong> ' , __('You may need to change this if email text is encoding incorrectly. The default is utf-8.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"email_encoding\">\r\n ';\r\n\r\n $pagesYxxx[0] = 'utf-8';\r\n $pagesYxxx[1] = 'iso-8859-1';\r\n $pagesYxxx[2] = 'koi8-r';\r\n $pagesYxxx[3] = 'gb2312';\r\n $pagesYxxx[4] = 'big5';\r\n $pagesYxxx[5] = 'shift_jis';\r\n $pagesYxxx[5] = 'euc-jp';\r\n foreach ($pagesYxxx as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['email_encoding']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n\r\n <p><strong>' , __('Disable All Emails', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true if you want to turn off all emails from wpsc Support Tickets.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"disable_all_emails\">\r\n ';\r\n\r\n $pagesY[0] = 'true';\r\n $pagesY[1] = 'false';\r\n foreach ($pagesY as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['disable_all_emails']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n ';\r\n \r\n if ($devOptions['show_advanced_options'] == 'true') {\r\n \r\n echo '\r\n <div style=\"padding:5px;border:1px dotted black;\">\r\n <p><strong>' , __('CC All New Tickets?', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true if you want to CC the below email address on all new tickets.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"cc_all_new_tickets\">\r\n ';\r\n\r\n $pagesY[0] = 'true';\r\n $pagesY[1] = 'false';\r\n foreach ($pagesY as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['cc_all_new_tickets']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n <strong>' , __('Email Address to CC on New Tickets', 'wpsc-support-tickets') , '</strong> ' , __('When enabled, the email address to CC on new tickets.', 'wpsc-support-tickets') , '<br /><input name=\"cc_all_new_tickets_to_email\" value=\"' , $devOptions['cc_all_new_tickets_to_email'] , '\" style=\"width:95%;\" />\r\n <br /><br /> \r\n '; \r\n \r\n \r\n echo '\r\n <p><strong>' , __('CC All User Replies?', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true if you want to CC the below email address on all user replies to tickets.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"cc_all_user_replies\">\r\n ';\r\n\r\n $pagesY[0] = 'true';\r\n $pagesY[1] = 'false';\r\n foreach ($pagesY as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['cc_all_user_replies']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n <strong>' , __('Email Address to CC on All User Replies', 'wpsc-support-tickets') , '</strong> ' , __('When enabled, the email address to CC on new user replies.', 'wpsc-support-tickets') , '<br /><input name=\"cc_all_user_replies_to_email\" value=\"' , $devOptions['cc_all_user_replies_to_email'] , '\" style=\"width:95%;\" />\r\n <br /><br /> \r\n '; \r\n \r\n \r\n \r\n echo '\r\n <p><strong>' , __('CC All Admin Replies?', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true if you want to CC the below email address on all admin replies to tickets.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"cc_all_admin_replies\">\r\n ';\r\n\r\n $pagesY[0] = 'true';\r\n $pagesY[1] = 'false';\r\n foreach ($pagesY as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['cc_all_admin_replies']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n <strong>' , __('Email Address to CC on All Admin Replies', 'wpsc-support-tickets') , '</strong> ' , __('When enabled, the email address to CC on new admin replies.', 'wpsc-support-tickets') , '<br /><input name=\"cc_all_admin_replies_to_email\" value=\"' , $devOptions['cc_all_admin_replies_to_email'] , '\" style=\"width:95%;\" />\r\n <br /><br /> \r\n </div>\r\n <br /><br /> \r\n '; \r\n \r\n \r\n \r\n echo ' \r\n <p style=\"padding:5px;border:1px dotted black;\">\r\n <img src=\"' , plugins_url() , '/wpsc-support-tickets/images/bug_report.png\" alt=\"' , __('Warning', 'wpsc-support-tickets') , '\" style=\"float:left;\" /> <strong style=\"font-size:1.2em;\">' , __('Warning', 'wpsc-support-tickets') , ' - ' , __('Activating these overrides can cause registration emails to fail in some circumstances. Please double check that new users receive their registration emails after enabling this override.', 'wpsc-support-tickets') , '</strong><br style=\"clear:both;\" /><br />\r\n <strong>' , __('Override Wordpress Email Sent \"Name\" &amp; \"From\"', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true if you want to make emails come from your wpsc Support Ticket admin email below, and to change your sent from name to your Blog\\'s name.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"override_wordpress_email\">\r\n ';\r\n\r\n $pagesY[0] = 'true';\r\n $pagesY[1] = 'false';\r\n foreach ($pagesY as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['override_wordpress_email']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n <br />\r\n <strong>' , __('Override Name Sent From', 'wpsc-support-tickets') ,'</strong> ', __('The name of the admin email sender, such as \"Business Name Support Team\", or whatever is appropriate for your situation.', 'wpsc-support-tickets') ,'<br /><input name=\"email_name\" value=\"' , $devOptions['email_name'] , '\" style=\"width:95%;\" /><br /><br />\r\n <strong>' , __('Override Email Sent From', 'wpsc-support-tickets') ,'</strong> ', __('The email address that all outgoing emails will appear to be sent from.', 'wpsc-support-tickets') ,'<br /><input name=\"overrides_email\" value=\"' , $devOptions['overrides_email'] , '\" style=\"width:95%;\" /><br /><br />\r\n </p>';\r\n }\r\n \r\n echo ' \r\n </td></tr></table>\r\n <br /><br /><br />\r\n </div>\r\n <div id=\"wst_tabs-4\"> \r\n <h1>' , __('Styling', 'wpsc-support-tickets') , '</h1>\r\n <table class=\"widefat\" style=\"background:#FFF;\"><tr><td> \r\n\r\n <p><strong>' , __('Disable inline styles', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true if you want to disable the inline CSS styles.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"disable_inline_styles\">\r\n ';\r\n\r\n $pagesX[0] = 'true';\r\n $pagesX[1] = 'false';\r\n foreach ($pagesX as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['disable_inline_styles']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n\r\n\r\n </td></tr></table>\r\n <br /><br /><br />\r\n </div>\r\n <div id=\"wst_tabs-5\"> \r\n <h1>' , __('Guests', 'wpsc-support-tickets') , '</h1>\r\n <table class=\"widefat\" style=\"background:#FFF;\"><tr><td> \r\n\r\n <p><strong>' , __('Allow Guests', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true if you want Guests to be able to use the support ticket system.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"allow_guests\">\r\n ';\r\n\r\n $pagesY[0] = 'true';\r\n $pagesY[1] = 'false';\r\n foreach ($pagesY as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['allow_guests']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n \r\n <p><strong>' , __('Show guest email address in front end list', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true and a guest\\'s email address will be displayed in the ticket list.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"hide_email_on_frontend_list\">\r\n ';\r\n\r\n $pagesXn[0] = 'true';\r\n $pagesXn[1] = 'false';\r\n foreach ($pagesXn as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['hide_email_on_frontend_list']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n \r\n\r\n <p><strong>' , __('Show guest email address on support tickets', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to true and a guest\\'s email address will be displayed in support tickets.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"hide_email_on_support_tickets\">\r\n ';\r\n\r\n $pagesXnr[0] = 'true';\r\n $pagesXnr[1] = 'false';\r\n foreach ($pagesXnr as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['hide_email_on_support_tickets']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n\r\n \r\n\r\n <p><strong>' , __('Show login/register links?', 'wpsc-support-tickets') , ':</strong> ' , __('Set this to false if you do not want a link to register or login to appear when a user is not logged in.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"show_login_text\">\r\n ';\r\n\r\n $pagesXnr[0] = 'true';\r\n $pagesXnr[1] = 'false';\r\n foreach ($pagesXnr as $pagg) {\r\n $option = '<option value=\"' . $pagg . '\"';\r\n if ($pagg === $devOptions['show_login_text']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg;\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n\r\n </td></tr></table>\r\n <br /><br /><br />\r\n </div>\r\n <div id=\"wst_tabs-6\"> \r\n <h1>' , __('Custom Fields', 'wpsc-support-tickets') , '</h1>\r\n <table class=\"widefat\" style=\"background:#FFF;\"><tr><td> \r\n\r\n <p><strong>' , __('Place custom form fields', 'wpsc-support-tickets') , ':</strong> ' , __('When creating a ticket, this determines where your custom fields are placed on the ticket submission form.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"custom_field_position\">\r\n ';\r\n\r\n $pagesXX[0]['valname'] = 'before everything';$pagesXX[0]['displayname'] = __('before everything', 'wpsc-support-tickets');\r\n $pagesXX[1]['valname'] = 'before message';$pagesXX[1]['displayname'] = __('before message', 'wpsc-support-tickets');\r\n $pagesXX[2]['valname'] = 'after message';$pagesXX[2]['displayname'] = __('after message', 'wpsc-support-tickets');\r\n $pagesXX[3]['valname'] = 'after everything';$pagesXX[3]['displayname'] = __('after everything', 'wpsc-support-tickets');\r\n\r\n foreach ($pagesXX as $pagg) {\r\n $option = '<option value=\"' . $pagg['valname'] . '\"';\r\n if ($pagg['valname'] === $devOptions['custom_field_position']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg['displayname'];\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p>\r\n\r\n <p><strong>' , __('Display custom fields', 'wpsc-support-tickets') , ':</strong> ' , __('When a ticket creator views a ticket they created, this setting determines where the custom fields are placed on the page.', 'wpsc-support-tickets') , ' <br />\r\n <select name=\"custom_field_frontend_position\">\r\n ';\r\n\r\n $pagesXY[0]['valname'] = 'before everything';$pagesXY[0]['displayname'] = __('before everything', 'wpsc-support-tickets');\r\n $pagesXY[1]['valname'] = 'before message';$pagesXY[1]['displayname'] = __('before message', 'wpsc-support-tickets');\r\n $pagesXY[2]['valname'] = 'after message';$pagesXY[2]['displayname'] = __('after message &amp; replies', 'wpsc-support-tickets');\r\n\r\n foreach ($pagesXY as $pagg) {\r\n $option = '<option value=\"' . $pagg['valname'] . '\"';\r\n if ($pagg['valname'] === $devOptions['custom_field_frontend_position']) {\r\n $option .= ' selected=\"selected\"';\r\n }\r\n $option .='>';\r\n $option .= $pagg['displayname'];\r\n $option .= '</option>';\r\n echo $option;\r\n }\r\n\r\n echo '\r\n </select>\r\n </p> \r\n \r\n <strong>' , __('Change TITLE to', 'wpsc-support-tickets') , ':</strong> ' , __('By default, a user must fill out a title when submitting a ticket. This setting lets you easily change the name of the word TITLE so that you word this appropriately for your situation.', 'wpsc-support-tickets') , '<br /><input name=\"custom_title\" value=\"' . $devOptions['custom_title'] . '\" style=\"width:95%;\" /><br /><br />\r\n \r\n <strong>' , __('Change MESSAGE to', 'wpsc-support-tickets') , ':</strong> ' , __('By default, a user must fill out a message when submitting a ticket. This setting lets you easily change the name of the words YOUR MESSAGE so that you word this appropriately for your situation.', 'wpsc-support-tickets') , '<br /><input name=\"custom_message\" value=\"' . $devOptions['custom_message'] . '\" style=\"width:95%;\" /><br /><br />\r\n ';\r\n \r\n echo '<strong>' , __('Change New Ticket button text to', 'wpsc-support-tickets') , ':</strong> ' , __('By default, this button says Create a New Ticket, but here you can change it to whatever you want.', 'wpsc-support-tickets') , '<br /><input name=\"custom_new_ticket_button_text\" value=\"' . $devOptions['custom_new_ticket_button_text'] . '\" style=\"width:95%;\" /><br /><br />';\r\n \r\n echo ' \r\n\r\n <br /><br /><br /><br />\r\n </td></tr></table>\r\n\r\n\r\n </div>\r\n\r\n <div id=\"wst_tabs-2\">';\r\n\r\n wpscSupportTickets_settings(); // Action hook\r\n\r\n echo '\r\n </div>\r\n \r\n\r\n <input type=\"hidden\" name=\"update_wpscSupportTicketsSettings\" value=\"update\" />\r\n <div style=\"float:right;position:relative;top:-20px;\"> <input class=\"button-primary\" style=\"position:relative;z-index:999999;\" type=\"submit\" name=\"update_wpscSupportTicketsSettings_submit\" value=\"';\r\n _e('Update Settings', 'wpsc-support-tickets');\r\n echo'\" /></div>\r\n \r\n\r\n </div>\r\n </div>\r\n </form>\r\n \r\n\r\n ';\r\n\r\n\r\n }", "function admin_config() {\n\t\t\tglobal $wpdb, $Html, $Db, $Subscriber, $Latestpost, $wpmlCountry, $Mailinglist;\n\t\t\t\n\t\t\tdo_action('newsletters_admin_settings');\n\t\t\t\n\t\t\tif (!empty($_GET['reset']) && $_GET['reset'] == 1) {\n\t\t\t\t$this -> update_options();\n\t\t\t\t$this -> redirect($this -> url);\n\t\t\t}\n\t\t\t\n\t\t\t$method = (empty($_GET['method'])) ? false : $_GET['method'];\n\t\n\t\t\tswitch ($method) {\n\t\t\t\tcase 'managementpost'\t:\n\t\t\t\t\t$this -> get_managementpost(false, true);\n\t\t\t\t\t$msg_type = 'message';\n\t\t\t\t\t$message = __('Manage subscriptions post/page has been created', $this -> plugin_name);\n\t\t\t\t\t$this -> redirect($this -> referer, $msg_type, $message);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'checkdb'\t\t\t:\n\t\t\t\t\t$this -> check_roles();\n\t\t\t\t\t$this -> check_tables();\n\t\t\t\t\t\n\t\t\t\t\tif (!empty($this -> tablenames)) {\n\t\t\t\t\t\tforeach ($this -> tablenames as $table) {\n\t\t\t\t\t\t\t$query = \"OPTIMIZE TABLE `\" . $table . \"`\";\n\t\t\t\t\t\t\t$wpdb -> query($query);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this -> delete_option('hidedbupdate');\n\t\t\t\t\t\n\t\t\t\t\tflush_rewrite_rules();\n\t\t\t\t\t\n\t\t\t\t\t$msg_type = 'message';\n\t\t\t\t\t$message = __('All database tables have been checked and optimized.', $this -> plugin_name);\n\t\t\t\t\t$this -> redirect($this -> referer, $msg_type, $message);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'clearlpshistory'\t:\n\t\t\t\t\tif (!empty($_GET['id'])) {\n\t\t\t\t\t\t$clearquery = \"DELETE FROM \" . $wpdb -> prefix . $Latestpost -> table . \" WHERE `lps_id` = '\" . $_GET['id'] . \"'\";\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$clearquery = \"TRUNCATE TABLE \" . $wpdb -> prefix . $Latestpost -> table . \"\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($wpdb -> query($clearquery)) {\n\t\t\t\t\t\t$msg_type = 'message';\n\t\t\t\t\t\t$message = __('Latest Posts Subscription history has been cleared.', $this -> plugin_name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$msg_type = 'error';\n\t\t\t\t\t\t$message = __('Latest Posts Subscription history could not be cleared, please try again.', $this -> plugin_name);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this -> redirect($this -> referer, $msg_type, $message);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'reset'\t\t\t:\n\t\t\t\t\t$query = \"TRUNCATE TABLE `\" . $wpdb -> prefix . \"\" . $wpmlCountry -> table . \"`\";\n\t\t\t\t\t$wpdb -> query($query);\n\t\t\t\t\n\t\t\t\t\t$query = \"DELETE FROM `\" . $wpdb -> prefix . \"options` WHERE `option_name` LIKE '\" . $this -> pre . \"%';\";\n\t\t\t\t\n\t\t\t\t\tif ($wpdb -> query($query)) {\t\t\t\t\n\t\t\t\t\t\t$msg_type = 'message';\n\t\t\t\t\t\t$message = __('All configuration settings have been reset', $this -> plugin_name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$msg_type = 'error';\n\t\t\t\t\t\t$message = __('Configuration settings cannot be reset', $this -> plugin_name);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this -> redirect($Html -> retainquery('reset=1', $this -> url), $msg_type, $message);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault\t\t\t\t\t:\t\t\t\t\t\t\t\n\t\t\t\t\t//make sure that data has been posted\n\t\t\t\t\tif (!empty($_POST)) {\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t//unset values that are not required\n\t\t\t\t\t\tunset($_POST['save']);\n\t\t\t\t\t\tdelete_option('tridebugging');\n\t\t\t\t\t\t$this -> delete_option('inlinestyles');\n\t\t\t\t\t\t$this -> delete_option('themeintextversion');\n\t\t\t\t\t\t$this -> delete_option('emailarchive');\n\t\t\t\t\t\t$this -> delete_option('excerpt_settings');\n\t\t\t\t\t\t$this -> delete_option('defaulttemplate');\n\t\t\t\t\t\t$this -> delete_option('loadstyles');\n\t\t\t\t\t\t$this -> delete_option('loadscripts');\n\t\t\t\t\t\t$this -> delete_option('remove_width_height_attr');\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!empty($_FILES)) {\n\t\t\t\t\t\t\tforeach ($_FILES as $fkey => $fval) {\n\t\t\t\t\t\t\t\tswitch ($fkey) {\n\t\t\t\t\t\t\t\t\tcase 'tracking_image_file'\t\t\t:\n\t\t\t\t\t\t\t\t\t\t$tracking_image_file = $this -> get_option('tracking_image_file');\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (!empty($_POST['tracking']) && $_POST['tracking'] == \"Y\" && !empty($_POST['tracking_image']) && $_POST['tracking_image'] == \"custom\") {\n\t\t\t\t\t\t\t\t\t\t\tif (!empty($_FILES['tracking_image_file']['name'])) {\n\t\t\t\t\t\t\t\t\t\t\t\t$tracking_image_file = $_FILES['tracking_image_file']['name'];\n\t\t\t\t\t\t\t\t\t\t\t\t$tracking_image_path = $Html -> uploads_path() . DS . $this -> plugin_name . DS;\n\t\t\t\t\t\t\t\t\t\t\t\t$tracking_image_full = $tracking_image_path . $tracking_image_file;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (move_uploaded_file($_FILES['tracking_image_file']['tmp_name'], $tracking_image_full)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this -> update_option('tracking_image_file', $tracking_image_file);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this -> render_error(__('Tracking image file could not be moved from /tmp', $this -> plugin_name));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tif (empty($tracking_image_file)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this -> render_error(__('No image was specified', $this -> plugin_name));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach ($_POST as $key => $val) {\t\t\n\t\t\t\t\t\t\t$this -> update_option($key, $val);\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tswitch ($key) {\n\t\t\t\t\t\t\t\tcase 'defaulttemplate'\t\t:\n\t\t\t\t\t\t\t\t\tif (!empty($val)) {\n\t\t\t\t\t\t\t\t\t\t$this -> update_option('defaulttemplate', true);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'debugging'\t\t\t:\n\t\t\t\t\t\t\t\t\tif (!empty($val)) {\n\t\t\t\t\t\t\t\t\t\tupdate_option('tridebugging', 1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'embed'\t\t\t\t:\n\t\t\t\t\t\t\t\t\tif ($this -> language_do()) {\n\t\t\t\t\t\t\t\t\t\tif (!empty($val) && is_array($val)) {\n\t\t\t\t\t\t\t\t\t\t\tforeach ($val as $vkey => $vval) {\n\t\t\t\t\t\t\t\t\t\t\t\t$val[$vkey] = $this -> language_join($vval);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this -> update_option('embed', $val);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'excerpt_more'\t\t\t:\n\t\t\t\t\t\t\t\t\tif ($this -> language_do()) {\n\t\t\t\t\t\t\t\t\t\t$this -> update_option($key, $this -> language_join($val));\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this -> update_option($key, $val);\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'customcsscode'\t\t:\n\t\t\t\t\t\t\t\t\tif (!empty($_POST['customcss']) && $_POST['customcss'] == \"Y\") {\n\t\t\t\t\t\t\t\t\t\t$this -> update_option('customcss', \"Y\");\n\t\t\t\t\t\t\t\t\t\t$this -> update_option('customcsscode', $_POST['customcsscode']);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this -> update_option('customcss', \"N\");\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'emailarchive'\t\t\t:\n\t\t\t\t\t\t\t\t\tif (!empty($val)) {\n\t\t\t\t\t\t\t\t\t\t$this -> emailarchive_scheduling();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//update scheduling\n\t\t\t\t\t\t$this -> scheduling();\n\t $this -> pop_scheduling();\n\t $this -> optimize_scheduling();\n\t \n\t if (!empty($_POST['latestposts_updateinterval']) && $_POST['latestposts_updateinterval'] == \"Y\") {\n\t \t$this -> latestposts_scheduling();\n\t }\n\t\n\t\t\t\t\t\t$message = 6;\n\t\t\t\t\t\t$this -> redirect(admin_url('admin.php?page=' . $this -> sections -> settings), 'message', $message);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$mailinglists = $Mailinglist -> get_all('*', true);\n\t\t\t\t\t$this -> delete_all_cache('all');\n\t\t\t\t\t$this -> render_admin('settings', array('mailinglists' => $mailinglists));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "function admin_page() {\n\t\t$this->maybe_authorize();\n?>\n\t\t<div class=\"wrap ghupdate-admin\">\n\n\t\t\t<div class=\"head-wrap\">\n\t\t\t\t<?php screen_icon( 'plugins' ); ?>\n\t\t\t\t<h2><?php _e( 'Setup GitHub Updates' , 'github_plugin_updater' ); ?></h2>\n\t\t\t</div>\n\n\t\t\t<div class=\"postbox-container primary\">\n\t\t\t\t<form method=\"post\" id=\"ghupdate\" action=\"options.php\">\n\t\t\t\t\t<?php\n\t\tsettings_errors();\n\t\tsettings_fields( 'ghupdate' ); // includes nonce\n\t\tdo_settings_sections( 'github-updater' );\n?>\n\t\t\t\t</form>\n\t\t\t</div>\n\n\t\t</div>\n\t\t<?php\n\t}", "function handle_app_notifier_settings() {\n $ips = ( get_option('restriction_allowed_ips') ) ? get_option('restriction_allowed_ips') : [];\n update_option('notifier_endpoint', $_POST['endpoint']);\n update_option('enable_notification', $_POST['enable_notification']);\n update_option( 'enable_api_restriction', $_POST['enable_api_restriction'] );\n\n if ( isset( $_POST['restriction_allowed_ips'] ) && !empty( $_POST['restriction_allowed_ips'] ) ) {\n array_push($ips, $_POST['restriction_allowed_ips'] );\n update_option('restriction_allowed_ips', $ips);\n }\n wp_redirect(admin_url('/admin.php?page=notifier'));\n}", "public function settings()\r\n {\r\n if ($this->request->is('post')) {\r\n\r\n $settingsChanged = false;\r\n\r\n $userId = $this->Session->read('Auth.User.id');\r\n\r\n $this->User->id = $userId;\r\n\r\n if ($this->request->data['User']['Clear All']) {\r\n $this->User->Reminder->deleteAll(\r\n array('Reminder.user_id' => $this->Session->read('Auth.User.id'), false)\r\n );\r\n }\r\n\r\n if (!empty($this->request->data['User']['email'])) {\r\n\r\n $this->User->set($this->request->data);\r\n $this->OpauthUser->set($this->request->data);\r\n\r\n $validUser = $this->User->validates(array('fieldList' => array('email')));\r\n $validOpauth = $this->OpauthUser->validates(array('fieldList' => array('email')));\r\n\r\n if ($this->Session->read('User.authType') == 'opauth') {\r\n\r\n $this->OpauthUser->id = $userId;\r\n\r\n if ($validOpauth && $validUser) {\r\n $this->OpauthUser->saveField('email', $this->request->data['User']['email'], false);\r\n $settingsChanged = true;\r\n }\r\n\r\n } else {\r\n\r\n if ($validUser && $validOpauth) {\r\n $this->User->saveField('email', $this->request->data['User']['email'], false);\r\n $settingsChanged = true;\r\n }\r\n }\r\n }\r\n\r\n if (!empty($this->request->data['User']['password'])) {\r\n\r\n if ($this->User->saveField('password', $this->request->data['User']['password'], true)) {\r\n $settingsChanged = true;\r\n }\r\n }\r\n\r\n if ($this->request->data['User']['timezone'] !== \"empty\") {\r\n\r\n if ($this->Session->read('User.authType') == 'opauth') {\r\n\r\n $this->OpauthUser->id = $userId;\r\n\r\n if ($this->OpauthUser->saveField('timezone', $this->request->data['User']['timezone'], false)) {\r\n $this->Session->write('Auth.User.timezone', $this->request->data['User']['timezone']);\r\n $settingsChanged = true;\r\n }\r\n\r\n } else {\r\n if ($this->User->saveField('timezone', $this->request->data['User']['timezone'], true)) {\r\n $this->Session->write('Auth.User.timezone', $this->request->data['User']['timezone']);\r\n $settingsChanged = true;\r\n }\r\n }\r\n }\r\n\r\n if ($this->request->data['User']['Clear All']) {\r\n $settingsChanged = true;\r\n $this->Session->setFlash('Cleared all reminders', 'successFlash');\r\n }\r\n\r\n if ($settingsChanged) {\r\n $this->Session->setFlash('Settings Changed', 'successFlash');\r\n\r\n } else {\r\n $this->Session->setFlash('Nothing to update', 'failureFlash');\r\n }\r\n }\r\n }", "public function adsettingsAction() {\n\n //GET NAVIGATION\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_adsettings');\n\n //FORM\n $this->view->form = $form = new Sitestore_Form_Admin_Adsettings();\n\n //CHECK THAT COMMUNITY AD PLUGIN IS ENABLED OR NOT\n $communityadEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('communityad');\n if ($communityadEnabled) {\n $this->view->ismoduleenabled = $ismoduleenabled = 1;\n } else {\n $this->view->ismoduleenabled = $ismoduleenabled = 0;\n }\n\n //CHECK THAT SITESTORE DOCUMENT PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoredocument') && $ismoduleenabled) {\n $this->view->isdocumentenabled = 1;\n } else {\n $this->view->isdocumentenabled = 0;\n }\n\n //CHECK THAT SITESTORE NOTE PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorenote') && $ismoduleenabled) {\n $this->view->isnoteenabled = 1;\n } else {\n $this->view->isnoteenabled = 0;\n }\n\n //CHECK THAT SITESTORE ALBUM PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorealbum') && $ismoduleenabled) {\n $this->view->isalbumenabled = 1;\n } else {\n $this->view->isalbumenabled = 0;\n }\n\n //CHECK THAT SITESTORE VIDEO PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorevideo') && $ismoduleenabled) {\n $this->view->isvideoenabled = 1;\n } else {\n $this->view->isvideoenabled = 0;\n }\n\n //CHECK THAT SITESTORE EVENT PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoreevent') && $ismoduleenabled) {\n $this->view->iseventenabled = 1;\n } else {\n $this->view->iseventenabled = 0;\n }\n\n //CHECK THAT SITESTORE DISCUSSION PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorediscussion') && $ismoduleenabled) {\n $this->view->isdiscussionenabled = 1;\n } else {\n $this->view->isdiscussionenabled = 0;\n }\n\n //CHECK THAT SITESTORE POLL PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorepoll') && $ismoduleenabled) {\n $this->view->ispollenabled = 1;\n } else {\n $this->view->ispollenabled = 0;\n }\n\n //CHECK THAT SITESTORE REVIEW PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorereview') && $ismoduleenabled) {\n $this->view->isreviewenabled = 1;\n } else {\n $this->view->isreviewenabled = 0;\n }\n\n //CHECK THAT SITESTORE OFFER PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoreoffer') && $ismoduleenabled) {\n $this->view->isofferenabled = 1;\n } else {\n $this->view->isofferenabled = 0;\n }\n\n //CHECK THAT SITESTORE FORM PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoreform') && $ismoduleenabled) {\n $this->view->isformenabled = 1;\n } else {\n $this->view->isformenabled = 0;\n }\n\n //CHECK THAT SITESTORE INVITE PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoreinvite') && $ismoduleenabled) {\n $this->view->isinviteenabled = 1;\n } else {\n $this->view->isinviteenabled = 0;\n }\n\n //CHECK THAT SITESTORE BADGE PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorebadge') && $ismoduleenabled) {\n $this->view->isbadgeenabled = 1;\n } else {\n $this->view->isbadgeenabled = 0;\n }\n\n //CHECK THAT SITESTORE NOTE PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoremusic') && $ismoduleenabled) {\n $this->view->ismusicenabled = 1;\n } else {\n $this->view->ismusicenabled = 0;\n }\n\n //START FOR INRAGRATION WORK WITH OTHER PLUGIN.\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoreintegration') &&\n $ismoduleenabled) {\n $this->view->mixSettingsResults = Engine_Api::_()->getDbtable('mixsettings', 'sitestoreintegration')->getIntegrationItems();\n $this->view->issitestoreintegrationenabled = 1;\n } else {\n $this->view->issitestoreintegrationenabled = 0;\n }\n //END FOR INRAGRATION WORK WITH OTHER PLUGIN.\n\n //CHECK THAT SITESTORE TWITTER PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoretwitter') && $ismoduleenabled) {\n $this->view->istwitterenabled = 1;\n } else {\n $this->view->istwitterenabled = 0;\n }\n\n //CHECK THAT SITESTORE TWITTER PLUGIN IS ENABLED OR NOT\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestoremember') && $ismoduleenabled) {\n $this->view->ismemberenabled = 1;\n } else {\n $this->view->ismemberenabled = 0;\n }\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n }\n }", "function subway_settings_api_init() {\n\n\t// Add new 'Pages Visibility Settings'.\n\tadd_settings_section(\n\t\t'subway_setting_section',\n\t\t__( 'Pages Visibility Settings', 'subway' ),\n\t\t'subway_setting_section_callback_function',\n\t\t'reading'\n\t);\n\n\t// WP Options 'subway_public_post'.\n\tadd_settings_field(\n\t\t'subway_public_post',\n\t\t__( 'Public Posts IDs', 'subway' ),\n\t\t'subway_setting_callback_function',\n\t\t'reading',\n\t\t'subway_setting_section'\n\t);\n\n\t// WP Options 'subway_is_public'.\n\tadd_settings_field(\n\t\t'subway_is_public',\n\t\t__( 'Public Website', 'subway' ),\n\t\t'subway_is_public_form',\n\t\t'reading',\n\t\t'subway_setting_section'\n\t);\n\n\t// WP Options 'subway_login_page'.\n\tadd_settings_field(\n\t\t'subway_login_page',\n\t\t__( 'Login Page', 'subway' ),\n\t\t'subway_login_page_form',\n\t\t'reading',\n\t\t'subway_setting_section'\n\t);\n\n\t// WP Options 'subway_redirect_type'.\n\tadd_settings_field(\n\t\t'subway_redirect_type',\n\t\t__( 'Redirect Type', 'subway' ),\n\t\t'subway_redirect_option_form',\n\t\t'reading',\n\t\t'subway_setting_section'\n\t);\n\n\t// WP Options 'subway_bypassing_info'.\n\tadd_settings_field(\n\t\t'subway_bypassing_info',\n\t\t__( 'Bypassing Redirect', 'subway' ),\n\t\t'subway_bypassing_option_form',\n\t\t'reading',\n\t\t'subway_setting_section'\n\t);\n\n\t// Register all the callback settings id.\n\tregister_setting( 'reading', 'subway_public_post' );\n\tregister_setting( 'reading', 'subway_is_public' );\n\tregister_setting( 'reading', 'subway_login_page' );\n\tregister_setting( 'reading', 'subway_redirect_type' );\n\n\tregister_setting( 'reading', 'subway_redirect_page_id' );\n\tregister_setting( 'reading', 'subway_redirect_custom_url' );\n\n}", "public function admin_options() {\n?>\n\t\t<h3><?php _e('Authorize SIM', WC_Authorize_SIM::TEXT_DOMAIN); ?></h3>\n \t<p><?php _e('Authorize SIM works by sending the user to Authorize to enter their payment information.', WC_Authorize_SIM::TEXT_DOMAIN); ?></p>\n \t<div class=\"updated\"><p>\n \t\t<strong><?php _e('Authorize.Net config:', WC_Authorize_SIM::TEXT_DOMAIN) ?></strong>\n \t\t<?php _e( 'Please login to Authorize and go to Account >> Settings >> Response/Receipt URLs' ); ?>\n \t\t<ol>\n\t \t\t<li><?php _e( 'Click \"Add URL\", and set this value for URL textbox: ') ?><strong><?php echo $this->notify_url ?></strong></li>\n\t \t\t<li><?php _e( 'Click \"Submit\" to complete', WC_Authorize_SIM::TEXT_DOMAIN ) ?></li>\n \t\t</ol>\n \t</p></div>\n \t<table class=\"form-table\">\n \t\t<?php $this->generate_settings_html(); ?>\n\t\t</table><!--/.form-table--> \t\n<?php\n }", "public function process() {\n\t\tif ( ! WD_Utils::check_permission() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->verify_nonce( 'disable_error_display' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! is_writable( WD_Utils::retrieve_wp_config_path() ) ) {\n\t\t\twp_send_json( array(\n\t\t\t\t'status' => 0,\n\t\t\t\t'error' => __( \"Your wp-config.php isn't writable\", wp_defender()->domain )\n\t\t\t) );\n\t\t}\n\n\t\tif ( ( $res = $this->write_wp_config() ) === true ) {\n\t\t\t$this->after_processed();\n\t\t\twp_send_json( array(\n\t\t\t\t'status' => 1,\n\t\t\t\t'message' => __( \"All PHP errors are hidden.\", wp_defender()->domain )\n\t\t\t) );\n\t\t} else {\n\t\t\t$this->output_error( 'cant_writable', $res->get_error_message() );\n\t\t}\n\t}", "function sc_settings_page(){\r\n\tglobal $wpdb;\r\n\t$upload_dir = wp_upload_dir();\r\n\t$up_path = $upload_dir['basedir'].\"/\";\r\n\t\r\n\tif( $_POST['submit']==\"Update Settings\" ){\r\n\t\t\r\n\t\t$msg = '';\r\n\t\t\r\n\t\t//catch the value of the form\r\n\t\t$sc_email = strip_tags( $_POST['sc_email'] );\r\n\t\t$sc_captcha = (int)$_POST['sc_captcha'];\r\n\t\t$sc_mess_method = strip_tags( $_POST['sc_mess_method'] );\r\n\t\t$sc_thanku = strip_tags( $_REQUEST['sc_thanku'] );\r\n\t\t$sc_error = strip_tags( $_REQUEST['sc_error'] );\r\n\t\t$sc_thanku_page = (int)$_REQUEST['sc_thanku_page'];\r\n\t\t$sc_error_page = (int)$_REQUEST['sc_error_page'];\r\n\t\t$auto_res_switch = (int)$_POST['auto_res_switch'];\r\n\t\t$auto_res_sub = strip_tags( $_POST['auto_res_sub'] );\r\n\t\t$auto_res_mess = strip_tags( $_POST['auto_res_mess'] );\r\n\t\t$sc_file_path = strip_tags( $_REQUEST['sc_file_path'] );\r\n\t\t\r\n\t\t$lead_id = strip_tags( $_POST['lead_id'] );\r\n\t\t$lead_lang = trim( strip_tags( $_REQUEST['lead_lang'] ) );\r\n\t\t$lead_format = strip_tags( $_REQUEST['lead_format'] );\r\n\t\t$lead_color = strip_tags( $_REQUEST['lead_color'] );\r\n\t\t$lead_label = strip_tags( $_REQUEST['lead_label'] );\r\n\t\t$lead_value = (float)strip_tags( $_POST['lead_value'] );\r\n\t\t\r\n\t\t$sc_bar_color = strip_tags( $_POST['sc_bar_color'] );\r\n\t\t$sc_bar_radius = (int)$_POST['sc_bar_radius'];\r\n\t\t\tif( $sc_bar_radius>35 ) $sc_bar_radius = 35;\r\n\t\t$sc_label_fsize = (int)$_POST['sc_label_fsize'];\r\n\t\t\tif( $sc_label_fsize<8 ) $sc_label_fsize = 8;\r\n\t\t\telseif( $sc_label_fsize>18 ) $sc_label_fsize = 18;\r\n\t\t$sc_label_fcolor = strip_tags( $_POST['sc_label_fcolor'] );\r\n\t\t$sc_label_fface = $_REQUEST['sc_label_fface'];\r\n\t\t$sc_input_bcolor = strip_tags( $_POST['sc_input_bcolor'] );\r\n\t\t$sc_input_bradius = (int)$_POST['sc_input_bradius'];\r\n\t\t\tif( $sc_input_bradius>35 ) $sc_input_bradius = 35;\r\n\t\t$sc_input_bgcolor = strip_tags( $_POST['sc_input_bgcolor'] );\r\n\t\t$sc_input_fsize = (int)$_POST['sc_input_fsize'];\r\n\t\t\tif( $sc_input_fsize<8 ) $sc_input_fsize = 8;\r\n\t\t\telseif( $sc_input_fsize>18 ) $sc_input_fsize = 18;\r\n\t\t$sc_input_fcolor = strip_tags( $_POST['sc_input_fcolor'] );\r\n\t\t$sc_input_fface = $_REQUEST['sc_input_fface'];\r\n\t\t$sc_form_bcolor = strip_tags( $_POST['sc_form_bcolor'] );\r\n\t\t$sc_req_fcolor = strip_tags( $_POST['sc_req_fcolor'] );\r\n\t\t$sc_form_bimage_del = $_POST['sc_form_bimage_del'];\r\n\t\t$sc_form_submit_del = $_POST['sc_form_submit_del'];\r\n\t\t//echo \"<pre>\"; var_dump($sc_form_bimage_del); echo \"</pre>\";\r\n\t\t\r\n\t\t//form background image upload\r\n\t\t\r\n\t\t//retrive previous name\r\n\t\t$img_del = 1;\r\n\t\t$sc_form_bimage = get_option('sc_form_styles');\r\n\t\t$sc_form_bimage = $sc_form_bimage['sc_form_bimage'];\r\n\t\t$tmp_sc_form_bimage = $_FILES['sc_form_bimage']['name'];\r\n\t\tif( $tmp_sc_form_bimage!='' ){\r\n\t\t\t$img_del = 0;\r\n\t\t\t$handle = new Upload($_FILES['sc_form_bimage']);\r\n\t\t\t\r\n\t\t\tif ($handle->uploaded) {\r\n\t\t\t\r\n\t\t\t\t$handle->allowed = array('image/*');\r\n\t\t\t\t\r\n\t\t\t\t//resize images\r\n\t\t\t\t$bg_image = getimagesize($_FILES['sc_form_bimage']['tmp_name']);\r\n\t\t\t\tif( $bg_image[0]>313 ){\r\n\t\t\t\t\t//if only width is greater than the desired size\r\n\t\t\t\t\t$handle->image_resize = true;\r\n\t\t\t\t\t$handle->image_ratio_y = true;\r\n\t\t\t\t\t$handle->image_x = 313;\r\n\t\t\t\t}\r\n\t\t\t\t$handle->Process($up_path);\r\n\t\t\t\t\r\n\t\t\t\tif ($handle->processed) {\r\n\t\t\t\t\t//upload successful.\r\n\t\t\t\t\t//delete previous file [thumbnail too]\r\n\t\t\t\t\t$sc_form_bimage_old = $sc_form_bimage;\r\n\t\t\t\t\tif( $sc_form_bimage_old ) @unlink($up_path.$sc_form_bimage_old);\r\n\t\t\t\t\tif( $sc_form_bimage_old ) @unlink($up_path.\"th_\".$sc_form_bimage_old);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$sc_form_bimage = $handle->file_dst_name;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//create thumbnail image\r\n\t\t\t\t\t$th_image = getimagesize($_FILES['sc_form_bimage']['tmp_name']);\r\n\t\t\t\t\tif( $th_image[0]>100 && $th_image[1]>100 ){\r\n\t\t\t\t\t\t//if both height and width is greater than the desired size\r\n\t\t\t\t\t\t$handle->image_resize = true;\r\n\t\t\t\t\t\t$handle->image_ratio = true;\r\n\t\t\t\t\t\t$handle->image_y = 100;\r\n\t\t\t\t\t\t$handle->image_x = 100;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif( $th_image[0]>100 ){\r\n\t\t\t\t\t\t//if only width is greater than the desired size\r\n\t\t\t\t\t\t$handle->image_resize = true;\r\n\t\t\t\t\t\t$handle->image_ratio_y = true;\r\n\t\t\t\t\t\t$handle->image_x = 100;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif( $th_image[1]>100 ){\r\n\t\t\t\t\t\t//if only height is greater than the desired size\r\n\t\t\t\t\t\t$handle->image_resize = true;\r\n\t\t\t\t\t\t$handle->image_ratio_x = true;\r\n\t\t\t\t\t\t$handle->image_y = 100;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$handle->Process($up_path);\r\n\t\t\t\t\tif ($handle->processed) {\r\n\t\t\t\t\t\t$th_image_name = $handle->file_dst_name;\r\n\t\t\t\t\t\t@copy($up_path.$handle->file_dst_name,$up_path.\"th_\".$sc_form_bimage);\r\n\t\t\t\t\t\t@unlink($up_path.$th_image_name);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$err = $handle->error;\r\n\t\t\t\t}\r\n\t\t\t\t$handle->Clean();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$err = $handle->error;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif( $err )\r\n\t\t\t$msg .= $err.\" [Form Background Image]\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t//retrive previous sumbit button image name\r\n\t\t$img_del2 = 1;\r\n\t\t$sc_form_submit = get_option('sc_form_styles');\r\n\t\t$sc_form_submit = $sc_form_submit['sc_form_submit'];\r\n\t\t$tmp_sc_form_submit = $_FILES['sc_form_submit']['name'];\r\n\t\tif( $tmp_sc_form_submit!='' ){\r\n\t\t\t$img_del2 = 0;\r\n\t\t\t$handle = new Upload($_FILES['sc_form_submit']);\r\n\t\t\t\r\n\t\t\tif ($handle->uploaded) {\r\n\t\t\t\r\n\t\t\t\t$handle->allowed = array('image/*');\r\n\t\t\t\t\r\n\t\t\t\t//resize images\r\n\t\t\t\t$handle->image_resize = true;\r\n\t\t\t\t$handle->image_x = 133;\r\n\t\t\t\t$handle->image_y = 34;\r\n\t\t\t\t\r\n\t\t\t\t$handle->Process($up_path);\r\n\t\t\t\t\r\n\t\t\t\tif ($handle->processed) {\r\n\t\t\t\t\t//upload successful.\r\n\t\t\t\t\t//delete previous file\r\n\t\t\t\t\t$sc_form_submit_old = $sc_form_submit;\r\n\t\t\t\t\tif( $sc_form_submit_old ) @unlink($up_path.$sc_form_submit_old);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$sc_form_submit = $handle->file_dst_name;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$err2 = $handle->error;\r\n\t\t\t\t}\r\n\t\t\t\t$handle->Clean();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$err2 = $handle->error;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif( $err2 ){\r\n\t\t\tif( $msg=='' ) $msg = $err2.\" [Form Submit Button]\";\r\n\t\t\telse $msg .= \"<br />\".$err2.\" [Form Submit Button]\";\r\n\t\t}\r\n\t\t\t\t\r\n\t\t//perform bgimage delete operation if no new image uploaded and image delete is on\r\n\t\tif( $img_del==1 && $sc_form_bimage_del=='1' ){\r\n\t\t\tif( $sc_form_bimage!='' ){\r\n\t\t\t\t@unlink($up_path.$sc_form_bimage);\r\n\t\t\t\t@unlink($up_path.\"th_\".$sc_form_bimage);\r\n\t\t\t}\r\n\t\t\t$sc_form_bimage = '';\r\n\t\t}\r\n\t\t//perform submit image delete operation if no new image uploaded and image delete is on\r\n\t\tif( $img_del2==1 && $sc_form_submit_del=='1' ){\r\n\t\t\tif( $sc_form_submit!='' ){\r\n\t\t\t\t@unlink($up_path.$sc_form_submit);\r\n\t\t\t}\r\n\t\t\t$sc_form_submit = '';\r\n\t\t}\r\n\t\t//echo \"<pre>\"; var_dump($sc_form_bimage); echo \"</pre>\";\r\n\t\t\r\n\t\t\r\n\t\t//reorgonize (make array) the user inputted mails\r\n\t\t$temp = explode(\",\", $sc_email);\r\n\t\t//removing white spaces and check for valid email address, remove invalid email address.\r\n\t\t$loop = count($temp);\r\n\t\tfor($i=0; $i<$loop; $i++){\r\n\t\t\t$email = trim($temp[$i]);\r\n\t\t\tif( !sc_isemail($email) || $email=='' ){\r\n\t\t\t\tunset($temp[$i]);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$temp[$i] = $email;\r\n\t\t}\r\n\t\t$sc_email = $temp;\r\n\t\t//echo \"<pre>\"; print_r($sc_email); echo \"</pre>\";\r\n\t\t\r\n\t\t\r\n\t\t//arrenging the data in array for updating\r\n\t\t\r\n\t\t//update sc_settings\r\n\t\t$sc_settings['sc_email'] = $sc_email;\r\n\t\t$sc_settings['sc_captcha'] = $sc_captcha;\r\n\t\t$sc_settings['sc_mess_method'] = $sc_mess_method;\r\n\t\t$sc_settings['sc_thanku'] = $sc_thanku;\r\n\t\t$sc_settings['sc_error'] = $sc_error;\r\n\t\t$sc_settings['sc_thanku_page'] = $sc_thanku_page;\r\n\t\t$sc_settings['sc_error_page'] = $sc_error_page;\r\n\t\t$sc_settings['auto_res_switch'] = $auto_res_switch;\r\n\t\t$sc_settings['auto_res_sub'] = $auto_res_sub;\r\n\t\t$sc_settings['sc_file_path'] = $sc_file_path;\r\n\t\t\r\n\t\tupdate_option('sc_settings', $sc_settings);\r\n\t\t\r\n\t\t//update sc_auto_res_mess\r\n\t\tupdate_option('sc_auto_res_mess', $auto_res_mess);\r\n\t\t\r\n\t\t//update sc_auto_res_mess\r\n\t\t$lead_vars = array();\r\n\t\t$lead_vars['id'] = $lead_id;\r\n\t\t$lead_vars['language'] = $lead_lang;\r\n\t\t$lead_vars['format'] = $lead_format;\r\n\t\t$lead_vars['color'] = $lead_color;\r\n\t\t$lead_vars['label'] = $lead_label;\r\n\t\t$lead_vars['value'] = $lead_value;\r\n\t\tupdate_option('sc_google_lead_vars', $lead_vars);\r\n\t\t\r\n\t\t//update sc_form_styles\r\n\t\t$sc_form_styles = array();\r\n\t\t$sc_form_styles['sc_bar_color'] = $sc_bar_color;\r\n\t\t$sc_form_styles['sc_bar_radius'] = $sc_bar_radius;\r\n\t\t$sc_form_styles['sc_label_fsize'] = $sc_label_fsize;\r\n\t\t$sc_form_styles['sc_label_fcolor'] = $sc_label_fcolor;\r\n\t\t$sc_form_styles['sc_label_fface'] = $sc_label_fface;\r\n\t\t$sc_form_styles['sc_input_bcolor'] = $sc_input_bcolor;\r\n\t\t$sc_form_styles['sc_input_bradius'] = $sc_input_bradius;\r\n\t\t$sc_form_styles['sc_input_bgcolor'] = $sc_input_bgcolor;\r\n\t\t$sc_form_styles['sc_input_fsize'] = $sc_input_fsize;\r\n\t\t$sc_form_styles['sc_input_fcolor'] = $sc_input_fcolor;\r\n\t\t$sc_form_styles['sc_input_fface'] = $sc_input_fface;\r\n\t\t$sc_form_styles['sc_form_bimage'] = $sc_form_bimage;\r\n\t\t$sc_form_styles['sc_form_submit'] = $sc_form_submit;\r\n\t\t$sc_form_styles['sc_form_bcolor'] = $sc_form_bcolor;\r\n\t\t$sc_form_styles['sc_req_fcolor'] = $sc_req_fcolor;\r\n\t\tupdate_option('sc_form_styles', $sc_form_styles);\r\n\t\t\r\n\t\tif( $msg=='' )\r\n\t\t\t$msg .= \"Thank You. Your settings updated successfully.\";\r\n\t}\r\n\t\r\n\t//retrive options\r\n\t$settings = get_option('sc_settings');\r\n\t$sc_email = $settings['sc_email'];\r\n\t$sc_captcha = $settings['sc_captcha'];\r\n\t$sc_mess_method = $settings['sc_mess_method'];\r\n\t$sc_thanku = $settings['sc_thanku'];\r\n\t$sc_error = $settings['sc_error'];\r\n\t$sc_thanku_page = $settings['sc_thanku_page'];\r\n\t$sc_error_page = $settings['sc_error_page'];\r\n\t$auto_res_switch = $settings['auto_res_switch'];\r\n\t$auto_res_sub = $settings['auto_res_sub'];\r\n\t$sc_file_path = $settings['sc_file_path'];\r\n\t\r\n\t//make $sc_email array to string\r\n\t$sc_email = implode(\", \",$sc_email);\r\n\t\r\n\t$auto_res_mess = get_option('sc_auto_res_mess');\r\n\t\r\n\t$lead_vars = get_option('sc_google_lead_vars');\r\n\t$lead_id = $lead_vars['id'];\r\n\t$lead_lang = $lead_vars['language'];\r\n\t$lead_format = $lead_vars['format'];\r\n\t$lead_color = $lead_vars['color'];\r\n\t$lead_label = $lead_vars['label'];\r\n\t$lead_value = $lead_vars['value'];\r\n\t\r\n\t$sc_form_styles = get_option('sc_form_styles');\r\n\t$sc_bar_color = $sc_form_styles['sc_bar_color'];\r\n\t$sc_bar_radius = $sc_form_styles['sc_bar_radius'];\r\n\t$sc_label_fsize = $sc_form_styles['sc_label_fsize'];\r\n\t$sc_label_fcolor = $sc_form_styles['sc_label_fcolor'];\r\n\t$sc_label_fface = $sc_form_styles['sc_label_fface'];\r\n\t$sc_input_bcolor = $sc_form_styles['sc_input_bcolor'];\r\n\t$sc_input_bradius = $sc_form_styles['sc_input_bradius'];\r\n\t$sc_input_bgcolor = $sc_form_styles['sc_input_bgcolor'];\r\n\t$sc_input_fsize = $sc_form_styles['sc_input_fsize'];\r\n\t$sc_input_fcolor = $sc_form_styles['sc_input_fcolor'];\r\n\t$sc_input_fface = $sc_form_styles['sc_input_fface'];\r\n\t$sc_form_bimage = $sc_form_styles['sc_form_bimage'];\r\n\t$sc_form_submit = $sc_form_styles['sc_form_submit'];\r\n\t$sc_form_bcolor = $sc_form_styles['sc_form_bcolor'];\r\n\t$sc_req_fcolor = $sc_form_styles['sc_req_fcolor'];\r\n\t\r\n\t//retrive all the pages\r\n\t$sql = \"SELECT * FROM \". $wpdb->prefix .\"posts WHERE post_type='page' ORDER BY post_title\";\r\n\t$pages = $wpdb->get_results($sql, ARRAY_A);\r\n\t\r\n\t//echo \"<pre>\"; print_r($spages); echo \"</pre>\"; die();\r\n\t\r\n?>\t\r\n\t<div class=\"wrap\">\r\n\t\t<h2>Leads Settings</h2>\r\n\t\t\r\n\t\t<iframe src=\"http://www.image-psd-to-wordpress.com/plugin_info.php\" frameborder=\"0\" height=\"150\" width=\"100%\" scrolling=\"auto\"></iframe>\r\n\t\t\r\n\t\t\r\n\t\t<?php if($msg): ?><div id=\"message\" class=\"updated fade\"><p><strong><?php echo $msg; ?></strong></p></div><?php endif; ?>\r\n\t\t\r\n\t\t<div style=\"padding-bottom:20px\">\r\n\t\t<a href=\"<?php bloginfo('url'); ?>/wp-admin/admin.php?page=slide-contact-form-and-a-lead-manager/slider-contact.php\" class=\"button\">Leads Form</a>\r\n\t\t<a href=\"<?php bloginfo('url'); ?>/wp-admin/admin.php?page=sc-leads-page\" class=\"button\">Leads List</a>\r\n\t\t<a href=\"<?php bloginfo('url'); ?>/wp-admin/admin.php?page=sc-settings-page\" class=\"button\">Settings</a>\r\n\t\t</div>\r\n\t\t\r\n\t\t<form name=\"sc_settings_form\" id=\"sc_settings_form\" action=\"\" method=\"post\" enctype=\"multipart/form-data\">\r\n\t\t\r\n\t\t\t<!--General Options starts-->\r\n\t\t\t<fieldset style=\"margin-bottom:20px; padding-bottom:10px; border:1px solid #dfdfdf\">\r\n\t\t\t<legend style=\"margin-left:10px;\">General Options</legend>\r\n\t\t\t<table class=\"form-table\">\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_email\">Mail Sent to: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<textarea name=\"sc_email\" id=\"sc_email\" rows=\"5\" cols=\"50\"><?php echo $sc_email; ?></textarea><br />\r\n\t\t\t\t\t\t<span class=\"description\">Leave this filed blank if you want to use current admin email address. Your current admin email address is <code><?php echo get_option('admin_email'); ?></code>.<br />\r\n\t\t\t\t\t\tYou can enter multiple email addresses, each separated by <strong>comma(,)</strong>.</span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_captcha1\">Active Captcha?: </label></th>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<input name=\"sc_captcha\" id=\"sc_captcha1\" type=\"radio\" value=\"1\" <?php if($sc_captcha==1) echo ' checked=\"checked\"'; ?> /> <label for=\"sc_captcha1\">Yes&nbsp;&nbsp;&nbsp;</label>\r\n\t\t\t\t\t\t<input name=\"sc_captcha\" id=\"sc_captcha2\" type=\"radio\" value=\"0\" <?php if($sc_captcha==0) echo ' checked=\"checked\"'; ?> /> <label for=\"sc_captcha2\">No</label>\r\n\t\t\t\t\t\t<!--<br /><span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t</fieldset>\r\n\t\t\t<!--General Options ends-->\r\n\r\n\r\n<script type=\"text/javascript\" language=\"javascript\">\r\njQuery(document).ready(function() {\r\n\r\n\tjQuery('#sc_bar_color, #sc_label_fcolor, #sc_input_bcolor, #sc_input_bgcolor, #sc_input_fcolor, #sc_form_bcolor, #sc_req_fcolor').ColorPicker({\r\n\t\tonShow: function(colpkr) {\r\n\t\t\tjQuery(colpkr).fadeIn(500);\r\n\t\t\treturn false;\r\n\t\t},\r\n\t\tonHide: function(colpkr) {\r\n\t\t\tjQuery(colpkr).fadeOut(500);\r\n\t\t\treturn false;\r\n\t\t},\r\n\t\tonSubmit: function(hsb, hex, rgb, el) {\r\n\t\t\tvar spanid = \"#\"+ el.id +\"_span\";\r\n\t\t\tjQuery(el).val(\"#\"+hex);\r\n\t\t\tjQuery(el).ColorPickerHide();\r\n\t\t\tjQuery(spanid).css(\"background\", \"#\"+hex);\r\n\t\t},\r\n\t\tonBeforeShow: function () {\r\n\t\t\tjQuery(this).ColorPickerSetColor(this.value);\r\n\t\t}\r\n\t})\r\n\r\n});\r\n</script>\r\n\r\n\t\t\t<!--Customize Form starts-->\r\n\t\t\t<fieldset style=\"margin-bottom:20px; padding-bottom:10px; border:1px solid #dfdfdf\">\r\n\t\t\t<legend style=\"margin-left:10px;\">Customize Form Styles</legend>\r\n\t\t\t<table class=\"form-table\">\r\n\t\t\t\t<!--bar starts-->\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_bar_color\">Sliding Bar Color: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_bar_color\" id=\"sc_bar_color\" type=\"text\" value=\"<?php echo $sc_bar_color; ?>\" readonly=\"readonly\" style=\"width:100px; text-align:center; float:left\" />\r\n\t\t\t\t\t\t<span class=\"sc_color_div\" id=\"sc_bar_color_span\" <?php if($sc_bar_color!=''): ?>style=\"background:<?php echo $sc_bar_color; ?>\"<?php endif; ?>><!----></span>\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set background and border color of the sliding bar.</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_bar_radius\">Sliding Bar Border Radius: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_bar_radius\" id=\"sc_bar_radius\" type=\"text\" value=\"<?php echo $sc_bar_radius; ?>\" maxlength=\"2\" style=\"width:50px; text-align:right;\" />\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the border radius of the sliding bar. [Enter an integer number. Maximum 35px allowed.]</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<!--bar ends-->\r\n\t\t\t\t\r\n\t\t\t\t<!--label starts-->\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_label_fsize\">Label Font Size: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_label_fsize\" id=\"sc_label_fsize\" type=\"text\" value=\"<?php echo $sc_label_fsize; ?>\" maxlength=\"2\" style=\"width:50px; text-align:right;\" />\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the font size of the labels. Range 8px to 18px. [Enter an integer number.]</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_label_fcolor\">Label Font Color: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_label_fcolor\" id=\"sc_label_fcolor\" type=\"text\" value=\"<?php echo $sc_label_fcolor; ?>\" readonly=\"readonly\" style=\"width:100px; text-align:center; float:left\" />\r\n\t\t\t\t\t\t<span class=\"sc_color_div\" id=\"sc_label_fcolor_span\" <?php if($sc_label_fcolor!=''): ?>style=\"background:<?php echo $sc_label_fcolor; ?>\"<?php endif; ?>><!----></span>\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the font color of the labels.</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_label_fface\">Label Font Family: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<select name=\"sc_label_fface\" id=\"sc_label_fface\">\r\n\t\t\t\t\t\t\t<option value=\"0\">Select a font family</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_label_fface==\"Arial, Helvetica, sans-serif\") echo ' selected=\"selected\"'; ?> value=\"Arial, Helvetica, sans-serif\">Arial, Helvetica, sans-serif</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_label_fface==\"'Times New Roman', Times, serif\") echo ' selected=\"selected\"'; ?> value=\"'Times New Roman', Times, serif\">Times New Roman, Times, serif</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_label_fface==\"'Courier New', Courier, monospace\") echo ' selected=\"selected\"'; ?> value=\"'Courier New', Courier, monospace\">Courier New, Courier, monospace</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_label_fface==\"Georgia, 'Times New Roman', Times, serif\") echo ' selected=\"selected\"'; ?> value=\"Georgia, 'Times New Roman', Times, serif\">Georgia, Times New Roman, Times, serif</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_label_fface==\"Verdana, Arial, Helvetica, sans-serif\") echo ' selected=\"selected\"'; ?> value=\"Verdana, Arial, Helvetica, sans-serif\">Verdana, Arial, Helvetica, sans-serif</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_label_fface==\"Geneva, Arial, Helvetica, sans-serif\") echo ' selected=\"selected\"'; ?> value=\"Geneva, Arial, Helvetica, sans-serif\">Geneva, Arial, Helvetica, sans-serif</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_label_fface==\"'Trebuchet MS', Arial, Helvetica, sans-serif\") echo ' selected=\"selected\"'; ?> value=\"'Trebuchet MS', Arial, Helvetica, sans-serif\">Trebuchet MS, Arial, Helvetica, sans-serif</option>\r\n\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the font family of the labels.</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<!--label ends-->\r\n\t\t\t\t\r\n\t\t\t\t<!--input starts-->\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_input_bcolor\">Input Border Color: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_input_bcolor\" id=\"sc_input_bcolor\" type=\"text\" value=\"<?php echo $sc_input_bcolor; ?>\" readonly=\"readonly\" style=\"width:100px; text-align:center; float:left;\" />\r\n\t\t\t\t\t\t<span class=\"sc_color_div\" id=\"sc_input_bcolor_span\" <?php if($sc_input_bcolor!=''): ?>style=\"background:<?php echo $sc_input_bcolor; ?>\"<?php endif; ?>><!----></span>\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the border color input fields.</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_input_bradius\">Input Border Radius: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_input_bradius\" id=\"sc_input_bradius\" type=\"text\" value=\"<?php echo $sc_input_bradius; ?>\" maxlength=\"2\" style=\"width:50px; text-align:right;\" />\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the border radius of input fields. [Enter an integer number. Maximum 35px allowed.]</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_input_bgcolor\">Input Background Color: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_input_bgcolor\" id=\"sc_input_bgcolor\" type=\"text\" value=\"<?php echo $sc_input_bgcolor; ?>\" readonly=\"readonly\" style=\"width:100px; text-align:center; float:left\" />\r\n\t\t\t\t\t\t<span class=\"sc_color_div\" id=\"sc_input_bgcolor_span\" <?php if($sc_input_bgcolor!=''): ?>style=\"background:<?php echo $sc_input_bgcolor; ?>\"<?php endif; ?>><!----></span>\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the background color of input fields.</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_input_fsize\">Input Font Size: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_input_fsize\" id=\"sc_input_fsize\" type=\"text\" value=\"<?php echo $sc_input_fsize; ?>\" maxlength=\"2\" style=\"width:50px; text-align:right;\" />\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the font size of input fields. Range 8px to 18px. [Enter an integer number.]</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_input_fcolor\">Input Font Color: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_input_fcolor\" id=\"sc_input_fcolor\" type=\"text\" value=\"<?php echo $sc_input_fcolor; ?>\" readonly=\"readonly\" style=\"width:100px; text-align:center; float:left\" />\r\n\t\t\t\t\t\t<span class=\"sc_color_div\" id=\"sc_input_fcolor_span\" <?php if($sc_input_fcolor!=''): ?>style=\"background:<?php echo $sc_input_fcolor; ?>\"<?php endif; ?>><!----></span>\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the font color of input fields.</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_input_fface\">Input Font Family: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<select name=\"sc_input_fface\" id=\"sc_input_fface\">\r\n\t\t\t\t\t\t\t<option value=\"0\">Select a font family</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_input_fface==\"Arial, Helvetica, sans-serif\") echo ' selected=\"selected\"'; ?> value=\"Arial, Helvetica, sans-serif\">Arial, Helvetica, sans-serif</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_input_fface==\"'Times New Roman', Times, serif\") echo ' selected=\"selected\"'; ?> value=\"'Times New Roman', Times, serif\">Times New Roman, Times, serif</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_input_fface==\"'Courier New', Courier, monospace\") echo ' selected=\"selected\"'; ?> value=\"'Courier New', Courier, monospace\">Courier New, Courier, monospace</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_input_fface==\"Georgia, 'Times New Roman', Times, serif\") echo ' selected=\"selected\"'; ?> value=\"Georgia, 'Times New Roman', Times, serif\">Georgia, Times New Roman, Times, serif</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_input_fface==\"Verdana, Arial, Helvetica, sans-serif\") echo ' selected=\"selected\"'; ?> value=\"Verdana, Arial, Helvetica, sans-serif\">Verdana, Arial, Helvetica, sans-serif</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_input_fface==\"Geneva, Arial, Helvetica, sans-serif\") echo ' selected=\"selected\"'; ?> value=\"Geneva, Arial, Helvetica, sans-serif\">Geneva, Arial, Helvetica, sans-serif</option>\r\n\t\t\t\t\t\t\t<option<?php if($sc_input_fface==\"'Trebuchet MS', Arial, Helvetica, sans-serif\") echo ' selected=\"selected\"'; ?> value=\"'Trebuchet MS', Arial, Helvetica, sans-serif\">Trebuchet MS, Arial, Helvetica, sans-serif</option>\r\n\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the font family of input fields.</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<!--input ends-->\r\n\t\t\t\t\r\n\t\t\t\t<!--other starts-->\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_form_bcolor\">Form Background Color: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_form_bcolor\" id=\"sc_form_bcolor\" type=\"text\" value=\"<?php echo $sc_form_bcolor; ?>\" readonly=\"readonly\" style=\"width:100px; text-align:center; float:left;\" />\r\n\t\t\t\t\t\t<span class=\"sc_color_div\" id=\"sc_form_bcolor_span\" <?php if($sc_form_bcolor!=''): ?>style=\"background:<?php echo $sc_form_bcolor; ?>\"<?php endif; ?>><!----></span>\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the background color of the form.</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_form_bimage\">Form Background Image: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t<input name=\"sc_form_bimage\" id=\"sc_form_bimage\" type=\"file\" value=\"<?php echo $sc_form_bimage; ?>\" style=\"width:200px;\" />\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Upload an image to set as background image of the form.</small></span>\r\n\r\n\t\t\t\t\t\t<?php if($sc_form_bimage!=''): ?>\r\n\t\t\t\t\t\t<div class=\"sc_admin_image_preview\">\r\n\t\t\t\t\t\t\t<img src=\"<?php echo get_bloginfo('url'); ?>/wp-content/uploads/<?php echo \"th_\".$sc_form_bimage; ?>\" alt=\"\" align=\"absbottom\" />\r\n\t\t\t\t\t\t\t<input name=\"sc_form_bimage_del\" id=\"sc_form_bimage_del\" type=\"checkbox\" value=\"1\" style=\"width:20px;\" />\r\n\t\t\t\t\t\t\t<label for=\"sc_form_bimage_del\">Delete Image</label>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<?php endif; ?>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_form_bimage\">Form Submit Button: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t<input name=\"sc_form_submit\" id=\"sc_form_submit\" type=\"file\" value=\"<?php echo $sc_form_submit; ?>\" style=\"width:200px;\" />\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Upload an image of 133px &times; 34px to replace the default submit button image.</small></span>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<?php if($sc_form_submit!=''): ?>\r\n\t\t\t\t\t\t<div class=\"sc_admin_image_preview\">\r\n\t\t\t\t\t\t\t<img src=\"<?php echo get_bloginfo('url'); ?>/wp-content/uploads/<?php echo $sc_form_submit; ?>\" alt=\"\" align=\"absbottom\" />\r\n\t\t\t\t\t\t\t<input name=\"sc_form_submit_del\" id=\"sc_form_submit_del\" type=\"checkbox\" value=\"1\" style=\"width:20px;\" />\r\n\t\t\t\t\t\t\t<label for=\"sc_form_submit_del\">Delete Image</label>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<?php endif; ?>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_req_fcolor\">Required Text Color: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_req_fcolor\" id=\"sc_req_fcolor\" type=\"text\" value=\"<?php echo $sc_req_fcolor; ?>\" readonly=\"readonly\" style=\"width:100px; text-align:center; float:left;\" />\r\n\t\t\t\t\t\t<span class=\"sc_color_div\" id=\"sc_req_fcolor_span\" <?php if($sc_req_fcolor!=''): ?>style=\"background:<?php echo $sc_req_fcolor; ?>\"<?php endif; ?>><!----></span>\r\n\t\t\t\t\t\t&nbsp;<span class=\"description\"><small>Set the color of required text.</small></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<!--other ends-->\r\n\t\t\t\t\r\n\t\t\t</table>\r\n\t\t\t</fieldset>\r\n\t\t\t<!--Customize Form ends-->\r\n\t\t\t\r\n\t\t\t<!--Thank You Message Options starts-->\r\n\t\t\t<fieldset style=\"margin-bottom:20px; padding-bottom:10px; border:1px solid #dfdfdf\">\r\n\t\t\t<legend style=\"margin-left:10px;\">Thank You Message Options</legend>\r\n\t\t\t<table class=\"form-table\">\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label>Thank you method: </label></th>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<input type=\"radio\" name=\"sc_mess_method\" id=\"sc_mess_method1\" value=\"1\"<?php if($sc_mess_method==1) echo ' checked=\"checked\"'; ?> onchange=\"showhide_method('1');\" /> <label for=\"sc_mess_method1\" style=\"margin-right:20px;\">Simple</label>\r\n\t\t\t\t\t\t<input type=\"radio\" name=\"sc_mess_method\" id=\"sc_mess_method2\" value=\"2\"<?php if($sc_mess_method==2) echo ' checked=\"checked\"'; ?> onchange=\"showhide_method('2');\" /> <label for=\"sc_mess_method2\">Advanced</label>\r\n\t\t\t\t\t\t<br /><span class=\"description\">Simple method will just show the Thank you message/Error message, <br />Advanced method will redirect the user to the specified page.</span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th class=\"method1\" scope=\"row\" <?php if($sc_mess_method!=1) echo ' style=\"display:none\"'; ?>><label for=\"sc_thanku\">Thank you message: </label></th>\r\n\t\t\t\t\t<td class=\"method1 form-field\" <?php if($sc_mess_method!=1) echo ' style=\"display:none\"'; ?>>\r\n\t\t\t\t\t\t<textarea name=\"sc_thanku\" id=\"sc_thanku\" rows=\"5\" cols=\"50\"><?php echo $sc_thanku; ?></textarea><br />\r\n\t\t\t\t\t\t<!--<span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th class=\"method1\" scope=\"row\" <?php if($sc_mess_method!=1) echo ' style=\"display:none\"'; ?>><label for=\"sc_error\">Error message: </label></th>\r\n\t\t\t\t\t<td class=\"method1 form-field\" <?php if($sc_mess_method!=1) echo ' style=\"display:none\"'; ?>>\r\n\t\t\t\t\t\t<textarea name=\"sc_error\" id=\"sc_error\" rows=\"5\" cols=\"50\"><?php echo $sc_error; ?></textarea><br />\r\n\t\t\t\t\t\t<!--<span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th class=\"method2\" scope=\"row\" <?php if($sc_mess_method!=2) echo ' style=\"display:none\"'; ?>><label for=\"sc_thanku_page\">Thank you page: </label></th>\r\n\t\t\t\t\t<td class=\"method2 form-field\" <?php if($sc_mess_method!=2) echo ' style=\"display:none\"'; ?>>\r\n\t\t\t\t\t\t<select name=\"sc_thanku_page\" id=\"sc_thanku_page\">\r\n\t\t\t\t\t\t\t<option value=\"0\">Select a page</option>\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\tfor($i=0; $i<count($pages); $i++){\r\n\t\t\t\t\t\t\t\tif( $sc_thanku_page==$pages[$i]['ID'] ) $sel = ' selected=\"selected\"';\r\n\t\t\t\t\t\t\t\telse $sel = '';\r\n\t\t\t\t\t\t\t\techo '<option value=\"'. $pages[$i]['ID'] .'\"'. $sel .'>'. $pages[$i]['post_title'] .'</option>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t<!--<br /><span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th class=\"method2\" scope=\"row\" <?php if($sc_mess_method!=2) echo ' style=\"display:none\"'; ?>><label for=\"sc_error_page\">Error page: </label></th>\r\n\t\t\t\t\t<td class=\"method2 form-field\" <?php if($sc_mess_method!=2) echo ' style=\"display:none\"'; ?>>\r\n\t\t\t\t\t\t<select name=\"sc_error_page\" id=\"sc_error_page\">\r\n\t\t\t\t\t\t\t<option value=\"0\">Select a page</option>\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\tfor($i=0; $i<count($pages); $i++){\r\n\t\t\t\t\t\t\t\tif( $sc_error_page==$pages[$i]['ID'] ) $sel = ' selected=\"selected\"';\r\n\t\t\t\t\t\t\t\telse $sel = '';\r\n\t\t\t\t\t\t\t\techo '<option value=\"'. $pages[$i]['ID'] .'\"'. $sel .'>'. $pages[$i]['post_title'] .'</option>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t<!--<br /><span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t</fieldset>\r\n\t\t\t<!--Thank You Message Options ends-->\r\n\t\t\t\r\n\t\t\t<!--Auto Responder Options starts-->\r\n\t\t\t<fieldset style=\"margin-bottom:20px; padding-bottom:10px; border:1px solid #dfdfdf\">\r\n\t\t\t<legend style=\"margin-left:10px;\">Auto Responder Options</legend>\r\n\t\t\t<table class=\"form-table\">\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label>Auto Responder: </label></th>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<input name=\"auto_res_switch\" id=\"auto_res_switch1\" value=\"1\" type=\"radio\"<?php if($auto_res_switch=='1') echo ' checked=\"checked\"'; ?> /> <label for=\"auto_res_switch1\" style=\"margin-right:20px;\">ON</label>\r\n\t\t\t\t\t\t<input name=\"auto_res_switch\" id=\"auto_res_switch2\" value=\"0\" type=\"radio\"<?php if($auto_res_switch=='0') echo ' checked=\"checked\"'; ?> /> <label for=\"auto_res_switch2\">OFF</label>\r\n\t\t\t\t\t\t<!--<span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"auto_res_sub\">Auto Responder Subject: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"auto_res_sub\" id=\"auto_res_sub\" value=\"<?php echo $auto_res_sub; ?>\" class=\"regular-text\" type=\"text\" /><br />\r\n\t\t\t\t\t\t<!--<span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"auto_res_mess\">Auto Responder Message: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<textarea name=\"auto_res_mess\" id=\"auto_res_mess\" rows=\"5\" cols=\"50\"><?php echo $auto_res_mess; ?></textarea><br />\r\n\t\t\t\t\t\t<a href=\"javascript:void(0)\" title=\"Will reset the Auto Responder Message\" onclick=\"$('#auto_res_mess').val('We have received your inquiry and we will respond back to you shortly. For your record here is a copy of the message you submitted.')\">Restore Message</a>\r\n\t\t\t\t\t\t<!--<span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t</fieldset>\r\n\t\t\t<!--Auto Responder Options ends-->\r\n\t\t\t\t\r\n\t\t\t<!--Lead JS Options starts-->\t\r\n\t\t\t<fieldset style=\"margin-bottom:20px; padding-bottom:10px; border:1px solid #dfdfdf\">\r\n\t\t\t<legend style=\"margin-left:10px;\">Lead JS Options</legend>\r\n\t\t\t<table class=\"form-table\">\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"lead_id\">Google Lead ID: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"lead_id\" id=\"lead_id\" value=\"<?php echo $lead_id; ?>\" class=\"regular-text\" type=\"text\" />\r\n\t\t\t\t\t\t<!--<span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"lead_lang\">Google Lead Language: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"lead_lang\" id=\"lead_lang\" value=\"<?php echo $lead_lang; ?>\" class=\"regular-text\" type=\"text\" style=\"width:100px\" />\r\n\t\t\t\t\t\t<!--<span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"lead_format\">Google Lead Format: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"lead_format\" id=\"lead_format\" value=\"<?php echo $lead_format; ?>\" class=\"regular-text\" type=\"text\" style=\"width:100px\" />\r\n\t\t\t\t\t\t<!--<span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"lead_color\">Google Lead Color: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"lead_color\" id=\"lead_color\" value=\"<?php echo $lead_color; ?>\" class=\"regular-text\" type=\"text\" style=\"width:100px\" />\r\n\t\t\t\t\t\t<!--<span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"lead_label\">Google Lead Label: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"lead_label\" id=\"lead_label\" value=\"<?php echo $lead_label; ?>\" class=\"regular-text\" type=\"text\" />\r\n\t\t\t\t\t\t<!--<span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"lead_value\">Google Lead Value: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"lead_value\" id=\"lead_value\" value=\"<?php echo $lead_value; ?>\" class=\"regular-text\" type=\"text\" style=\"width:100px\" />\r\n\t\t\t\t\t\t<!--<span class=\"description\"></span>-->\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t</fieldset>\r\n\t\t\t<!--Lead JS Options ends-->\r\n\t\t\t\r\n\t\t\t<!--Lead JS Options starts-->\t\r\n\t\t\t<!--<fieldset style=\"margin-bottom:20px; padding-bottom:10px; border:1px solid #dfdfdf\">\r\n\t\t\t<legend style=\"margin-left:10px;\">Include File</legend>\r\n\t\t\t<table class=\"form-table\">\r\n\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t<th scope=\"row\"><label for=\"sc_file_path\">Lead File Path: </label></th>\r\n\t\t\t\t\t<td class=\"form-field\">\r\n\t\t\t\t\t\t<input name=\"sc_file_path\" id=\"sc_file_path\" value=\"<?php echo $sc_file_path; ?>\" class=\"regular-text\" type=\"text\" />\r\n\t\t\t\t\t\t<br /><span class=\"description\">Enter the directory path to Lead File. Example: <code>/var/www/html/zend.developer4lease.com/public/renderedHtml/lead</code></span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t</fieldset>-->\r\n\t\t\t<!--Lead JS Options ends-->\r\n\t\t\t\r\n\t\t\t<p class=\"submit\">\r\n\t\t\t\t<input type=\"submit\" name=\"submit\" value=\"Update Settings\" class=\"button-primary\" />\r\n\t\t\t</p>\r\n\t\t\t\r\n\t\t</form>\r\n\t</div>\r\n\t\r\n\t<?php sc_credit(); ?>\r\n<?php\r\n}", "public function action_article_settings()\n\t{\n\t\tglobal $context, $scripturl, $txt;\n\n\t\t// These are very likely to come in handy! (i.e. without them we're doomed!)\n\t\trequire_once(ADMINDIR . '/ManagePermissions.controller.php');\n\t\trequire_once(ADMINDIR . '/ManageServer.controller.php');\n\t\trequire_once(SUBSDIR . '/SettingsForm.class.php');\n\n\t\t// Initialize the form\n\t\t$this->_initArticleSettingsForm();\n\n\t\t// Save away\n\t\tif (isset($_GET['save']))\n\t\t{\n\t\t\tcheckSession();\n\n\t\t\t$this->_articleSettingsForm->setConfigValues($_POST);\n\t\t\t$this->_articleSettingsForm->save();\n\t\t\tredirectexit('action=admin;area=portalconfig;sa=articlesettings');\n\t\t}\n\n\t\t// Show the form\n\t\t$context['post_url'] = $scripturl . '?action=admin;area=portalconfig;sa=articlesettings;save';\n\t\t$context['settings_title'] = $txt['sp-adminArticleSettingsName'];\n\t\t$context['page_title'] = $txt['sp-adminArticleSettingsName'];\n\t\t$context['sub_template'] = 'show_settings';\n\n\t\t$this->_articleSettingsForm->prepare();\n\t}", "function fm_process_admin_settings($entry) {\r\n\t// Deals with all processing from the files section of admin\r\n\tif (!$exist_record = get_record('fmanager_admin', 'usertype', $entry->usertype)) {\r\n\t\t$tmp = NULL;\r\n\t\t$tmp->usertype = $entry->usertype;\r\n\t\tif (!insert_record('fmanager_admin', $tmp)) {\r\n\t\t\t$err = NULL;\r\n\t\t\t$err->errtype = \"insert\";\r\n\t\t\t$err->forhwho =\"user\";\r\n\t\t\terror(get_string('errrecordmod', 'block_file_manager', $err), $_SERVER['HTTP_REFERER']);\r\n\t\t}\r\n\t}\r\n\tif ($exist_record = get_record('fmanager_admin', 'usertype', $entry->usertype)) {\r\n\t\t$entry->id = $exist_record->id;\r\n\t\tif (!update_record('fmanager_admin', $entry)) {\r\n\t\t\t$err = NULL;\r\n\t\t\t$err->errtype = 'update';\r\n\t\t\t$err->forwho = 'user';\r\n\t\t\terror(get_string('errrecordmod', 'block_file_manager', $err), $_SERVER['HTTP_REFERER']);\r\n\t\t}\r\n\t}\r\n}", "function mks_handle_request() {\n if (isset($_POST['mks_action'])) {\n switch ($_POST['mks_action']) {\n case 'api_settings';\n verify_api();\n break;\n }\n }\n}", "public function settingsPage(){\n\n\t\tif (isset($_POST['so_save'])) {\n\t\t\t$retrievedNonce = $_REQUEST['_wpnonce'];\n\t\t\tif (wp_verify_nonce($retrievedNonce, 'saveStackoverflowSettings' )) {\n\t\t\t\tupdate_option('stackoverflowUser', esc_html($_POST['so_id']));\n\t\t\t}\n\t\t}\n\n\t\tif (isset($_POST['getData'])) {\n\t\t\t$retrievedNonce = $_REQUEST['_wpnonce'];\n\t\t\tif (wp_verify_nonce($retrievedNonce, 'getStackoverflowData' )) {\n\t\t\t\t$this->getProfileData();\n\t\t\t}\n\t\t}\n\n\t\t$getSOdata = get_option('StackoverflowData');\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h3><?php _e('Stackoverflow Statistics Settings', 'stackoverflowStats'); ?></h3>\n\t\t\t<form method=\"post\" action=\"\">\n\t\t\t\t<?php wp_nonce_field('saveStackoverflowSettings'); ?>\n\t\t\t\t<label><?php _e('Your Stackoverflow ID', 'stackoverflowStats'); ?></label><br>\n\t\t\t\t<input type=\"text\" name=\"so_id\" value=\"<?php echo get_option(\"stackoverflowUser\"); ?>\" placeholder=\"Your Stackoverflow ID\">\n\t\t\t\t<button type=\"submit\" class=\"button-primary\" name=\"so_save\" value=\"save\"><?php _e('Save', 'stackoverflowStats'); ?></button>\n\t\t\t</form>\n\n\t\t\t<?php\n\t\t\tif($getSOdata){ ?>\n\t\t\t\t<p><?php _e('Last Update: ', 'stackoverflowStats'); echo esc_html($getSOdata[\"lastFetch\"]); ?> </p>\n\t\t\t<?php }\n\t\t\telse { ?>\n\t\t\t\t<p><?php _e('Last Data-update: No-Data', 'stackoverflowStats'); ?> </p>\n\t\t\t<?php }\n\n\t\t\tif (get_option(\"stackoverflowUser\")){\n\t\t\t\t?>\n\t\t\t\t<form method=\"post\" action=\"\">\n\t\t\t\t\t<?php wp_nonce_field('getStackoverflowData'); ?>\n\t\t\t\t\t<button type=\"submit\" class=\"button-primary\" name=\"getData\" value=\"data\"><?php _e('Get data from Stackoverflow', 'stackoverflowStats'); ?></button>\n\t\t\t\t</form>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}", "function process_settings_actions() {\n\t\t\tglobal $movies;\n\t\t\t\n\t\t\tif ( ( isset( $_POST['movies-settings-action'] ) ) \n\t\t\t && ( $_POST['movies-settings-action'] == 'settings-update' ) ) {\n\t\t\n\t\t\t\tif ( !wp_verify_nonce( $_POST['movies-settings-update-wpnonce'], 'movies-settings-update' ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\n\t\t\t\t$current_theatre_id = $movies->settings['theatre-id'];\n\t\t\n\t\t\t\tif ( ( isset( $_POST['movies_settings'] ) ) && ( !empty( $_POST['movies_settings'] ) ) ) {\n\n\t\t\t\t\tforeach( $_POST['movies_settings'] as $settings_key => $settings_value ) {\n\t\t\t\t\t\tswitch( $settings_key ) {\n\t\t\t\t\n\t\t\t\t\t\t\tcase 'theatre-id':\n\t\t\t\t\t\t\t\t$theatre_id = intval( $settings_value );\n\t\t\t\t\t\t\t\tif ( !empty( $theatre_id ) ) {\n\t\t\t\t\t\t\t\t\t$movies->settings['theatre-id'] = $theatre_id;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t\t\tcase 'cache-timeout':\n\t\t\t\t\t\t\t\tif ( intval( $_POST['movies_settings']['cache-timeout'] ) < 1 ) {\n\t\t\t\t\t\t\t\t\t$movies->settings['cache-timeout'] = 1 * 3600;\n\t\t\t\t\t\t\t\t} else if ( intval( $_POST['movies_settings']['cache-timeout']) > 24 ) {\n\t\t\t\t\t\t\t\t\t$movies->settings['cache-timeout'] = 24 * 3600;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$movies->settings['cache-timeout'] = intval( $_POST['movies_settings']['cache-timeout'] ) * 3600;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$movies->save_plugin_options();\n\t\t\n\t\t\t\t\t?><div id=\"movies-settings-saved\" class=\"updated below-h2\"><p><?php \n\t\t\t\t\t\t\t\t_e('Settings Saved', 'movies'); ?></p></div><?php\n\n\t\t\t\t\tif ( $current_theatre_id !== $movies->settings['theatre-id'] ) {\n\n\t\t\t\t\t\t$movies->movies_xml_processor->process_all_feeds( true, true );\n\t\t\t\t\t\t\n\t\t\t\t\t\t?><div id=\"movies-feed-urls-processed\" class=\"updated below-h2\"><p><?php _e('XML Feeds Processed - Due to Theatre ID change.', 'movies'); ?></p></div><?php\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function action_general_settings()\n\t{\n\t\tglobal $context, $scripturl, $txt;\n\n\t\t$context['SPortal']['themes'] = sp_general_load_themes();\n\n\t\t// These are very likely to come in handy! (i.e. without them we're doomed!)\n\t\trequire_once(ADMINDIR . '/ManagePermissions.controller.php');\n\t\trequire_once(ADMINDIR . '/ManageServer.controller.php');\n\t\trequire_once(SUBSDIR . '/SettingsForm.class.php');\n\n\t\t// Initialize the form\n\t\t$this->_initGeneralSettingsForm();\n\n\t\tif (isset($_GET['save']))\n\t\t{\n\t\t\tcheckSession();\n\n\t\t\tif (!empty($_POST['sp_portal_mode']))\n\t\t\t{\n\t\t\t\tupdateSettings(array('front_page' => 'PortalMain_Controller'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tupdateSettings(array('front_page' => 'MessageIndex_Controller'));\n\t\t\t}\n\n\t\t\t$this->_generalSettingsForm->setConfigValues($_POST);\n\t\t\t$this->_generalSettingsForm->save();\n\t\t\tredirectexit('action=admin;area=portalconfig;sa=generalsettings');\n\t\t}\n\n\t\t$context['post_url'] = $scripturl . '?action=admin;area=portalconfig;sa=generalsettings;save';\n\t\t$context['settings_title'] = $txt['sp-adminGeneralSettingsName'];\n\t\t$context['page_title'] = $txt['sp-adminGeneralSettingsName'];\n\t\t$context['sub_template'] = 'show_settings';\n\n\t\t$this->_generalSettingsForm->prepare();\n\t}", "public function universal()\n {\n if (!get_permission('global_settings', 'is_view')) {\n access_denied();\n }\n\n if ($_POST) {\n if (!get_permission('global_settings', 'is_edit')) {\n access_denied();\n }\n }\n\n $config = array();\n if ($this->input->post('submit') == 'setting') {\n foreach ($this->input->post() as $input => $value) {\n if ($input == 'submit') {\n continue;\n }\n $config[$input] = $value;\n }\n if (empty($config['reg_prefix'])) {\n $config['reg_prefix'] = false;\n }\n $this->db->where('id', 1);\n $this->db->update('global_settings', $config);\n set_alert('success', translate('the_configuration_has_been_updated'));\n redirect(current_url());\n }\n\n if ($this->input->post('submit') == 'theme') {\n foreach ($this->input->post() as $input => $value) {\n if ($input == 'submit') {\n continue;\n }\n $config[$input] = $value;\n }\n $this->db->where('id', 1);\n $this->db->update('theme_settings', $config);\n set_alert('success', translate('the_configuration_has_been_updated'));\n $this->session->set_flashdata('active', 2);\n redirect(current_url());\n }\n\n if ($this->input->post('submit') == 'logo') {\n move_uploaded_file($_FILES['logo_file']['tmp_name'], 'uploads/app_image/logo.png');\n move_uploaded_file($_FILES['text_logo']['tmp_name'], 'uploads/app_image/logo-small.png');\n move_uploaded_file($_FILES['print_file']['tmp_name'], 'uploads/app_image/printing-logo.png');\n move_uploaded_file($_FILES['report_card']['tmp_name'], 'uploads/app_image/report-card-logo.png');\n\n move_uploaded_file($_FILES['slider_1']['tmp_name'], 'uploads/login_image/slider_1.jpg');\n move_uploaded_file($_FILES['slider_2']['tmp_name'], 'uploads/login_image/slider_2.jpg');\n move_uploaded_file($_FILES['slider_3']['tmp_name'], 'uploads/login_image/slider_3.jpg');\n\n set_alert('success', translate('the_configuration_has_been_updated'));\n $this->session->set_flashdata('active', 3);\n redirect(current_url());\n }\n\n $this->data['title'] = translate('global_settings');\n $this->data['sub_page'] = 'settings/universal';\n $this->data['main_menu'] = 'settings';\n $this->data['headerelements'] = array(\n 'css' => array(\n 'vendor/dropify/css/dropify.min.css',\n ),\n 'js' => array(\n 'vendor/dropify/js/dropify.min.js',\n ),\n );\n $this->load->view('layout/index', $this->data);\n }", "public function save_settings() {\n\n if (!isset($_REQUEST['action']) || !isset($_GET['page']))\n return;\n\n if ('swpm-settings' !== $_GET['page'])\n return;\n\n if ('swpm_settings' !== $_REQUEST['action'])\n return;\n\n check_admin_referer('swpm-update-settings');\n\n $data = array();\n\n foreach ($_POST['swpm-settings'] as $key => $val) {\n $data[$key] = esc_html($val);\n }\n\n update_option('swpm-settings', $data);\n }", "function postageapp_admin_form() {\n $form = array();\n \n $form['settings'] = array(\n '#type' => 'fieldset',\n '#title' => t('Postageapp settings'),\n );\n \n $form['settings']['postageapp_api_key'] = array(\n '#type' => 'textfield',\n '#title' => t('PostageApp API Key'),\n '#required' => TRUE,\n '#default_value' => variable_get('postageapp_api_key', ''),\n '#description' => t('The API key for your PostageApp account. Get or generate a valid API key at your PostageApp dashboard which is available at yourusername.postageapp.com')\n );\n \n return system_settings_form($form);\n}", "public function settings_output() {\n\n\t\tif (false == ($render = apply_filters('updraftplus_settings_page_render', true))) {\n\t\t\tdo_action('updraftplus_settings_page_render_abort', $render);\n\t\t\treturn;\n\t\t}\n\n\t\tdo_action('updraftplus_settings_page_init');\n\n\t\tglobal $updraftplus;\n\n\t\t/**\n\t\t * We use request here because the initial restore is triggered by a POSTed form. we then may need to obtain credential for the WP_Filesystem. to do this WP outputs a form, but we don't pass our parameters via that. So the values are passed back in as GET parameters.\n\t\t */\n\t\tif (isset($_REQUEST['action']) && (('updraft_restore' == $_REQUEST['action'] && isset($_REQUEST['backup_timestamp'])) || ('updraft_restore_continue' == $_REQUEST['action'] && !empty($_REQUEST['job_id'])))) {\n\t\t\t$this->prepare_restore();\n\t\t\treturn;\n\t\t}\n\n\t\tif (isset($_REQUEST['action']) && 'updraft_delete_old_dirs' == $_REQUEST['action']) {\n\t\t\t$nonce = empty($_REQUEST['updraft_delete_old_dirs_nonce']) ? '' : $_REQUEST['updraft_delete_old_dirs_nonce'];\n\t\t\tif (!wp_verify_nonce($nonce, 'updraftplus-credentialtest-nonce')) die('Security check');\n\t\t\t$this->delete_old_dirs_go();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!empty($_REQUEST['action']) && 'updraftplus_broadcastaction' == $_REQUEST['action'] && !empty($_REQUEST['subaction'])) {\n\t\t\t$nonce = (empty($_REQUEST['nonce'])) ? \"\" : $_REQUEST['nonce'];\n\t\t\tif (!wp_verify_nonce($nonce, 'updraftplus-credentialtest-nonce')) die('Security check');\n\t\t\tdo_action($_REQUEST['subaction']);\n\t\t\treturn;\n\t\t}\n\n\t\tif (isset($_GET['error'])) {\n\t\t\t// This is used by Microsoft OneDrive authorisation failures (May 15). I am not sure what may have been using the 'error' GET parameter otherwise - but it is harmless.\n\t\t\tif (!empty($_GET['error_description'])) {\n\t\t\t\t$this->show_admin_warning(htmlspecialchars($_GET['error_description']).' ('.htmlspecialchars($_GET['error']).')', 'error');\n\t\t\t} else {\n\t\t\t\t$this->show_admin_warning(htmlspecialchars($_GET['error']), 'error');\n\t\t\t}\n\t\t}\n\n\t\tif (isset($_GET['message'])) $this->show_admin_warning(htmlspecialchars($_GET['message']));\n\n\t\tif (isset($_GET['action']) && 'updraft_create_backup_dir' == $_GET['action'] && isset($_GET['nonce']) && wp_verify_nonce($_GET['nonce'], 'create_backup_dir')) {\n\t\t\t$created = $this->create_backup_dir();\n\t\t\tif (is_wp_error($created)) {\n\t\t\t\techo '<p>'.__('Backup directory could not be created', 'updraftplus').'...<br>';\n\t\t\t\techo '<ul class=\"disc\">';\n\t\t\t\tforeach ($created->get_error_messages() as $msg) {\n\t\t\t\t\techo '<li>'.htmlspecialchars($msg).'</li>';\n\t\t\t\t}\n\t\t\t\techo '</ul></p>';\n\t\t\t} elseif (false !== $created) {\n\t\t\t\techo '<p>'.__('Backup directory successfully created.', 'updraftplus').'</p><br>';\n\t\t\t}\n\t\t\techo '<b>'.__('Actions', 'updraftplus').':</b> <a href=\"'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus\">'.__('Return to UpdraftPlus configuration', 'updraftplus').'</a>';\n\t\t\treturn;\n\t\t}\n\n\t\techo '<div id=\"updraft_backup_started\" class=\"updated updraft-hidden\" style=\"display:none;\"></div>';\n\n\t\t// This opens a div\n\t\t$this->settings_header();\n\t\t?>\n\n\t\t\t<div id=\"updraft-hidethis\">\n\t\t\t<p>\n\t\t\t<strong><?php _e('Warning:', 'updraftplus'); ?> <?php _e(\"If you can still read these words after the page finishes loading, then there is a JavaScript or jQuery problem in the site.\", 'updraftplus'); ?></strong>\n\n\t\t\t<?php if (false !== strpos(basename(UPDRAFTPLUS_URL), ' ')) { ?>\n\t\t\t\t<strong><?php _e('The UpdraftPlus directory in wp-content/plugins has white-space in it; WordPress does not like this. You should rename the directory to wp-content/plugins/updraftplus to fix this problem.', 'updraftplus');?></strong>\n\t\t\t<?php } else { ?>\n\t\t\t\t<a href=\"<?php echo apply_filters('updraftplus_com_link', \"https://updraftplus.com/do-you-have-a-javascript-or-jquery-error/\");?>\" target=\"_blank\"><?php _e('Go here for more information.', 'updraftplus'); ?></a>\n\t\t\t<?php } ?>\n\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t<?php\n\n\t\t\t$include_deleteform_div = true;\n\n\t\t\t// Opens a div, which needs closing later\n\t\t\tif (isset($_GET['updraft_restore_success'])) {\n\n\t\t\t\tif (get_template() === 'optimizePressTheme' || is_plugin_active('optimizePressPlugin') || is_plugin_active_for_network('optimizePressPlugin')) {\n\t\t\t\t\t$this->show_admin_warning(\"<a href='https://optimizepress.zendesk.com/hc/en-us/articles/203699826-Update-URL-References-after-moving-domain' target='_blank'>\" . __(\"OptimizePress 2.0 encodes its contents, so search/replace does not work.\", \"updraftplus\") . ' ' . __(\"To fix this problem go here.\", \"updraftplus\") . \"</a>\", \"notice notice-warning\");\n\t\t\t\t}\n\t\t\t\t$success_advert = (isset($_GET['pval']) && 0 == $_GET['pval'] && !$updraftplus->have_addons) ? '<p>'.__('For even more features and personal support, check out ', 'updraftplus').'<strong><a href=\"'.apply_filters(\"updraftplus_com_link\", 'https://updraftplus.com/shop/updraftplus-premium/').'\" target=\"_blank\">UpdraftPlus Premium</a>.</strong></p>' : \"\";\n\n\t\t\t\techo \"<div class=\\\"updated backup-restored\\\"><span><strong>\".__('Your backup has been restored.', 'updraftplus').'</strong></span><br>';\n\t\t\t\t// Unnecessary - will be advised of this below\n\t\t\t\t// if (2 == $_GET['updraft_restore_success']) echo ' '.__('Your old (themes, uploads, plugins, whatever) directories have been retained with \"-old\" appended to their name. Remove them when you are satisfied that the backup worked properly.');\n\t\t\t\techo $success_advert;\n\t\t\t\t$include_deleteform_div = false;\n\n\t\t\t}\n\n\t\t\tif ($this->scan_old_dirs(true)) $this->print_delete_old_dirs_form(true, $include_deleteform_div);\n\n\t\t\t// Close the div opened by the earlier section\n\t\t\tif (isset($_GET['updraft_restore_success'])) echo '</div>';\n\n\t\t\tif (empty($success_advert) && empty($this->no_settings_warning)) {\n\n\t\t\t\tif (!class_exists('UpdraftPlus_Notices')) include_once(UPDRAFTPLUS_DIR.'/includes/updraftplus-notices.php');\n\t\t\t\tglobal $updraftplus_notices;\n\t\t\t\t\n\t\t\t\t$backup_history = UpdraftPlus_Backup_History::get_history();\n\t\t\t\t$review_dismiss = UpdraftPlus_Options::get_updraft_option('dismissed_review_notice', 0);\n\t\t\t\t$backup_dir = $updraftplus->backups_dir_location();\n\t\t\t\t// N.B. Not an exact proxy for the installed time; they may have tweaked the expert option to move the directory\n\t\t\t\t$installed = @filemtime($backup_dir.'/index.html');// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\t\t\t\t$installed_for = time() - $installed;\n\n\t\t\t\t$advert = false;\n\t\t\t\tif (!empty($backup_history) && $installed && time() > $review_dismiss && $installed_for > 28*86400 && $installed_for < 84*86400) {\n\t\t\t\t\t$advert = 'rate';\n\t\t\t\t}\n\n\t\t\t\t$updraftplus_notices->do_notice($advert);\n\t\t\t}\n\n\t\t\tif (!$updraftplus->memory_check(64)) {\n\t\t\t\t// HS8390 - A case where UpdraftPlus::memory_check_current() returns -1\n\t\t\t\t$memory_check_current = $updraftplus->memory_check_current();\n\t\t\t\tif ($memory_check_current > 0) {\n\t\t\t\t?>\n\t\t\t\t\t<div class=\"updated memory-limit\"><?php _e('Your PHP memory limit (set by your web hosting company) is very low. UpdraftPlus attempted to raise it but was unsuccessful. This plugin may struggle with a memory limit of less than 64 Mb - especially if you have very large files uploaded (though on the other hand, many sites will be successful with a 32Mb limit - your experience may vary).', 'updraftplus');?> <?php _e('Current limit is:', 'updraftplus');?> <?php echo $updraftplus->memory_check_current(); ?> MB</div>\n\t\t\t\t<?php }\n\t\t\t}\n\n\n\t\t\tif (!empty($updraftplus->errors)) {\n\t\t\t\techo '<div class=\"error updraft_list_errors\">';\n\t\t\t\t$updraftplus->list_errors();\n\t\t\t\techo '</div>';\n\t\t\t}\n\n\t\t\t$backup_history = UpdraftPlus_Backup_History::get_history();\n\t\t\tif (empty($backup_history)) {\n\t\t\t\tUpdraftPlus_Backup_History::rebuild();\n\t\t\t\t$backup_history = UpdraftPlus_Backup_History::get_history();\n\t\t\t}\n\n\t\t\t$tabflag = 'backups';\n\t\t\t$main_tabs = $this->get_main_tabs_array();\n\t\t\t\n\t\t\tif (isset($_REQUEST['tab'])) {\n\t\t\t\t$request_tab = sanitize_text_field($_REQUEST['tab']);\n\t\t\t\t$valid_tabflags = array_keys($main_tabs);\n\t\t\t\tif (in_array($request_tab, $valid_tabflags)) {\n\t\t\t\t\t$tabflag = $request_tab;\n\t\t\t\t} else {\n\t\t\t\t\t$tabflag = 'backups';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->include_template('wp-admin/settings/tab-bar.php', false, array('main_tabs' => $main_tabs, 'backup_history' => $backup_history, 'tabflag' => $tabflag));\n\t\t?>\n\t\t\n\t\t<div id=\"updraft-poplog\" >\n\t\t\t<pre id=\"updraft-poplog-content\"></pre>\n\t\t</div>\n\t\t\n\t\t<?php\n\t\t\t$this->include_template('wp-admin/settings/delete-and-restore-modals.php');\n\t\t?>\n\t\t\n\t\t<div id=\"updraft-navtab-backups-content\" <?php if ('backups' != $tabflag) echo 'class=\"updraft-hidden\"'; ?> style=\"<?php if ('backups' != $tabflag) echo 'display:none;'; ?>\">\n\t\t\t<?php\n\t\t\t\t$is_opera = (false !== strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') || false !== strpos($_SERVER['HTTP_USER_AGENT'], 'OPR/'));\n\t\t\t\t$tmp_opts = array('include_opera_warning' => $is_opera);\n\t\t\t\t$this->include_template('wp-admin/settings/tab-backups.php', false, array('backup_history' => $backup_history, 'options' => $tmp_opts));\n\t\t\t\t$this->include_template('wp-admin/settings/upload-backups-modal.php');\n\t\t\t?>\n\t\t</div>\n\t\t\n\t\t<div id=\"updraft-navtab-migrate-content\"<?php if ('migrate' != $tabflag) echo ' class=\"updraft-hidden\"'; ?> style=\"<?php if ('migrate' != $tabflag) echo 'display:none;'; ?>\">\n\t\t\t<?php\n\t\t\tif (has_action('updraftplus_migrate_tab_output')) {\n\t\t\t\tdo_action('updraftplus_migrate_tab_output');\n\t\t\t} else {\n\t\t\t\t$this->include_template('wp-admin/settings/migrator-no-migrator.php');\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t\n\t\t<div id=\"updraft-navtab-settings-content\" <?php if ('settings' != $tabflag) echo 'class=\"updraft-hidden\"'; ?> style=\"<?php if ('settings' != $tabflag) echo 'display:none;'; ?>\">\n\t\t\t<h2 class=\"updraft_settings_sectionheading\"><?php _e('Backup Contents And Schedule', 'updraftplus');?></h2>\n\t\t\t<?php UpdraftPlus_Options::options_form_begin(); ?>\n\t\t\t\t<?php $this->settings_formcontents(); ?>\n\t\t\t</form>\n\t\t\t<?php\n\t\t\t\t$our_keys = UpdraftPlus_Options::get_updraft_option('updraft_central_localkeys');\n\t\t\t\tif (!is_array($our_keys)) $our_keys = array();\n\n\t\t\t\t// Hide the UpdraftCentral Cloud wizard If the user already has a key created for either\n\t\t\t\t// updraftplus.com or self hosted version.\n\t\t\t\tif (empty($our_keys)) {\n\t\t\t?>\n\t\t\t<div id=\"updraftcentral_cloud_connect_container\" class=\"updraftcentral_cloud_connect hidden-in-updraftcentral\">\n\t\t\t\t<?php\n\n\t\t\t\t\t$email = '';\n\n\t\t\t\t\t// Checking email from \"Premium / Extensions\" tab\n\t\t\t\t\tif (defined('UDADDONS2_SLUG')) {\n\t\t\t\t\t\tglobal $updraftplus_addons2;\n\n\t\t\t\t\t\tif (is_a($updraftplus_addons2, 'UpdraftPlusAddons2') && is_callable(array($updraftplus_addons2, 'get_option'))) {\n\t\t\t\t\t\t\t$options = $updraftplus_addons2->get_option(UDADDONS2_SLUG.'_options');\n\n\t\t\t\t\t\t\tif (!empty($options['email'])) {\n\t\t\t\t\t\t\t\t$email = htmlspecialchars($options['email']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check the vault's email if we fail to get the \"email\" from the \"Premium / Extensions\" tab\n\t\t\t\t\tif (empty($email)) {\n\t\t\t\t\t\t$settings = UpdraftPlus_Storage_Methods_Interface::update_remote_storage_options_format('updraftvault');\n\t\t\t\t\t\tif (!is_wp_error($settings)) {\n\t\t\t\t\t\t\tif (!empty($settings['settings'])) {\n\t\t\t\t\t\t\t\tforeach ($settings['settings'] as $storage_options) {\n\t\t\t\t\t\t\t\t\tif (!empty($storage_options['email'])) {\n\t\t\t\t\t\t\t\t\t\t$email = $storage_options['email'];\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Checking any possible email we could find from the \"updraft_email\" option in case the\n\t\t\t\t\t// above two checks failed.\n\t\t\t\t\tif (empty($email)) {\n\t\t\t\t\t\t$possible_emails = $updraftplus->just_one_email(UpdraftPlus_Options::get_updraft_option('updraft_email'));\n\t\t\t\t\t\tif (!empty($possible_emails)) {\n\t\t\t\t\t\t\t// If we get an array from the 'just_one_email' result then we're going\n\t\t\t\t\t\t\t// to pull the very first entry and make use of that on the succeeding process.\n\t\t\t\t\t\t\tif (is_array($possible_emails)) $possible_emails = array_shift($possible_emails);\n\n\t\t\t\t\t\t\tif (is_string($possible_emails)) {\n\t\t\t\t\t\t\t\t$emails = explode(',', $possible_emails);\n\t\t\t\t\t\t\t\t$email = trim($emails[0]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->include_template('wp-admin/settings/updraftcentral-connect.php', false, array('email' => $email));\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\t\t}\n\t\t\t?>\n\t\t</div>\n\n\t\t<div id=\"updraft-navtab-expert-content\"<?php if ('expert' != $tabflag) echo ' class=\"updraft-hidden\"'; ?> style=\"<?php if ('expert' != $tabflag) echo 'display:none;'; ?>\">\n\t\t\t<?php $this->settings_advanced_tools(); ?>\n\t\t</div>\n\n\t\t<div id=\"updraft-navtab-addons-content\"<?php if ('addons' != $tabflag) echo ' class=\"updraft-hidden\"'; ?> style=\"<?php if ('addons' != $tabflag) echo 'display:none;'; ?>\">\n\t\t\n\t\t\t<?php\n\t\t\t\t$tab_addons = $this->include_template('wp-admin/settings/tab-addons.php', true, array('tabflag' => $tabflag));\n\t\t\t\t\n\t\t\t\techo apply_filters('updraftplus_addonstab_content', $tab_addons);\n\t\t\t\t\n\t\t\t?>\n\t\t\n\t\t</div>\n\t\t\n\t\t<?php\n\t\tdo_action('updraftplus_after_main_tab_content', $tabflag);\n\t\t// settings_header() opens a div\n\t\t$this->settings_footer();\n\t}", "public function ajax_form_settings() {\n\t\tglobal $current_user;\n\t\tget_currentuserinfo();\n\n\t\tif ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'visual_form_builder_form_settings' ) {\n\t\t\t$form_id = absint( $_REQUEST['form'] );\n\t\t\t$status = isset( $_REQUEST['status'] ) ? $_REQUEST['status'] : 'opened';\n\t\t\t$accordion = isset( $_REQUEST['accordion'] ) ? $_REQUEST['accordion'] : 'general-settings';\n\t\t\t$user_id = $current_user->ID;\n\n\t\t\t$form_settings = get_user_meta( $user_id, 'vfb-form-settings', true );\n\n\t\t\t$array = array(\n\t\t\t\t'form_setting_tab' \t=> $status,\n\t\t\t\t'setting_accordion' => $accordion\n\t\t\t);\n\n\t\t\t// Set defaults if meta key doesn't exist\n\t\t\tif ( !$form_settings || $form_settings == '' ) {\n\t\t\t\t$meta_value[ $form_id ] = $array;\n\n\t\t\t\tupdate_user_meta( $user_id, 'vfb-form-settings', $meta_value );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$form_settings[ $form_id ] = $array;\n\n\t\t\t\tupdate_user_meta( $user_id, 'vfb-form-settings', $form_settings );\n\t\t\t}\n\t\t}\n\n\t\tdie(1);\n\t}", "function myprefix_settings_manager() {\n\t\n\techo \"<h1>\";\n\t_e(settingsPageTitle);\n\techo \"</h1>\";\n\t\n\t// Setting up the action URI for our form, we need to send our \n\t//\tsettings to the options.php page then redirect back to our \n\t//\tsettings page.\n\t$optionsPageURI = \"/wp-admin/options.php\";\n\t$settingsPageURI = \"/wp-admin/options-general.php?page=settingsPageSlug\";\n\t$actionURI = $optionsPageURI . '?redirect_to=' . $settingsPageURI;\n\t\n\t?>\n\t\t<form action=\"<?php echo $actionURI; ?>\" method=\"post\">\n\t\t\t<?php settings_fields(settingsPageID); ?>\n\t\t\t<?php do_settings_sections(settingsPageID); ?>\n\t\t\t<div class=\"submit\">\n\t\t\t\t<input name=\"Submit\" class=\"primary-button\" type=\"submit\" value=\"<?php esc_attr_e('Save Changes');?>\" />\n\t\t\t</div>\n\t\t</form>\n\t\t\n<?php\n}", "public function load_settings() {\n\t\tadd_action( 'admin_init', [ $this, 'register_option' ] );\n\t\tadd_action( 'admin_init', [ $this, 'license_action' ] );\n\t\tadd_action( 'admin_notices', [ $this, 'show_error' ] );\n\t\tadd_action( 'admin_init', [ $this, 'update_settings' ] );\n\t\tadd_filter( 'http_request_args', [ $this, 'disable_wporg_request' ], 5, 2 );\n\t\tadd_filter( 'edd_sl_updater_add_admin_page', [ $this, 'license_page' ] );\n\t}", "function pf_ajax_usersystemhandler(){\n\n\theader('Content-Type: application/json; charset=UTF-8;');\n\n\tif(isset($_POST['formtype']) && $_POST['formtype']!=''){\n\t\t$formtype = esc_attr($_POST['formtype']);\n\t}\n\n $lang = '';\n if(isset($_POST['lang']) && $_POST['lang']!=''){\n $lang = sanitize_text_field($_POST['lang']);\n }\n\n if(function_exists('icl_t')) {\n if (!empty($lang)) {\n do_action( 'wpml_switch_language', $lang );\n }\n }\n\n if(isset($_POST['vars']) && $_POST['vars']!=''){\n $vars = array();\n parse_str($_POST['vars'], $vars);\n\n if (is_array($vars)) {\n $vars = PFCleanArrayAttr('PFCleanFilters',$vars);\n } else {\n $vars = esc_attr($vars);\n }\n }\n $pfrecheck = PFRECIssetControl('setupreCaptcha_general_status','','0');\n \n if (wp_get_referer()) {\n $wpreferurl = esc_url(wp_get_referer());\n }else{\n $wpreferurl = esc_url(home_url());\n }\n\n /*\n $setup4_membersettings_requestupdateinfo = PFASSIssetControl('setup4_membersettings_requestupdateinfo','','1');\n $setup4_membersettings_dashboard = PFSAIssetControl('setup4_membersettings_dashboard','',site_url());\n $setup4_membersettings_dashboard_link = get_permalink($setup4_membersettings_dashboard);\n\n\n switch ($setup4_membersettings_requestupdateinfo) {\n case '1':\n $redirectpage = $setup4_membersettings_dashboard_link.$pfmenu_perout.'ua=profile';\n break;\n case '2':\n $redirectpage = $setup4_membersettings_dashboard_link.$pfmenu_perout.'ua=myitems';\n break;\n case '3':\n $redirectpage = $homeurllink;\n break;\n }\n $wpreferurl = \n */\n\n\tswitch($formtype){\n\t\tcase 'login':\n if (is_array($vars)) {\n $redirectpage = (isset($vars['redirectpage']))? $vars['redirectpage']:0;\n\n $pfrechecklg = PFRECIssetControl('setupreCaptcha_general_login_status','','0');\n\n if(in_array('rem', $vars)){\n $rememberme = ($vars['rem'] == 'on') ? true : false ;\n }else{\n $rememberme = false;\n }\n $info = array();\n\n $info['user_login'] = sanitize_user($vars['username'],true);\n $info['user_password'] = trim(html_entity_decode($vars['password']));\n $info['remember'] = $rememberme;\n\n if ( $pfrecheck == 1 && $pfrechecklg == 1) {\n if (isset($vars['g-recaptcha-response'])) {\n $pfReResult = PFCGreCaptcha($vars['g-recaptcha-response']);\n if ($pfReResult == 1) {\n $user_signon = wp_signon( $info, true );\n if ( is_wp_error( $user_signon )) {\n echo json_encode( array( 'login'=>false, 'mes'=>esc_html__( 'Wrong username or password!','pointfindert2d' )));\n } else {\n wp_set_auth_cookie($user_signon->ID);\n echo json_encode( array( 'login'=>true, 'mes'=>esc_html__('Login successful, redirecting...','pointfindert2d' ),'referurl' => $wpreferurl,'redirectpage' => $redirectpage));\n }\n }else{\n echo json_encode( array( 'login'=>false, 'mes'=>esc_html__('Wrong reCaptcha. Please verify first.','pointfindert2d' )));\n }\n }else{\n echo json_encode( array( 'login'=>false, 'mes'=>esc_html__( 'Please enter reCaptcha!','pointfindert2d' )));\n }\n }else{\n $user_signon = wp_signon( $info, true );\n\n if ( is_wp_error( $user_signon )) {\n echo json_encode( array( 'login'=>false, 'mes'=>esc_html__( 'Wrong username or password!','pointfindert2d' )));\n } else {\n wp_set_auth_cookie($user_signon->ID);\n echo json_encode( array( 'login'=>true, 'mes'=>esc_html__('Login successful, redirecting...','pointfindert2d' ),'referurl' => $wpreferurl,'redirectpage' => $redirectpage));\n }\n }\n \n }\n\t\tbreak;\n\n case 'register':\n $pfrechecklg = PFRECIssetControl('setupreCaptcha_general_reg_status','','0');\n if ( $pfrecheck == 1 && $pfrechecklg == 1) {\n if (isset($vars['g-recaptcha-response'])) {\n $pfReResult = PFCGreCaptcha($vars['g-recaptcha-response']);\n \n if ($pfReResult != 1) {\n $progressok = 0;\n echo json_encode( array( 'login'=>false, 'mes'=>esc_html__('Wrong reCaptcha. Please verify first.','pointfindert2d' )));\n }else{\n $progressok = 1;\n }\n\n }else{\n $progressok = 0;\n echo json_encode( array( 'login'=>false, 'mes'=>esc_html__( 'Please enter reCaptcha!','pointfindert2d' )));\n }\n }else{\n $progressok = 1;\n }\n\n if($progressok == 1){\n\n $username = $vars['username'];\n $email = sanitize_email($vars['email']);\n \n\n $username = sanitize_user( $username, $strict = true );\n \n $user_exist = username_exists( $username );\n $user_email_exist = email_exists( $email );\n \n \n if ( $user_exist || $user_email_exist ) {\n\n $message = sprintf(esc_html__(\"Oops! There appears to be an account already with that name and/or email. %s Please change username and/or email.\",\"pointfindert2d\"),'<br/>');\n echo json_encode( array( 'status'=>01, 'mes'=>$message));\n exit;\n\n } else {\n\n \n $password = wp_generate_password( 12, false );\n $user_id = wp_create_user( $username, $password, $email );\n\n wp_update_user( array( 'ID' => $user_id ));\n\n $user = new WP_User( $user_id );\n $user->set_role( 'subscriber' );\n\n \n $message_reply = pointfinder_mailsystem_mailsender(\n \t\t\t\t\tarray(\n \t\t\t\t\t\t'toemail' => $email,\n \t\t\t\t 'predefined' => 'registration',\n \t\t\t\t 'data' => array('password' => $password,'username'=>$username),\n \t\t\t\t\t)\n \t\t\t\t);\n\n $setup33_emailsettings_mainemail = PFMSIssetControl('setup33_emailsettings_mainemail','','1');\n pointfinder_mailsystem_mailsender(\n array(\n 'toemail' => $setup33_emailsettings_mainemail,\n 'predefined' => 'registrationadmin',\n 'data' => array('username'=>$username),\n )\n );\n\n $auto_ll = PFASSIssetControl('as_autologin','','0');\n\n if ( $message_reply) {\n\n \n if ($auto_ll == 1) {\n $message = esc_html__(\"Success! Check your email for your password! You will be auto login in 3sec.\",\"pointfindert2d\");\n\n \n $user = get_user_by( 'id', $user_id ); \n if( $user ) {\n wp_set_current_user( $user_id, $user->user_login );\n wp_set_auth_cookie( $user_id );\n do_action( 'wp_login', $user->user_login );\n }\n } else {\n $message = esc_html__(\"Success! Check your email for your password!\",\"pointfindert2d\");\n }\n \n echo json_encode( array( 'status'=>0, 'mes'=>$message,'auto'=>$auto_ll));\n\n } else {\n\n $message = esc_html__(\"Looks like your Mail Configuration not completed. Please check Mail Config Panel > Email Settings under PF Settings\",\"pointfindert2d\");\n echo json_encode( array( 'status'=>03, 'mes'=>$message,'auto'=>0));\n }\n }\n }\n break;\n\n case 'lp':\n\n function pfretrieve_password($user_login) {\n global $wpdb, $current_site;\n\n if ( empty( $user_login) ) {\n return false;\n } else if ( strpos( $user_login, '@' ) ) {\n $user_data = get_user_by( 'email', trim( $user_login ) );\n if ( empty( $user_data ) )\n return false;\n } else {\n $login = trim($user_login);\n $user_data = get_user_by('login', $login);\n }\n\n do_action('lostpassword_post');\n\n\n if ( !$user_data ){return false;}\n\n // redefining user_login ensures we return the right case in the email\n $user_login = $user_data->user_login;\n $user_email = $user_data->user_email;\n\n do_action('retrieve_password', $user_login);\n\n $allow = apply_filters('allow_password_reset', true, $user_data->ID);\n\n if ( ! $allow ){\n return false;\n }else if ( is_wp_error($allow) ){\n return false;\n }\n\n $key = '';//$wpdb->get_var($wpdb->prepare(\"SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s\", $user_login));\n if ( empty($key) ) {\n // Generate something random for a key...\n $key = wp_generate_password(20, false);\n do_action('retrieve_password_key', $user_login, $key);\n\n\n if ( empty( $wp_hasher ) ) {\n require_once ABSPATH . 'wp-includes/class-phpass.php';\n $wp_hasher = new PasswordHash( 8, true );\n }\n /*\n Change this\n $hashed = $wp_hasher->HashPassword( $key );\n */\n $hashed = time() . ':' . $wp_hasher->HashPassword( $key );\n // Now insert the new md5 key into the db\n $wpdb->update($wpdb->users, array('user_activation_key' => $hashed), array('user_login' => $user_login));\n }\n\n $message_reply = pointfinder_mailsystem_mailsender(\n\t\t\t\t\t array(\n\t\t\t\t\t\t'toemail' => $user_email,\n\t\t\t\t 'predefined' => 'lostpassword',\n\t\t\t\t 'data' => array('keylink' => network_site_url(\"wp-login.php?action=rp&key=$key&login=\" . rawurlencode($user_login), 'login'),'username'=>$user_login),\n\t\t\t\t\t )\n\t\t\t\t );\n\n\n if ( !$message_reply){\n return esc_html__('The e-mail could not be sent.','pointfindert2d') . \"<br />\\n\" . esc_html__('Possible reason: Your host may have disabled the mail() function...','pointfindert2d');\n }\n\n return esc_html__('Password reset link has been sent to your email.','pointfindert2d');\n }\n\n $pflpwd = esc_html__('Unfortunately we can not find this email and/or username in our records.','pointfindert2d');\n $pflpwd_status = 1;\n \n $pfrechecklg = PFRECIssetControl('setupreCaptcha_general_fb_status','','0');\n\n if ( $pfrecheck == 1 && $pfrechecklg == 1) {\n if (isset($vars['g-recaptcha-response'])) {\n $pfReResult = PFCGreCaptcha($vars['g-recaptcha-response']);\n \n if ($pfReResult != 1) {\n $progressok = 0;\n echo json_encode( array( 'login'=>false, 'mes'=>esc_html__('Wrong reCaptcha. Please verify first.','pointfindert2d' )));\n }else{\n $progressok = 1;\n }\n\n }else{\n $progressok = 0;\n echo json_encode( array( 'login'=>false, 'mes'=>esc_html__( 'Please enter reCaptcha!','pointfindert2d' )));\n }\n }else{\n $progressok = 1;\n }\n\n if($progressok == 1){\n if (!empty($vars['username'])) {\n if ( username_exists( $vars['username'] ) ){\n $user_login = sanitize_text_field( $vars['username'] );\n $pflpwd = pfretrieve_password($user_login);\n $pflpwd_status = 0;\n }\n }\n\n if(!empty($vars['email'])){\n $user_email = sanitize_email( $vars['email'] );\n if( email_exists( $user_email )) {\n $user_retemail = get_user_by( 'email', $user_email );\n $pflpwd = pfretrieve_password($user_retemail->data->user_login);\n $pflpwd_status = 0;\n }\n }\n if($pflpwd_status == 0){\n echo json_encode( array( 'status'=>0, 'mes'=>$pflpwd));\n }else{\n echo json_encode( array( 'status'=>1, 'mes'=>$pflpwd));\n };\n }\n break;\n\n\n case 'connectsocial':\n\n if (is_array($vars)) {\n $redirectpage = (isset($vars['redirectpage']))? $vars['redirectpage']:0;\n\n $info = array();\n $info['user_login'] = sanitize_user($vars['username'],true);\n $info['user_password'] = trim(html_entity_decode($vars['password']));\n $info['remember'] = false;\n\n $user_signon = wp_signon( $info, true );\n\n if ( !is_wp_error( $user_signon )) {\n $scontenttype = (isset($vars['ctype']))? $vars['ctype']:0;\n $scontenttext = (isset($vars['ctext']))? json_decode(base64_decode($vars['ctext']),true):array();\n\n $homeurllink = site_url($path = '/');\n $pfmenu_perout = PFPermalinkCheck();\n\n $setup4_membersettings_requestupdateinfo = PFASSIssetControl('setup4_membersettings_requestupdateinfo','','1');\n $setup4_membersettings_dashboard = PFSAIssetControl('setup4_membersettings_dashboard','',site_url());\n $setup4_membersettings_dashboard_link = get_permalink($setup4_membersettings_dashboard);\n\n\n $redirectpage = $homeurllink;\n switch ($setup4_membersettings_requestupdateinfo) {\n case '1':\n $redirectpage = $setup4_membersettings_dashboard_link.$pfmenu_perout.'ua=profile';\n break;\n case '2':\n $redirectpage = $setup4_membersettings_dashboard_link.$pfmenu_perout.'ua=myitems';\n break;\n case '3':\n $redirectpage = $homeurllink;\n break;\n }\n\n if (!empty($scontenttext) && !empty($scontenttext['username'])) {\n\n global $wpdb;\n\n $resultid = '';\n\n switch ($scontenttype) {\n case '1':/* Facebook */\n\n $resultid = $wpdb->get_var( $wpdb->prepare(\n \"SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s and meta_value = %s\", \n 'user_socialloginid',\n $scontenttext['dbid']\n ) );\n if ( !empty($resultid) ) {\n wp_set_auth_cookie($user_signon->ID);\n echo json_encode( array( 'login'=>true, 'mes'=>esc_html__('Login successful, this social account already have a connection.','pointfindert2d' ),'referurl' => $wpreferurl,'redirectpage' => $redirectpage));\n die();\n }else{\n $resultid = $wpdb->get_var( $wpdb->prepare(\"SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s and meta_value = %s\", 'user_socialloginidfb',$scontenttext['dbid']) );\n }\n\n if ( !empty($resultid) ) {\n wp_set_auth_cookie($user_signon->ID);\n echo json_encode( array( 'login'=>true, 'mes'=>esc_html__('Login successful, this social account already have a connection.(2)','pointfindert2d' ),'referurl' => $wpreferurl,'redirectpage' => $redirectpage));\n die();\n }\n \n update_user_meta($user_signon->ID, 'user_socialloginidfb', $scontenttext['dbid'], true );\n $fbid = str_replace('fb', '', $scontenttext['dbid']);\n update_user_meta($user_signon->ID, 'user_facebook', 'http://facebook.com/'.$fbid);\n break;\n\n case '2':/* Twitter */\n $resultid = $wpdb->get_var( $wpdb->prepare(\n \"SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s and meta_value = %s\", \n 'user_socialloginid',\n $scontenttext['dbid']\n ) );\n if ( !empty($resultid) ) {\n wp_set_auth_cookie($user_signon->ID);\n echo json_encode( array( 'login'=>true, 'mes'=>esc_html__('Login successful, this social account already have a connection.','pointfindert2d' ),'referurl' => $wpreferurl,'redirectpage' => $redirectpage));\n die();\n }else{\n $resultid = $wpdb->get_var( $wpdb->prepare(\"SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s and meta_value = %s\", 'user_socialloginidtw',$scontenttext['dbid']) );\n }\n\n if ( !empty($resultid) ) {\n wp_set_auth_cookie($user_signon->ID);\n echo json_encode( array( 'login'=>true, 'mes'=>esc_html__('Login successful, this social account already have a connection.(2)','pointfindert2d' ),'referurl' => $wpreferurl,'redirectpage' => $redirectpage));\n die();\n }\n\n update_user_meta($user_signon->ID, 'user_socialloginidtw', $scontenttext['dbid'], true );\n update_user_meta($user_signon->ID, 'user_twitter', 'http://twitter.com/'.$scontenttext['screen_name']);\n break;\n\n case '3':/* Google */\n $resultid = $wpdb->get_var( $wpdb->prepare(\n \"SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s and meta_value = %s\", \n 'user_socialloginid',\n $scontenttext['dbid']\n ) );\n if ( !empty($resultid) ) {\n wp_set_auth_cookie($user_signon->ID);\n echo json_encode( array( 'login'=>true, 'mes'=>esc_html__('Login successful, this social account already have a connection.','pointfindert2d' ),'referurl' => $wpreferurl,'redirectpage' => $redirectpage));\n die();\n }else{\n $resultid = $wpdb->get_var( $wpdb->prepare(\"SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s and meta_value = %s\", 'user_socialloginidgl',$scontenttext['dbid']) );\n }\n\n if ( !empty($resultid) ) {\n wp_set_auth_cookie($user_signon->ID);\n echo json_encode( array( 'login'=>true, 'mes'=>esc_html__('Login successful, this social account already have a connection.(2)','pointfindert2d' ),'referurl' => $wpreferurl,'redirectpage' => $redirectpage));\n die();\n }\n\n update_user_meta($user_signon->ID, 'user_socialloginidgl', $scontenttext['dbid'], true );\n $glid = str_replace('g', '', $scontenttext['dbid']);\n update_user_meta($user_signon->ID, 'user_googleplus', 'https://plus.google.com/'.$glid);\n break;\n\n case '4':/* VK */\n $resultid = $wpdb->get_var( $wpdb->prepare(\n \"SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s and meta_value = %s\", \n 'user_socialloginid',\n $scontenttext['dbid']\n ) );\n if ( !empty($resultid) ) {\n wp_set_auth_cookie($user_signon->ID);\n echo json_encode( array( 'login'=>true, 'mes'=>esc_html__('Login successful, this social account already have a connection.','pointfindert2d' ),'referurl' => $wpreferurl,'redirectpage' => $redirectpage));\n die();\n }else{\n $resultid = $wpdb->get_var( $wpdb->prepare(\"SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s and meta_value = %s\", 'user_socialloginidvk',$scontenttext['dbid']) );\n }\n\n if ( !empty($resultid) ) {\n wp_set_auth_cookie($user_signon->ID);\n echo json_encode( array( 'login'=>true, 'mes'=>esc_html__('Login successful, this social account already have a connection.(2)','pointfindert2d' ),'referurl' => $wpreferurl,'redirectpage' => $redirectpage));\n die();\n }\n\n update_user_meta($user_signon->ID, 'user_socialloginidvk', $scontenttext['dbid'], true );\n\n /*$vkid = str_replace('vk', '', $scontenttext['dbid']);\n\n update_user_meta($user_signon->ID, 'user_vk', 'https://vk.com/id'.$vkid);*/\n break;\n }\n\n }\n\n \n wp_set_auth_cookie($user_signon->ID);\n echo json_encode( array( 'login'=>true, 'mes'=>esc_html__('Login successful, accounts are connected, redirecting...','pointfindert2d' ),'referurl' => $wpreferurl,'redirectpage' => $redirectpage));\n } else {\n echo json_encode( array( 'login'=>false, 'mes'=>esc_html__( 'Wrong username or password!','pointfindert2d' )));\n }\n }\n\n\n break;\n\n case 'createsocial':\n\n if (is_array($vars)){ \n $redirectpage = (isset($vars['redirectpage']))? $vars['redirectpage']:0;\n\n $scontenttype = (isset($vars['ctype']))? $vars['ctype']:0;\n $scontenttext = (isset($vars['ctext']))? json_decode(base64_decode($vars['ctext']),true):array();\n\n $homeurllink = site_url($path = '/');\n $pfmenu_perout = PFPermalinkCheck();\n\n\n $setup4_membersettings_requestupdateinfo = PFASSIssetControl('setup4_membersettings_requestupdateinfo','','1');\n $setup4_membersettings_dashboard = PFSAIssetControl('setup4_membersettings_dashboard','',site_url());\n $setup4_membersettings_dashboard_link = get_permalink($setup4_membersettings_dashboard);\n\n\n $redirectpage = $homeurllink;\n switch ($setup4_membersettings_requestupdateinfo) {\n case '1':\n $redirectpage = $setup4_membersettings_dashboard_link.$pfmenu_perout.'ua=profile';\n break;\n case '2':\n $redirectpage = $setup4_membersettings_dashboard_link.$pfmenu_perout.'ua=myitems';\n break;\n case '3':\n $redirectpage = $homeurllink;\n break;\n }\n \n if (!empty($scontenttext) && !empty($scontenttext['username'])) {\n\n switch ($scontenttype) {\n case '1':\n /* Facebook */\n $user_exist = username_exists( $scontenttext['username'] );\n $user_email_exist = email_exists( $scontenttext['email'] );\n\n if ( $user_exist || $user_email_exist ) {\n\n $message = sprintf(esc_html__(\"Oops! There appears to be an account already with that name and/or email. %s Please change username and/or email.\",\"pointfindert2d\"),'<br/>');\n echo json_encode( array( 'status'=>01, 'mes'=>$message));\n exit;\n\n } else {\n $password = wp_generate_password( 12, false );\n $user_id = wp_create_user( $scontenttext['username'], $password, $scontenttext['email'] );\n $user = new WP_User( $user_id );\n $fbid = str_replace('fb', '', $scontenttext['dbid']);\n update_user_meta($user_id, 'user_socialloginid', $scontenttext['dbid'], true );\n update_user_meta($user_id, 'user_facebook', 'http://facebook.com/'.$fbid);\n\n if (isset($scontenttext['name'])) {\n wp_update_user(array('ID'=>$user_id,'nickname'=>$scontenttext['name'])); \n }\n\n if (isset($scontenttext['first_name'])) {\n update_user_meta($user_id, 'first_name', $scontenttext['first_name']);\n }\n\n if (isset($scontenttext['last_name'])) {\n update_user_meta($user_id, 'last_name', $scontenttext['last_name']);\n }\n\n pointfinder_mailsystem_mailsender(\n array(\n 'toemail' => $scontenttext['email'],\n 'predefined' => 'registration',\n 'data' => array('password' => $password,'username'=>$scontenttext['username']),\n )\n );\n\n $message = esc_html__(\"Success! Check your email for your password! You will be auto login in 3sec.\",\"pointfindert2d\");\n\n $user = get_user_by( 'id', $user_id ); \n if( $user ) {\n wp_set_current_user( $user_id, $user->user_login );\n wp_set_auth_cookie( $user_id );\n do_action( 'wp_login', $user->user_login );\n }\n\n echo json_encode(array('status'=>0, 'mes'=>$message,'auto'=>1,'redirect'=>$redirectpage));\n }\n break;\n\n case '2':\n /* Twitter */\n $domain_name = preg_replace('/^www\\./','',$_SERVER['SERVER_NAME']);\n if (!empty($vars['email_n'])) {\n $email = $vars['email_n'];\n }else{\n $email = sanitize_email('twitter_user_'.$scontenttext['email'].'@'.$domain_name);\n }\n\n $user_exist = username_exists( $scontenttext['username'] );\n $user_email_exist = email_exists( $email );\n\n if ( $user_exist || $user_email_exist ) {\n\n $message = sprintf(esc_html__(\"Oops! There appears to be an account already with that name and/or email. %s Please change username and/or email.\",\"pointfindert2d\"),'<br/>');\n echo json_encode( array( 'status'=>01, 'mes'=>$message));\n exit;\n\n } else {\n \n $password = wp_generate_password( 12, false );\n $user_id = wp_create_user( $scontenttext['username'], $password, $email );\n $user = new WP_User( $user_id );\n $ggid = str_replace('g', '', $scontenttext['dbid']);\n update_user_meta($user_id, 'user_socialloginid', $scontenttext['dbid'], true );\n update_user_meta($user_id, 'user_twitter', 'http://twitter.com/'.$scontenttext['screen_name']);\n\n \n if (!empty($vars['email_n'])) {\n pointfinder_mailsystem_mailsender(\n array(\n 'toemail' => $email,\n 'predefined' => 'registration',\n 'data' => array('password' => $password,'username'=>$scontenttext['username']),\n )\n );\n }\n\n $message = esc_html__(\"Success! Check your email for your password! You will be auto login in 3sec.\",\"pointfindert2d\");\n\n $user = get_user_by( 'id', $user_id ); \n if( $user ) {\n wp_set_current_user( $user_id, $user->user_login );\n wp_set_auth_cookie( $user_id );\n do_action( 'wp_login', $user->user_login );\n }\n\n echo json_encode(array('status'=>0, 'mes'=>$message,'auto'=>1,'redirect'=>$redirectpage));\n }\n break;\n\n case '3':\n /* Google */\n $user_exist = username_exists( $scontenttext['username'] );\n $user_email_exist = email_exists( $scontenttext['email'] );\n\n if ( $user_exist || $user_email_exist ) {\n\n $message = sprintf(esc_html__(\"Oops! There appears to be an account already with that name and/or email. %s Please change username and/or email.\",\"pointfindert2d\"),'<br/>');\n echo json_encode( array( 'status'=>01, 'mes'=>$message));\n exit;\n\n } else {\n $password = wp_generate_password( 12, false );\n $user_id = wp_create_user( $scontenttext['username'], $password, $scontenttext['email'] );\n $user = new WP_User( $user_id );\n $ggid = str_replace('g', '', $scontenttext['dbid']);\n update_user_meta($user_id, 'user_socialloginid', $scontenttext['dbid'], true );\n update_user_meta($user_id, 'user_googleplus', 'https://plus.google.com/'.$ggid);\n\n pointfinder_mailsystem_mailsender(\n array(\n 'toemail' => $scontenttext['email'],\n 'predefined' => 'registration',\n 'data' => array('password' => $password,'username'=>$scontenttext['username']),\n )\n );\n\n $message = esc_html__(\"Success! Check your email for your password! You will be auto login in 3sec.\",\"pointfindert2d\");\n\n $user = get_user_by( 'id', $user_id ); \n if( $user ) {\n wp_set_current_user( $user_id, $user->user_login );\n wp_set_auth_cookie( $user_id );\n do_action( 'wp_login', $user->user_login );\n }\n\n echo json_encode(array('status'=>0, 'mes'=>$message,'auto'=>1,'redirect'=>$redirectpage));\n }\n break;\n\n case '4':\n /* VK */\n $domain_name = preg_replace('/^www\\./','',$_SERVER['SERVER_NAME']);\n if (!empty($vars['email_n'])) {\n $email = $vars['email_n'];\n }else{\n $email = sanitize_email('vk_user_'.$scontenttext['email'].'@'.$domain_name);\n }\n\n $user_exist = username_exists( $scontenttext['username'] );\n $user_email_exist = email_exists( $email );\n\n if ( $user_exist || $user_email_exist ) {\n\n $message = sprintf(esc_html__(\"Oops! There appears to be an account already with that name and/or email. %s Please change username and/or email.\",\"pointfindert2d\"),'<br/>');\n echo json_encode( array( 'status'=>01, 'mes'=>$message));\n exit;\n\n } else {\n \n $password = wp_generate_password( 12, false );\n $user_id = wp_create_user( $scontenttext['username'], $password, $email );\n $user = new WP_User( $user_id );\n $ggid = str_replace('g', '', $scontenttext['dbid']);\n update_user_meta($user_id, 'user_socialloginid', $scontenttext['dbid'], true );\n /*update_user_meta($user_id, 'user_twitter', 'http://twitter.com/'.$scontenttext['screen_name']);*/\n\n \n if (!empty($vars['email_n'])) {\n pointfinder_mailsystem_mailsender(\n array(\n 'toemail' => $email,\n 'predefined' => 'registration',\n 'data' => array('password' => $password,'username'=>$scontenttext['username']),\n )\n );\n }\n\n $message = esc_html__(\"Success! Check your email for your password! You will be auto login in 3sec.\",\"pointfindert2d\");\n\n $user = get_user_by( 'id', $user_id ); \n\n\n if (isset($scontenttext['first_name'])) {\n update_user_meta($user_id, 'first_name', $scontenttext['first_name']);\n }\n\n if (isset($scontenttext['last_name'])) {\n update_user_meta($user_id, 'last_name', $scontenttext['last_name']);\n }\n\n if( $user ) {\n wp_set_current_user( $user_id, $user->user_login );\n wp_set_auth_cookie( $user_id );\n do_action( 'wp_login', $user->user_login );\n }\n\n echo json_encode(array('status'=>0, 'mes'=>$message,'auto'=>1,'redirect'=>$redirectpage));\n }\n break;\n }\n\n }\n } \n\n break; \n\t}\ndie();\n}", "public function settings_admin_page_callback()\n {\n $instance = Custom_Settings_Page_Api::instance();\n $instance->option_name('mo_analytics');\n $instance->page_header(__('Statistics', 'mailoptin'));\n $this->register_core_settings($instance);\n if (apply_filters('mailoptin_enable_advance_analytics', false)) {\n $instance->sidebar(SettingsPage::get_instance()->analytic_chart_sidebar());\n SettingsPage::get_instance()->process_actions();\n }\n $instance->build(!apply_filters('mailoptin_enable_advance_analytics', false));\n }", "function _dataone_admin_settings_submit($form, &$form_state) {\n global $base_url;\n\n // Let menu_execute_active_handler() know that a menu rebuild may be required.\n variable_set('menu_rebuild_needed', TRUE);\n\n // Register updated node document.\n drupal_set_message(t('Don\\'t forget to register your changes with DataONE'), 'warning');\n $register_url = $base_url . '/admin/config/services/dataone/register/';\n $selected_versions = variable_get(DATAONE_VARIABLE_API_VERSIONS);\n foreach ($selected_versions as $version => $label) {\n $register_version_url = $register_url . $version;\n drupal_set_message(t('Register @ver: !url', array('@ver' => $label, '!url' => $register_version_url)), 'warning');\n }\n\n}", "public function admin_init_actions(){\n \t\tregister_setting( 'deeppress_options_group', 'remote_url', 'myplugin_callback' );\n\t\t$this->process_actions();\n\t}", "function ROMP_admin_form_response(){\n\n\t\tif( isset( $_POST['ROMP_add_user_meta_nonce'] ) && wp_verify_nonce( $_POST['ROMP_add_user_meta_nonce'], 'ROMP_add_user_meta_form_nonce') ) {\n\t\t\t\n\t\t\t$crmMID = $_POST['crmMID'];\n\t\t\t$CFLink = $_POST['CFLink'];\n\t\t\t$result = $this->wpdb->get_results(\"SELECT * FROM wp_romp_settings\");\n\n\t\t\tif(empty($result)){\n\n\t\t\t\t$sql = \"INSERT INTO `wp_romp_settings`(`romp_crm_id`, `romp_cf_link`) VALUES ('\".$crmMID.\"','\".$CFLink.\"')\";\n\t\t\t\techo $this->wpdb->query($sql);\n\t\t\t\twp_safe_redirect(admin_url('admin.php?page=romp_enquiry_settings&message=1'));\n\t\t\t\texit;\n\n\t\t\t}else{\n\n\t\t\t\tforeach ( $result as $page ){\n\t\t\t\t\t$sql = 'UPDATE wp_romp_settings SET romp_crm_id = \"'.$crmMID.'\", romp_cf_link = \"'.$CFLink.'\" WHERE romp_crm_id='.$page->romp_crm_id;\n\t\t\t\t\techo $this->wpdb->query($sql);\n\t\t\t\t}\n\t\t\t\twp_safe_redirect(admin_url('admin.php?page=romp_enquiry_settings&message=2'));\n\t\t\t\texit;\n\n\t\t\t}\n\n\t\t}else {\n\n\t\t\t// wp_safe_redirect(admin_url('admin.php?page=romp_enquiry_settings&message=3'));\n\t\t\techo \"ERROR\";\n\n\t\t}\n\n\t}", "static public function save_setup_settings() {\n\n $data = WPP_F::parse_str( $_REQUEST[ 'data' ] );\n\n $_setup = array(\n 'api' => WPP_API_URL_STANDARDS,\n 'data' => $data,\n 'schema' => self::get_settings_schema()\n );\n\n $_current_settings = get_option('wpp_settings');\n\n $_modified_settings = WPP_F::extend( $_current_settings, $_setup['schema'] );\n\n //die( '<pre>' . print_r( $_modified_settings['field_alias'], true ) . '</pre>' );\n\n if( is_array( $_modified_settings['property_stats_groups'] ) ) {\n // $_modified_settings['property_stats_groups'] = array_unique( $_modified_settings['property_stats_groups'] );\n }\n\n // @note This kills c.rabbit.ci response via Varnish, perhaps some sort of log output somewhere.\n if( is_array( $_modified_settings['searchable_attributes'] ) ) {\n // $_modified_settings[ 'searchable_attributes' ] = array_unique( $_modified_settings[ 'searchable_attributes' ] );\n }\n\n // preserve field aliases\n $_modified_settings['field_alias'] = $_current_settings['field_alias'];\n\n $_modified_settings['_updated'] = time();\n\n update_option( 'wpp_settings', $_modified_settings );\n\n $posts_array = get_posts( array(\n 'posts_per_page' => 1,\n 'orderby' => 'date',\n 'order' => 'DESC',\n 'post_type' => 'property',\n 'post_status' => 'publish',\n 'suppress_filters' => true\n ) );\n\n $return[ 'props_single' ] = get_permalink( $posts_array[ 0 ]->ID );\n\n $return[ '_settings' ] = $data[ 'wpp_settings' ];\n\n self::flush_cache();\n\n wp_send_json( $return );\n\n }", "public function save_builder_settings() {\n\t\t_deprecated_function( 'save_builder_settings', '1.6', 'save_builder' );\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforminator_validate_ajax( \"forminator_save_builder_fields\" );\n\n\t\t$submitted_data = $this->get_post_data();\n\t\t$fields = array();\n\t\t$id = isset( $submitted_data['form_id'] ) ? $submitted_data['form_id'] : null;\n\t\t$id = intval( $id );\n\t\t$title = sanitize_text_field( $submitted_data['formName'] );\n\t\t$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';\n\t\t$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';\n\n\t\tif ( is_null( $id ) || $id <= 0 ) {\n\t\t\t$form_model = new Forminator_Custom_Form_Model();\n\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = Forminator_Custom_Form_Model::STATUS_PUBLISH;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$form_model = Forminator_Custom_Form_Model::model()->load( $id );\n\n\t\t\tif ( ! is_object( $form_model ) ) {\n\t\t\t\twp_send_json_error( __( \"Form model doesn't exist\", Forminator::DOMAIN ) );\n\t\t\t}\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = $form_model->status;\n\t\t\t}\n\t\t}\n\t\t$form_model->set_var_in_array( 'name', 'formName', $submitted_data, 'forminator_sanitize_field' );\n\n\t\t// Sanitize settings\n\t\t$settings = forminator_sanitize_field( $submitted_data['data'] );\n\n\t\t// Sanitize custom css\n\t\tif ( isset( $submitted_data['data']['custom_css'] ) ) {\n\t\t\t$settings['custom_css'] = sanitize_textarea_field( $submitted_data['data']['custom_css'] );\n\t\t}\n\n\t\t// Sanitize thank you message\n\t\tif ( isset( $submitted_data['data']['thankyou-message'] ) ) {\n\t\t\t$settings['thankyou-message'] = $submitted_data['data']['thankyou-message'];\n\t\t}\n\n\t\t// Sanitize user email message\n\t\tif ( isset( $submitted_data['data']['user-email-editor'] ) ) {\n\t\t\t$settings['user-email-editor'] = $submitted_data['data']['user-email-editor'];\n\t\t}\n\n\t\t// Sanitize admin email message\n\t\tif ( isset( $submitted_data['data']['admin-email-editor'] ) ) {\n\t\t\t$settings['admin-email-editor'] = $submitted_data['data']['admin-email-editor'];\n\t\t}\n\n\t\t$settings['formName'] = $title;\n\t\t$settings['version'] = $version;\n\t\t$form_model->settings = $settings;\n\n\t\t// status\n\t\t$form_model->status = $status;\n\n\t\t// Save data\n\t\t$id = $form_model->save();\n\n\t\t// add privacy settings to global option\n\t\t$override_privacy = false;\n\t\tif ( isset( $settings['enable-submissions-retention'] ) ) {\n\t\t\t$override_privacy = filter_var( $settings['enable-submissions-retention'], FILTER_VALIDATE_BOOLEAN );\n\t\t}\n\t\t$retention_number = null;\n\t\t$retention_unit = null;\n\t\tif ( $override_privacy ) {\n\t\t\t$retention_number = 0;\n\t\t\t$retention_unit = 'days';\n\t\t\tif ( isset( $settings['submissions-retention-number'] ) ) {\n\t\t\t\t$retention_number = (int) $settings['submissions-retention-number'];\n\t\t\t}\n\t\t\tif ( isset( $settings['submissions-retention-unit'] ) ) {\n\t\t\t\t$retention_unit = $settings['submissions-retention-unit'];\n\t\t\t}\n\t\t}\n\n\t\tforminator_update_form_submissions_retention( $id, $retention_number, $retention_unit );\n\n\t\twp_send_json_success( $id );\n\t}", "public function saveSettingAction(){\n $configKey = array('api_key', 'api_secret','include_folders','resize_auto',\n 'resize_image','min_size','max_size','compression_type_pdf','compression_type_png','compression_type_jpg','compression_type_gif', 'saving_auto', 'compress_auto', 'cron_periodicity', 'reindex_init');\n $coreConfig = Mage::getConfig();\n $post = $this->getRequest()->getPost();\n foreach ($configKey as $key) { \n if (isset($post[$key])) { \n $coreConfig->saveConfig(\"mageio_\".$key, Mage::helper('core')->escapeHtml($post[$key]))->cleanCache();\n }\n }\n\t\t$installed_time = Mage::getStoreConfig('mageio_installed_time');\n if(empty($installed_time)) {\n $installed_time = time();\n $coreConfig = Mage::getConfig();\n $coreConfig->saveConfig('mageio_installed_time', Mage::helper('core')->escapeHtml($installed_time))->cleanCache();\n }\n\t\t//Remove error message if set\n\t\t$coreConfig->saveConfig(\"mageio_errormessage\", Mage::helper('core')->escapeHtml(null))->cleanCache();\n\t\t\n\t\t$this->_redirect('imagerecycle/index/index');\n\t}", "private function admin_ajax_routing() {\n\n\t\t// Load API injection\n\t\t$this->add_action( 'wp_ajax_flowdrive_get_profile', $this->api, 'getUserProfile');\n\t\t$this->add_action( 'wp_ajax_flowdrive_get_base_folders', $this->api, 'getBaseFolders');\n\t\t$this->add_action( 'wp_ajax_flowdrive_get_layer', $this->api, 'getLayer');\n\t\t$this->add_action( 'wp_ajax_flowdrive_compare', $this->api, 'compare');\n\t\t$this->add_action( 'wp_ajax_flowdrive_get_folder_contents', $this->api, 'getFolderContents');\n\t\t$this->add_action( 'wp_ajax_flowdrive_post_item', $this->api, 'postItem');\n\t}", "public function application()\n\t{\n\t\t$settings = new Settings_Model();\n\t\t$this->view->settings = $settings;\n\t\t$this->view->errors = '';\n\n\t\tif ( ! $_POST)\n\t\t{\n\t\t\t$this->view->status = NULL;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$settings->set_fields($this->input->post());\n\t\t\t$settings->installed = TRUE;\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$settings->save();\n\t\t\t\t$this->template->body->status = TRUE;\n\t\t\t}\n\t\t\tcatch (Kohana_User_Exception $e)\n\t\t\t{\n\t\t\t\t$this->view->errors = $e;\n\t\t\t\t$this->view->settings = $settings;\n\t\t\t\t$this->view->status = FALSE;\n\t\t\t}\n\t\t}\n\t}", "function custom_settings_page() { ?>\n\t<div class=\"wrap\">\n\t\t<h1>Custom Settings</h1>\n\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t<?php\n settings_fields('section');\n do_settings_sections('theme-options'); \n submit_button(); \n ?>\n\t\t</form>\n\t</div>\n\t<?php }", "private function action_forumSettings()\n\t{\n\t\tglobal $txt, $incontext, $databases, $db_type, $db_connection;\n\n\t\t$incontext['sub_template'] = 'forum_settings';\n\t\t$incontext['page_title'] = $txt['install_settings'];\n\n\t\t// Let's see if we got the database type correct.\n\t\tif (isset($_POST['db_type'], $databases[$_POST['db_type']]))\n\t\t{\n\t\t\t$db_type = $_POST['db_type'];\n\t\t}\n\n\t\t// Else we'd better be able to get the connection.\n\t\telse\n\t\t{\n\t\t\tload_database();\n\t\t}\n\n\t\t$db_type = $_POST['db_type'] ?? $db_type;\n\n\t\t// What host and port are we on?\n\t\t$host = empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] . (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT']) : $_SERVER['HTTP_HOST'];\n\n\t\t// Now, to put what we've learned together... and add a path.\n\t\t$incontext['detected_url'] = 'http' . (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 's' : '') . '://' . $host . strtr(substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')), array('/install' => ''));\n\n\t\t// Check if the database sessions will even work.\n\t\t$incontext['test_dbsession'] = ini_get('session.auto_start') != 1;\n\t\t$incontext['continue'] = 1;\n\n\t\t// Submitting?\n\t\tif (isset($_POST['boardurl']))\n\t\t{\n\t\t\tif (substr($_POST['boardurl'], -10) == '/index.php')\n\t\t\t{\n\t\t\t\t$_POST['boardurl'] = substr($_POST['boardurl'], 0, -10);\n\t\t\t}\n\t\t\telseif (substr($_POST['boardurl'], -1) == '/')\n\t\t\t{\n\t\t\t\t$_POST['boardurl'] = substr($_POST['boardurl'], 0, -1);\n\t\t\t}\n\n\t\t\tif (substr($_POST['boardurl'], 0, 7) != 'http://' && substr($_POST['boardurl'], 0, 7) != 'file://' && substr($_POST['boardurl'], 0, 8) != 'https://')\n\t\t\t{\n\t\t\t\t$_POST['boardurl'] = 'http://' . $_POST['boardurl'];\n\t\t\t}\n\n\t\t\t// Save these variables.\n\t\t\t$vars = array(\n\t\t\t\t'boardurl' => $_POST['boardurl'],\n\t\t\t\t'boarddir' => addslashes(TMP_BOARDDIR),\n\t\t\t\t'sourcedir' => addslashes(TMP_BOARDDIR) . '/sources',\n\t\t\t\t'cachedir' => addslashes(TMP_BOARDDIR) . '/cache',\n\t\t\t\t'mbname' => strtr($_POST['mbname'], array('\\\"' => '\"')),\n\t\t\t\t'language' => substr($_SESSION['installer_temp_lang'], 8, -4),\n\t\t\t\t'extdir' => addslashes(TMP_BOARDDIR) . '/sources/ext',\n\t\t\t);\n\n\t\t\t// Must save!\n\t\t\tif (!updateSettingsFile($vars))\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['settings_error'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Make sure it works.\n\t\t\trequire(TMP_BOARDDIR . '/Settings.php');\n\n\t\t\t// Set our db character_set to utf8\n\t\t\tupdateSettingsFile(array('db_character_set' => 'utf8'));\n\n\t\t\t// Good, skip on.\n\t\t\treturn true;\n\t\t}\n\n\t\tdefinePaths();\n\n\t\treturn false;\n\t}", "public function run() {\n\n // Render the admin page view / menus\n add_action( \n 'admin_menu', \n array( $this, 'add_settings_page' ) );\n\n if ( ! empty ( $GLOBALS['pagenow'] ) && ( \n 'options-general.php' === $GLOBALS['pagenow'] || 'options.php' === $GLOBALS['pagenow']\n ))\n {\n // Register the settings and render the fields\n add_action( \n 'admin_init', \n array( $this, 'register_settings' ) );\n }\n\n }", "public function flow_process_admin_options() {\r\n\r\n $hasFile = false;\r\n $nombrePlugin = basename(__DIR__);\r\n $idFileInput = \"woocommerce_\" . $this->id . \"_logo-small\";\r\n if (isset($_FILES[$idFileInput])) {\r\n $file = $_FILES[$idFileInput];\r\n $hasFile = $file['size']>0;\r\n if ($hasFile) {\r\n move_uploaded_file($file['tmp_name'], PLUGIN_DIR_flow.\"images/custom-logo-small.png\");\r\n }\r\n }\r\n\r\n $post_data = $this->get_post_data();\r\n $anyErrors = false;\r\n\r\n if(empty($post_data['woocommerce_'.$this->id.'_api_key'])){\r\n update_option('woocommerce_flow_api_key_valid', false);\r\n $anyErrors = true;\r\n }\r\n else{\r\n update_option('woocommerce_flow_api_key_valid', true);\r\n }\r\n\r\n if(empty($post_data['woocommerce_'.$this->id.'_secret_key'])){\r\n update_option('woocommerce_flow_secret_key_valid', false);\r\n $anyErrors = true;\r\n }\r\n else{\r\n update_option('woocommerce_flow_secret_key_valid', true);\r\n }\r\n\r\n if(!$anyErrors)\r\n $this->process_admin_options();\r\n\r\n return ;\r\n\r\n }", "public function page_init()\n {\n register_setting(\n 'my_option_group', // Option group\n 'linkedin_api_option', // Option name\n array( $this, 'sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n 'Request Settings', // Title\n array(), // Callback\n 'my-setting-admin' // Page\n );\n\n add_settings_field(\n 'redirect_url', // ID\n 'Redirect URL', // Title\n array( $this, 'redirect_url_callback' ), // Callback\n 'my-setting-admin', // Page\n 'setting_section_id' // Section\n );\n\n add_settings_field(\n 'client_id',\n 'Client ID',\n array( $this, 'client_id_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'client_secret',\n 'Client Secret',\n array( $this, 'client_secret_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'authorization_code',\n 'Authorization Code For An Access Token',\n array( $this, 'authorization_code_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'access_token',\n 'Access Token',\n array( $this, 'access_token_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n }", "public function admin_init()\n\t\t{\n\t\t\t$this->register_settings();\n\t\t\t$region = $this->get_option('region');\n\t\t\t$apiKey = $this->get_option('apiKey');\n\t\t\t$useAPI = $this->get_option('useAPI');\n\t\t\t$password = $this->get_option('password');\n\n\t\t\tadd_action('admin_notices', array(&$this, 'admin_notices'));\n\t\t}", "public function settings_view()\n {\n $this->register_handler('plugin.settingsform', array($this, 'settings_form'));\n $this->register_handler('plugin.settingslist', array($this, 'settings_list'));\n $this->register_handler('plugin.factoradder', array($this, 'settings_factoradder'));\n $this->register_handler('plugin.highsecuritydialog', array($this, 'settings_highsecuritydialog'));\n\n $this->include_script('kolab2fa.js');\n $this->include_stylesheet($this->local_skin_path() . '/kolab2fa.css');\n\n if ($this->check_secure_mode()) {\n $this->api->output->set_env('session_secured', $_SESSION['kolab_2fa_secure_mode']);\n }\n\n $this->api->output->add_label('save','cancel');\n $this->api->output->set_pagetitle($this->gettext('settingstitle'));\n $this->api->output->send('kolab_2fa.config');\n }", "public function save_settings_callback() {\r\n $setting_data = $this->ajax_data['setting_data'];\r\n\r\n labb_update_options($setting_data);\r\n\r\n $template = false;\r\n // get new restore global settings panel\r\n if ($this->ajax_data['reset']) {\r\n ob_start();\r\n require_once('views/settings.php');\r\n $template = ob_get_clean();\r\n }\r\n\r\n $response = $this->ajax_response(true, $this->ajax_data['reset'], $template);\r\n return $response;\r\n\r\n }", "public function ajaxGateway() {\n\n // Out of that if I'm not in Ajax channel!\n if( FALSE == wpdk_is_ajax() ) {\n echo '<h3>Unable to execute the method ' . __METHOD__ .'in this way</h3>';\n die();\n }\n\n // Init Ajax response\n $response = array();\n\n switch( $_POST['command'] ) {\n\n case self::ENGAGE_RULE:\n\n // Build parameter = value array\n $parameters = array();\n foreach( explode('&', $_POST['data']) as $chunk ) {\n $single = explode( '=', $chunk );\n $parameters[ urldecode( $single[0] ) ] = urldecode( $single[1] );\n }\n\n // Get generic param\n $genericParam = $parameters[ $this->id() . '-generic-param'];\n\n // Enable rule 1 in configuration\n $this->status( self::RULE_ON );\n $this->_genericParam = $genericParam;\n\n break;\n\n case self::DISABLE_RULE:\n\n // Disable rule 1 in configuration\n $this->status( self::RULE_OFF );\n $this->_genericParam = '';\n\n break;\n\n default:\n\n $response['message'] = __( 'General error in Deflector Template Rule', WPXDEFLECTOREXTENSIONTEMPLATE_TEXTDOMAIN );\n\n }\n\n // Store new configuration into DB\n $this->_saveSettings();\n\n // Return response to caller\n echo json_encode( $response );\n die();\n\n }", "function custom_settings_page() { ?>\n <div class=\"wrap\">\n <h1>Custom Settings</h1>\n <form method=\"post\" action=\"options.php\">\n <?php\n settings_fields( 'section' );\n do_settings_sections( 'theme-options' ); \n submit_button(); \n ?> \n </form>\n </div>\n<?php }", "public function action_google_settings() {\n\n $package = Model::factory('package');\n $errors = array();\n $google_settings_submit = arr::get($_REQUEST, 'btn_google');\n\n $post_values = array();\n $google_settings = $package->google_settings();\n\n $google_id = 1;\n\n if ($google_settings_submit && Validation::factory($_POST)) {\n $post_values = $_POST;\n\n $validator = $package->validate_update_google_settings(arr::extract($_POST, array('ios_google_map_key', 'ios_google_geo_key', 'web_google_map_key', 'google_timezone_api_key', 'web_google_geo_key', 'android_google_api_key','web_foursquare_api_key','android_foursquare_api_key','ios_foursquare_api_key')));\n\n if ($validator->check()) {\n $status = $package->update_google_settings($_POST, $google_id);\n\n if ($status == 1) {\n Message::success(__('sucessful_settings_update'));\n } else {\n Message::error(__('not_updated'));\n }\n\n $this->request->redirect(\"package/google_settings\");\n } else {\n $errors = $validator->errors('errors');\n }\n }\n\n $this->template->title = CLOUD_SITENAME . ' | ' . __('google_settings');\n $this->template->page_title = __('google_settings');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/google_settings\")\n ->bind('errors', $errors)\n ->bind('google_settings', $google_settings)\n ->bind('postvalue', $post_values);\n }", "function btpay_post_action()\n {\n global $wpdb;\n if (!empty($_POST))\n {\n if (isset($_POST['update_config']))\n {\n $id = $_POST['update_config'];\n btpay_handle_config_update();\n include BT_PLUGIN_DIR . '/pages/btpay-config-page.php';\n }\n }\n else\n {\n include BT_PLUGIN_DIR . '/pages/btpay-config-page.php';\n }\n }", "public function action_cloud_sms_settings() {\n\n $usertype = $_SESSION['user_type'];\n\n $package = Model::factory('package');\n $errors = array();\n $smssettings_submit = arr::get($_REQUEST, 'btn_sms_activate');\n\n $post_values = array();\n\n $sms_id = '';\n $company_id = 1;\n $smssettings = $package->sms_settings();\n if (empty($smssettings)) {\n\n $smssettings[0]['sms_account_id'] = '';\n $smssettings[0]['sms_auth_token'] = '';\n $smssettings[0]['sms_from_number'] = '';\n $smssettings[0]['sms_id'] = '';\n $sms_id = $smssettings[0]['sms_id'];\n } else {\n $sms_id = 1;\n }\n\n if ($smssettings_submit && Validation::factory($_POST)) {\n $post_values = $_POST;\n\n $validator = $package->validate_update_smssettings(arr::extract($_POST, array('sms_account_id', 'sms_auth_token', 'sms_from_number')));\n //'site_city';\n if ($validator->check()) {\n $status = $package->update_sms_settings($_POST, $company_id, $sms_id);\n\n if ($status == 1) {\n Message::success(__('sucessful_settings_update'));\n } else {\n Message::error(__('not_updated'));\n }\n\n $this->request->redirect(\"package/cloud_sms_settings\");\n } else {\n $errors = $validator->errors('errors');\n }\n }\n //$id = $this->request->param('id');\n // $id=1;\n\n $this->selected_page_title = __(\"sms_settings\");\n $view = View::factory(ADMINVIEW . 'package_plan/sms_settings')\n ->bind('validator', $validator)\n ->bind('errors', $errors)\n ->bind('postvalue', $post_values)\n ->bind('smssettings', $smssettings);\n\n $this->template->title = CLOUD_SITENAME . \" | \" . __('sms_settings');\n $this->template->page_title = __('sms_settings');\n $this->template->content = $view;\n }", "public function settings_api_init() {\n\t\t// Register sections and settings.\n\t\tadd_settings_section(\n\t\t\t$this->menu_slug,\n\t\t\t__( 'Top Story', 'top-story' ),\n\t\t\tnull,\n\t\t\t$this->menu_slug\n\t\t);\n\n\t\t// Register settings and add fields.\n\t\tregister_setting( $this->menu_slug, 'current-top-story' );\n\n\t\t// Add field.\n\t\tadd_settings_field(\n\t\t\t$this->menu_slug,\n\t\t\t__( 'Search for post by title to replace current top story. (Leave blank to disable.)', 'top-story' ),\n\t\t\tarray( $this, 'option_display' ),\n\t\t\t$this->menu_slug,\n\t\t\t$this->menu_slug\n\t\t);\n\t}", "public function settings_fields() {\n\t\t$this->create_sections();\n\t\t$this->create_fields();\n\t\tregister_setting( $this->token, $this->token, array( $this, 'validate_fields' ) );\n\t}", "public function siteAdmin($subreddit = null, $allow_top = null, $api_type = null, $comment_score_hide_mins = null, $css_on_cname = null, $description = null, $exclude_banned_modqueue = null, $header_title = null, $lang = null, $link_type = null, $name = null, $over_18 = null, $public_description = null, $public_traffic = null, $show_cname_sidebar = null, $show_media = null, $spam_comments = null, $spam_links = null, $spam_selfposts = null, $submit_link_label = null, $submit_text = null, $submit_text_label = null, $title = null, $type = null, $wiki_edit_age = null, $wiki_edit_karma = null, $wikimode = null) {\n\t\t$urlSubmit = \"{$this->apiHost}/site_admin\";\n\n\t\t// data checks and pre-setup\n\t\tif ($subreddit == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$postData = sprintf ( \"uh=%s&sr=%s&allow_top=%s&api_type=%s&comment_score_hide_mins=%s&css_on_cname=%s&description=%s&exclude_banned_modqueue=%s&header-title=%s&lang=%s&link_type=%s&name=%s&over_18=%s&public_description=%s&public_traffic=%s&show_cname_sidebar=%s&show_media=%s&spam_comments=%s&spam_links=%s&spam_selfposts=%s&submit_link_label=%s&submit_text=%s&submit_text_label=%s&title=%s&type=%s&wiki_edit_age=%s&wiki_edit_karma=%s&wikimode=%s\", $this->modHash, $subreddit, $allow_top, $api_type, $comment_score_hide_mins, $css_on_cname, $description, $exclude_banned_modqueue, $header_title, $lang, $link_type, $name, $over_18, $public_description, $public_traffic, $show_cname_sidebar, $show_media, $spam_comments, $spam_links, $spam_selfposts, $submit_link_label, $submit_text, $submit_text_label, $title, $type, $wiki_edit_age, $wiki_edit_karma, $wikimode );\n\n\t\t$response = $this->runCurl ( $urlSubmit, $postData );\n\t\treturn $response;\n\t}", "public static function func_ajax_sav_setting() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $postid = self::sanitize($_POST['pst']);\n $type = self::sanitize($_POST['typ']);\n $lang = self::sanitize($_POST['lan']);\n $ptype = self::sanitize($_POST['ptype']);\n\n $select = $wpdb->get_results(\"SELECT * FROM \" . $wpdb->prefix.self::$table_name_settings);\n\n if(!empty($select)){\n $id=null;\n foreach($select as $key => $val){\n $id = $val->rs_int;\n }\n if($id != null){\n $wpdb->query($wpdb->prepare(\"UPDATE \" . $wpdb->prefix.self::$table_name_settings. \" SET rs_postid = %s, rs_lang = %s, rs_type = %s, rs_posttype = %s WHERE rs_int = %d\",$postid,$lang,$type,$ptype,$id ));\n }\n\n } else {\n $wpdb->query($wpdb->prepare( \"INSERT INTO \".$wpdb->prefix.self::$table_name_settings .\" VALUES (%d, %s, %s, %s, %s)\", null, $postid,$ptype,$lang,$type ));\n }\n\n echo get_permalink($postid);\n die();\n\t\t\t\t}\n\t\t\n\t\t}", "public function postSettings()\n {\n $form = $this->users->getSettingsForm();\n\n if (! $form->isValid()) {\n return $this->redirectBack([ 'errors' => $form->getErrors() ]);\n }\n\n $this->users->updateSettings($this->user, Input::all());\n\n return $this->redirectRoute('user.settings', [], [ 'settings_updated' => true ]);\n }", "public function admin_init() {\r\n\t\t\t// Register your plugin's settings.\r\n\t\t\tregister_setting( 'sift_ninja-group', 'sift_ninja_api_key' );\r\n\t\t\tregister_setting( 'sift_ninja-group', 'sift_ninja_account_name' );\r\n\t\t\tregister_setting( 'sift_ninja-group', 'sift_ninja_channel' );\r\n\t\t\tregister_setting( 'sift_ninja-group', 'sift_ninja_trash_on_response' );\r\n\r\n\t\t\t// Add your settings section.\r\n\t\t\tadd_settings_section(\r\n\t\t\t\t'sift_ninja-section',\r\n\t\t\t\t'Sift Ninja',\r\n\t\t\t\tarray( &$this, 'settings_section_text' ),\r\n\t\t\t\t'sift_ninja'\r\n\t\t\t);\r\n\r\n\t\t\t// Add your setting's fields.\r\n\t\t\t\tadd_settings_field(\r\n\t\t\t\t\t'sift_ninja-api_key',\r\n\t\t\t\t\t'API Key',\r\n\t\t\t\t\tarray( &$this, 'settings_field_input_text' ),\r\n\t\t\t\t\t'sift_ninja',\r\n\t\t\t\t\t'sift_ninja-section',\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'field' => 'sift_ninja_api_key',\r\n\t\t\t\t\t\t'help_text' => 'Your Sift Ninja API key',\r\n\t\t\t\t\t\t'default' => '',\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\r\n\t\t\t\tadd_settings_field(\r\n\t\t\t\t\t'sift_ninja-account_name',\r\n\t\t\t\t\t'Account Name',\r\n\t\t\t\t\tarray( &$this, 'settings_field_input_text' ),\r\n\t\t\t\t\t'sift_ninja',\r\n\t\t\t\t\t'sift_ninja-section',\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'field' => 'sift_ninja_account_name',\r\n\t\t\t\t\t\t'help_text' => 'Your Sift Ninja Account name',\r\n\t\t\t\t\t\t'default' => '',\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\r\n\t\t\t\tadd_settings_field(\r\n\t\t\t\t\t'sift_ninja-channel',\r\n\t\t\t\t\t'Channel',\r\n\t\t\t\t\tarray( &$this, 'settings_field_input_text' ),\r\n\t\t\t\t\t'sift_ninja',\r\n\t\t\t\t\t'sift_ninja-section',\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'field' => 'sift_ninja_channel',\r\n\t\t\t\t\t\t'help_text' => 'Your Sift Ninja channel to use',\r\n\t\t\t\t\t\t'default' => 'comments',\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\r\n\t\t\t\tadd_settings_field(\r\n\t\t\t\t\t'sift_ninja-trash',\r\n\t\t\t\t\t'Send to Trash',\r\n\t\t\t\t\tarray( &$this, 'settings_field_input_checkbox' ),\r\n\t\t\t\t\t'sift_ninja',\r\n\t\t\t\t\t'sift_ninja-section',\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'field' => 'sift_ninja_trash_on_response',\r\n\t\t\t\t\t\t'help_text' => 'If checked, then comments that Sift Ninja marks as bad will be sent directly to trash rather than moderation',\r\n\t\t\t\t\t\t'default' => '0',\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\r\n\t\t\t\t// Possibly do additional admin_init tasks.\r\n\t\t}", "function setup_settings() {\n\t\t\t$page = is_network_admin() ? 'settings.php' : 'writing';\n\t\t\t$section = 'post_revision_workflow';\n\t\t\t\n\t\t\tif( is_network_admin() ) {\n\t\t\t\tadd_action( 'wpmu_options', array( &$this, 'ms_settings_section' ) );\n\t\t\t\tadd_action( 'update_wpmu_options', array( &$this, 'update_ms_settings' ) );\n\t\t\t} else {\n\t\t\t\tregister_setting( $page, 'dpn_reviewers', array( &$this, 'sanitize_settings' ) );\n\t\t\t\tadd_settings_section( $section, __( 'Post Revision Workflow', $this->text_domain ), array( &$this, 'settings_section' ), $page );\n\t\t\t\tadd_settings_field( 'dpn_reviewers', __( 'Default email address for post revision workflow notification:', $this->text_domain ), array( &$this, 'settings_field' ), $page, $section, array( 'label_for' => 'dpn_reviewers' ) );\n\t\t\t}\n\t\t}", "function ajax_saveSettings()\n{\n\n $cc = new CapabilityCheck('saveSettings');\n if (!$cc->checkCapability()) {\n return;\n }\n\n $message = 'Saving sitewide CyberPanel settings.';\n\n check_ajax_referer('CPWP');\n $cpjm = new CPJobManager('saveSettings', $_POST, $message);\n $cpjm->RunJob();\n}", "function custom_settings_page() { ?>\r\n<div class=\"wrap\">\r\n<h1>Custom Settings</h1>\r\n<form method=\"post\" action=\"options.php\">\r\n<?php settings_fields( 'section' );\r\ndo_settings_sections( 'theme-options' );\r\nsubmit_button(); ?>\r\n</form>\r\n</div>\r\n<?php }", "public function settings() {\n\n\t\tdo_settings_sections( 'wpbgdc' );\n\n\t\tsubmit_button();\n\n\t\techo '<div class=\"clear\"></div>';\n\n\t}", "public function admin_init() {\n\t\t// Maybe connect with SocialFlow.\n\t\t$this->maybe_authorize();\n\n\t\t// Register our settings in the global \"whitelist_settings\".\n\t\tregister_setting( 'socialflow', 'socialflow', array( $this, 'save_settings' ) );\n\t}", "function MKS_plugin_options_page() {\n ?>\n <div>\n <h2>MakesBridge Plugin Settings</h2>\n <p>\n <em>Don't have a MakesBridge Account?</em> <a href=\"http://makesbridge.com/request-15-day-trial?pmc=CLDGRP\" target=\"_BLANK\">Sign up for a free trial here</a>\n </p>\n <form action=\"options.php\" method=\"post\">\n <?php settings_fields('makesbridge_options');\n do_settings_sections('MakesBridge'); ?>\n <input type=\"hidden\" name=\"mks_action\" value=\"api_settings\" />\n <input name=\"Submit\" type=\"submit\" value=\"Save Changes\" class=\"button-primary\"/>\n </form>\n </div>\n <?php\n}", "public function save_settings() {\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-settings' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'vfb_settings' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tcheck_admin_referer( 'vfb-update-settings' );\n\n\t\t$data = array();\n\n\t\tforeach ( $_POST['vfb-settings'] as $key => $val ) {\n\t\t\t$data[ $key ] = esc_html( $val );\n\t\t}\n\n\t\tupdate_option( 'vfb-settings', $data );\n\t}", "function action_admin(&$handler)\n\t {\n\t // Get the atkpage singleton instance\n\t $page = &atkpage::getInstance();\n atk_var_dump($_SESSION,\"ADMIN_ADMIN SESSION\");\n\t atk_var_dump($this->m_postvars,\"ADMIN_ADMIN POSTVARS\");\n\n\t // Add the stylesheet to the page\n\t $this->addStyle(\"style.css\");\n\n\t $boxes = array();\n\n\t // If a period is selected for a specific employee, then show the approval screen\n\t if ((!is_null($this->m_postvars[\"viewuser\"])) && (!is_null($this->m_postvars[\"viewdate\"])) && (($this->m_postvars[\"year\"] == null) || ($this->m_postvars[\"year\"] == substr($this->m_postvars[\"viewdate\"], 0, 4))))\n\t {\n\t \t// Try to find the hour_lock in de database\n\t \t$hourslocknode = &atkGetNode(\"timereg.hours_lock\");\n\t \t$hourlocks = $hourslocknode->selectDb(\"hours_lock.id='\" . $this->m_postvars[\"periodid\"] . \"'\");\n\n\t \t// Only show the weekview if the lock still exists:\n\t \tif (count($hourlocks) > 0)\n\t \t{\n\n\t \t // Store the employeeid and viewdate in class vars\n \t \t$this->m_user = $this->m_postvars[\"viewuser\"];\n \t \t$this->m_viewdate = $this->m_postvars[\"viewdate\"];\n\n \t \t// Add the approve screen to the page\n \t \t$boxes[] = $this->weekview(atkConfig::get('timereg','hours_approve_projectteam_members_only'));\n\t \t}\n\n\t }\n\n\t // Add the approvedperiodview to the page\n\t $boxes[] = $this->approvedperiodview();\n $actionpage = $this->renderActionPage(\"stats\", $boxes);\n $page->addContent($actionpage);\n\n\t // Return an empty string (output is handled through the page\n\t return \"\";\n\t }", "public function site_settings()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$data['form_submit_message'] = '';\n\t\t\t$this->load->model('settings_model', 'sm');\n\t\t\t\n\t\t\tif(count($_POST) > 0)\n\t\t\t{\n\t\t\t\tforeach($_POST as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$settings_data['value'] = $value;\n\t\t\t\t\t$this->sm->update($key, $settings_data);\n\t\t\t\t}\n\t\t\t\t$data['form_submit_message'] = '<div style=\"font-weight:bold;color:#0000FF;\">'.lang('msg_settings_saved') .'</div>';\n\t\t\t}\n\t\t\t\n\t\t\t$settings_raw_data = $this->sm->get_all();\n\t\t\t$settings_data = array();\n\t\t\tforeach($settings_raw_data as $raw_settings)\n\t\t\t\t$settings_data[$raw_settings->name] = $raw_settings->value;\n\t\t\t$data['settings'] = $settings_data;\n\t\t\t$this->load->view('settings-admin', $data);\n\t\t}" ]
[ "0.6553425", "0.6451734", "0.6380472", "0.63680845", "0.63439685", "0.633343", "0.6313774", "0.62749743", "0.6266015", "0.62075406", "0.62073714", "0.61051077", "0.6092356", "0.60846925", "0.60637134", "0.60343075", "0.60304105", "0.60162705", "0.6008718", "0.5993316", "0.5979997", "0.5977104", "0.5947636", "0.59383655", "0.59354955", "0.59347504", "0.59321463", "0.5921102", "0.5908752", "0.59078825", "0.5901386", "0.5899789", "0.58984137", "0.58977824", "0.5888784", "0.5887764", "0.58840543", "0.5881515", "0.5856125", "0.5855789", "0.5836471", "0.5830153", "0.58208334", "0.5813729", "0.5793872", "0.5775274", "0.5773507", "0.5773203", "0.57706976", "0.57705444", "0.57657766", "0.5763339", "0.5756274", "0.57506096", "0.5745989", "0.57448536", "0.5744846", "0.574204", "0.57389045", "0.5736892", "0.57351226", "0.572653", "0.5721292", "0.57094204", "0.57071894", "0.57043636", "0.5702289", "0.57011664", "0.5700552", "0.569977", "0.5699419", "0.56964844", "0.569087", "0.5690864", "0.56879693", "0.5685725", "0.56816846", "0.5678759", "0.56720054", "0.566782", "0.56675124", "0.5667156", "0.56655246", "0.5662294", "0.56565845", "0.56558794", "0.5652819", "0.56424016", "0.5633339", "0.56329584", "0.563204", "0.56315994", "0.5630607", "0.56272376", "0.5622481", "0.56149584", "0.56134266", "0.5597063", "0.5595395", "0.5593626", "0.55920255" ]
0.0
-1
default conecta con la base de datos
public function __construct(){ $this->cmd = new Conexion(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function conectar(){\n global $Usuario;\n global $Clave;\n global $_SESSION;\n $this->dataOrdenTrabajo->SetUserName($Usuario);\n $this->dataOrdenTrabajo->SetUserPassword($Clave);\n $this->dataOrdenTrabajo->SetDatabaseName($_SESSION['database']);\n $this->dataOrdenTrabajo->setConnected(true);\n }", "function abrir_conexion()\n {\n $this->db = Conectar::conexion();\n }", "function Conecta(){\n\t\t$this->conexao = @mysql_connect($this->servidor,$this->usuario,$this->senha); //varaivel link desntro desta classa recebera a conex�o\n\t\tif(!$this->conexao){\n\t\t\techo 'Falha na conex�o com o banco de dados<br>';\n\t\t\texit();\n\t\t}elseif(!mysql_select_db($this->banco,$this->conexao)){\n\t\t\techo 'Falha ao selecionar o banco de dados<br>';\n\t\t\texit();\n\t\t}\n\t}", "private function connect()\r\n {\r\n\r\n /**\r\n * A TENTATIVA DE CRIAR UM OBJETO COM A CONEXAO DO BANCO É FEITA\r\n */\r\n try {\r\n /**\r\n * SALVA NA VARIAVEL ESTATICA O OBJETO REFERENTE A CONEXÃO COM O BANCO.\r\n * AS VARIAVEIS QUE SAO USADAS PARA CONEXAO SÃO DA CLASSE PAI\r\n */\r\n self::$con = new PDO('mysql:host=' . $this->getHost() . ';dbname=' . $this->getDatabase() . '', $this->getUser(), $this->getPassword(), array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES 'utf8'\"));\r\n /**\r\n * DEFINE O TIPO DE MANIPULAÇÃO DE ERRO SERÁ USADO PELO PDO\r\n */\r\n self::$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n /**\r\n * CAPTURA O ERRO, SE GERADO\r\n */\r\n } catch (\\PDOException $error) {\r\n /**\r\n * O ERRO É IMPRESSO NA TELA\r\n */\r\n echo $error->getMessage();\r\n }\r\n }", "private function conect(){\r\n\t\tglobal $HOST;\r\n\t\tglobal $BASEDEDATOS;\r\n\t\tglobal $USUARIO;\r\n\t\tglobal $PASS;\r\n\t\t$this->myconn = mysql_connect($HOST,$USUARIO,$PASS);\r\n\t\tif (! $this->myconn){\r\n\t\t\techo \"Error al intentar conectarse con el servidor MySQL\";\r\n\t\texit(); \r\n\t\t}\r\n\r\n\t\tif (! @mysql_select_db($BASEDEDATOS,$this->myconn)){\r\n\t\t\techo \"No se pudo conectar correctamente con la Base de datos\";\r\n\t\t\texit();\r\n\t\t}\r\n\t\r\n\t}", "public function conectar()\n {\n if(!isset($this->conexion)){\n $this->conexion = (mysql_connect($this->localhost, $this->usuario,$this->password)) or die(mysql_error() );\n mysql_select_db($this->database , $this->conexion) or die(mysql_error()); \n }\n }", "public function conectar() {\n $this->conexion=new mysqli($this->servidor, $this->usuario, $this->clave, $this->baseDatos);\n }", "function conectar(&$enlace){\r\n\t\t\t\t$enlace=mysqli_connect(\"localhost\",\"root\",\"\");\r\n\t\t\t\tif($enlace==false)\r\n\t\t\t\t\tdie (\"No puede establecer la conexión<br>\");\r\n else echo\"CONEXIÓN REALIZADA\". \"<BR>\";\r\n\t\t\t\t//Seleccionar la base de datos\r\n\t\t\t\t$seleccion=mysqli_select_db($enlace,\"universidad\");\r\n\t\t\t\tif($seleccion==false)\r\n\t\t\t\t\tdie (\"No se pudo seleccionar la base de datos<br>\");\r\n else echo\"BASE DE DATOS SELECCIONADA\". \"<BR><BR>\";\r\n\t\t\t}", "public function Conecta()\n\t{\n\t\t$this->conn = new PDO(\"mysql:host=\".$this->host.\";dbname=\".$this->database, $this->user, $this->password);\n\n\t}", "function conectar() \n\t {\n\t\t//conectarme con el servidor de base de datos\n\t\t$con=mysql_connect($this->Servidor,$this->Usuario,$this->Clave);\n\t\t// si hubo problemas al conectarme con el servidor de base de datos\n\t\tif (!$con)\n\t\t{\n\t\t\tdie(\"Error al conectarme con el Servidor de Base de Datos\");\n\t\t}\n\t\t//Seleccionar la base de datos\n\t\t$bd=mysql_select_db($this->BaseDatos,$con);\n\t\t//error al seleccionar la base de datos\n\t\tif (!$bd)\n\t\t{\n\t\t\tdie(\"Error al seleccionar la Base de Datos\");\n\t\t}\n\t\t//almaceno la conexion en la propiedad conect\n\t\t$this->conect=$con;\n\t\t//devuelvo la conexion desde donde fue invocada\n\t\treturn true;\t\n\t}", "function conecta_alumno($nombrebase) {\n\n // --- Realizar la conexion\n @ $db = mysqli_pconnect($mihost,\"PequeLiante\",\"H@y59ONGs\"); \n\n if (!$db){\n echo mensaje_error('No se ha podido abrir la base de datos. Inténtelo más tarde',1);\n exit;\n }\n\n // --- Abrir la base de datos\n $mibase = mysqli_select_db($nombrebase);\n\n if (!$mibase){\n echo mensaje_error('No existe la base de datos donde se almacena la información. Inténtelo más tarde',1);\n exit;\n }\n }", "public function __construct(){\n $this->conectado = $this->conectar();\n }", "private function conectar(){\n try{\n\t\t\t$this->conexion = Conexion::abrirConexion(); /*inicializa la variable conexion, llamando el metodo abrirConexion(); de la clase Conexion por medio de una instancia*/\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie($e->getMessage()); /*Si la conexion no se establece se cortara el flujo enviando un mensaje con el error*/\n\t\t}\n }", "public function conectar(){\n $this->conexion = mysqli_connect($this->hostname, $this->user, $this->password, $this->database);\n }", "private function conectarDB(){\n\t\t$dsn = 'mysql:dbname='.self::nombre_db.' ;host='.self::servidor;\n\t\ttry {\n\t\t\t#metodo abstracto para la conexion a la bd\n\t\t\t$this->_conn = new PDO($dsn, self::usuario_db, self::pwd_db);\n\t\t \t\n\t\t } catch (PDOException $e) {\n\t\t \techo \"Falló la conexión: \".$e->getMessage();\n\t\t } \n\t}", "public function conectar(){\r\n try { //tratar a execucao do codigo\r\n //criar conexao com o PDO\r\n //new instanciar uma classe (gerar um novo objeto baseado na classe)\r\n $con = new PDO(\"mysql:host={$this->servidor};dbname={$this->banco};charset=utf8;\",$this->usuario, $this->senha);\r\n \r\n return $con; //retornando a conexao\r\n }catch(PDOException $msg){ // devolver mensagem caso de erro\r\n echo \"Nao possivel possivel conectar com o banco de dados {$msg->getMessage()}\";\r\n }\r\n \r\n }", "private function conectar_base_datos(){\n\t\t$this->descriptor = mysqli_connect($this->servidor,$this->usuario,$this->pass,$this->base_datos);\n\t\tif (mysqli_connect_errno()) {\n \t\t?>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\">\n\t\t\t\talert (\"Falló conexión al servidor:<?php printf(\"%s\\n\", mysqli_connect_error());?>\"); \n\t\t\t</script>\n\t\t\t<?\n\t\t\texit();\n\t\t}\n\t}", "private function conectar()\n {\n try {\n $options = [\n PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION\n ];\n\n $this->pdo = new PDO(\"mysql:dbname=usuarios;host=localhost\", 'root', '', $options);\n\n } catch (PDOException $e) {\n echo 'Falhou: ' . $e->getMessage();\n }\n }", "function conecta() {\n $conexao = mysql_connect(\"localhost\", \"root\", \"\") or die(\"Erro na conexão do banco de dados.\");\n $selecionabd = mysql_select_db(\"controlemotorista\", $conexao) or die(\"Banco de dados inexistente.\");\n return $conexao;\n }", "public function __construct(){\n $this->db = new Conect();//criando o objeto Conect\n $this->db = $this->db->Conn();//executando metodo e pondo em uma variavel\n}", "public function connectDB() {}", "function conectarse() {\n\t\tif(!($conexion = mysql_connect(\"localhost\", \"root\", \"\"))) {\n\t\t\techo \"Error al conectarse a la Base de datos\";\n\t\t\texit();\n\t\t}\n\t\tif(!mysql_select_db(\"precioscuidados\", $conexion)) {\n\t\t\techo \"Error al seleccionar a la Base de datos\";\n\t\t\texit();\n\t\t}\n\t\treturn $conexion;\n\t}", "public function getConnexion(){\n $this->connexion = null; \n try{\n $this->connexion = new PDO('mysql:host=' . $this->host . ';dbname=' . $this->name,\n $this->user, $this->pass, array(PDO::MYSQL_ATTR_INIT_COMMAND =>'SET NAMES UTF8', \n PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING, PDO::ATTR_EMULATE_PREPARES, false));\n }catch (PDOException $e){\n echo 'false';\n\n }\n }", "function __construct(){\n // se definen los datos del servidor de base de datos\n $conection['server']=\"localhost\"; //host\n $conection['user']=\"root\"; // usuario\n $conection['pass']=\"admin\"; //password\n $conection['base']=\"INNSADB\"; //base de datos\n\n // crea la conexion pasandole el servidor , usuario y clave\n $conect= mysql_connect($conection['server'],$conection['user'],$conection['pass']);\n mysql_set_charset('utf8',$conect);\n\n if ($conect) {// si la conexion fue exitosa , selecciona la base\n mysql_select_db($conection['base']);\n $this->con=$conect;\n }\n\n }", "public function __construct() {\n $this->conecta();\n }", "function conecta_profesor($nombrebase) {\n\n // --- Realizar la conexion\n //@ $db = mysqli_pconnect($mihost,\"GranLiante\",\"S4l4d3l4M4k1nA\");\n\t@ $db = mysqli_pconnect($mihost,\"GranLiante\",\"S4l4d3l4M4k1nA\");\n\n if (!$db){\n echo mensaje_error('No se ha podido abrir la base de datos. Inténtelo más tarde',1);\n exit;\n }\n\n // --- Abrir la base de datos\n $mibase = mysqli_select_db($nombrebase);\n\n if (!$mibase){\n echo mensaje_error('No existe la base de datos donde se almacena la información. Inténtelo más tarde',1);\n exit;\n }\n }", "public static function connect(){\n\n// con el this obtengo valores de fuera de esta funcion, luego a la variable se instancia con los valores de la conexion\n\t\t\t$connection_db = new mysqli (DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n// este if es para obtener datos en caso de tener algun error\n\t\t\tif($connection_db->connect_errno){\n\n\t\t\t\techo \"Fallo la conexion a la base de datos: \" . $connection_db->connect_error;\n\t\t\t\treturn;\n\t\t\t}// else{\n\t\t\t// \techo \"Conexion exitosa\";\n\t\t\t// \treturn $connection_db;\n\t\t\t// } solo en caso de querer probar el exito de la conexion\n\n// el charset es por si en la base de datos hay comas aqui se muestren tambien\n\t\t\t$connection_db->set_charset(DB_CHARSET);\n\t\t}", "function fconectar(){\n\t\t$this->conexion = new mysqli($this->servidor, $this->usuario, $this->pwd, $this->bd);\n\t\tif ($this->conexion->connect_error) {\n \t\tdie('Error de Conexión (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error);\n\t\t}\t\t\n\t}", "function conectar()\n\t{\n $this->conexion = new \\mysqli($this->servidor,$this->usuario,$this->clave,$this->base) \n or die (\"Error de Conexion MySQL \".$this->conexion->connect_errno);\n $this->bandera = true;\n $this->conexion->set_charset(\"utf8\");\n return $this->conexion;\n }", "public function connect(){\n\t//boi the phai dua no vao mang $this->_connection = sqlsrv_connect($this->_hostname,array($this->_user,$this->_pass) or die ('Không thể kết nối đến CSDL');\n\t// thi no bao k ket noi CSDL duoc\n\t//con neu chi chay $this->_connection = sqlsrv_connect($this->_hostname) or die ('Không thể kết nối đến CSDL'); thi no vo duoc,nhung thang sqlsrv nay no k co cau lenh select database(sqlsrv_seleect_db) nhu cua thang mysql_select_db va mssql_select_db boi the o khuc duoi phai lam sao hien tai mac dinh dang de la sqlsrv_query($this->_connection,$this->_database);\n\t\t$this->_connection = sqlsrv_connect($this->_hostname,$this->_params) or die ('Không thể kết nối đến CSDL');\n\t\t//$smst = sqlsrv_query($this->_connection,$this->_database);\n\t\t//câu lệnh cũ \n\t\t//$this->_connection = mysql_connect(\"$this->_hostname\",\"$this->_user\",\"$this->_pass\") or die ('Không thể kết nối đến CSDL');\n\t\t//mysql_select_db($this->_database,$this->_connection);\n\t}", "public function UsuarioDAO(){\r\n\t\t\t$dba = new DbAdmin(\"mysqli\");\r\n\t\t\t$dba->connect('localhost', 'root', '', 'inteligencia');\r\n\t\t\t$this->dba = $dba;\t\r\n\t\t}", "static public function conectar () {\n # tiene tres parametros\n\n $link = new PDO('mysql:host=localhost;dbname=aplicacionphp','root','');\n # var_dump($link);\n\n return $link;\n\n }", "function ManejoBD(){\n\t\t$this->BaseDatos = \"instituto\"; # aignar valor a la propiedad $BaseDatos\n\t\t$this->Servidor = \"localhost\"; # aignar valor a la propiedad $Servidor\n\t\t$this->Usuario = \"root\"; # aignar valor a la propiedad $Usuario\n\t\t$this->Clave = \"123456\"; # aignar valor a la propiedad $Clave\n\t}", "function Conexion($servidor, $baseDato, $usuario, $password)\n {\n # se guardan los datos de los parametros en las propiedades de la clase\n $this->servidor = $servidor;\n $this->baseDato = $baseDato;\n $this->usuario = $usuario;\n $this->password = $password;\n # se llama al metodo privado configurar()\n $this->configurar();\n }", "function conexion (){\r\n\t\t\r\n\t\ttry{\r\n\t\t\t$conexion=new PDO('mysql:host=localhost; dbname=socor', 'root', '');\r\n\t\t\t$conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t\t$conexion->exec(\"SET CHARACTER SET UTF8\");\t\t\t\r\n\t\t}catch(exception $e){\r\n\t\t\tdie(\"error gafo\" . getMessage());\t\t\t\r\n\t\t\techo \"linea del error gafo \" . $e->getLine();\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\treturn $conexion;\t\t\r\n\t}", "protected function connect(){\n $dsn = \"mysql:host=\".$this->servidor.\";dbname=\".$this->base_datos;\n // Creamos un objeto pdo que crea la conexion con la base de datos\n $db = new PDO($dsn, $this->user, $this->pswd);\n // Añadimos un atributo que hara que los datos que nos devuelva la base de datos\n // se agrupen en forma de array asociativo\n $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n // Devolvemos el objeto db\n return $db;\n }", "public function connectToDB() {}", "public function conectar() {\n //Establecer conexion con el servidor\n $this->linkId = @mysql_connect($this->servidor, $this->usuario, $this->password);\n if ($this->linkId == true) {//Si se conecto al servidor.\n //Asignar la conexion a la base de datos\n if (!mysql_select_db($this->baseDatos)) {\n throw new Exception(\"No se pudo conectar a la base de datos\");\n }\n } else {//Si no se conecto al servidro\n throw new Exception(\"No se pudo conectar al servidor\");\n }\n }", "function conectar($servidor,$usuario,$contras,$base){\n $link=mysql_connect($servidor,$usuario,$contras) or die (\"Can't connect to the Database Server\");\n $conect=mysql_select_db($base,$link) or die (\"Can't find the database\");\n return $conect;\n }", "function post(){\r\n\t\t//Connect\r\n\t\t$sql = new DataBase;\r\n\t\t$sql->connect();\r\n\t}", "function post_conectar()\n\t{\n\t\t//En este metodo antiguamente se incluia codigo para asegurarse que el esquema de auditoria\n\t\t//guardara el usuario conectado.\n\t}", "public function Connect() {\n\n try {\n //atribuindo usuario de acesso ao banco ao atributo user\n $this->user = \"root\";\n \n //atribuindo a senha de acesso ao banco no atributo pass\n $this->pass = \"\";\n\n //atribuindo o endereço do banco no atributoi host \n $this->host = \"localhost\";\n \n //atribuindo o nome do banco criado no atributo base\n $this->base = \"mydb\";\n\n\n\n $parametros = array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES UTF8\"); //Definimos a conexão com o banco no padrão URF-8\n\n\n\n // atribuindo os parametros de conexao no atrinuto file\n $this->file = \"mysql:host=\" . $this->host . \";dbname=\" . $this->base;\n\n //atribuido a linha de comando PDO(para iniciação na conexao) no atributo pdo\n $this->pdo = new PDO($this->file, $this->user, $this->pass, $parametros);\n\n\n\n //atribuindo os atributos complementares PDO no atributo pdo\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $this->pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n\n $this->pdo->setAttribute(PDO::ATTR_PERSISTENT, true);\n\n if (!$this->pdo) {\n echo \"Erro na conexão\";\n }\n \n return $this->pdo;\n } catch (PDOException $ex) {\n\n echo \"Erro no sistema\" . $ex->getMessage();\n }\n }", "function conexion(){\n $conexion=mysqli_connect(\n\n\n $this ->servidor,\n $this ->usuario,\n $this ->contraseña,\n $this ->BaseDatos\n\n\n );\n\n //return deuelve un objeto a la conexion\n return $conexion;\n }", "private function connect(){\n\t\trequire (__DIR__ . '/../../config.php');\n\t\t$mysqlCFG =$database['mysql'];\n\t\t\n\t\tif(!self::$db){\n\t\t\t$connectionString = \"mysql:host=$mysqlCFG[host];dbname=$mysqlCFG[dbname]\";\n\t\t\ttry{\n\t\t\t\tself::$db = new \\PDO($connectionString, $mysqlCFG['user'], $mysqlCFG['password']);\n\t\t\t\tself::$db->setAttribute( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\t\t\t}catch(\\PDOException $e){\n\t\t\t\tdie(\"Ocurrio un error al conectar con la base de datos: $e->getMessage()\");\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function Conecta() {\r\n $conexao = mysqli_connect(\"mysql.hostinger.com.br\", \"u172114687_admin\", \"00Lavaauto\", \"u172114687_dados\");\r\n return $conexao;\r\n }", "public function abrirConexion(){\n if($this->conexion == null){\n $cls_conexion = new cls_conexion();\n $this->conexion = $cls_conexion->conectar();\n }\n }", "private function __construct() {\n\t\tself::$conexao = new PDO(\"mysql:dbname=\" . BD . \";host=\" . HOST, USUARIO, SENHA, array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\n\t\tself::$conexao->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\tself::$conexao->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\n\t}", "public function conexion()\r\n\t{\r\n\t\tif($this->driver=='mysql' || $this->driver==null)\r\n\t\t{\r\n\t\t\t$con = new mysqli($this->host, $this->user, $this->pass, $this->database);\r\n\r\n\t\t\t//se setea el tipo de acotejamiento\r\n\r\n\t\t\t$con->query(\"SET NAMES\".$this->charset);\r\n\t\t}\r\n\r\n\t\treturn $con;\r\n\t}", "public function conectionDB(){\n $mysqlConnect = \"mysql:host=$this->dbHost;dbname=$this->dbName\";\n $dbConnection = new PDO($mysqlConnect,$this->dbUser,$this->dbPass);\n $dbConnection -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $acentos = $dbConnection->query(\"SET NAMES 'utf8'\");\n return $dbConnection;\n\n }", "public static function conectar()\n {\n\n // $link->exec(\"set names utf8\");\n\n // // return $link;\n\n $link = new PDO(\"mysql:host=88.198.24.90;dbname=inventar_proyectofinal\", \"inventariosadsi\", \"SETQDnuHgv(_\");\n $link->exec(\"set names utf8\");\n return $link;\n\n $link->exec(\"set names utf8\");\n\n return $link;\n\n }", "public function ConectarBDD(){\r\n $this->conexion=pg_connect('dbname=sanjuanitas user=DBA password=12345678');\r\n if(!$this->conexion){\r\n echo json_encode(\"Error al intentar conectar la base de datos\");\r\n }\r\n }", "function conectar()\n\t\t{\n\t\t\t//$connectionInfo = array(\"Database\"=>$this->db, \"UID\"=>$this->user, \"PWD\"=>$this->pass);\n\n\t\t\t$connectionInfo = array(\"Database\"=>$this->db);\n\t\t\t$this->conexion = sqlsrv_connect($this->server,$connectionInfo);\n\t\t\tif(!$this->conexion)\n\t\t\t{\n\t\t\t\techo \"Error al Conectar\";\n\t\t\t\tdie( print_r( sqlsrv_errors(), true));\n\t\t\t}\n\t\t}", "private function databaseConnection()\n {\n // Les connexions sont établies en créant des instances de la classe de base de PDO\n $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING);\n $this->db = new PDO(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS, $options);\n }", "static public function conectar(){\n /* SE CREA UN OBJETO LLAMADO PDO */\n $link = new PDO(\"mysql:host=localhost;dbname=sefaureo2\",\n \"jaengine_sef219\",\n \"yD$4QM4LJ2s2\");\n\n /* LA FUNCION EXEC SIRVE PARA QUE ACEPTE LOS CARACTERES LATINOS */\n $link->exec(\"set names utf8\");\n \n return $link;\n\n }", "public function __construct(){\n\t\t\t$this->dsn = 'mysql:host=localhost;dbname=renova';\n\t\t\t$this->username = 'root';\n\t\t\t$this->password ='';\n\t\t\t$this->connection();\n\n\t\t}", "public function connect_db() {\n }", "final public function Selado ()\n {\n if(!self::$conn)\n {\n try\n {\n self::$conn = new PDO(\n $this->param['socket'].\n \":host=\".$this->param['endereco'].\n \";dbname=\".$this->param['bdados'].\n \";charset=\".$this->param['charset'].\n \";\",$this->param['usuario']\n ,$this->param['senha']);\n self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n self::$conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\n } catch (PDOException $e)\n {\n print \"***********<br/><h3>Servidor de dados não responde!. <br/><a href=''>tente novamente...</a></h3> \";\n die(\"****************************\");\n }\n }\n }", "function __construct() {\n\n $conection['server']=\"localhost\"; //host\n $conection['user']=\"dario\"; // usuario\n $conection['pass']=\"dario\"; //password\n $conection['base']=\"INNSADB\"; //base de datos\n\n $conect = oci_connect($conection['user'], $conection['pass'], $conection['server'],'AL32UTF8');\n //el parametro 'AL32UTF8' soluciona todo el tema de los acentos\n if (!$conect) {\n $m = oci_error();\n echo $m['message'], \"\\n\";\n exit;\n } else {\n //echo \"Conexión con éxito a Oracle!\";\n $this->con=$conect;\n }\n\n }", "function conectar2 ($servidor, $usuario, $pass, $base) {\n\t\t\t\t$db_con = mysql_connect ($servidor,$usuario,$pass);\n\t\t\t\tif (!$db_con) return false; \n\t\t\t\tif (!mysql_select_db ($base, $db_con)) return false;\n\t\t\t\tif (!mysql_query(\"SET NAMES 'utf8'\")) return false;\n\t\t\t\treturn $db_con; \n\t\t\t}", "function conectar(){\n // USER : u402480197_melredes\n // SENHA : K#f:S>F9o\n\n\n $host= \"mysql:host=localhost;dbname=melprotecoes\";\n $user= \"root\";\n $pass= \"\";\n\n try {\n $pdo= new PDO($host, $user, $pass);\n return $pdo;\n } catch (PDOException $e) {\n echo \"Erro de login: \" . $e->getMessage();\n } catch (Exception $e) {\n echo \"Erro: \" . $e->getMessage();\n }\n\n }", "public static function connect(){\n $config = (object)Bind::get('config')->database;\n\n // $pdo = new PDO(\"mysql:host=localhost;dbname=curso_mvc;charset=utf8\", \"root\", \"root\");\n // $pdo->setAttribute(\"PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION\"); \n // //Erros que forem acontecendo serão mostrados através de um exception\n\n // // $pdo->setAttribute(\"PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC\");\n // //Retorna um array.. $user['name']\n\n // $pdo->setAttribute(\"PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ\");\n // //Vai retornar um obj.. $user->name\n\n $pdo = new PDO(\"mysql:host=$config->host;dbname=$config->dbname;charset=$config->charset\", $config->username, $config->password, $config->options);\n\n return $pdo;\n \n }", "public function conectar(){\n\t\t\t\n\t\t\t\n\t\t\t$host = \"localhost\";\n\t\t\t$user = \"root\";\n\t\t\t$password = \"\";\n\t\t\t$database = \"ssca\";\n\t\t\t\n\t\t\n\t\t\t$conexion = mysqli_connect($host, $user, $password);\n\t\t\tmysqli_select_db($conexion, $database);\n\t\t\treturn $conexion;\n\t\t}", "function conectar2 ($servidor, $usuario, $pass, $base) {\n\t\t\t\t\t$db_con = mysql_connect ($servidor,$usuario,$pass);\n\t\t\t\t\tif (!$db_con) return false; \n\t\t\t\t\tif (!mysql_select_db ($base, $db_con)) return false;\n\t\t\t\t\tif (!mysql_query(\"SET NAMES 'utf8'\")) return false;\n\t\t\t\t\treturn $db_con; \n\t\t\t\t}", "public function conexion(){\n\n $bbdd = $this->driver .':host='. $this->host . ';dbname=' . $this->database . ';charset=' . $this->charset;\n\n //$bbdd = ' mysql:host=localhost;dbname=mvc1;charset=utf8';\n try {\n $connection = new PDO($bbdd, $this->user, $this->pass);\n $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n return $connection;\n } catch (PDOException $e) {\n //Lanzamos la excepción\n throw new Exception('Problema al establecer conexión.');\n }\n }", "function conexion(){\n\n\t\trequire(\"/home/cc409/pekes-tote/data/dbData.inc\");\n\t\t$conexion=new mysqli($host,$user,$pass,$database);\n\t\tif($conexion->connect_errno){\n \tdie('Error de Conexion '. $conexion->connect_errno .\" : \".$conexion->connect_error);\n }\n return $conexion;\n }", "public function connectDefault() {\n\t\t\treturn $this->connect(Config::DB_SERVER, Config::DB_NAME, Config::DB_USERNAME, Config::DB_PASSWORD);\n\t\t}", "public function conectar() \n \t{\n return $this->conex; \n \t}", "public function Cl_Conexion() {\r\n try {\r\n $this->cone= mysqli_connect($this->host, $this->usuario, $this->password, $this->base);\r\n } catch (Exception $ex) {\r\n echo $exc->getTraceAsString();\r\n }\r\n }", "protected function start(){\n\t\n\t\t\t$this->con = new PDO(\"mysql:host=$this->host;dbname=$this->banco;\", \"$this->user\" , \"$this->senha\");\n\t\t}", "public function connect(){\n $this->database->connect($this->server, $this->login, $this->password, $this->db_name);\n if($this->database->connect_errno){\n return;\n }\n //nastavi kodovanie databazy na UTF-8\n $this->database->query(\"SET CHARACTER SET utf8\");\n $this->connected=true;\n }", "private function setConexion()\r\n\t\t{\r\n\t\t\t$this->_conexion = New ConexionController();\r\n\t\t\t$this->_conn = $this->_conexion->initConectar('db');\r\n\t\t}", "private function setConexion()\r\n\t\t{\r\n\t\t\t$this->_conexion = New ConexionController();\r\n\t\t\t$this->_conn = $this->_conexion->initConectar('db');\r\n\t\t}", "function conectar() {\r\n\t\n\t$conexion = mysql_connect(constant(\"HOST_NAME\"),constant(\"USUARIO_BD\"),constant(\"PASS_BD\"));\r\n\tmysql_select_db(constant(\"BD\"),$conexion);\r\n\t\r\n\treturn $conexion;\r\n}", "public function __construct()\n {\n $PARAM_hote = 'localhost';\n\n // le port de connexion à la base de données\n $PARAM_port = '3306';\n // le nom de la base de données\n\n $PARAM_nom_bd = 'InstaDog';\n\n // Le nom d'utilisateur pour se connecter \n $PARAM_utilisateur = 'adminInstaDog';\n\n // le mot de passe de l'utilisateur pour se connecter\n $PARAM_mot_passe = 'Inst@D0g';\n \n // Attraper les exceptions \n try {\n $this->connexion = new PDO(\n 'mysql:host=' . $PARAM_hote . '; dbname=' . $PARAM_nom_bd,\n $PARAM_utilisateur,\n $PARAM_mot_passe\n );\n } catch (Exception $e) {\n echo 'Erreur: ' . $e->getMessage() . '<br/>';\n echo 'N° : ' . $e->getCode();\n }\n }", "public function __construct() \r\n {\r\n \t$this->id = 0;\r\n\t\t$this->nombre = \"\";\r\n\t\t$this->clave = \"\";\r\n\t\t$this->privilegio = \"\";\r\n \t$this->con = new cConexion();\r\n\t\t$this->tabla = \"usuario\";\r\n\t\t//$this->con->Conectar();\r\n }", "static function conectar(){\n R::setup(\"mysql:host=\".CONFIG_HOST.\";dbname=\".CONFIG_BD,CONFIG_USER,CONFIG_PASS);\n\t\t\tself::$mysqli = new mysqli(CONFIG_HOST, CONFIG_USER, CONFIG_PASS, CONFIG_BD);\n\t\t\tself::$mysqli->set_charset('utf8');\n }", "function cls_conexion(){\r\n\r\n\t}", "function transaccion(){\n\t\t\t$this->conexion = new conexion();\n\t\t\t$this->conn = $this->conexion->enlace();\n\t\t}", "public function __construct() \n {\n $this->con();\n }", "private function connect()\n {\n //variable con el nombre del server\n $server = \"localhost\";\n //variable con el nombre de la base\n $database = \"candidatossv\";\n //variable con el usuario de la base\n $username = \"root\";\n //variable con la contra de la base\n $password = \"\";\n try {\n //realizando conexion\n @self::$connection = new PDO(\"mysql:host=$server; dbname=$database; charset=utf8\", $username, $password);\n } catch (PDOException $exception) {\n //mostrando el tipo de excepcion al realizar la conexion\n throw new Exception($exception->getCode());\n }\n }", "public function connect(){\n\t\t$this->conn=mysqli_connect($this->host,$this->user,$this->pass); //menghubungkan ke localhost\n\t\tmysqli_select_db($this->conn,$this->database); //menghubungkan ke database\n\t\tif(!$this->conn){ //menghubungkan ke database\n\t\t\treturn die('Maaf, koneksi belum tersambung: '.mysqli_connect_error()); //Maaf,koneksi belum tersambung\n\t\t}\n\t}", "function dbConectionm ()\t{\r\n $conexion = null; // Se inicializa variable a nul\r\n \t\t# code...\r\n \t\t\t$usr = \"root\";\r\n \t\t$pwd = \"\";\r\n \t\t$host = \"localhost\";\r\n \t\t$db = \"soluciones_en_ti\";\r\n \t\t\r\n \t\t try {\r\n \t\t $conexion = new PDO(\"mysql:host=$host;dbname=$db;\",$usr,$pwd);\r\n //$conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n \t }\r\n \t catch(PDOException $e){\r\n echo \"Failed to get DB handle: \" . $e->getMessage();\r\n exit; \r\n }\r\n return $conexion;\r\n \t }", "function getConexion(){\r\n try{\r\n $conexion = new mysqli($this->host.\":\".$this->port, $this->user, $this->pass, $this->base);\r\n if($conexion->connect_errno){\r\n $conexion = \"SIN CONEXION A LA BASE DE DATOS: \".$conexion->connect_errno.\" - \".$conexion->connect_error;\r\n }\r\n }catch(Exception $ex){\r\n $conexion = \"Excepcion en la conexion: \".$ex->getMessage(); \r\n } \r\n return $conexion;\r\n }", "function conectar_bd() {\n\t\t$conexion_bd = mysqli_connect(\"localhost\",\"root\",\"\",\"almacenciasa\");\n\n\t\t//verificar si la base de datos se conecto\n\t\tif( $conexion_bd == NULL){\n\t\t\tdie(\"No se pudo conectar con la base de datos\");\n\t\t}\n\t\treturn $conexion_bd;\n\t}", "function conectar () {\n $username = \"root\";\n $password = \"root\";\n try {\n $conn = new PDO ('mysql:host=localhost;dbname=its', $username, $password);\n } catch (Exception $errorConexion) {\n echo \"ERROR: $errorConexion\";\n }\n return $conn;\n }", "function __construct() {\r\n $instancia = Database::getInstance();\r\n\r\n $this->con = $instancia->getConexion();\r\n }", "function conexao_mysql(){\n\t\t$conexao = mysqli_connect($this->host, $this->usuario, $this->senha, $this->banco_de_dados);\n\n\t\t//ajustar o charset de comunicação entre a aplicação e o banco de dados recebe dois paramentros.\n\t\tmysqli_set_charset($conexao,'utf8');\n\n\t\t//verficar se houve algum erro de conexao com banco de dados.\n\t\t//mysqli_connect_errno = se nao for 0 existe sim um erro com banco de dados.\n\t\t//mysqli_connect_error = mensagem do erro.\n\t\tif(mysqli_connect_errno()){\n\t\t\techo 'Erro ao tentar se conectar com banco de dados:'.mysqli_connect_error();\n\t\t}\n\t\t\n\t\treturn $conexao;\n\t}", "function conectarBD ()\n{\n\ttry {\n\t\t$pdo= new PDO('mysql:host=127.0.0.1;dbname=tareas','root','');\n\t\treturn $pdo;\n\t\t} \n\t\tcatch(PDOException $e) \n\t\t{\n\t \tdd($e->getmessage());\n\t // con el operador -> se invocan las funciones de la clase \n\t}\n}", "function dataBaseConection( ) {\n try{\n $db = new PDO(motor.\":host=\".pc.\"; dbname=\".dbname.\"; port=\".port ,dbuser, dbpasswd);\n return $db;\n }\n catch( PDOException $pdoException ){\n echo \"<br>\";\n echo \"La conexion fallo: \". $pdoException->getMessage();\n }\n}", "public static function connect(){\n if(is_null(static::$connection)){\n $host = \"localhost\";\n $user = \"root\";\n $password = \"\";\n $dbname = \"userdata\";\n $dsn = \"mysql:host=$host;dbname=$dbname\";\n\n //create PDO connection and set fetch method\n static::$connection = new PDO($dsn,$user,$password);\n static::$connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE,PDO::FETCH_ASSOC);\n }\n return static::$connection;\n }", "public function __construct(){\n \t\t// Criando Conexão\n \t\t$dsn = 'mysql:dbname=db_padrao;host=localhost;port=3336;';\n \t\t$user = 'root';\n \t\t$password = '';\n\t\t$this->connector = new PDO($dsn, $user, $password);\n\t\t$this->connector->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t$this->connector->exec(\"SET CHARACTER SET utf8\");\n \t\t$retornos = [];\n \t}", "function getBd(){\n $cnx = connexion();\n return $cnx;\n}", "function abrirBanco(){\n $conexao = new mysqli(\"localhost\",\"root\",\"\",\"banco\");\n return $conexao;\n }", "function abrirBanco(){\n $conexao = new mysqli(\"localhost\",\"root\",\"\",\"banco\");\n return $conexao;\n }", "public function __construct()\n {\n\n\n\n $this->db = Conectdb::conection();\n }", "private function __construct(){\n \n try {\n $dsn = \"mysql:host=\".SERVER_DB.\";dbname=Usuarios;charset=utf8\";\n $this->dbh = new PDO($dsn, \"root\", \"root\");\n $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e){\n echo \"Error de conexión \".$e->getMessage();\n exit();\n }\n // Construyo las consultas\n $this->stmt_usuarios = $this->dbh->prepare(\"select * from Usuarios\");\n $this->stmt_usuario = $this->dbh->prepare(\"select * from Usuarios where user=:user\");\n $this->stmt_boruser = $this->dbh->prepare(\"delete from Usuarios where user=:user\");\n $this->stmt_moduser = $this->dbh->prepare(\"update Usuarios set nombre=:nombre, clave=:clave, email=:email plan=:plan estado=:estado where user=:user\");\n $this->stmt_creauser = $this->dbh->prepare(\"insert into Usuarios (user,nombre,clave,email,plan,estado) Values(?,?,?,?)\");\n }", "function Conectar(){\n\n\n\t$servername = \"127.0.0.1\";\n\t$username = \"root\";\n\t$password = \"\";\n\t$dbname = \"normalizacion_beco_web\";\n\t\n\t\n\t// Create connection\n\t$conection = new mysqli($servername, $username, $password, $dbname);\n\t// Check connection\n\tif ($conection->connect_error) {\n\t\tdie(\"Connection failed: \" . $conection->connect_error);\n\t}else {\n\t\t//echo 'Connection OK '.$conection;\n\t}\n\treturn $conection;\n}", "public static function conectar()\n\t\t{\n\t\t\treturn self::conexao('post');\n\t\t}", "public function __construct()\n {\n // Connexion à la Base de Données\n $this->conn = new PDO(DATABASE, LOGIN, PASSWORD);\n \n }", "function tienda(){\r\n $this->conexion = new Conexion();\r\n $this->conexion->Conexion();\r\n }", "function m_seleBD(){\n\t\tmysql_select_db($this->a_nomBD, $this->a_conexion);\n\t}" ]
[ "0.7443549", "0.72799975", "0.7178088", "0.7150023", "0.7134301", "0.709854", "0.70920664", "0.70821714", "0.7071114", "0.7064414", "0.70420885", "0.7011411", "0.69392705", "0.68658686", "0.6862212", "0.6855865", "0.6843906", "0.6786938", "0.6757083", "0.67535216", "0.672354", "0.6718647", "0.67150843", "0.67120767", "0.6700836", "0.6699832", "0.6696515", "0.6684489", "0.668322", "0.6676459", "0.66742736", "0.66733426", "0.66655105", "0.6646109", "0.664301", "0.6641285", "0.664053", "0.66310644", "0.6616788", "0.66060746", "0.6591082", "0.6588044", "0.65784585", "0.656236", "0.65533435", "0.65393573", "0.653687", "0.6533686", "0.6532961", "0.6508357", "0.6503459", "0.649862", "0.6493063", "0.6488099", "0.6487656", "0.6485121", "0.64850825", "0.6484922", "0.646825", "0.6465715", "0.64560276", "0.64538383", "0.64533913", "0.6452331", "0.6451814", "0.6441398", "0.64386773", "0.6437436", "0.6426609", "0.64260507", "0.64222425", "0.64222425", "0.6420485", "0.6411997", "0.6406297", "0.6405154", "0.64016306", "0.64015853", "0.6387601", "0.6383836", "0.6383203", "0.63737464", "0.6370056", "0.6367706", "0.636573", "0.6362988", "0.6358386", "0.63567406", "0.6344152", "0.63420737", "0.63286924", "0.63276494", "0.63221705", "0.63221705", "0.63175094", "0.63072973", "0.63056785", "0.63004947", "0.6299746", "0.6299617", "0.6297075" ]
0.0
-1
Register any authentication / authorization services.
public function boot() { $this->registerPolicies(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerServices()\n {\n $this->app->bind(SocialProvidersManager::class, SocialiteProvidersManager::class);\n\n $this->app->singleton(TwoFactor::class, function () {\n return new AuthyTwoFactor(new Client());\n });\n }", "private function registerServices() {\n // Modules\n $this->addService('modules', 'MyTravel\\Core\\Service\\Modules::setService');\n // Routing\n $this->addService('routing', 'MyTravel\\Core\\Service\\Routing::setService');\n // Event dispatcher\n $this->serviceContainer\n ->register('events', 'Symfony\\Component\\EventDispatcher\\EventDispatcher');\n // Database\n $this->addService('db', 'MyTravel\\Core\\Service\\Db::setService');\n // Access\n $this->addService('access', 'MyTravel\\Core\\Service\\Access::setService');\n }", "protected function registerServices(): void\n {\n $this->registerKernels();\n $this->registerFactories();\n $this->registerMicroServices();\n }", "public function registerAuth()\n {\n $this->container->make(DingoAuth\\Auth::class)->extend('jwt', function($app) {\n return new DingoAuth\\Provider\\JWT($app[\\Antares\\Modules\\Api\\Providers\\Auth\\JWT::class]);\n });\n }", "public function registerAuthServices(Container $container)\n {\n static $provider = null;\n\n if ($provider === null) {\n $provider = new AuthServiceProvider();\n }\n\n $provider->register($container);\n }", "public function registerServices() {\n\t\t$services = $this->getServices();\n\t\t$services = array_map( [ $this, 'instantiateServices' ], $services );\n\t\t\n\t\tarray_walk( $services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}", "public static function register_services()\n {\n foreach ( self::get_services() as $class )\n {\n $service = self::instantiate( $class );\n if( method_exists( $service, 'register' ) )\n $service->register();\n }\n }", "public static function register_services()\n {\n foreach ( self::get_services() as $class ) {\n $service = self::instantiate( $class );\n if ( method_exists( $service, 'register' ) ) {\n $service->register();\n }\n }\n }", "public static function register_services()\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($service, 'register')) {\n $service->register();\n }\n }\n }", "public function register_services() {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( ! empty( $this->services ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$classes = $this->get_service_classes();\n\n\t\t$this->services = array_map(\n\t\t\t[ $this, 'instantiate_service' ],\n\t\t\t$classes\n\t\t);\n\n\t\tarray_walk( $this->services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}", "protected function registerServices()\r\n\t{\r\n\r\n\t\t$di = new FactoryDefault();\r\n\r\n\t\t$loader = new Loader();\r\n\r\n\t\t/**\r\n\t\t * We're a registering a set of directories taken from the configuration file\r\n\t\t */\r\n\t\t$loader->registerDirs(\r\n\t\t\tarray(\r\n\t\t\t\t__DIR__ . '/../apps/library/',\r\n\t\t\t\t__DIR__ . '/../apps/plugins/'\r\n\t\t\t)\r\n\t\t)->register();\r\n\r\n\r\n\r\n\t\t//Registering a router\r\n\t\t$di->set('router', function(){\r\n\r\n\t\t\t$router = new Router();\r\n\r\n\t\t\t$router->setDefaultModule(\"frontend\");\r\n\t\t\t$router->setDefaultController(\"index\");\r\n\t\t\t$router->setDefaultAction(\"index\");\r\n\r\n $router->add(\"/register/recoveryPassword\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'register',\r\n 'action' => 'recoveryPassword',\r\n ));\r\n $router->add(\"/register/index\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'register',\r\n 'action' => 'index',\r\n ));\r\n\r\n $router->add(\"/help/about\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'help',\r\n 'action' => 'about',\r\n ));\r\n\r\n\t\t\t\r\n\t\t\t$router->add(\"/ajax/getlast\", array(\r\n\t\t\t\t'module' => 'frontend',\r\n\t\t\t\t'controller' => 'ajax',\r\n\t\t\t\t'action' => 'getlast',\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$router->add(\"/:controller/:action/:params\", array(\r\n\t\t\t\t'module' => 'frontend',\r\n\t\t\t\t'controller' => 1,\r\n\t\t\t\t'action' => 2,\r\n\t\t\t\t'params'=>3\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/:controller/:action/:params\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 1,\r\n\t\t\t\t'action' => 2,\r\n\t\t\t\t'params'=>3\r\n\t\t\t));\r\n\r\n// $router->add(\"/admin/register\", array(\r\n// 'module' => 'backend',\r\n// 'controller' => 'register',\r\n// 'action' => 'index',\r\n// ));\r\n\r\n\t\t\t$router->add(\"/admin\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/login\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\r\n\r\n//\t\t\t$router->notFound(array(\r\n//\t\t\t\t\"controller\" => \"index\",\r\n//\t\t\t\t\"action\" => \"page404\",\r\n//\t\t\t));\r\n\r\n\t\t\treturn $router;\r\n\r\n\t\t});\r\n\r\n\t\t$this->setDI($di);\r\n\t}", "public static function register_services(): void\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($class, 'register')) {\n $service->register();\n }\n }\n }", "public function register()\n {\n $this->registerAuthenticator();\n }", "public function register()\n {\n Auth::extend('sso', function ($app, $name, array $config) {\n // 返回一个 Illuminate\\Contracts\\Auth\\Guard 实例...\n return new OaGuard(Auth::createUserProvider($config['provider']),$app->make('request'));\n });\n\n Auth::provider('sso', function ($app, array $config) {\n return new OaUserProvider();\n });\n }", "public function registerServices(DiInterface $di)\n {\n self::acl($di);\n }", "public function registerServices(){\n }", "protected function registerServiceProviders()\n {\n foreach ($this->providers as $provider) {\n $this->app->register($provider);\n }\n }", "protected function registerServices()\n {\n\n $di = new FactoryDefault();\n\n /**\n * Read services\n */\n include CORE_PATH . \"/config/services.php\";\n\n /**\n * Get config service for use in inline setup below\n */\n $config = $di->getConfig();\n\n\n include CORE_PATH . '/config/loader.php';\n\n \n\n $this->setDI($di);\n }", "public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n API::error(function (AuthorizationException $exception)\n {\n //如果出现权限异常,请先检查策略是否有再服务提供者中进行绑定\n abort(403, $exception->getMessage());\n });\n\n API::error(function (AuthenticationException $exception)\n {\n abort(401, $exception->getMessage());\n });\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/awesio-auth.php', 'awesio-auth');\n\n $this->app->singleton(AuthContract::class, Auth::class);\n\n $this->registerRepositories();\n\n $this->registerServices();\n\n $this->registerHelpers();\n }", "public function registerServices()\n {\n $this->app->bind('helpers.lib', function($app) {\n return new LibHelper;\n });\n $this->app->bind('helpers.theme', function($app) {\n return ThemeHelper::instance();\n });\n $this->app->bind('helpers.acf', function($app) {\n $helper = AcfHelper::instance();\n $helper->setThemeHelper($this->app['helpers.theme']);\n $helper->setLib($this->app['helpers.lib']);\n\n return $helper;\n });\n }", "protected function registerServiceProviders()\n {\n if ($this->active()->has('providers')) {\n $providers = $this->active()->get('providers');\n\n foreach ($providers as $provider) {\n App::register($provider);\n }\n }\n }", "public function registerDefaultServices()\n {\n /*\n * Add Paths to container\n */\n $this['basePath'] = $this->basePath();\n $this['storagePath'] = $this->basePath().'/storage';\n $this['appPath'] = $this->appPath();\n\n $this->register(new DefaultServices($this));\n\n $this->register(new ErrorHandlerService($this));\n\n // Enable debug based on user configuration\n if (true === $this->app->config->get('app')['debug']) {\n Debug::enable();\n }\n\n /*\n * retister View Provider\n */\n $this->register(new ViewServiceProvider($this));\n\n /*\n * Register Route Provider\n */\n $this->register(new RouteServiceProvider($this));\n\n /*\n * Register Database Provider\n */\n $this->register(new DatabaseServiceprovider($this));\n }", "public function registerServices()\n {\n /**\n * @var $container Container\n */\n $container = $this->getContainer();\n\n $services = $container->settings['services'];\n\n if (is_array($services) && !empty($services)) {\n foreach ($services as $service) {\n /**\n * @var $instance ServiceInterface\n */\n $instance = new $service();\n\n $container[$instance->name()] = $instance->register();\n\n unset($instance);\n }\n }\n\n unset($container, $services, $service);\n }", "public function register_services(): void {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( \\count( $this->service_container ) > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the injector as the very first service.\n\t\t$this->service_container->put(\n\t\t\tstatic::SERVICE_PREFIX . static::INJECTOR_ID,\n\t\t\t$this->injector\n\t\t);\n\n\t\t$services = $this->get_service_classes();\n\n\t\tif ( $this->enable_filters ) {\n\t\t\t/**\n\t\t\t * Filter the default services that make up this plugin.\n\t\t\t *\n\t\t\t * This can be used to add services to the service container for\n\t\t\t * this plugin.\n\t\t\t *\n\t\t\t * @param array<string, string> $services Associative array of identifier =>\n\t\t\t * class mappings. The provided\n\t\t\t * classes need to implement the\n\t\t\t * Service interface.\n\t\t\t */\n\t\t\t$filtered_services = apply_filters(\n\t\t\t\tstatic::HOOK_PREFIX . static::SERVICES_FILTER,\n\t\t\t\t$services\n\t\t\t);\n\n\t\t\t$services = $this->validate_services( $filtered_services );\n\t\t}\n\n\t\twhile ( null !== key( $services ) ) {\n\t\t\t$id = $this->maybe_resolve( key( $services ) );\n\n\t\t\t$class = $this->maybe_resolve( current( $services ) );\n\n\t\t\t// Delay registering the service until all requirements are met.\n\t\t\tif (\n\t\t\t\tis_a( $class, HasRequirements::class, true )\n\t\t\t) {\n\t\t\t\tif ( ! $this->requirements_are_met( $id, $class, $services ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->schedule_potential_service_registration( $id, $class );\n\n\t\t\tnext( $services );\n\t\t}\n\t}", "public function boot()\n\t{\n\t\t$this->registerPolicies();\n\n\t\tAuth::provider('api_token', function($app, array $config) {\n\t\t\treturn new ApiTokenUserProvider();\n\t\t});\n\n\t\tAuth::extend('api_token', function ($app, $name, array $config) {\n\t\t\t$guard = new ApiTokenGuard(\n\t\t\t\tAuth::createUserProvider($config['provider']),\n\n\t\t\t\t$app['request'],\n\t\t\t\t$config['input_key'] ?? 'api_token',\n\t\t\t\t$config['storage_key'] ?? 'api_token',\n\t\t\t\t$config['hash'] ?? true\n\t\t\t);\n\n\t\t\treturn $guard;\n\t\t});\n\n\t\tAuth::provider('firebase', function($app, array $config) {\n\t\t\treturn new FirebaseUserProvider();\n\t\t});\n\n\t\tAuth::extend('firebase', function ($app, $name, array $config) {\n\t\t\t$guard = new FirebaseGuard(\n\t\t\t\tAuth::createUserProvider($config['provider']),\n\n\t\t\t\t$app['request'],\n\t\t\t\t$config['input_key'] ?? 'token',\n\t\t\t\t$config['storage_key'] ?? 'token',\n\t\t\t\t$config['hash'] ?? true\n\t\t\t);\n\n\t\t\treturn $guard;\n\t\t});\n\t}", "public function register()\n {\n $this->registerServices();\n }", "protected function registerBaseServices()\n {\n $container = $this->getContainer();\n\n $container->share('logger', function () use ($container) {\n return new Logger($container->get('config'));\n });\n\n $this->registerService(new Providers\\ConfigProvider());\n $this->registerService(new Providers\\FileSystemProvider());\n $this->registerService(new Providers\\ParserManagerProvider());\n $this->registerService(new Providers\\BackendProvider());\n }", "public function register()\n\t{\n\t\t$this->registerAuthInstall();\n\t}", "public function registerServices() {\n\t\t$services = Config::inst()->get('FakeManager', 'services');\n\t\tif($services) {\n\t\t\tforeach($services as $origName => $fakeName) {\n\t\t\t\t$fakeObj = Injector::inst()->create($fakeName);\n\t\t\t\tif($this->db && $fakeObj instanceof FakeDatabaseConsumerInterface) {\n\t\t\t\t\t$fakeObj->setDb($this->db);\n\t\t\t\t}\n\t\t\t\t$this->services[$origName] = $fakeObj;\n\t\t\t\tInjector::inst()->registerService($fakeObj, $origName);\n\t\t\t}\n\t\t}\n\t}", "public function boot(): void\n {\n $this->registerPolicies();\n\n Auth::provider('null', fn (Application $app, array $config) => new NullUserProvider($config['model'] ?? IAPUser::class));\n\n Auth::provider('list', fn (Application $app, array $config) => new ListUserProvider($config['model'] ?? IAPUser::class, $config['list'] ?? []));\n\n Auth::provider('group', fn (Application $app, array $config) => new GroupUserProvider($config['model'] ?? IAPUser::class, $config['group'] ?? ''));\n\n Auth::provider('identity-group', fn (Application $app, array $config) => new IdentityGroupUserProvider($config['model'] ?? IAPUser::class, $config['group'] ?? ''));\n\n $this->viaRequest('firebase', [Guard\\Firebase_Guard::class, 'validate']);\n\n $this->viaRequest('gae-internal', [Guard\\AppEngine_Guard::class, 'validate']);\n $this->viaRequest('gae-iap', [Guard\\IAP_Guard::class, 'validate']);\n $this->viaRequest('gae-oidc', [Guard\\OIDC_Guard::class, 'validate']);\n $this->viaRequest('gae-oauth2', [Guard\\OAuth2_Guard::class, 'validate']);\n\n $this->viaRequest('gae-combined-iap', [Guard\\Combined\\IAP_Guard::class, 'validate']);\n $this->viaRequest('gae-combined-iap-oidc', [Guard\\Combined\\IAP_OIDC_Guard::class, 'validate']);\n $this->viaRequest('gae-combined-iap-oidc-oauth2', [Guard\\Combined\\IAP_OIDC_OAuth2_Guard::class, 'validate']);\n }", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register(): void\n {\n /* @phpstan-ignore-next-line */\n $this->app->configure('auth');\n /* @phpstan-ignore-next-line */\n $this->app->configure('remote-token-auth');\n\n config([\n 'auth.guards.rta' => array_merge([\n 'driver' => 'remote-token-auth',\n ], config('auth.guards.rta', [])),\n ]);\n\n $this->registerAdapter();\n }", "public function register()\n\t{\n\t\t$this->registerCommands();\n\t\t$this->registerHybridAuth();\n\t}", "public function register(): void\n {\n $this->configure();\n $this->registerServices();\n }", "public function boot()\n {\n $this->registerPolicies();\n $this->registerPassport();\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function boot()\n {\n require __DIR__ . '/helpers.php';\n\n $this->app['auth']->extend('custom', function ($app, $name, array $config) {\n $guard = new Guard($name, $app['auth']->createUserProvider($config['provider']), $app['session.store']);\n $guard->setCookieJar($app['cookie']);\n $guard->setDispatcher($app['events']);\n $guard->setRequest($app->refresh('request', $guard, 'setRequest'));\n\n return $guard;\n });\n\n $this->app['auth']->provider('custom', function ($app) {\n return new EloquentUserProvider(\n $app[Hasher::class],\n $app[UserRepository::class],\n $app[TeamRepository::class]\n );\n });\n\n $this->registerPolicies();\n }", "public function registerServices($di)\n\t{\n\n\t\t//Registering a dispatcher\n\t\t$di->set(Services::DISPATCHER, function () {\n\t\t\t$eventsManager = new EventsManager;\n\n\t\t\t/**\n\t\t\t * Check if the user is allowed to access certain action using the SecurityPlugin\n\t\t\t */\n\t\t\t$eventsManager->attach('dispatch:beforeDispatch', new APISecurityPlugin);\n\n\t\t\t$dispatcher = new \\Phalcon\\Mvc\\Dispatcher();\n\t\t\t$dispatcher->setDefaultNamespace(\"Multiple\\\\API\\\\Controllers\");\n\t\t\t$dispatcher->setEventsManager($eventsManager);\n\n\t\t\treturn $dispatcher;\n\t\t});\n\n\t\t/**\n\t\t * Setting up the view component\n\t\t */\n\t\t//Registering a shared view component\n\t\t$di->set(Services::VIEW, function() {\n\t\t\t$view = new \\Phalcon\\Mvc\\View();\n\t\t\t$view->setViewsDir(APP_PATH.'app/modules/api/views/');\n\t\t\t$view->registerEngines(array(\".volt\" => 'volt'));\n\t\t\treturn $view;\n\t\t});\n\n\t\t/**\n\t\t * Setting up volt\n\t\t */\n\t\t$di->set(Services::VOLT, function($view, $di) {\n\t\t\t$volt = new VoltEngine($view, $di);\n\n\t\t\t$volt->setOptions(array(\n\t\t\t\t\"compiledPath\" => APP_PATH . \"cache/api/\"\n\t\t\t));\n\n\t\t\t$compiler = $volt->getCompiler();\n\t\t\t$compiler->addFunction('is_a', 'is_a');\n\n\t\t\treturn $volt;\n\t\t}, true);\n\n\n\t\t$di->setShared(Services::AUTH_MANAGER, function () use ($di) {\n\n\t\t\t$authManager = new AuthenticateManager(60000);\n\t\t\t$authManager->registerAdaptor(MobileAdaptor::NAME, new MobileAdaptor());\n\t\t\t$authManager->registerTokenParser(new TokenParser(\"mysecret\"));\n\n\t\t\treturn $authManager;\n\t\t});\n\n\t\t/**\n\t\t * @description PhalconRest - \\League\\Fractal\\Manager\n\t\t */\n\t\t$di->setShared(Services::FRACTAL_MANAGER, function () {\n\n\t\t\t$fractal = new \\League\\Fractal\\Manager;\n\t\t\t$fractal->setSerializer(new CustomSerializer());\n\n\t\t\treturn $fractal;\n\t\t});\n\n\t\t/** @var \\Phalcon\\Http\\ResponseInterface $response */\n\t\t$response = $di->get('response');\n\t\t$response->setHeader('Access-Control-Allow-Origin', '*')\n\t\t\t->setContentType('application/json', 'utf-8');\n\n\t}", "protected function registerServices()\n {\n $this->singleton('request', function ($app) {\n return new Request($app);\n });\n\n $this->singleton('response', function ($app) {\n return new Response($app);\n });\n\n $this->singleton('route', function ($app) {\n return new Route($app);\n });\n\n $this->singleton('view', function ($app) {\n return new View($app);\n });\n\n $this->singleton('exception', function ($app) {\n return new Exception($app, $app->exception);\n });\n\n $this->singleton('crypt', function ($app) {\n return new Crypt($app->getSecret());\n });\n\n $this->singleton('cookie', function ($app) {\n return new Cookie($app, $app->getConfig('state')['cookie']);\n });\n\n $this->singleton('session', function ($app) {\n return new Session(new SessionDatabaseHandler($app, $app->getConfig('state')['session']));\n });\n\n return $this->factory();\n }", "protected function registerServiceProviders()\n {\n $this->register(\\Illuminate\\Events\\EventServiceProvider::class);\n if(is_array($providers = $this['config']['providers'])){\n foreach ($providers as $alias => $provider) {\n if (!is_int($alias)) {\n $this->services[$alias] = $provider;\n } else {\n $this->register($provider);\n }\n }\n }\n }", "public function register()\n {\n // $this->app->bind('AuthService', AuthService::class);\n }", "public function register()\n {\n\n $this->registerPermissionMerger();\n\n $this->registerPermissionChecker();\n\n $this->registerHasher();\n\n $this->registerTokenRepository();\n\n $this->registerUserProvider();\n\n $this->registerLoginValidator();\n\n $this->registerGroupRepository();\n\n $this->registerGroupManager();\n\n $this->registerUserRepository();\n\n $this->app->singleton('auth.driver', function($app)\n {\n return $app['auth']->guard();\n });\n\n }", "protected function registerServices()\n {\n $this->app->singleton('components', function($app) {\n $path = $app['config']->get('components.paths.components');\n\n return new Repository($app, $path);\n });\n }", "public function boot()\n {\n $this->registerPolicies();\n\n $headerParser = new AuthHeaders();\n auth()->parser()->setChain([$headerParser]);\n $this->app->forgetInstance('tymon.jwt.parser');\n $this->app->forgetInstance('tymon.jwt');\n $headerParser = new AuthHeaders();\n $headerParser->setHeaderPrefix('Device');\n auth('device')->parser()->setChain([$headerParser]);\n $this->app->forgetInstance('tymon.jwt.parser');\n $this->app->forgetInstance('tymon.jwt');\n $headerParser = new AuthHeaders();\n $headerParser->setHeaderPrefix('Authorizer');\n auth('authorizer')->parser()->setChain([$headerParser]);\n\n Gate::before(function (Authorizable $user, string $ability) {\n if ($user instanceof AuthorizableInterface) {\n return $user->hasPermissionTo($ability) ?: null;\n }\n });\n }", "protected function registerAuthenticator()\n {\n $this->app->singleton('auth', function ($app) {\n return new AuthManager($app);\n });\n }", "protected function loadServices()\n {\n $di = $this->getDI();\n\n // Register the dispatcher setting a Namespace for controllers\n $di->setShared('dispatcher', function () {\n\n\n $dispatcher = new Dispatcher();\n $dispatcher->setDefaultNamespace('Phalcana\\Controllers');\n\n $listener = new Dispatch;\n $events = new Manager();\n $events->attach('dispatch', $listener);\n $dispatcher->setEventsManager($events);\n\n return $dispatcher;\n });\n\n $di->setShared('router', $this->loadRoutes(new Router(false)));\n }", "public function register()\n {\n $this->app->when(PaypalController::class)\n ->needs(PaymentInterface::class)\n ->give(PaypalService::class);\n\n $this->app->when(StripeController::class)\n ->needs(PaymentInterface::class)\n ->give(StripeService::class);\n\n $this->app->when(SquarePayController::class)\n ->needs(PaymentInterface::class)\n ->give(SquarePayService::class);\n }", "private function providers()\n {\n $this->register(new CorsServiceProvider());\n $this->register(new HmacServiceProvider());\n }", "protected function registerServices()\n {\n $this->app->singleton('adminmenu', function () {\n return new Builder();\n });\n }", "private function registerAll()\n {\n $this->registerApp();\n $this->registerPsr();\n $this->registerRequests();\n $this->registerResponses();\n $this->registerPlugins();\n $this->registerCallables();\n $this->registerViews();\n $this->registerUtils();\n }", "public function boot()\n {\n $this->app->singleton('api.auth', function ($app) {\n return new AuthManager(new RequestTokenStorage($app->make('request')));\n });\n }", "public function boot()\n {\n $this->app->bind(\n AuthorizationInterface::class,\n User::class\n );\n }", "public function register()\n {\n // Bind Credential Contract with Service\n $this->app->bind(Credentials::class, function ($app){\n return new CredentialsManger($app->make('filesystem.disk'), $app->make('encrypter'));\n });\n\n // Bind Caption Contract with Service\n $this->app->bind(Configuration::class, function ($app){\n return new ConfigurationManager($app->make('filesystem.disk'));\n });\n\n // Inject dependencies into Auth Service.\n $this->app->singleton(Post::class, function ($app){\n return new PostService(new Instagram(true, true), $app->make(Credentials::class));\n });\n\n // Inject Guzzle Into Reddit Service\n $this->app->singleton(Scraper::class, function ($app){\n return new ScraperService(new Client(['base_uri' => 'http://www.reddit.com']), $app->make(Configuration::class), $app->make('filesystem.disk'));\n });\n\n $this->app->bind(Caption::class, function ($app){\n return new CaptionManager($app->make('filesystem.disk'), $app->make('encrypter'));\n });\n }", "public function boot()\n {\n $this->app['auth']->extend('jwt', function ($app) {\n $bearerToken = $app['request']->server->getHeaders()['AUTHORIZATION'] ?? '';\n $tokenService = new TokenService();\n $guard = new JwtGuard($bearerToken, $tokenService);\n return $guard;\n });\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "protected function registerServiceProviders()\n\t{\n\t\t// Core Bus\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Bus\\BusServiceProvider');\n\n\t\t// Core Event\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Events\\EventsServiceProvider');\n\n\t\t// Repositories\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Repositories\\RepositoriesServiceProvider');\n\t}", "public function register()\n\t{\n $this->registerApi();\n\t}", "public function boot()\n {\n Passport::routes(function ($router) {\n $router->forAuthorization();\n $router->forAccessTokens();\n //$router->forTransientTokens(); // the tokens we issue are permanent\n //$router->forClients(); // we don't want external applications using our oauth flows\n //$router->forPersonalAccessTokens(); // we don't have a user-facing API yet\n });\n\n $this->registerPolicies();\n\n Gate::define('use-permission', function ($user, $permission) {\n if ($user->hasRole('privacc') && config()->get('app.env') != 'production') {\n return true;\n }\n\n try {\n return auth()->user()->hasPermissionTo($permission);\n } catch (PermissionDoesNotExist $e) {\n return false;\n }\n });\n\n $this->serviceAccessGates();\n }", "protected function registerBaseServiceProviders()\n {\n $this->register(new EventServiceProvider($this));\n $this->register(new RouteServiceProvider($this));\n }", "public function register()\n {\n $this->app->bind('redhotmayo\\auth\\AuthorizationService', AuthorizationService::SERVICE);\n $this->app->bind('AuthorizationService', AuthorizationService::SERVICE);\n\n // Register 'api_authorizer' instance container to our ApiAuthorizer object\n $this->app['api_authorizer'] = $this->app->share(function($app)\n {\n $service = App::make('AuthorizationService');\n return new ApiAuthorizer($service);\n });\n\n // Shortcut so developers don't need to add an Alias in app/config/app.php\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('ApiAuthorizer', 'redhotmayo\\api\\auth\\ApiAuthorizer');\n });\n }", "public function register(): void\n\t{\n\t\t$this->mergeConfigFrom(__DIR__.'/../../config/larauthkit.php', 'larauthkit');\n\t\tif (config('larauthkit.authn.enable'))\n\t\t{\n\t\t\t$this->app->register(AuthkitEventServiceProvider::class);\n\t\t\t$this->app->register(AuthnServiceProvider::class);\n\t\t}\n\n\t\tif (config('larauthkit.authz.enable'))\n\t\t{\n\t\t\t$this->app->register(AuthzServiceProvider::class);\n\t\t}\n\t}", "public function __construct()\n {\n $this->userService = Core::getService(UserService::class);\n $this->applicationService = Core::getService(ApplicationService::class);\n $this->libraryService = Core::getService(LibraryService::class);\n $this->middleware('auth');\n }", "protected function registerServices()\n {\n $this->app->singleton(\n 'adminmenu',\n function () {\n return new Builder();\n }\n );\n }", "public function register()\n {\n $this->registerBindings(collect($this->bindings));\n $this->registerFactories(collect($this->factories));\n $this->registerProviders(collect($this->providers));\n $this->registerSeeders(collect($this->seeders));\n }", "protected function registerBaseServiceProviders()\n {\n $this->register(new EventServiceProvider($this));\n $this->register(new LogServiceProvider($this));\n $this->register(new RoutingServiceProvider($this));\n }", "public function register(): void\n {\n $this->registerMultipleConfig();\n\n $this->registerProviders([\n Providers\\AuthServiceProvider::class,\n Providers\\RouteServiceProvider::class,\n ]);\n\n $this->registerCommands([\n InstallCommand::class,\n PublishCommand::class,\n ]);\n }", "public function boot()\n {\n $this->registerPolicies();\n\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeExtensionGrant(), Passport::tokensExpireIn()\n );\n\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeQRCodeGrant(), Passport::tokensExpireIn()\n );\n\n Passport::routes();\n\n Passport::tokensCan([\n 'create-dragons' => 'Create dragons',\n 'create-trees' => 'Create trees',\n 'create-child-accounts' => 'Create child accounts',\n 'update-child-accounts' => 'Update child accounts',\n 'update-profile' => 'Update profile',\n ]);\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(AuthServiceProvider::class);\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'StartMeUp\\Services\\Registrar'\n\t\t);\n\n\t\t$repositories = [\n\t\t\t'Company',\n\t\t];\n\t\tforeach ($repositories as $repository) {\n\t\t\t$this->bindRepository($repository);\n\t\t}\n\n\t}", "public function register()\n {\n $this->loadConfigs(['assets.php', 'permissions.php']);\n $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');\n\n $this->app->bind(Authentication::class, SentinelAuthentication::class);\n }", "public function boot(): void\n {\n $this->registerPolicies();\n }", "public function boot() {\n\t\t$this->registerPolicies();\n\n\t\tPassport::routes();\n\t\tPassport::tokensExpireIn(Carbon::now()->addMinutes(30));\n\t\tPassport::refreshTokensExpireIn(carbon::now()->addDays(30));\n\t\tPassport::personalAccessTokensExpireIn(Carbon::now()->addMonths(2));\n\n\t\t//Register implicit grant type\n\t\tPassport::enableImplicitGrant();\n\n\t\t//Scopes for api\n\t\tPassport::tokensCan(['purchase-product' => 'Create transactions for products',\n\t\t\t'manage-product' => 'Create, read, delete, update products',\n\t\t\t'manage-account' => 'Read account data if verified or is admin modify data but can not remove account',\n\t\t\t'read-general' => 'Read general information like purcahsing categories, selling proucts, your transactions etc',\n\t\t]);\n\t}", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes(null, [\n 'prefix' => 'oauth'\n ]);\n\n Gate::define('upload_budgets', function ($user) {\n return $user->permissions()->where('key', 'upload_budgets')->count();\n });\n\n Gate::define('manage_categories', function ($user) {\n return $user->permissions()->where('key', 'manage_categories')->count();\n });\n\n Gate::define('manage_citizens', function ($user) {\n return $user->permissions()->where('key', 'manage_citizens')->count();\n });\n\n Gate::define('manage_shop-keepers', function ($user) {\n return $user->permissions()->where('key', 'manage_shop-keepers')->count();\n });\n\n Gate::define('manage_budgets', function ($user) {\n return $user->permissions()->where('key', 'manage_budgets')->count();\n });\n\n Gate::define('manage_vouchers', function ($user) {\n return $user->permissions()->where('key', 'manage_vouchers')->count();\n });\n\n Gate::define('manage_admins', function ($user) {\n return $user->permissions()->where('key', 'manage_admins')->count();\n });\n\n Gate::define('manage_permissions', function ($user) {\n return $user->permissions()->where('key', 'manage_permissions')->count();\n });\n\n Gate::define('manage_vouchers_transactions', function ($user) {\n return $user->permissions()->where('key', 'manage_vouchers_transactions')->count();\n });\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Auth::extend('custom', function ($app, $name, array $config) {\n $guard = new CustomGuard($name, Auth::createUserProvider($config['provider']), $app['session.store']);\n\n if (method_exists($guard, 'setCookieJar')) {\n $guard->setCookieJar($this->app['cookie']);\n }\n\n if (method_exists($guard, 'setDispatcher')) {\n $guard->setDispatcher($this->app['events']);\n }\n\n if (method_exists($guard, 'setRequest')) {\n $guard->setRequest($this->app->refresh('request', $guard, 'setRequest'));\n }\n\n return $guard;\n });\n }", "public function register()\n {\n $this->app->routeMiddleware([\n 'auth' => Authenticate::class,\n ]);\n\n $this->app->router->group(['prefix' => 'api/xblock/auth', 'namespace' => 'XBlock\\Auth'], function ($router) {\n $router->post('/login', [\n 'uses' => 'Login@index',\n ]);\n $router->get('/user', [\n 'uses' => 'Login@getLoginUser',\n 'middleware' => 'auth'\n ]);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('migrations'),\n ], 'xblock');\n $this->registerMigrations();\n $this->commands([\n CreateKey::class\n ]);\n }\n\n }", "public function boot()\n {\n $this->configureAuthorization();\n }", "public function boot()\n {\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeFirebaseGrant(), Passport::tokensExpireIn()\n );\n }", "public function boot()\n {\n $this->app['auth']->viaRequest('api', function ($request) {\n if ($request->header('Authorization')) {\n $key = explode(' ',$request->header('Authorization'));\n\n $client = new Client();\n $response = $client->get(env('SERVICE_ADDRESS_USER').'/users/validate/'.$key[(count($key)-1)]);\n return $response->getStatusCode()==200;\n }\n });\n }", "public function register()\n {\n $this->app->singleton('forrest', function ($app) {\n\n // Config options\n $settings = config('forrest');\n $storageType = config('forrest.storage.type');\n $authenticationType = config('forrest.authentication');\n\n // Dependencies\n $httpClient = $this->getClient();\n $input = new LaravelInput(app('request'));\n $event = new LaravelEvent(app('events'));\n $encryptor = new LaravelEncryptor(app('encrypter'));\n $redirect = $this->getRedirect();\n $storage = $this->getStorage($storageType);\n\n $refreshTokenRepo = new RefreshTokenRepository($encryptor, $storage);\n $tokenRepo = new TokenRepository($encryptor, $storage);\n $resourceRepo = new ResourceRepository($storage);\n $versionRepo = new VersionRepository($storage);\n $instanceURLRepo = new InstanceURLRepository($tokenRepo, $settings);\n $stateRepo = new StateRepository($storage);\n\n $formatter = new JSONFormatter($tokenRepo, $settings);\n\n switch ($authenticationType) {\n case 'OAuthJWT':\n $forrest = new OAuthJWT(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'WebServer':\n $forrest = new WebServer(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'UserPassword':\n $forrest = new UserPassword(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'UserPasswordSoap':\n $forrest = new UserPasswordSoap(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n default:\n $forrest = new WebServer(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n }\n\n return $forrest;\n });\n }", "public function boot(): void\n {\n $adapter = $this->app->make(AdapterInterface::class);\n\n /* @phpstan-ignore-next-line */\n $this->app['auth']->viaRequest(\n 'remote-token-auth',\n fn (Request $request): Authenticatable => $adapter->authorize($request)\n );\n }", "public function boot()\n {\n $this->app->register(UserServiceProvider::class);\n $this->app->register(DashboardServiceProvider::class);\n $this->app->register(CoreServiceProvider::class);\n $this->app->register(InstitutionalVideoServiceProvider::class);\n $this->app->register(InstitutionalServiceProvider::class);\n $this->app->register(TrainingServiceProvider::class);\n $this->app->register(CompanyServiceProvider::class);\n $this->app->register(LearningUnitServiceProvider::class);\n $this->app->register(PublicationServiceProvider::class);\n }", "private function initializeServices()\n {\n $this->emailManager = $this->getService('mycp.service.email_manager');\n $this->translatorService = $this->getService('translator');\n $this->securityService = $this->getService('Secure');\n $this->router = $this->getService('router');\n }", "public function register()\n {\n $this->registerAdapterFactory();\n $this->registerDigitalOceanFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "private function registerAuthenticationRoutes(){\n $prefix = config('web-call-center.prefix');\n \\Route::group((!empty($prefix)? compact('prefix') : []) + ['namespace' => $this->namespace, 'middleware' => 'web'],\n __DIR__.'/../../routes/auth.php');\n }", "public function register()\n {\n $this->registerServices();\n $this->setupStubPath();\n $this->registerProviders();\n }", "protected function registerServiceProviders()\n {\n foreach($this->providers as $provider)\n {\n // check if the provider class exists\n if (class_exists($provider))\n {\n // register this service provider, and Instantiate it.\n $service = new $provider($this);\n\n // check if the service provider has a boot method.\n if (method_exists($service, 'register')) {\n $service->register();\n }\n\n // save the active provider so that we can call it later.\n $this->activeProviders[$provider] = $service;\n }\n }\n }", "public function register()\n { \n // User Repository\n $this->app->bind('App\\Contracts\\Repository\\User', 'App\\Repositories\\User');\n \n // JWT Token Repository\n $this->app->bind('App\\Contracts\\Repository\\JSONWebToken', 'App\\Repositories\\JSONWebToken');\n \n $this->registerClearSettleApiLogin();\n \n $this->registerClearSettleApiClients();\n \n \n }", "public function boot()\n {\n \n // Aqui você pode definir como deseja que os usuários sejam autenticados para o seu Lumen\n // application. O retorno de chamada que recebe a instância de solicitação recebida\n // deve retornar uma instância do usuário ou nulo. Você é livre para obter\n // a instância do usuário por meio de um token de API ou qualquer outro método necessário.\n\n $this->app['auth']->viaRequest('api', function ($request) {\n return \\App\\Aluno::where('email',$request->input('email'))->first();\n });\n }", "public function register()\n {\n // Register all repositories\n foreach ($this->repositories as $repository) {\n $this->app->bind(\"App\\Repository\\Contracts\\I{$repository}\",\n \"App\\Repository\\Repositories\\\\{$repository}\");\n }\n\n // Register all services\n foreach ($this->services as $service) {\n $this->app->bind(\"App\\Service\\Contracts\\I{$service}\", \n \"App\\Service\\Modules\\\\{$service}\");\n }\n }", "public function register()\n {\n /**\n * Sets third party service providers that are only needed on local environments\n */\n if ($this->app->environment() == 'local') {\n /**\n * Loader for registering facades\n */\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n /**\n * Load third party local providers and facades\n */\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n\n $this->app->register(\\Laracasts\\Generators\\GeneratorsServiceProvider::class);\n }\n $this->app->bind('soaClient', function ($app,$params) {\n $cloud = SOA::getInstance($params[0]);\n if($cloud->getEnv()){\n return $cloud;\n }\n $cloud->setEncodeType(true, true);\n $config = config('soa.'.$params[0]);\n $cloud->putEnv('app', $config['app']);\n $cloud->putEnv('appKey', $config['appKey']);\n $cloud->setServers($config['hosts']);\n return $cloud;\n });\n $this->app['request']->server->set('HTTPS', $this->app->environment() != 'local');\n }", "protected function registerGuard()\n {\n Auth::extend('passport', function ($app, $name, array $config) {\n return tap($this->makeGuard($config), function ($guard) {\n $this->app->refresh('request', $guard, 'setRequest');\n });\n });\n }", "public function register()\n {\n $this->app->bind(ClientRepositoryInterface::class, function() {\n return new ClientRepository();\n });\n\n $this->app->bind(AccessTokenRepositoryInterface::class, function() {\n return new AccessTokenRepository();\n });\n\n $this->app->bind(ScopeRepositoryInterface::class, function() {\n return new ScopeRepository();\n });\n\n $this->app->bind(ResourceServer::class, function() {\n $accessTokenRespository = new AccessTokenRepository();\n $publicKey = base_path('public.key');\n return new ResourceServer($accessTokenRespository, $publicKey);\n });\n\n $this->app->bind(AuthorizationServer::class, function() {\n\n $clientRepository = new ClientRepository();\n $scopeRepository = new ScopeRepository();\n $accessTokenRepository = new AccessTokenRepository();\n $authCodeRepository = new AuthCodeRepository();\n $refreshTokenRepository = new RefreshTokenRepository();\n\n\n $privateKey = base_path('private.key');\n $publicKey = base_path('public.key');\n $userRepository = new UserRepository();\n $refreshTokenRepository = new RefreshTokenRepository();\n $intervaloPadrao = new \\DateInterval('P12M');\n\n\n $server = new AuthorizationServer($clientRepository, $accessTokenRepository, $scopeRepository, $privateKey, $publicKey);\n $server->enableGrantType(new ClientCredentialsGrant(), $intervaloPadrao);\n $server->enableGrantType(new PasswordGrant($userRepository, $refreshTokenRepository), $intervaloPadrao);\n\n $authGrant = new AuthCodeGrant($authCodeRepository, $refreshTokenRepository, $intervaloPadrao);\n $authGrant->setRefreshTokenTTL(new \\DateInterval('P12M'));\n \n \n $refreshGrant = new \\League\\OAuth2\\Server\\Grant\\RefreshTokenGrant($refreshTokenRepository);\n $refreshGrant->setRefreshTokenTTL(new \\DateInterval('P12M'));\n\n $server->enableGrantType($authGrant, $intervaloPadrao);\n $server->enableGrantType($refreshGrant, $intervaloPadrao);\n\n\n\n return $server;\n\n });\n\n }", "public function register()\n {\n // dynamically set the rootview based on whether the route is backend or frontend \n // can also be done in a middleware that wraps all admin routes\n if(request()->is('test-react/*')){\n Inertia::setRootView('react.app');\n } elseif(request()->is('test')){\n Inertia::setRootView('vue.app');\n } else {\n // some other\n }\n\n if ($this->app->environment() == 'local') {\n $this->app->register(\\Reliese\\Coders\\CodersServiceProvider::class);\n }\n $this->registerInertia();\n $this->registerWebSockets();\n }", "public function register()\n {\n\n $this->app->register(HookProvider::class);\n $this->app->register(RouteProvider::class);\n// $this->app->register(InstallModuleProvider::class);\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }" ]
[ "0.7238336", "0.71634316", "0.70841175", "0.6916285", "0.6882426", "0.68549484", "0.6853438", "0.6812384", "0.6786827", "0.6771727", "0.6648215", "0.66145295", "0.6606313", "0.6571872", "0.65712136", "0.65602577", "0.65544224", "0.65215147", "0.65081686", "0.64967656", "0.6473557", "0.6465625", "0.6440537", "0.6437382", "0.6419586", "0.63912356", "0.6371695", "0.6331455", "0.63311565", "0.6329123", "0.63267297", "0.6325765", "0.63092077", "0.6308683", "0.6301807", "0.62803197", "0.6268785", "0.62419224", "0.6224927", "0.62247604", "0.62150115", "0.62082845", "0.6207118", "0.6200618", "0.6199985", "0.6199563", "0.61966515", "0.61902905", "0.61892736", "0.61820686", "0.6179434", "0.6158386", "0.61570966", "0.61423475", "0.61418444", "0.6128293", "0.6118749", "0.61166286", "0.6112297", "0.6104109", "0.6099709", "0.60972136", "0.6073358", "0.60715634", "0.60552776", "0.60526836", "0.60454774", "0.6043968", "0.604386", "0.6043709", "0.6040946", "0.6038717", "0.60383916", "0.60350347", "0.60292214", "0.6003098", "0.599686", "0.5995341", "0.59874433", "0.598662", "0.5982651", "0.5974995", "0.5973818", "0.59618443", "0.59618413", "0.59617674", "0.59532464", "0.59489155", "0.5946842", "0.59463835", "0.5943532", "0.59256464", "0.5916127", "0.59147394", "0.5912967", "0.59065604", "0.5904983", "0.5903013", "0.5897574", "0.5897574", "0.5897574" ]
0.0
-1
Constructs a new SettingsForm object.
public function __construct(Settings $settings) { $this->settings = $settings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildSettingsForm() {}", "public function getForm ()\n {\n return new QuoteSettingsForm();\n }", "protected function form()\n {\n $form = new Form(new Config);\n\n $form->text('key', '配置项')->readOnly();\n\n $form->text('value', '值');\n\n $form->text('desc', '描述');\n\n $form->tools(function(Form\\Tools $tools) {\n $tools->disableView();\n });\n\n return $form;\n }", "private function _initGeneralSettingsForm()\n\t{\n\t\tglobal $txt, $context;\n\n\t\t// Instantiate the form\n\t\t$this->_generalSettingsForm = new Settings_Form(Settings_Form::DB_ADAPTER);\n\n\t\t$config_vars = array(\n\t\t\tarray('select', 'sp_portal_mode', explode('|', $txt['sp_portal_mode_options'])),\n\t\t\tarray('check', 'sp_maintenance'),\n\t\t\tarray('text', 'sp_standalone_url'),\n\t\t\t'',\n\t\t\tarray('select', 'portaltheme', $context['SPortal']['themes']),\n\t\t\tarray('check', 'sp_disableColor'),\n\t\t\tarray('check', 'sp_disableForumRedirect'),\n\t\t\tarray('check', 'sp_disable_random_bullets'),\n\t\t\tarray('check', 'sp_disable_php_validation', 'subtext' => $txt['sp_disable_php_validation_desc']),\n\t\t\tarray('check', 'sp_disable_side_collapse'),\n\t\t\tarray('check', 'sp_resize_images'),\n\t\t\tarray('check', 'sp_disableMobile'),\n\t\t);\n\n\t\t$this->_generalSettingsForm->setConfigVars($config_vars);\n\t}", "protected function form()\n {\n return Admin::form(Setting::class, function (Form $form) {\n\n $form->text('phone', '联系电话')->rules('required');\n $form->textarea('address', '联系地址')->rules('required');\n $form->text('email', 'Email')->rules('required');\n $form->text('copyright', '版权信息')->rules('required');\n $form->text('phone_2', '电话(侧边栏)')->rules('required');\n $form->image('wechat', 'Wechat')->rules('required')->removable();\n $form->textarea('intro', '简介')->rules('required');\n\n });\n }", "private function loadForm()\n {\n // init settings form\n $this->frm = new Form('settings');\n\n // add festival year\n $this->frm->addText('year', $this->get('fork.settings')->get($this->URL->getModule(), 'year'));\n\n // add fields for pagination\n $this->frm->addDropdown(\n 'overview_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'overview_num_items', 10)\n );\n $this->frm->addDropdown(\n 'recent_festival_list_num_items',\n array_combine(range(1, 30), range(1, 30)),\n $this->get('fork.settings')->get($this->URL->getModule(), 'recent_festival_list_num_items', 5)\n );\n\n // add functions fields\n $this->frm->addCheckbox('cover_image_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_enabled', false));\n $this->frm->addCheckbox('cover_image_required', $this->get('fork.settings')->get($this->URL->getModule(), 'cover_image_required', false));\n $this->frm->addCheckbox('multi_images_enabled', $this->get('fork.settings')->get($this->URL->getModule(), 'multi_images_enabled', false));\n\n // add god user only fields\n if ($this->godUser) {\n $this->frm->addText('image_size_limit', (float) $this->get('fork.settings')->get($this->URL->getModule(), 'image_size_limit', 10));\n }\n }", "function buildSettingsForm() {\n $form = parent::buildSettingsForm();\n\n $form['entity:file']['show_scheme'] = array(\n '#title' => t('Show file scheme'),\n '#type' => 'checkbox',\n '#default_value' => isset($this->conf['show_scheme']) ? $this->conf['show_scheme'] : array()\n );\n\n $form['entity:file']['group_by_scheme'] = array(\n '#title' => t('Group files by scheme'),\n '#type' => 'checkbox',\n '#default_value' => isset($this->conf['group_by_scheme']) ? $this->conf['group_by_scheme'] : array(),\n );\n\n $image_extra_info_options = array(\n 'thumbnail' => t('Show thumbnails <em>(using the image style !linkit_thumb_link)</em>', array('!linkit_thumb_link' => l('linkit_thumb', 'admin/config/media/image-styles/edit/linkit_thumb'))),\n 'dimensions' => t('Show pixel dimensions'),\n );\n\n $form['entity:file']['image_extra_info'] = array(\n '#title' => t('Images'),\n '#type' => 'checkboxes',\n '#options' => $image_extra_info_options,\n '#default_value' => isset($this->conf['image_extra_info']) ? $this->conf['image_extra_info'] : array('thumbnail', 'dimensions'),\n );\n\n return $form;\n }", "private function _initArticleSettingsForm()\n\t{\n\t\t// instantiate the article form\n\t\t$this->_articleSettingsForm = new Settings_Form(Settings_Form::DB_ADAPTER);\n\n\t\t$config_vars = array(\n\t\t\tarray('check', 'sp_articles_index'),\n\t\t\tarray('int', 'sp_articles_index_per_page'),\n\t\t\tarray('int', 'sp_articles_index_total'),\n\t\t\tarray('int', 'sp_articles_length'),\n\t\t\t'',\n\t\t\tarray('int', 'sp_articles_per_page'),\n\t\t\tarray('int', 'sp_articles_comments_per_page'),\n\t\t\t'',\n\t\t\tarray('text', 'sp_articles_attachment_dir')\n\t\t);\n\n\t\t$this->_articleSettingsForm->setConfigVars($config_vars);\n\t}", "protected function form()\n {\n // 创建一个表单\n return Admin::form(SystemSetting::class, function (Form $form) {\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->text('title', '网站名称')->rules('required');\n $form->image('logo', '网站LOGO')->rules('required');\n $form->image('gongzhonghao', '公众号二维码');\n $form->image('xiaochengxu', '小程序二维码');\n $form->text('service', '在线客服');\n $form->text('icp', 'ICP 备案信息');\n $form->radio('is_login', '是否登录才能访问')->options(['1' => '是', '0' => '否'])->default('0');\n });\n }", "protected function getSettingsFormFactory()\n {\n return $this->get('dag.settings.form_factory');\n }", "protected function settingForm()\n {\n return Administrator::form(function (Form $form) {\n $form->display('username', trans('admin.username'));\n $form->text('name', trans('admin.name'))->rules('required');\n $form->image('avatar', trans('admin.avatar'));\n $form->password('password', trans('admin.password'))->rules('confirmed|required');\n $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required')\n ->default(function ($form) {\n return $form->model()->password;\n });\n\n $form->setAction(admin_base_path('auth/setting'));\n\n $form->ignore(['password_confirmation']);\n\n $form->saving(function (Form $form) {\n if ($form->password && $form->model()->password !== $form->password) {\n $form->password = bcrypt($form->password);\n }\n });\n\n $form->saved(function () {\n admin_toastr(trans('admin.update_succeeded'));\n\n return redirect(admin_base_path('auth/setting'));\n });\n });\n }", "protected function form()\n {\n $form = new Form(new Sections());\n\n $form->text('name', __('Nazwa'));\n $form->text('pageId', __('ID sekcji (w sensie HTML)'));\n $form->textarea('content', __('Zawartość'));\n $form->textarea('style', __('Style(CSS'));\n\n return $form;\n }", "public function initConfigurationForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\t\n\t\t$pl = $this->getPluginObject();\n\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\n\t\t// setting 1 (a checkbox)\n\t\t$cb = new ilCheckboxInputGUI($pl->txt(\"setting_1\"), \"setting_1\");\n\t\t$form->addItem($cb);\n\t\t\n\t\t// setting 2 (text)\n\t\t$ti = new ilTextInputGUI($pl->txt(\"setting_2\"), \"setting_2\");\n\t\t$ti->setRequired(true);\n\t\t$ti->setMaxLength(10);\n\t\t$ti->setSize(10);\n\t\t$form->addItem($ti);\n\t\n\t\t$form->addCommandButton(\"save\", $lng->txt(\"save\"));\n\t \n\t\t$form->setTitle($pl->txt(\"example_plugin_configuration\"));\n\t\t$form->setFormAction($ilCtrl->getFormAction($this));\n\t\t\n\t\treturn $form;\n\t}", "protected function form()\n {\n $form = new Form(new Dictionary());\n $form->disableViewCheck();\n $form->disableEditingCheck();\n $form->disableCreatingCheck();\n\n\n $form->select('type', __('Type'))->options(Dictionary::TYPES);\n $form->text('option', __('Title'))->required();\n $form->text('slug', __('Slug'))->rules('nullable|regex:/(\\w\\d\\_)*/', [\n 'regex' => 'Только латинские буквы и знаки подчеркивания',\n ]);\n $form->text('alternative', __('Alternative'));\n $form->switch('approved', __('Approved'))->default(1);\n $form->number('sort', __('Sort'));\n\n $form->saving(function (Form $form) {\n if ($form->slug === null) {\n $form->slug = Str::slug($form->option);\n }\n });\n return $form;\n }", "public function settings_form($settings)\n\t{\n\t\treturn form_open('', array('class' => 'dashForm')).'\n\t\t\n\t\t\t<p>These values are found on your devot:ee profile page.</p>\n\t\t\t\n\t\t\t<p><label for=\"api_key\">API Key:</label>\n\t\t\t<input type=\"text\" name=\"api_key\" value=\"'.$settings->api_key.'\" /></p>\n\t\t\t\n\t\t\t<p><label for=\"secret_key\">Secret Key:</label>\n\t\t\t<input type=\"text\" name=\"secret_key\" value=\"'.$settings->secret_key.'\" /></p>\n\t\t\t\n\t\t\t<p><input type=\"submit\" value=\"Save\" /></p>\n\t\t\t\n\t\t\t'.form_close();\n\t}", "protected function form()\n {\n $form = new Form(new Resources);\n\n $form->text('name', '名称')->rules('required',['required' => '请输入 配置项的名称']);\n\n $form->radio('type', '类型')->options(Resources::TYPE);\n\n $form->cropper('url','图片');\n\n $form->number('sort_num','排序');\n\n $form->textarea('memo','备注');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n return $form;\n }", "public function settingsForm() {\n $element = [\n '#markup' => 'Rules settings form is not implemented yet.',\n ];\n return $element;\n }", "function settingsObject()\n\t{\n\t\tglobal $tpl, $ilCtrl, $lng;\n\t\t\n\t\t$editor = $this->object->_getRichTextEditor();\n\t\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$this->form = new ilPropertyFormGUI();\n\t\t$this->form->setFormAction($ilCtrl->getFormAction($this));\n\t\t$this->form->setTitle($lng->txt(\"adve_activation\"));\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_use_tiny_mce\"), \"use_tiny\");\n\t\tif ($editor == \"tinymce\")\n\t\t{\n\t\t\t$cb->setChecked(true);\n\t\t}\n\t\t$this->form->addItem($cb);\n\t\t$this->form->addCommandButton(\"saveSettings\", $lng->txt(\"save\"));\n\t\t\n\t\t$tpl->setContent($this->form->getHTML());\n\t}", "protected function form()\n {\n $form = new Form(new Setting());\n\n $form->decimal('member_fee', __('会员年费'))->required();\n $form->decimal('task_rate', __('任务佣金抽成比例'))->required()->help('将扣除对应比例,比例范围0-1');\n $form->tools(function (Form\\Tools $tools) {\n\n // 去掉`列表`按钮\n $tools->disableList();\n\n // 去掉`删除`按钮\n $tools->disableDelete();\n\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n $footer->disableReset();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n //保存后回调\n $form->saved(function (Form $form) {\n $success = new MessageBag([\n 'title' => '提示',\n 'message' => '保存成功',\n ]);\n\n return back()->with(compact('success'));\n });\n return $form;\n }", "protected function form()\n {\n // return Admin::form(Campaign_setting_form::class, function (Form $form) {\n // });\n }", "function initSettingsTypeForm()\n\t{\n\t\tinclude_once(\"./Services/Administration/classes/class.ilSetting.php\");\n\t\t$type = ilSetting::_getValueType();\n\n\t\tinclude_once (\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n $form = new ilPropertyFormGUI();\n\n\t\t$form->setId(\"settings_type\");\n\t\t$form->setTitle($this->lng->txt(\"settings_type\"));\n\t\t$form->setFormAction(\"setup.php?cmd=gateway\");\n\n\t\t$item = new ilNonEditableValueGUI($this->lng->txt('settings_type_current'));\n\t\t$item->setValue(strtoupper($type));\n\n\t\tif ($type == \"clob\")\n\t\t{\n\t\t\t$item->setInfo($this->lng->txt('settings_info_clob'));\n $form->addCommandButton(\"showLongerSettings\", $this->lng->txt(\"settings_show_longer\"));\n $form->addCommandButton(\"changeSettingsType\", $this->lng->txt(\"settings_change_text\"));\n\t }\n\t\telse\n\t\t{\n\t\t\t$item->setInfo($this->lng->txt('settings_info_text'));\n \t$form->addCommandButton(\"changeSettingsType\", $this->lng->txt(\"settings_change_clob\"));\n\t\t}\n\t\t$form->addItem($item);\n\n\t\tif (is_array($this->longer_settings))\n\t\t{\n\t\t\t$item = new ilCustomInputGUI($this->lng->txt('settings_longer_values'));\n\n\t\t\tif (count($this->longer_settings))\n\t\t\t{\n\t foreach ($this->longer_settings as $row)\n\t\t\t\t{\n\t $subitem = new ilCustomInputGUI(sprintf($this->lng->txt('settings_key_info'), $row['module'], $row['keyword']));\n\t\t\t\t\t$subitem->setInfo($row['value']);\n\t\t\t\t\t$item->addSubItem($subitem);\n\t }\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t $item->setHTML($this->lng->txt('settings_no_longer_values'));\n\t }\n\t\t\t$form->addItem($item);\n\t }\n\n\t\treturn $form;\n\t}", "protected function form()\n {\n $form = new Form(new Posts());\n\n $form->text('title', __('Title'));\n $form->text('content', __('Content'));\n $form->number('author_id', __('Author id'));\n $form->number('is_locked', __('Is locked'));\n $form->number('is_locked_comments', __('Is locked comments'));\n $form->text('categories', __('Categories'));\n\n return $form;\n }", "public function settingsForm()\n {\n return 'forecastio-form-settings';\n }", "protected function form()\n {\n $form = new Form(new userWhitelist());\n\n $form->text('accountId', ___('AccountId'));\n $form->text('accountName', ___('AccountName'));\n $form->text('nickName', ___('NickName'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Posts);\n\n $form->text('title', 'Title');\n $form->text('content', 'Content');\n $form->text('video_url', 'Video url');\n $form->switch('status', '审核状态')->states( [ \n 'off' => ['value' => 0, 'text' => '禁止', 'color' => 'primary'],\n 'on' => ['value' => 1, 'text' => '通过', 'color' => 'default']\n ]);\n $form->number('content_type', 'Content type');\n $form->number('member_id', 'Member id');\n return $form;\n }", "protected function form()\n {\n $form = new Form(new SiteHelp);\n\n $form->select('site_help_category_id', __('site-help::help.site_help_category_id'))\n ->options(SiteHelpCategory::pluck('name', 'id'));\n $form->text('title', __('site-help::help.title'));\n $form->number('useful', __('site-help::help.useful'))->default(0);\n $form->textarea('desc', __('site-help::help.desc'));\n $form->image('thumbnail', __('site-help::help.thumbnail'))\n ->removable()\n ->uniqueName()\n ->move('site-help');\n $form->UEditor('content', __('site-help::help.content'));\n $form->select('status', __('site-help::help.status.label'))\n ->default(1)\n ->options(__('site-help::help.status.value'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Cate());\n\n $form->text('name', __('Name'));\n $form->url('link', __('Link'));\n $form->text('thumb', __('Thumb'));\n $form->switch('status', __('Status'));\n $form->number('sort', __('Sort'));\n $form->datetime('createtime', __('Createtime'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Blog());\n\n $form->text('title', __('Title'));\n $form->text('sub_title', __('Sub title'));\n $form->text('tag', __('Tag'));\n $form->textarea('body', __('Body'));\n $form->text('posted_by', __('Posted by'));\n $form->datetime('posted_at', __('Posted at'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Site);\n\n $form->select('category_id', '分类')->options(SiteCategory::selectOptions(null, ''))->rules('required');\n $form->text('title', '标题')->attribute('autocomplete', 'off')->rules('required|max:50');\n $form->image('thumb', '图标')->resize(120, 120)->uniqueName();\n $form->text('describe', '描述')->attribute('autocomplete', 'off')->rules('required|max:300');\n $form->url('url', '地址')->attribute('autocomplete', 'off')->rules('required|max:250');\n $this->disableFormFooter($form);\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Project());\n $form->text('name', '项目名称')->rules('required')->required();\n $form->url('url', '项目地址')->rules('required')->required();\n $form->text('username', '账号');\n $form->text('password', '密码');\n $status = [\n 'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],\n 'off' => ['value' => 2, 'text' => '禁用', 'color' => 'danger'],\n ];\n $form->switch('status', '状态')->states($status)->default(1);\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableDelete();\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n $footer->disableReset();\n $footer->disableViewCheck();\n $footer->disableEditingCheck();\n $footer->disableCreatingCheck();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Category);\n\n $form->text('name', 'Имя');\n\n $form->textarea('text');\n\n $form->switch('status', 'Статус')->states([\n 'on' => ['value' => '1', 'text' => 'Публиковать', 'color' => 'success'],\n 'off' => ['value' => '0', 'text' => 'Не публиковать', 'color' => 'danger'],\n ]);\n\n\n return $form;\n }", "public function initGeneralSettingsForm()\n\t{\n\t\tglobal $lng, $ilUser, $styleDefinition, $ilSetting;\n\t\t\n\t\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$this->form = new ilPropertyFormGUI();\n\n\t\t// language\n\t\tif ($this->userSettingVisible(\"language\"))\n\t\t{\n\t\t\t$languages = $this->lng->getInstalledLanguages();\n\t\t\t$options = array();\n\t\t\tforeach($languages as $lang_key)\n\t\t\t{\n\t\t\t\t$options[$lang_key] = ilLanguage::_lookupEntry($lang_key,\"meta\", \"meta_l_\".$lang_key);\n\t\t\t}\n\t\t\t\n\t\t\t$si = new ilSelectInputGUI($this->lng->txt(\"language\"), \"language\");\n\t\t\t$si->setOptions($options);\n\t\t\t$si->setValue($ilUser->getLanguage());\n\t\t\t$si->setDisabled($ilSetting->get(\"usr_settings_disable_language\"));\n\t\t\t$this->form->addItem($si);\n\t\t}\n\n\t\t// skin/style\n\t\tinclude_once(\"./Services/Style/classes/class.ilObjStyleSettings.php\");\n\t\tif ($this->userSettingVisible(\"skin_style\"))\n\t\t{\n\t\t\t$templates = $styleDefinition->getAllTemplates();\n\t\t\tif (is_array($templates))\n\t\t\t{ \n\t\t\t\t$si = new ilSelectInputGUI($this->lng->txt(\"skin_style\"), \"skin_style\");\n\t\t\t\t\n\t\t\t\t$options = array();\n\t\t\t\tforeach($templates as $template)\n\t\t\t\t{\n\t\t\t\t\t// get styles information of template\n\t\t\t\t\t$styleDef = new ilStyleDefinition($template[\"id\"]);\n\t\t\t\t\t$styleDef->startParsing();\n\t\t\t\t\t$styles = $styleDef->getStyles();\n\n\t\t\t\t\tforeach($styles as $style)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!ilObjStyleSettings::_lookupActivatedStyle($template[\"id\"],$style[\"id\"]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$options[$template[\"id\"].\":\".$style[\"id\"]] =\n\t\t\t\t\t\t\t$styleDef->getTemplateName().\" / \".$style[\"name\"];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$si->setOptions($options);\n\t\t\t\t$si->setValue($ilUser->skin.\":\".$ilUser->prefs[\"style\"]);\n\t\t\t\t$si->setDisabled($ilSetting->get(\"usr_settings_disable_skin_style\"));\n\t\t\t\t$this->form->addItem($si);\n\t\t\t}\n\t\t}\n\n\t\t// screen reader optimization\n\t\tif ($this->userSettingVisible(\"screen_reader_optimization\"))\n\t\t{ \n\t\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"user_screen_reader_optimization\"), \"screen_reader_optimization\");\n\t\t\t$cb->setChecked($ilUser->prefs[\"screen_reader_optimization\"]);\n\t\t\t$cb->setDisabled($ilSetting->get(\"usr_settings_disable_screen_reader_optimization\"));\n\t\t\t$cb->setInfo($this->lng->txt(\"user_screen_reader_optimization_info\"));\n\t\t\t$this->form->addItem($cb);\n\t\t}\n\n\t\t// hits per page\n\t\tif ($this->userSettingVisible(\"hits_per_page\"))\n\t\t{\n\t\t\t$si = new ilSelectInputGUI($this->lng->txt(\"hits_per_page\"), \"hits_per_page\");\n\t\t\t\n\t\t\t$hits_options = array(10,15,20,30,40,50,100,9999);\n\t\t\t$options = array();\n\n\t\t\tforeach($hits_options as $hits_option)\n\t\t\t{\n\t\t\t\t$hstr = ($hits_option == 9999)\n\t\t\t\t\t? $this->lng->txt(\"no_limit\")\n\t\t\t\t\t: $hits_option;\n\t\t\t\t$options[$hits_option] = $hstr;\n\t\t\t}\n\t\t\t$si->setOptions($options);\n\t\t\t$si->setValue($ilUser->prefs[\"hits_per_page\"]);\n\t\t\t$si->setDisabled($ilSetting->get(\"usr_settings_disable_hits_per_page\"));\n\t\t\t$this->form->addItem($si);\n\t\t}\n\n\t\t// Users Online\n\t\tif ($this->userSettingVisible(\"show_users_online\"))\n\t\t{\n\t\t\t$si = new ilSelectInputGUI($this->lng->txt(\"show_users_online\"), \"show_users_online\");\n\t\t\t\n\t\t\t$options = array(\n\t\t\t\t\"y\" => $this->lng->txt(\"users_online_show_y\"),\n\t\t\t\t\"associated\" => $this->lng->txt(\"users_online_show_associated\"),\n\t\t\t\t\"n\" => $this->lng->txt(\"users_online_show_n\"));\n\t\t\t$si->setOptions($options);\n\t\t\t$si->setValue($ilUser->prefs[\"show_users_online\"]);\n\t\t\t$si->setDisabled($ilSetting->get(\"usr_settings_disable_show_users_online\"));\n\t\t\t$this->form->addItem($si);\n\t\t}\n\n\t\t// Store last visited\n\t\t$lv = new ilSelectInputGUI($this->lng->txt(\"user_store_last_visited\"), \"store_last_visited\");\n\t\t$options = array(\n\t\t\t0 => $this->lng->txt(\"user_lv_keep_entries\"),\n\t\t\t1 => $this->lng->txt(\"user_lv_keep_only_for_session\"),\n\t\t\t2 => $this->lng->txt(\"user_lv_do_not_store\"));\n\t\t$lv->setOptions($options);\n\t\t$lv->setValue((int) $ilUser->prefs[\"store_last_visited\"]);\n\t\t$this->form->addItem($lv);\n\n\t\t// hide_own_online_status\n\t\tif ($this->userSettingVisible(\"hide_own_online_status\"))\n\t\t{ \n\t\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"hide_own_online_status\"), \"hide_own_online_status\");\n\t\t\t$cb->setChecked($ilUser->prefs[\"hide_own_online_status\"] == \"y\");\n\t\t\t$cb->setDisabled($ilSetting->get(\"usr_settings_disable_hide_own_online_status\"));\n\t\t\t$this->form->addItem($cb);\n\t\t}\n\t\t\n\t\tinclude_once 'Services/Authentication/classes/class.ilSessionReminder.php';\n\t\tif(ilSessionReminder::isGloballyActivated())\n\t\t{\n\t\t\t$cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled');\n\t\t\t$cb->setInfo($this->lng->txt('session_reminder_info'));\n\t\t\t$cb->setValue(1);\n\t\t\t$cb->setChecked((int)$ilUser->getPref('session_reminder_enabled'));\n\n\t\t\t$expires = ilSession::getSessionExpireValue();\n\t\t\t$lead_time_gui = new ilNumberInputGUI($this->lng->txt('session_reminder_lead_time'), 'session_reminder_lead_time');\n\t\t\t$lead_time_gui->setInfo(sprintf($this->lng->txt('session_reminder_lead_time_info'), ilFormat::_secondsToString($expires, true)));\n\n\t\t\t$min_value = ilSessionReminder::MIN_LEAD_TIME;\n\t\t\t$max_value = max($min_value, ((int)$expires / 60) - 1);\n\n\t\t\t$current_user_value = $ilUser->getPref('session_reminder_lead_time');\n\t\t\tif($current_user_value < $min_value ||\n\t\t\t $current_user_value > $max_value)\n\t\t\t{\n\t\t\t\t$current_user_value = ilSessionReminder::SUGGESTED_LEAD_TIME;\n\t\t\t}\n\t\t\t$value = min(\n\t\t\t\tmax(\n\t\t\t\t\t$min_value, $current_user_value\n\t\t\t\t),\n\t\t\t\t$max_value\n\t\t\t);\n\n\t\t\t$lead_time_gui->setValue($value);\n\t\t\t$lead_time_gui->setSize(3);\n\t\t\t$lead_time_gui->setMinValue($min_value);\n\t\t\t$lead_time_gui->setMaxValue($max_value);\n\t\t\t$cb->addSubItem($lead_time_gui);\n\n\t\t\t$this->form->addItem($cb);\n\t\t}\n\n\t\t// calendar settings (copied here to be reachable when calendar is inactive)\n\t\t// they cannot be hidden/deactivated\n\n\t\tinclude_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');\n\t\tinclude_once('Services/Calendar/classes/class.ilCalendarUtil.php');\n\t\t$lng->loadLanguageModule(\"dateplaner\");\n\t\t$user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());\n\n\t\t$select = new ilSelectInputGUI($lng->txt('cal_user_timezone'),'timezone');\n\t\t$select->setOptions(ilCalendarUtil::_getShortTimeZoneList());\n\t\t$select->setInfo($lng->txt('cal_timezone_info'));\n\t\t$select->setValue($user_settings->getTimeZone());\n\t\t$this->form->addItem($select);\n\n\t\t$year = date(\"Y\");\n\t\t$select = new ilSelectInputGUI($lng->txt('cal_user_date_format'),'date_format');\n\t\t$select->setOptions(array(\n\t\t\tilCalendarSettings::DATE_FORMAT_DMY => '31.10.'.$year,\n\t\t\tilCalendarSettings::DATE_FORMAT_YMD => $year.\"-10-31\",\n\t\t\tilCalendarSettings::DATE_FORMAT_MDY => \"10/31/\".$year));\n\t\t$select->setInfo($lng->txt('cal_date_format_info'));\n\t\t$select->setValue($user_settings->getDateFormat());\n\t\t$this->form->addItem($select);\n\n\t\t$select = new ilSelectInputGUI($lng->txt('cal_user_time_format'),'time_format');\n\t\t$select->setOptions(array(\n\t\t\tilCalendarSettings::TIME_FORMAT_24 => '13:00',\n\t\t\tilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));\n\t\t$select->setInfo($lng->txt('cal_time_format_info'));\n\t $select->setValue($user_settings->getTimeFormat());\n\t\t$this->form->addItem($select);\n\t\t\n\t\t\n\t\t// starting point\t\n\t\tinclude_once \"Services/User/classes/class.ilUserUtil.php\";\n\t\tif(ilUserUtil::hasPersonalStartingPoint())\n\t\t{\n\t\t\t$this->lng->loadLanguageModule(\"administration\");\n\t\t\t$si = new ilRadioGroupInputGUI($this->lng->txt(\"adm_user_starting_point\"), \"usr_start\");\n\t\t\t$si->setRequired(true);\n\t\t\t$si->setInfo($this->lng->txt(\"adm_user_starting_point_info\"));\n\t\t\t$def_opt = new ilRadioOption($this->lng->txt(\"adm_user_starting_point_inherit\"), 0);\n\t\t\t$def_opt->setInfo($this->lng->txt(\"adm_user_starting_point_inherit_info\"));\n\t\t\t$si->addOption($def_opt);\n\t\t\tforeach(ilUserUtil::getPossibleStartingPoints() as $value => $caption)\n\t\t\t{\n\t\t\t\t$si->addOption(new ilRadioOption($caption, $value));\n\t\t\t}\n\t\t\t$si->setValue(ilUserUtil::hasPersonalStartPointPref()\n\t\t\t\t? ilUserUtil::getPersonalStartingPoint()\n\t\t\t\t: 0);\n\t\t\t$this->form->addItem($si);\n\t\t\t\t\t\t\n\t\t\t// starting point: repository object\n\t\t\t$repobj = new ilRadioOption($lng->txt(\"adm_user_starting_point_object\"), ilUserUtil::START_REPOSITORY_OBJ);\n\t\t\t$repobj_id = new ilTextInputGUI($lng->txt(\"adm_user_starting_point_ref_id\"), \"usr_start_ref_id\");\n\t\t\t$repobj_id->setRequired(true);\n\t\t\t$repobj_id->setSize(5);\n\t\t\tif($si->getValue() == ilUserUtil::START_REPOSITORY_OBJ)\n\t\t\t{\n\t\t\t\t$start_ref_id = ilUserUtil::getPersonalStartingObject();\n\t\t\t\t$repobj_id->setValue($start_ref_id);\n\t\t\t\tif($start_ref_id)\n\t\t\t\t{\n\t\t\t\t\t$start_obj_id = ilObject::_lookupObjId($start_ref_id);\n\t\t\t\t\tif($start_obj_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$repobj_id->setInfo($lng->txt(\"obj_\".ilObject::_lookupType($start_obj_id)).\n\t\t\t\t\t\t\t\": \".ilObject::_lookupTitle($start_obj_id));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t$repobj->addSubItem($repobj_id);\n\t\t\t$si->addOption($repobj);\n\t\t}\t\t\n\t\t\n\t\t// selector for unicode characters\n\t\tglobal $ilSetting;\n\t\tif ($ilSetting->get('char_selector_availability') > 0)\n\t\t{\n\t\t\trequire_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';\n\t\t\t$char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_USER);\n\t\t\t$char_selector->getConfig()->setAvailability($ilUser->getPref('char_selector_availability'));\n\t\t\t$char_selector->getConfig()->setDefinition($ilUser->getPref('char_selector_definition'));\n\t\t\t$char_selector->addFormProperties($this->form);\n\t\t\t$char_selector->setFormValues($this->form);\n\t\t}\n\t\t\n\t\t$this->form->addCommandButton(\"saveGeneralSettings\", $lng->txt(\"save\"));\n\t\t$this->form->setTitle($lng->txt(\"general_settings\"));\n\t\t$this->form->setFormAction($this->ctrl->getFormAction($this));\n\t \n\t}", "protected function form()\n {\n $language = Language::query()->get();\n return Form::make(new Setting(), function (Form $form) use ($language) {\n\n $form->defaultEditingChecked();\n\n $form->tab(\"基础\", function (Form $form) {\n\n $form->radio('default_lang', '默认语言')->options(Language::query()->where('status', true)->get()->pluck('name', 'slug'))->help('default_lang:当无法获取语言环境时将会使用此值');\n $form->text('time_format', 'JS日期格式')->help('time_format');\n $form->number('app_version_code', 'APP版本标识')->help('app_version_code');\n $form->url('app_download_url', 'APP下载地址')->help('app_download_url');\n $form->url('socket_url', '消息推送地址')->help('socket_url');\n $form->url('web_url', '前端地址')->help('web_url');\n\n $form->textarea('web_js_code', '前端JS代码')->help('web_js_code');\n\n\n })->tab(\"用户\", function (Form $form) {\n\n $form->number('device_reg_max', '设备注册上限')->help('device_reg_max:同一个设备最多可注册用户');\n\n $form->list('country_code', '注册开启国家码')->width(3)->help('country_code:<a target=\"_blank\" href=\"http://www.loglogo.com/front/countryCode/\">查看国家码列表</a>');\n\n $form->switch('is_sms_reg', '使用短信注册')->help('is_sms_reg');\n\n $form->radio('open_recaptcha', '是否开启谷歌验证')->help('open_recaptcha')\n ->options([1 => '开启', 0 => '关闭'])\n ->when(1, function (Form $form) {\n $form->text('google_web_recaptcha', '谷歌验证码客户端KEY')->help('google_web_recaptcha');\n $form->text('google_serve_recaptcha', '谷歌验证码服务端KEY')->help('google_serve_recaptcha');\n $form->list('google_check_domains', '谷歌验证域名白名单')->help('google_check_domains')->width(2);\n });\n\n\n })->tab(\"钱包\", function (Form $form) {\n\n $form->text('default_currency', '货币单位')->required()->help('default_currency:用于客户端展示用')->width(2);\n $form->text('fiat_code', '国际货币单位')->required()->help('fiat_code:用于获取实时汇率')->width(2);\n $form->switch('show_suffix', '前端换算K单位金额')->help('show_suffix');\n $form->number('money_decimal', '余额显示小数点')->help('money_decimal');\n $form->number('usdt_decimal', 'USDT显示小数点')->help('usdt_decimal');\n $form->switch('open_transform', '开启余额转换')->help('open_transform');\n $form->text('usdt_money_rate', 'USDT- ' . Setting(\"default_currency\") . ' 汇率')->width(2)->required()->help('usdt_money_rate:1USDT=多少' . Setting(\"default_currency\") . ',系统每分钟更新汇率');\n $form->text('rmb_money_rate', '人民币- ' . Setting(\"default_currency\") . ' 汇率')->width(2)->required()->help('rmb_money_rate:1元=多少' . Setting(\"default_currency\"));\n $form->number(\"usdt_to_money_min\", \"USDT转余额最小值\")->required()->help('usdt_to_money_min');\n $form->number(\"money_to_usdt_min\", \"余额转USDT最小值\")->required()->help('money_to_usdt_min');\n\n })->tab(\"充值\", function (Form $form) use ($language) {\n\n $form->radio('open_recharge', '开启充值功能')->options([1 => '开启', 0 => '关闭'])->help('open_recharge:关闭后用户将无法充值')->when(0, function (Form $form) use ($language) {\n $form->embeds('close_recharge_describe', '关闭充值说明', function (Form\\EmbeddedForm $form) use ($language) {\n foreach ($language as $lang) {\n $lang->show ? $form->text($lang->slug, $lang->name)->help('close_recharge_describe') : $form->hidden($lang->slug, $lang->name);\n }\n });\n });\n $form->list('first_recharge_select', '第一次充值选择金额')->help('first_recharge_select')->width(2);\n $form->list('recharge_select', '充值选择金额')->help('recharge_select')->width(2);\n\n })->tab(\"提现\", function (Form $form) use ($language) {\n\n $form->radio('open_withdraw', '开启提现功能')->options([1 => '开启', 0 => '关闭'])->help('open_withdraw:关闭后用户将无法充值')->when(0, function (Form $form) use ($language) {\n $form->embeds('close_withdraw_describe', '关闭充值说明', function (Form\\EmbeddedForm $form) use ($language) {\n foreach ($language as $lang) {\n $lang->show ? $form->text($lang->slug, $lang->name)->help('close_withdraw_describe') : $form->hidden($lang->slug, $lang->name);\n }\n });\n });\n\n $form->number('min_withdraw', '最低提现金额')->help('min_withdraw');\n\n\n })->tab(\"赚钱宝\", function (Form $form) {\n\n $form->switch('mb_open_in', '允许转入')->help('mb_open_in');\n $form->switch('mb_open_out', '允许转出')->help('mb_open_out');\n\n $form->rate('mb_balance_rate', '余额年化率')->help('mb_balance_rate')->width(2)->type('number')->rules('required|numeric|min:0|max:100');\n $form->rate('mb_usdt_rate', 'USDT年化率')->help('mb_usdt_rate')->width(2)->type('number')->rules('required|numeric|min:0|max:100');\n $form->rate('mb_give_rate', '赠送金年化率')->help('mb_give_rate')->width(2)->type('number')->rules('required|numeric|min:0|max:100');\n\n })->tab('任务', function (Form $form) {\n $form->number('free_task_num', '免费任务次数')->help('free_task_num');\n });\n\n\n $form->disableDeleteButton();\n $form->disableCreatingCheck();\n $form->disableViewButton();\n $form->disableResetButton();\n\n\n $form->saving(function (Form $form) {\n\n if ($form->fiat_code && $form->model()->get('fiat_code') != $form->fiat_code) {\n $form->rmb_money_rate = Currency::convert()->from('CNY')->to($form->fiat_code)\n ->get();\n }\n });\n\n });\n }", "private function initNotificationSettingsForm()\n\t{\n\t\tif(null === $this->notificationSettingsForm)\n\t\t{\n\t\t\t$form = new ilPropertyFormGUI();\n\t\t\t$form->setFormAction($this->ctrl->getFormAction($this, 'updateNotificationSettings'));\n\t\t\t$form->setTitle($this->lng->txt('forums_notification_settings'));\n\n\t\t\t$radio_grp = new ilRadioGroupInputGUI('','notification_type');\n\t\t\t$radio_grp->setValue('default');\n\n\t\t\t$opt_default = new ilRadioOption($this->lng->txt(\"user_decides_notification\"), 'default');\n\t\t\t$opt_0 = new ilRadioOption($this->lng->txt(\"settings_for_all_members\"), 'all_users');\n\t\t\t$opt_1 = new ilRadioOption($this->lng->txt(\"settings_per_users\"), 'per_user');\n\n\t\t\t$radio_grp->addOption($opt_default, 'default');\n\t\t\t$radio_grp->addOption($opt_0, 'all_users');\n\t\t\t$radio_grp->addOption($opt_1, 'per_user');\n\n\t\t\t$chb_2 = new ilCheckboxInputGUI($this->lng->txt('user_toggle_noti'), 'usr_toggle');\n\t\t\t$chb_2->setValue(1);\n\n\t\t\t$opt_0->addSubItem($chb_2);\n\t\t\t$form->addItem($radio_grp);\n\n\t\t\t$form->addCommandButton('updateNotificationSettings', $this->lng->txt('save'));\n\n\t\t\t$this->notificationSettingsForm = $form;\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function form()\n {\n if ( ! auth()->guard('admin')->user()->can('access form ' . $this->table)) {\n return redirect()->route('admin.setting.index')->with('alert-danger', __($this->noPermission));\n }\n $view = [\n 'back' => route('admin.setting.index'),\n 'title' => __('Form Settings'),\n 'breadcrumbs' => [\n route('admin.setting.index') => __('Setting'),\n route('admin.setting.role.index') => __('Form'),\n null => __('Edit')\n ],\n 'subtitle' => __('All About Form Settings'),\n 'description' => __('You can adjust all form settings here'),\n 'navs' => $this->settings,\n 'setting' => $this->settings->where('slug', 'form')->first(),\n 'forms' => json_decode(setting('form_settings')),\n 'formLimiters' => [\n 'None' => __('None'),\n 'Quota' => __('Quota'),\n 'Datetime' => __('Datetime'),\n 'Both' => __('Both'),\n ]\n ];\n return view('admin.setting.form.index', $view);\n }", "private function _initBlockSettingsForm()\n\t{\n\t\tglobal $txt;\n\n\t\t// instantiate the block form\n\t\t$this->_blockSettingsForm = new Settings_Form(Settings_Form::DB_ADAPTER);\n\n\t\t$config_vars = array(\n\t\t\tarray('check', 'showleft'),\n\t\t\tarray('check', 'showright'),\n\t\t\tarray('text', 'leftwidth'),\n\t\t\tarray('text', 'rightwidth'),\n\t\t\t'',\n\t\t\tarray('multicheck',\n\t\t\t\t 'sp_IntegrationHide',\n\t\t\t\t 'subsettings' => array('sp_adminIntegrationHide' => $txt['admin'], 'sp_profileIntegrationHide' => $txt['profile'], 'sp_pmIntegrationHide' => $txt['personal_messages'], 'sp_mlistIntegrationHide' => $txt['members_title'], 'sp_searchIntegrationHide' => $txt['search'], 'sp_calendarIntegrationHide' => $txt['calendar'], 'sp_moderateIntegrationHide' => $txt['moderate']),\n\t\t\t\t 'subtext' => $txt['sp_IntegrationHide_desc']\n\t\t\t),\n\t\t);\n\n\t\t$this->_blockSettingsForm->setConfigVars($config_vars);\n\t}", "protected function form()\n {\n $form = new Form(new Goods);\n\n $form->text('title', trans('admin.title'))->required()->rules('required');\n $form->text('slogan', trans('admin.slogan'))->required()->rules('required');\n $form->text('name', trans('admin.name'))->required()->rules('required');\n $form->decimal('price', trans('admin.price'))->required()->rules('required');\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n return $form;\n }", "protected function form()\n {\n $form = new Form(new V_MRQC_SSBRModel);\n\n $form->display('id', __('ID'));\n $form->display('created_at', __('Created At'));\n $form->display('updated_at', __('Updated At'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Profile);\n\n $form->display('id', __('ID'));\n $form->text('name', __('Имя'));\n $form->text('surname', __('Фамилия'));\n $form->text('slug', __('slug'));\n $form->date('birthday', __('День рождения'));\n $form->text('study_place', __('Образование '));\n $form->image('avatar', __('аватар'));\n $form->display('created_at', __('Created At'));\n $form->display('updated_at', __('Updated At'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Member);\n\n $form->text('open_id', 'Open id');\n $form->text('wx_open_id', 'Wx open id');\n $form->text('access_token', 'Access token');\n $form->number('expires', 'Expires');\n $form->text('refresh_token', 'Refresh token');\n $form->text('unionid', 'Unionid');\n $form->text('nickname', 'Nickname');\n $form->switch('subscribe', 'Subscribe');\n $form->switch('sex', 'Sex');\n $form->text('headimgurl', 'Headimgurl');\n $form->switch('disablle', 'Disablle');\n $form->number('time', 'Time');\n $form->mobile('phone', 'Phone');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Feed());\n\n $form->text('url', __('URL Feed'));\n $form->text('domain', __('Dominio'));\n $form->select('id_author',__(\"Author\"))->options(Author::all()->pluck('name', 'id'));\n $form->select('type',__(\"Tipo Feed\"))->options([1 => \"Intro\", 2 => \"Completo\"]);\n\n return $form;\n }", "public function initGeneralPageSettingsForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t\n\t\t$aset = new ilSetting(\"adve\");\n\n\t\t// use physical character styles\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_use_physical\"), \"use_physical\");\n\t\t$cb->setInfo($this->lng->txt(\"adve_use_physical_info\"));\n\t\t$cb->setChecked($aset->get(\"use_physical\"));\n\t\t$form->addItem($cb);\n\n\t\t// blocking mode\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_blocking_mode\"), \"block_mode_act\");\n\t\t$cb->setChecked($aset->get(\"block_mode_minutes\") > 0);\n\t\t$form->addItem($cb);\n\n\t\t\t// number of minutes\n\t\t\t$ni = new ilNumberInputGUI($this->lng->txt(\"adve_minutes\"), \"block_mode_minutes\");\n\t\t\t$ni->setMinValue(2);\n\t\t\t$ni->setMaxLength(5);\n\t\t\t$ni->setSize(5);\n\t\t\t$ni->setRequired(true);\n\t\t\t$ni->setInfo($this->lng->txt(\"adve_minutes_info\"));\n\t\t\t$ni->setValue($aset->get(\"block_mode_minutes\"));\n\t\t\t$cb->addSubItem($ni);\n\t\t\n\t\t$form->addCommandButton(\"saveGeneralPageSettings\", $lng->txt(\"save\"));\n\t \n\t\t$form->setTitle($lng->txt(\"adve_pe_general\"));\n\t\t$form->setFormAction($ilCtrl->getFormAction($this));\n\t \n\t\treturn $form;\n\t}", "protected function form()\n {\n $form = new Form(new BuSong);\n\n// $form->number('serialid', __('Serialid'));\n $form->text('svrkey', __('svrkey'));\n $form->text('songname', __('歌名'));\n $form->text('singer', __('歌星'));\n $form->select('langtype', __('语种'))->options([0=>'国语',1=>'粤语',2=>'英语',3=>'台语',4=>'日语',5=>'韩语',6=>'不详']);\n $form->text('remarks', __('备注'));\n $form->datetime('createdate', __('创建时间'))->default(date('Y-m-d H:i:s'));\n $form->select('ischeck', __('是否检查'))->options([0=>'否',1=>'是']);\n $form->select('buState', __('状态'))->options([0=>'新增',1=>'处理中',2=>'完成',3=>'歌曲信息出错',4=>'取消无法处理',5=>'已上传',6=>'彻底删除']);\n $form->text('musicdbpk', __('musicdbpk'));\n $form->text('optionRemarks', __('操作日志'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Goodss);\n $form->switch('is_enable','状态')->options([\n 'on' => ['value' => 1, 'text' => '正常', 'color' => 'primary'],\n 'off' => ['value' => 0, 'text' => '禁止', 'color' => 'default'],\n ]);\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n //$footer->disableReset();\n\n // 去掉`提交`按钮\n //$footer->disableSubmit();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new RequestForConfirmation());\n\n $form->switch('status', __('Status'));\n $form->text('comment', __('Comment'));\n $form->select('user_id', __('User id'))->options(User::all()->pluck('name', 'id'))->required();\n $form->select('project_id', __('Project id'))->options(Project::all()->pluck('project_name', 'id'))->required();\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new CouponCode);\n\n $form->text('name', __('Name'));\n $form->text('code', __('Code'));\n $form->text('type', __('Type'));\n $form->decimal('value', __('Value'));\n $form->number('total', __('Total'));\n $form->number('used', __('Used'));\n $form->decimal('min_amount', __('Min amount'));\n $form->datetime('not_before', __('Not before'))->default(date('Y-m-d H:i:s'));\n $form->datetime('not_after', __('Not after'))->default(date('Y-m-d H:i:s'));\n $form->switch('enabled', __('Enabled'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Banner);\n\n $form->text('title', 'Title');\n $form->image('image', 'Image')->rules('required')->move('images/banners');\n $form->switch('status', 'Published')->default(1);\n\n $form->footer(function ($footer) {\n // disable `View` checkbox\n $footer->disableViewCheck();\n\n // disable `Continue editing` checkbox\n $footer->disableEditingCheck();\n\n // disable `Continue Creating` checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new User());\n\n $form->text('name', __('Name'));\n $form->email('email', __('Email'));\n $form->datetime('email_verified_at', __('Email verified at'))->default(date('Y-m-d H:i:s'));\n $form->password('password', __('Password'));\n $form->text('remember_token', __('Remember token'));\n $form->decimal('point', __('Point'))->default(0.000);\n $form->switch('status', __('field.status'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Engine());\n\n $form->text('name', __('Name'))\n ->required();\n $form->select('power_station_id', __('Power station'))\n ->options(PowerStation::all()->pluck('name', 'id'))\n ->required();\n $form->image('photo', __('Photo'));\n $form->textarea('details', __('Details'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new CouponCode());\n\n $form->text('name', __('Name'));\n $form->text('code', __('Code'));\n $form->text('type', __('Type'));\n $form->decimal('value', __('Value'));\n $form->number('total', __('Total'));\n $form->number('used', __('Used'));\n $form->decimal('min_amount', __('Min amount'));\n $form->datetime('not_before', __('Not before'))->default(date('Y-m-d H:i:s'));\n $form->datetime('not_after', __('Not after'))->default(date('Y-m-d H:i:s'));\n $form->switch('enabled', __('Enabled'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new ThemePoster());\n\n $form->select('domain_id', __('domain_id'))->options(DomainConfig::getDomainMap())->rules('required');\n $form->radio('type', __('type'))->options(ThemePoster::getTypeMap())->when(1, function (Form $form){\n $form->select('type_id', __('type_id'))->options(array_merge(['0' => '总列表'], Product::getCategoryMap()->toArray()))->rules('required');\n\n })->when(2, function (Form $form){\n $form->select('type_id', __('type_id'))->options(array_merge(['0' => '总列表'], Article::getCategoryMap()))->rules('required');\n\n });\n $form->text('title', __('title'))->rules('required');\n $form->text('alt', __('alt'))->rules('required');\n $form->image('site', '图片尺寸 1600*300')\n ->uniqueName()\n ->rules('required|max:150')->resize(1600, 300);\n $form->url('link', __('link'));\n $form->switch('is_show', __('is_show'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Emailtpls());\n\n $form->text('tpl_name', __('Tpl name'));\n $form->textarea('tpl_content', __('Tpl content'));\n $form->text('tpl_token', __('Tpl token'));\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n });\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`查看`按钮\n $tools->disableView();\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Enseignant());\n\n $form->text('matricule', __('Matricule'));\n $form->text('nom', __('Nom'));\n $form->text('postnom', __('Postnom'));\n $form->text('prenom', __('Prenom'));\n $form->text('sexe', __('Sexe'));\n $form->text('grade', __('Grade'));\n $form->text('fonction', __('Fonction'));\n\n return $form;\n }", "public function form()\n {\n $form = new Form(new PermissionCategory());\n $form->tab('Общее', function (Form $form) {\n $form->display('id', 'ID');\n\n $form->text('name', trans('admin.name'))->rules('required');\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('log_name', __('Log name'));\n $form->text('description', __('Description'));\n $form->number('subject_id', __('Subject id'));\n $form->text('subject_type', __('Subject type'));\n $form->number('causer_id', __('Causer id'));\n $form->text('causer_type', __('Causer type'));\n $form->textarea('properties', __('Properties'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Feedback);\n\n $form->select('user_id', __('feedback::feedback.user_id'))\n ->options(function ($id) {\n $user = User::find($id);\n if ($user) {\n return [$user->id => $user->username];\n }\n })\n ->ajax(route('admin.select.user'))\n ->required();\n $form->text('title', __('feedback::feedback.title'))->readonly();\n $form->UEditor('content', __('feedback::feedback.content'));\n $form->text('contact', __('feedback::feedback.contact'))->readonly();\n $form->image('file', __('feedback::feedback.file'))->readonly();\n $form->UEditor('reply', __('feedback::feedback.reply'));\n $form->select('status', __('feedback::feedback.status.label'))\n ->options(__('feedback::feedback.status.value'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity);\n\n $form->text('log_name', 'Log name');\n $form->textarea('description', 'Description');\n $form->number('subject_id', 'Subject id');\n $form->text('subject_type', 'Subject type');\n $form->number('causer_id', 'Causer id');\n $form->text('causer_type', 'Causer type');\n $form->text('properties', 'Properties');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Drug);\n\n $form->text('street_name', '«Уличное» название');\n $form->text('city', 'Город');\n $form->text('active_substance', 'Активное вещество');\n $form->text('symbol', 'Символ');\n $form->text('state', 'Состояние');\n $form->text('color', 'Цвет');\n $form->text('inscription', 'Надпись');\n $form->text('shape', 'Форма');\n $form->text('weight', 'Вес таблетки');\n $form->text('weight_active', 'Вес действующего вещества');\n $form->text('description', 'Описание');\n $form->text('negative_effect', 'Негативный эффект');\n $form->switch('confirm', 'Подтверждение');\n\n return $form;\n }", "public static function addSettingsFormFields(QuickForm $form)\n {\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Platform());\n\n $form->text('platform_number', __('Platform number'))\n ->creationRules(['required', 'max:30', 'unique:platforms'])\n ->updateRules(['required', 'max:30']);\n $form->text('platform_name', __('Platform name'))\n ->creationRules(['required', 'max:30', 'unique:platforms'])\n ->updateRules(['required', 'max:30']);\n\n $form->footer(function ($footer){\n $footer->disableEditingCheck();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new TopicCategory);\n\n $form->text('name', '话题分类名称')->rules('required|string');\n $form->number('sort', '排序值')->default(9)->rules('required|integer|min:0')->help('默认倒序排列:数值越大越靠前');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Gys);\n\n $form->text('name', 'Name');\n $form->text('tel', 'Tel');\n $form->textarea('file', 'File');\n $form->number('type', 'Type');\n $form->text('username', 'Username');\n $form->password('password', 'Password');\n $form->number('status', 'Status');\n // 在表单提交前调用\n $form->saving(function (Form $form) {\n if ($form->password && $form->model()->password != $form->password) {\n $form->password = bcrypt($form->password);\n }\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('name', __('Name'));\n $form->image('image', __('Image'));\n $form->text('intro', __('Intro'));\n $form->UEditor('details', __('Details'));\n $form->datetime('start_at', __('Start at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('end_at', __('End at'))->default(date('Y-m-d H:i:s'));\n $form->text('location', __('Location'));\n $form->decimal('fee', __('Fee'))->default(0.00);\n $form->number('involves', __('Involves'));\n $form->number('involves_min', __('Involves min'));\n $form->number('involves_max', __('Involves max'));\n $form->switch('status', __('Status'));\n $form->text('organizers', __('Organizers'));\n $form->number('views', __('Views'));\n $form->switch('is_stick', __('Is stick'));\n\n return $form;\n }", "public function settings(&$form)\n {\n $settings = json_decode($this->settings, TRUE);\n\n $form->add(new \\IPS\\Helpers\\Form\\Text('paymentwall_project_key', $settings['project_key'], TRUE));\n $form->add(new \\IPS\\Helpers\\Form\\Text('paymentwall_secret_key', $settings['secret_key'], TRUE));\n $form->add(new \\IPS\\Helpers\\Form\\Text('paymentwall_widget_code', $settings['widget_code'], TRUE));\n $form->add(new \\IPS\\Helpers\\Form\\Text('paymentwall_success_url', $settings['success_url'], FALSE));\n $form->add(new \\IPS\\Helpers\\Form\\YesNo('paymentwall_test_mode', $settings['test_mode'], FALSE, array(), NULL, NULL, NULL, 'paymentwall_test_mode'));\n $form->add(new \\IPS\\Helpers\\Form\\YesNo('paymentwall_delivery', $settings['delivery'], FALSE, array(), NULL, NULL, NULL, 'paymentwall_delivery'));\n }", "protected function form()\n {\n $form = new Form(new GoodsModel);\n\n $form->select('cid', __('分类'))->options(CategoryModel::selectOptions());\n $form->text('goods_name', __('Goods name'));\n $form->image('goods_img', __('Goods img'));\n $form->textarea('content', __('Content'));\n $form->number('goods_pricing', __('Goods pricing'));\n $form->number('goods_price', __('Goods price'));\n\n return $form;\n }", "protected function form()\n {\n $categories = Category::get()->pluck('name', 'id')->toArray();\n\n $form = new Form(new Plan);\n\n $form->select(Plan::CATEGORY_ID, 'Категория')\n ->options($categories)\n ->default(request()->input(Plan::CATEGORY_ID))\n ->required();\n\n $form->text(Plan::COUNT, __('Количество'))->required();\n $form->month('month', __('Месяц'))->default(now()->month)->required();\n $form->year('year', __('Год'))->default(now()->year)->required();\n\n $form->footer(function ($footer) {\n\n // disable `View` checkbox\n $footer->disableViewCheck();\n\n // disable `Continue editing` checkbox\n $footer->disableEditingCheck();\n\n // disable `Continue Creating` checkbox\n $footer->disableCreatingCheck();\n\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Regional());\n\n $form->image('logo', 'Logo');\n $form->text('name', 'Regional');\n $form->text('address', 'Alamat');\n $form->image('image', 'Gambar');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Direction());\n\n $form->text('name', __(trans('hhx.name')));\n $form->text('intro', __(trans('hhx.intro')));\n $form->image('Img', __(trans('hhx.img')))->move('daily/direction')->uniqueName();\n $form->select('status', __(trans('hhx.status')))->options(config('hhx.status'));;\n $form->number('order_num', __(trans('hhx.order_num')));\n $form->hidden('all_num', __(trans('hhx.all_num')))->default(0.00);\n $form->decimal('stock', __(trans('hhx.stock')));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new DbTop());\n $form->select('status', __(trans('hhx.status')))->options(config('hhx.db_status'));;\n $form->text('pan_url', __(trans('hhx.pan_url')));\n $form->text('pan_code', __(trans('hhx.pan_code')));\n\n return $form;\n }", "function settingsForm($field, $instance, $view_mode, $form, &$form_state);", "protected function form()\n {\n $form = new Form(new CompanyCulture());\n\n $form->text('name', '企业名称')->rules('required');\n $form->text('en_name', '企业名称(en)')->rules('required');\n $form->image('image_url', '图片')->rules('required|image');\n $form->editor('content', '内容')->rules('required');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`列表`按钮\n $tools->disableList();\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n });\n\n return $form;\n }", "public function backup_settings_form($settings) {\n $objects = $this->get_object_names();\n $form['#description'] = t(\"You may omit specific tables, or specific table data from the backup file. Only omit data that you know you will not need such as cache data, or tables from other applications. Excluding tables can break your Drupal install, so <strong>do not change these settings unless you know what you're doing</strong>.\");\n $form['exclude_tables'] = array(\n \"#type\" => \"select\",\n \"#multiple\" => TRUE,\n \"#title\" => t(\"Exclude the following tables altogether\"),\n \"#options\" => $objects,\n \"#default_value\" => $settings['exclude_tables'],\n \"#description\" => t(\"The selected tables will not be added to the backup file.\"),\n );\n $form['nodata_tables'] = array(\n \"#type\" => \"select\",\n \"#multiple\" => TRUE,\n \"#title\" => t(\"Exclude the data from the following tables\"),\n \"#options\" => $objects,\n \"#default_value\" => $settings['nodata_tables'],\n \"#description\" => t(\"The selected tables will have their structure backed up but not their contents. This is useful for excluding cache data to reduce file size.\"),\n );\n $form['utils_lock_tables'] = array(\n '#type' => 'checkbox',\n '#title' => t('Lock tables during backup'),\n '#default_value' => !empty($settings['utils_lock_tables']) ? $settings['utils_lock_tables'] : NULL,\n '#description' => t('This can help reduce data corruption, but will make your site unresponsive.'),\n );\n return $form;\n }", "protected function form()\n {\n $form = new Form(new MachinesStyle());\n\n $form->text('style_name', __('型号名称'));\n\n $form->select('aa', __('所属类型'))->options(MachinesType::where('state', '1')->get()->pluck('name', 'id'))->load('factory_id', '/api/getAdminFactory');\n\n $form->select('factory_id', __('所属厂商'))->required();\n\n $form->ignore(['aa']);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Member());\n\n $form->text('open_id', __('微信openid'));\n $form->image('head', __('头像'));\n $form->text('nickname', __('昵称'));\n $form->mobile('mobile', __('手机号码'));\n $form->text('email', __('邮箱'));\n $form->text('name', __('姓名'));\n $form->text('weixin', __('微信号'));\n $form->text('qq', __('qq'));\n $form->text('city', __('所在城市'));\n $form->text('yidudian', __('易读点'));\n $form->text('integral', __('积分'));\n $form->text('balance', __('余额'));\n $states = [\n 'on' => ['value' => 1, 'text' => '正常', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '冻结', 'color' => 'danger'],\n ];\n $form->switch('status', '是否使用')->states($states);\n return $form;\n }", "protected function form()\n {\n $form = new Form(new News);\n\n $form->text('title', '题目');\n // $form->number('category_id', '分类');\n $form->select('category_id','分类')->options('/api/admin_categories');\n // $form->textarea('content', 'Content');\n $form->ueditor('content','新闻内容')->rules('required');\n // $form->text('thumbnail', '封面图');\n $form->image('thumbnail', '封面图')->move('public/uploads/thunbnails');\n $form->number('status', '状态');\n $form->number('read_count', '阅读次数');\n\n return $form;\n }", "public function getConfigForm()\r\n {\r\n $form = parent::getConfigForm();\r\n $form->addElementPath(dirname(__FILE__) . '/fields');\r\n return $form;\r\n }", "protected function form()\n {\n $form = new Form(new WechatUser);\n\n $form->text('nick_name', __('昵称'));\n $form->text('name', __('用户名'));\n $form->password('password', __('密码'));\n $form->mobile('mobile', __('手机号'));\n $form->text('mini_program_open_id', __('OpenId'));\n\n return $form;\n }", "protected function createComponentConfigMqttForm() {\n\t\t$this->onlyForAdmins();\n\t\treturn $this->formFactory->create($this);\n\t}", "protected function form()\n {\n $form = new Form(new Usertype());\n\n $form->text('usertype', '类型名称')->rules('required|max:10');\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableList();\n $tools->disableDelete();\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n $footer->disableReset();\n $footer->disableViewCheck();\n $footer->disableEditingCheck();\n $footer->disableCreatingCheck();\n });\n return $form;\n }", "public function create() {\r\n\t\r\n\t$form = new Form();\r\n\t$form->setTranslator($this->translator);\r\n\treturn $form;\r\n }", "protected function form()\n {\n $form = new Form(new Feedback);\n\n\n\n return $form;\n }", "protected function form()\n {\n return Form::make(new Notice(), function (Form $form) {\n $form->row(function (Form\\Row $form) {\n $form->text('title')->required();\n $form->editor('content');\n });\n $form->row(function (Form\\Row $form) {\n $form->width(4)\n ->radio('from')\n ->options($this->form)\n ->default(0);\n $form->width(4)\n ->switch('top')\n ->default(0);\n $form->width(4)\n ->switch('status')\n ->default(1);\n });\n\n $form->disableViewCheck();\n $form->disableEditingCheck();\n $form->disableCreatingCheck();\n });\n }", "protected function form()\n {\n $form = new Form(new $this->currentModel);\n \n $form->display('id', 'ID');\n $form->select('company_id', '公司名称')->options(Company::getSelectOptions());\n $form->text('project_name', '项目名称');\n $form->image('project_photo', '项目图片')->uniqueName()->move('public/photo/images/custom_thum/');\n $form->url('link_url', '项目链接');\n $form->radio('display', '公开度')->options(['0' => '公开', '-1'=> '保密'])->default('0');\n //$form->display('created_at', 'Created At');\n //$form->display('updated_at', 'Updated At');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new MoneyOut);\n\n $form->display('id', __('ID'));\n $form->display('created_at', __('Created At'));\n $form->display('updated_at', __('Updated At'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Code());\n\n $form->mobile('phone', __('Phone'));\n $form->number('code', __('Code'));\n $form->ip('ip', __('IP'));\n\n return $form;\n }", "public abstract function settingsForm(array $pluginInfo);", "protected function form()\n {\n $form = new Form(new Community);\n\n $form->text('permalink', __('Permalink'));\n $form->text('eyecatch_path', __('Eyecatch path'));\n $form->text('name', __('Name'));\n $form->text('pref', __('Pref'));\n $form->text('information', __('Information'));\n $form->text('image1_path', __('Image1 path'));\n $form->text('image2_path', __('Image2 path'));\n $form->text('image3_path', __('Image3 path'));\n $form->text('video1_link', __('Video1 link'));\n $form->text('video2_link', __('Video2 link'));\n $form->text('video3_link', __('Video3 link'));\n $form->text('calendar', __('calendar'));\n $form->text('message_image_path', __('Message image path'));\n $form->text('message', __('Message'));\n $form->text('contact', __('Contact'));\n $form->text('facebook_link', __('Facebook link'));\n $form->text('instagram_link', __('Instagram link'));\n $form->text('website_link', __('Website link'));\n\n\n return $form;\n }", "public function buildForm(array $form, FormStateInterface $form_state) {\n $form['FedoraResource_settings']['#markup'] = 'Settings form for Fedora resource entities. Manage field settings here.';\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Task);\n\n $form->text('eid', 'Eid');\n $form->text('store', 'Store');\n $form->text('etype', 'Etype');\n $form->text('uid', 'Uid');\n $form->text('uname', 'Uname');\n $form->text('qq', 'Qq');\n $form->number('qtype', 'Qtype');\n $form->number('times', 'Times')->default(1);\n $form->textarea('content', 'Content');\n $form->text('deadline', 'Deadline');\n $form->file('file', 'File');\n $form->number('isok', 'Isok');\n $form->number('istag', 'Istag');\n $form->text('sid', 'Sid');\n $form->text('sname', 'Sname');\n $form->text('score', 'Score');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Good);\n\n $form->hidden('group_id')->value(session('group_id'));\n $form->text('name', __('Наименование'));\n $form->text('size', __('Объем/кол-во'));\n $form->decimal('price', __('Цена'))->default(0);\n $form->image('file', 'Фото');\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new UsersOpenclose);\n\n $form->text('srvkey', __('srvkey'));\n $form->text('KtvBoxid', __('机器码'));\n $form->datetime('opendate', __('开房时间'))->default(date('Y-m-d H:i:s'));\n $form->datetime('closedate', __('关房时间'))->default(date('Y-m-d H:i:s'));\n $form->select('feesmode', __('收费模式'))->options([0=>'非扫码收费',1=>'扫码收费']);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Message);\n $form->hidden('admin_id')->default(Admin::user()->id);\n $form->hidden('type')->default(1);\n\n// $form->number('admin_id', trans('message.admin_id'));\n// $form->number('store_id', trans('message.store_id'));\n $form->textarea('message', trans('message.message'));\n// $form->select(trans('message.type'), trans('message.type'));\n// $form->select(trans('message.category'), trans('message.category'));\n// $form->textarea(trans('message.data'), trans('message.data'));\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new GithubRepositories());\n\n $form->text('name', __('项目名'));\n $form->text('full_name', __('项目全名'));\n $form->textarea('description', __('简介'));\n $form->textarea('owner', __('作者资料'));\n $form->textarea('html_url', __('网页地址'));\n $form->textarea('original_data', __('原始数据'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new City());\n $form->disableViewCheck();\n $form->disableEditingCheck();\n $form->disableCreatingCheck();\n\n $form->text('name', __('field.name'));\n $form->text('slug', __('field.slug'));\n $form->text('description', __('field.description'));\n $form->number('sort', __('field.sort'))->default(0);\n $form->hasMany('files', __('field.images'), function (Form\\NestedForm $form) {\n $form->image('file', __('field.image'))\n ->options(['showClose'=>false])\n ->options(['fileActionSettings'=>['showRemove'=>true]])\n ->options(['otherActionButtons'=>ImageHelper::previewRotateButtons()])\n ->uniqueName();\n $form->number('sort', __('field.sort'))->default(0);\n });\n $form->saving(function (Form $form) {\n if ($form->slug === null) {\n $form->slug = Str::slug($form->option);\n }\n });\n return $form;\n }", "protected function form()\n {\n $userModel = config('admin.database.users_model');\n $permissionModel = config('admin.database.permissions_model');\n $roleModel = config('admin.database.roles_model');\n\n $form = new Form(new $userModel());\n\n $form->display('id', 'ID');\n\n $form->text('name', trans('admin.name'))->rules('required');\n $form->text('surname', __('Surname'));\n $form->email('email', __('Email'));\n $form->password('password', trans('admin.password'))->rules('required|confirmed')->default(function ($form) {\n return $form->model()->password;\n });\n $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required')\n ->default(function ($form) {\n return $form->model()->password;\n });\n\n $form->ignore(['password_confirmation']);\n\n $form->multipleSelect('roles', trans('admin.roles'))->options($roleModel::all()->pluck('name', 'id'));\n $form->multipleSelect('permissions', trans('admin.permissions'))->options($permissionModel::all()->pluck('name', 'id'));\n\n $form->saving(function (Form $form) {\n if ($form->password && $form->model()->password != $form->password) {\n $form->password = Hash::make($form->password);\n }\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Station());\n\n $form->select('area_id', __(trans('admin.area_name')))->options(Area::all()->pluck('area_name', 'id'))->rules('required');\n $form->text('station_code', __(trans('admin.station_code')))->rules('required|max:4');\n $form->text('station_name', __(trans('admin.station_name')))->rules('required|max:40');\n $form->text('address', __(trans('admin.address')));\n $form->text('telno', __(trans('admin.telno')));\n $form->ckeditor('footer', __(trans('admin.footer')));\n $form->text('order', __(trans('admin.order')));\n $form->datetime('valid_at', __(trans('admin.valid_at')))->default(date('Y-m-d H:i:s'));\n $form->textarea('remark', __(trans('admin.remark')));\n $form->text('mod_user', __(trans('admin.mod_user')))->default(Admin::user()->name)->readonly();\n $form->saving(function (Form $form) {\n $form->mod_user = Admin::user()->name;\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BorrowComment);\n\n $form->text('shared_book_name', __('Shared book name'));\n $form->text('student_name', __('Student name'));\n $form->image('student_avatar', __('Student avatar'));\n $form->textarea('content', __('Content'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Terrace());\n\n $form->image('image', __('平台图片'))->rules('required', ['required' => '平台图片不能为空']);\n $form->text('name', __('平台名称'))->rules('required', ['required' => '平台名称不能为空']);\n $form->text('path', __('外链'))->rules('required', ['required' => '平台外链不能为空']);\n $form->text('notice_info', __('提示语'))->rules('required', ['required' => '平台提示语不能为空']);\n $form->radio('status','状态')->options(['1' => '未推荐', '2'=> '已推荐'])->default(1);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Cases);\n\n $form->select('cate_id', '分类')->options('/admin/api/getcasecate');\n $form->select('algw_id', '顾问')->options('/admin/api/getgw');\n $form->text('title', '标题');\n $form->text('keywords', 'SEO关键字');\n $form->text('description', 'SEO描述');\n $form->text('desc', '副标题');\n $form->text('author', '来源');\n $form->radio('is_tj', '推荐')->options([0=>'否',1=>'是']);\n $form->image('thumb', '缩略图')->uniqueName();\n $form->editor('data', '详情');\n\n\n return $form;\n }", "public function form_builder()\n {\n // ToDo run checks when form is being created, please.\n// if(!empty($this->check())):\n// throw new ValidationError(checks_html_output($this->check()));\n//\n// endif;\n\n return new form\\ModelForm($this, $this->_field_values());\n }", "protected function form()\n {\n $form = new Form(new Category());\n \n $form->text('erp_id', __('ID(ERP用)'));\n $form->select('parent_id', __('中分類'))->options(\n\n Category::Mid()->pluck('name', 'id')\n\n )->required();\n \n $form->text('name', __('小分類名稱'));\n $form->hidden('type', __('Type'))->default(3);\n\n return $form;\n }" ]
[ "0.7931135", "0.7473588", "0.7415449", "0.73788315", "0.73011667", "0.71759987", "0.71723974", "0.7153141", "0.7099724", "0.7070693", "0.69913894", "0.6990635", "0.695825", "0.6930156", "0.6929857", "0.692464", "0.691735", "0.6902617", "0.68829995", "0.68779665", "0.6849144", "0.6777859", "0.6774888", "0.6774607", "0.67539364", "0.6747158", "0.6743952", "0.6743031", "0.67233765", "0.6720248", "0.67017573", "0.67014503", "0.6652238", "0.66479445", "0.6638764", "0.663193", "0.6624188", "0.66022784", "0.65942085", "0.6591438", "0.6588095", "0.6576756", "0.657133", "0.65710896", "0.65640306", "0.65593016", "0.65545833", "0.65494907", "0.65416336", "0.65222234", "0.6521244", "0.65166724", "0.6516349", "0.6510616", "0.65104735", "0.6509155", "0.64880884", "0.6469071", "0.64597166", "0.64572877", "0.6452423", "0.6451471", "0.6444042", "0.6443461", "0.6432645", "0.64134514", "0.64059925", "0.639942", "0.63988465", "0.63962096", "0.6383681", "0.6376475", "0.63749534", "0.6373849", "0.6373225", "0.63596344", "0.635759", "0.63504475", "0.63444096", "0.6342078", "0.63418806", "0.63376635", "0.63367385", "0.6335596", "0.6332106", "0.63315773", "0.63244957", "0.6322555", "0.6322546", "0.63203716", "0.63181573", "0.6314546", "0.631123", "0.6310436", "0.6307248", "0.63055277", "0.62966186", "0.6291054", "0.62896866", "0.6288919", "0.62847733" ]
0.0
-1
Run the database seeds.
public function run() { // DB::table('nails')->insert([ 'created' => date('YmdHis'), 'type' => '1', 'title_ko' => "원컬러(케어포함)", 'title_jp' => 'ワンカーラ(ケア含む)', 'price_ko' => '30000', 'price_jp' => '3000', 'useTime' => date('H:i:s',strtotime('01:00:00')), ]); DB::table('nails')->insert([ 'created' => date('YmdHis'), 'type' => '2', 'title_ko' => "원컬러(케어포함)", 'title_jp' => 'ワンカーラ(ケア含む)', 'price_ko' => '40000', 'price_jp' => '4000', 'useTime' => date('H:i:s',strtotime('01:00:00')), ]); DB::table('nails')->insert([ 'created' => date('YmdHis'), 'type' => '3', 'title_ko' => "케어", 'title_jp' => 'ケアのみ', 'price_ko' => '5000', 'price_jp' => '500', 'useTime' => date('H:i:s',strtotime('01:00:00')), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Transform the resource into an array.
public function toArray($request) { return [ 'id' => $this->id, 'name' => $this->name, 'category' => [ 'id' => $this->category_id, 'name' => $this->category_name ], 'image' => !empty($this->image) ? env('DO_SPACES_DOMAIN') . $this->image : asset('/img/products/no-image.svg'), 'price' => $this->price, 'created_at' => $this->created_at->format('Y M d - h:m A'), 'sum_boughts' => $this->sum_boughts ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }", "public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }", "public function asArray() {\n return $this->resource;\n }", "public function transform($resource)\n {\n return [];\n }", "public function toArray()\n {\n if ($this->resource instanceof ArrayableInterface) {\n\n return $this->resource->toArray();\n } else {\n\n return null;\n }\n }", "public function parse($resource)\n {\n return $resource->toArray();\n }", "public function transform($resource)\n {\n return [\n 'id' => $resource['id'],\n 'item' => $resource['item'],\n 'qty' => $resource['qty'],\n\n ];\n }", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "abstract protected function toArray();", "public function getAsArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function getAsArray()\n\t{\n\t\t\n\t\t$path = $this->get();\n\t\t\n\t\treturn self::toArray($path);\n\t\t\n\t}", "public function transform($resource)\n {\n return [\n\n 'id' => (int) $resource->id,\n\t\t\t'name' => $resource->name,\n\t\t\t'description' => $resource->description,\n 'seat_count' => $resource->seat_count,\n\t\t\t'is_active' => $resource->is_active,\n\t\t\t'status' => $resource->status,\n\t\t\t'created_at' => $resource->created_at->toDateTimeString(),\n\t\t\t'updated_at' => $resource->updated_at->toDateTimeString(),\n\t\t\t\n ];\n }", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray(): array\n {\n return [\n 'users' => HiUserResource::collection($this->resource),\n ];\n }", "public function toArray()\n {\n return $this->transform();\n }", "function toArray() ;", "function toArray() ;", "public function convertItemArray() {}", "public function toArray(): array\n {\n $content = $this->getContent();\n\n if (\\is_array($content)) {\n return $this instanceof Filterable\n ? (array) $this->filterResponse($content)\n : $content;\n }\n\n return [];\n }", "protected function asArray()\n\t{\n\t\treturn \\json_decode($this->response, true);\n\t}", "public function arr() {\n\t\t\treturn \\uri\\generate::to_array($this->object);\n\t\t}", "public function toArray()\n {\n return $this->getContent();\n }", "public function toArray()\n {\n\n }", "public function asArray(): array\n {\n return json_decode($this->result, true);\n }", "public function toArray()\n {\n return $this->cast('array');\n }", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "private function arrayify(): array\n {\n return $this->toArray();\n }", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "public function toArray() // untested\n {\n return $this->data;\n }", "public function toArray(){\n $this->buildArray();\n return $this->array;\n }", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;" ]
[ "0.7750928", "0.7750928", "0.7715773", "0.75906307", "0.7310379", "0.7138024", "0.7134791", "0.7096877", "0.7096877", "0.70968604", "0.70968604", "0.70968604", "0.70968604", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.6959165", "0.69560915", "0.68910366", "0.68910366", "0.68910366", "0.68910366", "0.68910366", "0.68910366", "0.6881386", "0.6868011", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6851924", "0.6790647", "0.674651", "0.674651", "0.67363435", "0.6720337", "0.6712338", "0.67115825", "0.6710179", "0.666141", "0.66587526", "0.6656767", "0.6655622", "0.66545117", "0.6648871", "0.6648871", "0.6648871", "0.6648871", "0.6648871", "0.66377884", "0.6637001", "0.6629", "0.6629", "0.6629", "0.6629", "0.6629", "0.6629", "0.6629" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Show the application dashboard.
public function index() { if( Auth::guest() ) { return view(TControllerLogin::FORM_LOGIN); } $questionnaire = new TControllerQuestionnaire(); return $questionnaire->showQuestionnaireInCalendar(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77862287", "0.7761407", "0.7563901", "0.75170934", "0.746699", "0.74665695", "0.7367683", "0.73534966", "0.7348662", "0.7343759", "0.7328216", "0.73182577", "0.73092335", "0.728953", "0.72847724", "0.7275449", "0.7275449", "0.7275449", "0.7275449", "0.7253329", "0.7253329", "0.7253329", "0.7253329", "0.7253329", "0.7242651", "0.7238307", "0.7237317", "0.7219582", "0.7199839", "0.71993226", "0.71928704", "0.71812886", "0.7167083", "0.7159392", "0.7148408", "0.7135078", "0.7134049", "0.7131566", "0.7125967", "0.71214664", "0.7119546", "0.7111876", "0.7109968", "0.71093625", "0.70989627", "0.7082487", "0.70770097", "0.70768017", "0.7065654", "0.7057395", "0.70552087", "0.7052588", "0.70494616", "0.70454663", "0.70416385", "0.7022026", "0.7019332", "0.7015568", "0.7010608", "0.7010608", "0.7010608", "0.7010608", "0.7010608", "0.7010608", "0.7010608", "0.7010608", "0.6993445", "0.69812995", "0.69754696", "0.69749504", "0.69699633", "0.6969114", "0.69688344", "0.6966357", "0.6959957", "0.6947264", "0.69448495", "0.69430286", "0.69427854", "0.69423646", "0.69407797", "0.69385755", "0.69385237", "0.69385237", "0.6928513", "0.69231254", "0.6908938", "0.69031125", "0.6884284", "0.6871347", "0.68683225", "0.6857883", "0.6848346", "0.68478656", "0.68420464", "0.68405044", "0.6835461", "0.6833515", "0.6833089", "0.68289226", "0.68144387" ]
0.0
-1
The main method that creates new instances in a separate context.
public static function visit(ApplicationInterface $application, ManagerNodeInterface $managerConfiguration) { // initialize the service locator $serviceLocator = new ServiceLocator(); // initialize the stackable for the data, the services and the scheduled timer tasks $data = new StackableStorage(); $services = new StackableStorage(); $tasksToExecute = new GenericStackable(); $scheduledTimers = new GenericStackable(); // initialize the timer factory $timerFactory = new TimerFactory(); $timerFactory->injectApplication($application); $timerFactory->start(); // initialize the calendar timer factory $calendarTimerFactory = new CalendarTimerFactory(); $calendarTimerFactory->injectApplication($application); $calendarTimerFactory->start(); // initialize the executor for the scheduled timer tasks $timerServiceExecutor = new TimerServiceExecutor(); $timerServiceExecutor->injectApplication($application); $timerServiceExecutor->injectTasksToExecute($tasksToExecute); $timerServiceExecutor->injectScheduledTimers($scheduledTimers); $timerServiceExecutor->start(); // initialize the service registry $serviceRegistry = new TimerServiceRegistry(); $serviceRegistry->injectData($data); $serviceRegistry->injectServices($services); $serviceRegistry->injectTimerFactory($timerFactory); $serviceRegistry->injectServiceLocator($serviceLocator); $serviceRegistry->injectWebappPath($application->getWebappPath()); $serviceRegistry->injectCalendarTimerFactory($calendarTimerFactory); $serviceRegistry->injectTimerServiceExecutor($timerServiceExecutor); // attach the instance $application->addManager($serviceRegistry, $managerConfiguration); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static abstract function createInstance();", "public function run()\n {\n Provider::factory(10)->create();\n }", "public function run()\n {\n prodecyt::factory(50)->create();\n }", "public function run()\n {\n factory(ActClass::class, 5)->create();\n }", "public function run()\n {\n factory(Classes::class,100)->create();\n\n }", "public function run()\n {\n factory(Clase::Class,15)->create();\n }", "public function run()\n {\n factory(Bio::class, 10)->create();\n \n }", "public function run()\n {\n factory(Livros::class, 120)->create();\n\n }", "public function run()\n {\n // Client::factory(5)->create();\n // ClientEmployee::factory(10)->create();\n // InternalEmployee::factory(10)->create();\n // User::factory(30)->create();\n }", "public function run()\n {\n factory(Tag::class, 20)->create();\n }", "public function run() {\n factory(Document::class, 10)->create();\n }", "public function run()\n {\n PraticalInfos::factory(1)->create();\n }", "public function run()\n {\n factory(Sponser::class, 5)->create();\n }", "public function run()\n {\n \tfactory(Docente::class, 15)->create();\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function instance() {\n\t\t\n\t}", "abstract public function instance();", "public function run() {\n\t\t$this->create_instances();\n\t\t$this->register_hooks();\n\t}", "public function run()\n {\n factory(Hosting::class, 3)->create();\n }", "static function create(): self;", "public function run()\n {\n factory(Servicios::class, 10)->create();\n }", "public function run()\n {\n factory(Barang::class, 10)->create();\n }", "public function run()\n {\n factory(News::class, 10)->create();\n }", "private function __construct() {\n \n trace('***** Creating new '.__CLASS__.' object. *****');\n \n }", "public function run()\n {\n factory(Planilla::class,10)->create();\n }", "public function run()\n {\n factory(Tweet::class, 20)->create();\n }", "public function run()\n {\n factory(Order::class, 100)->create();\n\n // try {\n // factory(ProductPrice::class, 2000)->create();\n // } catch (\\Throwable $th) {\n // // var_dump($th);\n // }\n }", "public function run() {\n factory(App\\Client::class, 10)->create();\n }", "public function run()\n { \n factory(Deputy::class, 25)->create();\n }", "public function run()\n {\n factory(Insumo::class,10)->create();\n }", "public function run()\n {\n factory(InventoryItem::class, 50)->create();\n }", "public function run()\n\t{\n\t\tfactory(Ingredient::class, 25)->create();\n\t}", "public function run()\n {\n factory(Ospiti::class, 10) -> create();// create server per INSERIRE I DATI NEL DATABASE\n }", "public function newInstance();", "public function newInstance();", "public function run()\n {\n factory(\\Modules\\Posts\\Entities\\Post::class, 100)->create();\n }", "public function run()\n {\n factory('App\\Models\\User', 100)->create();\n\n factory('App\\Models\\Link', 100)->create();\n\n factory('App\\Models\\JobCompany', 10)->create();\n factory('App\\Models\\Job', 100)->create();\n\n factory('App\\Models\\Meetup', 100)->create();\n\n factory('App\\Models\\Thread', 100)->create();\n }", "public function run()\n {\n factory(ActivityModel::class, 100)->create();\n }", "public function run()\n {\n Source::factory(5)->create();\n }", "public function run()\n {\n factory(Spare::class, 20)->create();\n }", "public function new()\n\t{\n\t\t//\n\t}", "public function new()\n\t{\n\t\t//\n\t}", "public function run()\n {\n factory(Grades::class, 100)->create(); \n }", "public function regularNew() {}", "public function instance();", "abstract protected function onCreateInstance();", "public function run()\n {\n factory(Identidad::class, 1)->create();\n }", "public function run()\n {\n factory( App\\Project::class )->create( [\n 'name' => 'rbc',\n 'description' => 'sistema resto bar' \n ] ) ;\n\n factory( App\\Project::class )->create( [\n 'name' => 'pm',\n 'description' => 'project manager' \n ] ) ;\n\n factory( App\\Project::class, 20 )->create() ;\n }", "public function run()\n {\n User::factory(10)->create();\n FollowUpStatus::factory(4)\n ->create();\n Customer::factory(10)\n ->create();\n FollowUpHistory::factory(10)->create();\n }", "public function run()\n {\n User::factory(1)->create();\n Meeting::factory(10)->create();\n Rsvp::factory(40)->create();\n Agenda::factory(50)->create();\n }", "public function run()\n {\n factory(Sistema::class, 5)->create();\n }", "public function run() {\n\n Team::factory( 10 )->create();\n User::factory( 25 )->create();\n Ticket::factory( 500 )->create();\n Point::factory( 200 )->create();\n }", "public function run()\n {\n\t\tfactory(App\\Model\\Movie::class, 50)->create();\n }", "public function run()\n {\n factory(OauthClients::class,10)->create();\n }", "public static function instance()\n {\n }", "public function run()\n {\n factory(\\App\\my_user::class, 10)->create();\n factory(\\App\\UserApi::class, 10)->create();\n }", "public function run()\n {\n factory(Village::class, 25)->create()->each(function($village){\n $village->make();\n });\n }", "public function run()\n {\n //factory(App\\Contractor::class, 50)->create(); \n }", "public function run()\n {\n Recipe::factory()\n ->count(1)\n ->create();\n }", "public function run()\n { \n self::create();\n }", "public function run()\n {\n factory(Vacancy::class, 10)->create()->each(function ($vacancy) {\n \n }); \n }", "public function run()\n {\n factory(User::class, 100)->create();\n factory(Section::class, 7)->create();\n factory(Doctor::class, 30)->create();\n factory(Post::class, 50)->create();\n factory(Comment::class, 100)->create();\n factory(Appointment::class, 100)->create();\n factory(Chat::class, 20)->create();\n factory(Message::class, 200)->create();\n factory(Recipient::class, 40)->create();\n factory(Vote::class, 20)->create();\n factory(Reservation::class, 20)->create();\n }", "protected function create() {\n\t}", "public function run()\n {\n factory(User::class, 40)->create();\n }", "public function run()\n {\n factory('App\\Customer', 20)->create();\n factory('App\\Product', 20)->create();\n factory('App\\Stock', 200)->create();\n factory('App\\Area', 3)->create();\n }", "public function run()\n {\n factory(App\\TripCoordinator::class, 5)->create();\n }", "public function new()\n {\n //\n }", "public function new()\n {\n //\n }", "public function run()\n {\n factory(ServiceBay::class, 10)->create();\n }", "public function run()\n {\n // model factories: generación de datos de pruebas\n \t//factory(Product::class)->make(); // crea objetos\n\n \tfactory(Product::class, 100)->create();//crea objetos y los guarda en bbdd\n }", "public function run()\n {\n Propuestas::factory(50)->create();\n }", "abstract function create();", "public function make() {}", "public function run()\n {\n factory(Menu::class, 30)->create();\n factory(Menu::class, 30)->create();\n }", "public function run()\n {\n factory(ClienteCuenta::class,1)->create();\n }", "public function run()\n {\n $vehicles = factory( Vehicle::class, 5)->create();\n }", "public function run()\n {\n Medecin::factory(10)->create();\n Malade::factory(10)->create();\n\n User::factory(10)->create();\n\n }", "public function run()\n {\n //factory(ReadingList::class, 10)->create();\n }", "public abstract function createInstance($parameters);", "public function run()\n {\n //factory(Expedient::class, 50)->create(); //creted on the audit factory one to one\n }", "public function run()\n {\n factory(Noticia::class,20)->create();\n }", "public function run()\n {\n factory(User::class, 50)->create();\n factory(Forum::class, 20)->create();\n factory(Post::class, 100)->create();\n\n }", "public function run()\n {\n factory(Especialidad::class,80)->create();\n }", "abstract protected function create ();", "public function run()\n {\n Model::unguard();\n\n factory(ProductCategory::class, 3)->create();\n factory(SubProduct::class, 3)->create();\n\n }", "public function run()\n {\n factory(Produk::class, 10000)->create();\n }", "public static function instance();", "public function run()\n {\n factory(App\\Models\\CatCentroReclusion::class, 10)->create();\n /*factory(App\\Models\\Persona::class, 10)->create();\n factory(App\\Models\\Desaparecido::class, 10)->create();\n factory(App\\Models\\Domicilio::class, 10)->create();\n factory(App\\Models\\Familiar::class, 10)->create();\n factory(App\\Models\\Antecedente::class, 10)->create();\n factory(App\\Models\\Documento::class, 10)->create();*/\n }", "public function run()\n {\n factory(Employee::class, 10) -> create(); //il 50 è riferito al numero di employee che mi interessa avere nella tabella\n }", "public function run()\n {\n //\n $numOfLabels = 5;\n factory( \\App\\Label::class, $numOfLabels )->create();\n\n\n }", "public function create() {\n\t \n }", "public function run()\n {\n \\User::factory(10)->create();\n }", "public function newInstance(): object;", "public function run()\n {\n factory(societe_has_stage::class, 50)->create();\n }", "public function run()\n {\n factory(User::class, 20)->create();\n factory(soal::class, 20)->create();\n factory(pengaturan::class, 20)->create();\n factory(nilai::class, 20)->create();\n factory(cct1::class, 3)->create();\n factory(cct2::class, 3)->create();\n factory(cct3::class, 3)->create();\n factory(cct4::class, 3)->create();\n factory(skalasikap::class, 3)->create();\n }", "public function run()\n {\n Client::factory()\n ->state([\n 'name' => 'Client 1',\n 'permission' => Fund::TYPES\n ])\n ->create();\n Client::factory()\n ->state([\n 'name' => 'Client 2',\n 'permission' => ['VC', 'RE']\n ])\n ->create();\n Client::factory()\n ->state([\n 'name' => 'Client 3',\n 'permission' => ['PL', 'PC']\n ])\n ->create();\n }", "public function run()\n {\n factory(Pronostiques::class, 30)->create();\n factory(Articles::class, 5)->create();\n factory(User::class, 1)->create();\n factory(Coupons::class, 1)->create();\n }", "public function run()\n {\n factory(BookGenre::class, 5)->create();\n }", "public function run()\n {\n factory(Paquete_Reserva::class,50)->create();\n }" ]
[ "0.7075748", "0.7019136", "0.7017353", "0.7012162", "0.6940595", "0.6864716", "0.6849585", "0.68458486", "0.68181723", "0.6809618", "0.67747945", "0.67655325", "0.6743449", "0.67397374", "0.6732605", "0.6732605", "0.6732605", "0.67103285", "0.6653088", "0.6643545", "0.6640763", "0.66402876", "0.66344815", "0.6603661", "0.6577634", "0.6561622", "0.65561837", "0.6548394", "0.65259534", "0.6522867", "0.6518279", "0.65040505", "0.6502227", "0.6499893", "0.64971346", "0.6490479", "0.6490479", "0.6489513", "0.6488707", "0.6484225", "0.6474379", "0.6465455", "0.64523935", "0.64523935", "0.645064", "0.6444237", "0.64434814", "0.64398164", "0.6437948", "0.6422304", "0.6413271", "0.6412216", "0.6408792", "0.64056724", "0.6402672", "0.63972396", "0.63856894", "0.63845176", "0.6379085", "0.63778377", "0.63742936", "0.6370541", "0.63698524", "0.6365968", "0.63657844", "0.6360449", "0.63593614", "0.63567835", "0.6356277", "0.6356277", "0.6349069", "0.63435936", "0.63317055", "0.6328283", "0.6326844", "0.6321587", "0.63056076", "0.63008267", "0.6299854", "0.629227", "0.62860274", "0.62841916", "0.6282111", "0.6281547", "0.62763447", "0.6276243", "0.6272253", "0.6270211", "0.62692857", "0.62632775", "0.62603354", "0.6255651", "0.62546545", "0.6249421", "0.62480503", "0.6244368", "0.6241841", "0.6239168", "0.6235891", "0.6233966", "0.6230641" ]
0.0
-1
Gets allowable values of the enum
public static function getAllowableEnumValues() { return [ self::LEGACY, self::STATIC_REMOTE_KEY, self::ANCHORS, self::UNKNOWN_COMMITMENT_TYPE, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getAllowableEnumValues()\n {\n return [\n self::PERSONAL,\n self::EDUCATION,\n self::HEALTH,\n self::FINANCE,\n self::PROFESSIONAL,\n self::LICENSES,\n self::CERTIFICATES,\n self::LEGAL,\n self::OTHERS\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::GROUND,\nself::STANDARD,\nself::PREMIUM, ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::O,\n self::PP,\n self::ID,\n self::DL,\n self::OT,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::USER,\n self::BILLING,\n self::ENGINEER,\n self::SUPERUSER\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::PERSONAL,\n self::ENTERPRISE,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::CFP,\n self::FORHIRE,\n self::COLLABS,\n self::EDUCATION,\n self::JOBS,\n self::MENTORS,\n self::PRODUCTS,\n self::MENTEES,\n self::FORSALE,\n self::EVENTS,\n self::MISC,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::RENT,\n self::SALE,\n self::MIXING_FORM,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::_201,\n self::_202,\n self::_203,\n self::_204,\n self::_244,\n self::_205\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::_EMPTY,\n self::UNKNOWN,\n self::LITER,\n self::KILOGRAM,\n self::SQUARE_METER,\n self::CUBIC_METER,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::DAMAGE_TYPE_NONE,\n self::DAMAGE_TYPE_KINETIC,\n self::DAMAGE_TYPE_ARC,\n self::DAMAGE_TYPE_THERMAL,\n self::DAMAGE_TYPE_VOID,\n self::DAMAGE_TYPE_RAID,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::OFFER,\n self::CHANNELOFFER,\n self::ORDERITEMID,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::COPY_CODE,\n self::ONE_TAP\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::NOT_ENOUGH_DELIVERY_TARGET,\n self::OUT_OF_STOCK,\n self::OVER_SOV_DAILY_LIMIT,\n self::OVER_SOV_WEEKLY_LIMIT,\n self::UNKNOWN,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::ASIN,\n self::SELLER_SKU\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::UNKNOWN,\n self::SINGLE,\n self::UNMARRIED,\n self::MARRIED_WITH_CONDITIONS,\n self::MARRIED_IN_COMMUNITY_OF_PROPERTY,\n self::LIVING_TOGETHER_IN_CIVIL_PARTNERSHIP,\n self::LIVING_TOGETHER_WITHOUT_CIVIL_PARTNERSHIP,\n self::PARTNER_REGISTRATION_IN_COMMUNITY_OF_PROPERTY,\n self::PARTNER_REGISTRATION_WITH_TERM_LIFE_INSURANCE,\n self::PARTNER_REGISTRATION_PARTNERSHIP_WITH_CONDITIONS,\n self::WIDOWER,\n self::WIDOW,\n self::DIVORCED,\n self::MARRIED,\n self::MARRIED_IN_LIMITED_COMMUNITY_OF_PROPERTY,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::_OR,\n self::_AND,\n self::NOTIN,\n self::UNKNOWN,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::_DEFAULT,\n self::GET,\n self::RESERVE,\n self::BOOK,\n self::BUY,\n self::APPLY,\n self::CONSULT,\n self::DOWNLOAD,\n self::PLAYING,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::BASEMENT,\n self::GROUND,\n self::MIDDLE,\n self::TOP,\n self::FLOOR_1,\n self::FLOOR_2,\n self::FLOOR_3,\n self::FLOOR_4,\n self::FLOOR_5,\n self::FLOOR_6,\n self::FLOOR_7,\n self::FLOOR_8,\n self::FLOOR_9,\n self::FLOOR_10,\n self::FLOOR_11,\n self::FLOOR_12,\n self::FLOOR_13,\n self::FLOOR_14,\n self::FLOOR_15,\n self::FLOOR_16,\n self::FLOOR_17,\n self::FLOOR_18,\n self::FLOOR_19,\n self::FLOOR_20,\n self::FLOOR_21_OR_ABOVE,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::UNKNOWN,\n self::CASH,\n self::GIFT,\n self::INNER,\n self::CREDIT,\n self::DEBT_TEMP,\n self::DEBT_FIXED,\n self::TCC_GIFT,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::_NEW,\nself::USED,\nself::COLLECTIBLE,\nself::REFURBISHED,\nself::CLUB, ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::EU_STANDARD_CONTRACTUAL_CLAUSE,\n self::BINDING_CORPORATE_RULES,\n self::PRIVACY_SHIELD,\n self::ADEQUAT_COUNTRY,\n self::DEROGATION,\n self::NONE,\n self::OTHER,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::TO_RENTED,\n self::TO_SOLD,\n self::TO_WITHDRAWN,\n self::TO_AVAILABLE,\n self::TO_UNDER_OFFER,\n self::TO_UNDER_OPTION,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::DAILY,\n self::WEEKLY,\n self::MULTI_WEEKLY,\n self::ONE_WEEK,\n self::MULTI_FORTNIGHT,\n self::MONTHLY,\n self::MULTI_MONTHLY,\n self::RANDOM,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::MAINTENANCE,\n self::QUOTA,\n self::REPORTS,\n self::BACKUP_ERROR,\n self::BACKUP_WARNING,\n self::BACKUP_INFO,\n self::BACKUP_DAILY_REPORT,\n self::BACKUP_CRITICAL,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::LINEAR,\n self::DATA_MATRIX,\n self::QR,\n self::MICRO_QR,\n self::PDF417,\n self::AZTEC,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::NOT_DISCLOSED,\n self::SINGLE,\n self::MARRIED_CIVIL_PARTNER,\n self::CIVIL_PARTNER,\n self::DIVORCED_DISSOLVED_CIVIL_PARTNERSHIP,\n self::WIDOWED_SURVIVING_CIVIL_PARTNER,\n self::SEPARATED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::UNKNOWN,\n self::PENDING,\n self::PROCESSING,\n self::SUCCESS,\n self::FAIL,\n self::PARTIAL_FAIL,\n self::SYSTEM_ERROR,\n self::DELETED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::VN,\n self::AU,\n self::PALAO,\n self::BALI,\n self::FJ,\n self::PUJI,\n self::MV,\n self::JP,\n self::TR,\n self::GR,\n self::FR,\n self::IT,\n self::BULAGE,\n self::XIANBENNA,\n self::MU,\n self::GE,\n self::SUMEI,\n self::SAIBAN,\n self::JIZHOU,\n self::SHABA,\n self::DE,\n self::LONDON,\n self::SYDNEY,\n self::NZ,\n self::JILONGPO,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::RATE_1,\n self::RATE_2,\n self::RATE_3,\n self::RATE_4,\n self::RATE_5,\n self::RATE_6,\n self::RATE_7,\n self::RATE_8,\n self::RATE_9,\n self::RATE_10,\n self::UNKNOWN,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::FIRE_DETECTION_SYSTEM_CONNECTED_TO_COMMUNICATIONS_ROOM,\n self::PRIVATE_PARKING,\n self::ELEVATOR,\n self::SWIMMING_POOL,\n self::OUTDOOR_SPACE,\n self::DAY_NURSERY,\n self::OUT_OF_SCHOOL_CARE,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::IDENTITY,\n self::PROPERTY,\n self::VEHICLE,\n self::ADMIT_AND_ID_CARDS,\n self::MARKSHEETS,\n self::TRANSCRIPTS,\n self::CERTIFICATES,\n self::PRESCRIPTIONS,\n self::MEDICAL_REPORTS,\n self::DISCHARGE_SUMMARY,\n self::ACCOUNT_AND_CERTIFICATES,\n self::BILLS_AND_INVOICES,\n self::INSURANCE,\n self::RECEIPTS_AND_SUBSCRIPTIONS,\n self::TAXES,\n self::CORPORATES,\n self::COMPETITIONS,\n self::INTELLECTUAL_PROPERTIES,\n self::OTHERS,\n self::APPLICATIONS_AND_CERTIFICATES,\n self::LICENSES,\n self::ORGANIZATION_IDS,\n self::PERMITS,\n self::LEGAL\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::CATEGORY_ID,\n self::STOCK_QUANTITY,\n self::PRICE,\n self::SALE_PRICE,\n self::RATING,\n self::REVIEWS,\n self::BADGE,\n self::AGE_GROUP,\n self::AVAILABILITY_DATE,\n self::GENDER_GROUP,\n self::GOOGLE_PRODUCT_CATEGORY,\n self::LOCATION,\n self::SALES_RANK,\n self::UNKNOWN,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::UNSUPPORTED,\n self::UNKNOWN,\n self::CASH,\n self::GIFT,\n self::SPECIAL_PROMOTION,\n self::PAYMENT_DUE,\n self::CREDIT_TEMPORARY,\n self::CREDIT_ROLL,\n self::TCC_GIFT,\n self::UNSUPPPORTED,\n self::MINIPROGRAM,\n self::CREDIT,\n self::INNER,\n self::DEBT_TEMP,\n self::DEBT_FIXED,\n ];\n }", "public static function getAllowableEnumValues() : array\n {\n return [\n self::CORE,\n self::SNL,\n self::EFN,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::ACTIVE,\n self::STANDBY\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::UNSHIPPED,\n self::SHIPPED,\n self::CANCELED_BY_SELLER,\n self::CANCELED_BY_BUYER,\n self::RETURNED,\n self::REFUNDED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::CREATED,\n self::USED,\n self::EXPIRED,\n self::CANCELLED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::PREPROCESSING,\n self::STAGING_QUEUED,\n self::STAGING,\n self::STAGING_COMPLETED,\n self::STAGING_FAILED,\n self::TRANSFORMING_QUEUED,\n self::TRANSFORMING,\n self::TRANSFORMING_FAILED,\n self::TRANSFORMING_COMPLETED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::WEB,\n self::IOS,\n self::ANDROID,\n self::LIFF,\n self::MINI,\n self::CPM,\n self::MPM,\n self::READER\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::UNKNOWN,\n self::AGENDA_ITEM,\n self::INVOICE,\n self::TASK,\n self::EMAIL,\n self::SEARCH_PROFILE,\n self::CONTACT_ME,\n self::WEBSITE,\n self::TRANSACTION,\n self::COMMUNICATION_LOG,\n self::RELOCATION,\n self::BID,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::POSTED,\n self::FOLLOWED,\n self::LIKED,\n self::FAVORITED,\n self::SAVED,\n self::DISLIKED,\n self::PURCHASED,\n self::COMMENTED_ON,\n self::CREATED,\n self::VIEWED,\n self::REPORTED,\n self::BLOCKED,\n self::DELETED,\n self::AUTHORED,\n self::USED,\n self::DISMISSED,\n self::LOGGED_IN,\n self::TAGGED_WITH,\n self::CATEGORIZED_IN,\n self::INTERESTED_IN,\n self::LOCATED_IN,\n self::READ_QUARTER,\n self::READ_HALF,\n self::READ_ALL,\n self::SUBSCRIBED_TO,\n self::SUBSCRIBED_FROM,\n self::ADDED_TO,\n self::MADE_BY,\n self::PAUSED_ON,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::NONE,\n self::IGNORE_CASE,\n self::IGNORE_NON_SPACE,\n self::IGNORE_SYMBOLS,\n self::ORDINAL_IGNORE_CASE,\n self::STRING_SORT,\n self::ORDINAL,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::ACCOUNTING,\n self::ATS,\n self::CALENDAR,\n self::CRM,\n self::CSP,\n self::CUSTOMER_SUPPORT,\n self::ECOMMERCE,\n self::EMAIL,\n self::EMAIL_MARKETING,\n self::EXPENSE_MANAGEMENT,\n self::FILE_STORAGE,\n self::FORM,\n self::HRIS,\n self::LEAD,\n self::PAYROLL,\n self::POS,\n self::PROCUREMENT,\n self::PROJECT_MANAGEMENT,\n self::SCRIPT,\n self::SMS,\n self::SPREADSHEET,\n self::TEAM_MESSAGING,\n self::ISSUE_TRACKING,\n self::TIME_REGISTRATION,\n self::TRANSACTIONAL_EMAIL,\n self::VAULT,\n self::DATA_WAREHOUSE\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::EQUAL,\n self::NOT_EQUAL,\n self::GREATER_THAN_EQUALS,\n self::LESS_THAN_EQUALS,\n self::UNKNOWN,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::REASON_FOR_MOVING_EXPIRED,\n self::ASKING_PRICE_NOT_MET,\n self::RENEW_OBJECT_IN_MEDIA,\n self::CHOSE_OTHER_REAL_ESTATE_AGENT,\n self::PURCHASED_BY_OWNER,\n self::SOLD_BY_OTHER_REAL_ESTATE_AGENT,\n self::OWNER_HAS_RENTED_PROPERTY,\n self::LOGGED_OF_AS_BOG_OBJECT,\n self::WITHDRAWN_FROM_AUCTION,\n self::SELLER_CONTINUES_TO_INHABIT,\n self::OBJECT_REGISTERED_TWICE,\n self::ASSIGNMENT_TERMINATED_BY_REALTOR,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::PASS_PROTOCOL_DO_NOT_USE,\nself::RAW_PROTOCOL,\nself::V1_PROTOCOL,\nself::FLIGHT_PROTOCOL,\nself::MEMBERSHIP,\nself::SINGLE_USE_COUPON, ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::ADGROUP_WECHAT,\n self::AD_WECHAT,\n self::POI_WECHAT,\n self::AD,\n self::ADVERTISER,\n self::CAMPAIGN,\n self::ADGROUP,\n self::MATERIAL_VIDEO,\n self::MATERIAL_IMAGE,\n self::PROMOTED_OBJECT,\n self::CREATIVE_TEMPLATE,\n self::PRODUCT_CATELOG,\n self::AGE,\n self::GENDER,\n self::REGION_RECENTLY_IN,\n self::REGION_VISITED_IN,\n self::REGION_LIVE_IN,\n self::REGION_TRAVEL_IN,\n self::CITY_RECENTLY_IN,\n self::CITY_VISITED_IN,\n self::CITY_LIVE_IN,\n self::CITY_TRAVEL_IN,\n self::BIDWORD,\n self::QUERYWORD,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::NONE,\nself::ON_FIXED_DATE,\nself::AFTER_X_DAYS,\nself::ON_VARIABLE_DATE_TIME,\nself::SET_TO_NULL, ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::AWAITING_ORDER,\n self::SHIPPING_SOON,\n self::SHIPPED,\n self::DELIVERED,\n self::RETURNED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::FOREST_EDGE,\n self::WATERSIDE,\n self::PARK,\n self::ON_BUSY_STREET,\n self::ON_QUIET_STREET,\n self::CENTRAL_CITY_CENTER,\n self::RESIDENTIAL_AREA,\n self::UNOBSTRUCTED_VIEW,\n self::SHELTERED_LOCATION,\n self::OPEN_AREA,\n self::OUTSIDE_VILLAGE,\n self::ON_WATERWAY,\n self::FORESTED_AREA,\n self::NEAR_RAILWAY_STATION,\n self::SUBURB,\n self::BUSINESS_PARK,\n self::OTHER,\n self::LRTE,\n self::HARBOR_AREA,\n self::INDUSTRIAL_AREA,\n self::OFFICE_PARK,\n self::PRTE,\n self::SHOPPING_CENTER,\n self::COUNTRYSIDE,\n self::NEAR_HIGHWAY,\n self::NEAR_PUBLIC_TRANSPORT,\n self::NEAR_SCHOOL,\n self::SEASIDE,\n self::SECLUDED_LOCATION,\n self::STANDALONE,\n self::SUB_DIVISION,\n self::FURNITURE_BOULEVARD,\n self::INDOOR_SHOPPING,\n self::SEA_VIEW,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::SQUARE,\n self::CIRCLE,\n self::DIAMOND,\n self::OPEN_ARROW,\n self::CLOSED_ARROW,\n self::NONE,\n self::BUTT,\n self::REVERSED_OPEN_ARROW,\n self::REVERSED_CLOSED_ARROW,\n self::SLASH,\n ];\n }", "public static function getAllowableEnumValues()\n {\n $allowable = [\n self::BUSINESS,\n self::INDIVIDUAL,\n ];\n $allowableAllCase = array_merge(array_map('strtolower', $allowable), $allowable);\n return $allowableAllCase;\n }", "#[\\ReturnTypeWillChange]\n public static function getAllowableEnumValues()\n {\n return [\n self::ACTIVE,\n self::INACTIVE,\n self::DEACTIVATED\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::SYSTEMTEST,\n self::SYSTEMNOTIFICATION,\n self::SELLERORDER_ACCEPTED,\n self::SELLERORDER_SHIPPING,\n self::SELLERORDER_PAYMENT,\n self::SELLERORDER_CANCELLATION_REQUEST,\n self::SELLERORDER_CANCELLATION_ACCEPTED,\n self::SELLERORDER_CANCELLATION_DENIED,\n self::SELLERORDER_REFUND,\n self::SELLERORDER_INVOICE,\n self::SELLERORDER_RETURN_RECEIVED,\n self::SELLEROFFER_NEW,\n self::SELLEROFFER_UPDATE,\n self::SELLEROFFER_END,\n self::SELLEROFFER_STOCK_UPDATE,\n self::SELLEROFFER_PRICE_UPDATE,\n self::SELLERREPORT_REQUEST,\n self::SELLERCHANNEL_UNLINKED,\n self::SELLERMETA_SELLER_ATTRIBUTES_UPDATE_REQUEST,\n self::SELLERTICKET_REPLY,\n ];\n }", "public function getAllowedValues();", "public function getAllowedValues();", "public static function getAllowableEnumValues()\n {\n return [\n self::CANCELLED,\nself::NEED_TO_BE_SENT,\nself::OPEN,\nself::RECEIVED,\nself::RETURNED,\nself::RETURNED_PAID,\nself::SENT,\nself::SENT_AND_AUTOPAID, ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::ORDER_STATUS_CHANGE,\n self::BUYER_REQUESTED_CHANGE,\n ];\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_MINUS_1,\r\n self::STATUS_0,\r\n self::STATUS_1,\r\n self::STATUS_2,\r\n self::STATUS_3,\r\n self::STATUS_4,\r\n self::STATUS_5,\r\n self::STATUS_6,\r\n self::STATUS_7,\r\n self::STATUS_8,\r\n self::STATUS_9,\r\n self::STATUS_10,\r\n self::STATUS_11,\r\n ];\r\n }", "public static function getAllowableEnumValues() : array\n {\n return [\n self::LIST_ITEM,\n self::LIST_ORDERED,\n self::LIST_UNORDERED,\n self::STYLE_BOLD,\n self::STYLE_ITALIC,\n self::STYLE_LINEBREAK,\n self::STYLE_PARAGRAPH,\n self::STYLE_UNDERLINE,\n ];\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_FREEZED,\r\n self::STATUS_DOWN,\r\n self::STATUS_ACTIVE,\r\n self::STATUS_ERROR,\r\n ];\r\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::PENDING,\n self::PENDING_SENT,\n self::PENDING_DOCUMENT_SENT,\n self::PENDING_PROGRESS,\n self::PENDING_UPDATE,\n self::PENDING_SENT_UPDATE,\n self::TIMEOUT,\n self::ACCEPT,\n self::DECLINE,\n self::INVALID_NAME,\n self::FAILED,\n self::CANCEL,\n self::AUTO_CANCEL,\n self::ACTIVE,\n self::SENT,\n self::OPEN,\n self::TMCH_CLAIM,\n self::TMCH_CLAIM_CONFIRMED,\n self::TMCH_CLAIM_REJECTED,\n self::TMCH_CLAIM_EXPIRED,\n self::TMCH_CLAIM_PENDING,\n self::TMCH_CLAIM_FAILED,\n self::FAILED_REF,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::0,\n self::1,\n self::2,\n self::3,\n self::4,\n self::5,\n self::6,\n self::7,\n self::8,\n self::9,\n self::10,\n self::11,\n self::12,\n self::13,\n self::14,\n self::15,\n self::16,\n self::17,\n self::18,\n self::19,\n self::20,\n self::21,\n self::22,\n self::23,\n self::24,\n self::25,\n self::26,\n self::27,\n self::28,\n self::29,\n self::30,\n self::31,\n self::32,\n self::33,\n self::34,\n self::35,\n self::36,\n self::37,\n self::38,\n self::39,\n self::40,\n self::41,\n self::42,\n self::43,\n self::44,\n self::45,\n self::46,\n self::47,\n self::48,\n self::49,\n self::50,\n self::51,\n self::52,\n self::53,\n self::54,\n self::55,\n self::56,\n self::57,\n self::58,\n self::59,\n self::89,\n self::90,\n self::91,\n self::92,\n self::93,\n self::94,\n self::95,\n self::96,\n self::97,\n self::98,\n self::99,\n self::100,\n self::101,\n self::102,\n self::103,\n self::104,\n self::105,\n self::106,\n self::107,\n self::108,\n self::109,\n self::110,\n self::111,\n self::112,\n self::113,\n self::115,\n self::116,\n self::117,\n self::118,\n self::119,\n self::120,\n self::121,\n self::122,\n self::123,\n self::124,\n self::125,\n self::126,\n self::127,\n self::128,\n self::129,\n self::130,\n self::131,\n self::132,\n self::133,\n self::134,\n self::135,\n self::136,\n self::137,\n self::138,\n self::139,\n self::140,\n self::141,\n self::142,\n self::143,\n self::144,\n self::145,\n self::146,\n self::147,\n self::148,\n self::149,\n self::150,\n self::151,\n self::152,\n self::153,\n self::154,\n self::155,\n self::156,\n self::157,\n self::158,\n self::159,\n self::160,\n self::161,\n self::162,\n self::163,\n self::164,\n self::165,\n self::166,\n self::167,\n self::168,\n self::169,\n self::170,\n self::171,\n self::172,\n self::173,\n self::174,\n self::175,\n self::200,\n self::201,\n self::202,\n self::203,\n self::204,\n self::205,\n self::206,\n self::207,\n self::208,\n self::209,\n self::210,\n self::211,\n self::212,\n self::213,\n self::214,\n self::215,\n self::216,\n self::217,\n self::218,\n self::219,\n self::220,\n self::221,\n self::222,\n self::223,\n self::224,\n self::225,\n self::226,\n self::227,\n self::228,\n self::229,\n self::230,\n self::231,\n self::232,\n self::233,\n self::234,\n self::235,\n self::300,\n self::301,\n self::302,\n self::303,\n self::304,\n self::305,\n self::306,\n self::307,\n self::308,\n self::309,\n self::310,\n self::311,\n self::312,\n self::313,\n self::400,\n self::500,\n self::501,\n self::502,\n self::503,\n self::504,\n self::505,\n self::506,\n self::507,\n self::508,\n self::509,\n self::510,\n self::511,\n self::512,\n self::513,\n self::514,\n self::515,\n self::516,\n self::517,\n self::518,\n self::519,\n self::520,\n self::521,\n self::522,\n self::523,\n self::524,\n self::525,\n self::526,\n self::527,\n self::528,\n self::529,\n self::530,\n self::531,\n self::532,\n self::533,\n self::534,\n self::535,\n self::536,\n self::537,\n self::538,\n self::539,\n self::540,\n self::541,\n self::542,\n self::543,\n self::544,\n self::555,\n self::556,\n self::557,\n self::558,\n self::559,\n self::560,\n self::561,\n self::562,\n self::563,\n self::564,\n self::565,\n self::566,\n self::567,\n self::568,\n self::569,\n self::570,\n self::571,\n self::572,\n self::573,\n self::574,\n self::575,\n self::576,\n self::577,\n self::578,\n self::579,\n self::580,\n self::581,\n self::582,\n self::583,\n self::584,\n self::585,\n self::586,\n self::587,\n self::588,\n self::589,\n self::590,\n self::591,\n self::592,\n self::593,\n self::594,\n self::595,\n self::601,\n self::602,\n self::603,\n self::604,\n self::605,\n self::606,\n self::607,\n self::608,\n self::609,\n self::610,\n self::611,\n self::612,\n self::613,\n self::614,\n self::615,\n self::616,\n self::617,\n self::618,\n self::619,\n self::620,\n self::621,\n self::622,\n self::623,\n self::624,\n self::625,\n self::626,\n self::627,\n self::628,\n self::629,\n self::630,\n self::631,\n self::632,\n self::633,\n self::634,\n self::635,\n self::636,\n self::637,\n self::638,\n self::639,\n self::641,\n self::642,\n self::643,\n self::644,\n self::646,\n self::647,\n self::648,\n self::649,\n self::650,\n self::651,\n self::652,\n self::653,\n self::654,\n self::655,\n self::656,\n self::657,\n self::658,\n self::659,\n self::660,\n self::661,\n self::662,\n self::663,\n self::664,\n self::665,\n self::666,\n self::667,\n self::668,\n self::669,\n self::670,\n self::671,\n self::672,\n self::673,\n self::674,\n self::675,\n self::676,\n self::677,\n self::678,\n self::679,\n self::680,\n self::681,\n self::682,\n self::683,\n self::684,\n self::685,\n self::686,\n self::687,\n self::688,\n self::689,\n self::690,\n self::691,\n self::692,\n self::693,\n self::694,\n self::695,\n self::696,\n self::697,\n self::698,\n self::699,\n self::701,\n self::702,\n self::703,\n self::704,\n self::705,\n self::706,\n self::707,\n self::750,\n self::751,\n self::801,\n self::802,\n self::803,\n self::804,\n self::805,\n self::806,\n self::807,\n self::900,\n self::901,\n self::902,\n self::903,\n self::904,\n self::905,\n self::906,\n self::907,\n self::908,\n self::909,\n self::1000,\n self::1001,\n self::1002,\n self::1003,\n self::1004,\n self::1005,\n self::1006,\n self::1007,\n self::1008,\n self::1009,\n self::1100,\n self::1204,\n self::1205,\n self::1218,\n self::1223,\n self::1224,\n self::1225,\n self::1226,\n self::1227,\n self::1229,\n self::1230,\n self::1231,\n self::1232,\n self::1233,\n self::1234,\n self::1235,\n self::1236,\n self::1237,\n self::1238,\n self::1239,\n self::1300,\n self::1301,\n self::1302,\n self::1303,\n self::1304,\n self::1305,\n self::1306,\n self::1307,\n self::1308,\n self::1309,\n self::1310,\n self::1311,\n self::1312,\n self::1313,\n self::1314,\n self::1315,\n self::1316,\n self::1317,\n self::1318,\n self::1400,\n self::1401,\n self::1402,\n self::1403,\n self::1404,\n self::1405,\n self::1500,\n self::1501,\n self::1502,\n self::1600,\n self::1601,\n self::1602,\n self::1603,\n self::1604,\n self::1605,\n self::1606,\n self::1607,\n self::1608,\n self::1609,\n self::1610,\n self::1611,\n self::1612,\n self::1613,\n self::1614,\n self::1615,\n self::1616,\n self::1617,\n self::1618,\n self::1619,\n self::1620,\n self::1621,\n self::1622,\n self::1623,\n self::1624,\n self::1625,\n self::1626,\n self::1627,\n self::1628,\n self::1629,\n self::1630,\n self::1631,\n self::1632,\n self::1633,\n self::1634,\n self::1635,\n self::1636,\n self::1637,\n self::1638,\n self::1639,\n self::1640,\n self::1641,\n self::1642,\n self::1643,\n self::1644,\n self::1645,\n self::1646,\n self::1647,\n self::1648,\n self::1649,\n self::1650,\n self::1651,\n self::1652,\n self::1653,\n self::1654,\n self::1655,\n self::1656,\n self::1657,\n self::1658,\n self::1659,\n self::1660,\n self::1661,\n self::1662,\n self::1663,\n self::1664,\n self::1665,\n self::1666,\n self::1667,\n self::1668,\n self::1669,\n self::1670,\n self::1671,\n self::1672,\n self::1673,\n self::1674,\n self::1675,\n self::1676,\n self::1677,\n self::1678,\n self::1679,\n self::1680,\n self::1681,\n self::1682,\n self::1683,\n self::1684,\n self::1685,\n self::1686,\n self::1687,\n self::1688,\n self::1800,\n self::1801,\n self::1802,\n self::1803,\n self::1804,\n self::1805,\n self::1806,\n self::1900,\n self::1901,\n self::1902,\n self::1903,\n self::1904,\n self::1905,\n self::1906,\n self::1907,\n self::1908,\n self::1910,\n self::1911,\n self::1912,\n self::1913,\n self::1914,\n self::2000,\n self::2001,\n self::2002,\n self::2003,\n self::2004,\n self::2005,\n self::2006,\n self::2007,\n self::2008,\n self::2009,\n self::2010,\n self::2011,\n self::2012,\n self::2013,\n self::2014,\n self::2015,\n self::2016,\n self::2017,\n self::2018,\n self::2019,\n self::2020,\n self::2021,\n self::2022,\n self::2023,\n self::2024,\n self::2025,\n self::2026,\n self::2027,\n self::2028,\n self::2029,\n self::2030,\n self::2031,\n self::2032,\n self::2033,\n self::2034,\n self::2035,\n self::2036,\n self::2037,\n self::2038,\n self::2039,\n self::2040,\n self::2041,\n self::2042,\n self::2043,\n self::2044,\n self::2045,\n self::2046,\n self::2047,\n self::2048,\n self::2049,\n self::2050,\n self::2051,\n self::2052,\n self::2053,\n self::2054,\n self::2055,\n self::2056,\n self::2057,\n self::2058,\n self::2059,\n self::2060,\n self::2061,\n self::2062,\n self::2063,\n self::2064,\n self::2065,\n self::2100,\n self::2101,\n self::2102,\n self::2103,\n self::2104,\n self::2105,\n self::2106,\n self::2107,\n self::2108,\n self::2109,\n self::2110,\n self::2111,\n self::2112,\n self::2113,\n self::2114,\n self::2115,\n self::2116,\n self::2117,\n self::2118,\n self::2119,\n self::2120,\n self::2121,\n self::2122,\n self::2123,\n self::2124,\n self::2125,\n self::2126,\n self::2200,\n self::2201,\n self::2202,\n self::2203,\n self::2204,\n self::2205,\n self::2206,\n self::2207,\n self::2300,\n self::2500,\n self::2501,\n self::2502,\n self::2503,\n self::2504,\n self::2505,\n self::2506,\n self::2600,\n self::2601,\n self::2700,\n self::2701,\n self::2702,\n self::2703,\n self::2800,\n self::2801,\n self::2802,\n self::2803,\n self::2804,\n self::2805,\n self::2806,\n self::2900,\n self::2901,\n self::3000,\n self::3001,\n self::3002,\n self::3003,\n self::3004,\n self::3005,\n self::3006,\n self::3007,\n self::3008,\n self::3009,\n self::3010,\n self::3011,\n self::3012,\n self::3013,\n self::3014,\n self::3015,\n self::3016,\n self::3017,\n self::3018,\n self::3019,\n self::3020,\n self::3021,\n self::3022,\n self::3023,\n self::3024,\n self::3025,\n self::3026,\n self::3027,\n self::3028,\n self::3200,\n self::3201,\n self::3202,\n self::3203,\n self::3204,\n self::3206,\n self::3207,\n self::3208,\n self::3209,\n self::3210,\n self::3211,\n self::3212,\n self::3213,\n self::3214,\n self::3215,\n self::3216,\n self::3217,\n self::3218,\n self::3219,\n self::3220,\n self::3221,\n self::3222,\n self::3300,\n self::3400,\n self::3401,\n self::3402,\n self::3403,\n self::3404,\n self::3405,\n self::3406,\n self::3407,\n self::3408,\n self::3409,\n self::3410,\n self::3411,\n self::3412,\n self::3413,\n self::3414,\n self::3500,\n self::3600,\n self::3702,\n self::3703,\n self::3705,\n self::3706,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_IDLE,\n self::STATUS_DISABLED,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::MONDAY_MORNING,\n self::MONDAY_AFTERNOON,\n self::MONDAY_EVENING,\n self::TUESDAY_MORNING,\n self::TUESDAY_AFTERNOON,\n self::TUESDAY_EVENING,\n self::WEDNESDAY_MORNING,\n self::WEDNESDAY_AFTERNOON,\n self::WEDNESDAY_EVENING,\n self::THURSDAY_MORNING,\n self::THURSDAY_AFTERNOON,\n self::THURSDAY_EVENING,\n self::FRIDAY_MORNING,\n self::FRIDAY_AFTERNOON,\n self::FRIDAY_EVENING,\n self::SATURDAY_MORNING,\n self::SATURDAY_AFTERNOON,\n self::SATURDAY_EVENING,\n self::SUNDAY_MORNING,\n self::SUNDAY_AFTERNOON,\n self::SUNDAY_EVENING,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::DESTINY_OBJECTIVE_UI_STYLE_NONE,\n self::DESTINY_OBJECTIVE_UI_STYLE_HIGHLIGHTED,\n self::DESTINY_OBJECTIVE_UI_STYLE_CRAFTINGWEAPONLEVEL,\n self::DESTINY_OBJECTIVE_UI_STYLE_CRAFTINGWEAPONLEVELPROGRESS,\n self::DESTINY_OBJECTIVE_UI_STYLE_CRAFTINGWEAPONTIMESTAMP,\n self::DESTINY_OBJECTIVE_UI_STYLE_CRAFTINGMEMENTOS,\n self::DESTINY_OBJECTIVE_UI_STYLE_CRAFTINGMEMENTOTITLE,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_LOCKED,\nself::STATUS_AVAILABLE, ];\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_1,\n self::TYPE_2,\n self::TYPE_3,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::APP_IPHONE_65,\n self::APP_IPHONE_58,\n self::APP_IPHONE_55,\n self::APP_IPHONE_47,\n self::APP_IPHONE_40,\n self::APP_IPHONE_35,\n self::APP_IPAD_PRO_3_GEN_129,\n self::APP_IPAD_PRO_3_GEN_11,\n self::APP_IPAD_PRO_129,\n self::APP_IPAD_105,\n self::APP_IPAD_97,\n self::APP_DESKTOP,\n self::APP_WATCH_SERIES_4,\n self::APP_WATCH_SERIES_3,\n self::APP_APPLE_TV,\n self::IMESSAGE_APP_IPHONE_65,\n self::IMESSAGE_APP_IPHONE_58,\n self::IMESSAGE_APP_IPHONE_55,\n self::IMESSAGE_APP_IPHONE_47,\n self::IMESSAGE_APP_IPHONE_40,\n self::IMESSAGE_APP_IPAD_PRO_3_GEN_129,\n self::IMESSAGE_APP_IPAD_PRO_3_GEN_11,\n self::IMESSAGE_APP_IPAD_PRO_129,\n self::IMESSAGE_APP_IPAD_105,\n self::IMESSAGE_APP_IPAD_97,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_0,\nself::STATUS_1,\nself::STATUS_2, ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::ACTION_INVALID,\n self::ACTION_MISSING,\n self::BOOT_ORDER_INVALID,\n self::CORE_MEMORY_UNSUPPORTED,\n self::FIREWALL_INVALID,\n self::CORE_NUMBER_INVALID,\n self::HOSTNAME_INVALID,\n self::HOSTNAME_MISSING,\n self::MEMORY_AMOUNT_INVALID,\n self::NIC_MODEL_INVALID,\n self::PASSWORD_DELIVERY_INVALID,\n self::SERVER_TITLE_INVALID,\n self::SERVER_TITLE_MISSING,\n self::SIZE_INVALID,\n self::SIZE_MISSING,\n self::STORAGE_DEVICE_INVALID,\n self::STORAGE_DEVICE_MISSING,\n self::STORAGE_DEVICES_INVALID,\n self::STORAGE_DEVICES_MISSING,\n self::STORAGE_INVALID,\n self::STORAGE_MISSING,\n self::STORAGE_TITLE_INVALID,\n self::STORAGE_TITLE_MISSING,\n self::TIMEZONE_INVALID,\n self::TYPE_INVALID,\n self::TIER_INVALID,\n self::VIDEO_MODEL_INVALID,\n self::VNC_INVALID,\n self::VNC_PASSWORD_INVALID,\n self::ZONE_INVALID,\n self::ZONE_MISSING,\n self::USER_DATA_INVALID,\n self::INSUFFICIENT_CREDITS,\n self::STORAGE_FORBIDDEN,\n self::PLAN_CORE_NUMBER_ILLEGAL,\n self::PLAN_MEMORY_AMOUNT_ILLEGAL,\n self::TRIAL_PLAN,\n self::STORAGE_NOT_FOUND,\n self::ZONE_NOT_FOUND,\n self::CDROM_DEVICE_IN_USE,\n self::DEVICE_ADDRESS_IN_USE,\n self::IP_ADDRESS_RESOURCES_UNAVAILABLE,\n self::MULTIPLE_TEMPLATES,\n self::PUBLIC_STORAGE_ATTACH,\n self::SERVER_RESOURCES_UNAVAILABLE,\n self::STORAGE_ATTACHED_AS_CDROM,\n self::STORAGE_ATTACHED_AS_DISK,\n self::STORAGE_DEVICE_LIMIT_REACHED,\n self::STORAGE_IN_USE,\n self::STORAGE_RESOURCES_UNAVAILABLE,\n self::STORAGE_STATE_ILLEGAL,\n self::STORAGE_TYPE_ILLEGAL,\n self::ZONE_MISMATCH,\n self::INVALID_USERNAME,\n ];\n }", "public function getStateAllowableValues()\n {\n return [\n self::STATE_0,\nself::STATE_1, ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_CANCELED,\n self::STATUS_DISABLED,\n ];\n }", "public function getStateAllowableValues()\n {\n return [\n self::STATE_0,\nself::STATE_1,\nself::STATE_2, ];\n }", "public function getStateAllowableValues()\n {\n return [\n self::STATE_0,\nself::STATE_1,\nself::STATE_2, ];\n }", "public function getLevelAllowableValues()\n {\n return [\n self::LEVEL_QM,\n self::LEVEL_EF,\n self::LEVEL_QF,\n self::LEVEL_SF,\n self::LEVEL_F,\n ];\n }", "public function getValidationAllowableValues()\n {\n return [\n self::VALIDATION_NONE,\n self::VALIDATION_STRING,\n self::VALIDATION_NUMBER,\n self::VALIDATION_DATE,\n self::VALIDATION_DATE_CUSTOM,\n self::VALIDATION_TIME,\n self::VALIDATION_ZIP,\n self::VALIDATION_PHONE,\n self::VALIDATION_SOCIAL_SEC,\n self::VALIDATION_EMAIL,\n self::VALIDATION_CURRENCY,\n self::VALIDATION_PERCENT,\n self::VALIDATION_FORMULA,\n self::VALIDATION_CUSTOM,\n self::VALIDATION_XFA_PICTURE,\n ];\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_AVAILABLE,\r\n self::STATUS_PROTECTING,\r\n self::STATUS_DELETING,\r\n self::STATUS_RESTORING,\r\n self::STATUS_ERROR,\r\n self::STATUS_WAITING_PROTECT,\r\n self::STATUS_WAITING_DELETE,\r\n self::STATUS_WAITING_RESTORE,\r\n ];\r\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_REQUESTED,\n self::STATUS_RESERVED,\n self::STATUS_IN_HOUSE,\n self::STATUS_CANCELLED,\n self::STATUS_CHECKED_OUT,\n self::STATUS_NO_SHOW,\n self::STATUS_WAIT_LIST,\n self::STATUS_UNKNOWN,\n ];\n }", "public function getAllowedValues() : array\n {\n return $this->allowedValues;\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_CONSISTENT,\r\n self::STATUS_INCONSISTENT,\r\n self::STATUS_COMPARING,\r\n self::STATUS_WAITING_FOR_COMPARISON,\r\n self::STATUS_FAILED_TO_COMPARE,\r\n self::STATUS_TARGET_DB_NOT_EXIST,\r\n self::STATUS_CAN_NOT_COMPARE,\r\n ];\r\n }", "public function getTypeAllowableValues()\r\n {\r\n return [\r\n self::TYPE_EIP,\r\n self::TYPE_DUALSTACK,\r\n self::TYPE_DUALSTACK_SUBNET,\r\n ];\r\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_EXPIRED,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_DRAFT,\n self::STATUS_IN_PROGRESS,\n self::STATUS_APPROVED,\n self::STATUS_REJECTED,\n self::STATUS_FEEDBACK,\n ];\n }", "public function getValidationTypeAllowableValues()\n {\n return [\n self::VALIDATION_TYPE_SMS,\n self::VALIDATION_TYPE_IVR,\n self::VALIDATION_TYPE_CALL,\n self::VALIDATION_TYPE_UNKNOWN,\n ];\n }", "public function getFieldAllowableValues()\n {\n return [\n self::FIELD_CONTENT_DISCOVERABILITY_PERCENTAGE,\n self::FIELD_QUALITY_SCORE_PERCENTAGE,\n self::FIELD_OFFER_PERCENTAGE,\n self::FIELD_RATING_REVIEWS_PERCENTAGE,\n self::FIELD_VIEW_TRENDING_ITEMS,\n self::FIELD_VIEW_POST_PURCHASE_ITEMS,\n self::FIELD_WFS_FLAG,\n self::FIELD_CATEGORY_NAME,\n self::FIELD_HAS_ISSUES,\n self::FIELD_PRODUCT_TYPE,\n self::FIELD_ATTRIBUTE_LIST,\n self::FIELD_PRODUCT_TYPES,\n self::FIELD_BRAND_LIST,\n self::FIELD_OOS,\n self::FIELD_FAST_AND_FREE_SHIPPING,\n self::FIELD_PRICE_MEET_BEAT_FLAG,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_ARCHIVED,\n ];\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_MONEY_TRANSFER,\n self::TYPE_DIRECT_DEBIT,\n ];\n }", "public function getStatusAllowableValues()\r\n {\r\n return [\r\n self::STATUS_CREATION_IN_PROGRESS,\r\n self::STATUS_CREATION_FAILED,\r\n self::STATUS_AVAILABLE,\r\n self::STATUS_APPLY_IN_PROGRESS,\r\n self::STATUS_APPLIED,\r\n ];\r\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_MEETING,\n self::STATUS_WAITING_ROOM,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_PAUSED,\n self::STATUS_DELETED,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_SUCCESS,\n self::STATUS_UNKNOWN_DEVICE,\n self::STATUS_UNCONFIRMED_DEVICE,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_ON_HOLD,\n self::STATUS_HOLD_PAYMENTS,\n self::STATUS_INACTIVE,\n self::STATUS_ONE_TIME,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_DELETED,\n self::STATUS_ACTIVE,\n self::STATUS_PROCESSING,\n self::STATUS_SENDING,\n self::STATUS_COMPLETED,\n self::STATUS_PAUSED,\n self::STATUS_CANCELLED,\n self::STATUS_DRAFT,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_PENDING,\n self::STATUS_INPROGRESS,\n self::STATUS_SUCCESS,\n self::STATUS_FAILED,\n self::STATUS_TIMEOUT,\n self::STATUS_PARTIALSUCCESS,\n ];\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_CHARGE,\n self::TYPE_RECURRING,\n self::TYPE_SUBSCRIPTION,\n self::TYPE_SUBSCRIPTION_CHARGE,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_OPEN,\n self::STATUS_PENDING,\n self::STATUS_SUCCESSFUL,\n self::STATUS_NOT_SUCCESSFUL,\n self::STATUS_DISCARDED,\n ];\n }", "public function getStateAllowableValues()\r\n {\r\n return [\r\n self::STATE_PENDING,\r\n self::STATE_IN_PROGRESS,\r\n self::STATE_SUCCESS,\r\n self::STATE_FAILURE,\r\n ];\r\n }", "public function getStateAllowableValues()\n {\n return [\n self::STATE_PENDING,\n self::STATE_PROCESSING,\n self::STATE_AUTHORIZED,\n self::STATE_SETTLED,\n self::STATE_REFUNDED,\n self::STATE_FAILED,\n self::STATE_CANCELLED,\n ];\n }", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_COUNTRY,\n self::TYPE_STATE,\n self::TYPE_COUNTY,\n self::TYPE_CITY,\n self::TYPE_SPECIAL,\n ];\n }" ]
[ "0.85661143", "0.85386074", "0.8532823", "0.8499898", "0.84983075", "0.8495044", "0.8462803", "0.84575796", "0.84546816", "0.8451272", "0.8446605", "0.84448344", "0.84363633", "0.8412434", "0.84114456", "0.8409116", "0.84022546", "0.8399002", "0.8383075", "0.8368423", "0.8358248", "0.83475083", "0.8340744", "0.83386165", "0.8337225", "0.83322835", "0.832383", "0.83207023", "0.8317006", "0.831653", "0.8312797", "0.8312132", "0.82991815", "0.82968843", "0.82938343", "0.8283132", "0.8270902", "0.8268284", "0.8248483", "0.8246657", "0.82442594", "0.8232236", "0.8220639", "0.821561", "0.8194362", "0.81898314", "0.81865364", "0.8181541", "0.81332", "0.8120291", "0.81033003", "0.80748713", "0.80553484", "0.8022418", "0.8010376", "0.8010376", "0.8003242", "0.795873", "0.7929589", "0.78884655", "0.78638047", "0.7850364", "0.78272533", "0.7793764", "0.77901936", "0.77898186", "0.777796", "0.77504784", "0.7736611", "0.7723707", "0.77188045", "0.77087593", "0.7689521", "0.7688848", "0.7688848", "0.76789993", "0.7653846", "0.7646383", "0.76231986", "0.7620709", "0.7585392", "0.7580192", "0.756464", "0.7562525", "0.7550388", "0.7548202", "0.754065", "0.7532127", "0.75173485", "0.75164795", "0.7510301", "0.7507607", "0.7488675", "0.74702585", "0.7468896", "0.74617684", "0.7461686", "0.7459808", "0.74564207", "0.7443824" ]
0.840635
16
Get the AST of the file passed as an argument
function getAst($file){ $fileRes=fopen("fileRes.txt","w"); $code=file_get_contents($file); $parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7); try { $ast = $parser->parse($code); } catch (Error $error) { echo "Parse error: {$error->getMessage()}\n"; return; } $dumper = new NodeDumper; echo $dumper->dump($ast) . "\n"; fwrite($fileRes, $dumper->dump($ast) . "\n"); fclose($fileRes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAST(): PhpParser\\Node\n {\n return $this->ast ?? ($this->ast = CompatibleParser::create()->parseSourceFile($this->contents));\n }", "public function get_ast() {\n // Check if no AST is yet loaded\n if (empty($this->ast)) {\n try {\n $lexer = new \\PhpParser\\Lexer\\Emulative([\n \"usedAttributes\" => [\n \"comments\",\n \"startLine\", \"endLine\",\n \"startTokenPos\", \"endTokenPos\"\n ]\n ]);\n\n // Create a new PHP parser\n $parser = new \\PhpParser\\Parser\\Php7($lexer);\n\n // Try creating the AST parser\n $this->ast = $parser->parse($this->get_content());\n\n // Save the tokens\n $this->tokens = $lexer->getTokens();\n } catch(\\PhpParser\\Error $e) {\n \\Lily\\Console::error(\"An error ocurred while parsing an AST:\", $e->getMessage());\n return null;\n }\n }\n\n return $this->ast;\n }", "public function getAst()\n {\n return $this->ast;\n }", "public function parseFile($file)\n {\n $ast = $this->getAST(\n $this->getContents($file)\n );\n return $this->converter->convert($ast);\n }", "public function getTreeSource();", "function getSourceFile() ;", "function astToCode($ast){\n $prettyPrinter = new PrettyPrinter\\Standard;\n echo $prettyPrinter->prettyPrintFile($ast);\n }", "public function getAST($content)\n {\n try {\n return $this->parser->parse($content);\n } catch (Error $error) {\n echo \"Parse error: {$error->getMessage()}\\n\";\n return;\n }\n }", "public function parse($file);", "public function parse($file);", "private function parse($fileName) {\n\n\t\tif (!$fileName) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$content = $this->getFileContent($fileName, $this->class->getStartLine());\n\t\t$namespace = str_replace('\\\\', '\\\\\\\\', $this->class->getNamespaceName());\n\t\t$content = preg_replace('/^.*?(\\bnamespace\\s+' . $namespace . '\\s*[;|{].*)$/s', '\\\\1', $content);\n\t\t$this->tokens = token_get_all('<?php ' . $content);\n\t\t$this->numTokens = count($this->tokens);\n\n\t\t$statements = $this->parseUseStatements();\n\n\t\treturn $statements;\n\t}", "protected function createTree($file){\n $lexer = new ListLexer(file_get_contents($file));\n $parser = new ListParser($lexer);\n $parser->parse(); // begin parsing at rule list\n $fn = new FileNode(array('file' => $file), $parser->tree);\n $fn->file = $file;\n \n $fn->buildContent();\n\n return $fn;\n\t}", "public function compile($ast) {\n /* FILE HEADER */\n $this->_emitter\n ->emit(['<?php', '// EMITTER VERSION [' . self::VERSION . ']'])\n ->flush();\n\n /* FILE BODY */\n $this->_processStatementBlock($ast);\n\n /* FILE FOOTER */\n $this->_emitter\n ->emit(\"?>\")\n ->flush();\n return $ast;\n }", "public function lex($file) {\n\t\t$this->_file = $file;\n\t\treturn $this->compileClass();\n\t}", "public function get_ast_root() {\n return $this->ast_root;\n }", "public function evalFile(string $src): CompiledFile;", "public function getAst() {\n\t\t\treturn \"<p>Ast: \".$this->ast.\"</p>\";\n\t\t}", "public function parseFile(\n CodeBase $code_base,\n string $file_path\n ) : Context {\n\n // Convert the file to an Abstract Syntax Tree\n // before passing it on to the recursive version\n // of this method\n $node = \\ast\\parse_file(\n $file_path,\n Configuration::instance()->ast_version\n );\n\n $context =\n (new Context($code_base))->withFile($file_path);\n\n if (empty($node)) {\n Log::err(\n Log::EUNDEF,\n \"Empty or missing file {$file_path}\",\n $file_path,\n 0\n );\n return $context;\n }\n\n return $this->parseNodeInContext($node, $context);\n }", "protected function sourceParserByFile($file)\n {\n if (!is_string($file)) {\n throw new InvalidArgumentException('The file must be a string.');\n }\n\n $type = pathinfo($file, PATHINFO_EXTENSION);\n\n return $this->sourceParser(strtolower($type));\n }", "public static function parse($file) {\n\t\tinclude $file;\n\t\tif (!isset($data)) {\n\t\t\tthrow new RuntimeException(\"Failed to parse php file `{$file}`\");\n\t\t}\n\t\treturn $data;\n\t}", "protected static function compile($file) {\n\n\t\t$content = file_get_contents($file);\n\t\t\n\t\tforeach( BP_Parser::$parts as $part ) {\n\t\t\t$content = call_user_func(\"BP_Parser::handle_$part\", $content, dirname($file) );\n\t\t}\n\n\t\treturn $content;\n\n\t}", "public function analyzeFile(\n CodeBase $code_base,\n string $file_path\n ) {\n // Convert the file to an Abstract Syntax Tree\n // before passing it on to the recursive version\n // of this method\n $node = \\ast\\parse_file(\n $file_path,\n Configuration::instance()->ast_version\n );\n\n // Set the file on the context\n $context =\n (new Context($code_base))->withFile($file_path);\n\n // Ensure we have some content\n if (empty($node)) {\n Log::err(\n Log::EUNDEF,\n \"Empty or missing file {$file_path}\",\n $file_path,\n 0\n );\n\n return $context;\n }\n\n // Start recursively analyzing the tree\n return $this->analyzeNodeInContext(\n $node,\n $context\n );\n }", "function tidy_parse_file($filename, $config = null, $encoding = null, $use_include_path = false) {}", "public function getParseTree( $text ) {\n\t\tglobal $wgVisualEditorParserCmd, $wgServer, $wgScriptPath;\n\n\t\t// TODO This is probably not very portable to non-Unix OS. There's a lot of code in wfShellExec to make\n\t\t// that portable and secure on Windows etc. In any case the existing PHP-based parser calls out to an external script to do \n\t\t// HTML-tidy anyway, in a similar manner, without any shell escapes...\n\t\t$cmd = join( \" \", array( \n\t\t\t$wgVisualEditorParserCmd, \n\t\t\t'--wgScriptPath', wfEscapeShellArg( $wgServer . $wgScriptPath ),\n\t\t) );\n\n\t\t$parserIn = 0;\n\t\t$parserOut = 1;\n\t\t$parserErr = 2;\n\n\t\t$descriptorSpec = array(\n\t\t\t$parserIn => array( 'pipe', 'r' ), // child reads from stdin, we write\n\t\t\t$parserOut => array( 'pipe', 'w' ), // child writes to stdout, we read\n\t\t\t$parserErr => array( 'pipe', 'w' ) // child writes to stderr, we read\n\t\t);\n\n\t\t$pipes = array();\n\n\t\t$process = proc_open( $cmd, $descriptorSpec, $pipes );\n\n\t\t$ret = array( 'contents' => null );\n\n\t\tif ( is_resource( $process ) ) {\n\t\t\t// Theoretically, this style of communication could cause a deadlock\n\t\t\t// here. If the stdout buffer fills up, then writes to stdin could\n\t\t\t// block. \n\t\t\t//\n\t\t\t// TODO This might be an opportune time to give the parser all the subtemplates it's going to need,\n\t\t\t// such that we can. The DB does have a mapping of title to templates used.\n\t\t\t// Would need a convention for indicating multiple files in the text we write to the parser, like mime multipart\n\t\t\tfwrite( $pipes[$parserIn], $text );\n\t\t\tfclose( $pipes[$parserIn] );\n\t\t\n\t\t\t$ret['contents'] = FormatJson::decode( self::readFilehandle( $pipes[$parserOut] ) );\n\n\t\t\t$errors = self::readFilehandle( $pipes[$parserErr] );\n\t\t\tif ( $errors != '' and $errors != null ) {\n\t\t\t\t$ret['errors'] = $errors;\n\t\t\t}\n\n\t\t\t$retval = proc_close( $process );\n\t\t\tif ( $retval != 0 ) {\n\t\t\t\twfWarn( \"Parser process returned $retval\" );\n\t\t\t\tif ( !$ret['errors'] ) {\n\t\t\t\t\t$ret['errors'] = 'External parser process returned error code, check server logs';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\twfWarn( \"Unable to start external parser process\" );\n\t\t\t$ret['errors'] = \"Unable to start external parser process, check server logs\";\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function parse()\n {\n return include $this->filePath;\n }", "public function getCode()\n {\n if ( $this->isInternal() ) {\n $code = '/* ' . $this->getName() . ' is an internal function.'\n . ' Therefore the source code is not available. */';\n } else {\n $filename = $this->getFileName();\n\n $start = $this->getStartLine();\n $end = $this->getEndLine();\n\n $offset = $start - 1;\n $length = $end - $start + 1;\n \n $lines = array_slice( file( $filename ), $offset, $length );\n\n if ( strpos( trim( $lines[0] ), 'function' ) !== 0 ) {\n $lines[0] = substr( $lines[0], strpos( $lines[0], 'function' ) );\n }\n\n $code = implode( '', $lines );\n }\n return $code;\n }", "public function staticParse($file)\n {\n $source = file_get_contents($file);\n if( preg_match_all( '/(?:abstract\\s+class|class|interface)\\s+(\\w+)/i' ,$source, $matches ) ) {\n var_dump( $matches ); \n }\n }", "public function getTokenStream();", "public function getParser() {}", "public function getParser() {}", "public function getParser() {}", "function opcache_compile_file($file)\n{\n}", "public static function parseSource($fileOrDirectory, $ignoreAnnotations = false)\n {\n include_once 'PHP/Depend/Parser.php';\n include_once 'PHP/Depend/Builder/Default.php';\n include_once 'PHP/Depend/Code/Filter/Collection.php';\n include_once 'PHP/Depend/Tokenizer/Internal.php';\n include_once 'PHP/Depend/Input/ExcludePathFilter.php';\n include_once 'PHP/Depend/Input/Iterator.php';\n\n if (file_exists($fileOrDirectory) === false) {\n $fileOrDirectory = self::createCodeResourceURI($fileOrDirectory);\n }\n\n if (is_dir($fileOrDirectory)) {\n $it = new PHP_Depend_Input_Iterator(\n new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($fileOrDirectory)\n ),\n new PHP_Depend_Input_ExcludePathFilter(array('.svn'))\n );\n } else {\n $it = new ArrayIterator(array($fileOrDirectory));\n }\n\n $files = array();\n foreach ($it as $file) {\n if (is_object($file)) {\n $files[] = realpath($file->getPathname());\n } else {\n $files[] = $file;\n }\n }\n sort($files);\n\n $builder = new PHP_Depend_Builder_Default();\n\n foreach ($files as $file) {\n $tokenizer = new PHP_Depend_Tokenizer_Internal();\n $tokenizer->setSourceFile($file);\n\n $parser = new PHP_Depend_Parser($tokenizer, $builder);\n if ($ignoreAnnotations === true) {\n $parser->setIgnoreAnnotations();\n }\n\n $parser->parse();\n }\n return $builder->getPackages();\n }", "function libopml_parse_file($filename, $strict = true) {\n\t$file_content = file_get_contents($filename);\n\n\tif ($file_content === false) {\n\t\tthrow new LibOPML_Exception(\n\t\t\t$filename . ' cannot be found'\n\t\t);\n\t}\n\n\treturn libopml_parse_string($file_content, $strict);\n}", "public static function fromFile($file, $c= __CLASS__) {\n $parser= new XMLParser();\n $tree= new $c();\n \n $parser->setCallback($tree);\n $parser->parse(FileUtil::getContents($file));\n\n // Fetch actual encoding from parser\n $tree->setEncoding($parser->getEncoding());\n\n delete($parser);\n return $tree;\n }", "function create_parser() {}", "public function parseFile($filename)\n {\n $this->lexer = new Lexer($filename, Lexer::T_FILE, $this->symbolsTable);\n\t\t\n\t\t// $exprList = array(); \n\t\twhile(($expr = $this->parseExpr()) != null)\n\t\t{\n\t\t\t// $exprList[] = $expr;\n\t\t\tif($expr->getType() != \\library\\ml\\analysis\\Lexer::TT_LAM)\t\n\t \t$expr->interpret($this->symbolsTable, $this->register);\n\t\t}\n\n\t\t//echo '<pre>'.print_r($this->symbolsTable, true).'</pre>';\n }", "public function load(string $file): string;", "public function getTree($tree, $file)\n {\n $migrationName = $this->getMigrationName($file);\n $isMigrationRun = $this->isMigrationRun($migrationName);\n return [\n \"migration\" => $migrationName,\n \"is_run\" => $isMigrationRun,\n \"tree\" => $tree,\n ];\n }", "public function getSource()\n {\n return 'tokens';\n }", "public function reflect(string $file): ReflectionHierarchy;", "static function AnalyzeFile($file) {\n\t\t$completion = -1;\n\t\t$source = @file_get_contents($file);\n\t\tif ($source) {\n\t\t\t$blocks = DocBlock::ParseCode($source);\n\t\t\tif ($blocks !== null) {\n\t\t\t\t$complete = 0;\n\t\t\t\t$pageblock = false;\n\t\t\t\t$total = 0;\n\t\t\t\tforeach($blocks as $block) {\n\t\t\t\t\t$complete += $block->valid ? 1 : 0;\n\t\t\t\t\tif ($block->type == BLOCK_PAGE) $pageblock = true;\n\t\t\t\t\tif ($block->type == BLOCK_PAGE && !$_POST['Dpage']) continue;\n\t\t\t\t\t$total++;\n\t\t\t\t}\n\t\t\t\tif (!$pageblock && $_POST['Dpage']) $total++;\n\t\t\t\t\n\t\t\t\t// Statistics\n\t\t\t\tif ($total > 0) {\n\t\t\t\t\t$completion = round( $complete / $total * 100);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn DocBlock::PrepareBullet($completion,$complete,$total);\n\t}", "public function getSource()\n\t{\n\t\treturn file_get_contents($this->file);\n\t}", "public function parseFile( $filename ) {\n if( $this->isInitialized == false ) throw new GPTParserException( \"GPT parser not initialized. Call init() first.\" );\n\n $lines = file( $filename, FILE_IGNORE_NEW_LINES );\n\n $this->context = GPTParserContext::get();\n $this->context->Filename = $filename;\n $this->context->Parser = $this;\n\n $this->lastWhitespace = 0;\n $this->scopes = array();\n\n $this->rootNodes = array();\n\n // Iterate over all lines\n foreach( $lines as $lineNumber => $line ) {\n $this->internalParse( $lineNumber, $line );\n }\n\n $result = \"\";\n\n // Render result\n foreach( $this->rootNodes as $rootNode ) {\n $result .= $rootNode->render( $this->PostProcessor );\n }\n\n return $result;\n }", "public function myAstShouldContainTheFile($file_path)\n {\n /** @var \\SimpleXMLElement $structure */\n $structure = simplexml_load_file('build/structure.xml');\n if (!$structure->xpath('/project/file[@path=\"'.$file_path.'\"]')) {\n throw new \\Exception(\n \"File not found in structure file:\\n\" . $structure->asXML()\n );\n }\n }", "public function testSimple()\n {\n //$tokenizer->tokenize(__FILE__);\n }", "public function getSource()\n\t{\n\t\treturn $this->token->source;\n\t}", "function ast_dump($ast, int $options = 0) : string {\n if ($ast instanceof ast\\Node) {\n $result = ast\\get_kind_name($ast->kind);\n\n if ($options & AST_DUMP_LINENOS) {\n $result .= \" @ $ast->lineno\";\n if (isset($ast->endLineno)) {\n $result .= \"-$ast->endLineno\";\n }\n }\n\n if (ast\\kind_uses_flags($ast->kind) || $ast->flags != 0) {\n $result .= \"\\n flags: \" . format_flags($ast->kind, $ast->flags);\n }\n if (isset($ast->name)) {\n $result .= \"\\n name: $ast->name\";\n }\n if (isset($ast->docComment)) {\n $result .= \"\\n docComment: $ast->docComment\";\n }\n foreach ($ast->children as $i => $child) {\n $result .= \"\\n $i: \" . str_replace(\"\\n\", \"\\n \", ast_dump($child, $options));\n }\n return $result;\n } else if ($ast === null) {\n return 'null';\n } else if (is_string($ast)) {\n return \"\\\"$ast\\\"\"; \n } else {\n return (string) $ast;\n }\n}", "private function getVisitorCode(ReflectionClass $class): CodeVisitor\n {\n $traverser = new NodeTraverser();\n $visitor = new CodeVisitor();\n $traverser->addVisitor($visitor);\n $fileName = $class->getFileName();\n if (is_bool($fileName)) {\n throw new InvalidSourceClassException(get_class($class));\n }\n\n $file = file_get_contents($fileName);\n if ($file === false) {\n throw new RuntimeException($fileName); // @codeCoverageIgnore\n }\n\n $stmts = $this->parser->parse($file);\n if (is_array($stmts)) {\n $traverser->traverse($stmts);\n }\n\n return $visitor;\n }", "public function getQueryAst()\n {\n return $this->query_ast;\n }", "function phan_output_ast_installation_instructions(): void\n{\n require_once __DIR__ . '/Library/StringUtil.php';\n $ini_path = php_ini_loaded_file() ?: '(php.ini path could not be determined - try creating one at ' . dirname(PHP_BINARY) . '\\\\php.ini as a new empty file, or one based on php.ini.development or php.ini.production)';\n $configured_extension_dir = ini_get('extension_dir');\n $extension_dir = StringUtil::isNonZeroLengthString($configured_extension_dir) ? $configured_extension_dir : '(extension directory could not be determined)';\n $extension_dir = \"'$extension_dir'\";\n $new_extension_dir = dirname(PHP_BINARY) . '\\\\ext';\n if (!is_dir((string)$configured_extension_dir)) {\n $extension_dir .= ' (extension directory does not exist and may need to be changed)';\n }\n if (DIRECTORY_SEPARATOR === '\\\\') {\n if (PHP_VERSION_ID >= 70300 && PHP_VERSION_ID < 80100 || !preg_match('/[a-zA-Z]/', PHP_VERSION)) {\n // e.g. https://windows.php.net/downloads/pecl/releases/ast/1.0.16/php_ast-1.0.16-8.0-nts-vs16-x64.zip for php 8.0, 64-bit non thread safe\n // e.g. https://windows.php.net/downloads/pecl/releases/ast/1.0.16/php_ast-1.0.16-7.4-ts-vc15-x86.zip for php 7.4, 32-bit thread safe\n fprintf(\n STDERR,\n PHP_EOL . \"Windows users can download php-ast from https://windows.php.net/downloads/pecl/releases/ast/%s/php_ast-%s-%s-%s-%s-%s.zip\" . PHP_EOL,\n LATEST_KNOWN_PHP_AST_VERSION,\n LATEST_KNOWN_PHP_AST_VERSION,\n PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION,\n PHP_ZTS ? 'ts' : 'nts',\n PHP_VERSION_ID >= 80000 ? 'vs16' : 'vc15',\n PHP_INT_SIZE == 4 ? 'x86' : 'x64'\n );\n fwrite(STDERR, \"(if that link doesn't work, check https://windows.php.net/downloads/pecl/releases/ast/ )\" . PHP_EOL);\n fwrite(STDERR, \"To install php-ast, add php_ast.dll from the zip to $extension_dir,\" . PHP_EOL);\n } else {\n if (PHP_VERSION_ID < 70300) {\n fwrite(STDERR, \"php-ast 1.0.11 is the minimum php-ast version needed for ast version 85. https://pecl.php.net/package/ast/1.0.11/windows does not supply dlls for php 7.2 because php-ast 1.0.11 was published after security support for php 7.2 was dropped\" . PHP_EOL);\n } else {\n fprintf(STDERR, \"Releases for php %s may not yet be available at https://windows.php.net/downloads/pecl/releases/ast/\" . PHP_EOL, PHP_VERSION);\n }\n fwrite(STDERR, \"To build php-ast from source for Windows, see https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2 and https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2#building_pecl_extensions\" . PHP_EOL);\n }\n fwrite(STDERR, \"Then, enable php-ast by adding the following lines to your php.ini file at '$ini_path'\" . PHP_EOL . PHP_EOL);\n if (!is_dir((string)$configured_extension_dir) && is_dir($new_extension_dir)) {\n fwrite(STDERR, \"extension_dir=$new_extension_dir\" . PHP_EOL);\n }\n fwrite(STDERR, \"extension=php_ast.dll\" . PHP_EOL . PHP_EOL);\n } else {\n fwrite(STDERR, <<<EOT\nphp-ast can be installed in the following ways:\n\n1. Unix (PECL): Run 'pecl install ast' and add extension=ast.so to your php.ini.\n\n2. Unix (Compile): Download https://github.com/nikic/php-ast then compile and install the extension as follows:\n\n cd path/to/php-ast\n phpize\n ./configure\n make\n sudo make install\n\n Additionally, add extension=ast.so to your php.ini file.\n\nEOT\n );\n }\n fwrite(STDERR, \"For more information, see https://github.com/phan/phan/wiki/Getting-Started#installing-dependencies\" . PHP_EOL);\n}", "public function parseFile(string $filename);", "public function from($file) {\n $this->codegen->source= $file ?? '(unknown)';\n return $this;\n }", "function get_content($file) {\n include($file);\n return array($q, $a);\n }", "public function compile(File $file);", "protected function findIdentifier($file)\n {\n\n $code = file_get_contents($file);\n\n // if we could not open the file tell them\n if ($code === false) {\n throw new ParserException(sprintf('Could not open file %s for type inspection.', $file));\n }\n\n // some variables we will need\n $namespace = '';\n $type = '';\n $stuctureName = '';\n\n // get the tokens and their count\n $tokens = @token_get_all($code);\n $count = count($tokens);\n\n // iterate over the current set of tokens and filter out what we found\n for ($i = 0; $i < $count; $i++) {\n if ($tokens[$i][0] == T_NAMESPACE) {\n // we passed the namespace token, lets collect the name\n for ($j = $i; $j < $count; $j++) {\n if ($tokens[$j][0] === T_STRING) {\n // collect all strings and connect them\n $namespace .= '\\\\' . $tokens[$j][1];\n\n } elseif ($tokens[$j] === '{' || $tokens[$j] === ';') {\n // break if we clearly reached the end of the namespace declaration\n break;\n }\n }\n continue;\n\n } elseif ($i > 1\n && $tokens[$i - 2][0] === T_CLASS\n && $tokens[$i - 1][0] === T_WHITESPACE\n && $tokens[$i][0] === T_STRING\n ) {\n if ($this->findAnnotations($file, array(Aspect::ANNOTATION))) {\n $type = 'aspect';\n\n } else {\n $type = 'class';\n }\n\n $stuctureName = $tokens[$i][1];\n break;\n\n } elseif ($i > 1\n && $tokens[$i - 2][0] === T_TRAIT\n && $tokens[$i - 1][0] === T_WHITESPACE\n && $tokens[$i][0] === T_STRING\n ) {\n $type = 'trait';\n $stuctureName = $tokens[$i][1];\n break;\n\n } elseif ($i > 1\n && $tokens[$i - 2][0] === T_INTERFACE\n && $tokens[$i - 1][0] === T_WHITESPACE\n && $tokens[$i][0] === T_STRING\n ) {\n $type = 'interface';\n $stuctureName = $tokens[$i][1];\n break;\n }\n }\n\n // Check what we got and return it accordingly. We will return an ugly array of the sort\n // array(<STRUCTURE_TYPE>, <STRUCTURE_NAME>).\n if (empty($stuctureName)) {\n return false;\n\n } elseif (empty($namespace)) {\n // We got no namespace, so just use the structure name\n return array($type, $stuctureName);\n\n } else {\n // We got both, so combine it.\n return array($type, ltrim($namespace . '\\\\' . $stuctureName, '\\\\'));\n }\n }", "function visitPhpFile(\\SplFileInfo $file, MessageCatalogue $catalogue, array $ast)\r\n {\r\n // TODO: Implement visitPhpFile() method.\r\n }", "public function getSourceFile(): string\n {\n return $this->getStubContents($this->getStubPath(), $this->getStubVariables());\n }", "public function compile($ast) {\n $this->_emitter->emit(\"<?php\", true);\n $this->_emitter->emit('// EMITTER VERSION [' . self::VERSION . ']', true);\n $this->_processStatementBlock($ast);\n /*\n foreach ($ast as $index => $entry) {\n $this->_redirectAST($entry['type'], $entry);\n }\n */\n $this->_emitter->emit(\"?>\", true);\n return $ast;\n }", "public function parse($file)\n {\n return $this->content;\n }", "private function getToken()\n {\n static $srcpos = 0; // current position in the source stream\n static $srclen; // the length of the source stream\n\n $statement = '';\n $token = null;\n if (empty($srclen)) {\n $srclen = strlen($this->source);\n }\n while (is_null($token) && $srcpos < $srclen) {\n $c = $this->source[$srcpos++];\n switch ($c) {\n case self::BEGIN_COMMENT:\n if (substr($this->source, $srcpos - 1, strlen(self::BEGIN_SL_COMMENT)) === self::BEGIN_SL_COMMENT) {\n $statement = self::BEGIN_SL_COMMENT;\n while ($this->source[$srcpos++] !== \"\\n\") {\n $statement .= $this->source[$srcpos];\n }\n $token = $this->createToken($statement);\n } elseif (substr($this->source, $srcpos - 1, strlen(self::BEGIN_ML_COMMENT))\n === self::BEGIN_ML_COMMENT) {\n if (ltrim($statement)) {\n throw new \\Exception('Invalid comment');\n }\n $statement .= $c.$this->source[$srcpos++];\n while (substr($this->source, $srcpos, strlen(self::END_ML_COMMENT))\n !== self::END_ML_COMMENT) {\n $statement .= $this->source[$srcpos++];\n }\n $srcpos += strlen(self::END_ML_COMMENT);\n $token = $this->createToken($statement.self::END_ML_COMMENT);\n } else {\n $statement .= $c;\n }\n break;\n case self::DOUBLE_QUOTE:\n case self::SINGLE_QUOTE:\n $statement .= $c;\n while ($this->source[$srcpos] !== $c) {\n $statement .= $this->source[$srcpos++];\n }\n $statement .= $this->source[$srcpos++];\n break;\n case self::BEGIN_INTERPOLATION:\n $statement .= $c;\n if (substr($this->source, $srcpos - 1, strlen(self::BEGIN_INTERPOLATION_BLOCK))\n === self::BEGIN_INTERPOLATION_BLOCK) {\n while ($this->source[$srcpos] !== self::END_BLOCK) {\n $statement .= $this->source[$srcpos++];\n }\n $statement .= $this->source[$srcpos++];\n }\n break;\n case self::BEGIN_BLOCK:\n case self::END_BLOCK:\n case self::END_STATEMENT:\n $token = $this->createToken($statement.$c);\n if (is_null($token)) {\n $statement = '';\n }\n break;\n default:\n $statement .= $c;\n break;\n }\n }\n\n if (is_null($token)) {\n $srclen = $srcpos = 0;\n }\n\n return $token;\n }", "function GetXMLTree($file) {\n\tif (file_exists($file)) { \n\t\t$data = implode('', file($file));\n\t} else {\n\t\t$data = $file;\n\t}\n\t$data = eregi_replace(\">\".\"[[:space:]]+\".\"<\",\"><\",$data);\n\t$p = xml_parser_create();\n\txml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0);\n\txml_parse_into_struct($p, $data, &$vals, &$index);\n\txml_parser_free($p);\n\t$i = 0;\n\t$tree = array();\n\t$tree[] = array(\n\t\t'tag' => $vals[$i]['tag'],\n\t\t'attributes' => $vals[$i]['attributes'],\n\t\t'value' => $vals[$i]['value'],\n\t\t'children' => GetChildren($vals, $i)\n\t);\n\treturn $tree;\n}", "function runParser($filePath) {\n fileParser($filePath);\n\n fileNumberAdder();\n\n formatPrinter();\n}", "public function createParser();", "public function parse(): array\n {\n $this->parseElement();\n $this->parseChildNodes();\n\n return ['dir' => $this->dir,\n 'includes' => $this->includes,\n 'excludes' => $this->excludes];\n }", "public function load($file) {\n\t\tif ( ! is_readable($file) || is_dir($file) ) {\n\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t\"Missing or invalid file path: ${file}\"\n\t\t\t);\n\t\t}\n\n\t\treturn $this->parse(file_get_contents($file));\n\t}", "protected function parseSourceFile($file_path, &$result = array()) {\n if (false === ($source = file_get_contents($file_path))) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $this->I18n(\"Can't get file content: {{ file }}\", array(\n 'file' => $file_path\n ))));\n return false;\n }\n $path = substr($file_path, strlen(WB_PATH));\n $module = dirname(substr($file_path, strlen(WB_PATH . '/modules/')));\n if (strpos($module, DIRECTORY_SEPARATOR) > 0) $module = substr($module, 0, strpos($module, DIRECTORY_SEPARATOR));\n $file = basename($file_path);\n $tokens = token_get_all($source);\n $matches = array();\n // first run: get only matches for \"I18n\"\n for($i = 0; $i < count($tokens); $i++) {\n if (is_array($tokens[$i]) && (token_name($tokens[$i][0]) == 'T_STRING') &&\n \t\t(($tokens[$i][1] == 'I18n') || ($tokens[$i][1] == 'I18n_Register'))) $matches[] = $i;\n }\n foreach ($matches as $match) {\n $parensis_open = 0;\n $concat = false;\n $text = '';\n $has_content = false;\n for($i = $match; $i < count($tokens); $i++) {\n if ($parensis_open < 1) {\n // first detect the opening parensis!\n if (is_string($tokens[$i]) && ($tokens[$i] == '(')) {\n $parensis_open++;\n }\n }\n else {\n if (is_string($tokens[$i])) {\n // handle strings\n if ($tokens[$i] == ')') {\n $parensis_open--;\n $concat = false;\n if ($parensis_open == 0) break;\n }\n if ($tokens[$i] == '(') {\n $concat = false;\n $parensis_open++;\n }\n if ($has_content && ($tokens[$i] == '.')) {\n $concat = true;\n }\n }\n else {\n // handle tokens\n if (token_name($tokens[$i][0]) == 'T_CONSTANT_ENCAPSED_STRING') {\n if (empty($text)) {\n $item = trim($tokens[$i][1]);\n $text = substr($item, 1, strlen($item) - 2);\n $has_content = true;\n }\n elseif ($concat) {\n $item = trim($tokens[$i][1]);\n $text .= substr($item, 1, strlen($item) - 2);\n }\n }\n }\n }\n }\n if (!empty($text)) {\n $result[] = array(\n 'module' => $module,\n 'path' => $path,\n 'file' => $file,\n 'key' => $text,\n 'line' => $tokens[$match][2]\n );\n }\n }\n return true;\n }", "public static function scanFile($file, DOMDocument $dom = null)\n {\n if (!file_exists($file)) {\n throw new Exception\\InvalidArgumentException(\n \"The file $file specified doesn't exist\"\n );\n }\n return self::scan(file_get_contents($file), $dom);\n }", "function runkit_lint_file($filename)\n{\n}", "function get_php ($filename) {\n ob_start(); \n include($filename);\n $buf = ob_get_contents();\n ob_end_clean(); \n return $buf;\n}", "public function getPMVAST()\n {\n return $this->pMVAST;\n }", "public function compile ();", "public function getSource()\n\t{\n\t\treturn $this->broker->getFileTokens($this->getFileName())->getSourcePart($this->startPosition, $this->endPosition);\n\t}", "function compile ($src);", "function test363() : int {\n return ast\\parse_code(22, []);\n}", "public function parse(): array\n {\n $parsed = [];\n \n foreach ($this->files as $namespace => $path) {\n try {\n $parsed[$namespace] = require $path;\n } catch (\\Exception $e) {}\n }\n \n return $parsed;\n }", "protected function parseFile($file) {\n $ext = pathinfo($file,PATHINFO_EXTENSION);\n $data = null;\n switch($ext){\n case 'xml':\n $_data = X3_File_XML::fromFile($file,true);\n var_dump($_data);exit;\n $data['name'] = (string)$_data->name;\n foreach($_data->fields as $name=>$field){\n $data[$name][0] = $field->type;\n //foreach ($field)\n }\n var_dump($data);exit;\n break;\n case 'json':\n $data = X3_File_JSON::fromFile($file,true);\n break;\n case 'inc':\n case 'php':\n $data = include($file);\n break;\n default:\n throw new X3_Exception(\"Data model file '*.$ext' not supported yet\",500);\n }\n $data = $this->normalizeDataStruct($data);\n return $data;\n }", "private function loadFile(string $file, ?string $root = null): string\n {\n $root = $root ?? Path::getDirectory($file);\n\n $filePath = Path::join($root, $file);\n $fileDirectory = Path::getDirectory($filePath);\n\n if (!$this->filesystem->exists($filePath)) {\n throw new SchemaFileNotFound([\n 'file' => $filePath,\n ]);\n }\n\n $contents = $this->filesystem->get($filePath);\n\n return collect(explode(\"\\n\", $contents))\n ->map(function (string $line) use ($fileDirectory): array {\n if (!Str::startsWith(trim($line), self::INCLUDE_STATEMENT)) {\n return [\n trim($line, \"\\r\"),\n ];\n }\n\n $includedFile = Path::join($fileDirectory, trim(Str::after($line, self::INCLUDE_STATEMENT)));\n\n return $this->loadFilePattern(\n Path::getFilename($includedFile),\n Path::getDirectory($includedFile)\n );\n })\n ->flatten()\n ->join(\"\\n\")\n ;\n }", "public function getEntryPoint(): SolutionFile\n {\n return $this->file;\n }", "public function getParser()\n\t{\n\t\treturn $this->root->parser;\n\t}", "public function get_modified_content() {\n // First of all, get the contents\n $content = $this->get_content();\n\n $ast = $this->ast ?? null;\n\n // Check if has any traverser instruction\n if (!empty($this->node_instructions)) {\n // Prepare the traverser\n $this->apply_node_instructions();\n }\n\n // Check if any traverser was created\n if (!empty($this->traverser)) {\n // Let the traverser perform\n $ast = $this->traverser->traverse($this->get_ast());\n }\n\n // Check if the AST was created\n if (!empty($ast)) {\n // Convert it back to PHP\n $pretty_printer = new \\PhpParser\\PrettyPrinter\\Standard();\n $content = $pretty_printer->printFormatPreserving($ast, $this->ast, $this->tokens);\n\n // Fix some buggy issues with the format preserving\n $content = preg_replace(\"/(function .+?)\\n.+\\{/m\", '$1 {', $content);\n }\n\n return $content;\n }", "protected function sourceOf($tree, $mode= INDENT_DEFAULT) {\n return rtrim($tree->getSource($mode), \"\\n\");\n }", "public function getContents(){\n return file_get_contents($this->source);\n }", "function get_contents(){\r\n\t\t$cmds=array('striptabs','beginnextbuffer','trim');\r\n\t\tglobal $gcontents;\r\n\t\tunset($gcontents);\r\n\t\tif($a=func_get_args()){\r\n\t\t\tforeach($a as $v){\r\n\t\t\t\tif(in_array(strtolower($v),$cmds)){\r\n\t\t\t\t\t$v=strtolower($v);\r\n\t\t\t\t\t$$v=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$gcontents['out']=ob_get_contents();\r\n\t\tif($trim)$gcontents['out']=trim($gcontents['out']).\"\\n\";\r\n\t\tob_end_clean();\r\n\t\tif($striptabs)$gcontents['out']=str_replace(\"\\t\",'',$gcontents['out']);\r\n\t\tif($beginnextbuffer){\r\n\t\t\tob_start();\r\n\t\t}\r\n\t\treturn $gcontents['out'];\r\n\t}", "public function parse()\n {\n $latest_comment = false;\n $in_func = false;\n\n foreach ($this->_tokens as $token) {\n $id = $text = null;\n\n if (is_array($token)) {\n list($id, $text, $line) = $token;\n }\n if (T_WHITESPACE == $id) {\n continue;\n }\n\n if (T_STRING == $id && in_array($text, $this->_functionNames) && !$in_func) {\n $in_func = true;\n $paren_level = -1;\n $args = array();\n $func_name = $text;\n $func_line = $line;\n $func_comment = $latest_comment ? $latest_comment : '';\n\n $just_got_into_func = true;\n $latest_comment = false;\n continue;\n }\n\n if (!$in_func) {\n continue;\n }\n\n if ('(' == $token) {\n $paren_level++;\n\n if (0 == $paren_level) { // start of first argument\n $just_got_into_func = false;\n $current_argument = null;\n $current_argument_is_just_literal = true;\n }\n continue;\n }\n\n if ($just_got_into_func) {\n // there wasn't a opening paren just after the function name -- this means it is not a function\n $in_func = false;\n $just_got_into_func = false;\n }\n\n if (')' == $token) {\n if (0 == $paren_level) {\n $in_func = false;\n $args[] = $current_argument;\n $call = array('name' => $func_name, 'args' => $args, 'line' => $func_line);\n if ($func_comment) {\n $call['comment'] = $func_comment;\n }\n\n $fCall = new FunctionCallMeta($func_name, $args, $func_line, $this->getFilePath());\n $this->add($fCall);\n }\n\n $paren_level--;\n continue;\n }\n\n if (',' == $token && 0 == $paren_level) {\n $args[] = $current_argument;\n $current_argument = null;\n $current_argument_is_just_literal = true;\n continue;\n }\n\n if ((T_CONSTANT_ENCAPSED_STRING == $id || T_LNUMBER == $id || $id == T_DNUMBER || strtolower(\n $text\n ) == 'true' || strtolower($text) == 'false') && $current_argument_is_just_literal\n ) {\n // we can use eval safely, because we are sure $text is just a string literal\n eval('$current_argument = ' . $text . ';');\n continue;\n }\n\n if (strtolower($text) == 'null') {\n $current_argument = 'null';\n $current_argument_is_just_literal = true;\n continue;\n }\n\n $current_argument_is_just_literal = false;\n $current_argument = '{{complex}}';\n }\n }", "public static function fromFile($file)\n {\n if(!\\file_exists($file)) {\n throw new \\Exception(\"Cannot found file {$file}\");\n }\n $lex = \\yaml_parse(file_get_contents($file));\n return self::_generateFromLex($lex);\n }", "public function prog(){\n array_push($this->prog_stack, $this->prog_scope);\n $ID1 = null;\n\n try {\n // runtime/Php/test/Antlr/Tests/grammers/t023scopes.g\n // runtime/Php/test/Antlr/Tests/grammers/t023scopes.g\n {\n $ID1=$this->match($this->input,$this->getToken('ID'),self::$FOLLOW_ID_in_prog34); \n $this->prog_stack[count($this->prog_stack)-1]['name'] = ($ID1!=null?$ID1->getText():null);\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n array_pop($this->prog_stack);\n throw $e;\n }\n array_pop($this->prog_stack);\n\n return ;\n }", "function getPathParser();", "public function parse(string $filePath) : Repository;", "protected function compile()\n\t{\n\t\t$lexer = new Lexer($this->template->getEnvironment());\n\t\t$stream = $lexer->tokenize(file_get_contents($this->filename), basename($this->filename));\n\n\t\t// unique class based on the filename\n\t\t// @todo fix problem with '-' in classes\n\t\t$class = $this->template->getEnvironment()->getCacheFilename($this->filename);\n\t\t$class = 'S' . substr($class, 0, -8) . '_Template';\n\n\t\t// writer object which contains the parsed PHP code\n\t\t$writer = new Writer();\n\t\t$writer->write(\"<?php\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('namespace Spoon\\Template;' . \"\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('/* ' . $this->filename . ' */' . \"\\n\");\n\t\t$writer->write(\"class $class extends Renderer\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\t\t$writer->write('protected function display(array $context)' . \"\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\n\t\t$tags = $this->template->getEnvironment()->getTags();\n\n\t\t$token = $stream->getCurrent();\n\t\twhile(!$stream->isEof())\n\t\t{\n\t\t\tswitch($token->getType())\n\t\t\t{\n\t\t\t\tcase Token::TEXT:\n\t\t\t\t\t$text = new TextNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$text->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::VAR_START:\n\t\t\t\t\t$stream->next();\n\t\t\t\t\t$variable = new VariableNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$variable->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::BLOCK_START:\n\t\t\t\t\t$token = $stream->next();\n\n\t\t\t\t\t// validate tag existence\n\t\t\t\t\tif(!isset($tags[$token->getValue()]))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\tsprintf('There is no such template tag \"%s\"', $token->getValue()),\n\t\t\t\t\t\t\t$token->getLine(),\n\t\t\t\t\t\t\t$this->filename\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$node = new $tags[$token->getValue()]($stream, $this->template->getEnvironment());\n\t\t\t\t\t$node->compile($writer);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($token->getType() !== Token::EOF)\n\t\t\t{\n\t\t\t\t$token = $stream->next();\n\t\t\t}\n\n\t\t\telse break;\n\t\t}\n\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\treturn $writer->getSource();\n\t}", "function showSource($dir, $file)\r\n{\r\n $path = $dir. $file;\r\n\techo '<div>';\r\n echo '<h1>'. $path. '</h1>';\r\n highlight_file($path);\r\n echo '</div>'. \"\\n\";\r\n}", "public function compile() {\n\t\t$file = new CompiledFile();\n\t\treturn array($file);\n\t}", "protected function _getParser() {}", "public function parse(): array\n {\n $parsed = [];\n $iterator = $this->getIterator();\n\n foreach ($iterator as $fileInfo) {\n if ($fileInfo->isDot() || $fileInfo->isDir()) {\n continue;\n }\n\n [$pathname, $filename] = $this->getPathAndFileName($fileInfo);\n\n $parsed[$filename] = require $pathname;\n }\n\n return $parsed;\n }", "public function getContents($file);", "public function resolveCallProvider()\n {\n $simpleNameElement = function (string $functionName): Node {\n return new Node(\n AST_NAME,\n NAME_NOT_FQ,\n ['name' => $functionName]\n );\n };\n\n // Takes an array and turns it into an AST_ARRAY\n $arrayToAst = function (array $array): Node {\n $elements = [];\n\n foreach ($array as $key => $value) {\n $elements[] = new Node(\n AST_ARRAY_ELEM,\n 0,\n [\n 'key' => $key,\n 'value' => $value,\n ]\n );\n }\n\n return new Node(\n AST_ARRAY,\n ARRAY_SYNTAX_SHORT,\n $elements\n );\n };\n\n // Takes a functionname and an array of arguments, and turns that into an AST_CALL Node\n $astCall = function (string $functionName, array $arguments) use ($simpleNameElement, $arrayToAst): Node {\n foreach ($arguments as $i => $argument) {\n if (is_array($argument)) {\n $arguments[$i] = $arrayToAst($argument);\n }\n }\n\n return new Node(\n AST_CALL,\n 0,\n [\n 'expr' => $simpleNameElement($functionName),\n 'args' => new Node(\n AST_ARG_LIST,\n 0,\n $arguments\n )\n ]\n );\n };\n\n return [\n [$astCall('file_get_contents', []), 'originalFile'],\n [$astCall('reset', [['a']]), 'a'],\n [$astCall('youcandoitnot', []), $astCall('youcandoitnot', [])],\n [$astCall('base64_decode', ['aGVuaw==']), 'henk'],\n ];\n }", "function get_contents(){\r\n\t\t$cmds=array('striptabs','beginnextbuffer');\r\n\t\tglobal $gcontents;\r\n\t\tunset($gcontents);\r\n\t\tif($a=func_get_args()){\r\n\t\t\tforeach($a as $v){\r\n\t\t\t\tif(in_array(strtolower($v),$cmds)){\r\n\t\t\t\t\t$v=strtolower($v);\r\n\t\t\t\t\t$$v=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$gcontents['out']=ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\tif($striptabs)$gcontents['out']=str_replace(\"\\t\",'',$gcontents['out']);\r\n\t\tif($beginnextbuffer){\r\n\t\t\tob_start();\r\n\t\t}else{\r\n\t\t\treturn $gcontents['out'];\r\n\t\t}\r\n\t}", "public function path($file = '')\n\t{\n\t\treturn $this->parse($file);\n\t}", "abstract public function getContent($file);", "function getJSON($file){\n\t$data = file_get_contents($file);\n\t\n\tif($data){\n\t\t$decode = json_decode($data, FILE_USE_INCLUDE_PATH);\n\t}\n\telse{\n\t\t$decode = NULL;\n\t}\n\treturn $decode;\n}" ]
[ "0.7130161", "0.6404749", "0.626057", "0.6195941", "0.59012216", "0.58897066", "0.58599913", "0.5745889", "0.56962526", "0.56962526", "0.55929047", "0.55581176", "0.54711765", "0.54660505", "0.5441345", "0.54100645", "0.53430694", "0.53302413", "0.5330153", "0.5283172", "0.5258298", "0.5234798", "0.51420754", "0.5142022", "0.51170635", "0.5099056", "0.5054696", "0.5048872", "0.50327474", "0.50327474", "0.5030865", "0.5025768", "0.5010874", "0.5007116", "0.50005794", "0.49937773", "0.49747387", "0.49713045", "0.49661607", "0.49572885", "0.4939102", "0.4922398", "0.4907837", "0.49050638", "0.4897133", "0.48946744", "0.4869125", "0.4853527", "0.48474026", "0.48378366", "0.48345926", "0.48301485", "0.48278823", "0.4811964", "0.47928703", "0.47852528", "0.47740102", "0.4773649", "0.4746857", "0.4742784", "0.4721788", "0.47216284", "0.4715659", "0.47070792", "0.47037047", "0.46989265", "0.46698326", "0.46679884", "0.46639535", "0.46627456", "0.4661976", "0.46491706", "0.46479833", "0.46433336", "0.46405432", "0.46340916", "0.46178758", "0.46155158", "0.4604591", "0.45990238", "0.4598834", "0.45856288", "0.45830533", "0.45797423", "0.4575307", "0.45696053", "0.45662266", "0.455213", "0.45355353", "0.45342395", "0.45325702", "0.45229676", "0.45213032", "0.4514597", "0.44911763", "0.44834974", "0.44815642", "0.44520557", "0.44478494", "0.4443492" ]
0.76714706
0
Convert the AST to a PHP Code
function astToCode($ast){ $prettyPrinter = new PrettyPrinter\Standard; echo $prettyPrinter->prettyPrintFile($ast); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lapa_compiler_php_code($act, $parser)\n{\n if ($act == 1) {\n $buff = '';\n if (!isset(LapaEngineParser::$_plugins_property['php_code'])) {\n LapaEngineParser::$_plugins_property['php_code'] = array();\n }\n $attr = $parser->parseDirectiveAttributes();\n $name = isset($attr['name']) ? $attr['name']: 'default';\n $parser->newStackCommand(array('php_code', $name));\n $parser->_outputNew();\n }else {\n if ( (!$stack_commands = $parser->getStackCommand() ) || $stack_commands[0] != 'php_code' ) {\n throw new LapaEngineException('Неверный вызов \"/php_code\" cтрока %s.', $parser->templateLine());\n }\n /* вырезали буффер php кода, его надо еще вернуть */\n $buff = $parser->_outputGet();\n /* создаем переменную с значением */ \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n $buff .= \"\\$_var_php_code['{$stack_commands[1]}'] = '\" . preg_replace(\"/(?!\\\\\\\\)\\\\'/\", '\\\\\\'','<?php ' . str_replace('\\\\', '\\\\\\\\',$buff) . ' ?>') . \"';\"; \n $parser->removeStackCommand(); \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n }\n return $buff;\n}", "public function compile($ast) {\n $this->_emitter->emit(\"<?php\", true);\n $this->_emitter->emit('// EMITTER VERSION [' . self::VERSION . ']', true);\n $this->_processStatementBlock($ast);\n /*\n foreach ($ast as $index => $entry) {\n $this->_redirectAST($entry['type'], $entry);\n }\n */\n $this->_emitter->emit(\"?>\", true);\n return $ast;\n }", "public function compile($ast) {\n /* FILE HEADER */\n $this->_emitter\n ->emit(['<?php', '// EMITTER VERSION [' . self::VERSION . ']'])\n ->flush();\n\n /* FILE BODY */\n $this->_processStatementBlock($ast);\n\n /* FILE FOOTER */\n $this->_emitter\n ->emit(\"?>\")\n ->flush();\n return $ast;\n }", "function getAst($file){\n $fileRes=fopen(\"fileRes.txt\",\"w\");\n $code=file_get_contents($file);\n $parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7);\n try {\n $ast = $parser->parse($code);\n } catch (Error $error) {\n echo \"Parse error: {$error->getMessage()}\\n\";\n return;\n }\n $dumper = new NodeDumper;\n echo $dumper->dump($ast) . \"\\n\";\n fwrite($fileRes, $dumper->dump($ast) . \"\\n\");\n fclose($fileRes);\n }", "function test363() : int {\n return ast\\parse_code(22, []);\n}", "public function visitPhpCodeAstNode( ezcTemplatePhpCodeAstNode $code )\n {\n $this->write( $code->code );\n }", "public function getAst()\n {\n return $this->ast;\n }", "public function getAST(): PhpParser\\Node\n {\n return $this->ast ?? ($this->ast = CompatibleParser::create()->parseSourceFile($this->contents));\n }", "public function get_ast() {\n // Check if no AST is yet loaded\n if (empty($this->ast)) {\n try {\n $lexer = new \\PhpParser\\Lexer\\Emulative([\n \"usedAttributes\" => [\n \"comments\",\n \"startLine\", \"endLine\",\n \"startTokenPos\", \"endTokenPos\"\n ]\n ]);\n\n // Create a new PHP parser\n $parser = new \\PhpParser\\Parser\\Php7($lexer);\n\n // Try creating the AST parser\n $this->ast = $parser->parse($this->get_content());\n\n // Save the tokens\n $this->tokens = $lexer->getTokens();\n } catch(\\PhpParser\\Error $e) {\n \\Lily\\Console::error(\"An error ocurred while parsing an AST:\", $e->getMessage());\n return null;\n }\n }\n\n return $this->ast;\n }", "function phan_output_ast_installation_instructions(): void\n{\n require_once __DIR__ . '/Library/StringUtil.php';\n $ini_path = php_ini_loaded_file() ?: '(php.ini path could not be determined - try creating one at ' . dirname(PHP_BINARY) . '\\\\php.ini as a new empty file, or one based on php.ini.development or php.ini.production)';\n $configured_extension_dir = ini_get('extension_dir');\n $extension_dir = StringUtil::isNonZeroLengthString($configured_extension_dir) ? $configured_extension_dir : '(extension directory could not be determined)';\n $extension_dir = \"'$extension_dir'\";\n $new_extension_dir = dirname(PHP_BINARY) . '\\\\ext';\n if (!is_dir((string)$configured_extension_dir)) {\n $extension_dir .= ' (extension directory does not exist and may need to be changed)';\n }\n if (DIRECTORY_SEPARATOR === '\\\\') {\n if (PHP_VERSION_ID >= 70300 && PHP_VERSION_ID < 80100 || !preg_match('/[a-zA-Z]/', PHP_VERSION)) {\n // e.g. https://windows.php.net/downloads/pecl/releases/ast/1.0.16/php_ast-1.0.16-8.0-nts-vs16-x64.zip for php 8.0, 64-bit non thread safe\n // e.g. https://windows.php.net/downloads/pecl/releases/ast/1.0.16/php_ast-1.0.16-7.4-ts-vc15-x86.zip for php 7.4, 32-bit thread safe\n fprintf(\n STDERR,\n PHP_EOL . \"Windows users can download php-ast from https://windows.php.net/downloads/pecl/releases/ast/%s/php_ast-%s-%s-%s-%s-%s.zip\" . PHP_EOL,\n LATEST_KNOWN_PHP_AST_VERSION,\n LATEST_KNOWN_PHP_AST_VERSION,\n PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION,\n PHP_ZTS ? 'ts' : 'nts',\n PHP_VERSION_ID >= 80000 ? 'vs16' : 'vc15',\n PHP_INT_SIZE == 4 ? 'x86' : 'x64'\n );\n fwrite(STDERR, \"(if that link doesn't work, check https://windows.php.net/downloads/pecl/releases/ast/ )\" . PHP_EOL);\n fwrite(STDERR, \"To install php-ast, add php_ast.dll from the zip to $extension_dir,\" . PHP_EOL);\n } else {\n if (PHP_VERSION_ID < 70300) {\n fwrite(STDERR, \"php-ast 1.0.11 is the minimum php-ast version needed for ast version 85. https://pecl.php.net/package/ast/1.0.11/windows does not supply dlls for php 7.2 because php-ast 1.0.11 was published after security support for php 7.2 was dropped\" . PHP_EOL);\n } else {\n fprintf(STDERR, \"Releases for php %s may not yet be available at https://windows.php.net/downloads/pecl/releases/ast/\" . PHP_EOL, PHP_VERSION);\n }\n fwrite(STDERR, \"To build php-ast from source for Windows, see https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2 and https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2#building_pecl_extensions\" . PHP_EOL);\n }\n fwrite(STDERR, \"Then, enable php-ast by adding the following lines to your php.ini file at '$ini_path'\" . PHP_EOL . PHP_EOL);\n if (!is_dir((string)$configured_extension_dir) && is_dir($new_extension_dir)) {\n fwrite(STDERR, \"extension_dir=$new_extension_dir\" . PHP_EOL);\n }\n fwrite(STDERR, \"extension=php_ast.dll\" . PHP_EOL . PHP_EOL);\n } else {\n fwrite(STDERR, <<<EOT\nphp-ast can be installed in the following ways:\n\n1. Unix (PECL): Run 'pecl install ast' and add extension=ast.so to your php.ini.\n\n2. Unix (Compile): Download https://github.com/nikic/php-ast then compile and install the extension as follows:\n\n cd path/to/php-ast\n phpize\n ./configure\n make\n sudo make install\n\n Additionally, add extension=ast.so to your php.ini file.\n\nEOT\n );\n }\n fwrite(STDERR, \"For more information, see https://github.com/phan/phan/wiki/Getting-Started#installing-dependencies\" . PHP_EOL);\n}", "public function getAst() {\n\t\t\treturn \"<p>Ast: \".$this->ast.\"</p>\";\n\t\t}", "abstract public function toPhp();", "private function apply_node_instructions() {\n // Add a new node visitor to the traverser\n $this->get_traverser()->addVisitor(new class($this) extends \\PhpParser\\NodeVisitorAbstract {\n public function __construct($file) {\n $this->file = $file;\n }\n\n /**\n * Applies all instructions to a node for a given type\n *\n * @param string $type The instruction type to be applied\n * @param \\PhpParser\\Node $node The node to be actioned\n * @return \\PhpParser\\Node\n */\n private function apply_instructions(string $type, \\PhpParser\\Node $node): \\PhpParser\\Node {\n // Retrieve all instructions by type\n $instructions = $this->file->get_instructions($type);\n\n // Check if has no leave instructions\n if (empty($instructions)) {\n return $node;\n }\n\n // Iterate over all instructions\n foreach($instructions as $instruction) {\n // Get the node type\n $instruction_node = $instruction->node;\n\n // Check if it's not the same as the current node\n if (!($node instanceof $instruction_node)) {\n continue;\n }\n\n // Extract the parameters\n $if = (array) $instruction->if;\n $do = (array) $instruction->do;\n\n // Check for all instructions\n foreach($if as $index => $cnd) {\n // Variable that will later handle if the condition was met\n $condition = false;\n\n // Check if condition is a callback\n if (is_callable($cnd)) {\n // Try matching it with the current node\n $condition = call_user_func_array($cnd, [$node]);\n } else {\n // Retrieve the index value\n $node_index = $node->{$index};\n\n // Check if the condition value is a string, and node index has a toString() method\n if (is_string($cnd[1]) && is_callable([$node_index, \"toString\"])) {\n // Call it\n $node_index = $node_index->toString();\n }\n\n // Evaluate the condition\n eval(\"\\$condition = \\$node_index \" . $cnd[0] . \" \" . escapeshellarg($cnd[1]) . \";\");\n }\n\n // Check if the condition was not met\n if (!$condition) {\n // Assert the failed condition\n $instruction->do_assertion(File\\Instruction::ASSERT_FAILED_CONDITION_NOT_MET, null);\n\n // Break the instruction\n break 2;\n }\n }\n\n // Do all instructions\n foreach($do as $action) {\n // Check if it's callable\n if (is_callable($action)) {\n // Just call the action\n call_user_func_array($action, [$node]);\n continue;\n }\n\n // Extract the action name\n $action_name = $action[\"action\"];\n unset($action[\"action\"]);\n\n // Check if is settings variables\n if ($action_name === \"set\") {\n // Iterate over all variables\n foreach($action[\"vars\"] ?? $action[\"variables\"] as $var => $value) {\n // Set the node variable value\n $node->{$var} = $value;\n }\n }\n }\n }\n\n return $node;\n }\n\n public function leaveNode(\\PhpParser\\Node $node) {\n return $this->apply_instructions(\"leave\", $node);\n }\n\n public function enterNode(\\PhpParser\\Node $node) {\n return $this->apply_instructions(\"enter\", $node);\n }\n });\n }", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function compile ();", "public function compile(Compiler $compiler, Node $node);", "public function testParsingPhpExpression()\n {\n $tokens = [\n new Token(TokenTypes::T_PHP_TAG_OPEN, '<?php', 1),\n new Token(TokenTypes::T_EXPRESSION, 'echo \"foo\";', 1),\n new Token(TokenTypes::T_PHP_TAG_CLOSE, '?>', 1)\n ];\n $this->ast->getCurrentNode()\n ->addChild(new ExpressionNode('<?php'))\n ->addChild(new ExpressionNode('echo \"foo\";'))\n ->addChild(new ExpressionNode('?>'));\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function toPhp();", "function code ( $arguments = \"\" ) {\n $arguments = func_get_args ();\n $rc = new ReflectionClass('tcode');\n return $rc->newInstanceArgs ( $arguments );\n}", "public function printAST($ast)\n {\n }", "public function convert()\n {\n $cFunctionCallIndexes = array();\n\n $classMap = $this->getClassMap();\n\n $cSourceCodeMap = array();\n\n foreach($classMap as $className => $classInfo) {\n for ($index = $classInfo->startLine; $index <= $classInfo->endLine; $index++) {\n if (preg_match(\"/call_c_function\\(.*\\)/\", $this->codeLines[$index], $matches)) {\n if(count($matches) == 1) {\n $codeLine = str_replace(array(\"call_c_function\",\"(\",\")\",\";\",\"$\"),\"\",trim($this->codeLines[$index]));\n $lineComps = explode(\"=\",$codeLine);\n $lineCompsCount = count($lineComps);\n $resultVarName = \"\";\n if ($lineCompsCount == 1) { //this means we just call the c function and do not have a return variable\n $cFunctionCallComps = explode(\",\",$lineComps[0]);\n $cFunctionCallComps = explode(\",\",$lineComps[1]);\n foreach($cFunctionCallComps as $idx => $comp) {\n $cFunctionCallComps[$idx] = trim(str_replace(\"$\",\"\",$cFunctionCallComps[$idx]));\n }\n } else if ($lineCompsCount > 1) { //this means we call the c function and then store the result in a return variable \n $resultVarName = trim(str_replace(\"$\",\"\",$lineComps[0]));\n $cFunctionCallComps = explode(\",\",$lineComps[1]);\n foreach($cFunctionCallComps as $idx => $comp) {\n $cFunctionCallComps[$idx] = trim(str_replace(\"$\",\"\",$cFunctionCallComps[$idx]));\n }\n }\n\n if (count($cFunctionCallComps) > 0) {\n $firstComp = array_shift($cFunctionCallComps);\n $cSourceFile = str_replace(array(\"'\",'\"'),\"\",$firstComp);\n $secondComp = array_shift($cFunctionCallComps);\n $cFUnctionName = str_replace(array(\"'\",'\"'),\"\",$secondComp);\n $cFUnctionInputParamsStr = \"\";\n if (count($cFunctionCallComps) > 0) {\n $cFUnctionInputParamsStr = implode(\", \",$cFunctionCallComps); \n }\n\n $cFunctionCallCode = \"\";\n $cFunctionCallCode .= \"let $resultVarName = null;\\n\"; //initialize result var\n $cFunctionCallCode .= \"\\n%{\\n\";\n if (strlen($resultVarName) == 0) {\n $cFunctionCallCode .= $cFUnctionName.\"($cFUnctionInputParamsStr);\"; \n } else {\n $cFunctionCallCode .= \"$resultVarName = \".$cFUnctionName.\"($cFUnctionInputParamsStr);\";\n }\n $cFunctionCallCode .= \"\\n}%\\n\";\n\n $expectedZephirCode = 'let '.$resultVarName.' = call_c_function('.$firstComp.', '.$secondComp.', '.implode(\", \",$cFunctionCallComps).');';\n $this->postSearchAndReplace($expectedZephirCode,$cFunctionCallCode);\n\n //now, inject the c source code to the top of the class \n $namespace = $classInfo->namespace;\n $classPureName = array_pop(explode(\"\\\\\",$className));\n $originalCode = \"namespace $namespace;\\n\\n\".\"class $classPureName\\n\";\n if (!isset($cSourceCodeMap[$cSourceFile])) {\n $cSourceCode = file_get_contents($this->inputDir.\"/\".$cSourceFile);\n $cSourceCodeMap[$cSourceFile] = $cSourceCode;\n $withCSourceCode = \"%{\\n\".$cSourceCodeMap[$cSourceFile].\"\\n}%\\n\".$originalCode; \n $this->postSearchAndReplace($originalCode, $withCSourceCode);\n }\n }\n\n }\n\n }\n }\n\n }\n }", "public static function markupToPHP($content) {\n\t\tif ($content instanceof phpQueryObject)\n\t\t\t$content = $content->markupOuter();\n\t\t/* <php>...</php> to <?php...? > */\n\t\t$content = preg_replace_callback(\n\t\t\t'@<php>\\s*<!--(.*?)-->\\s*</php>@s',\n//\t\t\tcreate_function('$m',\n//\t\t\t\t'return \"<'.'?php \".htmlspecialchars_decode($m[1]).\" ?'.'>\";'\n//\t\t\t),\n\t\t\tarray('phpQuery', '_markupToPHPCallback'),\n\t\t\t$content\n\t\t);\n\t\t/* <node attr='< ?php ? >'> extra space added to save highlighters */\n\t\t$regexes = array(\n\t\t\t'@(<(?!\\\\?)(?:[^>]|\\\\?>)+\\\\w+\\\\s*=\\\\s*)(\\')([^\\']*)(?:&lt;|%3C)\\\\?(?:php)?(.*?)(?:\\\\?(?:&gt;|%3E))([^\\']*)\\'@s',\n\t\t\t'@(<(?!\\\\?)(?:[^>]|\\\\?>)+\\\\w+\\\\s*=\\\\s*)(\")([^\"]*)(?:&lt;|%3C)\\\\?(?:php)?(.*?)(?:\\\\?(?:&gt;|%3E))([^\"]*)\"@s',\n\t\t);\n\t\tforeach($regexes as $regex)\n\t\t\twhile (preg_match($regex, $content))\n\t\t\t\t$content = preg_replace_callback(\n\t\t\t\t\t$regex,\n\t\t\t\t\tcreate_function('$m',\n\t\t\t\t\t\t'return $m[1].$m[2].$m[3].\"<?php \"\n\t\t\t\t\t\t\t.str_replace(\n\t\t\t\t\t\t\t\tarray(\"%20\", \"%3E\", \"%09\", \"&#10;\", \"&#9;\", \"%7B\", \"%24\", \"%7D\", \"%22\", \"%5B\", \"%5D\"),\n\t\t\t\t\t\t\t\tarray(\" \", \">\", \"\t\", \"\\n\", \"\t\", \"{\", \"$\", \"}\", \\'\"\\', \"[\", \"]\"),\n\t\t\t\t\t\t\t\thtmlspecialchars_decode($m[4])\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.\" ?>\".$m[5].$m[2];'\n\t\t\t\t\t),\n\t\t\t\t\t$content\n\t\t\t\t);\n\t\treturn $content;\n\t}", "public function getCode() {\n return $this->parse()['code'];\n }", "public function convert()\n\t{\n\t\t$pattern1 = \"/\\/php>/siU\";\n\t\t$replace1 = \"/runphp>\";\n\t\t$pattern2 = \"/\\<php/siU\";\n\t\t$replace2 = \"<runphp\";\n\t\n\t\t$result1 = preg_replace($pattern1, $replace1, $this->content);\n\t\t$this->content = preg_replace($pattern2, $replace2, $result1);\n\t}", "private function getVisitorCode(ReflectionClass $class): CodeVisitor\n {\n $traverser = new NodeTraverser();\n $visitor = new CodeVisitor();\n $traverser->addVisitor($visitor);\n $fileName = $class->getFileName();\n if (is_bool($fileName)) {\n throw new InvalidSourceClassException(get_class($class));\n }\n\n $file = file_get_contents($fileName);\n if ($file === false) {\n throw new RuntimeException($fileName); // @codeCoverageIgnore\n }\n\n $stmts = $this->parser->parse($file);\n if (is_array($stmts)) {\n $traverser->traverse($stmts);\n }\n\n return $visitor;\n }", "public function getAST($content)\n {\n try {\n return $this->parser->parse($content);\n } catch (Error $error) {\n echo \"Parse error: {$error->getMessage()}\\n\";\n return;\n }\n }", "public function testTransformPhpArrayToStatementArray()\n {\n $result = $this->fixture->transformPhpArrayToStatementArray(\n $this->testGraph,\n array(\n 'http://foo/' => 'http://foo/Person',\n 'http://foo/1' => array(\n array(\n 'http://bar/1' => 'http://baz/1',\n 'http://bar/2' => 'http://baz/1',\n 'http://bar/3' => 'literal1'\n ),\n array(\n 'http://bar/4' => 'http://baz/2',\n 'http://bar/5' => 'http://baz/2',\n 'http://bar/6' => 'literal2'\n )\n ),\n 'http://foo/2' => array(\n 'http://bar/7' => 'http://baz/3',\n 'http://bar/8' => 'http://baz/3',\n 'http://bar/9' => 'literal3'\n ),\n )\n );\n\n $this->assertEquals(\n array(\n // block 1\n $this->statementFactory->createStatement(\n $result[0]->getSubject(),\n $this->nodeFactory->createNamedNode('http://bar/7'),\n $this->nodeFactory->createNamedNode('http://baz/3')\n ),\n $this->statementFactory->createStatement(\n $result[0]->getSubject(),\n $this->nodeFactory->createNamedNode('http://bar/8'),\n $this->nodeFactory->createNamedNode('http://baz/3')\n ),\n $this->statementFactory->createStatement(\n $result[0]->getSubject(),\n $this->nodeFactory->createNamedNode('http://bar/9'),\n $this->nodeFactory->createLiteral('literal3')\n ),\n // block 2\n $this->statementFactory->createStatement(\n $result[4]->getSubject(),\n $this->nodeFactory->createNamedNode('http://bar/4'),\n $this->nodeFactory->createNamedNode('http://baz/2')\n ),\n $this->statementFactory->createStatement(\n $result[4]->getSubject(),\n $this->nodeFactory->createNamedNode('http://bar/5'),\n $this->nodeFactory->createNamedNode('http://baz/2')\n ),\n $this->statementFactory->createStatement(\n $result[4]->getSubject(),\n $this->nodeFactory->createNamedNode('http://bar/6'),\n $this->nodeFactory->createLiteral('literal2')\n ),\n // block 3\n $this->statementFactory->createStatement(\n $result[6]->getSubject(),\n $this->nodeFactory->createNamedNode('http://bar/1'),\n $this->nodeFactory->createNamedNode('http://baz/1')\n ),\n $this->statementFactory->createStatement(\n $result[6]->getSubject(),\n $this->nodeFactory->createNamedNode('http://bar/2'),\n $this->nodeFactory->createNamedNode('http://baz/1')\n ),\n $this->statementFactory->createStatement(\n $result[6]->getSubject(),\n $this->nodeFactory->createNamedNode('http://bar/3'),\n $this->nodeFactory->createLiteral('literal1')\n ),\n // block 4\n $this->statementFactory->createStatement(\n $this->testGraph,\n $this->nodeFactory->createNamedNode('http://foo/'),\n $this->nodeFactory->createNamedNode('http://foo/Person')\n ),\n $this->statementFactory->createStatement(\n $this->testGraph,\n $this->nodeFactory->createNamedNode('http://foo/1'),\n $result[6]->getSubject()\n ),\n $this->statementFactory->createStatement(\n $this->testGraph,\n $this->nodeFactory->createNamedNode('http://foo/1'),\n $result[4]->getSubject()\n ),\n $this->statementFactory->createStatement(\n $this->testGraph,\n $this->nodeFactory->createNamedNode('http://foo/2'),\n $result[0]->getSubject()\n ),\n ),\n $result\n );\n }", "static function php_compiler ($space, $html)\n {\n return \"<?php\\n$space$html?>\";\n }", "public function decode()\n {\n $this->get_token();\n $this->token = strtoupper($this->token);\n\n switch($this->token)\n {\n case \"RETURN\":\n $this->stats->add_jump();\n case \"CREATEFRAME\":\n case \"PUSHFRAME\":\n case \"POPFRAME\":\n case \"BREAK\":\n return Instructions::zeroParams;\n \n case \"DEFVAR\":\n case \"POPS\":\n return Instructions::oneParamV;\n\n case \"LABEL\":\n $this->stats->add_label($this->buffer);\n return Instructions::oneParamL; \n\n case \"JUMP\":\n case \"CALL\":\n $this->stats->add_jump();\n return Instructions::oneParamL;\n\n case \"PUSHS\":\n case \"WRITE\":\n case \"EXIT\":\n case \"DPRINT\":\n return Instructions::oneParamS;\n\n case \"MOVE\":\n case \"INT2CHAR\":\n case \"STRLEN\":\n case \"TYPE\":\n case \"NOT\":\n return Instructions::twoParamVS;\n \n case \"READ\":\n return Instructions::twoParamVT;\n \n case \"ADD\":\n case \"SUB\":\n case \"MUL\":\n case \"IDIV\":\n case \"LT\":\n case \"GT\":\n case \"EQ\":\n case \"AND\":\n case \"OR\":\n case \"STRI2INT\":\n case \"CONCAT\":\n case \"GETCHAR\":\n case \"SETCHAR\":\n return Instructions::threeParamVSS;\n \n case \"JUMPIFEQ\":\n case \"JUMPIFNEQ\":\n $this->stats->add_jump();\n return Instructions::threeParamLSS;\n \n case Instructions::EOF:\n return Instructions::EOF;\n\n default:\n return Instructions::unknownFun;\n }\n\n }", "public function get_ast_root() {\n return $this->ast_root;\n }", "public function getPMVAST()\n {\n return $this->pMVAST;\n }", "public static function expr()\n {\n $out = call_user_func_array('self::parse', func_get_args());\n $obj = text($out);\n return $obj;\n }", "public function insertPhpCode($code)\n {\n $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code));\n }", "public function evalFile(string $src): CompiledFile;", "function ast_dump($ast, int $options = 0) : string {\n if ($ast instanceof ast\\Node) {\n $result = ast\\get_kind_name($ast->kind);\n\n if ($options & AST_DUMP_LINENOS) {\n $result .= \" @ $ast->lineno\";\n if (isset($ast->endLineno)) {\n $result .= \"-$ast->endLineno\";\n }\n }\n\n if (ast\\kind_uses_flags($ast->kind) || $ast->flags != 0) {\n $result .= \"\\n flags: \" . format_flags($ast->kind, $ast->flags);\n }\n if (isset($ast->name)) {\n $result .= \"\\n name: $ast->name\";\n }\n if (isset($ast->docComment)) {\n $result .= \"\\n docComment: $ast->docComment\";\n }\n foreach ($ast->children as $i => $child) {\n $result .= \"\\n $i: \" . str_replace(\"\\n\", \"\\n \", ast_dump($child, $options));\n }\n return $result;\n } else if ($ast === null) {\n return 'null';\n } else if (is_string($ast)) {\n return \"\\\"$ast\\\"\"; \n } else {\n return (string) $ast;\n }\n}", "function _phpCodeHandler($data)\r\n {\r\n if (preg_match('/\\s*^php:(.+)/', $data, $matches)) {\r\n $keys = array_keys($GLOBALS);\r\n foreach ($keys as $key) {\r\n $$key =& $GLOBALS[$key];\r\n }\r\n return (string) eval($matches[1].';');\r\n }\r\n return $data;\r\n }", "public function pass_6()\n\t{\n\t\t$tokens = token_get_all($this->source[$this->last_pass]);\n\t\t$token_count = count($tokens);\n\t\t$tp = 0;\n\t\t$tokens_to_patch = array('T_FUNCTION');\n\t\t$last_class = '';\n\t\twhile($tp < $token_count) {\n\t\t\t$token_name = $this->token_name($tokens[$tp]);\n\t\t\tif($token_name == 'T_NAMESPACE') $current_namespace = $this->token_content($tokens[$this->get_next_non_comment($tokens,$tp+1)]);\n\t\t\tif($token_name == 'T_CLASS') {\n\t\t\t$last_class = $this->token_content($tokens[$this->get_next_non_comment($tokens,$tp+1)]);\n\t\t\tif(isset($current_namespace)) $last_class = $current_namespace.\"\\\\\".$last_class;\n\t\t\t}\n\t\t\tif(in_array($token_name, $tokens_to_patch )) {\n\t\t\t\tif($blockstart = $this->search_token($tokens,$tp,'{',array(';'))) {\n\t\t\t\t\t $function_name_tp = $this->get_next_non_comment($tokens,$tp+1);\n\t\t\t\t\t if(!is_array($tokens[$function_name_tp])) \n\t\t\t\t\t\t $function_name_tp = $this->get_next_non_comment($tokens,$function_name_tp+1);\n\t\t\t\t\t $function_name = $tokens[$function_name_tp][1];\n\t\t\t\t\t if(!Analyzer::shouldpatch($function_name,$last_class)) {\n\t\t\t\t\t \t$tp++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t }\n\t\t\t\t\t //Analyzer::$instancenumberfor[$function_name] = 0;\n\t\t\t\t\t $this->add_tokens_to_be_inserted_after($blockstart+1,\"\",0);\n\t\t\t\t\t $blockend = $this->get_pair($tokens,$blockstart);\n\t\t\t\t\t $children = $this->get_children_from($tokens,$blockstart,$blockend,0,$temp,true);\n\t\t\t\t\t //Analyzer::$possiblebranches[$function_name] = $children->getPaths();\n\t\t\t\t}\n\t\t\t} \n\t\t\t\t\n\t\t\t$tp++;\n\t\t}\n\t\t$this->source[$this->current_pass] = $this->change_stuff();\n\t}", "abstract protected function mapCode( $code );", "public function setQueryAst($var)\n {\n GPBUtil::checkString($var, True);\n $this->query_ast = $var;\n\n return $this;\n }", "function getOutputCode() {\n\t\t\t\n\t\t$_bckOutputCode=$this->outputCode;\n\t\t$this->outputCode=\"\";\n\t\tfor ($in=0;$in<$this->indent; $in++) {\n\t\t\t$this->outputCode.=\"\";\n\t\t}\n\t\t$this->indent++;\n\t\t$this->outputCode.=$_bckOutputCode;\n\n\t\tfor ($childIdx=0; $childIdx<count($this->child); $childIdx++) {\n\t\t\tif (is_object($this->child[$childIdx])) {\n\t\t\t\t$theChild=$this->child[$childIdx];\n\t\t\t\tif (is_object($theChild)) {\n\t\t\t\t\t$theChild->indent=$this->indent;\n\t\t\t\t\t$this->outputCode.=$theChild->getOutputCode();\n\t\t\t\t} else {\n\t\t\t\t\t$this->outputCode.=$theChild;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$ind=$this->indent;\n\t\t$ind--;\n\t\t$this->indent=$ind;\n\t\t$this->CloseTag();\n\t\treturn $this->outputCode;\n\t}", "public function parse(): PhpCss\\Ast\\Node {\n }", "public function parseStatement()\n {\n\n }", "static public function code($content, $attributes=array()) {\n return self::content('code', $content, $attributes);\n }", "public function compile(Twig_Compiler $compiler);", "protected function compile()\n\t{\n\t\t$lexer = new Lexer($this->template->getEnvironment());\n\t\t$stream = $lexer->tokenize(file_get_contents($this->filename), basename($this->filename));\n\n\t\t// unique class based on the filename\n\t\t// @todo fix problem with '-' in classes\n\t\t$class = $this->template->getEnvironment()->getCacheFilename($this->filename);\n\t\t$class = 'S' . substr($class, 0, -8) . '_Template';\n\n\t\t// writer object which contains the parsed PHP code\n\t\t$writer = new Writer();\n\t\t$writer->write(\"<?php\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('namespace Spoon\\Template;' . \"\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('/* ' . $this->filename . ' */' . \"\\n\");\n\t\t$writer->write(\"class $class extends Renderer\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\t\t$writer->write('protected function display(array $context)' . \"\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\n\t\t$tags = $this->template->getEnvironment()->getTags();\n\n\t\t$token = $stream->getCurrent();\n\t\twhile(!$stream->isEof())\n\t\t{\n\t\t\tswitch($token->getType())\n\t\t\t{\n\t\t\t\tcase Token::TEXT:\n\t\t\t\t\t$text = new TextNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$text->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::VAR_START:\n\t\t\t\t\t$stream->next();\n\t\t\t\t\t$variable = new VariableNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$variable->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::BLOCK_START:\n\t\t\t\t\t$token = $stream->next();\n\n\t\t\t\t\t// validate tag existence\n\t\t\t\t\tif(!isset($tags[$token->getValue()]))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\tsprintf('There is no such template tag \"%s\"', $token->getValue()),\n\t\t\t\t\t\t\t$token->getLine(),\n\t\t\t\t\t\t\t$this->filename\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$node = new $tags[$token->getValue()]($stream, $this->template->getEnvironment());\n\t\t\t\t\t$node->compile($writer);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($token->getType() !== Token::EOF)\n\t\t\t{\n\t\t\t\t$token = $stream->next();\n\t\t\t}\n\n\t\t\telse break;\n\t\t}\n\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\treturn $writer->getSource();\n\t}", "private function compileJs() {\n\t\tforeach ($this->_tokens as $_) {\n\t\t\t$this->next ($name, $value);\n\t\t\t$this->parseToken($name, $value, $this->js);\n\t\t}\n\t}", "public function compile(\\Twig\\Compiler $compiler)\n\t{\n\t\t$compiler\n\t\t\t->addDebugInfo($this)\n\t\t\t->write('return ');\n\t\t// check for an expression to return.\n\t\tif ($this->hasNode('expr')) {\n\t\t\t$compiler->subcompile($this->getNode('expr'));\n\t\t}\n\t\telse // Return '' if there isn't one\n\t\t{\n\t\t\t$compiler->raw('\"\"');\n\t\t}\n\n\t\t$compiler->raw(\";\\n\");\n\t}", "function compile ($src);", "public static function doPrint($ast)\n {\n }", "function to_php($value, Backend $backend) {\n return $value;\n }", "static function ParseCode($source) {\n\t\tglobal $phpTokens;\n\t\t\n\t\t$alltokens = token_get_all($source);\n\t\t$tokens = array();\n\t\t$interesting = array( \n\t\t\tT_DOC_COMMENT, T_FUNCTION, T_STRING, T_VARIABLE, T_CLASS, T_INCLUDE, T_INCLUDE_ONCE, T_REQUIRE, \n\t\t\tT_REQUIRE_ONCE, T_CONSTANT_ENCAPSED_STRING, T_DNUMBER,T_LNUMBER, T_SPECIAL_BRACKET, T_INTERFACE);\n\t\t$opentagfound = false;\n\t\tforeach($alltokens as $token) {\n\t\t\tif ($token[0] == T_OPEN_TAG) $opentagfound = true;\n\t\t\t\n\t\t\tif (!is_array($token) && $token != \")\") continue;\n\t\t\tif ($token == \")\") $token = array(T_SPECIAL_BRACKET, \")\", 0);\n\t\t\tif (!in_array($token[0], $interesting)) continue;\n\t\t\t$token[3] = @token_name($token[0]);\n\t\t\t$tokens[] = $token;\n\t\t}\n\t\t\n\t\t// NO open tag? there is no PHP code at all?\n\t\tif (!$opentagfound) return null;\n\t\t\n\t\t// Find Php Comment blocks\n\t\t$blocks = array();\n\t\t\n\t\t// Now, we have all interesting & consecutive tokens\n\t\t$pageDocBlock = null;\n\t\t$lines = preg_split(\"/((\\r?\\n)|(\\n?\\r))/\", $source);\n\t\t\n\t\t// Check all tokens\n\t\tfor($i=0; $i<count($tokens); $i++) {\n\t\t\t$token = $tokens[$i];\n\t\t\t$nextToken = $tokens[$i+1];\n\t\t\t$previousToken = $tokens[$i-1];\n\t\t\t\n\t\t\t\n\t\t\t// Trying to detect if there is a Page Docblock\n\t\t\t// First doc bloc should be a T_DOC_COMMENT. \n\t\t\t// It should contain @package\n\t\t\tif ($i == 0 && $token[0] == T_DOC_COMMENT) {\n\t\t\t\tif (stripos($token[1], \"@package\") !== FALSE) {\n\t\t\t\t\t// We found the page docblock!\n\t\t\t\t\t$block = new DocBlock($token[1], \"(Page DocBlock)\", BLOCK_PAGE);\n\t\t\t\t\t$block->line = $token[2];\n\t\t\t\t\t$block->docline = $token[2];\n\t\t\t\t\t$blocks[] = $block;\n\t\t\t\t\t$pageDocBlock = $block;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// So, what's this comment block for?\n\t\t\tif (!in_array($token[0],array(T_FUNCTION,T_CLASS,T_INTERFACE,T_STRING,T_INCLUDE,T_INCLUDE_ONCE,T_REQUIRE,T_REQUIRE_ONCE))) continue; // nothing of interest (bad syntax?) => continue...\n\t\t\tif ($token[0] == T_STRING && strtolower($token[1]) != \"define\") continue; // a string, but not \"define\"... not useful to us\n\t\t\t\n\t\t\t// Filter out elements we don't want to see\n\t\t\tif ($token[0] == T_FUNCTION && !$_POST['Dfunc']) continue;\n\t\t\telseif ($token[0] == T_CLASS && !$_POST['Dclas']) continue;\n\t\t\telseif ($token[0] == T_INTERFACE && !$_POST['Dinte']) continue;\n\t\t\telseif ($token[0] == T_STRING && !$_POST['Dcons']) continue;\n\t\t\telseif (in_array($token[0], array(T_INCLUDE,T_INCLUDE_ONCE,T_REQUIRE,T_REQUIRE_ONCE)) && !$_POST['Dincl']) continue;\n\t\t\t\n\t\t\t// Filter out anonymous functions (non anonymous functions have their name/T_STRING right after the keyword 'function')\n\t\t\tif ($token[0] == T_FUNCTION && $nextToken[0] != T_STRING) continue;\n\t\t\t\n\t\t\t// Do we have a docblock for this token?\n\t\t\t$relevantDocBlock = null;\n\t\t\tif ($previousToken[0] == T_DOC_COMMENT) {\n\t\t\t\t// Is it the page token?\n\t\t\t\tif ($i == 1 && $pageDocBlock) { // yup, it's the page token, no action\n\t\t\t\t\t//$relevantDocBlock = null;\n\t\t\t\t} else {\n\t\t\t\t\t// This is a doc block likely meant for the following object\n\t\t\t\t\t$relevantDocBlock = $previousToken;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Create empty docblock\n\t\t\tif (!$relevantDocBlock) {\n\t\t\t\t$relevantDocBlock = array(T_DOC_COMMENT,\"/**\\r\\n*\\r\\n*/\",0);\n\t\t\t}\n\t\t\t\n\t\t\t// Find out associated tokens, depending on the current token type\n\t\t\t$associatedCode = $lines[ $token[2]-1 ];\n\t\t\t$type = $token[3];\n\t\t\t\n\t\t\t$block = new DocBlock($relevantDocBlock[1],$associatedCode, $type);\n\t\t\t$block->line = $token[2];\n\t\t\t$block->docline = $relevantDocBlock[2];\n\t\t\t//echo \"<pre>\"; print_r(htmlentities($lines));die();\t\t\t\n\t\t\t$blocks[] = $block;\n\t\t}\n\t\t\n\t\treturn $blocks;\n\t}", "public function closureToPHP(): string\n {\n // and store the result of a conversion in a $return variable\n return '$return = (function($value) {\n if ($value instanceof \\MongoDB\\BSON\\UTCDateTime) {\n return new \\AndyDune\\DateTime\\DateTime($value->toDateTime());\n }\n if ($value instanceof \\MongoDate) {\n return new \\AndyDune\\DateTime\\DateTime($value->toDateTime());\n }\n \n return new \\AndyDune\\DateTime\\DateTime((int)$value);\n })($value);';\n }", "final function getCode();", "public function getPHP()\n\t{\n\t\t//\n\t}", "private function getToken()\n {\n static $srcpos = 0; // current position in the source stream\n static $srclen; // the length of the source stream\n\n $statement = '';\n $token = null;\n if (empty($srclen)) {\n $srclen = strlen($this->source);\n }\n while (is_null($token) && $srcpos < $srclen) {\n $c = $this->source[$srcpos++];\n switch ($c) {\n case self::BEGIN_COMMENT:\n if (substr($this->source, $srcpos - 1, strlen(self::BEGIN_SL_COMMENT)) === self::BEGIN_SL_COMMENT) {\n $statement = self::BEGIN_SL_COMMENT;\n while ($this->source[$srcpos++] !== \"\\n\") {\n $statement .= $this->source[$srcpos];\n }\n $token = $this->createToken($statement);\n } elseif (substr($this->source, $srcpos - 1, strlen(self::BEGIN_ML_COMMENT))\n === self::BEGIN_ML_COMMENT) {\n if (ltrim($statement)) {\n throw new \\Exception('Invalid comment');\n }\n $statement .= $c.$this->source[$srcpos++];\n while (substr($this->source, $srcpos, strlen(self::END_ML_COMMENT))\n !== self::END_ML_COMMENT) {\n $statement .= $this->source[$srcpos++];\n }\n $srcpos += strlen(self::END_ML_COMMENT);\n $token = $this->createToken($statement.self::END_ML_COMMENT);\n } else {\n $statement .= $c;\n }\n break;\n case self::DOUBLE_QUOTE:\n case self::SINGLE_QUOTE:\n $statement .= $c;\n while ($this->source[$srcpos] !== $c) {\n $statement .= $this->source[$srcpos++];\n }\n $statement .= $this->source[$srcpos++];\n break;\n case self::BEGIN_INTERPOLATION:\n $statement .= $c;\n if (substr($this->source, $srcpos - 1, strlen(self::BEGIN_INTERPOLATION_BLOCK))\n === self::BEGIN_INTERPOLATION_BLOCK) {\n while ($this->source[$srcpos] !== self::END_BLOCK) {\n $statement .= $this->source[$srcpos++];\n }\n $statement .= $this->source[$srcpos++];\n }\n break;\n case self::BEGIN_BLOCK:\n case self::END_BLOCK:\n case self::END_STATEMENT:\n $token = $this->createToken($statement.$c);\n if (is_null($token)) {\n $statement = '';\n }\n break;\n default:\n $statement .= $c;\n break;\n }\n }\n\n if (is_null($token)) {\n $srclen = $srcpos = 0;\n }\n\n return $token;\n }", "public function getBytecode()\n {\n return $this->bytecode;\n }", "function parse_php($string) {\n ob_start();\n eval('?>'.$string);\n $string = ob_get_contents();\n ob_end_clean();\n return $string;\n}", "public function compile(Twig_Compiler $compiler)\n\t{\n\n\t\tif (version_compare(PHP_VERSION, '7.0.0', '>='))\n\t\t{\n\n\t\t\tparent::compile($compiler);\n\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t// Get variable placeholder names\n\t\t\t$varL = $compiler->getVarName();\n\t\t\t$varR = $compiler->getVarName();\n\n\t\t\t// Compile to: (($varL = left) !== NULL ? $varL : (($varR = right) !== NULL ? $varR : null))\n\t\t\t$compiler\n\t\t\t\t->raw(sprintf('(($%s = ', $varL))\n\t\t\t\t->subcompile($this->getNode('left'))\n\t\t\t\t->raw(sprintf(') !== NULL ? $%s : ', $varL))\n\t\t\t\t->raw(sprintf('(($%s = ', $varR))\n\t\t\t\t->subcompile($this->getNode('right'))\n\t\t\t\t->raw(sprintf(') !== NULL ? $%s : null', $varR))\n\t\t\t\t->raw(sprintf(')'))\n\t\t\t\t->raw(sprintf(')'))\n\t\t\t;\n\n\t\t}\n\n\t}", "public function toPhp()\n {\n return $this->_value->toPhp();\n }", "public function make($code);", "function yy_r7(){ $this->compiler->tag_nocache = true; $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo '<?xml';?>\", $this->compiler, true); }", "public function compile()\n\t{\n\t\tif ($this->dirty() and $this->compile)\n\t\t{\n\t\t\t$compiler = new Compiler($this, $this->app);\n\t\t\t$this->contents = $compiler->run();\n\t\t}\n\t}", "function yy_r6(){ \r\n if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU || $this->sec_obj->php_handling == SMARTY_PHP_ALLOW) {\r\n $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo '<?=\".$this->yystack[$this->yyidx + -1]->minor.\"?>'?>\\n\", $this->compiler, false);\r\n } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) {\r\n $this->_retvalue = $this->cacher->processNocacheCode(htmlspecialchars('<?='.$this->yystack[$this->yyidx + -1]->minor.'?>', ENT_QUOTES), $this->compiler, false);\r\n }elseif ($this->sec_obj == SMARTY_PHP_REMOVE) {\r\n $this->_retvalue = '';\r\n }\r\n }", "public function compile(Twig_Compiler $compiler)\n {\n \tif ('_self' === $this->getAttribute('name')) {\n //$compiler->raw('$this');\n } elseif ('_context' === $this->getAttribute('name')) {\n // $compiler->raw('$context');\n } elseif ('_charset' === $this->getAttribute('name')) {\n // $compiler->raw('$this->env->getCharset()');\n } else {\n $compiler\n \t->write(sprintf('$context[\\'%s\\'] = (isset($context[\\'%s\\']) ? $context[\\'%s\\'] : new %s())', $this->getAttribute('name'), $this->getAttribute('name'), $this->getAttribute('name'), $this->getAttribute('name')))\n \t\t->raw(\";\\n\");\n }\n \t\n \t$compiler ->write('echo ')\n ->subcompile($this->getNode('names')->getNode(0))\n ->raw(\"\\n\");\n \n $compiler->raw(\";\\n\");\n }", "function lang_xml2php($lang_code, $langdata_path)\n{\n\t$handle = fopen($langdata_path.$lang_code.\".php\", \"w\");\n\t$string_data = <<<EOF\n<?php\n\\$LANG_ARRAY = array (\n\nEOF;\n\tfwrite($handle, $string_data);\n\n\t$pages = simplexml_load_file($langdata_path.$lang_code.\".xml\");\n\n\t$page_count = 0;\n\tforeach($pages as $page)\n\t{\n\t\t$page_count++;\n\t\t$string_data = '\"'.$page['id'].'\" => array ( ';\n\t\tfwrite($handle, \"\\t\".$string_data.\"\\n\");\n\t\t$terms = $page->term;\n\t\t$term_count = 0;\n\t\tforeach($terms as $term)\n\t\t{\n\t\t\t$term_count++;\n\t\t\t$string_data = \"\\\"\".$term->key.\"\\\" => \\\"\".$term->value.\"\\\"\";\n\t\t\tif($term_count != count($terms))\n\t\t\t{\n\t\t\t\t$string_data .= \", \";\n\t\t\t}\n\t\t\tfwrite($handle, \"\\t\\t\".$string_data.\"\\n\");\n\t\t}\n\n\t\t$string_data = \") \";\n\t\tfwrite($handle, \"\\t\".$string_data);\n\t\tif($page_count < count($pages))\n\t\t{\n\t\t\t$string_data = \", \";\n\t\t\tfwrite($handle, $string_data.\"\\n\");\n\t\t}\n\t}\n\n\t$string_data = <<<EOF\n);\n\ninclude_once(__DIR__.\"/../lang/lang_util.php\");\n?>\nEOF;\n\tfwrite($handle, \"\\n\".$string_data);\n\tfclose($handle);\n}", "function yy_r5(){if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) {\r\n $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo htmlspecialchars('<?php\".str_replace(\"'\",\"\\'\",$this->yystack[$this->yyidx + -1]->minor).\"?>', ENT_QUOTES);?>\\n\", $this->compiler, false);\r\n } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) {\r\n $this->_retvalue = $this->cacher->processNocacheCode(htmlspecialchars('<?php'.$this->yystack[$this->yyidx + -1]->minor.'?>', ENT_QUOTES), $this->compiler, false);\r\n }elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) {\r\n $this->_retvalue = $this->cacher->processNocacheCode('<?php'.$this->yystack[$this->yyidx + -1]->minor.'?>', $this->compiler, true);\r\n }elseif ($this->sec_obj->php_handling == SMARTY_PHP_REMOVE) {\r\n $this->_retvalue = '';\r\n }\r\n }", "public function resolveCallProvider()\n {\n $simpleNameElement = function (string $functionName): Node {\n return new Node(\n AST_NAME,\n NAME_NOT_FQ,\n ['name' => $functionName]\n );\n };\n\n // Takes an array and turns it into an AST_ARRAY\n $arrayToAst = function (array $array): Node {\n $elements = [];\n\n foreach ($array as $key => $value) {\n $elements[] = new Node(\n AST_ARRAY_ELEM,\n 0,\n [\n 'key' => $key,\n 'value' => $value,\n ]\n );\n }\n\n return new Node(\n AST_ARRAY,\n ARRAY_SYNTAX_SHORT,\n $elements\n );\n };\n\n // Takes a functionname and an array of arguments, and turns that into an AST_CALL Node\n $astCall = function (string $functionName, array $arguments) use ($simpleNameElement, $arrayToAst): Node {\n foreach ($arguments as $i => $argument) {\n if (is_array($argument)) {\n $arguments[$i] = $arrayToAst($argument);\n }\n }\n\n return new Node(\n AST_CALL,\n 0,\n [\n 'expr' => $simpleNameElement($functionName),\n 'args' => new Node(\n AST_ARG_LIST,\n 0,\n $arguments\n )\n ]\n );\n };\n\n return [\n [$astCall('file_get_contents', []), 'originalFile'],\n [$astCall('reset', [['a']]), 'a'],\n [$astCall('youcandoitnot', []), $astCall('youcandoitnot', [])],\n [$astCall('base64_decode', ['aGVuaw==']), 'henk'],\n ];\n }", "private function compileLine ($line) {\n foreach ($line as $i => $token) {\n if (is_array($token)) {\n $line[$i] = chop($this->compileLine($token), ';');\n }\n }\n \n $last = current(array_slice($line, -1, 1)) ?: '';\n $first = current(array_slice($line, 0, 1)) ?: '';\n $second = current(array_slice($line, 1, 1)) ?: '';\n \n $length = count($line);\n $code = '';\n \n /* Comments */\n if ($first === 'shh') {\n $code .= \"// $second\";\n }\n \n if ($first === 'quiet') {\n $code .= '/*' . ($second === 'dogeblock' ? '*' : '');\n }\n \n if ($first === 'loud') {\n $code .= '*/';\n }\n \n /* Variable assignment */\n if ($first === 'very') {\n $last = implode(' ', array_slice($line, 3));\n \n $code .= \"$second = $last;\";\n }\n \n if ($second === 'is') {\n $last = implode(' ', array_slice($line, 2));\n \n $code .= \"$first = $last;\";\n }\n \n /* Use statement */\n if ($first === 'so' && $length > 1) {\n $code .= \"use $second\";\n \n if ($length > 2) {\n $code .= \" as $last\";\n }\n \n $code .= ';';\n }\n \n /* Comparison structures */\n if ($first === 'but') {\n $code .= 'else ';\n }\n \n if ($first === 'rly' || $second === 'rly') {\n $index = $first === 'rly' ? 1 : 2;\n $code .= 'if (' \n . $this->compileBoolean(implode(' ', array_slice($line, $index, -1))) \n . ') ';\n }\n \n if ($first === 'notrly') {\n $code .= 'if (!(' \n . $this->compileBoolean(implode(' ', array_slice($line, 1, -1))) \n . ')) ';\n }\n \n /* Loops */\n if ($first === 'many') {\n $code .= 'while ('\n . $this->compileBoolean(implode(' ', array_slice($line, 1, -1)))\n . ') ';\n }\n \n if ($first === 'much') {\n $code .= 'for ('\n . $this->compileBoolean(implode(' ', array_slice($line, 1, -1)))\n . ') ';\n }\n \n if ($first === '4lulz') {\n $with = array_search('with', $line);\n $arguments = array_slice($line, 1, $with - 1);\n \n $arguments = count($arguments) > 1 \n ? \"{$arguments[0]} => {$arguments[1]}\"\n : \"{$arguments[0]}\";\n \n $with = $line[$with + 1];\n \n $code .= \"foreach ($with as $arguments) \";\n }\n \n /* Operators */\n if ($second === 'more') {\n $third = $line[2];\n $code .= \"$first += $third;\";\n }\n \n if ($second === 'less') {\n $third = $line[2];\n $code .= \"$first -= $third;\";\n }\n \n if ($second === 'lots') {\n $third = $line[2];\n $code .= \"$first *= $third;\";\n }\n \n if ($second === 'few') {\n $third = $line[2];\n $code .= \"$first /= $third;\";\n }\n \n /* Functions */\n if ($first === 'plz') {\n $arguments = '';\n \n if ($length > 2) {\n $arguments = implode(', ', array_slice($line, 3));\n }\n \n $code .= \"$second($arguments);\";\n }\n \n if ($first === 'such') {\n $arguments = '';\n \n if ($length > 2) {\n $arguments = implode(', ', array_slice($line, 3, -1));\n }\n \n $code .= \"function $second ($arguments) \";\n }\n \n /* Block statements */\n if ($last === 'so') {\n $code .= '{';\n }\n \n if ($first === 'wow') {\n if ($length > 1) {\n $code .= 'return ' . implode(' ', array_slice($line, 1)) . \";\\n\";\n }\n \n $code .= \"}\";\n }\n \n if ($first === 'amaze') {\n $code .= 'return ' . implode(' ', array_slice($line, 1)) . ';';\n }\n \n if ($code) {\n return $code;\n }\n \n return $length === 1 ? implode(' ', $line) : '';\n }", "protected function functionExpression(Func $node): void\n {\n $driver = $this->entitySet->getDriver();\n $node->validateArguments();\n\n switch (true) {\n case $node instanceof Ceiling:\n $this->pushStatement('CEILING(');\n break;\n\n case $node instanceof Floor:\n $this->pushStatement('FLOOR(');\n break;\n\n case $node instanceof Round:\n $this->pushStatement('ROUND(');\n\n switch ($driver) {\n case SQLEntitySet::SQLServer:\n $this->evaluate($node->getArgument());\n $this->pushComma();\n $this->pushStatement('0 )');\n return;\n }\n break;\n\n case $node instanceof Func\\Type\\Cast:\n $arguments = $node->getArguments();\n list($arg1, $arg2) = $arguments;\n $targetType = null;\n\n switch ($arg2->getValue()) {\n case Type\\Binary::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'TEXT';\n break;\n\n case SQLEntitySet::PostgreSQL:\n $targetType = 'bytea';\n break;\n\n default:\n $targetType = 'BINARY';\n break;\n }\n break;\n\n case Type\\UInt16::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'SMALLINT';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'UNSIGNED INTEGER';\n break;\n }\n break;\n\n case Type\\UInt32::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLite:\n case SQLEntitySet::SQLServer:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'UNSIGNED INTEGER';\n break;\n }\n break;\n\n case Type\\UInt64::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'BIGINT';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'UNSIGNED INTEGER';\n break;\n }\n break;\n\n case Type\\Boolean::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'UNSIGNED INTEGER';\n break;\n\n case SQLEntitySet::SQLServer:\n $targetType = 'BIT';\n break;\n\n case SQLEntitySet::PostgreSQL:\n $targetType = 'BOOLEAN';\n break;\n\n }\n break;\n\n case Type\\Date::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'TEXT';\n break;\n\n case SQLEntitySet::MySQL:\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLServer:\n $targetType = 'DATE';\n break;\n }\n break;\n\n case Type\\DateTimeOffset::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'TEXT';\n break;\n\n case SQLEntitySet::PostgreSQL:\n $targetType = 'TIMESTAMP(3)';\n break;\n\n case SQLEntitySet::SQLServer:\n $targetType = 'DATETIMEOFFSET';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'DATETIME(3)';\n break;\n }\n break;\n\n case Type\\Decimal::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'REAL';\n break;\n\n case SQLEntitySet::MySQL:\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLServer:\n $targetType = 'DECIMAL(10,10)';\n break;\n }\n break;\n\n case Type\\Double::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'REAL';\n break;\n\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'DOUBLE PRECISION';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'DOUBLE';\n break;\n }\n break;\n\n case Type\\Int16::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'SIGNED INTEGER';\n break;\n\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'SMALLINT';\n break;\n }\n break;\n\n case Type\\Int32::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'SIGNED INTEGER';\n break;\n }\n break;\n\n case Type\\Int64::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'SIGNED INTEGER';\n break;\n\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'BIGINT';\n break;\n }\n break;\n\n case Type\\SByte::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'SIGNED INTEGER';\n break;\n\n case SQLEntitySet::PostgreSQL:\n $targetType = 'SMALLINT';\n break;\n\n case SQLEntitySet::SQLServer:\n $targetType = 'TINYINT';\n break;\n }\n break;\n\n case Type\\Single::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'REAL';\n break;\n\n case SQLEntitySet::MySQL:\n case SQLEntitySet::SQLServer:\n $targetType = 'FLOAT';\n break;\n }\n break;\n\n case Type\\String_::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'TEXT';\n break;\n\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLServer:\n $targetType = 'VARCHAR';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'CHAR';\n break;\n }\n break;\n\n case Type\\TimeOfDay::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'TEXT';\n break;\n\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::MySQL:\n $targetType = 'TIME(3)';\n break;\n }\n break;\n\n default:\n $node->notImplemented();\n }\n\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLServer:\n $this->pushStatement('CONVERT(');\n $this->pushStatement($targetType);\n $this->pushComma();\n $this->evaluate($arg1);\n $this->pushComma();\n // https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql#date-and-time-styles\n $this->pushStatement('120');\n $this->pushStatement(')');\n break;\n\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLite:\n $this->pushStatement('CAST(');\n $this->evaluate($arg1);\n $this->pushStatement('AS');\n $this->pushStatement($targetType);\n $this->pushStatement(')');\n break;\n\n case SQLEntitySet::MySQL:\n $this->pushStatement('CONVERT(');\n $this->evaluate($arg1);\n $this->pushComma();\n $this->pushStatement($targetType);\n $this->pushStatement(')');\n break;\n }\n return;\n\n case $node instanceof Node\\Func\\DateTime\\Date:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('DATE(');\n break;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"STRFTIME( '%Y-%m-%d',\");\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('(');\n $this->evaluate($node->getArgument());\n $this->pushStatement(')::date');\n return;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('FORMAT(');\n $this->evaluate($node->getArgument());\n $this->pushStatement(\", 'yyyy-MM-dd')\");\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Day:\n switch ($driver) {\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( day,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'DAY',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::MySQL:\n $this->pushStatement('DAY(');\n break;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%d',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Hour:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('HOUR(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( hour,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'HOUR',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%H',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Minute:\n switch ($driver) {\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( minute,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'MINUTE',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::MySQL:\n $this->pushStatement('MINUTE(');\n break;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%M',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Month:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('MONTH(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( month,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'MONTH',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%m',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Now:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('NOW(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('CURRENT_TIMESTAMP(');\n break;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"DATETIME( 'now'\");\n break;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Second:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('SECOND(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( second,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'SECOND',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%S',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Time:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('TIME(');\n break;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"STRFTIME( '%H:%M:%S',\");\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('(');\n $this->evaluate($node->getArgument());\n $this->pushStatement(')::time');\n return;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('FORMAT(');\n $this->evaluate($node->getArgument());\n $this->pushStatement(\", 'HH:mm:ss')\");\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Year:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('YEAR(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( year,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'YEAR', \");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%Y',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof MatchesPattern:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('REGEXP_LIKE(');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $arguments = $node->getArguments();\n list($arg1, $arg2) = $arguments;\n $this->evaluate($arg1);\n $this->pushStatement('~');\n $this->evaluate($arg2);\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof ToLower:\n $this->pushStatement('LOWER(');\n break;\n\n case $node instanceof ToUpper:\n $this->pushStatement('UPPER(');\n break;\n\n case $node instanceof Trim:\n $this->pushStatement('TRIM(');\n break;\n\n case $node instanceof Concat:\n switch ($driver) {\n case SQLEntitySet::PostgreSQL:\n $arguments = $node->getArguments();\n\n if (!$arguments) {\n return;\n }\n\n $this->pushStatement('CONCAT(');\n while ($arguments) {\n $argument = array_shift($arguments);\n $this->pushStatement('CAST(');\n $this->evaluate($argument);\n $this->pushStatement('AS TEXT )');\n\n if ($arguments) {\n $this->pushComma();\n }\n }\n\n $this->pushStatement(')');\n return;\n\n case SQLEntitySet::MySQL:\n case SQLEntitySet::SQLServer:\n $this->pushStatement('CONCAT(');\n break;\n\n case SQLEntitySet::SQLite:\n $arguments = $node->getArguments();\n\n if (!$arguments) {\n return;\n }\n\n $this->pushStatement('(');\n\n while ($arguments) {\n $argument = array_shift($arguments);\n $this->evaluate($argument);\n\n if ($arguments) {\n $this->pushStatement('||');\n }\n }\n\n $this->pushStatement(')');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof IndexOf:\n $arguments = $node->getArguments();\n list($arg1, $arg2) = $arguments;\n\n switch ($driver) {\n case SQLEntitySet::MySQL:\n case SQLEntitySet::SQLite:\n $this->pushStatement('INSTR(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('CHARINDEX(');\n list($arg2, $arg1) = $arguments;\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('STRPOS(');\n break;\n\n default:\n $node->notImplemented();\n }\n\n $this->evaluate($arg1);\n $this->pushComma();\n $this->evaluate($arg2);\n $this->pushStatement(')');\n $this->pushStatement('-1');\n return;\n\n case $node instanceof Length:\n switch ($driver) {\n case SQLEntitySet::SQLite:\n case SQLEntitySet::MySQL:\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('LENGTH(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('LEN(');\n break;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Substring:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n case SQLEntitySet::SQLite:\n case SQLEntitySet::SQLServer:\n $this->pushStatement('SUBSTRING(');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('SUBSTR(');\n break;\n\n default:\n $node->notImplemented();\n }\n\n list($arg1, $arg2, $arg3) = array_pad($node->getArguments(), 3, null);\n\n $this->evaluate($arg1);\n $this->pushComma();\n $this->pushStatement('(');\n $this->evaluate($arg2);\n $this->pushStatement('+ 1 )');\n $this->pushComma();\n\n if ($arg3) {\n $this->evaluate($arg3);\n } else {\n $this->pushStatement('2147483647');\n }\n\n $this->pushStatement(')');\n return;\n\n case $node instanceof Contains:\n case $node instanceof EndsWith:\n case $node instanceof StartsWith:\n $arguments = $node->getArguments();\n list($arg1, $arg2) = $arguments;\n\n $this->evaluate($arg1);\n $this->pushStatement('LIKE');\n $value = $arg2->getValue();\n\n if ($node instanceof StartsWith || $node instanceof Contains) {\n $value .= '%';\n }\n\n if ($node instanceof EndsWith || $node instanceof Contains) {\n $value = '%'.$value;\n }\n\n $arg2->setValue($value);\n $this->evaluate($arg2);\n return;\n\n default:\n $node->notImplemented();\n }\n\n $this->addCommaSeparatedArguments($node);\n $this->pushStatement(')');\n }", "public function pass_5($path)\n\t{\n\t\t$tokens = token_get_all($this->source[$this->last_pass]);\n\t\t$token_count = count($tokens);\n\t\t$tp = 0;\n\t\t$tokens_to_patch = array('T_FUNCTION');\n\t\t$last_class = '';\n\t\twhile($tp < $token_count) {\n\t\t\t$token_name = $this->token_name($tokens[$tp]);\n\t\t\tif($token_name == 'T_NAMESPACE') $current_namespace = $this->token_content($tokens[$this->get_next_non_comment($tokens,$tp+1)]);\n\t\t\tif($token_name == 'T_CLASS') {\n\t\t\t$last_class = $this->token_content($tokens[$this->get_next_non_comment($tokens,$tp+1)]);\n\t\t\tif(isset($current_namespace)) $last_class = $current_namespace.\"\\\\\".$last_class;\n\t\t\t}\n\t\t\tif(in_array($token_name, $tokens_to_patch )) {\n\t\t\t\tif($blockstart = $this->search_token($tokens,$tp,'{',array(';'))) {\n\t\t\t\t\t $function_name_tp = $this->get_next_non_comment($tokens,$tp+1);\n\t\t\t\t\t if(!is_array($tokens[$function_name_tp])) \n\t\t\t\t\t\t $function_name_tp = $this->get_next_non_comment($tokens,$function_name_tp+1);\n\t\t\t\t\t $function_name = $tokens[$function_name_tp][1];\n\t\t\t\t\t if(!Analyzer::shouldpatch($function_name,$last_class)) {\n\t\t\t\t\t \t$tp++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t } \n\t\t\t\t\t Analyzer::$instancenumberfor[$function_name] = 0;\n\t\t\t\t\t $this->add_tokens_to_be_inserted_after($blockstart+1,\"/*0*/\".\"if(isset(\\\\codespy\\\\Analyzer::\\$instancenumberfor[__FILE__][__CLASS__][__FUNCTION__])) \\\\codespy\\\\Analyzer::\\$instancenumberfor[__FILE__][__CLASS__][__FUNCTION__]++; else \\\\codespy\\\\Analyzer::\\$instancenumberfor[__FILE__][__CLASS__][__FUNCTION__]=0;\\\\codespy\\\\Analyzer::\\$executionbranches[__FILE__][__CLASS__][__FUNCTION__][\\\\codespy\\\\Analyzer::\\$instancenumberfor[__FILE__][__CLASS__][__FUNCTION__]][0] = 1;\");\n\t\t\t\t\t $blockend = $this->get_pair($tokens,$blockstart);\n\t\t\t\t\t $children = $this->get_children_from($tokens,$blockstart,$blockend,0);\n\t\t\t\t\t Analyzer::$possiblebranches[$path][$last_class][$function_name] = $children->getPaths();\n\t\t\t\t\t Analyzer::$nodetrees[$path][$last_class][$function_name] = $children;\n\t\t\t\t}\n\t\t\t} \n\t\t\t\t\n\t\t\t$tp++;\n\t\t}\n\t$this->source[$this->current_pass] = $this->change_stuff();\n\t}", "public function decompileFunctionBody($cxt, $function) {\r\n\t\t$statements = array();\t\r\n\t\t$contexts = array($cxt);\r\n\t\treset($cxt->opQueue);\r\n\t\t$cxt->nextAddress = key($cxt->opQueue);\r\n\t\twhile($contexts) {\r\n\t\t\t$cxt = array_shift($contexts);\r\n\t\t\twhile(($stmt = $this->decompileNextInstruction($cxt)) !== false) {\t\t\t\t\r\n\t\t\t\tif($stmt) {\r\n\t\t\t\t\tif(!isset($statements[$cxt->lastAddress])) {\r\n\t\t\t\t\t\tif($stmt instanceof AS2DecompilerFlowControl) {\r\n\t\t\t\t\t\t\tif($stmt instanceof AS2DecompilerBranch) {\r\n\t\t\t\t\t\t\t\t// look for ternary conditional operator\r\n\t\t\t\t\t\t\t\tif($this->decompileTernaryOperator($cxt, $stmt)) {\r\n\t\t\t\t\t\t\t\t\t// the result is on the stack\r\n\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// look ahead find any logical statements \r\n\t\t\t\t\t\t\t\tif($this->decompileLogicalStatement($cxt, $stmt)) {\r\n\t\t\t\t\t\t\t\t\t// the result is on the stack\r\n\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// clone the context and add it to the list\r\n\t\t\t\t\t\t\t\t$cxtT = clone $cxt;\r\n\t\t\t\t\t\t\t\t$cxtT->nextAddress = $stmt->addressIfTrue;\r\n\t\t\t\t\t\t\t\t$contexts[] = $cxtT;\r\n\t\t\t\t\t\t\t} else if($stmt instanceof AS2DecompilerJump) {\r\n\t\t\t\t\t\t\t\t// jump to the location and continue\r\n\t\t\t\t\t\t\t\t$cxt->nextAddress = $stmt->address;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$statements[$cxt->lastAddress] = $stmt;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// we've been here already\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// create basic blocks\r\n\t\t$blocks = $this->createBasicBlocks($statements);\r\n\t\tunset($statements);\r\n\r\n\t\t// look for loops, from the innermost to the outermost\r\n\t\t$loops = $this->createLoops($blocks, $function);\r\n\t\t\r\n\t\t// recreate loops and conditional statements\r\n\t\t$this->structureLoops($loops, $blocks, $function);\r\n\t\t\r\n\t\t$this->recreateClasses($function);\r\n\t}", "private function apply_instructions(string $type, \\PhpParser\\Node $node): \\PhpParser\\Node {\n // Retrieve all instructions by type\n $instructions = $this->file->get_instructions($type);\n\n // Check if has no leave instructions\n if (empty($instructions)) {\n return $node;\n }\n\n // Iterate over all instructions\n foreach($instructions as $instruction) {\n // Get the node type\n $instruction_node = $instruction->node;\n\n // Check if it's not the same as the current node\n if (!($node instanceof $instruction_node)) {\n continue;\n }\n\n // Extract the parameters\n $if = (array) $instruction->if;\n $do = (array) $instruction->do;\n\n // Check for all instructions\n foreach($if as $index => $cnd) {\n // Variable that will later handle if the condition was met\n $condition = false;\n\n // Check if condition is a callback\n if (is_callable($cnd)) {\n // Try matching it with the current node\n $condition = call_user_func_array($cnd, [$node]);\n } else {\n // Retrieve the index value\n $node_index = $node->{$index};\n\n // Check if the condition value is a string, and node index has a toString() method\n if (is_string($cnd[1]) && is_callable([$node_index, \"toString\"])) {\n // Call it\n $node_index = $node_index->toString();\n }\n\n // Evaluate the condition\n eval(\"\\$condition = \\$node_index \" . $cnd[0] . \" \" . escapeshellarg($cnd[1]) . \";\");\n }\n\n // Check if the condition was not met\n if (!$condition) {\n // Assert the failed condition\n $instruction->do_assertion(File\\Instruction::ASSERT_FAILED_CONDITION_NOT_MET, null);\n\n // Break the instruction\n break 2;\n }\n }\n\n // Do all instructions\n foreach($do as $action) {\n // Check if it's callable\n if (is_callable($action)) {\n // Just call the action\n call_user_func_array($action, [$node]);\n continue;\n }\n\n // Extract the action name\n $action_name = $action[\"action\"];\n unset($action[\"action\"]);\n\n // Check if is settings variables\n if ($action_name === \"set\") {\n // Iterate over all variables\n foreach($action[\"vars\"] ?? $action[\"variables\"] as $var => $value) {\n // Set the node variable value\n $node->{$var} = $value;\n }\n }\n }\n }\n\n return $node;\n }", "public function expr()/*# : ExpressionInterface */;", "abstract public function tree_encoder();", "abstract function getCompiler($options=false);", "public function getQueryAst()\n {\n return $this->query_ast;\n }", "public function getOpcodes($from_text, $to_text)\n {\n return $this->parser->parse($from_text, $to_text);\n }", "function compile($code, $do_not_echo = false, $retvar = '')\n\t{\n\t\t$code = ' ?' . '>' . $this->compile_code('', $code, true) . '<' . '?php' . \"\\n\";\n\t\tif($do_not_echo)\n\t\t{\n\t\t\t$code = \"ob_start();\\n\". $code. \"\\n\\${$retvar} = ob_get_contents();\\nob_end_clean();\\n\";\n\t\t}\n\t\treturn $code;\n\t}", "public function asCompiled();", "public function compile(\\Twig_Compiler $compiler)\n {\n $compiler\n ->addDebugInfo($this)\n ->write(\"echo \\$this->env->getExtension('capturize_extension')->capturizeAction(\")\n ->subcompile($this->getNode('expr'))\n ->raw(', ')\n ->subcompile($this->getNode('attributes'))\n ->raw(\");\\n\")\n ;\n }", "public function testMethod()\n {\n $expected = <<<'CODE'\n/**\n * @param int $a\n * @param int $b\n *\n * @return int\n */\npublic function add(int $a, int $b) : int\n{\n return $a + $b;\n}\nCODE;\n $expected = $this->indentText($expected);\n $actual = $this->cmd->execute(new CommandParams('Calc.php method My\\Test\\Ns\\Calc add'), $this->ctx);\n $this->assertSourceCode($expected, $actual);\n }", "public function interpret( int $code ): string;", "protected function transpileFor($expression): string\n {\n return \"<?php for{$expression}: ?>\";\n }" ]
[ "0.65731436", "0.6365944", "0.6208117", "0.608867", "0.5917447", "0.58069885", "0.57775354", "0.57605785", "0.5656182", "0.5651327", "0.5579599", "0.5561794", "0.54806894", "0.5449166", "0.5449166", "0.5449166", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.54484093", "0.53971756", "0.53790766", "0.536", "0.52570397", "0.52287614", "0.51215386", "0.51126736", "0.5027326", "0.50081956", "0.50049293", "0.4983931", "0.4981996", "0.49600872", "0.49445918", "0.4910521", "0.49073043", "0.4876249", "0.48709342", "0.48627585", "0.4842285", "0.4826678", "0.48190647", "0.48136404", "0.4802453", "0.47947377", "0.47875354", "0.47806495", "0.477833", "0.4774146", "0.47575113", "0.47519833", "0.4728269", "0.47121722", "0.47014472", "0.46887347", "0.46650386", "0.46578458", "0.4621199", "0.46150845", "0.46110487", "0.46066442", "0.46017262", "0.4590114", "0.45691967", "0.45690084", "0.45677575", "0.45546123", "0.45538318", "0.45497608", "0.45469597", "0.45297027", "0.4526917", "0.4515472", "0.45117944", "0.45088202", "0.44802904", "0.44614527", "0.44569102", "0.4456092", "0.44489107", "0.44423386", "0.4441009", "0.44408768", "0.44382665", "0.44378978", "0.44333553", "0.44310817", "0.44221443", "0.4421783" ]
0.7482285
0
if url has parameter, so we analyze it
public function parseUrl() { if ($this->uri !== NULL) { $uriCleaned = rtrim($this->uri, '/'); $pieces = explode('/', $uriCleaned); // Determine controller if (isset($pieces[0])) { $this->controller = ucfirst(strtolower($pieces[0])) . 'Controller'; unset($pieces[0]); } // Determine method if (isset($pieces[1])) { $this->method = strtolower($pieces[1]); unset($pieces[1]); } // Determine parameters $this->params = array_values($pieces); } $controllerPath = __DIR__ . '/../controllers/' . $this->controller . '.php'; if (file_exists($controllerPath)) { require $controllerPath; $this->controller = new $this->controller(); } else { handleError(); } if (! is_callable([$this->controller, $this->method])) { handleError(); } // run app call_user_func_array([$this->controller, $this->method], $this->params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function filterUrlParams(string $param): bool\n {\n return preg_match('/^wilensky_adyen\\.urls\\./', $param);\n }", "private function detectRequest()\n {\n // Get URL\n $url = isset($_GET) && array_key_exists('url', $_GET) ? $_GET['url'] : '';\n $url = trim($url, '/');\n\n // Apply routes\n $url = $this->applyRoutes($url, $this->routes);\n\n // Split URL\n $params = explode('/', $url);\n if(empty($params[0])) {\n $params = array();\n }\n\n\n // Save parameters\n $this->params = $params;\n }", "function url_get_param($name) {\n\tparse_str(parse_url(curPageURL(), PHP_URL_QUERY), $vars);\t\t\n\treturn isset($vars[$name]) ? $vars[$name] : null;\t\n}", "public function processUrl(){\n\t\t\n\t\tif (isset($_GET['url'])) {\n\t\t\treturn $url = explode('/',filter_var(rtrim($_GET['url'],'/'),FILTER_SANITIZE_URL));//what we're doing here is attempting to filter the url to make it clean and easy to use in our case we're going to explode the url into an array.\n\t\t}\n\n\n\t}", "public function checkParams()\n {\n if (!isset($_GET['params'])) {\n die($this->error('404'));\n } else {\n $id = $_GET['params'];\n }\n }", "public function parse_query_vars()\n {\n }", "private function parseUrl()\n {\n $url = $_SERVER['REQUEST_URI'];\n if (!empty($url)) {\n // parse url\n $this->params = explode(\"/\", filter_var(rtrim($url, \"/\"), FILTER_SANITIZE_URL));\n }\n\n if(empty($this->params[0])) {\n unset($this->params[0]);\n\n $this->params = array_values($this->params);\n }\n\n $this->getController();\n $this->getAction();\n\n $this->params = array_values($this->params);\n }", "public function parseURL()\n {\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/'); //menghapus tanda / di akhir url\n $url = filter_var($url, FILTER_SANITIZE_URL);//memfilter url dari karakter aneh (hack)\n $url = explode('/', $url); //memecah url yang diinput dengan delimiter / dan menjadikannya array\n return $url;\n }\n }", "function urlOk ($url) {\r\n return filter_var($url, FILTER_VALIDATE_URL);\r\n }", "public function get_url_params()\n {\n }", "public function parseUrl(){\n\n if(isset($_GET['url'])){\n //echo $_GET['url'];\n\n return $url = explode('/',filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n }\n }", "private function match ($url) {\n foreach ($this->pattern as $key => $pattern) $url = str_replace('{' . $key . '}', '(?P<' . $key . '>' . $pattern . ')', $url);\n preg_match('#^' . $url . '$#', App::$request->url, $matches);\n foreach ($matches as $key => $val)\n if (array_key_exists($key,$this->pattern)) $this->params[$key] = $val;\n return !empty($matches);\n }", "private function splitUrl() {\n\n if (isset($_GET['url'])) {\n\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n $this->url_params = array_values($url);\n\n // para debugging, descomente estas lineas si tiene problemas con la URL\n //echo 'Controller: ' . $this->url_controller . '<br>';\n //echo 'Action: ' . $this->url_action . '<br>';\n //echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n }\n }", "public function getIsUrlParametersAccepted(): bool;", "function parseURL()\n{\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n return $url;\n }\n}", "function get_valueFromStringUrl($url_path_part , $parameter_name) {\n\t\t\t$parts = parse_url($_SERVER[\"REQUEST_URI\"]);\n\t\t\tif(isset($parts['query'])) {\n\t\t\t\tparse_str($parts['query'], $query);\n\t\t\t\tif(isset($query[$parameter_name])) {\n\t\t\t\t\treturn $query[$parameter_name];\n\t\t\t\t}\n\t\t\t\telse { return null; }\n\t\t\t}\n\t\t\telse { return null; }\n\t\t}", "private function parseUrl($url) \n {\n $queryString = parse_url($url, PHP_URL_QUERY);\n\n parse_str($queryString, $params);\n\n if (is_array($params)) {\n $this->setController ($params['controller'] ?? $this->controller);\n $this->setAction ($params['action'] ?? $this->action);\n \n unset($params['controller'], $params['action']);\n \n $params = array_filter($params, function($val) {\n return $val != \"\";\n });\n \n $this->setParams($params);\n }\n }", "function getURLString(){\n $url = $_SERVER['REQUEST_URI'];\n $aurl = explode('?', $url);\n if(count($aurl) > 1)\n { \n $query = $aurl[1];\n parse_str($query, $params);\n return $params;\n }\n return array();\n}", "private function splitUrl()\n {\n if (isset($_GET['url'])) {\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n\n $this->url_params = array_values($url);\n // ::DEBUGGING\n // echo 'Controller: ' . $this->url_controller . '<br>';\n // echo 'Action: ' . $this->url_action . '<br>';\n // echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n // echo 'Parameters POST: ' . print_r($_POST, true) . '<br>';\n }\n }", "function get_exists($parameter){\n return key_exists($parameter, $_GET) && strlen(trim($_GET[$parameter])) > 0;\n}", "private function _parseURL($url)\n {\n // to delete $this->base_dir in $requested_url\n $url = (empty($this->base_dir) OR $this->base_dir == '/') ? substr($url, 1) /* remove the starting / */ \n : str_replace($this->base_dir, '', $url);\n \n $data = explode('?', $url);\n \n if(isset($data[1]))\n parse_str($data[1], $_GET);\n \n return $data[0];\n }", "function getQueryParm($parm) { // not working too good!\n $return = \"\";\n $uri = parse_url(rawurldecode($_SERVER['REQUEST_URI']));\n if (isset($uri['query'])) {\n $query = $uri['query'];\n if ($parm) {\n $pos = $this->stripos($query, $parm . \"=\");\n if ($pos)\n $return = substr($query, $pos + strlen($parm) + 1);\n }\n }\n return $return;\n }", "private function url ($param)\n {\n if(!filter_var($this->value, FILTER_VALIDATE_URL))\n {\n $this->SetError('url', 'The '.$this->SpacedKey.' field must be a valid url');\n return false;\n }\n return true;\n }", "public function has_url_get_parameters() {\r\n\t\treturn (strlen($this->url_get_parameters) > 3);\r\n\t}", "private function ParseUrl()\n {\n $url = explode('/', trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/'), 3);\n\n if (isset($url[0]) AND $url[0] != '') {\n $this->_controller = $url[0];\n }\n if (isset($url[1]) AND $url[1] != '') {\n $this->_action = $url[1];\n }\n if (isset($url[2]) AND $url[2] != '') {\n $this->_params = explode('/', $url[2]);\n }\n }", "static function filtrarUrl($url) {\n if (strpos($url, \"?\") !== false) {\n $parts = explode(\"?\", $url);\n return $parts[0];\n } else\n return $url;\n }", "function vUrl( $url )\r\n\t\t{\r\n\t\t return filter_var( $url, FILTER_VALIDATE_URL );\r\n\t\t \r\n\t\t}", "public function parseUrl()\n\t\t{\n\t\t\tif(isset($_GET['url']))\n\t\t\t{\n\t\t\t\t// explode(separator, string, limit);\n\t\t\t\treturn $url = explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n\t\t\t}\n\t\t}", "private function parseRequestParameter()\n {\n \t$paramIndentifier = $this->getSettingParameter('identifier');\n \t$paramFileName = $this->getSettingParameter('fileName');\n \t$paramChunkedNumber = $this->getSettingParameter('chunkedNumber');\n \t$paramChunkedSize = $this->getSettingParameter('chunkedSize');\n \t$paramTotalFileSize = $this->getSettingParameter('totalFileSize');\n \t$paramTotalChunkOfFile = $this->getSettingParameter('numberChunkedOfFile');\n\n \t$this->indentifier = (string) $this->request->getParam($paramIndentifier);\n \t$this->fileName = (string) $this->request->getParam($paramFileName);\n \t$this->chunkedNumber = (int) $this->request->getParam($paramChunkedNumber);\n \t$this->chunkedSize = $this->request->getParam($paramChunkedSize);\n \t$this->totalFileSize = $this->request->getParam($paramTotalFileSize);\n \t$this->numberChunkedOfFile = (int) $this->request->getParam($paramTotalChunkOfFile);\n }", "public function extractUrlParams(string $url): void {\n\n // Route string\n $params_string = str_replace($this->routePath, \"\", $url);\n\n // Remove /\n if (substr($params_string, 0, 1) === \"/\") {\n $params_string = substr($params_string, 1);\n }\n $params = [];\n $arr = explode(\"/\", $params_string);\n\n for ($index = 0; $index < count($arr); $index++) {\n if (isset($arr[$index + 1])) {\n $params[$arr[$index]] = $arr[$index + 1];\n } else {\n $params[$arr[$index]] = null;\n }\n $index++;\n }\n\n // Set parameters\n Request::setParams($params);\n }", "private function hasParams($request)\n {\n preg_match_all($this->regex, $this->uri, $uri_);\n\n if (count($uri_[0]) !== 0) {\n return $this->setParams($request);\n }\n return false;\n }", "private function extractRouteParams()\n {\n // Extract params\n $params = array_filter(explode('/', $_GET['url']));\n\n // First parameter is the controller\n $this->_controller = $params[0];\n\n // Second parameter is the action method\n\t\tif (isset($params[1]) && !empty($params[1])) {\n\t\t\t$this->_action = $params[1];\n\t\t}\n\n // Set additional parameters\n\t\tif (isset($params[2]) && !empty($params[2])) {\n\t\t\t$this->_urlParams = $params[2];\n\t\t}\n }", "public function parseURL()\n {\n $url = $_GET['url']; // localhost/HornyMVC/admin/erfds/sd/ds -> $url = admin/erfds/sd/ds\n\n $url = explode('/', trim($url));\n\n $url = array_slice($url, array_search(\"HornyMVC\", $url) ? array_search(\"HornyMVC\", $url) + 1 : 0);\n\n return $url;\n }", "function url_analyze ($url)\n{\n\trequire (\"url_handling_parameters.php\");\n\n\t// return-values:\n\t// 0 = url is not allowed, unable to handle\n\t// 1 = url is ok -> make picture\n\t// 2 = url is email\n\t// 3 = url is downloadable file\n\n\t\n\t// allowed?\n\tif (eregiArray($url_forbidden,$url)) return 0;\n\t// email\n\tif (eregiArray($url_email,$url)) return 2; \n\t// downloadable files\n\telseif (eregiArray($url_download,$url)) return 3;\n\t// allowed url\n\telseif (eregiArray($url_allowed,$url)) return 1;\n\t\n\telse return 0;\n}", "private function detectQueryParams()\n {\n $uri = new Uri('http://example.org'.$this->getRequestTarget());\n parse_str($uri->getQuery(), $params);\n return array_merge($_GET, $params);\n }", "private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}", "private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}", "function ValidRequiredQueryString($name) {\n return isset($_GET[$name]) && $_GET[$name] != \"\";\n}", "abstract public function parseRequestParameters();", "function wp_parse_url($url, $component = -1)\n {\n }", "function nvp_CheckGet($params) {\r\n $result=true;\r\n if (!empty ($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty ($_GET[$eachparam])) {\r\n $result=false; \r\n }\r\n } else {\r\n $result=false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n }", "function parseGetParams()\n {\n $this->parameters = array();\n\n $uriParts = explode('?', $this->userURI);\n $itemCount = count($uriParts);\n if ($itemCount == 0)\n {\n return;\n }\n\n //remove last item if it's empty\n if (isset($uriParts[$itemCount - 1]) && $uriParts[$itemCount - 1] == '')\n {\n array_pop($uriParts);\n }\n \n //remove first item if it's empty\n if (isset($uriParts[0]) && $uriParts[0] == '')\n {\n array_shift($uriParts);\n }\n\n //if has no valid item then return\n if (count($uriParts) == 0)\n {\n return;\n }\n writeLog(print_r($uriParts, true));\n \n foreach($uriParts as $inputData)\n {\n $data = html_entity_decode($inputData);\n $pair = explode('=', $data);\n\n if (count($pair)>1)\n {\n $this->parameters[$pair[0]] = $pair[1];\n }\n }\n \n writeLog(\"params = \".print_r($this->parameters, true));\n }", "private function cleanParams(){\n $brokenUrl = explode(\"&\", iWeb::currentUrl());\n unset($brokenUrl[0]);\n $brokenUrl = array_values($brokenUrl);\n foreach ($brokenUrl as $param){\n $paramaters = explode(\"=\",$param);\n $this->params[$paramaters[0]] = $paramaters[1];\n }\n\n }", "private function _getUrl()\r\n {\r\n $url = filter_input(INPUT_GET, 'url');\r\n $url = rtrim($url, '/');\r\n $url = filter_var($url,FILTER_SANITIZE_URL);\r\n $this->_url = explode('/', $url);\r\n }", "private function splitUrl()\n {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n \n // Put URL parts into according properties\n // By the way, the syntax here is just a short form of if/else, called \"Ternary Operators\"\n // @see http://davidwalsh.name/php-shorthand-if-else-ternary-operators\n $this->url_controller = (isset($url[0]) ? $url[0] : null);\n $this->url_action = (isset($url[1]) ? $url[1] : null);\n $this->url_parameter_1 = (isset($url[2]) ? $url[2] : null);\n $this->url_parameter_2 = (isset($url[3]) ? $url[3] : null);\n $this->url_parameter_3 = (isset($url[4]) ? $url[4] : null);\n\n // for debugging. uncomment this if you have problems with the URL\n # echo 'Controller: ' . $this->url_controller . '<br />';\n # echo 'Action: ' . $this->url_action . '<br />';\n # echo 'Parameter 1: ' . $this->url_parameter_1 . '<br />';\n # echo 'Parameter 2: ' . $this->url_parameter_2 . '<br />';\n # echo 'Parameter 3: ' . $this->url_parameter_3 . '<br />';\n }\n }", "function validarEstudiante($url=null){\n echo $url[0];\n }", "function heateor_ss_validate_url($url){\r\n\treturn filter_var(trim($url), FILTER_VALIDATE_URL);\r\n}", "static function parse($url, $request){\n $url = trim($url, '/');\n $params = explode('/', $url);\n if (!empty($params[1])){\n $request->controller = $params[1];\n } else {\n $request->controller = \"\";\n }\n\n\t\tif ($request->controller === 'register' ||\n\t\t\t$request->controller === 'forgetId') {\n\t\t\t$params[2] = Router::validAccountByMail($params);\n\t\t}\n\t\t$request->action = isset($params[2]) ? $params[2] : 'accueil';\n\t\t$request->params = array_slice($params, 3);\n\n\t\treturn TRUE;\n\t}", "private function parseURL()\n {\n $request = trim($_SERVER['REQUEST_URI'], '/');\n\n\n //If our request has question mark, then we got parameters\n if( strpos($request, '?') )\n {\n //Removing all GET parameters from the request\n $request = substr($request, 0, strpos($request, '?'));\n }\n\n if (!empty($request)) {\n\n $url = explode('/', $request); //split everything by slashes\n // var_dump($url);\n\n if ($url) {\n //The pattern of the url is ==> localhost/controller/action\n //controller is the first element of the url \n //(basically we're checking for the files with Controller as the \n //last part of their name, in the CONTROLLER directory, \n //for instance, we have a file with name imageController.php in the CONTROLLER directory)\n $this->controller = $url[0] . 'Controller';\n //action is the second element of the url and if it is set we're using it,\n //otherwise we use index page\n $this->action = isset($url[1]) ? $url[1] : $this->action;\n }\n }\n }", "function rest_parse_request_arg($value, $request, $param)\n {\n }", "public static function parse_URL($url)\n {\n }", "protected static function parse_url($url)\n {\n }", "function processUriParams() {\n\t\t$params = array();\n\t\t$uriParams = explode('/', trim($this->_uri, '/'));\n\t\t$count = count($uriParams);\n\t\tif($count > 0) {\n\t\t\tfor($i = 0; $i < $count; $i++) {\n\t\t\t\t$val = isset($uriParams[($i + 1)]) ? $uriParams[($i + 1)] : null;\n\t\t\t\t$params[$uriParams[$i]] = urldecode(is_numeric($val) ? (int) $val : $val);\n\t\t\t}\n\t\t\t$this->_uriParams = $params;\n\t\t}\n\t}", "function parseURL($url){\r\n //Explodeo la url para convertirla en un array\r\n $urlExploded = explode('/' ,$_GET['action']);\r\n //Creo un nuevo array y en la posición 'action' le asigno la acción recibida\r\n $arrayReturn[ConfigApp::$ACTION] = $urlExploded[0];\r\n //Si esta seteado, llama al metodo array_slice(), lo que hace este metodo es crear un arrego a partir de una posición dada, en este caso desde la posición 1\r\n $arrayReturn[ConfigApp::$PARAMS] = isset($urlExploded[1]) ? array_slice($urlExploded, 1) : null;\r\n\r\n return $arrayReturn;\r\n }", "function name_and_representation_in_url() {\n preg_match(URI_REGEX, request_uri(), $request_matches);\n return array(\n (isset($request_matches[1]) ? $request_matches[1] : ''),\n (isset($request_matches[2]) ? $request_matches[2] : ''),\n );\n}", "function cpay_CheckGet($params) {\r\n $result = true;\r\n if (!empty($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty($_GET[$eachparam])) {\r\n $result = false;\r\n }\r\n } else {\r\n $result = false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n}", "function url_parts($url) {\n if (!preg_match('/^(?P<protocol_domain>(?P<protocol>https?\\:\\/+)(?P<domain>([^\\/\\W]|[\\.\\-])+))(?P<request_uri>(?P<pathname>(?P<path>\\/(.+\\/)?)?(?P<file>[^\\?\\#]+?)?)?(?P<query_string>\\?[^\\#]*)?)(\\#(?P<hash>.*))?$/',$url,$url_parts)) {\n echo debug_backtrace();\n throw new Exception(\"Invalid url: $url\");\n }\n return $url_parts;\n}", "function get_required_param($param)\n{\n global $params;\n\n if (empty($params[$param]))\n {\n header('HTTP/1.0 400 Bad Request');\n die('Invalid Request - Missing \"' . $param . '\"');\n }\n\n return $params[$param];\n}", "public function get_params($param_name){\n if(empty($param_name)){\n $f = fopen($_SERVER['DOCUMENT_ROOT'].\"/logs/error.log\",\"a\");\n fwrite($f,'> Error when trying to access $_GET[\"'.$param_name.'\"] from : '.self::$page_name.'\\n');\n fclose($f);\n return 0;\n }\n else{\n return $_GET[$param_name];\n }\n }", "protected function prepareUrl($url)\n {\n $xurl = parse_url($url);\n parse_str($xurl[\"query\"], $this->parameters);\n $this->url = preg_replace('/\\?.+$/', null, $url);\n }", "private function get_url_query( $url ) {\n\t\t$params = [];\n\t\t$query = $this->get_query_after( $url );\n\n\t\twp_parse_str( $query ? $query : '', $params );\n\n\t\tif ( $this->is_exact_match( $url, $params ) ) {\n\t\t\t$this->match_exact = $query;\n\t\t}\n\n\t\treturn $params;\n\t}", "function urlHasDuplicateParameters($queryString){\n //Segment the query string by breaking up each parameter into key value pairs delimited by '&'\n\t\t$parts = explode('&', $queryString);\n\t\t$parameters = array();\n\t\t\n //Loop through each parameter and push into an array, checking if its already been added\n\t\tforeach($parts as $part){\n\t\t\t$key = substr($part, 0, strpos($part, '='));\n\t\t\tif (in_array($key, $parameters)){\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tarray_push($parameters, $key);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lessonpageid);;\n }", "function checkurl($url){\n if(!filter_var($url, FILTER_VALIDATE_URL)){\n return \" \";\n }\n else{\n return $url;\n }\n }", "function parse_url_helper($youtubeURL)\n{\n $link = parse_url($youtubeURL);\n if(!array_key_exists('query', $link))\n throw new Exception('No \\'Query\\'');\n else\n return $link;\n}", "public function is_valid_url()\r\n {\r\n return (!empty($this->internal_params['url']) &&\r\n piplapi_is_valid_url($this->internal_params['url']));\r\n }", "function validUrl($url)\n{\n return filter_var($url, FILTER_VALIDATE_URL);\n}", "public function extractParameters()\n {\n $request = $this->container->get('request_stack')->getCurrentRequest();\n\n if (preg_match(self::$routePattern, $request->get('_route'), $routeMatches)) {\n $searchEngine = $this->container->get('search.engine');\n\n $this->routePrefix = reset($routeMatches);\n $this->originalRouteParameterCount = (int)end($routeMatches);\n\n $activeModules = $searchEngine->getActiveModules();\n\n $dateFormatString = $this->container->get('languagehandler')->getDateFormat();\n $dateFormat = preg_replace(\"/[^\\w]/\", '-', $dateFormatString);\n\n for ($i = 0; $i < $this->originalRouteParameterCount; $i++) {\n $rawInput = strtolower($request->get(\"a{$i}\"));\n $parameterInformation = Utility::convertStringToArray($rawInput);\n\n if (!$this->hasKeywords() && $rawKeyword = $searchEngine->convertFromKeywordFormat($rawInput)) {\n $parameterInformation = Utility::convertStringToArray($rawKeyword);\n foreach ($parameterInformation as $parameter) {\n $this->addKeyword($parameter);\n }\n continue;\n }\n\n if (!$this->hasWheres() && $rawWhere = $searchEngine->convertFromWhereFormat($rawInput)) {\n $parameterInformation = Utility::convertStringToArray($rawWhere);\n foreach ($parameterInformation as $parameter) {\n $this->addWhere($parameter);\n }\n continue;\n }\n\n if (!$this->hasModules() && $modules = array_intersect($activeModules, $parameterInformation)) {\n foreach ($modules as $key => $value) {\n $this->addModule($key);\n }\n continue;\n }\n\n if (!$this->hasStartDate() && $date = \\DateTime::createFromFormat($dateFormat, $rawInput)) {\n $this->setStartDate($date);\n continue;\n }\n\n if (!$this->hasEndDate() && $date = \\DateTime::createFromFormat($dateFormat, $rawInput)) {\n $this->setEndDate($date);\n continue;\n }\n\n if (($elasticType = $searchEngine->getFriendlyUrlType($parameterInformation)) && (!$this->hasCategories() || !$this->hasLocations())) {\n switch ($elasticType) {\n case CategoryConfiguration::$elasticType:\n if (!$this->hasCategories()) {\n $categories = $searchEngine->categoryFriendlyURLSearch($parameterInformation);\n $this->setCategories($categories);\n !$this->hasModules() and array_map(function($category) {\n $this->addModule($category->getModule());\n }, $categories);\n }\n break;\n case LocationConfiguration::$elasticType:\n if (!$this->hasLocations()) {\n $this->setLocations($searchEngine->locationFriendlyURLSearch($parameterInformation));\n }\n break;\n }\n\n continue;\n }\n\n if (self::$exception) {\n throw new NotFoundHttpException();\n }\n }\n }\n\n foreach ($request->query->all() as $key => $value) {\n $this->queryParameters[$key] = Utility::convertStringToArray($value, '-');\n }\n }", "function allowed_get_params($allowed_params = []){\r\n //$allowed_array will contain only allowed url parameters\r\n $allowed_array = [];\r\n foreach($allowed_params as $param){\r\n if(isset($_GET[$param])){\r\n $allowed_array[$param] = $_GET[$param];\r\n }else{\r\n $allowed_array[$param] = NULL;\r\n }\r\n }\r\n return $allowed_array;\r\n\r\n}", "public static function processURL($url = '')\n\t{\n\t\t$parsed_url = self::explodeURL($url);\n\t\tforeach($parsed_url as $key => $url) {\n\n\t\t\t/**\n\t\t\t * We don't want to process the input stream content.\n\t\t\t */\n\t\t\tif ($key === 'php_input_stream') {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\n\t\t\t\t$custom_url_part = explode(':', $url);\n\t\t\t\tif (isset($custom_url_part[1])) {\n\t\t\t\t\t$parsed_url[$custom_url_part[0]] = $custom_url_part[1];\n\t\t\t\t}\n\n\t\t\t\t// Remove the default (empty) values from the parsed array\n\t\t\t\tif (is_int($key) || empty($parsed_url[$key])) {\n\t\t\t\t\tunset($parsed_url[$key]);\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Collect all \"fancy\" parameters\n\t\t\t\t * http://phetiche/controller/method/arg[0]/arg[1]/arg[2]/arg[3] ...\n\t\t\t\t */\n\t\t\t\tif (!in_array($url, $parsed_url) && !empty($url) && $key != 0) {\n\t\t\t\t\t$parsed_url['uri_args'][] = $url;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If no request ID is found, then NULL it so we can still use (check) it\n\t\t */\n\t\t$parsed_url['controller'] = (isset($parsed_url['controller'])) ? $parsed_url['controller'] : null;\n\t\t$parsed_url['method'] = (isset($parsed_url['method'])) ? $parsed_url['method'] : null;\n\t\t$parsed_url['request_id'] = (isset($parsed_url['request_id'])) ? $parsed_url['request_id'] : null;\n\t\t$parsed_url['routed_to'] = null;\n\n\t\t/**\n\t\t * Now that we have a final array on (request) data, we can merge the other\n\t\t * request method's data, such as POST and PUT.\n\t\t */\n\t\treturn Phetiche_request::readInput($parsed_url);\n\t}", "public function splitURL(){\n global $url;\n\n $url = explode('/', $url);\n $this->controller = (!empty($url[0]) ? $url[0] : null);\n $this->action = (!empty($url[1]) ? $url[1] : null);\n $this->parameter1 = (isset($url[2]) ? $url[2] : null);\n $this->parameter2 = (isset($url[3]) ? $url[3] : null);\n $this->parameter3 = (isset($url[4]) ? $url[4] : null);\n }", "private function _getUrl()\n {\n // Explode url to the array Variabels (url)\n $url = isset($_GET['url']) ? $_GET['url'] : null;;\n $url = rtrim($url, '/');\n $url = filter_var($url,FILTER_SANITIZE_URL);\n $this->_url = explode('/', $url);\n }", "function get_param_string($name, $default = false, $no_security = false)\n{\n $ret = __param($_GET, $name, $default);\n if (($ret === '') && (isset($_GET['require__' . $name])) && ($default !== $ret) && ($_GET['require__' . $name] !== '0')) {\n // We didn't give some required input\n set_http_status_code('400');\n warn_exit(do_lang_tempcode('IMPROPERLY_FILLED_IN'));\n }\n\n if ($ret === $default) {\n return $ret;\n }\n\n if (strpos($ret, ':') !== false && function_exists('cms_url_decode_post_process')) {\n $ret = cms_url_decode_post_process($ret);\n }\n\n require_code('input_filter');\n check_input_field_string($name, $ret);\n\n if ($ret === false) { // Should not happen, but have seen in the wild via malicious bots sending corrupt URLs\n $ret = $default;\n }\n\n return $ret;\n}", "function get_query_string($key) {\n $val = null;\n if (!empty($_GET[$key])) {\n $val = $_GET[$key];\n }\n return $val;\n}", "function emr_maybe_remove_query_string( $url ) {\n\t$parts = explode( '?', $url );\n\n\treturn reset( $parts );\n}", "public function getParams(){\n if( !empty($this->uri['query']) ):\n parse_str($this->uri['query'], $this->params);\n return $this->params;\n endif;\n }", "function getUrlInfo()\n{\n $url = \"{$_SERVER['REQUEST_URI']}\";\n $url = htmlspecialchars( $url, ENT_QUOTES, 'UTF-8' );\n $parse = parse_url($url);\n $url = rtrim($parse['path'], '/');\n $url = strtolower($url);\n $filtered = array_filter(explode('/', $url));\n $filtered = array_values($filtered);\n return $filtered;\n}", "function getUrlParameter($parameterName) {\n\n\t\t$parameter = null;\n\n\t\tif (isset($_GET[$parameterName]))\n\t\t\t$parameter = $_GET[$parameterName];\n\n\t\treturn $parameter;\n\n\t}", "function hasParam($name)\n {\n return isset($_REQUEST[$name]);\n }", "function get_url_param( $variable, $default='' )\n {\n return !empty( $_GET[ $variable ] )?$_GET[ $variable ]:$default;\n }", "public static function parseURL($url) {\n\t\t\t\t\n\t\t}", "function get_request_contains($request_url,$search_string) {\n //get the current url\n $string = $search_string;\n $url = $request_url;\n //~ echo $request_url;\n //check for string in url\n $lookup = strpos($url, $string);\n\n\n //If string is found, set the value of found_context\n if($lookup > 1 || $lookup !== false) {\n //~ echo 'is_component request';\n return true;\n }\n\n //If not found, set UNSET the value of found_context\n else {\n //~ echo 'is_not component request';\n return false; \n }\n}", "public function splitUrl() {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_STRING);\n $url = explode('/', $url);\n\n // parse custom urls\n $url = $this->parseRoutes($url);\n\n if ($this->app->language->enabled) {\n // set lang key\n $this->lang_key = isset($url[0]) ? $url[0] : null;\n // set controller\n $this->url_controller = isset($url[1]) ? $url[1] : null;\n // and action\n $this->url_action = isset($url[2]) ? $url[2] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1], $url[2]);\n } else {\n // set controller\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n // and action\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1]);\n }\n\n // store action params\n $this->action_params = array_values($url);\n\n }\n }", "private function __parseUrl()\n {\n if (isset($_GET['url'])) {\n return explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n }\n return [];\n }", "function checkQueryParams($param_array){\n\t$cnt = 0;\n\tfor($i=0; $i < count($param_array); $i++){\n\t\tif(isset($_GET[$param_array[$i]])){\n\t\t\t$params_set[$param_array[$i]] = $_GET[$param_array[$i]];\n\t\t\t$cnt++;\n\t\t}\n\t\t$params_set[\"cnt\"] = $cnt;\n\t}\n\treturn $params_set;\n}", "private function getParamsFromRequest() {\n if (isset($_GET['page'])) {\n $this->currentpage = $_GET['page'];\n } else {\n //else set default page to render\n $this->currentpage = 1;\n }\n //If limit is defined in URL\n if (isset($_GET['limit'])) {\n $this->limit = $_GET['limit'];\n } else { //else set default limit to 20\n $this->limit = 10;\n }\n //If currentpage is set to null or is set to 0 or less\n //set it to default (1)\n if (($this->currentpage == null) || ($this->currentpage < 1)) {\n $this->currentpage = 1;\n }\n //if limit is set to null set it to default (10)\n if (($this->limit == null)) {\n $this->limit = 10;\n //if limit is any number less than 1 then set it to 0 for displaying\n //items without limit\n } else if ($this->limit < 1) {\n $this->limit = 0;\n }\n }", "function parse_string_extract_param($string) {\n if ($this->parse_string_is_once_param($string)) {\n return\n substr(\n $string, +strlen($this->parse['before']), -strlen($this->parse['after'])\n );\n }\n return false;\n }", "function _refererhi() {\n $referer = parse_url($_SERVER['HTTP_REFERER']);\n parse_str($referer['query'],$vars);\n if (isset($vars['q'])) {\n return $vars['q'];\n } else if (isset($vars['p'])) {\n return $vars['p'];\n }\n }", "private function getUrl()\n {\n //echo $_GET['url'];\n if(isset($_GET['url']))\n {\n $url=rtrim($_GET['url'],'/');\n $url=filter_var($url,FILTER_SANITIZE_URL);\n $url=explode('/',$url);\n return $url;\n }\n }", "public function has_query_params( $url ) {\n\t\t$qpos = strpos( $url, '?' );\n\n\t\tif ( $qpos === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "private function parseGET()\n {\n if (isset($_GET['method'])) {\n $this->method = $_GET['method'];\n unset($_GET['method']);\n }\n\n if (isset($_GET['output'])) {\n $this->output = $_GET['output'];\n unset($_GET['output']);\n }\n\n $testDN = Get_User_Principle_PI();\n if (empty($testDN) == false) {\n $this->identifier = $testDN;\n }\n\n if (count($_GET) > 0) {\n $this->params = $_GET;\n }\n }", "public static function getParamsFromURL($url)\n {\n $return = array();\n if (! empty($url)) {\n $params = explode(\"/\", $url);\n $params = Formatter::cleanData($params);\n \n if (count($params) != 0) {\n foreach ($params as $nr => $param) {\n if ((preg_match('/page-(?<number>\\d+)/', $param, $matches))) { // Page\n $return[self::PARAM_PAGE] = (int) $matches[1];\n } elseif ((preg_match('/lang-(?P<value>.+)/', $param, $matches))) { // Language\n $return[self::PARAM_LANG] = $matches['value'];\n } elseif (! isset($return[self::PARAM_CONTROLLER])) { // Module\n $return[self::PARAM_CONTROLLER] = $param;\n } elseif (! isset($return[self::PARAM_METHOD])) { // Method\n $return[self::PARAM_METHOD] = $param;\n } else { // Method argument\n if (! array_key_exists(self::PARAM_METHOD_ARGUMENTS, $return)) {\n $return[self::PARAM_METHOD_ARGUMENTS] = array();\n }\n $return[self::PARAM_METHOD_ARGUMENTS][] = $param;\n }\n }\n }\n }\n \n return $return;\n }", "function getParamInfo() {\n\t\treturn FALSE;\n\t}", "function getURL($url, $prams)\n {\n return $url . '?' . http_build_query($prams);\n }", "private function match(string $url) : bool\n {\n foreach ($this->routes as $route => $params) {\n if (preg_match($route, $url, $matches)) {\n foreach ($matches as $key => $param) {\n if (is_string($key)) {\n $params[$key] = $param;\n }\n }\n $this->params = $params;\n return true;\n }\n }\n return false;\n }", "public function testParse_request_url__null() {\n\t$result = $this->object->parse_request_url(null);\n $this->assertTrue($result==array(),\n\t '$result did not match:'.print_r($result,1)\n\t);\n }", "private function processParams(string $uri, string $delimiter = ':'): string\n {\n if (strpos($uri, $delimiter) !== false) {\n preg_match_all(static::paramsRegex(), $uri, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $match) {\n $param = explode($delimiter, $match[1]);\n if (count($param) === 2) {\n $plain_var = htmlspecialchars(strip_tags($param[1]), ENT_QUOTES, 'UTF-8');\n $this->params[$param[0]] = $plain_var;\n $uri = str_replace($match[0], '', $uri);\n }\n }\n }\n return $uri;\n }", "private function spiltUrl()\n {\n // the .htaccess file.\n // TODO: create .htaccess file and add rule.\n if (isset($_GET['url'])) {\n // echo $_GET['url'];\n \n // Trim the last '/' from the url\n // so the http://example.com/sample/ will be http://example.com/sample\n $url = rtrim($_GET['url'], '/');\n \n $url = filter_var($url, FILTER_SANITIZE_URL);\n \n $url = explode('/', $url);\n \n // Put URL parts into the appropiate properties.\n $this->url_controller = (isset($url[0])) ? $url[0] : null;\n $this->url_action = (isset($url[1])) ? $url[1] : null;\n $this->url_parameter_1 = (isset($url[2])) ? $url[2] : null;\n $this->url_parameter_2 = (isset($url[3])) ? $url[3] : null;\n $this->url_parameter_3 = (isset($url[4])) ? $url[4] : null;\n }\n }", "public function validate($url);", "private function rescue_uri()\n\t{\n\t\t$query = $this->request->query_string;\n\n\t\tif (strpos($query, '&amp;') === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$query = html_entity_decode($query);\n\n\t\t$rc = parse_str($query, $this->request->params);\n\t}", "function fielding_youtube_params( $url ) {\n\treturn ((strpos($url, \"?\") < -1) ? \"?\" : \"&\") . \"autoplay=1&fs=1&rel=0\";\n}" ]
[ "0.66514355", "0.6615127", "0.65288806", "0.64697945", "0.64654154", "0.64058006", "0.63376915", "0.6289184", "0.6281281", "0.6243267", "0.6197642", "0.6167427", "0.61563504", "0.61347175", "0.6098976", "0.6085107", "0.6079851", "0.60264647", "0.5992272", "0.59860134", "0.59847295", "0.5974729", "0.5948796", "0.59240973", "0.5900394", "0.588218", "0.5860522", "0.58599824", "0.58553106", "0.58519626", "0.5849906", "0.5847964", "0.58413845", "0.58370966", "0.5809257", "0.58001566", "0.58001566", "0.57979894", "0.57963187", "0.5787538", "0.5782711", "0.5778747", "0.57665205", "0.57633245", "0.57597554", "0.57528096", "0.57458305", "0.57383573", "0.57379454", "0.5718979", "0.5718254", "0.5717732", "0.57127565", "0.5705559", "0.5673125", "0.56690556", "0.56643164", "0.5662254", "0.5661017", "0.56555986", "0.5645558", "0.5606362", "0.56027955", "0.5596241", "0.55941755", "0.55872333", "0.558232", "0.557797", "0.5573496", "0.5570801", "0.55683154", "0.55549103", "0.5554906", "0.5547969", "0.55429715", "0.5534233", "0.5525607", "0.5521985", "0.55005944", "0.5493622", "0.5490445", "0.5484769", "0.5478923", "0.5476657", "0.5467845", "0.5467262", "0.54664296", "0.54622597", "0.5461012", "0.5450123", "0.54484165", "0.54471767", "0.54448473", "0.54348814", "0.5431882", "0.54310924", "0.543037", "0.54278827", "0.54249895", "0.5419663", "0.54144156" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('modulo_subtema')->insert([ 'modulo_id' => Modulo::all()->random()->id, 'subtema_id' => Subtema::all()->random()->id, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Creates an HTTP server that invokes the given callback for each incoming HTTP request In order to process any connections, the server needs to be attached to an instance of `React\Socket\ServerInterface` which emits underlying streaming connections in order to then parse incoming data as HTTP. See also [listen()](listen) for more details.
public function __construct(LoopInterface $loop, $requestHandler) { if (!\is_callable($requestHandler)) { throw new \InvalidArgumentException('Invalid request handler given'); } $this->callback = $requestHandler; $this->clock = new Clock($loop); $this->parser = new RequestHeaderParser($this->clock); $that = $this; $this->parser->on('headers', function (ServerRequestInterface $request, ConnectionInterface $conn) use ($that) { $that->handleRequest($conn, $request); }); $this->parser->on('error', function(\Exception $e, ConnectionInterface $conn) use ($that) { $that->emit('error', array($e)); // parsing failed => assume dummy request and send appropriate error $that->writeError( $conn, $e->getCode() !== 0 ? $e->getCode() : Response::STATUS_BAD_REQUEST, new ServerRequest('GET', '/') ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serve($cb) {\n\t$offset = rand(0,2000);\n\tforeach (range(40000+$offset, 50000+$offset) as $port) {\n\t\tlogger(\"serve: Trying port %d\", $port);\n\t\tif (($server = @stream_socket_server(\"tcp://localhost:$port\"))) {\n\t\t\tfprintf(STDERR, \"%s\\n\", $port);\n\t\t\tlogger(\"serve: Using port %d\", $port);\n\t\t\tdo {\n\t\t\t\t$R = array($server); $W = array(); $E = array();\n\t\t\t\t$select = stream_select($R, $E, $E, 10, 0);\n\t\t\t\tif ($select && ($client = stream_socket_accept($server, 1))) {\n\t\t\t\t\tlogger(\"serve: Accept client %d\", (int) $client);\n\t\t\t\t\tif (getenv(\"PHP_HTTP_TEST_SSL\")) {\n\t\t\t\t\t\tstream_socket_enable_crypto($client, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$R = array($client);\n\t\t\t\t\t\twhile (!feof($client) && stream_select($R, $W, $E, 1, 0)) {\n\t\t\t\t\t\t\tlogger(\"serve: Handle client %d\", (int) $client);\n\t\t\t\t\t\t\t$cb($client);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger(\"serve: EOF/timeout on client %d\", (int) $client);\n\t\t\t\t\t} catch (Exception $ex) {\n\t\t\t\t\t\tlogger(\"serve: Exception on client %d: %s\", (int) $client, $ex->getMessage());\n\t\t\t\t\t\t/* ignore disconnect */\n\t\t\t\t\t\tif ($ex->getMessage() !== \"Empty message received from stream\") {\n\t\t\t\t\t\t\tfprintf(STDERR, \"%s\\n\", $ex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while ($select);\n\t\t\treturn;\n\t\t}\n\t}\n}", "public static function http_server(): void\n {\n sock::$type = 'http:server';\n sock::$host = '0.0.0.0';\n sock::$port = 80;\n $ok = sock::create();\n\n if (!$ok) exit('HTTP Server creation failed!');\n\n do {\n //IMPORTANT!!! Reset all data & read list & client list\n $data = $read = $client = [];\n\n //Accept new connection\n sock::accept($read, $client);\n\n //Read HTTP Request data\n $msg = sock::read($client);\n\n var_dump($msg);\n\n //Prepare simple data\n $key = key($client);\n $sock = current($client);\n\n $data[$key]['sock'] = $sock;\n\n $data[$key]['msg'] = 'Hello! I am a simple HTTP Server running under PHP~';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= 'Your request message was: ';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= trim(current($msg)['msg']);\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= 'Thanks for your test!';\n\n //Send to browser\n $result = sock::write($data, $client);\n\n var_dump($result);\n\n } while (true);\n }", "protected static function createListener($context)\n\t{\n\t\t$type = MHTTPD::$config['SSL']['enabled'] ? 'ssl' : 'tcp';\n\t\t$addr = MHTTPD::$config['Server']['address'];\n\t\t$port = MHTTPD::$config['Server']['port'];\n\n\t\tif (!(MHTTPD::$listener = stream_socket_server(\"{$type}://{$addr}:{$port}\", $errno, $errstr, \n\t\t\tSTREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context))\n\t\t\t) {\n\t\t\ttrigger_error(\"Could not create \".strtoupper($type).\" server socket\", E_USER_ERROR);\n\t\t}\n\n\t\tif (MHTTPD::$debug) {\n\t\t\tcecho(\"\\n\".chrule().\"\\n\");\n\t\t\tcecho(\"Created \".strtoupper($type).\" listener: \".stream_socket_get_name(MHTTPD::$listener, false).\"\\n\\n\");\n\t\t} else {\n\t\t\t$t = ($type == 'ssl') ? ' (SSL)' : '';\n\t\t\tcecho(\"Started MiniHTTPD server on {$addr}, port {$port}{$t} ...\\n\\n\");\n\t\t}\n\t}", "public function __construct()\n {\n $this->http = new swoole_http_server(self::HOST, self::PORT);\n\n $this->http->set([\n \"enable_static_handler\" => true,\n \"document_root\" => \"/home/alex/study/thinkphp/public/static/\",\n 'worker_num' => 2,\n 'task_worker_num' => 2,\n\n ]);\n\n $this->http->on(\"WorkerStart\", [$this, 'onWorkerStart']);\n $this->http->on(\"request\", [$this, 'onRequest']);\n $this->http->on(\"task\", [$this, 'onTask']);\n $this->http->on(\"finish\", [$this, 'onFinish']);\n $this->http->on(\"close\", [$this, 'onClose']);\n\n\n $this->http->start();\n }", "public function listen(callable $callback);", "public function listenHttp($port, $host = '127.0.0.1')\n {\n $socket = new SocketServer($this->loop);\n\n $http = new HttpServer($socket);\n $http->on('request', function (Request $request, Response $response) {\n $curl = curl_init();\n\n $baseHeaders = $request->getHeaders();\n $headers = [];\n foreach ($baseHeaders as $header => $headerValue) {\n $headers[] = \"$header: $headerValue\";\n }\n\n $headers[] = 'X-Proxy: http';\n \n curl_setopt($curl, CURLOPT_URL, $request->getUrl()->__toString());\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($curl, CURLOPT_HEADER, true);\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);\n $data = curl_exec($curl);\n\n $parsedData = $this->parseResponse($data);\n\n $response->writeHead($parsedData['code'], $parsedData['headers']);\n $response->end($parsedData['body']);\n\n });\n\n $socket->listen($port, $host);\n }", "public static function start(Closure $handler)\n {\n $address = getenv(self::CHILD_ADDRESS) ?: \"127.0.0.1:8080\";\n\n Loop::run(\n function () use ($handler, $address) {\n $sockets = [\n Server::listen($address),\n ];\n\n $server = new HttpServer(\n $sockets,\n new CallableRequestHandler(\n function (Request $request) use ($handler) {\n $body = yield $request->getBody()->buffer();\n\n $triggerRequest = new TriggerRequest();\n // Get the trigger request from the request body\n $triggerRequest->mergeFromJsonString($body);\n\n // Convert HTTP Request to Nitric Request\n $nitricRequest = \\Nitric\\Faas\\Request::fromTriggerRequest(\n $triggerRequest\n );\n\n $nitricResponse = $handler($nitricRequest);\n if ($nitricResponse instanceof \\Nitric\\Faas\\Response) {\n // Return the Nitric Response as an HTTP Response\n return self::httpResponse($nitricResponse);\n } else {\n $stringData = \"\";\n if (is_array($nitricResponse) || $nitricResponse instanceof stdClass) {\n $stringData = json_encode($nitricResponse);\n } else {\n $stringData = $nitricResponse;\n }\n // Assume simple string return for now...\n $defaultResponse = $nitricRequest->getDefaultResponse();\n $defaultResponse->setData($stringData);\n\n return self::httpResponse($defaultResponse);\n }\n }\n ),\n new Logger()\n );\n\n yield $server->start();\n\n // Stop the server gracefully when SIGINT is received.\n // This is technically optional, but it is best to call Server::stop().\n Loop::onSignal(\n SIGINT,\n function (string $watcherId) use ($server) {\n Loop::cancel($watcherId);\n yield $server->stop();\n }\n );\n }\n );\n }", "public function run(HttpServer $server = null): void\n {\n $this->startup();\n if ($server) {\n $server->addListener($this);\n $server->start();\n } else {\n $response = $this->handle(ServerRequest::fromGlobals());\n $this->emitter->emit($response);\n if ($response instanceof Response) {\n $response->end();\n }\n }\n\n $this->shutdown();\n }", "protected static function main()\n\t{\n\t\t// Create a TCP/SSL server socket context\n\t\t$context = MHTTPD::getContext();\n\t\t\n\t\t// Start the listener\n\t\tMHTTPD::createListener($context);\n\n\t\t// Initialize some handy vars\n\t\t$timeout = ini_get('default_socket_timeout');\n\t\t$maxClients = MHTTPD::$config['Server']['max_clients'];\n\t\t$maxHeaderBlockSize = MHTTPD_Message::getMaxHeaderBlockSize();\n\t\tif (MHTTPD::$debug) {\n\t\t\t$listener_name = stream_socket_get_name(MHTTPD::$listener, false);\n\t\t}\n\t\t\n\t\t// Start the browser\n\t\tMHTTPD::launchBrowser();\n\t\t\n\t\t// The main loop\n\t\twhile (MHTTPD::$running) \t{\t\n\t\t\n\t\t\t// Build a list of active streams to monitor\n\t\t\t$read = array('listener' => MHTTPD::$listener);\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t\t\t\t\t\t\n\t\t\t\t// Add any client sockets\n\t\t\t\tif ($csock = $client->getSocket()) {\n\t\t\t\t\t$read[\"client_$i\"] = $csock;\n\t\t\t\t\t\n\t\t\t\t\t// Add any client FCGI sockets\n\t\t\t\t\tif ($cfsock = $client->getFCGISocket()) {\n\t\t\t\t\t\t$read[\"clfcgi_$i\"] = $cfsock;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Add any client file streams\n\t\t\t\t\tif ($client->isStreaming()) {\n\t\t\t\t\t\t$read[\"clstrm_$i\"] = $client->getStream();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Add any aborted FCGI requests\n\t\t\tforeach (MHTTPD::$aborted as $aID=>$ab) {\n\t\t\t\t$read['aborted_'.$aID.'_'.$ab['client'].'_'.$ab['pid']] = $ab['socket'];\n\t\t\t}\n\n\t\t\tif (MHTTPD::$debug) {\n\t\t\t\tcecho(\"FCGI scoreboard:\\n\"); cprint_r(MFCGI::getScoreboard(true)); cecho(\"\\n\");\n\t\t\t\tcecho(\"Pre-select:\\n\"); cprint_r($read);\n\t\t\t\tcecho(chrule().\"\\n>>>> Waiting for server activity ($listener_name)\\n\".chrule().\"\\n\\n\");\n\t\t\t}\n\n\t\t\t// Wait for any new activity\n\t\t\tif (!($ready = @stream_select($read, $write=null, $error=null, null))) {\n\t\t\t\ttrigger_error(\"Could not select streams\", E_USER_WARNING);\n\t\t\t}\n\t\t\t\n\t\t\tif (MHTTPD::$debug) {cecho(\"Post-select:\\n\"); cprint_r($read);}\n\t\t\t\t\t\t\n\t\t\t// Check if the listener has a new client connection\n\t\t\tif (in_array(MHTTPD::$listener, $read)) {\n\t\t\t\t\n\t\t\t\t// Search for a free slot to add the new client\n\t\t\t\tfor ($i = 1; $i <= $maxClients; $i++) {\n\t\t\t\t\t\n\t\t\t\t\tif (!isset(MHTTPD::$clients[$i])) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// This slot is free, so add the new client connection\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"New client ($i): \");}\n\t\t\t\t\t\tif (!($sock = @stream_socket_accept(MHTTPD::$listener, $timeout, $peername))) {\n\t\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"\\nCould not accept client stream\\n\");}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"$peername\\n\");}\n\t\t\t\t\t\t$client = new MHTTPD_Client($i, $sock, $peername);\n\t\t\t\t\t\t$client->debug = MHTTPD::$debug;\n\t\t\t\t\t\tMHTTPD::$clients[$i] = $client;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t} elseif ($i == $maxClients) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// No free slots, so the request goes to the backlog\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"No free client slots!\\n\");}\n\t\t\t\t\t\ttrigger_error(\"Too many clients\", E_USER_NOTICE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Return to waiting if only the listener is active\n\t\t\t\tif ($ready == 1) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"No other connections to handle\\n\\n\");}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Handle any incoming client data on selected sockets\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t \n\t\t\t\tif (MHTTPD::$debug) {cecho(\"Client ($i) ... \");}\n\t\t\t\t$csock = $client->getSocket();\n\n\t\t\t\t// Handle any new client requests\n\t\t\t\tif ($client->isReady() && $csock && in_array($csock, $read)) {\n\t\t\t\t\n\t\t\t\t\t// Start reading the request\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"reading ... \");}\n\t\t\t\t\t$client->setTimeout(10);\n\t\t\t\t\t$input = '';\n\t\t\t\t\t\n\t\t\t\t\t// Get the request header block only\n\t\t\t\t\twhile ($buffer = @fgets($csock, 1024)) {\n\t\t\t\t\t\t$input .= $buffer;\n\t\t\t\t\t\tif ($buffer == '' || substr($input, -4) == \"\\r\\n\\r\\n\" \n\t\t\t\t\t\t\t|| strlen($input) > $maxHeaderBlockSize\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($input) {\n\t\t\t\t\t\n\t\t\t\t\t\t// Store the headers and process the request\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"done\\n\");}\n\t\t\t\t\t\t$client->setInput(trim($input));\n\t\t\t\t\t\tif (!$client->processRequest() && !$client->needsAuthorization()) {\n\t\t\t\t\t\t\tMHTTPD::removeClient($client);\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// No request data, client is disconnecting\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"disconnected\\n\");}\n\t\t\t\t\t\tMHTTPD::removeClient($client);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Handle any request body data\n\t\t\t\t} elseif ($client->isPosting() && $csock && in_array($csock, $read)) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"reading body \");}\n\t\t\t\t\t$client->readRequestBody();\n\t\t\t\t\n\t\t\t\t// Handle any disconnects or malformed requests\n\t\t\t\t} elseif ($csock && in_array($csock, $read)) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"aborted connection\\n\");}\n\t\t\t\t\tMHTTPD::removeClient($client);\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t// Handle any inactive client connections\n\t\t\t\t} else {\n\t\t\t\t\tif (MHTTPD::$debug) {\n\t\t\t\t\t\tcecho('inactive (');\n\t\t\t\t\t\tcecho('req:'.$client->hasRequest());\n\t\t\t\t\t\tcecho(' resp:'.$client->hasResponse());\n\t\t\t\t\t\tcecho(' fcgi:'.$client->hasFCGI());\n\t\t\t\t\t\tcecho(\")\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Handle any incoming FCGI responses\n\t\t\t\tif (($clfsock = $client->getFCGISocket()) && in_array($clfsock, $read)) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"Client ($i) ... reading FCGI socket: {$clfsock}\\n\");}\n\t\t\t\t\tif (!$client->readFCGIResponse()) {\n\t\t\t\t\t\tMHTTPD::removeClient($client); // abort any hanging connections\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle any outgoing FCGI requests\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t\t\tif ($client->hasFCGI() && !$client->hasSentFCGI()\n\t\t\t\t\t&& (!$client->isPosting() || $client->hasFullRequestBuffer())\n\t\t\t\t\t) {\n\t\t\t\t\tif (MHTTPD::$debug){cecho(\"Client ($i) ... sending FCGI request\\n\");}\n\t\t\t\t\tif (!$client->sendFCGIRequest()) {\n\t\t\t\t\t\tMHTTPD::removeClient($client); // abort any failed connections\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Handle any outgoing client responses\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t\t\tif ($client->hasRequest()) {\n\t\t\t\t\tif (!$client->isPosting() && $client->hasSentFCGI() && !$client->hasResponse()) {\n\t\t\t\t\t\tif (MHTTPD::$debug){cecho(\"Client ($i) ... waiting for FCGI response\\n\");}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} elseif ($client->needsAuthorization()) {\n\t\t\t\t\t\tif (MHTTPD::$debug){cecho(\"Client ($i) ... waiting for authorization\\n\");}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} elseif ($client->hasResponse()) {\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"Client ($i) ... handling response\\n\");}\n\t\t\t\t\t\tMHTTPD::handleResponse($client);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t// Handle any aborted FCGI requests\n\t\t\tforeach ($read as $r) {\n\t\t\t\tforeach (MHTTPD::$aborted as $aID=>$ab) {\n\t\t\t\t\tif ($r == $ab['socket']) {\n\t\t\t\t\t\tMFCGI::removeClient($ab['process']);\n\t\t\t\t\t\tMHTTPD::closeSocket($r);\n\t\t\t\t\t\tunset(MHTTPD::$aborted[$aID]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// End of main loop\n\t\t\tif (MHTTPD::$debug) {cecho(\"\\n\");}\n\t\t}\n\t\t\n\t\t// Quit the server cleanly\n\t\tMHTTPD::shutdown();\n\t}", "private function createHttpHandler()\n {\n $this->httpMock = new MockHandler();\n\n $handlerStack = HandlerStack::create($this->httpMock);\n $handlerStack->push(Middleware::history($this->curlHistory));\n\n $this->client = new Client(['handler' => $handlerStack]);\n\n app()->instance(Client::class, $this->client);\n }", "public function onRequest(StreamServerNodeInterface $client, HttpRequest $request);", "public function run(Closure $loopCallback = null): Server {\n $this->_stream->stop()\n ->start();\n\n $condition = ($loopCallback ?? function() {\n return true;\n });\n\n while ($condition($this)) {\n $timeout = empty($this->_messages) ? 1000 : 1;\n $message = $this->_stream->select($timeout);\n if ($message) {\n $this->_messages[] = $message;\n }\n\n foreach ($this->_messages as $key => $message) { /* @var $message IMessage */\n try {\n $message->notify();\n if ($message->isCompleted() || $message->isTimeoutReached()) {\n unset($this->_messages[$key]);\n $message->close();\n }\n } catch (Exception $e) {\n $this->_errors[] = $e;\n $message->close();\n unset($this->_messages[$key]);\n }\n }\n }\n\n return $this;\n }", "public static function listen(Closure $callback)\n {\n }", "public function request($callback, $url, array $postVariables = null)\n {\n $components = $this->parseUrl($url);\n \n if ($components === null || $components['scheme'] === 'https') {\n return false;\n }\n \n $this->callback = $callback;\n\n $address = gethostbyname($components['host']);\n\n if (ip2long($address) === false || ($address === gethostbyaddr($address)\n && preg_match(\"#.*\\.[a-zA-Z]{2,3}$#\", $host) === 0) )\n {\n return false;\n }\n \n $this->socket = @socket_create(AF_INET, SOCK_STREAM, 0);\n\n if ($this->socket === false) {\n return false;\n }\n\n $connected = @socket_connect($this->socket, $address, $components['port']);\n \n if (!$connected) {\n return false;\n }\n \n $this->reactor->addReader($this->socket, array($this, 'receiveData'));\n \n $data = \"GET \" . $components['path'] . \"?\" . $components['query'] . \" HTTP/1.1\\r\\n\"\n . \"Host: \" . $components['host'] . \"\\r\\n\"\n . \"Connection: Close\\r\\n\\r\\n\";\n\n socket_write($this->socket, $data);\n \n return true;\n }", "public function createNetworkWebhooksHttpServerAsync($network_id, $create_network_webhooks_http_server)\n {\n return $this->createNetworkWebhooksHttpServerAsyncWithHttpInfo($network_id, $create_network_webhooks_http_server)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function run(Server $server = null): void\n {\n $this->startup();\n if ($server) {\n $server->addListener($this);\n $server->start();\n } else {\n $response = $this->handle(ServerRequest::fromGlobals());\n $this->emitter->emit($response);\n if ($response instanceof Response) {\n $response->end();\n }\n }\n\n $this->shutdown();\n }", "public function __construct(LoopInterface $loop, array $serverParams = [])\n {\n $this->loop = $loop;\n $this->serverParams = array_replace([], self::DEFAULT_SERVER_PARAMS, $serverParams, [\n 'loop' => $loop\n ]);\n $onError = function (Throwable $error) {\n $this->emit('error', [$error]);\n };\n $this->requestParser = new RequestParser($this->serverParams);\n $this->matcherFactory = new MatcherFactory($this->serverParams);\n $this->filters = new FilterCollection($this->serverParams);\n $this->routes = new RouteCollection($this->serverParams, $this->matcherFactory);\n $this->negotiator = new WebSocketNegotiator($this->serverParams);\n $this->webSocketHandlers = new WebSocketHandlerFactory($this->serverParams);\n $this->controllerManager = new ControllerManager($this->serverParams, $onError);\n $this->tcpServer = $this->createTcpServer($loop);\n $this->tcpServer->on('error', $onError);\n $this->tcpConnections = new TcpConnections($this->tcpServer, function (ConnectionInterface $connection) {\n $this->onTcpConnection($connection);\n });\n $this->addShutdownSignals($this->serverParams);\n }", "public function listen (array $options = [])\r\n\t\t{\r\n\t\t\t\tif ($this -> isListening ())\r\n\t\t\t\t{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;\r\n\t\t\t\t$context = stream_context_create ($options);\r\n\t\t\t\t$scheme = (string) $this -> getTransport () . '://' . $this -> getAddress () . ':' . $this -> getPort ();\r\n\t\t\t\t$resourcePointer = stream_socket_server ($scheme, $errno, $errstr, $flags, $context);\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Determine on which port we bound.\r\n\t\t\t\t*/\r\n\t\t\t\tif ($this -> getPort () == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t\t$localAddress = stream_socket_get_name ($resourcePointer, false);\r\n\t\t\t\t\t\t$port = substr ($localAddress, strrpos ($localAddress, ':') + 1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this -> setPort ($port);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Check if we succeeded to make the resource\r\n\t\t\t\t*/\r\n\t\t\t\tif (!is_resource ($resourcePointer) || $errno || $errstr )\r\n\t\t\t\t{\r\n\t\t\t\t\t\tthrow new SocketException (sprintf ('Failed to create socket resource, error: %s', $errstr));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Callback for when a new connection has been received.\r\n\t\t\t\t*/\r\n\t\t\t\t$acceptCallback = function (PollerInterface $pollerInterface, $resourcePointer)\r\n\t\t\t\t{\r\n\t\t\t\t\t\tif (false === $newConnection = stream_socket_accept ($resourcePointer))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$event = new AcceptingFailedEvent ($this);\r\n\t\t\t\t\t\t\t\t$this -> dispatch (SocketEvents :: SOCK_EXCEPTION, $event);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$socket = $this -> handleNewConnection ($newConnection);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($this -> getTransport () == self :: TRANSPORT_SSL)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$socket -> setTransport (ClientStream :: TRANSPORT_SSL);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$event = new AcceptingSucceededEvent ($this, $socket);\r\n\t\t\t\t\t\t$this -> dispatch (SocketEvents :: SOCK_ACCEPTED_CONN, $event);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Insert callback into poller\r\n\t\t\t\t*/\r\n\t\t\t\t$this -> pollerInstance -> addReadStream ($resourcePointer, $acceptCallback);\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Finishing up..\r\n\t\t\t\t*/\r\n\t\t\t\t$this -> currentState = self :: STATE_LISTENING;\r\n\t\t\t\t$this -> resourcePointer = $resourcePointer;\r\n\t\t\t\t$this -> resourcePointerId = (int) $resourcePointer;\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t}", "function server_loop($address, $port)\n{\n GLOBAL $__server_listening;\n\n if(($sock = socket_create(AF_INET, SOCK_STREAM, 0)) < 0)\n {\n echo \"failed to create socket: \".socket_strerror($sock).\"\\n\";\n exit();\n }\n\n if(($ret = socket_bind($sock, $address, $port)) < 0)\n {\n echo \"failed to bind socket: \".socket_strerror($ret).\"\\n\";\n exit();\n }\n\n if( ( $ret = socket_listen( $sock, 0 ) ) < 0 )\n {\n echo \"failed to listen to socket: \".socket_strerror($ret).\"\\n\";\n exit();\n }\n\n socket_set_nonblock($sock);\n \n echo \"waiting for clients to connect\\n\";\n\n while ($__server_listening)\n {\n $connection = @socket_accept($sock);\n if ($connection === false)\n {\n usleep(100);\n }elseif ($connection > 0)\n {\n handle_client($sock, $connection);\n }else\n {\n echo \"error: \".socket_strerror($connection);\n die;\n }\n }\n}", "function server_loop($address, $port)\n{\n GLOBAL $fh;\n GLOBAL $__server_listening;\n\t\n\t//printLog($fh, \"server_looping...\");\n\n if(($sock = socket_create(AF_INET, SOCK_STREAM, 0)) < 0)\n {\n\t\t//printLog($fh, \"failed to create socket: \".socket_strerror($sock));\n exit();\n }\n\n\tif(($ret = socket_bind($sock, $address, $port)) < 0)\n\t{\n\t\t//printLog($fh, \"failed to bind socket: \".socket_strerror($ret));\n\t\texit();\n\t}\n\n\tif( ( $ret = socket_listen( $sock, 0 ) ) < 0 )\n\t{\n\t\t//printLog($fh, \"failed to listen to socket: \".socket_strerror($ret));\n\t\texit();\n\t}\n\n\tsocket_set_nonblock($sock);\n\n\t//printLog($fh, \"waiting for clients to connect...\");\n\n\twhile ($__server_listening)\n\t{\n\t\t$connection = @socket_accept($sock);\n\t\tif ($connection === false)\n\t\t{\n\t\t\tusleep(100);\n\t\t} elseif ($connection > 0) {\n\t\t\thandle_client($sock, $connection);\n\t\t} else {\n\t\t\t//printLog($fh, \"error: \".socket_strerror($connection));\n\t\t\tdie;\n\t\t}\n\t}\n}", "public function listen(Closure $callback)\n {\n if(isset($this->events)) {\n $this->events->listen(RequestExecuted::class, $callback);\n }\n }", "public static function createSocket($uri, array $context = [])\n {\n if ((string)(int)$uri === (string)$uri) {\n $uri = '127.0.0.1:' . $uri;\n }\n\n // assume default scheme if none has been given\n if (\\strpos($uri, '://') === false) {\n $uri = 'tcp://' . $uri;\n }\n\n // parse_url() does not accept null ports (random port assignment) => manually remove\n if (\\substr($uri, -2) === ':0') {\n $parts = \\parse_url(\\substr($uri, 0, -2));\n if ($parts) {\n $parts['port'] = 0;\n }\n } else {\n $parts = \\parse_url($uri);\n }\n\n // ensure URI contains TCP scheme, host and port\n if (!$parts || !isset($parts['scheme'], $parts['host'], $parts['port']) || $parts['scheme'] !== 'tcp') {\n throw new \\InvalidArgumentException('Invalid URI \"' . $uri . '\" given');\n }\n\n if (false === \\filter_var(\\trim($parts['host'], '[]'), \\FILTER_VALIDATE_IP)) {\n throw new \\InvalidArgumentException('Given URI \"' . $uri . '\" does not contain a valid host IP');\n }\n\n $socket = @\\stream_socket_server(\n $uri,\n $errno,\n $errstr,\n \\STREAM_SERVER_BIND | \\STREAM_SERVER_LISTEN,\n \\stream_context_create(['socket' => $context + ['backlog' => 511]])\n );\n\n if (false === $socket) {\n throw new \\RuntimeException('Failed to listen on \"' . $uri . '\": ' . $errstr, $errno);\n }\n\n return $socket;\n }", "public function createServer($config = array()) {\n $this->server = new LimelightServer($config);\n }", "function with_dev_server(callable $callback): void\n{\n start_dev_server();\n $callback();\n stop_dev_server();\n}", "public function run()\n {\n $serv = new \\swoole_server($this->host, $this->port);\n $serv->set(\n array(\n 'process_name' => 'ershoufang_crawler', //swoole 进程名称\n 'worker_num' => 2,//开启的worker进程数\n 'task_worker_num' => 2,//开启的task进程数\n 'open_cpu_affinity' => true,\n 'daemonize' => false,\n 'max_request' => 10000,\n 'dispatch_mode' => 2,\n 'debug_mode' => 0,\n 'log_file' => 'swoole.log',\n 'open_tcp_nodelay' => true,\n \"task_ipc_mode\" => 2,\n 'task_max_request' => 10000\n )\n );\n\n $serv->on('Start', array($this, 'onStart'));\n $serv->on('Connect', array($this, 'onConnect'));\n $serv->on('Receive', array($this, 'onReceive'));\n $serv->on('WorkerStart', array($this, 'onWorkerStart'));\n $serv->on('Task', array($this, 'onTask'));\n $serv->on('Finish', array($this, 'onFinish'));\n $serv->on('Close', array($this, 'onClose'));\n $serv->start();\n }", "public function run(callable $callback)\n {\n ApiHandler::register($this->url, $this->method, $callback);\n }", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "public function createServer(\n IContext $ctx\n ): IServer;", "public function listen(): static\n {\n $this->breakLoop = false;\n $this->listening = true;\n\n $baseTime = microtime(true);\n $times = [];\n $lastCycle = $baseTime;\n $this->generateMaps = false;\n $this->generateMaps();\n\n $this->startSignalHandlers();\n $this->breakLoop = false;\n\n while (!$this->breakLoop) {\n $socketCount = count($this->sockets);\n $streamCount = count($this->streams);\n $signalCount = count($this->signals);\n $timerCount = count($this->timers);\n\n if ($this->generateMaps) {\n $this->generateMaps();\n }\n\n $hasHandler = false;\n\n\n // Timers\n if (!empty($this->timers)) {\n $hasHandler = true;\n $time = microtime(true);\n\n foreach ($this->timers as $id => $binding) {\n if ($binding->frozen) {\n continue;\n }\n\n $dTime = $times[$id] ?? $baseTime;\n $diff = $time - $dTime;\n\n if ($diff > $binding->duration) {\n $times[$id] = $time;\n $binding->trigger(null);\n }\n }\n }\n\n\n\n // Signals\n if (!empty($this->signals) && $this->hasPcntl) {\n $hasHandler = true;\n pcntl_signal_dispatch();\n }\n\n // Sockets\n if (!empty($this->socketMap)) {\n $hasHandler = true;\n $e = null;\n\n /** @var array<int, resource|Socket> $read */\n $read = $this->socketMap[self::RESOURCE][self::READ];\n /** @var array<int, resource|Socket> $write */\n $write = $this->socketMap[self::RESOURCE][self::WRITE];\n\n try {\n /* @phpstan-ignore-next-line */\n $res = socket_select($read, $write, $e, 0, 10000);\n } catch (Throwable $e) {\n $res = false;\n }\n\n if ($res === false) {\n // TODO: deal with error\n } elseif ($res > 0) {\n foreach ($read as $resourceId => $socket) {\n foreach (Coercion::toArray(\n $this->socketMap[self::HANDLER][self::READ][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($socket);\n }\n }\n\n foreach ($write as $resourceId => $socket) {\n foreach (Coercion::toArray(\n $this->socketMap[self::HANDLER][self::WRITE][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($socket);\n }\n }\n }\n\n // TODO: add timeout handler\n }\n\n // Streams\n if (!empty($this->streamMap)) {\n $hasHandler = true;\n $e = null;\n\n /** @var array<int, resource> $read */\n $read = $this->streamMap[self::RESOURCE][self::READ];\n /** @var array<int, resource> $write */\n $write = $this->streamMap[self::RESOURCE][self::WRITE];\n\n try {\n $res = stream_select($read, $write, $e, 0, 10000);\n } catch (Throwable $e) {\n $res = false;\n }\n\n\n if ($res === false) {\n // TODO: deal with error\n } elseif ($res > 0) {\n foreach ($read as $resourceId => $stream) {\n foreach (Coercion::toArray(\n $this->streamMap[self::HANDLER][self::READ][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($stream);\n }\n }\n\n foreach ($write as $resourceId => $stream) {\n foreach (Coercion::toArray(\n $this->streamMap[self::HANDLER][self::WRITE][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($stream);\n }\n }\n }\n\n // TODO: add timeout handler\n }\n\n\n // Tick\n if (\n !$this->breakLoop &&\n $this->tickHandler\n ) {\n if (false === ($this->tickHandler)($this)) {\n $this->breakLoop = true;\n }\n }\n\n // Cycle\n if (\n !$this->breakLoop &&\n $this->cycleHandler\n ) {\n $time = microtime(true);\n\n if ($time - $lastCycle > 1) {\n $lastCycle = $time;\n\n if (false === ($this->cycleHandler)(++$this->cycles, $this)) {\n $this->breakLoop = true;\n }\n }\n }\n\n\n if (!$hasHandler) {\n $this->breakLoop = true;\n } elseif (\n $socketCount !== count($this->sockets) ||\n $streamCount !== count($this->streams) ||\n $signalCount !== count($this->signals) ||\n $timerCount !== count($this->timers)\n ) {\n $this->generateMaps = true;\n }\n\n usleep(30000);\n }\n\n $this->breakLoop = false;\n $this->listening = false;\n\n $this->stopSignalHandlers();\n\n return $this;\n }", "public function listen() :void {\n\n echo \"Starting websocket server on... \" . $this->address . \":\" . $this->port;\n \n socket_listen($this->server);\n socket_set_nonblock($this->server);\n $this->clients[] = new WebSocket($this->server);\n\n do {\n\n $read = array_map(function($ws) {return $ws->socket;}, $this->clients);\n $write = null; \n $except = null;\n\n $ready = socket_select($read, $write, $except, 0);\n if ($ready === false) {\n if ($this->onError !== null) {\n $callback = $this->onError;\n $callback(\"[\".socket_last_error().\"]\".\" \".socket_strerror(socket_last_error()));\n }\n\n return;\n }\n\n if ($ready < 1) continue;\n\n // check if there is a client trying to connect.\n if (in_array($this->server, $read)) {\n if (($client = socket_accept($this->server)) !== false) {\n\n // send websocket handshake headers.\n if (!$this->sendHandshakeHeaders($client)) {\n continue;\n }\n\n // add the new client to the $clients array.\n $ws = new WebSocket($client);\n $this->clients[] = $ws;\n\n // call \"connection\" event handler for each new client.\n if ($this->onConnect !== null) {\n $callback = $this->onConnect;\n $callback($ws);\n }\n\n // remove the listening socket from the clients-with-data array.\n $key = array_search($this->server, $read);\n unset($read[$key]);\n }\n }\n\n foreach ($read as $key => $client) {\n\n $buffer = \"\";\n $bytes = @socket_recv($client, $buffer, 2048, 0);\n\n // check if the client is disconnected.\n if ($bytes === false) {\n\n // remove client from $clients array\n // and call disconnect event handler.\n unset($this->clients[$key]);\n if ($this->onDisconnect !== null) {\n $callback = $this->onDisconnect;\n $callback();\n }\n\n continue;\n }\n\n $ws = $this->clients[$key];\n $callback = $ws->onMessage;\n if ($callback !== null) {\n $callback($ws, $this->unmask($buffer));\n }\n }\n } while (true);\n socket_close($this->server);\n }", "public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next);", "public function createNetworkWebhooksHttpServer($network_id, $create_network_webhooks_http_server)\n {\n list($response) = $this->createNetworkWebhooksHttpServerWithHttpInfo($network_id, $create_network_webhooks_http_server);\n return $response;\n }", "public function createSocket()\n {\n //Create TCP/IP sream socket\n $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n //reuseable port\n socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1);\n\n //bind socket to specified host\n socket_bind($this->socket, 0, $this->port);\n\n //listen to port\n socket_listen($this->socket);\n\n //create & add listning socket to the list\n $this->clients[0] = [\n $this->socket\n ];\n }", "public function handle(\n ServerRequestInterface $request,\n ResponseInterface $response,\n callable $next = null\n ) : ResponseInterface;", "public function createServer(Websocket $websocket) : Promise\n {\n $socket = SocketServer::listen('tcp://127.0.0.1:0');\n $port = $socket->getAddress()->getPort();\n $server = new Server([$socket], $websocket, new NullLogger());\n return call(static function () use($server, $port) {\n (yield $server->start());\n return [$server, $port];\n });\n }", "private function createEventListenerForStream($callback)\n {\n $logger = $this->getLogger();\n\n $function = function (MessageEvent $event) use ($callback, $logger) {\n $protocol = $event->getProtocolMessage();\n\n if ($protocol === null) {\n $logger->debug('Incompatable message: '.$event->getMessage());\n\n return;\n }\n\n $routing = $event->getMessage()->getRoutingInformation();\n\n call_user_func($callback, $protocol, $routing);\n\n return;\n };\n\n return $function;\n }", "function xmlrpc_server($callbacks) {\n $xmlrpc_server = new stdClass();\n // Define built-in XML-RPC method names\n $defaults = array(\n 'system.multicall' => 'xmlrpc_server_multicall',\n array(\n 'system.methodSignature',\n 'xmlrpc_server_method_signature',\n array('array', 'string'),\n 'Returns an array describing the return type and required parameters of a method.'\n ),\n array(\n 'system.getCapabilities',\n 'xmlrpc_server_get_capabilities',\n array('struct'),\n 'Returns a struct describing the XML-RPC specifications supported by this server.'\n ),\n array(\n 'system.listMethods',\n 'xmlrpc_server_list_methods',\n array('array'),\n 'Returns an array of available methods on this server.'),\n array(\n 'system.methodHelp',\n 'xmlrpc_server_method_help',\n array('string', 'string'),\n 'Returns a documentation string for the specified method.')\n );\n // We build an array of all method names by combining the built-ins\n // with those defined by modules implementing the _xmlrpc hook.\n // Built-in methods are overridable.\n foreach (array_merge($defaults, (array)$callbacks) as $key => $callback) {\n // we could check for is_array($callback)\n if (is_int($key)) {\n $method = $callback[0];\n $xmlrpc_server->callbacks[$method] = $callback[1];\n $xmlrpc_server->signatures[$method] = $callback[2];\n $xmlrpc_server->help[$method] = $callback[3];\n }\n else {\n $xmlrpc_server->callbacks[$key] = $callback;\n $xmlrpc_server->signatures[$key] = '';\n $xmlrpc_server->help[$key] = '';\n }\n }\n\n $data = file_get_contents('php://input');\n if (!$data) {\n die('XML-RPC server accepts POST requests only.');\n }\n $xmlrpc_server->message = xmlrpc_message($data);\n if (!xmlrpc_message_parse($xmlrpc_server->message)) {\n xmlrpc_server_error(-32700, t('Parse error. Request not well formed.'));\n }\n if ($xmlrpc_server->message->messagetype != 'methodCall') {\n xmlrpc_server_error(-32600, t('Server error. Invalid XML-RPC. Request must be a methodCall.'));\n }\n if (!isset($xmlrpc_server->message->params)) {\n $xmlrpc_server->message->params = array();\n }\n xmlrpc_server_set($xmlrpc_server);\n $result = xmlrpc_server_call($xmlrpc_server, $xmlrpc_server->message->methodname, $xmlrpc_server->message->params);\n\n if (is_object($result) && !empty($result->is_error)) {\n xmlrpc_server_error($result);\n }\n // Encode the result\n $r = xmlrpc_value($result);\n // Create the XML\n $xml = '\n<methodResponse>\n <params>\n <param>\n <value>'.\n xmlrpc_value_get_xml($r)\n .'</value>\n </param>\n </params>\n</methodResponse>\n\n';\n // Send it\n xmlrpc_server_output($xml);\n}", "public static function tcp_server(): void\n {\n sock::$type = 'tcp:server';\n sock::$host = '0.0.0.0';\n sock::$port = 1000;\n $ok = sock::create();\n\n if (!$ok) exit('TCP Server creation failed!');\n\n //Set Client list alone\n $client = [];\n\n do {\n //Copy client list to read list\n $read = $client;\n\n //Listen to TCP port\n sock::listen($read);\n\n //Accept new connection\n sock::accept($read, $client);\n\n //Read TCP Data\n $msg = sock::read($read, $client);\n\n var_dump($msg);\n\n //Regroup data\n $data = [];\n\n //example: from message and send back to client\n foreach ($msg as $key => $value) {\n //Client socket resource\n $data[$key]['sock'] = $client[$key];\n //Message to be sent\n $data[$key]['msg'] = 'Hello, dear sender!';\n $data[$key]['msg'] .= PHP_EOL;\n $data[$key]['msg'] .= 'I received your message, and now send it back.';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= '====================================================================';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= $value['msg'];\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= '====================================================================';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= 'Thanks for your test!';\n }\n\n //Send data back and maintain clients\n $result = sock::write($data, $client);\n\n var_dump($result);\n\n } while (true);\n }", "public static function tcp_server(): void\n {\n sock::$type = 'tcp:server';\n sock::$host = '0.0.0.0';\n sock::$port = self::port;\n $ok = sock::create();\n\n if (!$ok) exit('TCP Server creation failed!');\n\n //Set Client list alone\n $client = [];\n\n do {\n //Copy client list to read list\n $read = $client;\n\n //Listen to TCP port\n sock::listen($read);\n\n //Accept new connection\n sock::accept($read, $client);\n\n //Read TCP Data\n $msg = sock::read($read, $client);\n\n var_dump($msg);\n\n $data = [];\n\n //example: from message and send back to client\n foreach ($client as $k => $v) {\n foreach ($msg as $key => $value) {\n $data[$k]['sock'] = $v;\n $data[$k]['msg'] = $key !== $k ? $value['msg'] : 'OK! ' . count($client) . ' players are online waiting!';\n }\n }\n\n //Send data back and maintain clients\n $result = sock::write($data, $client);\n\n var_dump($result);\n\n } while (true);\n }", "public function createNetworkWebhooksHttpServerAsyncWithHttpInfo($network_id, $create_network_webhooks_http_server)\n {\n $returnType = 'object';\n $request = $this->createNetworkWebhooksHttpServerRequest($network_id, $create_network_webhooks_http_server);\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 }", "protected function bindSwooleServer()\n {\n $this->app->singleton('swoole.server', function () {\n return $this->server;\n });\n }", "public function onListen(callable $callback) : SystemBroadcast {\n\n\t\t\t$this->onListenHandlers[] = $callback;\n\n\t\t\treturn $this;\n\t\t}", "private static function stream_setup($callback, $streamUrl) {\n self::$callback = $callback;\n\n //Authenticate the socket to Oanda\n self::authenticate(($streamHandle = curl_init()));\n\n //Setup the stream\n curl_setopt($streamHandle, CURLOPT_URL, $streamUrl);\n\n //Our callback, called for every new data packet\n curl_setopt($streamHandle, CURLOPT_WRITEFUNCTION, 'self::stream_callback');\n\n return $streamHandle;\n }", "public function listen();", "public function initTcpListenServer()\n {\n $listenConfig = config('websocketlogin.listern');\n $this->listern = $this->server->addListener($listenConfig['uri'], $listenConfig['port'], $listenConfig['type']);\n return $this->listern;\n }", "protected function listen()\n {\n do {\n $data = fgets($this->socket, 512);\n if (!empty($data)) {\n $request = $this->receive($data);\n $cmd = strtolower($request->getCommand());\n\n if ($cmd === 'privmsg') {\n $event_name = 'message.' . ($request->isPrivateMessage() ? 'private' : 'channel');\n } else {\n $event_name = 'server.' . $cmd;\n }\n\n // Skip processing if the incoming message is from the bot\n if ($request->getSendingUser() === $this->config['nick']) {\n continue;\n }\n\n $event = new Event($request);\n $this->dispatcher->dispatch($event_name, $event);\n $responses = $event->getResponses();\n\n if (!empty($responses)) {\n $this->send($responses);\n }\n }\n } while (!feof($this->socket));\n }", "public static function run()\n {\n// $server = IoServer::factory(new WsServer(new WebSocket()), 8080);\n// echo \"websocket do run...\";\n// $server->run();\n// echo \"websocket sever up...\";\n React::runWampServer();\n }", "public static function start($config)\n\t{\n\t\t// Add the config\n\t\tif (!is_array($config)) {\n\t\t\ttrigger_error(\"Cannot start server, invalid configuration settings\", E_USER_ERROR);\n\t\t}\n\t\tMHTTPD::addConfig($config);\n\n\t\t// Load the mime types info\n\t\t$mimes = @parse_ini_file(MHTTPD::getExepath().'lib\\minihttpd\\config\\mimes.ini', true);\n\t\tMHTTPD::$config['Mimes'] = array_map('listToArray', $mimes['Mimes']);\n\t\t\n\t\t// Set the initial server info values\n\t\tMHTTPD::$info['software'] = 'MiniHTTPD/'.MHTTPD::VERSION.' ('.php_uname('s').')';\n\t\t$addr = $config['Server']['address'];\n\t\t$port = $config['Server']['port'];\n\t\tMHTTPD::$info['signature'] = 'MiniHTTPD/'.MHTTPD::VERSION.' ('.php_uname('s').\") Server at {$addr} Port {$port}\";\n\t\tMHTTPD::$info['launched'] = time();\n\t\t\n\t\t// Spawn any FCGI processes\n\t\tMFCGI::$debug = MHTTPD::$debug;\n\t\tMFCGI::spawn(null, MHTTPD::$config);\n\t\n\t\t// Load the configured request handlers\n\t\tif (MHTTPD::$debug) {cecho(chrule().\"\\n\");}\n\t\tforeach (MHTTPD::$config['Handlers'] as $type=>$handler) {\n\t\t\tif (class_exists($handler)) {\n\t\t\t\tif (MHTTPD::$debug) {cecho(\"Handler loaded ... $type\\n\");}\n\t\t\t\tMHTTPD::$handlers[$type] = new $handler;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Create the queue object for the handlers\n\t\tMHTTPD::$handlersQueue = new MHTTPD_Handlers_Queue(MHTTPD::$handlers);\n\t\t\n\t\t// Start running the main loop\n\t\tMHTTPD::$running = true;\n\t\tMHTTPD::main();\n\t}", "public function startListening();", "public function __construct ( \\Hoa\\Socket\\Server $server ) {\n\n $this->_server = $server;\n $this->_server->setNodeName('\\Hoa\\Websocket\\Node');\n $this->_on = new \\Hoa\\Core\\Event\\Listener($this, array(\n 'message',\n 'close',\n 'error'\n ));\n\n return;\n }", "public function start()\n {\n $this->server->on(\"open\", [$this, 'wsOpen']);\n $this->server->on(\"message\", [$this, 'wsMessage']);\n $this->server->on(\"close\", [$this, 'wsClose']);\n\n $this->server->start();\n }", "public function listen(Closure $callback)\n {\n if ( isset ( $this->events ) ) {\n $this->events->listen ( 'leaps.query', $callback );\n }\n }", "public function listen($listener);", "public static function listen($callback){\n\t\t\\Illuminate\\Log\\Writer::listen($callback);\n\t}", "protected function stream($callback, $status = 200, $headers = array())\n {\n return Response::stream($callback, $status, $headers, 'stream');\n }", "public function run()\n {\n $port = (int) CommandLine::getInput('p');\n\n if (!$port) {\n die('You must specify a valid port for the socket server. For example: \"-p=1024\"');\n }\n\n $server = new SocketServer('127.0.0.1', $port);\n\n // Set greetings for the new connection\n $server->greetings(\"\\nHi! Just type your brackets sequence and you will see the result\\n\");\n\n // Set handler of the incoming messages\n $server->setMessageHandler($this->messageHandler);\n\n // Start up the server\n $server->run();\n }", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "public function __invoke(ServerRequestInterface $request, callable $next)\n {\n if ($request->getMethod() === 'GET' && $request->getUri()->getPath() === '/') {\n return new Response(200, ['Content-Type' => 'text/plain'], 'OK');\n }\n\n return $next($request);\n }", "public function handle()\n {\n\t //创建server\n $server = new \\swoole_websocket_server(\"0.0.0.0\" , 9501);\n\n\t $server->on(\"open\" , function(Server $server , $request){\n//\t\t $this->info($request->fd . \"连接成功\");\n\t\t echo $request->fd . \"连接成功\";\n\t });\n\n\t $server->on(\"message\" , function(Server $server , $request){\n\t\t $msg = $request->data;\n\n\t\t foreach($server->connections as $fd){\n\t\t\t $server->push($fd , $msg);\n\t\t }\n\t });\n\n\t $server->on(\"close\" , function(Server $server , $request){\n//\t\t $this->info($request->fd . \"断开连接\");\n\t\t echo $request->fd . \"断开连接\";\n\t });\n\n\t $server->start();\n }", "public function addReadStream($stream, callable $listener);", "function ts3client_spawnNewServerConnectionHandler($port, &$result) {}", "public function listen()\n\t{\n\t\t$uri = $_REQUEST['uri'] ?? '';\n\t\t$uri = trim($uri, '/\\^$');\n\t\t$replacementValues = array();\n\n\t\t// List through the stored URI's\n\t\tforeach ($this->urls as $step => $url)\n\t\t{\n\t\t\t// See if there is a match\n\t\t\tif (preg_match(\"#^$url$#\", $uri))\n\t\t\t{\n\t\t\t\t// Replace the values\n\t\t\t\t$realUri = explode('/', $uri);\n\t\t\t\t$fakeUri = explode('/', $url);\n\n\t\t\t\t// Gather the .+ values with the real values in the URI\n\t\t\t\tforeach ($fakeUri as $key => $value) {\n\t\t\t\t\tif ($value == '.+')\t$replacementValues[] = $realUri[$key];\n\t\t\t\t}\n\n\t\t\t\t// Pass an array for arguments\n\t\t\t\tcall_user_func_array($this->functions[$step], $replacementValues);\n\t\t\t\texit;\n\t\t\t}\n\n\t\t} // End of Loop\n\n\t}", "public function httpWeb(){\n // 创建一个Worker监听2345端口,使用http协议通讯\n $http_worker = new Worker(\"http://0.0.0.0:2345\");\n\n /***********param name***********/\n //设置当前Worker实例的名称,方便运行status命令时识别进程。不设置时默认为none\n //$this->name = 'MyWebsocketWorker';\n\n /***********param count***********/\n //设置当前Worker实例启动多少个进程,不设置时默认为1。\n // 启动4个进程对外提供服务\n $http_worker->count = 4;\n\n /***********param id***********/\n //当前worker进程的id编号,范围为0到$worker->count-1。\n /*\n //windows系统由于不支持进程数count的设置,只有id只有一个0号。windows系统下不支持同一个文件初始化两个Worker监听,所以windows系统这个示例无法运行\n // worker实例1有4个进程,进程id编号将分别为0、1、2、3\n $worker1 = new Worker('tcp://0.0.0.0:8585');\n // 设置启动4个进程\n $worker1->count = 4;\n // 每个进程启动后打印当前进程id编号即 $worker1->id\n $worker1->onWorkerStart = function($worker1)\n {\n echo \"worker1->id={$worker1->id}\\n\";\n };\n\n // worker实例2有两个进程,进程id编号将分别为0、1\n $worker2 = new Worker('tcp://0.0.0.0:8686');\n\n // 设置启动2个进程\n $worker2->count = 2;\n // 每个进程启动后打印当前进程id编号即 $worker2->id\n $worker2->onWorkerStart = function($worker2)\n {\n echo \"worker2->id={$worker2->id}\\n\";\n };\n */\n\n /***********param protocol***********/\n //设置当前Worker实例的协议类\n //$worker->protocol = 'Workerman\\\\Protocols\\\\Http';\n\n /***********param transport***********/\n //设置当前Worker实例所使用的传输层协议,目前只支持3种(tcp、udp、ssl)。不设置默认为tcp。\n //$worker->transport = 'udp';\n\n /***********param reusePort***********/\n //设置当前worker是否开启监听端口复用(socket的SO_REUSEPORT选项),默认为false,不开启。\n //如果你的 Linux 内核版本是 3.9 及以上的话,那么在使用 Workerman 时,可以将 reusePort 设置为 true 提升程序运行效率\n //$worker->reusePort = true;\n\n /***********param connections***********/\n //格式为array(id=>connection, id=>connection, ...),此属性中存储了当前进程的所有的客户端连接对象,其中id为connection的id编号,详情见手册TcpConnection的id属性。\n\n /***********param stdoutFile***********/\n //此属性为全局静态属性,如果以守护进程方式(-d启动)运行,则所有向终端的输出(echo var_dump等)都会被重定向到stdoutFile指定的文件中。\n //如果不设置,并且是以守护进程方式运行,则所有终端输出全部重定向到/dev/null。注意:此属性必须在Worker::runAll();运行前设置才有效。windows系统不支持此特性。\n //Worker::$stdoutFile = '/tmp/stdout.log';\n\n /***********param logFile***********/\n //用来指定workerman日志文件位置。此文件记录了workerman自身相关的日志,包括启动、停止等。如果没有设置,文件名默认为workerman.log,文件位置位于Workerman的上一级目录中。\n //Worker::$logFile = '/tmp/workerman.log';\n\n /***********param user***********/\n //设置当前Worker实例以哪个用户运行。此属性只有当前用户为root时才能生效。不设置时默认以当前用户运行。建议$user设置权限较低的用户,例如www-data、apache、nobody等。注意:此属性必须在Worker::runAll();运行前设置才有效。windows系统不支持此特性。\n // 设置实例的运行用户\n //$worker->user = 'www-data';\n\n /***********param reloadable***********/\n //设置当前Worker实例是否可以reload,即收到reload信号后是否退出重启。不设置默认为true,收到reload信号后自动重启进程。\n //有些进程维持着客户端连接,例如Gateway/Worker模型中的gateway进程,当运行reload重新载入业务代码时,却又不想客户端连接断开,则设置gateway进程的reloadable属性为false\n // 设置此实例收到reload信号后是否reload重启\n //$worker->reloadable = false;\n\n /***********param daemonize***********/\n //此属性为全局静态属性,表示是否以daemon(守护进程)方式运行。如果启动命令使用了 -d参数,则该属性会自动设置为true。也可以代码中手动设置。\n //注意:此属性必须在Worker::runAll();运行前设置才有效。windows系统不支持此特性。\n //Worker::$daemonize = true;\n\n /***********param globalEvent***********/\n //此属性为全局静态属性,为全局的eventloop实例,可以向其注册文件描述符的读写事件或者信号事件。\n // 当进程收到SIGALRM信号时,打印输出一些信息\n /*Worker::$globalEvent->add(SIGALRM, EventInterface::EV_SIGNAL, function()\n {\n echo \"Get signal SIGALRM\\n\";\n });*/\n\n /***********param onWorkerStart***********/\n //设置Worker子进程启动时的回调函数,每个子进程启动时都会执行。\n /*$worker->onWorkerStart = function($worker)\n {\n echo \"Worker starting...\\n\";\n };*/\n\n /***********param onWorkerReload***********/\n //设置Worker收到reload信号后执行的回调。可以利用onWorkerReload回调做很多事情,例如在不需要重启进程的情况下重新加载业务配置文件。\n\n /***********param onConnect***********/\n //当客户端与Workerman建立连接时(TCP三次握手完成后)触发的回调函数。每个连接只会触发一次onConnect回调。\n //注意:onConnect事件仅仅代表客户端与Workerman完成了TCP三次握手,这时客户端还没有发来任何数据,此时除了通过$connection->getRemoteIp()获得对方ip,没有其他可以鉴别客户端的数据或者信息,所以在onConnect事件里无法确认对方是谁。要想知道对方是谁,需要客户端发送鉴权数据,例如某个token或者用户名密码之类,在onMessage回调里做鉴权。\n /*$worker->onConnect = function($connection)\n {\n echo \"new connection from ip \" . $connection->getRemoteIp() . \"\\n\";\n };*/\n\n /***********param onMessage***********/\n //当客户端通过连接发来数据时(Workerman收到数据时)触发的回调函数\n /*$worker->onMessage = function($connection, $data)\n {\n var_dump($data);\n $connection->send('receive success');\n };*/\n\n /***********param onClose***********/\n //当客户端连接与Workerman断开时触发的回调函数。不管连接是如何断开的,只要断开就会触发onClose。每个连接只会触发一次onClose。\n //注意:如果对端是由于断网或者断电等极端情况断开的连接,这时由于无法及时发送tcp的fin包给workerman,workerman就无法得知连接已经断开,也就无法及时触发onClose。这种情况需要通过应用层心跳来解决。workerman中连接的心跳实现参见这里。如果使用的是GatewayWorker框架,则直接使用GatewayWorker框架的心跳机制即可,参见这里。\n /*$worker->onClose = function($connection)\n {\n echo \"connection closed\\n\";\n };*/\n\n /***********param onBufferFull***********/\n /*$worker->onBufferFull = function($connection)\n {\n echo \"bufferFull and do not send again\\n\";\n };*/\n\n /***********param onBufferDrain***********/\n //每个连接都有一个单独的应用层发送缓冲区,缓冲区大小由TcpConnection::$maxSendBufferSize决定,默认值为1MB,可以手动设置更改大小,更改后会对所有连接生效。\n //该回调在应用层发送缓冲区数据全部发送完毕后触发。一般与onBufferFull配合使用,例如在onBufferFull时停止向对端继续send数据,在onBufferDrain恢复写入数据。\n /*$worker->onBufferDrain = function($connection)\n {\n echo \"buffer drain and continue send\\n\";\n };*/\n\n /***********param onError***********/\n //当客户端的连接上发生错误时触发。\n //目前错误类型有\n //1、调用Connection::send由于客户端连接断开导致的失败(紧接着会触发onClose回调) (code:WORKERMAN_SEND_FAIL msg:client closed)\n //2、在触发onBufferFull后(发送缓冲区已满),仍然调用Connection::send,并且发送缓冲区仍然是满的状态导致发送失败(不会触发onClose回调)(code:WORKERMAN_SEND_FAIL msg:send buffer full and drop package)\n //3、使用AsyncTcpConnection异步连接失败时(紧接着会触发onClose回调) (code:WORKERMAN_CONNECT_FAIL msg:stream_socket_client返回的错误消息)\n /*$worker->onError = function($connection, $code, $msg)\n {\n echo \"error $code $msg\\n\";\n };*/\n\n /***********param runAll***********/\n //运行所有Worker实例。\n //Worker::runAll()执行后将永久阻塞,也就是说位于Worker::runAll()后面的代码将不会被执行。所有Worker实例化应该都在Worker::runAll()前进行。\n //注意:windows版本的workerman不支持在同一个文件中实例化多个Worker。 上面的例子无法在windows版本的workerman下运行。windows版本的workerman需要将多个Worker实例初始化放在不同的文件中\n\n /***********param stopAll***********/\n //停止当前进程(子进程)的所有Worker实例并退出。此方法用于安全退出当前子进程,作用相当于调用exit/die退出当前子进程。与直接调用exit/die区别是,直接调用exit或者die无法触发onWorkerStop回调,并且会导致一条WORKER EXIT UNEXPECTED错误日志。\n\n /***********param param_name***********/\n /***********param param_name***********/\n\n // 接收到浏览器发送的数据时回复hello world给浏览器\n $http_worker->onMessage = function($connection, $data)\n {\n // 向浏览器发送hello world\n $connection->send('hello world');\n };\n\n\n // 运行worker\n Worker::runAll();\n }", "public function run(): ResponseInterface {\n\t\treturn $this->handle(self::getServerRequest());\n\t}", "public function addServer($host, $port, $weight = 0) {}", "public function listen(ServerInterface $socket)\n {\n $socket->on('connection', array($this->parser, 'handle'));\n }", "protected function createNetworkWebhooksHttpServerRequest($network_id, $create_network_webhooks_http_server)\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 createNetworkWebhooksHttpServer'\n );\n }\n // verify the required parameter 'create_network_webhooks_http_server' is set\n if ($create_network_webhooks_http_server === null || (is_array($create_network_webhooks_http_server) && count($create_network_webhooks_http_server) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $create_network_webhooks_http_server when calling createNetworkWebhooksHttpServer'\n );\n }\n\n $resourcePath = '/networks/{networkId}/webhooks/httpServers';\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\n // body params\n $_tempBody = null;\n if (isset($create_network_webhooks_http_server)) {\n $_tempBody = $create_network_webhooks_http_server;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "abstract public function serve();", "public function addWriteStream($stream, callable $listener);", "protected function setupServers()\n\t{\n\t\t$docRoot = realpath(__DIR__ . '/..') . '/web';\n $serverPort = self::choosePort(\n self::URL_SERVER_PORT_MIN,\n self::URL_SERVER_PORT_MAX\n );\n self::$webServerUrl = self::URL_SERVER_BASE . ':' . $serverPort;\n\t\t$server = new Server($docRoot, self::$webServerUrl);\n\n\t\t// Wait for an alive response\n $integrationRoot = realpath(__DIR__ . '/..');\n\t\t$server->setRouterScriptPath($integrationRoot . '/scripts/router.php');\n\t\t$server->setCheckAliveUri('/server-check');\n\n\t\t$this->addServer($server);\n\t}", "private function listenSocket() {\n $result = socket_listen($this->listeningSocket);\n $this->checkResult($result);\n }", "public static function create(callable $cb)\n {\n if (!ServerHelper::coroutineIsEnabled()) {\n return false;\n }\n\n $tid = self::tid();\n\n return SwCoroutine::create(function() use($cb, $tid) {\n $id = SwCoroutine::getuid();\n self::$idMap[$id] = $tid;\n\n PhpHelper::call($cb);\n });\n }", "public function run(): void\n {\n $requestBody = $this->getConfig()->getInputAdapter()::getParsedBody();\n $request = ServerRequestFactory::fromGlobals(\n $_SERVER,\n $_GET,\n $requestBody,\n $_COOKIE,\n $_FILES\n );\n\n $queue = [];\n\n $queue[] = new \\Middlewares\\Emitter();\n $queue[] = new ErrorHandler([new JsonFormatter()]);\n $queue[] = (new \\Middlewares\\PhpSession())->name('VENUSSESSID')\n ->regenerateId(60); // Prevent session fixation attacks\n\n $queue[] = (new \\Middlewares\\FastRoute(\n $this->getConfig()->getDispatcher()\n ))->attribute('handler');\n\n $queue = array_merge($queue, $this->getConfig()->getMiddlewares());\n\n // Use router access permission check\n if ($this->getConfig()->usePermission()) {\n $queue[] = (new Permission(\n $this->getConfig()->getContainer()\n ))->handlerAttribute('handler');\n }\n\n $queue[] = (new RequestHandler(\n $this->getConfig()->getContainer()\n ))->handlerAttribute('handler');\n\n $dispatcher = new Dispatcher($queue);\n $dispatcher->dispatch($request);\n }", "public static function send(array $data, $fd = NULL, callable $callback = NULL)\n {\n self::initConfig();\n\n // select mode\n $sapi = php_sapi_name();\n $mode = ($sapi === 'cli') ? SWOOLE_SOCK_ASYNC : SWOOLE_SOCK_SYNC;\n\n /**\n * @property array $stamsel\n */\n switch ($mode) {\n\t\t\tcase SWOOLE_SOCK_ASYNC:\n\t\t\t\t$client = new \\Swoole\\Coroutine\\Client(SWOOLE_UNIX_STREAM);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$client = new \\Swoole\\Client(SWOOLE_UNIX_STREAM, $mode);\n\t\t}\n\n // dynamic custom data\n $client->CiSwooleData = $data;\n $client->response_to = $fd;\n $client->callback = $callback;\n\n // set eof charactor\n $client->set(\n [\n 'open_eof_split' => true,\n 'package_eof' => self::$config['package_eof'],\n ]);\n\n // client init\n ($mode === SWOOLE_SOCK_ASYNC) ? self::asyncInit($client) : self::syncInit($client);\n }", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = Str::camel(\"on_$event\");\n $callback = method_exists($this, $listener) ? [$this, $listener] : function () use ($event) {\n $this->triggerEvent($event, func_get_args());\n };\n\n $this->getServer()->on($event, $callback);\n }\n }", "public function listen()\n {\n $this->openWorker();\n while (!Signal::isExit()) {\n if (($payload = $this->pop(3)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n }\n $this->closeWorker();\n }", "public function handle(ServerRequestInterface $request);", "function __construct($addr, $port, $bufferLength = 2048) \n\t{\n\t\t$this->maxBufferSize = $bufferLength;\n\n\t\t$this->master = socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die(\"Failed: socket_create()\");\n\n\t\tsocket_set_option($this->master, SOL_SOCKET, SO_REUSEADDR, 1) or die(\"Failed: socket_option()\");\n\t\tsocket_bind($this->master, $addr, $port)or die(\"Failed: socket_bind()\");\n\t\tsocket_listen($this->master,20) or die(\"Failed: socket_listen()\");\n\n\t\t$this->sockets['m'] = $this->master;\n\n\t\t$this->stdout(\"Server started\".PHP_EOL.\"Listening on: $addr:$port\".PHP_EOL.\"Master socket: \".$this->master);\n\t}", "public function startServer()\n {\n // fork\n $pid = pcntl_fork();\n\n // if we're in the child process, start the server and listen for data\n if ($pid > 0)\n {\n return $pid;\n }\n elseif ($pid === 0)\n {\n return $this->listen();\n }\n }", "public function process(\n ServerRequestInterface $request, \n RequestHandlerInterface $handler\n ): ResponseInterface {\n return call_user_func($this->callable, $request, $handler);\n }", "public function server($index){\n $this->httpRequest->server($index);\n }", "function listen($name, Closure $callback = null)\n {\n return Event::listen($name, $callback);\n }", "public function initListeningEvent()\n {\n if(!$this->server instanceof \\Swoole\\WebSocket\\Server){\n throw new \\Exception('swoole的websocket服务还未开启');\n }\n try{\n $processor = new LoginCommonCallServiceProcessor(new LoginCommonService($this->server));\n $tFactory = new TTransportFactory();\n $pFactory = new TBinaryProtocolFactory();\n $transport = new ServerTransport($this->server);\n $server = new \\src\\Thrift\\Server\\Server($processor, $transport, $tFactory, $tFactory, $pFactory, $pFactory);\n $server->serve();\n }catch (\\TException $e){\n throw new \\Exception('thrift启动失败');\n }\n }", "public function open_socket(){\n //Create the server socket\n if($this->socket === null){\n \n //Create socket\n if (($this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) === false) {\n echo \"Socket_create() failed: reason: \" . socket_strerror(socket_last_error()) . \"\\n\";\n }\n \n if(socket_set_option($this->socket, SOL_SOCKET, SO_KEEPALIVE, 1) === FALSE){\n echo \"Socket_set_option() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n \n if(socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1) === FALSE){\n echo \"Socket_set_option() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n\n if (socket_bind($this->socket, $this->host, $this->port) === false) {\n echo \"Socket_bind() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n\n if (socket_listen($this->socket, 5) === false) {\n echo \"Socket_listen() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n \n }\n return $this->socket;\n }", "protected function listen()\n {\n // Set time limit to indefinite execution\n set_time_limit (0);\n\n $this->socket = socket_create(\n AF_INET,\n SOCK_DGRAM,\n SOL_UDP\n );\n\n if (!is_resource($this->socket))\n {\n $this->logger->log(\"Failed to create a socket for the discovery server. The reason was: \" .\n socket_strerror(socket_last_error()));\n }\n\n if (!@socket_bind(\n $this->socket,\n $this->config->getSetting('discovery-address'),\n $this->config->getSetting('discovery-port')))\n {\n $this->logger->log(\"Failed to bind to socket while initialising the discovery server.\");\n }\n\n // enter an infinite loop, waiting for data\n $data = '';\n while (true)\n {\n if (@socket_recv($this->socket, $data, 9999, MSG_WAITALL))\n {\n $this->logger->log(\"Discovery server received the following: $data\");\n\n $this->handleMessage($data);\n }\n }\n }", "function start_dev_server(): void\n{\n if (optional(this()->server)->isRunning()) {\n return;\n }\n\n this()->server = new Process([\n 'php',\n '-S',\n 'localhost:3000',\n $directory = __DIR__ . '/Server',\n $directory . '/index.php',\n ]);\n\n this()->server->start();\n this()->server->waitUntil(fn ($_, $output) => str_contains($output, 'started'));\n}", "public function onRequest(Client $client, ServerRequestInterface $request, ResponseInterface $response): ResponseInterface\n {\n return $this->handle($request);\n }", "public function start () {\n $this->cache = new Memcache;\n $this->cache->addServer($this->server, $this->port);\n }", "public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next)\n {\n $this->helper->setUri($request->getUri());\n return $next($request, $response);\n }", "protected function createStream()\n {\n $host = sprintf('udp://%s:%d', $this->config['host'], $this->config['port']);\n\n // stream the data using UDP and suppress any errors\n $this->stream = @stream_socket_client($host);\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "public function listen(int $port, string $host = '0.0.0.0'): void\n {\n $this->address = $port . ':' . $host;\n $factory = new Factory($this->loop);\n $factory->createServer($host . ':' . $port)->then(function (Socket $server) {\n $this->socket = $server;\n $server->on('message', function ($message) {\n $this->emit('data', [$message]);\n });\n });\n }", "public function serve()\n {\n Log::debug('Request received:', [\n 'Method' => $this->request->getMethod(),\n 'URI' => $this->request->getRequestUri(),\n 'Query' => $this->request->getQueryString(),\n 'Protocal' => $this->request->server->get('SERVER_PROTOCOL'),\n 'Content' => $this->request->getContent(),\n ]);\n\n $this->validate($this->token);\n\n if ($str = $this->request->get('echostr')) {\n Log::debug(\"Output 'echostr' is '$str'.\");\n\n return new Response($str);\n }\n\n $result = $this->handleRequest();\n\n $response = $this->buildResponse($result['to'], $result['from'], $result['response']);\n\n Log::debug('Server response created:', compact('response'));\n\n return new Response($response);\n }", "public function looping($callback)\n {\n $this->app['events']->listen(Events\\Looping::class, $callback);\n }", "public function looping($callback)\n {\n $this->app['events']->listen(Events\\Looping::class, $callback);\n }", "function on ($uri, $callback)\r\n\t{\r\n\t\tif ($this->called)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// NOTE: Last callback param is $matches\r\n\t\tlist($success, $matches) = Routing::match($uri, $this->request->URI);\r\n\t\tif ($success)\r\n\t\t{\r\n\t\t\tcall_user_func_array($callback, array_merge($this->runArgs, $matches));\r\n\t\t\t$this->called = true;\r\n\t\t}\r\n\t}", "public function listen(Closure $callback)\n\t{\n\t\t$this->neoeloquent->listen($callback);\n\t}", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = 'on' . ucfirst($event);\n\n if (method_exists($this, $listener)) {\n $this->server->on($event, [$this, $listener]);\n } else {\n $this->server->on($event, function () use ($event) {\n $event = sprintf('swoole.%s', $event);\n\n $this->container['events']->fire($event, func_get_args());\n });\n }\n }\n }", "public function handler(Server $server, int $fd, int $reactorId)\r\n {\r\n }", "function init ($server, $query, $data, $files, $data_stream, $cookie, $request_started) {\n\t\t++static::$id;\n\t\t$this->init_server($server);\n\t\t$this->init_query($query);\n\t\t$this->init_data_and_files($data, $files, $data_stream);\n\t\t$this->init_cookie($cookie);\n\t\t$this->init_route();\n\t\t$this->started = $request_started;\n\t}" ]
[ "0.6279382", "0.61892974", "0.5755778", "0.56389326", "0.5584015", "0.55315745", "0.5385823", "0.53057534", "0.52150726", "0.51838636", "0.5176809", "0.5168336", "0.5165255", "0.51558924", "0.5134752", "0.5103724", "0.50959784", "0.5077046", "0.49941042", "0.49790603", "0.49787354", "0.49415782", "0.4923173", "0.49160916", "0.48995918", "0.48804626", "0.48748913", "0.4863763", "0.4858437", "0.48578417", "0.48392105", "0.47700885", "0.4761598", "0.47486395", "0.47459036", "0.47388634", "0.47326198", "0.47284886", "0.4703965", "0.46846431", "0.46737063", "0.46526676", "0.4640748", "0.4630889", "0.4630512", "0.45933807", "0.45818874", "0.45736283", "0.45123872", "0.45071158", "0.44939953", "0.446153", "0.44603524", "0.44439015", "0.44416547", "0.44277564", "0.44221732", "0.44170156", "0.441108", "0.44102788", "0.4409191", "0.4408891", "0.43855157", "0.43809983", "0.43722886", "0.43672648", "0.43639272", "0.4360955", "0.4355218", "0.43446198", "0.43425217", "0.4337711", "0.43203235", "0.43084455", "0.43077898", "0.43065876", "0.42961696", "0.42916942", "0.42872655", "0.4268846", "0.4266041", "0.42651275", "0.42549786", "0.42529902", "0.42520708", "0.4250615", "0.42396435", "0.42381462", "0.42337063", "0.4229201", "0.42277926", "0.42252073", "0.42056203", "0.42047268", "0.42047268", "0.4199331", "0.41868544", "0.4162225", "0.41559204", "0.41542488" ]
0.45411295
48
Starts listening for HTTP requests on the given socket server instance
public function listen(ServerInterface $socket) { $socket->on('connection', array($this->parser, 'handle')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function listenSocket() {\n $result = socket_listen($this->listeningSocket);\n $this->checkResult($result);\n }", "public static function http_server(): void\n {\n sock::$type = 'http:server';\n sock::$host = '0.0.0.0';\n sock::$port = 80;\n $ok = sock::create();\n\n if (!$ok) exit('HTTP Server creation failed!');\n\n do {\n //IMPORTANT!!! Reset all data & read list & client list\n $data = $read = $client = [];\n\n //Accept new connection\n sock::accept($read, $client);\n\n //Read HTTP Request data\n $msg = sock::read($client);\n\n var_dump($msg);\n\n //Prepare simple data\n $key = key($client);\n $sock = current($client);\n\n $data[$key]['sock'] = $sock;\n\n $data[$key]['msg'] = 'Hello! I am a simple HTTP Server running under PHP~';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= 'Your request message was: ';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= trim(current($msg)['msg']);\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= 'Thanks for your test!';\n\n //Send to browser\n $result = sock::write($data, $client);\n\n var_dump($result);\n\n } while (true);\n }", "public function startListening();", "protected function listen()\n {\n do {\n $data = fgets($this->socket, 512);\n if (!empty($data)) {\n $request = $this->receive($data);\n $cmd = strtolower($request->getCommand());\n\n if ($cmd === 'privmsg') {\n $event_name = 'message.' . ($request->isPrivateMessage() ? 'private' : 'channel');\n } else {\n $event_name = 'server.' . $cmd;\n }\n\n // Skip processing if the incoming message is from the bot\n if ($request->getSendingUser() === $this->config['nick']) {\n continue;\n }\n\n $event = new Event($request);\n $this->dispatcher->dispatch($event_name, $event);\n $responses = $event->getResponses();\n\n if (!empty($responses)) {\n $this->send($responses);\n }\n }\n } while (!feof($this->socket));\n }", "public function listen();", "function server_loop($address, $port)\n{\n GLOBAL $__server_listening;\n\n if(($sock = socket_create(AF_INET, SOCK_STREAM, 0)) < 0)\n {\n echo \"failed to create socket: \".socket_strerror($sock).\"\\n\";\n exit();\n }\n\n if(($ret = socket_bind($sock, $address, $port)) < 0)\n {\n echo \"failed to bind socket: \".socket_strerror($ret).\"\\n\";\n exit();\n }\n\n if( ( $ret = socket_listen( $sock, 0 ) ) < 0 )\n {\n echo \"failed to listen to socket: \".socket_strerror($ret).\"\\n\";\n exit();\n }\n\n socket_set_nonblock($sock);\n \n echo \"waiting for clients to connect\\n\";\n\n while ($__server_listening)\n {\n $connection = @socket_accept($sock);\n if ($connection === false)\n {\n usleep(100);\n }elseif ($connection > 0)\n {\n handle_client($sock, $connection);\n }else\n {\n echo \"error: \".socket_strerror($connection);\n die;\n }\n }\n}", "public function start()\n {\n $this->server->on(\"open\", [$this, 'wsOpen']);\n $this->server->on(\"message\", [$this, 'wsMessage']);\n $this->server->on(\"close\", [$this, 'wsClose']);\n\n $this->server->start();\n }", "protected function listen()\n {\n // Set time limit to indefinite execution\n set_time_limit (0);\n\n $this->socket = socket_create(\n AF_INET,\n SOCK_DGRAM,\n SOL_UDP\n );\n\n if (!is_resource($this->socket))\n {\n $this->logger->log(\"Failed to create a socket for the discovery server. The reason was: \" .\n socket_strerror(socket_last_error()));\n }\n\n if (!@socket_bind(\n $this->socket,\n $this->config->getSetting('discovery-address'),\n $this->config->getSetting('discovery-port')))\n {\n $this->logger->log(\"Failed to bind to socket while initialising the discovery server.\");\n }\n\n // enter an infinite loop, waiting for data\n $data = '';\n while (true)\n {\n if (@socket_recv($this->socket, $data, 9999, MSG_WAITALL))\n {\n $this->logger->log(\"Discovery server received the following: $data\");\n\n $this->handleMessage($data);\n }\n }\n }", "public function listen (array $options = [])\r\n\t\t{\r\n\t\t\t\tif ($this -> isListening ())\r\n\t\t\t\t{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;\r\n\t\t\t\t$context = stream_context_create ($options);\r\n\t\t\t\t$scheme = (string) $this -> getTransport () . '://' . $this -> getAddress () . ':' . $this -> getPort ();\r\n\t\t\t\t$resourcePointer = stream_socket_server ($scheme, $errno, $errstr, $flags, $context);\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Determine on which port we bound.\r\n\t\t\t\t*/\r\n\t\t\t\tif ($this -> getPort () == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t\t$localAddress = stream_socket_get_name ($resourcePointer, false);\r\n\t\t\t\t\t\t$port = substr ($localAddress, strrpos ($localAddress, ':') + 1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this -> setPort ($port);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Check if we succeeded to make the resource\r\n\t\t\t\t*/\r\n\t\t\t\tif (!is_resource ($resourcePointer) || $errno || $errstr )\r\n\t\t\t\t{\r\n\t\t\t\t\t\tthrow new SocketException (sprintf ('Failed to create socket resource, error: %s', $errstr));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Callback for when a new connection has been received.\r\n\t\t\t\t*/\r\n\t\t\t\t$acceptCallback = function (PollerInterface $pollerInterface, $resourcePointer)\r\n\t\t\t\t{\r\n\t\t\t\t\t\tif (false === $newConnection = stream_socket_accept ($resourcePointer))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$event = new AcceptingFailedEvent ($this);\r\n\t\t\t\t\t\t\t\t$this -> dispatch (SocketEvents :: SOCK_EXCEPTION, $event);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$socket = $this -> handleNewConnection ($newConnection);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($this -> getTransport () == self :: TRANSPORT_SSL)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$socket -> setTransport (ClientStream :: TRANSPORT_SSL);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$event = new AcceptingSucceededEvent ($this, $socket);\r\n\t\t\t\t\t\t$this -> dispatch (SocketEvents :: SOCK_ACCEPTED_CONN, $event);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Insert callback into poller\r\n\t\t\t\t*/\r\n\t\t\t\t$this -> pollerInstance -> addReadStream ($resourcePointer, $acceptCallback);\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Finishing up..\r\n\t\t\t\t*/\r\n\t\t\t\t$this -> currentState = self :: STATE_LISTENING;\r\n\t\t\t\t$this -> resourcePointer = $resourcePointer;\r\n\t\t\t\t$this -> resourcePointerId = (int) $resourcePointer;\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t}", "protected static function createListener($context)\n\t{\n\t\t$type = MHTTPD::$config['SSL']['enabled'] ? 'ssl' : 'tcp';\n\t\t$addr = MHTTPD::$config['Server']['address'];\n\t\t$port = MHTTPD::$config['Server']['port'];\n\n\t\tif (!(MHTTPD::$listener = stream_socket_server(\"{$type}://{$addr}:{$port}\", $errno, $errstr, \n\t\t\tSTREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context))\n\t\t\t) {\n\t\t\ttrigger_error(\"Could not create \".strtoupper($type).\" server socket\", E_USER_ERROR);\n\t\t}\n\n\t\tif (MHTTPD::$debug) {\n\t\t\tcecho(\"\\n\".chrule().\"\\n\");\n\t\t\tcecho(\"Created \".strtoupper($type).\" listener: \".stream_socket_get_name(MHTTPD::$listener, false).\"\\n\\n\");\n\t\t} else {\n\t\t\t$t = ($type == 'ssl') ? ' (SSL)' : '';\n\t\t\tcecho(\"Started MiniHTTPD server on {$addr}, port {$port}{$t} ...\\n\\n\");\n\t\t}\n\t}", "protected static function main()\n\t{\n\t\t// Create a TCP/SSL server socket context\n\t\t$context = MHTTPD::getContext();\n\t\t\n\t\t// Start the listener\n\t\tMHTTPD::createListener($context);\n\n\t\t// Initialize some handy vars\n\t\t$timeout = ini_get('default_socket_timeout');\n\t\t$maxClients = MHTTPD::$config['Server']['max_clients'];\n\t\t$maxHeaderBlockSize = MHTTPD_Message::getMaxHeaderBlockSize();\n\t\tif (MHTTPD::$debug) {\n\t\t\t$listener_name = stream_socket_get_name(MHTTPD::$listener, false);\n\t\t}\n\t\t\n\t\t// Start the browser\n\t\tMHTTPD::launchBrowser();\n\t\t\n\t\t// The main loop\n\t\twhile (MHTTPD::$running) \t{\t\n\t\t\n\t\t\t// Build a list of active streams to monitor\n\t\t\t$read = array('listener' => MHTTPD::$listener);\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t\t\t\t\t\t\n\t\t\t\t// Add any client sockets\n\t\t\t\tif ($csock = $client->getSocket()) {\n\t\t\t\t\t$read[\"client_$i\"] = $csock;\n\t\t\t\t\t\n\t\t\t\t\t// Add any client FCGI sockets\n\t\t\t\t\tif ($cfsock = $client->getFCGISocket()) {\n\t\t\t\t\t\t$read[\"clfcgi_$i\"] = $cfsock;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Add any client file streams\n\t\t\t\t\tif ($client->isStreaming()) {\n\t\t\t\t\t\t$read[\"clstrm_$i\"] = $client->getStream();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Add any aborted FCGI requests\n\t\t\tforeach (MHTTPD::$aborted as $aID=>$ab) {\n\t\t\t\t$read['aborted_'.$aID.'_'.$ab['client'].'_'.$ab['pid']] = $ab['socket'];\n\t\t\t}\n\n\t\t\tif (MHTTPD::$debug) {\n\t\t\t\tcecho(\"FCGI scoreboard:\\n\"); cprint_r(MFCGI::getScoreboard(true)); cecho(\"\\n\");\n\t\t\t\tcecho(\"Pre-select:\\n\"); cprint_r($read);\n\t\t\t\tcecho(chrule().\"\\n>>>> Waiting for server activity ($listener_name)\\n\".chrule().\"\\n\\n\");\n\t\t\t}\n\n\t\t\t// Wait for any new activity\n\t\t\tif (!($ready = @stream_select($read, $write=null, $error=null, null))) {\n\t\t\t\ttrigger_error(\"Could not select streams\", E_USER_WARNING);\n\t\t\t}\n\t\t\t\n\t\t\tif (MHTTPD::$debug) {cecho(\"Post-select:\\n\"); cprint_r($read);}\n\t\t\t\t\t\t\n\t\t\t// Check if the listener has a new client connection\n\t\t\tif (in_array(MHTTPD::$listener, $read)) {\n\t\t\t\t\n\t\t\t\t// Search for a free slot to add the new client\n\t\t\t\tfor ($i = 1; $i <= $maxClients; $i++) {\n\t\t\t\t\t\n\t\t\t\t\tif (!isset(MHTTPD::$clients[$i])) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// This slot is free, so add the new client connection\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"New client ($i): \");}\n\t\t\t\t\t\tif (!($sock = @stream_socket_accept(MHTTPD::$listener, $timeout, $peername))) {\n\t\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"\\nCould not accept client stream\\n\");}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"$peername\\n\");}\n\t\t\t\t\t\t$client = new MHTTPD_Client($i, $sock, $peername);\n\t\t\t\t\t\t$client->debug = MHTTPD::$debug;\n\t\t\t\t\t\tMHTTPD::$clients[$i] = $client;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t} elseif ($i == $maxClients) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// No free slots, so the request goes to the backlog\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"No free client slots!\\n\");}\n\t\t\t\t\t\ttrigger_error(\"Too many clients\", E_USER_NOTICE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Return to waiting if only the listener is active\n\t\t\t\tif ($ready == 1) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"No other connections to handle\\n\\n\");}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Handle any incoming client data on selected sockets\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t \n\t\t\t\tif (MHTTPD::$debug) {cecho(\"Client ($i) ... \");}\n\t\t\t\t$csock = $client->getSocket();\n\n\t\t\t\t// Handle any new client requests\n\t\t\t\tif ($client->isReady() && $csock && in_array($csock, $read)) {\n\t\t\t\t\n\t\t\t\t\t// Start reading the request\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"reading ... \");}\n\t\t\t\t\t$client->setTimeout(10);\n\t\t\t\t\t$input = '';\n\t\t\t\t\t\n\t\t\t\t\t// Get the request header block only\n\t\t\t\t\twhile ($buffer = @fgets($csock, 1024)) {\n\t\t\t\t\t\t$input .= $buffer;\n\t\t\t\t\t\tif ($buffer == '' || substr($input, -4) == \"\\r\\n\\r\\n\" \n\t\t\t\t\t\t\t|| strlen($input) > $maxHeaderBlockSize\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($input) {\n\t\t\t\t\t\n\t\t\t\t\t\t// Store the headers and process the request\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"done\\n\");}\n\t\t\t\t\t\t$client->setInput(trim($input));\n\t\t\t\t\t\tif (!$client->processRequest() && !$client->needsAuthorization()) {\n\t\t\t\t\t\t\tMHTTPD::removeClient($client);\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// No request data, client is disconnecting\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"disconnected\\n\");}\n\t\t\t\t\t\tMHTTPD::removeClient($client);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Handle any request body data\n\t\t\t\t} elseif ($client->isPosting() && $csock && in_array($csock, $read)) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"reading body \");}\n\t\t\t\t\t$client->readRequestBody();\n\t\t\t\t\n\t\t\t\t// Handle any disconnects or malformed requests\n\t\t\t\t} elseif ($csock && in_array($csock, $read)) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"aborted connection\\n\");}\n\t\t\t\t\tMHTTPD::removeClient($client);\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t// Handle any inactive client connections\n\t\t\t\t} else {\n\t\t\t\t\tif (MHTTPD::$debug) {\n\t\t\t\t\t\tcecho('inactive (');\n\t\t\t\t\t\tcecho('req:'.$client->hasRequest());\n\t\t\t\t\t\tcecho(' resp:'.$client->hasResponse());\n\t\t\t\t\t\tcecho(' fcgi:'.$client->hasFCGI());\n\t\t\t\t\t\tcecho(\")\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Handle any incoming FCGI responses\n\t\t\t\tif (($clfsock = $client->getFCGISocket()) && in_array($clfsock, $read)) {\n\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"Client ($i) ... reading FCGI socket: {$clfsock}\\n\");}\n\t\t\t\t\tif (!$client->readFCGIResponse()) {\n\t\t\t\t\t\tMHTTPD::removeClient($client); // abort any hanging connections\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle any outgoing FCGI requests\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t\t\tif ($client->hasFCGI() && !$client->hasSentFCGI()\n\t\t\t\t\t&& (!$client->isPosting() || $client->hasFullRequestBuffer())\n\t\t\t\t\t) {\n\t\t\t\t\tif (MHTTPD::$debug){cecho(\"Client ($i) ... sending FCGI request\\n\");}\n\t\t\t\t\tif (!$client->sendFCGIRequest()) {\n\t\t\t\t\t\tMHTTPD::removeClient($client); // abort any failed connections\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Handle any outgoing client responses\n\t\t\tforeach (MHTTPD::$clients as $i=>$client) {\n\t\t\t\tif ($client->hasRequest()) {\n\t\t\t\t\tif (!$client->isPosting() && $client->hasSentFCGI() && !$client->hasResponse()) {\n\t\t\t\t\t\tif (MHTTPD::$debug){cecho(\"Client ($i) ... waiting for FCGI response\\n\");}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} elseif ($client->needsAuthorization()) {\n\t\t\t\t\t\tif (MHTTPD::$debug){cecho(\"Client ($i) ... waiting for authorization\\n\");}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} elseif ($client->hasResponse()) {\n\t\t\t\t\t\tif (MHTTPD::$debug) {cecho(\"Client ($i) ... handling response\\n\");}\n\t\t\t\t\t\tMHTTPD::handleResponse($client);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t// Handle any aborted FCGI requests\n\t\t\tforeach ($read as $r) {\n\t\t\t\tforeach (MHTTPD::$aborted as $aID=>$ab) {\n\t\t\t\t\tif ($r == $ab['socket']) {\n\t\t\t\t\t\tMFCGI::removeClient($ab['process']);\n\t\t\t\t\t\tMHTTPD::closeSocket($r);\n\t\t\t\t\t\tunset(MHTTPD::$aborted[$aID]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// End of main loop\n\t\t\tif (MHTTPD::$debug) {cecho(\"\\n\");}\n\t\t}\n\t\t\n\t\t// Quit the server cleanly\n\t\tMHTTPD::shutdown();\n\t}", "public function listenHttp($port, $host = '127.0.0.1')\n {\n $socket = new SocketServer($this->loop);\n\n $http = new HttpServer($socket);\n $http->on('request', function (Request $request, Response $response) {\n $curl = curl_init();\n\n $baseHeaders = $request->getHeaders();\n $headers = [];\n foreach ($baseHeaders as $header => $headerValue) {\n $headers[] = \"$header: $headerValue\";\n }\n\n $headers[] = 'X-Proxy: http';\n \n curl_setopt($curl, CURLOPT_URL, $request->getUrl()->__toString());\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($curl, CURLOPT_HEADER, true);\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);\n $data = curl_exec($curl);\n\n $parsedData = $this->parseResponse($data);\n\n $response->writeHead($parsedData['code'], $parsedData['headers']);\n $response->end($parsedData['body']);\n\n });\n\n $socket->listen($port, $host);\n }", "function server_loop($address, $port)\n{\n GLOBAL $fh;\n GLOBAL $__server_listening;\n\t\n\t//printLog($fh, \"server_looping...\");\n\n if(($sock = socket_create(AF_INET, SOCK_STREAM, 0)) < 0)\n {\n\t\t//printLog($fh, \"failed to create socket: \".socket_strerror($sock));\n exit();\n }\n\n\tif(($ret = socket_bind($sock, $address, $port)) < 0)\n\t{\n\t\t//printLog($fh, \"failed to bind socket: \".socket_strerror($ret));\n\t\texit();\n\t}\n\n\tif( ( $ret = socket_listen( $sock, 0 ) ) < 0 )\n\t{\n\t\t//printLog($fh, \"failed to listen to socket: \".socket_strerror($ret));\n\t\texit();\n\t}\n\n\tsocket_set_nonblock($sock);\n\n\t//printLog($fh, \"waiting for clients to connect...\");\n\n\twhile ($__server_listening)\n\t{\n\t\t$connection = @socket_accept($sock);\n\t\tif ($connection === false)\n\t\t{\n\t\t\tusleep(100);\n\t\t} elseif ($connection > 0) {\n\t\t\thandle_client($sock, $connection);\n\t\t} else {\n\t\t\t//printLog($fh, \"error: \".socket_strerror($connection));\n\t\t\tdie;\n\t\t}\n\t}\n}", "public function run()\n {\n $this->server->start();\n }", "public function run(HttpServer $server = null): void\n {\n $this->startup();\n if ($server) {\n $server->addListener($this);\n $server->start();\n } else {\n $response = $this->handle(ServerRequest::fromGlobals());\n $this->emitter->emit($response);\n if ($response instanceof Response) {\n $response->end();\n }\n }\n\n $this->shutdown();\n }", "public function onRequest(StreamServerNodeInterface $client, HttpRequest $request);", "public function listen() :void {\n\n echo \"Starting websocket server on... \" . $this->address . \":\" . $this->port;\n \n socket_listen($this->server);\n socket_set_nonblock($this->server);\n $this->clients[] = new WebSocket($this->server);\n\n do {\n\n $read = array_map(function($ws) {return $ws->socket;}, $this->clients);\n $write = null; \n $except = null;\n\n $ready = socket_select($read, $write, $except, 0);\n if ($ready === false) {\n if ($this->onError !== null) {\n $callback = $this->onError;\n $callback(\"[\".socket_last_error().\"]\".\" \".socket_strerror(socket_last_error()));\n }\n\n return;\n }\n\n if ($ready < 1) continue;\n\n // check if there is a client trying to connect.\n if (in_array($this->server, $read)) {\n if (($client = socket_accept($this->server)) !== false) {\n\n // send websocket handshake headers.\n if (!$this->sendHandshakeHeaders($client)) {\n continue;\n }\n\n // add the new client to the $clients array.\n $ws = new WebSocket($client);\n $this->clients[] = $ws;\n\n // call \"connection\" event handler for each new client.\n if ($this->onConnect !== null) {\n $callback = $this->onConnect;\n $callback($ws);\n }\n\n // remove the listening socket from the clients-with-data array.\n $key = array_search($this->server, $read);\n unset($read[$key]);\n }\n }\n\n foreach ($read as $key => $client) {\n\n $buffer = \"\";\n $bytes = @socket_recv($client, $buffer, 2048, 0);\n\n // check if the client is disconnected.\n if ($bytes === false) {\n\n // remove client from $clients array\n // and call disconnect event handler.\n unset($this->clients[$key]);\n if ($this->onDisconnect !== null) {\n $callback = $this->onDisconnect;\n $callback();\n }\n\n continue;\n }\n\n $ws = $this->clients[$key];\n $callback = $ws->onMessage;\n if ($callback !== null) {\n $callback($ws, $this->unmask($buffer));\n }\n }\n } while (true);\n socket_close($this->server);\n }", "function serve($cb) {\n\t$offset = rand(0,2000);\n\tforeach (range(40000+$offset, 50000+$offset) as $port) {\n\t\tlogger(\"serve: Trying port %d\", $port);\n\t\tif (($server = @stream_socket_server(\"tcp://localhost:$port\"))) {\n\t\t\tfprintf(STDERR, \"%s\\n\", $port);\n\t\t\tlogger(\"serve: Using port %d\", $port);\n\t\t\tdo {\n\t\t\t\t$R = array($server); $W = array(); $E = array();\n\t\t\t\t$select = stream_select($R, $E, $E, 10, 0);\n\t\t\t\tif ($select && ($client = stream_socket_accept($server, 1))) {\n\t\t\t\t\tlogger(\"serve: Accept client %d\", (int) $client);\n\t\t\t\t\tif (getenv(\"PHP_HTTP_TEST_SSL\")) {\n\t\t\t\t\t\tstream_socket_enable_crypto($client, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$R = array($client);\n\t\t\t\t\t\twhile (!feof($client) && stream_select($R, $W, $E, 1, 0)) {\n\t\t\t\t\t\t\tlogger(\"serve: Handle client %d\", (int) $client);\n\t\t\t\t\t\t\t$cb($client);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger(\"serve: EOF/timeout on client %d\", (int) $client);\n\t\t\t\t\t} catch (Exception $ex) {\n\t\t\t\t\t\tlogger(\"serve: Exception on client %d: %s\", (int) $client, $ex->getMessage());\n\t\t\t\t\t\t/* ignore disconnect */\n\t\t\t\t\t\tif ($ex->getMessage() !== \"Empty message received from stream\") {\n\t\t\t\t\t\t\tfprintf(STDERR, \"%s\\n\", $ex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while ($select);\n\t\t\treturn;\n\t\t}\n\t}\n}", "public function __construct()\n {\n $this->http = new swoole_http_server(self::HOST, self::PORT);\n\n $this->http->set([\n \"enable_static_handler\" => true,\n \"document_root\" => \"/home/alex/study/thinkphp/public/static/\",\n 'worker_num' => 2,\n 'task_worker_num' => 2,\n\n ]);\n\n $this->http->on(\"WorkerStart\", [$this, 'onWorkerStart']);\n $this->http->on(\"request\", [$this, 'onRequest']);\n $this->http->on(\"task\", [$this, 'onTask']);\n $this->http->on(\"finish\", [$this, 'onFinish']);\n $this->http->on(\"close\", [$this, 'onClose']);\n\n\n $this->http->start();\n }", "public function run()\n {\n $port = (int) CommandLine::getInput('p');\n\n if (!$port) {\n die('You must specify a valid port for the socket server. For example: \"-p=1024\"');\n }\n\n $server = new SocketServer('127.0.0.1', $port);\n\n // Set greetings for the new connection\n $server->greetings(\"\\nHi! Just type your brackets sequence and you will see the result\\n\");\n\n // Set handler of the incoming messages\n $server->setMessageHandler($this->messageHandler);\n\n // Start up the server\n $server->run();\n }", "public function run(Server $server = null): void\n {\n $this->startup();\n if ($server) {\n $server->addListener($this);\n $server->start();\n } else {\n $response = $this->handle(ServerRequest::fromGlobals());\n $this->emitter->emit($response);\n if ($response instanceof Response) {\n $response->end();\n }\n }\n\n $this->shutdown();\n }", "public function onStart(\\swoole_server $server)\n {\n }", "function listen()\n {\n $method = strtoupper($_SERVER['REQUEST_METHOD']);\n $path = trim($_SERVER['REQUEST_URI']);\n\n print $this->match_and_exec($method, $path);\n }", "public function start () {\n $this->cache = new Memcache;\n $this->cache->addServer($this->server, $this->port);\n }", "public function listen(): static\n {\n $this->breakLoop = false;\n $this->listening = true;\n\n $baseTime = microtime(true);\n $times = [];\n $lastCycle = $baseTime;\n $this->generateMaps = false;\n $this->generateMaps();\n\n $this->startSignalHandlers();\n $this->breakLoop = false;\n\n while (!$this->breakLoop) {\n $socketCount = count($this->sockets);\n $streamCount = count($this->streams);\n $signalCount = count($this->signals);\n $timerCount = count($this->timers);\n\n if ($this->generateMaps) {\n $this->generateMaps();\n }\n\n $hasHandler = false;\n\n\n // Timers\n if (!empty($this->timers)) {\n $hasHandler = true;\n $time = microtime(true);\n\n foreach ($this->timers as $id => $binding) {\n if ($binding->frozen) {\n continue;\n }\n\n $dTime = $times[$id] ?? $baseTime;\n $diff = $time - $dTime;\n\n if ($diff > $binding->duration) {\n $times[$id] = $time;\n $binding->trigger(null);\n }\n }\n }\n\n\n\n // Signals\n if (!empty($this->signals) && $this->hasPcntl) {\n $hasHandler = true;\n pcntl_signal_dispatch();\n }\n\n // Sockets\n if (!empty($this->socketMap)) {\n $hasHandler = true;\n $e = null;\n\n /** @var array<int, resource|Socket> $read */\n $read = $this->socketMap[self::RESOURCE][self::READ];\n /** @var array<int, resource|Socket> $write */\n $write = $this->socketMap[self::RESOURCE][self::WRITE];\n\n try {\n /* @phpstan-ignore-next-line */\n $res = socket_select($read, $write, $e, 0, 10000);\n } catch (Throwable $e) {\n $res = false;\n }\n\n if ($res === false) {\n // TODO: deal with error\n } elseif ($res > 0) {\n foreach ($read as $resourceId => $socket) {\n foreach (Coercion::toArray(\n $this->socketMap[self::HANDLER][self::READ][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($socket);\n }\n }\n\n foreach ($write as $resourceId => $socket) {\n foreach (Coercion::toArray(\n $this->socketMap[self::HANDLER][self::WRITE][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($socket);\n }\n }\n }\n\n // TODO: add timeout handler\n }\n\n // Streams\n if (!empty($this->streamMap)) {\n $hasHandler = true;\n $e = null;\n\n /** @var array<int, resource> $read */\n $read = $this->streamMap[self::RESOURCE][self::READ];\n /** @var array<int, resource> $write */\n $write = $this->streamMap[self::RESOURCE][self::WRITE];\n\n try {\n $res = stream_select($read, $write, $e, 0, 10000);\n } catch (Throwable $e) {\n $res = false;\n }\n\n\n if ($res === false) {\n // TODO: deal with error\n } elseif ($res > 0) {\n foreach ($read as $resourceId => $stream) {\n foreach (Coercion::toArray(\n $this->streamMap[self::HANDLER][self::READ][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($stream);\n }\n }\n\n foreach ($write as $resourceId => $stream) {\n foreach (Coercion::toArray(\n $this->streamMap[self::HANDLER][self::WRITE][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($stream);\n }\n }\n }\n\n // TODO: add timeout handler\n }\n\n\n // Tick\n if (\n !$this->breakLoop &&\n $this->tickHandler\n ) {\n if (false === ($this->tickHandler)($this)) {\n $this->breakLoop = true;\n }\n }\n\n // Cycle\n if (\n !$this->breakLoop &&\n $this->cycleHandler\n ) {\n $time = microtime(true);\n\n if ($time - $lastCycle > 1) {\n $lastCycle = $time;\n\n if (false === ($this->cycleHandler)(++$this->cycles, $this)) {\n $this->breakLoop = true;\n }\n }\n }\n\n\n if (!$hasHandler) {\n $this->breakLoop = true;\n } elseif (\n $socketCount !== count($this->sockets) ||\n $streamCount !== count($this->streams) ||\n $signalCount !== count($this->signals) ||\n $timerCount !== count($this->timers)\n ) {\n $this->generateMaps = true;\n }\n\n usleep(30000);\n }\n\n $this->breakLoop = false;\n $this->listening = false;\n\n $this->stopSignalHandlers();\n\n return $this;\n }", "public function start()\n {\n $this->registerDefaultServices();\n\n $this->handle($this->request->createFromGlobals());\n }", "public function initTcpListenServer()\n {\n $listenConfig = config('websocketlogin.listern');\n $this->listern = $this->server->addListener($listenConfig['uri'], $listenConfig['port'], $listenConfig['type']);\n return $this->listern;\n }", "protected function bindSwooleServer()\n {\n $this->app->singleton('swoole.server', function () {\n return $this->server;\n });\n }", "private function startServer() {\n\t\t$serverLog = PHPUNIT_TEMP_DIR . '/socketServer.log';\n\t\t$descriptorspec = array(\n\t\t\t0 => array(\"pipe\", \"r\"), // stdin\n\t\t\t1 => array(\"file\", $serverLog, \"a\"),// stdout\n\t\t\t2 => array(\"file\", $serverLog, \"a\") // stderr\n\t\t);\n\n\t\t$cmd = \"php \" . dirname(__FILE__) . '/socketServer.php';\n\t\t$this->server = proc_open($cmd, $descriptorspec, $this->pipes);\n\t\tif ($this->server === false) {\n\t\t\tthrow new Exception(\"Failed starting the socket server process.\");\n\t\t}\n\t\t\n\t\t// Sleep a bit to allow server to start\n\t\tusleep(200000);\n\t\t\n\t\t// Verify the server is running\n\t\t$status = proc_get_status($this->server);\n\t\tif (!$status['running']) {\n\t\t\tthrow new Exception(\"Socket server process failed to start. Check the log at [$serverLog].\");\n\t\t}\n\t}", "public function run()\n {\n $this->router->listen();\n }", "public function open_socket(){\n //Create the server socket\n if($this->socket === null){\n \n //Create socket\n if (($this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) === false) {\n echo \"Socket_create() failed: reason: \" . socket_strerror(socket_last_error()) . \"\\n\";\n }\n \n if(socket_set_option($this->socket, SOL_SOCKET, SO_KEEPALIVE, 1) === FALSE){\n echo \"Socket_set_option() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n \n if(socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1) === FALSE){\n echo \"Socket_set_option() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n\n if (socket_bind($this->socket, $this->host, $this->port) === false) {\n echo \"Socket_bind() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n\n if (socket_listen($this->socket, 5) === false) {\n echo \"Socket_listen() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n \n }\n return $this->socket;\n }", "function servicemain() {\n $http = new \\Higgs\\HttpServer();\n/*\n $http->addExtension(new \\Higgs\\Extensions\\Misc\\AddHeader([\n \"header\" => \"x-foo\",\n \"value\" => \"Hello World\"\n ]));\n*/\n $cfg = ObjMan::getObject(\"local:/config/higgs\");\n\n $exts = $cfg->query(\"/httpd/server[default]/extension\");\n foreach($exts as $ext) {\n $cn = \\Utils::getClassFromDotted($ext[0]);\n class_exists($cn);\n }\n foreach($exts as $ext) {\n $cn = \\Utils::getClassFromDotted($ext[0]);\n if (class_exists($cn)) {\n $ext = new $cn($ext->getAttributes());\n $http->addExtension($ext);\n } else {\n $this->warn(\"Could not load extension '{$ext[0]}'\");\n }\n }\n\n //$ctrl = new \\Higgs\\HttpControl();\n\n $server = new SocketServer();\n\n $ports = $cfg->query(\"/httpd/server[default]/listen\");\n foreach($ports as $ep) {\n $endpoint = $ep[0];\n if ($ep->hasAttribute(\"certificate\")) {\n $cert = new Certificate(\"server.pem\");\n $this->debug(\"Using certificate %s\", \"server.pem\");\n $info = $cert->getCertificateInfo();\n list($vfrom,$vto) = $cert->getValidity();\n $this->debug(\" Issued to: %s\", $info[\"name\"]);\n $this->debug(\" Issuer: %s (%s)\", $info[\"issuer\"][\"O\"], $info[\"issuer\"][\"OU\"]);\n $this->debug(\" Hash: 0x%s\", $info[\"hash\"]);\n $this->debug(\" Valid from: %s\", $vfrom);\n $this->debug(\" Valid until: %s\", $vto);\n if ($cert->isSelfSigned()) {\n $this->warn(\"Warning! The certificate in use is self-signed. Consider getting a proper certificate for production use.\");\n $this->warn(\"HSTS by design does not allow self-signed certificates. Enabling HSTS will not work.\");\n }\n $server->addListener($endpoint, $http, $cert);\n } else {\n $server->addListener($endpoint, $http);\n }\n }\n /*\n $server->addListener(\"tcp://127.0.0.1:9700\", $http);\n $server->addListener(\"ssl://127.0.0.1:9701\", $http, $cert);\n $server->addListener(\"tcp://127.0.0.1:9799\", $http);\n */\n while($server->process()) {\n usleep(5000);\n if ($this->stop) break;\n }\n }", "public function onOpen(Server $server, SwooleRequest $swooleRequest)\n {\n }", "public function createSocket()\n {\n //Create TCP/IP sream socket\n $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n //reuseable port\n socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1);\n\n //bind socket to specified host\n socket_bind($this->socket, 0, $this->port);\n\n //listen to port\n socket_listen($this->socket);\n\n //create & add listning socket to the list\n $this->clients[0] = [\n $this->socket\n ];\n }", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n $serv = new \\swoole_server($this->host, $this->port);\n $serv->set(\n array(\n 'process_name' => 'ershoufang_crawler', //swoole 进程名称\n 'worker_num' => 2,//开启的worker进程数\n 'task_worker_num' => 2,//开启的task进程数\n 'open_cpu_affinity' => true,\n 'daemonize' => false,\n 'max_request' => 10000,\n 'dispatch_mode' => 2,\n 'debug_mode' => 0,\n 'log_file' => 'swoole.log',\n 'open_tcp_nodelay' => true,\n \"task_ipc_mode\" => 2,\n 'task_max_request' => 10000\n )\n );\n\n $serv->on('Start', array($this, 'onStart'));\n $serv->on('Connect', array($this, 'onConnect'));\n $serv->on('Receive', array($this, 'onReceive'));\n $serv->on('WorkerStart', array($this, 'onWorkerStart'));\n $serv->on('Task', array($this, 'onTask'));\n $serv->on('Finish', array($this, 'onFinish'));\n $serv->on('Close', array($this, 'onClose'));\n $serv->start();\n }", "protected function setupServers()\n\t{\n\t\t$docRoot = realpath(__DIR__ . '/..') . '/web';\n $serverPort = self::choosePort(\n self::URL_SERVER_PORT_MIN,\n self::URL_SERVER_PORT_MAX\n );\n self::$webServerUrl = self::URL_SERVER_BASE . ':' . $serverPort;\n\t\t$server = new Server($docRoot, self::$webServerUrl);\n\n\t\t// Wait for an alive response\n $integrationRoot = realpath(__DIR__ . '/..');\n\t\t$server->setRouterScriptPath($integrationRoot . '/scripts/router.php');\n\t\t$server->setCheckAliveUri('/server-check');\n\n\t\t$this->addServer($server);\n\t}", "protected function socketPerform() {}", "function setServerSocket($socket)\n {\n $this->serverSocket = $socket;\n }", "public function listen()\n {\n $this->openWorker();\n while (!Signal::isExit()) {\n if (($payload = $this->pop(3)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n }\n $this->closeWorker();\n }", "public function setup() {\n $this->socket = socket_create(AF_INET, SOCK_STREAM, 0);\n if (!socket_bind($this->socket, $this->ip, $this->port)) {\n $errno = socket_last_error();\n $this->error(sprintf('Could not bind to address %s:%s [%s] %s', $this->ip, $this->port, $errno, socket_strerror($errno)));\n throw new Exception('Could not start server.');\n }\n\n socket_listen($this->socket);\n $this->daemon->on(Daemon::ON_POSTEXECUTE, array($this, 'run'));\n }", "public function listen()\n\t{\n\t\t$uri = $_REQUEST['uri'] ?? '';\n\t\t$uri = trim($uri, '/\\^$');\n\t\t$replacementValues = array();\n\n\t\t// List through the stored URI's\n\t\tforeach ($this->urls as $step => $url)\n\t\t{\n\t\t\t// See if there is a match\n\t\t\tif (preg_match(\"#^$url$#\", $uri))\n\t\t\t{\n\t\t\t\t// Replace the values\n\t\t\t\t$realUri = explode('/', $uri);\n\t\t\t\t$fakeUri = explode('/', $url);\n\n\t\t\t\t// Gather the .+ values with the real values in the URI\n\t\t\t\tforeach ($fakeUri as $key => $value) {\n\t\t\t\t\tif ($value == '.+')\t$replacementValues[] = $realUri[$key];\n\t\t\t\t}\n\n\t\t\t\t// Pass an array for arguments\n\t\t\t\tcall_user_func_array($this->functions[$step], $replacementValues);\n\t\t\t\texit;\n\t\t\t}\n\n\t\t} // End of Loop\n\n\t}", "public static function tcp_server(): void\n {\n sock::$type = 'tcp:server';\n sock::$host = '0.0.0.0';\n sock::$port = self::port;\n $ok = sock::create();\n\n if (!$ok) exit('TCP Server creation failed!');\n\n //Set Client list alone\n $client = [];\n\n do {\n //Copy client list to read list\n $read = $client;\n\n //Listen to TCP port\n sock::listen($read);\n\n //Accept new connection\n sock::accept($read, $client);\n\n //Read TCP Data\n $msg = sock::read($read, $client);\n\n var_dump($msg);\n\n $data = [];\n\n //example: from message and send back to client\n foreach ($client as $k => $v) {\n foreach ($msg as $key => $value) {\n $data[$k]['sock'] = $v;\n $data[$k]['msg'] = $key !== $k ? $value['msg'] : 'OK! ' . count($client) . ' players are online waiting!';\n }\n }\n\n //Send data back and maintain clients\n $result = sock::write($data, $client);\n\n var_dump($result);\n\n } while (true);\n }", "public function __construct()\n {\n Socket::$isServer = true;\n self::$server = new sockbase();\n self::$server->onmsg(__NAMESPACE__ . '\\SqlPool::inmsg');\n self::$server->dismsg(__NAMESPACE__ . '\\SqlPool::dis');\n $poolconf = ng169\\lib\\Option::get('pool');\n self::$pwd = $poolconf['pwd'];\n\n self::$server->start($poolconf['ip'], $poolconf['port']);\n\n // self::$server->start(\"127.0.0.1\", \"4563\");\n }", "public function run() \n\t{\n\t\twhile( true ) \n\t\t{\n\t\t\tif ( empty($this->sockets) )\n\t\t\t\t$this->sockets['m'] = $this->master;\n\n\t\t\t$read = $this->sockets;\n\t\t\t$write = $except = null;\n\n\t\t\t$this->_tick();\n\t\t\t$this->tick();\n\n\t\t\t@socket_select($read, $write, $except, 1);\n\n\t\t\tforeach ( $read as $socket ) \n\t\t\t{\n\t\t\t\tif ( $socket == $this->master ) \n\t\t\t\t{\n\t\t\t\t\t$client = socket_accept($socket);\n\n\t\t\t\t\tif ( $client < 0 ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$this->stderr(\"Failed: socket_accept()\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} \n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\t$this->connect($client);\n\t\t\t\t\t\t$this->stdout(\"Client connected. \" . $client);\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$numBytes = @socket_recv($socket, $buffer, $this->maxBufferSize, 0);\n\n\t\t\t\t\tif ( $numBytes === false ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$sockErrNo = socket_last_error($socket);\n\n\t\t\t\t\t\tswitch ($sockErrNo)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 102: // ENETRESET-- Network dropped connection because of reset\n\t\t\t\t\t\t\tcase 103: // ECONNABORTED -- Software caused connection abort\n\t\t\t\t\t\t\tcase 104: // ECONNRESET -- Connection reset by peer\n\t\t\t\t\t\t\tcase 108: // ESHUTDOWN-- Cannot send after transport endpoint shutdown -- probably more of an error on our part, if we're trying to write after the socket is closed.Probably not a critical error, though.\n\t\t\t\t\t\t\tcase 110: // ETIMEDOUT-- Connection timed out\n\t\t\t\t\t\t\tcase 111: // ECONNREFUSED -- Connection refused -- We shouldn't see this one, since we're listening... Still not a critical error.\n\t\t\t\t\t\t\tcase 112: // EHOSTDOWN-- Host is down -- Again, we shouldn't see this, and again, not critical because it's just one connection and we still want to listen to/for others.\n\t\t\t\t\t\t\tcase 113: // EHOSTUNREACH -- No route to host\n\t\t\t\t\t\t\tcase 121: // EREMOTEIO-- Rempte I/O error -- Their hard drive just blew up.\n\t\t\t\t\t\t\tcase 125: // ECANCELED-- Operation canceled\n\t\t\t\t\t\t\t\t$this->stderr(\"Unusual disconnect on socket \" . $socket);\n\t\t\t\t\t\t\t\t$this->disconnect($socket, true, $sockErrNo); // disconnect before clearing error, in case someone with their own implementation wants to check for error conditions on the socket.\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$this->stderr('Socket error: ' . socket_strerror($sockErrNo));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\telseif ( $numBytes == 0 ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$this->disconnect($socket);\n\t\t\t\t\t\t$this->stderr(\"Client disconnected. TCP connection lost: \" . $socket);\n\t\t\t\t\t} \n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\t$user = $this->getUserBySocket($socket);\n\n\t\t\t\t\t\tif ( !$user->handshake ) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tmp = str_replace(\"\\r\", '', $buffer);\n\n\t\t\t\t\t\t\tif (strpos($tmp, \"\\n\\n\") === false ) \n\t\t\t\t\t\t\t\tcontinue; // If the client has not finished sending the header, then wait before sending our upgrade response.\n\n\t\t\t\t\t\t\t$this->doHandshake($user, $buffer);\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//split packet into frame and send it to deframe\n\t\t\t\t\t\t\t$this->split_packet($numBytes, $buffer, $user);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function startListeningTo($port) {\n $this->createListeningSocket();\n $this->bindListeningSocket($port);\n $this->listenSocket();\n }", "public function getSocket();", "public function listen() {\n $this->source->listen($this->id);\n }", "public function handle()\n {\n /***** Controller Server *****/\n $host = 'localhost'; //host\n $port = '4070'; //port\n $null = NULL; //null var\n\n echo(\"========Starting=========\\n\");\n\t\t\t// Create TCP/IP sream socket\n echo(\"1. Creating socket...\\n\");\n $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\t\t\t// Socket option\n echo(\"2. Setting socket options...\\n\");\n socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1);\n\t\t\t// Bind socket\n echo(\"3. Binding socket...\\n\");\n socket_bind($socket, 0, $port);\n\t\t\t// listen to port\n echo(\"4. Start Listener...\\n\");\n socket_listen($socket);\n\n $clients = array($socket);\n\n echo(\"Controller server is started\\n\");\n echo(\"=========================\\n\");\n while (true) {\n \t$changed = $clients;\n \tsocket_select($changed, $null, $null, 0, $null);\n\n \t//Changed will be the server #resource IF new connection is being made\n \tif (in_array($socket, $changed)) {\n //New connection incoming\n \t\t$socket_new = socket_accept($socket); //accept new socket\n \t\tsocket_getpeername($socket_new, $ip); //get ip address of connected socket\n if ($ip != env('APP_IP')){\n \t\t echo \"Client \".$ip.\" is connected\\n\";\n \t\t $clients[$ip] = $socket_new; //add socket to client array\n\t\t\t\t\t} else {\n\t\t\t\t\t array_push($clients, $socket_new); //add 'send_message' socket to clients array\n\t\t\t\t\t}\n \t\t//Clear the changed array (the server) so it won't go to the foreach below\n \t\t$found_socket = array_search($socket, $changed);\n \t\tunset($changed[$found_socket]);\n \t}\n\n \t//Changed will be the client #resource IF message from client is incoming\n \tforeach ($changed as $changed_socket) {\n // Reading incoming message first 10 chars\n \t\t$buf = @socket_read($changed_socket, 10, PHP_NORMAL_READ); //to check $buf is filled\n\t\t\t\t\tsocket_getpeername($changed_socket, $ip);\n\n \t\tif ($buf === false) { //if $buf empty\n \t\t\t$clients = array_diff($clients, array($changed_socket)); // Remove client from $clients array\n if ($ip != env('APP_IP'))\n \t\t\t echo \"$ip is disconnected\\n\";\n \t\t} else {\n \t\t\tif($ip == env('APP_IP')) { //server to controller\n\t\t\t\t\t\t\t$buf .= @socket_read($changed_socket, 2, PHP_NORMAL_READ);\n\t\t\t\t\t\t\t$length = substr ($buf, 5, 6);\n\t\t\t\t\t\t\t$buf .= @socket_read($changed_socket, $length-12, PHP_NORMAL_READ);\n \t\t\t\t/*********************************************\n \t\t\t\t* Message from server 0000;000037;%0060;0010;%192.168.100.1\n * unmask[0] = 0000;XXXXXX;\n * unmask[1] = 0060;0010; (the message)\n * unmask[2] = 192.168.xxx.xxx (the controller) or 0 (all controller)\n *********************************************/\n \t\t\t\t$unmask = explode(\"%\", $buf);\n \t\t\t\t$message = $unmask[1];\n $controllerip = $unmask[2];\n echo \"$message to $controllerip\\n\";\n \t\t\t\t\n \t\t\t\tif(isset($clients[$controllerip])) {\n \t\t\t$this->send_message($message, array($clients[$controllerip]));\n } else {\n echo \"Controller isn't connected\\n\";\n }\n \t\t\t} else { //controller to server\n\t\t\t\t\t\t\t$length = substr ($buf, 5, 4);\n\t\t\t\t\t\t\t$buf .= @socket_read($changed_socket, $length-10, PHP_NORMAL_READ);\n \t\t\t\t/*********************************************\n \t\t\t\t* Message from controller\n *********************************************/\n echo \"$ip : $buf\\n\";\n\t\t\t\t\t\t\tif(!in_array(substr($buf,0,4), ['1027', '1012', '1080'])) //ignore these event\n\t\t\t\t\t\t\t\tevent(new EventHappened($buf.\"%\".$ip));\n /* Lupa buat apa\n if (isset($clients[env('APP_IP')])) {\n \t\t\t\t $this->send_message($buf, array($clients[getHostByName(getHostName())]));\n } else {\n echo \"Can't send message to server\\n\";\n }\n */\n \t\t\t}\n }\n \t}\n }\n socket_close($socket);\n }", "public function listen(): bool;", "public function __construct ( \\Hoa\\Socket\\Server $server ) {\n\n $this->_server = $server;\n $this->_server->setNodeName('\\Hoa\\Websocket\\Node');\n $this->_on = new \\Hoa\\Core\\Event\\Listener($this, array(\n 'message',\n 'close',\n 'error'\n ));\n\n return;\n }", "public static function start($config)\n\t{\n\t\t// Add the config\n\t\tif (!is_array($config)) {\n\t\t\ttrigger_error(\"Cannot start server, invalid configuration settings\", E_USER_ERROR);\n\t\t}\n\t\tMHTTPD::addConfig($config);\n\n\t\t// Load the mime types info\n\t\t$mimes = @parse_ini_file(MHTTPD::getExepath().'lib\\minihttpd\\config\\mimes.ini', true);\n\t\tMHTTPD::$config['Mimes'] = array_map('listToArray', $mimes['Mimes']);\n\t\t\n\t\t// Set the initial server info values\n\t\tMHTTPD::$info['software'] = 'MiniHTTPD/'.MHTTPD::VERSION.' ('.php_uname('s').')';\n\t\t$addr = $config['Server']['address'];\n\t\t$port = $config['Server']['port'];\n\t\tMHTTPD::$info['signature'] = 'MiniHTTPD/'.MHTTPD::VERSION.' ('.php_uname('s').\") Server at {$addr} Port {$port}\";\n\t\tMHTTPD::$info['launched'] = time();\n\t\t\n\t\t// Spawn any FCGI processes\n\t\tMFCGI::$debug = MHTTPD::$debug;\n\t\tMFCGI::spawn(null, MHTTPD::$config);\n\t\n\t\t// Load the configured request handlers\n\t\tif (MHTTPD::$debug) {cecho(chrule().\"\\n\");}\n\t\tforeach (MHTTPD::$config['Handlers'] as $type=>$handler) {\n\t\t\tif (class_exists($handler)) {\n\t\t\t\tif (MHTTPD::$debug) {cecho(\"Handler loaded ... $type\\n\");}\n\t\t\t\tMHTTPD::$handlers[$type] = new $handler;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Create the queue object for the handlers\n\t\tMHTTPD::$handlersQueue = new MHTTPD_Handlers_Queue(MHTTPD::$handlers);\n\t\t\n\t\t// Start running the main loop\n\t\tMHTTPD::$running = true;\n\t\tMHTTPD::main();\n\t}", "public function handle(ServerRequestInterface $request);", "public function run() {\n $read = array (\n 0 => $this->socket\n );\n\n foreach($this->clients as $client)\n $read[] = $client->socket;\n\n $result = @ socket_select($read, $write = null, $except = null, $this->blocking ? null : 1);\n if ($result === false || ($result === 0 && $this->blocking)) {\n $this->error('Socket Select Interruption: ' . socket_strerror(socket_last_error()));\n return false;\n }\n\n // If the master socket is in the $read array, there's a pending connection\n if (in_array($this->socket, $read))\n $this->connect();\n\n // Handle input from sockets in the $read array.\n $daemon = $this->daemon;\n $printer = function($str) use ($daemon) {\n $daemon->log($str, 'SocketServer');\n };\n\n foreach($this->clients as $slot => $client) {\n if (!in_array($client->socket, $read))\n continue;\n\n $input = socket_read($client->socket, $this->max_read);\n if ($input === null) {\n $this->disconnect($slot);\n continue;\n }\n\n $this->command($input, array($client->write, $printer));\n }\n }", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = Str::camel(\"on_$event\");\n $callback = method_exists($this, $listener) ? [$this, $listener] : function () use ($event) {\n $this->triggerEvent($event, func_get_args());\n };\n\n $this->getServer()->on($event, $callback);\n }\n }", "public function iniciar_socket(){\n\t\t$this->socket= new PHPWebSocket();\t\n\t\t\n\t\t$this->socket->bind('message', 'wsOnMessage');\n\t\t$this->socket->bind('open', 'wsOnOpen');\n\t\t$this->socket->bind('close', 'wsOnClose'); \n\n\n\t\treturn $this->socket->wsStartServer('192.168.1.104','9300');\n\t//\treturn $this->socket->wsStartServer('10.20.0.68','8180');\n\t\t\n\n\t}", "public function init()\n\t{\n\t\t$this->update();\n\t\t\n\t\tif ($this->config->enable->value)\n\t\t{\n\t\t\t$this->bindSockets(\n\t\t\t\t$this->config->listen->value,\n\t\t\t\t$this->config->listenport->value\n\t\t\t);\n\t\t}\n\t}", "public function start($host = 'localhost', $port = 8080, $maxConnections = SOMAXCONN)\n {\n set_time_limit(0);\n ob_implicit_flush();\n\n $this->host = $host;\n $this->port = $port;\n\n $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\n if ($this->socket === false)\n {\n $error = static::getLastError();\n\n throw new Exception('Creating socket failed: ' . $error->message . ' [' . $error->code . ']');\n }\n\n $this->sockets[] = $this->socket;\n\n if (socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1) === false)\n {\n $error = static::getLastError($this->socket);\n\n throw new Exception('Setting socket option to reuse address to true failed: ' . $error->message . ' [' . $error->code . ']');\n }\n\n if (socket_bind($this->socket, $this->host, $this->port) === false)\n {\n $error = static::getLastError($this->socket);\n\n throw new Exception('Binding to port ' . $this->port . ' on host \"' . $this->host . '\" failed: ' . $error->message . ' [' . $error->code . ']');\n }\n\n if (socket_listen($this->socket, $maxConnections) === false)\n {\n $error = static::getLastError($this->socket);\n\n throw new Exception('Starting to listen on the socket on port ' . $this->port . ' and host \"' . $this->host . '\" failed: ' . $error->message . ' [' . $error->code . ']');\n }\n\n $this->log(get_called_class() . \" started listening connections on {$this->host}:{$this->port}\");\n\n $this->registerAutoload();\n\n $this->run();\n }", "public static function start(Closure $handler)\n {\n $address = getenv(self::CHILD_ADDRESS) ?: \"127.0.0.1:8080\";\n\n Loop::run(\n function () use ($handler, $address) {\n $sockets = [\n Server::listen($address),\n ];\n\n $server = new HttpServer(\n $sockets,\n new CallableRequestHandler(\n function (Request $request) use ($handler) {\n $body = yield $request->getBody()->buffer();\n\n $triggerRequest = new TriggerRequest();\n // Get the trigger request from the request body\n $triggerRequest->mergeFromJsonString($body);\n\n // Convert HTTP Request to Nitric Request\n $nitricRequest = \\Nitric\\Faas\\Request::fromTriggerRequest(\n $triggerRequest\n );\n\n $nitricResponse = $handler($nitricRequest);\n if ($nitricResponse instanceof \\Nitric\\Faas\\Response) {\n // Return the Nitric Response as an HTTP Response\n return self::httpResponse($nitricResponse);\n } else {\n $stringData = \"\";\n if (is_array($nitricResponse) || $nitricResponse instanceof stdClass) {\n $stringData = json_encode($nitricResponse);\n } else {\n $stringData = $nitricResponse;\n }\n // Assume simple string return for now...\n $defaultResponse = $nitricRequest->getDefaultResponse();\n $defaultResponse->setData($stringData);\n\n return self::httpResponse($defaultResponse);\n }\n }\n ),\n new Logger()\n );\n\n yield $server->start();\n\n // Stop the server gracefully when SIGINT is received.\n // This is technically optional, but it is best to call Server::stop().\n Loop::onSignal(\n SIGINT,\n function (string $watcherId) use ($server) {\n Loop::cancel($watcherId);\n yield $server->stop();\n }\n );\n }\n );\n }", "private function __construct ( $srv ) { $this->server = $srv; }", "public function listen()\n {\n if (socket_listen($this->socket) === false) {\n throw new SocketException('Couldn`t listen socket: ');\n }\n\n return $this;\n }", "public function initListeningEvent()\n {\n if(!$this->server instanceof \\Swoole\\WebSocket\\Server){\n throw new \\Exception('swoole的websocket服务还未开启');\n }\n try{\n $processor = new LoginCommonCallServiceProcessor(new LoginCommonService($this->server));\n $tFactory = new TTransportFactory();\n $pFactory = new TBinaryProtocolFactory();\n $transport = new ServerTransport($this->server);\n $server = new \\src\\Thrift\\Server\\Server($processor, $transport, $tFactory, $tFactory, $pFactory, $pFactory);\n $server->serve();\n }catch (\\TException $e){\n throw new \\Exception('thrift启动失败');\n }\n }", "public function init()\n {\n $this->sockets = 0;\n }", "private function getHttpSocket(){\n\t\t$httpSocket = new HttpSocket(array('ssl_verify_host' => true));\n\t\treturn $httpSocket;\n\t}", "public function init() {\n try {\n // check for sockets support\n if (!extension_loaded('sockets')) {\n throw new Exception('Sockets extension required!');\n }\n\n // create a socket for communication with the nameParser service\n $this->m_socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n // create a short timeout to not block the service\n socket_set_option($this->m_socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => Yii::app()->params['nameParser']['timeout'], 'usec' => 0));\n socket_set_option($this->m_socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => Yii::app()->params['nameParser']['timeout'], 'usec' => 0));\n // connect to the service\n $this->m_connected = socket_connect($this->m_socket, Yii::app()->params['nameParser']['address'], Yii::app()->params['nameParser']['port']);\n } catch (Exception $e) {\n error_log('[NameParser] ' . $e->getMessage());\n\n $this->m_socket = NULL;\n $this->m_connected = false;\n }\n }", "public function listen($address, $port, $socket_class='IntroSocket', $live_past_shutdown=false) {\r\n\t\t$listener = new ListenerSocket();\r\n\t\t$listener->init($address, $port, $this, $socket_class, $live_past_shutdown);\r\n\t}", "public function actionStartListening()\n {\n if (!isset($_REQUEST['source']))\n {\n echo json_encode(array('errors' => array('Unknown connection type')));\n\n Yii::app()->end();\n }\n\n\n $source = strtoupper ($_REQUEST['source']);\n $communication_type = !empty($_REQUEST['communication_type']) ? strtoupper ($_REQUEST['communication_type']) : 'COMMUNICATION_TYPE_NONE' ;\n\n $last_connection = Listener::getLastConnectionInfo($source);\n\n if ($last_connection && !$last_connection['stopped'])\n {\n echo json_encode(array('ok_still' => 1));\n\n Yii::app()->end();\n }\n\n\n\n $command = Yii::app()->params['applications']['php_exe_path'] . ' -f ' . Yii::app()->params['console_app_path'] . ' listen '. $source .' '. $communication_type .' Admin';\n It::runAsynchCommand($command);\n\n echo json_encode(array('ok' => 1));\n\n Yii::app()->end();\n }", "protected function setupServer()\n {\n $serverVars = $this->router->getServerVarsForUri();\n $_SERVER = array_merge($_SERVER, $serverVars);\n }", "public function listen($listener);", "public function listen(): void\n {\n $receive = function () {\n each($this->receiveMessages(), $this->parseAndConsumeMessage());\n };\n\n $this->settings->beforeReceive($receive);\n }", "public function __construct(LoopInterface $loop, array $serverParams = [])\n {\n $this->loop = $loop;\n $this->serverParams = array_replace([], self::DEFAULT_SERVER_PARAMS, $serverParams, [\n 'loop' => $loop\n ]);\n $onError = function (Throwable $error) {\n $this->emit('error', [$error]);\n };\n $this->requestParser = new RequestParser($this->serverParams);\n $this->matcherFactory = new MatcherFactory($this->serverParams);\n $this->filters = new FilterCollection($this->serverParams);\n $this->routes = new RouteCollection($this->serverParams, $this->matcherFactory);\n $this->negotiator = new WebSocketNegotiator($this->serverParams);\n $this->webSocketHandlers = new WebSocketHandlerFactory($this->serverParams);\n $this->controllerManager = new ControllerManager($this->serverParams, $onError);\n $this->tcpServer = $this->createTcpServer($loop);\n $this->tcpServer->on('error', $onError);\n $this->tcpConnections = new TcpConnections($this->tcpServer, function (ConnectionInterface $connection) {\n $this->onTcpConnection($connection);\n });\n $this->addShutdownSignals($this->serverParams);\n }", "public function addServer($host, $port, $weight = 0) {}", "private function connect() {\n\t\tif (!$this->connected) {\n\t\t\t$this->socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\t\t\t$this->connected = @socket_connect($this->socket, $this->host, $this->port);\n\t\t}\n\t}", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "public function connect()\r\n {\r\n $this->log( \"Connecting to {$this->_server}:{$this->_port}\" );\r\n \r\n // open the connection\r\n $this->_conn = fsockopen( $this->_server, $this->_port, $errno, $errstr, 10 );\r\n \r\n if ( $this->_conn )\r\n {\r\n $this->log( \"Connected.\" );\r\n \r\n // start processing the data\r\n $this->main();\r\n }\r\n }", "public function initialize(DAV\\Server $server)\n {\n $this->server = $server;\n $this->server->on('method:GET', [$this,'httpGet'], 200);\n }", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = 'on' . ucfirst($event);\n\n if (method_exists($this, $listener)) {\n $this->server->on($event, [$this, $listener]);\n } else {\n $this->server->on($event, function () use ($event) {\n $event = sprintf('swoole.%s', $event);\n\n $this->container['events']->fire($event, func_get_args());\n });\n }\n }\n }", "public function run(): void\n {\n $requestBody = $this->getConfig()->getInputAdapter()::getParsedBody();\n $request = ServerRequestFactory::fromGlobals(\n $_SERVER,\n $_GET,\n $requestBody,\n $_COOKIE,\n $_FILES\n );\n\n $queue = [];\n\n $queue[] = new \\Middlewares\\Emitter();\n $queue[] = new ErrorHandler([new JsonFormatter()]);\n $queue[] = (new \\Middlewares\\PhpSession())->name('VENUSSESSID')\n ->regenerateId(60); // Prevent session fixation attacks\n\n $queue[] = (new \\Middlewares\\FastRoute(\n $this->getConfig()->getDispatcher()\n ))->attribute('handler');\n\n $queue = array_merge($queue, $this->getConfig()->getMiddlewares());\n\n // Use router access permission check\n if ($this->getConfig()->usePermission()) {\n $queue[] = (new Permission(\n $this->getConfig()->getContainer()\n ))->handlerAttribute('handler');\n }\n\n $queue[] = (new RequestHandler(\n $this->getConfig()->getContainer()\n ))->handlerAttribute('handler');\n\n $dispatcher = new Dispatcher($queue);\n $dispatcher->dispatch($request);\n }", "public function connect(): void\n {\n if ($this->socket === null) {\n $this->socket = @fsockopen($this->host, $this->port, $errNo, $errStr);\n\n if (!$this->socket) {\n throw new FaktoryException('Unable to connect to server: ' . $errStr);\n }\n\n $hi = $this->read();\n\n if (strpos($hi, \"HI\") !== 0) {\n $this->disconnect();\n throw new FaktoryException('Did not receive HI from server');\n }\n\n $data = json_decode(substr($hi, 2), true);\n\n if ($data['v'] !== 2) {\n $this->disconnect();\n throw new FaktoryException('Unsupported server version ' . $data['v']);\n }\n\n $options = $this->workerOptions;\n $options['v'] = 2;\n\n $this->writeCommand('HELLO', json_encode($options));\n }\n }", "public static function tcp_server(): void\n {\n sock::$type = 'tcp:server';\n sock::$host = '0.0.0.0';\n sock::$port = 1000;\n $ok = sock::create();\n\n if (!$ok) exit('TCP Server creation failed!');\n\n //Set Client list alone\n $client = [];\n\n do {\n //Copy client list to read list\n $read = $client;\n\n //Listen to TCP port\n sock::listen($read);\n\n //Accept new connection\n sock::accept($read, $client);\n\n //Read TCP Data\n $msg = sock::read($read, $client);\n\n var_dump($msg);\n\n //Regroup data\n $data = [];\n\n //example: from message and send back to client\n foreach ($msg as $key => $value) {\n //Client socket resource\n $data[$key]['sock'] = $client[$key];\n //Message to be sent\n $data[$key]['msg'] = 'Hello, dear sender!';\n $data[$key]['msg'] .= PHP_EOL;\n $data[$key]['msg'] .= 'I received your message, and now send it back.';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= '====================================================================';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= $value['msg'];\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= '====================================================================';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= 'Thanks for your test!';\n }\n\n //Send data back and maintain clients\n $result = sock::write($data, $client);\n\n var_dump($result);\n\n } while (true);\n }", "public function startServer()\n {\n // fork\n $pid = pcntl_fork();\n\n // if we're in the child process, start the server and listen for data\n if ($pid > 0)\n {\n return $pid;\n }\n elseif ($pid === 0)\n {\n return $this->listen();\n }\n }", "public function init() {\n\t\t$errno = \"\";\n\t\t$errstr = \"\";\n\t\t\n\t\t//Si la socket est un fichier\n\t\tif (file_exists ( $this->nom_socket )) {\n\t\t\t@unlink ( $this->nom_socket );\n\t\t}\n\t\t\n\t\t$nom_complet = $this->type_socket . \"://\" . $this->nom_socket;\n\t\tif ($this->port_socket != \"\") {\n\t\t\t$nom_complet .= \":\" . $this->port_socket;\n\t\t}\n\t\t$this->socket = stream_socket_server ( $nom_complet, $errno, $errstr );\n\t\t$this->onDebug ( $errstr . \" (\" . $errno . \") sur \" . $nom_complet, 1 );\n\t\t\n\t\tif (! $this->socket) {\n\t\t\treturn $this->onError ( $errstr . \" (\" . $errno . \") sur \" . $nom_complet );\n\t\t\tif ($errstr == \"Address already in use\") {\n\t\t\t\t$CODE_RETOUR = 2;\n\t\t\t} else {\n\t\t\t\t$CODE_RETOUR = 0;\n\t\t\t}\n\t\t} else {\n\t\t\t$CODE_RETOUR = 1;\n\t\t}\n\t\t\n\t\treturn $CODE_RETOUR;\n\t}", "public static function socket($request = null)\n {\n }", "public function run()\n {\n if ($this->connect()) {\n $this->login();\n $this->join();\n $this->listen();\n }\n }", "public function initialize(Server $server) {\n\t\t$this->server = $server;\n\t\t$server->on('exception', [$this, 'logException'], 1000);\n\t}", "public function __construct()\n\t{\n\t\t$configuration = new Config();\n\t\t// Configure socket server\n\t\tparent::__construct($configuration->socket_host, $configuration->socket_controller_port);\n\n\t\t// Run the server\n\t\t$this->run();\n\t}", "public function setupServers()\n\t{\n\t\t$browserTestsRoot = realpath(__DIR__ . '/../../..') . '/browser';\n\t\t$server = new \\halfer\\SpiderlingUtils\\Server($browserTestsRoot . '/docroot');\n\n\t\t// Re-use the Spiderling routing script (it contains the check-alive response)\n\t\t$server->setRouterScriptPath($browserTestsRoot . '/scripts/router.php');\n\t\t$server->setCheckAliveUri('/server-check');\n\n\t\t$this->addServer($server);\n\t}", "public function server($index){\n $this->httpRequest->server($index);\n }", "public function match(ServerRequestInterface $request);", "protected function _start_listening(){\r\n\t\t\tset_error_handler(array($this->_reporter, 'handle_error'));\r\n\t\t\tset_exception_handler(array($this->_reporter, 'handle_exception'));\r\n\t\t\terror_reporting(-1);\r\n\t\t\tini_set('display_errors', false);\r\n\t\t}", "public function run() {\n\n if(!$this->server) {\n\n try {\n\n // initialize socket server\n $this->server = new AppServer($this->config->socket->host, $this->config->socket->port);\n\n // create application with dependencies\n $app = new Sonar(\n new StorageService($this->config->storage),\n new QueueService($this->config->beanstalk),\n new GeoService(),\n new CacheService()\n );\n $this->server->route('/sonar', $app, ['*']);\n }\n catch(QueueServiceException $e) {\n throw new AppServiceException($e->getMessage());\n }\n catch(ConnectionException $e) {\n throw new SocketServiceException($e->getMessage());\n }\n catch(StorageServiceException $e) {\n throw new AppServiceException($e->getMessage());\n }\n catch(CacheServiceException $e) {\n throw new AppServiceException($e->getMessage());\n }\n\n }\n\n if(isset($this->config->storage) === false) {\n throw new AppServiceException('There is no option `storage` in your configurations');\n }\n\n $this->server->run();\n }", "public static function run()\n {\n// $server = IoServer::factory(new WsServer(new WebSocket()), 8080);\n// echo \"websocket do run...\";\n// $server->run();\n// echo \"websocket sever up...\";\n React::runWampServer();\n }", "function __construct($addr, $port, $bufferLength = 2048) \n\t{\n\t\t$this->maxBufferSize = $bufferLength;\n\n\t\t$this->master = socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die(\"Failed: socket_create()\");\n\n\t\tsocket_set_option($this->master, SOL_SOCKET, SO_REUSEADDR, 1) or die(\"Failed: socket_option()\");\n\t\tsocket_bind($this->master, $addr, $port)or die(\"Failed: socket_bind()\");\n\t\tsocket_listen($this->master,20) or die(\"Failed: socket_listen()\");\n\n\t\t$this->sockets['m'] = $this->master;\n\n\t\t$this->stdout(\"Server started\".PHP_EOL.\"Listening on: $addr:$port\".PHP_EOL.\"Master socket: \".$this->master);\n\t}", "public function run()\n {\n while(true)\n {\n $changed_sockets = $this->allsockets;\n $write = null;\n $except = null;\n @stream_select($changed_sockets, $write, $except, 0, 5000); \n foreach($changed_sockets as $socket)\n {\n if($socket == $this->master)\n {\n if(($ressource = stream_socket_accept($this->master)) === false)\n {\n $this->log('Socket error: ' . socket_strerror(socket_last_error($ressource)));\n continue;\n }\n else\n {\n $client = $this->createConnection($ressource);\n $this->clients[(int)$ressource] = $client;\n $this->allsockets[] = $ressource;\n \n if(count($this->clients) > $this->_maxClients)\n {\n $this->log('Attention: Client Limit Reached!');\n $client->onDisconnect();\n if($this->getApplication('status') !== false)\n {\n $this->getApplication('status')->statusMsg('Attention: Client Limit Reached!', 'warning');\n }\n continue;\n }\n \n $this->_addIpToStorage($client->getClientIp());\n if($this->_checkMaxConnectionsPerIp($client->getClientIp()) === false)\n {\n $this->log('Connection/Ip limit for ip ' . $client->getClientIp() . ' was reached!');\n $client->onDisconnect();\n if($this->getApplication('status') !== false)\n {\n $this->getApplication('status')->statusMsg('Connection/Ip limit for ip ' . $client->getClientIp() . ' was reached!', 'warning');\n }\n continue;\n } \n }\n }\n else\n { \n $client = $this->clients[(int)$socket];\n if(!is_object($client))\n {\n unset($this->clients[(int)$socket]);\n continue;\n }\n $data = $this->readBuffer($socket); \n $bytes = strlen($data);\n \n if($bytes === 0)\n {\n $client->onDisconnect(); \n continue;\n }\n elseif($data === false)\n {\n $this->removeClientOnError($client);\n continue;\n }\n elseif($client->waitingForData === false && $this->_checkRequestLimit($client->getClientId()) === false)\n {\n $client->onDisconnect();\n }\n else\n { \n $client->onData($data);\n }\n }\n }\n }\n }", "public function start()\n {\n try {\n $this->registerProvider(Dependents::class);\n $route = Router::match();\n $response = $this->startAction($route);\n }\n catch (\\Throwable $e) {\n $response = $this->handleException($e);\n }\n catch (\\Exception $e) {\n $response = $this->handleException($e);\n }\n\n if ($response instanceof Response) {\n $this->accept($response);\n }\n }", "public function testHttpTestServerAvailable() {\n\t\t$this->assertTrue(\\REQUESTS_TEST_SERVER_HTTP_AVAILABLE);\n\t}", "protected function configureSwooleServer()\n {\n $config = $this->container['config']->get('swoole.server');\n\n $this->server->set($config);\n }", "public function onConnect(\\swoole_server $server, $client_id, $from_id)\n {\n }", "protected function getConfiguredSocket() {}", "public function __construct($stream, LoggerInterface $log)\n {\n $this->log = $log;\n $this->server = stream_socket_server($stream, $errno, $errorMessage);\n stream_set_blocking( $this->server, 0 );\n $this->client_socks = array();\n\n if ($this->server === false) {\n throw new \\Exception(\"Could not bind socket to port\");\n }\n }" ]
[ "0.69306344", "0.6864181", "0.6773482", "0.6536119", "0.64459205", "0.6418066", "0.64069754", "0.63336957", "0.631853", "0.63043815", "0.62670517", "0.61843103", "0.615044", "0.609852", "0.6062807", "0.600146", "0.5992051", "0.5950484", "0.5921276", "0.5904807", "0.58876777", "0.5874494", "0.5863542", "0.58389354", "0.5830844", "0.58158594", "0.5808515", "0.5804382", "0.574997", "0.5730408", "0.570555", "0.56635207", "0.5631674", "0.559195", "0.55824083", "0.55547035", "0.55404305", "0.5522157", "0.5522041", "0.5520543", "0.54887986", "0.54677385", "0.5458437", "0.5371498", "0.53696483", "0.53670734", "0.5354406", "0.5352153", "0.53496367", "0.5348435", "0.531286", "0.5310076", "0.530948", "0.53040284", "0.52986205", "0.5290951", "0.5285155", "0.52844983", "0.5281767", "0.5280964", "0.5268532", "0.5264231", "0.52572346", "0.52382463", "0.5233765", "0.52276", "0.521399", "0.5213714", "0.51917356", "0.51762354", "0.516503", "0.5162909", "0.5153789", "0.51423", "0.51376283", "0.5131942", "0.5127932", "0.51208776", "0.5116601", "0.5115284", "0.5102035", "0.508881", "0.5044044", "0.5032212", "0.5021853", "0.5021848", "0.49806854", "0.49805444", "0.49768677", "0.49680394", "0.49597123", "0.49519432", "0.4928296", "0.4927089", "0.49220422", "0.4920489", "0.4911732", "0.49055192", "0.49042165", "0.48985565" ]
0.6133326
13
Return the Revison (hash) of current HEAD
public function getRev() : string;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHeadSHA1() {\n\t\t$headFile = \"{$this->dir}/HEAD\";\n\t\tif ( !is_readable( $headFile ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$head = file_get_contents( $headFile );\n\t\tif ( preg_match( \"/ref: (.*)/\", $head, $m ) ) {\n\t\t\t$head = rtrim( $m[1] );\n\t\t} else {\n\t\t\t$head = rtrim( $head );\n\t\t}\n\n\t\tif ( self::isSHA1( $head ) ) {\n\t\t\t// Detached head\n\t\t\treturn $head;\n\t\t}\n\n\t\t// Resolve ref\n\t\t$refFile = \"{$this->dir}/{$head}\";\n\t\tif ( !is_readable( $refFile ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn rtrim( file_get_contents( $refFile ) );\n\t}", "public static function getHeadRevision() {\n $settings = self::getSettings();\n if(!self::$_hasHeadRevisionIncremented) {\n if(self::newRevisionsAllowed()) {\n $settings->headrevision++;\n self::$_hasHeadRevisionIncremented = true;\n $settings->save();\n }\n }\n return $settings->headrevision;\n }", "protected function getUllrightHeadRevision()\n {\n $command = 'svn info http://bigfish.ull.at/svn/ullright/trunk';\n $output = reset($this->getFilesystem()->execute($command));\n preg_match('#Revision: ([\\d]+)#', $output, $matches);\n \n return $matches[1];\n }", "public function getHash(): string\n {\n return $this->commitData['sha'];\n }", "public static function hash()\n {\n if (static::isClean()) {\n return static::command(\"git log --pretty=format:'%H' -n 1\");\n }\n }", "public static function getCurrentRevision() {\n $settings = self::getSettings();\n return $settings->headrevision;\n }", "public function hash() {\n if(isset($this->cache['hash'])) return $this->cache['hash'];\n\n // add a unique hash\n $checksum = sprintf('%u', crc32($this->uri()));\n return $this->cache['hash'] = base_convert($checksum, 10, 36);\n }", "public function getReferenceHash()\n {\n return $this->reference_hash;\n }", "public function getCheckpointHash()\n {\n $query = $this->db->prepare(\n 'SELECT lasthash FROM gossamer_meta WHERE version = ?',\n self::GOSSAMER_PROTOCOL_VERSION\n );\n\n $results = $this->db->get_col($query);\n\n return (string) $results[0];\n }", "protected function getGitRevision() {}", "static public function getLastCommitHash(){\n \n //get the revision log \n $last_commit = self::getLastCommit();\n $commit_hashes = array_keys( $last_commit );\n return reset( $commit_hashes );\n \n }", "public function getHash(): string\n {\n return $this->data->hash;\n }", "public function getHash()\n\t{\n\t\treturn $this->hash;\n\t}", "public function getHash()\n {\n return $this->hash;\n }", "public function getHash()\n {\n return $this->hash;\n }", "public function getHash()\n {\n return $this->hash;\n }", "public function getHash()\n {\n return $this->hash;\n }", "public function getHash()\n {\n return $this->hash;\n }", "public function getHash()\n {\n return $this->hash;\n }", "private static function getUrlHash() {\n $queryStr = self::getUrlQueryString();\n return strRightFrom($queryStr, '#', 1, true);\n }", "public function getRHash()\n {\n return $this->r_hash;\n }", "public function getHash() {\n\t\treturn $this->Hash;\n\t}", "public function getHash(){\n\t\treturn $this->name->getHash();\n\t}", "public function getGitHash($short = false)\n {\n return $this->runGitCommand(\n sprintf(\n 'git log --pretty=\"%s\" -n1 HEAD',\n $short ? '%h' : '%H'\n )\n );\n }", "public function getHash()\n\t{\n\t\treturn $this->_hash ;\n\t}", "final public function getHash() {}", "public function getHash()\n {\n return $this->getData(self::HASH);\n }", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "function GetPrewURI() /*added 16_05*/\n\t\t{\n\t\tif($this->history[count($this->history)-1])\n\t\t\t$ret = $this->history[count($this->history)-1];\n\t\telse\n\t\t\t$ret = $_SERVER['SERVER_NAME'];\n//\t\treturn $this->history[count($this->history)-1]; \n\t\treturn $ret;\n\t\t}", "public function getHash() {}", "public function getChronicleHash()\n {\n return $this->chronicleHash;\n }", "public function getLastCommitSHA1(string $ref = 'HEAD'): string\n {\n $lines = $this->run('log --max-count=1 --format=format:%H ' . escapeshellarg($ref));\n\n return trim(implode(\"\\n\", $lines));\n }", "public function getVersionHistoryHashtxt()\n {\n $versionData = $this->getVersionHistoryJsn();\n $versionData = json_encode($versionData);\n $versionData = \\arajcany\\ToolBox\\Utility\\Security\\Security::encrypt64Url($versionData);\n\n return $versionData;\n }", "public function GetDigest()\n {\n return hash_final($this->_resource, true);\n }", "public function getHash();", "protected function getAgainst()\n {\n ob_start();\n $result = shell_exec('git rev-parse --verify --quiet HEAD');\n ob_clean();\n // Check if we're on a semi-secret empty tree\n if ($result) {\n return 'HEAD';\n } else {\n // Initial commit: diff against an empty tree object\n return '4b825dc642cb6eb9a060e54bf8d69288fbee4904';\n }\n }", "public function getHeadCode()\n {\n return $this->head_code;\n }", "public function getSha1()\n {\n if (array_key_exists(\"sha1\", $this->_propDict)) {\n return $this->_propDict[\"sha1\"];\n } else {\n return null;\n }\n }", "public function getLastRevisionId()\n {\n $this->pull();\n $result = $this->execute('log', array('-n1'), array());\n foreach($result as $line)\n {\n if ('commit' == substr($line, 0, 6))\n {\n $parts = explode(' ', $line);\n return (string)$parts[1];\n }\n }\n }", "public function rpIdHash(): string\n {\n return $this->rpIdHash;\n }", "public function getHash() {\n\t\treturn sha1( serialize( $this->property ) );\n\t}", "public function getRevision()\n {\n return $this->_rev;\n }", "public function getHash()\n\t{\n\t\tif (!$this->hash)\n\t\t{\n\t\t\t$this->createHash();\n\t\t\t$this->getFromDB($this->hash);\n\t\t}\n\n\t\treturn $this->hash;\n\t}", "public function getHead()\n {\n return $this->head;\n }", "public function getSha1()\n {\n return $this->sha1;\n }", "public function getHashIdentifier() : string;", "public function getRevision()\n {\n return $this->result[\"revision\"];\n }", "public function getRev()\n {\n return $this->data['fields']['rev'];\n }", "public function branch()\n {\n $result = $this->git('symbolic-ref --short HEAD');\n if (empty($result)) {\n return 'master';\n }\n\n return $result;\n }", "public function Head() {\n\t\treturn $this->head;\n\t}", "public function getSha1() {\n\t\treturn $this->sha1;\n\t}", "public function _getOnlineVersionHistoryHash()\n {\n\n $remote_update_url = TextFormatter::makeEndsWith($this->Settings->getSetting('remote_update_url'), \"/\");\n\n $arrContextOptions = [\n \"ssl\" => [\n \"verify_peer\" => false,\n \"verify_peer_name\" => false,\n ],\n ];\n $versionHistoryHash = @file_get_contents($remote_update_url . \"version_history_hash.txt\", false, stream_context_create($arrContextOptions));\n\n if ($versionHistoryHash) {\n $versionHistoryHash = \\arajcany\\ToolBox\\Utility\\Security\\Security::decrypt64Url($versionHistoryHash);\n $versionHistoryHash = @json_decode($versionHistoryHash, JSON_OBJECT_AS_ARRAY);\n if (is_array($versionHistoryHash)) {\n return $versionHistoryHash;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "public static function get() {\n\t\t$commitHash = trim(exec('git log --pretty=\"%h\" -n1 HEAD'));\n\n\t\t// Get date and time information.\n\t\t$commitDate = new \\DateTime(trim(exec('git log -n1 --pretty=%ci HEAD')));\n\t\t$commitDate->setTimezone(new \\DateTimeZone('UTC'));\n\n\t\t// Format all information into a version identifier.\n\t\treturn sprintf('v%s.%s.%s-dev.%s (%s)', self::MAJOR, self::MINOR, self::PATCH, $commitHash, $commitDate->format('Y-m-d H:m:s'));\n\t}", "public function getRevision() ;", "public function getHead()\n {\n return $this->Head;\n }", "public function getSHA1()\n {\n if (!$this->sha1) {\n $this->sha1 = sha1(\\gihp\\Parser\\File::exportObject($this));\n }\n\n return $this->sha1;\n }", "public function getRevision() {}", "function getUrl() {\n\t\treturn $this->repoObj->lobUrltitle;\n\t}", "public function get_head()\n\t{\n\t\treturn $this->its_all_in_your_head;\n\t}", "public function _getOnlineVersionHistoryHashForDebug()\n {\n\n $remote_update_url = TextFormatter::makeEndsWith($this->Settings->getSetting('remote_update_url'), \"/\");\n\n $arrContextOptions = [\n \"ssl\" => [\n \"verify_peer\" => false,\n \"verify_peer_name\" => false,\n ],\n ];\n $versionHistoryHash = @file_get_contents($remote_update_url . \"version_history_hash.txt\", false, stream_context_create($arrContextOptions));\n\n return $versionHistoryHash;\n }", "public function getSha1() {}", "function getSha1() ;", "public function getSha1() {}", "public function head()\n {\n $this->method = 'HEAD';\n return $this;\n }", "public function getHash()\n {\n return sprintf(\n '%s::%s::%s',\n $this->package,\n $this->class,\n $this->method\n );\n }", "public function getUrlHostHash() {\n $aUrlParts = parse_url( $this->url );\n\n return md5( $aUrlParts[ 'host' ] );\n }", "public function getPreviewHash()\n {\n return md5($this->timestamp_create . $this->create_user_id . $this->id);\n }", "private function getHash($url){\r\n return $url;\r\n }", "protected function getGitRevision()\n {\n chdir(PATH_site);\n $revision = trim(CommandUtility::exec('git describe'));\n chdir(PATH_typo3);\n return [\n htmlspecialchars('Site Version'),\n htmlspecialchars($revision),\n 'sysinfo-git',\n ];\n }", "public function getHead() {\r\n\t\treturn $this->_head;\r\n\t}", "public function getHashIndex()\n {\n return $this->hashIndex;\n }", "protected function getCommitMessageHead() {\n return \"WordPress updated to version \" . $this->getVersion();\n }", "public function getUserHash () {\n\t\treturn ($this->userHash);\n\t}", "function getFileRevision() {\n\t\treturn $this->getData('fileRevision');\n\t}", "function getLatestRev() {\n\t\t$rev = $this->LatestRevPacked;\n\t\tif(!$rev && $this->URL) {\n\t\t\t$this->NeedsLatestRev = 1;\n\t\t\t$this->update();\n\t\t\t$rev = $this->LatestRevPacked;\n\t\t}\n\t\treturn $rev;\n\t}", "public function getRevision()\n {\n return $this->revision;\n }", "public function hash() {\r\n\t\t$filename = pathinfo($this->filepath, PATHINFO_BASENAME );\r\n\t\treturn sha1($filename);\r\n\t}", "public function getGitShortHashPlaceholder()\n {\n if (isset($this->raw->{'git-commit-short'})) {\n return $this->raw->{'git-commit-short'};\n }\n\n return null;\n }", "public function getIsHead()\n {\n return $this->getMethod() === 'HEAD';\n }", "public function getGitVersion()\n {\n try {\n return $this->getGitTag();\n } catch (RuntimeException $exception) {\n try {\n return $this->getGitHash(true);\n } catch (RuntimeException $exception) {\n throw new RuntimeException(\n sprintf(\n 'The tag or commit hash could not be retrieved from \"%s\": %s',\n dirname($this->file),\n $exception->getMessage()\n ),\n 0,\n $exception\n );\n }\n }\n }", "public function head() {\n return $this->head ;\n }", "public function setHead($head): Versionable;", "public function getHashIndex() {\n\t\treturn $this->_hashIndex;\n\t}", "public function getRevisionNumber()\n {\n return $this->revision_number;\n }", "public function getRevision();", "public function getRevision() {\n return $this->revision;\n }", "public function isHead()\n {\n return ($this->getMethod() == 'HEAD') ? true : false;\n }", "public static function version()\n {\n if (! file_exists('.git')) {\n return '*no-git* (dirty)';\n }\n\n return preg_replace('/\\s+/', '', shell_exec('git describe --tag'));\n }", "public function getHeadline() {\n\t\t$headline = $this->wire('processHeadline'); \n\t\tif(!$headline) $headline = $this->wire('page')->get('title|name'); \n\t\t$headline = $this->_($headline); \n\t\treturn $headline;\n\t}", "public function getGitHashPlaceholder()\n {\n if (isset($this->raw->{'git-commit'})) {\n return $this->raw->{'git-commit'};\n }\n\n return null;\n }", "final public function getHash(): string\n {\n return serialize([\n \\get_class($this),\n $this->acceptedExtension(),\n $this->getJsModule(),\n ]);\n }", "public function hash() {\n\t\t$hash = parent::get('hash');\n\t\tif($hash) return $hash; \t\n\t\t$this->set('hash', md5($this->basename())); \n\t\treturn parent::get('hash'); \n\t}", "public function getDigest() : string\n {\n return $this->digest;\n }", "public function version()\n {\n return $this->git('describe --always --tags --dirty');\n }", "public function getHash(): ?string\n {\n return $this->hash;\n }", "public function isHead()\n {\n return $this->getMethod() === 'HEAD';\n }", "public function get_ref( $ref = '' ){\n\n\t\t\tif( empty( $ref ) )\n\t\t\t\t$ref = 'heads/master';\n\t\t\telse\n\t\t\t\t$ref = sprintf( 'heads/%s', str_replace( 'heads/', '', $ref ) );\n\n\t\t\treturn $this->get_github_data( 'ref', $ref );\n\n\t\t}" ]
[ "0.7551706", "0.6887303", "0.66661054", "0.6633864", "0.65264004", "0.65162176", "0.6377292", "0.6317431", "0.61980957", "0.6194594", "0.61905175", "0.61805445", "0.61775494", "0.6164585", "0.6164585", "0.6164585", "0.6164585", "0.6164585", "0.6164585", "0.6110272", "0.608633", "0.60706645", "0.60643387", "0.6047137", "0.6013575", "0.600213", "0.5959237", "0.5948798", "0.5948798", "0.5948798", "0.5948798", "0.58984697", "0.589808", "0.58979887", "0.5890988", "0.5882009", "0.5875288", "0.5822905", "0.5786591", "0.57718945", "0.5732135", "0.5728919", "0.56976664", "0.5687578", "0.568289", "0.5673535", "0.567147", "0.56704783", "0.5664305", "0.5647304", "0.5647174", "0.5644758", "0.5637589", "0.56293803", "0.5619637", "0.56163687", "0.5605523", "0.56034374", "0.55956376", "0.5594482", "0.55909294", "0.5577656", "0.5571577", "0.55514574", "0.5550378", "0.5548556", "0.55473465", "0.5544574", "0.554162", "0.5526755", "0.55109656", "0.5506059", "0.5484479", "0.54723066", "0.5467569", "0.54658794", "0.54651725", "0.54601747", "0.54543906", "0.5445649", "0.54422045", "0.5436726", "0.5435446", "0.541528", "0.5415014", "0.5413336", "0.5406251", "0.5402271", "0.5381223", "0.53798616", "0.5378824", "0.5378492", "0.53731847", "0.536324", "0.5356058", "0.5336711", "0.53365946", "0.5326821", "0.5326141", "0.5323582" ]
0.55648476
63
Run the database seeds.
public function run() { Country::create($this->country()); Region::insert($this->regions()); if ($this->cities() > 4000) { foreach (array_chunk($this->cities(), 3500) as $chunk) City::insert($chunk); } else { City::insert($this->cities()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
find models where field has foreign on current model
private function getRelatedHasManyModels(string $modelName) { $structures = SchemaStructure::get(); $filtered = collect($structures)->filter(function ($schema, $modelKey) use ($modelName) { if (substr($modelKey, 0, 6) === 'pivot:') { return false; } $foreignKeyFields = collect($schema) ->filter(function ($fields, $schemaName) { return data_get($fields, 'foreign'); }); // check the 'on' is related to current model $ons = data_get($foreignKeyFields, '*.foreign.on'); return collect($ons)->first(fn ($on) => Str::plural(Str::snake($modelName)) === Str::plural($on)); }); return $filtered->keys(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasRelation($model, $foreignKey, $localKey);", "public function isRelated();", "public function getForeignKey();", "public function showRelated(Request $request, object $model, string $fieldName): bool;", "public static function getResolveForeignIdFields();", "function isFK(){\n\t\treturn $this->remote_field != '' ;\n\t}", "public function constrain()\n\t{\n\t\treturn $this->related\n\t\t ->whereEquals($this->relatedKey, $this->model->{$this->localKey})\n\t\t ->whereEquals($this->shifter, strtolower($this->model->getModelName()));\n\t}", "private function isForeignInBelongsToModel($table, $key)\n {\n $has_column = array_filter($table->getColumns(), function ($column) use ($key) {\n return $column->name == $key;\n });\n\n //Check if relationship column has been already added from belongsToModelProperty\n return count($has_column) > 0;\n }", "public function af(): BelongsTo\n {\n return $this->additionalField();\n }", "protected function _checkForeignKeysReverseRestrict() {}", "public function has_one($model, $foreign = null) {\n\t\treturn $this->has_one_or_many(__FUNCTION__, $model, $foreign);\n\t}", "protected function _checkForeignKeysRestrict() {}", "public function findForeignIDs($model) \r\n {\r\n foreach($model->hasAndBelongsToMany as $assocKey => $assocData) {\r\n $assocModel = $model->{$assocData['className']};\r\n $field = Inflector::underscore($model->name) . '_count';\r\n if ($assocModel->hasField($field)) {\r\n $joinModel = $model->{$assocData['with']};\r\n $joinIDs = $joinModel->find('all', array(\r\n 'fields' => array(\r\n $assocData['associationForeignKey']\r\n ) ,\r\n 'conditions' => array(\r\n $assocData['foreignKey'] => $model->id\r\n ) ,\r\n 'group' => $assocData['associationForeignKey']\r\n ));\r\n $this->foreignTableIDs[$assocData['className']] = array_keys(Set::combine($joinIDs, '{n}.' . $assocData['with'] . '.' . $assocData['associationForeignKey']));\r\n }\r\n }\r\n }", "public function getForeignKeys(){\n \n }", "public function showRelationship(Request $request, object $model, string $fieldName): bool;", "public function fieldBelongsToItsModel($field)\n {\n\treturn $this->fetch('select [id] from [fields] where [table] = %s and [name] = %s', \n\t $field->getModel()->getTableName(),\n\t $field->getName()\n\t) === false ? false : true;\n }", "private function hasForeignFields()\r\n\t{\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\tif ($field instanceOf ForeignField)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function has_many($model, $foreign = null) {\n\t\treturn $this->has_one_or_many(__FUNCTION__, $model, $foreign);\n\t}", "function getForeignKeysToModel($model)\n {\n $keys = array();\n foreach ($this->_cols as $col=>$val) {\n $field = new $val['type']();\n if ($field->type == 'foreignkey' and $val['model'] == $model) {\n $keys[$col] = $val;\n }\n }\n return $keys;\n }", "public function model()\n {\n return $this->belongsTo('Furniture\\FModel', 'model_id');\n }", "public function getForeignKey($name);", "public function getContainsForeignPK()\n {\n return $this->containsForeignPK;\n }", "public function fieldOne(): BelongsTo\n {\n return $this->belongsTo(Field::class, 'field_one_id');\n }", "function is_reference_in_table($field, $table, $id)\n{\n $CI =& get_instance();\n $CI->db->where($field, $id);\n $row = $CI->db->get($table)->row();\n if ($row) {\n return true;\n }\n\n return false;\n}", "protected function getRelated(Request $request, $model)\n {\n return $this->field->getQuery()->findOrFail($request->related_id);\n }", "protected function _checkForeignKeysReverseCascade() {}", "public function getForeignModel(): string\n {\n return $this->foreignModel;\n }", "private function oneOrMany($model, $foreign_key)\n \t{\n \t\t$this->relating_key = (is_null($foreign_key)) ? Inflector::lower(static::modelName($this)).'_id' : $foreign_key;\n\n \t\treturn $model::where('_id', $this->attributes[$this->relating_key]);\n \t}", "public function validateForeignKey($field) {\n $associations = array_map(\n create_function('$v', 'return $v[\"foreignKey\"];'), $this->belongsTo\n );\n\n $aliases = array();\n foreach ($associations as $model => $foreignKey) {\n if (!array_key_exists($foreignKey, $aliases))\n $aliases[$foreignKey] = array();\n array_push($aliases[$foreignKey], $model);\n }\n\n foreach ($aliases[key($field)] as $model) {\n $count = $this->{$model}->find('count', array(\n 'conditions' => array(\n $model . '.' . $this->{$model}->primaryKey => current($field)\n ),\n 'recursive' => -1\n ));\n if ($count == 1)\n return true;\n }\n return false;\n }", "public function getField()\n {\n return $this->belongsTo(Field::class, 'field_id')->first();\n }", "public function getField()\n {\n return $this->hasOne(Field::className(), ['field_id' => 'field_id']);\n }", "private static function getRelatedModel($model, $relationColumn) {\n return $model->foreign_keys[$relationColumn]['classname'];\n }", "public function hasOne($class, $foreignKey = null, $localKey = null);", "public function getForeignKeys()\n {\n return $this->parentTable->getColumnForeignKeys($this->name);\n }", "public function additionalField(): BelongsTo\n {\n return $this->belongsTo(AdditionalField::class);\n }", "public function hasRelationManyToOne($fieldName) {\n\t\t$result = FALSE;\n\n\t\t$foreignField = $this->getForeignField($fieldName);\n\t\tif (!empty($foreignField)) {\n\n\t\t\t// Load TCA service of foreign field..\n\t\t\t$foreignTable = $this->getForeignTable($fieldName);\n\t\t\t$tcaForeignFieldService = \\TYPO3\\CMS\\Vidi\\Tca\\TcaServiceFactory::getFieldService($foreignTable);\n\t\t\t$result = $this->hasRelationMany($fieldName) && $tcaForeignFieldService->hasRelationOne($foreignField);\n\t\t}\n\t\treturn $result;\n\t}", "public function junctionField(): BelongsTo\n {\n return $this->belongsTo(Field::class, 'junction_field_id');\n }", "public function company() \n\t{\n\t\treturn $this->belongsTo('Company', 'object_id')->where('soft_deleted', 0);\n\t}", "public function getFind()\n {\n return $this->hasOne(FrecuenciaIndicador::className(), ['find_id' => 'find_id']);\n }", "public function referee()\n {\n return $this->hasOne('App\\Models\\Referee');\n }", "public function referredIn($field)\r\n {\r\n $result = [];\r\n foreach ($this->relations as $relation) {\r\n if (false === $i = array_search($field, $relation->localKeys())) {\r\n continue;\r\n }\r\n\r\n $result[$relation->foreignKeys()[$i]] = $relation;\r\n }\r\n\r\n return $result;\r\n }", "public function getForeignKey()\n {\n return $this->foreignKey;\n }", "public function getForeignKey()\n {\n return $this->foreignKey;\n }", "public function getForeignKey()\n {\n return $this->foreignKey;\n }", "public function foreignKeyCheck(): ForeignKeyCheck\n {\n return Factory::factory('DatabaseForeignKeyCheck', null, $this);\n }", "public function __get($field) {\n\n if (array_key_exists($field, $this->_fields)) {\n return $this->_fields[$field];\n } else if (in_array($field, ApplicationSql::tablenames())) { // Büyükten -> Küçüğe\n\n $belong_table = $field; // user\n $foreign_key = $field . \"_id\"; //user_id\n\n if (!in_array($foreign_key, ApplicationSql::fieldnames($this->_table)))\n throw new BelongNotFoundException(\"Tabloya ait olan böyle foreign key yok\", $foreign_key);\n\n return $belong_table::find($this->_fields[$foreign_key]);\n } else {\n preg_match_all(\"/all_of_.*/\", $field, $matches);\n $matches = $matches[0];\n\n if ($matches) {\n $field = substr($field, 7);\n if (in_array($field, ApplicationSql::tablenames())) {\n\n $owner_table = ucfirst($field); // model name\n $owner_key = strtolower($this->_table) . \"_id\";\n\n // return $owner_table::load()->where([$owner_key => $this->_fields[\"id\"]])->take();\n return $owner_table::load()->where($owner_key, $this->_fields[\"id\"])->take();\n }\n }\n }\n\n throw new FieldNotFoundException(\"Tabloda getirilecek böyle bir anahtar mevcut değil\", $field);\n }", "public function getForeignKey()\n {\n return 'owner_id';\n }", "public function isForeignKey()\n {\n\treturn false;\n }", "public function fetchRelatedEagerReturnsNullForEmptyRelationHasOne() {}", "public function getQuery(): Query\n {\n $foreignModel = $this->foreignModel;\n $query = new Query(new $foreignModel());\n $this->initQuery($query);\n\n return $query;\n }", "function get_related($obj, $exception=array())// retreive related objects\r\n\t{\r\n\t\t$arr = object_2_array($obj);\r\n\t\t$objs = array();\r\n\t\tforeach ($arr as $k=>$v)\r\n\t\t{\r\n\t\t\tif (strstr($k, '_id') && !in_array($k, $exception))// if it's foreign key\r\n\t\t\t{\r\n\t\t\t\t$field = explode('_', $k);\r\n\t\t\t\tarray_pop($field);\r\n\t\t\t\t$f = count($field) ? implode('_', $field) : $field[0];\r\n\t\t\t\t$objs[$f] = $this->Retrieve(ucwords($this->get_db_name($f)), $v, true, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count($objs) ? $objs : false;\r\n\t}", "public function fieldMany(): BelongsTo\n {\n return $this->belongsTo(Field::class, 'field_many_id');\n }", "public function foreignConstraint();", "public function getForeignKey()\n {\n return 'match_id';\n }", "abstract public function findRelatedRecordsByEmail(): array;", "public function getQualifiedForeignKeyName()\n {\n return $this->foreignKey;\n }", "public function getForeignField($fieldName) {\n\t\t$result = NULL;\n\t\t$configuration = $this->getConfiguration($fieldName);\n\n\t\tif (!empty($configuration['foreign_field'])) {\n\t\t\t$result = $configuration['foreign_field'];\n\t\t} elseif ($this->hasRelationManyToMany($fieldName)) {\n\n\t\t\t$foreignTable = $this->getForeignTable($fieldName);\n\t\t\t$manyToManyTable = $this->getManyToManyTable($fieldName);\n\n\t\t\t// Load TCA service of foreign field.\n\t\t\t$tcaForeignFieldService = \\TYPO3\\CMS\\Vidi\\Tca\\TcaServiceFactory::getFieldService($foreignTable);\n\n\t\t\t// Look into the MM relations checking for the opposite field\n\t\t\tforeach ($tcaForeignFieldService->getFieldNames() as $fieldName) {\n\t\t\t\tif ($manyToManyTable == $tcaForeignFieldService->getManyToManyTable($fieldName)) {\n\t\t\t\t\t$result = $fieldName;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function getQualifiedForeignKeyName(): string\n {\n return $this->related->getQualifiedKeyName();\n }", "public function getForeign()\n {\n return $this->foreign;\n }", "public function __get($column) {\n\t\tif ($column == 'search') {\n\t\t\tif (isset($this->_related[$column])) {\n\t\t\t\treturn $this->_related[$column];\n\t\t\t}\n\n\t\t\t$model = $this->_related($column);\n\n\t\t\t// Use this model's primary key value and foreign model's column\n\t\t\t$col = $model->_object_name.'.'.$this->_belongs_to[$column]['foreign_key'];\n\t\t\t$val = $this->guid;\n\n\t\t\t$model->where($col, '=', $val)->find();\n\t\t}\n\n\t\treturn parent::__get($column);\n\t}", "public function whereRelatedTo($field, $className, $objectId) {\n\t$this->parseQuery->whereRelatedTo($field, $className, $objectId);\n }", "public function belongsTo($class, $foreignKey = null, $otherKey = null);", "public function business()\n {\n return $this->belongsTo('App\\Business');\n }", "public function detachRelationship(Request $request, object $model, string $fieldName): bool;", "public function business()\n {\n return $this->belongsTo('App\\Models\\Business');\n }", "public function business()\n {\n return $this->belongsTo('App\\Models\\Business');\n }", "public function hasModel();", "public function business()\n {\n return $this->belongsTo('App\\Business');\n }", "private function isForeignField($fieldName)\r\n\t{\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\tif ($field->name == $fieldName && $field instanceOf ForeignField)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function whereHas($relation, $field, $operator, $value);", "public function user(): BelongsTo;", "public function testFkExists()\n {\n $this->assertTrue($this->connection->foreignKeyExists('writers', 'writer_period'));\n $this->assertFalse($this->connection->foreignKeyExists('writers', 'unknown FK'));\n }", "public function relatedDataBase()\n {\n return $this->belongsTo('App\\Database','database');\n }", "public function getFk()\n {\n return $this->_fk;\n }", "public function hasMany($class, $foreignKey = null, $localKey = null);", "protected function other_key()\n {\n return Relationship::foreign($this->model, $this->other);\n }", "public function getRelatedDescriptor()\n\t{\n\t\treturn Db::getDescriptor($this->getRelatedClass());\n\t}", "protected function setWhere()\n {\n $foreign = $this->getForeignKey ();\n $this->query->where ( $foreign, '=', $this->parent->getKey () );\n return $this;\n }", "function hasAssociation($fieldName);", "public function oneToOne($model, $foreign_key = null)\n \t{\n \t\t$this->relating = __FUNCTION__;\n\n \t\tif ( ! is_null($foreign_key)) {\n \t\t\t$this->relating_key = $foreign_key;\n \t\t} else {\n \t\t\tlist(, $caller) = debug_backtrace(false);\n\n \t\t\t$this->relating_key = $caller['function'].'_id';\n \t\t}\n\n \t\treturn $model::where('_id', $this->attributes[$this->relating_key]);\n \t}", "public function hasRelation($fieldName) {\n\t\treturn NULL !== $this->getForeignTable($fieldName);\n\t}", "public function getForeignKey()\n {\n return 'nonmember_id';\n }", "function _related_required($object, $model)\r\n\t{\r\n\t\treturn ($this->_count_related($model, $object) == 0) ? FALSE : TRUE;\r\n\t}", "private function _has_one($request)\n {\n $relation = $this->_relationships[$request];\n $this->_database->join($relation['foreign_table'], $relation['foreign_table'].'.'.$relation['foreign_key'].' = '.$this->table.'.'.$relation['local_key'], 'left');\n return TRUE;\n }", "public function belongsToRelation()\n {\n return $this->belongsTo(Relations::class)\n ->foreignKey('on_table_id');\n }", "public function order(): BelongsTo;", "public static function belongsTo($model, $parentColumn) {\n $r = new static(['type' => DbRelations::BELONGS_TO, 'model' => $model]);\n return $r->columnsEqual($parentColumn, $model::getDb()->getTablePk($model::getTableName()));\n }", "public function dropForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\t// Does the table exist?\n\t\tif (blx()->db->getSchema()->getTable('{{'.$table.'}}'))\n\t\t{\n\t\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t\t{\n\t\t\t\t$otherModel = new $config[1];\n\t\t\t\t$otherTable = $otherModel->getTableName();\n\n\t\t\t\t// Does the other table exist?\n\t\t\t\tif (blx()->db->getSchema()->getTable('{{'.$otherTable.'}}'))\n\t\t\t\t{\n\t\t\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\t\t\t\t\tblx()->db->createCommand()->dropForeignKey($fkName, $table);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function referal() {\n return $this->hasMany('App\\Referal','refered_by');\n }", "function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}", "protected function _has_one_or_many($associated_class_name, $foreign_key_name=null, $foreign_key_name_in_current_models_table=null, $connection_name=null) {\r\n $base_table_name = self::_get_table_name(get_class($this));\r\n $foreign_key_name = self::_build_foreign_key_name($foreign_key_name, $base_table_name);\r\n\r\n $where_value = ''; //Value of foreign_table.{$foreign_key_name} we're\r\n //looking for. Where foreign_table is the actual\r\n //database table in the associated model.\r\n\r\n if(is_null($foreign_key_name_in_current_models_table)) {\r\n //Match foreign_table.{$foreign_key_name} with the value of\r\n //{$this->_table}.{$this->id()}\r\n $where_value = $this->id();\r\n } else {\r\n //Match foreign_table.{$foreign_key_name} with the value of\r\n //{$this->_table}.{$foreign_key_name_in_current_models_table}\r\n $where_value = $this->$foreign_key_name_in_current_models_table;\r\n }\r\n\r\n // Added: to determine eager load relationship parameters\r\n $this->relating_key = $foreign_key_name;\r\n return self::factory($associated_class_name, $connection_name)->where($foreign_key_name, $where_value);\r\n }", "function dbWhereVars() {\n\n foreach ($this->fields() as $f) {\n if ($this->$f === false) continue;\n $this->db->where($this->model.'.'.$f,$this->$f);\n }\n\n }", "public function libro(){\n return $this->belongsTo('App\\Models\\Libro');\n }", "public function belongs_to($model, $foreign = null) {\n\t\t// If no foreign key is specified for the relationship, we will assume that the\n\t\t// name of the calling function matches the foreign key. For example, if the\n\t\t// calling function is \"manager\", we'll assume the key is \"manager_id\".\n\t\tif (is_null($foreign)) {\n\t\t\tlist(, $caller) = debug_backtrace(false);\n\n\t\t\t$foreign = \"{$caller['function']}_id\";\n\t\t}\n\n\t\treturn new Relationships\\Belongs_To($this, $model, $foreign);\n\t}", "public function company(){\n return $this->belongsTo('\\App\\Company');\n }", "public function relatedTable()\n {\n return $this->belongsTo('App\\Table','table');\n }", "public function addForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$otherModel = new $config[1];\n\t\t\t$otherTable = $otherModel->getTableName();\n\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\n\t\t\tif (isset($config['onDelete']))\n\t\t\t{\n\t\t\t\t$onDelete = $config['onDelete'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (empty($config['required']))\n\t\t\t\t{\n\t\t\t\t\t$onDelete = static::SET_NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$onDelete = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblx()->db->createCommand()->addForeignKey($fkName, $table, $config[2], $otherTable, 'id', $onDelete);\n\t\t}\n\t}", "public function fieldType()\n\t{\n\t\treturn $this->belongsTo('App\\FieldType');\n\t}", "public function relationships()\n {\n return $this->fields->reject(function($field) {\n return is_null($field->type()->getRelationship());\n });\n }", "public function getWithRelations();" ]
[ "0.6361989", "0.611719", "0.5958025", "0.5846257", "0.5841553", "0.5789155", "0.57811683", "0.57795066", "0.56357276", "0.56052136", "0.5595923", "0.55646515", "0.5550924", "0.5549504", "0.55375385", "0.55168736", "0.5514967", "0.5510312", "0.5480558", "0.54536396", "0.5453159", "0.54394895", "0.54286295", "0.53494596", "0.53446877", "0.53392196", "0.5333426", "0.53200537", "0.5298613", "0.52976316", "0.52927583", "0.5280553", "0.5274525", "0.5274466", "0.5217866", "0.5215378", "0.5207682", "0.51910084", "0.51875025", "0.51872396", "0.517127", "0.51677924", "0.51677924", "0.51677924", "0.5153414", "0.51493627", "0.5149194", "0.51476777", "0.51468414", "0.51455224", "0.5128148", "0.51235735", "0.5103017", "0.5102055", "0.5095906", "0.50889784", "0.508877", "0.5085914", "0.5083476", "0.5080615", "0.5078432", "0.5078361", "0.50683403", "0.50533754", "0.5053281", "0.5053281", "0.5050577", "0.50410897", "0.5040155", "0.5032973", "0.50308937", "0.501975", "0.50110734", "0.5006469", "0.5001982", "0.49996588", "0.499455", "0.4994026", "0.4989154", "0.49862", "0.49839482", "0.4978101", "0.4975974", "0.49738005", "0.49708724", "0.4967075", "0.49602532", "0.4959003", "0.49469614", "0.49454197", "0.49379665", "0.49341816", "0.49182358", "0.4909373", "0.49040264", "0.48991787", "0.48986802", "0.4895548", "0.4895082", "0.48833528" ]
0.51517934
45
fieldname should be snakecase
private function generateBelongsTo($fieldName) { $foreignKey = Str::snake(Str::camel($fieldName)); $exploded = explode('_', $foreignKey); // get rid of last element, which is usually 'id' $relationName = implode('_', array_slice($exploded, 0, sizeof($exploded) - 1)); $modelName = Str::studly($relationName); return $this->generateRelationMethod($relationName, 'belongsTo', $modelName, $foreignKey); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getPureModelNameField()\n {\n $name = explode('Mapper_', get_class($this));\n $name = explode('_', $name[1]);\n $out = '';\n foreach($name as $k => $part)\n {\n if($k == 0)\n {\n $out .= strtolower($part);\n }\n else\n {\n $out .= ucfirst($part);\n }\n }\n return $out;\n }", "function make_fieldname_text($fieldname) {\n\t$fieldname=str_replace(\"_\", \" \",$fieldname);\n\t$fieldname=ucfirst($fieldname);\n\treturn $fieldname;\t\t\n}", "function field2name($field) {\n return str_replace(\n array('_a', '_b', '_c', '_d', '_e', '_f', '_g', '_h', '_i', '_j', '_k', '_l', '_m', '_n', '_o', '_p', '_q', '_r', '_s', '_t', '_u', '_v', '_w', '_x', '_y', '_z'), array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'), lcfirst($field)\n );\n}", "private function fieldName($fieldName){\n if(array_key_exists($fieldName, $this->customNames)){\n return $this->customNames[$fieldName];\n }\n return ucfirst($fieldName);\n }", "public static function snakeCase($str) {}", "function name2field($name) {\n return str_replace(\n array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'), array('_a', '_b', '_c', '_d', '_e', '_f', '_g', '_h', '_i', '_j', '_k', '_l', '_m', '_n', '_o', '_p', '_q', '_r', '_s', '_t', '_u', '_v', '_w', '_x', '_y', '_z'), lcfirst($name)\n );\n}", "function _fixName($field_or_value_name) {\r\n if ($field_or_value_name == \"\")\r\n return \"\";\r\n // convert space into underscore\r\n $result = preg_replace(\"/ /\", \"_\", strtolower($field_or_value_name));\r\n // strip all non alphanumeric chars\r\n $result = preg_replace(\"/\\W/\", \"\", $result);\r\n return $result;\r\n }", "function getFieldLabel($fieldName){\n\n\t\tif( isset($this->labels[$fieldName]) ) return $this->labels[$fieldName];\n\t\telse return ucwords( str_replace(\"_\", \" \", $fieldName) );\n\n\t}", "protected function getFieldNamePrefix() {}", "protected function getFieldNamePrefix() {}", "public function underscoredToLowerCamelCaseDataProvider() {}", "public function setNameAttribute ($name){\n $this->attributes['name'] = strtolower($name);\n}", "function cleanUpFieldName($str, $table) {\n\t\t$passthrough = 0;\n\t\tforeach ($GLOBALS['TCA'] as $tablename => $cols) {\n\t\t\tif ($tablename == $table) {\n\t\t\t\t$passthrough = 1;\n\t\t\t}\n\t\t}\n\t\t$fieldName = preg_replace('/[^[:alnum:]_]/', '', strtolower($str));\n\t\tif ((!$fieldName || in_array($fieldName, $this->wizard->reservedWords)\n\t\t\t\t|| in_array(\n\t\t\t\t\t$fieldName, $this->usedNames\n\t\t\t\t))\n\t\t\t&& $passthrough == 0\n\t\t) {\n\t\t\t$fieldName .= ($fieldName ? '_' : '') . t3lib_div::shortmd5(microtime());\n\t\t}\n\t\t$this->usedNames[] = $fieldName;\n\t\treturn $fieldName;\n\t}", "public function lowercase()\n {\n return $this->getNameInstance()->lowercase();\n }", "function FormatFieldName($getFieldName){\r\n\t\t\tglobal $prefArray;\r\n\t\t\tif(!empty($prefArray)){\r\n\t\t\t\tforeach($prefArray as $key=>$value) {\r\n\t\t\t\t\tif($getFieldName == $value['field']){\r\n\t\t\t\t\t\tif(!empty($value['instruction'])){\r\n\t\t\t\t\t\t\t$key = $value['instruction'];\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$key = str_replace(\"_\",\" \",$key['field']);\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn ucwords($key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//return $prefArray[$getFieldName];\r\n\t\t\t}else{\r\n\t\t\t\t$tmpFieldName = str_replace(\"_\",\" \",$getFieldName);//(converts 'job_store_name' to 'Job Store Name')\r\n\t\t\t\treturn(ucwords($tmpFieldName));\r\n\t\t\t}\r\n\t\t}", "public function snakeCase($val)\n\t{\n\t\treturn snake_case($val);\n\t}", "function properCase($propername) {\n //if (ctype_upper($propername)) {\n $propername = ucwords(strtolower($propername));\n //}\n return $propername;\n }", "function formatInput($param1)\n{\n return ucwords(strtolower($param1));\n}", "public function getFieldName() {}", "public function setNameAttribute($value){//\n $this->attributes['name'] = strtolower($value);\n }", "private function _fieldNameToCamelCase($field) {\n $field_parts = explode('_', $field);\n $out = '';\n foreach ($field_parts as $part) {\n $out .= ucfirst($part);\n }\n return $out;\n }", "public function get_field_name($field_name)\n {\n }", "public function set_to_lower_case()\n {\n if (empty($this->params['named']['field']))\n {\n echo 'You must enter a field to work with. recipe-manager/ingredients/set_to_lower_case/field:ingredient';\n exit();\n }\n\n if (strpos($this->params['named']['field'], '.'))\n {\n $fields = explode('.', $this->params['named']['field']);\n }\n else\n {\n $fields[] = $this->params['named']['field'];\n }\n\n var_dump($fields);\n\n $params = array(\n //'conditions' => array('Model.field' => $thisValue), //array of conditions\n //'recursive' => 1, //int\n //'fields' => array($this->modelClass . '.' . $field), //array of field names\n //'order' => array('Model.created', 'Model.field3 DESC'), //string or array defining order\n //'group' => array('Model.field'), //fields to GROUP BY\n //'limit' => n, //int\n //'page' => n, //int\n //'offset' => n, //int\n //'callbacks' => true //other possible values are false, 'before', 'after'\n );\n\n $result = $this->{$this->modelClass}->find('all', $params);\n\n foreach ($result as &$item)\n {\n var_dump(count($fields));\n if (count($fields) == 1)\n {\n var_dump('Single Item');\n var_dump($item[$this->modelClass][$fields[0]]);\n $item[$this->modelClass][$fields[0]] = strtolower($item[$this->modelClass][$fields[0]]);\n var_dump($item[$this->modelClass][$fields[0]]);\n }\n else if (count($fields) == 2)\n {\n var_dump('Nested Item');\n foreach ($item[$this->modelClass][$fields[0]] as &$array)\n {\n var_dump($array[$fields[1]]);\n $array[$fields[1]] = strtolower($array[$fields[1]]);\n var_dump($array[$fields[1]]);\n }\n }\n var_dump($item);\n\n if (!$this->{$this->modelClass}->save($item))\n {\n exit('Error');\n }\n }\n exit('Done');\n }", "public function get_field_name();", "function get_prefix($field)\n\t{\n\t\t$str = \"Nuev\";\n\n\t\tif( $field == \"usr_email\" || $field == \"usr_name\" || $field == \"usr_cod_postal\" )\n\t\t\t$str .= \"o\";\n\t\telse\n\t\t\t$str .= \"a\";\n\n\t\treturn $str;\n\t}", "public function message()\n {\n return \"The :attribute should be in snake_case format.\";\n }", "function ModifMiniNombreUser( $nameUser ){\r\n return strtolower($nameUser);\r\n}", "function acf_str_camel_case($string = '')\n{\n}", "public function getDbFieldName($field_name);", "private function alphabeticValidation($field) {\r\n\t \t\tif ($field->getMethod() == \"get\")\r\n\t \t\t\treturn Inspekt::isAlpha($_GET[$field->getName()]);\r\n\t \t\telse\r\n\t \t\t\treturn Inspekt::isAlpha($_POST[$field->getName()]);\r\n\t \t}", "function get_cf_name($field)\n\t{\n\t\treturn substr($field,1);\n\t}", "function snake_case($value, $delimiter = '_')\n {\n $key = $value.$delimiter;\n\n if (!ctype_lower($value)) {\n $value = preg_replace('/\\s+/u', '', $value);\n $value = mb_strtolower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value));\n }\n\n return $value;\n }", "function title_case($value)\n {\n return Str::title($value);\n }", "protected function getDefaultFieldNamePrefix() {}", "protected function getDefaultFieldNamePrefix() {}", "public function underscoredToUpperCamelCaseDataProvider() {}", "public function beforeSave() {\n\t\tif(isset(Yii::app()->params->admin)) {\n\t\t\t$admin = Yii::app()->params->admin;\n\t\t\tif(!empty($admin->contactNameFormat)) {\n\t\t\t\t$str = $admin->contactNameFormat;\n\t\t\t\t$str = str_replace('firstName',$this->firstName,$str);\n\t\t\t\t$str = str_replace('lastName',$this->lastName,$str);\n\t\t\t} else {\n\t\t\t\t$str = $this->firstName.' '.$this->lastName;\n\t\t\t}\n\t\t\tif($admin->properCaseNames)\n\t\t\t\t$str = $this->ucwords_specific($str,array('-',\"'\",'.'),'UTF-8');\n\t\t\t\n\t\t\t$this->name = $str;\n\t\t}\n\t\t\n\t\treturn parent::beforeSave();\n\t}", "function title_case($value)\n {\n return Str::title($value);\n }", "function _create_proper_name_field() {\r\n global $locale;\r\n $full_name = $locale->getLocaleFormattedName($this->first_name, $this->last_name, $this->salutation);\r\n $this->name = $full_name;\r\n $this->full_name = $full_name; \r\n\r\n\t}", "public function usesCaseSensitiveIdentifiers() {}", "public function requireMixedCase()\n {\n $this->mixedCase = true;\n }", "function snake_case($value, $delimiter = '_')\n\t{\n\t\treturn Illuminate\\Support\\Str::snake($value, $delimiter);\n\t}", "function hc_field_name($field){\n\t\techo hc_get_field_name($field);\n\t}", "function filterName($field) {\n // Limpiar el nombre del usuario\n $sanitizeField = filter_var(trim($field), FILTER_SANITIZE_STRING);\n\n // Validate user name\n if (filter_var($sanitizeField, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"/^[a-zA-Z\\s]+$/\")))) {\n return $sanitizeField;\n } else {\n return false;\n }\n}", "function camel_case($value)\n {\n return lcfirst(pascal_case($value));\n }", "public static function snakecase($str) {\n return strtolower(preg_replace('/[[:upper:]]/','_\\0',$str));\n }", "public function camelCaseToLowerCaseUnderscoredDataProvider() {}", "function import_record_vars() {\r\n while (list($key, $val) = each($this->Record))\r\n if (ereg(\"[A-Za-z][A-Za-z0-9_]*\", $key)) {\r\n $field_name = strtoupper($key); \r\n\t global $$field_name;\r\n\t $$field_name=$val;\r\n }; \r\n }", "public static function key_field($str) {\n\t\treturn 'field_' . self::key($str);\n\t}", "public function getTitleCase($value) {\n\t\t$value = str_replace('_', ' ', $value);\n\t\t$value = ucwords($value);\n\t\t$value = str_replace(' ', '', $value);\n\t\treturn $value;\n\t}", "public function automaticName($data)\n\t{\n\t\t$name = (isset($data['name']) && $data['name'] ? $data['name'] : $data['label']);\n\t\t$name = strip_tags($name);\n\t\t$name = trim($name);\n\n\t\treturn preg_replace(\"/[^a-zA-Z0-9_]/\", '', strtolower($name));\n\t}", "public static function snakeCase(string $input): string\n\t{\n\t\tif (preg_match('/[A-Z]/', $input) === 0) {\n\t\t\treturn $input;\n\t\t}\n\t\treturn strtolower(preg_replace_callback('/([a-z])([A-Z])/', fn(array $arr) => $arr[1] . '_' . strtolower($arr[2]), $input));\n\t}", "function filterName($field){\n // Sanitize user name\n $field = filter_var(trim($field), FILTER_SANITIZE_STRING);\n\n // Validate user name\n if(filter_var($field, FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z\\s]+/\")))){\n return $field;\n }else{\n return FALSE;\n }\n}", "protected function convName($name){\n if(ctype_upper(substr($name, 0, 1))){\n $name = strtolower(preg_replace('/([^A-Z])([A-Z])/', \"$1_$2\", $name));\n }\n else{\n $name = preg_replace('/(?:^|_)(.?)/e',\"strtoupper('$1')\", $name);\n }\n return $name;\n }", "function username(){\n return strtolower($this->user->username);\n }", "function getfield(){\r\n // Талбаруудын утгыг авах\r\n }", "public function testSnakeCase1()\n {\n $this->assertEquals(Str::snakeCase('étoile filante'), 'etoile_filante');\n }", "public abstract function getTitleFieldName();", "public function getFirstNameAttribute($value)\n {\n return ucfirst($value);\n }", "function from_camel_case($input)\n{\n preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches);\n $ret = $matches[0];\n foreach ($ret as &$match) {\n $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match);\n }\n return implode('_', $ret);\n}", "function nameValidator() {\n\t\tglobal $firstname;\n\t\treturn ctype_alpha($firstname);\n\t}", "function isLower(){ return $this->length()>0 && $this->toString()===$this->downcase()->toString(); }", "public function name($field) {\n\t\treturn $field;\n\t}", "public function getNameAttribute($value){\n return ucfirst($value);\n\n }", "public function getFieldSlug();", "public function snakeCase($input)\n {\n return strtolower(preg_replace('/(.)([A-Z])/', '$1-$2', $input));\n }", "function lower_case($value)\n {\n return Str::lower($value);\n }", "function from_camel_case($str) {\n return GHelper::from_camel_case($str);\n}", "public function ucase($field, $alias = '')\n {\n return $this->prepareScalarStatement($field, $alias, 'UCASE');\n }", "function p_usrnam($username)\n{\n\treturn config_item(\"username_as_lowercase\")? lc($username) : $username;\n}", "function map_field($field){\n $str= $field->to_str();\n //\n //return field to str\n return $str;\n }", "abstract protected function filterField(): string;", "function snake_case($value, $delimiter = '_')\n {\n return Str::snake($value, $delimiter);\n }", "public function snake($word);", "function form__field_id($field) {\n return 'Input' . ucfirst(strtolower(str_replace('_', ' ', str_replace('[', '', str_replace(']', '', $field)))));\n}", "private static function _casenormalize(&$val)\n {\n $val = strtolower($val);\n }", "public function requireMixedCase() {\n\t$this->_mixedCase = true; // reset the $_mixedCase property of the current instance to true\n }", "public function getNameAttribute()\n {\n return ucwords($this->firstName . ' ' . $this->lastName);\n }", "function correctCase($name)\n{\n // aAa | AAA | aaA ---> aaa\n $nameLowecase = strtolower($name);\n // aaa --> Aaa\n $uppercaseName = ucfirst($nameLowecase);\n return $uppercaseName;\n}", "protected function getNameInput()\n {\n return Str::singular(parent::getNameInput());\n }", "public function alpha($field) {\n\t\treturn (preg_match('/^[a-zA-Z]+$/', $_POST[$field['name']]));\n\t}", "public function getName(){ return $this->getField('name'); }", "public function getUcaseName() {\n return ucfirst($this->name);\n }", "function toSnakeCase($string)\n{\n $regex = ['/([a-z\\d])([A-Z])/', '/([^_])([A-Z][a-z])/'];\n\n return strtolower(preg_replace($regex, '$1_$2', $string));\n}", "function translate_field($field)\n {\n }", "function translate_field($field)\n {\n }", "function translate_field($field)\n {\n }", "function translate_field($field)\n {\n }", "function translate_field($field)\n {\n }", "function translate_field($field)\n {\n }", "function camelCaseToSnakeCase(string $input): string\n{\n return preg_replace('/[-\\.]/', '_', strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $input)));\n}", "abstract function normalizedName();", "function removeSpecial($field)\n{\n\t$in_str = str_replace(array('<', '>', '&', '{', '}', '*', '/', '(', '[', ']', '@', '!', ')', '&', '*', '#', '$', '%', '^', '|', '?', '+', '=',\n\t\t'\"', ','), array(''), $field);\n\t$cur_encoding = mb_detect_encoding($in_str);\n\tif ($cur_encoding == 'UTF-8' && mb_check_encoding($in_str, 'UTF-8'))\n\t\t$name = $in_str;\n\telse\n\t\t$name = utf8_encode($in_str);\n\tif (!Validate::isName($name))\n\t{\n\t\t$len = Tools::strlen($name);\n\t\t$return_val = '';\n\t\tfor ($i = 0; $i < $len; $i++)\n\t\t{\n\t\t\tif (ctype_alpha($name[$i]))\n\t\t\t\t$return_val .= $name[$i];\n\t\t}\n\t\t$name = $return_val;\n\t\tif (empty($name))\n\t\t{\n\t\t\t$letters = range('a', 'z');\n\t\t\tfor ($i = 0; $i < 5; $i++)\n\t\t\t\t$name .= $letters[rand(0, 26)];\n\t\t}\n\t}\n\treturn $name;\n}", "public function fixName($fieldName) {\r\n\t\t// updates the filename removing the keywords thumb and default name for the field.\r\n\t\tlist ($filename, $ext) = $this->splitFilenameAndExt($this->__model->data[$this->__model->name][$fieldName]['name']);\r\n\t\t$filename = str_replace($this->patterns, $this->replacements, $filename);\r\n\t\t$filename = Inflector::slug($filename);\r\n\t\t$i = 0;\r\n\t\t$newFilename = $filename;\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\t * do we create a random filename or not ?\r\n\t\t */\r\n\t\tif($this->__fields[$fieldName]['random_filename'] == true){\r\n\t\t\t\r\n\t\t\t$newFilename = low($this->generatePassword());\r\n\t\t\t\r\n\t\t\t$class = low($this->__model->data[$this->__model->name]['class']);\r\n\t\t\t// if this is a polymorphic upload\r\n\t\t\tif(isset($this->__model->data[$this->__model->name]['foreign_id'])){\r\n\t\t\t\t$foreign_id = $this->__model->data[$this->__model->name]['foreign_id'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(isset($foreign_id)){\r\n\t\t\t\t$newFilename = $foreign_id . '.' . $newFilename;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(isset($class)){\r\n\t\t\t\t$newFilename = $class . '.' . $newFilename;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\twhile (file_exists($this->__fields[$fieldName]['dir'] . DS . $newFilename . '.' . $ext)) {\r\n\t\t\t\t$newFilename = $filename . $i++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$this->__model->data[$this->__model->name][$fieldName]['name'] = $newFilename . '.' . $ext;\r\n\t}", "private function getFieldNameFromMethodName($methodName)\n {\n $str = substr($methodName, 3); // removing 'get'\n $str = $this->lcfirst($str);\n $str = preg_replace('/([A-Z])/', '_$1', $str);\n return strtolower($str);\n }", "function pgm_get_acf_key( $field_name ) {\n\n $field_key = $field_name;\n\n switch( $field_name ) {\n\n case 'pgm_fname':\n $field_key = 'field_57767bd66431b';\n break;\n case 'pgm_lname':\n $field_key = 'field_57767bf76431c';\n break;\n case 'pgm_email':\n $field_key = 'field_57767c396431d';\n break;\n case 'pgm_subscriptions':\n $field_key = 'field_57767c886431e';\n break;\n\n }\n\n return $field_key;\n\n}", "public function lcfirstDataProvider() {}", "function studly_case($str){\n\t\treturn Str::studly($str);\n\t}", "function displayOneCfDef($key) {\n\t\treturn ucwords(str_replace('_',' ',$key));\n\t}", "public function getNameAttribute($value){\n return ucfirst($value);\n }", "public function getFieldName() {\n return $this->fieldName;\n }" ]
[ "0.68264145", "0.68139523", "0.6792839", "0.6743889", "0.6695041", "0.66924566", "0.66435564", "0.6547463", "0.6513578", "0.6513578", "0.6512856", "0.6444521", "0.63947433", "0.63904417", "0.63616997", "0.63605905", "0.6347529", "0.63470024", "0.6342303", "0.63225317", "0.63111925", "0.6290652", "0.62904435", "0.62887657", "0.6252725", "0.62394", "0.6238336", "0.6234833", "0.62181526", "0.61962944", "0.6158776", "0.61441696", "0.6120254", "0.61180246", "0.61180246", "0.6108344", "0.61043304", "0.60953295", "0.608611", "0.6081813", "0.6080868", "0.6078409", "0.6048791", "0.6033975", "0.602965", "0.6027179", "0.6020334", "0.601038", "0.599236", "0.5990601", "0.5983508", "0.5979201", "0.5978696", "0.5973493", "0.5966794", "0.5955326", "0.59436107", "0.59411347", "0.59321123", "0.59265774", "0.59239376", "0.59233606", "0.5922523", "0.5915205", "0.5913433", "0.58854485", "0.5879987", "0.5871843", "0.5871507", "0.58703333", "0.58605057", "0.58599246", "0.5846121", "0.584236", "0.5840907", "0.5835172", "0.5829905", "0.5817628", "0.581724", "0.581614", "0.5814799", "0.581169", "0.5800057", "0.57993215", "0.5789241", "0.5789241", "0.5789241", "0.5789241", "0.5789241", "0.5789241", "0.5788522", "0.5787959", "0.57859594", "0.5782016", "0.57809424", "0.57793486", "0.57540697", "0.5750657", "0.57368106", "0.5734855", "0.5719752" ]
0.0
-1
Do something to the data, before forwarding it.
public function __construct(array $data = []) { parent::__construct($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->data = $this->data['value'];\r\r\n }\r\r\n }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "public function doProcessData() {}", "protected function forwardToReferringRequest() {}", "public function processData() {}", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n // All keys are srings in array, merge it with defaults to override\r\r\n $this->e_data = array_merge($this->default_options, $this->e_data);\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "final private function pass($data) {\n if (is_null($this->next)) {\n return $data;\n }\n return $this->next->execute($data);\n }", "abstract public function get__do_process ( $data );", "function processData() ;", "public function process($data);", "protected abstract function handleData();", "function process_data($data) {\n // Implement in children classes\n }", "protected function processReceivedData() \n {\n parent::processReceivedData();\n // to do: call processReceivedData() for all members\n }", "protected function processReceivedData() \r\n {\r\n parent::processReceivedData();\r\n // to do: call processReceivedData() for all members\r\n }", "protected function processReceivedData() {\n\n parent::processReceivedData();\n }", "public function storeIncomingData() {}", "public function handleData();", "protected function processData($data)\n {\n $this->data = array_replace_recursive($this->data, $data);\n }", "public function __invoke($data)\n {\n $this->write($data);\n }", "public function postDispatch()\n {\n parent::postDispatch();\n\n $this->getRequestData();\n }", "protected function preProcessRecordData(&$data)\n {\n }", "public function forward($forward);", "function en_send_transdata() {\n\t// Handle sending of data\n}", "protected function preprocessData() {}", "public function proxyAction()\n {\n $action = $this->getParam('call');\n $this->forward($action);\n }", "public function forward() : void {\n $this->seek(0, SEEK_END);\n }", "public function compileData(): void\n {\n $data = [];\n\n if ($this->expectsPayload) {\n $data = $this->payload->getData();\n\n if ($this->payload->expectsMessage()) {\n $this->level = $this->payload->getLevel();\n $this->message = $this->payload->getMessage();\n\n $data['flash'] = [\n $this->level => $this->message,\n ];\n }\n }\n\n $data['breadcrumbs'] = app('breadcrumbs')->render();\n\n $this->data = $data;\n\n $this->route = Route::has($this->payload->getRoute())\n ? route($this->payload->getRoute())\n : $this->payload->getRoute();\n }", "function process_data($data) {\n }", "public function perform(&$data)\n\t{\n\t\t$action = $this->action;\n\t\treturn $action($data);\n\t}", "public function preSend()\n {\n }", "public function preFlush(): void\n {\n $this->setParams(clone $this->getParams());\n }", "public function next(): void\n {\n next($this->payload);\n }", "public function hooked()\n {\n $this->setData();\n }", "public function requestDataSending()\n {\n $this->start();\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function next(): void\n {\n next($this->data);\n }", "public function forward(string $actionName, array $data = array()) {\n\t\t// update the action name that was last used\n\t\tif(method_exists($this->response, 'setActionName')) {\n\t\t\t$this->response->setActionName($actionName);\n\t\t}\n\n\t\treturn call_user_func_array(array( $this, $actionName ), $data);\n\t}", "public function forward($sourceFieldValue, $field, $source, $destination);", "function _data_handler($parser, $data)\n {\n if (!isset($this->current) || is_object($this->current)) {\n return;\n }\n $this->current.= trim($data);\n }", "public function preDispatch() {\n\t\t\n\t\t}", "abstract protected function prepareData( $data );", "public function willProcessRequest(array $data) {\n }", "public function pass(array $data) {\n foreach ($this->fields as $field) {\n $field->setValue($data[$field->getName()]);\n }\n }", "public function preDispatch()\n\t{\n\n\t\t\n\t\t\n\t}", "public function hook()\n {\n $this->setData();\n }", "protected function processData($data)\n {\n return $data;\n }", "protected function beforeGetData()\n {\n\n }", "abstract protected function process(Telemetry\\Sensor\\SensorDataPacket &$oMutableData);", "public function rewind()\n {\n $this->datasource->rewind();\n\n //Process the transformers\n if($this->valid())\n {\n $this->transformedData = $this->transform($this->datasource->current(), $this->datasource->key());\n }\n \n }", "public function printData()\n {\n pre($this->getData());\n }", "public function hook_before(&$postdata) {\n\n\t\t }", "protected function process($data) {\n return $data;\n }", "public function __invoke(array &$data, Content $content): void;", "public function __invoke($data) {\n return $this->transform($data);\n }", "public function processItem($data)\n {\n $this->unpublishExpiredContents();\n }", "public function processData() {\n\t\t$GLOBALS['TCA'] = \\BusyNoggin\\BnBackend\\BackendLibrary::removeExcludeFields($GLOBALS['TCA']);\n\t}", "protected function dispatchEventItemIsParsed($data){\n $this->byCallback($data);\n }", "protected function preProcess() {}", "public function process() {\n $call = $this->getData('p');\n\n if(method_exists($this, $call)) {\n $this->$call();\n } else {\n $this->output = array(\n 'success' => false,\n 'key' => 'eeek'\n );\n\n $this->renderOutput();\n }\n }", "abstract public function prepareData();", "public function input($_data){\n\t\t$this->data=$_data;\n\t}", "public function pre_dispatch()\n\t{\n\t\t$this->_memID = currentMemberID();\n\t\t$this->_profile = MembersList::get($this->_memID);\n\t}", "public function __before() {\n\t\t// runs after this->data is set up, but before the class methods are run\n\t}", "function dataHandler($parser, $data){\n \tif ($this->readingdata) {\n \t\t$this->currentdata.=$data; \t\t\n \t}\n }", "public function preStoreActions($data)\n {\n return $data;\n }", "function prepareData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "protected function setGetData()\n\t{\n\t\t$this->request->addParams($this->query->getParams());\n\t}", "public function consume($data);", "public function gatherData() {\r\n\t\t$this->resource->gatherData();\r\n\t}", "#[ReturnTypeWillChange]\n public function __unserialize($data)\n {\n foreach ($data as $item) {\n $this->unshift($item);\n }\n }", "public function rewind() {\n\t\treset($this->_data);\n\t}", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "abstract protected function data();", "public function processRequest($data) {\n $this->select_user($data);\n }", "public function acceptData($data);", "public function handle($data)\n {\n if ($data instanceof \\Exception) {\n $this->setData($this->handleException($data));\n } else {\n $this->setData($data);\n }\n }", "public function preDispatch();", "private function processChunk(string $data): void\n {\n if ($this->eventFactory) {\n if ($event = $this->eventFactory->createEvent($data)) {\n $this->doDispatch($event);\n }\n\n // if an event factory is present, we have fully handed control\n return;\n }\n\n if (str_starts_with($data, \"\\e\") && strlen($data) > 1) {\n $event = EscapeSequenceEvent::fromString($data);\n }\n\n if (!isset($event)) {\n $event = InputEvent::fromString($data);\n }\n\n $this->doDispatch($event);\n }", "public function dataAction() {\n parent::dataAction();\n }", "public function flushData()\n\t{\n\t\t$class = get_class($this);\n\t\tunset($this->_data[$class]);\n\t}", "public function handleDataSubmission() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "public function rewind() {\n reset($this->data);\n }", "public function rewind() {\n reset($this->data);\n }", "public function setData($_data)\n {\n $this->_data = $_data;\n }", "public function rewind(): void\n {\n reset($this->payload);\n }", "public function preDispatch()\n\t{\n\t\t$this->_actionController->initView();\n\t\t\n\t\t// We have to store the values here, because forwarding overwrites\n\t\t// the request settings.\n\t\t$request = $this->getRequest();\n\t\t$this->_lastAction = $request->getActionName();\n\t\t$this->_lastController = $request->getControllerName();\n\t}", "public abstract function preTrip();", "abstract public function map($data);", "abstract public function put__do_process ();", "public function performRewind() {\n $this->data = array();\n $this->currentPage = 0;\n $this->currentCount = 0;\n }", "protected function processInput()\n {\n if (empty($this->input)) {\n $this->input = request()->except('_token');\n\n if ($this->injectUserId) {\n $this->input['user_id'] = Auth::user()->id;\n }\n }\n $this->sanitize();\n request()->replace($this->input); // @todo IS THIS NECESSARY?\n }", "public function postDispatch() {\n\t\t\n\t\t}", "public function appendDataForPostCaching(&$data) {\n\t\t$this->appendDataForGetRecord($data);\n\t}", "abstract public function send($data);", "public function rewind()\n {\n reset($this->data);\n }", "public function rewind()\n {\n reset($this->data);\n }", "public function rewind()\n {\n reset($this->data);\n }" ]
[ "0.6821797", "0.6562945", "0.6450783", "0.6404638", "0.63373476", "0.61273426", "0.60424536", "0.5970502", "0.5907564", "0.586869", "0.5820183", "0.5769508", "0.57421523", "0.5741242", "0.57369155", "0.5696279", "0.56885237", "0.5685177", "0.5676247", "0.56319785", "0.5613733", "0.56034577", "0.55855644", "0.55181646", "0.5504912", "0.5457957", "0.54306096", "0.54257417", "0.5413575", "0.54063547", "0.540569", "0.53471416", "0.53321064", "0.53112006", "0.5305979", "0.5305554", "0.5282705", "0.52796173", "0.5267768", "0.52547807", "0.5253415", "0.5244144", "0.5237862", "0.5220304", "0.52166784", "0.5213602", "0.52058184", "0.52053297", "0.5201247", "0.5190685", "0.5175849", "0.5167253", "0.51581466", "0.513516", "0.51241314", "0.5122477", "0.5111745", "0.5110674", "0.5105786", "0.5104449", "0.510368", "0.5103239", "0.508029", "0.50705457", "0.5054173", "0.5047381", "0.503999", "0.50319993", "0.5031328", "0.5024718", "0.502415", "0.50220096", "0.50090057", "0.5003673", "0.50030816", "0.5002452", "0.49937996", "0.49904466", "0.49733877", "0.49731952", "0.4969028", "0.49626675", "0.49626675", "0.49626675", "0.49626675", "0.49592298", "0.49592298", "0.49546164", "0.49543893", "0.49525326", "0.49306577", "0.49306327", "0.49263784", "0.4925278", "0.49249122", "0.49233755", "0.49170998", "0.491666", "0.49145707", "0.49145707", "0.49145707" ]
0.0
-1
Add verifiers, setters, getters, ... Implement traits as Mixins? If so, we'd maybe have...
using \IngwiePhoenix\UniterMPC\Models\Displayable; public function __toDOM() { return (<div> <p>We present to you:</p> <span class="title">{$this->title}</div> </div>); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mdl_create_mixin(array $definition, bool $set, bool $get)\n{\n // TODO : Validate and throw if required\n $set = isset($definition['setter']) ? boolval($definition['setter']) : $set;\n $get = isset($definition['getter']) ? boolval($definition['getter']) : $get;\n $setters = [];\n $getters = [];\n $properties = mdl_array_wrap($definition['properties'] ?? []);\n $methods = mdl_array_wrap($definition['methods'] ?? []);\n $immutable = boolval($definition['immutable'] ?? false);\n\n $mixin = PHPTrait(\n preg_replace(\"/\\s+/\", \"\", $definition['name']),\n array_map(function ($item) {\n return mdl_create_method($item);\n }, $methods),\n array_map(function ($item) use (&$getters, &$setters, $set, $get, $immutable) {\n $property = mdl_create_property($item);\n // # Create setters if required\n if ($set && (false === boolval($item['readonly'] ?? false))) {\n $setters[] = mdl_create_property_setter($property, $item['type'] ?? null, $immutable);\n }\n // # Create getters if required\n if ($get) {\n $getters[] = mdl_create_property_getter($property, $item['type'] ?? null);\n }\n return $property;\n }, $properties)\n );\n foreach (array_merge($setters, $getters) as $value) {\n /**\n * @var TraitableStruct\n */\n $mixin = $mixin->addMethod($value);\n }\n if (isset($definition['mixins'])) {\n foreach (mdl_array_wrap($definition['mixins']) as $value) {\n $mixin = $mixin->addTrait($value);\n }\n }\n return $mixin;\n}", "abstract protected function setRequiredGetters();", "abstract protected function getDirectGetters();", "public function initializeTraits( ) : void {\n foreach ( static::$traitInitializers[ static::class ] as $method ) $this -> { $method } ( ) ;\n }", "protected function setUpTraits()\n {\n $uses = parent::setUpTraits();\n\n if (isset($uses[InteractsWithPermissions::class])) {\n $this->setupInteractsWithPermissionsTrait();\n }\n\n return $uses;\n }", "abstract public function getTraits();", "public function traits(){\n $this->clapHands();\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->__resTraitConstruct();\n\t}", "public function test6(){\n echo \"test2 method in trait<br>\";\n }", "public function test2(){\n echo \"test2 method in trait<br>\";\n }", "public function addTrait(PhpTrait $trait);", "protected function initializeTraits()\n {\n foreach (static::$traitInitializers[static::class] as $method) {\n $this->{$method}();\n }\n }", "public function give($implementation);", "public function setExtendables()\n {\n $this->extend('foo', function() {\n return [$this->getUserAgent(), $this->getRemoteAddr()];\n });\n }", "protected function setUpTraits()\n {\n parent::setUpTraits();\n\n $uses = array_flip(class_uses_recursive(get_class($this)));\n\n if (isset($uses[ForeignKeys::class])) {\n /** @var \\Tests\\Traits\\ForeignKeys $this */\n $this->enableForeignKeys();\n }\n\n if (isset($uses[DatabaseSeeding::class])) {\n /** @var \\Tests\\Traits\\DatabaseSeeding $this */\n $this->seedDatabase();\n }\n }", "protected function parseBehaviorTraits(){\n\t\t$traits = (new \\ReflectionClass($this))->getTraits();\n\t\tif (!empty($traits)){\n\t\t\t$getName = function(\\ReflectionMethod $image){ return $image->name; };\n\t\t\tforeach($traits as $reflection){\n\t\t\t\t$methods = $reflection->getMethods(\\ReflectionMethod::IS_PUBLIC);\n\t\t\t\t$this->behaviorMethods += array_map($getName, $methods);\n\t\t\t}\n\t\t}\n\t}", "function addProperty($name, $value) {\r\n\r\n\t\t$propertyName = 'set'.ucfirst($name);\r\n\t\t\r\n\t\t// XML boolean needs to be converted\r\n\t\tif( strtolower($value) == 'true') {\r\n\t\t\t$value = True;\r\n\t\t} elseif(strtolower($value) == 'false') {\r\n\t\t\t$value = False;\r\n\t\t}\r\n\r\n\r\n\t\t// Set methods on the PlugIn driver class ($this->className, $this->key)\r\n\t\t// Eg: <plug-in ... key=\"SMARTY_PLUGIN\" .../> maps to $this->setKey(\"SMARTY_PLUGIN\")\r\n\t\tif( method_exists( $this, $propertyName) ) {\r\n\t\t\t$this->$propertyName($value);\r\n\t\t} else {\r\n\t\t\t// Set properties in the PlugIn class.\r\n\t\t\t// Check for a set-property element, and try to set the class variable directly\r\n\t\t\t// Eg: <set-property property=\"force_compile\" value=\"true\"/>\r\n\t\t\t$plugInVars = get_class_vars( get_class($this->plugIn) );\t\t\r\n\r\n\t\t\tif( array_key_exists($name, $plugInVars) ) {\r\n\t\t\t\t$p =& $this->plugIn;\r\n\t\t\t\t$p->$name = $value;\r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t\t$driverName = ucfirst(get_class($this));\t\t\t\t\r\n\t\t\t\tprint 'Error: '.$driverName.'->addProperty(): Method: '.\r\n\t\t\t\t\t\t$propertyName.\" not found<br>\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "protected function add() {\n\t}", "public function setTraits(array $traits);", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "protected function setMacros()\n {\n Meta::mixin(new ValidationMeta);\n BaseModel::mixin(new ValidationModel);\n BaseField::mixin(new ValidationField);\n }", "public function setModifiersFromTags(): void\n {\n $hasFinalTag = count($this->getTags('final')) > 0;\n $hasProtectedTag = count($this->getTags('protected')) > 0;\n $hasPrivateTag = count($this->getTags('private')) > 0;\n $hasPublicTag = count($this->getTags('public')) > 0;\n $hasStaticTag = count($this->getTags('static')) > 0;\n $accessTags = $this->getTags('access');\n $hasAccessTag = count($accessTags) > 0;\n $flags = $this->modifiers ?? 0;\n\n if ($hasAccessTag) {\n $accessTag = strtolower(trim(implode('', $accessTags[0])));\n if ($accessTag === 'protected') {\n $hasProtectedTag = true;\n } elseif ($accessTag === 'private') {\n $hasPrivateTag = true;\n } elseif ($accessTag === 'public') {\n $hasPublicTag = true;\n }\n }\n\n if ($hasFinalTag) {\n $flags |= self::MODIFIER_FINAL;\n }\n if ($hasProtectedTag) {\n $flags |= self::MODIFIER_PROTECTED;\n }\n if ($hasPrivateTag) {\n $flags |= self::MODIFIER_PRIVATE;\n }\n if ($hasPublicTag) {\n $flags |= self::MODIFIER_PUBLIC;\n }\n if ($hasStaticTag) {\n $flags |= self::MODIFIER_STATIC;\n }\n\n $this->setModifiers($flags);\n }", "public function testModelUseTrait()\n {\n $use = array_key_exists(\n VirtualAttribute::class,\n class_uses_recursive(Post::class)\n );\n\n $notUse = array_key_exists(\n VirtualAttribute::class,\n class_uses_recursive(User::class)\n );\n\n // has\n $this->assertTrue($use);\n\n // not has\n $this->assertNotTrue($notUse);\n }", "public function testifUseTraits()\n {\n $traits = [\n SoftDeletes::class, \n Uuid::class\n ];\n $categoryTraits = array_keys(class_uses(Category::class)); \n $this->assertEquals($traits, $categoryTraits);\n }", "public function methods();", "public function getTraits(): Collection\n {\n return $this->traits;\n }", "abstract protected function setMethod();", "abstract public function decorate();", "public function add()\n {\n }", "public function add()\n {\n }", "public function add()\n {\n }", "public function give( $implementation );", "abstract protected function mixins(ClassReflection $classReflection, string $methodName): array;", "public function setTraits(Collection $traits): void\n {\n $this->traits = $traits;\n }", "public function add()\n\t{\n\n\t}", "public function add()\n\t{\n\n\t}", "public function getTraits(): Set;", "public function __construct()\n {\n $this->extendableConstruct();\n }", "public static function mix(object $mixin, bool $replace = true): void\n {\n $methods = (new ReflectionClass($mixin))->getMethods(\n ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED\n );\n\n foreach ($methods as $method) {\n if ($replace || !static::hasMacro($method->name)) {\n $method->setAccessible(true);\n static::register($method->name, $method->invoke($mixin));\n }\n }\n }", "public function usesTraits()\n\t{\n\t\tif ( count($this->getTraits()) > 0 )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "abstract protected function attributes();", "protected function setUpTraits()\n {\n $uses = parent::setUpTraits();\n\n if (isset($uses[RefreshOctoberDatabase::class])) {\n $this->refreshDatabase();\n }\n\n return $uses;\n }", "protected function decoratorAdded() {}", "function mdl_create_class(array $definition, bool $set, bool $get)\n{\n // TODO: Add validation and throw if required\n $set = isset($definition['setter']) ? boolval($definition['setter']) : $set;\n $get = isset($definition['getter']) ? boolval($definition['getter']) : $get;\n $setters = [];\n $getters = [];\n $properties = mdl_array_wrap($definition['properties'] ?? []);\n $methods = mdl_array_wrap($definition['methods'] ?? []);\n $immutable = boolval($definition['immutable'] ?? false);\n /**\n * @var BluePrint\n */\n $blueprint = new PHPClass(\n preg_replace(\"/\\s+/\", \"\", $definition['name']),\n mdl_array_wrap($definition['implements'] ?? []),\n array_map(function ($item) {\n return mdl_create_method($item);\n }, $methods),\n array_map(function ($item) use (&$getters, &$setters, $set, $get, $immutable) {\n $property = mdl_create_property($item);\n // # Create setters if required\n if ($set && (false === boolval($item['readonly'] ?? false))) {\n $setters[] = mdl_create_property_setter($property, $item['type'] ?? null, $immutable);\n }\n // # Create getters if required\n if ($get) {\n $getters[] = mdl_create_property_getter($property, $item['type'] ?? null);\n }\n return $property;\n }, $properties)\n );\n\n foreach (array_merge($setters, $getters) as $value) {\n /**\n * @var BluePrint\n */\n $blueprint = $blueprint->addMethod($value);\n }\n if (isset($definition['mixins'])) {\n foreach (mdl_array_wrap($definition['mixins']) as $value) {\n # code...\n /**\n * @var BluePrint\n */\n $blueprint = $blueprint->addTrait($value);\n }\n }\n\n if (isset($definition['extends'])) {\n $blueprint = $blueprint->setBaseClass($definition['extends']);\n }\n\n if (isset($definition['abstract']) && (boolval($definition['abstract']) === true)) {\n $blueprint = $blueprint->asAbstract();\n }\n\n if (isset($definition['final'])) {\n $blueprint = $blueprint->asFinal();\n }\n\n // TODO : Add constructor\n if (isset($definition['constructor']) && (boolval($definition['constructor']) === true) && !mdl_has_constructor_method($methods)) {\n $blueprint = $blueprint->addMethod(mdl_create_class_constructor(mdl_array_unique(array_merge($properties, $definition['mixin_properties'] ?? []), 'name')));\n }\n return $blueprint;\n}", "protected function registerMutators() {\n\n\t\t$this->registerSetter('data', function($dataStore) {\n\n\t\t\t$this->__store = $dataStore;\n\n\t\t});\n\n\t\t$this->registerGetter('data', function() {\n\n\t\t\treturn $this->__store;\n\n\t\t});\n\n\t\t$this->registerGetter('size', function() {\n\n\t\t\treturn count($this->__store);\n\n\t\t});\n\n\t\t$this->registerGetter('keys', function() {\n\n\t\t\treturn array_keys($this->__store);\n\n\t\t});\n\n\t\t$this->registerGetter('values', function() {\n\n\t\t\treturn array_values($this->__store);\n\n\t\t});\n\n\t\t$this->registerGetter('firstKey', function() {\n\n\t\t\t$storeKeys = $this->keys;\n\n\t\t\treturn $storeKeys[0];\n\n\t\t});\n\n\t\t$this->registerGetter('lastKey', function() {\n\n\t\t\t$storeKeys = $this->keys;\n\n\t\t\treturn $storeKeys[count($storeKeys) - 1];\n\n\t\t});\n\n\t\t$this->registerGetter('first', function() {\n\n\t\t\treturn $this->data[$this->firstKey];\n\n\t\t});\n\n\t\t$this->registerGetter('last', function() {\n\n\t\t\treturn $this->data[$this->lastKey];\n\n\t\t});\n\n\t\t$this->registerGetter('serialized', function() {\n\n\t\t\treturn $this->serialize();\n\n\t\t});\n\n\t\t$this->registerGetter('parameterized', function() {\n\n\t\t\treturn $this->parameterize();\n\n\t\t});\n\n\t}", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public function testHasMethodMappedMethods() {\n\t\tnew Sample ();\n\t\t$Collection = new BehaviorCollection ();\n\t\t$Collection->init ( 'Sample', array (\n\t\t\t\t'Test',\n\t\t\t\t'Test2' \n\t\t) );\n\t\t\n\t\t$this->assertTrue ( $Collection->hasMethod ( 'look for the remote in the couch' ) );\n\t\t$this->assertTrue ( $Collection->hasMethod ( 'mappingRobotOnTheRoof' ) );\n\t}", "public static function _register()\n {\n self::assignElements([\n 'ItemRevised' => ['type' => 'bool'],\n 'BuyItNowAdded' => ['type' => 'bool'],\n 'BuyItNowLowered' => ['type' => 'bool'],\n 'ReserveLowered' => ['type' => 'bool'],\n 'ReserveRemoved' => ['type' => 'bool']\n ], parent::NAME);\n\n self::assignAttributes([]);\n }", "protected function setUpTraits()\n {\n return $this->setUpTheTestEnvironmentTraits(array());\n }", "public function testSupports(): void\n {\n $builder = $this->getBuilder();\n\n self::assertFalse($builder->supports('PurpleElephant'));\n self::assertTrue($builder->supports(PublicProperties::class));\n }", "function runkit_method_add($classname, $methodname, $args, $code, $flags = RUNKIT_ACC_PUBLIC)\n{\n}", "public function add();", "public function add();", "public function __construct($daten = array())\n{\n if ($daten) {\n foreach ($daten as $k => $v) {\n $setterName = 'set' . ucfirst($k);\n // wenn ein ungültiges Attribut übergeben wurde\n // (ohne Setter), ignoriere es\n if (method_exists($this, $setterName)) {\n $this->$setterName($v);\n }\n }\n }\n}", "function addClassMethod($accessModifier, $methodType, $dataType, $name) {\n\t\t// Konstruktor\n\t\tif ($this->name == $dataType) {\n\t\t\t$name = $dataType;\n\t\t\t$dataType = \"\";\n\t\t}\n\n\t\t// Destruktor\n\t\tif ((\"~\".$this->name) == $dataType) {\n\t\t\t$name = $dataType;\n\t\t\t$dataType = \"\";\n\t\t}\n\n\t\tarray_push($this->methodArray, array(\"modifier\" => $accessModifier, \"methodType\" => $methodType, \"type\" => $dataType, \"name\" => $name, \"virtualPure\" => false, \"priority\" => true, \"parentClass\" => $this->name, \"conflicts\" => false, \"show\" => true));\n\t}", "public function testGetAndSetMethods()\n {\n $attribs = ['class' => 'gravatar', 'title' => 'avatar', 'id' => 'gravatar-1'];\n $this->_object->setDefaultImg('monsterid')\n ->setImgSize(150)\n ->setSecure(true)\n ->setEmail(\"example@example.com\")\n ->setAttribs($attribs)\n ->setRating('pg');\n $this->assertEquals(\"monsterid\", $this->_object->getDefaultImg());\n $this->assertEquals(\"pg\", $this->_object->getRating());\n $this->assertEquals(\"example@example.com\", $this->_object->getEmail());\n $this->assertEquals($attribs, $this->_object->getAttribs());\n $this->assertEquals(150, $this->_object->getImgSize());\n $this->assertTrue($this->_object->getSecure());\n }", "public static function setters();", "protected function setUpTraits()\n {\n $uses = array_flip(class_uses_recursive(static::class));\n\n return $this->setUpTheTestEnvironmentTraits($uses);\n }", "public function decorate();", "public function getClassTraits($class_name);", "function addTrait($trait)\n {\n if (is_string($trait)) {\n $this->traits[] = $this->normalizeTrait($trait);\n } else if (is_array($trait)) {\n foreach ($trait as $item) {\n if(!is_string($item)){\n $this->throwTraitException();\n }\n $this->addTrait($item);\n }\n } else {\n $this->throwTraitException();\n }\n return $this;\n }", "public function properties() { }", "public function addMetaboxes() {}", "public function extra();", "abstract public function getExtends();", "public function withTraits(array $traits): self\n {\n return $this->with('traits', $traits);\n }", "function properties()\n {\n }", "public function register()\n {\n return [T_TRAIT];\n }", "public function add_caps_to_roles(): void {\n\t\t$all_capabilities_raw = $this->get_all_capabilities();\n\t\t$all_capabilities = array_values( $all_capabilities_raw );\n\n\t\t$administrator = get_role( 'administrator' );\n\t\t$editor = get_role( 'editor' );\n\t\t$author = get_role( 'author' );\n\t\t$contributor = get_role( 'contributor' );\n\n\t\tif ( $administrator instanceof WP_Role ) {\n\t\t\tforeach ( $all_capabilities as $cap ) {\n\t\t\t\t$administrator->add_cap( $cap );\n\t\t\t}\n\t\t}\n\n\t\tif ( $editor instanceof WP_Role ) {\n\t\t\tforeach ( $all_capabilities as $cap ) {\n\t\t\t\t$editor->add_cap( $cap );\n\t\t\t}\n\t\t}\n\n\t\tif ( $author instanceof WP_Role ) {\n\t\t\t$author->add_cap( $all_capabilities_raw['edit_posts'] );\n\t\t\t$author->add_cap( $all_capabilities_raw['edit_published_posts'] );\n\t\t\t$author->add_cap( $all_capabilities_raw['delete_posts'] );\n\t\t\t$author->add_cap( $all_capabilities_raw['delete_published_posts'] );\n\t\t\t$author->add_cap( $all_capabilities_raw['publish_posts'] );\n\t\t\t$author->add_cap( $all_capabilities_raw['assign_terms'] );\n\t\t}\n\n\t\tif ( $contributor instanceof WP_Role ) {\n\t\t\t$contributor->add_cap( $all_capabilities_raw['edit_posts'] );\n\t\t\t$contributor->add_cap( $all_capabilities_raw['delete_posts'] );\n\t\t\t$contributor->add_cap( $all_capabilities_raw['assign_terms'] );\n\t\t}\n\n\t\t/**\n\t\t * Fires when adding the custom capabilities to existing roles.\n\t\t *\n\t\t * Can be used to add the capabilities to other, custom roles.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $all_capabilities List of all post type capabilities, for reference.\n\t\t */\n\t\tdo_action( 'web_stories_add_capabilities', $all_capabilities );\n\t}", "abstract protected function interface();", "public function __construct()\n {\n parent::__construct();\n\n $this->setChildren(Collection::fromInterfaceString(NamespaceInterface::class));\n $this->setFunctions(Collection::fromInterfaceString(FunctionInterface::class));\n $this->setConstants(Collection::fromInterfaceString(ConstantInterface::class));\n $this->setClasses(Collection::fromInterfaceString(ClassInterface::class));\n $this->setInterfaces(Collection::fromInterfaceString(InterfaceInterface::class));\n $this->setTraits(Collection::fromInterfaceString(TraitInterface::class));\n $this->setTags(new Collection());\n $this->setEnums(Collection::fromInterfaceString(EnumInterface::class));\n }", "function chouXiang()\n {\n echo '必须继承重写的抽象类的抽象方法'.'</br>';\n }", "protected function _ensureInheritedAttributes() {}", "public function withMethod($method)\n {\n }", "public function withMethod($method)\n {\n }", "static public function add()\n {\n add_role(\n self::ROLE_KEY, \n self::ROLE_NAME, \n [\n 'read' => true,\n 'edit_posts' => true, \n 'upload_files' => false,\n 'edit_others_posts' => true, //a tester a false\n\n 'edit_exercices' => true,\n 'publish_exercices' => false,\n 'read_exercice' => true,\n 'delete_exercice' => true,\n //'delete_exercices' => true,\n 'edit_others_exercices' => false,\n 'delete_others_exercices' => false,\n 'edit_exercice' => true,\n\n 'edit_lessons' => true,\n 'publish_lessons' => true,\n 'read_lesson' => true,\n 'delete_lesson' => true,\n 'edit_others_lessons' => false,\n 'delete_others_lessons' => false,\n 'edit_lesson' => true,\n\n 'manage_arts' => false,\n 'edit_arts' => false,\n 'delete_arts' => false,\n 'assign_arts' => true, \n ]\n\n );\n }", "function __registerMethods()\n\t{\n\t\t$this->server->wsdl->addComplexType('intArray',\n\t\t\t\t\t\t\t\t\t\t\t'complexType',\n\t\t\t\t\t\t\t\t\t\t\t'array',\n\t\t\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t\t\t'SOAP-ENC:Array',\n\t\t\t\t\t\t\t\t\t\t\tarray(),\n\t\t\t\t\t\t\t\t\t\t\tarray(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:int[]')),\n\t\t\t\t\t\t\t\t\t\t\t'xsd:int');\n\n\n\t\t$this->server->wsdl->addComplexType('stringArray',\n\t\t\t\t\t\t\t\t\t\t\t'complexType',\n\t\t\t\t\t\t\t\t\t\t\t'array',\n\t\t\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t\t\t'SOAP-ENC:Array',\n\t\t\t\t\t\t\t\t\t\t\tarray(),\n\t\t\t\t\t\t\t\t\t\t\tarray(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:string[]')),\n\t\t\t\t\t\t\t\t\t\t\t'xsd:string');\n\n\t\t// isValidSession()\n\t\t$this->server->register('isValidSession',\n\t\t\t\t\t\t\t\tarray('ext_uid' => 'xsd:string',\n\t\t\t\t\t\t\t\t\t 'soap_pw' => 'xsd:string',\n\t\t\t\t\t\t\t\t\t 'new_user' => 'xsd:boolean'),\n\t\t\t\t\t\t\t\tarray('valid' => 'xsd:boolean',\n\t\t\t\t\t\t\t\t\t'firstname' => 'xsd:string',\n\t\t\t\t\t\t\t\t\t'lastname' => 'xsd:string',\n\t\t\t\t\t\t\t\t\t'email' => 'xsd:string'),\n\t\t\t\t\t\t\t\tSERVICE_NAMESPACE,\n\t\t\t\t\t\t\t\tSERVICE_NAMESPACE.'#isValidSession',\n\t\t\t\t\t\t\t\tSERVICE_STYLE,\n\t\t\t\t\t\t\t\tSERVICE_USE,\n\t\t\t\t\t\t\t\t'Dummy Session Validation');\n\n\t\treturn true;\n\t}" ]
[ "0.6208702", "0.6193468", "0.5816709", "0.57795763", "0.5770411", "0.5684611", "0.56045514", "0.5469539", "0.5443488", "0.54144335", "0.53618044", "0.53317755", "0.5268784", "0.5236666", "0.5220153", "0.5206269", "0.5168246", "0.514561", "0.5141908", "0.51351196", "0.51351196", "0.51351196", "0.51351196", "0.51351196", "0.51351196", "0.51351196", "0.51351196", "0.51351196", "0.51351196", "0.51351196", "0.51351196", "0.51351196", "0.51210713", "0.5091824", "0.5057364", "0.5028188", "0.50108266", "0.5007503", "0.49946737", "0.4975372", "0.49693233", "0.49693233", "0.49693233", "0.4967287", "0.49670875", "0.49400553", "0.49292514", "0.49292514", "0.49116868", "0.48945418", "0.48757324", "0.4870243", "0.48676497", "0.48633373", "0.48474082", "0.48384896", "0.47891122", "0.4775817", "0.4775817", "0.4775817", "0.4775817", "0.4775817", "0.4775817", "0.4775817", "0.4775817", "0.4775817", "0.4775817", "0.4775817", "0.4775817", "0.4775817", "0.47558644", "0.47457984", "0.47398272", "0.47397158", "0.47387412", "0.47368842", "0.47368842", "0.47338724", "0.47272372", "0.47224927", "0.47154218", "0.47098556", "0.47093415", "0.47038934", "0.47034657", "0.46979076", "0.4696319", "0.46746713", "0.46553224", "0.4649641", "0.46489763", "0.46487236", "0.46423385", "0.4641496", "0.4627097", "0.461923", "0.46178713", "0.46110454", "0.46110454", "0.46099886", "0.45916635" ]
0.0
-1
Do some internal storing and preparing here.
public function __construct($data) { $this->data = $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function prepareToStore();", "abstract protected function _prepare();", "function _prepare() {}", "abstract public function prepareData();", "protected function prepare()\n\t{\n\t}", "abstract protected function prepareContextItem();", "protected function preprocessData() {}", "public function prepare() {\n if (!isset($this->Created))\n $this->Created = date('YmdHis', time());\n\n if (isset($this->ConfirmPassword))\n unset($this->ConfirmPassword);\n\n $this->Password = Auth::getHash($this->Password);\n// $this->ProfileImage = $this->_processProfileImage();\n }", "protected function prepareData()\n {\n parent::prepareData();\n $this->prepareConfigurableProductOptions();\n $this->prepareAttributeSet();\n }", "function prepareForDb() {\n $this->description = sql_escape($this->description);\n $this->postsHeader = sql_escape($this->postsHeader);\n $this->postBody = sql_escape($this->postBody);\n $this->postsFooter = sql_escape($this->postsFooter);\n $this->formLogged = sql_escape($this->formLogged);\n $this->form = sql_escape($this->form);\n $this->navigation = sql_escape($this->navigation);\n $this->name = sql_escape($this->name);\n $this->nameLin = sql_escape($this->nameLin);\n $this->memberName = sql_escape($this->memberName);\n $this->date = sql_escape($this->date);\n $this->time = sql_escape($this->time); \n $this->nextPage = sql_escape($this->nextPage);\n $this->previousPage =sql_escape($this->previousPage);\n $this->firstPage = sql_escape($this->firstPage);\n $this->lastPage = sql_escape($this->lastPage);\n\t$this->gravDefault = sql_escape($this->gravDefault);\n }", "public function prepare() {}", "public function prepare() {}", "public function prepare();", "public function prepare();", "protected function prepareMyData(){\n\t\tglobal $C;\n if( $this->id > 0 ){\n $this->get( \"`id`={$this->id}\" );\n $this->unstoreSfield();\n }\n\t\t$C->setID( $this->data['parent'] );\n\t\t$C->get( \"`id`={$this->data['parent']}\" );\n\t\t$C->unstoreSfield();\n $p = $C->getData();\n if( is_array( $p ) ){\n\t\t\tT::assign( \"parent\", $p[\"name\"] );\n\t\t\t$fieldlist=array();\n if( is_array( $p[\"fields\"] ) )\n foreach( $p[\"fields\"] as $key => $item ){\n $fieldlist[] = array( \"cnt\" => $key, \"name\" => $item, \"value\"=> $this->data[$this->sfield][$key] );\n }\n\t\t\tT::assign( \"fieldlist\", $fieldlist );\n }\n\t\tT::assign( \"f\", $this->sfield );\n\t\tT::assign( \"item\",$this->data );\t\t\n\t}", "function prepareData(){\n $this->ref = array();\n foreach($this->getIterator() as $junk=>$item){\n // current values\n $id = $item[$this->id_field];\n \n // save item\n $this->items[$id] = $item;\n \n // save relation\n if(isset($item[$this->parent_id_field])) {\n $this->ref[$item[$this->parent_id_field]][] = $id;\n } else {\n $this->ref[undefined][] = $id;\n }\n }\n }", "public function prepare() {\n // Initialize instance variables\n $this->postData = $this->bot->getPostData();\n\n $this->findAndReplacesForImageUrls = $this->bot->getSetting(SettingKey::POST_FIND_REPLACE_IMAGE_URLS);\n $this->postSaveImagesAsMedia = $this->bot->getSettingForCheckbox(SettingKey::POST_SAVE_IMAGES_AS_MEDIA);\n $this->postSaveAllImagesInContent = $this->bot->getSettingForCheckbox(SettingKey::POST_SAVE_ALL_IMAGES_IN_CONTENT);\n $this->postSaveImagesAsGallery = $this->postSaveImagesAsMedia && $this->bot->getSettingForCheckbox(SettingKey::POST_SAVE_IMAGES_AS_GALLERY);\n\n // If the user wants to save all images in the post content, set \"save images as media\" to true so that the\n // script can run properly.\n if($this->postSaveAllImagesInContent) {\n $this->postSaveImagesAsMedia = true;\n }\n\n // Save the thumbnail URL first, because the thumbnail may be removed by gallery image selectors later.\n $this->prepareAndSaveThumbnail();\n\n // Prepare the attachment data.\n $this->prepareAttachmentData();\n }", "protected function prepareCache()\n {\n $oldUmask = umask(0);\n mkdir($this->cacheDirectory, 0777);\n mkdir($this->getObjectsDirectory(), 0777);\n\n $this->cacheInfo = array(\"objects\" => array());\n file_put_contents($this->cacheDirectory . self::CACHE_INFO_FILENAME, json_encode(array(\"cache\" => $this->cacheInfo)));\n @chmod($this->cacheDirectory . self::CACHE_INFO_FILENAME, 0666);\n umask($oldUmask);\n }", "protected function _prepareRecords()\n {\n // Remove default records.\n $this->_deleteAllRecords();\n\n $metadata = array('public' => true);\n $isHtml = false;\n\n $collections = array();\n $items = array();\n $files = array();\n foreach ($this->_recordsByType as $type => $recordsMetadata) {\n foreach ($recordsMetadata as $recordMetadata) {\n $identifiers = array();\n foreach ($recordMetadata['Identifier'] as $identifier) {\n $identifiers[] = array('text' => $identifier, 'html' => $isHtml);\n }\n $elementTexts = array('Dublin Core' => array(\n 'Title' => array(array('text' => $recordMetadata['Title'], 'html' => $isHtml)),\n 'Identifier' => $identifiers,\n ));\n switch ($type) {\n case 'Collection':\n $collections[$recordMetadata['collection_id']] = insert_collection($metadata, $elementTexts);\n break;\n case 'Item':\n $metadataItem = $metadata;\n if (!empty($recordMetadata['collection_id'])) {\n $metadataItem['collection_id'] = $collections[$recordMetadata['collection_id']]->id;\n }\n $record = insert_item($metadataItem, $elementTexts);\n if (!empty($recordMetadata['files'])) {\n $fileUrl = TEST_DIR . '/_files/test.txt';\n $files[$recordMetadata['item_id']] = insert_files_for_item($record, 'Filesystem', array_fill(0, $recordMetadata['files'], $fileUrl));\n }\n break;\n case 'File':\n $record = $files[$recordMetadata['item_id']][$recordMetadata['file_key']];\n $record->addElementTextsByArray($elementTexts);\n $record->save();\n break;\n }\n }\n }\n }", "function apply() {\n\t\t$this->store();\n\t}", "private function prepare(){\r\n \r\n $autoload = &$this->settings->autoload; \r\n \r\n if(isset($autoload)){\r\n \r\n foreach($autoload AS $key => $class){\r\n \r\n $settings = &$this->settings->{$key};\r\n \r\n if(isset($settings)){\r\n\r\n $this->{$key} = new $class($settings);\r\n }\r\n }\r\n }\r\n }", "abstract protected function cacheData();", "function prepareForBuildPage() \n\t{\n\t\t// save recs\n\t\t//$this->save();\n\t\t// PRG rule, to avoid POSTDATA resend\n\t\t$this->rulePRG();\t\n\t\t//Sorting fields\n\t\t$this->buildOrderParams();\n\t\t// fill data\n\t\t$this->fillMembers();\n\t\t$this->fillGroups();\n\t\t// build sql query\n\t\t$this->buildSQL();\n\t\t// build pagination block\n\t\t$this->buildPagination();\n\t\t// seek page must be executed after build pagination\n\t\tif ($this->sortByGroup===false)\n\t\t\t$this->seekPageInRecSet($this->querySQL);\t\t\t\t\t\n\t\telse\n\t\t\t$this->recSet = db_query($this->querySQL, $this->conn);\n\t\t// fill grid data\n\t\t$this->fillGridData();\n\t\t// build search panel\n\t\t$this->buildSearchPanel(\"adv_search_panel\");\n\t\t// add common js code\n\t\t$this->addCommonJs();\n\t\t// add common html code\n\t\t$this->addCommonHtml();\n\t\t// Set common assign\n\t\t$this->commonAssign();\n\t\t// build admin block\t\t\n\t\t$this->assignAdmin();\t\n\t}", "protected function prepare()\n {\n $this->slug = $this->getSubmittedSlug();\n\n if ($this->isNew()) {\n $this->prepForNewEntry();\n } else {\n $this->prepForExistingEntry();\n }\n\n // As part of the prep, we'll apply the date and slug. We'll remove them\n // from the fields array since we don't want it to be in the YAML.\n unset($this->fields['date'], $this->fields['slug']);\n\n $this->fieldset = $this->content->fieldset()->withTaxonomies();\n }", "abstract public function prepare(Snapshot $snapshot);", "protected function prepareGalleryData() {}", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "function construct() {\n if (!$this->cacheGet()) {\n $this->prepare();\n $this->build();\n $this->expand();\n $this->populate();\n }\n }", "function prepareForStorage(&$data) {\n\t\t$recordId = $data->{$this->model->getTableKey()};\n\t\t$data->{$this->propertyName} = $this->getCurrentFilename($recordId);\n\t\treturn parent::prepareForStorage($data);\n\t}", "protected function store()\n\t{\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t\t//---------------------\n\t\t// Your code goes here\n\t\t// --------------------\n\t}", "abstract protected function prepareData( $data );", "protected function preProcess() {}", "public function prepare() {\n $this->customTaxonomies = [];\n\n // Get custom taxonomy with selectors\n $this->prepareCustomTaxonomyWithSelectors();\n\n // Get manually added custom post taxonomy\n $this->prepareManuallyAddedCustomTaxonomy();\n\n // If there is no custom taxonomy, stop.\n if(empty($this->customTaxonomies)) return;\n\n // Store it\n $this->bot->getPostData()->setCustomTaxonomies($this->customTaxonomies);\n }", "abstract public function prepare(): self;", "abstract protected function prepareModels();", "private function initData()\n {\n $data = $this->cache->load($this->cacheId);\n if (false === $data) {\n /** @var Reader $reader */\n $reader = $this->readerFactory->create(\n ['fileName' => sprintf(self::SEARCH_PATTERN, $this->componentName)]\n );\n $data = $reader->read();\n $this->cache->save($this->serializer->serialize($data), $this->cacheId);\n } else {\n $data = $this->serializer->unserialize($data);\n }\n\n if (!empty($data)) {\n $this->data[$this->componentName] = [Converter::DATA_ATTRIBUTES_KEY => ['name' => $this->componentName]];\n $this->merge([$this->componentName => $data]);\n $this->data = $this->evaluateComponentArguments($this->data);\n }\n }", "public function prepareData()\r\n\t{\r\n\r\n\t\t// Get title and encode it\r\n\t\tif (empty($this->title)) {\r\n\t\t\t$this->title = urlencode(urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, 'UTF-8')));\r\n\t\t}\r\n\r\n\t\t// Get current post permalink and encode it\r\n\t\tif (empty($this->shared_url)) {\r\n\t\t\t$this->shared_url = get_permalink(get_the_ID());\r\n\t\t}\r\n\r\n\t\t// Get excerpt and format it for Twitter\r\n\t\tif (empty($this->tweet)) {\r\n\t\t\t$tweet = (strlen(get_the_excerpt()) > 140) ? substr(get_the_excerpt(), 0, 140) . '...' : get_the_excerpt();\r\n\t\t\t$this->tweet = $tweet . ' ' . $this->shared_url;\r\n\t\t}\r\n\t}", "protected function _afterPrepareDocumentData()\n {\n }", "public function prepare(){\n\t\treturn array(\n\t\t\t'creationData' => $this->creationData->prepare(),\n\t\t\t'modificationHistory' => $this->modificationHistory->prepare() );\t\t\n\t}", "public function prepareVars()\n {\n $this->vars['history'] = $this->model->revision_history;\n $this->vars['chapter_id'] = $this->model->id;\n }", "protected function setupDBData()\n {\n /**\n * IMPORTANT NOTE : these functions must be executed sequentially in order for the command to work.\n */\n $this->setupProducts();\n $this->setupServerTypes();\n $this->setupServers();\n $this->setupUsers();\n }", "public function prepare()\n {\n }", "abstract function prepare_data(&$data_arr);", "protected function initDatabaseRecord() {}", "function prepareData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "protected function prepare_item_for_database($request)\n {\n }", "protected function prepare_item_for_database($request)\n {\n }", "protected function saveToCache() {}", "function _prepare(){\t\r\r\n\t\t// init array\r\r\n\t\t$this->options = array();\t\r\r\n\t\t// to be saved vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->options[$var] = $this->{$var};\r\r\n\t\t}\t\r\r\n\t}", "public function _prepare() {\n if( !DBwrite::connected() ) {\n DBwrite::connect();\n }\n\n $query = $this->query;\n foreach( $this->key_value_map as $key => $value ) {\n $query = str_replace(\n '#'.$key, \n $this->sanitizeValue( $key, $value ),\n $query\n );\n }\n \n $this->real_query = $query;\n return $this->real_query;\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }", "public function store()\n\t {\n\t //\n\t }", "protected function initStorageObjects() {}", "protected function initStorageObjects() {}", "protected function initStorageObjects() {}", "public function prepare():void\n {\n\n // Get IP address\n if ($this->reg_ip == '') { \n $this->reg_ip = IpAddress::get();\n }\n\n // Get user-agent\n if ($this->reg_user_agent == '') { \n $this->reg_user_agent = UserAgent::get();\n }\n\n // Lookup ip address\n if ($this->reg_country == '' && $this->reg_ip != '') { \n $res = LookupIP::query($this->reg_ip);\n foreach ($res as $key => $value) {\n $key = 'reg_' . $key; \n $this->$key = $value;\n }\n }\n\n }", "abstract protected function prepareContext(): void;", "protected function prepareDetailsTables()\n\t{\n\t}", "public function generateInternalCache()\n\t{\n\t\t// Purge\n\t\t$this->purgeInternalCache();\n\n\t\t// Rebuild\n\t\t$this->generateConfigCache();\n\t\t$this->generateDcaCache();\n\t\t$this->generateLanguageCache();\n\t\t$this->generateDcaExtracts();\n\t}", "private function prepareData(){\n\t\t\t$this->text = trim($this->text);\n\t\t\t$this->user_id = intval($this->user_id);\n\t\t\t$this->parent_id = intval($this->parent_id);\n\t\t}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "protected function prepare() \n {\n $this->array = new ArrayNode;\n }", "function Prepare()\r\n\t{\r\n\t\tif (!$this->Active) return;\r\n\r\n\t\t$act = Server::GetState($this->Name.'_action');\r\n\r\n\t\tif ($this->sorting == ED_SORT_TABLE)\r\n\t\t\t$this->sort = array(Server::GetVar('sort', $this->ds->id) =>\r\n\t\t\t\tServer::GetVar('order', 'ASC'));\r\n\r\n\t\t$this->state = $act == 'edit' ? STATE_EDIT : STATE_CREATE;\r\n\r\n\t\tif ($act == 'Cancel') $this->Reset();\r\n\r\n\t\tif ($act == 'Create')\r\n\t\t{\r\n\t\t\t$insert = array();\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = isset($child_id) ? $this->ds->children[$child_id] : $this;\r\n\r\n\t\t\t$fields = $context->ds->FieldInputs;\r\n\t\t\tforeach ($fields as $col => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in))\r\n\t\t\t\t{\r\n\t\t\t\t\t$value = Server::GetVar($this->Name.'_'.$col);\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'date')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$insert[$col] = date('Y-m-d', strtotime($value));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if($in->attr('TYPE') == 'datetime')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($value[5][0] == 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//time is in PM\r\n\t\t\t\t\t\t\tif($value[3][0] != 12) $value[3][0] += 12;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$time_portion = \" {$value[3][0]}:{$value[4][0]}:00\";\r\n\t\t\t\t\t\t$insert[$col] = $value[2].'-'.$value[0].'-'.$value[1].$time_portion;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'password' && strlen($value) > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$insert[$col] = md5($value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (empty($value['tmp_name'])) continue;\r\n\t\t\t\t\t\t$ext = strrchr($value['name'], '.');\r\n\r\n\t\t\t\t\t\t# We move files later because we do not have enough\r\n\t\t\t\t\t\t# data to decide where to put them or what to name them.\r\n\r\n\t\t\t\t\t\t$files[] = array(\r\n\t\t\t\t\t\t\t'src' => $value['tmp_name'],\r\n\t\t\t\t\t\t\t'dst' => $in->attr('VALUE')\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t//$insert[$col] = $ext;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'selects') $insert[$col] = $value;\r\n\t\t\t\t\telse $insert[$col] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telse if (is_numeric($col)) continue;\r\n\t\t\t\telse $insert[$col] = Database::SqlUnquote($in);\r\n\t\t\t\t//I just changed this to 'else' (check the history), because a\r\n\t\t\t\t//numeric value with a string column would not go in eg. 5\r\n\t\t\t\t//instead of '5', if this ends up conflicting, we'll need to\r\n\t\t\t\t//come up with a different solution.\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t{\r\n\t\t\t\tif (!$handler->Create($this, $insert)) { $this->Reset(); return; }\r\n\t\t\t}\r\n\r\n\t\t\t$parent = Server::GetVar('parent');\r\n\r\n\t\t\tif (isset($parent))\r\n\t\t\t{\r\n\t\t\t\t$child = $this->ds->children[Server::GetVar('child')];\r\n\t\t\t\t$insert[$child->child_key] = $parent;\r\n\t\t\t}\r\n\r\n\t\t\t$id = $context->ds->Add($insert);\r\n\t\t\t$insert[$context->ds->id] = $id;\r\n\r\n\t\t\t# Handle all uploads\r\n\r\n\t\t\tif (!empty($files))\r\n\t\t\t{\r\n\t\t\t\t$vp = new VarParser();\r\n\t\t\t\tforeach ($files as $file)\r\n\t\t\t\t{\r\n\t\t\t\t\t# Handler associated\r\n\t\t\t\t\tif (is_object($file['dst']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$file['dst']->Create($file['src'], $insert);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse # Move uploaded file\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$dst = $vp->ParseVars($file['dst'], $insert);\r\n\t\t\t\t\t\tmove_uploaded_file($file['src'], $dst);\r\n\t\t\t\t\t\tchmod($dst, 0777);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t$handler->Created($this, $id, $insert);\r\n\r\n\t\t\t$this->Reset();\r\n\t\t}\r\n\r\n\t\telse if ($act == 'Update')\r\n\t\t{\r\n\t\t\t$ci = Server::GetVar('ci');\r\n\r\n\t\t\tif ($this->type == CONTROL_SIMPLE)\r\n\t\t\t{\r\n\t\t\t\tforeach (array_keys($this->ds->FieldInputs) as $name)\r\n\t\t\t\t{\r\n\t\t\t\t\t$vals[$name] = Server::GetVar($name);\r\n\t\t\t\t}\r\n\t\t\t\t$fp = fopen($ci, 'w+');\r\n\t\t\t\tfwrite($fp, serialize($vals));\r\n\t\t\t\tfclose($fp);\r\n\t\t\t}\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = $child_id != null ? $this->ds->children[$child_id] : $this;\r\n\t\t\t$update = array();\r\n\t\t\tforeach ($context->ds->FieldInputs as $col => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (get_class($in) == 'FieldInput' && $in->type == 'label') continue;\r\n\r\n\t\t\t\t\t$value = Server::GetVar($this->Name.'_'.$col);\r\n\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'date')\r\n\t\t\t\t\t\t$update[$col] = date('Y-m-d', strtotime($value));\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'datetime')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($value[5][0] == 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//time is in PM\r\n\t\t\t\t\t\t\tif ($value[3][0] != 12) $value[3][0] += 12;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$time_portion = \" {$value[3][0]}:{$value[4][0]}:00\";\r\n\t\t\t\t\t\t$update[$col] = $value[2].'-'.$value[0].'-'.$value[1].$time_portion;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'label')\r\n\t\t\t\t\t\tunset($update[$col]);\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'password')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!empty($value)) $update[$col] = md5($value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'checkbox')\r\n\t\t\t\t\t\t$update[$col] = ($value == 1) ? 1 : 0;\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'selects')\r\n\t\t\t\t\t\t$update[$col] = $value;\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!empty($value['tmp_name']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$vp = new VarParser();\r\n\t\t\t\t\t\t\t$src = $value['tmp_name'];\r\n\t\t\t\t\t\t\t$vars = $update;\r\n\t\t\t\t\t\t\t$vars[$this->ds->id] = $ci;\r\n\t\t\t\t\t\t\t$val = $in->attr('VALUE');\r\n\r\n\t\t\t\t\t\t\t# File Handler\r\n\t\t\t\t\t\t\tif (is_object($val)) $val->Update($src, $vars);\r\n\t\t\t\t\t\t\telse # String Based\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$dst = $vp->ParseVars($val, $vars);\r\n\t\t\t\t\t\t\t\tmove_uploaded_file($src, $dst);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tunset($update[$col]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse $update[$col] = $value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (count($this->handlers) > 0)\r\n\t\t\t{\r\n\t\t\t\t$q['match'][$this->ds->id] = $ci;\r\n\t\t\t\t$data = $this->ds->GetOne($q);\r\n\t\t\t\t$update[$this->ds->id] = $ci;\r\n\t\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t{\r\n\t\t\t\t\t$res = $handler->Update($this, $ci, $data, $update);\r\n\t\t\t\t\t// Returns false, simple failure.\r\n\t\t\t\t\tif (!$res) { $this->Reset(); return; }\r\n\t\t\t\t\t// Returns an array of errors.\r\n\t\t\t\t\tif (is_array($res))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->state = STATE_EDIT;\r\n\t\t\t\t\t\t$this->Errors = $res;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($this->type == CONTROL_BOUND)\r\n\t\t\t\t$context->ds->Update(array($context->ds->id => $ci), $update);\r\n\r\n\t\t\t$this->Reset();\r\n\t\t}\r\n\r\n\t\telse if ($act == 'delete')\r\n\t\t{\r\n\t\t\t$ci = Server::GetState($this->Name.'_ci');\r\n\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = isset($child_id) ? $this->ds->children[$child_id] : $this;\r\n\r\n\t\t\t$data = $context->ds->GetOne(array($context->ds->id => $ci));\r\n\r\n\t\t\tif (count($this->handlers) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!$handler->Delete($this, $ci, $data)) return;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!empty($context->ds->FieldInputs))\r\n\t\t\tforeach ($context->ds->FieldInputs as $name => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in) && strtolower(get_class($in)) == 'forminput')\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$vp = new VarParser();\r\n\t\t\t\t\t\t$val = $in->attr('VALUE');\r\n\t\t\t\t\t\t# File handler\r\n\t\t\t\t\t\tif (is_object($val))\r\n\t\t\t\t\t\t\t$val->Delete($data);\r\n\t\t\t\t\t\telse # Regular string file\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$files = glob($vp->ParseVars($val, $data).\".*\");\r\n\t\t\t\t\t\t\tforeach ($files as $file) unlink($file);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$context->ds->Remove(array($context->ds->id => $ci));\r\n\t\t}\r\n\r\n\t\tif ($this->type == CONTROL_SIMPLE)\r\n\t\t{\r\n\t\t\t$ci = Server::GetState($this->Name.'_ci');\r\n\r\n\t\t\tif (file_exists($ci))\r\n\t\t\t\t$this->values = unserialize(file_get_contents($ci));\r\n\t\t\telse\r\n\t\t\t\t$this->values = array();\r\n\t\t}\r\n\t}", "protected function preparePrep()\n {\n $this->prepList = [];\n $this->invalidList = [];\n $this->rewind();\n if (array_key_exists('SellerSKUList.Id.1', $this->options)) {\n $this->options['Action'] = 'GetPrepInstructionsForSKU';\n $this->resetASINs();\n } elseif (array_key_exists('ASINList.Id.1', $this->options)) {\n $this->options['Action'] = 'GetPrepInstructionsForASIN';\n $this->resetSKUs();\n }\n }", "protected function prepare_fields()\n {\n }", "function prepare()\r\n\t{\r\n\t\treturn parent::prepare();\r\n\t}", "private function prepareOptimize()\n\t{\n\t\t$cacheKey = 'NEXT_OPTIMIZE_ON_SOLR';\n\n\t\t/** @var Carbon $nextOptimizeOnSolr */\n\t\t$nextOptimizeOnSolr = $this->cache->get($cacheKey, Carbon::now());\n\n\t\t// if cached value is too old, make it now\n\t\tif ($nextOptimizeOnSolr->isPast()) {\n\t\t\t$nextOptimizeOnSolr = Carbon::now();\n\t\t}\n\n\t\t// adding 2 minutes for next possible optimize\n\t\t$nextOptimizeOnSolr->addMinutes(2);\n\n\t\t// store until next optimize is possible\n\t\t$this->cache->put($cacheKey, $nextOptimizeOnSolr, $nextOptimizeOnSolr);\n\n\t\t$job = (new Optimize($cacheKey))\n\t\t\t->delay($nextOptimizeOnSolr);\n\n\t\tdispatch($job);\n\t}", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "public function prepare_item_for_database($request)\n {\n }", "public function prepare_item_for_database($request)\n {\n }", "public function prepareParsing()\n {\n $this->saverHelper->createFirstSheet();\n }", "protected function collectInformation() {}", "function prepareForCopy() {\n\t\t$this->id = null;\n\t}", "protected function prepareAssignCatActionData()\n {\n foreach ($this->_data as $key => $value) {\n switch ($key) {\n case 'urlPath':\n $this->_urlPath = $value;\n break;\n case 'paramName':\n $this->_paramName = $value;\n break;\n default:\n $this->_additionalData[$key] = $value;\n break;\n }\n }\n }", "public function prepareVars()\n {\n $this->vars['defaultCurrency'] = $this->defaultCurrency;\n $this->vars['defaultValue'] = $this->getPriceValue($this->defaultCurrency->id);\n $this->vars['currencies'] = Currency::orderBy('sort_order', 'ASC')->get();\n $this->vars['field'] = $this->formField;\n }", "private function setup_cache() {\n // Set up non-persistent object caching groups\n wp_cache_add_non_persistent_groups( [ '_np_pedestal' ] );\n }", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "private function prepareExternalProduct() {\n if ($this->getSaverData()->isFirstPage()) {\n $this->setPrice();\n $this->setSKU();\n $this->setEnableReviews();\n $this->setMenuOrder();\n $this->setExternalProductDetails();\n }\n\n $this->setTags();\n $this->setAttributes();\n }", "protected function initStorageObjects() {\n\t\t\n\t}", "protected function initStorageObjects() {\n\t\t\n\t}", "public function prepare()\n {\n $this->getInstruction()->execute();\n }", "protected function storeMappingTablePrepare(): void\n {\n // Create a temporary table with the mapper.\n $this->operationSqls[] = <<<'SQL'\n# Create a temporary table to map values.\nDROP TABLE IF EXISTS `_temporary_mapper`;\nCREATE TABLE `_temporary_mapper` LIKE `value`;\nALTER TABLE `_temporary_mapper`\n DROP `resource_id`,\n ADD `source` longtext COLLATE utf8mb4_unicode_ci\n;\nSQL;\n }", "protected function _preload() {\n }", "protected function populateState()\n\t{\n\t}", "protected function populateState()\n\t{\n\t}", "protected static function buildSpriteDataAndCreateCacheEntry() {}", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n // All keys are srings in array, merge it with defaults to override\r\r\n $this->e_data = array_merge($this->default_options, $this->e_data);\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "protected function prepareStatements()\n {\n if (!empty($this->statements)) {\n return;\n }\n $this->statements['load'] = $this->db->prepare(\n 'SELECT * FROM `' . $this->options['table'] . '` WHERE `userId` = :userId '\n . 'AND `scope` = :scope AND `name` = :name AND `args` = :args'\n );\n\n $this->statements['save'] = $this->db->prepare(\n 'INSERT INTO `' . $this->options['table'] . '` (`userId`, `scope`, `name`, `args`, `xml`) VALUES '\n . '(:userId, :scope, :name, :args, :xml)'\n );\n\n $this->statements['delete'] = $this->db->prepare(\n 'DELETE FROM`' . $this->options['table'] . '` WHERE `userId` = :userId '\n . 'AND `scope` = :scope AND `name` = :name AND `args` = :args'\n );\n }", "function _refresh_stored_values()\r\n\t{\r\n\t\t// Update stored values\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\t$this->stored->{$field} = $this->{$field};\r\n\t\t}\r\n\r\n\t\t// Check if there is a \"matches\" validation rule\r\n\t\tforeach ($this->validation as $validation)\r\n\t\t{\r\n\t\t\t// If there is, match the field value with the other field value\r\n\t\t\tif (array_key_exists('matches', $validation['rules']))\r\n\t\t\t{\r\n\t\t\t\t$this->{$validation['field']} = $this->stored->{$validation['field']} = $this->{$validation['rules']['matches']};\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n\n $path = explode('\\\\', get_class($this->model));\n\n $this->vars['task_id'] = array_pop($path) . '-' . $this->model->{$this->taskKey};\n $this->vars['task_name'] = $this->model->{$this->taskName};\n\n $this->vars['app_name'] = HarvestSettings::get('app_name', 'Harvest');\n $this->vars['app_url'] = Request::url();\n }", "function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"engine\",\n\t\t\t\"text\",\n\t\t);\n\t}", "protected function _precreate() {\n }", "protected function _beforePrepareDocumentData()\n {\n $this->_documentData = array();\n $this->_documentTextSearch = array();\n $this->_documentCategoryNames = array();\n $this->_documentAutocompleteSearch = array();\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "protected function _beforeSave()\n {\n $this->_prepareData();\n return parent::_beforeSave();\n }" ]
[ "0.797006", "0.68865186", "0.6698406", "0.6631291", "0.64127314", "0.6139953", "0.6077745", "0.6068535", "0.6019223", "0.6000846", "0.5999058", "0.5998174", "0.5990794", "0.5990794", "0.5972535", "0.5971756", "0.59688", "0.5896521", "0.5873503", "0.5792668", "0.57522994", "0.57470006", "0.57373846", "0.5720737", "0.57111824", "0.56811035", "0.5671353", "0.5670658", "0.5670558", "0.5670558", "0.5670558", "0.56703484", "0.56656796", "0.5652358", "0.56514025", "0.5592667", "0.5577101", "0.557555", "0.5562859", "0.5554885", "0.5554379", "0.555214", "0.55477047", "0.55302364", "0.5528933", "0.552782", "0.5526084", "0.5514838", "0.55137134", "0.5500364", "0.5500364", "0.5498885", "0.54948443", "0.54928595", "0.54873997", "0.54841775", "0.5475788", "0.5475788", "0.54742706", "0.5474219", "0.54576594", "0.5455834", "0.5445241", "0.5443883", "0.54432714", "0.54409564", "0.54368323", "0.5434781", "0.54340947", "0.54181474", "0.54175603", "0.5409034", "0.54083866", "0.54083866", "0.5407781", "0.53793985", "0.5378342", "0.5372264", "0.5368343", "0.53647816", "0.5362061", "0.5362061", "0.5362061", "0.53581977", "0.53554887", "0.53554887", "0.53523916", "0.5350562", "0.5346016", "0.53421813", "0.53421813", "0.5335925", "0.5326993", "0.53222007", "0.53210855", "0.5319447", "0.53187734", "0.5316068", "0.5303467", "0.53023523", "0.5290315" ]
0.0
-1
Use $this>data and create a DOM.
public function __toDOM() { // Basically, use a JSX-ish syntax to do so and just // return the DOM fragment that had been built. // A DOM interpreter will turn that into an actual HTML // output. Something that could be used here is caching, where // a presenter could mark itself as being cacheable OR it // could dynamicaly allocate cached states of itself and just skip // processing itself entirely. It may only do so for fragments within too. return (<div class="articles"> // ... </div>); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __generate($data) {\n extract($this->__settings);\n $html = '';\n\n $id = '';\n if ($depth == 0) {\n $id = ' id=\"' . $div . '\"';\n }\n\n $whitespace = str_repeat(\"\\t\", $depth);\n\n $html .= \"<ul\" . $id . \">\\n\";\n foreach ($data as $item) {\n $html .= \"<li>\";\n if ($link) {\n\n if ($ajaxtarget == null) {\n $html .= $this->Html->link(\n $item[$model][$title], array(\n 'controller' => $controller,\n 'action' => $action,\n $item[$model]['id']\n ));\n } else {\n $html .= $this->Js->link(\n $item[$model][$title], array(\n 'controller' => $controller,\n 'action' => $action,\n $item[$model]['id']\n ), array(\n 'update' => '#' . $ajaxtarget,\n 'before' => $this->Js->get('#' . $ajaxtarget)->effect('fadeOut'),\n 'complete' => $this->Js->get('#' . $ajaxtarget)->effect('fadeIn'),\n )\n );\n }\n } else {\n $html .= $item[$model][$title];\n }\n if (count($item['children']) > 0) {\n $this->__settings['depth'] = $depth + 1;\n $html .= $this->__generate($item['children'], $this->__settings);\n }\n $html .= \"</li>\\n\";\n }\n $html .= \"</ul>\\n\";\n $html = str_replace(\"\\n\", \"\\n\" . $whitespace, $html);\n return $html;\n }", "public function build()\n {\n\n if ($this->html)\n return $this->html;\n\n if (count($this->data) == 0) {\n $this->html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n $this->html .= '</ul>'.NL;\n\n return $this->html;\n }\n\n $html = '';\n\n $html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n\n\n foreach ($this->data as $id => $row) {\n\n $entry = $this->buildTreeNode($row);\n\n $html .= <<<HTML\n<li id=\"{$this->id}_{$id}\" >\n\n {$entry}\n <ul id=\"{$this->id}_{$id}_tree\" ></ul>\n\n</li>\n\nHTML;\n\n\n }\n\n $html .= '</ul>'.NL;\n\n\n $this->html = $html;\n\n return $this->html;\n\n }", "public function generateHtmlDivData()\n\t{\n\t\t// TODO : to be implemented\n\t}", "public function build( $data );", "public function create()\r\n {\r\n // Load only root elements.\r\n $this->loadRoots($this->elements, $this->roots);\r\n\r\n // Make sure that first element isn't child. If child then throw a exception about that.\r\n if ($this->elements[0]->isChild())\r\n TypeRegression::cantBe('child', 'First');\r\n\r\n // Set elements compiled field with relations\r\n $this->makeRelationsToCompiled($this->elements);\r\n \r\n // After append process by root-child then compile all stuffs into 'page' field.\r\n foreach ($this->roots as $key => $element) {\r\n \r\n $this->page .= $element->compiled;\r\n }\r\n }", "public function build(){\n\n\t\t// Node Attributes;\n\t\t$this->getAttrString();\n\t\t\n\t\tif(is_array($this->content)){\n\t\t\t$this->html.= '<'. $this->tag .' '. $this->attrString .'>' ;\n\t\t\tforeach ($this->content as $key => $value) \n\t\t\t\t$this->html.= $value->build() ;\n\n\t\t\t$this->html .= '</'. $this->tag .'>';\n\t\t}else{\n\t\t\t// Node Content\n\t\t\t$nodeContent = $this->content instanceof HTMLNode ? $this->content->build() : $this->content ; \n\n\t\t\t// Node HTML\n\t\t\t$this->html = '<'. $this->tag .' '. $this->attrString .'>'. $nodeContent .'</'. $this->tag .'>' ;\n\t\t}\n\n\t\treturn $this->html ;\n\t}", "public function output_html($data, $query='') {\n return '<div id=\"'. $this->get_id() .'\"/>'.$this->description.'</div>';\n }", "private function viewBuilder() {\n $html = '';\n $file = false;\n // Create fields\n foreach ($this->formDatas as $field) {\n $type = $field['type'];\n switch ($type) {\n case 'text' :\n case 'password' :\n case 'hidden' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n // Addon - 2013-07-31\n case 'date' :\n case 'datetime' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"text\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n\n\n if ($type == 'datetime') {\n $plugin = $this->addPlugin('widget', false);\n $plugin = $this->addPlugin('date');\n }\n $plugin = $this->addPlugin($type);\n if (!isset($this->js['script'])) {\n $this->js['script'] = '';\n }\n if ($type == 'datetime') {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datetimepicker({ dateFormat: \"yy-mm-dd\", timeFormat : \"HH:mm\"});});</script>';\n } else {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datepicker({ dateFormat: \"yy-mm-dd\"});});</script>';\n }\n break;\n // End Addon\n case 'select' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <select name=\"' . $field['name'] . '\">';\n // Add options\n foreach ($field['options'] as $option) {\n $html .= '\n <option value=\"' . $option . '\" <?php echo set_select(\"' . $field['name'] . '\", \"' . $option . '\"); ?>>' . $option . '</option>';\n }\n $html .= '\n </select>';\n break;\n case 'checkbox' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['checkbox'] as $option) {\n $html .= '\n <input type=\"checkbox\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'radio' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['radio'] as $option) {\n $html .= '\n <input type=\"radio\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'reset' :\n case 'submit' :\n $html .= '\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n case 'textarea' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <textarea name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\"><?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?></textarea>';\n break;\n case 'file' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"file\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" />';\n $file = true;\n break;\n }\n }\n\n $view = '\n <html>\n <head>\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo base_url() ?>assets/css/generator/' . $this->cssName . '.css\">\n '; // Addon - 2013-07-31\n foreach ($this->css as $css) {\n $view .= $css . '\n ';\n }\n foreach ($this->js as $js) {\n $view .= $js . '\n ';\n }\n // End Addon\n $view .= '\n </head>\n <body>\n <?php\n // Show errors\n if(isset($error)) {\n switch($error) {\n case \"validation\" :\n echo validation_errors();\n break;\n case \"save\" :\n echo \"<p class=\\'error\\'>Save error !</p>\";\n break;\n }\n }\n if(isset($errorfile)) {\n foreach($errorfile as $name => $value) {\n echo \"<p class=\\'error\\'>File \\\"\".$name.\"\\\" upload error : \".$value.\"</p>\";\n }\n }\n ?>\n <form action=\"<?php echo base_url() ?>' . $this->formName . '\" method=\"post\" ' . ($file == true ? 'enctype=\"multipart/form-data\"' : '') . '>\n ' . $html . '\n </form>\n </body>\n </html>';\n return array(str_replace('<', '&lt;', $view), $view);\n }", "public function asHTML(): string\n {\n $initialData = '';\n\n if (is_array($this->data) && count($this->data) > 0) {\n $initialData = json_encode($this->data);\n }\n\n if (is_string($this->data) && !empty($this->data)) {\n $initialData = $this->data;\n }\n\n $div = $this->dom->createElement('div');\n\n $div->setAttribute('data-template', $this->name);\n\n // set initial data for client side\n if (!empty($initialData)) {\n $div->setAttribute('data-initial-data', urlencode($initialData));\n }\n\n // rest of method expects the `template` node to be first and only child\n // of the document (`$this->dom`)\n\n $firstChild = $this->dom->firstChild;\n\n /**\n * copy `template` attributes\n * @var \\DOMNode $attribute\n */\n foreach ($firstChild->attributes as $attribute) {\n if ($attribute->localName === 'id') {\n continue;\n }\n $div->setAttribute($attribute->nodeName, $attribute->nodeValue);\n }\n\n // copy `template` children\n while ($firstChild->hasChildNodes()) {\n $div->appendChild($firstChild->firstChild);\n }\n\n // replace `template` with `div`\n $this->dom->replaceChild($div, $firstChild);\n\n return $this->dom->saveHTML();\n }", "public function create(array $data)\n {\n $cleaned = $this->clean($data);\n\n $content = HtmlContent::create($cleaned);\n\n return $content;\n }", "public function createHTML () {\r\n\t\t\r\n\t\t//Declare STD Object $res\r\n\t\t$res = $this->blogstate->blogStatement();\r\n\r\n\t\t$blogPost = \"\";\r\n\r\n\t\t//Adding news items contained in $res variable.\r\n\t\tforeach($res AS $key => $val) {\r\n\t\t\t$catLink = \"\";\r\n\t\t\t$categoryAnchors = explode(\",\",($val->category));\r\n\t\t\t\r\n\t\t\tforeach($categoryAnchors as $catVal) {\r\n\t\t\t\t$catLink .= \"<a href='\". $this->db->getQueryString(array('genre' => $catVal)) .\"'>$catVal</a> &nbsp;\";\r\n\t\t\t}\r\n\r\n\t\t\t//Calling the function handleString to handle the $val-data variable with the chosen filters.\r\n \t\t\t$blogPost .= \"\r\n \t\t\t\t<div class='one-blog-post'>\r\n \t\t\t\t\t<h2><a href='newsitem.php?slug=\". $val->slug .\"'>{$val->title}</a></h2>\r\n \t\t\t\t\t<p>{$this->handleString($val->DATA, $val->slug, $val->FILTER)}</p>\r\n\r\n \t\t\t\t\t<div class='container-fluid'>\r\n \t\t\t\t\t\t<p class='pull-right'>Kategori: \". $catLink .\" &nbsp; Publicerad: {$val->published}</p>\r\n \t\t\t\t\t</div>\r\n \t\t\t\t</div>\";\r\n\t\t}\r\n\r\n\t\t//Adding HTML markup to $out.\r\n\t\t$out = \"\r\n\t\t\t\t<div class='container-fluid text-center show-all-movies'>\r\n\t\t\t\t\tNyheter\r\n\t\t\t\t</div>\r\n\t\t\t\t\r\n\t\t\t\t<div class='blog-posts'> \t\r\n\t\t\t\t\t{$blogPost}\r\n\t\t\t\t</div>\r\n\t\t\";\r\n\t\treturn $out;\r\n\t}", "function writeHTML()\n\t{\n\t\tglobal $_activeTree;\n\t\t\n\t\t$c = count($this->children);\n\n\t\tif ($this->link)\n\t\t{\n\t\t\t$title = \"<a href='{$this->link}' target='{$this->target}'>{$this->title}</a>{$this->extras}\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = \"<a href='#' onclick='\";\n\t\t\t\n\t\t\tif ($_activeTree->onSelect)\n\t\t\t{\n\t\t\t\t$title .= \"{$_activeTree->onSelect}(\\\"{$this->value}\\\");\";\n\t\t\t}\n\t\t\t\n\t\t\t$title .= \"; return false'>{$this->title}</a>{$this->extras}\";\n\t\t}\n\t\t\n\t\tif ($c == 0 && !$this->onDemand)\n\t\t{\n\t\t\t// Leaf node\n\t\t\techo \"<div class='{$this->leafStyle}'>\";\n\n\t\t\tif (isset($this->value) && $this->value !== \"\" && $_activeTree->selectMode != 'navigation')\n\t\t\t{\n?>\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" name=\"<? echo $this->id?>\" value=\"<? echo $this->value?>\"<? \n\t\t\t\tif ($this->checked) echo \" checked\";\n\t\t\t\tif ($this->disabled) echo \" disabled\";\n\t\t\t\tif ($_activeTree->selectMode == \"single\") \n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"Tree.clearCheckBoxes('{$_activeTree->id}', this);\";\n\t\t\t\t\tif ($_activeTree->onSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \" {$_activeTree->onSelect}('{$this->value}');\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\\\"\";\n\t\t\t\t}\n\t\t\t\telse if ($_activeTree->onSelect)\n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"{$_activeTree->onSelect}('{$this->value}');\\\"\";\n\t\t\t\t}\n\t\t\t\t ?>/>\n<?\n\t\t\t}\n\t\t\n\t\t\techo \"$title</div>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->open)\n\t\t\t{\n\t\t\t\t$style = $this->openStyle;\n\t\t\t\t$display = \"block\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$style = $this->closedStyle;\n\t\t\t\t$display = \"none\";\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tif ($this->onDemand)\n\t\t\t{\n\t\t\t\t$cmd = \"Tree.loadOnDemand('{$this->id}', '{$this->onDemand}');\";\n\t\t\t\t\n\t\t\t\tif ($this->open)\n\t\t\t\t{\n?>\n<script type=\"text/javascript\">\n\twindow.addEvent('domready', function() {Tree.loadOnDemand('<?echo $this->id?>', '<?echo $this->onDemand?>');});\n</script>\n<?\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$cmd = \"\";\n\t\t\t}\n\t\t\t\n\t\t\t$cmd .= \"Tree.toggleFolder('{$this->id}', '{$this->openStyle}', '{$this->closedStyle}');\";\n?>\n\t\t<div id='<?echo $this->id?>' class='<?echo $style?>' onclick=\"<?echo $cmd ?>\">\n<?\n\t\t\tif (isset($this->value) && $this->value !== \"\")\n\t\t\t{\n?>\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" name=\"<? echo $this->id?>\" value=\"<? echo $this->value?>\" <? \n\t\t\t\tif ($this->checked) echo \" checked\";\n\t\t\t\tif ($this->disabled) echo \" disabled\";\n\t\t\t\tif ($_activeTree->selectMode == \"single\") \n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"Tree.clearCheckBoxes('{$_activeTree->id}', this);\";\n\t\t\t\t\tif ($_activeTree->onSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \" {$_activeTree->onSelect}('{$this->value}');\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\\\"\";\n\t\t\t\t}\n\t\t\t\telse if ($_activeTree->onSelect)\n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"{$_activeTree->onSelect}('{$this->value}');\\\"\";\n\t\t\t\t}\n\t\t\t\t ?>/>\n<?\n\t\t\t}\n?>\n\t\t<?echo $title?></div>\n\t\t<div id='<?echo $this->id?>_contents' style='padding-left: <?echo $_activeTree->indent ?>; display: <? echo $display?>'>\n\t\t\t\n<?\t\t\t\n\t\t\tfor($i = 0; $i < $c; ++$i)\n\t\t\t{\n\t\t\t\t$this->children[$i]->writeHTML();\n\t\t\t}\n?>\n\t\t</div>\n<?\n\t\t}\n\t}", "public function buildHTML() {\n\n\t\t// Load the header\n\t\tinclude 'templates/header.php';\n\n\t\t// Load the content\n\t\t$this->contentHTML();\n\n\t\t// Load the footer\n\t\tinclude 'templates/footer.php';\n\n\t}", "public function build()\n {\n\n $this->load();\n $this->html = $this->buildTable() ;\n\n return $this->html;\n\n }", "public function __construct () {\n\t\t$this->url =\t\t!ee()->TMPL->fetch_param('url') ? $this->url : ee()->TMPL->fetch_param('url');\n\t\t$this->pageId = \t!ee()->TMPL->fetch_param('page_id') ? $this->pageId : ee()->TMPL->fetch_param('page_id');\n\t\t$this->element =\t!ee()->TMPL->fetch_param('element') ? $this->element : ee()->TMPL->fetch_param('element');\n\t\t$this->elementClass =\t!ee()->TMPL->fetch_param('element_class') ? $this->elementClass : ee()->TMPL->fetch_param('element_class');\n\t\t\t\t\n\t\t$this->return_data = '<' . $this->element . ' class=\"' . $this->elementClass . '\" data-confluenceurl=\"' . $this->url . '\" data-confluencepageid=\"' . $this->pageId . '\"></' . $this->element . '>';\t\t\n\t}", "function createItems($data) { ?>\n\t\t<div class=\"item active\">\n\t\t\t<img src=\"layout/gallery/default.png\" alt=\"<?= $data[$i][\"header\"] ?>\" \n\t\t\t\tstyle=\"height: 500px; margin-left: auto; margin-right: auto;\">\n\t\t\t<div class=\"carousel-caption custom-caption\">\n\t\t\t\t<h3>Chapter House</h3>\n\t\t\t\t<p>View of the house from 47th street.</p>\n\t\t\t</div> \n\t\t</div> <?PHP\n\t\tfor ($i = 0; $i < count($data); $i++) { ?>\n\t\t\t<div class=\"item\">\n\t\t\t\t<img src=\"layout/gallery/<?= $data[$i][\"id\"] ?>.png\" alt=\"<?= $data[$i][\"header\"] ?>\" \n\t\t\t\t\tstyle=\"height: 500px; margin-left: auto; margin-right: auto;\">\n\t\t\t\t<div class=\"carousel-caption custom-caption\">\n\t\t\t\t\t<h3><?= $data[$i][\"header\"]; ?></h3>\n\t\t\t\t\t<p><?= $data[$i][\"content\"]; ?></p>\n\t\t\t\t</div> \n\t\t\t</div> <?PHP\n\t\t}\n\t}", "function writeHTML()\n\t{\n\t\tglobal $_activeTree;\n\t\t\n\t\t$_activeTree= $this;\n\t\t\n\t\t$this->writeScript();\n\t\t$width = is_numeric($this->width) ? \"{$this->width}px\" : $this->width;\n\t\t$height = is_numeric($this->height) ? \"{$this->height}px\" : $this->height;\n\t\t\n\t\tif ($this->selectMode == \"single\")\n\t\t{\n?>\n<input type='hidden' name='<?echo $this->id ?>' id='<?echo $this->id?>' value='<?echo $this->value ?>'/>\n<? \n\t\t}\n?><table id=\"<?echo $this->id?>_table\" class=\"<? echo $this->style?>\" cellpadding=\"0\" cellspacing=\"0\" <? if ($this->width) echo \"style='width:{$width}'\"; ?>>\n\t\t <? \n\t\t if ($this->title)\n\t\t {\n\t\t ?>\t\t \n\t\t <tr>\n\t\t <th><? echo $this->title?></th>\n\t\t </tr>\n\t\t <?\n\t\t }\n\t\t ?>\n\t\t <tr>\n\t\t <td>\n\t\t <div style=\"padding: 0; margin: 0; width: 100%;<? if ($this->height > 0) { ?> height: <?echo $this->height?>px;<? } ?><?if ($this->scroll) echo \"overflow: auto\"?>\">\n<?\n\t\t$this->writeNodes();\n?>\n\t\t </div>\n\t\t </td>\n\t\t </tr>\n\t\t</table>\n<?\n\t\t$_activeTree = null;\n\t}", "public function generate() {\n\t\t\t$this->Wrapper->appendChild($this->Header);\n\t\t\t$this->Wrapper->appendChild($this->Contents);\n\t\t\t$this->Wrapper->appendChild($this->Footer);\n\n\t\t\t$this->Body->appendChild($this->Wrapper);\n\n\t\t\t$this->__appendBodyId();\n\t\t\t$this->__appendBodyClass($this->_context);\n\t\t\treturn parent::generate();\n\t\t}", "public function content()\n {\n $wrapper = new Brick('div');\n $wrapper->addClass('selector');\n $wrapper->data(array(\n 'field' => 'selector',\n 'name' => $this->name(),\n 'page' => $this->page(),\n 'mode' => $this->mode,\n 'autoselect' => $this->autoselect(),\n 'size' => $this->size,\n 'editable' => $this->editable,\n ));\n $wrapper->html(tpl::load(__DIR__ . DS . 'template.php', array('field' => $this)));\n\n return $wrapper;\n }", "protected function render( $data ) {\n\n\t\t// begin rendering\n\t\techo $data[ 'headelement' ];\n\t\t?>\n\t\t<div id=\"mw-mf-viewport\">\n\t\t\t<div id=\"mw-mf-page-left\" class=\"navigation-drawer\">\n\t\t\t\t<?php\n\t\t\t\t\t$this->renderMainMenu( $data );\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<div id='mw-mf-page-center'>\n\t\t\t\t<?php\n\t\t\t\t\tforeach( $this->data['banners'] as $banner ):\n\t\t\t\t\t\techo $banner;\n\t\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t\t<div class=\"header\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$this->html( 'menuButton' );\n\t\t\t\t\t\tif ( $data['disableSearchAndFooter'] ) {\n\t\t\t\t\t\t\techo $data['specialPageHeader'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<form action=\"<?php echo $data['wgScript'] ?>\" class=\"search-box\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo $this->makeSearchInput( $data['searchBox'] );\n\t\t\t\t\t\t\t// FIXME: change this into a search icon instead of a text button\n\t\t\t\t\t\t\techo $this->makeSearchButton(\n\t\t\t\t\t\t\t\t'fulltext',\n\t\t\t\t\t\t\t\tarray( 'class' => 'searchSubmit mw-ui-button mw-ui-progressive' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo $data['secondaryButton'];\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t\t<!--placeHolderForHeader 资料-->\n\t\t\t\t<div id=\"content_wrapper\">\n\t\t\t\t<?php\n\t\t\t\t\t$this->renderContentWrapper( $data );\n\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t\t\t$this->renderFooter( $data );\n\t\t\t\t?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t\techo $data['reporttime'];\n\t\t\techo $data['bottomscripts'];\n\t\t?>\n\t\t</body>\n\t\t</html>\n\t\t<?php\n\t}", "public function setDatas()\n\t{\n\t\t$this->data[\"skeleton\"] = $this->getSkeleton();\n\t\t$this->data[\"css\"] = $this->getCss();\n\t\t$this->data[\"javascript\"] = $this->getJavascript();\n\t\t$this->data[\"module\"] = $this->getModule();\n\t\t$this->data[\"site\"] = $this->getSite();\n\t\t\t\t\t\t\n\t\t$this->_nodeName = $this->getNodeName();\n\t\t$this->_value = $this->getNodeValue();\n\t}", "function generate($data, $settings = null) {\n if (is_null($settings)) {\n $settings = array();\n }\n $this->__settings = array_merge(array(\n 'model' => null,\n 'title' => 'name',\n 'depth' => 0,\n 'link' => true,\n 'div' => 'tree',\n 'controller' => null,\n 'action' => null,\n 'ajaxtarget' => null,\n 'additional' => null,\n ), (array) $settings);\n extract($this->__settings);\n\n $html = \"\\n\";\n $html .= $this->__generate($data, $settings);\n\n // inject the additional items before the end of the list\n if (is_array($additional)) {\n $html = substr($html, 0, strrpos($html, '</ul>'));\n foreach ($additional as $item) {\n $html .= \"<li>$item</li>\\n\";\n }\n $html .= \"</ul>\\n\";\n }\n\n $js = '';\n $js .= '$(function() {';\n $js .= '$(\"#tree\").treeview({';\n $js .= 'collapsed: true,';\n $js .= 'animated: \"medium\",';\n $js .= 'control:\"#sidetreecontrol\",';\n $js .= 'persist: \"location\"';\n $js .= '});';\n $js .= '})';\n $this->Html->scriptBlock($js, array('inline' => false));\n\n return $html;\n }", "public function render()\r\n {\r\n $this->data['menu'] = build_menu(\r\n $this->choices, $this->uri->segment(1));\r\n \r\n $this->data['header'] = $this->parser->parse(\r\n '_header', $this->data, true);\r\n $this->data['content'] = $this->parser->parse(\r\n $this->data['page_body'], $this->data, true);\r\n $this->data['footer'] = $this->parser->parse(\r\n '_footer', $this->data, true);\r\n \r\n $this->data['data'] = &$this->data;\r\n \r\n $this->parser->parse('_template', $this->data);\r\n }", "function initialize () {\n $this->set_openingtag(\"<DIV[attributes]>[content]\");\n\t$this->set_closingtag(\"</DIV>\");\n }", "static function getHTMLForTree( $data ){\n\t\tglobal $wgOut;\n\t\t$wgOut->addModules( 'ext.DataVisualizer' );\n\n\t\treturn '<div class=\"dv_d3_tree\" style=\"text-align:center;\" dv_data=' . json_encode($data) .'></div>';\n\t}", "public function toHTML(){\r\n if(isset($_SESSION['id'])){\r\n // Checks if the user is an admin.\r\n if(checkIfAdmin($_SESSION['id'])){\r\n // Displays the adminData.\r\n $this->adminData();\r\n }else{\r\n // Displays the member data.\r\n $this->MemberData();\r\n }\r\n }\r\n // If not logged in guestData() shows.\r\n else{\r\n $this->GuestData();\r\n }\r\n }", "public function render($data);", "public function render( $data = null )\r\n\t{\r\n\t\tload_bootstrap( 'intouch' );\r\n\t\t\r\n\t\t// Compatibility check\r\n\t\tif (! check_compatible( 'dunamis' ) ) $this->setAlert( 'alert.dunamis.compatible', 'error' );\r\n\t\t\r\n\t\t$title\t= $this->buildTitle();\r\n\t\t$navbar\t= $this->buildNavigation();\r\n\t\t$alerts\t= $this->buildAlerts();\r\n\t\t$modals\t= $this->buildModals();\r\n\t\t\r\n\t\t$baseurl = get_baseurl( 'intouch' );\r\n\t\t$doc = dunloader( 'document', true );\r\n\t\t\r\n\t\t$doc->addStyleDeclaration( '#contentarea > div > h1, #content > h1 { display: none; }' );\t// Wipes out WHMCS' h1\r\n\t\t$doc->addStyleDeclaration( '.contentarea > h1 { display: none; }' );\t// Wipes out WHMCS' h1 in 5.0.3\r\n\t\t$doc->addStylesheet( get_baseurl( 'intouch' ) . 'assets/admin.css' );\r\n\t\t\r\n\t\treturn \t\t'<div style=\"float:left;width:100%;\">'\r\n\t\t\t\t.\t'<div id=\"intouch\">'\r\n\t\t\t\t.\t'\t' . $title\r\n\t\t\t\t.\t'\t' . $navbar\r\n\t\t\t\t.\t'\t' . $alerts\r\n\t\t\t\t.\t'\t' . $data\r\n\t\t\t\t.\t'\t' . $modals\r\n\t\t\t\t.\t'</div>'\r\n\t\t\t\t.\t'</div>';\r\n\t}", "public function getHTML($data);", "public function render()\n\t{\n\t\t$template = $this->template;\n\t\t$template->setFile( __DIR__ . '/dataGrid.latte' );\n\n\t\t$template->grid = $this;\n\t\t$template->stencils = $this->stencils;\n\t\t$template->actionWidth = $this->actionWidth;\n\t\t$template->actitle = $this->actitle;\n\t\t$template->acfooter = $this->acfooter;\n\t\t$template->cmd = self::CMD;\n\t\t$template->labels = $this->labels;\n\t\t$template->columns = $this->columns;\n\t\t$template->key = $this->key;\n\t\t$template->isSorting = $this->isSorting();\n\t\t$template->isFiltering = $this->isFiltering();\n\t\t$template->isAdding = $this->isAdding();\n\t\t$template->isRemoving = $this->isRemoving();\n\t\t$template->isEditing = $this->isEditing();\n\t\t$template->hasActions = $this->hasActions();\n\t\t$template->sortable = $this->sortable;\n\t\t$template->sorting = $this->sorting;\n\t\t$template->filtering = $this->filtering;\n\t\t$template->id = $this->id;\n\t\t$template->pgbtn = $this->getPagerButtons();\n\t\t$template->currentPage = $this->getCurrentPage();\n\t\t$template->rowsPerPage = $this->getRowsPerPage();\n\t\t$template->pageCount = $this->getPageCount();\n\n\t\tif ( count( $this->dataSnippet ) ) $template->data = $this->dataSnippet;\n\t\telse $template->data = $this->getData();\n\n\t\t$template->render();\n\t}", "protected function _build() {\n $alt_title = $this->isXhtml ? tep_output_string_protected( str_replace ( '&amp;', '&', $this->attributes['alt'] ) ) : tep_output_string( $this->attributes['alt'] );\n $parameters = tep_not_null( $this->parameters ) ? tep_output_string( $this->parameters ) : false;\n $width = (int)$this->_calculated_width;\n $height = (int)$this->_calculated_height;\n $this->_html = '<img width=\"' . $width . '\" height=\"' . $height . '\" src=\"' . $this->src . '\" title=\"' . $alt_title . '\" alt=\"' . $alt_title . '\"';\n if ( false !== $parameters ) $this->_html .= ' ' . html_entity_decode(tep_output_string( $parameters ));\n $this->_html .= $this->isXhtml ? ' />' : '>'; \n }", "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}", "final public function render() {\n\t\treturn $this->_view->getBaseView()->element($this->_name, $this->_data, $this->_options);\n\t}", "abstract protected function buildData(DOMDocument $xml);", "public function getHTMLNode($xml, &$data) {\n\t\t$node = parent::getHTMLNode($xml, $data);\n\t\t$imageDiv = $xml->createElement('div', array('class' => 'image-container'));\n\t\t$imageDiv->appendChild($xml->createImgElement($this->getImageURL('image'), 'image', $this->imageSize));\n\t\t$node->appendChild($imageDiv);\n\t\treturn $node;\n\t}", "public function run()\n {\n return \\yii\\helpers\\Html::tag($this->container, $this->content, $this->getOptions());\n }", "public function generate($data=''){\n\t\t$dompdf = new Dompdf\\Dompdf();\n\t\t$dompdf->loadHtml($data);\n\n\t\t// Render the HTML as PDF\n\t\t$dompdf->render();\n\t\t$dompdf->stream();\n\t}", "abstract public function render($data);", "protected function renderData()\n {\n $this->view->baseUrl = $this->_baseUrl;\n $this->view->staticUrl = Zend_Registry::get('static');\n $this->view->version = Zend_Registry::get('version');\n $this->view->hostUrl = Zend_Registry::get('host');\n $this->view->photoUrl = Zend_Registry::get('photo');\n $this->view->adminUser = $this->_user;\n\n $this->view->isSuperUser = $this->_isSuperUser;\n $this->view->isViewer = $this->_isViewer;\n $this->view->isWatcher = $this->_isWatcher;\n $this->view->isEditor = $this->_isEditor;\n }", "function render()\r\n {\r\n // ########### Control Generation ################################################\r\n $temp = '<div';\r\n if ( !empty( $this->_style ) ) {\r\n $style = \"\";\r\n foreach ( $this->_style as $key => $value )\r\n $style .= \"$key: $value;\";\r\n $this->_params['style'] = $style;\r\n unset( $style );\r\n }\r\n if ( !empty( $this->_events ) )\r\n foreach ( $this->_events as $key => $function )\r\n $this->_params[$key] = $this->GetRJS( $function );\r\n foreach ( $this->_params as $key => $value )\r\n $temp .= \" $key=\\\"$value\\\"\";\r\n $temp .= '>' . $this->_value . '</div>' . \"\\n\";\r\n // ########### JS Vars Code ################################################\r\n if ( !empty( $this->_vars ) ) {\r\n $js = \"\";\r\n foreach( $this->_vars as $key => $value ) {\r\n switch ( gettype( $value ) ) {\r\n case \"NULL\":\r\n $js .= \" var \" . $this->_params['id'] . \"_$key = null; \\n\";\r\n break;\r\n case \"boolean\":\r\n $js .= \" var \" . $this->_params['id'] . \"_$key = \" . ( ( $value )?\"true\":\"false\" ) . \";\\n\";\r\n break;\r\n case \"integer\":\r\n case \"double\":\r\n case \"float\":\r\n $js .= \" var \" . $this->_params['id'] . \"_$key = $value;\\n\";\r\n break;\r\n case \"string\":\r\n $js .= \" var \" . $this->_params['id'] . \"_$key = \\\"0:\" . addslashes( $value ) . \"\\\";\\n\";\r\n break;\r\n default:\r\n $js .= \" var \" . $this->_params['id'] . \"_$key = '1:\" . base64_encode( serialize( $value ) ) . \"';\\n\";\r\n break;\r\n }\r\n }\r\n }\r\n // ########### JS Code Generation #########################################\r\n if ( !empty( $this->_js ) || ( isset( $js ) ) ) {\r\n if ( !isset( $js ) ) $js = ' ';\r\n $temp .= \"<script type=\\\"text/javascript\\\" language=\\\"javascript\\\">\\n$js\";\r\n foreach( $this->_js as $value )\r\n $temp .= \"$value\\n\";\r\n $temp .= \"</script>\\n\";\r\n }\r\n return $temp;\r\n }", "public function buildElement()\n\t{\n\t\t$e = $this->getElement();\n\t\t$view = $e->getView();\n\t\t$helper = $e->helper;\t\t\n\t\t\n\t\t$type = $e->getType();\n\t\t\n\t\t$attribs = $e->getAttribs();\n\t\t\n\t\t/*$mode = self::MODE_FILE;\n\t\tif (is_string($attribs['selector_mode']) && in_array($attribs['selector_mode'], $this->_modes)) {\n\t\t\t$mode = $attribs['selector_mode'];\n\t\t}\n\t\t$attribs['selector_mode'] = $mode;*/\n\t\t\n\t\t$buttonLabel = '';\n\t\t\n\t\t$selectMultiple = 'false';\n\t\t$jsMethod = 'mainImageRenderer';\n\t\tif (isset($attribs['selectMultiple']) && !!$attribs['selectMultiple']) {\n\t\t\t$selectMultiple = 'true';\n\t\t\t$jsMethod = 'imagesRenderer';\n\t\t}\n\t\t\n\t\t$imgType = '';\n\t\tif (is_string($attribs['media-type'])) {\n\t\t\t$imgType = $attribs['media-type'];\n\t\t\tunset ($attribs['media-type']);\n\t\t}\n\t\t\n\t\t$xhtml = '<div class=\"' . $this->_namespace . '-tag\">'\n\t\t\t . $view->formHidden($e->getName(), $e->getValue(), array('media-type' => $imgType, 'select-multiple' => $selectMultiple, 'autocomplete' => \"off\"))\n\t\t\t . $view->$helper($e->getName(), $buttonLabel, $attribs, $e->options)\n\t\t\t . '<script>$(document).ready(function(){ $.fn.cmsManager(\\'' . $jsMethod . '\\', null, \\'' . $e->getName() . '\\'); })</script>'\n\t\t\t . '</div>';\t\t\t\n\t\n\t\treturn $xhtml;\n\t}", "private function createNode($data)\n {\n return (new Node($data));\n }", "function build() {\n\t\t$this->order_id = new view_field(\"Order ID\");\n\t\t$this->timestamp = new view_field(\"Date\");\n\t\t$this->total_amount = new view_field(\"Amount\");\n $this->view= new view_element(\"static\");\n \n $translations = new translations(\"fields\");\n $invoice_name = $translations->translate(\"fields\",\"Invoice\",true);\n $this->view->value=\"<a href=\\\"/orders/order_details.php?order_id={$this->_order_id}\\\" target=\\\"invoice\\\">\".$invoice_name.\"</a>\";\n\n\t\tif(isset($_SESSION['wizard']['complete']['process_time']))\n\t\t{\n\t\t\t$this->process_time = new view_field(\"Seconds to process\");\n\t\t\t$this->process_time->value=$_SESSION['wizard']['complete']['process_time'];\n\t\t\t$this->server = new view_field();\n\t\t\t$address_parts = explode('.',$_SERVER['SERVER_ADDR']);\n\t\t\t$this->server->value = $address_parts[count($address_parts) - 1];\n\t\t}\n\t\tparent::build();\n\t}", "public function buildElement() {\n\n // Set the element type\n $this->addType('example');\n\n // Add the element attributes\n $this->addAttributes(array(\n // Some attributes\n ));\n\n // Example if we need to add child object\n // to this element\n $object = new VTCore_Form_Base();\n $object->addType('example_child');\n $object->addAttributes(array(\n // Some Attributes\n ));\n\n // Adding a plaing text as child of subchild\n $object->addText('some text');\n\n // Inject the child and subchild back to parent\n $this->addChildren($object);\n\n // No need to echo or print anything, all the\n // actual rendering will be performed by\n // VTCore_Form_Base() when user is invoking\n // the render or __toString method.\n }", "public function __construct() {\n $this->html = new HtmlElm( \"html\" );\n $head = new HtmlElm( \"head\" );\n $meta = new EmptyHtmlElm( \"meta\" );\n $this->head = $head->append( $meta->attr( \"http-equiv\", \"Content-Type\" )->attr( \"content\", \"text/html;charset=utf-8\" ) );\n $this->body = new HtmlElm( \"body\" );\n }", "private function createBuilder()\n {\n $class = get_class($this->data->getModel());\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "public function buildObject() {\n $this->convertVCGrid = !get_theme_support('bootstrap');\n\n $this->object = new VTCore_History_Element_HsElement($this->atts);\n $this->object->addChildren(do_shortcode($this->content));\n }", "public abstract function render($data);", "public function __construct()\n\t{\n\t\t$this->html = new HtmlBuilder;\n\t}", "public function render()\n\t{\n\t\t// convert json to PHP arrays\n\t\tif(!is_array($this->headers))\n\t\t\t$this->headers = $this->extract_json($this->headers);\n\t\tif(!is_array($this->data))\n\t\t\t$this->data = $this->extract_json($this->data);\n\n\t\t// generate a table of the appropriate type with sub-render method\n\t\t$table_html = $this->{\"render_$this->type\"}();\n\t\t\n\t\t// get the snippets directory if set\n\t\tif($this->snippets_dir && file_exists(\"$this->snippets_dir/table.php\"))\n\t\t\t$snippet = \"$this->snippets_dir/table.php\";\n\t\telse\n\t\t\t$snippet = __DIR__ . \"/snippets/table.php\";\n\t\t\n\t\t// build up the replacements array\n\t\t$replacements = array(\n\t\t\t'body' => $table_html,\n\t\t\t'class' => strlen($this->class)?\"class=\\\"$this->class\\\"\":'',\n\t\t\t'id' => strlen($this->id)?\"id=\\\"$this->id\\\"\":'',\n\t\t\t'caption' => strlen($this->caption)?\"<caption>$this->caption</caption>\":'',\n\t\t);\n\t\t\n\t\t$html = \\helpers\\html\\html::load_snippet($snippet, $replacements);\n\n\t\treturn $html;\n\t}", "function addSelfToDocument($domtree, $parentElement) { \n // create the root element for this class and append it to our parent\n $xmlRoot = $parentElement->appendChild($domtree->createElement('view'));\n $xmlRoot->appendChild($domtree->createElement('siteicon_url', get_option('hbo_siteicon_url')));\n $xmlRoot->appendChild($domtree->createElement('housekeepingurl', get_option('hbo_housekeeping_url')));\n $xmlRoot->appendChild($domtree->createElement('split_room_report_url', get_option('hbo_split_room_report_url')));\n $xmlRoot->appendChild($domtree->createElement('unpaid_deposit_report_url', get_option('hbo_unpaid_deposit_report_url')));\n $xmlRoot->appendChild($domtree->createElement('group_bookings_report_url', get_option('hbo_group_bookings_report_url')));\n $xmlRoot->appendChild($domtree->createElement('guest_comments_report_url', get_option('hbo_guest_comments_report_url')));\n $xmlRoot->appendChild($domtree->createElement('bedcounts_url', get_option('hbo_bedcounts_url')));\n $xmlRoot->appendChild($domtree->createElement('manual_charge_url', get_option('hbo_manual_charge_url')));\n $xmlRoot->appendChild($domtree->createElement('generate_payment_link_url', get_option('hbo_generate_payment_link_url')));\n $xmlRoot->appendChild($domtree->createElement('payment_history_url', get_option('hbo_payment_history_url')));\n $xmlRoot->appendChild($domtree->createElement('payment_history_inv_url', get_option('hbo_payment_history_inv_url')));\n $xmlRoot->appendChild($domtree->createElement('process_refunds_url', get_option('hbo_process_refunds_url')));\n $xmlRoot->appendChild($domtree->createElement('refund_history_url', get_option('hbo_refund_history_url')));\n $xmlRoot->appendChild($domtree->createElement('report_settings_url', get_option('hbo_report_settings_url')));\n $xmlRoot->appendChild($domtree->createElement('view_log_url', get_option('hbo_view_log_url')));\n $xmlRoot->appendChild($domtree->createElement('job_history_url', get_option('hbo_job_history_url')));\n $xmlRoot->appendChild($domtree->createElement('job_scheduler_url', get_option('hbo_job_scheduler_url')));\n $xmlRoot->appendChild($domtree->createElement('blacklist_url', get_option('hbo_blacklist_url')));\n $xmlRoot->appendChild($domtree->createElement('online_checkin_url', get_option('hbo_online_checkin_url')));\n $xmlRoot->appendChild($domtree->createElement('redirect_to_url', get_option('hbo_redirect_to_url')));\n $xmlRoot->appendChild($domtree->createElement('log_directory', get_option('hbo_log_directory')));\n $xmlRoot->appendChild($domtree->createElement('log_directory_url', get_option('hbo_log_directory_url')));\n $xmlRoot->appendChild($domtree->createElement('run_processor_cmd', get_option('hbo_run_processor_cmd')));\n }", "function buildOutput()\n {\n $dom = new DOMDocument('1.0', 'UTF-8');\n $field = $dom->createElement('field');\n if ( !isset($this->class) )\n {\n $field->setAttribute('class', $this->type);\n } else {\n $field->setAttribute('class', $this->class);\n }\n $field->setAttribute('id', $this->name);\n $field->setAttribute('label', $this->label);\n $field->setAttribute('name', $this->name);\n $field->setAttribute('type', $this->type);\n if ( is_array($this->options) )\n {\n foreach ( $this->options AS $name=>$value )\n {\n $field->setAttribute($name, $value);\n }\n }\n $field->appendChild($dom->createCDATASection($this->value));\n return $field;\n }", "public function getHTML() {\t\n\t\t$html = '';\n\t\tif ($this->type != 'title') $html.= '<p>'.\"\\n\";\n\t\tif ($this->type != 'info' && $this->type != 'system' && $this->type != 'title') \n\t\t\t{\t\t\t\n\t\t\t$html.= '<label id=\"label_for_'. $this->name . '\" name=\"label_for_'. $this->name . '\" for=\"'. $this->name . '\">';\n\t\t\t// special check for files item\n\t\t\tif ($this->type == 'file')\n\t\t\t\t{\n\t\t\t\tif (file_exists($_SERVER['DOCUMENT_ROOT'].'/uploads/' . $this->name))\n\t\t\t\t\t{\n\t\t\t\t\t$html.= '<a href = \"/uploads/'. $this->name .'\">'.$this->label.'</a> \n\t\t\t\t\t\t(<a href=\"javascript:void Messi.ask(\\''.DELETE.' ' .$this->name.' ?\\', \n\t\t\t\t\t\tfunction(val) { if(val==\\'Y\\') formSubmit(\\'delete\\',\\'' . $this->name . '\\');});\">'.DELETE.'</a>)';\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t$html.= $this->label.' ('.NONE.')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t$html.= $this->label;\n\t\t\t\t}\n\t\t\t$html.= '</label>'.\"\\n\";\n\t\t\t}\n\t\t// add dependence of the item for js managing in user interface\n\t\tif ($this->depend != 'none' or $this->depend != '') {\n\t\t\t$html.= '<input type=\"hidden\" id=\"dependance_for_'. $this->name . '\" value=\"'. $this->depend . '\" />'.\"\\n\";\n\t\t}\t\n\t\t$html.= '<input type=\"hidden\" id=\"title_for_'. $this->name . '\" value=\"'. $this->title . '\" />'.\"\\n\";\n\t\tswitch ($this->type)\n\t\t\t{\n\t\t\tcase 'text' : \n\t\t\t\t$html.= '<input id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" \n\t\t\t\t\tonchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'password' : \n\t\t\t\t$html.= '<input type=\"password\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" \n\t\t\t\t\tonchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'checkbox' : \n\t\t\t\t$html.= '<input type=\"checkbox\" id=\"'. $this->name . '\" name=\"'. $this->name . '\"' . ( ($this->value == 'on') ? \" \n\t\t\t\t\tchecked \" : \"\") . ' onchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'file' : \n\t\t\t\t$html.= '<input type=\"file\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'select' :\n\t\t\t\t$html.= '<select id=\"'. $this->name . '\" name=\"'. $this->name . '\" onchange=\"display_dependance();\" >'.\"\\n\";\n\t\t\t\t$valuesPossible = explode(',',$this->values);\n\t\t\t\tforeach ($valuesPossible as $valuePossible){\n\t\t\t\t\t$html.= '<option value=\"'. $valuePossible . '\" ' . (($valuePossible == $this->value) ? \" selected \" : \"\") . '>'.\n\t\t\t\t\t(($valuePossible == \"none\") ? NONE : $valuePossible) . '</option>'.\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t$html.= '</select><div style=\"clear:both\"></div>'.\"\\n\";\n\t\t\t\tbreak; \n\n\t\t\tcase 'title' : \n\t\t\t\t$html.= \"\\n\". '<h2>'.$this->label.'</h2><hr />'.\"\\n\\n\";\t\t\t\n\t\t\t\tbreak;\n\n\t\t\t// system action items\n\t\t\tcase 'system' : \n\t\t\t\t// a system item will render a button that submit the form with the configured action name in the config-map.php\n\t\t\t\t$html.= '<label></label><input class=\"button\" type=\"button\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'.$this->label.'\" \n\t\t\t\tonclick=\"new Messi(\\''.addslashes($this->help).'\\', {\n\t\t\t\t\ttitle: \\''.addslashes($this->label).'?\\', \n\t\t\t\t\tmodal: true, buttons: [{id: 0, label: \\''.YES.'\\', val: \\'Y\\'}, {id: 1, label: \\''.NO.'\\', val: \\'N\\'}], \n\t\t\t\t\tcallback: function(val) { if(val==\\'Y\\') {openTerminal();formSubmit(\\''.$this->values.'\\');}}});\" />';\n\t\t\t\tbreak;\n\n\t\t\tcase 'html' : \n\t\t\t\t// this is only arbitrary html code to display\n\t\t\t\t$html.= $this->value;\t\t\t\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * HERE YOU CAN ADD THE TYPE RENDERER YOU NEED\n\t\t\t *\n\t\t\t * case 'YOUR_TYPE' : \n\t\t\t *\t$html.= 'ANY_HTML_CODE_TO_RENDER';\n\t\t\t *\tbreak;\n\t\t\t */\n\n\t\t\tdefault : \n\t\t\t\t$html.= '<b>'.NO_METHOD_TO_RENDER_THIS_ITEM .'</b><br />Item : '.$this->name. '<br />Type : '.$this->type. '<br />'.\"\\n\"; \n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\tif ($this->type != 'title') $html.= '</p>'.\"\\n\"; \t\t\n\t\treturn $html;\n\t}", "public function render () { \n $this->load->view( $this->template_path($this->layout) , array(\n 'page_title' => $this->load_title(),\n 'js_files' => $this->load_js(),\n 'css_files' => $this->load_css(),\n 'body_class' => $this->load_body_class()\n ));\n return $this;\n }", "\n using \\IngwiePhoenix\\UniterMPC\\Models\\Displayable;\n\n public function __toDOM() {\n return (<div>\n <p>We present to you:</p>\n <span class=\"title\">{$this->title}</div>\n </div>);\n }", "public function render(){\n\t\t$this->el = new XTemplate($this->temp,$this->path);\n\t\t\n\t\t// scan all variables when using\n\t\tforeach ($this->accordion__data as $key=>$value){\n $this->el->assign('ID',$key);\n $this->el->assign('TITLE',$value[0]);\n $this->el->assign('CONTENT',$value[1]);\n\n if($value[2] == 1){\n $this->el->assign('COLLAPSED','');\n $this->el->assign('TRUE','true');\n $this->el->assign('SHOW','show');\n }else{\n $this->el->assign('COLLAPSED','collapsed');\n $this->el->assign('TRUE','false');\n $this->el->assign('SHOW','');\n }\n\n\n if ($this->accordion__arrow == 0){\n $this->el->parse('main.loop');\n }else{\n $this->el->parse('main_1.loop');\n }\n\n\n\t\t}\n\n\t\t// fixed out results\n if ($this->accordion__arrow == 0){\n $this->el->parse('main');\n echo $this->el->text('main');\n }else{\n $this->el->parse('main_1');\n echo $this->el->text('main_1');\n }\n\n\t\t\n\t}", "protected function generateHtml()\n\t{\n\t}", "public function build()\n {\n $this->responseData = [\n 'data' => $this->getData(),\n 'meta' => $this->getMeta(),\n 'links' => $this->getLinks(),\n ];\n }", "public function build()\n {\n return '<button type=\"menu\" ><![CDATA['.$this->content.']]></button>';\n }", "function Dojo_create() \n{\n return html('dojo/create.html.php');\n}", "protected function addContent()\n {\n $this->content .= $this->parse($this->template);\n return $this;\n }", "public function create()\n {\n $this->set_datas([]);\n $this->blade->view($this->get_view_page(), $this->get_datas());\n }", "public function build($row = -1, $col = -1, $num = -1, $data = array()){\n\n global $filelogger;\n\n $filelogger->debug(\"row=%, col=%, num=%, data=%\", \n array($row,$col,$num,StringUtil::get_object_string($data)));\n\n // element gonna be setup\n $e = null;\n\n switch($this->type) {\n\n // input fields\n // TODO: mapping data on to elements of group \"entries\"\n\n case \"textarea\" : \n $e = new Textarea($this->module, $this->fname, $this->name,\n $this->groupid, $row, $col, $num, \n $this->title, $this->rows, $this->cols,\n $this->disabled, $this->value, $this->iclasses);\n break;\n\n case \"text\" : \n $e = new Text($this->module, $this->fname, $this->name,\n $this->groupid, $row, $col, $num, $this->title, \n $this->size, $this->length, $this->value, \n $this->disabled, $this->iclasses);\n break;\n\n case \"password\" : \n $e = new Password($this->module, $this->fname, $this->name,\n $this->groupid, $row, $col, $num, $this->title, \n $this->size, $this->length, $this->disabled, \n $this->iclasses);\n break;\n\n // name AND value characterize the element, same name/diff value => multichoice\n case \"checkbox\" : \n $e = new Checkbox($this->module, $this->fname, $this->name, \n $this->groupid, $row, $col, $num, $this->title, \n $this->value, $this->checked, $this->disabled,\n $this->iclasses);\n break;\n\n // ONLY value characterizes the element, the name is fix on single choices\n case \"radio\" : \n $e = new Radio($this->module, $this->fname, $this->name,\n $this->groupid, $row, $col, $num, $this->title, \n $this->value, $this->checked,$this->disabled,\n $this->iclasses);\n break;\n\n // optgroups/options will be passed as data array, s.a. $data\n case \"select\" : \n $e = new Select($this->module, $this->fname, $this->name,\n $this->groupid, $row, $col, $num, $this->title, \n $this->size, $this->multiple, $this->disabled, \n $this->iclasses);\n break;\n\n // data fields\n\n // value must be adjustable, e.g. see Tokenizer\n case \"hidden\" : \n $e = new Hidden($this->module, $this->fname, $this->name,\n $this->groupid, $row, $col, $num, $this->value);\n break;\n\n case \"file\" : \n $e = new File($this->module, $this->fname, $this->name, \n $this->groupid, $row, $col, $num, $this->title, \n $this->disabled, $this->iclasses);\n break;\n\n // buttons \n case \"submit\" : \n $e = new Submit($this->module, $this->fname, $this->name,\n $this->groupid, $row, $col, $num, $this->title, \n $this->value, $this->disabled, $this->iclasses);\n break;\n\n case \"reset\" : \n $e = new Reset($this->module, $this->fname, $this->name, \n $this->groupid, $row, $col, $num, $this->title, \n $this->value, $this->disabled, $this->iclasses);\n break;\n\n case \"image\" : \n $e = new Image($this->module, $this->fname, $this->name, \n $this->groupid, $row, $col, $num, $this->title, \n $this->value, $this->source, $this->disabled, \n $this->iclasses);\n break;\n\n case \"button\" : \n $e = new Button($this->module, $this->fname, $this->name, \n $this->groupid, $row, $col, $num, $this->title, \n $this->btype, $this->value, $this->text, \n $this->disabled, $this->iclasses);\n break;\n\n default: return \"-\";\n\n }\n\n return $e->build($data);\n\n }", "function render_html( $data ) {\n\n \trequire_once( dirname( __FILE__ ) . '/bootstrap/header.html' );\n\n \t//err out if no results\n\t\tif ( empty( $data ) ) {\n\t\t $this->error( 'No results found', 404 );\n\t\t return;\n\t\t}\n\t\t\n\t\t//page title\n\t\techo \"<h1>Results</h1>\";\n\t\t\n\t\t//render table headings\n\t\techo \"<table class='table table-striped'>\\n<thead>\\n<tr>\\n\";\n\n\t\tforeach ( array_keys( get_object_vars( reset( $data ) ) ) as $heading ) {\n \t\techo \"\\t<th>$heading</th>\\n\";\n\t\t}\n\t\t\n\t\techo \"</tr>\\n</thead>\\n\";\n\t\t\n\t\t//loop data and render\n\t\tforeach ( $data as $row ) {\n \t\t\n \t\techo \"<tr>\\n\";\n \t\t\n \t\tforeach ( $row as $cell ) {\n \t\t\n \t\techo \"\\t<td>$cell</td>\\n\";\n \t\t\n \t\t}\n \t\t\n \t\techo \"</tr>\";\n \t\t\n\t\t}\n\t\t\n\t\techo \"</table>\";\n\t\t\n \trequire_once( dirname( __FILE__ ) . '/bootstrap/footer.html' );\t\t\n\t\t\n\t}", "public function showData(){\n echo \"<li>Data: \";\n if(gettype($this->data) == \"array\"){\n print_r(implode(', ', $this->data));\n }\n else{\n print_r($this->data);\n }\n echo \"</li>\";\n\n echo \"<ul><li>is a \".$this->type.\"</li>\"; // Print the type of the node\n\n if($this->parentNode != NULL){\n echo \"<li>Parent: \";\n if(gettype($this->parentNode->getData()) == \"array\"){\n print_r(implode(', ', $this->parentNode->getData()));\n }\n else{\n print_r($this->parentNode->getData());\n }\n\n echo \"</li>\";\n }\n else{\n echo \"<li>has no parent node.</li>\";\n }\n\n // echo \"<li>Children: </li>\";\n // // Show left child\n // if($this->childNodes[\"left\"] != NULL){\n // $d = $this->childNodes[\"left\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"L: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"L: \".$d.\"\\t\";\n // }\n //\n // }\n // // Show left-right child if we have it\n // if($this->childNodes[\"LR\"] != NULL){\n // $d = $this->childNodes[\"LR\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"LR: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"LR: \".$d.\"\\t\";\n // }\n // }\n //\n // // ... middle child\n // if($this->childNodes[\"mid\"] != NULL){\n // $d = $this->childNodes[\"mid\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"M: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"M: \".$d.\"\\t\";\n // }\n // }\n // // ... middle-right child\n // if($this->childNodes[\"MR\"] != NULL){\n // $d = $this->childNodes[\"MR\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"MR: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"MR: \".$d.\"\\t\";\n // }\n // }\n //\n // // ... right child\n // if($this->childNodes[\"right\"] != NULL){\n // $d = $this->childNodes[\"right\"]->getData();\n // if(gettype($d) == \"array\"){\n // echo \"R: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"R: \".$d.\"\\t\";\n // }\n // }\n // // ... right-right child\n // if($this->childNodes[\"RR\"] != NULL){\n // $d = $this->childNodes[\"RR\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"RR: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"RR: \".$d.\"\\t\";\n // }\n // }\n\n echo \"</ul>\";\n }", "function contents($parser, $data){\n global $current_tag, $xml_picture_key, /*$xml_name_key, $xml_size_key,*/ $xml_link_key, $counter, $featured_array;\n switch($current_tag){\n case $xml_picture_key:\n $featured_array[$counter]->picture = $data;\n break;\n /*case $xml_name_key:\n $featured_array[$counter]->name = $data;\n break;\n\t\t\tcase $xml_size_key:\n $featured_array[$counter]->size = $data;\n break;*/\n case $xml_link_key:\n $featured_array[$counter]->link = $data;\n $counter++;\n break;\n }\n }", "public function build()\n {\n\n return $this->render();\n \n }", "private function get_data() {\n\t\t$this->set_data();\n\t\t\n\t\treturn $this;\n\t}", "public function build() {\n\t\t$this->add($this->Html->A(array('href' => 'http://cakephp.org', 'target' => '_blank', 'text' => 'CakePHP')));\n\t\t$this->add($this->Html->Abbr(array('text' => __('This is an abrreviation'))));\n\t\t$this->add($this->Html->Address(array('text' => __('This is an address'))));\n\t\t$this->add($this->Html->B(array('text' => __('This is bold text'))));\n\t\t$this->add($this->Html->Bdo(array('name' => 'value')));\n\t\t$this->add($this->Html->Blockquote(array('text' => __('This is a block quote'))));\n\t\t$this->add($this->Html->Br());\n\t\t$this->add($this->Html->Button(array('value' => __('This is a button'))));\n\t\t$this->add($this->Html->Cite(array('text' => __('This is a citation'))));\n\t\t$this->add($this->Html->Code(array('text' => __('This is a code block'))));\n\t\t$this->add($this->Html->Comment(array('text' => __('This is a comment'))));\n\t\t$this->add($this->Html->Del(array('text' => __('This is deleted text'))));\n\t\t$this->add($this->Html->Dfn(array('text' => __('This is a definition'))));\n\t\t$this->add($this->Html->Div(array('text' => __('This is a division'))));\n\t\t$dl = $this->Html->Dl(array('text' => __('This is a defined list')));\n\t\t$dl->add($this->Html->Dt(array('text' => __('This is a definition title'))));\n\t\t$dl->add($this->Html->Dd(array('text' => __('This is a definition data'))));\n\t\t$this->add($dl);\n\t\t$this->add($this->Html->Em(array('text' => __('This is text with emphasis'))));\n\t\t$form = $this->Html->Form(array('name' => 'example'));\n\t\t\t$fieldset = $this->Html->Fieldset();\n\t\t\t$fieldset->add($this->Html->Legend(array('text' => __('This is a legend of a fieldset'))));\n\t\t\t$fieldset->add($this->Html->Label(array('text' => __('This is a label'))));\n\t\t\t$fieldset->add($this->Html->Input(array('name' => 'text', 'type' => 'text', 'value' => __('This is a text input'))));\n\t\t\t$fieldset->add($this->Html->Input(array('name' => 'password', 'type' => 'password', 'value' => __('This is a password input'))));\n\t\t\t$fieldset->add($this->Html->Input(array('name' => 'radio', 'type' => 'radio', 'value' => 'radio')));\n\t\t\t$fieldset->add($this->Html->Input(array('name' => 'checkbox', 'type' => 'checkbox', 'value' => 'checkbox')));\n\t\t\t$fieldset->add($this->Html->Textarea(array('name' => 'textarea', 'text' => __('This is a textarea'))));\n\t\t\t\t$select = $this->Html->Select(array('name' => 'select'));\n\t\t\t\t\t$optgroup = $this->Html->Optgroup(array('label' => __('This is an option group')));\n\t\t\t\t\t$optgroup->add($this->Html->Option(array('value' => 123, 'text' => __('This is an option'))));\n\t\t\t\t$select->add($optgroup);\n\t\t\t$fieldset->add($select);\n\t\t$form->add($fieldset);\n\t\t$this->add($form);\n\t\t$this->add($this->Html->Hr());\n\t\t$this->add($this->Html->I(array('text' => __('This is text in italics'))));\n\t\t$this->add($this->Html->Iframe(array('name' => 'ctk', 'src' => 'https://github.com/jameswatts/cake-toolkit')));\n\t\t$this->add($this->Html->Img(array('src' => 'http://cakephp.org/img/cake-logo.png', 'alt' => 'CakePHP')));\n\t\t$this->add($this->Html->Ins(array('text' => __('This is inserted text'))));\n\t\t$this->add($this->Html->Kbd(array('text' => __('This is keyboard text'))));\n\t\t$map = $this->Html->Map();\n\t\t$map->add($this->Html->Area());\n\t\t$this->add($map);\n\t\t$this->add($this->Html->Noscript(array('text' => __('This is displayed if you do not have JavaScript enabled'))));\n\t\t$object = $this->Html->Object();\n\t\t$object->add($this->Html->Param(array('name' => 'example', 'value' => 123)));\n\t\t$this->add($object);\n\t\t$this->add($this->Html->P(array('text' => __('This is a paragraph of text'))));\n\t\t$this->add($this->Html->Pre(array('text' => __('This is preformatted text'))));\n\t\t$this->add($this->Html->Q(array('text' => __('This is a quotation'))));\n\t\t$this->add($this->Html->S(array('text' => __('This is a strike-through text'))));\n\t\t$this->add($this->Html->Samp(array('text' => __('This is a sample text'))));\n\t\t$this->add($this->Html->Small(array('text' => __('This is small text'))));\n\t\t$this->add($this->Html->Span(array('text' => __('This is a span'))));\n\t\t$this->add($this->Html->Strong(array('text' => __('This is a strong text'))));\n\t\t$this->add($this->Html->Style(array('name' => 'value')));\n\t\t$this->add($this->Html->Sub(array('text' => __('This is a sub-text'))));\n\t\t$this->add($this->Html->Sup(array('text' => __('This is a super-text'))));\n\t\t$table = $this->Html->Table(array('border' => 1));\n\t\t$table->add($this->Html->Caption(array('text' => __('This is a table caption'))));\n\t\t\t$colgroup = $this->Html->Colgroup();\n\t\t\t$colgroup->add($this->Html->Col(array('span' => 1)));\n\t\t\t$colgroup->add($this->Html->Col(array('span' => 1)));\n\t\t\t$tbody = $this->Html->Tbody();\n\t\t\t\t$tr = $this->Html->Tr();\n\t\t\t\t$tr->add($this->Html->Th(array('text' => __('This is a table header'))));\n\t\t\t\t$tr->add($this->Html->Td(array('text' => __('This is a table data'))));\n\t\t\t$tbody->add($tr);\n\t\t$table->add($colgroup);\n\t\t$table->add($tbody);\n\t\t$this->add($table);\n\t\t$ol = $this->Html->Ol();\n\t\t$ol->add($this->Html->Li(array('text' => __('This is an ordered list item'))));\n\t\t$this->add($ol);\n\t\t$ul = $this->Html->Ul();\n\t\t$ul->add($this->Html->Li(array('text' => __('This is an unordered list item'))));\n\t\t$this->add($ul);\n\t\t$this->add($this->Html->Var(array('text' => __('This is a variable'))));\n\t}", "public function render()\n\t{\n\t\t//draw head html items (use timestamp for title)\n\t\t$timestamp = date(\"m/d/Y\").\" - \".date(\"h:i:s a\");\n\t\t$this->head->render($timestamp);\n\t\t//draw navbar\n\t\t$this->element->renderElement($this->nav);\n\t\t//start of html body\n\t\t?>\n\t\t\t<div>\n\t\t\t\t<h2>New Note</h2>\n\t\t\t</div>\n\t\t\t<div class=\"form_div\">\n\t\t\t\t<form name=\"newNote\" action=\"<?= $this->savedir ?>\" method=\"post\">\n\t\t\t\t\tTitle: <input type=\"text\" name=\"title\"/><br>\n\t\t\t\t\tNote<br>\n\t\t\t\t\t<textarea rows='8' cols='30' name=\"note\"></textarea><br>\n\t\t\t\t\t<input class=\"save\" type=\"submit\" name=\"addnote\" value=\"save\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"type\" value=\"note\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=<?=$this->curr?> />\n\t\t\t\t</form>\n\t\t\t</div>\n\n\t\t<?php\n //end of html body\n //draw footer items\n\t\t$this->footer->render(\"\");\n\t}", "protected function _content_template() {\n\t\t?>\n\t\t<div class = \"selector-demo\">\n\t\t<div class=\"title div33 el\">\n\t\t\t{{{ settings.title }}}\n\t\t\t<div class=\"box\" style=\" background-color:blue;width: {{ settings.width.size }}{{ settings.width.unit }}\">\n\t\t\tHello\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t<div class = \"wrapper\">\n\t\tHey Circle\n\t\t</div>\n\t\t\n\t\t<# if ( 'yes' === settings.show_title ) { #>\n\t\t\t<div class=\"title div34 el\">{{{ settings.Subtitle }}}</div>\n\t\t<# } #>\n\t\t<div class=\"title2 div35 el\">{{{ settings.Subtitle }}}</div>\n\t\t\n\t\t<# _.each( settings.gallery, function( image ) { #>\n\t\t\t<img class = \"siva_image_drag\" src=\"{{ image.url }}\">\n\t\t<# }); #>\n\t\t</div>\n\t\t<div class = \"selector-demo\">\n\t\t<div class = \"div33 el\"> Anime Demo</div> <div class = \"div34 el\"> Anime Demo</div> <div class = \"div35 el\"> Anime Demo</div>\n\t\t{{{settings.class}}}\n\t\t</div>\n\t\t<?php\n\t}", "public function html()\n {\n return $this->builder()\n ->setTableId('user-table')\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->dom($this->getDom());\n }", "public function createData()\n {\n // TODO: Implement createData() method.\n }", "public function generate()\n {\n # Build teh Header\n $this->buildHeader();\n\n # Switch the Views\n switch ($this->view) {\n case 'day':\n $this->buildBodyDay();\n break;\n case 'week':\n $this->buildBodyWeek();\n break;\n default:\n $this->buildBody();\n break;\n }\n # return thr string\n return $this->html;\n }", "public function getHtml()\n {\n $header = new TableHeader($this);\n $header->addText('Dokument');\n $header->addText('Ersteller');\n $header->addEmpty();\n\n\n $fileReader = new FileReader();\n\n $contentLogModel = new ContentLogModel();\n $fileReader->addFieldByModel($contentLogModel);\n\n $userModel = new UserModel();\n $fileReader->addFieldByModel($userModel);\n\n $join = new ModelJoin($fileReader);\n $join->externalModel = $contentLogModel;\n $join->type = $fileReader->model->id;\n $join->externalType = $contentLogModel->dataId;\n\n $join = new ModelJoin($fileReader);\n $join->externalModel = $userModel;\n $join->type = $contentLogModel->userCreatedId;;\n $join->externalType = $userModel->id;\n\n $fileReader->filter->andEqual($contentLogModel->parentId, $this->dataId);\n $fileReader->filter->andEqual($contentLogModel->contentTypeId, (new FileTemplateStatus())->contentId);\n\n\n foreach ($fileReader->getData() as $fileRow) {\n\n $row = new TableRow($this);\n\n if (!$fileRow->delete) {\n $row->addHyperlink($fileRow->file->getUrl(), $fileRow->file->getFilename());\n\n } else {\n\n $stroke = new Strike($row);\n $stroke->content = $fileRow->file->getFilename();\n\n }\n // show image bzw. detail ansicht\n\n $userDisplay = $fileRow->getModelValue($userModel->displayName);\n $dateTimeCreated = new DateTime($fileRow->getModelValue($contentLogModel->dateTimeCreated));\n\n $row->addText($userDisplay . ' ' . $dateTimeCreated->getShortDateTimeLeadingZeroFormat());\n\n if (!$fileRow->delete) {\n $site = clone(FileDeleteSite::$site);\n $site->addParameter(new FileParameter($fileRow->id));\n $site->addParameter(new DataIdParameter($this->dataId));\n $row->addIconSite($site);\n } else {\n $row->addEmpty();\n }\n\n\n }\n\n return parent::getHtml();\n\n }", "function __construct()\n\t\t{\t\n\t\t\t$this->render();\n\t\t}", "function __construct()\n\t\t{\t\n\t\t\t$this->render();\n\t\t}", "function __construct()\n\t\t{\t\n\t\t\t$this->render();\n\t\t}", "public function content_template() { ?>\n\n\t\t<span class=\"customize-control-title\">\n\t\t<# if ( data.label ) { #>\n\t\t\t{{ data.label }}\n\t\t<# } #>\n\n\t\t<# if ( data.description ) { #>\n\t\t\t<span class=\"description customize-control-description\">{{{ data.description }}}</span>\n\t\t<# } #>\n\t\t</span>\n\n\t\t<ul>\n\n\t\t<# if ( data.family && data.family.choices ) { #>\n\n\t\t\t<li class=\"customize-control typography-font-family\">\n\n\t\t\t\t<# if ( data.family.label ) { #>\n\t\t\t\t\t<span class=\"customize-control-title\">{{ data.family.label }}</span>\n\t\t\t\t<# } #>\n\n\t\t\t\t<select {{{ data.family.link }}}>\n\n\t\t\t\t\t<# _.each( data.family.choices, function( label, choice ) { #>\n\t\t\t\t\t\t<option value=\"{{ choice }}\" <# if ( choice === data.family.value ) { #> selected=\"selected\" <# } #>>{{ label }}</option>\n\t\t\t\t\t<# } ) #>\n\n\t\t\t\t</select>\n\t\t\t</li>\n\t\t<# } #>\n\n\t\t<# if ( data.weight && data.weight.choices ) { #>\n\n\t\t\t<li class=\"customize-control typography-font-weight\">\n\n\t\t\t\t<# if ( data.weight.label ) { #>\n\t\t\t\t\t<span class=\"customize-control-title\">{{ data.weight.label }}</span>\n\t\t\t\t<# } #>\n\n\t\t\t\t<select {{{ data.weight.link }}}>\n\n\t\t\t\t\t<# _.each( data.weight.choices, function( label, choice ) { #>\n\n\t\t\t\t\t\t<option value=\"{{ choice }}\" <# if ( choice === data.weight.value ) { #> selected=\"selected\" <# } #>>{{ label }}</option>\n\n\t\t\t\t\t<# } ) #>\n\n\t\t\t\t</select>\n\t\t\t</li>\n\t\t<# } #>\n\n\t\t<# if ( data.style && data.style.choices ) { #>\n\n\t\t\t<li class=\"typography-font-style\">\n\n\t\t\t\t<# if ( data.style.label ) { #>\n\t\t\t\t\t<span class=\"customize-control-title\">{{ data.style.label }}</span>\n\t\t\t\t<# } #>\n\n\t\t\t\t<select {{{ data.style.link }}}>\n\n\t\t\t\t\t<# _.each( data.style.choices, function( label, choice ) { #>\n\n\t\t\t\t\t\t<option value=\"{{ choice }}\" <# if ( choice === data.style.value ) { #> selected=\"selected\" <# } #>>{{ label }}</option>\n\n\t\t\t\t\t<# } ) #>\n\n\t\t\t\t</select>\n\t\t\t</li>\n\t\t<# } #>\n\n\t\t<# if ( data.size ) { #>\n\n\t\t\t<li class=\"typography-font-size\">\n\n\t\t\t\t<# if ( data.size.label ) { #>\n\t\t\t\t\t<span class=\"customize-control-title\">{{ data.size.label }} (px)</span>\n\t\t\t\t<# } #>\n\n\t\t\t\t<input type=\"number\" min=\"1\" {{{ data.size.link }}} value=\"{{ data.size.value }}\" />\n\n\t\t\t</li>\n\t\t<# } #>\n\n\t\t<# if ( data.line_height ) { #>\n\n\t\t\t<li class=\"typography-line-height\">\n\n\t\t\t\t<# if ( data.line_height.label ) { #>\n\t\t\t\t\t<span class=\"customize-control-title\">{{ data.line_height.label }} (px)</span>\n\t\t\t\t<# } #>\n\n\t\t\t\t<input type=\"number\" min=\"1\" {{{ data.line_height.link }}} value=\"{{ data.line_height.value }}\" />\n\n\t\t\t</li>\n\t\t<# } #>\n\n\t\t</ul>\n\t<?php }", "function render_xml( $data ) {\n\n\t\theader (\"Content-Type:text/xml\"); \n\t\t$xml = new SimpleXMLElement( '<results></results>' );\n\t\t$xml = $this->object_to_xml( $data, $xml );\n\t\techo $this->tidy_xml( $xml );\n\t\t\n\t}", "private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}", "protected function make() {\n\n\t\tif ( ! is_null( $this->tag ) && isset( self::$aliases[ $this->tag ] ) ) {\n\t\t\t$this->set( 'key', self::$aliases[ $this->tag ] );\n\t\t}\n\n\t\t// Set Template\n\t\tif ( false !== $this->attributes['label'] ) {\n\t\t\t$template = 'shortcodes/metadata-label.php';\n\t\t} else {\n\t\t\t$template = 'shortcodes/metadata.php';\n\t\t}\n\n\t\t$this->template = new Template( $template );\n\t}", "function initialize() {\n $this->set_openingtag(\"<DATALIST[attributes]>\");\n $this->set_closingtag(\"</DATALIST>\");\n }", "public function render()\n\t{\n\n\t\t$table = \"<table\";\n\n\t\t// Add all attributes\n\t\tforeach ($this->attributes as $key => $value) {\n\t\t\t$table .= ' ' . $key . '=\"' . $value .'\"';\n\t\t}\n\n\t\t$table .= \">\"; // Close table\n\n\t\t// Add the head\n\t\tif ($this->showHeadRow) {\n\t\t\t$table .= \"<thead><tr>\";\n\n\t\t\t// Show the number header.\n\t\t\tif ($this->showNumberColumn) {\n\t\t\t\t$table .= \"<th>#</th>\";\n\t\t\t}\n\n\t\t\tforeach ($this->columns as $column) {\n\t\t\t\t$columnHeadTitle = isset($column['headTitle']) ? $column['headTitle'] : $column[0];\n\t\t\t\t$table .= \"<th>\" . $columnHeadTitle . \"</th>\";\n\t\t\t}\n\n\t\t\t$table .= \"</tr></thead>\"; // finish head\n\t\t}\n\n\t\t// Body\n\t\t$table .= \"<tbody>\";\n\n\t\t$row = $this->numberColumnOffset;\n\n\t\tif (count($this->data) == 0) {\n\t\t\t// Show a no data entry\n\t\t\t$colspan = count($this->columns) + ($this->showNumberColumn ? 1 : 0);\n\t\t\t$table .= '<tr><td colspan=\"'.$colspan.'\"><p align=\"center\" style=\"font-weight:bold;\">Keine Einträge</p></td></tr>';\n\t\t}\n\t\telse {\n\t\t\tforeach ($this->data as $dataObject) {\n\n\t\t\t\t// Row attributes\n\t\t\t\t$attributes = $this->rowAttributes;\n\t\t\t\tif (!is_array($attributes)) {\n\t\t\t\t\tif (is_callable($this->rowAttributes)) {\n\t\t\t\t\t\t$callable = $this->rowAttributes;\n\t\t\t\t\t\t$attributes = $callable($dataObject);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$attributeString = '';\n\t\t\t\tif ($attributes) {\t\t// Add attributes if we have some\n\t\t\t\t\tforeach ($attributes as $attributeName => $attributeValue) {\n\t\t\t\t\t\t$attributeString .= $attributeName . '=\"' . $attributeValue . '\" ' ;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->rowIdDataMethod) {\n\t\t\t\t\t// method name or closure?\n\t\t\t\t\t$id = '';\n\t\t\t\t\tif (is_string($this->rowIdDataMethod)) {\n\t\t\t\t\t\t$id = $dataObject->{$this->rowIdDataMethod}(); // Call the row data method\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$rf = new \\ReflectionFunction($this->rowIdDataMethod);\n\t\t\t\t\t\tif ($rf->isClosure()) {\n\t\t\t\t\t\t\t// we got a closure\n\t\t\t\t\t\t\t$closure = $this->rowIdDataMethod;\n\t\t\t\t\t\t\t$id = $closure($dataObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t$table .= '<tr id=\"'. $id .'\" ' . $attributeString . '>'; // Start row with id\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$table .= \"<tr \". $attributeString .\">\";\t// Start row without id\n\t\t\t\t}\n\n\t\t\t\t// Number?\n\t\t\t\tif ($this->showNumberColumn) {\n\t\t\t\t\t$table .= \"<td>\" . $row . \"</td>\";\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->columns as $column) {\n\t\t\t\t\t$dataMethod = isset($column['dataMethod']) ? $column['dataMethod'] : $column[1];\n\t\t\t\t\tif (is_string($dataMethod)) {\n\t\t\t\t\t\t// Just call the method an insert the return value into the table cell\n\t\t\t\t\t\t$table .= \"<td>\". $dataObject->$dataMethod() .\"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$rf = new \\ReflectionFunction($dataMethod);\n\t\t\t\t\t\tif ($rf->isClosure()) {\n\n\t\t\t\t\t\t\t// Call the closure and get the result\n\t\t\t\t\t\t\t$value = $dataMethod($dataObject, $this);\n\n\t\t\t\t\t\t\t$table .= \"<td>\". $value .\"</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$table .= \"</tr>\";\t// End the table row\n\t\t\t\t$row++;\n\t\t\t}\n\n\t\t\t// Render the footer row\n\t\t\t$table = $this->renderFooter($table);\n\n\t\t}\n\n\t\t$table .= \"</tbody>\";\n\n\t\t$table .= \"</table>\";\n\t\treturn $table;\n\t}", "function _renderForm($data)\n {\n $vars = new JObject();\n\n $html = $this->_getLayout('form', $vars);\n\n return $html;\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->postAjax()\n ->parameters($this->getBuilderParameters());\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->postAjax()\n ->parameters($this->getBuilderParameters());\n }", "protected function createResults($data) {\n if (parent::createResults($data) === null) return null;\n\n // Providing any selector would do the job. We provide a selector, because we want the method to work properly\n // The method does not work if there is no selector. Hence, we just provide a selector. Although the selector\n // has no effect, providing \"html\" as selector is logical because we want the HTML to be output as result.\n return $this->createHtmlManipulationResults($this->url, $this->content, \"html\", $this->getMessageLastPart());\n }", "public function __construct($type=\"div\",$content=\"\",$attr=array(),$unique_id=False,$self_closing=false){#constructor method for any element\n\t\t$this->type=$type;#tag type\n\t\t$this->attr=$attr;# attributes for the tag\n\t\t$this->content=array((string)$content);#content (can be raw text)\n\t\t$this->self_closing=$self_closing;\n\t\tif (isset(debug_backtrace()[1]['object'])){\t\n\t\t\t$this->master=debug_backtrace()[1]['object'];\n\t\t}\n\t\telse{\n\t\t\t$this->master=\"None\";\n\t\t}\n\t\tif ($unique_id){\n\t\t\t$this->attr=array_merge($this->attr, array(\"id\"=>self::get_unique_id()));\n\t\t}\n\t}", "public function buildHTML() {\n $vars = array('page' => &$this);\n\n // Trigger various page hooks.\n // Page init.\n $this->env->hook('page_preload', $vars);\n\n // This is an AJAX request. Skip loading index.html and just provide requested content.\n if (isset($_REQUEST['ajax'])) {\n $this->html = NodeFactory::render($this->env);\n }\n // This is an actual HTML page request. Commonly index.html.\n elseif (!empty($this->getIndexFile())) {\n $this->html = file_get_contents($this->env->dir['docroot'] . '/' . $this->getIndexFile());\n }\n // In case of a special pre-loaded page request, i.e. Shadow node edit.\n elseif (!empty($this->getData('content'))) {\n $this->html = $this->getData('content');\n }\n elseif (!is_file($this->env->dir['docroot'] . '/' . $this->getIndexFile())) {\n $this->html = t('Hello! Quanta seems not installed (yet) in your system. Please follow the <a href=\"https://www.quanta.org/installation-instructions\">Installation Instructions</a><br /><br />Reason: file not found(' . $this->getIndexFile() . ')');\n }\n\n // Trigger various page hooks.\n // Page init.\n $this->env->hook('page_init', $vars);\n\n // Page's body classes. // TODO: deprecate, include in page init.\n $this->env->hook('body_classes', $vars);\n\n // Page after build.\n $this->env->hook('page_after_build', $vars);\n\n // Page complete.\n $this->env->hook('page_complete', $vars);\n\n }", "public function build()\n {\n if(($document = $this->getDocument()) === null) {\n $document = $this->loader->getInstance(NodeLoader::DOCUMENT_NODE);\n $this->setDocument($document);\n }\n\n if(($header = $document->getHeader()) === null) {\n $header = $this->loader->getInstance(NodeLoader::HEADER_NODE);\n $document->setHeader($header);\n }\n\n if(($supplier = $header->getSupplier()) === null) {\n $supplier = $this->loader->getInstance(NodeLoader::SUPPLIER_NODE);\n $header->setSupplier($supplier);\n }\n\n if(($catalog = $header->getCatalog()) === null) {\n $catalog = $this->loader->getInstance(NodeLoader::CATALOG_NODE);\n $header->setCatalog($catalog);\n }\n\n if(($datetime = $catalog->getDateTime()) === null) {\n $datetime = $this->loader->getInstance(NodeLoader::DATE_TIME_NODE);\n $catalog->setDateTime($datetime);\n }\n\n if(($newCatalog = $document->getNewCatalog()) === null) {\n $newCatalog = $this->loader->getInstance(NodeLoader::NEW_CATALOG_NODE);\n $document->setNewCatalog($newCatalog);\n }\n\n return $document;\n }", "function initialize() {\n $this->set_openingtag(\"<DT[attributes]>\");\n $this->set_closingtag(\"</DT>\");\n }", "function generalTemplate ($data){\n\t\t\tob_start();\t\t\n\t\t\tif(isset($data['title']) and isset($data['description'])):\n\t\t\t?>\n\t\t\t<div class=\"title text\">\n\t\t\t\t<h1><?php echo $data['title']; ?></h1>\n\t\t\t</div>\n \n <div id=\"description text\">\n\t\t\t\t<?php echo $data['description']; ?>\n </div>\n\t\t\t<?php\n\t\t\tendif;\n\t\t\t$output = ob_get_contents();\n\t\t\tob_end_clean();\t\n\t\t\t\n\t\t\treturn $output;\n\t\t}", "function initialize() {\n $this->set_openingtag(\"<DD[attributes]>\");\n $this->set_closingtag(\"</DD>\");\n }", "public function run() {\n\n\t\t// Get value\n\t\t$meta = $this->get_meta_value();\n\t\t$key = $this->attributes['key'];\n\n\t\t// Get label\n\t\t$metadata = utils\\get_registered_movie_meta( $key );\n\t\t$label = ! empty( $metadata['description'] ) ? $metadata['description'] : '';\n\n\t\t// Set template data\n\t\t$this->template->set_data( array(\n\t\t\t'meta' => $meta,\n\t\t\t'label' => $label,\n\t\t\t'key' => $key,\n\t\t) );\n\n\t\treturn $this;\n\t}", "abstract protected function generateMarkup(array $data): string;", "function _renderForm($data) {\n\t\t$user = JFactory::getUser ();\n\t\t\n\t\t$vars = new JObject ();\n\t\t\n\t\t$html = $this->_getLayout ( 'form', $vars );\n\t\t\n\t\treturn $html;\n\t}", "function _renderForm($data) {\n\t\t$user = JFactory::getUser ();\n\t\t\n\t\t$vars = new JObject ();\n\t\t\n\t\t$html = $this->_getLayout ( 'form', $vars );\n\t\t\n\t\treturn $html;\n\t}", "public function __construct()\n\t{\n\t\t$this->type = 'html';\n\t\t\n\t\t$docTitle = 'PHP RUN-TEST RESULTS';\n\t\t\n\t\t// dom\n\t\t$imp = new DOMImplementation();\n\t\t$dtd = $imp->createDocumentType(\"html\", \"-//W3C//DTD XHTML 1.0 Transitional//EN\", \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\");\n \t$this->dom = $imp->createDocument(\"\", \"\", $dtd);\n\n \t// html\n \t$htmlNode = $this->dom->createElement('html');\n \t$this->dom->appendChild($htmlNode);\n \t\n \t// head\n \t$headNode = $this->dom->createElement('head');\n \t$htmlNode->appendChild($headNode);\n \t$headNode->appendChild($this->dom->createElement('title', $docTitle));\n \t\n \t// body\n \t$bodyNode = $this->dom->createElement('body');\n \t$htmlNode->appendChild($bodyNode);\n \t\n \t// stage\n \t$this->stage = $this->dom->createElement('div');\n \t$this->stage->setAttribute('id', 'stage');\n \t$bodyNode->appendChild($this->stage);\n \t\n \t$this->stage->appendChild($this->dom->createElement('h1', $docTitle));\n\t}", "public function element() {\n\t\t$element = parent::element();\n\t\t$element->data('field', self::$fieldname);\n\t\treturn $element;\n\t}" ]
[ "0.65951586", "0.634207", "0.6277972", "0.6116327", "0.6113038", "0.61057615", "0.5984947", "0.59721935", "0.5952263", "0.5939397", "0.5899791", "0.5882633", "0.5841263", "0.5789014", "0.57621956", "0.5751899", "0.5749329", "0.573784", "0.5721151", "0.5686208", "0.56719047", "0.56597555", "0.5657919", "0.56560785", "0.5652766", "0.5650753", "0.56471384", "0.56323415", "0.5629271", "0.56149924", "0.5612781", "0.56116897", "0.5609216", "0.56074625", "0.55979204", "0.5567731", "0.5564047", "0.55564076", "0.55523163", "0.55490595", "0.5548087", "0.5547465", "0.5537528", "0.55241203", "0.55207026", "0.55201685", "0.55193675", "0.55145615", "0.5508281", "0.549796", "0.54778767", "0.54753727", "0.5462943", "0.5459945", "0.5440172", "0.54374355", "0.54369175", "0.5436327", "0.5431573", "0.54269177", "0.5394882", "0.53911525", "0.53899515", "0.5389801", "0.5383173", "0.5376031", "0.5375054", "0.5374104", "0.5373843", "0.5372478", "0.53703415", "0.5370035", "0.5358622", "0.5356413", "0.53527594", "0.5352247", "0.5352247", "0.5352247", "0.5345177", "0.53361183", "0.5331489", "0.53296596", "0.53261596", "0.5322832", "0.53214765", "0.53160506", "0.53160506", "0.5314269", "0.5311155", "0.5308756", "0.5308629", "0.5308517", "0.5308018", "0.5303391", "0.53001386", "0.52991605", "0.52905095", "0.52905095", "0.5286496", "0.52805763" ]
0.55866444
35
Do something upon controller instantiation.
public function __construct() { $this->autodetectActions([ // Method => pattern...should be set by default. HTTP::GET => new RegEx("get_(.+)$") ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initializeController() {}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public function __init()\n\t{\n\t\t// This code will run before your controller's code is called\n\t}", "public function __construct()\n\t{\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function init()\n {\n $controller = $this->router->getController();\n $action = $this->router->getAction();\n $params = $this->router->getParams();\n\n $objController = registerObject($controller);\n\n call_user_func_array([$objController, $action], $params);\n }", "public function initController()\n {\n $this->model = new AliveSettingServiceMeta();\n\n $this->middleware([\n\n ]);\n }", "public function __construct()\n\t{\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function init()\n {\n /* Initialize action controller here */\n }", "public function init()\n {\n /* Initialize action controller here */\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "protected function _initControllers()\n\t{\n\t\treturn;\n\t}", "public function initBaseController();", "public function contentControllerInit()\n\t{\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->resolution_summary = \"\";\n\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "function initialize(Controller $controller) {\n $this->controller = $controller;\n }", "public function __construct()\n {\n if (get_called_class() != 'ApplicationController') {\n $this->_set_default_layout();\n $this->_vars = new stdClass();\n $this->_init();\n }\n }", "public function _construct($controller,$view){\r\n $this->controller = $controller;\r\n }", "function initialize(Controller $controller) {\n $this->controller=&$controller;\n \t}", "public function controller()\n\t{\n\t\n\t}", "public function init()\n {\n $this->vars['CRUD']['Object'] = $this;\n $this->kernel = kernel();\n\n // Dynamic initialization\n if (! $this->modelName) {\n $modelRefl = new ReflectionClass($this->modelClass);\n $this->modelName = $modelRefl->getShortName();\n }\n\n\n if (! $this->crudId) {\n $this->crudId = \\Phifty\\Inflector::getInstance()->underscore($this->modelName);;\n }\n if (! $this->templateId) {\n $this->templateId = $this->crudId;\n }\n\n // Derive options from request\n if ($request = $this->getRequest()) {\n if ($useFormControls = $request->param('_form_controls')) {\n $this->actionViewOptions['submit_btn'] = true;\n $this->actionViewOptions['_form_controls'] = true;\n }\n }\n\n $this->reflect = new ReflectionClass($this);\n $this->namespace = $ns = $this->reflect->getNamespaceName();\n\n // XXX: currently we use FooBundle\\FooBundle as the main bundle class.\n $bundleClass = \"$ns\\\\$ns\";\n if (class_exists($bundleClass)) {\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n } else {\n $bundleClass = \"$ns\\\\Application\";\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n }\n\n $this->vars['Handler'] = $this;\n $this->vars['Controller'] = $this;\n\n // anyway, we have the model classname, and the namespace, \n // we should be able to registerRecordAction automatically, so we don't have to write the code.\n if ($this->registerRecordAction) {\n $self = $this;\n $this->kernel->event->register('phifty.before_action',function() use($self) {\n $self->kernel->action->registerAction('RecordActionTemplate', array(\n 'namespace' => $self->namespace,\n 'model' => $self->modelName,\n 'types' => (array) $self->registerRecordAction\n ));\n });\n }\n\n\n $this->initPermissions();\n\n /*\n * TODO: Move this to before render CRUD page, keep init method simple\n\n if ( $this->isI18NEnabled() ) {\n $this->primaryFields[] = 'lang';\n }\n */\n $this->initNavBar();\n }", "public function AController() {\r\n\t}", "function __construct()\n {\n parent::Controller();\n }", "public function __construct()\n {\n $url = $this->getUrl();\n // Look in controllers folder for first value and ucwords(); will capitalise first letter \n if (isset($url[0]) && file_exists('../app/controllers/' . ucwords($url[0]) . '.php')) {\n $this->currentController = ucwords($url[0]); // Setting the current controllers name to the name capitilised first letter\n unset($url[0]); \n }\n\n // Require the controller\n require_once '../app/controllers/' . $this->currentController . '.php';\n // Taking the current controller and instantiating the controller class \n $this->currentController = new $this->currentController;\n // This is checking for the second part of the URL\n if (isset($url[1])) {\n if (method_exists($this->currentController, $url[1])) { // Checking the seond part of the url which is the corresponding method from the controller class\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n // Get params, if no params, keep it empty\n $this->params = $url ? array_values($url) : []; \n\n // Call a callback with array of params\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }", "public function __construct()\n {\n $this->args = $this->getTemplateArgs();\n $this->clientService = new SignatureClientService($this->args);\n $this->routerService = new RouterService();\n parent::controller($this->eg, $this->routerService, basename(__FILE__));\n }", "public function __construct()\n {\n $this->args = $this->getTemplateArgs();\n $this->clientService = new SignatureClientService($this->args);\n $this->routerService = new RouterService();\n parent::controller($this->eg, $this->routerService, basename(__FILE__));\n }", "public function __construct()\n {\n $this->args = $this->getTemplateArgs();\n $this->clientService = new SignatureClientService($this->args);\n $this->routerService = new RouterService();\n parent::controller($this->eg, $this->routerService, basename(__FILE__));\n }", "public function __construct() {\r\n\t\t\r\n\t\tSession::init();\n\t\tif (!Session::get('local'))\n\t\t\tSession::set('local', DEFAULT_LANGUAGE);\r\n\t\t\r\n\t\t$this->getUrl();\r\n\t\t\r\n\t\t//No controller is specified.\r\n\t\tif (empty($this->url[0])) {\r\n\t\t\t$this->loadDefaultController();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->loadCurrentController();\r\n\t\t$this->callControllerMethod();\r\n\r\n\t}", "public function __construct()\n {\n $this->controller = new Controller;\n $this->error_message = 'bad request or duplicate data';\n }", "function __construct()\n {\n $this->childController = strtolower(get_called_class());\n $this->openDatabaseConnection();\n $this->loadModel();\n $this->loadView();\n }", "function startup(&$controller) {\n $this->setVars();\n }", "public function initialize(Controller $controller) {\n\t\t$this->_controller = $controller;\n\t}", "public function __construct() {\n // filter controller, action and params\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); // $_GET['url']\n $params = explode('/', trim($url, '/'));\n\n // store first and seccond params, removing them from params list\n $controller_name = ucfirst(array_shift($params)); // uppercase classname\n $action_name = array_shift($params);\n\n require_once APP . 'config.php';\n\n // default controller and action\n if (empty($controller_name)) {\n $controller_name = AppConfig::DEFAULT_CONTROLLER;\n }\n if (empty($action_name)) {\n $action_name = AppConfig::DEFAULT_ACTION;\n }\n\n // load requested controller\n if (file_exists(APP . \"Controller/$controller_name.php\")) {\n require CORE . \"Controller.php\";\n require CORE . \"Model.php\";\n require APP . \"Controller/$controller_name.php\";\n $controller = new $controller_name();\n\n // verify if action is valid\n if (method_exists($controller, $action_name)) {\n call_user_func_array(array($controller, $action_name), $params);\n $controller->render(\"$controller_name/$action_name\"); // skipped if already rendered\n } else {\n // action not found\n $this->notFound();\n }\n } else {\n // controller not found\n $this->notFound();\n }\n }", "protected function initDefaultController() {\n\t\tif (!class_exists(\"HomeController\")) return;\n\t\t$this->controller = new HomeController();\n\t}", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "public function __construct()\n {\n //$this, refers to the application class\n $this->parseURL();\n\n // echo CONTROLLER . $this->controller . '.php';\n //checking whether the file exists\n if (file_exists(CONTROLLER . $this->controller . '.php')) {\n\n //checking if the method exists\n if (method_exists($this->controller, $this->action)) {\n //as we already know that the file exists, we are going to create an instance of the controller\n $this->controller = new $this->controller;\n //specifying the controller and the action and PHP is going to execute it\n //in this case, we don't want to pass any parameters to the function\n call_user_func_array([$this->controller, $this->action], []);\n\n //if everything is correct, we don't want to show 404 page\n $this->show404 = false;\n }\n\n }\n\n //if the file does not exist\n if ($this->show404) {\n echo \"404, page not found\";\n }\n\n }", "public function init()\n {\n $this->projectController->init();\n }", "protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function __construct() {\n $this->twitterController = new TwitterController;\n\t}", "function Controller()\n\t{\t\t\n\t\t$this->method = \"showView\";\n\t\tif (array_key_exists(\"method\", $_REQUEST))\n\t\t\t$this->method = $_REQUEST[\"method\"];\n\t\t\t\t\n\t\t$this->icfTemplating = new IcfTemplating();\n\t\t$this->tpl =& $this->icfTemplating->getTpl();\n\t\t$this->text =& $this->icfTemplating->getText();\t\t\n\t\t$this->controllerMessageArray = array();\n\t\t$this->pageTitle = \"\";\n\t\t$this->dateFormat = DateFormatFactory::getDateFormat();\n\t\t$this->controllerData =& $this->newControllerData();\n\t}", "function __construct() {\n\t\t$request = Request::getInstance();\n\t\t$plugin = Plugin::getInstance();\n\t\t$plugin->triggerEvents('load' . $request->getController());\n\t}", "public function __construct()\n {\n $this->controller = new LinkHookController();\n parent::__construct();\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t$this->load->model('mdl_menuitem', 'menuitem');\n\n\t\tlog_message('debug', \"Class Name Controller Initialized\");\n\t}", "public function _initialize()\n {\n $this->cate=CONTROLLER_NAME;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "function __construct() {\n //con esta linea se hereda el constructor de la clase Controller\n parent::__construct();\n }", "public function __construct() {\r\n\t\tparent::__construct($this->controllerName);\t\r\n\t\t$this->load->model('todo_model');\r\n\r\n\t\t$this->data = array(\r\n\t\t\t'title' => 'Orpheus.todo',\r\n\t\t\t'loadedControllers' => Registry::getLoadedLibs()\r\n\t\t\t);\r\n\t\t\r\n\t\t\r\n\t\t//$this->index();\r\n\t\t\r\n\t}", "public function __construct(){\n\t\t$url = $this->processUrl();\n\n\t\t//this if statement unsets the defaultController so we can use the one that is being talked to.\n\t\tif(file_exists('../app/controllers/'.$url[0].'.php')){\n\t\t\t$this->defaultController = $url[0];\n\t\t\tunset($url[0]);\n\t\t}\n\n\t\trequire_once('../app/controllers/' .$this->defaultController.'.php');\n\n\t\t$this->defaultController = new $this->defaultController;//instantiate and make it an object\n\n\t\tif(isset($url[1])){\n\t\t\tif(method_exists($this->defaultController,$url[1])){\n\t\t\t$this->defaultMethod = $url[1];\n\t\t\tunset($url[1]);\n\t\t\t}\t\n\t\t}\n\n\t\t\n\t\t$this->parameters = $url ? array_values($url):[];\n\t\t// print_r($this->parameters);\n\n\t\tcall_user_func_array([$this->defaultController,$this->defaultMethod],$this->parameters);\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "public function __construct()\n {\n // Prepare the action for execution, leveraging constructor injection.\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public function initialize(array $config)\n {\n $this->Controller = $this->_registry->getController();\n }", "public function init() {\n \n // Instantiate the class\n (new MidrubBaseAdminCollectionFrontendControllers\\Init)->view();\n \n }", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function setUp()\n {\n $this->controller = new Controller;\n }", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->media_values = array(\n\t\t\t101 => Kohana::lang('ui_main.all'),\n\t\t\t102 => Kohana::lang('actionable.actionable'),\n\t\t\t103 => Kohana::lang('actionable.urgent'),\n\t\t\t104 => Kohana::lang('actionable.action_taken')\n\t\t);\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "public function __construct($objController) {\n //Assign Controller for template configuration\n $this->objController = $objController;\n \n //Assign Request Param\n $this->request = $this->objController->getRequest();\n }", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "protected function createController()\n {\n $this->createClass('controller');\n }", "public function __construct()\n {\n // Call the CI_Controller constructor\n parent::__construct();\n }", "public function __construct()\n\t{\n //attach auth middleware to ensure login before accessing this controller\n\t\t$this->middleware('auth');\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "public function __construct()\n\t{ \t\t\n\t\t$this->common = new CommonController();\n\t}", "public function __construct()\n\t{ \t\t\n\t\t$this->common = new CommonController();\n\t}", "public function init() {\n $this->_temporizador = new Trf1_Admin_Timer ();\n $this->_temporizador->Inicio();\n\n /* Initialize action controller here */\n $this->view->titleBrowser = 'e-Sisad';\n }", "public static function init() {\n\t\t$_GET = App::filterGET();\n\t\t\n\t\t// Checken of er params zijn meegegeven\n\t\ttry {\n\t\t\tif (count($_GET) == 0) {\n\t\t\t\t$_GET[0] = '';\n\t\t\t}\n\t\t\t\n\t\t\t// Is de eerste param een controller ? Anders een pageView\n\t\t\tif (self::isController($_GET[0])) {\n\t\t\t\t$controllerName = self::formatAsController($_GET[0]);\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Er is sprake van een pageview\n\t\t\t\t$controllerName = 'PagesController';\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\t\n\t\t\t$action = self::getAction($controller);\n\t\t\t$controller->setAction($action);\n\n\t\t\t// Try to exec the action\n\t\t\ttry {\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(ActionDoesNotExistException $ex) {\n\n\t\t\t\techo $action;\n\t\t\t\t// Action bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidAction');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(MissingArgumentsException $ex) {\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('missingArguments');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\t\n\t\t\t// Try to render the view\n\t\t\ttry {\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\tcatch(ViewDoesNotExistException $ex) {\n\t\t\t\t// View bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidView');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t\t\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(NoValidTemplateException $ex) {\n\t\t\techo 'Invalid template';\n\t\t}\n\t\tcatch(IsNotControllerException $ex) {\n\t\t\techo 'Controller not found';\n\t\t}\n\t}", "public function __construct()\n {\n $this->Kontroller = new Kontroller;\n $this->CurSlug = Url::First();\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "public function __construct($controller) {\n\t\tSettings::getRunTimeObject('MENU_DEBUGGING')->addInfo('constructor for MenuModel');\n\n\t\t$this->controller = $controller;\n\t}", "function initialize(&$controller, $settings = array()) {\n\t\t$this->controller =& $controller; \n\t}", "protected function _init()\n\t{\n\t\t// inicializando controladores auxiliares\n\t\t$this->_initControllers();\n\t\t\n\t\treturn;\n\t}", "public function initializeAction() {\n\n\t}", "public function preInit()\n {\n $this->_viewEngine = Bigace_Services::get()->getService('view');\n }", "public function __construct($controller, $action) {\n parent::__construct($controller, $action); //parent is Controller.php\n }", "function initialize(&$controller, $settings = array()) {\n\t\t$this->controller =& $controller;\n\t}", "function initialize(&$controller, $settings = array()) {\n\t\t$this->controller =& $controller;\n\t}", "function initialize()\n {\n\n // Add CSS file\n $this->addCSS(\"assets/mostviewed.css\");\n\n // Initialize the Twig function\n $this->addTwigFunction('mostviewedget', 'twigMostViewedGet');\n $this->addTwigFunction('mostviewedupdate', 'twigMostViewedUpdate');\n\n // Set the path to match in the controller. \n $path = $this->app['config']->get('general/branding/path') . '/mostviewed';\n\n // Add the controller, so it can be matched.\n $this->app->match($path, array($this, 'controllerMostViewed'));\n\n }", "public function __construct()\n {\n $this->item = app(ItemController::class);\n }", "public function beforeRender()\n {\n $controller = $this->_registry->getController();\n\n $this->addToController($controller);\n }", "public function setUp()\n {\n $this->controllerInfo = new ControllerInfo();\n }", "public function __construct(Cd_Controller_Abstract $controller)\r\n {\r\n $this->_controller = $controller;\r\n $this->_init();\r\n }", "public function initialize(Controller $controller) \r\n\t{\r\n\t\t$this->controller \t\t\t\t\t= $controller;\r\n\t\t$this->controller->request->sufixo \t= $this->sufixo;\r\n\t}", "function initialize(&$controller) {\n $this->controller =& $controller;\n $this->controller->loadModel('Note');\n $this->controller->loadModel('Section');\n }", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }" ]
[ "0.82659256", "0.77988625", "0.77901417", "0.75465727", "0.7446072", "0.74255025", "0.74255025", "0.7413312", "0.740037", "0.73875564", "0.7298748", "0.7298748", "0.7290354", "0.7282338", "0.72164065", "0.70868295", "0.70605636", "0.70519257", "0.7050163", "0.7032363", "0.6989328", "0.6981768", "0.69780266", "0.6927103", "0.68937814", "0.6892301", "0.6887393", "0.6882978", "0.68702376", "0.68574923", "0.68574923", "0.68574923", "0.68457735", "0.68248117", "0.68111944", "0.6801607", "0.67998266", "0.67922056", "0.67869717", "0.6766836", "0.6746734", "0.673674", "0.67082834", "0.66988236", "0.6694754", "0.6687422", "0.6674614", "0.66726327", "0.66715926", "0.6671112", "0.6668503", "0.6666339", "0.6654125", "0.6644403", "0.663711", "0.663111", "0.6610258", "0.661022", "0.6609078", "0.6597737", "0.65861684", "0.65839374", "0.6579932", "0.6579587", "0.6579587", "0.6577713", "0.6575555", "0.6573282", "0.6570081", "0.65660965", "0.6559239", "0.6559239", "0.6559239", "0.6559239", "0.6559239", "0.65582365", "0.65440375", "0.6539845", "0.6527246", "0.6521046", "0.6521046", "0.6516405", "0.6506321", "0.65026057", "0.6500225", "0.6478869", "0.6478283", "0.6477162", "0.6475554", "0.64725316", "0.6457655", "0.64464587", "0.64464587", "0.6444822", "0.64409035", "0.64371884", "0.6436137", "0.6427464", "0.641542", "0.6412281", "0.6406341" ]
0.0
-1
Make it possible to autodetect actions
public function get_index() { $articles = ArticleModel::query() ->viaCache() ->findAll(); // Generate a cache key based on some criteria. // Hey, who said you couldn't use stringified JSONs // as keys for Redis? xD // a possible KEY: // {"criteria_userid":0}::\IngwiePhoenix\UniterMPC\App\Presenter\Articles // ... User-based, server-side cache, period. :) $presenter = ArticlePresenter::checkCache([ "criteria_userid" => App::getUser()->id; ]); if($model->hitCache()) App::$req->setHeader("x-cache","hit"); // Dead simple way of executing a view. // Basically: // - if Content-Type is set in request header, reply with the // requested type, if possible. // - If the requested Content-Type can not be served, serve the // prefered presentation (view). Default would be HTML. // // A post-processing middleware would check weather a DOM has // been returned or not, and insert that into a default view. // If PJAX is being used however, it would also skip that step and // just provide the new HTML, allowing smooth transistions without // having to reload. return $presenter($model); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setup_actions() {}", "protected function getActions() {}", "public function register_actions() {\n\t\t}", "private function actions()\n {\n }", "public function actions();", "protected function getAction() {}", "private function add_actions()\n {\n }", "protected function get_available_actions()\n {\n }", "protected function get_available_actions()\n {\n }", "public function supportsAction($actions);", "public function actions(): array;", "public function checkActions() {\n if (isset($this->request_json->action)) {\n\n if (is_array($this->request_json->action)) {\n $this->request_json->action = array_pop($this->request_json->action);\n }\n $vars = array('data' => (array) $this->request_json);\n $this->hook('action_' . $this->request_json->action, $vars);\n exit;\n }\n }", "abstract public function getAction();", "public function getDefaultAction();", "public function getDefaultAction();", "public function getDefaultAction();", "protected function initializeActionEntries() {}", "public function getAction() {}", "public function getAction() {}", "public function getAction() {}", "public function getAction() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "private function parseActions()\n {\n // default controller actions\n $actions = array_keys($this->getObject()->actions());\n $actionMethods = array_filter($this->reflection->getMethods(),\n function ($method) {\n // should match all methods named actionSomeAction\n return preg_match('/action([A-Z]{1}[a-zA-Z]+)/', $method->name, $matches);\n });\n $actionMethods = array_map(function ($method) {\n return Inflector::slug(str_replace('action', '', $method->name));\n }, $actionMethods);\n $actionMethods = array_merge($actions, $actionMethods);\n\n return array_intersect(['index', 'view', 'create', 'update', 'delete', 'options'], $actionMethods);\n }", "function process_action($target, $action) {\n //implement if needed\n }", "function actions()\n {\n return[];\n }", "function add_actions()\n {\n }", "public function getAction();", "public function getAction();", "public function getAction();", "public function getAction();", "public function getAction();", "public function getAction();", "public function getAction();", "protected function register_internal_actions() {\r\n\t\t$this->register_action( 'registered_actions', array( $this, 'action_registered' ) );\r\n\t\t$this->register_action( 'sync', array( $this, 'action_sync' ) );\r\n\t\t$this->register_action( 'status', array( $this, 'action_status' ) );\r\n\t\t$this->register_action( 'logout', array( $this, 'action_logout' ) );\r\n\t\t$this->register_action( 'activate', array( $this, 'action_activate' ) );\r\n\t\t$this->register_action( 'deactivate', array( $this, 'action_deactivate' ) );\r\n\t\t$this->register_action( 'install', array( $this, 'action_install' ) );\r\n\t\t$this->register_action( 'upgrade', array( $this, 'action_upgrade' ) );\r\n\t\t$this->register_action( 'delete', array( $this, 'action_delete' ) );\r\n\t\t$this->register_action( 'core_upgrade', array( $this, 'action_core_upgrade' ) );\r\n\t\t$this->register_action( 'analytics', array( $this, 'action_analytics' ) );\r\n\t}", "public function getDefaultHasAction()\n {\n return 1;\n }", "public function getDefaultHasAction()\n {\n return 1;\n }", "public function getDefaultHasAction()\n {\n return 1;\n }", "public function refreshActionLookups()\n {\n //\n }", "public function getActions();", "public function getActions();", "private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}", "public function get_actions(): array;", "abstract public function getActionsInstance();", "public function addActions()\n {\n }", "function getAction();", "public function getActions() {\n\n\t}", "public function forceAction($action_name);", "public function\n\t\tdo_actions()\n\t{\n\t}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "function virustotalscan_admin_tools_action_handler(&$actions)\r\n{\r\n\t$actions['virustotalscan'] = array('active' => 'virustotalscan', 'file' => 'virustotalscan');\r\n}", "function action($action, $forwarder = \"\") {\n \n global $CONFIG;\n \n\t $query = parse_url($_SERVER['REQUEST_URI']);\n\t\t\tif (isset($query['query'])) {\n\t\t\t\t$query = $query['query'];\n\t\t\t\t$query = rawurldecode($query);\n\t\t\t\t$query = explode('&',$query);\n\t\t\t\tif (sizeof($query) > 0) {\n\t\t\t\t\tforeach($query as $queryelement) {\n\t\t\t\t\t\t$vals = explode('=',$queryelement);\n\t\t\t\t\t\tif (sizeof($vals) > 1) {\n\t\t\t\t\t\t\tset_input(trim($vals[0]),trim($vals[1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n \n $forwarder = str_replace($CONFIG->url, \"\", $forwarder);\n $forwarder = str_replace(\"http://\", \"\", $forwarder);\n $forwarder = str_replace(\"@\", \"\", $forwarder);\n\n if (substr($forwarder,0,1) == \"/\") {\n $forwarder = substr($forwarder,1);\n }\n \n if (isset($CONFIG->actions[$action])) {\n \tif (\n \t\t(isadminloggedin()) ||\n \t\t(!$CONFIG->actions[$action]['admin'])\n \t) {\n\t if ($CONFIG->actions[$action]['public'] || $_SESSION['id'] != -1) {\n\t \t\n\t \t// Trigger action event TODO: This is only called before the primary action is called. We need to rethink actions for 1.5\n\t \t$event_result = true;\n\t \t$event_result = trigger_plugin_hook('action', $action, null, $event_result);\n\t \t\n\t \t// Include action\n\t \tif ($event_result) // Event_result being false doesn't produce an error - since i assume this will be handled in the hook itself. TODO make this better!\n\t \t{\n\t\t\t if (@include($CONFIG->actions[$action]['file'])) {\n\t\t\t } else {\n\t\t\t register_error(sprintf(elgg_echo('actionundefined'),$action));\n\t\t\t }\n\t \t}\n\t } else {\n\t register_error(elgg_echo('actionloggedout'));\n\t }\n \t}\n } else {\n \tregister_error(sprintf(elgg_echo('actionundefined'),$action));\n }\n forward($CONFIG->url . $forwarder);\n \n }", "abstract function getAction() : string;", "protected function resolveActionMethodName() {}", "public function setExpectedAction($action);", "public function getActionDictionary() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "public function getActions(): array;", "public function addAction() {\r\n\t}", "public function setAction($str);", "protected function executeAction() {\n \n }", "public function action($strAction = \"\") {\r\n if ($strAction == \"\")\r\n $strActionName = $this->getAction();\r\n else\r\n $strActionName = $strAction;\r\n\r\n $this->strOriginalAction = $strActionName;\r\n\r\n if(!$this->checkMethodExistsInConcreteClass(\"action\".ucfirst($strActionName))) {\r\n\r\n foreach(self::$arrActionNameMapping as $strAutoMatchAction => $strAnnotation) {\r\n $this->autoMatchAction($strAutoMatchAction, $strAnnotation, $strActionName);\r\n }\r\n }\r\n\r\n return parent::action($strActionName);\r\n }", "function setAction($action);", "public function discoverAction()\n\t{\n\t\t$resourceEntryPoints = [];\n\t\t$actionMethodNames = static::getPublicActionMethods($this->objectManager);\n\t\t$actionMethodParameters = static::getActionMethodParameters($this->objectManager);\n\t\tforeach ($actionMethodNames as $actionMethodName => $isPublic) {\n\t\t\tif (in_array($actionMethodName, ['discoverAction', 'optionsAction'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$actionName = str_replace('Action', '', $actionMethodName);\n\n\t\t\t$arguments = [];\n\t\t\tif (isset($actionMethodParameters[$actionMethodName][static::$RESOURCE_ARGUMENT_NAME])) {\n\t\t\t\tif ($actionMethodParameters[$actionMethodName][static::$RESOURCE_ARGUMENT_NAME]['optional'] === false) {\n\t\t\t\t\t$arguments = [static::$RESOURCE_ARGUMENT_NAME => ['__identity' => '{identifier}']];\n\t\t\t\t} else {\n\t\t\t\t\t$arguments = [static::$RESOURCE_ARGUMENT_NAME => ['__identity' => '({identifier})']];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Map CRUD actions back to generic URI action\n\t\t\t$uriActionName = in_array($actionName, ['show', 'list', 'create', 'update', 'remove']) ? 'index' : $actionName;\n\t\t\t$actionUri = $this->uriBuilder->setCreateAbsoluteUri($this->useAbsoluteUris)->setFormat($this->request->getFormat())->uriFor($uriActionName, $arguments);\n\t\t\t$actionReflection = new MethodReflection($this, $actionMethodName);\n\n\t\t\t$parameterDescriptions = [];\n\t\t\tif ($actionReflection->isTaggedWith('param')) {\n\t\t\t\tforeach ($actionReflection->getTagValues('param') as $parameterDescription) {\n\t\t\t\t\t$descriptionParts = preg_split('/\\s/', $parameterDescription, 3);\n\t\t\t\t\tif (isset($descriptionParts[2])) {\n\t\t\t\t\t\t$parameterName = ltrim($descriptionParts[1], '$');\n\t\t\t\t\t\t$parameterDescriptions[$parameterName] = $descriptionParts[2];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$parameters = array_map(static function($parameterInfo) {\n\t\t\t\treturn [\n\t\t\t\t\t'required' => !$parameterInfo['optional'],\n\t\t\t\t\t'type' => $this->normalizeResourceTypes ? ResourceTypeHelper::normalize($parameterInfo['type']) : $parameterInfo['type'],\n\t\t\t\t\t'default' => $parameterInfo['defaultValue']\n\t\t\t\t];\n\t\t\t}, $actionMethodParameters[$actionMethodName]);\n\t\t\t// PHPSadness.com: array_walk operates in place\n\t\t\tarray_walk($parameters, static function(&$parameterInfo, $parameterName) use ($parameterDescriptions) {\n\t\t\t\t$parameterInfo['description'] = $parameterDescriptions[$parameterName] ?? '';\n\t\t\t});\n\n\t\t\t$return = '';\n\t\t\tif ($actionReflection->isTaggedWith('return')) {\n\t\t\t\t$returnTags = $actionReflection->getTagValues('return');\n\t\t\t\t$returnParts = preg_split('/\\s/', reset($returnTags), 2);\n\t\t\t\t$return = $returnParts[1] ?? '';\n\t\t\t}\n\t\t\t$resourceEntryPoints[$actionName] = [\n\t\t\t\t'uri' => rawurldecode($actionUri),\n\t\t\t\t'parameters' => $parameters,\n\t\t\t\t'description' => $actionReflection->getDescription(),\n\t\t\t\t'return' => $return,\n\t\t\t];\n\t\t}\n\t\t$this->view->assign('description', $resourceEntryPoints);\n\t\tif ($this->view instanceof JsonView) {\n\t\t\t$this->view->setVariablesToRender(['description']);\n\t\t}\n\t}", "public function actions() {\n\t\trequire_once( WPEX_FRAMEWORK_DIR .'hooks/hooks.php' );\n\t\trequire_once( WPEX_FRAMEWORK_DIR .'hooks/actions.php' );\n\t\trequire_once( WPEX_FRAMEWORK_DIR .'hooks/partials.php' );\n\t}", "protected function initAction()\n {\n }", "public function _doAction();", "public function getAction(): string;", "public function getAction(): string;", "public function addAction() {\n\t}", "public function addAction() {\n\t}", "public function addAction() {\n\t}", "protected function getDefaultAction() {\t\n\t\treturn __DEFAULT_ACTION__;\n\t}", "function erp_process_actions() {\n if ( isset( $_REQUEST['erp-action'] ) ) {\n $action = sanitize_text_field( wp_unslash( $_REQUEST['erp-action'] ) );\n\n do_action( 'erp_action_' .$action, $_REQUEST );\n }\n}", "function detectPostActions()\n {\n $action = management::detectPostActions();\n if (isset($_POST['SaveServiceAdd'])) {\n $action['action'] = \"newServiceSelected\";\n } elseif (isset($_POST['CancelServiceAdd'])) {\n $action['action'] = \"newServiceCancel\";\n } elseif (isset($_POST['SaveService'])) {\n $action['action'] = \"saveService\";\n } elseif (isset($_POST['CancelService'])) {\n $action['action'] = \"cancelService\";\n }\n return $action;\n }", "abstract protected function setMainActionName();", "public static function workflowActions();", "private function setup_actions() {\r\n\t\tadd_action( 'init', array( $this, 'is_edd_activated' ), 1 );\r\n\r\n\t\tadd_filter( 'template_include', array( $this, 'template_loader' ) );\r\n\t\tadd_action( 'init', array( $this, 'endpoints' ) );\r\n\t\t\r\n\t\tdo_action( 'atcf_setup_actions' );\r\n\r\n\t\t$this->load_textdomain();\r\n\t}", "abstract public function getControllerAction();", "public function getFrontEndActions();", "public function actions(){\r\n\r\n if(isset($_GET['action'])){\r\n\r\n switch($_GET['action']){\r\n case 'login':\r\n $this->_login();\r\n break;\r\n case 'logout':\r\n $this->_logout();\r\n break;\r\n case 'get-core-menu':\r\n $this->_getCoreMenu();\r\n break;\r\n case 'page-settings':\r\n $this->_pageSettings();\r\n break;\r\n case 'global-settings':\r\n $this->_globalSettings();\r\n break;\r\n case 'navigation-settings':\r\n $this->_navigationSettings();\r\n break;\r\n case 'save':\r\n $this->_save();\r\n break;\r\n case 'img-upload':\r\n $this->_imgUpload();\r\n break;\r\n case 'img-save':\r\n $this->_imgSave();\r\n break;\r\n case 'img-rotate':\r\n $this->_imgRotate();\r\n break;\r\n }\r\n\r\n }\r\n\r\n }", "protected function callActionMethod() {}", "function defaultAction($args) {\n\t}", "public function action();", "public function hasActions();", "public function getActionName(){ }", "function wp_user_request_action_description($action_name)\n {\n }", "public function willInvokeAction(string $action): void;", "private function setup_actions() {\n\n\t\tadd_action( 'init', array( $this, 'action_init' ) );\n\n\t\tadd_action( 'p2p_init', array( $this, 'action_p2p_init' ) );\n\n\t\tadd_action( 'pre_get_posts', array( $this, 'action_pre_get_posts' ) );\n\n\t\tadd_action( 'add_attachment', array( $this, 'action_add_attachment' ) );\n\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'action_wp_enqueue_scripts' ) );\n\n\t}", "public function action()\n {\n foreach ($this->actions as $action) {\n $action->run();\n }\n }", "private static function allowed_actions() {\n\t\t$key = __CLASS__ . __METHOD__;\n\t\tif ( false == ( $actions = get_transient( $key ) ) ) {\n\t\t\t$dir = trailingslashit( dirname( __FILE__ ) ) . 'actions';\n\t\t\t$files = scandir( $dir );\n\t\t\tforeach ( $files as $file ) {\n\t\t\t\t$path = pathinfo( $file, PATHINFO_EXTENSION );\n\t\t\t\tif ( 'php' == $path ) {\n\t\t\t\t\t$file = str_replace( '.php', '', $file );\n\t\t\t\t\t$actions[] = $file;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tset_transient( $key, $actions, WEEK_IN_SECONDS );\n\n\t\t}\n\n\t\t/**\n\t\t * Filter allowable actions for internal API\n\t\t *\n\t\t * @since 0.1.0\n\t\t *\n\t\t * @param array $actions Actions to allow\n\t\t *\n\t\t * @return array\n\t\t */\n\t\treturn apply_filters( 'ht_dms_internal_api_allowed_actions', $actions );\n\n\t}", "public function allAction() {}" ]
[ "0.73795915", "0.71979535", "0.7106753", "0.70751536", "0.69824517", "0.6900814", "0.68981653", "0.6832109", "0.6832109", "0.683087", "0.6791689", "0.6646353", "0.66417116", "0.66396827", "0.66396827", "0.66396827", "0.6615338", "0.6593973", "0.6593973", "0.6593973", "0.6593973", "0.65814525", "0.65814525", "0.65814525", "0.65814525", "0.65814525", "0.65814525", "0.6559278", "0.64878565", "0.6476082", "0.6470355", "0.6440405", "0.6440405", "0.6440405", "0.6440405", "0.6440405", "0.6440405", "0.6440405", "0.6431724", "0.64146", "0.64146", "0.64146", "0.6412473", "0.639854", "0.639854", "0.6388004", "0.6375791", "0.6325156", "0.63210446", "0.63098186", "0.62992144", "0.6293191", "0.62901163", "0.6262085", "0.6262085", "0.6262085", "0.62601966", "0.6232344", "0.6226334", "0.6224211", "0.62187654", "0.6212897", "0.62101156", "0.620938", "0.62084275", "0.62084275", "0.6200893", "0.61994207", "0.61923313", "0.61732537", "0.617253", "0.61625236", "0.61619496", "0.61500806", "0.6149067", "0.6145876", "0.6142358", "0.6142358", "0.6137618", "0.6137618", "0.6137618", "0.61303616", "0.6128233", "0.6123356", "0.6114965", "0.61061585", "0.6097129", "0.60848254", "0.6076012", "0.6055567", "0.604467", "0.6035309", "0.6022537", "0.60222316", "0.60197127", "0.6013149", "0.60077286", "0.60015196", "0.5998463", "0.5993618", "0.5989077" ]
0.0
-1
We may make this MPC aware of realtime stuff, in which case:
using \IngwiePhoenix\UniterMPC\LiveObject; public function rpcConnect(RPCData $rpcReq) { // Set up connection stuff. // The way that RPC is working, if either via // WebSockets or JSON-RPC or something, should be // managed by other modules and a configuration. // Assuming that I had implemented SocketCluster's // methods, I might actually have this: $sc = $rpcReq->SocketClusterConnection; $this->publishSelf($sc); // A lambda? $sc->on("ping", function($input, $respond){ \JS\console::log("Responding..."); $respond("Thanks for your input: $input"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function tick() \n\t{\n\t\t// Override this for any process that should happen periodically.Will happen at least once\n\t\t// per second, but possibly more often.\n\t}", "abstract protected function isRealTime();", "protected function tick() {\n // per second, but possibly more often.\n }", "public function onTick() {\r\n\r\n }", "public function realtime($params = []);", "public function tick()\n {\n //\n }", "protected function _tick() \n\t{\n\t\t// Core maintenance processes, such as retrying failed messages.\n\t\tforeach ( $this->heldMessages as $key => $hm ) \n\t\t{\n\t\t\t$found = false;\n\n\t\t\tforeach ( $this->users as $currentUser ) \n\t\t\t{\n\t\t\t\tif ( $hm['user']->socket == $currentUser->socket ) \n\t\t\t\t{\n\t\t\t\t\t$found = true;\n\n\t\t\t\t\tif ( $currentUser->handshake ) \n\t\t\t\t\t{\n\t\t\t\t\t\tunset($this->heldMessages[$key]);\n\t\t\t\t\t\t$this->send($currentUser, $hm['message']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !$found ) \n\t\t\t{\n\t\t\t\t// If they're no longer in the list of connected users, drop the message.\n\t\t\t\tunset($this->heldMessages[$key]);\n\t\t\t}\n\t\t}\n\t}", "private function updateOperation() {\n sleep(1);\n }", "public function exec() {\n\t\t$this->stop();\n\t\tswitch ($this->enable) {\n\t\tcase FALSE:\n\t\t\t$this->update(TRUE);\n\t\t\tbreak;\n\t\tcase TRUE:\n\t\t\t$this->update(FALSE);\n\t\t\tusleep($this->delay);\n\t\t\t$this->start();\n\t\t\tbreak;\n\t\t}\n\t}", "function isDispatched() ;", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function onTick($currentTick){ \n }", "public function tick();", "public function notifyObservers() {\n\t\tforeach ( $this->observers as $obs => $key )\n\t\t\t$key->update ( $this->actTemp, $this->maxTemp, $this->minTemp, $this->actPressure );\n\t}", "function enableContinuousBuffer()\r\n {\r\n $this->continuousBuffer = true;\r\n }", "public function isObserved() {}", "public function isPeriodic()\n {\n\n }", "public function afterSyncing() {}", "public function notify() {\n $this->observers->rewind();\n while($this->observers->valid()) {\n $object = $this->observers->current();\n // dump($object);die;\n $object->update($this);\n $this->observers->next();\n }\n }", "function update_start()\n {\n }", "public function poll()\n {\n }", "protected function _syncSubject() {}", "function startRelaying() { }", "public function work() {\n\t\t$this->preLaunch();\n\n\t\t$this->currentTime = new Time($this->lastProcessingTime);\n\n\t\t$ticks = 0;\n\n\t\twhile(1) {\n\t\t\t$this->profileStart();\n\n\t\t\t$this->profile(\"Getting real-time sample\", __FILE__, __LINE__);\n\n\t\t\t// always get the realtime value\n\t\t\t$this->data->getAssetValueForTime(Time::now());\n\n\t\t\t$this->profile(\"Getting sample for running time\", __FILE__, __LINE__);\n\n\t\t\t// get the value we need right now\n\t\t\t$sample = $this->data->getAssetValueForTime($this->currentTime);\n\n\t\t\t$this->profileEndTask();\n\n\t\t\t$hasRun = $this->_process($this->currentTime, $sample);\n\n\t\t\t$this->profileStop();\n\n\t\t\tif ($this->currentTime->isNow() || $this->getShouldNotProcess()) {\n\t\t\t\t// Sleep for 1 second\n\t\t\t\tsleep(1);\n\n\t\t\t\t$ticks += 1;\n\t\t\t} else {\n\t\t\t\t// Sleep for 0.01 seconds\n\t\t\t\tusleep(1000000 * 0.01);\n\n\t\t\t\t$this->currentTime->add(1);\n\n\t\t\t\t$ticks += 0.5;\n\t\t\t}\n\n\t\t\tif ($ticks >= 15)\n\t\t\t{\n\t\t\t\t// This will first save our changes and then load any changed settings or state\n\t\t\t\t$this->data->saveAndReload();\n\n\t\t\t\t$ticks = 0;\n\t\t\t}\n\t\t}\n\t}", "protected function _tick() {\n foreach ($this->heldMessages as $key => $hm) {\n $found = false;\n foreach ($this->users as $currentUser) {\n if ($hm['user']->socket == $currentUser->socket) {\n $found = true;\n if ($currentUser->handshake) {\n unset($this->heldMessages[$key]);\n $this->send($currentUser, $hm['message']);\n }\n }\n }\n if (!$found) {\n // If they're no longer in the list of connected users, drop the message.\n unset($this->heldMessages[$key]);\n }\n }\n }", "protected function _syncTrapped() {}", "public function setSyncTime(): void\n {\n }", "function notify()\n {\n foreach ($this->observers as $obKey => $obValue) {\n $obValue->update($this);\n }\n }", "public function pps_monitor() \r\n { if(!$this->m_connected) return;\r\n \r\n set_time_limit(0);\r\n \r\n \r\n $this->m_buffer = '';\r\n $sockets = $this->get_sockets();;\r\n \r\n /*foreach( $this->servers as $key => $server ){\r\n if( $server->type === SERVER_TYPE_IRC ) {\r\n if( true ) {\r\n echo \"IRC TEST\\n\";\r\n $server->hooked = true;\r\n $server->parse_line(\"]{ing!~art@me65536d0.tmodns.net PRIVMSG #soldat.na :!ls\");\r\n return; \r\n }\r\n echo \"Hook irc\\n\";\r\n if( true )\r\n $sockets[] = $server->sock;\r\n continue;\r\n }\r\n if( !$server->connected ) continue;\r\n echo \"Found available server, hoocking stats\\n\";\r\n $server->stats = new base_stats( $this->db, $this->servers[$key], $this->servers[$key]->get_refreshx());\r\n $this->m_TPC += $server->stats->pc;\r\n $sockets[] = $server->sock;\r\n }*/\r\n\r\n echo \"--> Now monitoring...\\n\";\r\n $this->f_monitor($sockets);\r\n \r\n \r\n echo \"--> Ubnormal Termination => 'connection lost'\\n\\r\";\r\n foreach( $this->servers as $server ){\r\n socket_close($server->sock);\r\n }\r\n $this->m_is_connected = false;\r\n }", "protected function _syncProducer() {}", "function sync() {\n\t\t// TODO\n\t}", "function start()\n\t{\n\t\tif( ! $this->is_running ){\n\t\t\t$this->is_running = TRUE;\n\t\t\t$this->running_since = self::timeMillisecondsAsFloat();\n\t\t}\n\t}", "public function notify()\n\t{\n\t\tforeach ($this->observers as $obs)\n\t\t{\n\t\t\t$obs->update($this);\n\t\t}\n\t}", "function tick();", "function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update($this);\n }\n }", "private function _loop():void\n\t{\n\t\twhile( true )\n\t\t\tif( $this->_status === self::STATUSES['PAUSED'] )\n\t\t\t\tbreak;\n\t\t\telse\n\t\t\tif( $this->_queue )\n\t\t\t\t$this->_step();\n\t\t\telse\n\t\t\tif( $this->_timeout_queue )\n\t\t\t\t$this->_stepTimeout();\n\t\t\telse\n\t\t\t\tbreak;\n\t}", "public function aim_loop()\r\n\t{\r\n\t\twhile ($this->aim_connected()) {\r\n\t\t\techo $this->aim_recv();\r\n\t\t} \r\n\t}", "public function observe() {}", "public function beforeSyncing() {}", "private function cronMinute()\n {\n $timedRecords = $this->app['storage.event_processor.timed'];\n if ($timedRecords->isDuePublish()) {\n $this->notify('Publishing timed records');\n $timedRecords->publishTimedRecords();\n }\n if ($timedRecords->isDueHold()) {\n $this->notify('De-publishing timed records');\n $timedRecords->holdExpiredRecords();\n }\n }", "public function notify() {\n\t\tforeach($this->_observers as $key => $val) {\n\t\t\t$val->update($this);\n\t\t}\n\t}", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "function schedule()\n {\n $this->currentTcb = $this->list;\n while ($this->currentTcb != null) {\n if ($this->currentTcb->isHeldOrSuspended()) {\n $this->currentTcb = $this->currentTcb->link;\n } else {\n $this->currentId = $this->currentTcb->id;\n $this->currentTcb = $this->currentTcb->run();\n }\n }\n }", "public function preUpdate()\n {\n }", "function after_update() {}", "public function isDispatched() {}", "public function isDispatched() {}", "public function notify(){\n foreach ($this->observers as $observer){\n $observer->update();\n }\n }", "public function invoke()\n\t{\n\t\t$channel = $this->instance->getChannel($this->packet->parts[3]);\n\t\t$time = $this->packet->parts[4];\n\t\t\n\t\treturn parent::invoke();\n\t}", "public function notifyObservers()\n {\n foreach ($this->observers as $obj) {\n $obj->update(\n $this->temperature,\n $this->humidity,\n $this->pressure\n );\n }\n }", "function startUpdate()\r\n {\r\n $this->_updatecounter++;\r\n }", "public function loop();", "function refreshTime(){\n\n global $refreshTime;\n getChannel();\n if ((getChannel()[Name] == 'SmartPolitech') || (getChannel()[Name] == 'NoticiasEpcc')){\n $refreshTime = 960;\n }\n return $refreshTime;\n}", "private function respawn()\n {\n // create new event at the end of the queue\n Mage::getModel('marketingsoftware/queue')\n ->setObject($this->currentStatus)\n ->setAction('file_sync')\n ->save();\n }", "public function test_background_updates()\n {\n }", "public function notify()\r\n {\r\n foreach( $this->observers as $observer )\r\n $observer->update( $this );\r\n\r\n }", "public function startBuffering(): void {}", "public function startBuffering(): void {}", "function update_right_now_message()\n {\n }", "function start(){\n\t\t$this->time_start = $this->microtime_float();\n\t}", "abstract protected function update ();", "abstract public function queue($ts = null);", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "function eis_device_simulate($callparam) {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t$timestamp=$eis_dev_status[\"timestamp\"];\n\t$timestep=$eis_dev_status[\"sim_step\"]*60;\n\t// do nothing\n\treturn true;\n}", "public function startPowerUnits() {\n\t\t\n\t}", "private function init()\n {\n // get sync status object\n $this->currentStatus = $this->getObject();\n\n // if sum of last processed ids is then we can assume that we are doing \n // a new sync. So we want to clear old data files so we can make new ones.\n // if ($this->currentStatus->getLastCustomerId() == 0 \n // && $this->currentStatus->getLastOrderId() == 0\n // && $this->currentStatus->getLastSubscriptionId() == 0\n // )\n // Mage::helper('marketingsoftware/DataWriter')->clearDataFiles();\n\n // store start time for this event\n $this->startTime = microtime(true);\n }", "public function tick()\n {\n $this->poloniexWatcher->updateAssetPrices();\n\n $this->binanceWatcher->updateAssetPrices();\n\n $this->bitfinexWatcher->updateAssetPrices();\n\n $this->bittrexWatcher->updateAssetPrices();\n\n $this->coinMarketWatcher->sync();\n }", "public function notify()\n {\n foreach ($this->observers as $value) {\n $value->update($this);\n }\n }", "public function sync();", "public function sync();", "public function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update();\n }\n }", "public function tick()\n {\n $backtrace = debug_backtrace();\n if (isset($backtrace[1])) {\n $what = $backtrace[1]['function'];\n if (isset($backtrace[1]['class'])) {\n $what = $backtrace[1]['class'] . ' ' . $backtrace[1]['function'];\n }\n $message = $what .' ' . $this->memoryUsage();\n $this->log($message);\n }\n\n return;\n }", "abstract protected function needRefresh();", "public function dispatchLoopStartup()\n {\n //...\n }", "abstract function update();", "public function measurementsChanged()\n {\n $this->notifyObservers();\n }", "public function notify() : bool{}", "public function startPowerUnits() {\n\t\techo \"systems are not ready yet\";\n\t}", "public function onRun()\n {\n $this->prepareWallStream();\n }", "public function __sleep()\n\t{\n\t\t$this->_redisMaster = $this->_redisSlave = null;\n\t}", "public function init()\n\t{ \n\t\t# Return if no countoff is needed\n\t\tif ($this->countoff<1) return;\n\t\t\n\t\t# initialize event array\n\t\t$this->events = array();\n\t\t\n\t\tif ($this->initRestTicks) {\n\t\t\t# Add a brief rest and then all notes off and all sound off to relevant channels here\n\t\t\tfor($ix=0; $ix<$this->track_total; $ix++) {\n\t\t\t\t$this->track_ix = $ix;\n\t\t\t\t\n\t\t\t\t# for all channels in this track\n\t\t\t\tforeach($this->channels[$this->track_ix] as $chan) {\n\t\t\t\t\t$this->addEvent(0,176+$chan,123,0);\n\t\t\t\t\t$this->addEvent(0,176+$chan,7,0);\n\t\t\t\t}\n\t\t\t\t$this->addEvent($this->initRestTicks,176+$this->channels[$this->track_ix][0],7,0);\n\t\t\t\t$this->addEvent($this->initRestTicks,176+$this->channels[$this->track_ix][0],7,$this->mVol);\n\t\t\t}\n\t\t}\n\t\t\n\t\t# Put in the initial countoff\n\t\tfor($i=0; $i<$this->timeSig; $i++) { \n\t\t\t$vol = ($i==0) ? 127 : 70;\n\t\t\t$this->addEvent(0,153,37,$vol);\n\t\t\t$this->addEvent($this->ticksPerBeat,153,37,0);\n\t\t}\n\t\t\n\t\t# record where this track starts for looping purposes\n\t\t$this->loopStart[$this->track_ix] = count($this->events[$this->track_ix]);\n\t}", "public static function channelling(): void\n {\n self::$isChannel = true;\n }", "public function checkSignal()\n {\n if($this->current_signal){\n $this->fire($this->current_signal); \n }\n }", "public function measurementsChanged(): void\n {\n $this->notifyObservers();\n }", "function __sleep(){\n\n\t\t}", "function update() {\n\n\t\t\t}", "public function wake()\n {\n }", "public function notify() {}", "public function notify() {}", "public function notify() {}", "public function Play()\n {\n SetValue($this->GetIDForIdent(\"Status\"), 1);\n include_once(__DIR__ . \"/sonos.php\");\n (new PHPSonos($this->ReadPropertyString(\"IPAddress\")))->Play();\n \n }", "public function notifyOne() : bool{}", "function current_signal($offset = 0)\n{\n return XPSPL::instance()->current_signal($offset);\n}", "public function __wakeup()\n\t{\n\t\t// Re-initialize start time on wake-up\n\t\t$this->start_time = $this->microtime_float();\n\t}", "public function notifyObserver()\n {\n if (!empty($this->observers)) {\n foreach ($this->observers as $observer) {\n $observer->update($this->getTemperature(), $this->getPressure(), $this->getHumidity());\n }\n }\n }", "public function notify()\n {\n foreach ($this->_observers as $observer) {\n $observer->update($this);\n }\n }" ]
[ "0.6139315", "0.60454667", "0.5958186", "0.5807002", "0.5569378", "0.5568013", "0.55601364", "0.5463178", "0.54380506", "0.54240733", "0.54112077", "0.54036", "0.53751326", "0.53664595", "0.5351149", "0.53223294", "0.52848625", "0.52802604", "0.5274933", "0.52612275", "0.52574927", "0.52513325", "0.522761", "0.5227026", "0.52192485", "0.5209174", "0.51853985", "0.5175572", "0.5158819", "0.5149679", "0.51426077", "0.51319623", "0.51097494", "0.5098995", "0.508833", "0.5087843", "0.5082272", "0.50731725", "0.5067116", "0.506348", "0.50631523", "0.50531965", "0.50531965", "0.50531965", "0.50531965", "0.5049259", "0.5048997", "0.5042366", "0.50367206", "0.50367206", "0.5026853", "0.5022203", "0.5013693", "0.5007318", "0.4987717", "0.49714378", "0.49684325", "0.49593174", "0.4955101", "0.4952074", "0.4952074", "0.49466783", "0.4934234", "0.49311784", "0.49258325", "0.4922133", "0.4922133", "0.4922133", "0.49188966", "0.4914313", "0.49071807", "0.49028075", "0.4886523", "0.48846498", "0.48846498", "0.48790023", "0.48784098", "0.48743558", "0.4874032", "0.48688415", "0.4867683", "0.4864655", "0.4863115", "0.48567054", "0.48423415", "0.4832051", "0.48282328", "0.48227826", "0.4822444", "0.48216912", "0.4811533", "0.48100317", "0.4806039", "0.4806039", "0.4806039", "0.48055983", "0.4797105", "0.47851804", "0.47722092", "0.47622404", "0.4761828" ]
0.0
-1
Allow params passed by array
function __construct($file, $lock_type = null, $blocking_timeout = null, $stale_lock_timeout = null ) { $args = func_get_args(); if ( count( $args ) == 1 && is_array($args[0]) ) { if ( isset( $args[0]['file'] ) ) $file = $args[0]['file']; if ( isset( $args[0]['lock_type'] ) ) $lock_type = $args[0]['lock_type']; if ( isset( $args[0]['blocking_timeout'] ) ) $blocking_timeout = $args[0]['blocking_timeout']; if ( isset( $args[0]['stale_lock_timeout'] ) ) $stale_lock_timeout = $args[0]['stale_lock_timeout']; if ( isset( $args[0]['lock_extension'] ) ) $this->LOCK_EXTENSION = $args[0]['lock_extension']; } list( $this->file, $this->lock_type, $this->blocking_timeout, $this->stale_lock_timeout ) = array( $file, $lock_type, $blocking_timeout, $stale_lock_timeout ); if ( empty($this->file) ) $this->file = ''; if ( empty($this->lock_type) ) $this->lock_type = 0; if ( empty($this->blocking_timeout) ) $this->blocking_timeout = 0; if ( empty($this->stale_lock_timeout) ) $this->stale_lock_timeout = 0; $this->lock_pid = getmypid(); $this->unlocked = true; ###### Disabled Signals for now ### foreach ($CATCH_SIGS as $signal ) { ### if (!$SIG[$signal] || ### $SIG[$signal] == "DEFAULT") { ### $SIG[$signal] = $graceful_sig; ### } ### } ### force lock_type to be numerical if( $this->lock_type && ! preg_match('/^\d+/', $this->lock_type) && array_key_exists( $this->TYPES[$this->lock_type] ) ){ $this->lock_type = $this->TYPES[$this->lock_type]; } ### need the hostname if ( function_exists('gethostname') ) $this->HOSTNAME = gethostname(); else $this->HOSTNAME = php_uname("n"); if ( empty($this->HOSTNAME) ) $this->HOSTNAME = `hostanme`; # one last try... ### quick usage check if ( strlen($this->file) == 0 ) return trigger_error(($errstr = "Usage: \$f = $class->new('/pathtofile/file',\n" ."'BLOCKING|EXCLUSIVE|NONBLOCKING|SHARED', [blocking_timeout, stale_lock_timeout]);\n" ."(You passed \"$this->file\" and \"$this->lock_type\")"), E_USER_ERROR); if ( empty( $this->lock_type ) && preg_match('/^\d+$/', $this->lock_type, $m) ) return trigger_error(($errstr = "Unrecognized lock_type operation setting [$this->lock_type]"), E_USER_ERROR); ### choose a random filename $this->rand_file = $this->rand_file( $this->file ); ### choose the lock filename $this->lock_file = $this->file . $this->LOCK_EXTENSION; $quit_time = ( ( ! empty( $this->blocking_timeout ) && ( ($this->lock_type & NFS_LOCK_NB) == 0) ) ? ( time() + $this->blocking_timeout ) : 0 ); ### remove an old lockfile if it is older than the stale_timeout if( file_exists($this->lock_file) && $this->stale_lock_timeout > 0 && time() - filemtime($this->lock_file) > $this->stale_lock_timeout ){ unlink( $this->lock_file ); } while (true) { ### open the temporary file if ( ! $this->create_magic() ) return false; if ( ( $this->lock_type & NFS_LOCK_EX ) != 0 ) { if ( $this->do_lock() ) break; } else if ( ( $this->lock_type & NFS_LOCK_SH ) != 0 ) { if ( $this->do_lock_shared() ) break; } else { $errstr = "Unknown lock_type [$this->lock_type]"; return false; } ### Lock failed! ### I know this may be a race condition, but it's okay. It is just a ### stab in the dark to possibly find long dead processes. ### If lock exists and is readable, see who is mooching on the lock clearstatcache(); if ( file_exists($this->lock_file) ) { @$_FH = fopen($this->lock_file,'r+'); if ( $_FH !== false ) { $mine = array(); $them = array(); $dead = array(); @$stat = stat($this->lock_file); $has_lock_exclusive = (($stat[2] & $this->SHARE_BIT) == 0) ? true : false; $try_lock_exclusive = (($this->lock_type & NFS_LOCK_SH) == 0 ) ? true : false; $buffer = ''; while ( ( $read = fread($_FH, 4096) ) || strlen($buffer) != 0 ) { if ( $read !== false ) $buffer .= $read; if ( strpos( $buffer, "\n") === false && $read !== false ) continue; # skip until we have a full line, or EOF $lines = explode("\n", $buffer); $buffer = ( $read !== false ) ? array_pop($lines) : ''; foreach ( $lines as $line ) { # replacement for : "while(defined($line=<_FH>)" if (preg_match('/^\Q'. $this->HOSTNAME .'\E (\d+) /', $line, $m)) { $pid = $m[1]; if ($pid == getmypid()) { # This is me. array_push( $mine, $line ); }else if(posix_kill( $pid, 0 ) ) { # Still running on this host. array_push( $them, $line ); }else{ # Finished running on this host. array_push( $dead, $line ); } } else { # Running on another host, so array_push( $them, $line ); # assume it is still running. } } if ( $read === false && strlen($buffer) == 0 ) break; # save an fread() } ### If there was at least one stale lock discovered... if (! empty( $dead ) ) { # Lock lock_file to avoid a race condition. $lock = new File_NFSLock( array( 'file' => $this->lock_file, 'lock_type' => NFS_LOCK_EX, 'blocking_timeout' => 62, 'stale_lock_timeout' => 60, 'lock_extension' => '.shared', )); ### Rescan in case lock contents were modified between time stale lock ### was discovered and lockfile lock was acquired. fseek($_FH, 0, SEEK_CUR); $content = ''; $buffer = ''; while ( ( $read = fread($_FH, 4096) ) || strlen($buffer) != 0 ) { if ( $read !== false ) $buffer .= $read; if ( strpos( $buffer, "\n") === false && $read !== false ) continue; # skip until we have a full line, or EOF $lines = explode("\n", $buffer); $buffer = ( $read !== false ) ? array_pop($lines) : ''; foreach ( $lines as $line ) { # replacement for : "while(defined($line=<_FH>)" if (preg_match('/^\Q'. $this->HOSTNAME .'\E (\d+) /', $line, $m)) { $pid = $m[1]; if (!posix_kill( $pid, 0)) continue; # Skip dead locks from this host } $content .= $line; # Save valid locks } if ( $read === false && strlen($buffer) == 0 ) break; # save an fread() } ### Save any valid locks or wipe file. if( strlen($content) != 0 ){ fseek( $_FH, 0, SEEK_SET); fwrite( $_FH, $content); ftruncate( $_FH, strlen($content)); fclose( $_FH); }else{ fclose( $_FH); unlink( $this->lock_file ); } ### No "dead" or stale locks found. } else { fclose( $_FH ); } ### If attempting to acquire the same type of lock ### that it is already locked with, and I've already ### locked it myself, then it is safe to lock again. ### Just kick out successfully without really locking. ### Assumes locks will be released in the reverse ### order from how they were established. if ($try_lock_exclusive == $has_lock_exclusive && $mine){ $this->lock_success = true; return true; } } } ### If non-blocking, then kick out now. ### ($errstr might already be set to the reason.) if ( ( $this->lock_type & NFS_LOCK_NB ) != 0 ) { if ( empty($errstr) ) $errstr = "NONBLOCKING lock failed!"; return false; } ### wait a moment sleep(1); ### but don't wait past the time out if( ! empty( $quit_time ) && (time() > $quit_time) ){ $errstr = "Timed out waiting for blocking lock"; return false; } # BLOCKING Lock, So Keep Trying } ### clear up the NFS cache $this->uncache(); ### Yes, the lock has been aquired. $this->unlocked = false; $this->lock_success = true; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function params( $array ) {\n\t\t$this->params_list = $array;\n\t\t}", "function params(array $data);", "function set_allowed_uri_params_list()\r\n{\r\n //allowed params disabled. All allowed\r\n//\tif ($ar_params = func_get_args())\r\n//\t{\r\n//\t\tglobal $tpl_allowed_uri_params_list;\r\n//\r\n//\t\tif (is_array($tpl_allowed_uri_params_list))\r\n//\t\t{\r\n//\t\t\tforeach ($ar_params as $val)\r\n//\t\t\t{\r\n//\t\t\t\t$tpl_allowed_uri_params_list[] = $val;\r\n//\t\t\t}\r\n//\t\t}\r\n//\t\telse\r\n//\t\t{\r\n//\t\t\t$tpl_allowed_uri_params_list = $ar_params;\r\n//\t\t}\r\n//\t}\r\n}", "public static function validateParameters(array $params) {\n $allowed = self::ALLOWED_PARAMETERS;\n $prepared = [];\n foreach($params as $key => $value) {\n if(in_array($key, $allowed)) {\n $prepared[$key] = $value;\n }\n }\n return $prepared;\n }", "public function allowedParams(): array\n {\n return [\n 'title',\n 'year'\n ];\n }", "public function setParams(array $params){\n \tif(is_array($params)){\n $this->_params = $this->filterParams($params);\n \treturn $this->_params;\n \t}\n\n }", "public function params(): array;", "function allowed_get_params($allowed_params = []){\r\n //$allowed_array will contain only allowed url parameters\r\n $allowed_array = [];\r\n foreach($allowed_params as $param){\r\n if(isset($_GET[$param])){\r\n $allowed_array[$param] = $_GET[$param];\r\n }else{\r\n $allowed_array[$param] = NULL;\r\n }\r\n }\r\n return $allowed_array;\r\n\r\n}", "private function setParams(array $params) : array\n {\n if (count($params) === 1) {\n array_unshift($params, 'is');\n }\n\n return $params;\n }", "public function setParams(array $params);", "public function setParams(array $params);", "public function setParams(array $params);", "private function is_param_array($param){\n\t\tif(!is_array($param)){\n\t\t\t$this->text(\"Invalid parameter, cannot reply with appropriate message\");\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "public static function requireParamsArray() {\n\t\tswitch($_SERVER['REQUEST_METHOD']) {\n\t\t\tcase 'GET': $parameters = $_GET; break;\n\t\t\tcase 'POST': $parameters = $_POST; break;\n\t\t\tcase 'PUT':\n\t\t\tcase 'DELETE': $parameters = static::getInputVars(); break;\n\t\t}\n\n\t\t$params = func_get_args();\n\t\t$a = array();\n\t\tforeach ($params as $param) {\n\t\t\tif (!isset($parameters[$param])) {\n\t\t\t\tif (Application::inDevelopment()) {\n\t\t\t\t\t$passedParams = implode(',', array_keys($parameters));\n\t\t\t\t\tLog::debug(\"Missing {$_SERVER['REQUEST_METHOD']} parameter '{$param}', only got \" . (strlen($passedParams) > 0 ? $passedParams : '[nothing]'));\n\t\t\t\t}\n\t\t\t\tApplication::error(400, 'Missing one of the parameters');\n\t\t\t}\n\n\t\t\t$a[$param] = $parameters[$param];\n\t\t}\n\n\t\treturn $a;\n\t}", "function params(array $params) {\n\t\t$this->_params = $params;\n\t}", "private function checkParams($params){\n\n if(count($params) == 3)\n return true;\n else\n return false;\n }", "protected function _setInputParams(Array &$params) {\n\t\tforeach ($params as $paramKey => $paramValue) {\n\t\t\tif (\n\t\t\t\tin_array($paramKey, $this->args, true) &&\n\t\t\t\t!is_null($paramValue)\n\t\t\t) {\n\t\t\t\t$this->inputParams[$paramKey] = $paramValue;\n\t\t\t}\n\t\t}\n\n\t\t$this->params = array_merge($this->params, $this->inputParams);\n\t}", "public function getArrayParameters(): array;", "function insertParamArray($array) {\n\t\tforeach ($array as $key => $param) {\n\t\t\t$name = $param['name'];\n\t\t\t$value = $param['value'];\n\t\t\t$type = $param['type'];\n\n\t\t\t$this->insertParam($name, $value, $type);\n\t\t}\n\t}", "public function params($array, $params, $respondImmediately = true) {\n $errors = false;\n $pulled = [];\n foreach ($params as $param) {\n $val = idx($array, $param, NULL);\n if (is_null($val) || empty(trim($val))) {\n $errors[] = \"Missing parameter $param.\";\n } else {\n $pulled[$param] = $val;\n }\n }\n if ($errors) {\n foreach ($errors as $e) {\n $this->error($e, false);\n }\n if ($respondImmediately) {\n $this->respond();\n }\n }\n return $pulled;\n }", "public function setParameters(array $params)\n {\n $this->params = array_filter($params);\n $this->processFilters();\n }", "public function getParams() :array;", "public function setParameter(array $arr){\r\n $this->_parametros = $arr;\r\n\t\t// $this->_parametros = array_merge($this->_parametros, $arr);\r\n }", "public function params()\n\t{\n\t\t$r = array();\n\t\tforeach (func_get_args() as $name)\n\t\t\t$r[] = @$this->params[$name];\n\t\treturn $r;\n\t}", "public function setParams(array $params){\n\t\t$this->params = $params;\n\t}", "public function test_getTransactionParamsArray(){\n $this->assertNull($this->transaction->getTransactionParamsArray());\n\n //Now set an arbitrary param\n $paramsArray = ['test'=>'test'];\n $this->transaction->setParams($paramsArray);\n $this->assertNotNull($this->transaction->getTransactionParamsArray());\n $this->assertSame($paramsArray, $this->transaction->getTransactionParamsArray());\n }", "private function validateParams(array $params): bool {\n if (isset($params['id']) && (isset($params['site']))) {\n return true;\n }\n return false;\n }", "public function addParams($data) {\n\t\tif (!is_array($data)) {\n\t\t\tthrow new \\InvalidArgumentException(\"Array required, got: \" . gettype($data));\n\t\t}\n\t\tforeach ($data as $key => $value) {\n\t\t\t$this->params[$key] = (string)$value;\n\t\t}\n\t}", "public function params($params) {\n if(is_array($params)) return $params;\n $result = array();\n foreach(explode('|', $params) as $param) {\n $pos = strpos($param, ':');\n $result[trim(substr($param, 0, $pos))] = trim(substr($param, $pos+1));\n }\n return $result;\n }", "function _cleanup_input_params($params = array()) {\n\t\tif (empty($params)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (is_numeric($params)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Allows params as comma-separated pairs (\"active = 1, `group` = 2\")\n\t\t// Allowed symbols: \"=\" \"!=\" \">\" \"<\"\n\t\tif (is_string($params)) {\n\t\t\t$_tmp = array();\n\t\t\tforeach (explode(\",\", $params) as $item) {\n\t\t\t\t$k = \"\";\n\t\t\t\t$v = \"\";\n\t\t\t\tif (false !== strpos($item, \"=\")) {\n\t\t\t\t\tlist($k, $v) = explode(\"=\", $item);\n\t\t\t\t}\n\t\t\t\t$k = trim($k);\n\t\t\t\t$v = trim($v);\n\t\t\t\tif (!strlen($k)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$_tmp[$k] = $v;\n\t\t\t}\n\t\t\t$params = array(\"WHERE\" => $_tmp);\n\t\t}\n\t\tif (!is_array($params)) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ((array)$params as $sql_param => $sql_value) {\n\t\t\t// Check values\n\t\t\tif (is_array($sql_value)) {\n\t\t\t\tforeach ((array)$sql_value as $k => $v) {\n\t\t\t\t\tif (empty($k)) {\n\t\t\t\t\t\tif (isset($params[$sql_param][$k])) {\n\t\t\t\t\t\t\tunset($params[$sql_param][$k]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif (is_string($sql_value) || is_numeric($sql_value) || is_float($sql_value)) {\n\t\t\t\t// nothing yet\n\t\t\t}\n\t\t\t$sql_value = $params[$sql_param];\n\t\t\tif (empty($sql_param) || !in_array($sql_param, $this->_allowed_sql_params) || empty($sql_value)) {\n\t\t\t\tunset($params[$sql_param]);\n\t\t\t}\n\t\t}\n\t\tif (!$params[\"LIMIT\"] && !$params[\"OFFSET\"] && $params[\"LIMIT\"] != -1) {\n\t\t\t$params[\"LIMIT\"]\t= $this->DEF_RECORDS_LIMIT;\n\t\t\t$params[\"OFFSET\"]\t= 0;\n\t\t}\n\t\treturn $params;\n\t}", "function setParams($param_array) {\n\t\tif ( count($param_array) > 0 ) {\n\t\t\t// read the existing component value(s)\n\t\t\t$db = JFactory::getDbo();\n\t\t\t$db->setQuery('SELECT params FROM #__extensions WHERE name = \"com_mapyandex\"');\n\t\t\t$params = json_decode( $db->loadResult(), true );\n\t\t\t// add the new variable(s) to the existing one(s)\n\t\t\tforeach ( $param_array as $name => $value ) {\n\t\t\t\t$params[ (string) $name ] = (string) $value;\n\t\t\t}\n\t\t\t// store the combined new and existing values back as a JSON string\n\t\t\t$paramsString = json_encode( $params );\n\t\t\t$db->setQuery('UPDATE #__extensions SET params = ' .\n\t\t\t\t$db->quote( $paramsString ) .\n\t\t\t\t' WHERE name = \"com_mapyandex\"' );\n\t\t\t\t$db->query();\n\t\t}\n\t}", "public function setParams(array $params) :void;", "public function getParams(): array;", "public function bindParams(array $params);", "public function setParams(array $params): void;", "function cp_check_param($array, $mandatory_keys, $optional_keys = array()){\r\n $array = array_keys($array);\r\n if (count(array_diff($mandatory_keys, $array)) > 0){\r\n return false;\r\n }\r\n if (count(array_diff($array, array_merge($mandatory_keys,$optional_keys))) > 0){\r\n return false;\r\n }\r\n \r\n return true;\r\n}", "public function actionParamsWithArray($param1, $param2 = 'test', array $data = [])\n {\n echo \"param1 - $param1\\n\\rparam2 - $param2\\n\\r\";\n if ($data) {\n echo \"data:\\n\\r\";\n foreach ($data as $k => $v) {\n echo \"key - $k, value - $v\\n\\r\";\n }\n }\n }", "abstract protected function requiredArguments(): array;", "public function __construct($params)\n {\n if(is_array($params)){\n $this->params = $params;\n }\n }", "public function setParams(array $params) {\n\t\t$this->params = $params;\n\t}", "abstract public function sanatizeParameters(array $params);", "function setParams($param_array) {\n $db = JFactory::getDbo();\n \n \n if ( count($param_array) > 0 ) {\n // read the existing component value(s)\n $db = JFactory::getDbo();\n $db->setQuery('SELECT params FROM #__extensions WHERE name = \"joomleague\"');\n $params = json_decode( $db->loadResult(), true );\n // add the new variable(s) to the existing one(s)\n foreach ( $param_array as $name => $value ) {\n $params[ (string) $name ] = (string) $value;\n }\n // store the combined new and existing values back as a JSON string\n $paramsString = json_encode( $params );\n $db->setQuery('UPDATE #__extensions SET params = ' .\n $db->quote( $paramsString ) .\n ' WHERE name = \"joomleague\"' );\n $db->query();\n }\n \n }", "public function setParams(array $params)\n {\n $this->params = $params;\n }", "public function setParams(array $params)\n {\n $this->params = $params;\n }", "public function getInvalidParamsDynamic()\n {\n $fiber = new \\Fiber\\Fiber();\n return $fiber->get(\"!array\");\n }", "public function setParameters(array $params)\n\t {\n\t \t foreach ($params as $key => $value)\n\t \t {\n\t \t\tswitch ($key)\n\t \t\t{\n\t \t\t\tcase \"identification\":\n\t \t\t\t\tforeach($value as $key => $value) {\n\t \t\t\t\t\t// validate section fields name\n\t \t\t\t\t\tif(!array_key_exists($key, $this->json['params']['identification'])) {\n\t \t\t\t\t\t\tthrow new InvalidArgumentException(\"$key is not valid for identification section\");\n\t \t\t\t\t\t}\n\t \t\t\t\t\t// if referenceId parameter is not set in the constructor\n\t \t\t\t\t\tif('' === $this->json['params']['identification']['referenceid'])\n\t \t\t\t\t\t\t$this->json['params']['identification'][$key] = $value; \n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tdefault:\n\t \t\t\t\tthrow new OutOfBoundsException(\"You should set predefined parameter group!\");\n\t \t\t}\n\t \t }\t \t \n\t }", "public function setParams(array $params)\n\t{\n\t\t$this->params = $params;\n\t}", "public function ids( array $params = array() );", "public function check_meta_is_array($value, $request, $param)\n {\n }", "protected function clean_params($params)\n\t{\n\t\tif(!self::$blacklist) return $params;\n\n\t\tforeach ($params as $key => $value) {\n\t\t\tif(preg_match(\"/(\" . implode(\")|(\", self::$blacklist) . \")/i\", $key)) {\n\t\t\t\t$params[$key] = '[FILTERED]';\n\t\t\t}else if(is_array($value)){\n\t\t\t\t$params[$key] = $this->clean_params($value);\n\t\t\t}\n\t\t}\n\n\t\treturn $params;\n\t}", "public function setParameters(array $params)\n {\n $this->params = $params;\n }", "protected function filterParams()\n {\n }", "public function prepareRequest(&$params) {\n $attributeas = (array) $this->getParams();\n foreach ($attributeas as $key => $value) {\n $params[$key] = $value;\n }\n return true;\n }", "private static function prepareParamsArray($params)\n {\n if (is_array($params[0])) $params = $params[0];\n if (is_string($params)) $params = explode(',', $params);\n\n return $params;\n }", "function _checkParams($controller){\n \tif (empty($controller->params['named'])){\n \t\t$filter = array();\n \t}\n \t\n App::import('Sanitize');\n $sanit = new Sanitize();\n $controller->params['named'] = $sanit->clean($controller->params['named']);\n\n \n \tforeach($controller->params['named'] as $field => $value){\n \t\t\n \t\tif(!in_array($field, $this->paginatorParams)){\n\t\t\t\t$fields = explode('.',$field);\n\t\t\t\tif (sizeof($fields) == 1)\n\t \t\t\t$filter[$controller->modelClass][$field] = $value;\n\t \t\telse\n\t \t\t\t$filter[$fields[0]][$fields[1]] = $value; \t\t\t\n \t\t}\n \t}\n \t\t\n \tif (!empty($filter))\n \t\treturn $filter;\n \telse\n \t\treturn array(); \t\n }", "final protected function _setParameters(array $params)\n\t{\n\t\tforeach ($params as $key => $value) {\n\t\t\t$this->setParameter($key, $value);\n\t\t}\n\t}", "private function _setParams($params)\n {\n $this->_params = array();\n foreach ($params as $paramKey => $paramValue) {\n $this->_params[$paramKey] = $paramValue;\n }\n }", "function required_params()\n {\n $params = func_get_args();\n foreach ($params as $value) {\n if (is_array($value)) {\n if (empty($value)) {\n return false;\n }\n } else {\n if ($value === null || strlen(trim($value)) == 0) {\n return false;\n }\n }\n }\n\n return true;\n }", "public function setParams($params);", "public function setParams($params);", "function e(array $a = [1, 2, 3, 4], $b = \"hi\") {}", "static function vox_prep_args($params){\n\n\t\tif(!is_array($params) ) {\n\t\t\t$prep = array();\n\t\t\t$prep['label'] = $params;\n\t\t}\n\n\t\treturn $prep;\n\t}", "public function setParams(array $params)\n {\n $this->_params = $params;\n }", "public function parameters(): array;", "public function setParameters(array $params)\n\t {\n\t \tforeach ($params as $key => $value)\n\t \t{\n\t \t\tswitch ($key)\n\t \t\t{\n\t \t\t\tcase $this->identification: // section\n\t \t\t\t\tforeach($value as $key => $value) {\n\t \t\t\t\t\t// validate section fields name\n\t \t\t\t\t\tif(!array_key_exists($key, $this->json['params']['identification'])) {\n\t \t\t\t\t\t\tthrow new InvalidArgumentException(\"$key is not valid for identification section.\");\n\t \t\t\t\t\t}\n\t \t\t\t\t\t$this->json['params']['identification'][$key] = $value;\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\t\t \n\t \t\t\tcase $this->payment:\n\t \t\t\t\tforeach($value as $key => $value) {\n\t \t\t\t\t\t// validate section fields name\n\t \t\t\t\t\tif(!array_key_exists($key, $this->json['params']['payment'])) {\n\t \t\t\t\t\t\tthrow new InvalidArgumentException(\"$key is not valid for payment section\");\n\t \t\t\t\t\t}\n\t \t\t\t\t\t$this->validate($key, $value); // validator for field values\n\t \t\n\t \t\t\t\t\t$this->json['params']['payment'][$key] = $value;\n\t \t\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\t\t \n\t \t\t\tcase $this->account:\n\t \t\t\t\tforeach ($value as $key => $value) {\n\t \t\t\t\t\t// validate section fields name\n\t \t\t\t\t\tif(!array_key_exists($key, $this->json['params']['account'])) {\n\t \t\t\t\t\t\tthrow new InvalidArgumentException(\"$key is not valid for account section\");\n\t \t\t\t\t\t}\n\t \t\t\t\t\t$this->validate($key, $value); // validator for field values\n\t \t\n\t \t\t\t\t\t$this->json['params']['account'][$key] = $value;\n\t \t\t\t\t}\n\t \t\t\t\t \n\t \t\t\t\tbreak;\n\t \t\t\t\t \n\t \t\t\tcase $this->frontend:\n\t \t\t\t\tforeach ($value as $key => $value) {\n\t \t\t\t\t\t// validate section field name\n\t \t\t\t\t\tif(!array_key_exists($key, $this->json['params']['frontend'])) {\n\t \t\t\t\t\t\tthrow new InvalidArgumentException(\"$key is not valid for frontend section\");\n\t \t\t\t\t\t}\n\t \t\t\t\t//\t$this->validate($key, $value);\n\t \t\n\t \t\t\t\t\t$this->json['params']['frontend'][$key] = $value;\n\t \t\t\t\t}\n\t \t\t\t\t \n\t \t\t\t\tbreak;\n\t \t\t\t\t \n\t \t\t\tcase $this->customer:\n\t \t\t\t\tforeach ($value as $key => $value) {\n\t \t\t\t\t\t// validate section fields name\n\t \t\t\t\t\tif(!array_key_exists($key, $this->json['params']['customer'])) {\n\t \t\t\t\t\t\tthrow new InvalidArgumentException(\"$key is not valid for customer section\");\n\t \t\t\t\t\t}\n\t \t\t\t\t\tforeach($value as $k => $v) {\n\t \t\t\t\t\t\t// validate sub-section fields name\n\t \t\t\t\t\t\tif(!array_key_exists($k, $this->json['params']['customer'][$key])) {\n\t \t\t\t\t\t\t\tthrow new InvalidArgumentException(\"$k is not valid for $key sub-section of customer section\");\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\t$this->json['params'][$this->customer][$key][$k] = $v;\n\t \t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\t\t \n\t \t\t\tcase $this->merchant:\n\t \t\t\t\tforeach($value as $key => $value) {\n\t \t\t\t\t\t$this->json['params'][$this->merchant][$key] = $value;\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\t\t \n\t \t\t\tdefault:\n\t \t\t\t\tthrow new OutOfBoundsException(\"You should set predefined parameter group!\");\n\t \t\t}\n\t \t}\t \t \n\t }", "private function checkParameters(array $params)\n {\n $required_params = [\n 'class',\n 'action',\n 'url',\n ];\n\n foreach ($required_params as $required) {\n if (isset($params[$required]) === false) {\n throw new RoutingException();\n }\n }\n }", "public static function fix_array_params($params) {\n $badparams = array();\n $newparams = array();\n foreach ($params as $name => $param) {\n if (is_array($param)) {\n $badparams[] = $name;\n foreach ($param as $key => $value) {\n $fullname = $name . '[' . $key . ']';\n $newparams[$fullname] = $value;\n }\n }\n }\n foreach ($badparams as $name) {\n unset($params[$name]);\n }\n $params = array_merge($params, $newparams);\n return $params;\n }", "public function isAllowed(array $params = array())\n {\n return false;\n }", "public function setParams(array $params)\n\t{\n\t\t$this->_params = array_merge($this->_params, $params);\n\t}", "private function setParams()\n\t\t{\n\t\t\t/**\n\t\t\t* Remove do $this->_separetor os dois primeiros valores\n\t\t\t* referentes ao controller e action, deixando os demais valores\n\t\t\t* que serão usados para formarem os parametros, indices e valores\n\t\t\t*/\n\t\t\tunset($this->_separetor[1], $this->_separetor[2]);\n\t\t\t\n\t\t\t/**\n\t\t\t* Caso o ultimo item do $this->_separetor seja vazio\n\t\t\t* o mesmo é removido\n\t\t\t*/\n\t\t\tif ( end($this->_separetor) == null ) {\n\t\t\t\tarray_pop($this->_separetor);\n\t\t\t}\n\n\t\t\t\n\t\t\t/**\n\t\t\t* Se a $this->_separetor estivar vazia,\n\t\t\t* então os parametros serão definidos como vazios\n\t\t\t*/\n\t\t\tif ( !empty($this->_separetor) ) {\n\t\t\t\t/**\n\t\t\t\t* Percorre o array $this->_separetor, verificando os indices\n\t\t\t\t* se for impar, então seu valor será o indice do parametro.\n\t\t\t\t* Se for par, seu valor será o valor do paremetro\n\t\t\t\t*/\n\t\t\t\tforeach ($this->_separetor as $key => $value) {\n\t\t\t\t\tif ($key % 2 == 0) {\n\t\t\t\t\t\t$param_value[] = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$param_indice[] = $value;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$param_value = array();\n\t\t\t\t$param_indice = array();\n\t\t\t}\n\n\n\t\t\t/**\n\t\t\t* Verifica se os indices e valores dos parametros\n\t\t\t* não são vazios e possuem a mesma quantidade\n\t\t\t* Então vaz um \"array_combine\" para juntar os dois arrays\n\t\t\t* formando um indice->valor para o parametro\n\t\t\t*/\n\t\t\tif ( !empty($param_indice) \n\t\t\t\t&& !empty($param_value)\n\t\t\t\t&& count($param_indice)\n\t\t\t\t== count($param_value)\n\t\t\t) {\n\t\t\t\t$this->_params = array_combine($param_indice, $param_value);\n\t\t\t} else {\n\t\t\t\t$this->_params = array();\n\t\t\t}\n\t\t}", "function afo_browsenav2_params_alter(array $params, array $change) {\n\n\t$parameter_schema = afo_browsenav2_parameter_schema();\n\n\tswitch($change['op']) {\n\t\n\t\tcase 'add':\n\t\t\t// check if field array exists\n\t\t\tif(is_array($params[$change['field']])) {\n\t\t\t\t\n\t\t\t\t// check if field allows multiple values\n\t\t\t\tif($parameter_schema[$change['field']]['multiple']) {\n\n\t\t\t\t\t// check that value is not in field array\n\t\t\t\t\tif(!in_array($change['value'], $params[$change['field']])) {\t\n\t\t\t\t\t\t// add value to field array\n\t\t\t\t\t\t$params[$change['field']][] = $change['value'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// replace value with new one\n\t\t\t\t\t$params[$change['field']] = array($change['value']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// field array doesn't exist\n\t\t\telse {\n\t\t\t\t// create field array with value\n\t\t\t\t$params[$change['field']] = array($change['value']);\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\t\n\t\tcase 'remove':\n\t\t\t// check if field array exists\n\t\t\tif(is_array($params[$change['field']])) {\n\t\t\t\t\n\t\t\t\t// check if value is in field array\n\t\t\t\tif(in_array($change['value'], $params[$change['field']])) {\n\t\t\t\t\n\t\t\t\t\t// run through array and unset any matching values\n\t\t\t\t\tforeach($params[$change['field']] as $key => $val) {\n\t\t\t\t\t\tif($val == $change['value']) {\n\t\t\t\t\n\t\t\t\t\t\t\t// remove value form field array\n\t\t\t\t\t\t\tunset($params[$change['field']][$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\n\t\t\tbreak;\n\t\n\t}\n\n\treturn $params;\n}", "function __param($array, $name, $default, $integer = false, $posted = false)\n{\n if ((!isset($array[$name])) || ($array[$name] === false) || (($integer) && ($array[$name] === ''))) {\n if ($default !== false) {\n return $default;\n }\n\n require_code('failure');\n improperly_filled_in($name, $posted, $array);\n }\n\n $val = $array[$name];\n if (is_array($val)) {\n $val = trim(implode(',', $val), ' ,');\n }\n\n static $mq = null;\n if ($mq === null) {\n $mq = get_magic_quotes_gpc();\n }\n if ($mq) {\n $val = stripslashes($val);\n }\n\n return $val;\n}", "abstract public function processParameters ($params);", "function setValues($list) {\n global $params;\n if ( count($list )) {\n foreach ($list as $k => $v ) {\n $params[$k] = $v;\n }\n }\n}", "public function __construct(array $params = []);", "function getParams($input) {\n $allowedFields = ['post_id', 'user_name', 'content'];\n $filterParams = [];\n foreach($input as $param => $value){\n if(in_array($param, $allowedFields)){\n $filterParams[] = \"$param=:$param\";\n }\n }\n return implode(\", \", $filterParams);\n}", "public function validArrayForArrayConfigurationProvider() {}", "function prepare_parameters($orig_params, $add_params) {\n if(!$orig_params || !is_array($orig_params)) {\n $orig_params = array();\n }\n\n if($add_params && is_array($add_params)) {\n foreach ($add_params as $key => &$val) {\n $orig_params[$key] = $val;\n }\n }\n\n return $orig_params;\n}", "public function _clean_by_params($params = [])\n {\n }", "function fpg_process_array($action, $params_list) {\n\t$fce_name = \"fpg_$action\";\n\tif (function_exists($fce_name)) {\n\t\tforeach ($params_list as $name => $params) {\n if (!isset($params['return']))\n $params['return'] = reset($params['params']);\n\t\t\t$params['empty_function'] = isset($params['empty_function']) && $params['empty_function'];\n\t\t\t$params['empty_test'] = isset($params['empty_test']) && $params['empty_test'];\n\t\t\t$params['has_setter'] = !isset($params['only_getter']) || !$params['only_getter'];\n\t\t\t$params['has_getter'] = !isset($params['only_setter']) || !$params['only_setter'];\n\t\t\t$fce_name($name, $params);\n\t\t}\n\t}\n\telse {\n\t\tfprintf(STDERR, \"Argument $action is not a valid action\\n\");\n\t}\n}", "function getParams($params, $aExclude) {\r\n $i = 0;\r\n if (!is_array($params))\r\n return FALSE;;\r\n //\r\n // Excluding keys\r\n foreach ($params as $k => $v) {\r\n if (in_array($k, $aExclude)) {\r\n unset($params[$k]);\r\n }\r\n }\r\n //\r\n // Order the data\r\n foreach ($params as $key => $value) {\r\n switch ($key) {\r\n case 'to':\r\n $this->to = $value;\r\n break;\r\n case 'cc':\r\n $this->cc = $value;\r\n break;\r\n case 'bcc':\r\n $this->bcc = $value;\r\n break;\r\n case 'subject':\r\n $this->subject = $value;\r\n break;\r\n case 'from':\r\n $this->from = $value;\r\n break;\r\n case 'submit':\r\n NULL;\r\n break;\r\n default:\r\n $this->body[$i][\"key\"] = str_replace(\"_\", \" \", ucWords(strToLower($key)));\r\n $this->body[$i++][\"value\"] = $value;\r\n }\r\n }\r\n }", "public function setRequestParams($params = array())\r\n \t{\r\n \t\t$this->_requestParams = array();\r\n \t\tif (!is_array($params))\r\n \t\t{\r\n \t\t\treturn false;\r\n \t\t}\r\n\r\n \t\t$this->_requestParams = $params;\r\n \t\treturn true;\r\n \t}", "function checkQueryParams($param_array){\n\t$cnt = 0;\n\tfor($i=0; $i < count($param_array); $i++){\n\t\tif(isset($_GET[$param_array[$i]])){\n\t\t\t$params_set[$param_array[$i]] = $_GET[$param_array[$i]];\n\t\t\t$cnt++;\n\t\t}\n\t\t$params_set[\"cnt\"] = $cnt;\n\t}\n\treturn $params_set;\n}", "private function checkParams( $real, $sent ) {\n\t\t$new = array();\n\n\t\t$is_obj = is_object( $sent );\n\t\t$is_assoc = is_array( $sent ) && jsonrpc2::isAssoc( $sent );\n\n\t\t// check every parameter\n\t\tforeach ( $real as $i => $param ) {\n\t\t\t$name = $param->getName();\n\t\t\tif ( $is_obj && isset( $sent->{$name} ) ) {\n\t\t\t\t$new[$i] = $sent->{$name};\n\t\t\t} elseif ( $is_assoc && $sent[$name] ) {\n\t\t\t\t$new[$i] = $sent[$name];\n\t\t\t} elseif ( isset( $sent[$i] ) ) {\n\t\t\t\t$new[$i] = $sent[$i];\n\t\t\t} elseif ( !$param->isOptional() ) {\n\t\t\t\tthrow new Exception( -32602 );\n\t\t\t}\n\t\t}\n\n\t\t// return the list of matching params\n\t\treturn $new;\n\t}", "public function addParams(array $params)\n {\n foreach ($params as $key => $value) {\n $this->_params[$key] = $value;\n }\n }", "public function test_array_returns_true_when_optional_and_input_array() {\n\t\t$optional = true;\n\n\t\t$result = self::$validator->validate( array('test','test2'), $optional );\n\t\t$this->assertTrue( $result );\n\t}", "public function test_array_returns_true_when_not_optional_and_input_array() {\n\t\t$optional = false;\n\n\t\t$result = self::$validator->validate( array('test','test2'), $optional );\n\t\t$this->assertTrue( $result );\n\t}", "public function setParams($params = null)\n {\n self::clearParams();\n if($params && is_array($params)){\n foreach($params as $key => $value){\n if(!$key || trim($key) == ''){\n continue;\n }\n\n $this->params[$key] = $value;\n }\n }\n }", "function paramify(array $array, $valueItem=null, $delimiter=\"&\", $hiddenKeyRegex=null) {\r\n\t$params = array();\r\n\tforeach ($array as $key=>$value) {\r\n\t\tif (isset($hiddenKeyRegex) && preg_match($hiddenKeyRegex, $key)) {\r\n\t\t\t$value = \"{HIDDEN}\";\r\n\t\t} else if (is_array($value)) {\r\n\t\t\t$value = $value[$valueItem];\r\n\t\t} else if (is_object($value)) {\r\n\t\t\t$value = $value->{$valueItem};\r\n\t\t}\r\n\t\t$params[] = \"{$key}=\" . json_encode($value);\r\n\t}\r\n\treturn implode($delimiter, $params);\r\n}", "public function validateArguments() {}", "public function getParamsListToInject(): array\n {\n return [\n 'sectionTitle',\n 'sectionSubtitle',\n 'tiles'\n ];\n }", "function convArrayForSanitizing($src, &$array)\n{\n $array = array();\n foreach ($src as $key => $val) {\n if (key_exists($key, $_GET)) {\n array_push($array, sprintf(\"%s=%s\", $key, $val));\n }\n }\n}", "private function paramsCheck(array $params)\n {\n foreach ($params as $key => $value) {\n if (true === empty($value)) {\n $caller = debug_backtrace();\n throw new \\Exception('Empty or invalid parameters passed to ' . $caller[count($caller)-1]['function'] . ' function. Argument list received: ' . var_export($caller[count($caller)-1]['args'], true));\n }\n }\n \n return true;\n }", "public function getAllowedParams() {\n return array(\n 'id' => array (\n ApiBase::PARAM_TYPE => 'integer',\n ApiBase::PARAM_REQUIRED => true\n ),\n 'comment'=>array(\n ApiBase::PARAM_TYPE => 'text',\n ApiBase::PARAM_REQUIRED => true\n )\n );\n }", "protected function CheckTokenRequestParams(array $_params)\r\n\t{\r\n\t\treturn $_params;\r\n\t}", "private function createParam()\n\t{\n\t\t$this->param = Array('http' => Array(), 'url' => null);\n\t}", "public function setAllowableFormat($array_allowable_ext)\n {\n if ($array_allowable_ext == '*') {\n $this->allowable_ext = '*';\n return;\n }\n\n if (is_array($array_allowable_ext)) {\n $this->allowable_ext = $array_allowable_ext;\n } else {\n echo 'setAllowableFormat method error : The argument for must be an array';\n return;\n }\n }", "function checkFormParams($param_array){\n\t$cnt = 0;\n\tfor($i=0; $i < count($param_array); $i++){\n\t\tif(isset($_POST[$param_array[$i]])){\n\t\t\t$params_set[$param_array[$i]] = $_POST[$param_array[$i]];\n\t\t\t$cnt++;\n\t\t}\n\t\t$params_set[\"cnt\"] = $cnt;\n\t}\n\treturn $params_set;\n}", "function setPageParams($param) {\n\t//echo \"gelen\"; var_dump($param);\n\tif(is_array($param) && count($param)>0) {\n\t\tforeach($param as $key=>$value) {\n\t\t\t$_REQUEST[$key] = $value; \n\t\t}\n\t}\n\treturn true;\n}", "protected function CheckAuthRequestParams(array $_params)\r\n\t{\r\n\t\treturn $_params;\r\n\t}", "protected function validateParameters($params) {\n return true;\n }" ]
[ "0.7074934", "0.68416196", "0.6566634", "0.6520771", "0.64712787", "0.64630014", "0.6458937", "0.64380413", "0.64364517", "0.6427527", "0.6427527", "0.6427527", "0.6359281", "0.6307601", "0.62613857", "0.6247159", "0.6231713", "0.6207651", "0.6160057", "0.6148732", "0.6117627", "0.6087519", "0.6072638", "0.60154325", "0.60149556", "0.5988498", "0.5985348", "0.5983729", "0.59608907", "0.5952862", "0.59441364", "0.59235793", "0.5921677", "0.5892563", "0.5872394", "0.586744", "0.5864983", "0.5855684", "0.584895", "0.58357006", "0.5834078", "0.5827832", "0.5814668", "0.5814668", "0.5812498", "0.5808761", "0.5804435", "0.5781381", "0.578097", "0.5771187", "0.57581174", "0.5752027", "0.5749415", "0.5747196", "0.5745591", "0.57446516", "0.5741552", "0.5724082", "0.5723618", "0.5723618", "0.57185906", "0.5709635", "0.5705402", "0.57038045", "0.5699905", "0.5699737", "0.56995386", "0.56960005", "0.5664744", "0.56601", "0.5658948", "0.56521654", "0.565012", "0.56466407", "0.56367487", "0.5634091", "0.5631924", "0.5629237", "0.5624935", "0.56221056", "0.56186193", "0.5617109", "0.56161016", "0.561602", "0.5611881", "0.56117773", "0.56035286", "0.5593451", "0.558575", "0.5584559", "0.55724245", "0.5566701", "0.5561322", "0.55269545", "0.5522846", "0.55224055", "0.5510446", "0.55043703", "0.5503292", "0.5497874", "0.5486002" ]
0.0
-1
concepts for these routines were taken from Mail__Box which took the concepts from Mail__Folder
function rand_file($file) { return "$file.tmp.". time()%10000 .'.'. getmypid() .'.'. floor(rand(0,10000)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mail_fetch_folderact($args) {\n include_once (SM_PATH . 'plugins/mail_fetch/functions.php');\n mail_fetch_folderact_function($args);\n}", "function email_my_folders($folderid, $courseid, $myfolders, $space) {\n\n\t$space .= '&#160;&#160;&#160;';\n\n\t$folders = email_get_subfolders($folderid, $courseid);\n\tif ( $folders ) {\n\t\tforeach ( $folders as $folder ) {\n\t\t\t$myfolders[$folder->id] = $space.$folder->name;\n\t\t\t$myfolders = email_my_folders($folder->id, $courseid, $myfolders, $space);\n\t\t}\n\t}\n\n\treturn $myfolders;\n\n}", "function email_create_parents_folders($userid) {\n\n\t$folders = new stdClass();\n\t$folder = new stdClass();\n\n\t$folder->timecreated = time();\n\t$folder->userid\t = $userid;\n\t$folder->name\t\t = addslashes(get_string('inbox', 'block_email_list'));\n\t$folder->isparenttype = EMAIL_INBOX; // Be careful if you change this field\n\n\t/// $folders is an object who contain id's of created folders\n\n\t// Insert inbox if no exist\n\tif ( count_records('email_folder', 'userid', $userid, 'isparenttype', EMAIL_INBOX) == 0 ) {\n\t\tif (! $folders->inboxid = insert_record('email_folder', $folder)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Insert draft if no exist\n\t$folder->name\t\t = addslashes(get_string('draft', 'block_email_list'));\n\t$folder->isparenttype = EMAIL_DRAFT; // Be careful if you change this field\n\n\tif ( count_records('email_folder', 'userid', $userid, 'isparenttype', EMAIL_DRAFT) == 0 ) {\n\t\tif (! $folders->trashid = insert_record('email_folder', $folder)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Insert sendbox if no exits\n\t$folder->name\t\t = addslashes(get_string('sendbox', 'block_email_list'));\n\t$folder->isparenttype = EMAIL_SENDBOX; // Be careful if you change this field\n\n\tif ( count_records('email_folder', 'userid', $userid, 'isparenttype', EMAIL_SENDBOX) == 0 ) {\n\t\tif (! $folders->sendboxid = insert_record('email_folder', $folder)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Insert trash if no exits\n\t$folder->name\t\t = addslashes(get_string('trash', 'block_email_list'));\n\t$folder->isparenttype = EMAIL_TRASH; // Be careful if you change this field\n\n\tif ( count_records('email_folder', 'userid', $userid, 'isparenttype', EMAIL_TRASH) == 0) {\n\t\tif (! $folders->trashid = insert_record('email_folder', $folder)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn $folders;\n}", "function email_print_movefolder_button($options) {\n\n\tglobal $CFG, $USER;\n\n\t$courseid = NULL;\n\tif ( $options->id == SITEID and $options->course != SITEID) {\n\t\t$courseid = $options->course;\n\t} else {\n\t\t$courseid = $options->id;\n\t}\n\n\t/// TODO: Changed this function, now cases are had:\n\t//\t\t\t\t\t\t1.- Inbox folder: Only can move to subfolders inbox and trash folder.\n\t//\t\t\t\t\t\t2.- Sendbox and draft folder: Only can move on this subfolders.\n\t//\t\t\t\t\t\t3.- Trash folder: Can move any folder\n\tif ( isset($options->folderid) ) {\n\t\t// Get folder\n\t\t$folderbe = email_get_folder($options->folderid);\n\n\t} else if ( isset($options->folderoldid) ) {\n\t\t// Get folder\n\t\t$folderbe = email_get_folder($options->folderoldid);\n\t} else {\n\t\t// Inbox folder\n\t\t$folderbe = email_get_root_folder($USER->id, EMAIL_INBOX);\n\t}\n\n\tif ( email_isfolder_type($folderbe, EMAIL_SENDBOX ) ) {\n\t\t// Get my sendbox folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, true, false, true );\n\t} else if ( email_isfolder_type($folderbe, EMAIL_DRAFT )) {\n\t\t// Get my sendbox folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, true, true, true );\n\t} else if ( email_isfolder_type($folderbe, EMAIL_TRASH ) ) {\n\t\t// Get my folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, false, false, false );\n\t} else {\n\t\t// Get my folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, true, true, false );\n\t}\n\n\tif ( $folders ) {\n\n\t\t$choose = '';\n\n\t\t// Get my courses\n\t\tforeach ($folders as $key => $foldername) {\n\n\t $choose .= '<option value=\"'.$key.'\">'.$foldername .'</option>';\n\t\t}\n\t}\n\n\techo '<select name=\"folderid\" onchange=\"addAction(this)\">\n\t\t\t\t\t<option value=\"\" selected=\"selected\">' . get_string('movetofolder', 'block_email_list') . ':</option>' .\n \t\t\t$choose . '\n \t\t</select>';\n\n\n\t// Add 2 space\n\techo '&#160;&#160;';\n\n\t// Change, now folderoldid is actual folderid\n\tif (! $options->folderid ) {\n\t\tif ( $inbox = email_get_root_folder($USER->id, EMAIL_INBOX) ) {\n\t\t\techo '<input type=\"hidden\" name=\"folderoldid\" value=\"'.$inbox->id.'\" />';\n\t\t}\n\t} else {\n\t\techo '<input type=\"hidden\" name=\"folderoldid\" value=\"'.$options->folderid.'\" />';\n\t}\n\n\t// Define action\n\t//echo '<input type=\"hidden\" name=\"action\" value=\"move2folder\" />';\n\t// Add javascript for insert person/s who I've send mail\n\n\t$javascript = '<script type=\"text/javascript\" language=\"JavaScript\">\n <!--\n \t\tfunction addAction(form) {\n\n \t\t\tvar d = document.createElement(\"div\");\n d.setAttribute(\"id\", \"action\");\n var act = document.createElement(\"input\");\n act.setAttribute(\"type\", \"hidden\");\n act.setAttribute(\"name\", \"action\");\n act.setAttribute(\"id\", \"action\");\n act.setAttribute(\"value\", \"move2folder\");\n d.appendChild(act);\n document.getElementById(\"move2folder\").appendChild(d);\n\n \t\t\tdocument.sendmail.submit();\n \t\t}\n \t-->\n </script>';\n\n\techo $javascript;\n\n\t// Print sent button\n\t//echo '<input type=\"submit\" value=\"' .get_string('move'). '\" onclick=\"javascript:addAction(this);\" />';\n\n\t//echo '</div>';\n}", "function email_get_reference2foldermail($mailid, $folderid) {\n\treturn get_record('email_foldermail', 'mailid', $mailid, 'folderid', $folderid);\n\n}", "function email_newfolderform() {\n\n\tinclude_once('folder.php');\n\n\treturn true;\n}", "function email_get_root_folder($userid, $folder) {\n\n\tglobal $USER;\n\n\tif ( empty($userid) ) {\n\t\t$userid = $USER->id;\n\t}\n\n\temail_create_parents_folders($userid);\n\n\t$rootfolder = new object();\n\n\tif ( $userid > 0 and !empty($userid) ) {\n\t\tif ( $folder == EMAIL_INBOX ) {\n\t\t\t$rootfolder = get_record('email_folder', 'userid', $userid, 'isparenttype', EMAIL_INBOX);\n\t\t\t$rootfolder->name = get_string('inbox', 'block_email_list');\n\t\t\treturn $rootfolder;\n\t\t}\n\n\t\tif ( $folder == EMAIL_SENDBOX ) {\n\t\t\t$rootfolder = get_record('email_folder', 'userid', $userid, 'isparenttype', EMAIL_SENDBOX);\n\t\t\t$rootfolder->name = get_string('sendbox', 'block_email_list');\n\t\t\treturn $rootfolder;\n\t\t}\n\n\t\tif ( $folder == EMAIL_TRASH ) {\n\t\t\t$rootfolder = get_record('email_folder', 'userid', $userid, 'isparenttype', EMAIL_TRASH);\n\t\t\t$rootfolder->name = get_string('trash', 'block_email_list');\n\t\t\treturn $rootfolder;\n\t\t}\n\n\t\tif ( $folder == EMAIL_DRAFT ) {\n\t\t\t$rootfolder = get_record('email_folder', 'userid', $userid, 'isparenttype', EMAIL_DRAFT);\n\t\t\t$rootfolder->name = get_string('draft', 'block_email_list');\n\t\t\treturn $rootfolder;\n\t\t}\n\t}\n\n\treturn $rootfolder;\n\n}", "private function _list_messages($folders = null, $page = null, $sort_field = null, $sort_order = null, $slice = 0, $search_str = NULL) {\n\n if (!is_array($folders) || count($folders) == 0) {\n /*\n * no mailboxes supplied!\n */\n return FALSE;\n }\n\n /*\n * map mailboxes ID\n */\n $mailboxes = array();\n foreach ($folders as $folder_name) {\n\n /*\n * Retrieve mailbox ID\n */\n $mail_box_idnr = $this->get_mail_box_id($folder_name);\n if (!$mail_box_idnr) {\n // Not found - Skip!\n return FALSE;\n }\n\n /*\n * ACLs check ('lookup' and 'read' grants required )\n */\n $ACLs = $this->_get_acl(NULL, $mail_box_idnr);\n if (!is_array($ACLs) || !in_array(self::ACL_LOOKUP_FLAG, $ACLs) || !in_array(self::ACL_READ_FLAG, $ACLs)) {\n // Unauthorized - Skip!\n return FALSE;\n }\n\n /*\n * Add mailbox ID to mailboxes list\n */\n $mailboxes[$mail_box_idnr] = $folder_name;\n }\n\n /*\n * no mailboxes available\n */\n if (count($mailboxes) == 0) {\n return FALSE;\n }\n\n /*\n * Validate sort order (use default when not supplied)\n */\n if (strtoupper($sort_order) != 'DESC') {\n $sort_order = 'ASC';\n }\n\n /*\n * Set query offset / limit\n */\n $page = ((int) $page > 0 ? (int) $page : $this->list_page);\n $query_offset = ($page > 0 ? (($page - 1) * $this->page_size) : 0);\n $query_limit = $this->page_size;\n\n /**\n * \n * if $slice > 0 \n * only the messages moved are extracted\n * \n */\n if ($slice && (int) $slice > 0) {\n $query_offset = $query_offset + $query_limit - $slice;\n $query_limit = $slice;\n }\n\n /**\n * Return entries \n */\n if ($this->get_threading()) {\n return $this->_get_threaded_messages($mailboxes, $search_str, $sort_field, $sort_order, $query_offset, $query_limit);\n } else {\n return $this->_get_listed_messages($mailboxes, $search_str, $sort_field, $sort_order, $query_offset, $query_limit);\n }\n }", "function email_get_my_folders($userid, $courseid, $excludetrash, $excludedraft, $excludesendbox=false, $excludeinbox=false) {\n\n\t// Save my folders in this variable\n\t$myfolders = array();\n\n\t// Get especific root folders\n\t$folders = email_get_root_folders($userid, !$excludedraft, !$excludetrash, !$excludesendbox, !$excludeinbox);\n\n\t// for every root folder\n\tforeach ( $folders as $folder ) {\n\n\t\t$myfolders[$folder->id] = $folder->name;\n\t\t$myfolders = email_my_folders($folder->id, $courseid, $myfolders, '&#160;&#160;&#160;');\n\t}\n\n\treturn $myfolders;\n}", "function create_mailbox($db_array,$form_array,$path) {\n\techo \"<div align='center'>\";\n\tif (preg_match(\"/^([a-z0-9]{1}[a-z0-9\\.+_-]{1,18}[a-z0-9]{1})$/i\",$form_array[\"Boxname\"])) {\n\t\t$dbhandler=\"\";\n\t\topen_db($dbhandler,$db_array);\n\t\t$boxname = $form_array[\"Boxname\"];\n\t\t$creationdate = time();\n\t\t$query = $dbhandler->query(\"SELECT * FROM `mailboxlist` WHERE boxname='\".$boxname.\"'\");\t\n\t\tif (mysqli_num_rows($query)==0){\n\t\t\tmysqli_query($dbhandler,\"INSERT INTO `mailboxlist`(`boxname`, `destination`, `duration`, `comment`) VALUES ('\".$form_array['Boxname'].\"','\".$form_array['Destination'].\"','\".$_POST['ttl'].\"','\".$form_array['Comment'].\"')\");\n\t\t\t$boxname = str_replace(\".\",\":\",$boxname); # replace all dots with colons for qmail handling\n\t\t\techo $GLOBALS[\"text_create_file\"].\": \".$path.\".qmail-\".$boxname.\"<br />\";\n\t\t\t$filehandler = fopen($path.\".qmail-\".$boxname, \"w+\");\n\t\t\t# Create a new Mailbox-File\n\t\t\tfwrite($filehandler, $form_array['Destination']); # Writes the destination-address into the file\n\t\t\techo $GLOBALS[\"text_box_created\"];\n\t\t}\n\t\telse { echo $GLOBALS[\"text_box_exists\"]; }\n\t\tmysqli_close ($dbhandler);\n\t}\n\telse { echo $GLOBALS[\"text_invalid_boxname\"].\": \".$form_array[\"Boxname\"];}\n\techo \"</div>\";\n}", "function email_print_subfolders($subfolders, $userid, $courseid, $foredit=false, $admin=false) {\n\n\tglobal $CFG;\n\n\t$numbermails = 0;\n $unreaded = '';\n\n\t// String for alt of img\n\t$strremove = get_string('removefolder', 'block_email_list');\n\n\techo '<ul>';\n\n\t$subrow = 0;\n\tforeach ( $subfolders as $subfolder ) {\n\n\t\tunset($numbermails);\n\t\tunset($unreaded);\n\t\t// Get number of unreaded mails\n\t\t$numbermails = email_count_unreaded_mails($userid, $courseid, $subfolder->id);\n\t\tif ( $numbermails > 0 ) {\n\t\t\t$unreaded = '('.$numbermails.')';\n\t\t} else {\n\t\t\t$unreaded = '';\n\t\t}\n\n\t\techo '<li class=\"r'. $subrow .'\">';\n\n\t\t// If edit folder...\n\t\tif ( $foredit ) {\n\n\t\t\techo'<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/folder.php?course='.$courseid.'&amp;id='.$subfolder->id.'&amp;action='.md5('edit').'\">'.$subfolder->name.'</a>';\n\t\t\techo '&#160;&#160;<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/folder.php?course='.$courseid.'&amp;id='.$subfolder->id.'&amp;action='.md5('edit').'\"><img src=\"'.$CFG->pixpath.'/t/edit.gif\" alt=\"'.$strremove.'\" /></a>';\n\t\t\techo '&#160;&#160;<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/folder.php?course='.$courseid.'&amp;id='.$subfolder->id.'&amp;action='.md5('remove').'\"><img src=\"'.$CFG->pixpath.'/t/delete.gif\" alt=\"'.$strremove.'\" /></a>';\n\n\t\t} else {\n \techo '<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/index.php?id='.$courseid.'&amp;folderid='.$subfolder->id.'\">'.$subfolder->name.$unreaded.'</a>';\n\t\t}\n\n // Now, print all subfolders it\n\t\t$subfoldersrecursive = email_get_subfolders($subfolder->id, NULL, $admin);\n\n\t\t// Print recursive all this subfolders\n\t\tif ( $subfoldersrecursive ) {\n\t\t\temail_print_subfolders($subfoldersrecursive, $userid, $courseid, $foredit, $admin);\n\t\t}\n\n echo '</li>';\n $subrow = $subrow ? 0:1;\n\t}\n\n\techo '</ul>';\n}", "public function save_message($folder, &$message, $headers = '', $is_file = false, $flags = array(), $date = null) {\n\n /*\n\n Function general outline\n\n 1 Find folder - function db_find_create_mailbox\n 2 Create physical message (Dedup??) - function insert_physmessage\n 3 Create (logical) message (step == 0) - function _message_insert\n 4 Update USER Quota (step == 1) - function _update_message\n 5 Save message parts (step == 2) - function dm_message_store\n 6 Update headers cache (step == 3) - function dbmail_message_cache_headers\n 7 Update envelope cache - function dbmail_message_cache_envelope\n 8 Update reference field\n\n */\n\n if (!$this->dbmail->startTransaction()) {\n return FALSE;\n }\n\n /*\n * 1 Find folder\n */\n $mailbox_idnr = $this->get_mail_box_id($folder);\n if (!$mailbox_idnr) {\n // not found\n return FALSE;\n }\n\n // ACLs check ('insert' grant required )\n $ACLs = $this->_get_acl($folder);\n if (!is_array($ACLs) || !in_array(self::ACL_INSERT_FLAG, $ACLs)) {\n // Unauthorized!\n return FALSE;\n }\n\n /*\n * 2 Create physical message\n */\n $query = \"INSERT INTO dbmail_physmessage \"\n . \" ( \"\n . \" messagesize, \"\n . \" rfcsize, \"\n . \" internal_date \"\n . \" ) \"\n . \" VALUES \"\n . \" ( \"\n . \" '{$this->dbmail->escape(strlen($message))}', \"\n . \" '{$this->dbmail->escape(strlen($message))}', \"\n . \" NOW() \"\n . \" ) \";\n\n if (!$this->dbmail->query($query)) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n // Retrieve inserted ID\n $physmessage_id = $this->dbmail->insert_id('dbmail_physmessage');\n if (!$physmessage_id) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n /*\n * 3 Create (logical) message\n */\n $query = \"INSERT INTO dbmail_messages \"\n . \" ( \"\n . \" mailbox_idnr, \"\n . \" physmessage_id, \"\n . \" seen_flag, \"\n . \" unique_id, \"\n . \" status \"\n . \" ) \"\n . \" VALUES \"\n . \" (\"\n . \" '{$this->dbmail->escape($mailbox_idnr)}', \"\n . \" '{$this->dbmail->escape($physmessage_id)}', \"\n . \" 1, \"\n . \" '{$this->dbmail->escape($this->create_message_unique_id())}', \"\n . \" '{$this->dbmail->escape(self::MESSAGE_STATUS_SEEN)}' \"\n . \" )\";\n\n if (!$this->dbmail->query($query)) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n // Retrieve inserted ID\n $message_idnr = $this->dbmail->insert_id('dbmail_messages');\n if (!$message_idnr) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n /*\n * 4 Update USER Quota\n */\n if (!$this->increment_user_quota($this->user_idnr, strlen($message))) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n // create Mail_mimeDecode obj\n $mime_decoded = $this->decode_raw_message($message, FALSE);\n if (!$mime_decoded) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n /*\n * 5 Save message parts\n */\n\n // store main mail headers (retrieve real message headers instead of using Mail_mimeDecode content which are lowercased!!!!)\n $real_headers = $this->extract_raw_headers_from_message($message);\n if (!$this->_part_insert($physmessage_id, $real_headers, 1, 1, 0, 0)) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n // store mime parts\n $part_key = 1; ## this must be in a variable because it's passed by reference\n if (!$this->store_mime_object($physmessage_id, $mime_decoded, $part_key, 0, 1)) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n /*\n * 6 Update headers cache\n */\n\n // set raw headers string and store searchable header name /value pairs\n $raw_headers = '';\n foreach ($mime_decoded->headers as $header_name => $header_value) {\n $raw_headers .= $header_name . $this->get_header_delimiter($header_name) . $header_value . \"\\n\";\n }\n\n // filter saved headers and save them\n $saved_headers = $this->get_saved_headers($mime_decoded->headers, $raw_headers);\n foreach ($saved_headers as $header_name => $header_value) {\n\n if (!$this->save_header($physmessage_id, $header_name, $header_value)) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n }\n\n /*\n * 7 Update envelope cache \n */\n $envelope_headers = $this->get_mail_envelope_headers($raw_headers);\n if (!$this->save_mail_envelope_headers($physmessage_id, $envelope_headers)) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n // increment folder and message 'seq' flag\n if (!$this->increment_mailbox_seq($mailbox_idnr, $message_idnr)) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n return ($this->dbmail->endTransaction() ? $message_idnr : FALSE);\n }", "function mail_move_msg($msg,$tofolder) {\n\t\t$tofolder = $this->fix_prefix($tofolder,1);\n\t\tif($this->mail_protocol == \"imap\") {\n\n\t\t\tif($tofolder != $msg[\"folder\"]) {\n\t\t\t\t/* check the message id to make sure that the messages still in the server */\n\t\t\t\tif($this->_current_folder != $msg[\"folder\"])\n\t\t\t\t\t$boxinfo = $this->mail_select_box($msg[\"folder\"]);\n\t\t\n\t\t\t\t$this->mail_send_command(\"FETCH \".$msg[\"id\"].\":\".$msg[\"id\"].\" BODY.PEEK[HEADER.FIELDS (Message-Id)]\".$this->CRLF);\n\t\t\t\t$buffer = chop($this->mail_get_line());\n\t\n\t\t\t\t/* if any problem with the server, stop the function */\n\t\t\t\tif(preg_match(\"/^(\".$this->_sid.\" (NO|BAD))/i\",$buffer)) { $this->mail_error_msg = $buffer; return 0; }\n\t\n\t\t\t\twhile(!preg_match(\"/^(\".$this->_sid.\" OK)/i\",$buffer)) {\n\t\t\t\t\t/* we need only the message id yet */\n\t\n\t\t\t\t\tif(preg_match(\"/message-id: (.*)/i\",$buffer,$regs))\n\t\t\t\t\t\t$current_id = preg_replace(\"/<(.*)>/\",\"\\\\1\",$regs[1]);\n\t\n\t\t\t\t\t$buffer = chop($this->mail_get_line());\n\t\t\t\t}\n\n\t\t\t\t/* compare the old and the new message id, if different, stop*/\n\t\t\t\tif(base64_encode($current_id) != base64_encode($msg[\"message-id\"])) {\n\t\t\t\t\t$this->mail_error_msg = $error_retrieving;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\t$tofolder = $this->fix_prefix($tofolder,1);\n\t\t\t\t\n\t\t\t\t$this->mail_send_command(\"COPY \".$msg[\"id\"].\":\".$msg[\"id\"].\" \\\"$tofolder\\\"\".$this->CRLF);\n\t\t\t\t$buffer = $this->mail_get_line();\n\n\t\t\t\t/* if any problem with the server, stop the function */\n\t\t\t\tif(!preg_match(\"/^(\".$this->_sid.\" OK)/i\",$buffer)) { $this->mail_error_msg = $buffer; return 0; }\n\n\t\t\t\tif(file_exists($msg[\"localname\"])) {\n\t\t\t\t\t$currentname = $msg[\"localname\"];\n\t\t\t\t\t$basename = basename($currentname);\n\t\t\t\t\t$newfilename = $this->user_folder.\"$tofolder/$basename\";\n\t\t\t\t\tcopy($currentname,$newfilename);\n\t\t\t\t\tunlink($currentname);\n\t\t\t\t}\n\t\t\t\t$this->mail_set_flag($msg,\"\\\\DELETED\",\"+\");\n\t\t\t\t$this->_require_expunge = true;\n\t\t\t}\n\n\t\t\treturn 1;\n\n\t\t} else {\n\n\t\t\tif($tofolder != $this->_sysmap[\"inbox\"] && $tofolder != $msg[\"folder\"]) {\n\t\t\t\t/* now we are working with POP3 */\n\t\t\t\t/* check the message id to make sure that the messages still in the server */\n\t\t\t\tif($msg[\"folder\"] == $this->_sysmap[\"inbox\"]) {\n\t\n\t\t\t\t\t$this->mail_send_command(\"TOP \".$msg[\"id\"].\" 0\".$this->CRLF);\n\t\t\t\t\t$buffer = $this->mail_get_line();\n\t\t\n\t\t\t\t\t/* if any problem with the server, stop the function */\n\t\t\t\t\tif(!preg_match(\"/^(\\+OK)/\",$buffer)) { $this->mail_error_msg = $buffer; return 0; }\n\t\t\n\t\t\t\t\tunset($header);\n\t\t\n\t\t\t\t\twhile (!feof($this->mail_connection)) {\n\t\t\t\t\t\t$buffer = $this->mail_get_line();\n\t\t\t\t\t\tif(trim($buffer) == \".\") break;\n\t\t\t\t\t\t$header .= $buffer;\n\t\t\t\t\t}\n\t\t\t\t\t$mail_info = $this->get_mail_info($header);\n\t\t\n\t\t\n\t\t\t\t\t/* compare the old and the new message id, if different, stop*/\n\t\t\t\t\tif(base64_encode($mail_info[\"message-id\"]) != base64_encode($msg[\"message-id\"])) {\n\t\t\t\t\t\t$this->mail_error_msg = $error_retrieving;\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!file_exists($msg[\"localname\"])) {\n\t\t\t\t\t\tif(!$this->mail_retr_msg($msg,0)) \n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t$this->mail_set_flag($msg,\"\\\\SEEN\",\"-\");\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->mail_send_command(\"DELE \".$msg[\"id\"].$this->CRLF);\n\t\t\t\t\t$buffer = $this->mail_get_line();\n\n\t\t\t\t\tif(!preg_match(\"/^(\\+OK)/\",$buffer)) { \n\t\t\t\t\t\t$this->mail_error_msg = $buffer; \n\t\t\t\t\t\treturn 0; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(file_exists($msg[\"localname\"])) {\n\t\t\t\t\t$currentname = $msg[\"localname\"];\n\t\t\t\t\t$basename = basename($currentname);\n\t\t\t\t\t$newfilename = $this->user_folder.\"$tofolder/$basename\";\n\t\t\t\t\tcopy($currentname,$newfilename);\n\t\t\t\t\tunlink($currentname);\n\t\t\t\t}\n\t\t\t} else \n\t\t\t\treturn 0;\n\t\t\t\n\t\t}\n\t\treturn 1;\n\t}", "Function mailattachments( $to, $subject, $body, $attacharray, $extraheaders)\n {\n $mail_boundary = \"=_NextPart_\".md5(uniqid(time()));\n\n // MIME-compliant headers\n $mailheaders = $extraheaders\n .\"MIME-Version: 1.0\\r\\n\"\n .\"Content-type: multipart/mixed; boundary=\\\"$mail_boundary\\\"\\r\\n\"\n .\"\\r\\n\"\n .\"This is a multipart MIME message\\r\\n\"\n .\"\\r\\n\";\n\n // Body. The part that gets displayed as the message:\n $mailbody = \"--$mail_boundary\\r\\n\"\n .\"Content-type: text/plain;\\r\\ncharset=iso-8859-1\\r\\n\"\n .\"Content-transfer-encoding: 7bit\\r\\n\"\n .\"\\r\\n\"\n .$body\n .\"\\r\\n\";\n//*\n // Now, do the attachments\n for ($i = 0; $i < count($attacharray); $i++ )\n {\n \t$fp = fopen($attacharray[$i][filename], \"r\");\n \t$file = fread($fp, filesize($attacharray[$i][filename]));\n \t$file = base64_encode($file); //BASE64-encoded. Text. Nice.\n \t$file = chunk_split($file); // Now in handy bite-sized 76-char chunks.\n \t$filename = basename($attacharray[$i][filename]);\n \t\n \t$mailbody .= \"--$mail_boundary\\r\\n\"\n .\"Content-type: \".$attacharray[$i][mimetype].\";\\r\\n\"\n .\"\\tname=\\\"\".$filename.\"\\\"\\r\\n\"\n \t .\"Content-transfer-encoding: base64\\r\\n\"\n \t .\"Content-Disposition: attachment;\\r\\n\"\n .\"\\tfilename=\\\"\".$filename.\"\\\"\\r\\n\"\n .\"\\r\\n\"\n .$file\n .\"\\r\\n\"\n .\"\\r\\n\";\n //echo $attacharray[$i][filename].\"<br>\";\n //echo $attacharray[$i][mimetype].\"<br>\";\n //echo $filename.\"<br>\";\n //echo \"<br>\";\n }\n//*/\n // End of mail\n $mailbody .= \"--$mail_boundary--\";\n mail($to, $subject, $mailbody, $mailheaders);\n }", "function email_get_root_folders($userid, $draft=true, $trash=true, $sendbox=true, $inbox=true) {\n\n\temail_create_parents_folders($userid);\n\n\t$folders = array();\n\n\t// Include inbox folder\n\tif ( $inbox ) {\n\t\t$folders[] = email_get_root_folder( $userid, EMAIL_INBOX);\n\t}\n\n\t// Include return draft folder\n\tif ( $draft ) {\n\t\t$folders[] = email_get_root_folder( $userid, EMAIL_DRAFT);\n\t}\n\n\t// Include sendbox folder\n\tif( $sendbox ) {\n\t\t$folders[] = email_get_root_folder( $userid, EMAIL_SENDBOX);\n\t}\n\n\tif ( $trash ) {\n\t\t$folders[] = email_get_root_folder( $userid, EMAIL_TRASH);\n\t}\n\n\treturn $folders;\n\n}", "function email_print_administration_folders($options) {\n\tglobal $CFG, $USER;\n\n\techo '<form method=\"post\" name=\"folderform\" action=\"'.$CFG->wwwroot.'/blocks/email_list/email/folder.php?id='.$options->id.'&amp;action=none\">\n\t\t\t\t\t\t<table align=\"center\"><tr><td>';\n\n\tprint_heading(get_string('editfolder', 'block_email_list') );\n\n\tif ( $folders = email_get_root_folders($USER->id, false) ) {\n\n\t\t$course = get_record('course', 'id', $options->course);\n\n\t\techo '<ul>';\n\n // Has subfolders\n $hassubfolders = false;\n\n\t\t// Get courses\n\t\tforeach ($folders as $folder) {\n\t\t\t// Trash folder is not showing\n\t\t\tif (! email_isfolder_type($folder, EMAIL_TRASH) ) {\n\t\t\t\techo '<li>'.$folder->name.'</li>';\n\n\t\t\t\t// Now, print all subfolders it\n\t\t\t\t$subfolders = email_get_subfolders($folder->id, NULL, true);\n\n\t\t\t\t// If subfolders\n\t\t\t\tif ( $subfolders ) {\n\t\t\t\t\temail_print_subfolders($subfolders, $USER->id, $options->course, true, true);\n\t\t\t\t\t$hassubfolders = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo '</ul>';\n\t}\n\n\techo '</td></tr></table></form>';\n\n\treturn $hassubfolders;\n}", "function _mbox_cmp($a, $b) {\n $a = $a['nameX']; // Added to work with intranet office\n $b = $b['nameX']; // Added to work with intranet office\n /* Always return INBOX as \"smaller\". */\n if ($this->_sortinbox) {\n if (strcasecmp($a, 'INBOX') == 0) {\n return -1;\n } \n elseif (strcasecmp($b, 'INBOX') == 0) {\n return 1;\n }\n }\n \n // Hack to place Trash folde right after Inbox\n if (strcasecmp($a, 'Trash') == 0) {\n return -1;\n } \n elseif (strcasecmp($b, 'Trash') == 0) {\n return 1;\n }\n\n $a_parts = explode($this->_delimiter, $a);\n $b_parts = explode($this->_delimiter, $b);\n\n $a_count = count($a_parts);\n $b_count = count($b_parts);\n\n $iMax = min($a_count, $b_count);\n\n for ($i = 0; $i < $iMax; $i++) {\n if ($a_parts[$i] != $b_parts[$i]) {\n /* If only one of the folders is under INBOX, return it as\n * \"smaller\". */\n if ($this->_sortinbox && ($i == 0)) {\n $a_base = (strcasecmp($a_parts[0], 'INBOX') == 0);\n $b_base = (strcasecmp($b_parts[0], 'INBOX') == 0);\n if ($a_base && !$b_base) {\n return -1;\n } \n elseif (!$a_base && $b_base) {\n return 1;\n }\n }\n $cmp = strnatcasecmp($a_parts[$i], $b_parts[$i]);\n if ($cmp == 0) {\n return strcmp($a_parts[$i], $b_parts[$i]);\n }\n return $cmp;\n }\n }\n\n return ($a_count - $b_count);\n }", "function email_newfolder($folder, $parentfolder) {\n\n\t// Add actual time\n\t$folder->timecreated = time();\n\n\t// Make sure course field is not null\t\t\tThanks Ann.\n\tif ( ! isset( $folder->course) ) {\n\t\t$folder->course = 0;\n\t}\n\n\t// Insert record\n\tif (! $folder->id = insert_record('email_folder', $folder)) {\n\t\treturn false;\n\t}\n\n\t// Prepare subfolder\n\t$subfolder = new stdClass();\n\t$subfolder->folderparentid = $parentfolder;\n\t$subfolder->folderchildid = $folder->id;\n\n\t// Insert record reference\n\tif (! insert_record('email_subfolder', $subfolder)) {\n\t\treturn false;\n\t}\n\n\tadd_to_log($folder->userid, \"email\", \"add subfolder\", \"$folder->name\");\n\n\treturn true;\n}", "function mail_attachment($filename, $path, $mailto, $from_mail, $from_name, $replyto, $subject, $message) {\r\n\tif (strtoupper(substr(PHP_OS,0,3)=='WIN')) {\r\n\t $eol=\"\\r\\n\";\r\n\t} elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) {\r\n\t $eol=\"\\r\";\r\n\t} else {\r\n\t $eol=\"\\n\";\r\n\t} \r\n\r\n\r\n\t$file = $path.$filename;\r\n\t$file_size = filesize($file);\r\n\t$handle = fopen($file, \"rb\");\r\n\t$content = fread($handle, $file_size);\r\n\t$content = chunk_split(base64_encode($content));\r\n\t$f_type=filetype($file);\r\n\tfclose($handle);\r\n\t\r\n\t$uid = md5(uniqid(time()));\r\n\t$name = basename($file);\r\n\t//common headers\r\n\t$header = \"From: \".$from_name.\" <\".$from_mail.\">\".$eol;\r\n\t$header .= \"Reply-To: \".$replyto.$eol;\r\n\t$header .= \"MIME-Version: 1.0\".$eol;\r\n\t$header .= \"Content-Type: multipart/mixed; boundary=\\\"\".$uid.\"\\\"\".$eol.$eol;\r\n\t$header .= \"This is a multi-part message in MIME format\".$eol;\r\n\t$header .= \"--\".$uid.$eol;\r\n\t$header .= \"Content-type:text/plain; charset=iso-8859-1\".$eol;\r\n\t$header .= \"Content-Transfer-Encoding: 7bit\".$eol.$eol;\r\n\t$header .= $message.$eol.$eol;\r\n\t$header .= \"--\".$uid.$eol;\r\n\t$header .= \"Content-Type: application/octet-stream; name=\\\"\".$filename.\"\\\"\".$eol; // use diff. tyoes here\r\n\t$header .= \"Content-Transfer-Encoding: base64\".$eol;\r\n\t$header .= \"Content-Disposition: attachment; filename=\\\"\".$filename.\"\\\"\".$eol.$eol;\r\n\t$header .= $content.$eol.$eol;\r\n\t$header .= \"--\".$uid.\"--\";\r\n\tif (!(mail($mailto, $subject, \"\", $header))) {\r\n\t\techo \"mail send ... ERROR!\";\r\n\t}\r\n}", "public function process()\n\t{\n\t\tPhpfox::isUser(true);\t\t\n\t\t\n\t\t$bIsInLegacyView = false;\n\t\tif (Phpfox::getParam('mail.threaded_mail_conversation') && $this->request()->get('legacy'))\n\t\t{\t\t\t\t\n\t\t\tPhpfox::getLib('setting')->setParam('mail.threaded_mail_conversation', false);\n\t\t\t$bIsInLegacyView = true;\t\t\t\n\t\t}\n\t\t\n\t\t$this->setParam('bIsInLegacyView', $bIsInLegacyView);\n\t\t\n\t\tif (($aItemModerate = $this->request()->get('item_moderate')))\n\t\t{\n\t\t\t$sFile = Phpfox::getService('mail')->getThreadsForExport($aItemModerate);\n\t\t\t\n\t\t\tPhpfox::getLib('file')->forceDownload($sFile, 'mail.xml');\n\t\t}\n\t\t\n\t\t$iPage = $this->request()->getInt('page');\n\t\t$iPageSize = 10;\n\t\t$bIsSentbox = ($this->request()->get('view') == 'sent' ? true : false);\n\t\t$bIsTrash = ($this->request()->get('view') == 'trash' ? true : false);\n\t\t$iPrivateBox = ($this->request()->get('view') == 'box' ? $this->request()->getInt('id') : false);\n\n\t\t$bIs = $this->getParam('bIsSentbox');\n\t\t\n\t\tif ($this->request()->get('action') == 'archive')\n\t\t{\n\t\t\tPhpfox::getService('mail.process')->archiveThread($this->request()->getInt('id'), 1);\n\t\t\t\n\t\t\t$this->url()->send('mail.trash', null, Phpfox::getPhrase('mail.message_successfully_archived'));\n\t\t}\n\t\t\n\t\tif ($this->request()->get('action') == 'unarchive')\n\t\t{\n\t\t\tPhpfox::getService('mail.process')->archiveThread($this->request()->getInt('id'), 0);\n\t\t\t\n\t\t\t$this->url()->send('mail', null, Phpfox::getPhrase('mail.message_successfully_unarchived'));\n\t\t}\t\t\t\t\n\t\t\n\t\tif ($this->request()->get('action') == 'delete')\n\t\t{\n\t\t\t$iMailId = $this->request()->getInt('id');\n\t\t\tif (!is_int($iMailId) || empty($iMailId))\n\t\t\t{\n\t\t\t\tPhpfox_Error::set(Phpfox::getPhrase('mail.no_mail_specified'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$bTrash = $this->getParam('bIsTrash');\n\t\t\t\tif (!isset($bTrash) || !is_bool($bTrash))\n\t\t\t\t{\n\t\t\t\t\t$bIsTrash = Phpfox::getService('mail')->isDeleted($iMailId);\n\t\t\t\t}\n\t\t\t\tif ($bIsTrash)\n\t\t\t\t{\n\t\t\t\t\tif (Phpfox::getService('mail.process')->deleteTrash($iMailId))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->url()->send('mail.trash', null, Phpfox::getPhrase('mail.mail_deleted_successfully'));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tPhpfox_Error::set(Phpfox::getPhrase('mail.mail_could_not_be_deleted'));\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\n\t\t\t\t\t$bIsSent = $this->getParam('bIsSentbox');\n\t\t\t\t\tif (!isset($bIsSent) || !is_bool($bIsSent))\n\t\t\t\t\t{\n\t\t\t\t\t\t$bIsSentbox = Phpfox::getService('mail')->isSent($iMailId);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (Phpfox::getService('mail.process')->delete($iMailId, $bIsSentbox))\n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t$this->url()->send($bIsSentbox == true ? 'mail.sentbox' : 'mail', null, Phpfox::getPhrase('mail.mail_deleted_successfully'));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tPhpfox_Error::set(Phpfox::getPhrase('mail.mail_could_not_be_deleted'));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tif (($aVals = $this->request()->getArray('val')) && isset($aVals['action']))\n\t\t{\n\t\t\tif (isset($aVals['id']))\n\t\t\t{ //make sure there is at least one selected\n\t\t\t\t$oMailProcess = Phpfox::getService('mail.process');\n\t\t\t\tswitch ($aVals['action'])\n\t\t\t\t{\n\t\t\t\t\tcase 'unread':\n\t\t\t\t\t\tcase 'read':\n\t\t\t\t\t\t\tforeach ($aVals['id'] as $iId)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$oMailProcess->toggleView($iId, ($aVals['action'] == 'unread' ? true : false));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$sMessage = Phpfox::getPhrase('mail.messages_updated');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (isset($aVals['select']) && $aVals['select'] == 'every')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$aMail = Phpfox::getService('mail')->getAllMailFromFolder(Phpfox::getUserId(),(int)$aVals['folder'], $bIsSentbox, $bIsTrash);\n\t\t\t\t\t\t\t\t$aVals['id'] = $aMail;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ($aVals['id'] as $iId)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t($bIsTrash ? $oMailProcess->deleteTrash($iId) : $oMailProcess->delete($iId, $bIsSentbox));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$sMessage = Phpfox::getPhrase('mail.messages_deleted');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'undelete':\n\t\t\t\t\t\t\tforeach ($aVals['id'] as $iId)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$oMailProcess->undelete($iId);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sMessage = Phpfox::getPhrase('mail.messages_updated');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ // didnt select any message\n\t\t\t\t\t$sMessage = Phpfox::getPhrase('mail.error_you_did_not_select_any_message');\n\n\t\t\t\t}\n\t\t\t\t// define the mail box that the user was looking at\n\t\t\t\t$mSend = null;\n\t\t\t\tif ($bIsSentbox)\n\t\t\t\t{\n\t\t\t\t\t$mSend = array('sentbox');\n\t\t\t\t}\n\t\t\t\telseif ($bIsTrash)\n\t\t\t\t{\n\t\t\t\t\t$mSend = array('trash');\n\t\t\t\t}\n\t\t\t\telseif ($iPrivateBox)\n\t\t\t\t{\n\t\t\t\t\t$mSend = array('box', 'id' => $iPrivateBox);\n\t\t\t\t}\n\n\t\t\t\t// send the user to that folder with the message\n\t\t\t\t$this->url()->send('mail', $mSend, $sMessage);\n\t\t\t}\n\t\t\t\n\t\t\t$this->search()->set(array(\n\t\t\t\t\t'type' => 'mail',\n\t\t\t\t\t'field' => 'mail.mail_id',\t\t\t\t\n\t\t\t\t\t'search_tool' => array(\n\t\t\t\t\t\t'table_alias' => 'm',\n\t\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t\t'action' => $this->url()->makeUrl('mail', array('view' => $this->request()->get('view'), 'id' => $this->request()->get('id'))),\n\t\t\t\t\t\t\t'default_value' => Phpfox::getPhrase('mail.search_messages'),\n\t\t\t\t\t\t\t'name' => 'search',\n\t\t\t\t\t\t\t'field' => array('m.subject', 'm.preview')\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'sort' => array(\n\t\t\t\t\t\t\t'latest' => array('m.time_stamp', Phpfox::getPhrase('mail.latest')),\n\t\t\t\t\t\t\t'most-viewed' => array('m.viewer_is_new', Phpfox::getPhrase('mail.unread_first'))\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'show' => array(10, 15, 20)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\t\t\n\t\t\t\n\t\t\t$iPageSize = $this->search()->getDisplay();\n\n\t\t\t$aFolders = Phpfox::getService('mail.folder')->get();\n\n\t\t\t$sUrl = '';\n\t\t\t$sFolder = '';\n\t\t\tif (Phpfox::getParam('mail.threaded_mail_conversation'))\n\t\t\t{\t\t\t\t\n\t\t\t\tif ($bIsTrash)\n\t\t\t\t{\n\t\t\t\t\t$sUrl = $this->url()->makeUrl('mail.trash');\t\t\t\t\t\n\t\t\t\t\t$this->search()->setCondition('AND m.owner_user_id = ' . Phpfox::getUserId() . ' AND m.is_archive = 1');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($bIsSentbox)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sUrl = $this->url()->makeUrl('mail.sentbox');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t$sUrl = $this->url()->makeUrl('mail');\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t$this->search()->setCondition('AND m.viewer_user_id = ' . Phpfox::getUserId() . ' AND m.is_archive = 0');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($bIsTrash)\n\t\t\t\t{\n\t\t\t\t\t$sFolder = Phpfox::getPhrase('mail.trash');\n\t\t\t\t\t$sUrl = $this->url()->makeUrl('mail.trash');\n\t\t\t\t\t$this->search()->setCondition('AND (m.viewer_user_id = ' . Phpfox::getUserId() . ' AND m.viewer_type_id = 1) OR (m.owner_user_id = ' . Phpfox::getUserId() . ' AND m.owner_type_id = 1)');\t\t\t\t\t\n\t\t\t\t\t// $this->search()->setCondition('AND m.viewer_user_id = ' . Phpfox::getUserId() . ' AND m.viewer_type_id = 1');\n\t\t\t\t}\n\t\t\t\telseif ($iPrivateBox)\n\t\t\t\t{\n\t\t\t\t\tif (isset($aFolders[$iPrivateBox]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$sFolder = $aFolders[$iPrivateBox]['name'];\n\t\t\t\t\t\t$sUrl = $this->url()->makeUrl('mail.box', array('id' => (int) $iPrivateBox));\n\t\t\t\t\t\t$this->search()->setCondition('AND m.viewer_folder_id = ' . (int) $iPrivateBox . ' AND m.viewer_user_id = ' . Phpfox::getUserId() . ' AND m.viewer_type_id = 0');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->url()->send('mail', null, Phpfox::getPhrase('mail.mail_folder_does_not_exist'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($bIsSentbox)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sFolder = Phpfox::getPhrase('mail.sent_messages');\n\t\t\t\t\t\t$sUrl = $this->url()->makeUrl('mail.sentbox');\n\t\t\t\t\t\t$this->search()->setCondition('AND m.owner_user_id = ' . Phpfox::getUserId() . ' AND m.owner_type_id = 0');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sFolder = Phpfox::getPhrase('mail.inbox');\n\t\t\t\t\t\t$sUrl = $this->url()->makeUrl('mail');\n\t\t\t\t\t\t$this->search()->setCondition('AND m.viewer_folder_id = 0 AND m.viewer_user_id = ' . Phpfox::getUserId() . ' AND m.viewer_type_id = 0');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlist($iCnt, $aRows, $aInputs) = Phpfox::getService('mail')->get($this->search()->getConditions(), $this->search()->getSort(), $this->search()->getPage(), $iPageSize, $bIsSentbox, $bIsTrash);\n\n\t\t\tPhpfox::getLib('pager')->set(array(\n\t\t\t\t\t'page' => $iPage,\n\t\t\t\t\t'size' => $iPageSize,\n\t\t\t\t\t'count' => $iCnt\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\tPhpfox::getService('mail')->buildMenu();\n\t\t\t\n\t\t$aActions = array();\n\t\t$aActions[] = array(\n\t\t\t'phrase' => Phpfox::getPhrase('mail.delete'),\n\t\t\t'action' => 'delete'\n\t\t);\n\t\tif (!$bIsSentbox)\n\t\t{\n\t\t\t$aActions[] = array(\n\t\t\t\t'phrase' => Phpfox::getPhrase('mail.move'),\n\t\t\t\t'action' => 'move'\n\t\t\t);\n\t\t}\n\t\t\n\t\t$aModeration = array(\n\t\t\t\t'name' => 'mail',\n\t\t\t\t'ajax' => 'mail.moderation',\n\t\t\t\t'menu' => $aActions\n\t\t\t);\n\t\t\t\n\t\tif ($bIsSentbox)\n\t\t{\n\t\t\t$aModeration['custom_fields'] = '<div><input type=\"hidden\" name=\"sent\" value=\"1\" /></div>';\n\t\t}\n\t\telseif ($bIsTrash)\n\t\t{\n\t\t\t$aModeration['custom_fields'] = '<div><input type=\"hidden\" name=\"trash\" value=\"1\" /></div>';\n\t\t}\n\t\t\n\t\tif (Phpfox::getParam('mail.threaded_mail_conversation'))\n\t\t{\n\t\t\t$aModeration['ajax'] = 'mail.archive';\n\t\t\t\n\t\t\t$aMenuOptions = array();\n\t\t\tif ($bIsTrash)\n\t\t\t{\n\t\t\t\t$aMenuOptions = array(\n\t\t\t\t\t'phrase' => Phpfox::getPhrase('mail.un_archive'),\n\t\t\t\t\t'action' => 'un-archive'\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$aMenuOptions = array(\n\t\t\t\t\t'phrase' => Phpfox::getPhrase('mail.archive'),\n\t\t\t\t\t'action' => 'archive'\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t$aModeration['menu'] = array($aMenuOptions,\n\t\t\t\tarray(\n\t\t\t\t\t'phrase' => Phpfox::getPhrase('mail.export'),\n\t\t\t\t\t'action' => 'export'\n\t\t\t\t)\t\t\t\t\t\n\t\t\t);\n\t\t}\n\t\t\t\n\t\t$this->setParam('global_moderation', $aModeration);\t\t\t\n\n\t\tif (empty($sFolder))\n\t\t{\n\t\t\t$sFolder = Phpfox::getPhrase('mail.mail');\n\t\t}\n\t\t$iMailSpaceUsed = 0;\n\t\tif ((!Phpfox::getUserParam('mail.override_mail_box_limit') && Phpfox::getParam('mail.enable_mail_box_warning')))\n\t\t{\n\t\t\t$iMailSpaceUsed = Phpfox::getService('mail')->getSpaceUsed(Phpfox::getUserId());\n\t\t}\t\t\n\t\t\n\t\t\t$this->template()->setTitle($sFolder)\n\t\t\t\t->setBreadcrumb(Phpfox::getPhrase('mail.mail'), $this->url()->makeUrl('mail'))\n\t\t\t\t->setPhrase(array(\n\t\t\t\t\t\t'mail.add_new_folder',\n\t\t\t\t\t\t'mail.adding_new_folder',\n\t\t\t\t\t\t'mail.view_folders',\n\t\t\t\t\t\t'mail.edit_folders',\n\t\t\t\t\t\t'mail.you_will_delete_every_message_in_this_folder',\n\t\t\t\t\t\t'mail.updating'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t->setHeader('cache', array(\n\t\t\t\t\t\t'jquery/plugin/jquery.highlightFade.js' => 'static_script',\n\t\t\t\t\t\t'quick_edit.js' => 'static_script',\t\n\t\t\t\t\t\t'selector.js' => 'static_script',\n\t\t\t\t\t\t'mail.js' => 'module_mail',\n\t\t\t\t\t\t'pager.css' => 'style_css',\n\t\t\t\t\t\t'mail.css' => 'style_css'\n\t\t\t\t\t)\n\t\t\t\t)\t\t\t\n\t\t\t\t->assign(array(\n\t\t\t\t\t'aMails' => $aRows,\n\t\t\t\t\t'bIsSentbox' => $bIsSentbox,\n\t\t\t\t\t'bIsTrash' => $bIsTrash,\n\t\t\t\t\t'aInputs' => $aInputs,\n\t\t\t\t\t'aFolders' => $aFolders,\n\t\t\t\t\t'iMailSpaceUsed' => $iMailSpaceUsed,\n\t\t\t\t\t'iMessageAge' => Phpfox::getParam('mail.message_age_to_delete'),\n\t\t\t\t\t'sUrl' => $sUrl,\n\t\t\t\t\t'iFolder' => (isset($aFolders[$iPrivateBox]['folder_id']) ? $aFolders[$iPrivateBox]['folder_id'] : 0),\n\t\t\t\t\t'iTotalMessages' => $iCnt,\n\t\t\t\t\t'sSiteName' => Phpfox::getParam('core.site_title'),\n\t\t\t\t\t'bIsInLegacyView' => $bIsInLegacyView\n\t\t\t\t)\n\t\t\t);\n\t}", "function populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type = \"simple\"){\n\n\tglobal $users, $domain;\n\n\tfor($i = 1; $i <= $message_count; $i++) {\n\t\tif ($msg_type == \"simple\") {\n\t\t\t$msg = \"From: foo@anywhere.com\\r\\n\"\n\t\t\t\t. \"To: $users[0]@$domain\\r\\n\"\n\t\t\t\t. \"Subject: test$i\\r\\n\"\n\t\t\t\t. \"\\r\\n\"\n\t\t\t\t. \"$i: this is a test message, please ignore\\r\\n\";\n\t\t} else {\n\t\t\t$envelope[\"from\"]= \"foo@anywhere.com\";\n\t\t\t$envelope[\"to\"] = \"$users[0]@$domain\";\n\t\t\t$envelope[\"subject\"] = \"Test msg $i\";\n\n\t\t\t$part1[\"type\"] = TYPEMULTIPART;\n\t\t\t$part1[\"subtype\"] = \"mixed\";\n\n\t\t\t$part2[\"type\"] = TYPETEXT;\n\t\t\t$part2[\"subtype\"] = \"plain\";\n\t\t\t$part2[\"description\"] = \"imap_mail_compose() function\";\n\t\t\t$part2[\"contents.data\"] = \"message 1:xxxxxxxxxxxxxxxxxxxxxxxxxx\";\n\n\t\t\t$part3[\"type\"] = TYPETEXT;\n\t\t\t$part3[\"subtype\"] = \"plain\";\n\t\t\t$part3[\"description\"] = \"Example\";\n\t\t\t$part3[\"contents.data\"] = \"message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy\";\n\n\t\t\t$part4[\"type\"] = TYPETEXT;\n\t\t\t$part4[\"subtype\"] = \"plain\";\n\t\t\t$part4[\"description\"] = \"Return Values\";\n\t\t\t$part4[\"contents.data\"] = \"message 3:zzzzzzzzzzzzzzzzzzzzzzzzzz\";\n\n\t\t\t$body[1] = $part1;\n\t\t\t$body[2] = $part2;\n\t\t\t$body[3] = $part3;\n\t\t\t$body[4] = $part4;\n\n\t\t\t$msg = imap_mail_compose($envelope, $body);\n\t\t}\n\n\t\timap_append($imap_stream, $mailbox, $msg);\n\t}\n}", "function email_removefolder($folderid, $options) {\n\n\tglobal $CFG;\n\n\t// Check if this folder have subfolders\n\tif ( get_record('email_subfolder', 'folderparentid', $folderid) ) {\n\t\t// This folder is parent of other/s folders. Don't remove this\n\t\t// Notify\n \tredirect( $CFG->wwwroot.'/blocks/email_list/email/view.php?id='.$options->id.'&amp;action=viewmails', '<div class=\"notifyproblem\">'.get_string('havesubfolders', 'block_email_list').'</div>' );\n\t}\n\n\t// Get folder\n\tif ($folders = get_records('email_folder', 'id', $folderid)) {\n\n\t // For all folders . . .\n\t foreach($folders as $folder) {\n\n\t\t\t// Before removing references to foldermail, move this mails to root folder parent.\n\t\t\tif ($foldermails = get_records('email_foldermail', 'folderid', $folder->id) ) {\n\n\t\t\t\t// Move mails\n\t\t\t\tforeach ( $foldermails as $foldermail ) {\n\t\t\t\t\t// Get folder\n\t\t\t\t\tif ( $folder = email_get_folder($foldermail->folderid) ) {\n\n\t\t\t\t\t\t// Get root folder parent\n\t\t\t\t\t\tif ( $parent = email_get_parentfolder($foldermail->folderid) ) {\n\n\t\t\t\t\t\t\t// Assign mails it\n\t\t\t\t\t\t\temail_move2folder($foldermail->mailid, $foldermail->id, $parent->id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tprint_error('failgetparentfolder', 'block_email_list');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprint_error('failreferencemailfolder', 'block_email_list');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Delete all subfolders of this\n\t\t\tif (! delete_records('email_subfolder', 'folderparentid', $folder->id)) {\n\t\t\t \treturn false;\n\t\t\t}\n\n\t\t\t// Delete all subfolders of this\n\t\t\tif (! delete_records('email_subfolder', 'folderchildid', $folder->id)) {\n\t\t\t \treturn false;\n\t\t\t}\n\n\t\t\t// Delete all filters of this\n\t\t\tif (! delete_records('email_filter', 'folderid', $folder->id)) {\n\t\t\t \treturn false;\n\t\t\t}\n\n\t\t\t// Delete all foldermail references\n\t\t\tif (! delete_records('email_foldermail', 'folderid', $folder->id)) {\n\t\t\t \treturn false;\n\t\t\t}\n\t }\n\n\t // Delete all folders\n\t if (! delete_records('email_folder', 'id', $folderid)) {\n\t\t \treturn false;\n\t\t}\n\t}\n\n\tadd_to_log($folderid, \"email\", \"remove subfolder\", \"$folderid\");\n\n\tnotify(get_string('removefolderok', 'block_email_list'));\n\n\treturn true;\n}", "static public function validateFolder(Horde_Variables $vars, $name)\n {\n $new_id = $name . '_new';\n if (isset($vars->$new_id)) {\n if ($GLOBALS['registry']->hasMethod('mail/createFolder') &&\n $GLOBALS['registry']->call('mail/createFolder', array(Horde_String::convertCharset($vars->$new_id, 'UTF-8', 'UTF7-IMAP')))) {\n return $vars->$new_id;\n }\n } elseif (isset($vars->$name) && strlen($vars->$name)) {\n return $vars->$name;\n }\n\n throw new Ingo_Exception(_(\"Could not validate IMAP mailbox.\"));\n }", "function parse_home_dotqmail($contents,$account_info = '') {\n\n global $tpl, $autorespond;\n if($account_info == '') {\n global $uesr_info;\n $account_info = $user_info;\n }\n $is_standard = FALSE;\n $is_deleted = FALSE;\n $is_forwarded = FALSE;\n\n // Set default template settings\n $tpl->assign('routing_standard_checked', '');\n $tpl->assign('routing_deleted_checked', '');\n $tpl->assign('routing_forwarded_checked', '');\n $tpl->assign('forward', '');\n $tpl->assign('save_a_copy_checked', '');\n $tpl->assign('vacation_checked', '');\n $tpl->assign('vacation_subject', '');\n $tpl->assign('vacation_body', '');\n\n\n\n if(empty($contents)) $is_standard = TRUE;\n if((is_array($contents) && count($contents) == 1 && \n $contents[0] == '# delete')) $is_deleted = TRUE;\n\n if($is_standard) {\n $tpl->assign('routing_standard_checked', ' checked');\n } else if($is_deleted) {\n $tpl->assign('routing_deleted_checked', ' checked');\n } else {\n\n // now let's parse it\n while(list($key,$val) = each($contents)) {\n if($val == $account_info['user_dir'] . '/Maildir/' ||\n $val == './Maildir/') {\n $tpl->assign('save_a_copy_checked', ' checked');\n continue;\n } \n if(ereg($autorespond, $val)) {\n $tpl->assign('vacation_checked', ' checked');\n $this->get_vacation($val);\n continue;\n } else if(checkEmailFormat(ereg_replace('^&', '', $val))) {\n $is_forwarded = TRUE;\n $tpl->assign('routing_forwarded_checked', ' checked');\n $tpl->assign('forward', ereg_replace('^&', '', $val));\n }\n }\n\n // See if default routing select applies\n if(!$is_standard && !$is_deleted && !$is_forwarded) {\n $tpl->assign('routing_standard_checked', ' checked');\n }\n\n }\n\n}", "function send_mail_with_attachment($to,$from,$message,$subject,$attachment){\n$files = array($attachment);\n// email fields: to, from, subject, and so on\n$headers = \"From: SA-Access <$from>\";\n// boundary \n$semi_rand = md5(time()); \n$mime_boundary = \"==Multipart_Boundary_x{$semi_rand}x\"; \n// headers for attachment \n$headers .= \"\\nMIME-Version: 1.0\\n\" . \"Content-Type: multipart/mixed;\\n\" . \" boundary=\\\"{$mime_boundary}\\\"\"; \n// multipart boundary \n$message = \"This is a multi-part message in MIME format.\\n\\n\" . \"--{$mime_boundary}\\n\" . \"Content-Type: text/plain; charset=\\\"iso-8859-1\\\"\\n\" . \"Content-Transfer-Encoding: 7bit\\n\\n\" . $message . \"\\n\\n\"; \n$message .= \"--{$mime_boundary}\\n\";\n// preparing attachments\nfor($x=0;$x<count($files);$x++){\n\t$file = fopen($files[$x],\"rb\");\n\t$data = fread($file,filesize($files[$x]));\n\tfclose($file);\n\t$data = chunk_split(base64_encode($data));\n\t$message .= \"Content-Type: {\\\"application/octet-stream\\\"};\\n\" . \" name=\\\"$files[$x]\\\"\\n\" . \n\t\"Content-Disposition: attachment;\\n\" . \" filename=\\\"HealthCareWorkSheet.pdf\\\"\\n\" . \n\t\"Content-Transfer-Encoding: base64\\n\\n\" . $data . \"\\n\\n\";\n\t$message .= \"--{$mime_boundary}\\n\";\n}\n// send\nreturn @mail($to, $subject, $message, $headers); \n\n}", "function mail_attachment($filename, $path, $mailto, $from_mail, $from_name, $replyto, $subject, $message, $cc, $bcc) {\n\t\t$file = $path.$filename;\n\t\t$file_size = filesize($file);\n\t\t$handle = fopen($file, \"r\");\n\t\t$content = fread($handle, $file_size);\n\t\tfclose($handle);\n\t\t$content = chunk_split(base64_encode($content));\n\t\t$uid = md5(uniqid(time()));\n\t\t$name = basename($file);\n\t\t$header = \"From: \".$from_name.\" <\".$from_mail.\">\\r\\n\";\n\t\t$header .= \"Reply-To: \".$replyto.\"\\r\\n\";\n\t\t$header .= 'Cc: '.$cc . \"\\r\\n\";\n\t\t$header .= 'Bcc: '.$bcc . \"\\r\\n\";\n\t\t$header .= \"MIME-Version: 1.0\\r\\n\";\n\t\t$header .= \"Content-Type: multipart/mixed; boundary=\\\"\".$uid.\"\\\"\\r\\n\\r\\n\";\n\t\t$header .= \"This is a multi-part message in MIME format.\\r\\n\";\n\t\t$header .= \"--\".$uid.\"\\r\\n\";\n\t\t$header .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n\t\t$header .= \"Content-Transfer-Encoding: 7bit\\r\\n\\r\\n\";\n\t\t$header .= $message.\"\\r\\n\\r\\n\";\t\t\n\t\t$header .= \"--\".$uid.\"\\r\\n\";\n\t\t$header .= \"Content-Type: application/octet-stream; name=\\\"\".$filename.\"\\\"\\r\\n\"; // use diff. tyoes here\n\t\t$header .= \"Content-Transfer-Encoding: base64\\r\\n\";\n\t\t$header .= \"Content-Disposition: attachment; filename=\\\"\".$filename.\"\\\"\\r\\n\\r\\n\";\n\t\t$header .= $content.\"\\r\\n\\r\\n\";\n\t\t$header .= \"--\".$uid.\"--\";\n\t\t\n\t\tmail($mailto, $subject, \"\", $header);\n\t}", "private function process_emails(&$doing){\n\n if (isset($_GET['hotel_confirmation_once'])){\n // ----------------------- Ask for the welcome mail attachment\n print x(\"span class='only_online'\",\n\t x(\"form action='\".b_url::same('?resetcache_once=1').\"' method='post' enctype='multipart/form-data' name='upload_mail_attachment'\",\n\t\tx('table',\n\t\t x('tr',\n\t\t x('td','Please select PDF file').\n\t\t x('td',\"<input name='_virt_att' type='file' />\").\n\t\t \"<input name='v_id' value='\".$_GET['hotel_confirmation_once'].\"' type='hidden' />\".\n\t\t \"<input name='lease_id' value='\".$_GET['lease_once'].\"' type='hidden' />\").\n\t\t x('tr',\n\t\t x('td colspan=2',x('center',\"<input type='submit' value='submit'/>\"))))));\n }elseif (isset($_FILES['_virt_att'])){\n // ----------------------- Save the welcome mail attachment\n VM_mailer()->save_attachment($_REQUEST['v_id'],$_REQUEST['lease_id'],$_FILES['_virt_att'],'hotel_confirmation');\n }elseif (isset($_GET['mail2all_deny_once'])){\n // ----------------------- Send deny E-mails to all refused attenders of the event\n $q = $this->query();\n while($rec = myPear_db()->next_record($q)){\n\tif(VM_mailer()->m_applicant_deny($rec['v_id'],'status',$rec['v_status']) === False){\n\t VM_mailer()->m_applicant_deny($rec['v_id'],$no_preview=True);\n\t}\n }\n }\n if(isset($_GET['mail2all_welcome_once'])){\n // ----------------------- Send welcome E-mails to all accepted attenders of the event\n $q = $this->query();\n while($rec = myPear_db()->next_record($q)){\n\tif(VM_mailer()->welcome_applicant($rec['v_id'],'status',$rec['v_status']) === False){\n\t VM_mailer()->welcome_applicant($rec['v_id'],@$rec['lease_id'],$no_preview=True);\n\t}\n }\n }elseif (isset($_GET['mail_once'])){\n //\n // ----------------------- Preview e-mails \n //\n $doing = 'send_accept_deny';\n switch($_GET['mail_once']){ \n case 'vm_mail_yes':\n\tVM_mailer()->welcome_applicant($_GET['v_id'],$_GET['lease_id']);\n\tbreak;\n\t\n case 'vm_mail_no':\n\tVM_mailer()->m_applicant_deny($_GET['v_id']);\n\tbreak;\n\t\n case 'vm_mail_info':\n\tVM_mailer()->m_applicant_info_mail($_GET['v_id']);\n\tbreak;\n\n case 'vm_mail_pwd':\n\tVM_mailer()->remind_organizer($_GET['v_id'],VM::$e,'pwd',False);\n\tbreak;\n }\n }elseif(isset($_GET['sendmail_once'])){\n //\n // ----------------------- Sending the e-mail after preview\n //\n switch($sendmail_once=$_GET['sendmail_once']){\n case 'send':\n\tb_debug::_debug(\"sendmail_once='$sendmail_once'\",$this);\n\tbreak;\n default:\n\tb_debug::_debug(\"sendmail_once='$sendmail_once'... What to do???\",$this);\n }\n }\n }", "function email_move2folder($mailid, $foldermailid, $folderidnew) {\n\n\tif ( record_exists('email_folder', 'id', $folderidnew) ) {\n\n\t\t// Folder have exist in this new folder?\n\t\tif (! get_record('email_foldermail', 'mailid', $mailid, 'folderid', $folderidnew) ) {\n\n\t\t\t// Change folder reference to mail\n\t\t\tif (! set_field('email_foldermail', 'folderid', $folderidnew, 'id', $foldermailid, 'mailid', $mailid)) {\n\t\t\t \treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! delete_records('email_foldermail', 'id', $foldermailid) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "function create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type= \"simple\"){\n\tglobal $default_mailbox, $mailbox_prefix;\n\t$mailbox = $default_mailbox . \".\" . $mailbox_prefix . $mailbox_suffix;\n\n\t$mailboxes = imap_getmailboxes($imap_stream, $mailbox, '*');\n\n\t// check mailbox does not already exist\n\tif ($mailboxes) {\n\t\tforeach($mailboxes as $value) {\n\t\t\tif ($value->name == $mailbox) {\n\t\t\t\texit (\"TEST FAILED : Mailbox '$mailbox' already exists\\n\");\n\t\t\t}\n\t\t}\n\t}\n\n\tif (imap_createmailbox($imap_stream, $mailbox) === false) {\n\t\treturn false;\n\t}\n\n\t// Add number of test msgs requested\n\tif ($message_count > 0) {\n\t\tpopulate_mailbox($imap_stream, $mailbox, $message_count, $msg_type);\n\t}\n\n\treturn $mailbox;\n}", "function mail_allothers($db_object,$common,$post_var,$user_id,$error_msg)\n\t{\n\t\twhile(list($kk,$vv)=@each($post_var))\n\t\t{\n\n\t\t$$kk=$vv;\n\t\n\t\t}\n\t\t\n\t$config=$common->prefix_table(\"config\");\n\t$appraisal_table=$common->prefix_table(\"multirater_appraisal\");\n \t$otherraters_table = $common->prefix_table(\"other_raters\");\n\t$user_table=$common->prefix_table(\"user_table\");\n\t$ratergroup_table = $common->prefix_table(\"rater_group\");\n\t$position_table = $common->prefix_table(\"position\");\n \t\n//groups to be sent mail...\n\t\n\t$mysql = \"select rater_group_name from $ratergroup_table\";\n\t$group_arr = $db_object->get_single_column($mysql);\n\n\t\n\t\tfor($i=0;$i<count($group_arr);$i++)\n\t\t{\n\t\t\t$group_var = $group_arr[$i];\n\t\t\n\t\t\t$name=$group_var;\t\n\n\t\t\t$$name=1;\n\t\t}\n\n// emails in OTHERS category will be sent in the multirater_appraisal.php\n\n\t\tfor($x=0;$x<count($user_id_all);$x++)\n\t\t{\n\t\t\t\n\t\t$appraisal_userid = $user_id_all[$x];\n\t \n//OCT 11 MAILS SHOULD BE SENT FROM HERE TO BOSS , BOSS' BOSS , SELF ONLY\n\n//boss id\n\t\t\n\t\t$boss_no = $common->immediate_boss($db_object,$appraisal_userid);\n\t\t\n\n//boss' boss id \n\t\t \n\t\t\n\t\t$boss_boss_no = $common->immediate_boss($db_object,$boss_no);\n\n\t//check with the group names...\n\t\t$current_user_id = \"\";\n\t\t\n\t\t$current_user_id[] = $appraisal_userid; //converting the current userid to array \n\n\t\t\tif($grp_boss == 1)\n\t\t\t{\n\t\t\t\tif($boss_no != 0)\n\t\t\t\t{\n\t\t\t\t$array_users4 = $boss_no;\n\t\t\t\t}\n\t\t\t\t\n\t\t\n\t\t\n\t\t\t}\n\t\t \n\t \t\tif($grp_topboss == 1)\n\t\t\t{\n\t\t\t\tif($boss_boss_no !=0)\n\t\t\t\t{\n\t\t\t\t$array_users7 = $boss_boss_no;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t \n\n\t\t$array_users = @array_merge($array_users4,$array_users7,$current_user_id);\t\n\t\n//all the persons who are supposed to recieve email is obtained...\n\t\n\t\t$array_users = @array_unique($array_users);\n\n\n//codings to send mail...\n\t\t\n\t\t$mysql=\"select masubject,mamessage from $config\";\n\t\n\t\t$rslt_arr=$db_object->get_a_line($mysql);\n\n\t\t\n\n\t\t$masubject=$rslt_arr[\"masubject\"];\n\t\t$mamessage=$rslt_arr[\"mamessage\"];\n\n//sender email details...\n\t\t$mysql = \"select username,email from $user_table where user_id = '$appraisal_userid'\";\n\n\t\t$sender_arr = $db_object->get_a_line($mysql);\n\t\t$user = $sender_arr[\"username\"];\n\t\t$from = $sender_arr[\"email\"];\n\n\t\t\n\t\t$user_idstring=implode(\",\",$array_users);\n\n\t\t$mysql = \"select email,username,user_id from $user_table \n\t\twhere user_id in ($user_idstring)\";\n\t\t\t\t\t\t\n\n\t\t$email_arr1 = $db_object->get_rsltset($mysql);\n\n\t\t$email_arr=array();\n\n\t\tfor($l=0;$l<count($email_arr1);$l++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$id=$email_arr1[$l][\"user_id\"];\n\t\t\t\t$email_arr[$id][\"user_id\"] = $email_arr1[$l][\"user_id\"];\n\t\t\t\t$email_arr[$id][\"email\"]=$email_arr1[$l][\"email\"];\n\t\t\t\t$email_arr[$id][\"username\"]=$email_arr1[$l][\"username\"];\n\t\t\t\t\n\t\t\t}\n\n\n\n\n\t\twhile (list($kk,$vv) = @each($array_users))\n\t\t\t{\n\t\t\t$useridToMail = $array_users[$kk];\n\t\t\t\n\t\t\t\n\t\t\t\tif($useridToMail != 0)\n\t\t\t\t{\n\n\t\t\t\n\t\t\t\t$email = $email_arr[$useridToMail][\"email\"];\n\n\t\t\t\t$username = $email_arr[$useridToMail][\"username\"];\t\n\t\t\t\t$rater_user_id = $email_arr[$useridToMail][\"user_id\"];\n\n\t\t\t\t$to = $email;\n\t\t\t\t\n\t\t\t\t$values[\"username\"]\t=$username;\n\t\t\t\t$values[\"user\"] \t= $user;\n\t\t\t\t$values[\"login_username\"] = $username;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$values[\"url\"]=$common->http_path.\"/index.php\";\n\n\t\t\t\t$message=$common->direct_replace($db_object,$mamessage,$values);\n\n\t\t\t\t//echo \"to $to<br> sub $masubject<br> mess $message<br> from $from<br><br>\";\n\n\t\t\t\t$sent=$common->send_mail($to,$masubject,$message,$from);\n \n//store the data of the persons to whom the mail has been sent\n\t\t\n\t\t\t\t$rater_id = $rater_user_id;\n\t\t\t\t$user_to_be_rated = $appraisal_userid;\n\t\t\t\t$rater_email = $email;\n\t\t\n//insert the data regarding the raters into the table...\n\t\t\t\t\n//if the user is the rater, it means that he belong to the self category...\t\t\t\n\t\t\t\t\n\t\t\t\tif($user_to_be_rated == $rater_id)\n\t\t\t\t{\n\t\t\t\t$group_belongingto = 'grp_self';\n\t\t\t\t}\n\t\t\t\telseif($rater_id == $boss_boss_no)\n\t\t\t\t{\n\t\t\t\t$group_belongingto = 'grp_topboss';\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t$group_belongingto = 'grp_boss';\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$mysql = \"insert into $otherraters_table set rater_userid = '$rater_id' , rater_email = '$rater_email' ,cur_userid = '$user_to_be_rated' , group_belonging = '$group_belongingto' ,date_rating_requested=now()\";\n\t\t\t\t\n\t\t\t\t$db_object->insert($mysql);\n\t\t\n\t\t\t\t//user_to_be_rated = \"\"; //from\n\t\t\t\t//rater_id = \"\"; //to\n\t\t\n\t\t\t\t}\n\t\t\n\n\t\t\t}\n\t\t\n\t\n\t\t\n\t}\n\t\tif($sent)\n\t\t{\n\t\t\n\t\t\techo $error_msg[\"cMultiraterAppraisalMail_sent\"];\n\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo $error_msg[\"cMultiraterAppraisalMail_fail\"];\n\t\t}\n\t\t\n\t\n}", "public function process($from, $to, $data)\n\t{\n\t\tif(AUTO_ORGANISE_FILES)\n\t\t{\n\t\t\t$from = str_replace('<', '', str_replace('>', '', $from));\n\t\t\t$to = str_replace('<', '', str_replace('>', '', $to));\n\t\t\tif(!filter_var($from, FILTER_VALIDATE_EMAIL) || !filter_var($to, FILTER_VALIDATE_EMAIL))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$baseDir = DOCROOT.'/'.$to.'/'.$from;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$baseDir = DOCROOT;\n\t\t}\n\n\t\tif(!is_dir($baseDir))\n\t\t{\n\t\t\tif(!mkdir($baseDir, 0777, TRUE))\n\t\t\t{\n\t\t\t\techo \"Failed to create directory: \".$baseDir.\"\\n\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t$mime = mailparse_msg_create();\n\t\tmailparse_msg_parse($mime,$data);\n\t\t$struct = mailparse_msg_get_structure($mime);\n\n\t\tforeach($struct as $section)\n\t\t{\n\t\t\t$part = mailparse_msg_get_part($mime, $section); \n\t\t\t$part = mailparse_msg_get_part_data($part); \n\n\t\t\tif(!in_array($part['content-type'], ['image/png']))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$filename = $baseDir.'/';\n\t\t\t//if(isset($part['content-disposition']) && !empty($part['content-disposition']))\n\t\t\t//{\n\t\t\t//\t$filename .= preg_replace('/[^0-9a-z\\.\\_\\-]/i','',$part['content-disposition']);\n\t\t\t//}\n\t\t\t//else\n\t\t\t//{\n\t\t\t\t$filename .= preg_replace('/[^0-9a-z\\.\\_\\-]/i','',$part['content-name']);\n\t\t\t//}\n\n\t\t\tif(isset($part['headers']['content-type']))\n\t\t\t{\n\t\t\t\t//if(explode(';',$part['headers']['content-type'])[0] == 'image/png')\n\t\t\t\t//{\n\t\t\t\t\t$filedata = substr($data, $part['starting-pos-body'], $part['ending-pos-body']);\n\t\t\t\t\t$filedata = base64_decode($filedata);\n\t\t\t\t\tfile_put_contents($filename, $filedata);\n\n\t\t\t\t\t//$finfo = finfo_open(FILEINFO_MIME_TYPE);\n\t\t\t\t\t//$mimeType = finfo_file($finfo, DOCROOT.$filename) . \"\\n\";\n\t\t\t\t\t//finfo_close($finfo);\n\t\t\t\t//}\n\t\t\t}\n\t\t} \n\n\t}", "abstract protected function _sendMail ( );", "abstract public function get_mailto();", "function fm_get_all_shared_by_folder($original, $foldid) {\r\n\t$tmpvar = get_records('fmanager_link',\"owner=$original AND folder\",$foldid);\r\n\r\n\treturn $tmpvar;\t\r\n}", "function send_to_collections_general($parameters) \n\t{\n\t\t$application_id = $parameters->application_id;\n\n\t\tRemove_Standby($application_id);\n\n\t\t//ECash_Documents_AutoEmail::Queue_For_Send($parameters->application_id, 'RETURN_LETTER_2_SECOND_ATTEMPT', $parameters->status->fail_set[0]->transaction_register_id);\n\t\tECash_Documents_AutoEmail::Queue_For_Send($parameters->application_id, 'PAYMENT_FAILED', $parameters->status->fail_set[0]->transaction_register_id);\n\n\t\t// Send Return Letter 3 - 'Overdue Account Letter' 6.2.1.4\n\n\t\t// 6.2.1.1 - Change status to Collections Contact\n\t\tUpdate_Status(null, $application_id, array('queued','contact','collections','customer','*root'), NULL, NULL, FALSE);\n\t\t\n\t\t// 6.2.1.5 - Add to Collections General Queue\n\t\t$qm = ECash::getFactory()->getQueueManager();\n\t\t$queue_item = $qm->getQueue('collections_general')->getNewQueueItem($parameters->application_id);\n//\t\t$queue_item->Priority = 200; Not specified by spec\n\t\t$qm->moveToQueue($queue_item, 'collections_general');\n\n\t\t// 6.2.1.3 - Schedule Full Pull on next Payment Due Date\n\t\t// Get their next due date\n\t\t$data = Get_Transactional_Data($application_id);\n\t\t$info = $data->info;\n\t\t$rules = $data->rules;\n\n\t\t$paydates = Get_Date_List($data->info, date('m/d/Y'), $data->rules, 10, NULL, NULL);\n\t\n\t while(strtotime($paydates['event'][0]) < strtotime(date('Y-m-d')))\n\t {\n\t array_shift($paydates['event']);\n\t array_shift($paydates['effective']);\n\t }\n\t\n\t\t// If $paydates['event'] == date('Y-m-d'), and the batch has closed, shift one more time\n\t\tif (strtotime($paydates['event'][0]) == strtotime(date('Y-m-d')) && Has_Batch_Closed($this->server->company_id))\n\t\t{\n\t array_shift($paydates['event']);\n\t array_shift($paydates['effective']);\n\t }\n\n\t\t$next_action = date('m/d/Y', strtotime($paydates['event'][0]));\n\t\t$next_due_date = date('m/d/Y', strtotime($paydates['effective'][0]));\n\n\t\t// Removed for escalation #26062\n\t\t//Schedule_Full_Pull($application_id, NULL, NULL, $next_action, $next_due_date);\n\t\t\n\t\treturn 0;\n\t}", "function listFolder($sessionKey,$group_id,$item_id) {\n $params = array('id' => $item_id, 'report' => 'List');\n return _makeDocmanRequest($sessionKey, $group_id, 'show', $params);\n}", "function send_emails($fname, $lname, $email, $password)\n{\n\t$headers\t= 'MIME-Version: 1.0' . \"\\n\";\n\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\n\";\n\t$headers .= 'From: NEWSTART Lifestyle Club <club@newstart.com>' . \"\\r\\n\";\n\n\t// message\n\t$message = '\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<title>Welcome to the Club!</title>\n<meta name=\"viewport\" content=\"width=740\">\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n<style type=\"text/css\">\na {text-decoration: none;color:#87A621;}\na:hover {text-decoration: underline;}\n\t\n</style>\n<!--[if gte mso 9]>\n<style type=\"text/css\">\ntable,td,div,p {font-family:\\'Helvetica Neue\\', Arial, Helvetica, Lucida Sans, Lucida Sans Unicode, Lucida Grande sans-serif !important;}\n</style>\n<![endif]-->\n<!--[if lte mso 7]>\n<style type=\"text/css\">\ntable,td,div,p {font-family:\\'Helvetica Neue\\', Arial, Helvetica, Lucida Sans, Lucida Sans Unicode, Lucida Grande sans-serif !important;}\n</style>\n<![endif]-->\n</head>\n<body bgcolor=\"#509ADE\" style=\"margin:0; padding:0\">\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n\t<tr>\n\t\t<td style=\"padding:20px 20px 40px 20px; background-color:#509ADE\" bgcolor=\"#509ADE\">\n\t\t\t\n\t\t\t<!-- BEGIN MAIN CONTENT -->\n\t\t\t<table width=\"550\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" style=\"margin:0 auto;\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"550\" valign=\"top\" colspan=\"3\">\n\t\t\t\t\t\t\t\t\t<img src=\"http://newstartclub.com/assets/images/email/newsletter/email-header.jpg\" alt=\"NEWSTART Lifestyle Club\" width=\"550\" border=\"0\" style=\"display:block;margin:0\">\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"2\" valign=\"top\" style=\"background-image: url(http://newstartclub.com/assets/images/email/newsletter/email-left-shadow.jpg);\"></td>\n\t\t\t\t\t\t\t\t<td width=\"550\" valign=\"middle\" height=\"60\" align=\"right\" bgcolor=\"#000000\" style=\"background-image: url(http://newstartclub.com/assets/images/email/newsletter/nav-texture.png); background-color:#000000\">\n\t\t\t\t\t\t\t\t\t<div style=\"font-family:\\'Helvetica Neue\\', Arial, Helvetica, sans-serif; font-size:30px; color:#ffffff; padding: 12px 30px;\">\n\t\t\t\t\t\t\t\t\t\t<span style=\"font-size:30px;color:#FFFFFF;font-family:\\'Helvetica Neue\\', Arial, Helvetica, sans-serif;\">Welcome to the</span> <span style=\"font-size:30px;color:#FFFFFF;font-family:\\'Helvetica Neue\\', Arial, Helvetica, sans-serif;font-weight:bold;\">Club</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td width=\"2\" valign=\"top\" style=\"background-image: url(http://newstartclub.com/assets/images/email/newsletter/email-right-shadow.jpg);\"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\"550\" style=\"background-color:#ffffff\" bgcolor=\"#ffffff\">\n\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" style=\"margin:0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"2\" valign=\"top\" style=\"background-image: url(http://newstartclub.com/assets/images/email/newsletter/email-left-shadow.jpg);\"></td>\n\t\t\t\t\t\t\t\t<td width=\"30\" bgcolor=\"#ffffff\" valign=\"top\"></td>\n\t\t\t\t\t\t\t\t<td width=\"486\" style=\"font-family:\\'Helvetica Neue\\', Arial, Helvetica, sans-serif; font-weight: normal; line-height: 1.2; font-size:16px; color:#010101;\">\n\t\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" style=\"margin:0\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td height=\"30\"></td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td style=\"font-family:\\'Helvetica Neue\\', Arial, Helvetica, sans-serif; font-weight: normal; line-height: 1.5; font-size:16px; color:#010101;\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Dear ';\n\t\t\t\t\t\t$message .= $fname;\n\t\t\t\t\t\t$message .= ',</p>\n\t\t\t\t\t\t\t\t\t<p>As a registered member, you now have access to:</p>\n\t\t\t\t\t\t\t\t\t <ul>\n\t\t\t\t\t\t\t\t\t\t<li>Live streaming videos</li>\n\t\t\t\t\t\t\t\t\t\t<li>Local seminars & events</li>\n\t\t\t\t\t\t\t\t\t\t<li>Expert health advice</li>\n\t\t\t\t\t\t\t\t\t\t<li>Wellness tips & tools</li>\n\t\t\t\t\t\t\t\t\t\t<li>FREE membership</li>\n\t\t\t\t\t\t\t\t\t </ul>\n\t\t\t\t\t\t\t\t\t <p>To get started, log in to <a href=\"http://newstartclub.com/signin\" style=\"color:#87A621;\">http://newstartclub.com/signin</a> using the following:</p>\n\t\t\t\t\t\t\t\t\t <p><strong>Username:</strong> <a href=\"mailto:'. $email .'\" style=\"color:#87A621;\">'. $email .'</a><br /><strong>Password:</strong> '. $password .'</p>\n\t\t\t\t\t\t\t\t\t <p>If you ever wish to change your password, visit <a href=\"http://newstartclub.com/settings\" style=\"color:#87A621;\">http://newstartclub.com/settings</a>.</p>\n\t\t\t\t\t\t\t\t\t<span>Enjoy,<br />\n\t\t\t\t\t\t\t\t\tThe NEWSTART Lifestyle Club Team<br />\n\t\t\t\t\t\t\t\t\t<a href=\"http://newstartclub.com/\" style=\"color:#87A621;\">newstartclub.com</a></span><br /><br />\n\t\t\t\t\t\t\t\t\t<span>P.S. As our way of saying thanks for joining, please click <a href=\"http://newstartclub.com/downloads/sponsor-resources/common-files/NEWSTART-Planner.pdf\" style=\"color:#87A621;\">here</a> to download your free NEWSTART&reg; Daily Planner.</span>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td height=\"10\"></td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td width=\"30\" bgcolor=\"#ffffff\" valign=\"top\"></td>\n\t\t\t\t\t\t\t\t<td width=\"2\" valign=\"top\" style=\"background-image: url(http://newstartclub.com/assets/images/email/newsletter/email-right-shadow.jpg);\"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\"550\" valign=\"top\" colspan=\"3\">\n\t\t\t\t\t\t<img src=\"http://newstartclub.com/assets/images/email/newsletter/email-footer.jpg\" alt=\"footer\" width=\"550\" border=\"0\" style=\"display:block;margin:0\">\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t\n\t\t\t<!--BEGIN FOOTER-->\n\t\t\t<table width=\"550\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" style=\"margin:0 auto\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td style=\"padding:15px 20px 0 20px; font-family: \\'Lucida Grande\\', \\'Lucida Sans Unicode\\', Verdana, sans-serif !important; font-size:10px; line-height: 1.34em; color:#204C74\" align=\"center\">\n\t\t\t\t\t\tA FREE community service of <a href=\"http://newstart.com\" style=\"font-size:10px;color:#204C74; text-decoration:underline;\">NEWSTART&reg;</a>. &copy;'. date(\"Y\") .'. All Rights Reserved.\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t\n\t\t</td>\n\t</tr>\n</table>\n</body>\n</html>';\n\n\t// Mail it\n\tmail($email, 'Welcome to the Club!', stripslashes($message), $headers);\n}", "function mail_attachment($filename, $path, $mailto, $from_mail, $from_name, $replyto, $subject, $message) {\n if ($filename != '' && $path != ''){\n $file = $path.$filename;\n $file_size = filesize($file);\n $handle = fopen($file, \"r\");\n $content = fread($handle, $file_size);\n fclose($handle);\n $content = chunk_split(base64_encode($content));\n $uid = md5(uniqid(time()));\n $name = basename($file);\n $header = \"From: \".$from_name.\" <\".$from_mail.\">\\r\\n\";\n $header .= \"Reply-To: \".$replyto.\"\\r\\n\";\n $header .= \"MIME-Version: 1.0\\r\\n\";\n $header .= \"Content-Type: multipart/mixed; boundary=\\\"\".$uid.\"\\\"\\r\\n\\r\\n\";\n $header .= \"This is a multi-part message in MIME format.\\r\\n\";\n $header .= \"--\".$uid.\"\\r\\n\";\n $header .= \"Content-type:text/plain; charset=iso-8859-1\\r\\n\";\n $header .= \"Content-Transfer-Encoding: 7bit\\r\\n\\r\\n\";\n $header .= $message.\"\\r\\n\\r\\n\";\n $header .= \"--\".$uid.\"\\r\\n\";\n $header .= \"Content-Type: application/octet-stream; name=\\\"\".$filename.\"\\\"\\r\\n\"; // use different content types here\n $header .= \"Content-Transfer-Encoding: base64\\r\\n\";\n $header .= \"Content-Disposition: attachment; filename=\\\"\".$filename.\"\\\"\\r\\n\\r\\n\";\n $header .= $content.\"\\r\\n\\r\\n\";\n $header .= \"--\".$uid.\"--\";\n if (mail($mailto, $subject, \"\", $header)) {\n return 'E-mail Sent successfully'; // or use booleans here\n } else {\n return 'E-mail not Sent';\n }\n }else{\n $header = \"From: \".$from_name.\" <\".$from_mail.\">\\r\\n\";\n $header .= \"Reply-To: \".$replyto.\"\\r\\n\";\n if (mail($mailto, $subject, \"\", $header)) {\n return 'E-mail Sent successfully'; // or use booleans here\n } else {\n return 'E-mail not Sent';\n }\n }\n }", "public function getFolderInfo() {}", "public function testMailAssume()\n {\n $asserts = array();\n\n foreach ($this->messages as $id => $message) {\n $asserts[$id] = array();\n\n $asserts[$id]['id'] = $id;\n\n $asserts[$id]['folder'] = $this->createZendImapStorageFolder();\n $asserts[$id]['subject'] = $message['subject'];\n $asserts[$id]['received'] = strtotime($message['date']);\n $asserts[$id]['plainText'] = $message['plainText'];\n $asserts[$id]['attachments'] = null;\n $asserts[$id]['type'] = $message['type'];\n $asserts[$id]['domainName'] = $message['domainName'];\n $asserts[$id]['orderNumber'] = $message['orderNumber'];\n }\n\n $imapAdapter = $this->createImapAdpater();\n\n $imapAdapter\n ->expects($this->any())\n ->method('search')\n ->will($this->returnValue(array_keys($this->messages)));\n\n $testClass = $this;\n\n $imapAdapter\n ->expects($this->any())\n ->method('getMessage')\n ->will($this->returnCallback(function ($id) use ($testClass) {\n return $testClass->createImapStorageMessage($id);\n }));\n\n\n $messages = $this->imapHelper->fetchMails($imapAdapter, array(), null, null, true, true);\n\n $this->assertEquals($asserts, $messages);\n }", "function email_get_mails($userid, $courseid=NULL, $sort = NULL, $limitfrom = '', $limitnum = '', $options = NULL) {\n\n\tglobal $CFG;\n\n\t// For apply order, I've writting an sql clause\n\t$sql = \"SELECT m.id, m.userid as writer, m.course, m.subject, m.timecreated, m.body\n FROM {$CFG->prefix}email_mail m\n LEFT JOIN {$CFG->prefix}email_send s ON m.id = s.mailid \";\n\n\t// WHERE principal clause for filter userid\n\t$wheresql = \" WHERE s.userid = $userid\n\t\t\t\t\tAND s.sended = 1\";\n\tif ( $courseid != SITEID ) {\n\t\t// WHERE principal clause for filter courseid\n\t\t$wheresql = \" WHERE s.course = $courseid\n\t\t\t\t\tAND s.sended = 1\";\n\t}\n\n\tif ( $options ) {\n\t\tif ( isset($options->folderid ) ) {\n\t\t\t// Filter by folder?\n\t\t\tif ( $options->folderid != 0 ) {\n\n\t\t\t\t// Get folder\n\t\t\t\t$folder = email_get_folder($options->folderid);\n\n\t\t\t\tif ( email_isfolder_type($folder, EMAIL_SENDBOX) ) {\n\t\t\t\t\t// ALERT!!!! Modify where sql, because now I've show my inbox ==> email_send.userid = myuserid\n\t\t\t\t\t$wheresql = \" WHERE m.userid = $userid\n\t\t\t\t\t\t\t\t\tAND s.sended = 1\";\n\t\t\t\t\tif ( $courseid != SITEID) {\n\t\t\t\t\t\t// WHERE principal clause for filter courseid\n\t\t\t\t\t\t$wheresql = \" WHERE m.course = $courseid\n\t\t\t\t\t\t\t\t\t\tAND s.sended = 1\";\n\t\t\t\t\t}\n\t\t\t\t} else if ( email_isfolder_type($folder, EMAIL_DRAFT) ) {\n\t\t\t\t\t// ALERT!!!! Modify where sql, because now I've show my inbox ==> email_send.userid = myuserid\n\t\t\t\t\t$wheresql = \" WHERE m.userid = $userid\n\t\t\t\t\t\t\t\t\tAND s.sended = 0\";\n\t\t\t\t\tif ( $courseid != SITEID) {\n\t\t\t\t\t\t// WHERE principal clause for filter courseid\n\t\t\t\t\t\t$wheresql = \" WHERE m.course = $courseid\n\t\t\t\t\t\t\t\t\t\tAND s.sended = 0\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$sql .= \" LEFT JOIN {$CFG->prefix}email_foldermail fm ON m.id = fm.mailid \";\n\t\t\t\t$wheresql .= \" AND fm.folderid = $options->folderid \";\n\t\t\t\t$groupby = \" GROUP BY m.id\";\n\n\t\t\t} else {\n\t\t\t\t/// If folder == 0, I've get inbox\n\t\t\t\t// Get folder\n\t\t\t\t$folder = email_get_root_folder($userid, EMAIL_INBOX);\n\t\t\t\t$sql .= \" LEFT JOIN {$CFG->prefix}email_foldermail fm ON m.id = fm.mailid \";\n\t\t\t\t$wheresql .= \" AND fm.folderid = $folder->id \";\n\t\t\t\t$groupby = \" GROUP BY m.id\";\n\t\t\t}\n\t\t} else {\n\t\t\t/// If folder == 0, I've get inbox\n\t\t\t// Get folder\n\t\t\t$folder = email_get_root_folder($userid, EMAIL_INBOX);\n\t\t\t$sql .= \" LEFT JOIN {$CFG->prefix}email_foldermail fm ON m.id = fm.mailid \";\n\t\t\t$wheresql .= \" AND fm.folderid = $folder->id \";\n\t\t\t$groupby = \" GROUP BY m.id\";\n\t\t}\n\t} else {\n\t\t/// If no options, I've get inbox, per default get this folder\n\t\t// Get folder\n\t\t$folder = email_get_root_folder($userid, EMAIL_INBOX);\n\t\t$sql .= \" LEFT JOIN {$CFG->prefix}email_foldermail fm ON m.id = fm.mailid \";\n\t\t$wheresql .= \" AND fm.folderid = $folder->id \";\n\t\t$groupby = \" GROUP BY m.id\";\n\t}\n\n\tif ($sort) {\n\t\t$sortsql = ' ORDER BY '.$sort;\n\t} else {\n\t\t$sortsql = ' ORDER BY m.timecreated';\n\t}\n\n\treturn get_records_sql($sql.$wheresql.$groupby.$sortsql, $limitfrom, $limitnum);\n}", "private function fromListSendMail($email_info = array(), $seeker_email_info = array(), $to = 'seeker')\r\t{\r\t\trequire_once 'Project/Code/1_Website/Applications/User_Account/Modules/mail/email.php';\r\t\t\r\t\t$from_email = \"raymond.baldonado@starfi.sh\";\r\t\t$from_name\t= \"Raymond\";\r\t\t$subject\t= \"New Lead from Looking for Eldercare\";\r\t\t\r\t\t\r\t\t$images = array(\r\t\t\t'banner'\t=> 'Project/Design/1_Website/Applications/Seeker/images/Eldercare-email-template-banner.png',\r\t\t\t'icon'\t\t=> 'Project/Design/1_Website/Applications/Seeker/images/Eldercare-email-template-icon.png',\r\t\t\t'logo'\t\t=> 'Project/Design/1_Website/Applications/Seeker/images/Eldercare-email-template-logo.png'\r\t\t);\r\t\t\r\t\tif ($to == 'seeker')\r\t\t{\r\t\t\t$view = new seekerView();\r\t\t\t$view->_set('email_to', $to);\r\t\t\t$view->_set('email_info', $seeker_email_info);\r\t\t\t\r\t\t\t$body = $view->displayEmailTemplate();\r\t\t\t\r\t\t\tforeach ($email_info['hcp'] as $hcp)\r\t\t\t{\r\t\t\t\temail::send_email($hcp['email'], $hcp['name'], $from_email, $from_name, $subject, $body, '', '', $images);\r\t\t\t}\r\t\t}\r\t\t\r\t\telse\r\t\t{\r\t\t\t$view = new seekerView();\r\t\t\t$view->_set('email_to', $to);\r\t\t\t\r\t\t\tinclude_once 'Project/Code/System/House_Type/house_types.php';\r\t\t\t$house_types = new house_types();\r\t\t\t//var_dump($house_types->selectHcpHouseTypeArray('17'));die;\r\t\t\t$counter = 0; //Manual looping to get the house types of each hcp\r\t\t\t$house_type_temp = '';\r\t\t\tforeach ($email_info['hcp'] as $hcp_info)\r\t\t\t{\r\t\t\t\tforeach ($house_types->selectHcpHouseTypeArray($hcp_info['hcp_id']) as $house_type)\r\t\t\t\t{\r\t\t\t\t\t$house_type_temp .= $house_type['house_type'].', '; \r\t\t\t\t}\r\t\t\t\t$house_type_temp = rtrim($house_type_temp, ', ');\r\t\t\t\t$email_info['hcp'][$counter]['house_type'] = $house_type_temp;\r\t\t\t\t$counter++;\r\t\t\t}\r\t\t\t\r\t\t\t$house_type_temp = '';\r\t\t\t\r\t\t\t$view->_set('email_info', $email_info['hcp']);\r\t\t\t$body = $view->displayEmailTemplate();\r\t\t\t\r\t\t\t$to_email\t= $seeker_email_info['seeker_email'];\r\t\t\t$to_name\t= $seeker_email_info['seeker_name'];\r\t\t\t\r\t\t\temail::send_email($to_email, $to_name, $from_email, $from_name, $subject, $body, '', '', $images);\r\t\t}\r\t\t\r\t}", "function usage()\n{\nob_start(); \n?>\nCheck whether PM in 'sent' folder is read by recipient.\nParameters (use one of them):\nmessage_id - ID of private messsage (provided by Friends module as {message_id})\ncopy_id - ID of PM copy in 'sent' folder (provided by Messaging module as {message_id})\n\nReturns tagdata if message is read, and no results if it's not read yet.\n\n{exp:messaging:private_messages folder=\"sent\"}\n{exp:is_message_read:check copy_id=\"{message_id}\"}\n{if no_results}\n&lt;div class=\"unread\"&gt;\n{/if}\n&lt;div class=\"read\"&gt;\n{/exp:is_message_read:check}\n{subject}&lt;/div&gt;\n{/exp:messaging:private_messages}\n\n<?php\n$buffer = ob_get_contents();\n\t\nob_end_clean(); \n\nreturn $buffer;\n}", "abstract protected function _attachmentsList();", "function email_print_tree_myfolders($userid, $courseid) {\n\n\tglobal $CFG;\n\n\t$strfolders = get_string('folders', 'block_email_list');\n\t$stredit \t= get_string('editfolders', 'block_email_list');\n\t$strcourse = get_string('course');\n\t$strfolderopened = s(get_string('folderopened'));\n $strfolderclosed = s(get_string('folderclosed'));\n\n $spancounter = 1;\n\n\t// For title blocks\n\t$startdivtitle\t= '<div class=\"title\">';\n\t$enddivtitle = '</div>';\n\n\tprint_side_block_start($startdivtitle.$strfolders.$enddivtitle);\n\n\t// Get my folders\n\tif ( $folders = email_get_root_folders($userid) ) {\n\n $numbermails = 0;\n $unreaded = '';\n\t\t$row = 0;\n\n\t\techo '<ul class=\"c_menu\">';\n\n\t\t// Clean trash\n\t\t$clean = '';\n\n\t\t// Get courses\n\t\tforeach ($folders as $folder) {\n\n\t\t\tunset($numbermails);\n\t\t\tunset($unreaded);\n\t\t\t// Get number of unreaded mails\n\t\t\tif ( $numbermails = email_count_unreaded_mails($userid, $courseid, $folder->id) ) {\n\t\t\t\t$unreaded = ' ('.$numbermails.')';\n\t\t\t} else {\n\t\t\t\t$unreaded = '';\n\t\t\t}\n\n\t\t\tif ( email_isfolder_type($folder, EMAIL_TRASH) ) {\n\t\t\t\t$clean .= '&#160;&#160;<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/folder.php?course='.$courseid.'&amp;folderid='.$folder->id.'&amp;action=cleantrash\">'.get_string('cleantrash', 'block_email_list').'</a>';\n\t\t\t}\n\n\t\t\t// Now, print all subfolders it\n\t\t\t$subfolders = email_get_subfolders($folder->id, $courseid);\n\n\t\t\t// LI\n\t\t\techo '<li class=\"r'. $row .'\">';\n\t echo '<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/index.php?id='.$courseid.'&amp;folderid='.$folder->id.'\">'.$folder->name.$unreaded.'</a>';\n\n\t\t\t// If subfolders\n\t\t\tif ( $subfolders ) {\n\t\t\t\temail_print_subfolders( $subfolders, $userid, $courseid );\n\t\t\t}\n\t\t\techo '</li>';\n\t\t\t$row = $row ? 0:1;\n\t\t}\n\n\n\t\techo '</ul>';\n\n\t\techo '<div class=\"footer\">'.$clean.'</div>';\n\t\t// For admin folders\n\t\techo '<div class=\"footer\"><a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/folder.php?course='.$courseid.'&amp;action='.md5('admin').'\"><b>'.$stredit.'</b></a></div>';\n\n\t\tprint_side_block_end();\n\n\t}\n\n}", "function fm_get_all_sharedf_by_folder($original, $foldid) {\r\n\t$tmpvar = get_records('fmanager_folders',\"owner=$original AND pathid\",$foldid);\r\n\r\n\treturn $tmpvar;\t\r\n}", "function email_get_foldermail($mailid, $userid) {\n\n\tglobal $CFG;\n\n\t// Prepare select\n\t$sql = \"SELECT f.id, f.name, fm.id as foldermail\n FROM {$CFG->prefix}email_folder f\n INNER JOIN {$CFG->prefix}email_foldermail fm ON f.id = fm.folderid\n WHERE fm.mailid = $mailid\n AND f.userid = $userid\n ORDER BY f.timecreated\";\n\n\t// Return value of select\n\treturn get_records_sql($sql);\n}", "function email_get_root_folder_name($type) {\n\n\tif ($type == EMAIL_INBOX) {\n\t\t$name = get_string('inbox', 'block_email_list');\n\t} else if ($type == EMAIL_SENDBOX) {\n\t\t$name = get_string('sendbox', 'block_email_list');\n\t} else if ($type == EMAIL_TRASH) {\n\t\t$name = get_string('trash', 'block_email_list');\n\t} else if ($type == EMAIL_DRAFT) {\n\t\t$name = get_string('draft', 'block_email_list');\n\t} else {\n\t\t// Type is not defined\n\t\t$name = '';\n\t}\n\n\treturn $name;\n}", "function mail_select_box($boxname = \"INBOX\") {\n\t\tif($this->mail_protocol == \"imap\") {\n\t\t\t$original_name = preg_replace(\"/\\\"(.*)\\\"/\",\"\\\\1\", $boxname);\n\t\t\t$boxname = $this->fix_prefix($original_name,1);\n\t\t\t$this->mail_send_command(\"SELECT \\\"$boxname\\\"\".$this->CRLF);\n\t\t\t$buffer = $this->mail_get_line();\n\t\t\tif(preg_match(\"/^\".$this->_sid.\" NO/i\",$buffer)) { \n\t\t\t\tif($this->mail_subscribe_box($original_name)) {\n\t\t\t\t\t$this->mail_send_command(\"SELECT \\\"$boxname\\\"\".$this->CRLF);\n\t\t\t\t\t$buffer = $this->mail_get_line();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(preg_match(\"/^(\".$this->_sid.\" (NO|BAD))/i\",$buffer)) { $this->mail_error_msg = $buffer; return 0; }\n\t\t\t$boxinfo = Array();\n\t\t\t/* get total, recent messages and flags */\n\t\t\twhile(!preg_match(\"/^(\".$this->_sid.\" OK)/i\",$buffer)) {\n\t\t\t\tif(preg_match(\"/[ ]?\\\\*[ ]?([0-9]+)[ ]EXISTS/i\",$buffer,$regs))\n\t\t\t\t\t$boxinfo[\"exists\"] = $regs[1];\n\t\t\t\tif(preg_match(\"/[ ]?\\\\*[ ]?([0-9])+[ ]RECENT/i\",$buffer,$regs))\n\t\t\t\t\t$boxinfo[\"recent\"] = $regs[1];\n\t\t\t\tif(preg_match(\"/[ ]?\\\\*[ ]?FLAGS[ ]?\\\\((.*)\\\\)/i\",$buffer,$regs))\n\t\t\t\t\t$boxinfo[\"flags\"] = $regs[1];\n\t\t\t\t$buffer = $this->mail_get_line();\n\t\t\t}\n\t\t}\n\t\t$this->_current_folder = $boxname;\n\t\treturn $boxinfo;\n\t}", "protected static function mails()\n {\n if (is_dir(root().'app/mails')) {\n foreach (self::fetch('app/mails', false) as $file) {\n need($file);\n }\n }\n }", "public function list_folders($root = '', $name = '*', $filter = null, $rights = null, $skip_sort = false, $subscribed = false) {\n\n // get 'user' forlders\n $query = \"SELECT name FROM dbmail_mailboxes \";\n\n if ($subscribed) {\n $query .= \"inner join dbmail_subscription ON mailbox_idnr = mailbox_id \";\n }\n\n $query .= \" WHERE owner_idnr = {$this->dbmail->escape($this->user_idnr)} \"\n . \" AND deleted_flag = 0 \";\n\n if (!$skip_sort) {\n $query .= \" ORDER BY name ASC \";\n }\n\n $res = $this->dbmail->query($query);\n\n $folders = array();\n $additionalFolders = array();\n while ($row = $this->dbmail->fetch_assoc($res)) {\n\n if (strtoupper(substr($row['name'], 0, 5)) == 'INBOX') {\n // add 'INBOX' to main folders list\n $folders[] = $row['name'];\n } else {\n // put everything except 'INBOX' within '$additionalFolders' container\n $additionalFolders[] = $row['name'];\n }\n }\n\n // append $additionalFolders to main folders list\n foreach ($additionalFolders as $additionalFolder) {\n $folders[] = $additionalFolder;\n }\n\n // search for shared folders\n $sharingsUserPath = $this->namespace['other'][0][0];\n $sharingsUserDelimiter = $this->namespace['other'][0][1];\n $sharingsPublicPath = $this->namespace['shared'][0][0];\n $sharingsPublicDelimiter = $this->namespace['shared'][0][1];\n\n $sharingsSql = \"SELECT dbmail_users.userid AS mailbox_owner, dbmail_mailboxes.mailbox_idnr, dbmail_mailboxes.name as mailbox_name \"\n . \"FROM dbmail_acl \"\n . \"INNER JOIN dbmail_subscription ON dbmail_acl.user_id = dbmail_subscription.user_id AND dbmail_acl.mailbox_id = dbmail_subscription.mailbox_id \"\n . \"INNER JOIN dbmail_mailboxes ON dbmail_acl.mailbox_id = dbmail_mailboxes.mailbox_idnr \"\n . \"INNER JOIN dbmail_users ON dbmail_mailboxes.owner_idnr = dbmail_users.user_idnr \"\n . \"WHERE dbmail_acl.user_id = {$this->dbmail->escape($this->user_idnr)} \"\n . \"AND dbmail_acl.lookup_flag = 1 \"\n . \"ORDER BY mailbox_owner, mailbox_name \";\n\n $sharingsResult = $this->dbmail->query($sharingsSql);\n while ($sharing = $this->dbmail->fetch_assoc($sharingsResult)) {\n\n $mailbox_owner = $sharing['mailbox_owner'];\n $mailbox_name = $sharing['mailbox_name'];\n\n // folder owner by 'PUBLIC_FOLDER_USER' or by a real user?\n if ($mailbox_owner == self::PUBLIC_FOLDER_USER) {\n // hide owner userId from folder path\n $path = $sharingsPublicPath . $sharingsPublicDelimiter . $mailbox_name;\n } else {\n $path = $sharingsUserPath . $sharingsUserDelimiter . $mailbox_owner . $sharingsUserDelimiter . $mailbox_name;\n }\n\n $folders[] = $path;\n }\n\n return $folders;\n }", "public function queueManagement(int $mid){\n\t\t// \n\t\t// A queue number is added in mailbox table for getting the last queue number of the user, the queue number should not be used for sent folder because they are the emails which are send by us not came from them.\n\t\t// \n\t\t// Initially the folder should take the emails in send but when the project starts the send emails are not necessarily be taken from the email box of gmail etc or it can be taken into consideration but they will create a confustion as, to whom the reply will be associated.\n\t}", "public function count($folder = null, $mode = 'ALL', $force = false, $status = true) {\n\n /**\n * Some actions (eg. roundcube/program/steps/mail/move_del.inc) call this \n * method twice to retrieve messages count before and after doing stuff:\n * \n * $old_count = $RCMAIL->storage->count(NULL, $threading ? 'THREADS' : 'ALL');\n * $msg_count = $RCMAIL->storage->count(NULL, $threading ? 'THREADS' : 'ALL');\n * \n * So we can't cache results or the second call will not get fresh data ('$force' flag is not supplied)\n */\n if (is_array($folder) && count($folder) > 0) {\n // mailboxes list supplied\n $target = $folder;\n } elseif (is_string($folder) && strlen($folder) > 0) {\n // single mailbox supplied\n $target = array($folder);\n } elseif (array_key_exists('search_scope', $_SESSION) && $_SESSION['search_scope'] == 'all') {\n // no mailbox supplied, search within all mailboxes\n $target = $this->list_folders_subscribed('', '*', 'mail', null, true);\n } else if (array_key_exists('search_scope', $_SESSION) && $_SESSION['search_scope'] == 'sub') {\n // no mailbox supplied, search within current mailbox and nested ones\n $target = $this->list_folders_subscribed($this->folder, '*', 'mail');\n } elseif (strlen($this->folder) > 0) {\n $target = array($this->folder);\n }\n\n if (!is_array($target) || count($target) == 0) {\n // empty set!!!\n return 0;\n }\n\n $folders = $this->_format_folders_list($target);\n\n // map mailboxes ID\n $mailboxes = array();\n foreach ($folders as $folder_name) {\n\n // Retrieve mailbox ID\n $mail_box_idnr = $this->get_mail_box_id($folder_name);\n if (!$mail_box_idnr) {\n // Not found - Skip!\n return FALSE;\n }\n\n // ACLs check ('lookup' and 'read' grants required )\n $ACLs = $this->_get_acl(NULL, $mail_box_idnr);\n if (!is_array($ACLs) || !in_array(self::ACL_LOOKUP_FLAG, $ACLs) || !in_array(self::ACL_READ_FLAG, $ACLs)) {\n // Unauthorized - Skip!\n return FALSE;\n }\n\n // Add mailbox ID to mailboxes list\n $mailboxes[$mail_box_idnr] = $folder_name;\n }\n\n /*\n * Init $additional_joins list\n */\n $additional_joins = '';\n\n /*\n * Retrieve search string \n */\n $search_str = NULL;\n if (is_array($this->search_set) && array_key_exists(0, $this->search_set)) {\n $tmp = $this->format_search_parameters($this->search_set[0]);\n $search_str = $tmp->search;\n }\n\n $search_conditions = $this->_translate_search_parameters($search_str);\n if (!$search_conditions) {\n return FALSE;\n }\n\n /*\n * set additional join tables according to supplied search / filter conditions\n */\n if (is_object($search_conditions) && property_exists($search_conditions, 'additional_join_tables')) {\n $additional_joins .= \" {$search_conditions->additional_join_tables} \";\n }\n\n /*\n * Set base 'where' conditions\n */\n $where_conditions = \" WHERE dbmail_messages.mailbox_idnr IN (\" . implode(\",\", array_keys($mailboxes)) . \")\";\n $where_conditions .= \" AND dbmail_messages.status < \" . self::MESSAGE_STATUS_DELETE . \" \";\n\n /*\n * Apply search criteria\n */\n if (isset($search_conditions->additional_where_conditions) && strlen($search_conditions->additional_where_conditions) > 0) {\n $where_conditions .= \" AND {$search_conditions->additional_where_conditions}\";\n $additional_joins .= implode(PHP_EOL, $search_conditions->additional_joins);\n }\n\n /*\n * add 'where' conditions according to supplied search / filter conditions\n */\n if (is_object($search_conditions) && property_exists($search_conditions, 'formatted_filter_str') && strlen($search_conditions->formatted_filter_str) > 0) {\n $where_conditions .= \" AND ( {$search_conditions->formatted_filter_str} ) \";\n }\n\n if (is_object($search_conditions) && property_exists($search_conditions, 'formatted_search_str') && strlen($search_conditions->formatted_search_str) > 0) {\n $where_conditions .= \" AND ( {$search_conditions->formatted_search_str} ) \";\n }\n\n if ($mode == 'UNSEEN') {\n $where_conditions .= \" AND dbmail_messages.seen_flag = 0 \";\n }\n\n /*\n * Prepare base query\n */\n $query = \" SELECT mailbox_idnr, dbmail_messages.message_idnr \"\n . \" FROM dbmail_messages \";\n\n /*\n * Join to dbmail_physmessage when needed \n */\n if (isset($search_conditions->needs_physmessages) && $search_conditions->needs_physmessages) {\n $query .= \" INNER JOIN dbmail_physmessage ON dbmail_messages.physmessage_id = dbmail_physmessage.id \";\n }\n\n $query .= \" {$additional_joins} \"; \n $query .= \" {$where_conditions} \";\n \n if ($this->rcubeInstance->config->get('dbmail_messages_disable_cache')){\n $query .= \" group by dbmail_messages.message_idnr \"; //patched cc'\n }\n /*\n * Execute query\n */\n $res = $this->dbmail->query($query);\n \n if ($this->rcubeInstance->config->get('dbmail_messages_disable_cache')){\n return $res->rowCount();\n }\n\n /*\n * Retrieve full messages count and folder specific messages count\n */\n $total_messages = 0;\n $mailbox_messages = array();\n while ($row = $this->dbmail->fetch_assoc($res)) {\n\n $mailbox_name = $mailboxes[$row['mailbox_idnr']];\n $message_idnr = $row['message_idnr'];\n\n if (!array_key_exists($mailbox_name, $mailbox_messages)) {\n $mailbox_messages[$mailbox_name] = array();\n }\n\n if (!in_array($message_idnr, $mailbox_messages[$mailbox_name])) {\n $total_messages++;\n $mailbox_messages[$mailbox_name][] = $message_idnr;\n }\n }\n\n /*\n * Cache messages count and latest message id\n */\n if ($mode == 'ALL' && $status) {\n foreach ($mailbox_messages as $mailbox_name => $messages) {\n\n $mailbox_messages_count = count($messages);\n\n $this->set_folder_stats($mailbox_name, 'cnt', $mailbox_messages_count);\n $this->set_folder_stats($mailbox_name, 'maxuid', ($mailbox_messages_count ? $this->get_latest_message_idnr($mailbox_name) : 0));\n }\n }\n\n return $total_messages;\n }", "private function getpart($mbox,$mid,$p,$partno)\n\t{\n\t\t\n\t\t// DECODE DATA\n\t\t$data = ($partno) ?\n\t\timap_fetchbody($mbox,$mid,$partno): // multipart\n\t\timap_body($mbox,$mid); // simple\n\t\n\t\t// Any part may be encoded, even plain text messages, so check everything.\n\t\tif\t($p->encoding==4)\n\t\t\t$data = quoted_printable_decode($data);\n\t\telseif ($p->encoding==3)\n\t\t$data = base64_decode($data);\n\t\n\t\t// PARAMETERS\n\t\t// get all parameters, like charset, filenames of attachments, etc.\n\t\t$params = array();\n\t\tif ($p->parameters)\n\t\t\tforeach ($p->parameters as $x)\n\t\t\t$params[strtolower($x->attribute)] = $x->value;\n\t\tif ($p->dparameters)\n\t\t\tforeach ($p->dparameters as $x)\n\t\t\t$params[strtolower($x->attribute)] = $x->value;\n\t\n\t\t// ATTACHMENT\n\t\t// Any part with a filename is an attachment,\n\t\t// so an attached text file (type 0) is not mistaken as the message.\n\t\tif ($params['filename'] || $params['name']) {\n\t\t\t// filename may be given as 'Filename' or 'Name' or both\n\t\t\t$filename = ($params['filename'])? $params['filename'] : $params['name'];\n\t\t\t// filename may be encoded, so see imap_mime_header_decode()\n\t\t\t$fname = tempnam(null,'blog-file-');\n\t\t\t$file = fopen($fname,'w');\n\t\t\tfwrite($file,$data);\n\t\t\tfclose($file);\n\t\t\tchmod($fname,0644);\n\t\n\t\t\t$this->filenames[] = array('filename'=>$fname,'name'=>$filename);\n\t\t}\n\t\n\t\t// TEXT\n\t\tif ($p->type==0 && $data) {\n\t\t\t// Messages may be split in different parts because of inline attachments,\n\t\t\t// so append parts together with blank row.\n\t\t\tif (strtolower($p->subtype)=='plain')\n\t\t\t\t$this->text.= trim($data) .\"\\n\\n\";\n\t\t\telse\n\t\t\t\t$this->html.= $data .\"<br><br>\";\n\t\t\t$charset = $params['charset']; // assume all parts are same charset\n\t\t}\n\t\n\t\t// EMBEDDED MESSAGE\n\t\t// Many bounce notifications embed the original message as type 2,\n\t\t// but AOL uses type 1 (multipart), which is not handled here.\n\t\t// There are no PHP functions to parse embedded messages,\n\t\t// so this just appends the raw source to the main message.\n\t\telseif ($p->type==2 && $data) {\n\t\t\t$this->text.= $data.\"\\n\\n\";\n\t\t}\n\t\n\t\t// SUBPART RECURSION\n\t\tif ($p->parts) {\n\t\t\tforeach ($p->parts as $partno0=>$p2)\n\t\t\t\t$this->getpart($mbox,$mid,$p2,$partno.'.'.($partno0+1)); // 1.2, 1.2.1, etc.\n\t\t}\n\t}", "public function testGetDomainWildcardCatchAllInbox()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function email_copy_attachments($dirsrc, $mailiddst, $internalmailpath=NULL, $attachment=NULL) {\n\n global $CFG;\n\n\t// Get directory for save this attachments\n\t$dirsrc = $CFG->dataroot .'/'.$dirsrc;\n\t$dirdst = email_file_area($mailiddst) .'/'.$attachment;\n\n\tif (! $internalmailpath) {\n\t\t// Copy this attachments\n\t\tif (! copy($dirsrc, $dirdst) ) {\n\t\t\tdebugging( \"src:$dirsrc, dst: $dirdst \");\n\t\t\tprint_error('failcopingattachments', 'block_email_list');\n\t\t}\n\t} else {\n\t\tif ( file_exists($internalmailpath.'/'.$attachment) ) {\n\t\t\t// Copy attachments but src is internalmail path.\n\t\t\tif (! copy($internalmailpath.'/'.$attachment, $dirdst) ) {\n\t\t\t\tnotify('Failed when copying attachmets in migration. src: '.$internalmailpath.'/'.$attachment.' to dst:'.$dirdst);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n}", "function check_mailbox ($domain)\n{\n $limit = get_domain_properties ($domain);\n if ($limit['mailboxes'] >= 0)\n {\n if ($limit['mailbox_count'] >= $limit['mailboxes'])\n {\n return false;\n }\n }\n return true;\n}", "function _build_attachement()\r\n\t\t{\r\n\t\t$this->boundary= \"------------\" . md5( uniqid(\"myboundary\") ); // TODO : variable bound\r\n\r\n\t\t$this->headers .= \"MIME-Version: 1.0\\nContent-Type: multipart/mixed;\\n boundary=\\\"$this->boundary\\\"\\n\\n\";\r\n\t\t$this->fullBody = \"This is a multi-part message in MIME format.\\n--$this->boundary\\nContent-Type: text/plain; charset=utf-8\\n\"\r\n\t\t\t. \"Content-Transfer-Encoding: 7bit\\n\\n\" . $this->body .\"\\n\";\r\n\t\t$sep= chr(13) . chr(10);\r\n\r\n\t\t$ata= array();\r\n\t\t$k=0;\r\n\r\n\t\t// for each attached file, do...\r\n\t\tfor( $i=0; $i < sizeof( $this->aattach); $i++ )\r\n\t\t\t{\r\n\t\t\t$filename = $this->aattach[$i];\r\n\t\t\t$basename = $this->aattachname[$i];\r\n\t\t\t$ctype = $this->actype[$i]; // content-type\r\n\t\t\t$disposition = $this->adispo[$i];\r\n \t\t\tif( ! file_exists( $filename) )\r\n\t\t\t\t{\r\n\t\t\t\techo \"Class Mail, method attach : file $filename can't be found\";\r\n\t\t\t\texit;\r\n\t\t\t\t}\r\n\t\t\t$subhdr= \"--$this->boundary\\nContent-type: $ctype;\\n name=\\\"$basename\\\"\\nContent-Transfer-Encoding: base64\\nContent-Disposition: $disposition;\\n filename=\\\"$basename\\\"\\n\";\r\n\t\t\t$ata[$k++] = $subhdr;\r\n\t\t\t// non encoded line length\r\n\t\t\t$linesz= filesize( $filename)+1;\r\n\t\t\t$fp= fopen( $filename, 'r' );\r\n\t\t\t$data= base64_encode(fread( $fp, $linesz));\r\n\t\t\tfclose($fp);\r\n\t\t\t$ata[$k++] = chunk_split( $data );\r\n \t}\r\n\t\t$this->attachment= implode($sep, $ata);\r\n\t\t}", "function returnFolderMessages($message){\r\n\t\t$response = Project::getAjaxResponse();\r\n\t\t$htmlMess = \"\"; $i = 1;\r\n\t\tforeach ($message['aMessages'] as $userMessage){\r\n\t\t if ($i/2 == 1){$i = 1;} else {$i++;}\r\n\t\t if ($userMessage['avatars_id']){\r\n\t\t if ($userMessage['sys_av_id']){\r\n\t\t $avPath = $userMessage['sys_av_path'];\r\n\t\t }else{\r\n\t\t $avPath = $userMessage['avatars_path'];\r\n\t\t }\r\n\t\t $avName = $userMessage['avatars_av_name'];\r\n\t\t }else {\r\n\t\t $avPath = 'no90.jpg';\r\n\t\t $avName = 'no image';\r\n\t\t }\r\n\t\t if (!$userMessage['is_read']) $sIsRead = '<dd class=\"message-status unread-message-status\"><div class=\"status-wrp\"><span class=\"with-icon-s\"><i class=\"icon-s mess-unread-icon\"></i>Ваше последнее отправленное сообщение не прочтено</span></div></dd>';\r\n\t\t else $sIsRead = '';\r\n\t\t $htmlMess .= '<li class=\"it clearfix\">\r\n\t\t\t\t\t<dl>\r\n\t\t\t\t\t\t<dt><a href=\"'.Project::getRequest() -> createUrl('User', 'Profile', null, $userMessage['author_login']).'\" class=\"with-icon-s\"><i class=\"icon-s online-icon\"></i>'.$userMessage['author_login'].'</a> [ <a href=\"'.Project::getRequest() -> createUrl('User', 'Profile', null, $userMessage['author_login']).'\">'.$userMessage['author_login'].'</a> ]</dt>\r\n\t\t\t\t\t\t<dd class=\"av\"><a href=\"'.Project::getRequest() -> createUrl('User', 'Profile', null, $userMessage['author_login']).'\"><img class=\"avatar\" src=\"'.$this->image_url.'avatar/'.$avPath.'\" alt=\"'.$avName.'\" /></a></dd>\r\n\t\t\t\t\t\t<dd class=\"date\">'.$userMessage['send_date'].'</dd>\r\n\t\t\t\t\t\t<dd class=\"theme\">'.$userMessage['header'].'</dd>\r\n\t\t\t\t\t\t<dd class=\"message srv-msg\">'.nl2br($userMessage['m_text']).'</dd>\r\n\t\t\t\t\t\t'.$sIsRead.'\r\n\t\t\t\t\t</dl>\r\n\t\t\t\t\t<ul class=\"links\">\r\n\t\t\t\t\t\t<li><a href=\"'.Project::getRequest() -> createUrl('Messages', 'CorrespondenceWith').'/corr_user_id:'.$userMessage['author_id'].'\" class=\"new-link\">Переписка</a> ( <span class=\"of-all-count\">1</span> / 12)</li>\r\n\t\t\t\t\t\t<li><a href=\"'.Project::getRequest() -> createUrl('Messages', 'SendMessage').'/message_action:reply/mess_id:'.$userMessage['id'].'\">Написать сообщение</a></li>\r\n\t\t\t\t\t\t<li><a href=\"#\">Добавить в друзья</a></li>\r\n\t\t\t\t\t\t<li><a onclick=\"return DelMessage('.$userMessage['messages_id'].', '.(int)$message['current_page'].', '.(int)$message['groupId'].', \\''.$message['groupName'].'\\');\" href=\"javascript: void(0);\" class=\"spam-link\">Удалить</a></li>\r\n\t\t\t\t\t</ul>\r\n\t\t\t\t</li>';\r\n\t\t}\r\n\t\tif (!$htmlMess) $htmlMess = \"В данной группе нет писем\";\r\n\t\t\r\n\t\t$response -> block('cmod_messages', true, $htmlMess);\r\n\t\t$response -> block('titleGroupName', true, $message['groupName']);\r\n\t\t$response -> block('total_mesall', true, '( <span class=\"of-all-count\">'.$message['messageCountAll']['new'].'</span> / '.$message['messageCountAll']['read'].' )');\r\n\t\t$response -> block('total_mes'.$message['groupId'], true, '( <span class=\"of-all-count\">'.$message['messageCountGroup']['new'].'</span> / '.$message['messageCountGroup']['read'].' )');\r\n\t\t$response -> block('myMessagePager', true, $message['myMessagePager']);\r\n\t\t\r\n\t}", "function send_emails() {\n $settings = new Settings();\n $mail_companies = $settings->get_mailto_companies();\n $failed_list_mails = array();\n $mail_reader = new EmailReader(dirname(__FILE__) . '/mails', $this->user_information);\n foreach ($this->cookie_list as $item) {\n if (!$item->has_email()) {\n \t$failed_list_mails[] = $item;\n }\n else {\n $template = $mail_reader->get_companies_mail($item, $mail_companies);\n if (!$this->mail_to($item, $template, $mail_companies)) {\n $failed_list_mails[] = $item;\n }\n\t }\n }\n $this->update_amounts_used($this->cookie_list);\n\n\n $attachments = array();\n\n $failed_list_letters = array();\n foreach ($this->cookie_list as $item) {\n if (!$item->has_address()) {\n $failed_list_letters[] = $item;\n }\n else {\n $letter_generator = new LetterGenerator($this->user_information);\n $pdf = $letter_generator->generate_letter_string($item);\n if ($pdf) {\n \t$folder_writer = new FolderHandler();\n \t$file = $folder_writer->store_file($pdf, \"pdf\");\n \tif ($file) {\n \t\t$attachments[] = $file;\n \t}\n \telse {\n \t\t$failed_list_letters[] = $item;\n \t}\n }\n else {\n $failed_list_letters[] = $item;\n }\n }\n }\n\n\n\n return $this->send_confirmation_mail($attachments, $failed_list_mails, array_diff($this->cookie_list,\n $failed_list_mails), $failed_list_letters, array_diff($this->cookie_list, $failed_list_letters),\n $mail_companies);\n }", "function email_get_folder($folderid) {\n\n\t$folder = new object();\n\n\tif ( $folder = get_record('email_folder', 'id', $folderid) ) {\n\n\t\tif ( isset($folder->isparenttype) ) {\n\t\t\t// Only change in parent folders\n\t\t\tif ( ! is_null($folder->isparenttype) ) {\n\t\t\t\t// If is parent ... return language name\n\t\t\t\tif ( ( email_isfolder_type($folder, EMAIL_INBOX) ) ) {\n\t\t\t\t\t$folder->name = get_string('inbox', 'block_email_list');\n\t\t\t\t}\n\n\t\t\t\tif ( ( email_isfolder_type($folder, EMAIL_SENDBOX) ) ) {\n\t\t\t\t\t$folder->name = get_string('sendbox', 'block_email_list');\n\t\t\t\t}\n\n\t\t\t\tif ( ( email_isfolder_type($folder, EMAIL_TRASH) ) ) {\n\t\t\t\t\t$folder->name = get_string('trash', 'block_email_list');\n\t\t\t\t}\n\n\t\t\t\tif ( ( email_isfolder_type($folder, EMAIL_DRAFT) ) ) {\n\t\t\t\t\t$folder->name = get_string('draft', 'block_email_list');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $folder;\n}", "function email_get_folders($userid, $sort='id') {\n\n\treturn get_records('email_folder', 'userid', $userid, $sort);\n}", "function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = \"simple\"){\n\tglobal $server, $default_mailbox, $username, $password;\n\n\t// open a stream to default mailbox\n\t$imap_stream = imap_open($default_mailbox, $username, $password);\n\n\tif ($imap_stream === false) {\n\t\techo \"Cannot connect to IMAP server $server: \" . imap_last_error() . \"\\n\";\n\t\treturn false;\n\t}\n\n\techo \"Create a temporary mailbox and add \" . $message_count . \" msgs\\n\";\n\t$new_mailbox = create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type);\n\tif ($new_mailbox === false) {\n\t echo \"Cant create a temporary mailbox: \" . imap_last_error(). \"\\n\";\n\t return false;\n\t}\n\n\techo \".. mailbox '$new_mailbox' created\\n\";\n\n\t// reopen stream to new mailbox\n\tif (imap_reopen($imap_stream, $new_mailbox) === false) {\n\t\techo \"cant re-open '$new_mailbox' mailbox: \" . imap_last_error() . \"\\n\";\n\t\treturn false;\n\t}\n\n\treturn $imap_stream;\n}", "public function getAllMailFromFolder($iUser, $iFolder, $bIsSentbox, $bIsTrash)\n\t{\n\t\t$sWhere = ''; \n\t\tif ($bIsSentbox) \n\t\t{ \n\t\t\t$sWhere .= (int)$iUser . ' = m.owner_user_id' . ' AND ' . (int)$iFolder. ' = m.owner_folder_id AND m.owner_type_id != 3' ;\n\t\t} \n\t\telseif ($bIsTrash) \n\t\t{ \n\t\t\t$sWhere .= '(m.viewer_user_id = '.(int)$iUser.' AND m.viewer_type_id = 1) OR (m.owner_user_id = '.(int)$iUser.' AND m.owner_type_id = 1)'; \n\t\t} \n\t\telse \n\t\t{ \n\t\t\t$sWhere .= (int)$iUser . ' = m.viewer_user_id AND ' . (int)$iFolder . ' = m.viewer_folder_id AND m.viewer_type_id != 3' ;\n\t\t} \n\t\t\n\t\t$aMails = $this->database()->select('m.mail_id')\n\t\t\t->from($this->_sTable, 'm')\n\t\t\t->where($sWhere)\n\t\t\t->execute('getSlaveRows');\n\t\t\n\t\t$aOut = array();\n\t\t\n\t\tforeach ($aMails as $aMail) $aOut[] = $aMail['mail_id'];\n\t\t\n\t\treturn $aOut; \n\t}", "function gw_displayattachement($imb,$i,$struct=false){\n return;\n $part = 2;\n if(!$struct) return;\n $message = imap_fetchbody($imb,$i,$part);\n $name = $struct->parts[$part-1]->dparameters[0]->value;\n $type = $struct->parts[$part-1]->type;\n if(!in_array($type, array(4,5,6))) return;\n if($type==4) $type=\"audio/\";\n if($type==5) $type=\"image/\";\n if($type==6) $type=\"video/\";\n $type .= $struct->parts[$part-1]->subtype;\n $coding = $struct->parts[$part-1]->encoding;\n if ($coding == 0)\n $message = imap_7bit($message);\n elseif ($coding == 1)\n $wiadomsoc = imap_8bit($message);\n elseif ($coding == 2)\n $message = imap_binary($message);\n elseif ($coding == 3)\n $message = imap_base64($message);\n elseif ($coding == 4)\n $message = quoted_printable($message);\n elseif ($coding == 5)\n $message = $message;\n else return;\n return false;\n}", "public function inboxEpAction()\n\t{\n $inbox_parmas=$this->_request->getParams();\n\t\t$ticket_obj = new Ep_Message_Ticket();\n //$user_id =$this->adminLogin->userId ;\n //$user_type= $this->adminLogin->type ;\n if($this->user_type=='superadmin' || $this->adminLogin->loginName=='akeslassy' || $this->adminLogin->loginName=='mfouris' || $this->adminLogin->loginName=='julien' )\n\t\t{\n\t\t\t$ep_user_id=$inbox_parmas['ep_user_id'];\n\t\t\tif(!$ep_user_id)$ep_user_id=$this->user_id;\n\t\t\tif($ep_user_id && $ep_user_id!='all')\n\t\t\t\t$inbox_messages= $ticket_obj->getMasterInboxEP($ep_user_id);\n\t\t\telse\t\n\t\t\t\t$inbox_messages= $ticket_obj->getMasterInboxEP();\n\t\t\t\t\n\t\t\t$this->_view->ep_user_id=$ep_user_id;\t\n\t\t}\t\n\t\telse\t\n\t\t\t$inbox_messages= $ticket_obj->getMasterInboxEP($this->user_id);\n\t\t\t\n\t\t\t//echo $ticket_obj->getUnreadCount($user_type,$this->user_id);\n //echo \"<pre>\";print_r($inbox_messages);\n if(is_array($inbox_messages) && count($inbox_messages)>0)\n {\n $i=0;\n foreach($inbox_messages as $message)\n {\n $inbox_messages[$i]['sendername']=$ticket_obj->getUserName($message['userid']);\n $inbox_messages[$i]['recipientid']=$message['receiverId'];\n $inbox_messages[$i]['senderid']=$message['userid'];\n $inbox_messages[$i]['recipient']=$ticket_obj->getUserName($message['receiverId']);\n\t\t\t\t\t$inbox_messages[$i]['size']=formatSizeUnits(mb_strlen($message['content']));\n if($message['locked_user'])\n {\n $login_name=$ticket_obj->getLoginName($message['locked_user']);\n $locked_user=$login_name[0]['login'];\n $inbox_messages[$i]['locked_user_name']=\"Lock&eacute; par \".$locked_user;\n }\n $i++;\n }\n $this->_view->paginator = $inbox_messages;\n }\n else\n $this->_view->Inbox_Messages=\"Vous n'avez aucun message\";\n \n /**Edit-Place Contacts**/\n $get_EP_contacts=$ticket_obj->getEPContacts('\"salesuser\",\"partner\",\"customercare\",\"facturation\"');\n\t\t\tif(count($get_EP_contacts)>0)\n\t\t\t{\t\n $EP_contacts['all']='All';\n\t\t\t\tforeach($get_EP_contacts as $contact)\n {\n if($contact['contact_name']!=NULL)\n\t\t\t\t\t{\n $EP_contacts[$contact['identifier']]=$contact['contact_name'];\n\t\t\t\t\t\t$assign_contacts[$contact['identifier']]=$contact['contact_name'];\n\t\t\t\t\t}\t\n else\n {\n $contact['email']=explode(\"@\",$contact['email']);\n $EP_contacts[$contact['identifier']]=$contact['email'][0];\n\t\t\t\t\t\t$assign_contacts[$contact['identifier']]=$contact['email'][0];\n }\n }\n\t\t\t}\t\n if($EP_contacts!=='Not Exists')\n $this->_view->EP_contacts=$EP_contacts;\n\t\tif($assign_contacts!=='Not Exists')\n $this->_view->assign_contacts=$assign_contacts;\n if($Contributor_contacts!=='Not Exists')\n $this->_view->Contributor_contacts=$Contributor_contacts;\n if($clients_contacts!=='Not Exists')\n $this->_view->Cients_contacts=$clients_contacts;\n\t\t$this->_view->render(\"mastermail_inbox_ep\");\n\t}", "function email_count_unreaded_mails($userid, $courseid, $folderid=NULL) {\n\n\tglobal $CFG;\n\n\tif (! $folderid or $folderid <= 0 ) {\n\t\t// Get draft folder\n\t\tif ( $folder = email_get_root_folder($userid, EMAIL_INBOX) ) {\n\n\t\t\t$foldersid = $folder->id;\n\n\t\t\t// Get all subfolders\n\t\t\tif ( $subfolders = email_get_all_subfolders($folder->id) ) {\n\t\t\t\tforeach( $subfolders as $subfolder) {\n\t\t\t\t\t$foldersid .= ', '.$subfolder->id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sql = \"SELECT count(*)\n\t\t FROM {$CFG->prefix}email_mail m\n\t\t LEFT JOIN {$CFG->prefix}email_send s ON m.id = s.mailid\n\t\t LEFT JOIN {$CFG->prefix}email_foldermail fm ON m.id = fm.mailid \";\n\n\n\t\t\t// WHERE principal clause for filter by user and course\n\t\t\t$wheresql = \" WHERE s.userid = $userid\n\t\t\t\t\t\t AND s.course = $courseid\n\t\t\t\t\t\t AND fm.folderid IN ( $foldersid )\n\t\t\t\t\t\t AND s.readed = 0\n\t\t\t\t\t\t AND s.sended = 1\";\n\n\t\t\treturn count_records_sql( $sql.$wheresql );\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\t// return mails unreaded\n\t\t// wreturn count_records('email_send', 'userid', $userid, 'course', $courseid, 'readed', 0);\n\t} else {\n\n\t\t// Get folder\n\t\tif ( ! $folder = email_get_folder($folderid) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif ( email_isfolder_type($folder, EMAIL_INBOX) ) {\n\t\t\t// For apply order, I've writting an sql clause\n\t\t\t$sql = \"SELECT count(*)\n\t\t FROM {$CFG->prefix}email_mail m\n\t\t LEFT JOIN {$CFG->prefix}email_send s ON m.id = s.mailid\n\t\t LEFT JOIN {$CFG->prefix}email_foldermail fm ON m.id = fm.mailid \";\n\n\n\t\t\t// WHERE principal clause for filter by user and course\n\t\t\t$wheresql = \" WHERE s.userid = $userid\n\t\t\t\t\t\t AND s.course = $courseid\n\t\t\t\t\t\t AND fm.folderid = $folder->id\n\t\t\t\t\t\t AND s.readed = 0\n\t\t\t\t\t\t AND s.sended = 1\";\n\n\t\t\treturn count_records_sql( $sql.$wheresql );\n\n\t\t} else if ( email_isfolder_type($folder, EMAIL_DRAFT) ) {\n\t\t\t// For apply order, I've writting an sql clause\n\t\t\t$sql = \"SELECT count(*)\n\t\t \tFROM {$CFG->prefix}email_mail m\n\t\t \tLEFT JOIN {$CFG->prefix}email_foldermail fm ON m.id = fm.mailid \";\n\n\n\t\t\t// WHERE principal clause for filter user and course\n\t\t\t$wheresql = \" WHERE m.userid = $userid\n\t\t\t\t\t\t AND m.course = $courseid\n\t\t\t\t\t\t AND fm.folderid = $folder->id\";\n\n\t\t\treturn count_records_sql( $sql.$wheresql );\n\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n}", "function checkEmails()\n{\n $properties = parse_ini_file(\"/home/rchen/.config/office365.ini\");\n $mbox = imap_open($properties['host'], $properties['user'], $properties['pass']);\n\n if (!$mbox) {\n $message = sprintf(\"The login details you provided:\\nUsername: %s\\nPassword: %s\\nDoes NOT work for %s\", $properties['user'], $properties['pass'], $properties['host']);\n $cmd = sprintf('echo \"%s\" | xmessage -timeout 15 -file -', $message);\n shell_exec($cmd);\n return;\n }\n\n $unseen = imap_search($mbox, 'UNSEEN');\n $nrUnseen = $unseen ? count($unseen) : 0;\n //$message = 'echo \"You have >> %d << unread messages in your account.\\n\\n%s\" | xmessage -timeout 15 -file -'; \n //$message = 'notify-send \"New Message\" \"You have %d unread messages in your account.\\n%s\" -i email -t 23000'; \n $notifyMessage = 'notify-send \"%s\" \"%s\" -i email -t 10000 &';\n $newMessage = 'You have %d unread messages in your account.'; \n $fromMessage = 'From: %s';\n $subjectMessage = '[%s] Subject: %s';\n\n if ($nrUnseen > 0) {\n $newEmailNote = sprintf($newMessage, $nrUnseen);\n shell_exec(sprintf($notifyMessage, \"New Emails\", $newEmailNote));\n foreach ($unseen as $uid) {\n $email = imap_headerinfo($mbox, $uid);\n $fromAddress = $email->fromaddress;\n $date = $email->date;\n $subject = $email->subject;\n $fromNote = str_replace(\"\\\"\", \"\", sprintf($fromMessage, $fromAddress));\n $subjectNote = str_replace(\"\\\"\", \"\", sprintf($subjectMessage, $date, $subject));\n shell_exec(sprintf($notifyMessage, $fromNote, $subjectNote));\n }\n }\n imap_close($mbox);\n}", "function validateMailbox(&$mailbox)\n {\n // A couple of defaults.\n $phrase = '';\n $comment = '';\n $comments = array();\n\n // Catch any RFC822 comments and store them separately.\n $_mailbox = $mailbox;\n while (strlen(trim($_mailbox)) > 0) {\n $parts = explode('(', $_mailbox);\n $before_comment = $this->_splitCheck($parts, '(');\n if ($before_comment != $_mailbox) {\n // First char should be a (.\n $comment = substr(str_replace($before_comment, '', $_mailbox), 1);\n $parts = explode(')', $comment);\n $comment = $this->_splitCheck($parts, ')');\n $comments[] = $comment;\n\n // +1 is for the trailing )\n $_mailbox = substr($_mailbox, strpos($_mailbox, $comment)+strlen($comment)+1);\n } else {\n break;\n }\n }\n\n foreach ($comments as $comment) {\n $mailbox = str_replace(\"($comment)\", '', $mailbox);\n }\n\n $mailbox = trim($mailbox);\n\n // Check for name + route-addr\n if (substr($mailbox, -1) == '>' && substr($mailbox, 0, 1) != '<') {\n $parts = explode('<', $mailbox);\n $name = $this->_splitCheck($parts, '<');\n\n $phrase = trim($name);\n $route_addr = trim(substr($mailbox, strlen($name.'<'), -1));\n\n if ($this->_validatePhrase($phrase) === false || ($route_addr = $this->_validateRouteAddr($route_addr)) === false) {\n return false;\n }\n\n // Only got addr-spec\n } else {\n // First snip angle brackets if present.\n if (substr($mailbox, 0, 1) == '<' && substr($mailbox, -1) == '>') {\n $addr_spec = substr($mailbox, 1, -1);\n } else {\n $addr_spec = $mailbox;\n }\n\n if (($addr_spec = $this->_validateAddrSpec($addr_spec)) === false) {\n return false;\n }\n }\n\n // Construct the object that will be returned.\n $mbox = new stdClass();\n\n // Add the phrase (even if empty) and comments\n $mbox->personal = $phrase;\n $mbox->comment = isset($comments) ? $comments : array();\n\n if (isset($route_addr)) {\n $mbox->mailbox = $route_addr['local_part'];\n $mbox->host = $route_addr['domain'];\n $route_addr['adl'] !== '' ? $mbox->adl = $route_addr['adl'] : '';\n } else {\n $mbox->mailbox = $addr_spec['local_part'];\n $mbox->host = $addr_spec['domain'];\n }\n\n $mailbox = $mbox;\n return true;\n }", "function send_mails() {\n\t //$myactivebatch = $this->load_saved_batch();//load direct from file\n\t $myactivebatch = GetParam('batchrestore');//load in html form field and save as param\n\t //echo '>',$myactivebatch;\n\t \n\t $batch = GetReq('batchid');\n\t $bid = GetParam('bid')?GetParam('bid'):0; \n\t \t \n\t $include_subs = GetParam('includesubs');\n\t $include_all = GetParam('includeall');\t \n\t $subscribers = $include_subs?$include_subs:$include_all;//one or another\n\t\n\t $from = GetParam('from');\n\t $to = GetParam('to');\t \n\t $subject = GetParam('subject');\n\t \n\t if ($this->template) {\n\t if ($this->dirdepth) {\n\t\t for($i=0;$i<$this->dirdepth;$i++)\n\t\t\t $backdir .= \"../\";\n\t\t }\n\t\t else\n\t\t $backdir = \"../\";\n\t\t //repalce viewable data to send data (absolute dir)\t \n\t\t //echo $backdir;\n\t\t if ($this->mailbody)//get session text with headers\n\t\t $body = $this->mailbody;\n\t\t else //get text area\n\t $body = str_replace($backdir,$this->url.$this->infolder.'/',GetParam('mail_text')); \t \n\t }\t \n\t else\t{ //text area or session text with headers\n\t \n\t if (GetReq('editmode')) {\n\t\t $mytext = $this->mailbody?$this->mailbody:GetParam('mail_text');\n\t\t $body = $this->unload_spath($mytext);\n\t\t }\n\t\t else\n\t $body = $this->mailbody?$this->mailbody:GetParam('mail_text'); \n\t }\t \t \n\t \t \n\t\t \n\t if ($subscribers) {// || ($batch)) {//if sybs checked or batch in process..\n\t \n\t //save the current mail campaign state\n\t $this->save_current_batch($batch);\t\n\t \t \t \n\t //$subs = $this->subs_mail;\n\t\t \n\t\t //workinh batch tosend\n\t\t $subs = $this->getmails($include_all,$this->batch,$bid);\n\t\t \n\t if (($batch>=0) && ($batch>=$myactivebatch)) {\n\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body.'+'.$subs)) {\n if ($res = $this->sendit($from,$to,$subject,$body,$subs,$this->ishtml)) {\n\t $this->mailmsg = $res . \" mail(s) send!\";\n\t }\t \n\t else \n\t $this->mailmsg = \"Send failed\";\n\t\t }\n\t\t else \t\n\t\t $this->mailmsg = \"Send bypassed\"; \n\t }\t \n\t else {//one receipent\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body))\n\t\t if ($res = $this->sendit($from,$to,$subject,$body,null,$this->ishtml)) \n\t\t $this->mailmsg = $res . \" mail(s) send!\";\n\t\t else\n\t\t $this->mailmsg = \"Send failed\";\t\n\t }\t \n\t\t \n\t //auto refresh\n\t $refresh = GetParam('refresh')?GetParam('refresh'):$this->auto_refresh;\n\t if (($refresh>0) && ($res==$this->batch)) {\n $this->refresh_bulk_js(seturl('t=cpsubsend&batchid='.($bid+1).'&batch='.$this->batch.'&refresh='.$refresh),$refresh);\t\t\t \n\t $this->mailmsg .= \"Wait for next batch \" . $this->timeout;\t\t \n\t }\t \n\t \n\t //test\n\t //return $this->batch;\n //return (400);\t \t //??????????????????????????????????????????????????\n\t //echo '---------------------',$res,'---------------------------<br>';\n\t \n\t if ($res<$this->batch) //means end of campaign\n\t $this->reset_batch_state();\n\t \n\t return ($res);//how many mails tried to send (batch...)\t \n\t}", "function elegant_email_body($messagtext,$properties){ \n\n ob_start(); ?>\n\n\n<!DOCTYPE html>\n<html xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">\n<head>\n <title></title><!--[if !mso]><!== -->\n <meta content=\"IE=edge\" http-equiv=\"X-UA-Compatible\"><!--<![endif]-->\n <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n <meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\">\n <style type=\"text/css\">\n #outlook a { padding: 0; } .ReadMsgBody { width: 100%; } .ExternalClass { width: 100%; } .ExternalClass * { line-height:100%; } body { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } table, td { border-collapse:collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; } img { border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; } p { display: block; margin: 13px 0; }\n </style><!--[if !mso]><!-->\n <style type=\"text/css\">\n @media only screen and (max-width:480px) { @-ms-viewport { width:320px; } @viewport { width:320px; } }\n </style><!--<![endif]--><!--[if mso]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> <o:PixelsPerInch>96</o:PixelsPerInch> </o:OfficeDocumentSettings></xml><![endif]--><!--[if lte mso 11]><style type=\"text/css\"> .outlook-group-fix { width:100% !important; }</style><![endif]--><!--[if !mso]><!-->\n <link href=\"https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700\" rel=\"stylesheet\" type=\"text/css\">\n <style type=\"text/css\">\n @import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700); \n </style><!--<![endif]-->\n <style type=\"text/css\">\n ul {margin:0px;padding: 0px;}\n @media only screen and (min-width:480px) { .mj-column-per-100 { width:100%!important; }.mj-column-per-50 { width:50%!important; } }\n }\n </style>\n</head>\n<body style=\"background: #FFFFFF;\">\n <div class=\"mj-container\" style=\"background-color:#FFFFFF;\">\n <!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" align=\"center\" style=\"width:600px;\"> <tr> <td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"> <![endif]-->\n <div style=\"margin:0px auto;max-width:600px;\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"font-size:0px;width:100%;\">\n <tbody>\n <tr>\n <td style=\"text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:9px 0px 9px 0px;\">\n <!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td style=\"vertical-align:top;width:600px;\"> <![endif]-->\n <div class=\"mj-column-per-100 outlook-group-fix\" style=\"vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"center\" style=\"word-wrap:break-word;font-size:0px;padding:18px 18px 18px 18px;\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"border-collapse:collapse;border-spacing:0px;\">\n <tbody>\n <tr>\n <td style=\"width:384px;\"><img alt=\"\" height=\"auto\" src=\"<?php /*Knoppys Elegant Variations Plugin*/ echo variations_email_logo(get_host()); ?>\" style=\"border:none;border-radius:0px;display:block;font-size:13px;outline:none;text-decoration:none;width:100%;height:auto;\" title=\"\" width=\"384\"></td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td></tr></table> <![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td></tr></table> <![endif]--><!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" align=\"center\" style=\"width:600px;\"> <tr> <td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"> <![endif]-->\n <div style=\"margin:0px auto;max-width:600px;\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"font-size:0px;width:100%;\">\n <tbody>\n <tr>\n <td style=\"text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:9px 0px 9px 0px;\">\n <!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td style=\"vertical-align:top;width:600px;\"> <![endif]-->\n <div class=\"mj-column-per-100 outlook-group-fix\" style=\"vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;\"> \n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <tr align=\"center\">\n <td align=\"left\" style=\"word-wrap:break-word;font-size:0px;padding:0px 20px 0px 20px;\">\n <?php \n //The code for this function is located in the plugin Knoppys Elegant Variations\n echo variations_contact_details(get_host()); \n ?>\n </td>\n </tr>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td></tr></table> <![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td></tr></table> <![endif]--><!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" align=\"center\" style=\"width:600px;\"> <tr> <td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"> <![endif]-->\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"font-size:0px;width:100%;\">\n <tbody>\n <tr>\n <td>\n <div style=\"margin:0px auto;max-width:600px;\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"font-size:0px;width:100%;\">\n <tbody>\n <tr>\n <td style=\"text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:14px 0px 14px 0px;\">\n <!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td style=\"vertical-align:top;width:600px;\"> <![endif]-->\n <div class=\"mj-column-per-100 outlook-group-fix\" style=\"vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" style=\"word-wrap:break-word;font-size:0px;padding:0px 20px 0px 20px;\">\n <div style=\"cursor:auto;color:#000000;font-family:Arial,Helvetica, Arial, sans-serif;font-size:14px;line-height:22px;text-align:left;\">\n <p><?php echo $messagtext; ?></p>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td></tr></table> <![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </td>\n </tr>\n </tbody>\n </table><!--[if mso | IE]> </td></tr></table> <![endif]-->\n\n\n<?php foreach ($properties as $property) { ?>\n <!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" align=\"center\" style=\"width:600px;\"> <tr> <td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"> <![endif]-->\n <div style=\"margin:0px auto;max-width:600px;\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"font-size:0px;width:100%;\">\n <tbody>\n <tr>\n <td style=\"text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:9px 0px 9px 0px;\">\n <!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td style=\"vertical-align:top;width:600px;\"> <![endif]-->\n <div class=\"mj-column-per-100 outlook-group-fix\" style=\"vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" style=\"word-wrap:break-word;font-size:0px;padding:0px 20px 0px 20px;\">\n <div style=\"cursor:auto;color:#000000;font-family:Arial,Helvetica, Arial, sans-serif;font-size:14px;line-height:22px;text-align:left;\">\n <p><a href=\"<?php echo get_the_permalink($property[0]); ?>\" target=\"_blank\" style=\"color:#bc8536;\"><span style=\"color:#bc8536; font-size: 18px; line-height: 27px; font-weight: bold;margin-top:10px;\"><?php echo get_the_title($property[0]); ?></span></a></p>\n </div> \n <div style=\"cursor:auto;color:#bc8536;font-family:Arial,Helvetica, Arial, sans-serif;font-size:14px;line-height:22px;text-align:left;\">\n <p><span style=\"color:#bc8536; font-size: 16px; line-height: 27px; font-weight: bold;margin-top:10px;\">Location: <?php echo location($property[0]); ?></span></p>\n </div> \n </td>\n </tr> \n <tr>\n <td align=\"center\" style=\"word-wrap:break-word;font-size:0px;padding:0px 0px 0px 0px;\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"border-collapse:collapse;border-spacing:0px;\">\n <tbody>\n <tr>\n <?php\n if (get_host() == 'elegant-address.com') {\n $imageurl = get_the_post_thumbnail_url($property[0],'medium');\n } else {\n $imageurl = knoppys_property_header($property[0],get_post_meta($property[0],'image_1', true)); \n }\n ?>\n <td style=\"width:600px;padding:10px;\"><img alt=\"\" width=\"100%\" height=\"auto\" src=\"<?php echo $imageurl; ?>\" style=\"border:none;border-radius:0px;display:block;font-size:13px;outline:none;text-decoration:none;width:100%;height:auto;\"></td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td></tr></table> <![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td></tr></table> <![endif]--><!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" align=\"center\" style=\"width:600px;\"> <tr> <td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"> <![endif]-->\n <div style=\"margin:0px auto;max-width:600px;\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"font-size:0px;width:100%;\">\n <tbody>\n <tr>\n <td style=\"text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:9px 0px 9px 0px;\">\n <!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td style=\"vertical-align:top;width:300px;\"> <![endif]-->\n <div class=\"mj-column-per-50 outlook-group-fix\" style=\"vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:50%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" style=\"word-wrap:break-word;font-size:0px;padding:0px 20px 0px 20px;\">\n <div style=\"cursor:auto;color:#000000;font-family:Arial,Helvetica, Arial, sans-serif;font-size:14px;line-height:22px;text-align:left;\">\n <?php echo variations_email_ataglance(get_host(),$property[0]); ?>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td><td style=\"vertical-align:top;width:300px;\"> <![endif]-->\n <div class=\"mj-column-per-50 outlook-group-fix\" style=\"vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:50%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" style=\"word-wrap:break-word;font-size:0px;padding:0px 20px 0px 20px;\">\n <div style=\"cursor:auto;color:#000000;font-family:Arial,Helvetica, Arial, sans-serif;font-size:14px;line-height:22px;text-align:left;\">\n <p>Property Type: <?php echo get_post_meta($property[0],'type_name', true); ?><br>\n Location: <?php echo location($property[0]); ?><br> \n <span style=\"font-weight:bold;\">Price: <?php echo $property[2]; ?></span></p> \n <?php echo variations_brochurelink(get_host(),$property[0]); ?> \n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td></tr></table> <![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td></tr></table> <![endif]--><!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" align=\"center\" style=\"width:600px;\"> <tr> <td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"> <![endif]-->\n <div style=\"margin:0px auto;max-width:600px;\">\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"font-size:0px;width:100%;\">\n <tbody>\n <tr>\n <td style=\"text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:9px 0px 9px 0px;\">\n <!--[if mso | IE]> <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td style=\"vertical-align:top;width:600px;\"> <![endif]-->\n <div class=\"mj-column-per-100 outlook-group-fix\" style=\"vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" style=\"word-wrap:break-word;font-size:0px;padding:0px 20px 0px 20px;\">\n <div style=\"cursor:auto;color:#000000;font-family:Arial,Helvetica, Arial, sans-serif;font-size:14px;line-height:22px;text-align:left;\">\n <p><?php echo nl2br(rawurldecode(stripslashes($property[1]))); ?></p>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td></tr></table> <![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n </div><!--[if mso | IE]> </td></tr></table> <![endif]-->\n <?php } ?>\n\n </div>\n</body>\n</html>\n\n<?php $content = ob_get_clean();\nreturn $content;\n}", "function custom_mail($to, $subject, $message, $additional_headers, $additional_parameters) {\r\n try {\r\n $messagePostfix = '';\r\n $un = strtoupper(uniqid(time()));\r\n $eol = CAllEvent::GetMailEOL();\r\n\r\n // Ищем инструкции по подключеннию файлов и выполняем их\r\n // ADD-FILE: #CARD1#=>card1.jpg;#CARD2#=>card2.jpg;\r\n $additional_headers = preg_replace_callback('#^\\s*ADD-FILE:\\s*([^\\r\\n]+)(?:[\\r\\n]+|$)#sim', function ($m) use (&$messagePostfix, $un, $eol) {\r\n $strAddFile = trim(mb_decode_mimeheader($m[0]));\r\n if (empty($strAddFile)) {\r\n return '';\r\n }\r\n // Разбираемся какие файлы подключать\r\n // #CARD1#=>card1.jpg;#CARD2#=>card2.jpg;\r\n $arrFileAa = preg_split('#\\s*;\\s*#', $strAddFile, -1, PREG_SPLIT_NO_EMPTY);\r\n foreach ($arrFileAa as $strFileAs) {\r\n // #CARD1#=>card2.jpg\r\n $arrFileAs = preg_split('#\\s*=>\\s*#', $strFileAs, -1, PREG_SPLIT_NO_EMPTY);\r\n // Открываем файл\r\n $f = fopen($arrFileAs[0], 'rb');\r\n if ($f === false) {\r\n $fileData = 'Сan not open file ' . $arrFileAs[0];\r\n $fileName = $arrFileAs[1] . '.txt';\r\n } else {\r\n $fileData = fread($f, filesize($arrFileAs[0]));\r\n $fileName = $arrFileAs[1];\r\n fclose($f);\r\n }\r\n $messagePostfix .= '--------' . $un . $eol;\r\n $messagePostfix .= 'Content-Type: application/octet-stream;name=\"' . $fileName . '\"' . $eol;\r\n $messagePostfix .= 'Content-Disposition:attachment;filename=\"' . $fileName . '\"' . $eol;\r\n $messagePostfix .= 'Content-Transfer-Encoding: base64' . $eol . $eol;\r\n $messagePostfix .= chunk_split(base64_encode($fileData)) . $eol . $eol;\r\n }\r\n return '';\r\n }, $additional_headers);\r\n\r\n // Нужно ли добавлять файлы\r\n if ($messagePostfix) {\r\n $messagePrefix = '--------' . $un . $eol;\r\n $additional_headers = preg_replace_callback('#^\\s*(Content-Type:[^\\r\\n]+)(?:[\\r\\n]+|$)#sim', function ($m) use (&$messagePrefix, $eol) {\r\n $messagePrefix .= $m[1] . $eol;\r\n return '';\r\n }, $additional_headers);\r\n $additional_headers = preg_replace_callback('#^\\s*(Content-Transfer-Encoding:[^\\r\\n]+)(?:[\\r\\n]+|$)#sim', function ($m) use (&$messagePrefix, $eol) {\r\n $messagePrefix .= $m[1] . $eol;\r\n return '';\r\n }, $additional_headers);\r\n $additional_headers = trim($additional_headers) . $eol;\r\n $additional_headers .= 'Mime-Version: 1.0' . $eol;\r\n $additional_headers .= 'Content-Type:multipart/mixed;boundary=\"------' . $un . '\"' . $eol . $eol;\r\n\r\n $message = $messagePrefix . $eol . $eol . $message . $eol . $eol . $messagePostfix;\r\n }\r\n\r\n // file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'mail.txt', $additional_headers . $message);\r\n\r\n if ($additional_parameters != '') {\r\n return @mail($to, $subject, $message, $additional_headers, $additional_parameters);\r\n }\r\n return @mail($to, $subject, $message, $additional_headers);\r\n } catch (Exception $e) {\r\n return false;\r\n }\r\n}", "function get_pm_from($folder_id, $folder, $user_id, $url, $type = 'folder')\n{\n\tglobal $_CLASS, $_POST;\n\n\t$limit = 10;\n\t$start = get_variable('start', 'REQUEST', 0, 'int');\n\n\t$sort_days\t= get_variable('st', 'REQUEST', 0, 'int');\n\t$sort_key\t= get_variable('sk', 'REQUEST', 't');\n\t$sort_dir\t= get_variable('sd', 'REQUEST', 'd');\n\t\n\t// PM ordering options\n\t$limit_days = array(0 => $_CLASS['core_user']->lang['ALL_MESSAGES'], 1 => $_CLASS['core_user']->lang['1_DAY'], 7 => $_CLASS['core_user']->lang['7_DAYS'], 14 => $_CLASS['core_user']->lang['2_WEEKS'], 30 => $_CLASS['core_user']->lang['1_MONTH'], 90 => $_CLASS['core_user']->lang['3_MONTHS'], 180 => $_CLASS['core_user']->lang['6_MONTHS'], 364 => $_CLASS['core_user']->lang['1_YEAR']);\n\t$sort_by_text = array('a' => $_CLASS['core_user']->lang['AUTHOR'], 't' => $_CLASS['core_user']->lang['POST_TIME'], 's' => $_CLASS['core_user']->lang['SUBJECT']);\n\t$sort_by_sql = array('a' => 'u.username', 't' => 'p.message_time', 's' => 'p.message_subject');\n\n\t$sort_key = (!in_array($sort_key, array('a', 't', 's'))) ? 't' : $sort_key;\n\n\t$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';\n\tgen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);\n\n\tif ($type !== 'folder')\n\t{\n\t\t$folder_sql = ($type === 'unread') ? 't.pm_unread = 1' : 't.pm_new = 1';\n\t\t$folder_id = PRIVMSGS_INBOX;\n\t}\n\telse\n\t{\n\t\t$folder_sql = 't.folder_id = ' . (int) $folder_id;\n\t}\n\n\t// Limit pms to certain time frame, obtain correct pm count\n\tif ($sort_days)\n\t{\n\t\t$min_post_time = $_CLASS['core_user']->time - ($sort_days * 86400);\n\n\t\tif (isset($_POST['sort']))\n\t\t{\n\t\t\t$start = 0;\n\t\t}\n\n\t\t$sql = 'SELECT COUNT(t.msg_id) AS pm_count\n\t\t\tFROM ' . FORUMS_PRIVMSGS_TO_TABLE . ' t, ' . FORUMS_PRIVMSGS_TABLE . \" p\n\t\t\tWHERE $folder_sql\n\t\t\t\tAND t.user_id = $user_id\n\t\t\t\tAND t.msg_id = p.msg_id\n\t\t\t\tAND p.message_time >= $min_post_time\";\n\t\t$result = $_CLASS['core_db']->query_limit($sql, 1);\n\t\t$pm_count = ($row = $_CLASS['core_db']->fetch_row_assoc($result)) ? $row['pm_count'] : 0;\n\t\t$_CLASS['core_db']->free_result($result);\n\n\t\t$sql_limit_time = \"AND p.message_time >= $min_post_time\";\n\t}\n\telse\n\t{\n\t\tif ($type === 'folder')\n\t\t{\n\t\t\t$pm_count = $folder[$folder_id]['num_messages'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (in_array($folder_id, array(PRIVMSGS_INBOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX)))\n\t\t\t{\n\t\t\t\t$sql = 'SELECT COUNT(t.msg_id) AS pm_count\n\t\t\t\t\tFROM ' . FORUMS_PRIVMSGS_TO_TABLE . ' t, ' . FORUMS_PRIVMSGS_TABLE . \" p\n\t\t\t\t\tWHERE $folder_sql\n\t\t\t\t\t\tAND t.user_id = $user_id\n\t\t\t\t\t\tAND t.msg_id = p.msg_id\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sql = 'SELECT pm_count \n\t\t\t\t\tFROM ' . FORUMS_PRIVMSGS_FOLDER_TABLE . \" \n\t\t\t\t\tWHERE folder_id = $folder_id\n\t\t\t\t\t\tAND user_id = $user_id\";\n\t\t\t}\n\t\t\t$result = $_CLASS['core_db']->query_limit($sql, 1);\n\t\t\t$pm_count = ($row = $_CLASS['core_db']->fetch_row_assoc($result)) ? $row['pm_count'] : 0;\n\t\t\t$_CLASS['core_db']->free_result($result);\n\t\t}\n\n\t\t$sql_limit_time = '';\n\t}\n\n\t$pagination\t= generate_pagination(\"$url&amp;mode=view&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param\", $pm_count, $limit, $start);\n\n\t$_CLASS['core_template']->assign_array(array(\n\t\t'PAGINATION'\t\t=> $pagination['formated'],\n\t\t'PAGINATION_ARRAY'\t=> $pagination['array'],\n\n\t\t'PAGE_NUMBER'\t\t=> on_page($pm_count, $limit, $start),\n\t\t'TOTAL_MESSAGES'\t=> (($pm_count == 1) ? $_CLASS['core_user']->lang['VIEW_PM_MESSAGE'] : sprintf($_CLASS['core_user']->lang['VIEW_PM_MESSAGES'], $pm_count)),\n\n\t\t//'POST_IMG'\t\t=> (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'PM_LOCKED') : $user->img('button_pm_new', 'POST_PM'),\r\n\t\t'POST_IMG'\t\t\t=> $_CLASS['core_user']->img('btn_post_pm', 'POST_PM'),\n\t\t'REPORTED_IMG'\t\t=> $_CLASS['core_user']->img('icon_reported', 'MESSAGE_REPORTED'),\n\n\t\t//'L_NO_MESSAGES'\t=> (!$auth->acl_get('u_sendpm')) ? $user->lang['POST_PM_LOCKED'] : $user->lang['NO_MESSAGES'],\r\n\t\t'L_NO_MESSAGES'\t\t=> $_CLASS['core_user']->lang['NO_MESSAGES'],\n\n\t\t'S_SELECT_SORT_DIR'\t\t=> $s_sort_dir,\n\t\t'S_SELECT_SORT_KEY'\t\t=> $s_sort_key,\n\t\t'S_SELECT_SORT_DAYS'\t=> $s_limit_days,\n\t\t'S_TOPIC_ICONS'\t\t\t=> true, \n\n\t\t//'U_POST_NEW_TOPIC'\t=> ($_CLASS['auth']->acl_get('u_sendpm')) ? generate_link($url.'&amp;mode=compose&amp;action=post') : '', \n\t\t'U_POST_NEW_TOPIC'\t=> generate_link($url.'&amp;mode=compose&amp;action=post'), \n\t\t'S_PM_ACTION'\t\t=> generate_link(\"$url&amp;mode=view&amp;action=view_folder&amp;f=$folder_id\"))\n\t);\n\n\t// Grab all pm data\n\t$rowset = $pm_list = array();\n\n\t// If the user is trying to reach late pages, start searching from the end\n\t$store_reverse = false;\n\t$sql_limit = $limit;\n\n\tif ($start > $pm_count / 2)\n\t{\n\t\t$store_reverse = true;\n\n\t\tif ($start + $limit > $pm_count)\n\t\t{\n\t\t\t$sql_limit = min($limit, max(1, $pm_count - $start));\n\t\t}\n\n\t\t// Select the sort order\n\t\t$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');\n\t\t$sql_start = max(0, $pm_count - $sql_limit - $start);\n\t}\n\telse\n\t{\n\t\t// Select the sort order\n\t\t$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');\n\t\t$sql_start = $start;\n\t}\n\n\t$sql = 'SELECT t.*, p.author_id, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username \n\t\tFROM ' . FORUMS_PRIVMSGS_TO_TABLE . ' t, ' . FORUMS_PRIVMSGS_TABLE . ' p, ' . CORE_USERS_TABLE . \" u\n\t\tWHERE t.user_id = $user_id\n\t\t\tAND p.author_id = u.user_id\n\t\t\tAND $folder_sql\n\t\t\tAND t.msg_id = p.msg_id\n\t\t\t$sql_limit_time\n\t\tORDER BY $sql_sort_order\";\n\n\t$result = $_CLASS['core_db']->query_limit($sql, $sql_limit, $sql_start);\n\n\twhile ($row = $_CLASS['core_db']->fetch_row_assoc($result))\n\t{\n\t\t$rowset[$row['msg_id']] = $row;\n\t\t$pm_list[] = $row['msg_id'];\n\t}\n\t$_CLASS['core_db']->free_result($result);\n\n\t$pm_list = ($store_reverse) ? array_reverse($pm_list) : $pm_list;\n\n\treturn array(\n\t\t'pm_count'\t=> $pm_count, \n\t\t'pm_list'\t=> $pm_list, \n\t\t'rowset'\t=> $rowset\n\t);\n}", "function fileemail() {\n\t\t\tglobal $logid, $bwpsoptions;\n\t\t\t\n\t\t\t//Get the right email address.\n\t\t\tif ( is_email( $bwpsoptions['id_fileemailaddress'] ) ) {\n\t\t\t\t\n\t\t\t\t$toaddress = $bwpsoptions['id_fileemailaddress'];\n\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$toaddress = get_site_option( 'admin_email' );\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t//create all headers and subject\n\t\t\t$to = $toaddress;\n\t\t\t$headers = 'From: ' . get_option( 'blogname' ) . ' <' . $to . '>' . PHP_EOL;\n\t\t\t$subject = '[' . get_option( 'siteurl' ) . '] ' . __( 'WordPress File Change Warning', $this->hook ) . ' ' . date( 'l, F jS, Y \\a\\\\t g:i a e', current_time( 'timestamp' ) );\n\n\t\t\t//create message\n\t\t\t$message = '<p>' . __('<p>A file (or files) on your site at ', $this->hook ) . ' ' . get_option( 'siteurl' ) . __( ' have been changed. Please review the report below to verify changes are not the result of a compromise.', $this->hook ) . '</p>';\n\t\t\t$message .= $this->getdetails( $logid, true ); //get report\n\t\t\t\n\t\t\tadd_filter( 'wp_mail_content_type', create_function( '', 'return \"text/html\";' ) ); //send as html\n\t\t\t\n\t\t\twp_mail( $to, $subject, $message, $headers ); //send message\n\t\t\n\t\t}", "public function sendBatchEmail($peeps, $unsubtype, $SUBJECT, $TEXT, $context, \r\n // $FROM = array('webmail@cvuuf.org' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n $FROM = array('website@members.cvuuf.org' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n {\r\n // $FROM = array('website@members.cvuuf.org' => \"Conejo Valley UU Fellowship\");\r\n $FROM = array('cvuuf.org@cvuuf.net' => 'cvuuf.org@cvuuf.net');\r\n $efunctions = new Cvuuf_emailfunctions();\r\n $peoplemap = new Application_Model_PeopleMapper();\r\n $unsmap = new Application_Model_UnsubMapper();\r\n\r\n $results = array();\r\n $orwhere = array(\r\n array('`all`', ' = ', 1),\r\n array($unsubtype, ' = ', 1),\r\n );\r\n $unsubs = $unsmap->fetchOrWhere($orwhere);\r\n $unsubids = array();\r\n foreach ($unsubs as $unsub)\r\n {\r\n $person = $peoplemap->find($unsub->id);\r\n if ($person['email'] <> '')\r\n $unsubids[$person['email']] = 1;\r\n }\r\n\r\n $emailCount = count($peeps); \r\n $results[] = \"$emailCount copies to be sent.\";\r\n \t\t$count = 0;\r\n \t\t$fullcount = 0;\r\n\r\n $totalsent = 0;\r\n $invalid = array();\r\n $unsub = array();\r\n if ($emailCount >= 30) {\r\n return array('results' => $results.\" (rejected to avoid spam blacklists, 30-email max. Contact jakeholland.net@gmail.com to work out how to send this)\", 'log' => 'rejected to avoid spam blacklists', 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }\r\n unset($TO_array);\r\n \t\tforeach ($peeps as $peep) \r\n {\r\n \t $emailAddress = $peep->email;\r\n \t if (!$efunctions->isValidEmail($emailAddress))\r\n { \r\n $invalid[] = $emailAddress;\r\n }\r\n elseif (isset($unsubids[$emailAddress]))\r\n {\r\n $unsub[] = $emailAddress;\r\n } \r\n else \r\n {\r\n $fullcount++;\r\n $TO_array[$count++] = $emailAddress;\r\n \t\t\tif (($count%20) == 0) \r\n {\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n unset($TO_array);\r\n $count = 0;\r\n sleep(1);\r\n \t\t }\r\n // Check section limit and delay if reached\r\n if (($fullcount % 10) == 0)\r\n {\r\n $results[] = \"Progress count $fullcount sent\"; \r\n sleep(5);\r\n }\r\n \t}\r\n } \r\n // send last email segment\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n $results[] = sprintf(\"Ending fraction count %d copies\\n\", $numsent);\r\n $log = $efunctions->log_email($context, $emailCount, $totalsent, count($invalid), count($unsub));\r\n $results[] = \"Last Segment sent\";\r\n\r\n return array('results' => $results, 'log' => $log, 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }", "private static function mail()\n {\n $files = ['Mail', 'Mailable', 'SMTP'];\n $folder = static::$root.'Mailing'.'/';\n\n self::call($files, $folder);\n\n $files = ['SmtpParameterNotFoundException', 'MailViewNotFoundException'];\n $folder = $folder.'Exceptions/';\n\n self::call($files, $folder);\n }", "function email_have_asociated_folders($userid) {\n\tglobal $CFG, $USER;\n\n\tif ( empty($userid) ) {\n\t\t$userid = $USER->id;\n\t}\n\n\tif ( $CFG->email_marriedfolders2courses ) {\n\t\tif ( $preferences = get_record('email_preference', 'userid', $userid) ) {\n\t\t\tif ($preferences->marriedfolders2courses) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}", "function collections_contact($parameters) \n\t{\n\n\t\t$qi = new ECash_Queues_BasicQueueItem($parameters->application_id);\n\t\t$qm = ECash::getFactory()->getQueueManager();\n\t\t$qm->removeFromAllQueues($qi);\n\n\t\t$application_id = $parameters->application_id;\n\n\t\tRemove_Standby($application_id);\n\t\t\n\t\t// Send Return Letter 3 - 'Overdue Account Letter' 6.2.1.4\n\t\t//ECash_Documents_AutoEmail::Queue_For_Send($parameters->application_id, 'RETURN_LETTER_3_OVERDUE_ACCOUNT', $parameters->status->fail_set[0]->transaction_register_id);\n\t\tECash_Documents_AutoEmail::Queue_For_Send($parameters->application_id, 'PAYMENT_FAILED', $parameters->status->fail_set[0]->transaction_register_id);\n\n\t\t// 6.2.1.1 - Change status to Collections Contact\n\t\tUpdate_Status(null, $application_id, array('queued','contact','collections','customer','*root'), NULL, NULL, FALSE);\n\t\t\n\t\t// 6.2.1.5 - Add to Collections General Queue\n\t\t$qm = ECash::getFactory()->getQueueManager();\n\t\t$queue_item = $qm->getQueue('collections_general')->getNewQueueItem($parameters->application_id);\n//\t\t$queue_item->Priority = 200; Not specified by spec\n\t\t$qm->moveToQueue($queue_item, 'collections_general');\n\n\t\t// 6.2.1.3 - Schedule Full Pull on next Payment Due Date\n\t\t// Get their next due date\n\t\t$data = Get_Transactional_Data($application_id);\n\t\t$info = $data->info;\n\t\t$rules = $data->rules;\n\n\t\t$paydates = Get_Date_List($data->info, date('m/d/Y'), $data->rules, 10, NULL, NULL);\n\t\n\t while(strtotime($paydates['event'][0]) < strtotime(date('Y-m-d')))\n\t {\n\t array_shift($paydates['event']);\n\t array_shift($paydates['effective']);\n\t }\n\n\t\t$next_action = date('m/d/Y', strtotime($paydates['event'][0]));\n\t\t$next_due_date = date('m/d/Y', strtotime($paydates['effective'][0]));\n\n\t// Removed for escalation #26062\n\t\t//Schedule_Full_Pull($application_id, NULL, NULL, $next_action, $next_due_date);\n\t\t\n\t\treturn 0;\n\t}", "function nf_formatEmailMessage($type,$tid,$qid,$user) {\n global $CONF_NF,$_TABLES,$_CONF;\n\n $sql = \"SELECT taskname,prenotify_message,postnotify_message,reminder_message FROM {$_TABLES['nftemplatedata']} WHERE id='$tid'\";\n list ($taskname,$premessage,$postmessage, $remindermessage) = DB_fetchArray(DB_query($sql));\n $message = '';\n switch ($type) {\n case 'prenotify':\n if (trim($premessage) == '') {\n $message = $CONF_NF['prenotify_default_message'];\n } else {\n $message = $premessage;\n }\n break;\n case 'postnotify':\n if (trim($postmessage) == '') {\n $message = $CONF_NF['postnotify_default_message'];\n } else {\n $message = $postmessage;\n }\n break;\n case 'reminder':\n if (trim($remindermessage) == '') {\n $message = $CONF_NF['reminder_default_message'];\n } else {\n $message = $remindermessage;\n }\n break;\n case 'escalation':\n $message = $CONF_NF['escalation_message'];\n break;\n }\n\n $dateassigned = DB_getItem($_TABLES['nfqueue'],'createdDate',\"id='$qid'\");\n $processid = DB_getItem($_TABLES['nfqueue'],'nf_processID',\"id='$qid'\");\n if ($processid > 0) {\n $nfclass = new nexflow($processid);\n $pid = $nfclass->get_ProcessVariable('PID');\n }\n if (!isset($pid) OR $pid < 1 ) {\n $projectName = 'unknown';\n $projectlink = 'N/A';\n $pid = 0;\n } else {\n $projectName = DB_getItem($_TABLES['nfprojects'],'description',\"id=$pid\");\n $projectlink = $CONF_NF['RequestDetailLink_URL'] . '?id=' . $pid . '?appmode=';\n }\n $taskowner = COM_getDisplayName(nf_getAssignedUID($tid));\n $link = $CONF_NF['TaskConsole_URL'];\n $search = array ('[taskname]','[taskowner]','[user]','[dateassigned]','[newline]','[here]','[project]','[projectname]','[projectlink]','[siteurl]');\n $replace = array ($taskname,$taskowner,$user,$dateassigned,\"\\n\",$link,$pid,$projectName,$projectlink,$_CONF['site_url']);\n $message = str_replace($search,$replace,$message);\n\n if ($CONF_NF['debug']) {\n COM_errorLog(\"nf_formatEmailMessage => Type:$type, Message:$message\");\n }\n\n return $message;\n\n}", "public function loader($referrer = 'inbox', $path = '')\n\t{\n\t\tif ($this->util::loggedInIsAJAX() !== true)\n\t\t\treturn $this->util::loggedInIsAJAX();\n\t\t\n\t $data['success'] = false;\n\t $data['status'] = 'error';\n\t $data['message'] = _lang('an_error_occurred'); \n\n\t if ($path) \n\t {\n\t\t\t$post_data = $this->request->getPost();\n\t\t\t$paging = $this->request->getGet('page') ?? 1;\n\t\t\t$mail_path = base64_url($path, 'decode');\n\n\t \t$load_mail = \\Config\\Services::loadMail(\n\t \t\tmy_config('cpanel_domain') . ':993', \n\t \t\tfetch_user('enterprise_mail', user_id()), \n\t \t\t$this->session->get('password_token'),\n\t \t\t$mail_path\n\t \t);\n\t\t\t$mail_folder = folder_name($mail_path, true);\n\t \t$mailbox = $load_mail['mailbox'];\n\t \t$mails_ids = $load_mail['mails_ids'];\n\t \t$upload_path = $load_mail['upload_path'];\n\t \t$data['message'] = $error = $load_mail['error'];\n\n\t\t\t$folders = [];\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$mailbox->setPathDelimiter('/');\n\t\t\t\t$mailbox->setAttachmentsIgnore(true);\n\t\t\t\t$folders = $mailbox->getMailboxes('*'); \n\t\t\t}\n\t\t\tcatch(\\ErrorException $ex)\n\t\t\t{\n\t \t\t$data['message'] = $error = $ex->getMessage(); \n\t\t\t}\n\n\t\t\t$count_mail = count($mails_ids);\n\t\t\tif ($mails_ids) \n\t\t\t{\n\t $limit = my_config('perpage', null, 5);\n\t $page = min($paging, ceil( $count_mail/ $limit )); \n\t $offset = ($page - 1) * $limit;\n\t if( $offset < 0 ) $offset = 0;\n\n\t\t\t\t$view_data = array( \n\t\t\t\t\t'page_title' => ucwords(\"Mailbox $mail_folder\"),\n\t\t\t\t\t'page_name' => 'mail', \n\t\t\t\t\t'set_folder' => 'user/', \n\t\t\t\t\t'widget' => 'mailbox', \n\t\t\t\t\t'mail_error' => $load_mail['error'],\n\t\t\t\t\t'folders' => $folders,\n\t\t\t\t\t'mailbox' => $mailbox,\n\t\t\t\t\t'curr_folder' => $mail_folder,\n\t\t\t\t\t'mails_ids' => $mails_ids, \n\t\t\t\t\t'pagination' => $paging, \n\t\t\t\t\t'count_mail' => $count_mail, \n\t\t\t\t\t'upload_path' => $load_mail['upload_path']??'',\n\t\t\t\t\t'uploads_url' => $load_mail['uploads_url']??'', \n\t\t\t\t\t// pagination data \n\t 'offset' => $offset,\n\t 'limit' => $limit\n\t\t\t\t); \n\n\t\t\t $data['success'] = true;\n\t\t\t $data['status'] = 'success';\n\t\t\t $data['message'] = $error; \n\t\t\t $data['page_url'] = site_url(\"mail/hub/$referrer/$path/?hash=\" . csrf_hash() . ($paging > 1 ? '&page='.$paging : '')); \n\t\t\t $data['page_title'] = $view_data['page_title']; \n\t\t\t\t$data['html'] = load_widget(\"mail/mailbox_table\", $view_data);\n\t\t\t $data['pagination'] = ((($paging*$limit)-$limit) . '-' . ($count_mail >= $paging*$limit ? $paging*$limit : $count_mail) . '/' . $count_mail) .\n\t service('pager')->makeLinks($paging, $limit, $count_mail, 'custom_mail');\n\t }\n\t\t}\n\n\t\treturn $this->response->setJSON($data);\n\t}", "private function _processNonLightbox()\n {\n global $interface;\n global $configArray;\n\n // Assign IDs\n if (isset($_REQUEST['selectAll']) && is_array($_REQUEST['idsAll'])) {\n $ids = $_REQUEST['idsAll'];\n } else if (isset($_REQUEST['ids'])) {\n $ids = $_REQUEST['ids'];\n }\n\n // Without IDs, we can't continue\n if (empty($ids)) {\n header(\n \"Location: \" . $this->followupUrl . \"?errorMsg=bulk_noitems_advice\"\n );\n exit();\n }\n\n if ($this->origin == \"Favorites\") {\n // If we're on a particular list, save the ID so we can redirect to\n // the appropriate page after exporting.\n if (isset($_REQUEST['listID']) && !empty($_REQUEST['listID'])) {\n $interface->assign('listID', $_REQUEST['listID']);\n } else {\n $interface->assign('followupModule', \"MyResearch\");\n $interface->assign('followupAction', \"Favorites\");\n }\n }\n\n $interface->assign('errorMsg', $this->errorMsg);\n $interface->assign('emailList', $this->getRecordDetails($ids));\n $interface->setPageTitle('email_selected_favorites');\n $interface->assign('subTemplate', 'email.tpl');\n $interface->assign('emailIDS', $ids);\n $interface->setTemplate('view.tpl');\n $interface->display('layout.tpl');\n }", "function SendMail($toid,$fromid,$subject,$body,$filename=\"\",$filepath=\"\",$mailformat=false)\n{\n global $adminmailid;\n\t\t\t\t\t$to=$toid;\n\t\t\t\t\tif($fromid==\"\")\n\t\t\t\t\t\t$fromid=ADMIN_EMAIL;\n\n $subject = $subject;\n\t\t\t\t\t$mailcontent =$body;\n\t\t\t\t\t//SendHTMLMail($to,$subject,$mailcontent);\n\t\t\t\t\t$mail=new phpmailer();\n\t\t\t\t\t$mail->AddAddress($to);\n\t\t\t\t\t$mail->Subject = $subject;\n\t\t\t\t\t$mail->Body =$mailcontent;\n\t\t\t\t\t $mail->AltBody =\" \";\n\t\t\t\t\t$mail->From=\"Administrator\";\n\t\t\t\t\tif($filename!=\"\")\n\t\t\t\t\t{\n \t\t\t $arrfilename=explode(\",\",$filename);\n\t\t\t\t\t $arrfilepath=explode(\",\",$filepath);\n\t\t\t\t\t for($i=0;$i<count($arrfilename);$i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$mail->AddAttachment($arrfilepath[$i], $arrfilename[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$mail->IsHTML($mailformat);\n\n\t\t\t\t\t$mail->FromName=$fromid;\n\nif(!$mail->Send())\n\t{\n\t //echo \"There was an error sending the message<br><font face='Verdana' size='2'><center></font></center>\";\n return false;\n\t}\nreturn true;\n}", "static public function handleIncomingEmails() {\n\n /**\n * Handle incoming emails for all generic comments (blogs, files, etc...)\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'generic_comment',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n\n // Setup the parameters\n set_input('topic_guid', $parameters['guid']);\n set_input('entity_guid', $parameters['guid']);\n set_input('generic_comment', $parameters['message']);\n\n // Set action\n set_input('action', 'comments/add');\n\n // Perform the action\n action(\"comments/add\");\n\n\n });\n\n /**\n * Handle incoming emails for discussion posts\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'group_topic_post',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n\n set_input('entity_guid', $parameters['guid']);\n set_input('group_topic_post', $parameters['message']);\n\n // Set action\n set_input('action', 'discussion/reply/save');\n\n // Perform the action\n action(\"discussion/reply/save\");\n\n\n });\n\n /**\n * Handle incoming emails for updating status\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'status_update',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n\n // Set update message\n // 140 characters or less\n set_input('body', substr($parameters['message'], 0, 140));\n set_input('method', 'site');\n\n // Set action\n set_input('action', 'thewire/add');\n\n // perform the action\n action(\"thewire/add\");\n\n\n });\n \n /**\n * Handle incoming emails to send private messages\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'messages',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n \n set_input('subject', $parameters['subject']);\n set_input('body', $parameters['message']);\n set_input('recipient_guid', $parameters['guid']);\n\n // Set action\n set_input('action', 'messages/send');\n\n // Perform the action\n action(\"messages/send\");\n });\n }", "function sc_mailbox_message_subject($parm = '')\n {\n // if(e107::getParser()->filter($_GET['id']))\n // {\n // return $this->var['message_subject'];\n // }\n\n \n $urlparms = array(\n 'id' => $this->var['message_id'],\n );\n\n // Check if draft, because then it requires a link to continue writing the message (compose)\n if(e107::getParser()->filter($_GET['page']) == 'draftbox')\n {\n $url = e107::url('mailbox', 'composeid', $urlparms);\n }\n else\n {\n $url = e107::url('mailbox', 'read', $urlparms);\n }\n\n if($parm['type'] == 'url')\n {\n return $url; \n }\n\n return $this->var['message_subject']; \n \n }", "abstract public function getNumMessages($mailbox=\"Inbox\");", "public function handle()\n {\n// $transport = Swift_SmtpTransport::newInstance('mail.shineway-enterprise.com', 587, 'tls')\n// ->setUsername('robot@shineway-enterprise.com')\n// ->setPassword('abcd1234');\n//\n// $mailer = Swift_Mailer::newInstance($transport);\n//\n// $message = Swift_Message::newInstance()\n// ->setTo('matthew@shineway-enterprise.com')\n// ->setFrom('robot@shineway-enterprise.com')\n// ->setSubject('Test Raw Email');\n// //->setBody(\"Test Body\");\n//\n// $mime = Swift_MimePart::newInstance(\"body of the original message\\r\\n> Quota Test\");\n// $mime->setEncoder(new Swift_Mime_ContentEncoder_RawContentEncoder);\n// $message->attach($mime);\n// $mailer->send($message);\n\n\n //return;\n\n if (!Storage::exists('email-attachment'))\n Storage::makeDirectory('email-attachment');\n\n $temp_dir = storage_path('app/email-attachment');\n\n $mailbox = new Mailbox(\"{\" . env(\"MAIL_HOST\") .\":143/imap/novalidate-cert}INBOX\", env(\"MAIL_USERNAME\"), env(\"MAIL_PASSWORD\"), $temp_dir);\n $mail_ids = $mailbox->searchMailbox('UNSEEN');\n\n $this->info(\"Unread Message: \" . sizeof($mail_ids));\n\n foreach ($mail_ids as $mail_id)\n {\n try {\n $mail = $mailbox->getMail($mail_id);\n //$mailbox->markMailAsUnread($mail_id);\n\n // Ignore SPAM\n if (starts_with($mail->subject, \"***Spam***\"))\n continue;\n\n preg_match(\"/\\[Order (GLC-\\d*-\\d*)\\]/\", $mail->subject, $re);\n if (sizeof($re) == 2)\n $order = Order::find($re[1]);\n else\n $order = null;\n\n\n if ($order)\n {\n \\App::setLocale($order->{Order::COLUMN_LANGUAGE});\n\n $isFromGuest = stripos($mail->subject, \"Enquire from Guest\") === false;\n\n $content = \\EmailReplyParser\\EmailReplyParser::parseReply($mail->textPlain);\n\n $order_message = new OrderMessage();\n $order_message->{OrderMessage::COLUMN_ORDER_ID} = $order->{Order::COLUMN_ID};\n $order_message->{OrderMessage::COLUMN_CONTACT_VIA} = OrderMessage::CONTACT_VIA_EMAIL;\n $order_message->{OrderMessage::COLUMN_TYPE} = $isFromGuest ? OrderMessage::TYPE_ENQUIRE : OrderMessage::TYPE_REPLY;\n $order_message->{OrderMessage::COLUMN_MESSAGE} = $content;\n $order_message->{OrderMessage::COLUMN_FROM_ADDRESS} = $mail->fromAddress;\n\n if (!$isFromGuest)\n {\n $user = User::where('email', $mail->fromAddress)->first();\n if ($user)\n $order_message->{OrderMessage::COLUMN_REPLY_BY} = $user->id;\n }\n\n $order_message->save();\n\n $order_message = $order_message->fresh();\n\n // Save attachments\n $attachments = [];\n foreach ($mail->getAttachments() as $incoming)\n {\n $attachment = new OrderMessageAttachment();\n $attachment->{OrderMessageAttachment::COLUMN_ORDER_MESSAGE_ID} = $order_message->{OrderMessage::COLUMN_ID};\n $attachment->{OrderMessageAttachment::COLUMN_NAME} = $incoming->name;\n $attachment->save();\n\n // Get the attachment id and then move file to storage\n $attachment = $attachment->fresh();\n\n $attachment_dir = storage_path(OrderMessageAttachment::STORAGE_FOLDER);\n if (!file_exists($attachment_dir))\n mkdir($attachment_dir, 0777, true);\n\n $attachment_filename = $attachment->{OrderMessageAttachment::COLUMN_ID} . '.' . pathinfo($incoming->name, PATHINFO_EXTENSION);\n\n rename($incoming->filePath, $attachment_dir . '/' . $attachment_filename);\n\n // Upload the db record\n $attachment->{OrderMessageAttachment::COLUMN_PATH} = $attachment_filename;\n $attachment->save();\n\n $attachments[] = $attachment;\n\n }\n\n // Send email\n if ($isFromGuest)\n {\n if ($order->notification_users->count() > 0)\n $addresses = $order->notification_users->pluck('email')->unique();\n else {\n $emailset = Emailset::where('type', Emailset::TYPE_DEFAULT_ORDER_NOTIFICATION)->first();\n if ($emailset)\n $addresses = $emailset->MailAddress->pluck('mail_address');\n else\n $addresses = [];\n }\n $view = \"admin.orders.emails.enquire\";\n $subject = \"[Order $order->id] Enquire from Guest\";\n }\n else\n {\n $addresses = $order->products()->pluck(OrderProduct::COLUMN_EMAIL)->unique();\n $view = \"admin.orders.emails.reply\";\n $subject = \"[Order $order->id] \" . trans('email.reply-subject');\n }\n\n foreach ($addresses as $address)\n {\n \\Mail::send($view, compact('order', 'order_message'), function ($m) use ($address, $order, $subject, $attachments) {\n foreach ($attachments as $attachment)\n {\n $m->attach($attachment->getStoragePath(), ['as' => $attachment->{OrderMessageAttachment::COLUMN_NAME}]);\n }\n\n $m->to($address)->subject($subject);\n });\n }\n\n }\n else\n {\n // Unclassified message\n $emailset = Emailset::where('type', Emailset::TYPE_DEFAULT_ORDER_NOTIFICATION)->first();\n if ($emailset)\n $addresses = $emailset->MailAddress->pluck('mail_address');\n else\n $addresses = [];\n\n foreach ($addresses as $address)\n {\n \\Mail::send('admin.orders.emails.forward', ['original' => $mail], function ($message) use ($mail, $address) {\n $message->to($address);\n $message->subject(\"FWD: \" . $mail->subject);\n });\n }\n }\n\n\n }\n catch(\\Exception $e)\n {\n $this->error($e->getMessage());\n }\n\n\n// \\Mail::send('admin.email.auto-reply', ['original' => $mail], function ($message) use ($mail) {\n// $message->to($mail->fromAddress);\n// $message->subject(\"Re: \" . $mail->subject);\n//\n//// $headers = $message->getSwiftMessage()->getHeaders();\n//// $headers->addTextHeader('References', $mail->messageId);\n//// $headers->addTextHeader('In-Reply-To', $mail->messageId);\n//\n//// dd($message->getSwiftMessage());\n////\n//// if ($mail->textHtml)\n//// $message->getSwiftMessage()->addPart($mail->textHtml, 'text/html');\n//// else if ($mail->textPlain)\n//// $message->getSwiftMessage()->addPart($mail->textPlain, 'text/plain');\n// });\n }\n\n }", "function send_email($to='', $fromMail='', $subject='', $html_content='', $text_content='', $headers='') { \n\n\t$html_content = (!empty($html_content)) ? str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), '', $html_content) : '';\n\n\t// # Setup mime boundary\n\t$mime_boundary = 'Multipart_Boundary_x'.md5(time()).'x';\n\n\t$headers = \"MIME-Version: 1.0\\r\\n\";\n\t$headers .= \"Content-Type: multipart/alternative; boundary=\\\"$mime_boundary\\\"\\r\\n\";\n\t$headers .= \"Content-Transfer-Encoding: 7bit\\r\\n\";\n\n\t$body\t = \"This is a multi-part message in mime format.\\n\\n\";\n\n\t// # Add in plain text version\n\t$body\t.= \"--$mime_boundary\\n\";\n\t$body\t.= \"Content-Type: text/plain; charset=charset=\\\"us-ascii\\\"\\n\";\n\t$body\t.= \"Content-Transfer-Encoding: 7bit\\n\\n\";\n\t$body\t.= $text_content;\n\t$body\t.= \"\\n\\n\";\n\n\t// # Add in HTML version\n\t$body\t.= \"--$mime_boundary\\n\";\n\t$body\t.= \"Content-Type: text/html; charset=\\\"UTF-8\\\"\\n\";\n\t$body\t.= \"Content-Transfer-Encoding: 8bit\\n\\n\";\n\t$body\t.= wordwrap($html_content,500,\"\\r\\n\");\n\t$body\t.= \"\\n\\n\";\n\n\t// # Attachments would go here\n\t// # But this whole email thing should be turned into a class to more logically handle attachments, \n\n\t// # End email\n\t$body\t.= \"--$mime_boundary--\\n\"; // # trailing --, required to close email body for mime's\n\n\t// # Finish off headers\n\t$headers .= \"From: \".$fromMail.\"\\r\\n\";\n\t$headers .= \"X-Sender-IP: \".$_SERVER['argv'][3].\"\\r\\n\";\n\t$headers .= 'Date: '.date('n/d/Y g:i A').\"\\r\\n\";\n\t$headers .= \"Reply-To: \".STORE_OWNER_EMAIL_ADDRESS.\" \\r\\n\";\n\n\t// # Mail it out\n\treturn mail($to, $subject, $body, $headers);\n}", "public function testGetVoicemailGroupMailbox()\n {\n }", "public function testMailingList() {\n\t}", "public function testGetFoldersFromFolderId()\n {\n\n }", "function NewSendEmail($SrcType,$SrcId,$to,$sub,&$letter,&$attachments=0,&$embeded=0,$from='') { \n global $FESTSYS,$CONF;\n \n// echo \"Debug: \" .( UserGetPref('EmailDebug')?2:0) . \"<p>\";\n $Send = 1;\n if (@ $CONF['testing']){\n if (strstr($CONF['testing'],'@')) { \n $to = $CONF['testing'];\n } else { \n echo \"<p>Would send email to \" . Pretty_Print_To($to);\n if ($from) echo \"From: \" . Pretty_Print_To($from);\n echo \" with subject: $sub<p>Content:<p>$letter<p>\\n\";\n \n echo \"Text: \" . ConvertHtmlToText($letter);\n if ($attachments) {\n if (is_array($attachments)) {\n foreach ($attachments as $i=>$att) {\n if (is_array($att)) {\n if (isset($att[0])) {\n echo \"Would attach \" . $att[0] . \" as \" . $att[1] . \"<p>\";\n } else {\n echo \"Would attach \" . $att['AttFileName'] . \"<p>\"; \n }\n } else {\n echo \"Would Attach \" . $att . \"<p>\";\n }\n } \n } else {\n echo \"Would attach $attachments<p>\"; \n }\n }\n if ($embeded) {\n if (is_array($embeded)) {\n foreach ($embeded as $i=>$att) {\n if (is_array($att)) {\n if (isset($att[0])) {\n echo \"Would embed \" . $att[0] . \" as \" . $att[1] . \"<p>\";\n } else {\n echo \"Would embed \" . $att['AttFileName'] . \"<p>\";\n }\n } else {\n echo \"Would embed \" . $att . \"<p>\"; \n }\n } \n } else {\n echo \"Would embed $embeded<p>\"; \n }\n }\n $Send = 0;\n// exit; // Uncomment to test in depth\n// return; // Under test this will then log, and not send\n }\n }\n $From = $FESTSYS['SMTPuser'];\n $Atts = [];\n \n $email = new PhpMailer(true);\n try {\n $email->SMTPDebug = ((Access('SysAdmin') && UserGetPref('EmailDebug'))?2:0); // 2 general testing, 4 problems...\n $email->isSMTP();\n $mailserv = $FESTSYS['HostURL'];\n if (Feature('SMTPsubdomain')) $mailserv = Feature('SMTPsubdomain') . \".\" . $mailserv;\n $email->Host = $mailserv;\n $email->SMTPAuth = true;\n $email->AuthType = 'LOGIN';\n $email->From = $email->Username = $FESTSYS['SMTPuser'] . \"@\" . $FESTSYS['HostURL'];\n $email->FromName = $FESTSYS['FestName'];\n $email->Password = $FESTSYS['SMTPpwd'];\n $email->SMTPSecure = 'tls';\n $email->Port = 587;\n $email->SMTPOptions = ['ssl' => [ 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true]];\n \n if ($from) {\n if (is_array($from)) {\n $email->setFrom($from[0],$from[1]);\n } else {\n $email->setFrom($from);\n }\n }\n \n if (is_array($to)) {\n if (is_array($to[0])) {\n foreach ($to as $i=>$too) {\n if (!isset($too[0])) continue;\n $a = $too[1];\n $n = (isset($too[2])?$too[2]:'');\n switch ($too[0]) {\n case 'to':\n $email->addAddress($a,$n);\n $To = \"$n <$a>\";\n break;\n case 'cc':\n $email->addCC($a,$n);\n break;\n case 'bcc':\n $email->addBCC($a,$n);\n break;\n case 'replyto':\n $email->addReplyTo($a,$n);\n break;\n case 'from':\n $email->setFrom($a,$n);\n $From = \"$n <$a>\";\n break;\n } \n }\n } else {\n $email->addAddress($to[0],(isset($to[1])?$to[1]:''));\n $To = $to[0]; \n }\n } else {\n $email->addAddress($to);\n }\n $email->Subject = $sub;\n $email->isHTML(true);\n $email->Body = $letter; // HTML format\n $email->AltBody = ConvertHtmlToText($letter); // Text format\n\n if ($attachments) {\n if (is_array($attachments)) {\n foreach ($attachments as $i=>$att) {\n if (is_array($att)) {\n if (isset($att[0])) {\n $email->addAttachment($att[0],$att[1]);\n $Atts[] = [$att[0],$att[1],0];\n } else {\n $email->addAttachment($att['AttFileName']);\n $Atts[] = [\"\",$att['AttFileName'],0];\n }\n } else { \n $email->addAttachment($att);\n $Atts[] = [\"\",$att,0];\n }\n } \n } else {\n $email->addAttachment($attachments);\n $Atts[] = [\"\",$attachments,0];\n }\n }\n if ($embeded) {\n if (is_array($embeded)) {\n foreach ($embeded as $i=>$att) { \n if (is_array($att)) {\n if (isset($att[0])) {\n $email->addEmbeddedImage($att[0],$att[1]);\n $Atts[] = [$att[0],$att[1],1];\n } else {\n $email->addEmbeddedImage($att['AttFileName']);\n $Atts[] = [\"\",$att['AttFileName'],1];\n }\n } else {\n $email->addEmbeddedImage($att);\n $Atts[] = [\"\",$att,1];\n }\n }\n } else {\n $email->addEmbeddedImage($embeded,0); \n $Atts[] = [\"\",$embeded,1];\n }\n }\n\n if ($Send) $email->Send();\n \n } catch (Exception $e) {\n echo 'Message could not be sent. Mailer Error: ', $email->ErrorInfo;\n }\n\n $EmLog = ['Type'=>$SrcType,'TypeId'=>$SrcId,'Subject'=>$sub,'FromAddr'=>json_encode($From),'ToAddr'=>json_encode($to), 'TextBody'=>$letter,'Date'=>time()];\n $logid = Insert_db('EmailLog', $EmLog);\n if ($Atts && $logid) {\n foreach ($Atts as $at) {\n $atc = ['EmailId'=>$logid,'AttName'=>$at[0],'AttFileName'=>$at[1],'AttType'=>$at[2]];\n Insert_db('EmailAttachments',$atc);\n }\n }\n}", "function mailFollowupEx($tm, $type, $more_addresses = false, $changes='') {\n\n\t\t$monitor_ids = array();\n\n\t\tif (!$changes) {\n\t\t\t$changes=array();\n\t\t}\n\n\t\t$sess = session_get_user();\n\t\t$name = util_unconvert_htmlspecialchars($this->ArtifactType->getName());\n\t\t$body = $this->ArtifactType->Group->getUnixName() . '-' . $name .' '. $this->getStringID();\n\n\t\tif ($type == 1) {\n\t\t\t$body .= ' was opened at '.date('Y-m-d H:i', $this->getOpenDate());\n\t\t} elseif ($type == 3) {\n\t\t\t$body .= ' was deleted at '.date('Y-m-d H:i', time());\n\t\t} else {\n\t\t\t$body .= ' was changed at '.date('Y-m-d H:i', $tm);\n\t\t}\n\t\tif ($sess) {\n\t\t\t$body .= ' by ' . $sess->getRealName();\n\t\t}\n\n\t\tif ($type == 1 || $type == 2) {\n\t\t\t$body .= \"\\nYou can respond by visiting: \".\n\t\t\t\t\"\\n\".util_make_url ('/tracker/?func=detail&atid='. $this->ArtifactType->getID() .\n\t\t\t\t\t \"&aid=\". $this->getID() .\n\t\t\t\t\t \"&group_id=\". $this->ArtifactType->Group->getID());\n\t\t\tif (false) { // currently not working\n\t\t\t\t$body .=\n\t\t\t\t\"\\nOr by replying to this e-mail entering your response between the following markers: \".\n\t\t\t\t\"\\n\".ARTIFACT_MAIL_MARKER.\n\t\t\t\t\"\\n(enter your response here, only in plain text format)\".\n\t\t\t\t\"\\n\".ARTIFACT_MAIL_MARKER;\n\t\t\t}\n\t\t\t$body .= \"\\n\";\n\t\t}\n\n\t\t$body .= \"\\n\".$this->marker('status',$changes).\n\t\t\t \"Status: \". $this->getStatusName() .\"\\n\".\n\t\t\t$this->marker('priority',$changes).\n\t\t\t \"Priority: \". $this->getPriority() .\"\\n\".\n\t\t\t\"Submitted By: \". $this->getSubmittedRealName() .\n\t\t\t\" (\". $this->getSubmittedUnixName(). \")\".\"\\n\".\n\t\t\t$this->marker('assigned_to',$changes).\n\t\t\t \"Assigned to: \". $this->getAssignedRealName() .\n\t\t\t \" (\". $this->getAssignedUnixName(). \")\".\"\\n\".\n\t\t\t$this->marker('summary',$changes).\n\t\t\t \"Summary: \". util_unconvert_htmlspecialchars( $this->getSummary() ).\" \\n\";\n\n\t\t// Now display the extra fields\n\t\t$efd = $this->getExtraFieldDataText();\n\t\tforeach ($efd as $efid => $ef) {\n\t\t\t$body .= $this->marker('extra_fields', $changes, $efid);\n\t\t\t$body .= $ef[\"name\"].\": \".htmlspecialchars_decode($ef[\"value\"]).\"\\n\";\n\t\t}\n\n\t\t$subject='['. $this->ArtifactType->Group->getUnixName() . '-' . $name . ']' . $this->getStringID() .' '. util_unconvert_htmlspecialchars( $this->getSummary() );\n\n\t\tif ($type > 1) {\n\t\t\t// get all the email addresses that are monitoring this request or the ArtifactType\n\t\t\t$monitor_ids = array_merge($this->getMonitorIds(), $this->ArtifactType->getMonitorIds());\n\t\t} else {\n\t\t\t// initial creation, we just get the users monitoring the ArtifactType\n\t\t\t$monitor_ids = $this->ArtifactType->getMonitorIds();\n\t\t}\n\n\t\t$emails = array();\n\t\tif ($more_addresses) {\n\t\t\t$emails[] = $more_addresses;\n\t\t}\n\t\t//we don't email the current user\n\t\tif ($this->getAssignedTo() != user_getid()) {\n\t\t\t$monitor_ids[] = $this->getAssignedTo();\n\t\t}\n\t\tif ($this->getSubmittedBy() != user_getid()) {\n\t\t\t$monitor_ids[] = $this->getSubmittedBy();\n\t\t}\n\t\t//initial submission\n\t\tif ($type==1) {\n\t\t\t//if an email is set for this ArtifactType\n\t\t\t//add that address to the BCC: list\n\t\t\tif ($this->ArtifactType->getEmailAddress()) {\n\t\t\t\t$emails[] = $this->ArtifactType->getEmailAddress();\n\t\t\t}\n\t\t} else {\n\t\t\t//update\n\t\t\tif ($this->ArtifactType->emailAll()) {\n\t\t\t\t$emails[] = $this->ArtifactType->getEmailAddress();\n\t\t\t}\n\t\t}\n\n\t\t$body .= \"\\n\\nInitial Comment:\".\n\t\t\t\"\\n\".util_unconvert_htmlspecialchars( $this->getDetails() ) .\n\t\t\t\"\\n\\n----------------------------------------------------------------------\";\n\n\t\tif ($type > 1) {\n\t\t\t/*\n\t\t\t\tNow include the followups\n\t\t\t*/\n\t\t\t$result2=$this->getMessages();\n\n\t\t\t$rows=db_numrows($result2);\n\n\t\t\tif ($result2 && $rows > 0) {\n\t\t\t\tfor ($i=0; $i<$rows; $i++) {\n\t\t\t\t\t//\n\t\t\t\t\t//\tfor messages posted by non-logged-in users,\n\t\t\t\t\t//\twe grab the email they gave us\n\t\t\t\t\t//\n\t\t\t\t\t//\totherwise we use the confirmed one from the users table\n\t\t\t\t\t//\n\t\t\t\t\tif (db_result($result2,$i,'user_id') == 100) {\n\t\t\t\t\t\t$emails[] = db_result($result2,$i,'from_email');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$monitor_ids[] = db_result($result2,$i,'user_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$body .= \"\\n\\n\";\n\t\t\t\t\tif ($i == 0) {\n\t\t\t\t\t\t$body .= $this->marker('details',$changes);\n\t\t\t\t\t}\n\t\t\t\t\t$body .= \"Comment By: \". db_result($result2,$i,'realname') . \" (\".db_result($result2,$i,'user_name').\")\".\n\t\t\t\t\t\"\\nDate: \". date( _('Y-m-d H:i'),db_result($result2,$i,'adddate') ).\n\t\t\t\t\t\"\\n\\nMessage:\".\n\t\t\t\t\t\"\\n\".util_unconvert_htmlspecialchars( db_result($result2,$i,'body') ).\n\t\t\t\t\t\"\\n\\n----------------------------------------------------------------------\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t$body .= \"\\n\\nYou can respond by visiting: \".\n\t\t\t\"\\n\".util_make_url ('/tracker/?func=detail&atid='. $this->ArtifactType->getID() .\n\t\t\t\t\t \"&aid=\". $this->getID() .\n\t\t\t\t\t \"&group_id=\". $this->ArtifactType->Group->getID());\n\n\t\t//only send if some recipients were found\n\t\tif (count($emails) < 1 && count($monitor_ids) < 1) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (count($monitor_ids) < 1) {\n\t\t\t$monitor_ids=array();\n\t\t} else {\n\t\t\t$monitor_ids=array_unique($monitor_ids);\n\t\t}\n\n\t\t$from = $this->ArtifactType->getReturnEmailAddress();\n\t\t$extra_headers = 'Reply-to: '.$from;\n\n\t\t// load the e-mail addresses of the users\n\t\t$users = user_get_objects($monitor_ids);\n\t\tif (count($users) > 0) {\n\t\t\tforeach ($users as $user) {\n\t\t\t\tif ($user->getStatus() == \"A\") { //we are only sending emails to active users\n\t\t\t\t\t$emails[] = $user->getEmail();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//now remove all duplicates from the email list\n\t\tif (count($emails) > 0) {\n\t\t\t$bcc = implode(',',array_unique($emails));\n\t\t\tutil_send_message('', $subject, $body, $from, $bcc, '', $extra_headers);\n\t\t}\n\n\t\t$this->sendSubjectMsg = $subject;\n\t\t$this->sendBodyMsg = $body;\n\n\t\t//util_handle_message($monitor_ids,$subject,$body,$BCC);\n\n\t\treturn true;\n\t}", "function _thumbwhere_content_collection_notify() {\n\n if (twCanDebug()) {\n watchdog('thumbwhere_content_collection', 'incoming notification.');\n }\n\n $numargs = func_num_args();\n $arg_list = func_get_args();\n\n \n\tif (twCanDebug()) debug('$numargs = ' . $numargs);\n\t\n\tif (twCanDebug()) debug('$arg_list = ' . $arg_list);\n\t\n\tif (twCanDebug()) debug('$_REQUEST');\n\tif (twCanDebug()) debug($_REQUEST);\n\t\n\tif (twCanDebug()) debug('$_GET');\n\tif (twCanDebug()) debug($_GET);\n\t\n\tif (twCanDebug()) debug('$_POST');\n\tif (twCanDebug()) debug($_POST);\n\t\n\t//if (twCanDebug()) debug('$HTTP_RAW_POST_DATA');\n\t//if (twCanDebug()) debug($HTTP_RAW_POST_DATA);\n\t\n\tif (twCanDebug()) debug('$_SERVER');\n\tif (twCanDebug()) debug($_SERVER);\n\t\n\t//if (twCanDebug()) debug('$GLOBALS');\n\t//if (twCanDebug()) debug($GLOBALS);\n\n \n\n if (variable_get('thumbwhere_api_log_debug', 0) == 1) {\n foreach ($arg_list as $arg) {\n if (twCanDebug()) debug('$arg = ' . $arg);\n }\n }\n\n\n //////////////////////////////////////////////////\n //\n //\n\n switch ($_SERVER['REQUEST_METHOD']) {\n\n case 'POST': {\n if ($numargs == 1) {\n if ($arg_list[0] == 'content_collection') {\n\n //\n // Get the POST data as XML\n //\n\n $post_xml = new SimpleXMLElement('php://input', null, true);\n if (twCanDebug()) debug('$post_xml');\n if (twCanDebug()) debug($post_xml);\n\n if (twCanDebug()) debug('$post_xml->getName()');\n if (twCanDebug()) debug($post_xml->getName());\n\n // We expect 'action' as the root element. TODO: I would rather this was the more generic 'request'\n if ($post_xml->getName() != 'action') {\n drupal_add_http_header('Status', '404 not found.');\n print('We were expecting \\'action\\', as the root element, not \\'' . $post_xml->getName() . '\\'.');\n exit(0);\n }\n\n /*\n * SimpleXMLElement::__set_state(array(\n * 'content_collection' =>\n * SimpleXMLElement::__set_state(array(\n * '@attributes' =>\n * array (\n * 'key' => '8e9ff318-3cd7-4593-99de-4c37c0fb335a',\n * 'op' => 'create',\n * ),\n * )),\n * ))\n */\n\n\n // We expect 'action' as the root element.\n if (!isset($post_xml->content_collection)) {\n drupal_add_http_header('Status', '404 not found.');\n print('We were expecting a \\'content_collection\\', element in the action payload.');\n exit(0);\n }\n\n // Handle the incoming notification for content ingest\n _thumbwhere_handle_content_collection_notify_xml($post_xml->content_collection);\n\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid resource');\n exit(0);\n }\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid notification request url format.');\n exit(0);\n }\n }\n break;\n\n case 'GET': {\n\n if ($numargs == 1) {\n\n // If we are returning the index.xml file for the webservice.\n if ($arg_list[0] == 'index.xml') {\n // return index.xml\n drupal_add_http_header('Content-Type', 'text/xml');\n readfile(dirname(__FILE__) . '/index.xml');\n exit(0);\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('File not found.');\n exit(0);\n }\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid notification request url format.');\n exit(0);\n }\n }\n break;\n\n default: {\n drupal_add_http_header('Status', '404 not found.');\n exit(0);\n }\n break;\n }\n\n //\n //\n ////////////////////////////////////////////////////////////////////////////////////\n \n}", "private function _get_listed_messages($mailboxes = array(), $search_str = '', $sort_field = '', $sort_order = 'ASC', $query_offset = 0, $query_limit = 50) {\n\n /*\n * Build query\n */\n $base_messages_query = $this->_get_list_message_query(array_keys($mailboxes), $query_offset, $query_limit, $sort_field, $sort_order, $search_str, array());\n\n /*\n * Execute query\n */\n $base_messages_result = $this->dbmail->query($base_messages_query);\n \n //$this->rc->console('count: ' . $base_messages_result->rowCount());\n \n $headers = array();\n $msg_index = ($query_offset + 1);\n while ($msg = $this->dbmail->fetch_assoc($base_messages_result)) {\n\n /*\n * Get physmessage properties\n */\n $physmessage_record = $this->get_physmessage_record($msg[\"physmessage_id\"]);\n if (!$physmessage_record) {\n // Not found!\n return FALSE;\n }\n\n /*\n * Ok - prepare message data array\n */\n $message_data = array(\n 'message_idnr' => $msg[\"message_idnr\"],\n 'unique_id' => $msg[\"unique_id\"],\n 'physmessage_id' => $msg['physmessage_id'],\n 'message_size' => $physmessage_record[\"messagesize\"],\n 'seen_flag' => $msg[\"seen_flag\"],\n 'answered_flag' => $msg[\"answered_flag\"],\n 'deleted_flag' => $msg[\"deleted_flag\"],\n 'flagged_flag' => $msg[\"flagged_flag\"],\n 'folder_record' => array(\n 'name' => $mailboxes[$msg[\"mailbox_idnr\"]]\n ),\n 'mailbox_idnr' => $msg['mailbox_idnr']\n );\n\n /*\n * Retrieve message headers / body\n */\n $headers[$msg_index] = $this->retrieve_message($msg[\"message_idnr\"], $mailboxes[$msg[\"mailbox_idnr\"]], $message_data, FALSE);\n\n $msg_index++;\n }\n\n return array_values($headers);\n }", "public function index()\n\t{ \n\t\t$mail_path = base64_url($path, 'decode');\n\t}", "function restoreFolder($store, $folderentryid, $entryidlist, $action){\t\n\t\t\t$binEntryIdList = Array();\n\t\t\t$displayNameList = Array();\n\t\t\t//here the entryids and displaynames are stored in seprate arrays so \n\t\t\t//that folders display name can be checked for conflicting names which restoring folders. \n\t\t\tforeach($entryidlist as $key => $value){\n\t\t\t\t$binEntryIdList[] = hex2bin($entryidlist[$key][\"entryid\"]);\n\t\t\t\t$displayNameList[] = u2w($entryidlist[$key][\"display_name\"]);\n\t\t\t}\n\t\t\t\n\t\t\t$sfolder = mapi_msgstore_openentry($store, $folderentryid);\n\t\t\tfor($entryindex = 0;$entryindex < count($binEntryIdList); $entryindex++){\n\t\t\t\tmapi_folder_copyfolder($sfolder, $binEntryIdList[$entryindex], $sfolder, $displayNameList[$entryindex], FOLDER_MOVE);\n\t\t\t\t//here we check mapi errors for conflicting of names when folder/s is restored. \n\t\t\t\tif(mapi_last_hresult()==MAPI_E_COLLISION){\n\t\t\t\t\t$foldername = $GLOBALS[\"operations\"]->checkFolderNameConflict($store, $sfolder, $displayNameList[$entryindex]);\n\t\t\t\t\tmapi_folder_copyfolder($sfolder, $binEntryIdList[$entryindex], $sfolder, $foldername, FOLDER_MOVE);\n\t\t\t\t\t$result = (mapi_last_hresult()==NOERROR);\n\t\t\t\t\tif(!$result){\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// as after moving the folder's the entryid gets changed, so need to notify about the folder\n\t\t\t// so that we can update the folder on parent page.\n\t\t\t$folderProps = mapi_getprops($sfolder, array(PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID));\n\t\t\t$GLOBALS[\"bus\"]->notify(bin2hex($folderentryid), TABLE_SAVE, $folderProps);\n\n\t\t\treturn $result;\n\t\t}", "function Sending_MultyEMail($temp_value,$to,$cc,$subject,$path)\n{\n \t$mailmsg=createTemplate($temp_value,$path);\n\t$mailparam=array(\"to\"=>$to,\"toname\"=>\"\", \"cc\"=>$cc, \"bcc\"=>\"\", \"replyto\" => \"\", \"replytoname\" => \"\", \"subject\" =>$subject, \"message\"=>$mailmsg, \"fromemail\"=>\"\", \"fromname\"=>\"\", \"attachment\"=>\"\");\n\t\n\tif(sendmail($mailparam))\n\t{\n\t\t$statusresult[0] = true;\n\t\treturn $statusresult;\n\t}\n\telse\n\t{\n\t\t$statusresult[0] = false;\n\t\t$statusresult['msg'] = \"Unable to send mail\";\n\t\t$statusresult['errorcode']=-1;\n\t\treturn $statusresult;\n\t}\n}", "public function testEmailSharedLink()\n {\n }", "protected function makeMailBoundaries() {\n\t\t$this->_mailAlternativeBoundary = 'ALT_B_' . md5(uniqid(time()));\n\t\t$this->_mailFileBoundary = 'ATT_B_' . md5(uniqid(time()+10));\n\t}", "private function sendMessage() {\n\t\t$valid = true;\n\t\t\n\t\techo $recipients = $this->_requestParam('recipients');exit;\n\t\t$subjecttext = $this->_requestParam('subject');\n\t\t$bodytext = $this->_requestParam('message');\n\t\t$sendtime = $this->_requestParam('sendtime');\n\t\t$timezone = $this->_requestParam('timezone');\n\t\t\n\t\t// Cleanup send time\n\t\tif ($sendtime) {\n\t\t\t$tparts = str_split($sendtime, 2);\n\t\t\t$sendtime = $tparts[0].$tparts[1] . '-' . $tparts[2] . '-' . $tparts[3] . ' ' . $tparts[4] . ':' . $tparts[5] . ':00';\n\t\t}\n\t\t\n\t\t// Not using this at the moment, so don't want anyone to access it\n\t\t//$folder = $this->_request->getParam('id');\n\t\t//$loadby = $this->_request->getParam('field');\n\t\t$folder = false;\n\t\t$loadby = false;\n\t\t\n\t\t// Folder is optional (at the moment...)\n\t\tif ($folder) {\n\t\t $folder = new Application_Model_Folder($this->apiuser, $folder, $loadby);\n\t\t \n\t\t if ($folder->isValid()) {\n\t\t // Get subscribers in this folder\n \t\t\t$subscribers = $folder->getSubscribers();\n \t\t\t\n \t\t\t// TODO: Come up with a better way to pull phone #'s out of a folder's subscriber list\n \t\t\tforeach ($subscribers as $subscriber) {\n \t\t\t $recipients[] = $subscriber['phonenumber'];\n \t\t\t}\n\t\t } else {\n\t\t $valid = false;\n\t\t\t\t$this->setError($folder->getError(), 500);\n\t\t }\n\t\t}\n\t\t\n\t\t// Validate and send\n\t\tif ($valid) {\n \t\tif ($recipients) {\n \t\t\tif ($bodytext) {\n \t\t\t\t$message = new Application_Model_Message($this->apiuser);\n \t\t\t\t$bodytext = urldecode($bodytext);\n \t\t\t\t$subjecttext = urldecode($subjecttext);\n \t\t\t\t\n \t\t\t\t// Build the message with a subject if there is one.\n \t\t\t\t$msg = $subjecttext ? $subjecttext.': '.$bodytext : $bodytext;\n \t\t\t\t\n \t\t\t\t// Queue it up for delivery\n \t\t\t\t$return = $message->queue($msg, $recipients, $sendtime, $timezone);\n \t\t\t\t\n \t\t\t\tif ($return) {\n \t\t\t\t\t$this->setOutputParam('status', true);\n \t\t\t\t\t$this->setOutputParam('message', 'Message successfully sent.');\n \t\t\t\t} else {\n \t\t\t\t\t$this->setError($message->getError(), 500);\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\t$this->setError('Message is required.', 500);\n \t\t\t}\n \t\t} else {\n \t\t\t$this->setError('At least one recipient is required.', 500);\n \t\t}\n\t\t}\n\t}", "public function multi_attach_mail($to, $files, $sendermail, $subject, $message)\n\t{\n\t\t$from = \"Files attach <\".$sendermail.\">\";\n\t\t/*$subject = date(\"d.M H:i\").\" F=\".count($files);\n\t\t\t$message = date(\"Y.m.d H:i:s\").\"\\n\".count($files).\" attachments\";*/\n\t\t$headers = \"From: $from\";\n\n\t\t// boundary\n\t\t$semi_rand = md5(time());\n\t\t$mime_boundary = \"==Multipart_Boundary_x{$semi_rand}x\";\n\n\t\t// headers for attachment\n\t\t$headers .= \"\\nMIME-Version: 1.0\\n\".\"Content-Type: multipart/mixed;\\n\".\" boundary=\\\"{$mime_boundary}\\\"\";\n\n\t\t// multipart boundary\n\t\t$message = \"--{$mime_boundary}\\n\".\"Content-Type: text/plain; charset=\\\"iso-8859-1\\\"\\n\".\n\t\t\t\"Content-Transfer-Encoding: 7bit\\n\\n\".$message.\"\\n\\n\";\n\n\t\t// preparing attachments\n\t\tfor ($i = 0; $i < count($files); $i++)\n\t\t{\n\t\t\tif (is_file($files[$i]))\n\t\t\t{\n\t\t\t\t$message .= \"--{$mime_boundary}\\n\";\n\t\t\t\t$fp = @fopen($files[$i], \"rb\");\n\t\t\t\t$data = @fread($fp, filesize($files[$i]));\n\t\t\t\t@fclose($fp);\n\t\t\t\t$data = chunk_split(base64_encode($data));\n\t\t\t\t$message .= \"Content-Type: application/octet-stream; name=\\\"\".basename($files[$i]).\"\\\"\\n\".\n\t\t\t\t\t\"Content-Description: \".basename($files[$i]).\"\\n\".\n\t\t\t\t\t\"Content-Disposition: attachment;\\n\".\" filename=\\\"\".basename($files[$i]).\"\\\"; size=\".filesize($files[$i]).\";\\n\".\n\t\t\t\t\t\"Content-Transfer-Encoding: base64\\n\\n\".$data.\"\\n\\n\";\n\t\t\t}\n\t\t}\n\t\t$message .= \"--{$mime_boundary}--\";\n\t\t$returnpath = \"-f\".$sendermail;\n\t\t$ok = @mail($to, $subject, $message, $headers, $returnpath);\n\t\tif ($ok)\n\t\t{\n\t\t\treturn $i;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}" ]
[ "0.64656925", "0.5971009", "0.5830328", "0.5822168", "0.5805009", "0.57944626", "0.572633", "0.56741095", "0.5671253", "0.56588316", "0.56554395", "0.5639827", "0.56097615", "0.5530014", "0.5523291", "0.54827464", "0.5415981", "0.5414461", "0.53819937", "0.53809136", "0.5373698", "0.5324859", "0.53196806", "0.5302643", "0.53003186", "0.5295134", "0.5293038", "0.52598584", "0.52523625", "0.52507025", "0.52472866", "0.5210449", "0.5208139", "0.5206207", "0.5204828", "0.51965004", "0.51949155", "0.5193232", "0.5169851", "0.51637274", "0.5149069", "0.51464885", "0.51373184", "0.51360893", "0.5126557", "0.5116022", "0.510814", "0.50958323", "0.5093222", "0.50868064", "0.5084678", "0.5082774", "0.50786644", "0.5058246", "0.505681", "0.505425", "0.50404024", "0.5036148", "0.5033033", "0.5032744", "0.50266254", "0.5023774", "0.5017971", "0.501299", "0.5010195", "0.5005321", "0.50032747", "0.5002438", "0.49890643", "0.49831033", "0.4982705", "0.4975052", "0.49728155", "0.49676746", "0.4965254", "0.49540138", "0.4953367", "0.4940603", "0.4930482", "0.49271274", "0.4926858", "0.49183676", "0.49168152", "0.4915437", "0.49099898", "0.4908661", "0.48993075", "0.4898756", "0.48963872", "0.4894532", "0.48853263", "0.48823148", "0.4878292", "0.48737735", "0.48716107", "0.4864633", "0.48609272", "0.4858746", "0.48584554", "0.48546022", "0.48541373" ]
0.0
-1
Detect if this is the parent or the child
function newpid() { if ($this->lock_pid == getmypid()) { # This is the parent # Must wait for child to call newpid before processing. # A little patience for the child to call newpid $patience = time() + 10; while (time() < $patience) { if (rename("$this->lock_file.fork",$this->rand_file)) { # Child finished its newpid call. # Wipe the signal file. unlink( $this->rand_file ); break; } # Brief pause before checking again # to avoid intensive IO across NFS. usleep(100000); # sleep for 0.1 seconds } # Fake the parent into thinking it is already # unlocked because the child will take care of it. $this->unlocked = true; } else { # This is the new child # The lock_line found in the lock_file contents # must be modified to reflect the new pid. # Fix lock_pid to the new pid. $this->lock_pid = getmypid(); # Backup the old lock_line. $old_line = $this->lock_line; # Clear lock_line to create a fresh one. $this->lock_line = null; # Append a new lock_line to the lock_file. $this->create_magic($this->lock_file); $new_line = $this->lock_line; # Remove the old lock_line from lock_file. $this->lock_line = $old_line; $this->do_unlock_shared(); # Create signal file to notify parent that # the lock_line entry has been delegated. fopen($_FH, $this->lock_file .".fork",'w'); close($_FH); $this->lock_line = $new_line; #because PHP doeesn't have local scoping... } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isParent();", "public function hasParent();", "public function hasParent();", "public function hasParent();", "public function hasParent() {}", "public function isParent() {\n\t\treturn $this->isParent;\n\t}", "private function is_parent()\n\t{\n\t\treturn is_null($this->category_id);\n\t}", "public function isChild() {\n\t\treturn $this->_parent !== null;\n\t}", "public function isChildOnly();", "public function isCurrentChild(): bool;", "public function isChild(): bool;", "public function hasParent()\n {\n }", "public function getIsParent() {\n\t\treturn $this->isParent;\n\t}", "public function isChild()\n {\n return $this->parentId != null;\n }", "function is_child($parent) {\n\tglobal $wp_query;\n\tif ($wp_query->post->post_parent == $parent) { $return = true; } else { $return = false; }\n\treturn $return;\n}", "public function isChild(): bool\n {\n return false;\n }", "public function hasParent() {\n return isset($this->_parent);\n }", "public function hasParent()\n\t{\n\t\treturn !empty($this->parent);\n\t}", "public function hasParent() {\n\t\treturn $this->parent()->count() == 1;\n\t}", "public function hasParent()\n {\n return $this->currentParent !== null;\n }", "protected function hasParentMenuItem() {}", "public function isChild()\n {\n if (false === $this->parent_category) {\n return false;\n }\n\n return true;\n\n }", "public function getIsChildAttribute(){\n return $this->parent_id != NULL;\n }", "function hasParent() {\n\t\treturn (bool) ($this->parentID);\n\t}", "final public function hasParent() {\n\t\treturn ($this->_parentNode !== null);\n\t}", "abstract public function is_for_parent_node(Jquarry_Node $parent);", "protected function hasParentMenuItemKey() {}", "public function hasParentChildFilter() {\n return $this->_has(4);\n }", "function is_parent($parent_node, $child_node)\r\n\t{\r\n\t\t$p_root_id = $parent_node['root_id'];\r\n\t\t$p_l = $parent_node['l'];\r\n\t\t$p_r = $parent_node['r'];\r\n\r\n\t\t$c_root_id = $child_node['root_id'];\r\n\t\t$c_l = $child_node['l'];\r\n\t\t$c_r = $child_node['r'];\r\n\r\n\t\tif (($p_root_id == $c_root_id) && ($p_l < $c_l && $p_r > $c_r))\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}", "function has_post_parent($post = \\null)\n {\n }", "final public function allowsParent() {\n\t\treturn true;\n\t}", "public function isChildSupported();", "public function is_parent($target)\n {\n if ( ! ($target instanceof $this))\n $target = $this->factory_item($target);\n elseif ( !$target->loaded )\n $target->reload();\n\n return ((int) $this->primary_key === (int) $target->parent_key);\n }", "public function get_parent();", "function salmon_parent_is($atom, $parent, $breadcrumbs) {\n\treturn ($breadcrumbs[$atom['level'] - 1] == $parent); \n}", "public function hasParent(BaseObject $node)\n {\n return (bool)$node->getParentIdValue();\n }", "public function hasParentId(){\n return $this->_has(3);\n }", "public static function currentUserisParent()\n {\n return (check_user_role('parent')) ? true : false;\n }", "public function getRenderParents(): bool;", "function getParent();", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function is_parent_available() {\n\t\t$parent = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'name' => $this->theme->get_template(),\n\t\t\t'posts_per_page' => 1,\n\t\t\t'post_type' => 'repopackage',\n\t\t\t'orderby' => 'ID',\n\t\t\t'suppress_filters' => false,\n\t\t) );\n\t\t$this->theme->post_parent = current( $parent );\n\n\t\treturn ! empty( $parent );\n\t}", "protected function touchingParent()\n {\n return $this->getRelated ()->touches ( $this->guessInverseRelation () );\n }", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public static function isParent($parent, $child) {\r\n $parent_version = new Version($parent);\r\n $child_version = new Version($child);\r\n $parent_support_condition = $parent_version->N == $child_version->N \r\n && $parent_version->isSupportBranch() \r\n && ($child_version->isReleaseBranch() || $child_version->isBuild());\r\n $parent_release_condition = $parent_version->N == $child_version->N \r\n && $parent_version->M == $child_version->M \r\n && $parent_version->isReleaseBranch() \r\n && $child_version->isRelease();\r\n return ($parent_support_condition || $parent_release_condition);\r\n }", "abstract public function parent();", "public function getHasChild()\n {\n $sql = \"SELECT * FROM \" . TB_USAGE . \" WHERE parent_id = \" . $this->db->sqltext($this->mix_id);\n $this->db->query($sql);\n if ($this->db->num_rows() > 0) {\n $this->hasChild = true;\n } else {\n $this->hasChild = false;\n }\n\n return $this->hasChild;\n }", "public function get_isTableWiTreeParentField()\n {\n if ( empty( $this->arr_tablesWiTreeparentfield ) )\n {\n return false;\n }\n\n return true;\n }", "public function hasSiblings() {}", "public function isSelf(){\n\t\t$db = new DB_WE();\n\n\t\tif($this->ID){\n\t\t\t$count = 0;\n\t\t\t$parentid = $this->ParentID;\n\t\t\twhile($parentid != 0){\n\t\t\t\tif($parentid == $this->ID){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t$parentid = f('SELECT ParentID FROM ' . escape_sql_query($this->_table) . ' WHERE ID=' . intval($parentid), '', $db);\n\t\t\t\t$count++;\n\t\t\t\tif($count == 9999){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function isChildren()\n {\n return count($this->children)>0;\n }", "protected function hasParentMenuArr() {}", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function hasParentMessage(): bool {\n return isset($this->parentMessageId);\n }", "public function isOnlyChild(): bool\n {\n if ($this->isFirstChild() === true && $this->isLastChild() === true) {\n return true;\n } else {\n return false;\n }\n }", "public function hasSiblings();", "function custom_is_child($pid)\n{\n global $post; // load details about this page\n $anc = get_post_ancestors($post->ID);\n foreach ($anc as $ancestor) {\n if (is_page() && $ancestor == $pid) {\n return true;\n }\n }\n return false; // we're elsewhere\n}", "public function parent() { return $this->post->post_parent; }", "public function isParentOf($page) {\n if(!is_a($page, 'Page')) $page = page($page);\n\n return $this->is($page) ? false : $page->parent->is($this);\n }", "public function isAncestor()\n {\n $model_ticket_forwarded_to = self::find()->andWhere(['forwarded_from_id' => $this->id])->one();\n\n return !is_null($model_ticket_forwarded_to);\n }", "function isChildOrSubChildOf($refArticle) {\n\t\tif (is_numeric($refArticle)) {\n\t\t\t$refArticle = polarbear_article::getInstance($refArticle);\n\t\t}\n\t\t$isChild = false;\n\t\t// loop our way up until we reach the top article or refArticle\n\t\t// $refArticle\n\t\t$doLoop = true;\n\t\t$tmpA = $this;\n\t\twhile ($doLoop) {\n\t\t\t// get parent article\n\t\t\t$tmpA = $tmpA->parent();\n\t\t\tif ($tmpA == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t#echo \"<br><br>tmpA:\".$tmpA->getTitleArticle();\n\t\t\t#echo \"<br> refArticle->getId():\" . $refArticle->getId();\n\t\t\t#echo \"<br> tmpA->getId():\" . $tmpA->getId();\n\t\t\t#echo \"<br> tmpA->getParentId():\"; var_dump($tmpA->getParentId());\n\t\t\t// check if the parent article is the refArticle. if it is, that means that $this is a child of $refArticle\n\t\t\tif ($tmpA->getId() == $refArticle->getId()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// if parent is null = is at top level\n\t\t\tif ($tmpA->getParentId()==null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\n\t\tpb_pqp_log_speed(\"article isChildOrSubChildOf()\");\n\n\t\treturn false;\n\t}", "function has_child () {\n\t\treturn sizeof($this->children) ? true : false;\n\t}", "protected function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function hasChildren(): bool;", "public function getParentNode()\r\n {\r\n return $this->_parentNode ? $this->_parentNode : false;\r\n }", "public function hasChildren() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "function is_child($pageID) { \n\tglobal $post; \n\tif( is_page() && ($post->post_parent==$pageID) ) {\n return true;\n\t} else { \n return false; \n\t}\n}", "public function is_child($target)\n {\n if ( ! ($target instanceof $this))\n $target = $this->factory_item($target);\n elseif ( !$target->loaded )\n $target->reload();\n\n return ((int) $this->parent_key === (int) $target->primary_key);\n }", "function is_parent()\n{ \n global $post;\n\n if ( is_page() && $post->post_parent ) {\n // This is a subpage\n return;\n\n } else {\n // This is not a subpage\n return true;\n }\n \n}", "public function isNavbarClickableparent()\r\n\t{\r\n\t\treturn $this->navbarClickableparent;\r\n\t}", "function is_property_parent($entity_type, $name) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getPropsHelper();\n\n return $helper->propIsParent($name);\n}", "public function getGrandParent();", "public function hasChildren () {\n return ($this->current () instanceof self);\n }", "function is_property_self_parent($entity_type, $name) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getPropsHelper();\n\n return $helper->propIsSelfParent($name);\n}", "public function hasHasRemoteParent(){\n return $this->_has(11);\n }", "protected function retrieveParent()\n {\n }", "public static function is_parent($id)\n {\n if ('parent_service' == BA_Lib::get_product_type($id)) {\n return true;\n }\n return false;\n }" ]
[ "0.8252481", "0.77812743", "0.77812743", "0.77812743", "0.77277786", "0.75959295", "0.75503385", "0.75284773", "0.7514375", "0.7434257", "0.73479927", "0.7346543", "0.72572976", "0.72147954", "0.719216", "0.7176184", "0.7143872", "0.71225893", "0.7083779", "0.7069521", "0.7027337", "0.70230263", "0.701579", "0.7010033", "0.68058556", "0.6661858", "0.6566709", "0.6534394", "0.6493128", "0.64853346", "0.64514554", "0.64301866", "0.6416451", "0.637208", "0.63684857", "0.635626", "0.63304114", "0.6326157", "0.62758785", "0.6240554", "0.62302834", "0.62302834", "0.62044543", "0.6190611", "0.6169293", "0.6169293", "0.6169293", "0.6169293", "0.6160185", "0.6134256", "0.6130565", "0.6128862", "0.61227924", "0.6107875", "0.6092224", "0.60908747", "0.6071192", "0.6071192", "0.6071192", "0.6071192", "0.6071192", "0.6071192", "0.6071192", "0.6071192", "0.6071192", "0.6071192", "0.6070376", "0.6068109", "0.6065642", "0.6058637", "0.6057117", "0.6052391", "0.6050662", "0.6034665", "0.60290754", "0.6027882", "0.6027379", "0.60127413", "0.60098934", "0.60096544", "0.60096544", "0.60096544", "0.60096544", "0.60096544", "0.60096544", "0.60096544", "0.6009585", "0.6009585", "0.6009585", "0.6009585", "0.60055685", "0.60044473", "0.6000245", "0.5987978", "0.596409", "0.5955577", "0.5932188", "0.59120893", "0.59072345", "0.58805287", "0.587912" ]
0.0
-1
Display a listing of the resource.
public function show() { $sewa = UserSewa::Where('user_id', auth()->id())->get(); return response([ 'total' => $sewa->count(), 'messages' => 'Retrieved successfuly', 'data' => ConsoleResource::collection($sewa) ], 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $sewa = UserSewa::find($id); if ($sewa != null) { $sewa->delete(); return response(['message' => 'Pesanan has been deleted!']); } else { return response([ 'message' => 'No data found!', ], 403); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "public function remove($id);", "public function remove($id);", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6671365", "0.6660839", "0.66361386", "0.6632988", "0.6624729", "0.6542195", "0.6541645", "0.6466739", "0.6288393", "0.61767083", "0.6129533", "0.608954", "0.6054169", "0.60443425", "0.60073143", "0.59338665", "0.59317696", "0.592145", "0.5920155", "0.59065086", "0.5897853", "0.58968836", "0.58958197", "0.58958197", "0.58958197", "0.58958197", "0.58800334", "0.5869308", "0.5861188", "0.5811069", "0.5774596", "0.5763277", "0.5755447", "0.5747713", "0.5742094", "0.573578", "0.5727048", "0.57164854", "0.5712422", "0.57092893", "0.57080173", "0.5707143", "0.5704078", "0.5696418", "0.5684556", "0.5684556", "0.56790006", "0.5678463", "0.5658492", "0.564975", "0.5648406", "0.56480885", "0.5641393", "0.5638992", "0.56302536", "0.56228197", "0.5616424", "0.5607389", "0.56033397", "0.5602035", "0.55991143", "0.55988586", "0.5590501", "0.5581284", "0.55681103", "0.5566215", "0.55644745", "0.5563726", "0.55593926", "0.55583876", "0.5548547", "0.5542015", "0.5541403", "0.5541403", "0.55397224", "0.55390894", "0.55376494", "0.5531044", "0.5529739", "0.55279493", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527892", "0.5527671", "0.5527155", "0.5526666", "0.55245256", "0.552101", "0.55183184" ]
0.0
-1
Obtiene todos los gastos de la base de datos
public static function getAll() { $consulta = "SELECT * FROM " . self::TABLE_NAME; try { // Preparar sentencia $comando = DatabaseConnection::getInstance()->getDb()->prepare($consulta); // Ejecutar sentencia preparada $comando->execute(); return $comando->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAll(){\n \n // 1. Establece la conexion con la base de datos y trae todos los generos\n $query = $this->getDb()->prepare(\" SELECT * FROM genero\");\n $query-> execute(); \n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "public function loadAll() {\n $gerimu_masyvas = [];\n\n foreach ($this->db->getRows($this->table_name) as $gerimas) {\n $gerimu_masyvas[] = new \\App\\Item\\Gerimas($gerimas);\n }\n\n return $gerimu_masyvas;\n }", "function dadosCadastros(){//função geral que será chamada na index\n pegaCadastrosJson();//pega os valores dos cadastros do arquivo JSON e salva em um array\n contaNumeroCadastros();//conta Quantos cadastros existem\n }", "public static function getAll() {\n $lesObjets = array();\n $requete = \"SELECT * FROM genre\";\n $stmt = Bdd::getPdo()->prepare($requete);\n $ok = $stmt->execute();\n if ($ok) {\n // Tant qu'il y a des enregistrements dans la table\n while ($enreg = $stmt->fetch(PDO::FETCH_ASSOC)) {\n //ajoute un nouveau genre au tableau\n $lesObjets[] = self::enregVersMetier($enreg);\n }\n }\n return $lesObjets;\n }", "public function consultarTodos()\n\t{\n\t\t$sql = \t' SELECT colores.* '.\n\t\t\t\t' FROM colores '.\n\t\t\t\t' ORDER BY nombre ';\n\t\n\t\t$stmt = $this->getEntityManager()->getConnection()->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetchAll(); //Se utiliza el fecth por que es un registro\n\t\t\n\t\t//Elimina los espacios\n\t\tforeach($result as &$reg)\n\t\t{\n\t\t\t$reg['nombre'] = trim($reg['nombre']);\n\t\t}//end foreach\n\t\n\t\treturn $result;\n\t}", "function leerTodosGrupos() {\n $link = crearConexion();\n $grupos = [];\n\n $query = \"SELECT nombre, imagen, descripcion FROM grupo\";\n $result = mysqli_query($link, $query);\n cerrarConexion($link);\n while ($linea = mysqli_fetch_array($result)) {\n $fila['nombre'] = $linea['nombre'];\n $fila['imagen'] = $linea['imagen'];\n $fila['descripcion'] = $linea['descripcion'];\n\n $grupos[] = $fila;\n }\n\n return $grupos;\n}", "function findAll() {\n\t\t$query = \"SELECT id, nameEN, nameES FROM saga\";\n\t\t$res = array();\n\t\t\n\t\tforeach(DB::ejecutarConsulta($query) as $row) {\n\t\t\t// Añadimos un objeto por cada elemento obtenido\n\t\t\t$res[] = new SagaDAO($row);\n\t\t}\n\t\treturn $res;\n\t}", "public function tratarDados(){\r\n\t\r\n\t\r\n }", "function getAll() {\n $this->getConnection();\n $request = \"SELECT ID_GROUPE, DATE_CREATION, NOM, NIVEAU FROM GROUPE\";\n $result = $this->select($request);\n return $result;\n }", "public function lista() {\n $sql = \"SELECT * FROM cliente\";\n $qry = $this->db->query($sql); // query do pdo com acesso ao bd\n\n //return $qry->fetchAll(); // retorna todos os registros\n return $qry->fetchAll(\\PDO::FETCH_OBJ); // retorna todos os registros a nível de objeto\n }", "public function datos_gasolina() \n {\n $registros = DB::table('gasolinas')\n ->join ('carros', 'gasolinas.Carros_idCarro', '=', 'carros.id')\n ->select('gasolinas.id', 'gasolinas.Fecha', 'gasolinas.Litros', 'gasolinas.Total', \n 'gasolinas.Documento', 'gasolinas.Ticket', 'gasolinas.Estado', 'carros.Marca', \n 'carros.Modelo')\n ->get();\n return $registros;\n // return Gasolina::all();\n }", "public function get_all_godzina(){\n\t\t$data['godziny']=array();\n\t\t$query = $this->db->query('select * from godzina');\t\n\t\tforeach($query->result() as $row){\n\t\t\t\tarray_push($data['godziny'],array('id_godzina'=>$row->id_godzina,'godzina'=>$row->godzina));\n\t\t\t\n\t\t}\n\t\treturn $data;\n\t}", "function SHOWALL(){\n\n $stmt = $this->db->prepare(\"SELECT * FROM centro\");\n $stmt->execute();\n $centros_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $allcentros = array(); //array para almacenar los datos de todos los centros\n\n //Recorremos todos las filas de centros devueltas por la sentencia sql\n foreach ($centros_db as $centro){\n //Introducimos uno a uno los grupos recuperados de la BD\n array_push($allcentros,\n new CENTRO_Model(\n $centro['centro_id'],$centro['nombre_centro'],$centro['edificio_centro']\n )\n );\n }\n return $allcentros;\n }", "public function obtenerTodos()\n\t{\n\t\ttry\n\t\t{\n $this->conectar();\n \n\t\t\t$lista = array(); /*Se declara una variable de tipo arreglo que almacenará los registros obtenidos de la BD*/\n\n\t\t\t$sentenciaSQL = $this->conexion->prepare(\"SELECT IdProducto, NombreProducto, Descripcion, Precio, Stock, Categoria,Marca, Descuento,Proveedor, Estado,Foto\n\t\t\tFROM producto\"); /*Se arma la sentencia sql para seleccionar todos los registros de la base de datos*/\n\t\t\t\n\t\t\t$sentenciaSQL->execute();/*Se ejecuta la sentencia sql, retorna un cursor con todos los elementos*/\n \n /*Se recorre el cursor para obtener los datos*/\n\t\t\tforeach($sentenciaSQL->fetchAll(PDO::FETCH_OBJ) as $fila)\n\t\t\t{\n\t\t\t\t$obj = new Producto();\n\n $obj->IdProducto=$fila->IdProducto;\n $obj->NombreProducto=$fila->NombreProducto;\n $obj->Descripcion=$fila->Descripcion;\n $obj->Precio=$fila->Precio;\n $obj->Stock=$fila->Stock;\n $obj->Categoria=$fila->Categoria;\n $obj->Marca=$fila->Marca;\n $obj->Descuento=$fila->Descuento;\n $obj->Proveedor=$fila->Proveedor;\n $obj->Estado=$fila->Estado;\n $obj->Foto=$fila->Foto;\n\n\t\t\t$lista[] = $obj;\n\t\t\t\n\t\t\t}\n \n\t\t\treturn $lista;\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\techo $e->getMessage();\n\t\t\treturn null;\n\t\t}\n\t\tfinally\n\t\t{\n Conexion::cerrarConexion();\n }\n\t}", "public function getGrupos(){\n\t\t$filasPagina = 7;//registros mostrados por página\n\n\t\tif(isset($_GET['pagina'])){//si le pasamos el valor \"pagina\" de la url (si el usuario da click en la paginación)\n\t\t\t\tif($_GET['pagina']==1){\n\t\t\t\t$pagina=1; \n\t\t\t\theader(\"Location: principal.php?c=controlador&a=muestraGrupos\");\n\t\t\t\t}else{\n\t\t\t\t\t$pagina=$_GET['pagina'];//índice que indica página actual\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$pagina=1;//índice que indica página actual\n\t\t\t}\n\n\t\t\t$empezarDesde = ($pagina-1) * $filasPagina;\n\n\t\t\t$sql = \" SELECT * FROM grupos \";\n\n\t\t\t$resultado = $this->db->query($sql);\n\n\t\t\t$resultado->execute(array());\n\n\t\t\t$numFilas = $resultado->rowCount();//número de registos totales de la consulta\n\n\t\t\t//ceil — Redondear fracciones hacia arriba\n\t\t\t$totalPaginas = ceil($numFilas / $filasPagina);//calcula cuántas páginas serán en total para mostrar todos los registros\n\n\t\t\t$resultado->closeCursor();\n\n\t\t//------------------------- Consulta para mostrar los resultados ---------------------------\n\n\t\t\t$sql_limite = \" SELECT * FROM grupos LIMIT $empezarDesde , $filasPagina \";\n\n\t\t\t$resultado = $this->db->query($sql_limite);//ejecutando la consulta con la conexión establecida\n\n\t\t\twhile($row = $resultado->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$this->objeto[] = $row;//llenando array con valores de la consulta\n\t\t\t}\n\n\t\treturn $this->objeto;\n\t}", "function getAllDatos()\n\t\t\t{\n\t\t\t\t$datos=array(\n\t\t\t\t\"id\"=>$this->id,\n\t\t\t\t\"dni\"=>$this->dni,\n\t\t\t\t\"nombres\"=>$this->nombres,\n\t\t\t\t\"apellidos\"=>$this->apellidos,\n\t\t\t\t\"nombre_empresa\"=>$this->nombre_empresa,\n\t\t\t\t\"id_area\"=>$this->id_area,\n\t\t\t\t\"nombre_area\"=>$this->nombre_area,\n\t\t\t\t\"id_cargo\"=>$this->id_cargo,\n\t\t\t\t\"nombre_cargo\"=>$this->nombre_cargo,\n\t\t\t\t\"activo\"=>$this->activo,\n\t\t\t\t\"correo\"=>$this->correo,\n\t\t\t\t\"password\"=>$this->password);\n\t\t\t\treturn $datos;\n\n\t\t\t}", "public static function traerTodos()\n {\n $query = \"SELECT * FROM posteos ORDER BY idposteo DESC\";\n $db = DBConnection::getConnection();\n $stmt = $db->prepare($query);\n $stmt->execute();\n\n $salida = [];\n\n while($fila = $stmt->fetch()) {\n\n $post = new Posteo();\n\n $post->cargarDatos($fila);\n\n $salida[] = $post;\n }\n\n return $salida;\n }", "function listeGroupes(){\n $groupes = array();\n $connexion = new Connexion();\n $query = 'SELECT * FROM GROUPE';\n $result = $connexion->query($query);\n foreach($result as $row){\n $groupes[] = array('id'=>$row['id'],'libelle'=>$row['libelle'],'nombre'=>$row['nombre']);\n }\n return $groupes;\n}", "public function getTodos(){\n\t\t\t$this->db->query(\"SELECT * FROM generos\");\n\t\t\treturn $this->db->fetchAll();\n\t\t}", "public function busca_alunos(){\n\n\t\t\t$sql = \"SELECT * FROM aluno\";\n\n\t\t\t/*\n\t\t\t*isntrução que realiza a consulta de animes\n\t\t\t*PDO::FETCH_CLASS serve para perdir o retorno no modelo de uma classe\n\t\t\t*PDO::FETCH_PROPS_LATE serve para preencher os valores depois de executar o contrutor\n\t\t\t*/\n\n\t\t\t$resultado = $this->conexao->query($sql, PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'Aluno');\n\n $alunos = [];\n\n foreach($resultado as $aluno){\n $alunos[] = $aluno;\n }\n\n \t\t\treturn $alunos;\n\t\t}", "public function getAll() {\n\n $query = $this->db->prepare('SELECT * FROM comentario ORDER BY puntaje');\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "function obtenerRegistros($datos = []) {\n\t\t$this->openConnection();\n\t\t$sentencia = $this->conn->prepare($this->consulta);\n\t\tif(!empty($datos)){\n\t\t\tforeach ($datos as $key => $value) {\n\t\t\t\t$sentencia->bind_param($key, $value);\n\t\t\t}\n\t\t}\n\t\t$sentencia->execute();\n\t\t$reg = $sentencia->get_result();\n\t\t$rows = $reg->num_rows;\n\t\t$i = 0;\n\t\tdo {\n\t\t\t$this->registros[] = $reg->fetch_assoc();\n\t\t\t$i++;\n\t\t} while ($i < $rows);\n\t\t$this->closeConnection();\n\t}", "public function gestores(){\n\t\t$gestores = $this->query(\"SELECT id, Nombre, Clave, supervisor FROM gestors AS Gestor WHERE Activo=1\");\n\t\treturn $gestores;\n\t}", "function get_all_galeri()\n {\n return $this->db->get('galeri')->result_array();\n }", "public function get_all()\n {\n $conn = db();\n \n $clientes = [];\n \n $consulta = \"SELECT * FROM cliente\";\n try{\n \n $stmt = $conn->query($consulta);\n \n }catch(PDOException $ex){\n console_log($ex->getMessage());\n }\n\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $clientes[] = [\n 'id' => $row['id'],\n 'username' => $row['username'],\n 'passwd' => $row['passwd'],\n 'nombre' => $row['nombre'],\n 'apellidos' => $row['apellidos'],\n 'email' => $row['email'],\n 'domicilio' => $row['domicilio'],\n 'fechaCreacion' => $row['fechaCreacion'],\n 'fechaModificacion' => $row['fechaModificacion'],\n 'Cesta_id' => $row['Cesta_id']\n ];\n }\n return $clientes;\n \n }", "public function datos_gasolina_cheques() \n {\n $registros = DB::table('pago_gasolinas')\n ->join('gasolina_has_pago_gasolina', \n 'gasolina_has_pago_gasolina.Pago_gasolina_idPago_gasolina', '=', 'pago_gasolinas.id')\n ->join('gasolinas', 'gasolinas.id', '=', 'gasolina_has_pago_gasolina.Gasolina_id')\n ->select('pago_gasolinas.id', 'pago_gasolinas.Fecha', 'pago_gasolinas.Folio_pago', \n 'gasolinas.Ticket', 'pago_gasolinas.Cantidad', 'pago_gasolinas.Metodo_pago',\n 'pago_gasolinas.Documento')\n ->get();\n return $registros;\n }", "public function selectAllRegiuniData(){\n $sql = \"SELECT * FROM regiune ORDER BY id DESC\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "public function getAll(){\n //hacemos la consulta y lo guardamos en una variable\n $productos=$this->db->query(\"SELECT * FROM pedidos order by id desc;\");\n //devolvemos un valor en especifico.\n return $productos;\n }", "public function addAll($_request)\n\t{\n\t\t$_request[\"id_taller\"] = $_SESSION['user_info']['id_taller'];\n\t\t$_request[\"id_user\"] = $_SESSION['user_id'];\n\t\t$_request[\"total\"] = $_request['total-globalgasto'];\n\t\t$data=fromArray($_request,'gastos',$this->db,\"add\");\n\t\t$sql= \"INSERT INTO gastos (\".$data[0].\") VALUES(\".$data[1].\"); \";\n\t\t$res=$this->db->query($sql);\n\t\t$sql= \"SELECT LAST_INSERT_ID();\";//. $num ;\n\t\t$res=$this->db->query($sql);\n\t\t$set=array();\n\t\t$id=\"\";\n\t\tif(!$res){ die(\"Error getting result\"); }\n\t\telse{\n\t\t\twhile ($row = $res->fetch_assoc())\n\t\t\t\t$id= $row;\n\t\t}\n\t\t$id = $id[\"LAST_INSERT_ID()\"];\n\t\t$gastostipo\t= $_request[\"id_gastostiporegistros\"];\n\t\t$total\t\t= $_request[\"totalesregistros\"];\n\t\t$cantidad\t= $_request[\"cantidad\"];\n\t\t$detalles\t= $_request[\"detalles\"];\n\t\t\n\t\tforeach ($gastostipo as $key => $value) {\n\t\t\t$total = ($total[$key]) ? $total[$key] : 0 ;\n\t\t\t$cant = $cantidad[$key];\n\t\t\t$detalle = $detalles[$key];\n\t\t\t$id_gastostipo = $value;\n\t\t\t$_requestgastos[\"id_gastos\"] = $id;\n\t\t\t$_requestgastos[\"id_gastostipo\"] = $id_gastostipo;\n\t\t\t$_requestgastos[\"detalles\"] \t = $detalle;\n\t\t\t$_requestgastos[\"cantidad\"] = $cant;\n\t\t\t$_requestgastos[\"total\"] = $total;\n\t\t\t$objGastosRegistros = new GastosRegistros();\n\t\t\tif(!$objGastosRegistros->addAll($_requestgastos)){\n\t\t\t\techo \"Falla en insert pedido refaccion\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\tif($id_gastostipo==7){//nomina\n\t\t\t\t$objNomina = new Nomina();\n\t\t\t\t$_requestnomina[\"available\"] = 0;\n\t\t\t\tif(!$objNomina->updateAll($detalle,$_requestnomina)){\n\t\t\t\t\techo \"Falla en update de nomina available\";\n\t\t\t\t\texit;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn $id;\n\t}", "public static function findAll():array \r\n {\r\n $db = Database::getDatabase();\r\n $db->consulta(\"SELECT * FROM puesto;\");\r\n\r\n $datos=[];\r\n while ($puesto = $db->getObjeto(\"Puesto\")) {\r\n array_push($datos, $puesto); \r\n }\r\n\r\n return $datos;\r\n }", "public function cboGrados(){\n\t\t$db = new connectionClass();\n\n\t\t$sql = $db->query(\"SELECT * FROM grado\");\n\t\t$numberRecord = $sql->num_rows;\n\n\t\tif ($numberRecord != 0) {\n\t\t\t$dataArray = array();\n\t\t\t$i = 0;\n\n $dataArray[$i] = array(\"id\" => '0' , \"descripcion\" => 'Grado');\n\n\t\t\twhile($data = $sql->fetch_assoc()){\n $i++;\n\t\t\t\t$dataArray[$i] = array(\"id\" => $data['idGrado'], \"descripcion\" => $data['Descripcion']);\n\t\t\t}\n\n\t\t\theader(\"Content-type: application/json\");\n\t\t\treturn json_encode($dataArray);\n\t\t}\n\t}", "function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }", "public function getAll(){\n try{\n $sql = \"SELECT * FROM {$this->tabela}\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $dados = $stm->fetchAll(PDO::FETCH_OBJ);\n return $dados;\n }catch(PDOException $erro){\n echo \"<script>alert('Erro na linha: {$erro->getLine()}')</script>\";\n }\n }", "function galerien_liste()\n\t{\n\t\t$sql = sprintf(\"SELECT * FROM %s\n\t\t\t\t\t\tORDER BY bgalg_order_id\",\n\t\t\t$this->db_praefix.\"ecard_galerien\"\n\t\t);\n\t\t$temp_return = $this->db->get_results($sql, ARRAY_A);\n\t\treturn $temp_return;\n\t}", "public function getAllArr()\n\t{\n\t\t$sql = \"SELECT g.id,g.nombre,g.total,u.nombre,u.apellido_pat,u.apellido_mat,g.created_date,gt.nombre gastostipo,gt.tipo\n\t\tFROM gastos g \n\t\tleft join gastos_tipo gt on gt.id=g.id_gastostipo \n\t\tleft join user u on u.id=g.id_user \n\t\t\twhere g.status='active';\";\n\t\t$res = $this->db->query($sql);\n\t\t$set = array();\n\t\tif(!$res){ die(\"Error getting result\"); }\n\t\telse{\n\t\t\twhile ($row = $res->fetch_assoc())\n\t\t\t\t{ $set[] = $row; }\n\t\t}\n\t\treturn $set;\n\t}", "public function lihatDataGaleri(){\n\t\t$this->db->where(\"tipe\",1);\n\t\treturn $this->db->get(\"galeri\");\n\t}", "public function obtenerGestores(){\n $this->gestorAccesoDatos->conectar();\n $resultado = $this->gestorAccesoDatos->obtenerUsuarios();\n $this->gestorAccesoDatos->cerrarConexion();\n return $resultado;\n }", "public function buscar() {\n $buscarUsuario = new SqlQuery(); //instancio la clase\n (string) $tabla = get_class($this); //uso el nombre de la clase que debe coincidir con la BD \n try {\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienza la transacción\n $statement = $this->refControladorPersistencia->ejecutarSentencia(\n $buscarUsuario->buscar($tabla)); //senencia armada desde la clase SqlQuery sirve para comenzar la busqueda\n $arrayUsuario = $statement->fetchAll(PDO::FETCH_ASSOC); //retorna un array asociativo para no duplicar datos\n $this->refControladorPersistencia->get_conexion()->commit(); //si todo salió bien hace el commit\n return $arrayUsuario; //regreso el array para poder mostrar los datos en la vista... con Ajax... y dataTable de JavaScript\n } catch (PDOException $excepcionPDO) {\n echo \"<br>Error PDO: \" . $excepcionPDO->getTraceAsString() . '<br>';\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n }\n }", "public function listAll()\n\t{\n\t\t$sql = new Conexao;\n\n\t\treturn $sql->select(\"SELECT * FROM tb_criarapuracao\");\n\t}", "public function getAll()\n {\n $sql = \"SELECT * FROM Oto LIMIT15\";\n\n $stmt = $this->database->query($sql);\n return $stmt->fetchAll();\n\n }", "public function buscarDados()\n\t{\n\t\t$res = array();\n\t\t$cmd = $this->pdo->query(\"SELECT * FROM tbadm ORDER BY id_adm Desc\");\n\t\t$res = $cmd->fetchAll(PDO::FETCH_ASSOC);\n\t\treturn $res;\n\t}", "public function obtenerTodosLosAlergenos(){\n $respuesta = $this->realizarPeticion('GET', $this->urlBase.'GetAlergenos');\n\n $datos = json_decode($respuesta);\n\n $alergenos = $datos->objeto;\n\n return $alergenos;\n }", "public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM alojamientos';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "public function buscarTodos() {\r\n global $conn;\r\n $qry = $conn->query(\"SELECT * FROM conta\");\r\n $items = array();\r\n while($linha = $qry->fetch()) {\r\n $items[] = new Conta($linha[\"saldo\"], $linha[\"numero\"], $linha[\"cpf\"],$linha[\"cnpj\"]);\r\n }\r\n return $items;\r\n }", "function getAll() {\n global $dbh, $schema;\n try {\n // using prepared statements will help protect you from SQL injection\n $stmt = $dbh->prepare(\"SELECT * FROM $schema.ingrediente\");\n $stmt->execute();\n // get array containing all of the result set rows \n $result = $stmt->fetchall(PDO::FETCH_ASSOC);\n return $result;\n }\n catch(PDOException $e) {\n $_SESSION[\"s_errors\"][\"generic\"][] = \"ERRO[16]: \".$e->getMessage();\n header(\"Location: ../../index.php\");\n die;\n }\n }", "public function generos(){\n\t\t$gen = $this->request->getPost();\n\t\t$genero = strtoupper($gen['genero']);\n\t\t//dd($genero);\n\n\t\t//Construção da consulta por genero\n\t\t$db = \\Config\\Database::connect();\n\t\t$builder = $db->table('livros');\n\n\t\t$builder->select('livros.id,livros.imagem\"imagem\", livros.titulo\"titulo\", autores.nome\"autor\", livros.descricao\"descricao\"', FALSE);\n\t\t$builder->join('genero_livro', 'genero_livro.id_livro = livros.id')\n\t\t\t\t->join('generos', 'generos.id = genero_livro.id_genero')\n\t\t\t\t->join('autores_livros', 'autores_livros.id_livro = livros.id')\n\t\t\t\t->join('autores', 'autores.id = autores_livros.id_autor');\n\n\t\t$builder->where('generos.nome',$genero);\n\t\t$query = $builder->get();\n\t\t$resultado = $query->getResultArray();\n\t\t//dd($resultado);\n\t\t\n\t\t//Autores mostrados por padrão\n\t\t$autoresmodel = model('AutorModel');\n\t\t$autores = $autoresmodel->findAll();\n\n\t\t//Variaveis setadas para compatibilidade no reaproveitamento de Home\n\t\t$livros = $resultado;\n\t\t$session = session();\n\t\t$dados = [\n\t\t\t'autores' => $autores,\n\t\t\t'livros' => $livros,\n\t\t\t'session' => $session\n\t\t];\n\n\t\techo view('home',$dados);\n\t}", "public function getAll() {\n $result = array();\n $stm = $this->conn->query('SELECT * FROM VAGAS ');\n if($stm) {\n while($row = $stm->fetch(PDO::FETCH_OBJ)) {\n $VAGAS = new vaga(); \n\t\t\t\t\t$VAGAS->setId($row->id);\n\t\t\t\t\t$VAGAS->setN_vagas($row->nvagas);\n\t\t\t\t\t$VAGAS->setRemun($row->remun);\n\t\t\t\t\t$VAGAS->setAtividades($row->atividades);\n\t\t\t\t\t$VAGAS->setHorario($row->horario);\n $result[] = $VAGAS;\n }\n }\n return $result;\n\t\t\n }", "public function pegaTodos(){\n\t\treturn $this->resultado->fetchAll();\n\t}", "public function getAll()\n {\n // chuan bi cau lenh truy\n var_dump($this->conn);\n die();\n $sql = \"SELECT * FROM cars;\";\n\n // thu thi truy van\n $stmt = $this->conn->query($sql);\n\n //lay tat ca kq tra ve\n $result = $stmt->fetchAll();\n // su ly ket qua\n $cars = [];\n foreach ($result as $item) {\n $car = new Car($item['id'], $item['name'], $item['author'], $item['price']);\n array_push($cars, $car);\n }\n return $cars;\n }", "public function devolveTodosGruposAreas() {\n\t\t$this->load->database();\n\t\t$queryResult = $this->db->select('Area.id as AreaID , Area.nome, Grupo.id as GrupoID, Grupo.tipo,')\n\t\t\t\t\t\t\t\t->from('Grupo_Area')\n\t\t\t\t\t\t\t\t->join('Area', 'Grupo_Area.area = Area.id')\n\t\t\t\t\t\t\t\t->join('Grupo', 'Grupo_Area.grupo = Grupo.id')\n\t\t\t\t\t\t\t\t->get();\n\t\t$result = $queryResult->result();\t\t\t\t\t\n\t\t\n\t\treturn $result;\n\t}", "function getAll(){\n\t\t\t$pelicula = new Pelicula();\n\n\t\t\t//Creamos el array y le agregamos el item\n\t\t\t$peliculas = array();\n\t\t\t$peliculas[\"items\"] = array();\n\n\t\t\t//Se pide los datos de la base de datos\n\n\t\t\t$res = $pelicula->obtenerPeliculas();\n\n\t\t\t//se cuentan las filas y si las hay inicia el ciclo\n\n\t\t\tif($res->rowCount()){\n\n\t\t\t\twhile($row = $res->fetch(PDO::FETCH_ASSOC)){\n\n\t\t\t\t\t//se agregan los datos al array de item\n\t\t\t\t\t$item = array(\n\t\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t\t'nombre' => $row['nombre'],\n\t\t\t\t\t\t'imagen' => $row['imagen']\n\t\t\t\t\t);\n\t\t\t\t\t//se agregan los datos al array de item\n\t\t\t\t\tarray_push($peliculas['items'], $item);\n\t\t\t\t}\n\n\t\t\t\t//Se envia el array a la funcion para imprimir el JSON\n\n\t\t\t\t// echo json_encode($peliculas);\n\t\t\t\t$this->printJSON($peliculas);\n\n\t\t\t}else{\n\n\t\t\t\t//valida si hay datos disponibles\n\n\t\t\t\t//echo json_encode(array('mensaje' => 'No hay mensaje registrados'));\n\t\t\t\t$this->error('No hay elementos registrados');\n\t\t\t}\n\t\t}", "public function datos_carros() \n {\n $registros = DB::table('carros')\n ->where ('carros.Estado', '=', '1')\n ->select('carros.id', 'carros.Marca', 'carros.Modelo')\n ->get();\n return $registros;\n }", "public function listar() {\n $conexion = new Conexion();\n $consulta = $conexion->prepare('SELECT * FROM facultad');\n $consulta->execute();\n $ces = null;\n\n $tabla_datos = $consulta->fetchAll(PDO::FETCH_ASSOC);\n\n $astraba = array();\n\n\n foreach ($tabla_datos as $con => $valor) {\n $ces = $tabla_datos[$con][\"nombre\"];\n\n array_push($astraba, $ces);\n }\n return $astraba;\n }", "public function getEventos(){\t\n\t\t$sql=\"SELECT Evento.idEvento as idEvento,Nombre,Descripcion,FechaInicio,FechaFin,idLocal,idTipoEvento,Precio,Director,Interpretes,\n\t\tDuracion, HoraInicio, Coalesce( avg( Puntuacion ), 0 ) as media, Evento.idImagen, Imagen.NombreImg, Imagen.FechaImg\t\t\t\t\n\t\tFROM Evento LEFT JOIN Puntuacion on Puntuacion.idEvento=Evento.idEvento LEFT JOIN Imagen ON Evento.idImagen=Imagen.idImagen \n\t\tGROUP BY Evento.idEvento\";\t\t\n\t\t$db = new bdadministrador();\n\t\treturn $db->executeQuery($sql);\n\t}", "public function listarPreg(){\n $consulta = $this->ejecutar(\"SELECT * FROM cappiutep.t_usuario_pregunta WHERE id_usuario = '$this->IdUser'\");\n while($data = $this->getArreglo($consulta))$datos[] = $data;\n return $datos;\n }", "public static function getAll(){\n\t\t$consulta = \"SELECT * FROM prestamos\";\n\t\ttry {\n\t\t\t//preparar sentencia\n\t\t\t$comando = Database::getInstance()->getDb()->prepare($consulta);\n\t\t\t//ejecutar sentencia preparada\n\t\t\t$comando->execute();\n\n\t\t\treturn $comando->fetchAll(PDO::FETCH_ASSOC);\n\t\t} catch (PDOException $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function getAll2(){\n\t\t$sql = \"select * from prueba\";\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new TemparioData());\n\t}", "function ReadAll(){\n\n\t\t//Instanciamos y nos conectamos a la bd\n\t\t$Conexion = floopets_BD::Connect();\n\t\t$Conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t//Crear el query que vamos a realizar\n\t\t$consulta = \"SELECT tipo_denuncia.*,denuncia.* FROM denuncia INNER JOIN tipo_denuncia ON denuncia.td_cod_tipo_denuncia=tipo_denuncia.td_cod_tipo_denuncia WHERE denuncia.de_estado='Pendiente'\";\n\t\t$query = $Conexion->prepare($consulta);\n\t\t$query->execute();\n\t\t//Devolvemos el resultado en un arreglo\n\t\t//Fetch: es el resultado que arroja la consulta en forma de un vector o matriz segun sea el caso\n\t\t//Para consultar donde arroja mas de un dato el fatch debe ir acompañado con la palabra ALL\n\t\t$resultado = $query->fetchALL(PDO::FETCH_BOTH);\n\t\treturn $resultado;\n\t\tfloopets_BD::Disconnect();\n\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM cbt_nomor_peserta';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function tampilDataGalang(){\n\t\t\n\t}", "function getDatos(){\n $res = $this->Consulta('SELECT C.*, P.id_planta FROM '.$this->Table .' C\n INNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\n INNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\n INNER JOIN\n plantas P ON P.id_planta = S.id_planta\n \n WHERE '.$this->PrimaryKey.' = '.$this->_datos);\n $resultado = $res[0];\n // $resultado = array_map('utf8_encode',$resultado);\n \n print_r( json_encode( $resultado ) );\n }", "function SHOWALL(){\r\n\r\n $stmt = $this->db->prepare(\"SELECT * FROM edificio\");\r\n $stmt->execute();\r\n $edificios_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n $alledificios = array(); //array para almacenar los datos de todos los edificios\r\n\r\n //Recorremos todos las filas de edificios devueltas por la sentencia sql\r\n foreach ($edificios_db as $edificio){\r\n //Introducimos uno a uno los edificios recuperados de la BD\r\n array_push($alledificios,\r\n new EDIFICIO_Model(\r\n $edificio['edificio_id'],$edificio['nombre_edif'],$edificio['direccion_edif']\r\n ,$edificio['telef_edif'],$edificio['num_plantas'],$edificio['agrup_edificio']\r\n )\r\n );\r\n }\r\n return $alledificios;\r\n }", "function getAll() {\r\n\t\t$municipios = array();\r\n\t\t$conexao = Conexao::con();\r\n\r\n\t\t$sql[] = \"SELECT * FROM municipio m ORDER by m.nome\";\r\n\t\t$query = mysqli_query( $conexao, join( '', $sql ) );\r\n\r\n\t\twhile ( $row = mysqli_fetch_array( $query ) ) {\r\n\t\t\t$municipio = new stdClass();\r\n\t\t\t$municipio->idMunicipio = $row['id_municipio'];\r\n\t\t\t$municipio->idUf = $row['id_uf'];\r\n\t\t\t$municipio->nome = utf8_encode( $row['nome'] );\r\n\t\t\t$municipios[] = $municipio;\r\n\t\t}\r\n\t\treturn $municipios;\r\n\t}", "function get_all_genero()\n {\n $genero = $this->db->query(\"\n SELECT\n *\n\n FROM\n `genero`\n\n WHERE\n 1 = 1\n\n ORDER BY `genero_id` DESC\n \")->result_array();\n\n return $genero;\n }", "private function telaPerfilGerente()\r\n {\r\n //Carregando as lojas do banco de dados\r\n $repositorio = $this->getDoctrine()->getRepository('DCPBundle:Quebra');\r\n\r\n $sql = $repositorio->createQueryBuilder('l')\r\n ->select('l.id')\r\n ->groupby('l.id')\r\n ->getquery();\r\n\r\n $resultado = $sql->getResult();\r\n\r\n $loja = array();\r\n $contLoja = 0;\r\n foreach($resultado as $data)\r\n {\r\n if (!in_array($data, $loja))\r\n {\r\n $loja[$contLoja] = $data[\"id\"];\r\n $contLoja++;\r\n }\r\n }\r\n \r\n return $loja;\r\n }", "public function permisos()\n {\n\n $conectar = parent::conexion();\n\n $sql = \"select * from permisos;\";\n\n $sql = $conectar->prepare($sql);\n $sql->execute();\n return $resultado = $sql->fetchAll();\n }", "function fetchDiario() {\n\n $diarios = array();\n\n $con = new DB();\n $sql = $con->prepare(\"SELECT * FROM diario\");\n $result = $con->executeQuery($sql);\n\n foreach ($result as $row) {\n $id = $row['id'];\n $nombre = $row['nombre'];\n $descripcion = $row['descripcion'];\n $id_usuario = $row['id_usuario'];\n $diario = new Diario($id, $nombre, $descripcion, $id_usuario);\n array_push($diarios, $diario);\n }\n\n return $diarios;\n }", "public function selectAll() {\n $conn = $this->conex->connectDatabase();\n $sql = \"select * from tbl_patrocinio where apagado = 0\";\n $stm = $conn->prepare($sql);\n $success = $stm->execute();\n if ($success) {\n //Criando uma lista com os dados\n $listPatrocinio = [];\n foreach ($stm->fetchAll(PDO::FETCH_ASSOC) as $result) {\n $Patrocinio = new Patrocinio();\n $Patrocinio->setId($result['id_patrocinio']);\n $Patrocinio->setNome($result['nome']);\n $Patrocinio->setDescricao($result['descricao']);\n $Patrocinio->setImagem($result['imagem']);\n $Patrocinio->setApagado($result['apagado']);\n $Patrocinio->setStatus($result['ativo']);\n array_push($listPatrocinio, $Patrocinio);\n };\n $this->conex -> closeDataBase();\n //retornando a lista\n return $listPatrocinio;\n } else {\n return \"Erro\";\n }\n }", "function listar_fuentes_simbolos() {\n\t\t$query = \"SELECT fuentes_simbolos.*\n\t\tFROM fuentes_simbolos\n\t\tORDER BY nombre_fuente\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "public function mostrarDados(){\n\t\t$sql = \"SELECT cliente.cod_cliente, cliente.nome_cliente, categoria.cod_categoria, categoria.desc_categoria, servico.cod_servico, servico.desc_servico, servico.foto\t\n\t\t\t\tFROM cliente INNER JOIN (categoria INNER JOIN servico ON categoria.cod_categoria = servico.cod_categoria) ON cliente.cod_cliente = servico.cod_cliente\n\t\t\t\twhere cod_servico = '$this->cod_servico'\";\n\t\t$qry= self:: executarSQL($sql);\n\t\t$linha = self::listar($qry);\n\t\t\n\t\t$this-> cod_servico = $linha['cod_servico'];\n\t\t$this-> cod_categoria = $linha['cod_categoria'];\n\t\t$this-> desc_categoria = $linha['desc_categoria'];\n\t\t$this-> cod_cliente = $linha['cod_cliente'];\n\t\t$this-> nome_cliente = $linha['nome_cliente'];\n\t\t$this-> desc_servico = $linha['desc_servico'];\n\t\t$this-> foto = $linha['foto'];\n\t}", "public function cargarEstados()\r\n {\r\n \r\n $data = $this->cargar_model->cargarEstados();\r\n\r\n print_r(json_encode($data)); \r\n \r\n }", "public function selectAllEventos(){\n\n //script dos selects\n $selectAllSql = \"SELECT * FROM tbl_eventos WHERE status = 1 ORDER BY id_eventos DESC\";\n\n //Método que faz a conexão com o banco\n $conn = $this->conexao->connectDatabase();\n\n //executando o select\n $select = $conn->query($selectAllSql);\n\n //Contador iniciando em 0\n $cont = 0;\n\n //Loop que coloca todo os eventos em um rs\n while($rsEventos = $select->fetch(PDO::FETCH_ASSOC)){\n //Array de dados do tipo Evento\n $eventos[] = new Eventos();\n\n //Setando os valores do obj\n $eventos[$cont]->setIdEventos($rsEventos['id_eventos']);\n $eventos[$cont]->setTitulo($rsEventos['titulo']);\n $eventos[$cont]->setDescricao($rsEventos['descricao']);\n $eventos[$cont]->setLocalidade($rsEventos['localidade']);\n $eventos[$cont]->setDataEvento($rsEventos['dt_evento']);\n $eventos[$cont]->setStatus($rsEventos['status']);\n\n //incrementando o cont\n $cont += 1;\n\n }\n\n //Fechando a conexão com o banco de dados\n $this->conexao->closeDatabase();\n\n //retornando o array\n return $eventos;\n }", "public function inserirDados()\n\t\t{\n\t\t\t$insertIdoso = \"INSERT INTO idoso(logradouro,\n\t\t\t\t\t\t\t\t\t\ttipo_logradouro,\n\t\t\t\t\t\t\t\t\t\tnumero,\n\t\t\t\t\t\t\t\t\t\tcomplemento,\n\t\t\t\t\t\t\t\t\t\tbaiiro,\n\t\t\t\t\t\t\t\t\t\tcidade,\n\t\t\t\t\t\t\t\t\t\tuf,\n\t\t\t\t\t\t\t\t\t\tusuario_id_usuario)\n\t\t\t\t\t\t\t\tVALUES(:logradouro,\n\t\t\t\t\t\t\t\t\t\t:tipo_logradouro,\n\t\t\t\t\t\t\t\t\t\t:numero,\n\t\t\t\t\t\t\t\t\t\t:complemento,\n\t\t\t\t\t\t\t\t\t\t:baiiro,\n\t\t\t\t\t\t\t\t\t\t:cidade,\n\t\t\t\t\t\t\t\t\t\t:uf,\n\t\t\t\t\t\t\t\t\t\t:usuario_id_usuario)\";\n\n\t\t\t$stmt->pdo->prepare($insertIdoso);\n\t\t\t$stmt->bindParam(':logradouro', $this->logradouro);\n\t\t\t$stmt->bindParam(':tipo_logradouro', $this->tipo_logradouro);\n\t\t\t$stmt->bindParam(':numero', $this->numero);\n\t\t\t$stmt->bindParam(':complemento', $this->complemento);\n\t\t\t$stmt->bindParam(':bairro', $this->baiiro);\n\t\t\t$stmt->bindParam(':cidade', $this->cidade);\n\t\t\t$stmt->bindParam(':uf', $this->uf);\n\t\t\t$stmt->bindParam(':usuario_id_usuario', $this->buscarTodosDados());\n\n\t\t\tif($stmt->execute()) {\n\t\t\t\theader(\"Location: localhost:8001/contato\");\n\t\t\t} else {\n\t\t\t\tdie('Erro ao cadastrar');\n\t\t\t}\n\t\t}", "public function readAll(){\r\n $query = \"SELECT * FROM docente;\";\r\n $statement = $this->cdb->prepare($query);\r\n $statement->execute();\r\n $rows = $statement->fetchAll(\\PDO::FETCH_OBJ);\r\n return $rows; \r\n }", "public function run()\n {\n \t//---- ASIGNATURAS DE 1 GRADO----\n for ($i=2; $i <= 7 ; $i++) {\n\n DB::table('asignaturas')->insert([\n 'asignatura' => 'Lengua',\n 'codigo' => 'LENG-1G',\n 'id_curso' => $i,\n 'n_bloques' => '6',\n 'color' => '#FF4848',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Matemática',\n 'codigo' => 'MAT-1G',\n 'id_curso' => $i,\n 'n_bloques' => '6',\n 'color' => '#FF9797',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Ciencias Sociales',\n 'codigo' => 'CSCSOC-1G',\n 'id_curso' => $i,\n 'n_bloques' => '2',\n 'color' => '#FF62B0',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación Física',\n 'codigo' => 'EDUFIS-1G',\n 'id_curso' => $i,\n 'n_bloques' => '2',\n 'color' => '#E469FE',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Inglés',\n 'codigo' => 'ING-1G',\n 'id_curso' => $i,\n 'n_bloques' => '2',\n 'color' => '#9669FE',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Estética',\n 'codigo' => 'EST-1G',\n 'id_curso' => $i,\n 'n_bloques' => '2',\n 'color' => '#FFBBFF',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación Vial',\n 'codigo' => 'EDUCVIAL-1G',\n 'id_curso' => $i,\n 'n_bloques' => '2',\n 'color' => '#9A03FE',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Ciencias Naturales y Tecnologías',\n 'codigo' => 'CSCNATEC-1G',\n 'id_curso' => $i,\n 'n_bloques' => '2',\n 'color' => '#B5FFFC',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Formación Permanente',\n 'codigo' => 'FORMP-1G',\n 'id_curso' => $i,\n 'n_bloques' => '2',\n 'color' => '#23819C',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación y Valores',\n 'codigo' => 'EDUCVAL-1G',\n 'id_curso' => $i,\n 'n_bloques' => '2',\n 'color' => '#5757FF',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Lectura y Ortgrafía',\n 'codigo' => 'LECTORG-1G',\n 'id_curso' => $i,\n 'n_bloques' => '3',\n 'color' => '#01F33E',\n 'status' => 1\n ]);\n }\n \n //------ ASIGNATURAS DE 1ER AÑO----------\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Castellano',\n 'codigo' => 'CAST-1A',\n 'id_curso' => '8',\n 'n_bloques' => '4',\n 'color' => '#1FCB4A',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Matemática',\n 'codigo' => 'MAT-1A',\n 'id_curso' => '8',\n 'n_bloques' => '4',\n 'color' => '#89FC63',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Inglés',\n 'codigo' => 'ING-1A',\n 'id_curso' => '8',\n 'n_bloques' => '4',\n 'color' => '#DFE32D',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Biología',\n 'codigo' => 'BIO-1A',\n 'id_curso' => '8',\n 'n_bloques' => '6',\n 'color' => '#E0E04E',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Geografía',\n 'codigo' => 'GEO-1A',\n 'id_curso' => '8',\n 'n_bloques' => '3',\n 'color' => '#DFA800',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Historia de Venezuela',\n 'codigo' => 'HVZLA-1A',\n 'id_curso' => '8',\n 'n_bloques' => '3',\n 'color' => '#FFB428',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Artística',\n 'codigo' => 'ART-1A',\n 'id_curso' => '8',\n 'n_bloques' => '2',\n 'color' => '#FF800D',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación Familiar',\n 'codigo' => 'EDUCFAM-1A',\n 'id_curso' => '8',\n 'n_bloques' => '2',\n 'color' => '#FFBD82',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación para el Trabajo',\n 'codigo' => 'EDUCTRAB-1A',\n 'id_curso' => '8',\n 'n_bloques' => '12',\n 'color' => '#D1D17A',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Arte y Patrimonio',\n 'codigo' => 'ARTPAT-1A',\n 'id_curso' => '8',\n 'n_bloques' => '2',\n 'color' => '#C27E3A',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación Física',\n 'codigo' => 'EDUFIS-1A',\n 'id_curso' => '8',\n 'n_bloques' => '4',\n 'color' => '#25A0C5',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Memoria, Ciudadanía y Territorio',\n 'codigo' => 'MCT-1A',\n 'id_curso' => '8',\n 'n_bloques' => '4',\n 'color' => '#FF5353',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Grupo Estable',\n 'codigo' => 'GRUPEST-1A',\n 'id_curso' => '8',\n 'n_bloques' => '4',\n 'color' => '#B9264F',\n 'status' => 1\n ]);\n //-------- ASIGNATURAS DEL 2DO AÑO---------\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Castellano',\n 'codigo' => 'CAST-2A',\n 'id_curso' => '9',\n 'n_bloques' => '4',\n 'color' => '#1FCB4A',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Matemática',\n 'codigo' => 'MAT-2A',\n 'id_curso' => '9',\n 'n_bloques' => '4',\n 'color' => '#89FC63',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Inglés',\n 'codigo' => 'ING-2A',\n 'id_curso' => '9',\n 'n_bloques' => '3',\n 'color' => '#DFE32D',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Biología',\n 'codigo' => 'BIO-2A',\n 'id_curso' => '9',\n 'n_bloques' => '6',\n 'color' => '#E0E04E',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación para la Salud',\n 'codigo' => 'EDUCS-2A',\n 'id_curso' => '9',\n 'n_bloques' => '2',\n 'color' => '#990099',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Historia de Venezuela',\n 'codigo' => 'HVZLA-2A',\n 'id_curso' => '9',\n 'n_bloques' => '2',\n 'color' => '#FFB428',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Historia Universal',\n 'codigo' => 'HUNIV-2A',\n 'id_curso' => '9',\n 'n_bloques' => '4',\n 'color' => '#74138C',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Artística',\n 'codigo' => 'ART-2A',\n 'id_curso' => '9',\n 'n_bloques' => '3',\n 'color' => '#FF800D',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación para el Trabajo',\n 'codigo' => 'EDUCTRAB-2A',\n 'id_curso' => '9',\n 'n_bloques' => '16',\n 'color' => '#D1D17A',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Arte y Patrimonio',\n 'codigo' => 'ARTPAT-2A',\n 'id_curso' => '9',\n 'n_bloques' => '2',\n 'color' => '#C27E3A',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación Física',\n 'codigo' => 'EDUFIS-2A',\n 'id_curso' => '9',\n 'n_bloques' => '4',\n 'color' => '#25A0C5',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Grupo Estable',\n 'codigo' => 'GRUPEST-2A',\n 'id_curso' => '9',\n 'n_bloques' => '3',\n 'color' => '#B9264F',\n 'status' => 1\n ]);\n //-------- ASIGNATURAS DEL 3ER AÑO---------\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Castellano',\n 'codigo' => 'CAST-3A',\n 'id_curso' => '10',\n 'n_bloques' => '4',\n 'color' => '#1FCB4A',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Matemática',\n 'codigo' => 'MAT-3A',\n 'id_curso' => '10',\n 'n_bloques' => '5',\n 'color' => '#89FC63',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Inglés',\n 'codigo' => 'ING-3A',\n 'id_curso' => '10',\n 'n_bloques' => '3',\n 'color' => '#DFE32D',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Biología',\n 'codigo' => 'BIO-3A',\n 'id_curso' => '10',\n 'n_bloques' => '6',\n 'color' => '#E0E04E',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Física',\n 'codigo' => 'FIS-3A',\n 'id_curso' => '10',\n 'n_bloques' => '6',\n 'color' => '#1F88A7',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Química',\n 'codigo' => 'QUIM-3A',\n 'id_curso' => '10',\n 'n_bloques' => '6',\n 'color' => '#74BAAC',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Historia de Venezuela',\n 'codigo' => 'HVZLA-3A',\n 'id_curso' => '10',\n 'n_bloques' => '2',\n 'color' => '#FFB428',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Geografía',\n 'codigo' => 'GEO-3A',\n 'id_curso' => '10',\n 'n_bloques' => '3',\n 'color' => '#DFA800',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación para el Trabajo',\n 'codigo' => 'EDUCTRAB-3A',\n 'id_curso' => '10',\n 'n_bloques' => '16',\n 'color' => '#D1D17A',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación Física',\n 'codigo' => 'EDUFIS-3A',\n 'id_curso' => '10',\n 'n_bloques' => '4',\n 'color' => '#25A0C5',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Grupo Estable',\n 'codigo' => 'GRUPEST-3A',\n 'id_curso' => '10',\n 'n_bloques' => '3',\n 'color' => '#B9264F',\n 'status' => 1\n ]);\n //-------- ASIGNATURAS DEL 4TO AÑO---------\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Castellano',\n 'codigo' => 'CAST-4A',\n 'id_curso' => '11',\n 'n_bloques' => '4',\n 'color' => '#1FCB4A',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Matemática',\n 'codigo' => 'MAT-4A',\n 'id_curso' => '11',\n 'n_bloques' => '4',\n 'color' => '#89FC63',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Inglés',\n 'codigo' => 'ING-4A',\n 'id_curso' => '11',\n 'n_bloques' => '3',\n 'color' => '#DFE32D',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Biología',\n 'codigo' => 'BIO-4A',\n 'id_curso' => '11',\n 'n_bloques' => '6',\n 'color' => '#E0E04E',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Física',\n 'codigo' => 'FIS-4A',\n 'id_curso' => '11',\n 'n_bloques' => '6',\n 'color' => '#1F88A7',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Química',\n 'codigo' => 'QUIM-4A',\n 'id_curso' => '11',\n 'n_bloques' => '6',\n 'color' => '#74BAAC',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Historia de Venezuela',\n 'codigo' => 'HVZLA-4A',\n 'id_curso' => '11',\n 'n_bloques' => '4',\n 'color' => '#FFB428',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Filosofía',\n 'codigo' => 'FIL-4A',\n 'id_curso' => '11',\n 'n_bloques' => '3',\n 'color' => '#BBBBFF',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Instrucción Premilitar',\n 'codigo' => 'IPM-4A',\n 'id_curso' => '11',\n 'n_bloques' => '2',\n 'color' => '#36F200',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación Física',\n 'codigo' => 'EDUFIS-4A',\n 'id_curso' => '11',\n 'n_bloques' => '2',\n 'color' => '#25A0C5',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Grupo Estable',\n 'codigo' => 'GRUPEST-4A',\n 'id_curso' => '11',\n 'n_bloques' => '4',\n 'color' => '#B9264F',\n 'status' => 1\n ]);\n //-------- ASIGNATURAS DEL 5TO AÑO---------\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Castellano',\n 'codigo' => 'CAST-5A',\n 'id_curso' => '12',\n 'n_bloques' => '3',\n 'color' => '#1FCB4A',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Matemática',\n 'codigo' => 'MAT-5A',\n 'id_curso' => '12',\n 'n_bloques' => '5',\n 'color' => '#89FC63',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Inglés',\n 'codigo' => 'ING-5A',\n 'id_curso' => '12',\n 'n_bloques' => '3',\n 'color' => '#DFE32D',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Biología',\n 'codigo' => 'BIO-5A',\n 'id_curso' => '12',\n 'n_bloques' => '6',\n 'color' => '#E0E04E',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Física',\n 'codigo' => 'FIS-5A',\n 'id_curso' => '12',\n 'n_bloques' => '6',\n 'color' => '#1F88A7',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Química',\n 'codigo' => 'QUIM-5A',\n 'id_curso' => '12',\n 'n_bloques' => '6',\n 'color' => '#74BAAC',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Geografía',\n 'codigo' => 'GEO-5A',\n 'id_curso' => '12',\n 'n_bloques' => '6',\n 'color' => '#DFA800',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Instrucción Premilitar',\n 'codigo' => 'IPM-5A',\n 'id_curso' => '12',\n 'n_bloques' => '2',\n 'color' => '#36F200',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Educación Física',\n 'codigo' => 'EDUFIS-5A',\n 'id_curso' => '12',\n 'n_bloques' => '2',\n 'color' => '#25A0C5',\n 'status' => 1\n ]);\n DB::table('asignaturas')->insert([\n\n 'asignatura' => 'Grupo Estable',\n 'codigo' => 'GRUPEST-5A',\n 'id_curso' => '12',\n 'n_bloques' => '3',\n 'color' => '#B9264F',\n 'status' => 1\n ]);\n\n $asignaturas=Asignaturas::all();\n $periodos=periodos::all();\n }", "public function obtenerViajesplus();", "public function get_datos_basededatos($idbd){\n $listar = $this->pdo->prepare(\"SELECT * FROM pa_base_datos WHERE id = \".$idbd);\n $listar->execute();\n return $listar;\n \t}", "public function recuperar(): array {\r\n \r\n $autorDao = new AutorDao();\r\n \r\n $livros = [];\r\n $query = \"SELECT livro.*, editora.nome \"\r\n . \"FROM livro \"\r\n . \"INNER JOIN editora ON \"\r\n . \"editora.id = livro.editora_id\";\r\n \r\n $statement = $this->pdo->prepare($query);\r\n $statement->execute();\r\n while($registro = $statement->fetch(\\PDO::FETCH_LAZY)){\r\n $livro = $this->hydrate((array) $registro);\r\n $livro->autores = $autorDao->recuperarPorLivro($livro->id);\r\n $livros[] = $livro;\r\n }\r\n return $livros;\r\n }", "public function listarSocios() {\r\n $sql = \"select j.nombre,j.apellido,j.cedula,j.fechanac, j.porcentaje, m.nombre from juntadirectiva as j, municipio as m \"\r\n\t\t .\" where j.ciudadnac = m.id\";\t\t\r\n $respuesta = $this->object->ejecutar($sql);\r\n $this->construirListadoSocio($respuesta);\r\n }", "function listaTareas($base) {\n\t//prepara la sentencia para su ejecucion\n\t$sentencia = $base->prepare('Select * from tareas');\n\t// ejecuta la sentencia preparada\n\t$sentencia-> execute();\n\t//guarda los datos recuperados\n\t$tareas = $sentencia->fetchAll(PDO::FETCH_OBJ);\n\treturn $tareas;\n\t\t\n}", "function compilar_metadatos_generales()\n\t{\n\t\t$this->manejador_interface->titulo(\"Compilando datos generales\");\n\t\ttoba_proyecto_db::set_db( $this->db );\n\t\t$path = $this->get_dir_generales_compilados();\n\t\ttoba_manejador_archivos::crear_arbol_directorios( $path );\n\t\t$this->compilar_metadatos_generales_basicos();\n\t\t$this->compilar_metadatos_generales_grupos_acceso();\n\t\t$this->compilar_metadatos_generales_puntos_control();\n\t\t$this->compilar_metadatos_generales_mensajes();\n\t\t$this->compilar_metadatos_generales_dimensiones();\n\t\t$this->compilar_metadatos_generales_consultas_php();\n\t\t$this->compilar_metadatos_generales_servicios_web();\n\t\t$this->compilar_metadatos_generales_pms();\n\n\t}", "function cargar_datos($tabla)\n {\n //2015-12-04 solucionar problema memory limit y tiempo de ejecución\n ini_set('memory_limit', '2048M'); \n set_time_limit(120); //120 segundos, dos minutos por ciclo\n \n $json_descarga = $this->input->post('json_descarga');\n $descarga = json_decode($json_descarga);\n $respuesta = $this->Develop_model->cargar_registros($tabla, $descarga);\n \n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode($respuesta));\n }", "public function listar() {\r\n $this->conexao->conect(\"host=localhost dbname=postgres user=postgres password=123\");\r\n $aLivro= Array();\r\n $sSql = \"SELECT livcodigo,livnome,tbgenero.gencodigo,tblocalizacao.loccodigo FROM atividade.tblivro \"\r\n . \"INNER JOIN atividade.tbgenero ON tblivro.gencodigo = tbgenero.gencodigo \"\r\n . \"INNER JOIN atividade.tblocalizacao ON tblocalizacao.loccodigo = tblivro.loccodigo \";\r\n $oRes = $this->conexao->query($sSql);\r\n while($oLivroBanco = pg_fetch_assoc($oRes)){\r\n $oLivro = new Livro();\r\n $oGenero = new Genero();\r\n $oLocalizacao = new Localizacao();\r\n $oLivro->setLivcodigo($oLivroBanco['livcodigo']);\r\n $oLivro->setLivnome($oLivroBanco['livnome']);\r\n $oGenero->setGencodigo($oLivroBanco['gencodigo']);\r\n $oLocalizacao->setLoccodigo($oLivroBanco['loccodigo']);\r\n $oLivro->setGenero($oGenero);\r\n $oLivro->setLocalizacao($oLocalizacao);\r\n $aLivro[] = $oLivro;\r\n }\r\n $this->conexao->close();\r\n return $aLivro;\r\n }", "function listar_diccionario() {\n\t\t\t\n\t\t$query = \"SELECT palabras.*\n\t\tFROM palabras\n\t\tORDER BY palabras.id_palabra asc\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function listaTodosAniversariantesdeHojeDao(){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n \r\n $dataAtual = Date(\"Y-m-d\");\r\n $mes = $dataAtual[5].$dataAtual[6];\r\n $dia = $dataAtual[8].$dataAtual[9];\r\n //echo \"Mes \". $mes. \"Dia \".$dia;\r\n \r\n// $dbconn = mysqli_connect ($objDao->getServer(),$objDao->getUsername(),$objDao->getPassword(),$objDao->getDb());\r\n \r\n// $resultado = mysqli_query ($dbconn,\"CALL aniversariantedehoje($mes,$dia)\");\r\n $consulta=\"SELECT Matricula,Nome,DataNascimento1,Fone FROM membros WHERE MONTH(DataNascimento1) = $mes AND DAY(DataNascimento1)=$dia\";\r\n \r\n $resultado = mysql_query($consulta) or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n \r\n $listaMembro = array();\r\n \r\n $i=0;\r\n \r\n while ($registro = mysql_fetch_array($resultado, MYSQL_ASSOC)){\r\n \r\n\t $membro = new objetoMembro();\r\n \r\n $membro->setMatricula($registro['Matricula']);\r\n $membro->setNome($registro['Nome']);\r\n $membro->setData($registro['DataNascimento1']); \r\n $membro->setFone($registro['Fone']); \r\n \r\n\t $listaMembro[$i] = $membro;\r\n \r\n\t $i++;\r\n\t}\r\n \r\n \r\n\t\treturn $listaMembro;\r\n\t\tmysql_free_result($resultado);\r\n $objDao->freebanco();\r\n \r\n \r\n }", "public function getAll() {\n $sql = \"SELECT * FROM contatos\";\n $sql = $this->pdo->query($sql);\n\n if($sql->rowCount() > 0 ) {\n return $sql->fetchAll();\n } else {\n return array();\n }\n }", "public function get_all_godzina_better(){\n\t\t$data=array();\n\t\t$query = $this->db->query('select * from godzina');\t\n\t\tforeach($query->result() as $row){\n\t\t\t\tarray_push($data,array(\n\t\t\t\t'id_godzina'=>$row->id_godzina,\n\t\t\t\t'godzina'=>substr($row->godzina,0,5)\n\t\t\t\t));\n\t\t\t\n\t\t}\n\t\treturn $data;\n\t}", "public function getAll()\n {\n //SELECT * FROM festival;\n \n //foeach TUDOQUEVIER e COLOCAR NUM ARRAY\n \n //return ARRAY;\n }", "function selectAllPessoa(){\r\n $banco = conectarBanco();\r\n $sql = \"SELECT * FROM pessoa ORDER BY nome\";\r\n $resultado = $banco->query($sql); // Passa a query fornecida em $sql para o banco de dados e armazena o retorno em $resultado\r\n $banco->close();\r\n while ($row = mysqli_fetch_array($resultado)) { // Formata o retorno do banco de dados e separa as informações por cada pessoa (row)\r\n $grupo[] = $row;\r\n }\r\n return $grupo; // grupo eh um array, onde cada indice contem as informacoes de uma pessoa\r\n}", "function findAll() \n {\n $usuarios = array();\n $n=0;\n $sql=\"select u.id,u.nombre,u.paterno,u.materno,u.username,u.fechaAlta,\".\n \" u.estatus,u.idTipoUsuario,tu.descripcion from Usuarios u\".\n \" inner join TipoUsuarios tu on tu.id=u.idTipoUsuario\".\n \" order by u.id\";\n \n $usuariosRs = mysqli_query($this->_connDb, $sql); \n while ($row = mysqli_fetch_array($usuariosRs)) {\n $oUsuario = new Usuario(0);\n $oUsuario->setId($row['id']);\n $oUsuario->setNombre($row['nombre']);\n $oUsuario->setPaterno($row['paterno']);\n $oUsuario->setMaterno($row['materno']);\n $oUsuario->setUsername($row['username']);\n $oUsuario->setFechaAlta($row['fechaAlta']);\n $oUsuario->setEstatus($row['estatus']);\n\n // Creamos el objeto de tipo TipoUsuario\n $oTipoUsuario = new TipoUsuario($row['idTipoUsuario']);\n $oTipoUsuario->setDescripcion($row['descripcion']);\n\n // Inyectamos la dependencia de TipoUsuario\n $oUsuario->setTipoUsuario($oTipoUsuario);\n $usuarios[$n]=$oUsuario;\n $n++; \n }\n return $usuarios;\n }", "public final function findAll(){\n\n //Récupère la méthode de connection à la Base de donnée\n $dbc = Application::getInstance()->getDBConnection();\n\n //Variable où la requête est enregistrée\n $query = \"select * from Album\";\n\n //Requête en dur, prends la bdd et y exécute la requête\n $stmt = $dbc->query($query);\n\n /*Récupère tout les tuples de Album, et les transpose dans des instances de classe Album\n Et fini par enregistrer le résultat dans $results, FALSE est retourné s'ya erreur */\n $results = $stmt->fetchALL(PDO::FETCH_CLASS, 'Album');\n\n //Retourne le résultat de $results\n return $results;\n }", "function listaRuta()\r\n\t{\t\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::listaRegistros( $query );\r\n\t}", "public static function getListado(){\n return Dispositivo::model()->findAll();\n }", "function getComentarios(){\n $this->bd->setConsulta(\"select * from comentario\");\n $comentario = array();\n $i=0;\n while ($fila = $this->bd->getFila()){\n $comentario[$i] = new Comentario($fila[\"id\"], $fila[\"descripcion\"],$fila[\"fechacreacion\"],$fila[\"idEntrada\"],$fila[\"idUsuario\"]);\n $i++;\n }\n return $comentario;\n }", "public function getAll(){\r\n $sql=\"SELECT * FROM salas\";\r\n try{\r\n //creo la instancia de conexion\r\n $this->connection= Connection::getInstance();\r\n $result = $this->connection->execute($sql);\r\n }catch(\\PDOException $ex){\r\n throw $ex;\r\n } \r\n //hay que mapear de un arreglo asociativo a objetos\r\n if(!empty($result)){\r\n return $this->mapeo($result);\r\n }else{\r\n return false;\r\n }\r\n\r\n }", "public static function traerTodas()\n {\n $query = \"SELECT * FROM nivel\";\n $stmt = DBConnection::getStatement($query);\n $stmt->execute();\n\n $salida = [];\n\n while($datosNiv = $stmt->fetch()) {\n $niv = new Nivel();\n $niv->cargarDatos($datosNiv);\n\n $salida[] = $niv;\n }\n\n return $salida;\n }", "public function findAll(){\n //recupere le nom de la classe et le formate\n $table = strtolower(get_class($this));\n\n //Prepare la requete\n $query = \"SELECT * FROM $table\";\n $results = $this->conn->prepare($query);\n\n //Execution requete et stockage resultats dans une variable\n $results->execute();\n $resultats = $results->fetchAll(PDO::FETCH_ASSOC);\n return $resultats;\n }", "private function listado_obras(){\n \treturn Sesion::where(\"inicio\",\">\",Carbon::now())->distinct()->get(['nombre_obra']);\n }", "public function index()\n {\n //\n return Grupos::all();\n }", "public function readAll(){\r\n\r\n // QUERY SQL PARA FAZER CONSULTA NO BANCO\r\n\t\t$sql = 'SELECT * FROM usuarios';\r\n\r\n\t\t// PREPARANDO CONEXÃO COM O BANCO\r\n\t\t$stmt = Conexao::getConn()->prepare($sql);\r\n\r\n\t\t// EXECUTANDO QUERY\r\n\t\t$stmt->execute();\r\n \r\n // VERIFICA SE TEM REGISTRO NA TABELA\r\n\t\tif ($stmt->rowCount() > 0){\r\n\r\n // ARMAZENA OS RESULTADOS \r\n\t\t\t$resultado = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\r\n \r\n // RETORNA OS RESULTADOS EM JSON\r\n\t\t\treturn json_encode($resultado);\r\n\r\n }else{\r\n\r\n // CASO NÃO TENHA REGISTRO RETORNARA ARRAY VAZIO\r\n\t\t\treturn [];\r\n\r\n }\r\n\r\n }", "public static function loadAll(){\n $con = FConnectionDB::getIstanza();\n $righe = $con->loadAll( static::$nomeTabella);\n $valutazioni = array();\n $utenti = array();\n\n if($righe == NULL)\n {\n $valutazioni = NULL;\n }\n else\n {\n $numeroRighe = count($righe);\n for($i = 0; $i < $numeroRighe; $i++)\n {\n // $utenti = FPersistentManager::load(\"username\", $righe[$i][\"autore\"], FUtente::getNomeClasse());\n $valutazioni[$i] = new EValutazione($righe[$i][\"voto\"], $righe[$i][\"autore\"], $righe[$i][\"id_episodio\"]);\n }\n }\n\n return $valutazioni;\n }" ]
[ "0.7291827", "0.6910988", "0.68657726", "0.66332185", "0.6626993", "0.6608438", "0.6588318", "0.6542464", "0.6508171", "0.64502555", "0.6433232", "0.6400375", "0.6379873", "0.6372455", "0.6367907", "0.6308143", "0.62999666", "0.62915343", "0.6291458", "0.6274482", "0.62678444", "0.6262406", "0.62433463", "0.620853", "0.6194571", "0.6192372", "0.61889565", "0.6181247", "0.61793715", "0.6176194", "0.6165376", "0.6161752", "0.61566085", "0.6138033", "0.6135517", "0.61239886", "0.611668", "0.6102118", "0.60971355", "0.60954976", "0.60941136", "0.6086337", "0.60801667", "0.6079501", "0.6076517", "0.6074614", "0.607304", "0.6067324", "0.6057842", "0.60540605", "0.60462177", "0.6041979", "0.60419637", "0.604115", "0.60291946", "0.6028322", "0.6025092", "0.6024918", "0.6005925", "0.6005675", "0.60038996", "0.60014886", "0.6000909", "0.6000016", "0.59918535", "0.59900117", "0.59893537", "0.59845936", "0.5977093", "0.59745204", "0.59712595", "0.5970026", "0.596674", "0.59660804", "0.59652567", "0.59607816", "0.595447", "0.5953238", "0.5953092", "0.59463906", "0.59446144", "0.59439963", "0.59410316", "0.5940028", "0.5939613", "0.5937949", "0.59318924", "0.59295833", "0.5922318", "0.59202", "0.59189063", "0.5914261", "0.59074277", "0.5906028", "0.5905594", "0.5905492", "0.5902623", "0.5898377", "0.5895737", "0.5894638", "0.5894436" ]
0.0
-1
This better still be working
function get_data($url){ $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0"); $data = curl_exec($ch); curl_close($ch); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function _i() {\n }", "abstract public function getPasiekimai();", "public function AggiornaPrezzi(){\n\t}", "function fix() ;", "protected function test9() {\n\n }", "private function j() {\n }", "protected function _refine() {\n\n\t}", "protected function fixSelf() {}", "protected function fixSelf() {}", "public function serch()\n {\n }", "private function __() {\n }", "final function velcom(){\n }", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "public function inOriginal();", "public function pasaje_abonado();", "final private function __construct(){\r\r\n\t}", "public function boleta()\n\t{\n\t\t//\n\t}", "public function nadar()\n {\n }", "function process() ;", "public function temporality();", "abstract protected function _preProcess();", "public function hapus_toko(){\n\t}", "protected function preProcess() {}", "private function __construct()\t{}", "function is_usefull($text) //good\r\n { \r\n $text=trim($text);\r\n $value = preg_replace('#\\s\\s#' , \" \" , $text);\r\n $value = preg_replace('#\\s+,#' , \", \" , $text);\r\n $value = preg_replace('#,\\s+#' , \",\" , $text);\r\n $value = preg_replace('#\\s+\\'#' , \"'\" , $text);\r\n $value = preg_replace('#\\'\\s+#' , \"'\" , $text);\r\n $value = preg_replace('#\\s+\\.#' , \".\" , $text);\r\n $value = preg_replace('#\\.\\s+#' , \" \" , $text);\r\n $value = preg_replace('#\\.[a-z]{1}#' , \".strtouppe[a-z]{1}\" , $text);\r\n $value = preg_replace('#\\s\\)#' , \")\" , $text);\r\n $value = preg_replace('#\\)\\s#' , \")\" , $text);\r\n $value = preg_replace('#\\(\\s#' , \"(\" , $text);\r\n $value = preg_replace('#\\s\\(#' , \"(\" , $text);\r\n $value = preg_replace('#;\\s+#' , \"; \" , $text);\r\n $value = preg_replace('#s+\\;#' , \"; \" , $text);\r\n $value = preg_replace('#s+\\:#' , \" :\" , $text);\r\n return $text;\r\n is_usefull(\"$text\");\r\n }", "abstract protected function external();", "public function ogs()\r\n {\r\n }", "function initialBasicFixes()\r\n{\r\n /**\r\n * bypass date & timezone-related warnings with php 5.1\r\n */\r\n if (function_exists('date_default_timezone_set')) {\r\n $tz= @date_default_timezone_get();\r\n date_default_timezone_set($tz);\r\n }\r\n\r\n ini_set('zend.ze1_compatibility_mode', 0);\r\n ini_set(\"pcre.backtrack_limit\", -1); # fix 5.2.0 prce bug with render_wiki\r\n if(function_exists('mb_internal_encoding')) {\r\n mb_internal_encoding(\"UTF-8\");\r\n }\r\n #ini_set(\"mbstring.func_overload\", 2);\r\n\r\n /**\r\n * add rough php-version check to at least avoid parsing errors.\r\n * fine version-check follows further down\r\n */\r\n if(phpversion() < \"5.0.0\") {\r\n echo \"Sorry, but Streber requires php5 or higher.\";\r\n exit();\r\n }\r\n}", "function extract()\n {\n }", "function getContent() ;", "public function masodik()\n {\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function getAlternate() {}", "public static function main(){\n\t\t\t\n\t\t}", "public function testPreprocessingGetPageAngle()\n {\n }", "function getSource() ;", "public function custom()\n\t{\n\t}", "public function init() {\t\t\n\n }", "protected function init() {return;}", "private function __construct () {}", "public function ex4()\n {\n }", "abstract protected function _process();", "abstract protected function _process();", "protected function init()\n\t{\n\t\t\n\t}", "abstract protected function _prepare();", "public function obtenerViajesplus();", "private function __construct() { \n\t\t\n\n\t}", "private function init()\n\t{\n\t\treturn;\n\t}", "function factures_autoriser(){}", "function _prepare() {}", "public function liberar() {}", "function generate() ;", "public function fix() {}", "public function fix() {}", "protected function __init__() { }", "private function __construct() {\r\n\t\r\n\t}", "function __construct() ;", "public function needsReprocessing() {}", "public function obtener()\n {\n }", "function verReg() {\n \n }", "function getFinal()\n {\n }", "protected function _init()\r\n\t{\r\n\t}", "protected function _exec()\n {\n }", "public function __construct() {\n \t\t \t\n\t\t}", "function render() ;", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.5650212", "0.53874457", "0.5091937", "0.5064089", "0.49902973", "0.49843875", "0.4979388", "0.49641687", "0.49400294", "0.49400294", "0.49171808", "0.48828214", "0.48821422", "0.4843878", "0.4843878", "0.4843878", "0.4843878", "0.4825432", "0.4819157", "0.48028487", "0.47961316", "0.47948804", "0.47688472", "0.47583103", "0.47489586", "0.47454926", "0.47416165", "0.47346073", "0.47309557", "0.47222534", "0.47035524", "0.47018084", "0.4700553", "0.46987256", "0.46983454", "0.46874222", "0.4673867", "0.4671412", "0.4667739", "0.46665877", "0.46584332", "0.46564132", "0.46507522", "0.46462938", "0.4637059", "0.4634615", "0.4634615", "0.46327546", "0.462723", "0.46234357", "0.46157742", "0.46080488", "0.46034682", "0.46014926", "0.45996448", "0.4598219", "0.45878318", "0.45877388", "0.4584718", "0.4583218", "0.45804584", "0.4580075", "0.4575445", "0.45671925", "0.4565594", "0.4564789", "0.45629558", "0.45624855", "0.45584264", "0.45564535", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894", "0.4554894" ]
0.0
-1
Wrapper for PDO fetchAll(PDO::FETCH_ASSOC)
public static function fetchAllAssoc( PDOStatement $stmt, $style = 'assoc' ) { switch ($style) { case 'groupassoc': $rows = $stmt->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC); return self::convertTypesAll($stmt, array_map('reset', $rows)); break; case 'assoc': default: return self::convertTypesAll($stmt, $stmt->fetchAll(PDO::FETCH_ASSOC)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetchAll()\n {\n $this->execute();\n return $this->dbStmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function fetchAll() {\n $this->execute();\n return $this->stmt->fetchAll(PDO::FETCH_OBJ);\n }", "function pdo_fetch_all(PDOStatement $pdo_statement, $fetch_style = PDO::FETCH_ASSOC)\n {\n return $pdo_statement->fetchAll($fetch_style);\n }", "public function fetchAll ($fetch_all_method = PDO::FETCH_ASSOC) {\n return $this->query->fetchAll($fetch_all_method); \n }", "public function fetchAll($fetchMode = \\PDO::FETCH_BOTH);", "protected function hydrateAllData()\n {\n return $this->_stmt->fetchAll(PDO::FETCH_KEY_PAIR);\n }", "public function fetchAll($sql, $bind){\n $sth = $this->db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n /* example:\n $bind = array(':calories' => 150, ':colour' => 'red');\n */\n $sth->execute($bind);\n return $sth->fetchAll(PDO::FETCH_ASSOC);\n }", "public function fetchAll()\r\n {\r\n $this->query();\r\n return $this->sth->fetchAll();\r\n }", "public function fetchAll($all = 1)\n {\n if (!empty($this->prepare)) {\n if (1 == $all) {\n return $this->prepare->fetchAll();\n } elseif (2 == $all) {\n return $this->prepare->fetchAll(PDO::FETCH_ASSOC);\n }\n }\n return array();\n }", "function fetchAll()\n {\n //select all data\n $query = \"SELECT\n id, tag\n FROM\n \" . $this->table_name . \"\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n\n\n return $result;\n }", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "abstract public function fetchAll($fetchType = \\PDO::FETCH_ASSOC);", "public function fetchAll(): array\n {\n if (!$this->wasExecuted()) {\n $this->exec();\n }\n\n return $this->getAdapter()->getStatement()->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function getAll() {\n $prepareStatement = $this->pdo->prepare($this->sql);\n $prepareStatement->execute($this->param);\n\n # close connection\n Connection::disconnect();\n\n return $prepareStatement->fetchAll($this->fetch);\n }", "public function fetchAll() {\r\n\t\t$result = array();\r\n\r\n\t\twhile ($data = $this->fetch()) {\r\n\t\t\t$result[] = $data;\r\n\t\t}\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $result;\r\n\t}", "public function fetchAll($fetch_style = \\PDO::FETCH_ASSOC)\n\t{\n\t\treturn $this->getStatement()\n\t\t\t\t\t->fetchAll($fetch_style);\n\t}", "public abstract function fetchAll();", "public function fetchAll($sql, $bind = [], $mode = PDO::FETCH_ASSOC, $useMaster = false);", "public function fetchAll(){\n\t\treturn $this->instance->fetchAll();\n\t}", "public function fetchAll($sql, $params=array()) {\n if ($this->execute($sql, $params)) {\n $this->statement->setFetchMode(PDO::FETCH_ASSOC);\n $result = $this->statement->fetchAll();\n return $result;\n }\n return array();\n }", "function dbGetAll(){\r\n global $db_query;\r\n return $db_query->fetchAll(PDO::FETCH_ASSOC); \r\n}", "public function fetchAll() {\r\n\t\treturn $this->getMapper()->fetchAll();\r\n\t\t\r\n\t}", "public function fetchAll(){\n try{\n $this->array = $this->resultado->fetchAll();\n } catch (PDOException $e){\n $this->errors[] = 'error: function fetchAll<br/>'.$e->getMessage();\n $this->array = NULL;\n }\n return $this->array;\n }", "public function fetchAll($sql, $bind = null)\r\n {\r\n return $this->selectPrepare($sql, $bind)->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function all()\n {\n try {\n if($this->visible) {\n $visibleStatement = implode(\",\", $this->visible);\n $this->sqlStatement = str_replace(\"*\", $visibleStatement, $this->sqlStatement);\n }\n $statement = $this->db->prepare($this->sqlStatement);\n\n $statement->execute();\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n\n $results = $statement->fetchAll();\n\n return $results;\n\n } catch(PDOException $e) {\n return $e;\n }\n }", "public function fetch_all($assoc=MYSQLI_ASSOC){\n\t\t$output=array();\n\t\twhile($row=$this->fetch($assoc)){\n\t\t\t$output[]=$row;\n\t\t}\n\t\t\n\t\t@$this->qresult->data_seek(0);\n\t\t@$this->qresult->field_seek(0);\n\t\t\n\t\treturn $output;\n\t}", "public function queryFetchAllAssoc($statement) {\n return $this->connection->query($statement)->fetchAll(PDO::FETCH_ASSOC);\n }", "public function fetchAll($fetchMode = \\PDO::FETCH_ASSOC)\n {\n return $this->statement->fetchAll($fetchMode);\n }", "public function queryFetchAllAssoc($statement) {\n return self::$PDOInstance->query($statement)->fetchAll(PDO::FETCH_ASSOC);\n }", "public function fetchAll()\n {\n $result = $this->select();\n return $result;\n }", "protected function dbFetchAll() {\r\n\r\n //@@TODO RESOURCE CHECK IS_A ?\r\n\r\n $return_array = array();\r\n\r\n while ($row = $this->query_result->fetch_array(MYSQLI_ASSOC)) {\r\n $return_array[] = $this->dbOutArray($row);\r\n }\r\n return $return_array;\r\n }", "public function getAll($query, $column = array(), $fetchMode = PDO::FETCH_ASSOC){\n try{\n\n $stmt = $this->dbConn->prepare($query);\n\n foreach ($column as $key => $value) {\n $stmt->bindValue(\"$key\", $value);\n }\n\n $stmt->execute();\n\n return $stmt->fetchAll($fetchMode);\n }catch(PDOException $e){\n echo $e->getMessage();\n }\n }", "public function GetAllRows() : ARRAY\r\n {\r\n return($this->preparedStatement->fetchAll(\\PDO::FETCH_ASSOC));\r\n }", "public function fetchAll(): array\n {\n $fetchMode = defined('MDB2_FETCHMODE_ASSOC') ? \\MDB2_FETCHMODE_ASSOC : 2;\n $result = $this->_getResult()->fetchAll($fetchMode); // Returns an array on success and an \\PEAR_Error object on failure\n return is_array($result) ? $result : array();\n }", "public function fetchAll()\n\t{\n\t\t$aReturn = Array();\n\t\twhile( $oRecord = $this->next() )\n\t\t\tarray_push( $aReturn, $oRecord );\n\t\t$this->rewind();\n\t\treturn $aReturn;\n\t}", "public function getAll()\r\n {\r\n $stmt = $this->conn->prepare(\"SELECT * FROM $this->table ORDER BY id DESC\");\r\n $stmt->execute();\r\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM \".$this->table;\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_OBJ);\n \n }", "public function fetch(){\n\n $rows = [];\n\n while($row = $this->result->fetch(PDO::FETCH_ASSOC)) {\n $rows[]=$row;\n }\n\n $this->result=null;\n\n return $rows;\n\n }", "protected function getAll()\n {\n $statement = $this->connection->query($this->sqlToString());\n return $this->fetchAll($statement);\n }", "public function fetchAll($query, $params = NULL)\n {\n $stmt = $this->db->prepare($query);\n $stmt->execute($params);\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "protected function fetchAll(\\PDOStatement $statement)\n {\n return $statement->fetchAll();\n }", "public function fetchAll()\r\n {\r\n $sql = new Sql($this->dbAdapter);\r\n $select = $sql->select();\r\n $select\r\n ->from(array('a_s' => $this->table))\r\n ->order('a_s.sector_order ASC');\r\n \r\n $selectString = $sql->getSqlStringForSqlObject($select);\r\n $execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n $result = $execute->toArray();\r\n return $result;\r\n }", "public static function fetch_all($params) {}", "public function fetch_all(){\n $data = array();\n while( ($obj = oci_fetch_object($this->result)) != false ){\n $data[] = $obj;\n }\n return $data;\n }", "function fetchAll($res = null, $fmt = 'a')\n{\n\t$rows = array();\n\twhile ($row = $this->drv->fetch($res, $fmt)) {\n\t\t$rows[] = $row;\n\t}\n\treturn $rows;\n}", "public function fetchAll($statement, array $params = array());", "public function resultset(){\n\t\t$this->execute() ;\n\t\treturn $this->statement->fetchAll(PDO::FETCH_ASSOC) ;\n\t}", "public function fetchAll($sql, $params = array());", "public function fetchAllToArray()\n {\n $resultSet = $this->getDbTable()->fetchAll()->toArray();\n return $resultSet;\n }", "function FetchAllData($bdd){\n $sth = $bdd->prepare(\"SELECT * FROM article\");\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n}", "private function fetchAll($connection, $query, $params) {\n $objects = array();\n\n $statement = $connection->prepare($query);\n $this->bindParameters($statement, $params);\n $statement->execute();\n while ($obj = $statement->fetch(PDO::FETCH_OBJ)) {\n array_push($objects, $this->construct($obj));\n }\n \n\n return $objects;\n }", "abstract protected function doFetchAll();", "public static function getAll()\n {\n $sql = sprintf(\n 'SELECT * FROM `%s` LIMIT :limitFrom, :perPage',\n static::getTableName()\n );\n $stmt = static::getConn()->prepare($sql);\n $stmt->bindValue(':limitFrom', static::LIMIT_FROM, \\PDO::PARAM_INT);\n $stmt->bindValue(':perPage', static::PER_PAGE, \\PDO::PARAM_INT);\n\n $stmt->execute();\n\n $info = $stmt->errorInfo();\n if ($info[0] !== \\PDO::ERR_NONE) {\n die('We have : ' . $info[2]);\n }\n\n return $stmt->fetchAll(\n \\PDO::FETCH_CLASS |\n \\PDO::FETCH_PROPS_LATE,\n get_called_class()\n );\n }", "public function fetchAll($table = null)\n {\n if ($table){\n $this->table = $table;\n }\n\n $sql = $this->fetchStatement();\n\n $query = $this->query($sql , $this->bindings);\n $results = $query->fetchAll();\n $this->rows = $query->rowCount();\n\n $this->reset();\n return $results;\n }", "public function getAll($sql, $params=[]){\n try \n {\n $stmt = $this->dbh->prepare($sql);\n $stmt->execute($params);\n return $stmt->fetchAll();\n \n } catch (PDOException $e) \n {\n throw new Exception($e->getMessage());\n }\n\n }", "function all() {\n\t\t$results = array();\n\t\twhile ($result = $this->fetch())\n\t\t\t$results[] = $result;\n\t\treturn $results;\n\t}", "public function fetchRowset()\n\t{\n\t\t$this->_query();\n\n\t\treturn $this->stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\t}", "public function fetch_all_array(){\n $data = array();\n while( ($r = oci_fetch_assoc($this->result)) != false ){\n $data[] = $r;\n }\n return $data;\n }", "function all($table)\n {\n $sql = \"SELECT * FROM $table\";\n $statement = $this->pdo->prepare($sql);\n $statement->execute();\n $results = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n return $results;\n }", "public function fetchAll(){\r\n$table=$this->getTable();\r\nreturn $this->fetch_array($this->query(\"SELECT * FROM {$table}\"));\r\n}", "protected function fetchAll( $sql, $params = null ) {\n\t\t$this->logger->debug( $sql, $params ?: array() );\n\t\t$stmt = $this->dbh->prepare( $sql );\n\t\t$this->bind( $stmt, $params );\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchAll();\n\t}", "public function fetchAll($table = null)\n\t{\n\t\tif ($table)\n\t\t{\n\t\t\t$this->table = $table;\n\t\t}\n\t\t\n\t\t$sql = $this->fetchStatement();\n\t\t\n\t\t$query = $this->query($sql, $this->bindings);\n\t\t\n\t\t$results = $query->fetchAll();\n\t\t\n\t\t$this->rows = $query->rowCount();\n\t\t\n\t\t$this->reset();\n\t\t\n\t\treturn $results;\n\t}", "function fetch_all($sql, $values = false)\n {\n $sth = $this->dbh->prepare($sql);\n\n if ($sth == false) {\n $this->err(\"fetch_all: $sql\");\n return null;\n }\n\n if ($values) {\n $sth->execute($this->_ensure_array($values));\n } else {\n $sth->execute(); \n }\n \n $rows = $sth->fetchAll(PDO::FETCH_ASSOC);\n\n return $rows;\n }", "public abstract function fetchAll($table);", "public function fetchAll(int $mode = \\PDO::ATTR_DEFAULT_FETCH_MODE, mixed ...$args);", "public function fetchAll() {\n\n if (!$this->results) {\n\n $this->results = [];\n while ($row = $this->nextRow()) {\n $this->results[] = $row;\n }\n\n }\n\n return $this->results;\n }", "public function select_all(string $query)\n{\n $this->strquery = $query;\n $result = $this->conexion->prepare($this->strquery);\n $result->execute();\n $data = $result->fetchall(PDO::FETCH_ASSOC);\n return $data; \n}", "function getALL(): array\n {\n try {\n if ($this->conn->isConnected()) {\n $sql = 'SELECT * FROM shinycoffee.item';\n $stmt = $this->db->query($sql);\n $stmt->setFetchMode(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'Item', [0, 0, 0, 0, 0]);\n $stmt->execute();\n $temp = $stmt->fetchAll();\n return $temp;\n }\n } catch (PDOException $e) {\n return [];\n }\n }", "protected function getAll(){\n\t\t\n\t\t$connection = DB::connect();\n\t\t\n\t\t$sql = \"SELECT * FROM $this->_tableName\";\n\t\t$result = '';\n\t\t\n\t\ttry {\n\t\t\t$stmt = $connection->query($sql);\n\t\t\t$result = $stmt->fetchAll();\n\t\t\n\t\t\treturn $result;\n\t\t\n\t\t} catch (PDOException $e){\n\t\t\tdie('Error: '.$e->getMessage().'<br/>');\n\t\t}\n\t}", "public function fetchAll(&$statement)\n {\n return $this->db_handler->fetchAllRows($statement);\n }", "public function fetchAll($sql);", "public function fetchAll($sql);", "function fetchAll($pdo, $resultado)\n{\n try {\n $sql_query = 'SELECT * FROM names_app';\n $gsent = $pdo->prepare($sql_query);\n $gsent->execute();\n $resultado = $gsent->fetchAll();\n } catch (PDOException $e) {\n print \"¡Error!: \" . $e->getMessage() . \"<br/>\";\n die();\n }\n}", "public function fetchAll()\n {\n $objectArray = [];\n while($fetchedObject = $this->fetch())\n {\n $objectArray[] = $fetchedObject;\n }\n\n return $objectArray;\n }", "public function fetchAll( $type = null ){\n if( is_null( $type ) ){\n $type = PDO::FETCH_OBJ;\n }\n\n return $this->stmt->fetchAll( $type );\n }", "function fetchAll($sql, $array, $objectName = null);", "public function findAll() : array {\r\n\r\n // méthode query car pas besoin de préparation ( liée à une variable) \r\n\r\n $resultat = $this->pdo->query(\"SELECT * FROM {$this->table}\");\r\n \r\n // fetchAll pour fouiller le résultat et en extraire les données réelles\r\n\r\n $items = $resultat->fetchAll();\r\n\r\n return $items;\r\n}", "public function findAll(): array {\n $tableName = static::tableName();\n $st = self::prepare(\n \"SELECT * FROM $tableName\"\n );\n $st->execute();\n \n return $st->fetchAll(\\PDO::FETCH_OBJ);\n }", "public function getAll(): array\n {\n $this->setReqSql(\"SELECT * FROM {$this->table}\");\n return $this->outCast($this->fetchAll());\n }", "public function selectAll(): array\n {\n return $this->pdoConnection->query('SELECT * FROM ' . $this->table, \\PDO::FETCH_CLASS, $this->className)->fetchAll();\n }", "function fetchAll($result, $resultType = MYSQLI_ASSOC)\n {\n return $result->fetch_all($resultType);\n }", "public function resultSet(){\n\t\t$this->execute();\n\t\treturn $this->stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function fetchAssoc()\n {\n return $this->fetch();// \\PDO::FETCH_ASSOC\n }", "public function all($params = null)\n {\n $query = $this->db->prepare(\"SELECT * FROM `$this->tableName`\");\n\n $result = $query->execute();\n\n //maybe there is a reason to make only !empty().\n if (!empty($result) && $result)\n {\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n } else {\n var_dump($query);\n }\n\n }", "public function fetchAll() {\n\t\t$queryBuilder = $this->db->createQueryBuilder();\n\t\t$queryBuilder\n\t\t\t->select('*')\n\t\t\t->from($this->table_name, 't1')\n\t\t;\n\t\t$result = $queryBuilder->execute()->fetchAll();\n\n\t\treturn $result;\n\t}", "public function fetchAll($fetch_style = null, $fetch_argument = null, $ctor_args = [])\n {\n if ($fetch_style === null) {\n if ($this->fetchMode !== null) {\n $fetch_style = $this->fetchMode;\n } else {\n $fetch_style = $this->pdoOci8->getAttribute(PDO::ATTR_DEFAULT_FETCH_MODE);\n }\n }\n if ($fetch_argument !== null || !empty($ctor_args)) {\n throw new PDOException('Passing more than one argument to Oci8\\Statement::fetchAll() is not supported. '\n . 'Use Oci8\\Statement::setFetchMode().');\n }\n\n $result = [];\n switch($fetch_style) {\n case PDO::FETCH_ASSOC:\n case PDO::FETCH_BOTH:\n oci_fetch_all(\n $this->sth,\n $result,\n 0, // skip\n -1, // maxrows\n OCI_FETCHSTATEMENT_BY_ROW + ($fetch_style === PDO::FETCH_BOTH ? OCI_BOTH : OCI_ASSOC)\n + OCI_RETURN_NULLS\n );\n if (($case = $this->pdoOci8->getAttribute(PDO::ATTR_CASE)) != PDO::CASE_NATURAL) {\n $result = array_map(function ($row) use ($case) {\n return array_change_key_case($row, $case == PDO::CASE_LOWER ? CASE_LOWER : CASE_UPPER);\n }, $result);\n }\n break;\n case PDO::FETCH_NUM:\n oci_fetch_all($this->sth, $result, 0, -1, OCI_FETCHSTATEMENT_BY_ROW + OCI_NUM + OCI_RETURN_NULLS);\n break;\n case PDO::FETCH_COLUMN:\n oci_fetch_all($this->sth, $preResult, 0, -1, OCI_FETCHSTATEMENT_BY_COLUMN + OCI_NUM + OCI_RETURN_NULLS);\n $result = isset($preResult[0]) ? $preResult[0] : false;\n break;\n case PDO::FETCH_OBJ:\n case PDO::FETCH_INTO:\n case PDO::FETCH_CLASS:\n case PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE:\n while (false !== ($row = $this->fetch($fetch_style))) {\n $result[] = $row;\n }\n break;\n case PDO::FETCH_BOUND:\n case PDO::FETCH_LAZY:\n default:\n throw new PDOException('Oci8\\Statement::fetchAll() does not implement fetch mode ' . $fetch_style);\n break;\n }\n\n return $result;\n }", "public function fetchAllToPaginator()\n {\n return $this->selectToPaginator($this->getDbTable()\n ->select()\n ->from($this->getDbTable()->getTableName()));\n }", "public function queryAll() {\r\n $sql = \"SELECT * FROM $this->table\";\r\n $stmt = ConnectionFactory::prepare($sql);\r\n $stmt->execute();\r\n return $stmt->fetchAll();\r\n }", "function findAll($sql) {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\t$statement = $this->execute($sql, $args);\n\t\treturn $statement->fetchAll(PDO::FETCH_CLASS, $this->resultClass, array($this));\n\t}", "public function fetchAll($where=\"\"){\n\n\t\t$select=$this->getDbTable()->select();//\n\n\t\tif(!empty($where))$select->where($where);\n\t\t$result= $this->getDbTable()->getAdapter()->fetchAll($select);\n\t\treturn $result;\n\n\t}", "public function asArray() {\n\t\treturn $this->_sth->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function fetchAll($where = null)\n {\n $table = $this->getTable();\n if ($where != null) {\n $result = $table->fetchAll($where);\n } else {\n $result = $table->fetchAll();\n }\n\n return $result->toArray();\n }", "public function toList(): array\n {\n return $this->pdoStatement->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function getAll()\n {\n return $this->prepare(DB::findAll($this->table));\n }", "public function fetchAll(): array {\n\n if($this->database === null) {\n throw new \\Exception('Database connection has not been set.');\n }\n\n $this->queryProperty->setFetchType($this->queryProperty::FETCH_ALL);\n\n $cachedResult = $this->checkQueriesCache($this->queryProperty);\n if ($cachedResult !== null) {\n $this->cacheAndResetQueryProperties();\n return $cachedResult;\n }\n\n $task = $this->createTask();\n $result = $task->fetchAll(\\PDO::FETCH_ASSOC);\n $this->cacheAndResetQueryProperties($result);\n return $result;\n }", "public function fetch()\n {\n try {\n $sth = $this->conn->prepare($this->query);\n if ($sth->execute($this->bind) !== false)\n {\n if ($sth->execute() !== false) {\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n $this->countable = sizeof($result);\n return $result;\n }\n }\n }\n catch(PDOException $e) {\n $this->errors[] = $e->getMessage();\n return false;\n }\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM $this->table\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll();\n }", "public function fetchResults(\\PDO $pdo, $sql, array $params = array())\n\t{\n\t\treturn $this->runStatement($pdo, $sql, $params)->fetchAll(\\PDO::FETCH_ASSOC);\n\t}" ]
[ "0.7989667", "0.7853969", "0.7591586", "0.75594103", "0.7558138", "0.75515646", "0.7457583", "0.7435571", "0.73728174", "0.736468", "0.73495424", "0.73495424", "0.73495424", "0.73495424", "0.7316613", "0.7296686", "0.7283648", "0.72644603", "0.7229839", "0.72241724", "0.71595794", "0.7154535", "0.71422625", "0.71420366", "0.7139919", "0.70890063", "0.70811784", "0.70782465", "0.706862", "0.7055054", "0.7049653", "0.70460063", "0.6995356", "0.6987085", "0.6970418", "0.6968041", "0.6944731", "0.6934868", "0.69257164", "0.68963724", "0.6861287", "0.6850476", "0.6850111", "0.6847202", "0.6832967", "0.68307734", "0.68305725", "0.68259734", "0.68161714", "0.68036175", "0.67968005", "0.678279", "0.6781325", "0.67800826", "0.6767403", "0.675141", "0.6740463", "0.6735232", "0.6732718", "0.6719903", "0.6719761", "0.6709479", "0.6709144", "0.66992", "0.6698192", "0.6692578", "0.66922677", "0.66573066", "0.66526186", "0.6648352", "0.66446877", "0.664453", "0.6641625", "0.6640631", "0.6640631", "0.66220623", "0.66117436", "0.6607438", "0.6605421", "0.6603997", "0.66017526", "0.6599577", "0.6595018", "0.65928656", "0.6581362", "0.65766895", "0.657311", "0.6565138", "0.6563712", "0.65569973", "0.6553994", "0.65523744", "0.65504587", "0.6539886", "0.6539225", "0.65379786", "0.6536176", "0.6531411", "0.6527584", "0.6522195", "0.6520577" ]
0.0
-1
Wrapper for PDO fetch(PDO::FETCH_ASSOC)
public static function fetchAssoc(PDOStatement $stmt) { return self::convertTypes($stmt, $stmt->fetch(PDO::FETCH_ASSOC)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetchAssoc()\n {\n return $this->fetch();// \\PDO::FETCH_ASSOC\n }", "function pdo_fetch_assoc($stmt) {\r\n return pdo_stmt($stmt)->fetch(PDO::FETCH_ASSOC);\r\n }", "function _fetch_assoc()\r\n\t{\r\n\t\tif ( is_array($this->pdo_results) ) {\r\n\t\t\t$i = $this->pdo_index;\r\n\t\t\t$this->pdo_index++;\r\n\t\t\tif ( isset($this->pdo_results[$i]))\r\n\t\t\t\treturn $this->pdo_results[$i];\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn $this->result_id->fetch(PDO::FETCH_ASSOC);\r\n\t}", "function sql_fetch_assoc($res)\n {\n $results = array();\n if ($res)\n $results = $res->fetch(PDO::FETCH_ASSOC); \n return $results;\n }", "function pdo_fetch(PDOStatement $pdo_statement, $fetch_style = PDO::FETCH_ASSOC)\n {\n return $pdo_statement->fetch($fetch_style);\n }", "public function fetch()\n {\n $this->execute();\n return $this->dbStmt->fetch(PDO::FETCH_ASSOC);\n }", "function _fetch_assoc()\n\t{\n\t\treturn sqlsrv_fetch_array($this->result_id, SQLSRV_FETCH_ASSOC);\n\t}", "public function fetchAssoc();", "public function fetchAssoc();", "function _fetch_object()\r\n\t{\r\n\t\tif ( is_array($this->pdo_results) ) {\r\n\t\t\t$i = $this->pdo_index;\r\n\t\t\t$this->pdo_index++;\r\n\t\t\tif ( isset($this->pdo_results[$i])) {\r\n\t\t\t\t$back = '';\r\n\t\t\t\tforeach ( $this->pdo_results[$i] as $key => $val ) {\r\n\t\t\t\t\t$back->$key = $val;\r\n\t\t\t\t}\r\n\t\t\t\treturn $back;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn $this->result_id->fetch(PDO::FETCH_OBJ);\r\n\t}", "protected function _fetchAssoc()\n {\n $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;\n return oci_fetch_assoc($id);\n }", "protected function _fetch_assoc()\n\t{\n\t\t$id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;\n\t\treturn oci_fetch_assoc($id);\n\t}", "public function fetch_assoc()\n\t{\n\t\t$assoc = array();\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$assoc[$key] = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$assoc = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $assoc;\n\t}", "protected function fetchAssoc()\n {\n return oci_fetch_assoc($this->resultID);\n }", "protected function fetch() \n {\n $record = $this->statement->fetch(PDO::FETCH_ASSOC);\n\n if($record === false) {\n return false;\n }\n\n foreach($this->mappers as $mapper) {\n $record = $mapper($record);\n }\n\n return $record;\n }", "abstract public function fetch($fetchType = \\PDO::FETCH_ASSOC);", "public function safe_fetch_array()\n {\n\n $m_arr_row = $this->c_obj_stmt->fetch(PDO::FETCH_ASSOC);\n return $m_arr_row;\n }", "public function fetch($fetchMode = \\PDO::FETCH_BOTH);", "function fetch_assoc()\n {\n if (!$this->res_result) {\n $this->error = \"No Resultset can be fetched from query\";\n return null;\n } else {\n $_rec = @isis_fetch_flat_array($this->res_result);\n }\n\n return $_rec;\n }", "abstract protected function fetchAssoc();", "private function pdoFetch ( $SQL, array $arrParams = array(), $fetch_class = null )\n {\n $stmt = $this->_driver->prepare($SQL);\n if ( $fetch_class ) {\n $stmt->setFetchMode(PDO::FETCH_CLASS, get_class($fetch_class));\n $stmt->execute($arrParams);\n $result = $stmt->fetchAll();\n } else {\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n\n $stmt->execute($arrParams);\n $result = $stmt->fetchAll();\n }\n\n return $result;\n\n }", "public function fetch($fetch_style = \\PDO::FETCH_ASSOC)\n\t{\n\t\treturn $this->getStatement()\n\t\t\t\t\t->fetch($fetch_style);\n\t}", "public function fetch(){\n try{\n $this->array = $this->resultado->fetch();\n } catch (PDOException $e){\n $this->errors[] = 'error: function fetch<br/>'.$e->getMessage();\n $this->array = NULL;\n }\n return $this->array;\n }", "public function fetchAssoc($statement, array $params = array());", "public function fetch()\n {\n try {\n $sth = $this->conn->prepare($this->query);\n if ($sth->execute($this->bind) !== false)\n {\n if ($sth->execute() !== false) {\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n $this->countable = sizeof($result);\n return $result;\n }\n }\n }\n catch(PDOException $e) {\n $this->errors[] = $e->getMessage();\n return false;\n }\n }", "function fetch_assoc($result) {\n\t\tif ($result === false) {\n\t\t\treturn array(); // Return an empty array, causing any subsequent foreach to fail gracefully.\n\t\t}\n\t\treturn $result->fetch_array(MYSQLI_ASSOC);\n\t}", "public function fetch_array()\n\t{\n\t\tif($this->num_rows() < 1)\n\t\t\treturn false;\n\n\t\t$data = $this->result_metadata();\n\t\t$fields = array();\n\t\t$out = array();\n\n\t\t$fields[0] = &$this;\n\t\t$count = 0;\n\n\t\twhile($field = $data->fetch_field()) {\n\t\t\t$fields[$count] = &$out[$field->name];\n\t\t\t$count++;\n\t\t}\n\n\t\tcall_user_func_array(array($this, 'bind_result'), $fields);\n\n\t\treturn ($this->fetch()) ? $out : false;\n }", "public function fetch_row()\r\n{\r\n\t$tmp2 = $this->_result->fetch_row();\r\n\t$this->type = 1; // MYSQLI_ASSOC = 0, MYSQLI_NUM = 1, or MYSQLI_BOTH (To implement). \r\n\t$this->push_in($tmp2);\r\n\t\r\n\treturn $tmp2;\r\n}", "public function fetchRow()\n\t{\n\t\t$this->_query();\n\n\t\treturn $this->stmt->fetch(\\PDO::FETCH_ASSOC);\n\t}", "public function fetch()\n {\n\n if ($this->_result !== null) {\n if (($row = $this->_result->fetch(PDO::FETCH_ASSOC))=== false ) {\n $this->freeResult();\n\n }\n return $row;\n }\n return false;\n }", "public abstract function fetchAssoc();", "public function queryFetchRowAssoc($statement) {\n return $this->connection->query($statement)->fetch(PDO::FETCH_ASSOC); \n }", "public function fetch_assoc()\r\n {\r\n return $this->resultID->fetch_assoc();\r\n }", "function pdo_fetch_array($stmt, $type=3) {\r\n \r\n $map = array(\r\n MYSQL_ASSOC/*1*/ => PDO::FETCH_ASSOC/*2*/,\r\n MYSQL_NUM/*2*/ => PDO::FETCH_NUM/*3*/,\r\n MYSQL_BOTH/*3*/ => PDO::FETCH_BOTH/*4*/,\r\n // no consistency so far, so let's embrace and extend it:\r\n 0=>4, \"assoc\"=>2, \"num\"=>3, \"both\"=>4, \"ASSOC\"=>2, \"NUM\"=>3, \"BOTH\"=>4, \"MYSQL_ASSOC\"=>2, \"MYSQL_NUM\"=>3, \"MYSQL_BOTH\"=>4,\r\n );\r\n \r\n return pdo_stmt($stmt)->fetch(isset($map[$type]) ? $map[$type] : $type);\r\n }", "function sql_fetch_assoc($result) {\n\t\treturn pg_fetch_assoc($result);\n\t}", "public function fetch($assoc=MYSQLI_ASSOC){\n\t\t$this->assoc=$assoc;\n\t\treturn @$this->qresult->fetch_array($this->assoc);\n\t}", "public function fetch($fetchAs = \"FETCH_ASSOC\")\r\n\t\t{\r\n\t\t\treturn $this->_query->fetch(constant(\"PDO::{$fetchAs}\"));\r\n\t\t}", "function sql_fetch_row($res)\n {\n $results = array();\n if ($res)\n $results = $res->fetch(PDO::FETCH_NUM); \n return $results;\n }", "public function fetch() {\n\t\t$this->checkResultSet();\n\t\treturn $this->fetchRowAssoc();\n\t}", "public function fetch ($fetch_method = PDO::FETCH_ASSOC) {\n return $this->query->fetch($fetch_method);\n }", "public function fetchResult($result)\n {\n return $result->fetch(PDO::FETCH_ASSOC, 0, 0);\n }", "function & fetch() {\n // Call the PEAR::DB Result fetchRow() method\n if ( $row = & $this->result->fetchRow(DB_FETCHMODE_ASSOC) ) {\n return $row;\n } else {\n return false;\n }\n }", "public function fetch($fetch_style = PDO::FETCH_BOTH, $cursor_orientation = PDO::FETCH_ORI_NEXT, $cursor_offset = 0) {\n //not sure how to resolve this functionality.\n //This function relies on us having called PDOStatement::execute which has functionality more similar to odbc_execute,\n //but we are interacting with the results from what seems to be odbc_exec. The key thing here being the bound parameters\n //UPDATE::Looks like this has been resolved ^^. Still testing\n if (!isset($fetch_style)) $fetch_style = isset($this->fetch_mode) ? $this->fetch_mode : PDO::FETCH_BOTH;\n $result = false;\n if (!$this->success) return false;\n ob_start();\n switch ($fetch_style) {\n case (PDO::FETCH_NAMED):\n //todo\n //not sure how to emulate 1:1\n case (PDO::FETCH_ASSOC):\n $result = odbc_fetch_array($this->stmt);\n break;\n case (PDO::FETCH_BOTH):\n $result = odbc_fetch_array($this->stmt) ?: [];\n if (is_array($result))\n $result = array_merge($result, array_values($result ?: []));\n break;\n case (PDO::FETCH_BOUND):\n //todo link with the bindColumn function\n return true;\n break;\n case (PDO::FETCH_CLASS):\n //todo use the splat operator to unpack the arguments instead of using a reflection class\n $reflect = new ReflectionClass($this->fetch_receptacle);\n $fetch_receptacle = $reflect->newInstanceArgs($this->ctor_args ?: []);\n case (PDO::FETCH_INTO):\n $fetch_receptacle = isset($fetch_receptacle) ? $fetch_receptacle : $this->fetch_receptacle ?: new stdClass();\n $result = [];\n odbc_fetch_into($this->stmt, $result);\n #Assume that the fetch_receptacle is either an object or an array\n $r_is_array = is_array($fetch_receptacle);\n foreach ($result as $index => $item) {\n if ($r_is_array) $fetch_receptacle[$index] = $item;\n else $fetch_receptacle->{$index} = $item;\n }\n $result = $fetch_receptacle;\n break;\n case (PDO::FETCH_LAZY):\n $obj = new PDORow;\n $result = odbc_fetch_array($this->stmt);\n foreach ($result as $index => $item) {\n $obj->{$index} = $item;\n }\n $result = $obj;\n break;\n case (PDO::FETCH_NUM):\n $result = odbc_fetch_array($this->stmt);\n if ($result)\n $result = array_values($result);\n break;\n case (PDO::FETCH_OBJ):\n #todo, not 1:1\n $result = odbc_fetch_object($this->stmt);\n break;\n }\n $error = ob_get_clean();\n if (!$result) $this->throw_error($error);\n return $result;\n }", "function _fetch_assoc()\n\t{\n\t\treturn mysql_fetch_assoc($this->result_id);\n\t}", "abstract protected function fetchRowAssocDb();", "public function fetchAssoc(){\n $this->debugBacktrace();\n $this->fetchType = \"fetch_assoc\";\n return $this;\n }", "function pdo_fetch_row($stmt) {\r\n return pdo_stmt($stmt)->fetch(PDO::FETCH_NUM);\r\n }", "abstract public function fetchByAssoc(\n &$result,\n $rowNum = -1, \n $encode = true);", "public function Fetch($style = PDO::FETCH_ASSOC)\r\n { \r\n if ($style) {\r\n return $this->statement->fetchAll($style);\r\n }else{\r\n return $this->statement->fetchAll();\r\n }\r\n \r\n \r\n }", "function pdo_fetch_object($stmt, $classname=\"stdClass\", $params=array()) {\r\n return pdo_stmt($stmt)->fetchObject($classname, $params);\r\n }", "function FetchAssoc($rs='')\n {\n $ret = false;\n if ($rs==null || $rs==\"\") $rs = $this->result;\n if ($rs->_numOfRows>0) $ret = $rs->GetRows();\n return $ret;\n }", "protected function fetchAssocStatement($stmt) {\n if ($stmt->num_rows > 0) {\n $result = array();\n $md = $stmt->result_metadata();\n $params = array();\n while ($field = $md->fetch_field()) {\n $params[] = &$result[$field->name];\n }\n call_user_func_array(array($stmt, 'bind_result'), $params);\n if ($stmt->fetch())\n return $result;\n }\n return NULL;\n }", "public function fetch_array_assoc(&$result){\r\n\t\t$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;\r\n\t\tif(!$result->EOF){\r\n\t\t \t$rs = $result->fields;\r\n\t\t \t$result->MoveNext(); \r\n\t\t \treturn $rs;\r\n\t\t}\r\n\t}", "function sql_fetch_array($res)\n {\n $results = array();\n if ($res)\n $results = $res->fetch(PDO::FETCH_BOTH);\n return $results;\n }", "public function fetch(){\n\n $rows = [];\n\n while($row = $this->result->fetch(PDO::FETCH_ASSOC)) {\n $rows[]=$row;\n }\n\n $this->result=null;\n\n return $rows;\n\n }", "public function fetch_array() {\n\t\treturn $this->FetchArray();\n\t}", "function fetchAssoc($table,$col,$condition=\"non\") {\n global $db, $dbname;\n $socket = $db;\n $select_db = $dbname;\n\n $query = \"SELECT \".$col.\" FROM `$select_db`.`$table`\"; //echo \"$query <br/>\";\n if($condition != \"non\") $query .= \" WHERE \".$condition;\n $stm = $socket->prepare($query);\n\n $stm->execute();\n $stm = $stm->fetchAll(PDO::FETCH_ASSOC); //echo \"query = $query \".count($stm);\n if(!isset($stm) || count($stm) == 0) return -1;\n\t\t//return data\n return $stm;\n}", "function fetch(){\n\t\tif($this->result==null){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif($this->result==false){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn $this->result->fetch_assoc();\n\t}", "protected function fetch_row()\n\t{\n\t\treturn $this->resResult->fetch(PDO::FETCH_NUM);\n\t}", "public abstract function FetchAssoc();", "protected function _fetchAssoc($result)\r\n {\r\n return pg_fetch_assoc($result);\r\n }", "function fetchAssoc($table,$col,$condition=\"non\") {\n global $db, $dbname;\n $socket = $db;\n $select_db = $dbname;\n\n $query = \"SELECT \".$col.\" FROM `$select_db`.`$table`\"; //echo \"$query <br/>\";\n if($condition != \"non\") $query .= \" WHERE \".$condition;\n $stm = $socket->prepare($query);\n $stm->execute();\n $stm = $stm->fetchAll(PDO::FETCH_ASSOC); //echo \"query = $query \".count($stm);\n if(!isset($stm) || count($stm) == 0) return -1;\n\n\t\t//return data\n return $stm;\n}", "public function fetch_row() {\n\t\tif ($this->opencursor === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$row = $this->opencursor->fetch(PDO::FETCH_ASSOC);\n\t\tif ($row === false) {\n\t\t\t$this->close_open_cursor();\n\t\t\treturn false;\n\t\t}\n\t\treturn $row;\n\t}", "public function sql_fetch_assoc($result) {\n return @mysql_fetch_assoc($result);\n }", "public function fetch() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn @mysql_fetch_assoc($this->result);\r\n\t}", "function _fetch_assoc()\n\t{\n\t\treturn mysqli_fetch_assoc($this->result_id);\n\t}", "abstract public function fetchAll($fetchType = \\PDO::FETCH_ASSOC);", "public function fetch_assoc()\n {\n if(is_resource($this->resource))\n {\n $result = pg_fetch_assoc($this->resource);\n\n if(!$result)\n {\n return false;\n }\n else\n {\n return $result;\n }\n }\n else\n {\n return false;\n }\n }", "public function fetch_array()\n\t{\n\t\t$array = array();\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $value) {\n\t\t\t\t$array[] = $value;\n\t\t\t}\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$array[$key] = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$array = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $array;\n\t}", "public function fetch()\n {\n return $this->query->select(\n $this->filter,\n $this->order,\n null,\n $this->limitOffset,\n PDO::FETCH_CLASS\n );\n }", "function oci_fetch_assoc($statement)\n{\n}", "public function fetchKeyedArray()\n\t{\n\t\t$arr = $this->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC);\n\t\t$arr = array_map('reset', $arr);\n\t\t$keys = array_keys($arr);\n\t\t// if there's only one item in the lower arrays, we might as well\n\t\t// remove the array element\n\t\tif (count($keys) && count($arr[$keys[0]]) == 1)\n\t\t{\n\t\t\t$arr = array_map('reset', $arr);\n\t\t}\n\n\t\treturn $arr;\n\t}", "public function toRow()\n {\n return $this->pdoStatement->fetch(\\PDO::FETCH_ASSOC);\n }", "public function fetchResults(\\PDO $pdo, $sql, array $params = array())\n\t{\n\t\treturn $this->runStatement($pdo, $sql, $params)->fetchAll(\\PDO::FETCH_ASSOC);\n\t}", "public function result(){\n\t\t$this->execute() ;\n\t\treturn $this->statement->fetch(PDO::FETCH_ASSOC) ;\n\t}", "public function queryFetchAllAssoc($statement) {\n return $this->connection->query($statement)->fetchAll(PDO::FETCH_ASSOC);\n }", "public function fetchAll($fetch_style = null, $fetch_argument = null, $ctor_args = [])\n {\n if ($fetch_style === null) {\n if ($this->fetchMode !== null) {\n $fetch_style = $this->fetchMode;\n } else {\n $fetch_style = $this->pdoOci8->getAttribute(PDO::ATTR_DEFAULT_FETCH_MODE);\n }\n }\n if ($fetch_argument !== null || !empty($ctor_args)) {\n throw new PDOException('Passing more than one argument to Oci8\\Statement::fetchAll() is not supported. '\n . 'Use Oci8\\Statement::setFetchMode().');\n }\n\n $result = [];\n switch($fetch_style) {\n case PDO::FETCH_ASSOC:\n case PDO::FETCH_BOTH:\n oci_fetch_all(\n $this->sth,\n $result,\n 0, // skip\n -1, // maxrows\n OCI_FETCHSTATEMENT_BY_ROW + ($fetch_style === PDO::FETCH_BOTH ? OCI_BOTH : OCI_ASSOC)\n + OCI_RETURN_NULLS\n );\n if (($case = $this->pdoOci8->getAttribute(PDO::ATTR_CASE)) != PDO::CASE_NATURAL) {\n $result = array_map(function ($row) use ($case) {\n return array_change_key_case($row, $case == PDO::CASE_LOWER ? CASE_LOWER : CASE_UPPER);\n }, $result);\n }\n break;\n case PDO::FETCH_NUM:\n oci_fetch_all($this->sth, $result, 0, -1, OCI_FETCHSTATEMENT_BY_ROW + OCI_NUM + OCI_RETURN_NULLS);\n break;\n case PDO::FETCH_COLUMN:\n oci_fetch_all($this->sth, $preResult, 0, -1, OCI_FETCHSTATEMENT_BY_COLUMN + OCI_NUM + OCI_RETURN_NULLS);\n $result = isset($preResult[0]) ? $preResult[0] : false;\n break;\n case PDO::FETCH_OBJ:\n case PDO::FETCH_INTO:\n case PDO::FETCH_CLASS:\n case PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE:\n while (false !== ($row = $this->fetch($fetch_style))) {\n $result[] = $row;\n }\n break;\n case PDO::FETCH_BOUND:\n case PDO::FETCH_LAZY:\n default:\n throw new PDOException('Oci8\\Statement::fetchAll() does not implement fetch mode ' . $fetch_style);\n break;\n }\n\n return $result;\n }", "function fetch($result)\n\t{\n\t\treturn mysql_fetch_assoc($result);\n\t}", "public function fetch()\n {\n return mysqli_fetch_assoc($this->lastResults);\n }", "public function fetchArray();", "public function fetchArray();", "public function fetchArray($result)\n {\n return $result->fetch(PDO::FETCH_ASSOC);\n }", "private function fetchValues(&$result) {\n $result->setFetchMode(PDO::FETCH_ASSOC);\n $records = $result->fetchAll();\n return $records;\n }", "public function queryFetchAllAssoc($statement) {\n return self::$PDOInstance->query($statement)->fetchAll(PDO::FETCH_ASSOC);\n }", "public function fetchAll($fetchMode = \\PDO::FETCH_BOTH);", "public function fetch_row()\n {\n return $this->fetch_assoc();\n }", "public function fetch($query)\n {\n $result = $this->query($query);\n\n return $result->fetch(\\PDO::FETCH_ASSOC);\n }", "public function fetch($query, $params = NULL)\n {\n $stmt = $this->db->prepare($query);\n $stmt->execute($params);\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }", "function db_get_row($result)\n{\n\treturn $result->fetch_assoc();\n}", "public function fetch_assoc($resultado){\r\n\r\n\t\tmysqli_fetch_assoc($resultado);\r\n\t}", "public function fetchRow() : array\n\t{\n\t\treturn $this->handle->fetchRow($this->result);\n\t}", "public function toRow() {\r\n\t\treturn $this->PDOStatement->fetch(PDO::FETCH_ASSOC);\r\n\t}", "function pdo_fetch_all(PDOStatement $pdo_statement, $fetch_style = PDO::FETCH_ASSOC)\n {\n return $pdo_statement->fetchAll($fetch_style);\n }", "abstract protected function _getRowAssoc($rs);", "public function fetchRow();", "public function consultarDatos($consultaSQL){\n $conexionBD=$this->conectarBD();\n\n //2.Preparar la consulta que se va a realizar\n $consultaBuscarDatos= $conexionBD->prepare($consultaSQL);\n\n //3. Definir la forma en la que vmos a traer los datos\n // setFetchMode\n $consultaBuscarDatos->setFetchMode(PDO::FETCH_ASSOC);\n\n //4.Ejecutar la consulta\n $consultaBuscarDatos->execute();\n\n //5. Retornar los datos consultados\n return($consultaBuscarDatos->fetchAll());\n\n\n\n}", "public function fetch($tipo = 4)\n {\n\n if (!empty($this->prepare)) {\n if (1 == $tipo) {\n $datos = $this->prepare->fetch(PDO::FETCH_ASSOC);\n } elseif (2 == $tipo) {\n $datos = $this->prepare->fetch(PDO::FETCH_NUM);\n } elseif (3 == $tipo) {\n $datos = $this->prepare->fetch(PDO::FETCH_OBJ);\n } else {\n $datos = $this->prepare->fetch();\n }\n return $datos;\n }\n return array();\n }", "public static function fetch_assoc($sql)\n\t{\n\t return mysqli_fetch_assoc($sql); \n\t}", "protected function fetch($statement, $style) {\n\t\t// stdClass objects as generic containers for the query rows,\n\t\t// otherwise we'll just use the fetch style value.\n\t\tif($style === PDO::FETCH_CLASS) {\n\t\t\treturn $statement->fetchAll(PDO::FETCH_CLASS, 'stdClass');\n\t\t}\n\t\telse {\n\t\t\treturn $statement->fetchAll($style);\n\t\t}\n\t}", "protected function getReturnData($sth, $sql)\n\t{\n\n\t\tif (substr($sql, -7) === 'LIMIT 1') {\n\n\t\t\t$data = $sth->fetch(parent::FETCH_ASSOC);\n\n\t\t} else {\n\n\t\t\t$data = $sth->fetchAll(parent::FETCH_ASSOC);\n\n\t\t}\n\n\t\treturn $data;\n\n\t}" ]
[ "0.7939783", "0.76921266", "0.74102813", "0.7215635", "0.71462554", "0.7082283", "0.69285375", "0.6901894", "0.6901894", "0.68998075", "0.6879839", "0.6838226", "0.68092084", "0.68014705", "0.6788761", "0.6722403", "0.6700609", "0.6633409", "0.6628873", "0.659151", "0.65875965", "0.6545317", "0.65411144", "0.6524127", "0.65219146", "0.6520939", "0.65181327", "0.65119743", "0.65116745", "0.6494007", "0.6474079", "0.6462144", "0.6453975", "0.6444", "0.64381355", "0.64232534", "0.63837814", "0.63680214", "0.6348343", "0.63410485", "0.6339521", "0.63231575", "0.6314004", "0.62851083", "0.62824106", "0.6281038", "0.62701607", "0.6264343", "0.6255208", "0.62112445", "0.6209334", "0.62087476", "0.6201586", "0.6201307", "0.6191856", "0.61699665", "0.6166131", "0.6162737", "0.61492497", "0.61481154", "0.6127153", "0.6127038", "0.6119161", "0.6114558", "0.61102283", "0.61049443", "0.6096859", "0.6092869", "0.60840654", "0.6080126", "0.60783637", "0.6049943", "0.6049895", "0.6042982", "0.60429037", "0.6040011", "0.6038454", "0.60284066", "0.60281", "0.6023859", "0.6023859", "0.6023709", "0.6022018", "0.6018852", "0.60061896", "0.6005695", "0.6002119", "0.60003644", "0.59885323", "0.5986955", "0.5986775", "0.5982812", "0.59752834", "0.5971984", "0.5968384", "0.596702", "0.59556514", "0.5954164", "0.5949054", "0.5948467" ]
0.7047304
6
Get the full path to file view
public function getFullPath($path) { return config('view.path') . DS . $path . '.' . config('view.extension'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFileToView()\n {\n // when displaying uploaded doc/image in the view.\n return '/../'.$this->getUploadDir().'/'.$this->path;\n }", "function getViewFilePath();", "public function view()\n {\n return $this->entry->getPath();\n }", "public function getFileAToView()\n {\n // when displaying uploaded doc/image in the view.\n return '/../'.$this->getUploadDir().'/'.$this->pathA;\n }", "public function getViewFile()\n {\n if ($this->isPhpBlock()) {\n return $this->getFolder() . '/view.php';\n }\n return $this->getFolder() . '/view.html';\n }", "public function getFile($view) \n {\n return \"{$this->sourcePath}/{$this->files[$view]}\"; \n }", "protected function _view_path( $file ) {\n\t\tstatic $Path = null;\n\n\t\tif ( null === $Path ) {\n\t\t\t$basedir = dirname( dirname( __FILE__ ) ) . '/';\n\t\t\t$Path = $basedir . 'view/';\n\t\t}\n\n\t\treturn $Path . $file;\n\t}", "public function getViewPath()\n {\n $class = new ReflectionClass($this);\n return dirname($class->getFileName()) . DIRECTORY_SEPARATOR . 'views';\n }", "public function getViewPath(): string;", "public static function getTestViewFilePath() {\n\t\t$filePath = self::getTestFilePath().DIRECTORY_SEPARATOR.'views';\n\t\treturn $filePath;\n\t}", "public function getViewPath()\n {\n return dirname(__DIR__);\n }", "private function getViewPath() {\n if ($this->module) {\n return MODULE_PATH . $this->module . '/view/';\n } else {\n return PROTECTED_PATH . 'view/';\n }\n }", "function path($fileName) {\n if ($fileName[0] == '/') { return $fileName; } // if specified complete path\n $file_path = $this->module_path.'view/'.$fileName;\n $layout = Liber::conf('LAYOUT');\n if ( !empty($layout) ) {\n $context = empty($this->module)?'':$this->module.'/';\n if ( $layout[0] == '/' ) { // complete path to layout dir\n $file_path = $layout.$context.'view/'.$fileName;\n } else { // default app layout dir\n $file_path = Liber::conf('APP_PATH').'layout/'.$layout.'/'.$context.'view/'.$fileName;\n }\n\n if ( !file_exists($file_path) ) { // return original template file\n $file_path = $this->module_path.'view/'.$fileName;\n }\n }\n return $file_path;\n }", "public function path(): string\n {\n return 'files/' . $this->model->filename();\n }", "public function file() {\n return resource_path('views/' . $this->crud->getPluralsKebabSlash() . \"/show.blade.php\");\n }", "private function __fileContent()\n {\n return VIEWS . DS . $this->__paths['controller'] . DS . $this->__paths['action'] . '.php';\n }", "protected function filename(): string\n {\n return resource_path(\n 'views/' . $this->table->name() . '/show.blade.php'\n );\n }", "public function path()\n {\n if (in_array($this->object->extension(), ['html', 'twig', 'md'])) {\n return $this->object->getViewPath();\n } else {\n return $this->object->getAssetPath();\n }\n }", "public function getViewPath()\n {\n if ($this->_viewPath === null) {\n $this->_viewPath = realpath($this->getBasePath() . DIRECTORY_SEPARATOR . 'views');\n }\n return $this->_viewPath;\n }", "public function getFile3ToView()\n {\n // when displaying uploaded doc/image in the view.\n return '/../'.$this->getUploadDir().'/'.$this->path3;\n }", "public function getViewPath()\n {\n return Kerisy::$app->viewPath . strtolower($this->route->getPrefix());\n }", "public function getViewPath()\n {\n return $this->viewPath;\n }", "public function getViewPath()\n {\n return $this->viewPath;\n }", "public function dirPath()\n {\n return config('maxolex.config.views').'/'.$this->parser->singular();\n }", "private function getFilePath() {\n\t\treturn $this->options['path'].'/'.md5($this->options['revision']).'/'.$this->path;\n\t}", "public function getFilepath() {\n\t\treturn RuntimeDirectoryManager::getDocumentRoot().$this->filename;\n\t}", "protected function viewsPath()\n {\n return base_path('nova-components/views/' . $this->resourceName());\n }", "public function getFile2ToView()\n {\n // when displaying uploaded doc/image in the view.\n return '/../'.$this->getUploadDir().'/'.$this->path2;\n }", "protected function generateViewFile()\n {\n $sViewFile = $this->viewFile($this->sCliName);\n\n //if the view file is not empty and not the current running file\n if (!empty($sViewFile) && $sViewFile !== $this->sCliName)\n {\n //then return it as is...\n $this->sViewName = $this->sCliName;\n return $sViewFile;\n }\n\n //attempt to use the mode for the view\n $sViewFile = $this->viewFile($this->sMode);\n\n if (!empty($sViewFile))\n {\n $this->sViewName = $this->sMode;\n return $sViewFile;\n }\n\n return $this->viewFile('default');\n }", "protected function path($view)\n\t{\n\t\treturn $this->path.str_replace('.', '/', $view).EXT;\n\t}", "public static function getFile(){\n\t\t$file_name = base_path().\"/resources/views/DURC/durc_html.mustache\";\n\t\treturn($file_name);\n\t}", "public function getViewPath()\n {\n if ($this->viewPath !== null) {\n return Yii::getAlias($this->viewPath);\n }\n\n $class = new \\ReflectionClass($this);\n return dirname($class->getFileName()) . DIRECTORY_SEPARATOR . 'views';\n }", "public static function getFilePath(): string\n {\n return static::getInstance()->getFilePath();\n }", "protected function getViewTemplatePath($view = 'view')\n {\n return __DIR__.\"/../Generators/templates/scaffold/views/{$view}.txt\";\n }", "public function get_preview_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_preview_name();\n\t}", "protected function setViewFile() {\n\t\treturn dirname( __FILE__ ) . '/view/footer.php';\n\t}", "public function getFilepath();", "public function getViewPath()\n {\n return __DIR__ . '/../Views/';\n }", "function getViewPath() {\r\n $view_value = $this->getView();\r\n if(is_array($view_value)) {\r\n $controller_name = array_var($view_value, 0, $this->engine->getDefaultControllerName());\r\n $view_name = array_var($view_value, 1, $this->engine->getDefaultActionName());\r\n } else {\r\n $controller_name = $this->getControllerName();\r\n $view_name = trim($view_value) == '' ? $this->getAction() : $view_value;\r\n } // if\r\n \r\n return $this->engine->getViewPath($view_name, $controller_name);\r\n }", "protected function getViewPath()\n {\n $name = str_replace('\\\\', '/', $this->argument('name'));\n\n return collect(explode('/', $name))\n ->map(function ($part) {\n return Str::camel($part);\n })\n ->implode('/');\n }", "public function findViewFile($view)\n\t{\n\t\treturn Yii::getAlias('@yii/apidoc/templates/html/views/' . $view);\n\t}", "private static function viewPath($path)\n {\n $instance =& get_instance();\n\n if ($path[0] === '/') {\n // A Views \"Root\" path is wanted.\n $viewPath = APPPATH.\"Views\";\n }\n else {\n $viewPath = $instance->viewsPath();\n }\n\n return realpath($viewPath.$path.'.php');\n }", "public function getFullPath();", "public function path() {\n return $this->filepath();\n }", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFullFilePath()\n {\n return $this->basePath . $this->mediaFile->getFileName();\n }", "protected function get_file() {\n\n\t\treturn __FILE__;\n\t}", "protected function relativeViewsPath()\n {\n return 'nova-components/views/' . $this->viewsName();\n }", "public function getFullPath(): string;", "public function showPath()\n {\n return config('maxolex.config.views').'/'.$this->parser->singular().'/'.'show.blade.php';\n }", "public function fullPath(){\n if ( strpos( $this->template, DIRECTORY_SEPARATOR ) === 0 ) {\n return $this->template . '.php';\n } else {\n return $this->path . DIRECTORY_SEPARATOR . $this->template . '.php';\n }\n }", "public function get_file() {\n\t\treturn __FILE__;\n\t}", "public function getFullPath()\n {\n $assetstore = $this->get('assetstore');\n\n return $assetstore->getPath().'/'.$this->getPath();\n }", "public function path(): string\n {\n return realpath($this->file);\n }", "public function view_file() {\n\t\t$currentPath = implode('/', $this->passedArgs);\n\t\t$fullPath = $this->path . $currentPath;\n\t\t$previousPath = implode('/', array_slice($this->passedArgs, 0, count($this->passedArgs) -1));\n\t\t$upOneFolder = implode('/', array_slice($this->passedArgs, 0, count($this->passedArgs) -2));\n\n\t\tif (!file_exists($fullPath)) {\n\t\t\t$this->_notFound(__('No file exists with that name', true));\n\t\t}\n\t\ttry {\n\t\t\t$docs = $this->ApiFile->loadFile($fullPath);\n\t\t} catch(Exception $e) {\n\t\t\t$this->_notFound($e->getMessage());\n\t\t}\n\t\t$classIndex = ClassRegistry::init('ApiGenerator.ApiClass')->getClassIndex();\n\t\tlist($dirs, $files) = $this->ApiFile->read($this->path . $previousPath);\n\n\t\tif (!empty($docs)) {\n\t\t\t$this->set('showSidebar', true);\n\t\t\t$this->set('sidebarElement', 'sidebar/file_sidebar');\n\t\t\t$this->set(compact('currentPath', 'previousPath', 'upOneFolder', 'docs', 'dirs', 'files', 'classIndex'));\n\t\t} else {\n\t\t\t$this->set('previousPath', $previousPath);\n\t\t\t$this->render('no_class');\n\t\t}\n\t}", "abstract public function getViewFile($viewName);", "public function viewPath($path = '')\n\t{\n\t\treturn $this['path.view'].ltrim($path, '/');\n\t}", "public function getViewScriptPath()\n {\n return realpath($this->getViewPath() . DIRECTORY_SEPARATOR . 'scripts');\n }", "public function getFullpath()\n\t{\n\t\treturn $this->filesystem->getAdapter()->root . $this->path;\n\t}", "public function getFullPath(): string\n {\n return $this->getRoot() . $this->getPathExt();\n }", "private function _get_view_path()\n\t{\n\t\t//return $this->_ci->load->_ci_view_paths;\n\t\treturn APPPATH.'views/';\n\t}", "function getTentativeDisplayFile()\n {\n $ret = '';\n $ret = $_SESSION['currentDirPath'] . $_SESSION['currentDisplay'];\n\n return($ret);\n }", "public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}", "public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}", "public function getViewFile($controller,$viewName)\n\t{\n\t\t$moduleViewPath=$this->getViewPath();\n\t\tif(($module=$controller->getModule())!==null)\n\t\t\t$moduleViewPath.='/'.$module->getId();\n\t\treturn $controller->resolveViewFile($viewName,$this->getViewPath().'/'.$controller->getUniqueId(),$this->getViewPath(),$moduleViewPath);\n\t}", "public function editPath()\n {\n return config('maxolex.config.views').'/'.$this->parser->singular().'/'.'edit.blade.php';\n }", "public function getFilepath() {\n\t\treturn $this->directory.$this->fileprefix.'-'.$this->filename.'.'.static::EXTENSION;\n\t}", "protected function getViewFile($filename, $extension = 'php') {\n return $_SERVER['DOCUMENT_ROOT'] . '/view/' . $filename . '.' . $extension;\n }", "public function getFullPath()\n {\n return sfAssetsLibraryTools::getMediaDir(true) . $this->getRelativePath();\n }", "protected function getViewFile($mode)\n {\n $viewFile = $this->getViewPath() . '/' . $this->viewName . '.php';\n $alternativeViewFile = \"\";\n\n // Lookup alternative view file based on view mode\n if ($mode == self::OUTPUT_MAIL) {\n $alternativeViewFile = $this->getViewPath() . '/mail/' . $this->viewName . '.php';\n } elseif ($mode === self::OUTPUT_MAIL_PLAINTEXT) {\n $alternativeViewFile = $this->getViewPath() . '/mail/plaintext/' . $this->viewName . '.php';\n }\n\n if ($alternativeViewFile != \"\" && file_exists($alternativeViewFile)) {\n $viewFile = $alternativeViewFile;\n }\n\n return $viewFile;\n }", "public static function getDefaultViewPath(): string\n {\n return Path::packageCurrent(['resources/views']);\n }", "public function filePath() {\n return $this->baseDir() . '/' . $this->fileName();\n }", "public function getFilepath()\n {\n return $this->filepath;\n }", "public function getPathToFile(): string;", "public function getFilePath()\n {\n return $this->file_path;\n }", "public function getPath(){\n $ext = $this->getExt();\n $filename = $this->id.'.'.$ext;\n return str_replace( $filename, '', $this->filename ); \n }", "public function getFile_path() {\n return $this->_file_path ? $this->_file_path : null;\n }", "public function path(): string\n {\n return components_path($this->name);\n }", "public function getPath() {\n return FILES_LOCATION . DS . $this->getType() . DS . $this->getId();\n }", "public function getFilePath(): string;", "public function getFilePath(): string;", "public function getPath(){\n\t \treturn $this->dirname.'/'.$this->filename.'.'.$this->extension;\n\t }", "public function getViewFile($viewName)\n { // Try the template specific path first\n $path = APPLICATION_PATH.$this->_paths['pkg_template'].'/html/'.$viewName.'.php';\n if( file_exists($path) ) return $path;\n // Next try the domain common path\n $path = APPLICATION_PATH.$this->_paths['pkg_common'].'/html/'.$viewName.'.php';\n if( file_exists($path) ) return $path;\n // Finally, try the app common path\n $path = APPLICATION_PATH.$this->_paths['app_common'].'/html/'.$viewName.'.php';\n if( file_exists($path) ) return $path;\n // If none of these files were found, return false to indicate failure\n return false;\n }", "public function getFullViewPath($view)\n {\n\t $viewPaths = ControllerHelper::getViewPaths($this);\n\n\t foreach ($viewPaths as $path) {\n\t\t $path = \\Yii::getAlias($path);\n\t\t $viewPath = $path . DIRECTORY_SEPARATOR . $view . '.' . $this->view->defaultExtension;\n\n\t\t if (file_exists($viewPath)) {\n\t return $viewPath;\n\t }\n\t }\n\n\t return false;\n }", "protected function getPath()\n\t{\n\t\t$path = $this->provider->getPath().'/View';\n\t\t$old_path = $this->provider->getPath().'/views';\n\n\t\tforeach (array($path, $old_path) as $path)\n\t\t{\n\t\t\tif (file_exists($path.'/'.$this->path.'.php'))\n\t\t\t{\n\t\t\t\treturn $path.'/'.$this->path.'.php';\n\t\t\t}\n\t\t}\n\n\t\tthrow new \\Exception('View file not found: '.htmlentities($this->path));\n\t}", "public function getPath()\n {\n $controller = str_replace('\\\\', '/', $this->get('controller'));\n\n $path = (empty($controller) ? '' : $controller . '/') . $this->get('name') . '.' . $this->get('engine');\n\n return empty($this->parameters['bundle']) ? $path : '@' . $this->get('bundle') . '/resource/view/' . $path;\n }", "public function render() {\n\t\treturn sq::base().$this->getFilePath();\n\t}", "protected function _getBasePath()\n {\n if (null === $this->_actionController) {\n return './views';\n }\n\n $inflector = $this->getInflector();\n $this->_setInflectorTarget($this->getViewBasePathSpec());\n\n $dispatcher = $this->getFrontController()->getDispatcher();\n $request = $this->getRequest();\n\n $parts = [\n 'module' => (($moduleName = $request->getModuleName()) != '') ? $dispatcher->formatModuleName($moduleName) : $moduleName,\n 'controller' => $request->getControllerName(),\n 'action' => $dispatcher->formatActionName($request->getActionName())\n ];\n\n return $inflector->filter($parts);\n }", "public function getFilePath(): string\n {\n return $this->targetDir . '/' . $this->getFileName();\n }", "public function getFullPath(): string\n {\n $store = $this->getStore();\n return $store ? $store->getBaseMediaDir() . '/' . $this->getPath() : '';\n }", "public function getFilepath()\n {\n $filepath = $this->_path['dirname'].DIRECTORY_SEPARATOR.$this->_path['filename'];\n\n if ($this->_path['extension'])\n $filepath .= '.'.$this->_path['extension'];\n\n return $filepath;\n }", "protected function getTemplatePath(): string\n {\n return str_replace(\n $this->app->basePath() . DIRECTORY_SEPARATOR,\n '',\n $this->app['config']['view.path']\n );\n }", "public function viewPath($path = ''): string\n {\n $viewPath = $this['config']->get('view.paths')[0];\n\n return rtrim($viewPath, DIRECTORY_SEPARATOR).($path != '' ? DIRECTORY_SEPARATOR.$path : '');\n }", "public function getViewDir()\n {\n return $this->templateDir;\n }", "function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;" ]
[ "0.8425179", "0.8383683", "0.8176037", "0.8081522", "0.786931", "0.76978546", "0.76382154", "0.7618348", "0.7593391", "0.7589422", "0.75872153", "0.7517131", "0.74539995", "0.74276906", "0.73764247", "0.73415333", "0.7256058", "0.7249052", "0.72333854", "0.7216916", "0.71898514", "0.71847767", "0.71847767", "0.71716154", "0.71668565", "0.715792", "0.7122886", "0.71204096", "0.70681894", "0.7062608", "0.70525247", "0.7044298", "0.7015275", "0.7013289", "0.6985437", "0.69776434", "0.69751865", "0.69703096", "0.69702876", "0.6968136", "0.6946333", "0.6925638", "0.692341", "0.69224024", "0.69184846", "0.69184846", "0.69184846", "0.69184846", "0.69176835", "0.6915121", "0.69129646", "0.6892623", "0.68812925", "0.6876689", "0.6873023", "0.6860741", "0.6858239", "0.6857594", "0.6828248", "0.68092084", "0.6791307", "0.67896336", "0.67734826", "0.6755249", "0.67489004", "0.67454034", "0.67454034", "0.6727523", "0.6706077", "0.67037237", "0.67001206", "0.6692188", "0.668664", "0.6682741", "0.6678961", "0.66774726", "0.6656389", "0.66553825", "0.6643716", "0.66415274", "0.66365534", "0.66270554", "0.66256666", "0.66256666", "0.6611901", "0.65940577", "0.65887713", "0.658208", "0.6581149", "0.6580156", "0.65775985", "0.6572542", "0.65718704", "0.65711063", "0.6570145", "0.6561521", "0.656136", "0.65565854", "0.6556153", "0.6556153" ]
0.6578787
90
Used to render view
public function render() { $data = $this->data; ob_start(); include $this->path; $content = ob_get_clean(); return $content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function renderView();", "protected function render(){\n //render view\n \n }", "protected function render() {}", "protected function render() {}", "protected function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "protected function _render()\n {\n }", "private function _doRender(){\n\t\tinclude $this->_viewLocation;\n\t}", "protected function render()\n {\n }", "protected function render()\n {\n }", "protected function render()\n {\n }", "protected function render()\n {\n }", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render() {\r\n\t\t\r\n\t}", "public function render()\n {\n \n }", "public function render()\n {\n //\n }", "public function renderView()\n {\n //$_SESSION[\"info\"] zobrazuje vysledek operaci, paklize se nejake udaly\n if((isset($_SESSION[\"info\"])) && (!empty($_SESSION[\"info\"]))){\n $this->view_data[\"info\"] = $_SESSION[\"info\"];\n $_SESSION[\"info\"] = null;\n } \n\n //generuje csrf token pro formulare\n if (!isset($_SESSION[\"csrf_token\"])) {\n $_SESSION[\"csrf_token\"] = rand(1, 1e9);\n }\n \n if ($this->view)\n {\n $this->view_data[\"view\"] = $this->view;\n extract($this->view_data);\n $main_template = (dirname(__FILE__) .'/../view/@layout.phtml');\n \n if(file_exists($main_template))\n require_once($main_template); \n }\n }", "public function render(){\n\t\t\n\t}", "public function render()\n {\n }", "public function render()\n {\n }", "public function render()\n {\n }", "public function render()\n {\n }", "private function renderView(){\n\t\trequire($this->ViewFile);\n\t}", "abstract protected function renderFirstView();", "function render() ;", "public function renderContent() {}", "public function render(){\n\n }", "public function index()\n\t{\n $this->view->render();\n\t}", "public function Render()\n {\n }", "public abstract function render();", "public abstract function render();" ]
[ "0.8684931", "0.8523749", "0.836502", "0.836502", "0.83648986", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.81356114", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8134689", "0.8115431", "0.8115431", "0.8069213", "0.7973142", "0.796401", "0.796401", "0.7963337", "0.79625684", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7919003", "0.7916216", "0.78937167", "0.7884267", "0.78586984", "0.7857973", "0.784112", "0.784112", "0.784112", "0.784112", "0.7727601", "0.76217014", "0.76040906", "0.7586068", "0.7583259", "0.7577324", "0.756183", "0.75476", "0.75476" ]
0.0
-1
The default action show the home page
public function indexAction() { try { $pageHeading = "Categories"; $this->view->page_heading = $pageHeading; $this->view->data_page = "tables"; // get all the category list.... $relName = $this->_request->getParam('rel'); $categoryService = new Base_Model_ObtorLib_App_Core_Catalog_Service_Category(); $categoryEntity = new Base_Model_ObtorLib_App_Core_Catalog_Entity_Category(); $categoryEntity->setRelName($relName); $categoryService->category = $categoryEntity; $categoryList = $categoryService->search(); $this->view->categoryList = $categoryList; $this->view->relName = $relName; } catch (Exception $ex) { throw new Exception('<ERROR>' . $ex->getMessage() . "\n"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionHome(){\n\t\t\n\t\t$this->getContent('home');\n\t\t\n\t}", "public function home()\n\t{\n\n\t\tView::show(\"home.php\", \"Accueil Mon MVC !\");\n\t}", "public function homeAction()\n {\n View::render('Pages/home.html.twig');\n }", "public function home()\n\t{\n\t\tView::show(\"home.php\", \"Accueil !\");\n\t}", "public function actionDefault(){\n \n $this->redirect('Homepage:');\n }", "public function actionIndex()\n {\n //$this->redirect(array('site/login'));\n $this->render('home', array());\n }", "public function homeAction(){\n return $this->render('HMMainBundle:Default:index.html.twig');\n }", "public function homeAction()\n {\n return $this->render('AdvertBundle:Default:index.html.twig');\n }", "public function home()\n {\n\t\tif(!$_SESSION['logged_in'])\n\t\t\tredirect('administrator');\n\t\t\n $data = array(\n 'admin' => $_SESSION['username']\n );\n $this->page('administrator/home',$data);\n }", "public function home()\n {\n $listItem = $this->Item->getAll();\n $this->set(['title' => 'Home', 'items' => $listItem]);\n $this->render('home');\n }", "public function actionKnprHome()\n { \n return $this->render('knpr/knpr-home');\n }", "public function index() {\n\t\t$this->redirect(array('action' => 'home'));\n\t}", "public function home()\n {\n $this->render('home/content');\n }", "public function index() \n\t{\n\t\t$this->_render_hod_view('home');\n\t}", "public function index() {\n\t\t$this->redirect(array('action' => 'home'));\n }", "public function home() {\n $posts = $this->postManager->getPosts();\n $view = new View(\"Home\");\n $view->generate(array('posts' => $posts));\n }", "public function home()\n\t{\n\t // show the form\n\t return $this->homeRepository->home();\n\t}", "public function index() {\n $this->home(); \n }", "public function goHome()\n {\n $this->redirect(config('default_module').'/'.config('default_controller').'/'.config('default_action'));\n }", "public function home()\n {\n $this->privateAccess(true);\n //Set content type as html page\n $this->contentType(\n 'html',\n 'Management Proof',\n [\n $this->_assets_path . 'js/Core/datatables.min.js',\n $this->_assets_path . 'js/Apps/ManagementResults/home.js'\n ], [\n $this->_assets_path . 'css/Core/datatables.min.css'\n ]\n );\n\n //add management subject view\n include 'Apps/ManagementResults/view/home.php';\n\n }", "public function actionHome()\n {\n return $this->render('home');\n}", "private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }", "public function actionMultiregionalHome() {\n return $this->render('multiregional/multiregional-home');\n }", "public function index()\n {\n $this->render('home/home');\n }", "function home(){\n\n\t\tredirect('home');\n\t}", "public function defaultAction(){\n\t\t$pseudo = \"Test\";\n\n\t\t//Affiche moi la vue home;\n\t\t$installer = new installer;\n\t\tif(!$installer->checkInstall() xor file_exists('.env.prod')){\n\t\t\theader('location: /installer');\n\t\t}else{\n\t\t$page = new Page();\n\t\t$acceuil = $page->getpageaccueil();\n\t\tif(!empty($acceuil)){\n\t\t\t$view = new View(\"page\", \"front\");\n\t\t\t$view->assign(\"page\",$acceuil[0]);\n\t\t\t$articles = $page->getArticleByIdPage($acceuil[0][\"id\"]);\n\t\t\t$view->assign('articles',$articles);\n\t\t\t$view->assign(\"title\",$acceuil[0]['slug']);\n\t\t}\n\t\telse{\n\t\t\t$view = new View();\n\t\t\t$view->assign(\"title\",\"Votre site\");\n\t\t}\n\t\t\n\t}\n\n\t\t//envoyer le pseudo à la vue\n\t}", "public function actionHome()\n\t{\n $this->setMetaTag();\n \n $user_id = Yii::$app->user->getId();\n $issue = isset($_GET['issue']) ? $_GET['issue'] : null;\n $service = $this->serviceFactory->getService(ServiceFactory::SITE_SERVICE);\n $home = $service->getHomeInfo($user_id, $issue, new SiteVoBuilder());\n $create_thread_form = new CreateThreadForm();\n $selected = $home->getHomeSelected();\n return $this->render('home', ['home' => $home,\n 'feed_selected' => $selected,\n 'change_email_form' => new ResendChangeEmailForm(),\n 'create_thread_form' => $create_thread_form]);\n\t}", "public function homePage()\n {\n return $this->render(\"homePage.html.twig\");\n }", "public function route_home() {\n\t\techo '<h1>It wurks!</h1>';\n\t}", "public function index() \n\t{\n\t\tredirect('home');\n\t}", "public function Home()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'home');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | Home')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/homepage');\n }", "public function home()\n {\n global $user;\n\n // Example data to use in the home page.\n $context['user'] = $user;\n $context['allPosts'] = Post::tenMostRecent();\n $context['allComments'] = Comment::tenMostRecent();\n $context['allImages'] = Image::tenMostRecent();\n return render('views/pages/home.php', $context);\n }", "public function home()\n {\n $params = [\n 'name' => 'xEiBi'\n ];\n\n return $this->render('home', $params);\n }", "public function home()\r\n {\r\n\r\n $view = new Template();\r\n echo $view->render('views/home.html');\r\n }", "public function home()\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$data['username']\t\t\t= $this->session->userdata('username');\n\t\t\t\t$this->load->view('admin/home', $data);\n\t\t\t}", "private function home() {\n // busca as categorias do bd\n $categorias = $this->model->visualizarCategorias();\n // seta as categorias para a view\n $this->view->setCategorias($categorias);\n // passa o arquivo home\n $file = $this->templates . 'home.php';\n \n // retorna o conteudo da tela home para o usuario\n $this->telaUser = $this->view->retornaTela($file);\n }", "public function home($data){\r\n if(!$this->isLogged()){\r\n header(\"Location:\".url(\"admin/login\"));\r\n }\r\n echo $this->view->render(\"home.php\",[\r\n \"title\"=> \"Admin Home | \". SITE,\r\n ]);\r\n }", "public function index() {\n\n\t\t$data['content'] = 'Homepage';\n\t\t$this->flexi->title('Homepage')\n\t\t\t\t\t->make('home', $data);\n\n\t}", "public function home()\n {\n session_start();\n $posts = new PostManager;\n $resultat = $posts->getPosts(4);\n echo $this->getRender()->render('homeView.twig', [\n 'resultat' => $resultat,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function goHome()\n {\n $this->redirect(url($this->getHomeUrl()));\n }", "public function homeAction()\n {\n return $this->redirect($this->generateUrl('system_tracking_homepage'), 301);\n }", "public function home()\n\t{\n\t\treturn view('pages.home');\n\t}", "function home()\n\t{\n\t\t$data['active_page'] = 'home';\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_home_top_bg');\n\t\t$this->load->view('frontend/pages/boss/home');\n\t\t$this->load->view('frontend/templates/footer', $data);\n\n\t}", "public function index()\r\n {\r\n View::render('home');\r\n }", "public function index()\n {\n if (session()->get('logged_in')) {\n \techo render(HOME_PAGE, ['title' => 'Accueil']);\n }\n // Otherwise, the login page is displayed\n else $this->login();\n }", "public function index()\n {\n// $pageData = $this->_pageService->getPage(PageConstant::HOME_PAGE);\n return $this->renderView($this->getView('home.welcome'), [], 'Home');\n }", "public function homePage()\n {\n return cq()->homePage();\n }", "public function home()\n\t{\n\t\t$this->load->view('homepage_view');\n\t}", "public function home()\n\t{\n\t\t$this->sidebar_template = 'news';\n\t\t$this->news = R::dispense('news', 5);\n\t\t$this->render();\n\t}", "public function index() {\n\t\t$this->title = 'Home';\n\t\t$this->pageData['pages'] = Page::getAll();\n\t\t$this->render('index');\n\t}", "public function home()\n\t{\n\t\t$header = $this->loaded_module(0);\n\t\t$footer = $this->loaded_module(1);\n\t\t\n\t\t$data = $this->settings();\n\t\t\n\t\t$product = $this->loaded_module(7);\n\t\t$data[\"product_special\"] = $product->special_product_list(8);\n\t\t$data[\"latest_product\"] = $product->latest_product_list(6);\n\t\t$data[\"latest_product2\"] = $product->latest_product_list(6);\n\t\t$data[\"latest_product3\"] = $product->latest_product_list(6);\n\t\t\n\t\t$banner = $this->loaded_module_admin(7)->get_active_banner();\n\t\t$data[\"banner\"] = $banner;\n\t\t\n\t\t$header->header_view();\n\t\t$this->load->view(\"Home_v\", $data);\n\t\t$footer->footer_view();\n\t}", "public function home()\n {\n $lastUpdates = ArticleManager::findLastUpdates();\n\n $this->renderView('home.twig',\n [\n 'articleList' => $this->articleList,\n 'lastUpdates' => $lastUpdates, \n ]\n );\n }", "function home(){\n if(!is_null(Session::get('id_usuario'))){\n header(\"Location: \".URL.\"tarea\");\n\n }\n $this->view->show();\n }", "public function index()\n\t{\n\t\tif (ENVIRONMENT=='development')\n\t\t\t$this->render('home');\n\t\telse\n\t\t\tredirect();\n\t}", "public function index()\n\t{\n\t\tif (ENVIRONMENT=='development')\n\t\t\t$this->render('home');\n\t\telse\n\t\t\tredirect();\n\t}", "public function actionProvHome()\n {\n return $this->render('prov/prov-home');\n }", "public function home()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n if (!isset ($_GET['id'])) {\n show_view('views/pages/home.php', [\n 'posts' => Posts::readAll(),\n 'bodyParts' => BodyPart::all(),\n 'difficulty' => Difficulty::all(),\n ]);\n } else {\n show_view('views/pages/home.php', [\n 'posts' => Posts::findByBodyPart($_GET['id']),\n 'bodyParts' => BodyPart::all(),\n 'difficulty' => Difficulty::all(),\n ]);\n }\n }\n }", "function Home()\n {\n $this->requestSessionInfo();\n\n // muestra solo 2\n $recent_artworks = $this->modelArtwork->GetFrontArtworks(2);\n $this->view->ShowHome($recent_artworks);\n }", "public function home()\n\t{\n\t\t$page = 'home';\n\t\treturn view('dashboard.home', compact('page'));\n\t}", "public function home()\n\t{\n\t\t//Se valida la existencia de los datos del usuario que inicio sesion dentro de la session\n\t\tif($this->session->userdata('id_usuario_prueba') != null){\n\t\t\t$data = [\n\t\t\t\t\"page\" => \"Home\"\n\t\t\t];\n\t\t\t$this->load->view('layout/layout_open');\n\t\t\t$this->load->view('layout/layout_menu', $data);\n\t\t\t$this->load->view('home');\n\t\t\t$this->load->view('layout/layout_close');\n\t\t}else{\n\t\t\theader(\"Location:\" . base_url());\n\t\t}\n\t}", "protected function goHomePage()\n {\n $this->_redirect($this->homeURL);\n }", "public function home()\n\t{\n\t\t$this->load->view('index_view');\n\t}", "public function home()\n {\n return view(\"home\");\n }", "public function home()\n {\n return view('core::home.index');\n }", "public function index()\n\t{\n// $page = Page::whereTitle('home')->first();\n// if(! $page){\n// $page=nulls;\n// }\n\n\t\treturn view('admin.home.index');\n\n\n\t}", "public function index() {\n\n\t\tif(!empty($_GET['page'])) {\n\t\t\tif($_GET['page'] == 'home') {\n\t\t\t\t(new HomeController)->home();\n\t\t\t} elseif($_GET['page'] == 'about-me') {\n\t\t\t\t(new HomeController)->aboutMe();\n\t\t\t}\n\t\t} else {\n\t\t\t(new HomeController)->home();\n\t\t}\n\t}", "public function showHome()\n {\n //user authentication\n $user = UserAccountController::getCurrentUser();\n if ($user === null) {\n return;\n }\n $view = new View(\"userHome\");\n $view->addData(\"userName\", $user->getNickName());\n echo $view->render();\n }", "public function indexAction() {\n $this->view->render('home/index'); //path from the view folder\n //we already have view because it's set up in the parent, render is from view\n }", "public function home()\n {\n $slug = $this->getHomeSlug();\n\n if ( ! $slug) {\n return abort(404, \"No wiki home page defined\");\n }\n\n return redirect()->to(cms_route('wiki.page', [ $slug ]));\n }", "public function home()\n {\n return view('home'); //Le paso la vista principal\n }", "public function home()\n\t{\n\t\treturn view('e_shop.landing');\n\t}", "public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome';\r\n\t\t$this->template->content = View::factory('index');\r\n\t}", "public function home () {\n\t\t//deteccion\n\t\tif(Agent::isMobile()){\n\t\t\treturn View::make(\"movil.home\");\n\t\t} else {\n\t\t\treturn View::make(\"desktop.pre\");\n\t\t}\n\t}", "public function userHome() {\n\n $this->page->getPage('userhome.tpl');\n }", "public function home()\n\t{\n\t\t$data = $this->Service->get_latest_blogs();\n\n\t\t// Get the only one latest blog among all the categories.\n\t\t$data['latest_blog'] = $this->Blogs_model->get_latest_blog();\n\n\t\t// load the view\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('blogs/home', $data);\n\t\t$this->load->view('templates/footer');\n\t}", "public function actionIndex() {\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n //$this->layout = 'layout';\n $this->pageTitle=\"KushGhar-Home\";\n $this->render('index');\n }", "public function home(){\n $itemsHome = $this->itemsModel->listenerItems(); // Recupération des items de ma bdd ( par default les 8 permier items)\n include(\"home.php\"); // Chargement de la view (page home.php)\n }", "public function index()\n\t{\n\t\t$this->load->view('home');\n\t}", "public function home()\r\n\t{\r\n\t\tif( $this->is_logged_in() )\r\n\t\t{\r\n\t\t\treturn redirect('dashboard','refresh');\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\t return redirect('login','refresh');\r\n\t\t}\r\n\t}", "public function index()\n\t{\n\t\t$data['logo'] = \"/img/ilih.png\";\n\t\t$data['users'] = $this->User->getAll();\n\n\t\t$this->parser->parse('home', $data);\n\t}", "public function home()\n\t{\n\t\treturn View::make('newhome');\n\t}", "public static function index()\n {\n self::create_view(\"home.view\", [\n \"user\" => Session::retrieve_object(\"user\")\n ]);\n\n exit;\n }", "public function home()\n\t{\n\t\t\n\t\t$data = $this->data;\n\t\t$this->load->view('admin/index.php',$data);\n\t}", "public function index() {\n\t\t\t$this->render('home.twig.html', ['flash' => $this->session->getFlash(), 'token' => $this->session->getToken()]);\n\t\t}", "public function showHome()\n {\n if(!isset($_GET['people']))\n {\n $arr=$this->model->getList();\n include 'view_home.php';\n } else\n {\n $val = $this->model->getPerson($_GET['people']);\n include 'view2.php';\n }\n }", "public function index()\n\t{\n\t\t$this->load->view('home/home');\n\t}", "public function index()\n {\n return view('web.defaults.home');\n }", "public function homePageAction(Application $app){\n \n $spectacles = $app['dao.spectacle']->LastNineArticles();\n $archives= $app['dao.spectacle']->ArchiveShow();\n $presses = $app['dao.press']->findAll();\n return $app['twig']->render('index.html.twig', array('spectacles'=>$spectacles,\n 'archives'=>$archives,\n 'presses'=>$presses));\n }", "public function home() {\n\t\treturn View::make('home', array('pageTitle' => 'Home'));\n\t}", "public function index()\n {\n return View(\"pages.home\");\n }", "public function actionIndex() \n\t{\n\t\t$metaTitle = 'Homepage';\n\t\t\n\t\t$categories = array();\n\t\t$categories = Category::getCategoriesList();\n\t\t\n\t\t$latestProducts = array();\n\t\t$latestProducts = Product::getLatestProducts(4);\n\t\t\n\t\t// products for slider of recommended\n\t\t$sliderProducts = array();\n\t\t$sliderProducts = Product::getRecommendedProducts();\n\t\t\n\t\trequire_once(ROOT.'/views/site/index.php');\n\t\t\n\t\treturn true;\n\t}", "public function homePage()\n\t{\n $data[\"base_url\"] = $this->config->item(\"base_url\");\n $data['header'] = $this->load->view('user/header', $data, TRUE);\n\t\t$data['footer'] = $this->load->view('user/footer', $data, TRUE);\n\t\t$this->load->view('user/home',$data,true);\n }", "public function homepage()\n {\n return view('statics.home');\n }", "public function showHome()\n {\n return view('content.index.index.home');\n }", "public function index()\n\t{\n\t\treturn view('pages/home');\n\t}", "public function home()\n {\n return view('page.home');\n }", "public function home()\n {\n return view('admin.home');\n }", "public function index()\n\t{\n\t\tif ( $this->auth->check() )\n\t\t{\t\t\n\t\t\t// MUESTRA LA PAGINA\n\t\t\t$this->show_page();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect ( $this->_base_url );\n\t\t}\n\t}", "public function home() {\n return view('admin.home');\n }", "public function getHome()\n\t{\n\t\tif(Session::get('admin') == 'admin')\n\t\t\treturn Redirect::route('admin-home-get');\n\t\t\n\t\tif(Session::get('member') == 'member')\n\t\t\treturn Redirect::route('member-home-get');\n\n\t\tif(Session::get('employee') == 'employee')\n\t\t\treturn Redirect::route('employee-home-get');\n\n\t\treturn View::make('errors/404');\n\t}", "public function home()\n\t{\n\t\tSession::put('lang','EN');\n\t\treturn $this->homeblade();\n\t}" ]
[ "0.87153625", "0.8310088", "0.82810503", "0.8278076", "0.8214171", "0.81164247", "0.80845374", "0.8044981", "0.80166644", "0.8002096", "0.7999078", "0.79849523", "0.79761887", "0.795694", "0.79460955", "0.7902253", "0.7888324", "0.788606", "0.7880821", "0.7861734", "0.7838802", "0.7838412", "0.78327864", "0.7826531", "0.7816538", "0.7779734", "0.7769118", "0.77506584", "0.77426744", "0.7737106", "0.7725228", "0.77189624", "0.7703055", "0.7694349", "0.7686936", "0.7667964", "0.7663247", "0.76619303", "0.76535124", "0.7640195", "0.7637233", "0.76297516", "0.7624652", "0.76221615", "0.76194006", "0.7612479", "0.7588557", "0.75729644", "0.7565794", "0.75597113", "0.7553198", "0.75471556", "0.75423056", "0.75377196", "0.75377196", "0.75364745", "0.75325185", "0.7531952", "0.75315803", "0.75257677", "0.7525042", "0.750439", "0.74993926", "0.7496873", "0.7479717", "0.74702317", "0.74631333", "0.7445817", "0.7433147", "0.7414255", "0.74088806", "0.7404012", "0.74007213", "0.73968834", "0.73915917", "0.7391174", "0.73776376", "0.737426", "0.7364511", "0.7354475", "0.73542154", "0.7347136", "0.73423463", "0.73422736", "0.73305213", "0.7312517", "0.7306927", "0.730441", "0.7297422", "0.7294075", "0.7289855", "0.7287005", "0.7283341", "0.72723496", "0.7264403", "0.7262247", "0.72569174", "0.7256079", "0.7255837", "0.72454935", "0.7241475" ]
0.0
-1
Lists all Upload entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $entities = $em->getRepository('MHProductsBundle:Upload')->findAll(); return $this->render('MHProductsBundle:Upload:index.html.twig', array( 'entities' => $entities, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllUploads() {\n return Upload::all();\n }", "public function getFiles()\n {\n return R::findAll('upload');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $files = $em->getRepository('TikaBundle:UpFile')->findAllOrdered();\n\n return array(\n 'files' => $files,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('HypoTestBundle:File')->findAll();\n\n return array('entities' => $entities);\n }", "public function index()\n {\n return ImageEntity::all();\n }", "public function uploaded_files()\n {\n\t\tif(Module::hasAccess(\"Uploads\", \"view\")) {\n\t\t\t$uploads = array();\n\t\n\t\t\t// print_r(Auth::user()->roles);\n\t\t\tif(Entrust::hasRole('SUPER_ADMIN')) {\n\t\t\t\t$uploads = Upload::all();\n\t\t\t} else {\n\t\t\t\tif(config('laraadmin.uploads.private_uploads')) {\n\t\t\t\t\t// Upload::where('user_id', 0)->first();\n\t\t\t\t\t$uploads = Auth::user()->uploads;\n\t\t\t\t} else {\n\t\t\t\t\t$uploads = Upload::all();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$uploads2 = array();\n\t\t\tforeach ($uploads as $upload) {\n\t\t\t\t$u = (object) array();\n\t\t\t\t$u->id = $upload->id;\n\t\t\t\t$u->name = $upload->name;\n\t\t\t\t$u->extension = $upload->extension;\n\t\t\t\t$u->public = $upload->public;\n\t\t\t\t\n\t\t\t\t$u->user = $upload->user->name;\n\t\t\t\t$u->url = $upload->url;\n\t\t\t\t$u->thumbnails = $upload->thumbnails;\n\t\t\t\t$u->path = $upload->path;\n\t\t\t\t$u->type = $upload->type;\n\n\t\t\t\t$uploads2[] = $u;\n\t\t\t}\n\t\t\treturn response()->json(['uploads' => $uploads2]);\n\t\t} else {\n\t\t\treturn response()->json([\n\t\t\t\t'status' => \"failure\",\n\t\t\t\t'message' => \"Unauthorized Access\"\n\t\t\t]);\n\t\t}\n }", "public static function getAll_files() {\n $db = DBInit::getInstance();\n\n $statement = $db->prepare(\"SELECT id, file_name, uploaded, user FROM files\");\n $statement->execute();\n\n return $statement->fetchAll();\n }", "public function index(Request $request)\n {\n $upload = Upload::with(['tbluploadtypes'])->get()->sortByDesc('id');\n\t\t\n\t\treturn view('admin.upload.index', compact('upload'));\n\t}", "public function index(){\n //Load configuration\n $this->loadModel('Upload.Uploads');\n //Retrieves the last 35 logs\n $uploads = $this->Uploads->find('all', ['order' => ['created desc'], 'limit' => 35]);\n\n return $this->set(compact('uploads'));\n }", "public function list_of_fileuploads() {\n $request = $_GET;\n $result = $this->fileupload_model->load_list_of_fileuploads($request, array());\n $result = getUtfData($result);\n echo json_encode($result);\n exit;\n }", "public function uploads()\n {\n return $this->hasMany(Upload::class);\n }", "public function getAll()\n {\n return $files;\n }", "public static function upload_all(){\n $attachments = new \\CFCDN_Attachments();\n $attachments->upload_all();\n }", "public function index()\n {\n $my_tablet_id = Config::get('constants.TABLET_ID');\n $my_user_id = Config::get('constants.USER_ID');\n\n \n $my_uploads = Upload::where('tablet_users_id', '=', $my_tablet_id)->get();\n \n Log::info($my_uploads);\n \n return $my_uploads;\n }", "public function index()\n {\n $files = Upload::all();\n return view('upload', compact('files'));\n }", "public function index() {\n\t\t$this->{$this->modelClass}->recursive = 0;\n\n\t\t$this->set('attachments', $this->{$this->modelClass}->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'foreign_key' => $this->modelId,\n\t\t\t\t'group' => $this->modelClass,\n\t\t\t\t'model' => $this->model\n\t\t\t)\n\t\t)));\n\t\t$this->set('limit', $this->_getLimit());\n\t}", "public function index($page = null)\n {\n $url = sprintf('buckets/%d/vaults/%d/uploads.json', $this->bucket, $this->parent);\n\n $uploads = $this->client->get($url, [\n 'query' => [\n 'page' => $page,\n ],\n ]);\n\n return $this->response($uploads, Upload::class);\n }", "public function uploaded_files()\n {\n\t\tif(Module::hasAccess(\"Uploads\", \"view\")) {\n\t\t\t$uploads = array();\n\t\n\t\t\t// print_r(Auth::user()->roles);\n\t\t\tif(Entrust::hasRole('SUPER_ADMIN')) {\n\t\t\t\t$uploads = Upload::all();\n\t\t\t} else {\n\t\t\t\tif(config('laraadmin.uploads.private_uploads')) {\n\t\t\t\t\t// Upload::where('user_id', 0)->first();\n\t\t\t\t\t$uploads = Auth::user()->uploads;\n\t\t\t\t} else {\n\t\t\t\t\t$uploads = Upload::all();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$uploads2 = array();\n\t\t\tforeach ($uploads as $upload) {\n\t\t\t\t$u = (object) array();\n\t\t\t\t$u->id = $upload->id;\n\t\t\t\t$u->name = $upload->name;\n\t\t\t\t$u->extension = $upload->extension;\n\t\t\t\t$u->hash = $upload->hash;\n\t\t\t\t$u->public = $upload->public;\n\t\t\t\t$u->caption = $upload->caption;\n\t\t\t\t$u->user = $upload->user->name;\n\t\t\t\t\n\t\t\t\t$uploads2[] = $u;\n\t\t\t}\n\t\t\t\n\t\t\t// $folder = storage_path('/uploads');\n\t\t\t// $files = array();\n\t\t\t// if(file_exists($folder)) {\n\t\t\t// $filesArr = File::allFiles($folder);\n\t\t\t// foreach ($filesArr as $file) {\n\t\t\t// $files[] = $file->getfilename();\n\t\t\t// }\n\t\t\t// }\n\t\t\t// return response()->json(['files' => $files]);\n\t\t\treturn response()->json(['uploads' => $uploads2]);\n\t\t} else {\n\t\t\treturn response()->json([\n\t\t\t\t'status' => \"failure\",\n\t\t\t\t'message' => \"Unauthorized Access\"\n\t\t\t]);\n\t\t}\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function getUploadsData()\n {\n $em = $this->getEntityManager();\n $query = $em->createQuery('SELECT ur.userName,u.id,u.fileName,u.uniqueId,u.uploadedDate\n FROM Vlreleases\\UserBundle\\Entity\\Uploads u\n JOIN Vlreleases\\UserBundle\\Entity\\User ur\n WHERE ur.id=u.userId\n ORDER BY u.id desc');\n $result = $query->getResult();\n return $result;\n }", "public function index()\n {\n return Entity::all();\n }", "public function actionIndex()\n {\n $upload_handler = new UploadHandler();\n }", "public function listRecords( Upload $obj ){\r\n\r\n\t\t\t$response = $this->listRowsByTokenId( $obj->id_token );\r\n\t\t\treturn json_encode($response);\r\n\t\t\t\r\n\t\t}", "public function getAllEntities();", "public function index()\n {\n $images = File::all();\n return view('view-uploads')->with('images', $images);\n }", "public function index()\n {\n //\n $photos = Upload::all();\n return view('uploaded-images', compact('photos'));\n }", "public function uploads(): array;", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CrudforgeBundle:Users')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function actionIndex()\n {\n try {\n $model = new Upload();\n $info = $model->upImage();\n\n\n $info && is_array($info) ?\n exit(Json::htmlEncode($info)) :\n exit(Json::htmlEncode([\n 'code' => 1,\n 'msg' => 'error'\n ]));\n\n\n } catch (\\Exception $e) {\n exit(Json::htmlEncode([\n 'code' => 1,\n 'msg' => $e->getMessage()\n ]));\n }\n }", "public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }", "public function indexActionEntities() {\n return [];\n }", "public function index()\n {\n $table = $this->Attachments;\n $contain = [];\n $entities = $table->find()->contain($contain);\n $this->set('attachments', $entities);\n $this->set('_serialize', 'attachments');\n }", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n {\n $uploads=Auth::guard('team')->user()->uploads;\n $upload_names=UploadName::all();\n \n return view('team.uploads.index',compact('upload_names','uploads'));\n }", "public function indexAction(){\n\t\t\t$this->library->load('upload');\n\n\t\t\t//Goi den phuong thuc upload\n\t\t\t$this->library->upload->upload();\n\t\t}", "public function findAllEntities();", "public function files() {\n\t\t$files = $this->ApiFile->fileList($this->path);\n\t\t$this->set('files', $files);\n\t}", "public function getUploadedFiles() {}", "public function showEntities()\n {\n return Entity::paginate(10);\n }", "public function getAll()\n {\n try {\n $response = $this->getClient()->request('GET', $this->url . \"/files\", [\n 'headers' => [\n 'Authorization' => 'Bearer ' . $this->token,\n ],\n ]);\n } catch (\\Exception $e) {\n $response = $e;\n }\n\n return json_decode($response->getBody()->getContents());\n }", "function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('HamdiMediaBundle:GalleryImage')->findAll();\n\n return $this->render('HamdiMediaBundle:GalleryImage:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionUploads()\n {\n $model = new Imageupload;\n $model->image = UploadedFile::getInstances($model, 'image');\n if ($model->upload()) {\n return 100;\n }\n return 0;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $photos = $em->getRepository('BoAdminBundle:Photos')->findAll();\n\n return $this->render('photos/index.html.twig', array(\n 'photos' => $photos,\n ));\n }", "public function showAllAction( Request $request)\n { $em = $this->getDoctrine()->getManager();\n\n $entrepots = $em->getRepository('GererEntrepotBundle:Entrepot')->findAll();\n\n\n return $this->render('@GererEntrepot/admin/index.html.twig', array(\n 'entrepots' => $entrepots,\n ));\n\n }", "public function getFileUploads()\n {\n return $this->file_uploads;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('JetBredaBundle:Alquiler')->findAll();\n\n return array('entities' => $entities);\n }", "public function listCommand() {\n\t\t$iterator = new DirectoryIterator(UploadManager::UPLOAD_FOLDER);\n\n\t\t$counter = 0;\n\t\tforeach ($iterator as $file) {\n\t\t\tif ($file->isFile()) {\n\t\t\t\t$counter++;\n\t\t\t\t$this->outputLine($file->getFilename());\n\t\t\t}\n\t\t}\n\n\t\t$this->outputLine();\n\t\t$this->outputLine(sprintf('%s temporary file(s).', $counter));\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AdminBundle:User')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n $files = $this->files\n ->getFilesPaginated(config('core.sys.file.default_per_page'))\n ->items();\n return $this->handler\n ->apiResponse($files);\n }", "public function index()\n {\n return Photo::get();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $user = $this->getUser();\n $collection = $em->getRepository('AppPictureBundle:Collection')->findByUser($user);\n\n if(null == $collection){\n return $this->redirect($this->generateUrl('collection'));\n }else{\n $entities = $em->getRepository('AppPictureBundle:Picture')->findByCollection($collection);\n }\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n\t{\n\t\t$module = Module::get('Uploads');\n\t\t\n\t\tif(Module::hasAccess($module->id)) {\n\t\t\treturn View('la.uploads.index', [\n\t\t\t\t'show_actions' => $this->show_action,\n\t\t\t\t'listing_cols' => $this->listing_cols,\n\t\t\t\t'module' => $module\n\t\t\t]);\n\t\t} else {\n return redirect(config('laraadmin.adminRoute').\"/\");\n }\n\t}", "public function index()\n\t{\n\t\t$module = Module::get('Uploads');\n\t\t\n\t\tif(Module::hasAccess($module->id)) {\n\t\t\treturn View('la.uploads.index', [\n\t\t\t\t'show_actions' => $this->show_action,\n\t\t\t\t'listing_cols' => $this->listing_cols,\n\t\t\t\t'module' => $module\n\t\t\t]);\n\t\t} else {\n return redirect(config('laraadmin.adminRoute').\"/\");\n }\n\t}", "public function all(Request $request)\n {\n $this->validate($request, $this->rules['all']);\n\n $options = SearchOptions::fromString($request->get('query') ?? '');\n $page = intval($request->get('page', '0')) ?: 1;\n $count = min(intval($request->get('count', '0')) ?: 20, 100);\n\n $results = $this->searchRunner->searchEntities($options, 'all', $page, $count);\n $this->resultsFormatter->format($results['results']->all(), $options);\n\n /** @var Entity $result */\n foreach ($results['results'] as $result) {\n $result->setVisible([\n 'id', 'name', 'slug', 'book_id',\n 'chapter_id', 'draft', 'template',\n 'created_at', 'updated_at',\n 'tags', 'type', 'preview_html', 'url',\n ]);\n $result->setAttribute('type', $result->getType());\n $result->setAttribute('url', $result->getUrl());\n $result->setAttribute('preview_html', [\n 'name' => (string) $result->getAttribute('preview_name'),\n 'content' => (string) $result->getAttribute('preview_content'),\n ]);\n }\n\n return response()->json([\n 'data' => $results['results'],\n 'total' => $results['total'],\n ]);\n }", "public function getUploads($maxResults);", "public function actionIndex()\n {\n $searchModel = new EntityAttachmentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'model' => $this->retrieveModel(),\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionMultiple(){\n\t\t$model = new XUploadForm;\n\t\t$this->render('multiple', array(\n\t\t\t'model' => $model,\n\t\t));\n\t}", "public function index()\n {\n return Image::all();\n }", "public function all()\n {\n $dir = public_path() . '/uploads/temp/' . Session::getId() . '/';\n $data = [];\n $mimetypes = new Mimetype;\n if(file_exists($dir)) {\n foreach(scandir($dir) as $file) {\n if(in_array($file, ['.', '..'])) continue;\n $filedata = [];\n $filedata['name'] = $file;\n $filedata['url'] = url('/uploads/temp/' .Session::getId() . '/' .$file);\n $filedata['size'] = File::size($dir . $file);\n $filedata['type'] = $mimetypes->detectByFileExtension(File::extension($file));\n $data[] = $filedata;\n }\n return $data;\n }\n }", "public function getAllFiles()\n {\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $photos = $em->getRepository('AppBundle:Photo')->findAll();\n\n return $this->render('photo/index.html.twig', array(\n 'photos' => $photos,\n ));\n }", "public function index()\n {\n return view('upload.index');\n }", "public function getEntities(Request $request)\n {\n return $this->repo->getEntities($request->get('model'));\n }", "public function index()\n {\n return view('files.upload')->render();\n }", "public function list()\n {\n return $this->repo->getAll();\n ;\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppAdminBundle:FileManager')->findAll();\n if(empty($entities)) {\n if(!$this->container->getParameter('filemanager_path')) {\n $this->indexation($this->$this->get('kernel')->getRootDir() . '/../web');\n } else {\n $this->indexation($this->container->getParameter('filemanager_path'));\n }\n\n }\n\n $htmlTree = $em->getRepository('AppAdminBundle:FileManager')->childrenHierarchy(\n null, /* starting from root nodes */\n false, /* true: load all children, false: only direct */\n array(\n 'decorate' => true,\n 'representationField' => 'title',\n 'html' => true,\n 'rootOpen' => '<ul>',\n 'rootClose' => '</ul>',\n 'childOpen' => function($child) {\n return '<li id=\"'.$child['id'].'\">';\n },\n 'childClose' => '</li>'\n )\n );\n return array(\n 'htmlTree' => $htmlTree,\n );\n }", "public function getUploadedFiles()\n {\n }", "public function getAllFiles(){\n $user = auth()->user();\n $cloud = CloudFile::where('user_id', $user->id);\n $active = $cloud->where('active',true)->get();\n $trash = $cloud->where('active',true)->onlyTrashed()->get();\n\n return $this->respondWithSuccess('Files details',[\n 'active'=>$active,'trash'=>$trash]);\n }", "public static function getFiles()\n\t{\n\t\t$result = Array();\n\t\t$files = sfCore::$db->query(\"SELECT * FROM `swoosh_file_storage`\")->asObjects();\n\t\tforeach($files as $file){\n\t\t\t$sfFileStorageItem = sfCore::make('sfFileStorageItem');\n\t\t\t$sfFileStorageItem->loadFromObject($file);\n\t\t\t$result[] = $sfFileStorageItem;\n\t\t}\n\t\treturn $result;\n\t}", "public function index() {\n $this->data['title'] = \"Uploads\";\n $viewContent = $this->load->view('uploads/index', $this->data, true);\n renderWithLayout(array('content' => $viewContent), 'admin');\n }", "public function xuploadedfiles() {\n\t\t\n\t\t/* Load Model */\n\t\t$files = $this->getModel ( 'file' );\n\t\t\n\t\t/* Get all rows */\n\t\t$files->getAll ( $this->_getFormId () );\n\t\t\n\t\t/* set the view file (optional) */\n\t\t$this->setView ( 'uploadedfiles' );\n\t\t\n\t\t/* set last view into session */\n\t\t$this->session->returnto ( $this->getView () );\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('QihooToolBundle:AutoDownUrl')->getAllList();\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return view('lecturer::result.upload.index');\n }", "public function uploadFeedsAll()\n {\n $this->uploadFeeds();\n }", "public function index(){\n\t\tview('upload/index');\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SCRUMSwiftairBundle:Vluchten')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n $image = Image::all();\n return $this->showAll($image);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $users = $em->getRepository('DteBtsBundle:User')->findAll();\n\n return array(\n 'entities' => $users,\n );\n }", "public function actionList() {\n $this->_getList();\n }", "public function index()\n {\n //\n return view('upload.index');\n }", "public function index()\n {\n\n $this->types->trackFilter();\n\n return view('site::file.index', [\n 'repository' => $this->files,\n 'items' => $this->files->paginate(config('site.per_page.file', 10), ['files.*'])\n ]);\n }", "public function all()\n {\n if (!$this->isLogged()) exit;\n $this->oUtil->getModel('Todo');\n $this->oModel = new \\TestProject\\Model\\Todo;\n\n $this->oUtil->oTodos = $this->oModel->getAll();\n\n $this->oUtil->getView('index');\n }", "public function getIndex() {\n return view('upload');\n }", "public function index()\n {\n return $this->repository->all();\n }", "public function index()\n {\n return $this->repository->all();\n }", "public function fileInfo()\n {\n return R::findAll('uploaddetail');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('PrognozMagazineBundle:User')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n $data = $this->searchFiles();\n $datasources = Datasource::get(['id', 'datasource_name']);\n\n return view('uploaded_file.index', ['data' => $data, 'datasources' => $datasources]);\n\n // return view('upload.index');\n }", "public function findAll()\n {\n $results = $this->createQueryBuilder('u')\n ->getQuery();\n return $results->getResult();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AlmaBundle:TipoCamera')->findAll();\n\n return $this->render('AlmaBundle:TipoCamera:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('RocketSellerTwoPickBundle:User')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $tags_clouds = $em->getRepository('paOndebackendBundle:Tags_cloud')->findAll();\n\n return $this->render('tags_cloud/index.html.twig', array(\n 'tags_clouds' => $tags_clouds,\n ));\n }", "public function show(Upload $upload)\n {\n //\n }", "public function show(Upload $upload)\n {\n //\n }", "public function indexAction()\n {\n \n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BEEServicesBeeeaseBundle:ActionListe')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getEntities() {\n return $this->entities;\n }", "public function uploadMultiple()\n {\n\n foreach ($this->uploads['multiple'] as $field) {\n $files = [];\n\n if (is_array(Request::file($field))) {\n\n foreach (Request::file($field) as $file) {\n\n if ($file instanceof UploadedFile) {\n $files[] = Uploader::upload($file, $this->upload_folder . '/' . $field);\n }\n\n }\n\n }\n\n $this->setFileMultiple($field, $files);\n }\n\n }", "public function getAllAction()\n {\n /** @var \\AppBundle\\Repository\\PostRepository $postRepository */\n $postRepository = $this->getDoctrine()->getRepository(Post::class);\n $totalPosts = $postRepository->countTotals();\n \n if ($totalPosts == 0) {\n throw $this->createNotFoundException('No posts found');\n }\n \n $exportingForm = $this->getExportingForm();\n \n $posts = $postRepository->getAll();\n \n return $this->render('post/getall.html.twig', array(\n 'form' => $exportingForm->createView()\n , 'totals' => $totalPosts\n , 'posts' => $posts\n // TODO - Set up following param in config files\n , 'upload_dir' => basename($this->getParameter('uploaded_resources_dir'))\n ));\n }" ]
[ "0.7549063", "0.6630621", "0.64872676", "0.6406428", "0.6153479", "0.61228174", "0.60133183", "0.60095084", "0.5999258", "0.5964339", "0.5932661", "0.58934486", "0.5884072", "0.5868807", "0.5804504", "0.57970774", "0.57820106", "0.57660306", "0.57436514", "0.571109", "0.57050186", "0.56878173", "0.5678776", "0.5649401", "0.5624907", "0.5618247", "0.56075037", "0.5599678", "0.5584302", "0.5574112", "0.55402374", "0.55337936", "0.55263674", "0.55205804", "0.55195856", "0.54661083", "0.54533005", "0.54478884", "0.5439133", "0.542003", "0.5418911", "0.541506", "0.5412492", "0.54055333", "0.54049116", "0.53980285", "0.5396253", "0.5390129", "0.53889656", "0.5387383", "0.5385148", "0.5376877", "0.5368441", "0.5368441", "0.5346347", "0.53394693", "0.53151965", "0.5309109", "0.5295804", "0.52918327", "0.5289898", "0.5289233", "0.5279375", "0.52699506", "0.5258321", "0.52474695", "0.52464", "0.5245784", "0.5244344", "0.5241818", "0.5232311", "0.5227598", "0.52236146", "0.5213485", "0.5212482", "0.52061015", "0.5199039", "0.519233", "0.51914686", "0.5189128", "0.5171617", "0.5167547", "0.5161452", "0.5159987", "0.5143311", "0.51412576", "0.51412576", "0.5137039", "0.5132618", "0.51315224", "0.5128632", "0.51259565", "0.51251376", "0.51240814", "0.5120252", "0.5120252", "0.5116612", "0.510316", "0.51007676", "0.50968343" ]
0.72888285
1
Creates a new Upload entity.
public function createAction(Request $request) { $entity = new Upload(); $form = $this->createCreateForm($entity); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($entity); $entity->upload(); $em->flush(); return $this->redirect($this->generateUrl('admin_uploads')); } return $this->render('MHProductsBundle:Upload:new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n\t{\n\t\t$this->auth->restrict('Upload.Developer.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_upload())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_create_record').': ' . $insert_id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_create_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('upload', 'upload.js');\n\n\t\tTemplate::set('toolbar_title', lang('upload_create') . ' Upload');\n\t\tTemplate::render();\n\t}", "public function createAction()\n {\n $entity = new File();\n $request = $this->getRequest();\n $form = $this->createForm(new FileType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('hypo_test_file_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function create($input) {\n return Upload::create($input);\n }", "public function createEntity();", "public function upload();", "public function create($entity);", "public function create()\n {\n $attachment = $this->Attachments->newEntity();\n \n if ($this->request->is('post')) {\n \n // Assure file was uploaded\n if (!array_key_exists('file', $_FILES)) {\n $this->set('error', 'No attachment provided');\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n \n $uuid = Text::uuid();\n $file = $_FILES['file'];\n \n // Validate file upload\n if ($file['error'] !== UPLOAD_ERR_OK) {\n switch ($file['error']) {\n case UPLOAD_ERR_INI_SIZE:\n $this->set('error', 'The selected file is too big');\n break;\n case UPLOAD_ERR_FORM_SIZE:\n $this->set('error', 'The selected file is too big');\n break;\n case UPLOAD_ERR_NO_FILE:\n $this->set('error', 'No attachment provided');\n break;\n default:\n $this->set('error', 'An unexpected error occured');\n }\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n \n // Move uploaded file\n if (!move_uploaded_file($file[\"tmp_name\"], UPLOADS . $uuid)) {\n $this->set('error', 'An unexpected error occured');\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n \n $data = $this->request->getData();\n \n $data['path'] = $uuid;\n $data['name'] = $file['name'];\n $data['mime'] = $file['type'];\n $data['size'] = $file['size'];\n $attachment = $this->Attachments->patchEntity($attachment, $data);\n if (!$this->Attachments->save($attachment)) {\n $this->set('error', 'An unexpected error occured');\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n }\n \n $this->set('attachment', $attachment);\n $this->set('_serialize', 'attachment');\n }", "public function create(Entity $entity);", "public function upload()\n {\n }", "public function createAction(Request $request)\n {\n\n $user = $this->get('security.context')->getToken()->getUser();\n\n $entity = new Education();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n $entity->upload();\n $entity->setUser($user);\n\n $em->persist($entity);\n $em->flush();\n $this->get('session')->getFlashBag()->add(\n 'success',\"Data has been inserted successfully\"\n );\n return $this->redirect($this->generateUrl('education_show', array('id' => $entity->getId())));\n }\n\n return $this->render('SyndicateComponentBundle:Education:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // if there is an error when moving the file, an exception will\n // be automatically thrown by move(). This will properly prevent\n // the entity from being persisted to the database on error\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n\n // check if we have an old image\n if (isset($this->temp)) {\n // delete the old image\n unlink($this->getUploadRootDir().'/'.$this->temp);\n // clear the temp image path\n $this->temp = null;\n }\n $this->file = null;\n }", "function create($entity);", "public function upload()\n\t{\n\t\t$field \t\t = $this->getUploadField();\n\t\t$newName \t = $this->getUploadNewName();\n\t\t//$destination = 'assets/images/location';\t\n\t\t$destination = $this->getUploadDestination();\n\n\t\tif (\\Input::hasFile($field))\n\t\t{\n\t\t \\Input::file($field)->move($destination, $newName);\n\t\t}\n\t\t\n\t\t$this->entity->fill([$field => $newName]);\n\t\t$this->entity->save();\n\n\t\treturn true;\n\t}", "private function createCreateForm(Upload $entity)\n {\n $form = $this->createForm(new UploadType(), $entity, array(\n 'action' => $this->generateUrl('admin_uploads_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create', 'attr' => array('class' => 'btn btn-success')));\n\n return $form;\n }", "public function upload()\n\t{\n\t}", "public function storeEntity(Request $request)\n {\n $entity = new Entity();\n\n $entity->code = (string)Str::uuid();\n $entity->name = $request->input('name');\n $entity->description = $request->input('description');\n //TODO: upload file\n $entity->image = '';\n $entity->category_id = $request->input('category');\n $entity->save();\n $entity = Entity::find($entity->id)->toArray();\n\n return response()->json([$entity]);\n }", "public function store(Request $request, Uploader $uploader, Upload $uploadModel)\n {\t\n $this->authorize('create', Product::class);\n \n \t$product = new Product;\n \t$product->name = $request->name;\n $product->slug = $request->slug;\n $product->description = $request->description;\n $product->image = UploadController::processUpload($request, $uploader, $uploadModel);\n $product->category_id = $request->category_id;\n $product->price = $request->price;\n $product->is_active = $request->is_active;\n $product->save();\n\n\n return redirect()->route('admin.products');\n }", "public function createEntity($entityName = null);", "private function uploadFile($entity)\n {\n if (!$entity instanceof Image) {\n return;\n }\n\n $file = $entity->getImagefile();\n // only upload new files\n if ($file instanceof UploadedFile) {\n $fileName = $this->uploader->upload($file);\n $entity->setImagefile($fileName);\n }\n }", "private function uploadFile($entity) {\n if (!$entity instanceof DUser) {\n return;\n }\n\n $file = $entity->getPicture();\n\n // only upload new files\n if (!$file instanceof UploadedFile) {\n return;\n }\n\n $fileName = $this->uploader->upload($file);\n $entity->setPicture($fileName);\n }", "public function actionCreate()\n {\n $model = new UploadForm();\n\n if (Yii::$app->request->isPost) {\n $model->uploadedFile = UploadedFile::getInstance($model, 'uploadedFile');\n if ($model->upload()) {\n // file is uploaded successfully\n $model->uploadedFile = UploadedFile::reset();\n Yii::$app->session->setFlash('success', 'File uploaded');\n $this->goBack('index');\n } else {\n Yii::$app->session->setFlash('error', 'File Not uploaded');\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function store(CreateUploadRequest $request)\n\t{\n\t \n\t\t$title = $request->input('title');\n\t\t$description = $request->input('description');\n\t\t$flag = $request->input('flag');\n\t\t$upload_type_id = $request->input('upload_type_id_fk');\n\t\t\n\t\tif($request->hasfile('file_name')){\n\t\t\t\n\t\t\t$this->validate($request, ['file_name' => 'mimes:pdf']);\n\t\t\t\n\t\t\t$img = $request->file('file_name');\n\t\t\t\n\t\t\t$extension = $img->getClientOriginalExtension(); // getting image extension\n\t\t\t$fileName = rand(111, 99999) . '.' . $extension; // renaming image\n\t\t\t\n\t\t\t$img->move(public_path(\"uploads\"),$fileName);\n\t\t\t\n\t\t} else {\n\t\t\t//return $request;\n\t\t\t$fileName = '';\n\t\t}\n\t\t\n\t\tUpload::create(['title' => $title,'description' => $description,'flag' => $flag,'upload_type_id_fk' => $upload_type_id,'file_name' => $fileName]);\n\n\t\treturn redirect()->route(config('quickadmin.route').'.upload.index');\n\t}", "public function publicUpload()\n {\n $this->request->validate([\n $this->inputName => $this->extensions,\n ]);\n\n if ($uploadedFile = $this->request->file($this->inputName))\n {\n $fileName = time() . $uploadedFile->getClientOriginalName();\n $uploadedFile->move(uploadedImagePath() . DIRECTORY_SEPARATOR . $this->path, $fileName);\n $filePath = uploadedImagePath() . DIRECTORY_SEPARATOR . $this->path . DIRECTORY_SEPARATOR .$fileName;\n $image = $this->modelName::create(['name' => $fileName, 'path' => $filePath]);\n return $image->id;\n }\n\n }", "public function createAction(Request $request)\n {\n $entity = new HomePageSections();\n $form = $this->createForm(new HomePageSectionsType(), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n \n\n $uploadedDirectory = $this->container->getParameter('kernel.root_dir').'/../web/uploads';\n $image=$entity->getImage();\n /*@var $image \\Symfony\\Component\\HttpFoundation\\File\\UploadedFile */\n $image->move($uploadedDirectory, $image->getClientOriginalName());\n $entity->setImage($image->getClientOriginalName());\n \n \n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n \n// $this->get('session')->setFlash('notice','Uploaded');\n \n \n \n return $this->redirect($this->generateUrl('homepagesections_index', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function uploadAction(Request $request)\n {\n $user = $this->getConnectedUser();\n\n $version = new Version();\n $form = $this->createFormBuilder($version)\n ->add('uploadedFile')\n ->add('comment', 'textarea', array('required' => false))\n ->getForm();\n\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n $filename = $request->request->get('name');\n $filetype = $version->getUploadType();\n $size = $version->getUploadSize();\n\n $folder = null;\n $folderId = $request->request->get('folderId');\n if (is_numeric($folderId)) {\n $folder = $em->getRepository('TimeBoxMainBundle:Folder')->findOneById($folderId);\n }\n\n $existingFile = $em->getRepository('TimeBoxMainBundle:File')->findOneBy(array(\n 'user' => $user,\n 'folder' => $folder,\n 'name' => $filename,\n 'type' => $filetype,\n 'isDeleted' => false\n ));\n\n $versionDisplayId = 1;\n\n if (!$existingFile) {\n $file = new File();\n $file->setUser($user);\n $file->setName($filename);\n $file->setType($filetype);\n $file->setFolder($folder);\n $file->setTotalSize($size);\n $em->persist($file);\n $em->flush();\n }\n else {\n $file = $existingFile;\n $file->setTotalSize($file->getTotalSize() + $size);\n $lastVersion = $em->getRepository('TimeBoxMainBundle:Version')->findOneBy(\n array('file' => $file),\n array('displayId' => 'DESC')\n );\n $versionDisplayId = $lastVersion->getDisplayId() + 1;\n }\n\n $version->setDate(new \\DateTime);\n $version->setFile($file);\n $version->setSize($size);\n $version->setDisplayId($versionDisplayId);\n $version->setDescription(\"Uploaded file\");\n\n $user->setStorage(max($user->getStorage() + $size, 0));\n\n $em->persist($user);\n $em->persist($version);\n $em->flush();\n\n return $this->redirect($this->generateUrl('time_box_main_file'));\n }\n\n return array(\n 'form' => $form->createView(),\n 'folderId' => $request->request->get('folderId')\n );\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->id . '.' .$this->ext\n );\n\n // set the ext property to the filename where you've saved the file\n //$this->ext = $this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "function uploadObject();", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n if(!is_dir($this->getTargetUploadRootDir())){\n mkdir($this->getTargetUploadRootDir(), 0777, true);\n }\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getTargetUploadRootDir(),\n $this->file->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = date('Y-m-d').DIRECTORY_SEPARATOR.$this->id.DIRECTORY_SEPARATOR.$this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function createAction()\n {\n $request = $this->getRequest();\n $em = $this->getDoctrine()->getManager();\n\n $form = $this->createForm(new ImageType(), new ImageModel(new Image()));\n\n $path = $this->container->getParameter('blog.upload_dir');\n if (!file_exists($path)) {\n @mkdir($path, 0777, true);\n }\n $path = realpath($path);\n $formHandler = new ImageHandler($form, $request, new Image(), $em, $path);\n if ($formHandler->process()) {\n return $this->redirect($this->generateUrl('_blog_backend_image'));\n }\n\n return array(\n 'form' => $form->createView(),\n );\n }", "public function upload() {\n $logger = Logger::getLogger();\n if ($this->file[\"error\"] == UPLOAD_ERR_FORM_SIZE || $this->file[\"error\"] == UPLOAD_ERR_INI_SIZE) {\n $logger->critical(\"File size of uploaded song exceeds limit configured\", $this->file);\n }\n $song = SongManager::createSong($this->file[\"name\"]);\n $targetFile = SongManager::getAbsolutePath($song);\n Logger::getLogger()->info(\"Uploading {$this->file['name']} to $targetFile\", $this->file);\n\n if (move_uploaded_file($this->file[\"tmp_name\"], $targetFile)) {\n $song = SongManager::popularizeMetadata($song);\n foreach ($song->getArtists() as $artist) {\n DatabaseManager::getEntityManager()->persist($artist);\n }\n if ($song->getAlbum() !== null) {\n DatabaseManager::getEntityManager()->persist($song->getAlbum());\n }\n DatabaseManager::getEntityManager()->persist($song);\n } else {\n throw new \\RuntimeException(\"can't upload song\");\n }\n\n return $song;\n }", "public function store(UploadImageRequest $request)\n {\n return $this->resource(\n ImageCreate::dispatchNow(\n $request->only([\n Image::COLUMN_PARENT_ID,\n Image::COLUMN_STATUS_ID,\n ]),\n UploadFiles::dispatchNow(\n $request->file('image'),\n $request->only([\n File::COLUMN_TITLE,\n File::COLUMN_DESCRIPTION,\n File::COLUMN_SORT,\n ]),\n $request->user()\n )\n )\n );\n }", "public function create(Request $request)\n {\n $path = $request->get('path', '');\n\n $path = $this->getFullPath($path);\n\n return response([\n 'success' => $this->fileservice->create($path),\n ], 201);\n }", "public function store(StoreEntityFile $request, Entity $entity)\n {\n $this->authorize('update', $entity->child);\n\n try {\n $this->entityFile\n ->entity($entity)\n ->upload();\n\n $entity->load('files');\n\n\n // Send back the new list of files to the view\n $html = view('cruds.files.files', compact('entity'))->render();\n return response()->json([\n 'success' => true,\n 'html' => $html,\n 'enabled' => $entity->files->count() < config('entities.max_entity_files')\n ]);\n } catch (EntityFileException $e) {\n return response()->json([\n 'success' => false,\n 'error' => __('crud.files.errors.' . $e->getMessage(), ['max' => config('entities.max_entity_files')])\n ]);\n } catch (\\Exception $e) {\n return response()->json(['success' => false, 'error' => $e->getMessage()]);\n }\n }", "public function actionUpload()\n\t{\n\n\t\t$input = craft()->request->getPost();\n\n\t\t$file = UploadedFile::getInstanceByName('file');\n\n\t\t$folder = craft()->assets->findFolder(array(\n\t\t 'id' => $input['id']\n\t\t));\n\n\t\tif ($folder) {\n\t\t\t$folderId = $input['id'];\n\t\t}\n\n\t\tcraft()->assets->insertFileByLocalPath(\n\t\t $file->getTempName(),\n\t\t $file->getName(),\n\t\t $folderId,\n\t\t AssetConflictResolution::KeepBoth);\n\n\t\tcraft()->end();\n\t}", "public function newAction()\n {\n $entity = new Upload();\n $form = $this->createCreateForm($entity);\n\n return $this->render('MHProductsBundle:Upload:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $partes_ruta = pathinfo($this->getFile()->getClientOriginalName());\n $this->nombre = md5(uniqid()) . '.' . $partes_ruta['extension'];\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->nombre\n );\n\n $this->url = $this->getWebPath();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n\n $filePath = md5(uniqid($this->getIdUser().\"_profil\",true)).\".\".\n $this->getFile()->guessClientExtension();\n\n $this->getFile()->move(\n $this->getUploadRootDir(),$filePath\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filePath;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n\n\n\t\t\t\tif(!file_exists($this->getUploadRootDir())) mkdir($this->getUploadRootDir(), 0777, true);\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function createAction(Request $request)\n {\n $entity = new SkIdentificationModule();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n// $entity->upload();\n\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('identification_module_admin_edit', array('id' => $entity->getId())));\n }\n\n return $this->render('SkaphandrusAppBundle:SkIdentificationModule:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function store(Request $request)\n {\n Log::info($request);\n\n $my_tablet_id = Config::get('constants.TABLET_ID');\n $my_user_id = Config::get('constants.USER_ID');\n\n \n $my_media_upload = Upload::create([\n 'reference' =>$request['reference'],\n 'tablet_users_id' => $my_tablet_id,\n 'uploaded_by' => $my_user_id,\n ]);\n\n \n \n if (isset($request['file_upload'])){\n $my_media_upload->addMediaFromRequest('file_upload')->toMediaCollection('file_uploads');\n }\n\n return response()->json([$request->all()]);\n }", "function create_new(){\n\t\tif($this->request->post() && ($d = $this->form->validate($this->params))){\n\t\t\tclass_exists(\"TemporaryFileUpload\"); // make sure that all the relevant constants are defined\n\n\t\t\tif(!TEMPORARY_FILE_UPLOADS_ENABLED){\n\t\t\t\t$this->_report_fail(_(\"Temporary file uploading is not enabled\"),array(\n\t\t\t\t\t\"status_code\" => 403\n\t\t\t\t));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$file = $d[\"file\"];\n\n\t\t\tif($file->getTotalFileSize() > TEMPORARY_FILE_UPLOADS_MAX_FILESIZE){\n\t\t\t\t$this->_report_fail(sprintf(_(\"The file exceeds the maximum file size, which is %s\"),$this->_format_bytes(TEMPORARY_FILE_UPLOADS_MAX_FILESIZE)));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// TODO: To be removed...\n\t\t\tif($file->getFileName()==\"error.txt\"){\n\t\t\t\t$this->_report_fail(\"Testing error message!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif($file->chunkedUpload()){\n\t\t\t\t$token = $file->getToken();\n\t\t\t\tif($file->firstChunk()){\n\t\t\t\t\t$temporary_file_upload = TemporaryFileUpload::CreateNewRecordByHttpUploadedFile($file);\n\t\t\t\t\t$this->session->s(\"temporary_file_upload_id_$token\",$temporary_file_upload->getId());\n\n\t\t\t\t\t$this->_selfclean();\n\t\t\t\t}else{\n\t\t\t\t\t$id = $this->session->g(\"temporary_file_upload_id_$token\");\n\t\t\t\t\tif(is_null($id)){\n\t\t\t\t\t\t$this->_report_fail(_(\"Error 1\"));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$temporary_file_upload = TemporaryFileUpload::GetInstanceById($id);\n\t\t\t\t\tif(!$temporary_file_upload){\n\t\t\t\t\t\t$this->_report_fail(_(\"Error 2\"));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$full_path = $temporary_file_upload->getFullPath();\n\t\t\t\t\tif(!file_exists($full_path)){\n\t\t\t\t\t\t$this->_report_fail(_(\"Error 3 (file $full_path doen't exist)\"));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$temporary_file_upload->appendChunk($file);\n\t\t\t\t\tunlink($file->getTmpFileName());\n\t\t\t\t}\n\t\t\t}else{\n\n\t\t\t\t$temporary_file_upload = TemporaryFileUpload::CreateNewRecordByHttpUploadedFile($file);\n\n\t\t\t\t$this->_selfclean();\n\n\t\t\t}\n\n\t\t\t// the mime type is verified at the upload end\n\t\t\tif($temporary_file_upload->fullyUploaded()){\n\t\t\t\t$mime_type = Files::DetermineFileType($temporary_file_upload->getFullPath(),[\"original_filename\" => $temporary_file_upload->getFilename()]);\n\t\t\t\tif($mime_type && $temporary_file_upload->getMimeType()!==$mime_type){\n\t\t\t\t\t$temporary_file_upload->s(\"mime_type\",$mime_type);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->api_data = $this->_dump_temporary_file_upload($temporary_file_upload);\n\t\t}\n\t}", "public function store(UploadRequest $request)\n {\n $file = $request->file('image');\n $path = \"{$request->user()->id}/{$file->getClientOriginalName()}\";\n\n Storage::disk('s3')->put(\n $path,\n file_get_contents($file->getRealPath())\n );\n\n $image = $request->user()->images()->create([\n 'path' => $path\n ]);\n\n return response()->json([\n 'image' => $image->id,\n 'url' => 'dwa'\n ]);\n }", "public static function createFromUpload( array $file_upload, $options=array() )\r\n {\r\n if (!isset($file_upload['error']) || is_array($file_upload['error'])) \r\n {\r\n throw new \\Exception('Invalid Upload');\r\n }\r\n \r\n switch ($file_upload['error']) \r\n {\r\n \tcase UPLOAD_ERR_OK:\r\n \t break;\r\n \tcase UPLOAD_ERR_NO_FILE:\r\n \t throw new \\Exception('No file sent.');\r\n \tcase UPLOAD_ERR_INI_SIZE:\r\n \tcase UPLOAD_ERR_FORM_SIZE:\r\n \t throw new \\Exception('Exceeded filesize limit.');\r\n \tdefault:\r\n \t throw new \\Exception('Unknown errors.');\r\n }\r\n \r\n if (empty($file_upload['tmp_name']) || empty($file_upload['name']))\r\n {\r\n throw new \\Exception('Invalid Upload Properties');\r\n }\r\n\r\n if (empty($file_upload['size']))\r\n {\r\n throw new \\Exception('Invalid Upload Size');\r\n }\r\n \r\n $app = \\Base::instance();\r\n $options = $options + array('width'=>460, 'height'=>308);\r\n \r\n // Do the upload \r\n $model = new static;\r\n $grid = $model->getDb()->getGridFS( $model->collectionNameGridFS() );\r\n $file_path = $model->inputFilter()->clean($file_upload['tmp_name']);\r\n $name = $model->inputFilter()->clean($file_upload['name']);\r\n\t\t$buffer = file_get_contents($file_upload['tmp_name']);\r\n \r\n\t\t$thumb = null;\r\n\t\tif ( $thumb_binary_data = $model->getThumb( $buffer, null, $options )) {\r\n\t\t\t$thumb = new \\MongoBinData( $thumb_binary_data, 2 );\r\n\t\t}\r\n\t\t\r\n $values = array(\r\n 'type' => !empty($options['type']) ? $options['type'] : null,\r\n 'storage' => 'gridfs',\r\n 'md5' => md5_file( $file_path ),\r\n 'url' => null,\r\n \t'thumb' => $thumb,\r\n \t'filename' => $name,\r\n \t'contentType' => $model->getMimeType($buffer),\r\n 'title' => \\Dsc\\String::toSpaceSeparated( $name ),\r\n );\r\n \r\n if ($storedfile = $grid->storeFile( $file_path, $values ))\r\n {\r\n $model->load(array('_id'=>$storedfile));\r\n $model->bind( $values );\r\n $model->slug = $model->generateSlug();\r\n if(!empty($options['tags'])){\r\n \t$model->set('tags', $options['tags']);\r\n }\r\n $model->save();\r\n }\r\n \r\n return $model;\r\n }", "public function actionUpload1()\n {\n $upload_handler = new UploadHandler();\n }", "public function createEntity($name);", "public function createAction(Request $request)\n {\n $entity = new Picture();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('picture_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "private function postUploadFile($entity)\n {\n if (!$entity instanceof User) {\n return;\n }\n\n $file = $entity->getTempFile();\n\n // only upload new files\n if (!$file instanceof UploadedFile) {\n return;\n }\n\n if (null === $file) {\n return;\n }\n\n if (null !== $entity->getTempFilename()) {\n $oldFile = $this->uploader->getTargetDir().'/'.$entity->getId().'.'.$entity->getTempFilename();\n\n if(file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n $fileName = $entity->getId().'.'.$entity->getAvatar();\n\n $this->uploader->upload($file, $fileName);\n }", "public function create()\n {\n $invoice = new InvoiceEntity();\n $invoice->setNumber('019101910191091')\n ->setValue(100.90)\n ->setUrl('http://domain.com')\n ->setIssuanceDate('2017-09-15')\n ->setKey('POL9898AS');\n\n $tracking = new TrackingEntity();\n $tracking->setOrderId('00001010101AA')\n ->setStatus('in_route')\n ->setCode('BR800OPR5')\n ->setInvoice($invoice);\n\n $this->dm->persist($tracking);\n $this->dm->flush();\n }", "public function create()\n\t{\n\t\t$image = $this->uploadImage();\n if ($image) {\n $this->data('image', $image);\n }\n\t\t$this->data([\n\t\t\t'story_title' => $this->request->post('story_title'),\n\t\t\t'story_name' => $this->request->post('story_name'),\n\t\t\t'details' => $this->request->post('details'),\n\t\t\t'status' => $this->request->post('status'),\n\t\t\t'created_at' => date('Y-m-d H:i:s'),\n\t\t])->insert($this->table);\n\t}", "public function createAction(Request $request)\n {\n $entity = new Fileops();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('fileops_show', array('id' => $entity->getId())));\n }\n\n return $this->render('XarismaBundle:Fileops:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function upload()\n {\n // The file property can be empty if the field is not required\n if (null === $this->file) {\n return;\n }\n\n // Use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->path\n );\n\n // Set the path property to the filename where you've saved the file\n $this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function actionCreate()\n {\n $model = new Gallery();\n $file = new UploadForm();\n $file->imageFile = UploadedFile::getInstance($file, 'imageFile');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($file->upload($model->id, null, $file::TYPE_GALLERY)) {\n $model->image = $file->getNameImage($model->id, null, $file::TYPE_GALLERY);\n $model->save();\n } else {\n $model->image = null;\n $model->save();\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', compact('file', 'model'));\n }\n }", "public function store(EntityRequest $request)\n {\n\n\n $dataForm = $request->all();\n $dataForm['active'] = filter_var($dataForm['active'], FILTER_VALIDATE_BOOLEAN);\n $dataForm['access_application'] = filter_var($dataForm['access_application'], FILTER_VALIDATE_BOOLEAN);\n\n $dataForm['created_by'] = auth()->user()->id;\n $dataForm['updated_by'] = auth()->user()->id;\n\n $entity = Entity::create($dataForm);\n\n return redirect()->route('entity.show', $entity->id);\n }", "public function createAction()\n {\n $type = $this->params('type');\n $instance = $this->getInstanceManager()->getInstanceFromRequest();\n $query = $this->params()->fromQuery();\n $entity = $this->getEntityManager()->createEntity(\n $type,\n $query,\n $instance\n );\n $this->getEntityManager()->flush();\n\n $data = ['entity' => $entity, 'data' => $query];\n $response = $this->getEventManager()->trigger('create.postFlush', $this, $data);\n return $this->checkResponse($response);\n }", "public function store(CreateRequest $request)\n {\n $file = $request->file('file');\n $name = $file->getClientOriginalName();\n \\Storage::disk('local')->put($name, \\File::get($file));\n $request = $request->all();\n $request['file'] = $name;\n $document = $this->document->create($request);\n $document->documentTypes()->sync($request['documentType']);\n Session::flash('message-success',' Document '. $name.' '.trans('messages.created'));\n\n }", "protected static function entityFactory($input) {\n\n\t\tif (!isset(self::$config['filestore_prefix'])) {\n\t\t\t$prefix = \"file/\";\n\t\t}\n\n\t\t$uploads = self::$uploads[$input];\n\t\t$handled_uploads = array();\n\t\t$entities = array();\n\n\t\tforeach ($uploads as $key => $upload) {\n\t\t\tif ($upload->error) {\n\t\t\t\t$handled_uploads[] = $upload;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\n\t\t\t$filehandler = new ElggFile();\n\t\t\tif (is_array(self::$attributes)) {\n\t\t\t\tforeach (self::$attributes as $key => $value) {\n\t\t\t\t\t$filehandler->$key = $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$filestorename = elgg_strtolower(time() . $upload->name);\n\t\t\t$filehandler->setFilename($prefix . $filestorename);\n\n\t\t\t$filehandler->title = $upload->name;\n\t\t\t$filehandler->originalfilename = $upload->name;\n\t\t\t$filehandler->filesize = $upload->size;\n\t\t\t$filehandler->mimetype = $upload->mimetype;\n\t\t\t$filehandler->simpletype = $upload->simpletype;\n\n\t\t\t$filehandler->open('write');\n\t\t\t$filehandler->close();\n\n\t\t\tmove_uploaded_file($upload->path, $filehandler->getFilenameOnFilestore());\n\n\t\t\tif ($filehandler->save()) {\n\t\t\t\t$upload->guid = $filehandler->getGUID();\n\t\t\t\t$upload->file = $filehandler;\n\t\t\t\t$upload->not_attached = true;\n\n\t\t\t\t/*if ($filehandler->simpletype == \"image\") {\n\t\t\t\t\trequire_once(dirname(__FILE__) . '/IconHandler.php');\n\t\t\t\t\tIconHandler::makeIcons($filehandler);\n\t\t\t\t}*/\n\t\t\t\t// if image, we need to create thumbnails (this should be moved into a function)\n\t\t\t\tif ($upload->guid && $filehandler->simpletype == \"image\") {\n\t\t\t\t\tself::setImageThumbnails($filehandler);\n\t\t\t\t} else if ($upload->guid && $filehandler->mimetype == \"application/pdf\") {\n\t\t\t\t\tself::setPdfThumbnails($filehandler);\n\n\t\t\t\t} else if ($filehandler->icontime) {\n\t\t\t\t\t// if it is not an image, we do not need thumbnails\n\t\t\t\t\tunset($filehandler->icontime);\n\n\t\t\t\t\t$thumb = new ElggFile();\n\n\t\t\t\t\t$thumb->setFilename($prefix . \"thumb\" . $filestorename);\n\t\t\t\t\t$thumb->delete();\n\t\t\t\t\tunset($filehandler->thumbnail);\n\n\t\t\t\t\t$thumb->setFilename($prefix . \"smallthumb\" . $filestorename);\n\t\t\t\t\t$thumb->delete();\n\t\t\t\t\tunset($filehandler->smallthumb);\n\n\t\t\t\t\t$thumb->setFilename($prefix . \"largethumb\" . $filestorename);\n\t\t\t\t\t$thumb->delete();\n\t\t\t\t\tunset($filehandler->largethumb);\n\t\t\t\t}\n\n\n\t\t\t\t$entities[] = $filehandler;\n\t\t\t} else {\n\t\t\t\t$upload->error = elgg_echo('upload:error:unknown');\n\t\t\t}\n\n\t\t\t$handled_uploads[] = $upload;\n\t\t}\n\n\t\tself::$uploads[$input] = $handled_uploads;\n\t\tself::$files[$input] = $entities;\n\t}", "private function uploadImagePost(Request $request){\n\t\t// Handles data\n\t\t$target = explode('.',$request->target);\n\t\t$class = '\\App\\\\'.ucwords($target[0]);\n\t\t$object = $class::find($request->id);\n\n\t\t// Handles image\n\t\t$image = \\Gumlet\\ImageResize::createFromString(base64_decode($request->data));\n\t\t$image->quality_jpg = 50;\n\n\t\t// Saving image\n\t\t$object->image = (string) $image;\n\t\t$object->save();\n\t}", "public function setUploadData(UploadedFile $uploaded_file): Uploadable;", "public function store(PhotoCreateRequest $request)\n {\n DB::beginTransaction();\n $photo = $this->createPhotoInstance($request->all());\n $photo->owner()->associate(auth()->user());\n $photo->save();\n\n $photo->location()->save(\n new PhotoLocation($request->only('location'))\n );\n\n $tags = $this->createTags(explode(',', $request->tags));\n\n $photo->tags()->sync($tags->pluck('id')->toArray());\n\n // Execute processing to external photo: download, apply geocoding...\n dispatch(new ProcessingExternalPhoto($photo));\n\n DB::commit();\n\n // 201\n return $photo;\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(),\n [\n 'upload_id' => 'required',\n 'content' => 'required'\n ]);\n\n if ($validator->fails()) {\n return response()->json(['state' => false, 'message' => $validator->errors()], 401);\n }\n\n\n $item = UploadTimelineInformation::updateOrCreate(\n ['upload_id' => $request->upload_id,],\n [\n 'upload_id' => $request->upload_id,\n 'content' => $request->content,\n ]\n );\n\n\n return new UploadTimelineInformationResource($item);\n }", "protected abstract function importCreate($entity);", "public function store(Request $request)\n {\n return FileManager::handleNewUpload($request->file, $request->type, $request->brand);\n }", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n Image::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->path\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "private function createEntity()\n {\n $this->entity = $this->container->make($this->entity());\n }", "public function make_a_photo()\n {\n $product = factory(Product::class, 1)->create();\n\n $file = new UploadedFile(\n 'C:\\Users\\Admin\\Projects\\whimsical\\storage\\test\\test_file.jpg',\n 'test_file.jpg',\n 'jpg',\n 'null',\n 'null',\n true\n );\n\n $this->assertTrue(file_exists($file->path()), 'Test file does not exist');\n\n $product->addPhoto($product, $file);\n\n }", "public function store(CreateArticleRequest $request)\n {\n\n $tags = $request->input('tags');\n $currentTags = array_filter($tags, 'is_numeric');\n $newTags = array_diff($tags, $currentTags);\n\n foreach ($newTags as $newTag):\n if ($tag = Tag::create(['name' => $newTag]))\n $currentTags[] = $tag->id;\n endforeach;\n\n // $article = Auth::user()->articles()->create($request->all());\n\n $article = Article::create($request->all());\n $article->tags()->attach($currentTags);\n // $article->tags()->sync($currentTags);\n\n if($request->hasFile('cover')):\n $this->uploadFile($request->file('cover'));\n endif;\n\n return redirect('admin/content');\n }", "public function createEntity($entityId, $request)\n {\n return $this->start()->uri(\"/api/entity\")\n ->urlSegment($entityId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function upload() {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(), $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->photo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function create(): void\n {\n\n $description = null;\n $image = null;\n $velo_id = null;\n\n if (!empty($_POST['description']) && $_POST['description'] != \"\") {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!empty($_POST['image'])) {\n $image = htmlspecialchars($_POST['image']);\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n\n if (!$description || !$image || !$velo_id) {\n die(\"formulaire mal rempli\");\n }\n\n $this->model->insert($description, $image, $velo_id);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->setImageName($this->getFile()->getClientOriginalName());\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function store( Request $request )\n {\n\n $this->validate( $request, [\n\n 'name' => 'required|unique:files',\n 'file' => 'required|file|mimes:' . File::getAllExtensions() . '|max:' . File::getMaxSize()\n ]);\n\n $file = new File();\n\n $file_input = $request->file( 'file' );\n $ext = $file_input->getClientOriginalExtension();\n $type = $file->getType( $ext );\n\n if( $file->upload( $type, $file_input, $request[ 'name' ], $ext ) ){\n\n return $file::create([\n\n 'name' => $request[ 'name' ],\n 'type' => $type,\n 'extension' => $ext,\n 'user_id' => Auth::id()\n ]);\n }\n\n return response()->json( false );\n }", "public function createEntity($data = array());", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = '/'.$this->getUploadDir().'/'.$this->getFile()->getClientOriginalName();\n //get the file name\n// $file = $this->getFile()->getClientOriginalName();\n// $info = pathinfo($file);\n// $file_name = basename($file,'.'.$info['extension']);\n// $this->name = $file_name ;\n// $this->setName($file_name);\n// // clean up the file property as you won't need it anymore\n// $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n \n\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function store(Request $request)\r\r\n {\r\r\n $data = $request->except('_token', 'photo');\r\r\n\r\r\n if ($request->hasFile('photo'))\r\r\n {\r\r\n $image = $request->file('photo');\r\r\n $imageName = $this->upload($image, 'transfer', true); // resize option executed.\r\r\n $data['photo'] = $imageName;\r\r\n }\r\r\n $this->transferRepo->save($data);\r\r\n\r\r\n return redirect('/admin-panel/transfers')->with('success', 'success');\r\r\n }", "public function uploadAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Get Message Service\n $message = $this->getServiceLocator()->get('systemMessages');\n \n $files = $request->getFiles()->toArray();\n $temp = explode(\".\", $files[\"file\"][\"name\"]);\n $newName = round(microtime(true));\n $newfilename = $newName . '.' . end($temp);\n $image = new Image();\n $image->exchangeArray(array(\n \"website_id\" => $logedUser[\"idWebsite\"],\n \"name\" => $newName,\n \"extension\" => end($temp)\n ));\n if ($image->validation()) {\n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"public/files_database/\" . $logedUser[\"idWebsite\"] . \"/\" . $newfilename)) {\n $result = $this->getImageTable()->saveImage($image);\n $message->setCode($result);\n // Log\n $this->getServiceLocator()\n ->get('systemLog')\n ->addLog(0, $message->getMessage(), $message->getLogPriority());\n die('uploadSucess');\n } else {\n die('uploadError');\n }\n } else {\n die('Invalid extension');\n }\n }\n die(\"forbiden\");\n } else {\n die(\"forbiden - without permission\");\n }\n }", "public function actionCreate()\n {\n $model = new Register();\n $Uploadmodel = new UploadForm();\n $Model = new User();\n\n if (Yii::$app->request->isPost) \n {\n //print_r($_Files); die;\n $Uploadmodel->imageFile = UploadedFile::getInstance($model, 'imageFile');\n if($model->load(Yii::$app->request->post()))\n {\n if(isset($Uploadmodel->imageFile))\n {\n $model->imageFile = $Uploadmodel->imageFile->name; \n $Uploadmodel->upload();\n }\n $model->password_hash = $Model->setPassword($model->password_hash);\n if($model->save()) \n {\n //print_r($model->errors);\n return $this->redirect(['user-images', 'id' => $model->id]);\n }\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function postCreate(RequestValidation $request, ProductFile $uploader)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'description' => 'required',\n 'price' => 'required|numeric',\n 'file' => 'required',\n 'categories_list' => 'required'\n ]);\n $files = Request::file('file');\n\n return $uploader->insertProduct($request, $files);\n }", "public function upload() {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // si on avait un ancien fichier on le supprime\n if (null !== $this->tempFilename) {\n $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;\n if (file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n // déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move(\n $this->getUploadRootDir(), // répertoire de destination\n $this->id.'.'.$this->url // nom du fichier à créer \"id.extension\"\n );\n\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n $path = ($this->isPublic()) ? 'public' : 'sections' . '/' . strtolower($this->getSection()->getCode());\n\n if (!is_dir($this->getUploadRootDir(). '/' .$path)){\n if (!mkdir($this->getUploadRootDir(). '/' .$path)){\n throw new \\Exception('Create dir exception');\n }\n }\n\n $filename = sha1(uniqid(mt_rand(), true)).'.'.$this->getFile()->guessExtension();\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(). '/' .$path,\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $path . '/' . $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n// use the original file name here but you should\n// sanitize it at least to avoid any security issues\n// move takes the target directory and then the\n// target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n// set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n// clean up the file property as you won't need it anymore\n $this->file = null;\n\n\n }", "public function create()\n {\n return view('product.upload');\n }", "public function upload()\n {\n //Checks if the path is null\n if (null === $this->file) {\n return;\n }\n\n $hash = uniqid('', true);\n $extension = $this->file->getClientOriginalExtension();\n $newFilename = $hash.'.'.$extension;\n\n $this->file->move($this->getUploadRootDir(), $newFilename);\n $this->path = $newFilename;\n\n // Clean the path file\n $this->file = null;\n }", "public function store(UploadRequest $request)\n {\n $events= events::create($request->all());\n \n $filename = $request -> photo ->store('photos');\n EventPhoto::create([\n 'EventId'=> $events -> id,\n 'NameOfEvent' => $request ->NameOfEvent,\n 'VenueOfEvent' =>$request ->VenueOfEvent,\n 'Town' => $request ->Town,\n 'DateOfTheEvent' => $request -> DateOfTheEvent,\n 'OrganizingCompany' =>$request-> OrganizingCompany,\n 'ContactEmail' => $request -> ContactEmail,\n 'Description' => $request ->Description,\n //'Categories' => $Categories,\n 'filename' => $filename\n\n ]);\n return view('event');\n }", "public function createAction(Request $request)\n {\n $service = $this->getRepository();\n $entity = $this->getRepository()->makeEntity();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl($this->getRoute('show'), ['id' => $entity->getId()]));\n }\n\n return [\n 'entity' => $entity,\n 'form' => $form->createView(),\n ];\n }", "public function store(Request $request)\n {\n $avatar = null;\n\n $media = new Media();\n if($request->file('avatar')){\n $media->_file = $request->file('avatar');\n $media->_path = 'Avatar';\n $media = $media->_save();\n\n if($media)\n $avatar = $media->id;\n }\n\n $user = User::create([\n 'name'=>request('name'),\n 'email'=>request('email'),\n 'role'=>\"ETUDIENT\",\n 'phone'=>request('phone'),\n 'cin'=>request('cin'),\n 'avatar'=>$avatar,\n 'password'=>bcrypt( request('password') ),\n ]);\n\n if( $user && $user->id ) {\n $etudient = Etudient::create([\n 'user_id' => $user->id,\n 'cne' => request('cne'),\n ]);\n\n if( $etudient && $etudient->id ){\n // all is good\n $etudient->filiers()->sync(request('new_filier'));\n $etudient->modules()->sync(request('new_module'));\n }else{\n // is etudient not create we need to destroy user\n if( $user->picture )\n $user->picture->delete();\n $user->delete();\n }\n }\n\n return redirect()->route('etudient_edit', $user->id);\n }", "public function upload()\n {\n if (null === $this->image) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the target filename to move to\n $this->file->move($this->getUploadRootDir(), $this->image->getClientOriginalName());\n\n // set the path property to the filename where you'ved saved the file\n $this->path = $this->image->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function createAction(Request $request)\n {\n $entity = new Acc();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n /*Upload file*/\n $fileBadge = $request->files->get('fly_platformbundle_acc');\n $res = $this->get('fly.local.uploader')->uploadAccImage($fileBadge['picture']);\n if ($res['asc'] == 'error') {\n return JsonResponse::create(['asc' => 'error', 'message' => $res['msg']]);\n }\n $entity->setPicture($res['url']);\n\n $em->persist($entity);\n $em->flush();\n\n\n if($request->isXmlHttpRequest()){\n return JsonResponse::create(['asc'=>'success','data'=>$entity]);\n }\n\n return $this->redirect($this->generateUrl('acc_show', array('id' => $entity->getId())));\n }\n\n if($request->isXmlHttpRequest()){\n return JsonResponse::create(['asc'=>'error','msg'=>'Error']);\n }\n\n return $this->render('FlyPlatformBundle:Acc:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function upload($input);", "public function upload(Request $request)\n {\n //\n }", "public function createAction(Request $request)\n {\n $entity = new Fluidite();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n $dateDetection= new DateTime('now');\n $entity->setDateDetection($dateDetection);\n \n $user = $this->container->get('security.context')->getToken()->getUser();\n $username =$user->getUsername();\n $entity->setUser($username);\n \n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('fluidite')); }\n\n return $this->render('GestionPassBundle:Fluidite:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function store(TaskCreateRequest $request)\n {\n\n DB::beginTransaction();\n\n try{\n\n $task = $this->repository->create(\n $request->all() + [\n 'owner_user_id' => Auth::user()->id\n ]\n );\n\n $files = $request->input('files');\n $syncData = [];\n\n if( !empty($files) )\n {\n $pivotData = array_fill(0, count($files), ['table_name' => $task->getTable()]);\n $syncData = array_combine($files, $pivotData);\n }\n\n $task->files()->sync($syncData);\n\n $task->load('client','propoal.status','status','task_type','files','owner');\n\n $message = 'Registro Exitoso!';\n DB::commit();\n }catch(\\Exception $e){\n $task = [];\n DB::rollback();\n $message = $e->getMessage();\n $this->responseCode = 500;\n }\n\n return response()->json([\n 'message' => $message,\n 'data' => $task,\n ],$this->responseCode);\n }", "public function store(CreateFotoRequest $request)\n {\n $input = $request->all();\n\n $foto = $this->fotoRepository->create($input);\n\n Flash::success('Foto saved successfully.');\n\n return redirect()->back();\n }", "public function store(Request $request)\n {\n $data = new Transfer();\n $data -> title = $request -> input('title');\n $data -> keywords = $request -> input('keywords');\n $data -> description = $request -> input('description');\n $data -> slug = $request -> input('slug');\n $data -> status = $request -> input('status');\n $data -> category_id = $request -> input('category_id');\n $data -> user_id = Auth::id();\n $data -> base_price = $request -> input('base_price');\n $data -> km_price = $request -> input('km_price');\n $data -> capacity = $request -> input('capacity');\n $data -> detail = $request -> input('detail');\n $data -> image = Storage::putFile('images', $request->file(('image'))); //file upload\n\n $data -> save();\n return redirect() -> route('admin_transfers');\n }" ]
[ "0.67442226", "0.6611436", "0.6269555", "0.61469954", "0.6083409", "0.60704654", "0.6021481", "0.5995937", "0.5974643", "0.5966445", "0.59569573", "0.59283775", "0.59246695", "0.58801204", "0.58646446", "0.5854491", "0.58477277", "0.58372104", "0.5831217", "0.5822705", "0.5821149", "0.5805032", "0.57760906", "0.5771458", "0.57611334", "0.57582504", "0.57543254", "0.5732736", "0.5702112", "0.56868285", "0.56496555", "0.56467295", "0.5627362", "0.5624015", "0.5607176", "0.56044674", "0.55982095", "0.55963254", "0.55846024", "0.55811536", "0.55723935", "0.5568333", "0.5567326", "0.55554986", "0.5546026", "0.5537506", "0.55218124", "0.55151546", "0.5502558", "0.5494247", "0.5492986", "0.5491901", "0.54749143", "0.5449116", "0.5444298", "0.54404956", "0.5429271", "0.5417741", "0.54081154", "0.5405221", "0.5401397", "0.53945994", "0.538906", "0.5380402", "0.53737646", "0.5372979", "0.537251", "0.5363669", "0.53611404", "0.535751", "0.5356205", "0.5348428", "0.53310734", "0.53293896", "0.5327241", "0.5324081", "0.5322857", "0.5322784", "0.5322468", "0.53202534", "0.53156155", "0.53153116", "0.5307174", "0.5307174", "0.5307174", "0.5307174", "0.52997607", "0.5291906", "0.5288727", "0.5284371", "0.52838355", "0.52797294", "0.5275727", "0.5271181", "0.5267401", "0.5262083", "0.5258111", "0.52551", "0.52535945", "0.52510417" ]
0.70553786
0
Creates a form to create a Upload entity.
private function createCreateForm(Upload $entity) { $form = $this->createForm(new UploadType(), $entity, array( 'action' => $this->generateUrl('admin_uploads_create'), 'method' => 'POST', )); $form->add('submit', 'submit', array('label' => 'Create', 'attr' => array('class' => 'btn btn-success'))); return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createAction(Request $request)\n {\n $entity = new Upload();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $entity->upload();\n $em->flush();\n\n return $this->redirect($this->generateUrl('admin_uploads'));\n }\n\n return $this->render('MHProductsBundle:Upload:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function createForm() {\n module_load_include('inc', 'islandora_form_builder', 'FormGenerator');\n $form_values = &$this->formState['values'];\n $file = isset($form_values['ingest-file-location']) ? $form_values['ingest-file-location'] : '';\n $form['#attributes']['enctype'] = 'multipart/form-data';\n $form['indicator']['ingest-file-location'] = array(\n '#type' => 'file',\n '#title' => t('Upload Document'),\n '#size' => 48,\n '#description' => t('Select file to be added the the object.'),\n );\n $form_generator = FormGenerator::CreateFromModel($this->contentModelPid, $this->contentModelDsid);\n $form[FORM_ROOT] = $form_generator->generate($this->formName); // TODO get from user .\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Ingest'),\n '#prefix' => t('Please be patient. Once you click next there may be a number of files created. ' .\n 'Depending on your content model this could take a few minutes to process.<br />')\n );\n return $form;\n }", "public function newAction()\n {\n $entity = new Upload();\n $form = $this->createCreateForm($entity);\n\n return $this->render('MHProductsBundle:Upload:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function UploadForm()\n {\n return Form::create($this, \"UploadForm\",\n FieldList::create(\n FileField::create(\"XMLFile\", 'Wordpress XML file'),\n HiddenField::create(\"BlogHolderID\", '', $this->getBlogHolderID())\n ),\n FieldList::create(\n FormAction::create('doUpload', 'Import Wordpress XML file')\n )\n );\n }", "function createUploadForm(FormFactoryInterface $factory)\n{\n $formBuilder = $factory->createBuilder();\n $formBuilder->add('largeur', Form\\IntegerType::class, [\n 'data' => 500,\n 'constraints' => [\n new Assert\\NotBlank(),\n ],\n ]);\n $formBuilder->add('image', Form\\FileType::class, [\n 'constraints' => [\n new Assert\\NotBlank(),\n new Assert\\File(['maxSize' => '1M', 'mimeTypes' => ['image/png', 'image/jpg', 'image/jpeg']]),\n ],\n ]);\n\n return $formBuilder->getForm();\n}", "public function createAction()\n {\n $entity = new File();\n $request = $this->getRequest();\n $form = $this->createForm(new FileType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('hypo_test_file_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "private function createCreateForm(Fileops $entity)\n {\n $form = $this->createForm(new FileopsType(), $entity, array(\n 'action' => $this->generateUrl('fileops_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function actionCreate()\n {\n $model = new UploadForm();\n\n if (Yii::$app->request->isPost) {\n $model->uploadedFile = UploadedFile::getInstance($model, 'uploadedFile');\n if ($model->upload()) {\n // file is uploaded successfully\n $model->uploadedFile = UploadedFile::reset();\n Yii::$app->session->setFlash('success', 'File uploaded');\n $this->goBack('index');\n } else {\n Yii::$app->session->setFlash('error', 'File Not uploaded');\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "private function createEditForm(Upload $entity)\n {\n $form = $this->createForm(new UploadType(), $entity, array(\n 'action' => $this->generateUrl('admin_uploads_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function create()\n\t{\n\t\t$this->auth->restrict('Upload.Developer.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_upload())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_create_record').': ' . $insert_id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_create_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('upload', 'upload.js');\n\n\t\tTemplate::set('toolbar_title', lang('upload_create') . ' Upload');\n\t\tTemplate::render();\n\t}", "private function createCreateForm(Picture $entity)\n {\n $securityContext = $this->container->get('security.context');\n $form = $this->createForm(\n new PictureType($securityContext), \n $entity, \n array('action' => $this->generateUrl('picture_create'), 'method' => 'POST'));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function uploadingForm()\n {\n return view('formuploads.formupload');\n\n }", "public function createAction()\n {\n $request = $this->getRequest();\n $em = $this->getDoctrine()->getManager();\n\n $form = $this->createForm(new ImageType(), new ImageModel(new Image()));\n\n $path = $this->container->getParameter('blog.upload_dir');\n if (!file_exists($path)) {\n @mkdir($path, 0777, true);\n }\n $path = realpath($path);\n $formHandler = new ImageHandler($form, $request, new Image(), $em, $path);\n if ($formHandler->process()) {\n return $this->redirect($this->generateUrl('_blog_backend_image'));\n }\n\n return array(\n 'form' => $form->createView(),\n );\n }", "public function create()\n\t{\n\t $uploadtypename = Tbluploadtypes::all();\t \n\t\treturn view('admin.upload.create', compact('uploadtypename'));\n\t}", "public function create()\n {\n return view('pages.upload');\n }", "public function create()\n {\n return view('upload');\n }", "public function create()\n {\n return view('product.upload');\n }", "public function renderUploadForm() {}", "private function createCreateForm(Bien $entity)\n {\n $form = $this->createForm(new BienType(), $entity, array(\n 'action' => $this->generateUrl('bien_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Crear','attr' => array('class' => 'btn btn-success'),));\n return $form;\n }", "private function createCreateForm(Fluidite $entity)\n {\n $form = $this->createForm(new FluiditeType(), $entity, array(\n 'action' => $this->generateUrl('fluidite_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "protected function createComponentImageForm()\n {\n $entity = $this->template->image;\n $form = $this->imageManageFacade->imageFormFactory->create();\n\n $form->create()\n ->bootstrap3Render()\n ->bindEntity($entity)\n ->onSuccess[] = function (DevrunForm $form, $values) {\n\n /** @var ImagesEntity $entity */\n $entity = $form->getEntity();\n\n $imageReady = false;\n\n /** @var FileUpload $image */\n if ($image = $values->imageUpload) {\n if ($image->isOk() && $image->isImage()) {\n $imageReady = true;\n }\n }\n\n if ($imageReady)\n $this->imageManageFacade->updateImageFromEntity($entity, $image);\n\n else\n $this->imageManageFacade->imageRepository->getEntityManager()->persist($entity)->flush();\n\n $this->flashMessage('Obrázek upraven');\n $this->ajaxRedirect(\"default\");\n };\n\n\n return $form;\n }", "private function createCreateForm(Push $entity)\n {\n $form = $this->createForm(new PushType(), $entity, array(\n 'action' => $this->generateUrl('push_create'),\n 'method' => 'POST',\n 'attr' => array('id' => 'create-form')\n ));\n\n return $form;\n }", "public function newAction()\n {\n $entity = new File();\n $form = $this->createForm(new FileType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function create() {\n $this->data['title'] = PAGE_TITLES['uploads/create'];\n unset($_SESSION['flash']);\n unset($_SESSION['status']);\n $this->destroyToken();\n $this->data['token'] = $this->generateToken();\n return $this->view('uploads/create', $this->data);\n }", "private function createCreateForm(Testimonial $entity)\n {\n $form = $this->createForm(new TestimonialType(), $entity, array(\n 'action' => $this->generateUrl('config_testimonial_create'),\n 'attr' => array('enctype' => 'multipart/form-data'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Guardar'));\n\n return $form;\n }", "private function createCreateForm(Image $entity, $origin)\n {\n $form = $this->createForm(new ImageType(), $entity, array(\n 'action' => $this->generateUrl('image_create',array('origin'=>$origin)),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Enregistrer Image'));\n\n return $form;\n }", "function training_modal_load_files_form($form, &$form_state) {\n $form = array(\n 'file_upload' => array(\n '#type' => 'managed_file',\n '#title' => 'Upload file',\n '#upload_location' => 'private://upload',\n '#upload_validators' => array(\n 'file_validate_extensions' => array(),\n ),\n ),\n 'submit_upload' => array(\n '#type' => 'submit',\n '#value' => 'Submit',\n ),\n );\n\n return $form;\n}", "private function createCreateForm(Element $entity)\n\t{\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$request = $this->container->get('request_stack')->getCurrentRequest();\n\t\t$params = $request->get('_route_params');\n\t\t$block = $em->getRepository('NovuscomCMFBundle:Block')->find($params['id']);\n\n\n\t\tif ($params['section_id']) {\n\t\t\t$action = $this->generateUrl('admin_element_create_in_section',\n\t\t\t\tarray(\n\t\t\t\t\t'section_id' => $params['section_id'],\n\t\t\t\t\t'id' => $params['id'],\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t$action = $this->generateUrl('admin_element_create_in_block',\n\t\t\t\tarray(\n\t\t\t\t\t'id' => $params['id'],\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$form = $this->createForm(ElementType::class, $entity, array(\n\t\t\t'action' => $action,\n\t\t\t'method' => 'POST',\n\t\t\t'blockObject' => $block,\n\t\t\t'params' => array('_route_params' => $params),\n\t\t\t'em' => $em,\n\t\t));\n\n\n\t\t$properties = $block->getProperty();\n\t\t$countProperties = count($properties);\n\n\n\t\t/*$EP = new ElementProperty();\n\t\t$propertiesForm = $this->createFormBuilder($EP);\n\t\tforeach ($properties as $p) {\n\t\t\t//echo '<pre>' . print_r($p->getName(), true) . '</pre>';\n\t\t\t\t$add = $propertiesForm->add('value', 'text');\n\n\t\t}*/\n\t\t//$propForm = $add->getForm();\n\n\t\tif ($countProperties > 0) {\n\t\t\t//$propertyForm = new ElementPropertyType($properties, $em, false, $request);\n\t\t\t//$form->add('properties', $propertyForm, array('mapped' => false, 'label' => 'Свойства'));\n\t\t}\n\n\t\t//$form->add('properties', new ElementPropertyType($properties, $em));\n\n\t\t//$form->add('properties', 'collection', array('type' => new ElementPropertyType($properties, $em)));\n\n\t\t$epArray = array();\n\n\t\t/**\n\t\t * Пролучаем значения свойств типа \"строка\"\n\t\t */\n\t\t$ElementProperty = $em->getRepository('NovuscomCMFBundle:ElementProperty')->findBy(\n\t\t\tarray(\n\t\t\t\t'element' => $entity,\n\t\t\t)\n\t\t);\n\n\t\tforeach ($ElementProperty as $ep) {\n\t\t\t$epArray[$ep->getProperty()->getId()][] = $ep->getValue();\n\t\t}\n\n\t\t/**\n\t\t * Получаем значения свойств типа \"дата/время\"\n\t\t */\n\t\t$ElementPropertyDT = $em->getRepository('NovuscomCMFBundle:ElementPropertyDT')->findBy(\n\t\t\tarray(\n\t\t\t\t'element' => $entity,\n\t\t\t)\n\t\t);\n\t\tforeach ($ElementPropertyDT as $ep) {\n\t\t\t$epArray[$ep->getProperty()->getId()][] = $ep->getValue();\n\t\t}\n\n\t\t/**\n\t\t * Получаем значения свойств типа \"файл\"\n\t\t */\n\t\t$ElementPropertyFile = $em->getRepository('NovuscomCMFBundle:ElementPropertyF')->findBy(\n\t\t\tarray(\n\t\t\t\t'element' => $entity,\n\t\t\t)\n\t\t);\n\n\t\t$ElementPropertyFileId = array();\n\t\tforeach ($ElementPropertyFile as $epf) {\n\t\t\t$ElementPropertyFileId[$epf->getProperty()->getId()][$epf->getId()] = $epf->getFile()->getId();\n\t\t}\n\t\techo '<pre>' . print_r($ElementPropertyFileId, true) . '</pre>';\n\t\t$data = array(\n\t\t\t'VALUES' => $epArray,\n\t\t\t'PROPERTY_FILE_VALUES' => $ElementPropertyFileId,\n\t\t\t'LIIP' => $this->get('liip_imagine.cache.manager'),\n\t\t\t'BLOCK_PROPERTIES' => $block->getProperty(),\n\t\t\t'ELEMENT_ENTITY' => $entity,\n\t\t);\n\t\t$form->add('properties', ElementPropertyType::class,\n\t\t\tarray(\n\t\t\t\t//'entry_type' => ElementPropertyType::class,\n\t\t\t\t'label' => 'Свойства',\n\t\t\t\t'mapped' => false,\n\t\t\t\t//'by_reference' => false,\n\t\t\t\t//'allow_add' => true,\n\t\t\t\t//'allow_delete' => true,\n\t\t\t\t//'prototype' => true,\n\t\t\t\t'data' => $data,\n\t\t\t\t//'options' => array('asdasdasdasd'), // не работает\n\t\t\t));\n\n\t\t//$form->add('submit', SubmitType::class, array('label' => 'Сохранить', 'attr' => array('class' => 'btn btn-success')));\n\n\t\treturn $form;\n\t}", "public function uploadFileForm()\n {\n return view('admin.file.uploadFile');\n }", "public function addform()\n\t{\n \n\t\t$this->setMethod('post');\n\t\t $this->setAttrib('enctype', 'multipart/form-data');\n\n\t\t$this->addElement('file', 'upload_image', array( \n\t\t\t'label' => '',\n 'required' => false\n ));\n\n // Add the submit button\n $this->addElement('submit', 'submit', array(\n 'ignore' => true,\n 'label' => 'Submit',\n ));\n\n // And finally add some CSRF protection\n $this->addElement('hash', 'csrf', array(\n 'ignore' => true,\n ));\n\n\n\t}", "public function createForm();", "public function createForm();", "private function createCreateForm(ObjectType $entity)\n {\n $form = $this->createForm(new ObjectTypeType(), $entity, array(\n 'action' => $this->generateUrl('object_objecttype_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Создать'));\n\n return $form;\n }", "private function createCreateForm(TipoCamera $entity)\n {\n $form = $this->createForm(new TipoCameraType(), $entity, array(\n 'action' => $this->generateUrl('tipocamera_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Inserisci'));\n\n return $form;\n }", "private function createCreateForm(Feriado $entity)\n {\n $form = $this->createForm(new FeriadoType(), $entity, array(\n 'action' => $this->generateUrl('feriado_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function createForm()\n {\n }", "public function actionCreate()\n {\n $model = new Gallery();\n $file = new UploadForm();\n $file->imageFile = UploadedFile::getInstance($file, 'imageFile');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($file->upload($model->id, null, $file::TYPE_GALLERY)) {\n $model->image = $file->getNameImage($model->id, null, $file::TYPE_GALLERY);\n $model->save();\n } else {\n $model->image = null;\n $model->save();\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', compact('file', 'model'));\n }\n }", "public function createAction(Request $request)\n {\n $entity = new HomePageSections();\n $form = $this->createForm(new HomePageSectionsType(), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n \n\n $uploadedDirectory = $this->container->getParameter('kernel.root_dir').'/../web/uploads';\n $image=$entity->getImage();\n /*@var $image \\Symfony\\Component\\HttpFoundation\\File\\UploadedFile */\n $image->move($uploadedDirectory, $image->getClientOriginalName());\n $entity->setImage($image->getClientOriginalName());\n \n \n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n \n// $this->get('session')->setFlash('notice','Uploaded');\n \n \n \n return $this->redirect($this->generateUrl('homepagesections_index', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "private function createCreateForm(Vluchten $entity)\n {\n $form = $this->createForm(new VluchtenType(), $entity, array(\n 'action' => $this->generateUrl('vluchten_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function create()\n {\n return view('employees.upload');\n }", "private function createCreateForm(Feed $entity)\n {\n $t1 = new Tag();\n\n $t1->setName('przykladowy');\n $entity->addTag($t1);\n \n $form = $this->createForm(new FeedType(), $entity, array(\n 'action' => $this->generateUrl('create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "protected function form()\n {\n return Admin::form(PlatformFile::class, function (Form $form) {\n\n $form->display('id', 'ID');\n $form->multipleSelect('platform_ids', '主机')->options(Platform::all()->pluck('platform_name', 'id'))->attribute(['required'=>'required']);\n $form->multipleSelect('file_ids', '软件')->options(File::all()->pluck('name', 'id'))->attribute(['required'=>'required']);\n $form->text('upload_path', '上传路径');\n\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n\n $form->setAction('/admin/platform-file-application');\n });\n }", "private function createCreateForm(Utente $entity)\n {\n $form = $this->createForm(new UtenteType(), $entity, array(\n 'action' => $this->generateUrl('utente_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Inspection $entity)\n {\n $form = $this->createForm(new InspectionType(), $entity, array(\n 'action' => $this->generateUrl('inspection_create'),\n 'method' => 'POST'\n ));\n\n $form->add('submit', 'submit', array('label' => 'Enregistrer','attr' => array('class'=>\"btn btn-default\"))); \n \n return $form;\n }", "function patternentity_form($form, &$form_state, $patternentity) {\n $form['pattern_file'] = array(\n '#type' => 'file',\n '#title' => t('Choose a pattern file'),\n '#description' => t('Upload a file, allowed extensions: yaml, xml'),\n ); \n\n\n field_attach_form('patternentity', $patternentity, $form, $form_state);\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Upload'),\n '#weight' => 20,\n );\n\n return $form;\n}", "function newPlatformForm()\n{\n echo '<form action=\"./platform.php?action=add\" method=\"post\" enctype=\"multipart/form-data\" id=\"editForm\">\n <label>Platform Name :</label><input type=\"text\" name=\"name\" /><br />\n <label>Platform Icon :</label><input type=\"file\" value=\"upload\" name=\"icon\" /><br />\n <input type=\"submit\" name=\"submit\" value=\"submit\" />\n </form>';\n}", "public function fileUpload()\n {\n return View::make('file-upload.create');\n }", "public function uploadForm(Application $app)\n {\n $form = $this->getUploadForm($app);\n\n return $app['twig']->render('import/uploadform.html.twig', array(\n 'form' => $form->createView()\n ));\n }", "private function createCreateForm(Endroit $entity)\n {\n $form = $this->createForm(new EndroitType(), $entity, array(\n 'action' => $this->generateUrl('endroit_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function createAction(Request $request)\n {\n $entity = new Fileops();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('fileops_show', array('id' => $entity->getId())));\n }\n\n return $this->render('XarismaBundle:Fileops:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function uploadAction(Request $request)\n {\n $user = $this->getConnectedUser();\n\n $version = new Version();\n $form = $this->createFormBuilder($version)\n ->add('uploadedFile')\n ->add('comment', 'textarea', array('required' => false))\n ->getForm();\n\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n $filename = $request->request->get('name');\n $filetype = $version->getUploadType();\n $size = $version->getUploadSize();\n\n $folder = null;\n $folderId = $request->request->get('folderId');\n if (is_numeric($folderId)) {\n $folder = $em->getRepository('TimeBoxMainBundle:Folder')->findOneById($folderId);\n }\n\n $existingFile = $em->getRepository('TimeBoxMainBundle:File')->findOneBy(array(\n 'user' => $user,\n 'folder' => $folder,\n 'name' => $filename,\n 'type' => $filetype,\n 'isDeleted' => false\n ));\n\n $versionDisplayId = 1;\n\n if (!$existingFile) {\n $file = new File();\n $file->setUser($user);\n $file->setName($filename);\n $file->setType($filetype);\n $file->setFolder($folder);\n $file->setTotalSize($size);\n $em->persist($file);\n $em->flush();\n }\n else {\n $file = $existingFile;\n $file->setTotalSize($file->getTotalSize() + $size);\n $lastVersion = $em->getRepository('TimeBoxMainBundle:Version')->findOneBy(\n array('file' => $file),\n array('displayId' => 'DESC')\n );\n $versionDisplayId = $lastVersion->getDisplayId() + 1;\n }\n\n $version->setDate(new \\DateTime);\n $version->setFile($file);\n $version->setSize($size);\n $version->setDisplayId($versionDisplayId);\n $version->setDescription(\"Uploaded file\");\n\n $user->setStorage(max($user->getStorage() + $size, 0));\n\n $em->persist($user);\n $em->persist($version);\n $em->flush();\n\n return $this->redirect($this->generateUrl('time_box_main_file'));\n }\n\n return array(\n 'form' => $form->createView(),\n 'folderId' => $request->request->get('folderId')\n );\n }", "function form_create($model, $options = array()) {\n $defaults = array(\n 'type' => false,\n 'method' => 'post',\n 'action' => BASE . $_GET['url']\n );\n\n $options = array_merge($defaults, $options);\n\n $output = '<form id=\"' . ucfirst(strtolower($model)) . 'Form\"';\n if($options['type'] == 'file') {\n $output .= ' enctype=\"multipart/form-data\"';\n }\n\n $output .= ' method=\"' . $options['method'] . '\"';\n $output .= ' action=\"' . $options['action'] . '\">';\n\n return html__output($output);\n}", "private function createCreateForm(ActionListe $entity)\n {\n $form = $this->createForm(new ActionListeType(), $entity, array(\n 'action' => $this->generateUrl('actionliste_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Ajouter'));\n\n return $form;\n }", "private function createCreateForm(SyntaxonCore $entity)\n {\n $form = $this->createForm(new SyntaxonCoreType(), $entity, array(\n 'action' => $this->generateUrl('admin_syntaxon_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Compte $entity)\n {\n $form = $this->createForm(new CompteType(), $entity, array(\n 'action' => $this->generateUrl('compte_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Créer'));\n\n return $form;\n }", "public function createAction(Request $request)\n {\n $entity = new SkIdentificationModule();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n// $entity->upload();\n\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('identification_module_admin_edit', array('id' => $entity->getId())));\n }\n\n return $this->render('SkaphandrusAppBundle:SkIdentificationModule:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "private function createCreateForm(User $entity)\n {\n $form = $this->createForm(new UserType(), $entity, array(\n 'action' => $this->generateUrl('api_user_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function create()\n {\n return view('upload.test');\n }", "protected function _createEntity()\n\t\t{\n\t\t\t// Form template name.\n\t\t\t$separator = '__';\n\t\t\t$template = $type = $this->_createForm->type->getValue();\n\t\t\t$subject = $this->_createForm->subject->getValue();\n\t\t\tif ( $platformId = $this->_createForm->platform_id->getValue() ) {\n\t\t\t\t$platform = Table::_( 'platforms' )->get( $platformId );\n\t\t\t\t$template = $platform->name . $separator . $template;\n\t\t\t}\n\t\t\tif ( $pluginId = $this->_createForm->plugin_id->getValue() ) {\n\t\t\t\t$filter = new D_Filter_PluginDirectory();\n\t\t\t\t$plugin = Table::_( 'plugins' )->get( $pluginId );\n\t\t\t\t$template = str_replace( '-', '_', $filter->filter( $plugin->name ) ) . $separator . $template;\n\t\t\t}\n\t\t\t$template .= '.phtml';\n\t\t\t// Write a file.\n\t\t\t$directory = $this->_getTypeDirectory( $type );\n\t\t\tif ( !file_exists( $directory . $template ) ) {\n\t\t\t\tfile_put_contents(\n\t\t\t\t\t$directory . $template,\n\t\t\t\t\t$this->_createForm->content->getValue()\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Save a subject.\n\t\t\t$settingId = Model::_( 'settings' )->setting( $template . '[email subject]' );\n\t\t\tModel::_( 'settings' )->string( $settingId, $subject );\n\t\t}", "private function createCreateForm(PicFooter $entity)\n {\n $form = $this->createForm(new PicFooterType(), $entity, array(\n 'action' => $this->generateUrl('picfooter_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Project $entity)\n {\n $form = $this->createForm(new ProjectType(), $entity);\n $form->add('submit', 'submit', array('label' => 'Create'));\n return $form;\n }", "private function createCreateForm(Grupos $entity)\n {\n $form = $this->createForm(new GruposType(), $entity, array(\n 'action' => $this->generateUrl('grupos_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Criar'));\n\n return $form;\n }", "private function createCreateForm(IntrestConfig $entity) {\n\t\t$form = $this->createForm(new IntrestConfigType(), $entity, array(\n\t\t\t'action' => $this->generateUrl('member_intrestconfig_create'),\n\t\t\t'method' => 'POST',\n\t\t));\n\n\t\t$form->add('submit', 'submit', array('label' => 'Create'));\n\n\t\treturn $form;\n\t}", "public function newAction()\n {\n //Get the entity manager.\n $em = $this->get('doctrine.orm.entity_manager'); \n \n //Get the list of categories as an array. \n $categories = $em->getRepository('JobeetBundle:JobeetCategory')\n ->getCategoriesAsOptions(); \n \n //Set up the form.\n $job = new JobeetJob();\n $form = JobForm::create($categories, $job, $this->get('validator')); \n \n //If a POST, process the form and persist it if valid.\n $request = $this->get('request');\n if ('POST' === $request->getMethod()) {\n //Register an event subscriber to index the job.\n $em->getEventManager()->addEventSubscriber(new LuceneListener($this->get('lucene_search')));\n \n $params = $request->request->get('job'); \n \n //Get the category object.\n $params['category'] = $em->getReference('JobeetBundle:JobeetCategory', $params['category']); \n \n //TODO:VALIDATE HERE\n \n //Get uploaded files and bind the form.\n $files = $request->files->get('job'); \n //unset($params['category_id']);\n $form->bind($params, $files);\n \n //If there is a logo uploaded, move it to the uploads dir.\n if($files['logo']['file']) { \n $name = uniqid().'-'.$files['logo']['file']->getOriginalName();\n $files['logo']['file']->move($this->container->getParameter('frontend.logos_dir')); \n $files['logo']['file']->rename($name); \n }\n else {\n $name = '';\n } \n \n //Set the logo filename and persist the entity.\n $job->setLogo($name); \n $em->persist($job); \n $em->flush();\n }\n \n return $this->render('FrontendBundle:Job:new.twig', array('form' => $form));\n }", "private function createCreateForm(Aula $entity)\n {\n $form = $this->createForm(new AulaType(), $entity, array(\n 'action' => $this->generateUrl('aulas_aula_create'),\n 'method' => 'POST',\n ));\n $form->add('submit', 'submit', array('label' => 'Crear','attr'=>array('class'=>'btn btn-default botonTabla')));\n $form->add('button', 'submit', array('label' => 'Volver a la lista','attr'=>array('formaction'=>'../aula','formnovalidate'=>'formnovalidate','class'=>'btn btn-default botonTabla')));\n return $form;\n }", "public function create()\n {\n //加载文件上传模板\n return view(\"Admin.Req.files\");\n }", "abstract public function createForm();", "abstract public function createForm();", "private function createCreateForm(LocalBanner $entity)\n {\n $form = $this->createForm(new LocalBannerType(), $entity, array(\n 'action' => $this->generateUrl('localbanner_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => $this->get('translator')->transChoice('txt.gravar',0,array(),'messagesCommonBundle'), 'attr' => array('class' => 'btn btn-primary btn-lg')));\n\n return $form;\n }", "private function createCreateForm(User $entity)\n {\n $form = $this->createForm(new UserType(), $entity, array(\n 'action' => $this->generateUrl('user_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function createAction()\n {\n// $this->view->form = $form;\n }", "function Trigger_FileUpload(&$tNG) {\n $uploadObj = new tNG_FileUpload($tNG);\n $uploadObj->setFormFieldName(\"taptinquangcao\");\n $uploadObj->setDbFieldName(\"taptinquangcao\");\n $uploadObj->setFolder(\"../images/quangcao/\");\n $uploadObj->setMaxSize(5000);\n $uploadObj->setAllowedExtensions(\"jpg, gif, png, swf\");\n $uploadObj->setRename(\"auto\");\n return $uploadObj->Execute();\n}", "private function createCreateForm(Todoitems $entity)\n {\n \n $form = $this->createForm(new TodoitemsType(), $entity, array(\n 'action' => $this->generateUrl('todoitems_create'),\n 'method' => 'POST',\n 'id' => $this->getUser()->getId()\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function createAction(Request $request)\n {\n\n $user = $this->get('security.context')->getToken()->getUser();\n\n $entity = new Education();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n $entity->upload();\n $entity->setUser($user);\n\n $em->persist($entity);\n $em->flush();\n $this->get('session')->getFlashBag()->add(\n 'success',\"Data has been inserted successfully\"\n );\n return $this->redirect($this->generateUrl('education_show', array('id' => $entity->getId())));\n }\n\n return $this->render('SyndicateComponentBundle:Education:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "private function getUploadForm(Application $app, $data = null)\n {\n $form = $app['form.factory']\n ->createBuilder('form', $data)\n ->add('name', 'text', array(\n 'label' => 'Geef uw dataset een herkenbare naam',\n 'required' => true,\n 'constraints' => array(\n new Assert\\NotBlank(),\n new Assert\\Regex(array(\n 'pattern' => '/^[a-z0-9-\\s]+$/i',\n 'htmlPattern' => '^[a-z0-9-\\s]+$',\n 'match' => true,\n 'message' => 'Voer alleen letters of cijfers in',\n )),\n new Assert\\Length(array('min' => 1, 'max' => 123))\n )\n ))\n ->add('delimiter', 'text', array(\n 'label' => 'Wat is het scheidingsteken van de kolommen in uw dataset?',\n 'required' => false,\n 'constraints' => array(\n new Assert\\Length(array('min' => 1, 'max' => 2))\n ),\n 'attr' => array(\n 'placeholder' => 'bv , of ; ',\n 'class' => 'narrow'\n )\n ))\n /*->add('enclosure_character', 'text', array(\n 'label' => 'Worden de velden \"enclosed\" door een bepaald teken?',\n 'required' => false,\n 'constraints' => array(\n new Assert\\Length(array('min' => 1, 'max' => 1))\n ),\n 'attr' => array(\n 'class' => 'narrow'\n )\n ))*/\n /*->add('escape_character', 'text', array(\n 'label' => 'Is er een bepaald karakter dat \"escaped\" moet worden?',\n 'required' => false,\n 'constraints' => array(\n new Assert\\Length(array('min' => 1, 'max' => 1))\n ),\n 'attr' => array(\n 'class' => 'narrow'\n )\n ))*/\n ->add('skip_first_row', 'choice', array(\n 'label' => 'Bevat de eerste rij de kolomnamen?',\n 'required' => true,\n 'choices' => array(1 => 'Ja', 0 => 'Nee'),\n 'constraints' => array(\n new Assert\\Type('integer')\n )\n ))\n ->add('csvFile', 'file', array(\n 'label' => 'Kies een csv-bestand op uw computer',\n 'required' => true,\n 'constraints' => array(\n new Assert\\NotBlank(),\n new Assert\\File(array(\n 'maxSize' => '40M',\n 'mimeTypes' => array('text/csv', 'text/plain'),\n )),\n new Assert\\Type('file')\n )\n ))\n ->getForm();\n\n return $form;\n }", "public function getFormId() { \n return 'imageUploader'; //an unique id of your form\n \n }", "private function createCreateForm(Acc $entity)\n {\n $form = $this->createForm(new AccType(), $entity, array(\n 'action' => $this->generateUrl('acc_create'),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Task $entity)\n {\n //$form = $this->createForm(new TaskType(), $entity, array( \n //pero para Symfony3.4.15 ahora es:\n $form = $this->createForm(TaskType::class, $entity, array( \n 'action' => $this->generateUrl('infunisa_task_create'),\n 'method' => 'POST'\n ));\n \n return $form;\n }", "public function CreateForm();", "public function shortcodeUploadImage()\n {\n if ($this->settings->has('formerror')) {\n $form = $this->model->getSubmittedForm();\n } else {\n $form = $this->model->getNewForm();\n }\n\n return $this->view->fetch('upload.html.twig', ['form' => $form->createView()]);\n }", "private function createCreateForm(Incapacidad $entity)\n {\n $form = $this->createForm(new IncapacidadType(), $entity, array(\n 'action' => $this->generateUrl('admin_incapacidad_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Guardar','attr'=>\n array('class'=>'btn btn-primary btn-sm')\n ));\n\n return $form;\n }", "private function createCreateForm(Functions $entity) {\n $session = $this->get(\"session\");\n $form = $this->createForm(new FunctionsType(), $entity, array(\n 'action' => $this->generateUrl('hall_create'),\n 'method' => 'POST',\n \n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Menu $entity)\n {\n $translated = $this->get('translator');\n $form = $this->createForm(new MenuType(), $entity, array(\n 'action' => $this->generateUrl('menu_create'),\n 'method' => 'POST',\n ));\n\n $form->add('button', 'button', array('label' => $translated->transChoice('txt.gravar',0,array(),'messagesCommonBundle'), 'attr' => array('class' => 'btn btn-primary btn-lg','ng-click'=>'saveMenu()')));\n\n return $form;\n }", "function mongo_node_bundle_create_form($form, $form_state, $entity_type) {\n $form = array();\n\n $form['label'] = array(\n '#type' => 'textfield',\n '#title' => t('Entity type'),\n '#description' => t('The human readable name of the entity.'),\n );\n\n $form['name'] = array(\n '#type' => 'machine_name',\n '#required' => FALSE,\n '#machine_name' => array(\n 'exists' => '_mongo_node_bundle_exists',\n 'source' => array('label'),\n ),\n );\n\n $form['description'] = array(\n '#type' => 'textarea',\n '#title' => t('Description'),\n '#description' => t('Describe this bundle.'),\n );\n\n $form['entity_type'] = array(\n '#type' => 'value',\n '#value' => $entity_type,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n\n return $form;\n}", "public function getCreationForm()\n {\n return new ProductForm;\n }", "private function createCreateForm(Encuesta $entity)\n {\n $form = $this->createForm(new EncuestaType(), $entity, array(\n 'action' => $this->generateUrl('encuesta_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(DevisSetup $entity)\n {\n $form = $this->createForm(new DevisSetupType(), $entity, array(\n 'action' => $this->generateUrl('devissetup_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(User $entity)\n {\n $form = $this->createForm(\n new UserType(),\n $entity,\n array(\n 'action' => $this->generateUrl('vipa_admin_user_create'),\n 'method' => 'POST'\n )\n );\n\n return $form;\n }", "private function createCreateForm(SkBusiness $entity) {\n $form = $this->createForm(new SkBusinessType(), $entity, array(\n 'action' => $this->generateUrl('business_admin_create'),\n 'method' => 'POST',\n ));\n\n// $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function create($input) {\n return Upload::create($input);\n }", "function create_new(){\n\t\tif($this->request->post() && ($d = $this->form->validate($this->params))){\n\t\t\tclass_exists(\"TemporaryFileUpload\"); // make sure that all the relevant constants are defined\n\n\t\t\tif(!TEMPORARY_FILE_UPLOADS_ENABLED){\n\t\t\t\t$this->_report_fail(_(\"Temporary file uploading is not enabled\"),array(\n\t\t\t\t\t\"status_code\" => 403\n\t\t\t\t));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$file = $d[\"file\"];\n\n\t\t\tif($file->getTotalFileSize() > TEMPORARY_FILE_UPLOADS_MAX_FILESIZE){\n\t\t\t\t$this->_report_fail(sprintf(_(\"The file exceeds the maximum file size, which is %s\"),$this->_format_bytes(TEMPORARY_FILE_UPLOADS_MAX_FILESIZE)));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// TODO: To be removed...\n\t\t\tif($file->getFileName()==\"error.txt\"){\n\t\t\t\t$this->_report_fail(\"Testing error message!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif($file->chunkedUpload()){\n\t\t\t\t$token = $file->getToken();\n\t\t\t\tif($file->firstChunk()){\n\t\t\t\t\t$temporary_file_upload = TemporaryFileUpload::CreateNewRecordByHttpUploadedFile($file);\n\t\t\t\t\t$this->session->s(\"temporary_file_upload_id_$token\",$temporary_file_upload->getId());\n\n\t\t\t\t\t$this->_selfclean();\n\t\t\t\t}else{\n\t\t\t\t\t$id = $this->session->g(\"temporary_file_upload_id_$token\");\n\t\t\t\t\tif(is_null($id)){\n\t\t\t\t\t\t$this->_report_fail(_(\"Error 1\"));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$temporary_file_upload = TemporaryFileUpload::GetInstanceById($id);\n\t\t\t\t\tif(!$temporary_file_upload){\n\t\t\t\t\t\t$this->_report_fail(_(\"Error 2\"));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$full_path = $temporary_file_upload->getFullPath();\n\t\t\t\t\tif(!file_exists($full_path)){\n\t\t\t\t\t\t$this->_report_fail(_(\"Error 3 (file $full_path doen't exist)\"));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$temporary_file_upload->appendChunk($file);\n\t\t\t\t\tunlink($file->getTmpFileName());\n\t\t\t\t}\n\t\t\t}else{\n\n\t\t\t\t$temporary_file_upload = TemporaryFileUpload::CreateNewRecordByHttpUploadedFile($file);\n\n\t\t\t\t$this->_selfclean();\n\n\t\t\t}\n\n\t\t\t// the mime type is verified at the upload end\n\t\t\tif($temporary_file_upload->fullyUploaded()){\n\t\t\t\t$mime_type = Files::DetermineFileType($temporary_file_upload->getFullPath(),[\"original_filename\" => $temporary_file_upload->getFilename()]);\n\t\t\t\tif($mime_type && $temporary_file_upload->getMimeType()!==$mime_type){\n\t\t\t\t\t$temporary_file_upload->s(\"mime_type\",$mime_type);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->api_data = $this->_dump_temporary_file_upload($temporary_file_upload);\n\t\t}\n\t}", "private function createCreateForm(SkIdentificationModule $entity)\n {\n $form = $this->createForm(new SkIdentificationModuleType(), $entity, array(\n 'action' => $this->generateUrl('identification_module_admin_create'),\n 'method' => 'POST',\n ));\n\n // $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Invoice $entity)\n {\n $form = $this->createForm(new InvoiceType(), $entity, array(\n 'action' => $this->generateUrl('invoice_create'),\n 'method' => 'POST',\n ));\n\n // $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Equipo $entity)\n {\n $form = $this->createForm(new EquipoType(), $entity, array(\n 'action' => $this->generateUrl('tecnoequipo_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createEditForm(Fileops $entity)\n {\n $form = $this->createForm(new FileopsType(), $entity, array(\n 'action' => $this->generateUrl('fileops_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createCreateForm(Event $entity)\n {\n $eventType = new EventType();\n $form = $this->createForm($eventType, $entity, array(\n 'attr' => ['id' => $eventType->getName() . \"_id\"],\n 'action' => $this->generateUrl('event_create'),\n 'method' => 'POST',\n ));\n\n return $form;\n }", "private function createCreateForm(Servicio $entity)\n {\n $securityContext = $this->container->get('security.context');\n $form = $this->createForm(new ServicioType($securityContext), $entity, array(\n 'action' => $this->generateUrl('administracion_servicio_create'),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(User $entity)\n {\n $form = $this->createForm(new UserType(), $entity, array(\n 'action' => $this->generateUrl('usuarios_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function uploadAction()\n {\n // default file URI\n $defaultUri = $this->_config->urlBase . 'files/';\n\n // store for sparql queries\n $store = $this->_owApp->erfurt->getStore();\n\n // DMS NS var\n $dmsNs = $this->_privateConfig->DMS_NS;\n\n // check if DMS needs to be imported\n if ($store->isModelAvailable($dmsNs) && $this->_privateConfig->import_DMS) {\n $this->_checkDMS();\n }\n\n $url = new OntoWiki_Url(\n array('controller' => 'files', 'action' => 'upload'),\n array()\n );\n\n // check for POST'ed data\n if ($this->_request->isPost()) {\n $event = new Erfurt_Event('onFilesExtensionUploadFile');\n $event->request = $this->_request;\n $event->defaultUri = $defaultUri;\n // process upload in plugin\n $eventResult = $event->trigger();\n if ($eventResult === true) {\n if (isset($this->_request->setResource)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('File attachment added', OntoWiki_Message::SUCCESS)\n );\n $resourceUri = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n $resourceUri->setParam('r', $this->_request->setResource, true);\n $this->_redirect((string)$resourceUri);\n } else {\n $url->action = 'manage';\n $this->_redirect((string)$url);\n }\n }\n }\n\n $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('Upload File'));\n OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n $toolbar = $this->_owApp->toolbar;\n $url->action = 'manage';\n $toolbar->appendButton(\n OntoWiki_Toolbar::SUBMIT, array('name' => 'Upload File')\n );\n $toolbar->appendButton(\n OntoWiki_Toolbar::EDIT, array('name' => 'File Manager', 'class' => '', 'url' => (string)$url)\n );\n\n $this->view->defaultUri = $defaultUri;\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n $url->action = 'upload';\n $this->view->formActionUrl = (string)$url;\n $this->view->formMethod = 'post';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formName = 'fileupload';\n $this->view->formEncoding = 'multipart/form-data';\n if (isset($this->_request->setResource)) {\n // forward URI to form so we can redirect later\n $this->view->setResource = $this->_request->setResource;\n }\n\n if (!is_writable($this->_privateConfig->path)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('Uploads folder is not writable.', OntoWiki_Message::WARNING)\n );\n return;\n }\n\n // FIX: http://www.webmasterworld.com/macintosh_webmaster/3300569.htm\n header('Connection: close');\n }", "private function createCreateForm(MedicamentosSuministrados $entity) {\n \n $form = $this->createForm(new MedicamentosSuministradosType(), $entity, array(\n 'action' => $this->generateUrl('medicamentossuministrados_create'),\n 'method' => 'POST',\n 'attr' => array('class' => 'form-horizontal'),\n ));\n\n return $form;\n }" ]
[ "0.72410274", "0.7216413", "0.70136243", "0.6950677", "0.6893278", "0.68839616", "0.6779783", "0.6729024", "0.6714097", "0.66836065", "0.65154815", "0.6403051", "0.63459665", "0.63426125", "0.63268906", "0.6323754", "0.6299349", "0.62947685", "0.6259411", "0.62063897", "0.6185763", "0.61833537", "0.6174076", "0.6167679", "0.6160691", "0.61514264", "0.6144943", "0.61418486", "0.61331713", "0.6132169", "0.61312747", "0.61312747", "0.6114647", "0.61130476", "0.6093992", "0.6070967", "0.60612506", "0.60602766", "0.6054653", "0.6054018", "0.60241973", "0.6011997", "0.60082257", "0.5991407", "0.59770256", "0.59748125", "0.5964576", "0.5960017", "0.59595925", "0.59574926", "0.59444755", "0.59263587", "0.59236026", "0.5902127", "0.5893758", "0.58919454", "0.58898956", "0.5888761", "0.58813053", "0.5879048", "0.58703446", "0.5861402", "0.58573014", "0.58465034", "0.5845065", "0.5838277", "0.58362824", "0.58362824", "0.58293754", "0.5821957", "0.58178544", "0.58167136", "0.58099866", "0.5808882", "0.5807061", "0.58049774", "0.5796743", "0.5794015", "0.57930624", "0.5791895", "0.5790174", "0.57874733", "0.5780552", "0.5776295", "0.57761014", "0.5772507", "0.5768566", "0.57595336", "0.57590735", "0.5756188", "0.57558423", "0.5753977", "0.5753034", "0.57480514", "0.5745224", "0.5736089", "0.5736075", "0.57301486", "0.57250065", "0.5723808" ]
0.794489
0
Displays a form to create a new Upload entity.
public function newAction() { $entity = new Upload(); $form = $this->createCreateForm($entity); return $this->render('MHProductsBundle:Upload:new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new UploadForm();\n\n if (Yii::$app->request->isPost) {\n $model->uploadedFile = UploadedFile::getInstance($model, 'uploadedFile');\n if ($model->upload()) {\n // file is uploaded successfully\n $model->uploadedFile = UploadedFile::reset();\n Yii::$app->session->setFlash('success', 'File uploaded');\n $this->goBack('index');\n } else {\n Yii::$app->session->setFlash('error', 'File Not uploaded');\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n\t $uploadtypename = Tbluploadtypes::all();\t \n\t\treturn view('admin.upload.create', compact('uploadtypename'));\n\t}", "public function createAction(Request $request)\n {\n $entity = new Upload();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $entity->upload();\n $em->flush();\n\n return $this->redirect($this->generateUrl('admin_uploads'));\n }\n\n return $this->render('MHProductsBundle:Upload:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('upload');\n }", "public function create()\n {\n return view('pages.upload');\n }", "public function create()\n {\n return view('product.upload');\n }", "public function createAction()\n {\n $entity = new File();\n $request = $this->getRequest();\n $form = $this->createForm(new FileType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('hypo_test_file_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function create() {\n $this->data['title'] = PAGE_TITLES['uploads/create'];\n unset($_SESSION['flash']);\n unset($_SESSION['status']);\n $this->destroyToken();\n $this->data['token'] = $this->generateToken();\n return $this->view('uploads/create', $this->data);\n }", "public function renderUploadForm() {}", "public function create()\n\t{\n\t\t$this->auth->restrict('Upload.Developer.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_upload())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_create_record').': ' . $insert_id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_create_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('upload', 'upload.js');\n\n\t\tTemplate::set('toolbar_title', lang('upload_create') . ' Upload');\n\t\tTemplate::render();\n\t}", "public function uploadAction() {\n $imgId = $this->getInput('imgId');\n $this->assign('imgId', $imgId);\n $this->getView()\n ->display('common/upload.phtml');\n }", "private function createCreateForm(Upload $entity)\n {\n $form = $this->createForm(new UploadType(), $entity, array(\n 'action' => $this->generateUrl('admin_uploads_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create', 'attr' => array('class' => 'btn btn-success')));\n\n return $form;\n }", "public function create()\n {\n return view('employees.upload');\n }", "public function uploadingForm()\n {\n return view('formuploads.formupload');\n\n }", "public function fileUpload()\n {\n return View::make('file-upload.create');\n }", "public function createForm() {\n module_load_include('inc', 'islandora_form_builder', 'FormGenerator');\n $form_values = &$this->formState['values'];\n $file = isset($form_values['ingest-file-location']) ? $form_values['ingest-file-location'] : '';\n $form['#attributes']['enctype'] = 'multipart/form-data';\n $form['indicator']['ingest-file-location'] = array(\n '#type' => 'file',\n '#title' => t('Upload Document'),\n '#size' => 48,\n '#description' => t('Select file to be added the the object.'),\n );\n $form_generator = FormGenerator::CreateFromModel($this->contentModelPid, $this->contentModelDsid);\n $form[FORM_ROOT] = $form_generator->generate($this->formName); // TODO get from user .\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Ingest'),\n '#prefix' => t('Please be patient. Once you click next there may be a number of files created. ' .\n 'Depending on your content model this could take a few minutes to process.<br />')\n );\n return $form;\n }", "public function uploadFileForm()\n {\n return view('admin.file.uploadFile');\n }", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function newAction()\n {\n $entity = new File();\n $form = $this->createForm(new FileType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function actionCreate()\n {\n $model = new Gallery();\n $file = new UploadForm();\n $file->imageFile = UploadedFile::getInstance($file, 'imageFile');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($file->upload($model->id, null, $file::TYPE_GALLERY)) {\n $model->image = $file->getNameImage($model->id, null, $file::TYPE_GALLERY);\n $model->save();\n } else {\n $model->image = null;\n $model->save();\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', compact('file', 'model'));\n }\n }", "public function create()\n {\n return view('upload_file.home', get_defined_vars());\n }", "public function create()\n {\n return view('admins.Bookupload.create');\n }", "public function create()\n {\n //加载文件上传模板\n return view(\"Admin.Req.files\");\n }", "public function actionCreate()\n {\n $model = new File();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.files.create');\n\t}", "public function create()\n {\n return view ('admin.files.create');\n }", "public function create()\n {\n return view('upload.test');\n }", "public function UploadForm()\n {\n return Form::create($this, \"UploadForm\",\n FieldList::create(\n FileField::create(\"XMLFile\", 'Wordpress XML file'),\n HiddenField::create(\"BlogHolderID\", '', $this->getBlogHolderID())\n ),\n FieldList::create(\n FormAction::create('doUpload', 'Import Wordpress XML file')\n )\n );\n }", "public function create()\n {\n return view('games.upload');\n }", "public function create()\n {\n return view('admin.files.create');\n }", "public function actionCreate() {\n\t\t$model = new Menu ();\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () )) {\n\t\t\t$model->create_user_id = \\Yii::$app->user->id;\n\t\t\t$model->file = UploadedFile::getInstance ( $model, 'file' );\n\t\t\t$model->file->saveAs ( 'uploads/' . $model->file->baseName . '.' . $model->file->extension );\n\t\t\tif ($model->save ()) {\n\t\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t\t'view',\n\t\t\t\t\t\t'id' => $model->id \n\t\t\t\t] );\n\t\t\t} else {\n\t\t\t\tprint_r ( $model->getErrors () );\n\t\t\t\texit ();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->render ( 'create', [ \n\t\t\t\t'model' => $model \n\t\t] );\n\t}", "public function createAction()\n {\n $request = $this->getRequest();\n $em = $this->getDoctrine()->getManager();\n\n $form = $this->createForm(new ImageType(), new ImageModel(new Image()));\n\n $path = $this->container->getParameter('blog.upload_dir');\n if (!file_exists($path)) {\n @mkdir($path, 0777, true);\n }\n $path = realpath($path);\n $formHandler = new ImageHandler($form, $request, new Image(), $em, $path);\n if ($formHandler->process()) {\n return $this->redirect($this->generateUrl('_blog_backend_image'));\n }\n\n return array(\n 'form' => $form->createView(),\n );\n }", "public function create()\n\t{\n\t\t//\n\t\treturn view('Gallery/Admin/form');\n\t}", "public function shortcodeUploadImage()\n {\n if ($this->settings->has('formerror')) {\n $form = $this->model->getSubmittedForm();\n } else {\n $form = $this->model->getNewForm();\n }\n\n return $this->view->fetch('upload.html.twig', ['form' => $form->createView()]);\n }", "public function upload()\n {\n return view('pages.upload');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('files.import');\n }", "public function create() {\n return view('files::create');\n }", "public function create()\n {\n return view('files.create');\n }", "public function newAction()\n {\n $entity = new GalleryImage();\n $form = $this->createForm(new GalleryImageType(), $entity);\n\n return $this->render('HamdiMediaBundle:GalleryImage:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function actionCreate()\n {\n $model = new Admin();\n if ($model->load(Yii::$app->request->post())) {\n $imageUploadFile = UploadedFile::getInstance($model,'img');\n if($imageUploadFile != null ){\n $saveUrl = $this->qiniu($imageUploadFile);\n $model->img = $saveUrl;\n }\n $model->save();\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function addform()\n\t{\n \n\t\t$this->setMethod('post');\n\t\t $this->setAttrib('enctype', 'multipart/form-data');\n\n\t\t$this->addElement('file', 'upload_image', array( \n\t\t\t'label' => '',\n 'required' => false\n ));\n\n // Add the submit button\n $this->addElement('submit', 'submit', array(\n 'ignore' => true,\n 'label' => 'Submit',\n ));\n\n // And finally add some CSRF protection\n $this->addElement('hash', 'csrf', array(\n 'ignore' => true,\n ));\n\n\n\t}", "public function addAction()\n {\n \t$form = MediaForm::create($this->get('form.context'), 'media');\n\n \treturn $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => new Media()));\n }", "public function actionCreate()\n {\n $model = new Photo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function newAction()\n {\n //Get the entity manager.\n $em = $this->get('doctrine.orm.entity_manager'); \n \n //Get the list of categories as an array. \n $categories = $em->getRepository('JobeetBundle:JobeetCategory')\n ->getCategoriesAsOptions(); \n \n //Set up the form.\n $job = new JobeetJob();\n $form = JobForm::create($categories, $job, $this->get('validator')); \n \n //If a POST, process the form and persist it if valid.\n $request = $this->get('request');\n if ('POST' === $request->getMethod()) {\n //Register an event subscriber to index the job.\n $em->getEventManager()->addEventSubscriber(new LuceneListener($this->get('lucene_search')));\n \n $params = $request->request->get('job'); \n \n //Get the category object.\n $params['category'] = $em->getReference('JobeetBundle:JobeetCategory', $params['category']); \n \n //TODO:VALIDATE HERE\n \n //Get uploaded files and bind the form.\n $files = $request->files->get('job'); \n //unset($params['category_id']);\n $form->bind($params, $files);\n \n //If there is a logo uploaded, move it to the uploads dir.\n if($files['logo']['file']) { \n $name = uniqid().'-'.$files['logo']['file']->getOriginalName();\n $files['logo']['file']->move($this->container->getParameter('frontend.logos_dir')); \n $files['logo']['file']->rename($name); \n }\n else {\n $name = '';\n } \n \n //Set the logo filename and persist the entity.\n $job->setLogo($name); \n $em->persist($job); \n $em->flush();\n }\n \n return $this->render('FrontendBundle:Job:new.twig', array('form' => $form));\n }", "public function index()\n {\n \n //take me to houses upload\n return view('formuploads.formupload');\n\n }", "public function actionCreate()\n {\n $model = new Catalog2();\n $image = new ImageUpload();\n $image->imageRoot = 'catalog2/small/'; \n\n if ($model->load(Yii::$app->request->post()) && $model->uniqAlias()) {\n \n $image->imageFile = UploadedFile::getInstance($image, 'imageFile');\n \n if ($image->upload($model->alias) && $model->save()) return $this->redirect(['view', 'id' => $model->id]);\n }\n\n {\n return $this->render('create', [\n 'model' => $model,\n 'image' => $image,\n ]);\n }\n }", "public function uploadfiles()\n {\n return view ('filemanager.uploadfile'); \n }", "public function actionCreate()\n {\n $model = new UserScreening();\n if(Yii::$app->request->isPost)\n { $model->load(Yii::$app->request->post());\n $model->file = UploadedFile::getInstance($model, 'file');\n $filename = Yii::$app->security->generateRandomString(32) . '_' . $model->file->baseName . '.' . $model->file->extension;\n $bool_saved = $model->file->saveAs(Yii::getAlias('@webroot').'/../uploads/' . $filename);\n if($bool_saved)\n {\n $model->status = 0;\n $model->cv = $filename;\n $model->file = null; // So that on saving it should not look for it again\n if($model->save()) {\n return $this->redirect(Url::to(['user-screening/index']));\n }\n else {\n throw new ErrorException(Json::encode($model->getErrors()));\n }\n }\n else {\n echo \"Error in uploading file\" ; exit;\n }\n }\n else\n {\n $model = new UserScreening();\n return $this->render('create', [\n 'model' => $model\n ]);\n }\n }", "public function newAction()\n {\n if (!$this->get('security.context')->isGranted('ROLE_ADMIN') ) {\n return $this->redirect($this->generateUrl('error'), 302); \n }\n $entity = new Grupos();\n $form = $this->createCreateForm($entity);\n\n return $this->render('SytemSGBundle:Grupos:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function createAction(Request $request)\n {\n $entity = new Fileops();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('fileops_show', array('id' => $entity->getId())));\n }\n\n return $this->render('XarismaBundle:Fileops:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function getUploadfile()\n {\n return view(\"Admin::employee.uploadfile\");\n }", "public function create()\n\t{\n\t\treturn View::make('file.create');\n\t}", "public function create()\n {\n return view('upload_pelatihan.form_tambah');\n }", "public function actionCreate()\n {\n $us = Usuarios::find()->where(['id' => Yii::$app->user->id])->one();\n if ($us->rol !== 'C' && $us->rol !== 'V') {\n return $this->goHome();\n }\n $model = new Uniformes();\n\n $model->colegio_id = $us->colegio_id;\n if ($model->load(Yii::$app->request->post())) {\n $model->foto = UploadedFile::getInstance($model, 'foto');\n if ($model->save() && $model->upload()) {\n if ($us->rol === 'V') {\n return $this->redirect(['index']);\n }\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function newAction()\n {\n $entity = new Fluidite();\n $form = $this->createCreateForm($entity);\n\n return $this->render('GestionPassBundle:Fluidite:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction() {\n\n $entity = $this->get('admin.helper.ClothingType')->createNew();\n $form = $this->createForm(new ClothingTypes('add',$entity), $entity);\n return $this->render('LoveThatFitAdminBundle:ClothingType:new.html.twig', array(\n 'form' => $form->createView()));\n }", "public function uploadAction()\n {\n // default file URI\n $defaultUri = $this->_config->urlBase . 'files/';\n\n // store for sparql queries\n $store = $this->_owApp->erfurt->getStore();\n\n // DMS NS var\n $dmsNs = $this->_privateConfig->DMS_NS;\n\n // check if DMS needs to be imported\n if ($store->isModelAvailable($dmsNs) && $this->_privateConfig->import_DMS) {\n $this->_checkDMS();\n }\n\n $url = new OntoWiki_Url(\n array('controller' => 'files', 'action' => 'upload'),\n array()\n );\n\n // check for POST'ed data\n if ($this->_request->isPost()) {\n $event = new Erfurt_Event('onFilesExtensionUploadFile');\n $event->request = $this->_request;\n $event->defaultUri = $defaultUri;\n // process upload in plugin\n $eventResult = $event->trigger();\n if ($eventResult === true) {\n if (isset($this->_request->setResource)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('File attachment added', OntoWiki_Message::SUCCESS)\n );\n $resourceUri = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n $resourceUri->setParam('r', $this->_request->setResource, true);\n $this->_redirect((string)$resourceUri);\n } else {\n $url->action = 'manage';\n $this->_redirect((string)$url);\n }\n }\n }\n\n $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('Upload File'));\n OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n $toolbar = $this->_owApp->toolbar;\n $url->action = 'manage';\n $toolbar->appendButton(\n OntoWiki_Toolbar::SUBMIT, array('name' => 'Upload File')\n );\n $toolbar->appendButton(\n OntoWiki_Toolbar::EDIT, array('name' => 'File Manager', 'class' => '', 'url' => (string)$url)\n );\n\n $this->view->defaultUri = $defaultUri;\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n $url->action = 'upload';\n $this->view->formActionUrl = (string)$url;\n $this->view->formMethod = 'post';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formName = 'fileupload';\n $this->view->formEncoding = 'multipart/form-data';\n if (isset($this->_request->setResource)) {\n // forward URI to form so we can redirect later\n $this->view->setResource = $this->_request->setResource;\n }\n\n if (!is_writable($this->_privateConfig->path)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('Uploads folder is not writable.', OntoWiki_Message::WARNING)\n );\n return;\n }\n\n // FIX: http://www.webmasterworld.com/macintosh_webmaster/3300569.htm\n header('Connection: close');\n }", "public function upload()\n {\n return view('pages/uploadFiles');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function uploadForm(Application $app)\n {\n $form = $this->getUploadForm($app);\n\n return $app['twig']->render('import/uploadform.html.twig', array(\n 'form' => $form->createView()\n ));\n }", "public function create()\n {\n return view('backend.images.add');\n\n }", "public function createAction()\n {\n $entity = new Item();\n $request = $this->getRequest();\n $form = $this->createForm(new ItemType(), $entity);\n $form->handleRequest ($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n $photo = $entity->getPhoto();\n if(!empty($photo))\n {\n $media = $this->get('striide_inventory.service.media')->save($entity->getPhoto());\n $entity->setPhoto($media->getId());\n }\n\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('StriideInventoryBundle_admin_item_show', array('id' => $entity->getId())));\n\n }\n\n return $this->render('StriideInventoryBundle:Item:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'json_types' => json_encode($this->get('striide_inventory.types')->getInventoryTypesArray()),\n 'form_theme' => 'StriideTwitterbootstrapBundle:Form:form_theme.html.twig',\n 'crumbs' => array(\n array('href' => $this->get('router')->generate('StriideInventoryBundle_homepage'),\n 'label' => $this->get('translator')->trans('Inventory')),\n array('href' => $this->get('router')->generate('StriideInventoryBundle_admin_item_new'),\n 'label' => $this->get('translator')->trans('Create new Item'))\n )\n ));\n }", "public function newAction()\n {\n $entity = new Feriado();\n $form = $this->createCreateForm($entity);\n\n return $this->render('BaseBundle:Feriado:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function actionCreate()\n {\n $model = new Presentacion();\n\n if ($model->load(Yii::$app->request->post())) {\n //var_dump($_POST);\n //exit();\n \n //Imagen de fondo\n $file = UploadedFile::getInstance($model, 'ruta');\n $ext = end((explode(\".\", $file->name)));\n $path = 'slide_index'.Yii::$app->security->generateRandomString().\".{$ext}\";\n $file->saveAs('uploads/' . $path);\n $model->ruta = $path;\n\n //Imagen left\n $file2 = UploadedFile::getInstance($model, 'ruta_img');\n $ext2 = end((explode(\".\", $file2->name)));\n $path2 = 'slide_index'.Yii::$app->security->generateRandomString().\".{$ext2}\";\n $file2->saveAs('uploads/' . $path2);\n $model->ruta_img = $path2;\n\n if($model->save()){\n return $this->redirect(['index']);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Abonent();\n\n if ($model->load(Yii::$app->request->post())){\n \n /**\n * model saves file using event AFTER_INSERT \n */\n $model->imageFile = UploadedFile::getInstance($model, 'imageFile');\n if($model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "function newPlatformForm()\n{\n echo '<form action=\"./platform.php?action=add\" method=\"post\" enctype=\"multipart/form-data\" id=\"editForm\">\n <label>Platform Name :</label><input type=\"text\" name=\"name\" /><br />\n <label>Platform Icon :</label><input type=\"file\" value=\"upload\" name=\"icon\" /><br />\n <input type=\"submit\" name=\"submit\" value=\"submit\" />\n </form>';\n}", "public function create() {\n return view('admin.filecategory.create');\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MHProductsBundle:Upload')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Upload entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MHProductsBundle:Upload:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function create(): View\n {\n return view('admin.banner.create')\n ->withTitle('Upload Banner');\n }", "public function newAction()\n {\n $form = $this->createForm(new ImageType(), new ImageModel(new Image()));\n\n return array(\n 'form' => $form->createView(),\n );\n }", "public function newAction() {\n $this->get('session')->getFlashBag()->clear();\n $entity = new Perfil();\n $form = $this->createForm(PerfilType::class, $entity);\n\n return $this->render('UsuarioBundle:Perfil:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function newAction()\n {\n $entity = new Titeur();\n\t\t\t\t$user = $this->get('security.context')->getToken()->getUser();\n $form = $this->createForm(new TiteurType(), $entity, array('user' => $user));\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function create()\n {\n return view('tariffs::create');\n }", "public function actionCreate()\n {\n $model = new ProjectFiles();\n if($p = Yii::$app->request->get('ProjectFiles')){\n $model->project_id = !empty($p['project_id']) ? $p['project_id'] : null;\n $model->type = !empty($p['type']) ? $p['type'] : null;\n $searchModel = new ProjectFilesSearch();\n $searchModel->project_id = $model->project_id;\n }\n\n if(\\Yii::$app->user->can('viewProject', ['project'=>$model->project])){ \n if ($model->load(Yii::$app->request->post())) {\n $model->docFile = UploadedFile::getInstance($model, 'docFile');\n if($model->save()){\n if ($model->docFile) {\n $image = $model->uploadFiles();\n $model->file_id = $image;\n $model->save();\n } \n return $this->refresh();\n } \n } elseif(\\Yii::$app->request->post('step_form')){\n $model->project->setup_status = 'pics';\n $model->project->save();\n return $this->redirect($model->project->setupRedirect);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'dataProvider' => $searchModel->search(Yii::$app->request->queryParams),\n ]);\n }\n } else {\n throw new \\yii\\web\\ForbiddenHttpException('Nemate prava da pristupite ovoj stranici.');\n }\n }", "public function create()\n {\n return view('backpages.formImage');\n }", "public function indexAction(){\n\t\t\t$this->library->load('upload');\n\n\t\t\t//Goi den phuong thuc upload\n\t\t\t$this->library->upload->upload();\n\t\t}", "public function uploadXmlAction()\n {\n $form = $this->createFormBuilder()\n ->add('file', FileType::class, array('label' => $this->get('translator')->trans('Load XML file'),\n \"attr\" => array(\"accept\" => \".xml\",)))\n ->getForm();\n\n return $this->render('GrtResBundle:User:upload.html.twig', array(\n 'form' => $form->createView()\n ));\n }", "public function actionCreate()\n {\n $model = new Usuario();\n $imageModel = new Imageupload();\n if ($model->load(Yii::$app->request->post())) {\n if($model->validate()){\n\n $model->save();\n\n $imageModel->image = UploadedFile::getInstance($imageModel,'image');\n \n $imageModel->image->saveAs('uploads/'.$model->legajo.'_'.$model->empresa. $imageModel->image->extension);\n\n $imageModel->upload();\n // file is uploaded successfully\n //$model->imageFile = 'dgfg';\n \n \n return $this->redirect(['view', 'id' => $model->id]);\n }else{\n return $this->render('create', [\n 'model' => $model,\n 'imageModel' => $imageModel,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'imageModel' => $imageModel,\n ]);\n }\n }", "function displayForm() {\n\t\t$session = new SessionManager();\n\t\t$session->sessionLoad();\n\t\t$categorys = new CategoryModel();\n\t\t$rows = $categorys->readAll();\n\t\t$view = new View(\"view/uploadPic.php\");\n\t\t$upload_error = \"\";\n\t\tif( isset($_GET[\"error\"])){\n\t\t\t$upload_error = $_GET[\"error\"];\n\t\t}\n\t\t$view->upload_error = $upload_error;\n\t\t$view->rows = $rows;\n\t\t$view->isLogdin = $session->getIsLogdin();\n\t\t$view->userName = $session->username;\n\t\t$view->display();\n\t}", "public function actionCreate()\n {\n $model = new Register();\n $Uploadmodel = new UploadForm();\n $Model = new User();\n\n if (Yii::$app->request->isPost) \n {\n //print_r($_Files); die;\n $Uploadmodel->imageFile = UploadedFile::getInstance($model, 'imageFile');\n if($model->load(Yii::$app->request->post()))\n {\n if(isset($Uploadmodel->imageFile))\n {\n $model->imageFile = $Uploadmodel->imageFile->name; \n $Uploadmodel->upload();\n }\n $model->password_hash = $Model->setPassword($model->password_hash);\n if($model->save()) \n {\n //print_r($model->errors);\n return $this->redirect(['user-images', 'id' => $model->id]);\n }\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n\t\t$idInstitucion = $_SESSION['instituciones'][0];\n $model = new InfraestructuraEducativa();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\t\n\t\t$sedes = $this->obtenerSedes($idInstitucion);\n\t\t$estados = $this->obtenerEstados();\n\t\t\n return $this->render('create', [\n 'model' => $model,\n\t\t\t'sedes'=> $sedes,\n\t\t\t'estados'=>$estados,\n\t\t\t'idInstitucion'=>$idInstitucion,\n ]);\n }", "public function create()\n {\n return view('admin.create.image');\n }", "public function create()\n {\n //\n $name = 'create';\n return view('admin.imageNew.imageNewEdit',compact('name'));\n }", "public function newAction()\n {\n $entity = new TipoCamera();\n $form = $this->createCreateForm($entity);\n\n return $this->render('AlmaBundle:TipoCamera:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MHProductsBundle:Upload')->findAll();\n\n return $this->render('MHProductsBundle:Upload:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function create()\n {\n return view('admin.imagenes.create');\n }", "public function create()\n {\n return view('admin.img_add');\n }", "public function newAction()\n {\n $entity = new Slideshow();\n $form = $this->createForm(new SlideshowType(), $entity);\n\n return $this->render('BerkmanSlideshowBundle:Slideshow:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function newAction()\n {\n $entity = new ObjectType();\n $form = $this->createCreateForm($entity);\n\n return $this->render('BrainstrapBundlesFrontBundle:Object/ObjectType:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function upload_view($slug)\n\t{\n\t\t$data['slug'] = $slug;\n\t $data['title'] = 'Upload Form';\n\t\t$this->load->view('room/upload', $data);\n\t}" ]
[ "0.7445102", "0.72794753", "0.7198603", "0.7108853", "0.7104053", "0.70352554", "0.6973417", "0.6970073", "0.694496", "0.6935036", "0.69251996", "0.69245076", "0.69105077", "0.6824969", "0.6819915", "0.681212", "0.678973", "0.6786745", "0.6786745", "0.6786745", "0.6786745", "0.6786745", "0.6786745", "0.6784426", "0.6784426", "0.6776973", "0.6760802", "0.6676323", "0.6629345", "0.6628543", "0.6600538", "0.65984124", "0.6577679", "0.6547973", "0.6531127", "0.65044755", "0.64772", "0.6473198", "0.6472708", "0.64571416", "0.63947695", "0.63664305", "0.63417506", "0.63224816", "0.6269172", "0.62642646", "0.6262306", "0.6245768", "0.6228021", "0.62251645", "0.62245286", "0.6218262", "0.62028605", "0.61938345", "0.6190561", "0.61882365", "0.6176509", "0.61699337", "0.61699295", "0.6161665", "0.6151761", "0.6151681", "0.615111", "0.61475664", "0.6138465", "0.61376977", "0.6135564", "0.61230886", "0.6116569", "0.61152804", "0.61098486", "0.61007714", "0.6099423", "0.6091978", "0.6090116", "0.60652184", "0.6062349", "0.60596263", "0.6053302", "0.6052782", "0.6050788", "0.6047858", "0.60428023", "0.6040113", "0.60369605", "0.6029882", "0.60222805", "0.60210884", "0.6014192", "0.6011957", "0.6011812", "0.6009728", "0.60066074", "0.60063756", "0.600436", "0.5998402", "0.59958506", "0.5994757", "0.59904206", "0.59836996" ]
0.82161367
0
Finds and displays a Upload entity.
public function showAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('MHProductsBundle:Upload')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Upload entity.'); } $deleteForm = $this->createDeleteForm($id); return $this->render('MHProductsBundle:Upload:show.html.twig', array( 'entity' => $entity, 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Upload $upload)\n {\n //\n }", "public function show(Upload $upload)\n {\n //\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MHProductsBundle:Upload')->findAll();\n\n return $this->render('MHProductsBundle:Upload:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function uploadAction() {\n $imgId = $this->getInput('imgId');\n $this->assign('imgId', $imgId);\n $this->getView()\n ->display('common/upload.phtml');\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MHProductsBundle:Upload')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Upload entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MHProductsBundle:Upload:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit(Upload $upload)\n {\n //\n }", "public function edit(Upload $upload)\n {\n //\n }", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "function showUploadPhoto() {\n\t\t$this->setCacheLevelNone();\n\t\t$event = $this->getModel()->getEvent();\n\t\t$source = $this->getModel()->getSource();\n\t\t\n\t\tif ( $event->getID() == $source->getEventID() ) {\n\t\t\t$this->getEngine()->assign('event', utilityOutputWrapper::wrap($event));\n\t\t\t$this->getEngine()->assign('source', utilityOutputWrapper::wrap($source));\n\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('multifile', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/jquery.MultiFile.js'));\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('photoupload', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/mofilmphotoupload.js'));\n\t\t\t$this->addJavascriptResource(new mvcViewJavascript('blockui', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/jquery.blockUI.js'));\n\t\t\t$this->getEngine()->assign('error', FALSE);\n\t\t} else {\n\t\t\t$this->getEngine()->assign('error', TRUE);\n\t\t}\n\t\t\n\t\t$this->render($this->getTpl('uploadPhoto', '/account'));\n\t}", "public function getUpload()\n\t{\n\t\treturn View::make('teaser.getUpload');\n\t}", "public function newAction()\n {\n $entity = new Upload();\n $form = $this->createCreateForm($entity);\n\n return $this->render('MHProductsBundle:Upload:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function getUploadfile()\n {\n return view(\"Admin::employee.uploadfile\");\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('XarismaBundle:Fileops')->find($id);\n//dump($entity);\n//die();\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fileops entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('XarismaBundle:Fileops:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Upload $upload)\n {\n return Storage::download('uploads/' . $upload->code, $upload->name);\n }", "public function view(User $user, Upload $upload)\n {\n //\n }", "public function uploadProductPage()\n {\n if (!$this->session->getSessionValue(UserField::getId())) {\n header(\"Location:/product/showProducts\");\n }\n /** @var TagFinder $tagFinder */\n $tagFinder = PersistenceFactory::createFinder(Tag::class);\n /** @var array $tags */\n $tags = $tagFinder->findAll();\n $renderer = new UploadProductRenderer();\n $renderer->render($tags);\n }", "public function getEntity() {\n return $this->file;\n }", "public function renderUploadForm() {}", "public function getUpload() {\n\t\treturn $this->loadMediaUploadView();\n\t}", "public function shortcodeUploadImage()\n {\n if ($this->settings->has('formerror')) {\n $form = $this->model->getSubmittedForm();\n } else {\n $form = $this->model->getNewForm();\n }\n\n return $this->view->fetch('upload.html.twig', ['form' => $form->createView()]);\n }", "public function upload()\n {\n return $this->hasOne(Upload::class, 'id', 'upload_id');\n }", "public function edit($id)\n\t{\n\t\t$uploadtypename = Tbluploadtypes::all();\n\t\t$upload = Upload::find($id);\n\t \n\t\treturn view('admin.upload.edit', compact('upload','uploadtypename'));\n\t}", "public function handleuploadAction() {\r\n $allowedExtensions = array(\"png\",\"jpg\",\"jpeg\",\"gif\",\"bmp\");\r\n // max file size in bytes\r\n $sizeLimit = 10 * 1024 * 1024;\r\n \r\n $uploader = new qqFileUploader($allowedExtensions, $sizeLimit);\r\n \r\n $dir = \"img/picture\";\r\n \r\n $result = $uploader->handleUpload($dir);\r\n \r\n $image = \\Nette\\Image::fromFile($dir . \"/\" . $result['filename']);\r\n $image->resize(269, 200, \\Nette\\Image::EXACT);\r\n $image->save($dir . \"/\" . $result['filename']);\r\n \r\n // to pass data through iframe you will need to encode all html tags\r\n echo htmlspecialchars(Zend_Json::encode($result), ENT_NOQUOTES);\r\n $this->_helper->layout->disableLayout();\r\n $this->_helper->viewRenderer->setNoRender(TRUE);\r\n }", "public function upload($id) {\n $this->authorize('upload', $this->model);\n $upload = $this->model->record($id);\n return view('/users/upload', compact('upload'));\n }", "public function upload()\n {\n return view('pages.upload');\n }", "public function actionShow()\n\t{\n\t\t$this->render('show',array('model'=>$this->loadfiles()));\n\t}", "public function show(){\n\t\t // Default size is preview\n if(!empty($_GET['size'])) $size = $_GET['size'];\n else $size = 'preview';\n\n /** @var Photo $pobj */\n $pobj = Photo::fetch($_GET['id']);\n if($pobj !== false && !$pobj->temporary && $pobj->data->status == 'saved') $pobj->show($size);\n else $this->zajlib->reroute('__error', ['system_api_photo_show', []]);\n\t\t}", "public function show(UploadVideo $uploadVideo)\n {\n //\n }", "public function show(ImageUploads $imageUploads)\n {\n //\n }", "public function upload() {\n\t\t$limit = $this->_getLimit();\n\t\t$attachments = $this->{$this->modelClass}->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'foreign_key' => $this->modelId,\n\t\t\t\t'group' => $this->modelClass,\n\t\t\t\t'model' => $this->model\n\t\t\t)\n\t\t));\n\t\tif (!empty($this->data) && (count($attachments) < $limit)) {\n\t\t\t$friendly = explode('.', $this->data[$this->modelClass]['file']['name']);\n\t\t\tarray_pop($friendly);\n\t\t\t$friendly = implode('.', $friendly);\n\t\t\t$this->data[$this->modelClass]['alternative'] = low($friendly);\n\t\t\t$this->data[$this->modelClass]['approved'] = false;\n\t\t\tif ($this->isAuthorized('attachments/approve')) {\n\t\t\t\t$this->data[$this->modelClass]['approved'] = true;\n\t\t\t}\n\n\t\t\tif ($this->{$this->modelClass}->save($this->data)) {\n\t\t\t\t$this->Session->setFlash('Upload successful.', 'flash'.DS.'success');\n\t\t\t}\n\t\t\t//failures will be handled by error messages, no need to set flash since they'll see an error (no ajax)\n\t\t\t//and ajax uploads handle the errors nicely\n\t\t}\n\n\t\t$this->set(compact('attachments', 'limit'));\n\t}", "function showUploadPage() {\n\t\t$this->setCacheLevelNone();\n\t\t$this->getEngine()->assign('oLicenseSet', $this->getModel()->getLicenseList($this->getController()->getRequest()->getSession()->getUser()->getID()));\n\t\t$this->getEngine()->assign('eventID', $this->getModel()->getEventID());\n\t\t//$this->addCssResource(new mvcViewCss('uploadifycss', mvcViewCss::TYPE_FILE, '/libraries/plupload/js/jquery.ui.plupload/css/jquery.ui.plupload.css'));\n\t\t$this->addCssResource(new mvcViewCss('jscss', mvcViewCss::TYPE_FILE, '/libraries/jquery-ui/themes/smoothness/jquery-ui.css'));\n\t\t$this->addCssResource(new mvcViewCss('styleWizardCss', mvcViewCss::TYPE_FILE, '/libraries/jquery-plugins/smartWizard2/styles/smart_wizard.css'));\n\t\t\n\t\t$this->addCssResource(new mvcViewCss('uploadifycss', mvcViewCss::TYPE_FILE, '/libraries/uploadify-v3.1/uploadify.css'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('uploadify', mvcViewJavascript::TYPE_FILE, '/libraries/uploadify-v3.1/jquery.uploadify-3.1.min.js'));\n\n\t\t$this->addJavascriptResource(new mvcViewJavascript('uploadifv3', mvcViewJavascript::TYPE_INLINE, \"$('#FileUpload').uploadify({\n\t\theight : 30,\n\t\tfileObjName : 'Files',\t\n\t\tswf : '/libraries/uploadify-v3.1/uploadify.swf',\n\t\tuploader : '{$this->buildUriPath(uploadController::ACTION_DO_UPLOAD)}',\n\t\twidth : 120,\n\t\t'fileSizeLimit' : '500MB',\t\n\t\tfileTypeExts : '*.mp4;*.mov;*.avi;*.mpg;*.wmv;*.m4v',\n\t\t'onUploadSuccess' : function(file, data, response) {\n\t\t\t\t$('#fileNameStored').val(data);\n\t\t\t\t$('#uploadStatus').val(\\\"\\\");\n\t\t\t\t$('#msg_filename').text(\\\"Upload done : \\\"+file.name);\n },\n\t\t'onUploadError': function (file, errorCode, errorMsg, errorString) {\n\t\t\t$('#msg_filename').text(\\\"\\\");\n\t\t\talert('The file ' + file.name + ' could not be uploaded: ' + errorString);\n\t\t},\n\t\t'onSelect' : function(file) {\n\t\t\t$('#uploadStatus').val(\\\"started\\\");\n\t\t\t$('#msg_filename').text(\\\"\\\");\n\t\t},\n\t\t'buttonText' : 'Upload Video',\t\n\t\tformData : { '{$this->getRequest()->getSession()->getSessionName()}' : '{$this->getRequest()->getSession()->getSessionID()}'\n\t\t}\t\t\n\t\t});\n\t\t\"));\n\t\t\n\t\t//$this->addCssResource(new mvcViewCss('uploadifycss', mvcViewCss::TYPE_FILE, '/libraries/jquery-uploadify/uploadify.css'));\n\n\t\t//$this->addJavascriptResource(new mvcViewJavascript('swfobject', mvcViewJavascript::TYPE_FILE, '/libraries/swfobject/swfobject.js'));\n\t\t//$this->addJavascriptResource(new mvcViewJavascript('uploadify', mvcViewJavascript::TYPE_FILE, '/libraries/jquery-uploadify/jquery.uploadify.min.js'));\n\t\t/*\n\t\t$this->addJavascriptResource(new mvcViewJavascript('uploadifyInit', mvcViewJavascript::TYPE_INLINE, \"$('#FileUpload').uploadify({\n\t\t\t\t'uploader' : '/libraries/jquery-uploadify/uploadify.swf',\n\t\t\t\t'script' : '{$this->buildUriPath(uploadController::ACTION_DO_UPLOAD)}',\n\t\t\t\t'cancelImg' : '/libraries/jquery-uploadify/cancel.png',\n\t\t\t\t'auto' : true,\n\t\t\t\t'fileExt' : '*.mov;*.avi;*.wmv;*.mp4;*.mpg;*.m4v',\n\t\t\t\t'fileDesc' : 'Video Files',\n\t\t\t\t'sizeLimit' : 500000000,\n\t\t\t\t'fileDataName': 'Files',\n\t\t\t\t'scriptData': {\n\t\t\t\t\t'{$this->getRequest()->getSession()->getSessionName()}': '{$this->getRequest()->getSession()->getSessionID()}',\n\t\t\t\t\t'ajax': true\n\t\t\t\t},\n\t\t\t\t'onComplete' : function(event, ID, fileObj, response, data) {\n\t\t\t\t\tif ( response != 'failed' ) {\t\t\t\t\t\n\t\t\t\t\t \t$('#fileNameStored').val(response);\n\t\t\t\t\t \t$('#uploadStatus').val(\\\"\\\");\n\t\t\t\t\t\t//alert('upload done');\t\n\t\t\t\t\t\t $('#msg_filename').text(\\\"Upload done : \\\"+fileObj.name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert('upload failed');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'onSelectOnce' : function(event,data) {\n\t\t\t\t\t$('#uploadStatus').val(\\\"started\\\");\t\n\t\t\t\t}\t\n\n\t\t\t\t});\n\t\t\"));\n\t\t * \n\t\t */\n\n\t\t/*\n\t\t$this->addJavascriptResource(new mvcViewJavascript('plupload', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/plupload.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('pluploadfull', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/plupload.full.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('pluploadflash', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/plupload.flash.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('pluploadhtml4', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/plupload.html4.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('pluploadhtml5', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/plupload.html5.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('pluploadjs', mvcViewJavascript::TYPE_FILE, '/libraries/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('progressBar', mvcViewJavascript::TYPE_FILE, '/libraries/jquery-plugins/jquery.progressbar.min.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('fileStyle', mvcViewJavascript::TYPE_FILE, '/libraries/jquery-plugins/fileStyle/jquery.filestyle.mini.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('html5Uploader', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/customHTML5Uploader.js'));\n\t\t*/\n\n\t\t$this->getEngine()->assign('newGenres', utilityOutputWrapper::wrap(mofilmTag::listOfObjects(null, null, mofilmTag::TYPE_GENRE)));\n\n\t\t$this->addJavascriptResource(new mvcViewJavascript('smartwizard', mvcViewJavascript::TYPE_FILE, '/libraries/jquery-plugins/smartWizard2/js/jquery.smartWizard-2.0.min.js'));\n\t\t$this->addJavascriptResource(new mvcViewJavascript('creditAutomcomplete', mvcViewJavascript::TYPE_FILE, '/libraries/mofilm/creditAutocomplete.js?'.mofilmConstants::JS_VERSION));\n\t\t$this->getEngine()->assign('eventsall', utilityOutputWrapper::wrap(mofilmEvent::listOfObjects(null, null, true)));\n\t\t$this->getEngine()->assign('oUser', $this->getController()->getRequest()->getSession()->getUser());\n\t\t$list = mofilmRole::listOfObjects();\n\t\t$tmp = array();\n\t\tforeach ( $list as $oObject ) {\n\t\t\t//$tmp[] = $oObject->getDescription();\n\t\t\t$tmp[] = array(\"label\" => $oObject->getDescription(),\"value\" => $oObject->getDescription(),\"key\" => $oObject->getID());\n\n\t\t}\n\t\t$this->getEngine()->assign('availableRoles', json_encode($tmp));\n\t\t$this->getEngine()->assign('index', 0);\n\t\t$this->addJavascriptResource(new mvcViewJavascript('jqueryautocompletehtml', mvcViewJavascript::TYPE_FILE, '/libraries/jqueryautocomplete/jquery.ui.autocomplete.html.js'));\n\t\t$this->render($this->getTpl('upload', '/account'));\n\t}", "public function index()\n {\n return view('files.upload')->render();\n }", "public function index(Request $request)\n {\n $upload = Upload::with(['tbluploadtypes'])->get()->sortByDesc('id');\n\t\t\n\t\treturn view('admin.upload.index', compact('upload'));\n\t}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Lock_Service_FileType::getFileType(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t}", "public function manageAction()\n {\n $mimeProperty = $this->_privateConfig->mime->property;\n $fileClass = $this->_privateConfig->class;\n $fileModel = $this->_privateConfig->model;\n $store = $this->_owApp->erfurt->getStore();\n\n $query = new Erfurt_Sparql_SimpleQuery();\n $query->setProloguePart('SELECT DISTINCT ?mime_type ?uri')\n ->addFrom((string)$this->_getConfigModelUri())\n ->setWherePart(\n 'WHERE\n {\n ?uri a <' . $fileClass . '>.\n ?uri <' . $fileModel . '> <' . (string)$this->_owApp->selectedModel . '>.\n ?uri <' . $mimeProperty . '> ?mime_type.\n }'\n )\n ->setOrderClause('?uri')\n ->setLimit(10); // TODO: paging\n\n if ($result = $store->sparqlQuery($query, array('use_ac' => false))) {\n $files = array();\n foreach ($result as $row) {\n if (is_readable($this->getFullPath($row['uri']))) {\n array_push($files, $row);\n }\n }\n $this->view->files = $files;\n } else {\n $this->view->files = array();\n }\n\n $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('File Manager'));\n OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n $toolbar = $this->_owApp->toolbar;\n\n $filePath = _OWROOT\n . rtrim($this->_privateConfig->path, '/')\n . DIRECTORY_SEPARATOR;\n\n $url = new OntoWiki_Url(array('controller' => 'files', 'action' => 'upload'), array());\n\n if (is_writable($filePath)) {\n\n $toolbar->appendButton(\n OntoWiki_Toolbar::DELETE,\n array('name' => 'Delete Files', 'class' => 'submit actionid', 'id' => 'filemanagement-delete')\n );\n\n $toolbar->appendButton(\n OntoWiki_Toolbar::ADD,\n array('name' => 'Upload File', 'class' => 'upload-file', 'url' => (string)$url)\n );\n\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n } else {\n $msgString = sprintf(\n $this->_owApp->translate->_('Directory \"%s\" is not writeable. To upload files set it writable.'),\n rtrim($this->_privateConfig->path, '/') . DIRECTORY_SEPARATOR\n );\n $this->_owApp->appendMessage(\n new OntoWiki_Message($msgString, OntoWiki_Message::INFO)\n );\n }\n\n if (!defined('ONTOWIKI_REWRITE')) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('Rewrite mode is off. File URIs may not be accessible.', OntoWiki_Message::WARNING)\n );\n return;\n }\n\n $url->action = 'delete';\n $this->view->formActionUrl = (string)$url;\n $this->view->formMethod = 'post';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formName = 'filemanagement-delete';\n }", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function render()\n\t{\n\t\t$name = $this->_obj->getId();\n\t\t$prefix = Core::getController('medias');\n\t\tif (! $prefix) {\n\t\t\t$prefix = '/t41/medias/';\n\t\t}\n\t\t$uri = $prefix . 'upload';\n\t\tView::addCoreLib(array('core.js','locale.js','view.js','uploader.css','view:action:upload.js'));\n\t\tView::addEvent(sprintf(\"t41.view.register('%s_ul', new t41.view.action.upload(jQuery('#%s_ul'),'%s'))\", $name, $name, $uri), 'js');\n\t\t\n\t\t$html = '';\n\t\t// @todo code media deletion JS\n\t\tif (($this->_obj->getValue()) != null) {\n\t\t\t$html .= sprintf('<span><a href=\"%s\" target=\"_blank\">%s %s</a> | <a href=\"#\" onclick=\"t41.view.get(\\'%s_ul\\').reset(this)\">%s</a></span>'\n\t\t\t\t\t, MediaElement::getDownloadUrl($this->_obj->getValue()->getUri())\n\t\t\t\t\t, 'Télécharger'\n\t\t\t\t\t, $this->_obj->getValue()->getLabel()\n\t\t\t\t\t, $name\n\t\t\t\t\t, 'Supprimer'\n\t\t\t);\n\t\t}\n\t\t$html .= sprintf('<div id=\"%s_ul\" class=\"qq-upload-list\"></div>', $this->_nametoDomId($name));\n\t\t$html .= sprintf('<input type=\"hidden\" name=\"%s\" id=\"%s\" value=\"%s\" class=\"hiddenfilename\"/>'\n\t\t\t\t, $name\n\t\t\t\t, $this->_nametoDomId($name)\n\t\t\t\t, $this->_obj->getValue() ? $this->_obj->getValue()->getIdentifier() : null\n\t\t);\n\t\t\n\t\treturn $html;\n\t\t\n\t\t$action = new UploadAction($this->_obj);\n\t\t\n\t\t$deco = View\\Decorator::factory($action);\n\t\t$deco->render();\n\t\t\n\t\treturn $html . \"\\n\";\n\t}", "public function upload_view($slug)\n\t{\n\t\t$data['slug'] = $slug;\n\t $data['title'] = 'Upload Form';\n\t\t$this->load->view('room/upload', $data);\n\t}", "public function actionIndex()\n {\n try {\n $model = new Upload();\n $info = $model->upImage();\n\n\n $info && is_array($info) ?\n exit(Json::htmlEncode($info)) :\n exit(Json::htmlEncode([\n 'code' => 1,\n 'msg' => 'error'\n ]));\n\n\n } catch (\\Exception $e) {\n exit(Json::htmlEncode([\n 'code' => 1,\n 'msg' => $e->getMessage()\n ]));\n }\n }", "public function display(): string\n {\n // Apply any defaults for missing metadata\n $this->setDefaults();\n\n // Get the Files\n if (! isset($this->data['files'])) {\n // Apply a target user\n if ($this->data['userId']) {\n $this->model->whereUser($this->data['userId']);\n }\n\n // Apply any requested search filters\n if ($this->data['search']) {\n $this->model->like('filename', $this->data['search']);\n }\n\n // Sort and order\n $this->model->orderBy($this->data['sort'], $this->data['order']);\n\n // Paginate non-select formats\n if ($this->data['format'] !== 'select') {\n $this->setData([\n 'files' => $this->model->paginate($this->data['perPage'], 'default', $this->data['page']),\n 'pager' => $this->model->pager,\n ], true);\n } else {\n $this->setData([\n 'files' => $this->model->findAll(),\n ], true);\n }\n }\n\n // AJAX calls skip the wrapping\n if ($this->data['ajax']) {\n return view('Tatter\\Files\\Views\\Formats\\\\' . $this->data['format'], $this->data);\n }\n\n return view('Tatter\\Files\\Views\\index', $this->data);\n }", "public function updateAction(Request $request, $id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MHProductsBundle:Upload')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Upload entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n\n if ($editForm->isValid()) {\n $em->flush();\n\n return $this->redirect($this->generateUrl('admin_uploads'));\n }\n\n return $this->render('MHProductsBundle:Upload:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit()\n\t{\n\t\t$id = $this->uri->segment(5);\n\n\t\tif (empty($id))\n\t\t{\n\t\t\tTemplate::set_message(lang('upload_invalid_id'), 'error');\n\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t}\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\t$this->auth->restrict('Upload.Developer.Edit');\n\n\t\t\tif ($this->save_upload('update', $id))\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_edit_record').': ' . $id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_edit_success'), 'success');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_edit_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\telse if (isset($_POST['delete']))\n\t\t{\n\t\t\t$this->auth->restrict('Upload.Developer.Delete');\n\n\t\t\tif ($this->upload_model->delete($id))\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_delete_record').': ' . $id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_delete_success'), 'success');\n\n\t\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t\t} else\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_delete_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tTemplate::set('upload', $this->upload_model->find($id));\n\t\tAssets::add_module_js('upload', 'upload.js');\n\n\t\tTemplate::set('toolbar_title', lang('upload_edit') . ' Upload');\n\t\tTemplate::render();\n\t}", "public function actionUpload1()\n {\n $upload_handler = new UploadHandler();\n }", "public function display() {\r\n self::createUploaderScript();\r\n\r\n $this->echoOptionHeader();\r\n\r\n // Display the preview file name.\r\n $value = $this->getValue();\r\n if ( ! is_array( $value ) ) {\r\n $value = $this->getValue();\r\n }\r\n\r\n $previewFile = '';\r\n if ( ! empty( $value ) ) {\r\n $previewFile = \"<i class='dashicons dashicons-no-alt remove'></i><p>\". basename( get_attached_file( $value ) ) . \"</p>\";\r\n } else {\r\n $previewFile = $this->settings['label'];\r\n }\r\n echo \"<div class='tf-file-upload'>\" . $previewFile . '</div>';\r\n\r\n printf('<input name=\"%s\" placeholder=\"%s\" id=\"%s\" type=\"hidden\" value=\"%s\" />',\r\n $this->getID(),\r\n $this->settings['placeholder'],\r\n $this->getID(),\r\n esc_attr( $this->getValue() )\r\n );\r\n $this->echoOptionFooter();\r\n }", "private function loadMediaUploadView() {\n\n\t\t// get all the projects a user is in\n\t\t$userprojects = ProjectHandler::getUserProjects(Auth::user());\n\t\t$userprojects = array_column($userprojects, 'name');\n\t\t\n\t\treturn View::make('media.pages.upload')->with('projects', $userprojects);\n\t}", "public function upload()\n {\n return view('pages/uploadFiles');\n }", "public function content_for_upload();", "public function avatarUploadAction()\n { \n \n $uid= $this->auth->getUserId();\n $object = Users::findFirstById($uid);\n\n if($object && $object->getStatus() == $object::STATUS_ACTIVE) {\n\n if ($this->request->hasFiles()) {\n\n $uploads = $this->request->getUploadedFiles();\n\n foreach ($uploads as $fileObj) {\n\n $fileExt = $fileObj->getRealType();\n $mediaType = new MediaType();\n\n if (!$mediaType->checkExtension($fileExt)) {\n return $this->setError(t(\"Can't upload because file type's not allowed\"). \": \". $fileExt);\n }\n\n $localPath = $fileObj->getTempName();\n\n $name = Hash::generate().\"-\". $uid .'.jpg';\n $thumb = new Easy();\n $thumb->Thumbsize = 150;\n $thumb->Cropimage = [3,1,125,125,85,85];\n $thumb->Thumbsaveas = 'jpg';\n $thumb->Thumbfilename = $name;\n $thumb->Thumblocation = content_path('uploads/avatars/');\n $thumb->Createthumb( $localPath , 'file');\n\n $object->setAvatar( $name );\n $object->save();\n\n }\n\n }\n\n }\n\n die(); // no need to use media\n\n if ($this->request->hasFiles()) {\n \n $media = new Media();\n $uploads = $this->request->getUploadedFiles();\n $this->view->disable();\n $uploaded = true;\n\n \n\n foreach ($uploads as $fileObj) {\n\n $avatar = $media->initAvatar($fileObj);\n if (!$avatar) {\n $uploaded = false;\n }else {\n $path = $avatar;\n }\n }\n\n\n if (!$uploaded) {\n $error = implode(\"\\n\", $media->getError());\n $this->response->setStatusCode(406, $error);\n $this->response->setContent($error);\n } else {\n $object->setAvatar( $path );\n $object->save();\n $this->response->setStatusCode(200, t(\"Success\"));\n }\n return $this->response->send();\n }\n\n }", "public function view() {\n $file_name = $this->uri->segment(4);\n if ($file_name != \"\" && file_get_contents(base_url().\"assets/uploadedfiles/\".$file_name)) {\n $this->data['file_name'] = $file_name;\n $this->load->view(\"uploads/view\", $this->data);\n } else {\n redirect(\"admin/auth\");\n }\n }", "public function view() {\n $file_name = $this->uri->segment(4);\n if ($file_name != \"\" && file_get_contents(base_url().\"assets/uploadedfiles/\".$file_name)) {\n $this->data['file_name'] = $file_name;\n $this->load->view(\"uploads/view\", $this->data);\n } else {\n redirect(\"admin/auth\");\n }\n }", "public function show(){\n locateAndInclude('bForm_Avatar_vm');\n parent::show();\n }", "private function uploadImage(){\n\t\treturn response(view('partials.templates.upload')->render(), 200);\n\t}", "protected function printUploadInput()\n {\n $accepts = \"\";\n\n if (sizeof($this->filters) > 0) {\n $accepts = \" accept=\\\"\" . implode(\",\", $this->filters) . \"\\\"\";\n }\n\n ?>\n <input type=\"file\" name=\"<?= $this->getIndexedPresenterPath(); ?>\" id=\"<?= $this->getIndexedPresenterPath(); ?>\"\n presenter-name=\"<?= $this->presenterName ?>\"<?= $accepts . $this->getHtmlAttributeTags() . $this->getClassTag() ?>/>\n <?php\n }", "public function uploadfiles()\n {\n return view ('filemanager.uploadfile'); \n }", "public function index()\n\t{\n\t\t$module = Module::get('Uploads');\n\t\t\n\t\tif(Module::hasAccess($module->id)) {\n\t\t\treturn View('la.uploads.index', [\n\t\t\t\t'show_actions' => $this->show_action,\n\t\t\t\t'listing_cols' => $this->listing_cols,\n\t\t\t\t'module' => $module\n\t\t\t]);\n\t\t} else {\n return redirect(config('laraadmin.adminRoute').\"/\");\n }\n\t}", "public function index()\n\t{\n\t\t$module = Module::get('Uploads');\n\t\t\n\t\tif(Module::hasAccess($module->id)) {\n\t\t\treturn View('la.uploads.index', [\n\t\t\t\t'show_actions' => $this->show_action,\n\t\t\t\t'listing_cols' => $this->listing_cols,\n\t\t\t\t'module' => $module\n\t\t\t]);\n\t\t} else {\n return redirect(config('laraadmin.adminRoute').\"/\");\n }\n\t}", "public function uploadAction() {\r\n\r\n //GET NAVIGATION\r\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\r\n ->getNavigation('advancedslideshow_admin_main', array(), 'advancedslideshow_admin_main_manage_slideshows');\r\n\r\n //GET SLIDESHOW SUBJECT AND SLIDESHOW ID\r\n $advancedslideshow = Engine_Api::_()->core()->getSubject();\r\n $this->view->advancedslideshow_id = $advancedslideshow_id = $advancedslideshow->advancedslideshow_id;\r\n $settings = Engine_Api::_()->getApi('settings', 'core');\r\n $getSlideUpload = $settings->getSetting('siteslideshow.slide.upload', null);\r\n\r\n if (isset($_GET['ul']) || isset($_FILES['Filedata']))\r\n return $this->_forward('upload-image', null, null, array('format' => 'json', 'advancedslideshow_id' => $advancedslideshow_id));\r\n\r\n $this->view->form = $form = new Advancedslideshow_Form_Admin_Image_Upload();\r\n $form->file->setAttrib('data', array('advancedslideshow_id' => $advancedslideshow_id));\r\n $status = $this->getUploadedImage();\r\n\r\n if ((!$this->getRequest()->isPost()) || empty($getSlideUpload)) {\r\n return;\r\n }\r\n\r\n if ((!$form->isValid($this->getRequest()->getPost())) || empty($getSlideUpload)) {\r\n return;\r\n }\r\n\r\n $db = Engine_Api::_()->getItemTable('advancedslideshow_image')->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n $values = $form->getValues();\r\n $params = array(\r\n 'advancedslideshow_id' => $advancedslideshow_id,\r\n 'user_id' => Engine_Api::_()->user()->getViewer()->getIdentity(),\r\n );\r\n\r\n $settings->setSetting('siteslideshow.slide.upload', $status);\r\n $settings->setSetting('siteslideshow.manage', $status);\r\n $settings->setSetting('siteslideshow.slide.info', $status);\r\n\r\n foreach ($values['file'] as $image_id) {\r\n $image = Engine_Api::_()->getItem(\"advancedslideshow_image\", $image_id);\r\n if (!($image instanceof Core_Model_Item_Abstract) || !$image->getIdentity())\r\n continue;\r\n\r\n $image->save();\r\n\r\n if ($advancedslideshow->image_id == 0) {\r\n $advancedslideshow->image_id = $image->file_id;\r\n $advancedslideshow->save();\r\n }\r\n }\r\n\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n\r\n //REDIRECT\r\n $this->_redirect(\"admin/advancedslideshow/slides/manage/advancedslideshow_id/\" . $advancedslideshow_id);\r\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('HamdiMediaBundle:GalleryImage')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find GalleryImage entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('HamdiMediaBundle:GalleryImage:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function show()\n {\n return view('files::show');\n }", "function showUploadCompletePage() {\n\t\t$this->setCacheLevelNone();\n\t\t$this->render($this->getTpl('uploadComplete', '/account'));\t\t\n\t\n\t}", "public function uploadAction()\n {\n // default file URI\n $defaultUri = $this->_config->urlBase . 'files/';\n\n // store for sparql queries\n $store = $this->_owApp->erfurt->getStore();\n\n // DMS NS var\n $dmsNs = $this->_privateConfig->DMS_NS;\n\n // check if DMS needs to be imported\n if ($store->isModelAvailable($dmsNs) && $this->_privateConfig->import_DMS) {\n $this->_checkDMS();\n }\n\n $url = new OntoWiki_Url(\n array('controller' => 'files', 'action' => 'upload'),\n array()\n );\n\n // check for POST'ed data\n if ($this->_request->isPost()) {\n $event = new Erfurt_Event('onFilesExtensionUploadFile');\n $event->request = $this->_request;\n $event->defaultUri = $defaultUri;\n // process upload in plugin\n $eventResult = $event->trigger();\n if ($eventResult === true) {\n if (isset($this->_request->setResource)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('File attachment added', OntoWiki_Message::SUCCESS)\n );\n $resourceUri = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n $resourceUri->setParam('r', $this->_request->setResource, true);\n $this->_redirect((string)$resourceUri);\n } else {\n $url->action = 'manage';\n $this->_redirect((string)$url);\n }\n }\n }\n\n $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('Upload File'));\n OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n $toolbar = $this->_owApp->toolbar;\n $url->action = 'manage';\n $toolbar->appendButton(\n OntoWiki_Toolbar::SUBMIT, array('name' => 'Upload File')\n );\n $toolbar->appendButton(\n OntoWiki_Toolbar::EDIT, array('name' => 'File Manager', 'class' => '', 'url' => (string)$url)\n );\n\n $this->view->defaultUri = $defaultUri;\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n $url->action = 'upload';\n $this->view->formActionUrl = (string)$url;\n $this->view->formMethod = 'post';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formName = 'fileupload';\n $this->view->formEncoding = 'multipart/form-data';\n if (isset($this->_request->setResource)) {\n // forward URI to form so we can redirect later\n $this->view->setResource = $this->_request->setResource;\n }\n\n if (!is_writable($this->_privateConfig->path)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('Uploads folder is not writable.', OntoWiki_Message::WARNING)\n );\n return;\n }\n\n // FIX: http://www.webmasterworld.com/macintosh_webmaster/3300569.htm\n header('Connection: close');\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AlmaBundle:TipoCamera')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find TipoCamera entity.');\n }\n\n\n return $this->render('AlmaBundle:TipoCamera:show.html.twig', array(\n 'entity' => $entity\n ));\n }", "public function actionIndex()\n {\n $upload_handler = new UploadHandler();\n }", "public function xuploadedfiles() {\n\t\t\n\t\t/* Load Model */\n\t\t$files = $this->getModel ( 'file' );\n\t\t\n\t\t/* Get all rows */\n\t\t$files->getAll ( $this->_getFormId () );\n\t\t\n\t\t/* set the view file (optional) */\n\t\t$this->setView ( 'uploadedfiles' );\n\t\t\n\t\t/* set last view into session */\n\t\t$this->session->returnto ( $this->getView () );\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('HypoTestBundle:File')->findAll();\n\n return array('entities' => $entities);\n }", "public function viewPhoto(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $user_id = $user['id'];\n $items = [];\n\n if(null !== $this->request->getQuery('id')){\n $q_r = $this->{$this->main_model}->find()->where(['id' => $this->request->getQuery('id')])->first();\n\n if($q_r){\n $items['photo_file_name'] = $q_r->photo_file_name;\n }\n }\n\n $this->set([\n 'data' => $items, //For the form to load we use data instead of the standard items as for grids\n 'success' => true,\n '_serialize' => ['success','data']\n ]);\n }", "public function executeEdit(sfWebRequest $request)\n {\n $this->embedAllowed = aMediaTools::getEmbedAllowed();\n $this->uploadAllowed = aMediaTools::getUploadAllowed(); \n $this->forward404Unless(aMediaTools::userHasUploadPrivilege());\n $item = null;\n $this->slug = false;\n $this->popularTags = PluginTagTable::getPopulars(null, array('sort_by_popularity' => true), false, 10);\n if (sfConfig::get('app_a_all_tags', true))\n {\n $this->allTags = PluginTagTable::getAllTagNameWithCount();\n }\n else\n {\n $this->allTags = array();\n }\n if ($request->hasParameter('slug'))\n {\n $item = $this->getItem();\n $this->slug = $item->getSlug();\n }\n $this->forward404Unless($item);\n $this->forward404Unless($item->userHasPrivilege('edit'));\n $this->item = $item;\n if ($this->item->getEmbeddable())\n {\n // Handles the embed field correctly\n $this->form = new aMediaVideoForm($item);\n }\n else\n {\n $this->form = new aMediaEditForm($item);\n }\n $this->form->getWidgetSchema()->setNameFormat('a_media_item_'.$item->id.'_%s');\n \n $this->postMaxSizeExceeded = false;\n // An empty POST is an anomaly indicating that we hit the php.ini max_post_size or similar\n if ($request->isMethod('post') && (!count($request->getPostParameters())))\n {\n $this->postMaxSizeExceeded = true;\n }\n if ((!$this->postMaxSizeExceeded) && $request->isMethod('post'))\n {\n $parameters = $request->getParameter('a_media_item_'.$item->id.'_');\n $values = $request->getParameterHolder()->getAll();\n $value = array();\n $files = array();\n foreach ($values as $k => $v)\n {\n if (preg_match('/^a_media_item_' . $item->id . '_(.*)$/', $k, $matches))\n {\n if($k == $this->form['file']->renderId())\n {\n $files[$matches[1]] = $request->getFiles($this->form['file']->renderId());\n } else\n {\n $value[$matches[1]] = $v;\n }\n }\n } \n $parameters = $value;\n \n $result = null;\n if (isset($parameters['embed']))\n {\n // We need to do some prevalidation of the embed code so we can prestuff fields\n $result = $this->form->classifyEmbed($parameters['embed']);\n error_log(json_encode($result));\n }\n\n // If there is no thumbnail already stored for this media item,\n // and we are able to obtain one from the service, do so. If there is\n // already a thumbnail leave it alone as it might be a deliberate\n // replacement (TODO: it would be nice to always do it if the embed\n // code is definitely new)\n if (isset($result['thumbnail']) && (!$item->getImageAvailable()))\n {\n $this->convertServiceThumbnailToFileUpload($result['thumbnail'], $parameters);\n }\n \n $this->form->bind($parameters, $files);\n if ($this->form->isValid())\n {\n $file = $this->form->getValue('file');\n // The base implementation for saving files gets confused when \n // $file is not set, a situation that our code tolerates as useful \n // because if you're updating a record containing an image you \n // often don't need to submit a new one.\n unset($this->form['file']);\n $object = $this->form->getObject();\n if ($file)\n {\n // Everything except the actual copy which can't succeed\n // until the slug is cast in stone\n $object->preSaveFile($file->getTempName());\n }\n $this->form->save();\n if ($file)\n {\n $object->saveFile($file->getTempName());\n }\n if ($request->isXmlHttpRequest())\n {\n return $this->renderPartial('aMedia/mediaItemMeta', array(\n 'mediaItem' => $object,\n 'popularTags' => $this->popularTags,\n 'allTags' => $this->allTags,\n 'layout' => aMediaTools::getLayout($this->getUser()->getAttribute('layout', 'two-up', 'apostrophe_media'))\n ));\n }\n return $this->redirect(\"aMedia/resumeWithPage\");\n }\n }\n if ($request->isXmlHttpRequest())\n {\n return $this->renderTemplate('Ajax');\n }\n return $this->renderTemplate();\n }", "function display_image($entity)\n{\n\tglobal $config;\n\t\n\techo '\n\t\t\t<div class=\"heading-block clearfix\">\n\t\t\t\t<div class=\"heading-thumbnail\">';\n\t\t\t\t\n\t\n\tif (isset($entity->thumbnailUrl))\n\t{\n\t\techo '<img src=\"' . $config['thumbnail_cdn'] . get_thumbnail_url($entity->thumbnailUrl) . '\" />';\t\t\n\t}\t\n\telse\n\t{\n\t\techo '<img src=\"images/no-icon.svg\" />';\n\t}\n\t\t\n\techo '\n\t\t\t\t</div>\n\t\t\t\t<div class=\"heading-body\">\n\t\t\t\t\t<div class=\"heading-title\">';\n\t\t\t\t\t\n\techo get_literal_display($entity->name);\n\techo '\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"heading-description\">';\n\t\t\t\t\t\n\tif (isset($entity->description))\n\t{\n\t\techo '<div class=\"caption\">' . get_literal_display($entity->description) . '</div>';\n\t}\t\t\t\n\t\n\techo '<div id=\"identifiers\">';\n\techo '<ul class=\"identifier-list\">';\n\techo '<li><a class=\"external\" href=\"' . $entity->{'@id'} . '\" target=\"_new\">' . $entity->{'@id'} . '</a></li>';\n\techo '</ul>';\n\techo '</div>';\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\techo '\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>';\n\t\t\t\n\t// Display image\n\techo '<div>';\t\n\techo '<img class=\"image\" src=\"' .$entity->contentUrl->{'@id'} . '\" />';\t\n\techo '</div>';\n\n\n\n\techo '\n\t\t<script>figure_is_part_of(\"' . $entity->{'@id'} . '\", \"cited_by\");</script> \n\t';\n}", "public function browseAction(){\n\n\t\t$modelStatic = new Application_Model_Static();\n\n\t\t$images = $modelStatic->getMedia();\n \n\t\t$this->view->images = $images;\n \t\t\n\t\t$this->_helper->layout->setLayout('media');\n\t\t//$this->_helper->layout->disableLayout(0);\n\t\t$this->_helper->viewRenderer->setNoRender(true);\n\t\t\n \t}", "public function preview(){\n /** @var Photo $pobj */\n $pobj = Photo::fetch($_GET['id']);\n // @todo Preview should only be visible to the user who uploaded (if user exists) and should only be saved by user who uploaded\n // @todo We can achieve this with form verification id's (which we should have anyway)\n if($pobj !== false && $pobj->temporary) $pobj->show('preview');\n else $this->zajlib->reroute('__error', ['system_api_photo_preview', []]);\n\t\t}", "public function upload($id)\n\t{\n\t\treturn view('uploads.upload')->with('id', $id)->with('error','');\n\t}", "public function actionUploads()\n {\n $model = new Imageupload;\n $model->image = UploadedFile::getInstances($model, 'image');\n if ($model->upload()) {\n return 100;\n }\n return 0;\n }", "private function uploadFile($entity)\n {\n if (!$entity instanceof Image) {\n return;\n }\n\n $file = $entity->getImagefile();\n // only upload new files\n if ($file instanceof UploadedFile) {\n $fileName = $this->uploader->upload($file);\n $entity->setImagefile($fileName);\n }\n }", "public function indexAction(){\n\t\t\t$this->library->load('upload');\n\n\t\t\t//Goi den phuong thuc upload\n\t\t\t$this->library->upload->upload();\n\t\t}", "public function uploadAction($file) {\n\t\t\n\t\t$renderPartial = $this->request->hasArgument('renderPartial') ? $this->request->getArgument('renderPartial') : '';\n\t\t$mode = $this->request->hasArgument('mode') ? $this->request->getArgument('mode') : '';\n\t\t$filetype = $this->request->hasArgument('filetype') ? $this->request->getArgument('filetype') : 'file';\n\t\tif ($filetype == 'pdf') {\n\t\t\tif ($file->getOriginalResource()->getFileextension() !== 'pdf') {\n\t\t\t\t$this->forward('new', NULL, NULL, array('file' => $file,'mode'=>$mode,'renderPartial'=>$renderPartial, 'filetype' => $filetype));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->persistenceManager->isNewObject($file)) {\n\t\t\t$this->fileResourceRepository->add($file);\n\t\t} else {\n\t\t\t$this->fileResourceRepository->update($file);\n\t\t}\n\t\t\n\t\t$this->forward('edit', NULL, NULL, array('file' => $file,'mode'=>$mode,'renderPartial'=>$renderPartial, 'filetype' => $filetype));\n\t}", "public function show(Transfer $transfer)\n {\n //\n }", "public function uploadCsvAction(){\n return $this->render('@KrsticStatFilms/Home/update.html.twig');\n }", "public function show($id)\n{\n $entity = \\App\\TestFiles::find($id);\n $task = \\App\\Task::find($entity->taskid);\n $topic = \\App\\Topic::find($entity->topic);\n\n try {\n $path = storage_path('app\\\\public\\\\').$entity->content;\n //$path = str_replace('\\\\',DIRECTORY_SEPARATOR,$path);\n $content = File::get(getPath($path));\n //$content = $entity->content;\n } catch (Illuminate\\Contracts\\Filesystem\\FileNotFoundException $exception) {\n //die(\"The file doesn't exist\");\n $content = 'File is not found';\n }\n\n $x=['data'=>$entity, 'topic'=>$topic, 'task'=>$task, 'content'=>$content];\n return view('admin/testfiles/show')->with($x);\n}", "public function userfileAction() {\r\n\t\tif ((int)$this->_getParam('_parent') < 0) {\r\n \t\t$this->_detailedView('user_file');\r\n\t\t} else {\r\n\t\t\t$this->_component = $this->_components['user_file'];\r\n\t\t\t$this->detailedAction();\r\n\t\t}\r\n\t}", "public function uploadAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Get Message Service\n $message = $this->getServiceLocator()->get('systemMessages');\n \n $files = $request->getFiles()->toArray();\n $temp = explode(\".\", $files[\"file\"][\"name\"]);\n $newName = round(microtime(true));\n $newfilename = $newName . '.' . end($temp);\n $image = new Image();\n $image->exchangeArray(array(\n \"website_id\" => $logedUser[\"idWebsite\"],\n \"name\" => $newName,\n \"extension\" => end($temp)\n ));\n if ($image->validation()) {\n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"public/files_database/\" . $logedUser[\"idWebsite\"] . \"/\" . $newfilename)) {\n $result = $this->getImageTable()->saveImage($image);\n $message->setCode($result);\n // Log\n $this->getServiceLocator()\n ->get('systemLog')\n ->addLog(0, $message->getMessage(), $message->getLogPriority());\n die('uploadSucess');\n } else {\n die('uploadError');\n }\n } else {\n die('Invalid extension');\n }\n }\n die(\"forbiden\");\n } else {\n die(\"forbiden - without permission\");\n }\n }", "private function determineUploadLocation(FieldItemListInterface $field): string {\n return (new FileItem($field->getItemDefinition()))->getUploadLocation();\n }", "public function upload() {\n $index = \"index-1\";\n $menu = 'working_area';\n \n return view('upload', compact('index','menu'));\n }", "public function index()\n {\n $uploads=Auth::guard('team')->user()->uploads;\n $upload_names=UploadName::all();\n \n return view('team.uploads.index',compact('upload_names','uploads'));\n }", "public function getIndex() {\n return view('upload');\n }", "public function index()\n {\n $files = Upload::all();\n return view('upload', compact('files'));\n }", "function wck_get_entry_field_upload($id){\r\n\t\tif( !empty ( $id ) && is_numeric( $id ) ){\t\t\t\t\r\n\t\t\t$file_src = wp_get_attachment_url($id);\r\n\t\t\t$thumbnail = wp_get_attachment_image( $id, array( 80, 60 ), true );\r\n\t\t\t$file_name = get_the_title( $id );\r\n\t\t\t\r\n\t\t\tif ( preg_match( '/^.*?\\.(\\w+)$/', get_attached_file( $id ), $matches ) )\r\n\t\t\t\t$file_type = esc_html( strtoupper( $matches[1] ) );\r\n\t\t\telse\r\n\t\t\t\t$file_type = strtoupper( str_replace( 'image/', '', get_post_mime_type( $id ) ) );\r\n\t\t\t\r\n\t\t\treturn $display_value = '<div class=\"upload-field-details\">'. $thumbnail .'<p><span class=\"file-name\">'. $file_name .'</span><span class=\"file-type\">'. $file_type . '</span></p></div>';\t\r\n\t\t} else {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}", "public function show($id)\n {\n $this->project = Project::findOrFail($id);\n $this->upload = true;\n\n if(company()->package->max_storage_size != -1) {\n $fileStorage = FileStorage::all();\n if(company()->package->storage_unit == 'mb') {\n $totalSpace = company()->package->max_storage_size;\n } else {\n $totalSpace = company()->package->max_storage_size*1024;\n }\n //used space in mb\n $usedSpace = $fileStorage->count() > 0 ? round($fileStorage->sum('size')/(1000*1024), 4) : 0;\n\n if($usedSpace > $totalSpace) {\n $this->upload = false;\n }\n }\n\n return view('admin.projects.project-files.show', $this->data);\n }", "public function uploadXmlAction()\n {\n $form = $this->createFormBuilder()\n ->add('file', FileType::class, array('label' => $this->get('translator')->trans('Load XML file'),\n \"attr\" => array(\"accept\" => \".xml\",)))\n ->getForm();\n\n return $this->render('GrtResBundle:User:upload.html.twig', array(\n 'form' => $form->createView()\n ));\n }", "public function edit(Fileupload $fileupload)\n {\n //\n }", "private function uploadFile($entity) {\n if (!$entity instanceof DUser) {\n return;\n }\n\n $file = $entity->getPicture();\n\n // only upload new files\n if (!$file instanceof UploadedFile) {\n return;\n }\n\n $fileName = $this->uploader->upload($file);\n $entity->setPicture($fileName);\n }", "public function searchAction()\n {\n $user_id = $this->getSecurityContext()->getUser()->getId();\n $drive = $this->_driveHelper->getRepository()->getDriveByUserId($user_id);\n\n $q = $this->getScalarParam('q');\n // $hits = $this->getResource('drive.file_indexer')->searchInDrive($q, $drive->drive_id);\n $hits = $this->getResource('drive.file_indexer')->search($q);\n\n echo '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />';\n echo '<strong>', $hits->hitCount, '</strong> hits<br/>';\n foreach ($hits->hits as $hit) {\n $file = $this->_driveHelper->getRepository()->getFile($hit->document->file_id);\n if (empty($file)) {\n echo 'Invalid file ID: ', $hit->document->file_id;\n }\n if ($file && $this->_driveHelper->isFileReadable($file)) {\n echo '<div>', '<strong>', $file->name, '</strong> ', $this->view->fileSize($file->size), '</div>';\n }\n }\n exit;\n }", "public function actionIndex()\n {\n $searchModel = new EntityAttachmentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'model' => $this->retrieveModel(),\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionPoll_upload()\n {\n $this->layout = 'teacher';\n $model = new LessonUpload();\n \n return $this->render('poll_upload', [\n 'model' => $model,\n ]);\n }" ]
[ "0.70940953", "0.70940953", "0.65168816", "0.61416054", "0.60512686", "0.60028166", "0.60028166", "0.59676504", "0.59676504", "0.59676504", "0.59676504", "0.59676504", "0.59676504", "0.59642005", "0.59642005", "0.5830048", "0.5828786", "0.58183765", "0.57303464", "0.5716796", "0.56918323", "0.565193", "0.5648241", "0.5635419", "0.5626761", "0.56109154", "0.5589678", "0.5551775", "0.5545075", "0.55325633", "0.5500754", "0.5485867", "0.54553884", "0.5422994", "0.5412289", "0.5406328", "0.537963", "0.53784436", "0.53652453", "0.53429425", "0.5313762", "0.53044957", "0.52921176", "0.5291807", "0.5286094", "0.52833617", "0.52752906", "0.52666557", "0.52408534", "0.5234958", "0.5232158", "0.52160716", "0.5206802", "0.5205818", "0.5191715", "0.51898766", "0.51898766", "0.5186861", "0.5186087", "0.5177673", "0.5169092", "0.515764", "0.515764", "0.51571167", "0.51549655", "0.51546776", "0.5151406", "0.51434964", "0.5141162", "0.514058", "0.5131163", "0.511928", "0.511542", "0.51140404", "0.5111186", "0.51094", "0.5105804", "0.51041144", "0.50995815", "0.50925314", "0.5088941", "0.5083127", "0.5076563", "0.5073923", "0.50581014", "0.5051608", "0.50456023", "0.5041718", "0.5038681", "0.5032881", "0.50295454", "0.50263005", "0.5024401", "0.5017325", "0.5017096", "0.5008681", "0.49979913", "0.4997979", "0.49968347", "0.49928874" ]
0.70338666
2
Displays a form to edit an existing Upload entity.
public function editAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('MHProductsBundle:Upload')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Upload entity.'); } $editForm = $this->createEditForm($entity); $deleteForm = $this->createDeleteForm($id); return $this->render('MHProductsBundle:Upload:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Upload $upload)\n {\n //\n }", "public function edit(Upload $upload)\n {\n //\n }", "public function edit($id)\n\t{\n\t\t$uploadtypename = Tbluploadtypes::all();\n\t\t$upload = Upload::find($id);\n\t \n\t\treturn view('admin.upload.edit', compact('upload','uploadtypename'));\n\t}", "public function edit(Fileupload $fileupload)\n {\n //\n }", "public function edit()\n\t{\n\t\t$id = $this->uri->segment(5);\n\n\t\tif (empty($id))\n\t\t{\n\t\t\tTemplate::set_message(lang('upload_invalid_id'), 'error');\n\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t}\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\t$this->auth->restrict('Upload.Developer.Edit');\n\n\t\t\tif ($this->save_upload('update', $id))\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_edit_record').': ' . $id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_edit_success'), 'success');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_edit_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\telse if (isset($_POST['delete']))\n\t\t{\n\t\t\t$this->auth->restrict('Upload.Developer.Delete');\n\n\t\t\tif ($this->upload_model->delete($id))\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_delete_record').': ' . $id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_delete_success'), 'success');\n\n\t\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t\t} else\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_delete_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tTemplate::set('upload', $this->upload_model->find($id));\n\t\tAssets::add_module_js('upload', 'upload.js');\n\n\t\tTemplate::set('toolbar_title', lang('upload_edit') . ' Upload');\n\t\tTemplate::render();\n\t}", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $tagNames = array();\n foreach ($model->fetchTags($photo) as $tag) {\n $tagNames[] = $tag->name;\n }\n\n $form = $model->getForm();\n $form->setAction($this->_helper->url('update', null, null, array('id' => $photo->id)));\n $form->setDefault('tags', implode(',', $tagNames));\n $form->populate($photo->toArray());\n\n $this->view->photo = $photo;\n $this->view->photoForm = $form;\n }", "private function createEditForm(Upload $entity)\n {\n $form = $this->createForm(new UploadType(), $entity, array(\n 'action' => $this->generateUrl('admin_uploads_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function edit()\n {\n return view('files::edit');\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('XarismaBundle:Fileops')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fileops entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('XarismaBundle:Fileops:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Lock_Service_FileType::getFileType(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t}", "public function edit(HTTPRequest $request) {\n // Check form field state\n if($this->parent->isDisabled() || $this->parent->isReadonly()) return $this->httpError(403);\n\n // Check item permissions\n $item = $this->getItem();\n if(!$item) return $this->httpError(404);\n if($item instanceof Folder) return $this->httpError(403);\n if(!$item->canEdit()) return $this->httpError(403);\n\n Requirements::css(DMS_DIR . '/css/UploadField.css');\n\n return $this->customise(array(\n 'Form' => $this->EditForm()\n ))->renderWith($this->parent->getTemplateFileEdit());\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit(Form $form)\n {\n //\n }", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MHProductsBundle:Upload')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Upload entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MHProductsBundle:Upload:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "public function newAction()\n {\n $entity = new Upload();\n $form = $this->createCreateForm($entity);\n\n return $this->render('MHProductsBundle:Upload:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function editAction() \n {\n $stepParam = $this->params()->fromRoute('step', 1);\n // Determine the current step.\n $step = 1;\n if ((isset($this->sessionContainer->userChoices[\"step\"]))&&($stepParam==2)) {\n $step = $this->sessionContainer->userChoices[\"step\"]; \n }\n \n // Ensure the step is correct (between 1 and 2).\n if ($step<1 || $step>4)\n $step = 1;\n \n if ($step==1) {\n // Init user choices.\n $this->sessionContainer->userChoices = [];\n $this->sessionContainer->userChoices['step2Dirty'] = false;\n $this->sessionContainer->userChoices['step3Dirty'] = false;\n $this->sessionContainer->userChoices['step4Dirty'] = false;\n }\n \n // Create image holder.\n $files = null;\n $fileTitles = null;\n \n // Get post ID.\n $postId = (int)$this->params()->fromRoute('id', -1);\n \n // Create form.\n $form = new PostForm($step, $postId, $this->translator);\n \n // Validate input parameter\n if ($postId<0) {\n $this->getResponse()->setStatusCode(404);\n return;\n }\n \n // Find the existing post in the database.\n $post = $this->entityManager->getRepository(Post::class)\n ->findOneById($postId); \n if ($post == null) {\n $this->getResponse()->setStatusCode(404);\n return; \n } \n \n // Check whether this post is a POST request.\n if ($this->getRequest()->isPost()) {\n \n // Make certain to merge the files info!\n $request = $this->getRequest();\n $data = array_merge_recursive(\n $request->getPost()->toArray(),\n $request->getFiles()->toArray()\n );\n \n // Fill form with data.\n $form->setData($data);\n if ($form->isValid()) {\n \n // Get validated form data.\n $data = $form->getData();\n \n // Save user choices in session.\n $this->sessionContainer->userChoices[\"step$step\"] = $data; \n \n // Increase step if photo has not been selected.\n $fileExists = $this->postManager->checkFileExists($data); \n \n if($fileExists == false){\n $step ++;\n $this->sessionContainer->userChoices[\"step\"] = $step;\n }else{\n // Create the title file.\n $this->imageManager->createTitleFile($postId, $data);\n }\n \n // If we completed both steps.\n if ($step>4) {\n // Use post manager service update existing post.\n $this->postManager->updatePost($post, \n $this->sessionContainer->userChoices['step1']);\n $this->imageManager->saveTempFiles($post);\n $this->videoManager->saveTempFiles($post);\n $this->audioManager->saveTempFiles($post);\n \n // Redirect the user to \"admin\" page.\n return $this->redirect()->toRoute('posts', ['action'=>'admin']);\n }\n \n // Go to the next step.\n return $this->redirect()->toRoute('posts', ['action'=>'edit',\n 'id'=>$postId, 'step'=>2]);\n\n }\n } else {\n \n if ($step==1) {\n $data = [\n 'title' => $post->getTitle(),\n 'description' => $post->getDescription(),\n 'content' => $post->getContent(),\n 'tags' => $this->postManager->convertTagsToString($post),\n 'status' => $post->getStatus()\n ];\n $form->setData($data);\n }\n\n }\n \n if ($step==2) {\n \n // Get the list of already saved files.\n $files = $this->imageManager->getTempFiles($postId, \n $this->sessionContainer->userChoices['step2Dirty']);\n $fileTitles = $this->imageManager->getTempFileTitles($postId, \n $this->sessionContainer->userChoices['step2Dirty']);\n $this->sessionContainer->userChoices['step2Dirty'] = true; \n }\n \n if ($step==3) {\n \n // Get the list of already saved files.\n $files = $this->videoManager->getTempFiles($postId, \n $this->sessionContainer->userChoices['step3Dirty']);\n $this->sessionContainer->userChoices['step3Dirty'] = true; \n } \n \n if ($step==4) {\n \n // Get the list of already saved files.\n $files = $this->audioManager->getTempFiles($postId, \n $this->sessionContainer->userChoices['step4Dirty']);\n $this->sessionContainer->userChoices['step4Dirty'] = true; \n } \n \n if (!$this->access('post.own.edit', ['post'=>$post])) {\n return $this->redirect()->toRoute('not-authorized');\n }\n \n // Render the view template.\n $viewModel = new ViewModel([\n 'files' => $files,\n 'fileTitles' => $fileTitles,\n 'form' => $form,\n 'post' => $post\n ]);\n $viewModel->setTemplate(\"application/post/edit$step\");\n \n return $viewModel;\n }", "public function edit($model, $form);", "public function uploadAction() {\n $imgId = $this->getInput('imgId');\n $this->assign('imgId', $imgId);\n $this->getView()\n ->display('common/upload.phtml');\n }", "public function updateAction(Request $request, $id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MHProductsBundle:Upload')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Upload entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n\n if ($editForm->isValid()) {\n $em->flush();\n\n return $this->redirect($this->generateUrl('admin_uploads'));\n }\n\n return $this->render('MHProductsBundle:Upload:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function renderUploadForm() {}", "public function edit(form $form)\n {\n //\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('HamdiMediaBundle:GalleryImage')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find GalleryImage entity.');\n }\n\n $editForm = $this->createForm(new GalleryImageType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('HamdiMediaBundle:GalleryImage:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function uploadFileForm()\n {\n return view('admin.file.uploadFile');\n }", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function editView() {\n Template_Module::setFullWidth(true);\n $this->edit = true;\n $this->addView();\n // cestak obrázků\n $this->imagePath = $this->category()->getModule()->getDataDir(true);\n }", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function editAction(): void {\n View::renderTemplate('Profile/edit.twig', [\n 'user' => $this->user\n ]);\n }", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function edit(ImageUploads $imageUploads)\n {\n //\n }", "public function editAction() {\n if (!$this->zfcUserAuthentication()->hasIdentity()) {\n // redirect to the login redirect route\n return $this->redirect()->toRoute('account');\n }\n\n $id = (int) $this->params()->fromRoute('id', 0);\n if (!$id) {\n return $this->redirect()->toRoute('album', array('action' => 'add'));\n }\n $album = $this->getAlbumTable()->getAlbum($id);\n $form = new AlbumForm();\n $form->bind($album);\n\n $form->get('submit')->setAttribute('value', 'Edit');\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $form->setInputFilter($album->getInputFilter());\n $form->setData($request->getPost());\n if ($form->isValid()) {\n $this->getAlbumTable()->saveAlbum($form->getData());\n // Redirect to list of albums\n return $this->redirect()->toRoute('album');\n }\n }\n return new ViewModel(array(\n 'id' => $id,\n 'form' => $form,\n ));\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function editForm(): void\n {\n $this->articleId = $_GET['id'];\n $query = $this->articleModel->displayOneArticle($this->articleId);\n $editArticle = $query->fetch();\n\n $this->title = $editArticle['title'];\n $this->content = $editArticle['content'];\n $this->category = $editArticle['category'];\n }", "public function edit(Entity $entity)\n {\n $entity->typeCompanyPreview = self::previewTypeCompany($entity->type_company);\n\n\n return view('entity.edit', compact('entity'));\n }", "public function editAction()\r\n {\r\n \r\n $id= $this->container->get('security.context')->getToken()->getUser()->getId();\r\n $em = $this->getDoctrine()->getManager();\r\n $entity = $em->getRepository('UtilisateurBundle:Utilisateur')->find($id);\r\n \r\n if (!$entity) {\r\n throw $this->createNotFoundException('Unable to find Utilisateur entity.');\r\n }\r\n\r\n $editForm = $this->createEditForm($entity);\r\n $deleteForm = $this->createDeleteForm($id);\r\n\r\n return $this->render('UtilisateurBundle:Default:info.html.twig', array(\r\n 'entity' => $entity,\r\n 'edit_form' => $editForm->createView(),\r\n 'delete_form' => $deleteForm->createView(),\r\n ));\r\n }", "public function edit(Normativa $normativa)\n {\n //\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('GestionPassBundle:Fluidite')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fluidite entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('GestionPassBundle:Fluidite:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editForm() {\n return tpl::load(__DIR__ . DS . 'form.php', array('field' => $this));\n }", "public function editAction() {\n $entities = $this\n ->_getRepository()\n ->findAllOrdered();\n $entities = $this->_transformAllConfigEntities($entities);\n $form = $this->createForm(new ConfigType(), array(\n 'configentities' => $entities,\n ));\n\n return array(\n 'form' => $form->createView(),\n );\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction() {}", "public function edit($id)\n {\n $file = File::find($id);\n return view('admin.files.edit', compact(\n 'file'\n ));\n }", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function show(Upload $upload)\n {\n //\n }", "public function show(Upload $upload)\n {\n //\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function update_edit_form() {\n if ( ! $this->isValidPostType() ) {\n return false;\n }\n echo ' enctype=\"multipart/form-data\"';\n }", "public function editAction()\n {\n $ctrlRow = new Admin_Model_DbRow_Controller($this->dbCtrl->find($this->checkControllerIdParam()));\n $form = new Admin_Form_Controller_Edit($ctrlRow);\n\n IF($this->getRequest()->isPost()) {\n IF($form->isValid($this->getRequest()->getParams())) {\n $ctrlRow->fromArray(array(\n 'description' => $this->getRequest()->getParam('description')\n ));\n $this->dbCtrl->update($ctrlRow->toDbArray(array('description')), $ctrlRow->get('id'));\n \n $this->_redirect('admin/controller/index');\n }\n }\n\n $this->view->form = $form;\n }", "public function edit(FileList $upload_file)\n {\n if(isset(auth()->user()->creator_id) && ! auth()->user()->permissions->contains('name', 'update')) {\n return redirect('home');\n }\n\n return view('upload_file.home', get_defined_vars());\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit(FormModel $formModel)\n {\n //\n }", "public function editAction()\n {\n $profileRepoFactory = new Application_Factory_ProfileRepository();\n $profileModelFactory = new Application_Factory_ProfileModel();\n $profileForm = new Application_Form_Profile(['id' => 'edit-profile']);\n\n $profileForm->submit->setLabel(\"Save\");\n $profileRepo = $profileRepoFactory->createService();\n\n $this->view->profileForm = $profileForm;\n\n //GET request handler\n $visitEditProfilePage = !$this->getRequest()->isPost();\n if ($visitEditProfilePage) {\n $profileId = (int) $this->getParam('id', 0);\n $profileEntity = $profileRepo->findById($profileId);\n $profileForm->bindFromProfile($profileEntity);\n return; //render edit profile form\n }\n\n //POST request handler\n $postInvalidProfile = !$profileForm->isValid($this->getRequest()->getPost());\n if ($postInvalidProfile) {\n return; //represent profile form with error messages\n }\n\n //Persit filtered profile to persistent\n $profileRepo->save($profileModelFactory->createService($profileForm->getValues()));\n $this->_helper->redirector('index', 'profile', 'default');\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n {\n $Bookupload =Bookupload::find($id);\n return view('admins.Bookupload.edit')->with('Bookupload',$Bookupload);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AlmaBundle:TipoCamera')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find TipoCamera entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n\n return $this->render('AlmaBundle:TipoCamera:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView()\n ));\n }", "public function edit($id,rUser $rUser)\n {\n\n\n $upload_file=$this->rUploadFile->show($id);\n\n\n $userList=$rUser->getAllList();\n return view('admin.upload_file::edit', compact('upload_file','userList'));\n }", "public function edit() {\n $user = \\Auth::user();\n return view('avatar.edit')->with('user', $user);\n }", "public function executeEdit(sfWebRequest $request)\n {\n $this->embedAllowed = aMediaTools::getEmbedAllowed();\n $this->uploadAllowed = aMediaTools::getUploadAllowed(); \n $this->forward404Unless(aMediaTools::userHasUploadPrivilege());\n $item = null;\n $this->slug = false;\n $this->popularTags = PluginTagTable::getPopulars(null, array('sort_by_popularity' => true), false, 10);\n if (sfConfig::get('app_a_all_tags', true))\n {\n $this->allTags = PluginTagTable::getAllTagNameWithCount();\n }\n else\n {\n $this->allTags = array();\n }\n if ($request->hasParameter('slug'))\n {\n $item = $this->getItem();\n $this->slug = $item->getSlug();\n }\n $this->forward404Unless($item);\n $this->forward404Unless($item->userHasPrivilege('edit'));\n $this->item = $item;\n if ($this->item->getEmbeddable())\n {\n // Handles the embed field correctly\n $this->form = new aMediaVideoForm($item);\n }\n else\n {\n $this->form = new aMediaEditForm($item);\n }\n $this->form->getWidgetSchema()->setNameFormat('a_media_item_'.$item->id.'_%s');\n \n $this->postMaxSizeExceeded = false;\n // An empty POST is an anomaly indicating that we hit the php.ini max_post_size or similar\n if ($request->isMethod('post') && (!count($request->getPostParameters())))\n {\n $this->postMaxSizeExceeded = true;\n }\n if ((!$this->postMaxSizeExceeded) && $request->isMethod('post'))\n {\n $parameters = $request->getParameter('a_media_item_'.$item->id.'_');\n $values = $request->getParameterHolder()->getAll();\n $value = array();\n $files = array();\n foreach ($values as $k => $v)\n {\n if (preg_match('/^a_media_item_' . $item->id . '_(.*)$/', $k, $matches))\n {\n if($k == $this->form['file']->renderId())\n {\n $files[$matches[1]] = $request->getFiles($this->form['file']->renderId());\n } else\n {\n $value[$matches[1]] = $v;\n }\n }\n } \n $parameters = $value;\n \n $result = null;\n if (isset($parameters['embed']))\n {\n // We need to do some prevalidation of the embed code so we can prestuff fields\n $result = $this->form->classifyEmbed($parameters['embed']);\n error_log(json_encode($result));\n }\n\n // If there is no thumbnail already stored for this media item,\n // and we are able to obtain one from the service, do so. If there is\n // already a thumbnail leave it alone as it might be a deliberate\n // replacement (TODO: it would be nice to always do it if the embed\n // code is definitely new)\n if (isset($result['thumbnail']) && (!$item->getImageAvailable()))\n {\n $this->convertServiceThumbnailToFileUpload($result['thumbnail'], $parameters);\n }\n \n $this->form->bind($parameters, $files);\n if ($this->form->isValid())\n {\n $file = $this->form->getValue('file');\n // The base implementation for saving files gets confused when \n // $file is not set, a situation that our code tolerates as useful \n // because if you're updating a record containing an image you \n // often don't need to submit a new one.\n unset($this->form['file']);\n $object = $this->form->getObject();\n if ($file)\n {\n // Everything except the actual copy which can't succeed\n // until the slug is cast in stone\n $object->preSaveFile($file->getTempName());\n }\n $this->form->save();\n if ($file)\n {\n $object->saveFile($file->getTempName());\n }\n if ($request->isXmlHttpRequest())\n {\n return $this->renderPartial('aMedia/mediaItemMeta', array(\n 'mediaItem' => $object,\n 'popularTags' => $this->popularTags,\n 'allTags' => $this->allTags,\n 'layout' => aMediaTools::getLayout($this->getUser()->getAttribute('layout', 'two-up', 'apostrophe_media'))\n ));\n }\n return $this->redirect(\"aMedia/resumeWithPage\");\n }\n }\n if ($request->isXmlHttpRequest())\n {\n return $this->renderTemplate('Ajax');\n }\n return $this->renderTemplate();\n }", "public function fileEdit($field)\n {\n $form = new Forms($field, $this->config, $this->$field);\n if (in_array($field, $this->uploads['single'])) {\n $form->count(1, true);\n }\n return $form->editor();\n }", "private function createEditForm(Fileops $entity)\n {\n $form = $this->createForm(new FileopsType(), $entity, array(\n 'action' => $this->generateUrl('fileops_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function edit() {\n\t\t$data['pagetitle'] = 'Dashboard - Edit Posts';\n\n\t\t$data['postid'] = $viewmodel->getPostById($postid['id'] );\n\t\tView::renderAdminTemplate($data, \"App/Views/admin/edit/index.php\") ;\n\t}", "public function edit()\n {\n\n $data['id'] = Input::get('id');\n $page = $this->photoGallery->getDataById($data['id']);\n\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n $rootParent = $this->photoGallery->rootParentList();\n $dash = \"\";\n $dropdown = [ ];\n $pageList = [ \"\" => 'Select Gallery' ] + $this->recur($rootParent, $dash, $dropdown);\n\n return view('cms.modules.multicms.photoGallery_edit', compact('page', 'pageList'), $data);\n }", "public function getUploadfile()\n {\n return view(\"Admin::employee.uploadfile\");\n }", "public function edit()\r\n\r\n {\r\n\r\n $this->page_title->push(lang('menu_products_add'));\r\n\r\n $this->data['pagetitle'] = $this->page_title->show();\r\n\r\n\r\n /* Breadcrumbs :: Common */\r\n\r\n $this->breadcrumbs->unshift(1, lang('menu_products_add'), 'admin/setup/product/edit');\r\n\r\n\r\n /* Breadcrumbs */\r\n\r\n $this->data['breadcrumb'] = $this->breadcrumbs->show();\r\n\r\n\r\n /* Data */\r\n\r\n $this->data['error'] = NULL;\r\n\r\n $this->data['charset'] = 'utf-8';\r\n\r\n $this->data['form_url'] = 'admin/setup/product/update';\r\n\r\n\r\n /* Load Template */\r\n\r\n $this->template->admin_render('admin/products/edit', $this->data);\r\n\r\n\r\n }", "public function edit($file)\n {\n return view ('admin.files.edit');\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit($id)\n\t{\n\t\t// dd(Files::findOrFail($id));\n\n\t\t$file = Files::findOrFail($id);\n\t\treturn view('admin.files.edit')->with('file', $file);\n\t\t// return view('admin.files.edit', compact('file'));\n\t}", "public function edit(Picture $picture)\n {\n //\n }", "function editPlatformForm($id)\n {\n global $mysqli;\n $sql=\"SELECT * FROM platforms WHERE platformID=$id\";\n $result=$mysqli->query($sql)or die(\"query failed due to \".mysqli_error());\n if($result->num_rows==0)//redirect if unknown id \n {\n logError(\"unkown platform id\");\n header(\"location:./platform.php\");\n exit(); \n }\n else\n {//load platform content to be edited\n $row=$result->fetch_assoc();\n $name=$row['platformName'];\n $icon= $row['platformIcon'];\n $id=$row['platformID'];\n echo '<form action=\"./platform.php?action=update&id='.$id.'\" method=\"post\" enctype=\"multipart/form-data\" id=\"editForm\">\n <label>Platform Name :</label><input type=\"text\" name=\"name\" value=\"'.$name.'\" /><br />\n <label>Platform Icon :</label><input type=\"file\" value=\"upload\" name=\"icon\" /><br />\n <input type=\"submit\" name=\"submit\" value=\"submit\" />\n </form>'; \n }\n }", "public function uploadingForm()\n {\n return view('formuploads.formupload');\n\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function actionEdit()\n {\n $fieldId = (int)$this->post('id') | $this->get('id');\n $field = $this->seoFieldsModel->getField($fieldId);\n\n if (!$field) {\n clsCommon::redirect301('Location: ' . ADMIN_PATH . '/seofields');\n }\n\n if ($this->post()) {\n if (!clsSeoFields::validateFieldName($this->post('name'))) {\n $error = clsAdminCommon::getAdminMessage(\n 'error_field_az',\n ADMIN_ERROR_BLOCK,\n array('{%fieldname}' => 'Name')\n );\n $this->error->setError($error, 1, false, true);\n } else {\n $field->setName($this->post('name'));\n $updateRes = $this->seoFieldsModel->updateField($field);\n switch ($updateRes) {\n case clsSeoFields::STATUS_FIELD_ALREADY_EXISTS :\n $this->error->setError(\n 'Field with name ' . $field->getName() . ' already exists.',\n 1,\n false,\n true\n );\n break;\n case clsSeoFields::STATUS_FAIL :\n case clsSeoFields::STATUS_FIELD_NOT_EXISTS :\n $this->error->setError('Field has not been updated.', 1, false, true);\n break;\n default:\n $actionStatus = clsAdminCommon::getAdminMessage(\n 'succ_edit_entity',\n ADMIN_ERROR_BLOCK,\n array('{%entity}' => $this->entity, '{%entityname}' => $field->getName())\n );\n $this->error->setError($actionStatus, 1, true, true);\n clsCommon::redirect301('Location: ' . ADMIN_PATH . '/seofields/index');\n }\n }\n }\n $this->parser->field = $field;\n return $this->parser->render('@main/pages/seo/admin/seofields/edit.html');\n }", "public function getEdit(){\n return view(\"admin.product.edit\" );\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function actionEdit()\n\t{\n\t\t$field = $this->_getFieldOrError($this->_input->filterSingle('field_id', XenForo_Input::STRING));\n\t\treturn $this->_getFieldAddEditResponse($field);\n\t}", "public function editTask() {\n return $this->render('enterprise/task/task_form.html.twig');\n }", "public function edit($id)\n {\n //\n $name = \"edit\";\n $imageNew = ImageNew::findOrFail($id);\n return view('admin.imageNew.imageNewEdit',compact('name','imageNew'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('estarRdaBundle:Utente')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Utente entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('estarRdaBundle:Utente:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $item = Artistprofile::find($id);\n return view('profiles.editdataprofileForm',compact('item'));\n }", "private function createEditForm(Picture $entity)\n {\n $form = $this->createForm(new PictureType(), $entity, array(\n 'action' => $this->generateUrl('picture_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function editAction() {\n if($this->_getParam('id',false)) {\n $form = new ContentForm();\n $form->submit->setLabel('Submit changes');\n $form->author->setValue($this->getIdentityForForms());\n $this->view->form = $form;\n if($this->getRequest()->isPost() \n && $form->isValid($this->_request->getPost())){\n if ($form->isValid($form->getValues())) {\n $updateData = $form->getValues();\n $where = array();\n $where[] = $this->_content->getAdapter()\n ->quoteInto('id = ?', $this->_getParam('id'));\n $oldData = $this->_content->fetchRow($this->_content\n ->select()->where('id= ?' , \n (int)$this->_getParam('id')))->toArray();\n $this->_helper->audit($updateData, $oldData, 'ContentAudit', \n $this->_getParam('id'), $this->_getParam('id'));\n $this->_content->update($updateData, $where);\n $this->_helper->solrUpdater->update('beocontent', \n $this->_getParam('id'), 'content'); \n $this->getFlash()->addMessage('You updated: <em>' \n . $form->getValue('title') \n . '</em> successfully. It is now available for use.');\n $this->getCache()->clean(Zend_Cache::CLEANING_MODE_ALL);\n $this->_redirect('admin/content/');\n } else {\n $form->populate($this->_request->getPost());\n }\n } else {\n // find id is expected in $params['id']\n $id = (int)$this->_request->getParam('id', 0);\n if ($id > 0) {\n $content = $this->_content->fetchRow('id=' . (int)$id)->toArray();\n if($content) {\n $form->populate($content);\n } else {\n throw new Pas_Exception_Param($this->_nothingFound);\n }\n }\n }\n } else {\n throw new Pas_Exception_Param($this->_missingParameter, 500);\n }\n }", "public function editAction($id) {\n $this->get('session')->getFlashBag()->clear();\n\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('UsuarioBundle:Perfil')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha podido encontrar la entidad Perfil.');\n }\n\n $editForm = $this->createForm(new PerfilType(), $entity);\n\n return $this->render('UsuarioBundle:Perfil:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n ));\n }", "public function editAction() {\n $slideshowid = $this->_getParam('id', false);\n if ($slideshowid == false) {\n $error = new Zend_Session_Namespace('error');\n $error->msg = \"Parameter 'id' is missing!\";\n $this->_redirect('/webmaster-panel/slideshow/');\n }\n\n // create object and fetch row of the current slideshow\n $dbTableSlideshow = new Default_Model_DbTable_Slideshow();\n $slideshow = $dbTableSlideshow->fetchRow($dbTableSlideshow->select()->where('id=' . $slideshowid));\n\n // check if object contains id\n if (!isset($slideshow->id)) {\n $error = new Zend_Session_Namespace('error');\n $error->msg = \"This slideshow doesn't exists!\";\n $this->_redirect('/webmaster-panel/slideshow/');\n }\n\n $request = $this->getRequest();\n $form = new WebmasterPanel_Form_Slideshow('Update', $slideshow);\n if ($request->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n $data = $form->getValues();\n $data['date_modified'] = date('Y-m-d H:i:s');\n\n $dbTableSlideshow = new Default_Model_DbTable_Slideshow();\n $dbTableSlideshow->update($data, \"`id`='$slideshowid'\");\n $this->_redirect('/webmaster-panel/slideshow/');\n }\n }\n $this->view->form = $form;\n }", "public function getEditForm();", "public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}" ]
[ "0.76635087", "0.76635087", "0.7319025", "0.727926", "0.7155447", "0.7064358", "0.7026251", "0.6971774", "0.69346964", "0.6689844", "0.66567624", "0.6620031", "0.65884733", "0.6543387", "0.6539892", "0.6527884", "0.652384", "0.6512478", "0.65072465", "0.64936537", "0.64774656", "0.6472715", "0.6468832", "0.64571285", "0.64488244", "0.641289", "0.6400032", "0.6374473", "0.6371036", "0.63634616", "0.63618994", "0.63581735", "0.63581735", "0.6354263", "0.63502234", "0.63502234", "0.63502234", "0.63502234", "0.63502234", "0.63502234", "0.634002", "0.6319056", "0.6315334", "0.63100445", "0.630062", "0.62536603", "0.6253626", "0.6241058", "0.6233387", "0.62184095", "0.62076753", "0.62046623", "0.61986464", "0.61966926", "0.61889786", "0.61889786", "0.61887586", "0.6181944", "0.6179995", "0.616434", "0.6146047", "0.6140894", "0.61347455", "0.61308765", "0.6127009", "0.61135566", "0.61099887", "0.61020833", "0.6099461", "0.60981995", "0.60961753", "0.6095552", "0.60927045", "0.6083413", "0.60816956", "0.6075734", "0.6070966", "0.6068493", "0.60662216", "0.6062684", "0.60620564", "0.60596573", "0.60596573", "0.60569793", "0.6056908", "0.6051991", "0.6051991", "0.6044176", "0.6037119", "0.6036231", "0.6034925", "0.60332906", "0.60322285", "0.60257274", "0.6022878", "0.6019368", "0.60176647", "0.60131305", "0.60056823", "0.59977067" ]
0.78077114
0
Creates a form to edit a Upload entity.
private function createEditForm(Upload $entity) { $form = $this->createForm(new UploadType(), $entity, array( 'action' => $this->generateUrl('admin_uploads_update', array('id' => $entity->getId())), 'method' => 'PUT', )); $form->add('submit', 'submit', array('label' => 'Update')); return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createEditForm(Fileops $entity)\n {\n $form = $this->createForm(new FileopsType(), $entity, array(\n 'action' => $this->generateUrl('fileops_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function edit(Upload $upload)\n {\n //\n }", "public function edit(Upload $upload)\n {\n //\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MHProductsBundle:Upload')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Upload entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MHProductsBundle:Upload:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "private function createEditForm(Picture $entity)\n {\n $form = $this->createForm(new PictureType(), $entity, array(\n 'action' => $this->generateUrl('picture_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Image $entity)\n {\n $form = $this->createForm(new ImageType(), $entity, array(\n 'action' => $this->generateUrl('image_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Fluidite $entity)\n {\n $form = $this->createForm(new FluiditeType(), $entity, array(\n 'action' => $this->generateUrl('fluidite_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array(\n 'label' => 'Update',\n 'attr' => array(\n 'class' => 'btn ')\n \n ));\n\n return $form;\n }", "public function edit(Fileupload $fileupload)\n {\n //\n }", "private function createEditForm(Push $entity)\n {\n $form = $this->createForm(new PushType(), $entity, array(\n 'action' => $this->generateUrl('push_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n 'attr' => array('id' => 'edit-form')\n ));\n\n return $form;\n }", "private function createCreateForm(Upload $entity)\n {\n $form = $this->createForm(new UploadType(), $entity, array(\n 'action' => $this->generateUrl('admin_uploads_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create', 'attr' => array('class' => 'btn btn-success')));\n\n return $form;\n }", "public function UploadForm()\n {\n return Form::create($this, \"UploadForm\",\n FieldList::create(\n FileField::create(\"XMLFile\", 'Wordpress XML file'),\n HiddenField::create(\"BlogHolderID\", '', $this->getBlogHolderID())\n ),\n FieldList::create(\n FormAction::create('doUpload', 'Import Wordpress XML file')\n )\n );\n }", "private function createEditForm(Feriado $entity)\n {\n $form = $this->createForm(new FeriadoType(), $entity, array(\n 'action' => $this->generateUrl('feriado_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Bien $entity)\n {\n $form = $this->createForm(new BienType(), $entity, array(\n 'action' => $this->generateUrl('bien_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function newAction()\n {\n $entity = new Upload();\n $form = $this->createCreateForm($entity);\n\n return $this->render('MHProductsBundle:Upload:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "private function createEditForm(TipoCamera $entity)\n {\n $form = $this->createForm(new TipoCameraType(), $entity, array(\n 'action' => $this->generateUrl('tipocamera_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modifica'));\n\n return $form;\n }", "private function createEditForm(Inspection $entity)\n {\n $form = $this->createForm(new InspectionType(), $entity, array(\n 'action' => $this->generateUrl('inspection_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modifier','attr' => array('class' => 'btn btn-default'))); \n\n return $form;\n }", "private function createEditForm(Functions $entity) {\n $session = $this->get(\"session\");\n $form = $this->createForm(new FunctionsType(), $entity, array(\n 'action' => $this->generateUrl('hall_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n \n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Vluchten $entity)\n {\n $form = $this->createForm(new VluchtenType(), $entity, array(\n 'action' => $this->generateUrl('vluchten_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Project $entity)\n {\n $form = $this->createForm(new ProjectType(), $entity);\n $form->add('submit', 'submit', array('label' => 'Update'));\n return $form;\n }", "public function createForm() {\n module_load_include('inc', 'islandora_form_builder', 'FormGenerator');\n $form_values = &$this->formState['values'];\n $file = isset($form_values['ingest-file-location']) ? $form_values['ingest-file-location'] : '';\n $form['#attributes']['enctype'] = 'multipart/form-data';\n $form['indicator']['ingest-file-location'] = array(\n '#type' => 'file',\n '#title' => t('Upload Document'),\n '#size' => 48,\n '#description' => t('Select file to be added the the object.'),\n );\n $form_generator = FormGenerator::CreateFromModel($this->contentModelPid, $this->contentModelDsid);\n $form[FORM_ROOT] = $form_generator->generate($this->formName); // TODO get from user .\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Ingest'),\n '#prefix' => t('Please be patient. Once you click next there may be a number of files created. ' .\n 'Depending on your content model this could take a few minutes to process.<br />')\n );\n return $form;\n }", "private function createEditForm(ActionListe $entity)\n {\n $form = $this->createForm(new ActionListeType(), $entity, array(\n 'action' => $this->generateUrl('actionliste_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modifier'));\n\n return $form;\n }", "public function uploadFileForm()\n {\n return view('admin.file.uploadFile');\n }", "public function edit(Form $form)\n {\n //\n }", "private function createEditForm(EnvaseIngreso $entity)\n {\n $form = $this->createForm(new EnvaseIngresoType(), $entity, array(\n 'action' => $this->generateUrl('envase_ingreso_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Guardar', 'attr' => array('class' => \"btn btn-success\")));\n\n return $form;\n }", "private function createEditForm(ObjectType $entity)\n {\n $form = $this->createForm(new ObjectTypeType(), $entity, array(\n 'action' => $this->generateUrl('object_objecttype_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Сохранить изменения'));\n\n return $form;\n }", "private function createEditForm(Compte $entity)\n {\n $form = $this->createForm(new CompteType(), $entity, array(\n 'action' => $this->generateUrl('compte_update', array('id' => $entity->getId())),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Mettre à jour'));\n\n return $form;\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "private function createEditForm(IntrestConfig $entity) {\n\t\t$form = $this->createForm(new IntrestConfigType(), $entity, array(\n\t\t\t'action' => $this->generateUrl('member_intrestconfig_update', array('id' => $entity->getId())),\n\t\t\t'method' => 'PUT',\n\t\t));\n\n\t\t$form->add('submit', 'submit', array('label' => 'Update'));\n\n\t\treturn $form;\n\t}", "private function createEditForm(Utente $entity)\n {\n $form = $this->createForm(new UtenteType(), $entity, array(\n 'action' => $this->generateUrl('utente_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function editForm() {\n return tpl::load(__DIR__ . DS . 'form.php', array('field' => $this));\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "private function createEditForm(Task $entity) //recibiendo nuestra entidad de tarea\n {\n //$form = $this->createForm(new TaskType, $entity, array( \n //pero para Symfony3.4.15 ahora es: \n $form = $this->createForm(TaskType::class, $entity, array(\n 'action' => $this->generateUrl('infunisa_task_update', array('id' => $entity->getId())),\n 'method' => 'PUT' //como estamos editando la tarea usamos PUT\n ));\n \n return $form;\n }", "private function createEditForm(Incapacidad $entity)\n {\n $form = $this->createForm(new IncapacidadType(), $entity, array(\n 'action' => $this->generateUrl('admin_incapacidad_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modificar','attr'=>\n array('class'=>'btn btn-primary btn-sm')\n ));\n\n return $form;\n }", "private function createEditForm(Equipo $entity)\n {\n $form = $this->createForm(new EquipoType(), $entity, array(\n 'action' => $this->generateUrl('tecnoequipo_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function renderUploadForm() {}", "public function edit($id)\n\t{\n\t\t$uploadtypename = Tbluploadtypes::all();\n\t\t$upload = Upload::find($id);\n\t \n\t\treturn view('admin.upload.edit', compact('upload','uploadtypename'));\n\t}", "private function createEditForm(Endroit $entity)\n {\n $form = $this->createForm(new EndroitType(), $entity, array(\n 'action' => $this->generateUrl('endroit_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Grupos $entity)\n {\n $form = $this->createForm(new GruposType(), $entity, array(\n 'action' => $this->generateUrl('grupos_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Atualizar'));\n\n return $form;\n }", "private function createEditForm(Testimonial $entity)\n {\n $form = $this->createForm(new TestimonialType(), $entity, array(\n 'action' => $this->generateUrl('config_testimonial_update', array('id' => $entity->getId())),\n 'attr' => array('enctype' => 'multipart/form-data'),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar'));\n\n return $form;\n }", "private function createEditForm(PIFEClassique $entity)\n {\n $form = $this->createForm(new PIFEClassiqueType(), $entity, array(\n 'action' => $this->generateUrl('pifeclassique_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Mettre à jour'));\n\n return $form;\n }", "private function createEditForm(Encuesta $entity)\n {\n $form = $this->createForm(new EncuestaType(), $entity, array(\n 'action' => $this->generateUrl('encuesta_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Feed $entity)\n {\n $form = $this->createForm(new FeedType($this->getDoctrine()->getManager()), $entity, array(\n 'action' => $this->generateUrl('update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "protected function form()\n {\n return Admin::form(PlatformFile::class, function (Form $form) {\n\n $form->display('id', 'ID');\n $form->multipleSelect('platform_ids', '主机')->options(Platform::all()->pluck('platform_name', 'id'))->attribute(['required'=>'required']);\n $form->multipleSelect('file_ids', '软件')->options(File::all()->pluck('name', 'id'))->attribute(['required'=>'required']);\n $form->text('upload_path', '上传路径');\n\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n\n $form->setAction('/admin/platform-file-application');\n });\n }", "private function createEditForm(Examen $entity)\n {\n $form = $this->createForm(new ExamenType(), $entity, array(\n 'action' => $this->generateUrl('examen_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Usuario $entity)\n {\n $form = $this->createForm(new UsuarioType(), $entity, array(\n 'action' => $this->generateUrl('usuarios_update', array('id' => $entity->getId())),\n 'method' => 'POST',\n 'attr' => array('enctype' => 'multipart/form-data'),\n ));\n\n\n $form->add('submit', 'submit', array('label' => 'Guardar cambios', 'attr' => array('class' => 'btn btn-primary btn-large')));\n\n return $form;\n }", "private function createEditForm(Aula $entity)\n {\n $form = $this->createForm(new AulaType(), $entity, array(\n 'action' => $this->generateUrl('aulas_aula_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n $form->add('submit', 'submit', array('label' => 'Actualizar','attr'=>array('class'=>'btn btn-default botonTabla')));\n $form->add('button', 'submit', array('label' => 'Volver a la lista','attr'=>array('formaction'=>'../../aula','formnovalidate'=>'formnovalidate','class'=>'btn btn-default botonTabla')));\n return $form;\n }", "private function createEditForm(SyntaxonCore $entity)\n {\n $form = $this->createForm(new SyntaxonCoreType(), $entity, array(\n 'action' => $this->generateUrl('admin_syntaxon_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function getEditForm();", "public function uploadingForm()\n {\n return view('formuploads.formupload');\n\n }", "private function createEditForm(DevisSetup $entity)\n {\n $form = $this->createForm(new DevisSetupType(), $entity, array(\n 'action' => $this->generateUrl('devissetup_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Empleado $entity)\n {\n $form = $this->createForm(new EmpleadoType(), $entity, array(\n 'action' => $this->generateUrl('empleado_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function edit(form $form)\n {\n //\n }", "private function createEditForm(LocalBanner $entity)\n {\n $form = $this->createForm(new LocalBannerType(), $entity, array(\n 'action' => $this->generateUrl('localbanner_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => $this->get('translator')->transChoice('txt.editar',0,array(),'messagesCommonBundle'), 'attr' => array('class' => 'btn btn-primary btn-lg')));\n\n return $form;\n }", "function newPlatformForm()\n{\n echo '<form action=\"./platform.php?action=add\" method=\"post\" enctype=\"multipart/form-data\" id=\"editForm\">\n <label>Platform Name :</label><input type=\"text\" name=\"name\" /><br />\n <label>Platform Icon :</label><input type=\"file\" value=\"upload\" name=\"icon\" /><br />\n <input type=\"submit\" name=\"submit\" value=\"submit\" />\n </form>';\n}", "private function createEditForm(Dream $entity)\n {\n $form = $this->createForm(new DreamType(), $entity, array(\n 'action' => $this->generateUrl('dreams_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(SkBusiness $entity) {\n $form = $this->createForm(new SkBusinessType(), $entity, array(\n 'action' => $this->generateUrl('business_admin_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n// $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function edit()\n\t{\n\t\t$id = $this->uri->segment(5);\n\n\t\tif (empty($id))\n\t\t{\n\t\t\tTemplate::set_message(lang('upload_invalid_id'), 'error');\n\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t}\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\t$this->auth->restrict('Upload.Developer.Edit');\n\n\t\t\tif ($this->save_upload('update', $id))\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_edit_record').': ' . $id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_edit_success'), 'success');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_edit_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\telse if (isset($_POST['delete']))\n\t\t{\n\t\t\t$this->auth->restrict('Upload.Developer.Delete');\n\n\t\t\tif ($this->upload_model->delete($id))\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_delete_record').': ' . $id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_delete_success'), 'success');\n\n\t\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t\t} else\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_delete_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tTemplate::set('upload', $this->upload_model->find($id));\n\t\tAssets::add_module_js('upload', 'upload.js');\n\n\t\tTemplate::set('toolbar_title', lang('upload_edit') . ' Upload');\n\t\tTemplate::render();\n\t}", "private function createEditForm(Visiteur $entity)\n {\n $form = $this->createForm(new VisiteurType(), $entity, array(\n 'action' => $this->generateUrl('visiteur_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function editAction() \n {\n $stepParam = $this->params()->fromRoute('step', 1);\n // Determine the current step.\n $step = 1;\n if ((isset($this->sessionContainer->userChoices[\"step\"]))&&($stepParam==2)) {\n $step = $this->sessionContainer->userChoices[\"step\"]; \n }\n \n // Ensure the step is correct (between 1 and 2).\n if ($step<1 || $step>4)\n $step = 1;\n \n if ($step==1) {\n // Init user choices.\n $this->sessionContainer->userChoices = [];\n $this->sessionContainer->userChoices['step2Dirty'] = false;\n $this->sessionContainer->userChoices['step3Dirty'] = false;\n $this->sessionContainer->userChoices['step4Dirty'] = false;\n }\n \n // Create image holder.\n $files = null;\n $fileTitles = null;\n \n // Get post ID.\n $postId = (int)$this->params()->fromRoute('id', -1);\n \n // Create form.\n $form = new PostForm($step, $postId, $this->translator);\n \n // Validate input parameter\n if ($postId<0) {\n $this->getResponse()->setStatusCode(404);\n return;\n }\n \n // Find the existing post in the database.\n $post = $this->entityManager->getRepository(Post::class)\n ->findOneById($postId); \n if ($post == null) {\n $this->getResponse()->setStatusCode(404);\n return; \n } \n \n // Check whether this post is a POST request.\n if ($this->getRequest()->isPost()) {\n \n // Make certain to merge the files info!\n $request = $this->getRequest();\n $data = array_merge_recursive(\n $request->getPost()->toArray(),\n $request->getFiles()->toArray()\n );\n \n // Fill form with data.\n $form->setData($data);\n if ($form->isValid()) {\n \n // Get validated form data.\n $data = $form->getData();\n \n // Save user choices in session.\n $this->sessionContainer->userChoices[\"step$step\"] = $data; \n \n // Increase step if photo has not been selected.\n $fileExists = $this->postManager->checkFileExists($data); \n \n if($fileExists == false){\n $step ++;\n $this->sessionContainer->userChoices[\"step\"] = $step;\n }else{\n // Create the title file.\n $this->imageManager->createTitleFile($postId, $data);\n }\n \n // If we completed both steps.\n if ($step>4) {\n // Use post manager service update existing post.\n $this->postManager->updatePost($post, \n $this->sessionContainer->userChoices['step1']);\n $this->imageManager->saveTempFiles($post);\n $this->videoManager->saveTempFiles($post);\n $this->audioManager->saveTempFiles($post);\n \n // Redirect the user to \"admin\" page.\n return $this->redirect()->toRoute('posts', ['action'=>'admin']);\n }\n \n // Go to the next step.\n return $this->redirect()->toRoute('posts', ['action'=>'edit',\n 'id'=>$postId, 'step'=>2]);\n\n }\n } else {\n \n if ($step==1) {\n $data = [\n 'title' => $post->getTitle(),\n 'description' => $post->getDescription(),\n 'content' => $post->getContent(),\n 'tags' => $this->postManager->convertTagsToString($post),\n 'status' => $post->getStatus()\n ];\n $form->setData($data);\n }\n\n }\n \n if ($step==2) {\n \n // Get the list of already saved files.\n $files = $this->imageManager->getTempFiles($postId, \n $this->sessionContainer->userChoices['step2Dirty']);\n $fileTitles = $this->imageManager->getTempFileTitles($postId, \n $this->sessionContainer->userChoices['step2Dirty']);\n $this->sessionContainer->userChoices['step2Dirty'] = true; \n }\n \n if ($step==3) {\n \n // Get the list of already saved files.\n $files = $this->videoManager->getTempFiles($postId, \n $this->sessionContainer->userChoices['step3Dirty']);\n $this->sessionContainer->userChoices['step3Dirty'] = true; \n } \n \n if ($step==4) {\n \n // Get the list of already saved files.\n $files = $this->audioManager->getTempFiles($postId, \n $this->sessionContainer->userChoices['step4Dirty']);\n $this->sessionContainer->userChoices['step4Dirty'] = true; \n } \n \n if (!$this->access('post.own.edit', ['post'=>$post])) {\n return $this->redirect()->toRoute('not-authorized');\n }\n \n // Render the view template.\n $viewModel = new ViewModel([\n 'files' => $files,\n 'fileTitles' => $fileTitles,\n 'form' => $form,\n 'post' => $post\n ]);\n $viewModel->setTemplate(\"application/post/edit$step\");\n \n return $viewModel;\n }", "private function createEditForm(Sucursal $entity)\n {\n $form = $this->createForm(new SucursalType(), $entity, array(\n 'action' => $this->generateUrl('sucursal_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(User $entity)\n {\n $form = $this->createForm(new UserEditType(), $entity, array(\n 'action' => $this->generateUrl('user_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function createEditForm()\n {\n $form = new Zend_Form();\n\n $form->setAction($this->webroot.'/folder/edit')\n ->setMethod('post');\n\n $name = new Zend_Form_Element_Text('name');\n $name->setAttribs(array(\n 'placeholder' => $this->t('Name of the folder'),\n 'autofocus' => 'autofocus',\n 'required' => 'required',\n ))\n ->setRequired(true)\n ->addValidator('NotEmpty', true);\n\n $description = new Zend_Form_Element_Textarea('description');\n $description->setAttribs(array('placeholder' => $this->t('Optional')));\n $teaser = new Zend_Form_Element_Text('teaser');\n $teaser->setAttribs(array('placeholder' => $this->t('Optional')));\n $teaser->setAttrib('MAXLENGTH', '250');\n $submit = new Zend_Form_Element_Submit('submit');\n $submit->setLabel($this->t('Save'));\n\n $form->addElements(array($name, $description, $submit, $teaser));\n\n return $form;\n }", "private function createEditForm(User $entity)\n {\n $form = $this->createForm(new UserType(), $entity, array(\n 'action' => $this->generateUrl('user_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Estadofondo $entity)\n {\n $form = $this->createForm(new EstadofondoType(), $entity, array(\n 'action' => $this->generateUrl('estadofondo_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Education $entity)\n {\n $user = $this->get('security.context')->getToken()->getUser();\n $form = $this->createForm(new EducationType($user->getId()), $entity, array(\n 'action' => $this->generateUrl('education_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n 'attr' => array(\n 'class' => 'form-horizontal',\n 'novalidate' => 'novalidate',\n )\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update', 'attr' => array('class' => 'btn btn-primary')));\n $form->add('reset', 'reset', array('label' => 'Reset', 'attr' => array('class' => 'btn btn-danger')));\n\n\n return $form;\n }", "private function createEditForm(Viaje $entity)\n {\n $form = $this->createForm(new ViajeType(), $entity, array(\n 'action' => $this->generateUrl('viaje_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar'));\n\n return $form;\n }", "private function createEditForm(Servicio $entity)\n {\n $securityContext = $this->container->get('security.context');\n $form = $this->createForm(new ServicioType($securityContext), $entity, array(\n 'action' => $this->generateUrl('administracion_servicio_update', array('id' => $entity->getId())),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Rubrique $entity) {\r\n $form = $this->createForm('Loonins\\WikiBundle\\Form\\RubriqueType', $entity, array(\r\n 'action' => $this->generateUrl('rubrique_update', array('id' => $entity->getId())),\r\n 'method' => 'PUT',\r\n ));\r\n\r\n $form->add('submit', SubmitType::class, array('label' => 'Enregistrer les modifications'));\r\n\r\n return $form;\r\n }", "private function createEditForm(Blog $entity)\n {\n $form = $this->createForm(new BlogType(), $entity, array(\n 'action' => $this->generateUrl('admin_blog_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Cosecha $entity)\n {\n $form = $this->createForm(new CosechaType(), $entity, array(\n 'action' => $this->generateUrl('cosecha_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(User $entity)\n {\n $form = $this->createForm(new UserType(), $entity, array(\n 'action' => $this->generateUrl('api_user_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Link $entity)\n {\n $form = $this->createForm(new LinkType(), $entity, array(\n 'action' => $this->generateUrl('MesdHelpWikiBundle_link_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Container $entity)\n {\n $form = $this->createForm(new ContainerType(), $entity, array(\n 'action' => $this->generateUrl('container_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Account $entity) {\n $form = $this->createForm(new AccountType(), $entity, array(\n 'action' => $this->generateUrl('account_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Cole $entity)\n {\n $form = $this->createForm(new ColeType(), $entity, array(\n 'action' => $this->generateUrl('cole_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Logger $entity)\n {\n $form = $this->createForm(LoggerType::class, $entity, array(\n 'action' => $this->generateUrl('logger_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', SubmitType::class, array('label' => 'Update'));\n\n return $form;\n }", "public function uploadForm(Application $app)\n {\n $form = $this->getUploadForm($app);\n\n return $app['twig']->render('import/uploadform.html.twig', array(\n 'form' => $form->createView()\n ));\n }", "public function edit($model, $form);", "private function createEditForm(SkIdentificationModule $entity)\n {\n $form = $this->createForm(new SkIdentificationModuleType(), $entity, array(\n 'action' => $this->generateUrl('identification_module_admin_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n // $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(UserProfile $entity)\n {\n $form = $this->createForm(new UserProfileType(), $entity, array(\n 'action' => $this->generateUrl('user_profile_update', array('id' => $entity->getUser()->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(SesionVentaTratamiento $entity)\n {\n $form = $this->createForm(new SesionVentaTratamientoType(), $entity, array(\n 'action' => $this->generateUrl('admin_sesionventatratamiento_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Thread $entity)\n {\n $form = $this->createForm(new ThreadType(), $entity, array(\n 'action' => $this->generateUrl('thread_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Article $entity)\n {\n $form = $this->createForm(new ArticleType(), $entity, array(\n 'action' => $this->generateUrl($this->mesRoutes[\"update\"], array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(SkSpecies $entity) {\n $em = $this->getDoctrine()->getManager();\n\n // Get criterias from species\n $criteria_ids = $em->getRepository('SkaphandrusAppBundle:SkIdentificationCriteria')->getCriteriasFromSpecies($entity->getId());\n\n\n\n $form = $this->createForm(new SkIdentificationSpeciesType(), $entity, array(\n 'action' => $this->generateUrl('identification_species_admin_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n 'criterias' => $criteria_ids\n ));\n return $form;\n }", "private function createEditForm(Menu $entity)\n {\n $form = $this->createForm(new MenuType(), $entity, array(\n 'action' => $this->generateUrl('menu_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Acc $entity)\n {\n $form = $this->createForm(new AccType(), $entity, array(\n 'action' => $this->generateUrl('acc_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Galeria $entity, $tipo=\"imagen\")\r\n {\r\n if($tipo == \"imagen\"){\r\n $form = $this->createForm(new GaleriaType(), $entity, array(\r\n 'action' => $this->generateUrl('galerias_update', array('id' => $entity->getId())),\r\n 'method' => 'PUT',\r\n ));\r\n }else if($tipo== \"link_video\"){\r\n $form = $this->createForm(new GaleriaLinkVideoType(), $entity, array(\r\n 'action' => $this->generateUrl('galerias_update', array('id' => $entity->getId())),\r\n 'method' => 'PUT',\r\n ));\r\n }else if($tipo==\"parcial\"){\r\n $form = $this->createForm(new GaleriaParcialType(), $entity, array(\r\n 'action' => $this->generateUrl('galerias_actualizar', array('id' => $entity->getId())),\r\n 'method' => 'PATCH',\r\n ));\r\n }\r\n\r\n //$form->add('submit', 'submit', array('label' => 'Update'));\r\n\r\n return $form;\r\n }", "private function createEditForm(Event $entity)\n {\n $form = $this->createForm(new EventType(), $entity, array(\n 'action' => $this->generateUrl('event_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Whitelist $entity)\n {\n $form = $this->createForm(new WhitelistType(), $entity, array(\n 'action' => $this->generateUrl('whitelist_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Dzialy $entity) {\n $form = $this->createForm(new DzialyType(true), $entity, array(\n 'action' => $this->generateUrl('dzialy_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n \n\n return $form;\n }", "private function createEditForm(User $entity)\n {\n $form = $this->createForm(new UserType(), $entity, array(\n 'action' => $this->generateUrl('usuarios_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Panel $entity)\n {\n $form = $this->createForm(new PanelType(), $entity, array(\n 'action' => $this->generateUrl('paneles_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Guardar'));\n\n return $form;\n }", "private function createEditForm(Experience $entity)\n {\n $form = $this->createForm(new ExperienceType(), $entity);\n\n $form->add('submit', 'submit', array('label' => 'Valider'));\n\n return $form;\n }", "private function createEditForm(Ligne $entity)\n {\n $form = $this->createForm(new LigneType(), $entity, array(\n 'action' => $this->generateUrl('ligne_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Invoice $entity)\n {\n $form = $this->createForm(new InvoiceType(), $entity, array(\n 'action' => $this->generateUrl('invoice_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(VendorProfileLimit $entity)\n {\n $form = $this->createForm(new VendorProfileLimitType(), $entity, array(\n 'action' => $this->generateUrl('vendorprofilelimit_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Area $entity)\n {\n $form = $this->createForm(new AreaType(), $entity, array(\n 'action' => $this->generateUrl('area_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n// $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function editAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $tagNames = array();\n foreach ($model->fetchTags($photo) as $tag) {\n $tagNames[] = $tag->name;\n }\n\n $form = $model->getForm();\n $form->setAction($this->_helper->url('update', null, null, array('id' => $photo->id)));\n $form->setDefault('tags', implode(',', $tagNames));\n $form->populate($photo->toArray());\n\n $this->view->photo = $photo;\n $this->view->photoForm = $form;\n }", "private function createEditForm(PicFooter $entity)\n {\n $form = $this->createForm(new PicFooterType(), $entity, array(\n 'action' => $this->generateUrl('picfooter_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Klasses $entity)\n {\n $form = $this->createForm(new KlassesType(), $entity, array(\n 'action' => $this->generateUrl('klasses_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }" ]
[ "0.71561563", "0.69728", "0.69728", "0.693387", "0.6892674", "0.68268335", "0.6816255", "0.6720367", "0.6688814", "0.6687645", "0.6626489", "0.6622089", "0.6608572", "0.65511364", "0.6532778", "0.65219903", "0.6482008", "0.6426332", "0.6417779", "0.63903797", "0.63855124", "0.6375876", "0.6370288", "0.6370135", "0.6365305", "0.634999", "0.63476527", "0.6338826", "0.6337513", "0.63189775", "0.63180184", "0.6317507", "0.6317247", "0.63151395", "0.63028145", "0.6300135", "0.6298406", "0.6296257", "0.62936753", "0.62927306", "0.6275352", "0.62697726", "0.6267277", "0.6255178", "0.6233017", "0.6232317", "0.6231519", "0.6231129", "0.62282866", "0.62253475", "0.6223818", "0.622077", "0.6215224", "0.6211008", "0.62103057", "0.62079674", "0.6207811", "0.6207592", "0.6205861", "0.6204668", "0.6201235", "0.6195828", "0.6186256", "0.61848164", "0.61845106", "0.6183509", "0.6180353", "0.617892", "0.61620235", "0.6158501", "0.6158494", "0.61539906", "0.6153462", "0.6151425", "0.61506176", "0.61435497", "0.6142351", "0.61201406", "0.6119553", "0.6109029", "0.6106682", "0.6105586", "0.6105517", "0.61033463", "0.60973", "0.6093483", "0.6089182", "0.6087213", "0.608719", "0.60867643", "0.60857236", "0.60828024", "0.60801697", "0.6080071", "0.60627", "0.6059637", "0.6054869", "0.6049434", "0.603541", "0.60353255" ]
0.79956484
0
Edits an existing Upload entity.
public function updateAction(Request $request, $id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('MHProductsBundle:Upload')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Upload entity.'); } $deleteForm = $this->createDeleteForm($id); $editForm = $this->createEditForm($entity); $editForm->handleRequest($request); if ($editForm->isValid()) { $em->flush(); return $this->redirect($this->generateUrl('admin_uploads')); } return $this->render('MHProductsBundle:Upload:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Upload $upload)\n {\n //\n }", "public function edit(Upload $upload)\n {\n //\n }", "public function edit(Fileupload $fileupload)\n {\n //\n }", "public function update(Request $request, Upload $upload)\n {\n //\n }", "public function update(Request $request, Upload $upload)\n {\n //\n }", "public function edit()\n\t{\n\t\t$id = $this->uri->segment(5);\n\n\t\tif (empty($id))\n\t\t{\n\t\t\tTemplate::set_message(lang('upload_invalid_id'), 'error');\n\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t}\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\t$this->auth->restrict('Upload.Developer.Edit');\n\n\t\t\tif ($this->save_upload('update', $id))\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_edit_record').': ' . $id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_edit_success'), 'success');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_edit_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\telse if (isset($_POST['delete']))\n\t\t{\n\t\t\t$this->auth->restrict('Upload.Developer.Delete');\n\n\t\t\tif ($this->upload_model->delete($id))\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_delete_record').': ' . $id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_delete_success'), 'success');\n\n\t\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t\t} else\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_delete_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tTemplate::set('upload', $this->upload_model->find($id));\n\t\tAssets::add_module_js('upload', 'upload.js');\n\n\t\tTemplate::set('toolbar_title', lang('upload_edit') . ' Upload');\n\t\tTemplate::render();\n\t}", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MHProductsBundle:Upload')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Upload entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MHProductsBundle:Upload:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit(ImageUploads $imageUploads)\n {\n //\n }", "public function update(Request $request, Fileupload $fileupload)\n {\n //\n }", "public function upload()\n\t{\n\t\t$field \t\t = $this->getUploadField();\n\t\t$newName \t = $this->getUploadNewName();\n\t\t//$destination = 'assets/images/location';\t\n\t\t$destination = $this->getUploadDestination();\n\n\t\tif (\\Input::hasFile($field))\n\t\t{\n\t\t \\Input::file($field)->move($destination, $newName);\n\t\t}\n\t\t\n\t\t$this->entity->fill([$field => $newName]);\n\t\t$this->entity->save();\n\n\t\treturn true;\n\t}", "private function uploadFile($entity)\n {\n if (!$entity instanceof Image) {\n return;\n }\n\n $file = $entity->getImagefile();\n // only upload new files\n if ($file instanceof UploadedFile) {\n $fileName = $this->uploader->upload($file);\n $entity->setImagefile($fileName);\n }\n }", "public function update(User $user, Upload $upload)\n {\n //\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // if there is an error when moving the file, an exception will\n // be automatically thrown by move(). This will properly prevent\n // the entity from being persisted to the database on error\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n\n // check if we have an old image\n if (isset($this->temp)) {\n // delete the old image\n unlink($this->getUploadRootDir().'/'.$this->temp);\n // clear the temp image path\n $this->temp = null;\n }\n $this->file = null;\n }", "private function uploadFile($entity) {\n if (!$entity instanceof DUser) {\n return;\n }\n\n $file = $entity->getPicture();\n\n // only upload new files\n if (!$file instanceof UploadedFile) {\n return;\n }\n\n $fileName = $this->uploader->upload($file);\n $entity->setPicture($fileName);\n }", "public function edit_upload($data, $id)\n\t{\n\t\t$this->db->where('id_prospektus', $id);\n\t\t$this->db->update('file_foto', $data);\n\t}", "public function update(Request $request, Upload $upload)\n {\n return abort(404);\n }", "public function executeEdit(sfWebRequest $request)\n {\n $this->embedAllowed = aMediaTools::getEmbedAllowed();\n $this->uploadAllowed = aMediaTools::getUploadAllowed(); \n $this->forward404Unless(aMediaTools::userHasUploadPrivilege());\n $item = null;\n $this->slug = false;\n $this->popularTags = PluginTagTable::getPopulars(null, array('sort_by_popularity' => true), false, 10);\n if (sfConfig::get('app_a_all_tags', true))\n {\n $this->allTags = PluginTagTable::getAllTagNameWithCount();\n }\n else\n {\n $this->allTags = array();\n }\n if ($request->hasParameter('slug'))\n {\n $item = $this->getItem();\n $this->slug = $item->getSlug();\n }\n $this->forward404Unless($item);\n $this->forward404Unless($item->userHasPrivilege('edit'));\n $this->item = $item;\n if ($this->item->getEmbeddable())\n {\n // Handles the embed field correctly\n $this->form = new aMediaVideoForm($item);\n }\n else\n {\n $this->form = new aMediaEditForm($item);\n }\n $this->form->getWidgetSchema()->setNameFormat('a_media_item_'.$item->id.'_%s');\n \n $this->postMaxSizeExceeded = false;\n // An empty POST is an anomaly indicating that we hit the php.ini max_post_size or similar\n if ($request->isMethod('post') && (!count($request->getPostParameters())))\n {\n $this->postMaxSizeExceeded = true;\n }\n if ((!$this->postMaxSizeExceeded) && $request->isMethod('post'))\n {\n $parameters = $request->getParameter('a_media_item_'.$item->id.'_');\n $values = $request->getParameterHolder()->getAll();\n $value = array();\n $files = array();\n foreach ($values as $k => $v)\n {\n if (preg_match('/^a_media_item_' . $item->id . '_(.*)$/', $k, $matches))\n {\n if($k == $this->form['file']->renderId())\n {\n $files[$matches[1]] = $request->getFiles($this->form['file']->renderId());\n } else\n {\n $value[$matches[1]] = $v;\n }\n }\n } \n $parameters = $value;\n \n $result = null;\n if (isset($parameters['embed']))\n {\n // We need to do some prevalidation of the embed code so we can prestuff fields\n $result = $this->form->classifyEmbed($parameters['embed']);\n error_log(json_encode($result));\n }\n\n // If there is no thumbnail already stored for this media item,\n // and we are able to obtain one from the service, do so. If there is\n // already a thumbnail leave it alone as it might be a deliberate\n // replacement (TODO: it would be nice to always do it if the embed\n // code is definitely new)\n if (isset($result['thumbnail']) && (!$item->getImageAvailable()))\n {\n $this->convertServiceThumbnailToFileUpload($result['thumbnail'], $parameters);\n }\n \n $this->form->bind($parameters, $files);\n if ($this->form->isValid())\n {\n $file = $this->form->getValue('file');\n // The base implementation for saving files gets confused when \n // $file is not set, a situation that our code tolerates as useful \n // because if you're updating a record containing an image you \n // often don't need to submit a new one.\n unset($this->form['file']);\n $object = $this->form->getObject();\n if ($file)\n {\n // Everything except the actual copy which can't succeed\n // until the slug is cast in stone\n $object->preSaveFile($file->getTempName());\n }\n $this->form->save();\n if ($file)\n {\n $object->saveFile($file->getTempName());\n }\n if ($request->isXmlHttpRequest())\n {\n return $this->renderPartial('aMedia/mediaItemMeta', array(\n 'mediaItem' => $object,\n 'popularTags' => $this->popularTags,\n 'allTags' => $this->allTags,\n 'layout' => aMediaTools::getLayout($this->getUser()->getAttribute('layout', 'two-up', 'apostrophe_media'))\n ));\n }\n return $this->redirect(\"aMedia/resumeWithPage\");\n }\n }\n if ($request->isXmlHttpRequest())\n {\n return $this->renderTemplate('Ajax');\n }\n return $this->renderTemplate();\n }", "public function uploadAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Get Message Service\n $message = $this->getServiceLocator()->get('systemMessages');\n \n $files = $request->getFiles()->toArray();\n $temp = explode(\".\", $files[\"file\"][\"name\"]);\n $newName = round(microtime(true));\n $newfilename = $newName . '.' . end($temp);\n $image = new Image();\n $image->exchangeArray(array(\n \"website_id\" => $logedUser[\"idWebsite\"],\n \"name\" => $newName,\n \"extension\" => end($temp)\n ));\n if ($image->validation()) {\n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"public/files_database/\" . $logedUser[\"idWebsite\"] . \"/\" . $newfilename)) {\n $result = $this->getImageTable()->saveImage($image);\n $message->setCode($result);\n // Log\n $this->getServiceLocator()\n ->get('systemLog')\n ->addLog(0, $message->getMessage(), $message->getLogPriority());\n die('uploadSucess');\n } else {\n die('uploadError');\n }\n } else {\n die('Invalid extension');\n }\n }\n die(\"forbiden\");\n } else {\n die(\"forbiden - without permission\");\n }\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->id . '.' .$this->ext\n );\n\n // set the ext property to the filename where you've saved the file\n //$this->ext = $this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "private function createEditForm(Upload $entity)\n {\n $form = $this->createForm(new UploadType(), $entity, array(\n 'action' => $this->generateUrl('admin_uploads_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function editArticle(Request $request, SluggerInterface $slugger, Article $idArticle): Response \n {\n /********************************************************/ \n /* We get the form to add an article */\n /* without create a new instance of the article entity */\n /********************************************************/ \n \n $formArticle = $this->createForm( ArticleFormType::class, $idArticle);\n \n $formArticle->handleRequest($request);\n \n /**************************************************/ \n /* we check that the form is submitted and valid */\n /**************************************************/\n if ($formArticle->isSubmitted() && $formArticle->isValid() ) {\n //var_dump($formArticle);\n \n $pictureFile = $formArticle->get('picture')->getData();\n \n //var_dump($_FILES);\n \n //var_dump($pictureFile);\n \n if ($pictureFile) {\n $originalFilename = pathinfo($pictureFile->getClientOriginalName(), PATHINFO_FILENAME);\n \n /********************************************************************/\n /* this is needed to safely include the file name as part of the URL*/\n /********************************************************************/\n \n $safeFilename = $slugger->slug($originalFilename);\n $newFilename = $safeFilename.'-'.uniqid().\".\".$pictureFile->guessExtension();\n\n try {\n $pictureFile->move(\n $this->getParameter('upload_directory'),\n $newFilename\n );\n } catch (FileException $e) {\n $this->addFlash('message','une erreur est survenu lors de l\\'upload de l\\'image!');\n return $this->redirectToRoute('admin');\n }\n \n $article_data = $formArticle->getData();\n $article_data->setCreatedAt(new \\DateTime('NOW') ); \n \n $idArticle->setPicture($newFilename);\n \n $articleManager = $this->getDoctrine()->getManager();\n /*****************************************************************/\n /* useless to persist because it already comes from the database*/\n /*****************************************************************/\n $articleManager->flush();\n \n /*************************/\n /* adding a flash message*/\n /*************************/\n \n $this->addFlash('message','Article à bien été modifié!');\n /***************************/ \n /* redirect to admin page */\n /***************************/\n return $this->redirectToRoute('admin');\n return new Response(\"Article modifié\");\n }\n \n \n }\n /*******************************************************/ \n /* we indicate to the controller the associated view */\n /*******************************************************/\n return $this->render(\"admin/addArticle.html.twig\",[\n 'formArticle'=>$formArticle->createView()\n ]);\n \n \n }", "public function updateAction(Request $request, $id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SyndicateComponentBundle:Education')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Education entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n\n if ($editForm->isValid()) {\n $entity->upload();\n $em->flush();\n $this->get('session')->getFlashBag()->add(\n 'success',\"Data has been updated successfully\"\n );\n\n return $this->redirect($this->generateUrl('education_edit', array('id' => $id)));\n }\n\n return $this->render('SyndicateComponentBundle:Education:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editEntity(int $id): Response\n {\n $fileEntity = FileSystemEntities::getById($id);\n $request = $this->request->getPutData();\n\n $fileEntity->field_name = $request['field_name'];\n $fileEntity->updateOrFail();\n\n return $this->response($fileEntity);\n }", "public function update($entity);", "public function update($entity);", "public function setUploadData(UploadedFile $uploaded_file): Uploadable;", "public function edit(Fs $Fs)\n {\n //\n }", "public function edit(Fs $Fs)\n {\n //\n }", "public function edit(Fs $Fs)\n {\n //\n }", "public function update()\n {\n\n $id = null;\n $velo_id = null;\n $description = null;\n $image = null;\n\n if (!empty($_POST['id']) && ctype_digit($_POST['id'])) {\n $id = $_POST['id'];\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n if (!empty($_POST['image']) && $_POST['image'] != \"\") {\n $image = htmlspecialchars($_POST['image']);\n }\n\n if (!empty($_POST['description'])) {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!$id || !$image || !$description) {\n die(\"formulaire mal rempli $id, $image, $description\");\n }\n\n $voyage_to_edit = $this->model->find($id, $this->modelName);\n\n if (!$voyage_to_edit) {\n die(\"Does Not Exist\");\n }\n\n $this->model->edit($id, $description, $image);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "public function edit_upload_ft($data, $id)\n\t{\n\t\t$this->db->where('id_file_foto', $id);\n\t\t$this->db->update('file_foto', $data);\n\t}", "public function update(Request $request, ImageUploads $imageUploads)\n {\n //\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function editAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $tagNames = array();\n foreach ($model->fetchTags($photo) as $tag) {\n $tagNames[] = $tag->name;\n }\n\n $form = $model->getForm();\n $form->setAction($this->_helper->url('update', null, null, array('id' => $photo->id)));\n $form->setDefault('tags', implode(',', $tagNames));\n $form->populate($photo->toArray());\n\n $this->view->photo = $photo;\n $this->view->photoForm = $form;\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $file = new UploadForm();\n $file->imageFile = UploadedFile::getInstance($file, 'imageFile');\n\n if ($model->load(Yii::$app->request->post())) {\n if ($file->upload($id, null, $file::TYPE_GALLERY)) {\n $model->image = $file->getNameImage($id, null, $file::TYPE_GALLERY);\n $model->save();\n } else {\n $model->image = null;\n $model->save();\n return $this->redirect(['view', 'id' => $id]);\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', compact('file', 'model'));\n }\n }", "public function uploadAction(Request $request)\n {\n $user = $this->getConnectedUser();\n\n $version = new Version();\n $form = $this->createFormBuilder($version)\n ->add('uploadedFile')\n ->add('comment', 'textarea', array('required' => false))\n ->getForm();\n\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n $filename = $request->request->get('name');\n $filetype = $version->getUploadType();\n $size = $version->getUploadSize();\n\n $folder = null;\n $folderId = $request->request->get('folderId');\n if (is_numeric($folderId)) {\n $folder = $em->getRepository('TimeBoxMainBundle:Folder')->findOneById($folderId);\n }\n\n $existingFile = $em->getRepository('TimeBoxMainBundle:File')->findOneBy(array(\n 'user' => $user,\n 'folder' => $folder,\n 'name' => $filename,\n 'type' => $filetype,\n 'isDeleted' => false\n ));\n\n $versionDisplayId = 1;\n\n if (!$existingFile) {\n $file = new File();\n $file->setUser($user);\n $file->setName($filename);\n $file->setType($filetype);\n $file->setFolder($folder);\n $file->setTotalSize($size);\n $em->persist($file);\n $em->flush();\n }\n else {\n $file = $existingFile;\n $file->setTotalSize($file->getTotalSize() + $size);\n $lastVersion = $em->getRepository('TimeBoxMainBundle:Version')->findOneBy(\n array('file' => $file),\n array('displayId' => 'DESC')\n );\n $versionDisplayId = $lastVersion->getDisplayId() + 1;\n }\n\n $version->setDate(new \\DateTime);\n $version->setFile($file);\n $version->setSize($size);\n $version->setDisplayId($versionDisplayId);\n $version->setDescription(\"Uploaded file\");\n\n $user->setStorage(max($user->getStorage() + $size, 0));\n\n $em->persist($user);\n $em->persist($version);\n $em->flush();\n\n return $this->redirect($this->generateUrl('time_box_main_file'));\n }\n\n return array(\n 'form' => $form->createView(),\n 'folderId' => $request->request->get('folderId')\n );\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'nullable',\n // 'path' => 'required', \n 'description' => 'nullable' \n ]);\n \n $file = File::find($id); \n $file-> edit($request->all());\n if ($request->file('path') != null){\n $file->uploadFile($request->file('path')); \n }\n // dd($file->originalname);\n return redirect()->route('files.index');\n \n }", "public function edit(Foto $foto)\n {\n dd(5);\n }", "public function editAction() \n {\n $stepParam = $this->params()->fromRoute('step', 1);\n // Determine the current step.\n $step = 1;\n if ((isset($this->sessionContainer->userChoices[\"step\"]))&&($stepParam==2)) {\n $step = $this->sessionContainer->userChoices[\"step\"]; \n }\n \n // Ensure the step is correct (between 1 and 2).\n if ($step<1 || $step>4)\n $step = 1;\n \n if ($step==1) {\n // Init user choices.\n $this->sessionContainer->userChoices = [];\n $this->sessionContainer->userChoices['step2Dirty'] = false;\n $this->sessionContainer->userChoices['step3Dirty'] = false;\n $this->sessionContainer->userChoices['step4Dirty'] = false;\n }\n \n // Create image holder.\n $files = null;\n $fileTitles = null;\n \n // Get post ID.\n $postId = (int)$this->params()->fromRoute('id', -1);\n \n // Create form.\n $form = new PostForm($step, $postId, $this->translator);\n \n // Validate input parameter\n if ($postId<0) {\n $this->getResponse()->setStatusCode(404);\n return;\n }\n \n // Find the existing post in the database.\n $post = $this->entityManager->getRepository(Post::class)\n ->findOneById($postId); \n if ($post == null) {\n $this->getResponse()->setStatusCode(404);\n return; \n } \n \n // Check whether this post is a POST request.\n if ($this->getRequest()->isPost()) {\n \n // Make certain to merge the files info!\n $request = $this->getRequest();\n $data = array_merge_recursive(\n $request->getPost()->toArray(),\n $request->getFiles()->toArray()\n );\n \n // Fill form with data.\n $form->setData($data);\n if ($form->isValid()) {\n \n // Get validated form data.\n $data = $form->getData();\n \n // Save user choices in session.\n $this->sessionContainer->userChoices[\"step$step\"] = $data; \n \n // Increase step if photo has not been selected.\n $fileExists = $this->postManager->checkFileExists($data); \n \n if($fileExists == false){\n $step ++;\n $this->sessionContainer->userChoices[\"step\"] = $step;\n }else{\n // Create the title file.\n $this->imageManager->createTitleFile($postId, $data);\n }\n \n // If we completed both steps.\n if ($step>4) {\n // Use post manager service update existing post.\n $this->postManager->updatePost($post, \n $this->sessionContainer->userChoices['step1']);\n $this->imageManager->saveTempFiles($post);\n $this->videoManager->saveTempFiles($post);\n $this->audioManager->saveTempFiles($post);\n \n // Redirect the user to \"admin\" page.\n return $this->redirect()->toRoute('posts', ['action'=>'admin']);\n }\n \n // Go to the next step.\n return $this->redirect()->toRoute('posts', ['action'=>'edit',\n 'id'=>$postId, 'step'=>2]);\n\n }\n } else {\n \n if ($step==1) {\n $data = [\n 'title' => $post->getTitle(),\n 'description' => $post->getDescription(),\n 'content' => $post->getContent(),\n 'tags' => $this->postManager->convertTagsToString($post),\n 'status' => $post->getStatus()\n ];\n $form->setData($data);\n }\n\n }\n \n if ($step==2) {\n \n // Get the list of already saved files.\n $files = $this->imageManager->getTempFiles($postId, \n $this->sessionContainer->userChoices['step2Dirty']);\n $fileTitles = $this->imageManager->getTempFileTitles($postId, \n $this->sessionContainer->userChoices['step2Dirty']);\n $this->sessionContainer->userChoices['step2Dirty'] = true; \n }\n \n if ($step==3) {\n \n // Get the list of already saved files.\n $files = $this->videoManager->getTempFiles($postId, \n $this->sessionContainer->userChoices['step3Dirty']);\n $this->sessionContainer->userChoices['step3Dirty'] = true; \n } \n \n if ($step==4) {\n \n // Get the list of already saved files.\n $files = $this->audioManager->getTempFiles($postId, \n $this->sessionContainer->userChoices['step4Dirty']);\n $this->sessionContainer->userChoices['step4Dirty'] = true; \n } \n \n if (!$this->access('post.own.edit', ['post'=>$post])) {\n return $this->redirect()->toRoute('not-authorized');\n }\n \n // Render the view template.\n $viewModel = new ViewModel([\n 'files' => $files,\n 'fileTitles' => $fileTitles,\n 'form' => $form,\n 'post' => $post\n ]);\n $viewModel->setTemplate(\"application/post/edit$step\");\n \n return $viewModel;\n }", "public function edit(Picture $picture)\n {\n //\n }", "public function update(emRequest $request)\n {\n\n \n \n $emp = Employee::findOrFail($request->value);\n if ($request->hasFile('image')) {\n $path = $request->image->store('image');\n }\n\n $emp->nomEmploye = $request->input('nomEmploye');\n $emp->prenomEmploye = $request->input('prenomEmploye');\n $emp->adressEmploye = $request->input('adressEmploye');\n $emp->fonction = $request->input('fonction');\n $emp->salaire = $request->input('salaire');\n $emp->commission = $request->input('commission');\n $emp->image = $path;\n \n \n session()->flash('modifier',' l\\'employe a ete bien modifier !!');\n $emp->save();\n return back();\n }", "public function update($entity)\n {\n \n }", "public function update($id, UpdateUploadRequest $request)\n\t{\n\t\t\n\t\t//==========================Start=================================\n\t\t$title = $request->input('title');\n\t\t$description = $request->input('description');\n\t\t$flag = $request->input('flag');\n\t\t$upload_type_id = $request->input('upload_type_id_fk');\n\t\t\n\t\tif($request->hasfile('file_name')){\n\t\t\t//$this->validate($request, ['file_name' => 'mimes:jpeg,png,jpg,doc,docx,pdf']);\n\t\t\t$this->validate($request, ['file_name' => 'mimes:pdf']);\n\t\t\t//$destinationPath = public_path() . '/assets/uploads/leavefiles/'; // upload path\n\t\t\t$img = $request->file('file_name');\n\t\t\t//echo $img; die;\n\t\t\t$extension = $img->getClientOriginalExtension(); // getting image extension\n\t\t\t$fileName = rand(111, 99999) . '.' . $extension; // renaming image\n\t\t\t\n\t\t\t$img->move(public_path(\"uploads\"),$fileName);\n\t\t\t\n\t\t} else {\n\t\t\t//return $request;\n\t\t\t$fileName = $request->input('upload_file');\n\t\t}\n\t\t\n\t\t$upload = Upload::findOrFail($id);\n\t\t$upload->update(['title' => $title,'description' => $description,'flag' => $flag,'upload_type_id_fk' => $upload_type_id,'file_name' => $fileName]);\n\t\t\n\t\t//==========================End===================================\n\t\t\n\t\treturn redirect()->route(config('quickadmin.route').'.upload.index');\n\t}", "public function update(Request $request, Foto $foto)\n {\n dd(6);\n }", "public function upload()\n {\n // The file property can be empty if the field is not required\n if (null === $this->file) {\n return;\n }\n\n // Use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->path\n );\n\n // Set the path property to the filename where you've saved the file\n $this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function editobject($data, Form $form, $request)\n {\n Versioned::set_stage('Stage');\n\n // allow extensions to change the object state just before creating.\n $this->extend('updateObjectBeforeEdit', $this->editObject);\n\n if ($this->editObject->hasMethod('onBeforeFrontendEdit')) {\n $this->editObject->onBeforeFrontendEdit($this);\n }\n\n try {\n $form->saveInto($this->editObject);\n } catch (ValidationException $ve) {\n $form->sessionMessage(\"Could not upload file: \" . $ve->getMessage(), 'bad');\n $this->redirect($this->data()->Link());\n return;\n }\n\n // get workflow\n $workflowID = $this->data()->WorkflowDefinitionID;\n $workflowDef = false;\n if ($workflowID && $this->editObject->hasExtension(WorkflowApplicable::class)) {\n if ($workflowDef = WorkflowDefinition::get()->byID($workflowID)) {\n $this->editObject->WorkflowDefinitionID = $workflowID;\n }\n }\n\n if (Extensible::has_extension($this->CreateType, Versioned::class)) {\n $this->editObject->write('Stage');\n if ($this->PublishOnCreate) {\n $this->editObject->doPublish();\n }\n } else {\n $this->editObject->write();\n }\n\n // start workflow\n if ($this->editObject->hasExtension(WorkflowApplicable::class)) {\n $svc = singleton(WorkflowService::class);\n $workflowForObj = $svc->getWorkflowFor($this->editObject);\n if (!$workflowForObj) {\n // Only start a workflow if not in the middle of one.\n $svc->startWorkflow($this->editObject);\n }\n }\n\n $this->extend('objectEdited', $this->editObject);\n // let the object be updated directly\n // if this is a versionable object, it'll be edited on stage\n $this->editObject->invokeWithExtensions('frontendEdited');\n\n $link = $this->data()->Link(\"edit/{$this->editObject->ID}\");\n $link = $link . (strpos($link, \"?\") !== false ? \"&\" : \"?\") . \"edited=1\";\n\n $this->redirect($link);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $Uploadmodel = new UploadForm();\n $Model = new User();\n $ExistImage = Register::find()->select('imageFile')->where(['id'=>$id])->column();\n $Uploadmodel->imageFile = UploadedFile::getInstance($model, 'imageFile');\n if ($model->load(Yii::$app->request->post())) \n {\n if(isset($Uploadmodel->imageFile))\n {\n $model->imageFile = $Uploadmodel->imageFile->name; \n $Uploadmodel->upload();\n } else {\n $model->imageFile = $ExistImage[0];\n }\n if($model->save()) \n {\n return $this->redirect(['view', 'id' => $id]);\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n Image::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->path\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function update(Request $request, $id)\n {\n $manga = (new Manga)->newManga(true, $id);\n\n // Сохраняем том\n if ($request->input('uploaded-tom_to--manga')) {\n (new Tom)->newTom($id, $request->input('uploaded-tom_to--manga'));\n }\n\n // Сохраняем жанры\n if ($request->input('genres')) {\n (new EntityGenre)->updateEntity($request->input('genres'), $manga->id);\n }\n\n // Delete uploaded image\n if (0 != $request->input('delete-uploaded_image')) {\n $imageName = Image::select('name')\n ->where('entity_id', $id)\n ->first();\n\n $image = new Image;\n\n $image->deleteImage($request->input('delete-uploaded_image'), $imageName->name, 'manga');\n\n // image name\n $newNameImage = strOther($request->input('manga_name'), '') . '.' . explode('/', $request->input('image_mimeType'))[1];\n\n // Метод для изменения имени загруженной аватарки в базе данных\n $image->renameAvatar($newNameImage, $request->input('image_id'), true, $manga->id);\n\n // Метод для изменения имени загружнной аватрки в папке\n $image->renameAvatarDir(explode('/', $request->input('image_name'))[3], $newNameImage, 'manga');\n }\n\n // Айди тома с которым происходит работа\n $tomId = $request->input('uploaded-images_to--tom__id');\n // Сохраняем загруженные томы\n if ($request->input('uploaded_image_tom')) {\n (new ToTom)->saveImages($id, $tomId, $request->input('uploaded_image_tom'));\n }\n\n // Проверяем, нужно ли удалить какие-нибудь загруженные картинки к тому\n if ($request->input('delete-images_to--tom')) {\n (new ToTom)->deleteImages($id, $request->input('delete-images_to--tom'));\n }\n\n // Проверяем, нужно ли удалить какой-нибудь том\n if ($request->input('delete-tom')) {\n (new Tom)->deleteToms($id, $request->input('delete-tom'));\n }\n\n // Проверяем, нужно ли удалить жанры\n (new EntityGenre)->deleteGenres($id, $request->input('genres'));\n\n $seoData = [\n 'bundle' => 'manga',\n 'seo_description' => $request->input('seo_description'),\n 'seo_title' => $request->input('seo_title'),\n 'seo_keywords' => $request->input('seo_keywords'),\n 'seo_path' => $request->input('seo_path'),\n 'entity_id' => $id,\n 'tin_title' => $request->input('manga_name')\n ];\n\n (new Seo)->newSeo($seoData, false, $request->input('seo_id'));\n\n if ($request->input('update') == '1') {\n return redirect('admin/manga/' . $id . '/edit');\n } elseif ($request->input('update_close') == '1') {\n return redirect('admin/manga');\n }\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->setImageName($this->getFile()->getClientOriginalName());\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function uploadAction() {\n $imgId = $this->getInput('imgId');\n $this->assign('imgId', $imgId);\n $this->getView()\n ->display('common/upload.phtml');\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n\n $filePath = md5(uniqid($this->getIdUser().\"_profil\",true)).\".\".\n $this->getFile()->guessClientExtension();\n\n $this->getFile()->move(\n $this->getUploadRootDir(),$filePath\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filePath;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function update(Request $request, $id)\n {\n $apero = Apero::find($id);\n\n $apero->update($request->all());\n\n\n if (!empty($request->tags)) {\n $apero->tags()->detach();\n $apero->tags()->attach($request->input('tags'));\n } else {\n $apero->tags()->detach();\n }\n\n // Supression de l'image\n\n if (!is_null($request->delete_picture) || !is_null($request->picture))\n {\n\n $this->deleteImage($apero);\n\n\n $this->createImage($request, $apero);\n\n }\n\n /*if (!is_null($request->picture)) {\n\n $img = $request->picture;\n\n $ext = $img->getClientOriginalExtension();\n\n $fileName = md5(uniqid(rand(), true)) . \".$ext\";\n\n $img->move(env('UPLOADS'), $fileName);\n\n $apero->uri = $fileName;\n\n $apero->save();\n\n\n }*/\n\n\n return redirect()\n ->route('admin.apero.index')\n ->with(['message' => 'success update']);\n }", "public function actionUpload()\n\t{\n\n\t\t$input = craft()->request->getPost();\n\n\t\t$file = UploadedFile::getInstanceByName('file');\n\n\t\t$folder = craft()->assets->findFolder(array(\n\t\t 'id' => $input['id']\n\t\t));\n\n\t\tif ($folder) {\n\t\t\t$folderId = $input['id'];\n\t\t}\n\n\t\tcraft()->assets->insertFileByLocalPath(\n\t\t $file->getTempName(),\n\t\t $file->getName(),\n\t\t $folderId,\n\t\t AssetConflictResolution::KeepBoth);\n\n\t\tcraft()->end();\n\t}", "public function uploadAction($file) {\n\t\t\n\t\t$renderPartial = $this->request->hasArgument('renderPartial') ? $this->request->getArgument('renderPartial') : '';\n\t\t$mode = $this->request->hasArgument('mode') ? $this->request->getArgument('mode') : '';\n\t\t$filetype = $this->request->hasArgument('filetype') ? $this->request->getArgument('filetype') : 'file';\n\t\tif ($filetype == 'pdf') {\n\t\t\tif ($file->getOriginalResource()->getFileextension() !== 'pdf') {\n\t\t\t\t$this->forward('new', NULL, NULL, array('file' => $file,'mode'=>$mode,'renderPartial'=>$renderPartial, 'filetype' => $filetype));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->persistenceManager->isNewObject($file)) {\n\t\t\t$this->fileResourceRepository->add($file);\n\t\t} else {\n\t\t\t$this->fileResourceRepository->update($file);\n\t\t}\n\t\t\n\t\t$this->forward('edit', NULL, NULL, array('file' => $file,'mode'=>$mode,'renderPartial'=>$renderPartial, 'filetype' => $filetype));\n\t}", "public function Update($entity) {\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $partes_ruta = pathinfo($this->getFile()->getClientOriginalName());\n $this->nombre = md5(uniqid()) . '.' . $partes_ruta['extension'];\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->nombre\n );\n\n $this->url = $this->getWebPath();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function updateAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('StriideInventoryBundle:Item')->find($id);\n $photo = $entity->getPhoto();\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Item entity.');\n }\n\n $editForm = $this->createForm(new ItemType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n $request = $this->getRequest();\n\n $editForm->handleRequest($request);\n\n if ($editForm->isValid())\n {\n $p = $entity->getPhoto();\n if(empty($p) && !empty($photo))\n {\n $entity->setPhoto($photo);\n }\n else if(!empty($p))\n {\n $media = $this->get('striide_inventory.service.media')->save($entity->getPhoto());\n $entity->setPhoto($media->getId());\n }\n\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('StriideInventoryBundle_admin_item_show', array('id' => $id)));\n }\n\n return $this->render('StriideInventoryBundle:Item:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'json_types' => json_encode($this->get('striide_inventory.types')->getInventoryTypesArray()),\n 'edit_form_theme' => 'StriideTwitterbootstrapBundle:Form:form_theme.html.twig',\n 'delete_form' => $deleteForm->createView(),\n 'crumbs' => array(\n array('href' => $this->get('router')->generate('StriideInventoryBundle_homepage'),\n 'label' => $this->get('translator')->trans('Inventory')),\n array('href' => $this->get('router')->generate('StriideInventoryBundle_admin_item_edit', array('id' => $entity->getId())),\n 'label' => $this->get('translator')->trans('Edit Item'))\n )\n ));\n }", "public function upload() {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(), $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->photo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload();", "public function edit(Avatar $avatar)\n {\n //\n }", "public function editAction(Request $request, Photo $photo)\n {\n $photoSrc = $this->getParameter('root_directory').$photo->getSrc();\n $photoFile = new Filesystem();\n\n $deleteForm = $this->createDeleteForm($photo);\n $editForm = $this->createForm(PhotoType::class, $photo);\n $editForm->handleRequest($request);\n\n //Pobranie zalogowanego użytkownika\n $user = $this->getLoggedUser();\n\n //Pobranie ID statusu aktualizacji zdjęcia\n $status = $this->getDoctrine()->getManager()\n ->getRepository('AppBundle:Status')->find(9);\n\n //Wstawienie rekordu o aktualizacji zdjęcia do historii statusów\n $statusHistory = new StatusHistory();\n $statusHistory->setPhoto($photo);\n $statusHistory->setStatus($status);\n $statusHistory->setUser($user);\n\n $modifiedDate = new \\DateTime();\n $photo->setModifiedAt($modifiedDate);\n\n if ($editForm->isSubmitted() && $editForm->isValid()) {\n\n /** @var UploadedFile $newPhotoFile */\n $newPhotoFile = $editForm['src']->getData();\n\n if ($newPhotoFile) {\n $originalFileName = pathinfo($newPhotoFile->getClientOriginalName(), PATHINFO_FILENAME);\n $newFileName = $originalFileName.'-'.uniqid().'.'.$newPhotoFile->guessExtension();\n try {\n $newPhotoFile->move(\n $this->getParameter('photos_directory'),\n $newFileName\n );\n } catch (FileException $e) {\n }\n $newSrc = '/uploads/' . $newFileName;\n $photo->setSrc($newSrc);\n }\n $photoFile->remove($photoSrc);\n\n $em = $this->getDoctrine()->getManager();\n $entities = [$photo, $statusHistory];\n\n foreach ($entities as $entity) {\n $em->persist($entity);\n }\n\n $em->flush();\n\n return $this->redirectToRoute('photo_show', array('id' => $photo->getId()));\n }\n\n return $this->render('photo/edit.html.twig', array(\n 'photo' => $photo,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n// use the original file name here but you should\n// sanitize it at least to avoid any security issues\n// move takes the target directory and then the\n// target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n// set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n// clean up the file property as you won't need it anymore\n $this->file = null;\n\n\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Upload']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Upload'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('admin'));\n\t\t}\n\n\t\t$this->render('manage_update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function upload()\n {\n }", "public function upload() {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if($model->load(Yii::$app->request->post())){\n $model->c_author = Yii::$app->user->identity->getId();\n $model->file = UploadedFile::getInstance($model,'file');\n $model->file->saveAs('uploads/'.$model->file->baseName.'.'.$model->file->extension);\n \n $model->c_image=$model->file->baseName.'.'.$model->file->extension;\n if($model->save(false)){\n return $this->redirect(['view','id'=>$id]);\n }\n }\n return $this->render('update',['model'=>$model]);\n }", "public function upload()\n\t{\n\t if (null === $this->getFile()) {\n\t return;\n\t }\n\t\n\t // use the original file name here but you should\n\t // sanitize it at least to avoid any security issues\n\t\n\t // move takes the target directory and then the\n\t // target filename to move to\n\t \n\t $this->getFile()->move($this->getWebPath(),$this->imagen);\n\t \n\t \n\t // set the path property to the filename where you've saved the file\n\t $this->path = $this->getFile()->getClientOriginalName();\n\t\t//$this->temp = \n\t // clean up the file property as you won't need it anymore\n\t $this->file = null;\n\t}", "public function upload()\n {\n //Checks if the path is null\n if (null === $this->file) {\n return;\n }\n\n $hash = uniqid('', true);\n $extension = $this->file->getClientOriginalExtension();\n $newFilename = $hash.'.'.$extension;\n\n $this->file->move($this->getUploadRootDir(), $newFilename);\n $this->path = $newFilename;\n\n // Clean the path file\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n \n\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function update($entity){ \n //TODO: Implement update record.\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\r\r\n {\r\r\n $transferPic = $this->transferRepo->find($id);\r\r\n $transferData = $request->except('_token', '_method', 'photo', 'en');\r\r\n\r\r\n $activeLangCode = \\LanguageHelper::getDynamicLangCode();\r\r\n $transferTrans = $request->only($activeLangCode);\r\r\n\r\r\n\r\r\n\r\r\n if ($request->hasFile('photo'))\r\r\n {\r\r\n // Delete old image first.\r\r\n $thumbnail_path = public_path() . '/images/transfer/thumb/' . $transferPic->photo;\r\r\n $thumbnail_path2 = public_path() . '/images/transfer/' . $transferPic->photo;\r\r\n File::delete([$thumbnail_path, $thumbnail_path2]);\r\r\n\r\r\n // Save the new one.\r\r\n $image = $request->file('photo');\r\r\n $imageName = $this->upload($image, 'transfer', true); // resize option executed.\r\r\n $transferData['photo'] = $imageName;\r\r\n }\r\r\n\r\r\n $this->transferRepo->update($id, $transferData, $transferTrans);\r\r\n\r\r\n return redirect('admin-panel/transfers')->with('updated', 'updated');\r\r\n }", "public function update(ArticleEditFormRequest $request, $id)\n {\n\t\tif($request->hasFile('img')) { \n /*\n Unlike when a new page is created, when this page is being EDITED user doesnt \n have to upload a new file. Only validate If file is being uploaded (if detected)\n */\n $this->validate($request, [\n 'img' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n ]);\n\n $image = $request->file('img');\n $newName = $request->get('slug'). '-' .time().'.'.$image->getClientOriginalExtension();\n $image->move(public_path('images'), $newName);\n\n } else {\n $newName = 'default-img.png'; \n }\n\n\n \n $article = Article::whereId($id)->firstOrFail();\n\n $article->title = $request->get('title');\n $article->content = $request->get('content');\n $article->h2 = $request->get('h2');\n // $article->img = $request->get('img');\n\t\t$article->img = $newName;\n $article->slug = Str::slug($request->get('title'), '-');\n\n\n $article->save();\n // Instead of creating a new savePages() method to save pages. we can sync them\n $article->pages()->sync($request->get('pages'));\n\n return redirect(action('Admin\\ArticlesController@edit', $article->id))\n ->with('status', 'The article has been updated!')\n ->with('article', $article);\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload(): void\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // si on avait un ancien fichier on le supprime\n if (null !== $this->tempFilename) {\n $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;\n if (file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n // déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move(\n $this->getUploadRootDir(), // répertoire de destination\n $this->id.'.'.$this->url // nom du fichier à créer \"id.extension\"\n );\n\n }", "public function updateAction(Request $request, $id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SkaphandrusAppBundle:SkSpecies')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find SkSpecies entity.');\n }\n\n// // Set parent ID on embedded forms\n// $embedded = $request->request->get('skaphandrus_appbundle_skspecies');\n// foreach ($embedded['imageRefs'] as &$imageRef) {\n// $imageRef['species'] = $id;\n// }\n\n// $entity = new \\Skaphandrus\\AppBundle\\Entity\\SkSpecies();\n\n //http://symfony.com/doc/current/cookbook/form/form_collections.html\n //For deleting prices \n $originalImagesRef = new ArrayCollection();\n // Create an ArrayCollection of the current Tag objects in the database\n foreach ($entity->getImageRefs() as $imageRef) {\n $originalImagesRef->add($imageRef);\n }\n\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n\n if ($editForm->isValid()) {\n // remove the relationship between the Tag and the Task\n foreach ($originalImagesRef as $imageRef) {\n if (false === $entity->getImageRefs()->contains($imageRef)) {\n // remove the Task from the Tag\n// $imageRef = new \\Skaphandrus\\AppBundle\\Entity\\SkSpeciesImageRef();\n $imageRef->getSpecies()->removeImageRef($imageRef);\n\n // if it was a many-to-one relationship, remove the relationship like this\n // $course->setBusiness(null);\n // $em->persist($course);\n // if you wanted to delete the Tag entirely, you can also do that\n $em->remove($imageRef);\n }\n }\n\n $entity->setUpdatedAt(new \\DateTime('now'));\n \n $em->persist($entity);\n $em->flush();\n\n $this->get('session')->getFlashBag()->add('notice', 'form.common.message.changes_saved');\n return $this->redirect($this->generateUrl('identification_species_admin_edit', array('id' => $id)));\n }\n\n return $this->render('SkaphandrusAppBundle:SkIdentificationSpecies:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n ));\n }", "public function update(Request $request,Trainer $trainer)\n {\n \n\n if($request->hasFile('subir-avatar')){\n $file = $request->file('subir-avatar')->store('public');\n \n \n }else { $file = $trainer->avatar;}\n\n \n\n $trainer->fill([\n\n 'name' => $request->input('name'),\n 'avatar' => $file,\n 'slug' => Str::slug($request->input('name'), '-'),\n 'updated_at'=> time() \n \n ]);\n\n $trainer->save();\n\n \n return redirect()->route('trainer.show',[$request->slug])->with('status', '¡Actualizacion Exitosa!');\n //return 'Updated!';\n\n\n\n }", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->avatar)\n {\n return;\n }\n\n //Lastname du fichier\n $file = $this->id_user.'.'.$this->avatar->guessExtension();\n // move takes the target directory and then the target filename to move to\n $this->avatar->move($this->getUploadRootDir(), $file);\n //Suppression des thumbnail déjà en cache\n @unlink(__DIR__.'/../../../../../web/imagine/thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/avatar_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/moyen_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/mini_thumbnail/avatars/'.$file);\n\n // set the path property to the filename where you'ved saved the file\n $this->avatar = $file;\n }", "public function update($id, $name, $email, $avatar);", "public function editAction(Request $request, Album $album)\n {\n $user = $this->getUser();\n if (!is_object($user) || !$user instanceof UserInterface) {\n throw new AccessDeniedException('This user does not have access to this section.');\n }\n\n/*\n $originalPhotographies = new ArrayCollection();\n foreach ($album->getPhotographies() as $photography) {\n $originalPhotographies->add($photography);\n }\n*/\n $editForm = $this->createForm('FotoJoin\\ControlPanelBundle\\Form\\AlbumType', $album);\n $editForm->handleRequest($request);\n\n if ($editForm->isSubmitted() && $editForm->isValid()) {\n $em = $this->getDoctrine()->getManager();\n/*\n $newPhotographies = $album->getPhotographies();\n foreach ($originalPhotographies as $originalPhotography) {\n if (false === $newPhotographies->contains($originalPhotography)) {\n $em->remove($originalPhotography);\n }\n }\n*/\n $em->persist($album);\n $em->flush();\n $request->getSession()->getFlashBag()->add( 'success', 'album.edit.flash' );\n\n return $this->redirectToRoute('album_edit', array('id' => $album->getId()));\n }\n\n// $em = $this->getDoctrine()->getManager();\n// $photographies = $em->getRepository('FotoJoinControlPanelBundle:Photography')->findByAlbum($album);\n// $files = array();\n// foreach ($photographies as $key => $photography) { $files[] = $photography->getFile(); }\n// $photographyCollectionForm = $this->createForm('FotoJoin\\ControlPanelBundle\\Form\\PhotographyCollectionType', $files);\n// $editForm->get('file')->setData($files);\n\n $albums = $user->getAlbums();\n return $this->render('FotoJoinControlPanelBundle:Album:edit.html.twig', array(\n 'album' => $album,\n 'albums' => $albums,\n 'edit_form' => $editForm->createView(),\n 'user' => $user,\n ));\n }", "public function update(Request $request, Transfer $transfer, $id)\n {\n $data = Transfer::find($id);\n $data -> title = $request -> input('title');\n $data -> keywords = $request -> input('keywords');\n $data -> description = $request -> input('description');\n $data -> slug = $request -> input('slug');\n $data -> status = $request -> input('status');\n $data -> category_id = $request -> input('category_id');\n $data -> user_id = Auth::id();\n $data -> base_price = $request -> input('base_price');\n $data -> km_price = $request -> input('km_price');\n $data -> capacity = $request -> input('capacity');\n $data -> detail = $request -> input('detail');\n if($request->file('image')!=null){\n $data -> image = Storage::putFile('images', $request->file(('image'))); //file upload\n }\n\n $data -> save();\n return redirect() -> route('admin_transfers');\n }", "public function update(ArticleRequest $request, Article $article)\n {\n $data = array();\n if($request->hasFile('Image'))\n {\n $imageObject = $request->Image;\n $nameFile = $imageObject->getClientOriginalName();\n $data = [\n 'TieuDe' => $request->input('TieuDe'),\n 'NoiDung' => $request->input('NoiDung'),\n 'Image' => $nameFile,\n 'idTL'=> $request->input('idTL'),\n 'idLT' => $request->input('idLT')\n ]; \n\n $imageObject->move('images', $nameFile); // upload anh \n }\n else {\n $data = $request->all();\n }\n $listArticle = $article->update($data);\n return redirect()->route('article.index', compact('listArticle'));\n }", "public function Editar(){\n \n $id = $_GET['id'];\n $imagem = $_GET['imagem'];\n \n if(!empty($_FILES['btnImagem']['name'])){\n // Caminho da pasta onde as imagens serão armazenadas.\n $upload_dir = \"imagens/\";\n\n // Para manipular arquivos, deve ser usado \"$_FILES\"!!!\n // Armazenando o nome e a extensão do arquivo que foi selecionado.\n $nome_arq = basename($_FILES['btnImagem']['name']);\n\n // Verifica o tipo de extensão permitida para o upload do arquivo,\n // usamos o comando \"strstr()\" para localizar a sequência de caracteres.\n if(strstr($nome_arq,'.jpg') || strstr($nome_arq,'.png') || strstr($nome_arq,'.gif')){\n\n $upload_file = $upload_dir . $nome_arq;\n\n if(move_uploaded_file($_FILES['btnImagem']['tmp_name'], $upload_file)){\n\n $frota = new Frota();\n\n $frota->id = $id;\n// $frota->titulo_frota = $_POST['titulo_frota'];\n $frota->imagem = $upload_file;\n $frota->descricao = $_POST['txt_sobre'];\n $frota->idTipoOnibus = $_POST['cbx_tipoOnibus'];\n\n $frota::Update($frota);\n \n \n// var_dump($frota);\n\n }else{\n echo(\"Falha ao mover o arquivo!\");\n }\n\n }\n }else{\n \n\n $idFrota = $_GET['id'];\n\n $frota = new Frota();\n\n $frota->id = $idFrota;\n// $frota->titulo_frota = $_POST['titulo_frota'];\n $frota->imagem = $imagem;\n $frota->descricao = $_POST['txt_sobre'];\n $frota->idTipoOnibus = $_POST['cbx_tipoOnibus'];\n\n $frota::Update($frota);\n \n }\n }", "public function edit(Photo $photo)\n {\n\n }", "public function edit(HTTPRequest $request) {\n // Check form field state\n if($this->parent->isDisabled() || $this->parent->isReadonly()) return $this->httpError(403);\n\n // Check item permissions\n $item = $this->getItem();\n if(!$item) return $this->httpError(404);\n if($item instanceof Folder) return $this->httpError(403);\n if(!$item->canEdit()) return $this->httpError(403);\n\n Requirements::css(DMS_DIR . '/css/UploadField.css');\n\n return $this->customise(array(\n 'Form' => $this->EditForm()\n ))->renderWith($this->parent->getTemplateFileEdit());\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n $model->file= UploadedFile::getInstance($model, 'file');\n $upload='';\n \n //UPLOAD FILE----------------------\n if($model->file){\n $imgPath='uploads/products/'; //Set Path\n $model->photo=$imgPath.$model->file->name; //Upload\n $upload=1;\n }\n \n if($model->save()){\n if($upload){\n $model->file->saveAs($model->photo);\n }\n return $this->redirect(['view','id'=>$model->id]); //redirect\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function update(ArticleRequest $request, $id)\n {\n $article = Article::findOrFail($id);\n $data = $request->all();\n $data['user_id'] = Auth::user()->id;\n $image = Input::file('image');\n if(isset($image)) {\n $imageName = time().'.'.$image->getClientOriginalExtension();\n $data['image'] = $imageName;\n $image->move(\"uploads\",$imageName);\n \n //delete old img\n if($article->image != '' && file_exists(\"uploads/\".$article->image)) {\n unlink(\"uploads/\".$article->image);\n }\n }\n $article->update($data);\n//<<<<<<< stefan_ristevski\n//=======\n \n // $tags = $request->input('tag');\n // if($request->input('tag') == null) {\n // $tags = [];\n // }\n // $article->tags()->sync($tags);\n \n//>>>>>>> master\n return redirect('article');\n }" ]
[ "0.7408042", "0.7408042", "0.6544808", "0.6527495", "0.6527495", "0.636829", "0.62078375", "0.61127394", "0.60750175", "0.60458595", "0.60338354", "0.5980989", "0.59696585", "0.59563357", "0.5938882", "0.5900115", "0.582876", "0.5799776", "0.57985884", "0.5782106", "0.57795364", "0.5734445", "0.5728829", "0.57087016", "0.57087016", "0.57020843", "0.5683466", "0.5683466", "0.5683466", "0.5682847", "0.5674752", "0.5653444", "0.5645332", "0.5641908", "0.56361806", "0.5621554", "0.5606236", "0.56030864", "0.56019515", "0.5585973", "0.55804574", "0.55758214", "0.55678415", "0.55651045", "0.5556132", "0.5548006", "0.55470073", "0.55408293", "0.5538457", "0.5536257", "0.55310506", "0.5528404", "0.552665", "0.552665", "0.552665", "0.552665", "0.552665", "0.552665", "0.552312", "0.5518821", "0.5516916", "0.55151033", "0.5513466", "0.5511209", "0.5511209", "0.55092424", "0.55029917", "0.550073", "0.54933053", "0.5491626", "0.54914945", "0.5488205", "0.5486036", "0.548333", "0.5473796", "0.54734117", "0.54686904", "0.5465263", "0.5465122", "0.546182", "0.5460874", "0.54600394", "0.54589254", "0.54589254", "0.54589254", "0.54589254", "0.5450854", "0.5445211", "0.5444708", "0.54393584", "0.54361403", "0.5432893", "0.54321826", "0.5429506", "0.542828", "0.5428122", "0.5427552", "0.5411593", "0.54041153", "0.5404003" ]
0.6646503
2
Deletes a Upload entity.
public function deleteAction(Request $request, $id) { $form = $this->createDeleteForm($id); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('MHProductsBundle:Upload')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Upload entity.'); } $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('admin_uploads')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\n\n\t \t if(!unlink($this->directory .'/' . $_FILES[$this->inputName]['name']))\n Log::debug('Upload::delete Failed to delete upload');\n else\n Log::debug('Upload::delete Delete successful');\n\t }", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete($entity);", "public function delete(User $user, Upload $upload)\n {\n //\n }", "public function delete($entity)\n {\n $this->getObjectManager()->remove($entity);\n $this->getObjectManager()->flush();\n }", "public function destroy(Upload $upload)\n {\n //\n }", "public function destroy(Upload $upload)\n {\n //\n }", "protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }", "public function delete($entity){ \n //TODO: Implement remove record.\n }", "public function delete($entity)\n {\n \n }", "public function delete($entity) {\n $this->deleteRecord([\n 'id' => $entity->getId(),\n ]);\n }", "public function delete(DimeEntityInterface $entity);", "public function deleteEntity($entity): void\n {\n /** @var EntityRepository $repository */\n $repository = Prime::repository($entity);\n $mapper = $repository->mapper();\n\n $isReadOnly = $mapper->isReadOnly();\n $mapper->setReadOnly(false);\n\n $repository->disableEventNotifier();\n $repository->delete($entity);\n $repository->enableEventNotifier();\n\n $mapper->setReadOnly($isReadOnly);\n }", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public function deleteEntity($entity)\n {\n return $this->model->destroy($entity->id);\n\n }", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public function deleteTrack(DeleteTrackRequest $request): void\n\t{\n\t\t$request->album()->deleteTrack();\n\t}", "public function Delete($entity) {\n }", "public function deleteAction() {\n $fileID = (int) $this->params()->fromRoute('id', 0);\n $request = $this->getRequest();\n\n if ($fileID and $request->isXmlHttpRequest()) {\n try {\n\n $file = $this->getFileTable()->getFile($fileID);\n $filePath = $this->getOptions()->getUploadFolderPath() . '/' . $file->url;\n\n if (file_exists($filePath)) {\n if (!unlink($filePath)) {\n throw new \\Exception('Could not delete file');\n }\n }\n\n $this->getFileTable()->deleteFile($fileID);\n\n echo json_encode(array('state' => true));\n exit();\n } catch (\\Exception $e) {\n echo json_encode(array('state' => false));\n exit();\n }\n }\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "public function delete()\n\t{\n\t\tforeach( \\IPS\\Db::i()->select( '*', 'form_fields', array( 'field_type=?', 'Upload' ) ) AS $field )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tforeach( \\IPS\\Db::i()->select( '*', 'form_values', array( \"value_value<>? OR value_value IS NOT NULL\", '' ) ) as $cfield )\n\t\t\t\t{\n\t\t\t\t\t\\IPS\\File::get( 'core_FileField', $cfield[ 'value_value' ] )->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( \\Exception $e ){}\n\t\t}\n\t}", "public function delete($entity) : bool;", "public function destroy(Upload $upload)\n {\n return abort(404);\n }", "public function delete(EntityInterface $Entity);", "public function actionDelete()\n {\n if (Yii::$app->user->can('imagedelete')) {\n if (Yii::$app->request->isAjax) {\n $system = new Filesystem();\n $param = Yii::$app->request->post();\n $model = $this->findModel($param['id']);\n $system->remove($this->original . $model->unique_name);\n $system->remove($this->thumb_145x145 . $model->unique_name);\n $system->remove($this->thumb_original . $model->unique_name);\n $system->remove($this->thumb_191x128 . $model->unique_name);\n $model->delete();\n }\n } else {\n throw new HttpException(403, 'You are not allowed to access this page', 0);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function delete(IndexableEntity $entity);", "public function deleteFile( Request $request ){\n return FileItem::destroy((int)$request->get('id'));\n }", "public function delete(){\r\n\t\t$image = $this->admin_users_model->get_one(array('id'=>$this->uri->segment(2)),'UserAvatar');\r\n\t\t@unlink('../upload/avatar/'.$image);\r\n\t\t$this->admin_users_model->Delete($this->uri->segment(2));\r\n\t\tredirect('admin-users-list');\t\r\n\r\n\r\n\t\t}", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function destroy(Request $request)\n {\n $record = PhotoArticle::find($request->key);\n if($record->delete()){\n $this->storage->delete($record->path . 'original-' . $record->image);\n $this->storage->delete($record->path . '250x200-' . $record->image);\n $this->storage->delete($record->path . '1200x600-' . $record->image);\n return response()->json(['success'=>'Removido']);\n }else {\n return response()->json(['error'=>'Houve um problema para excluir a imagem! por favor, tente novamente!']);\n }\n }", "public static function _deleteAttachment($entity, $field, $name, $config) {\n\t\t$file = Interpolation::run($config['path'], $entity, $field, array(\n\t\t\t'filename' => $name\n\t\t));\n\t\t$path = dirname($file);\n\t\tif (is_file($file) && unlink($file)) {\n\t\t\t$files = @scandir($path);\n\t\t\tif ($files && count($files) === 2) {\n\t\t\t\trmdir($path);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "public function delete($entity) {\r\n\t\tif($entity instanceof Model_Abstract) {\r\n\t\t\t$id = $entity->getIdentityValue();\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$id = $entity;\r\n\t\t}\r\n\t\t// Need to unset the entity in the identity map if it exists\r\n\t\t$this->_unsetIdentity($id);\r\n\t\t \r\n\t\t$rowset = $this->_getGateway()->find($id);\r\n\t\tif($rowset->count() > 0) {\r\n\t\t\t$row = $rowset->current();\r\n\t\t\t$result = $row->delete();\r\n\t\t}\r\n\t}", "public function destroy(upload $upload)\n {\n $upload->delete();\n return redirect()->back()->with('message', 'You have deleted File successfully');\n }", "public static function DeleteById($entity)\n {\n //When the precedent is GetById\n if(isset(StorageManager::$entities[$entity->Alias]))\n {\n unset(StorageManager::$entities[$entity->Alias][$entity->IdEntite]);\n }\n\n //When the precedent request is getByArg\n $stores = StorageManager::Find($entity);\n\n if(count($store) > 0 )\n {\n foreach($stores as $store)\n {\n if(isset($store::$entities))\n {\n unset($store::$entities[$entity->Alias][$entity->IdEntite]);\n }\n }\n }\n }", "public function delete_file()\n {\n if(Module::hasAccess(\"Uploads\", \"delete\")) {\n\t\t\t$file_id = Input::get('file_id');\n\t\t\t\n\t\t\t$upload = Upload::find($file_id);\n\t\t\tif(isset($upload->id)) {\n\t\t\t\tif($upload->user_id == Auth::user()->id || Entrust::hasRole('SUPER_ADMIN')) {\n\t\n\t\t\t\t\t// Update Caption\n\t\t\t\t\t$upload->delete();\n\t\n\t\t\t\t\treturn response()->json([\n\t\t\t\t\t\t'status' => \"success\"\n\t\t\t\t\t]);\n\t\n\t\t\t\t} else {\n\t\t\t\t\treturn response()->json([\n\t\t\t\t\t\t'status' => \"failure\",\n\t\t\t\t\t\t'message' => \"Unauthorized Access 1\"\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn response()->json([\n\t\t\t\t\t'status' => \"failure\",\n\t\t\t\t\t'message' => \"Upload not found\"\n\t\t\t\t]);\n\t\t\t}\n\t\t} else {\n\t\t\treturn response()->json([\n\t\t\t\t'status' => \"failure\",\n\t\t\t\t'message' => \"Unauthorized Access\"\n\t\t\t]);\n\t\t}\n }", "public function delete_file()\n {\n if(Module::hasAccess(\"Uploads\", \"delete\")) {\n\t\t\t$file_id = Input::get('file_id');\n\t\t\t\n\t\t\t$upload = Upload::find($file_id);\n\t\t\tif(isset($upload->id)) {\n\t\t\t\tif($upload->user_id == Auth::user()->id || Entrust::hasRole('SUPER_ADMIN')) {\n\t\n\t\t\t\t\t// Update Caption\n\t\t\t\t\t$upload->delete();\n\t\n\t\t\t\t\treturn response()->json([\n\t\t\t\t\t\t'status' => \"success\"\n\t\t\t\t\t]);\n\t\n\t\t\t\t} else {\n\t\t\t\t\treturn response()->json([\n\t\t\t\t\t\t'status' => \"failure\",\n\t\t\t\t\t\t'message' => \"Unauthorized Access 1\"\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn response()->json([\n\t\t\t\t\t'status' => \"failure\",\n\t\t\t\t\t'message' => \"Upload not found\"\n\t\t\t\t]);\n\t\t\t}\n\t\t} else {\n\t\t\treturn response()->json([\n\t\t\t\t'status' => \"failure\",\n\t\t\t\t'message' => \"Unauthorized Access\"\n\t\t\t]);\n\t\t}\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function deleteAction(Request $request, Photo $photo)\n {\n $form = $this->createDeleteForm($photo);\n $form->handleRequest($request);\n\n $photoSrc = $this->getParameter('root_directory').$photo->getSrc();\n $photoFile = new Filesystem();\n\n if ($form->isSubmitted() && $form->isValid()) {\n $photoFile->remove($photoSrc);\n $em = $this->getDoctrine()->getManager();\n $em->remove($photo);\n $em->flush();\n }\n\n return $this->redirectToRoute('_dashboard');\n }", "public function massDelete(Request $request)\n {\n if ($request->get('toDelete') != 'mass') {\n $toDelete = json_decode($request->get('toDelete'));\n Upload::destroy($toDelete);\n } else {\n Upload::whereNotNull('id')->delete();\n }\n\n return redirect()->route(config('quickadmin.route').'.upload.index');\n }", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function postDelete()\n {\n $upload = Upload::findorfail(Input::get('id'));\n if ($upload->user_id == Auth::id()) {\n $path = public_path('uploads');\n $filename = $upload->filename_saved_as;\n File::delete($path.'/'.$filename);\n if (!File::exists($path.'/'.$filename)) {\n $upload->delete();\n return Redirect::back()->with('message', 'File deleted!');\n } else {\n return Redirect::back()\n ->with('message', 'Unfortunately, your file may not have deleted correctly.');\n }\n } else {\n return Redirect::to('posts/index')\n ->with('message', 'You cannot delete files that do not belong to you.');\n }\n }", "public function delete(): void\n {\n unlink($this->path);\n }", "public function delete(\\PropelPDO $oConnection = null)\r\n {\r\n parent::delete($oConnection);\r\n\r\n if ($this->isDeleted()) {\r\n // Version number decrementing\r\n $oConnection = $this->getConnection();\r\n $oConnection->exec('\r\n UPDATE files\r\n SET file_version = file_version-1\r\n WHERE file_version > \"' . $this->getFileVersion() . '\"\r\n AND file_category_id = \"' . $this->getFileCategoryId() . '\"\r\n AND file_entity_name = \"' . $this->getFileEntityName() . '\"\r\n AND file_entity_id= \"' . $this->getFileEntityId() . '\"\r\n ');\r\n\r\n // File deletion\r\n $this->remove();\r\n }\r\n }", "public function postRemove($entity);", "public function delete(Resizable $entity)\n {\n // get the sizes\n $sizes = (array) $entity->sizes;\n\n array_unshift($sizes, $model->original);\n\n // spin through each size\n foreach ($sizes as $file) {\n $img = $path .'/'. $file;\n\n if ($this->disk->has($img)) {\n $this->disk->delete($img);\n }\n }\n }", "public function delete(DataObject $entity){\n }", "public function deleteModel($entity){\n $this->entityManager->remove($entity);\n $this->entityManager->flush();\n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy(Fileupload $fileupload)\n {\n //\n }", "public function testUpload() {\n\t\ttry {\n\t\t\tif ($this->object->upload()) {\n\t\t\t\t$this->object->getOriginalFile()->delete();\n\t\t\t}\n\n\t\t\t$this->assertTrue(true);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(false, $e->getMessage());\n\t\t}\n\t}", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function actionDelete()\n\t{\n\t\t// setting the delete tag as false\n\t\t$deleteObject = Image::model()->findByPk($_GET['imageid']);\n\t\t$deleteObject->deleted = true;\n\t\t$deleteObject->save();\n\t\t\n\t\t// link to the physical image file\n\t\t$deleteMe = $deleteObject->getImageFile('full', false, Image::FULLIMAGEPATH);\n\t\t\t\n\t\t// first the existance of the file has to be evaluated in order to avoid an php error\n\t\tif( file_exists( $deleteMe ) )\n\t\t\trename( \n\t\t\t\t// source\n\t\t\t\t$deleteMe,\n\t\t\t\t// target \n\t\t\t\tImage::DELETEDIMAGEPATH . $deleteObject->imageid . '.' . $deleteObject->tiedostotyyppi\t\t\n\t\t);\n\t\t\n\t\t$deleteObject->deleteImage(array('small', 'light', 'medium', 'large'));\n\t\t\n\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t\n\t}", "protected static function deleteEntity(\\ElggEntity $entity) {\n\n\t\tif (!$entity->getPrivateSetting(ELASTICSEARCH_INDEXED_NAME)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$client = elasticsearch_get_client();\n\t\tif (empty($client)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\telasticsearch_add_document_for_deletion($entity->getGUID(), [\n\t\t\t'_index' => $client->getIndex(),\n\t\t\t'_type' => $client->getDocumentTypeFromEntity($entity),\n\t\t\t'_id' => $entity->getGUID(),\n\t\t]);\n\t}", "public function delete(GC_Model_Arquivo $object)\n\t{\n \t$this->getDbTable()->delete(array('id = ?' => $object->id));\n\t}", "public function deleteEntity($obj)\n\t{\n\t\t$this->db->deleteEntity($obj);\n\t}", "public function deleting(Instance $instance)\n {\n\n $instance->claims->each(function ($item) {\n $item->delete();\n });\n\n\n $storage = new MediaStorage;\n $storage->deleteDir('images/'.$instance->id);\n\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete($entity)\n {\n $this->getEventDispatcher()->dispatch(\n TrackingHistoryEvents::PRE_DELETE,\n new TrackingHistoryEvent($entity)\n );\n\n parent::delete($entity);\n\n $this->getEventDispatcher()->dispatch(\n TrackingHistoryEvents::POST_DELETE,\n new TrackingHistoryEvent($entity)\n );\n }", "public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }", "public function actionDeleteimage()\n {\n $this->enableCsrfValidation = false;\n $filename = Yii::$app->request->post('filename');\n $path_name = \"../web/web_mat/temp/\" . $filename;\n if (unlink($path_name)) {\n echo \"success\";\n } else {\n echo \"fail\";\n }\n }", "public function deleteFile(Request $request){\n $this->validate($request,[\n 'id' => 'required'\n ]);\n $id = $request->id;\n if (is_array($id)){\n return $this->respondWithSuccess('Files Deleted',CloudFile::destroy($id));\n }else{\n return $this->respondWithSuccess('file delete', CloudFile::find($id)->delete());\n }\n }", "public static function delete($entity)\n {\n return static::mapper()->delete($entity);\n }", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function actionDelete()\n {\n if (Yii::app()->getRequest()->getIsPostRequest()) {\n $id = $_POST['id'];\n /** @var $photo GalleryPhoto */\n $photo = GalleryPhoto::model()->findByPk($id);\n if ($photo !== null && $photo->delete()) echo 'OK';\n else echo 'FAIL';\n } else echo 'FAIL';\n }", "public function DeleteFile()\r\n\t{\r\n\t\t$queryDeleteFile = \"UPDATE files SET status=\\\"DELETED\\\" WHERE file_id=\".$this->fileId;\r\n\t\t$this->sqlDataBase->nonSelectQuery($queryDeleteFile);\r\n\t\tunlink(UPLOAD_PATH. DIRECTORY_SEPARATOR .$this->fileId);\r\n\t}", "public function entityDelete(EntityInterface $entity) {\n if (($entity_type = $entity->getEntityTypeId()) == \\Drupal::config('recurly.settings')->get('recurly_entity_type')) {\n // Check for a local account first, no need to attempt to close an account\n // if we don't have any information about it.\n $local_account = recurly_account_load(['entity_type' => $entity_type, 'entity_id' => $entity->id()], TRUE);\n if ($local_account) {\n $recurly_account = recurly_account_load(['entity_type' => $entity_type, 'entity_id' => $entity->id()]);\n recurly_account_delete($recurly_account);\n }\n }\n }", "public function removeEntity($entity)\n\t{\n\t\t$entityManager = $this->getDoctrine()->getManager();\n\t $entityManager->remove($entity);\n\t $entityManager->flush();\n\t}", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Fj_Service_Goods::deleteGoods($id);\n\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function delete($entity)\n {\n $statement = \"DELETE FROM contact WHERE id = :id\";\n $prepare = $this->db->prepare($statement);\n $prepare->bindValue(\":id\", $entity->getId());\n $prepare->execute();\n }", "public function deleteEntity($eid)\n {\n $this->getConnectionService()->deleteById($eid);\n }", "public function delete(PhpORM_Entity $entity)\n {\n $table = $this->getTable();\n return $table->delete($table->getAdapter()->quoteInto('id = ?',$entity->id));\n }", "public function removeUpload()\n {\n $this->picture = null;\n }", "public function delete()\n {\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $id = $_POST['id'];\n $pictureManager = new PictureManager();\n $pictureManager->delete($id);\n $productManager = new ProductManager();\n $productManager->delete($id);\n header('location: /adminProduct/list');\n }\n }", "public static function DeleteByArg($entity)\n {\n //When the precedent request is getByArg\n $stores = StorageManager::Find($entity);\n\n foreach($stores as $store)\n {\n unset($store::$entities[$entity->Alias][$entity->IdEntite]);\n }\n }", "public function deleteImage(Image $image)\n {\n //need to log unlink error\n @unlink($image->getAbsolutePath());\n $this->em->remove($image);\n }", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }", "public function ajaxDeleteFile(Request $request) {\n $data = $request->all();\n $file = LMSFile::find($data['id']);\n unlink(storage_path() . '/lms/' . $file->hash);\n //Deletes the db object\n $file->delete();\n echo 'ok';\n }", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "public function remove($entity)\n {\n $this->em->remove($entity);\n $this->em->flush();\n }", "public function delete(Request $request)\n {\n $id=$request['id'];\n $testimonial=Testimonial::testimonial_show($id);\n Storage::delete('public'.$testimonial->image);\n $testimonial->delete();\n return redirect('/admin/testimonial/index');\n }", "public function delete()\n {\n\n if( $this->loaded() === FALSE )\n throw new Exception( 'No se pudo borrar la foto.' );\n\n\n // borra las asignaciones a productos\n //$this->remove( 'productos' );\n\n\n // borra el archivo\n $this->borra_archivos_fisicos();\n\n\n // ahora si borra\n return( parent::delete() );\n\n }", "public function deleteImage($image){\n /** @var Image $image */\n $this->em->remove($image);\n $image->onPreRemove();\n $this->em->flush();\n }", "public function executeDeletefile(sfWebRequest $request)\n {\n if (!$this->getUser()->getGuardUser()->getIsSuperAdmin())\n $this->redirect('ingreso');\n\n $archivo = Doctrine_Core::getTable('Actualizacionestrat')->find(array($request['id']));\n\n $archivo_nombre = sfConfig::get('app_pathfiles_folder').\"/../actualizacionestrat\".'/'.$archivo->getImagefile();\n\n if (file_exists($archivo_nombre)) unlink($archivo_nombre);\n\n $archivo->delete();\n\n return true;\n\n }", "public function delete($id) {\n\t\t$fileName= $this->Partner->field('image',$id);\n\t\t//create and new file varalbe to be used by the file utility for deletion\n\t\t$file = new File(WWW_ROOT . $fileName, false, 0777);\n if ($this->request->is('get')) {\n throw new MethodNotAllowedException();\n }\n //deleted the field then run the record delection from the database\n if($this->Partner->delete($id)) {\n\t\t$file->delete();\n\t\t return $this->redirect(array('action' => 'index'));\n \n }\n}", "public function delete($force = false)\n {\n if (!$this->uploaded)\n @unlink($this->photoUrl);\n\n if ($this->uploaded && !$force)\n {\n $this->deleted = 1;\n $this->save();\n }\n else\n parent::delete();\n }", "public function destroy($id)\n\t{\n\t\tUpload::destroy($id);\n\t\treturn redirect()->route(config('quickadmin.route').'.upload.index');\n\t}", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function delete()\n {\n $this->job->delete();\n }", "public function delete()\n {\n $post_id = $this->uri->rsegment('3');\n $this->_del($post_id);\n $image = $this->input->get('image');\n unlink(\"upload/post\".$image);\n // thong bao xoa thanh cong\n $this->session->set_flashdata('message', 'Xóa thành công tin tức này');\n redirect(admin_url('blog'));\n }", "public function destroy(Request $request)\n {\n //\n $filename = $request->id;\n $uploaded_image = Image::where('original_name', basename($filename))->first();\n\n if (empty($uploaded_image)) {\n return Response()->json(['message' => 'Fichier Inexistant'], 400);\n }\n\n $file_path = $this->photos_path . '/' . $uploaded_image->filename;\n $resized_file = $this->photos_path . '/' . $uploaded_image->resized_name;\n\n if (file_exists($file_path)) {\n unlink($file_path);\n }\n\n if (file_exists($resized_file)) {\n unlink($resized_file);\n }\n\n if (!empty($uploaded_image)) {\n $uploaded_image->delete();\n }\n\n return Response()->json(['message' => 'Fichier Supprimé'], 200);\n\n }", "public function deleteById($entityId);", "public function deleteById($entityId);", "public function delete()\n {\n foreach ($this->users as $user) {\n $uid = $user->id;\n // delete whole website info for this user\n if ((bool)$this->delete) {\n $model = new FormUserClear($user);\n $model->comments = true;\n $model->content = true;\n $model->feedback = true;\n $model->wall = true;\n $model->make();\n }\n\n // delete avatars\n File::remove('/upload/user/avatar/big/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/small/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/original/' . $uid . '.jpg');\n // delete user profile and auth data\n $user->profile()->delete();\n // delete user provider data\n $user->provider()->delete();\n // delete user object\n $user->delete();\n }\n }", "protected function _deleteEntity( $id )\n\t\t{\n\t\t\t$data = explode( '__', $id );\n\t\t\t$template = array_pop( $data );\n\t\t\t$type = str_replace( '.phtml', '', $template );\n\t\t\t// Delete a file.\n\t\t\tif ( count( $data ) > 1 ) {\n\t\t\t\t$directory = $this->_getTypeDirectory( $type );\n\t\t\t\tif ( is_file( $directory . $id ) ) {\n\t\t\t\t\tunlink( $directory . $id );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function deleteAction(Request $request)\n {\n $id = (int)$request->attributes->get('id');\n $userAttr = $this->user->getAttributes();\n $isTest = (int)$request->attributes->get('test');\n $testResult = (int)$request->attributes->get('result');\n $validCSRF = $this->validateCSRF();\n if($isTest == 1 && $testResult == 0)\n {\n $userAttr = array('id' => (int)$request->attributes->get('user'));\n $validCSRF = true;\n }\n elseif($isTest == 1 && $testResult == 1)\n {\n $userAttr = array('id' => (int)$request->attributes->get('elUser1'));\n $validCSRF = true;\n }\n $result = array('isError' => 1, 'message' => '');\n $image = $this->enMan->getRepository('CatalogueImagesBundle:OffersImages')->getImageByUserAndId($id, $userAttr['id']);\n if($validCSRF === true && isset($image['id_oi']) && $image['id_oi'] == $id)\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 1), 200);\n }\n // start SQL transaction\n $this->enMan->getConnection()->beginTransaction();\n try\n {\n $this->enMan->createQueryBuilder()->delete('Catalogue\\ImagesBundle\\Entity\\OffersImages', 'oi')\n ->where('oi.id_oi = ?1')\n ->setParameter(1, $id)\n ->getQuery()\n ->execute();\n $dir = $this->config['images']['offersDir'].'/'.$image['id_of'].'/';\n foreach($this->config['images']['configuration']['offer']['prefix'] as $p => $prefix)\n {\n @unlink($dir.$prefix.$image['imageName']);\n }\n @unlink($dir.$image['imageName']);\n // update number of offer images\n $this->enMan->createQueryBuilder()\n ->update('Catalogue\\OffersBundle\\Entity\\Offers', 'o')\n ->set('o.offerImages', 'o.offerImages - 1')\n ->where('o.id_of = ?1')\n ->setParameter(1, (int)$image['id_of'])\n ->getQuery()\n ->execute();\n $this->enMan->getRepository('FrontendFrontBundle:Stats')->updateQuantity('- 1', 'ofim');\n\n // commit SQL transaction\n $this->enMan->getConnection()->commit();\n\n $result['isError'] = 0;\n $result['message'] = \"Le fichier a été correctement supprimé\";\n }\n catch(Exception $e)\n {\n $this->enMan->getConnection()->rollback();\n $this->enMan->close();\n $result['message'] = \"Une erreur s'est produite\";\n }\n }\n else\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 0), 200);\n }\n if(!$validCSRF) $result['message'] = \"Votre session a expiré. Veuillez réessayer.\";\n else $result['message'] = \"Une erreur s'est produite pendant la suppression du fichier\";\n }\n echo json_encode($result);\n die();\n }", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "public function destroy(Request $request, UserFile $file)\n {\n $this->authorize('destroy', $file);\n $file->delete();\n\n return redirect('/files');\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}" ]
[ "0.6958227", "0.6944553", "0.6914675", "0.68993485", "0.6855519", "0.6840424", "0.6840424", "0.6791171", "0.67702705", "0.6514831", "0.64879173", "0.64869595", "0.64151806", "0.63814855", "0.63805515", "0.637734", "0.63707864", "0.6370065", "0.6364476", "0.63504916", "0.6326644", "0.6308656", "0.6295813", "0.6272277", "0.6253615", "0.6226214", "0.6222756", "0.62096137", "0.6200664", "0.61948234", "0.6176809", "0.61751693", "0.61558175", "0.6128947", "0.6123384", "0.61134785", "0.61134785", "0.61093867", "0.61009383", "0.60956806", "0.609457", "0.6087466", "0.6086975", "0.60613024", "0.60612005", "0.6060743", "0.6048126", "0.604605", "0.6040611", "0.6021016", "0.60163534", "0.5989684", "0.5985031", "0.59822977", "0.59648716", "0.5962523", "0.5955351", "0.59535825", "0.5951914", "0.5940959", "0.5935472", "0.5928534", "0.5905908", "0.59003985", "0.5895376", "0.5884394", "0.58685374", "0.5864394", "0.5851069", "0.5850859", "0.58346117", "0.5833607", "0.5833344", "0.58053935", "0.5802861", "0.5792878", "0.5788891", "0.5782055", "0.5778005", "0.577736", "0.5777139", "0.5775699", "0.5771117", "0.5764145", "0.5761985", "0.57559663", "0.57511795", "0.5748183", "0.5747612", "0.57449377", "0.57353646", "0.573269", "0.57319283", "0.57319283", "0.5731664", "0.5729013", "0.5723629", "0.5722937", "0.57167727", "0.5716426" ]
0.6690614
9
Creates a form to delete a Upload entity by id.
private function createDeleteForm($id) { return $this->createFormBuilder() ->setAction($this->generateUrl('admin_uploads_delete', array('id' => $id))) ->setMethod('DELETE') ->add('submit', 'submit', array('label' => 'Delete')) ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('config_testimonial_delete', array('id' => $id)))\n ->setAttribute('enctype', 'multipart/form-data')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('image_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('picture_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('localbanner_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'title.sim', 'translation_domain' => 'messagesCommonBundle', 'attr' => array('class' => 'btn btn-success btn-lg bt-delete-foto')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('medicamentossuministrados_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'attr' => array('class' => 'btn')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fileops_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caracteristicasequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('object_objecttype_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Удалить'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('solmantenimientoidentificacion_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar','attr'=>array('class'=>'btn btn-danger btn btn-danger btn-lg btn-block')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fluidite_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array(\n 'label' => 'Delete',\n 'attr' => array(\n 'class' => 'btn btn-danger'\n ))\n \n )\n \n \n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('bien_delete', array('id' => $id)))\n ->setMethod('DELETE')\n // ->add('submit', 'submit', array('label' => 'Delete'))\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger'),))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('picfooter_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('utente_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "public function createDeleteForm($id){\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rsp_delete',array('id'=>$id)))\n ->setMethod('DELETE')\n ->add('submit','submit',array('label'=>'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pifeclassique_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('com_incident_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer','attr'=>array('class'=>'btn btn-danger','style'=>'width:100px;')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder(null, array('attr' => array( 'id' => 'pts_del')))\n ->setAction($this->generateUrl('morus_accetic_inventory_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $this->get('translator')->trans('btn.delete')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n { \n \n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aulas_aula_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tecnoasignar_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'ELIMINAR ASIGNACION'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id){\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('reserva_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Eliminar Reserva', 'attr' => array('class'=>'btn btn-danger btn-block')))\n\t\t\t->getForm()\n\t\t;\n\t}", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tecnoequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'ELIMINAR'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n\t{\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('admin_element_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', SubmitType::class, array('label' => 'Удалить', 'attr' => array(\n\t\t\t\t'class' => 'btn btn-danger',\n\t\t\t\t'data-delete' => ''\n\t\t\t)))\n\t\t\t->getForm();\n\t}", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('social_admin_resource_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => '删除','attr'=>[\n 'class'=>'btn btn-danger'\n ]))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n $translated = $this->get('translator');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('configuracao_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $translated->transChoice('txt.excluir',0,array(),'messagesCommonBundle'), 'attr' => array('class' => 'btn btn-danger btn-lg')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('victoire_business_template_delete', ['id' => $id]))\n ->setMethod('DELETE')\n ->add('submit', SubmitType::class, ['label' => 'Delete'])\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('endroit_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('envase_ingreso_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id,$idcupo)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('liquidaciones_delete', array('id' => $id,'idcupo'=>$idcupo)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'form-control')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('adtiposcomision_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('galerias_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('empleado_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('datoslistapublicidad_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('klasses_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dreams_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr'=>array('class'=>'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('visiteur_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ingrediente_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('admtipoaporte_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Eliminar','attr'=>array('class'=>'btn btn-danger')))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('container_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_productosprogramas_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('energy_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sifdainformeordentrabajo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar informe'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('propietario_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('feriado_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dzialy_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Usuń Dział' , 'attr' => array('class' => 'btn btn-danger' , 'icon' => 'times fa-fw')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('encuesta_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('posgradolineas_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('invoice_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_partners_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array(\n 'label' => 'Supprimer',\n 'attr' => array(\n 'class' => 'btn btn-danger'\n )))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('entreprise_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder(array('id' => $id))\n ->add('id', 'hidden')\n ->setAction($this->generateUrl('chofer_destroy', ['id' => $id]))\n ->getForm()\n ;\n }", "public function deleteAction(Request $request, $id)\n {\n $form = $this->createDeleteForm($id);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('MHProductsBundle:Upload')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Upload entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n }\n\n return $this->redirect($this->generateUrl('admin_uploads'));\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl($this->mesRoutes[\"delete\"], array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tipuscentre_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('vendorprofilelimit_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clientecredito_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_missatges_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('user_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array(\n \t\t'label' => 'Delete',\n \t\t'attr' => array('class' => 'ui-btn ui-corner-all ui-shadow ui-btn-b ui-btn-icon-left ui-icon-check')\n ))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mecz_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('product_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('devissetup_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('achats_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sucursal_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fichepatient_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'bttn')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_incapacidad_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('detailsproduits_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('vluchten_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_sesionventatratamiento_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('premiacao_ideia_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder(array('id' => $id))\r\n ->add('id', 'hidden')\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id) {\n $session = $this->get(\"session\");\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('hall_delete', array('id' => $id, )))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('estadofondo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'BORRAR'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('administracion_servicio_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('member_intrestconfig_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Delete'))\n\t\t\t->getForm()\n\t\t;\n\t}", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cole_deletar', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('business_admin_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'form.common.btn.delete', 'attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('business_admin_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'form.common.btn.delete', 'attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sifda_equipotrabajo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder(array('id' => $id))\n ->add('id', 'hidden')\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder(array('id' => $id))\n ->add('id', 'hidden')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('bill_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cardtype_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sales_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', SubmitType::class, array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('grupos_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('annonce_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('appbundle_listkdo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add(\n 'submit',\n 'submit',\n array('label' => 'button.delete', 'attr' => array('class' => 'tiny button alert'))\n )\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('usertotask_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('appbundle_userlistkdo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add(\n 'submit',\n 'submit',\n array('label' => 'button.delete', 'attr' => array('class' => 'tiny button alert'))\n )\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('timerecord_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('userman_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('resident_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder(array('id' => $id))\r\n ->add('id', 'hidden')\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder(array('id' => $id))\r\n ->add('id', 'hidden')\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('admin_consulta_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('viaje_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('funcionarioempresa_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cosecha_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }" ]
[ "0.7521323", "0.75173247", "0.74919534", "0.7397693", "0.7351193", "0.734221", "0.7341411", "0.7193868", "0.715488", "0.7132817", "0.7125539", "0.71149063", "0.7110867", "0.7106895", "0.7096944", "0.70882034", "0.70842665", "0.70830697", "0.7082067", "0.706732", "0.7066681", "0.70605373", "0.7057062", "0.7056338", "0.7051517", "0.70437694", "0.7041135", "0.7027037", "0.7025589", "0.7023629", "0.70227677", "0.70170367", "0.70053923", "0.70022666", "0.70009303", "0.69845533", "0.6979013", "0.6978588", "0.6977777", "0.6974841", "0.6974537", "0.697169", "0.6970472", "0.69693387", "0.6968041", "0.69668454", "0.6966491", "0.6966262", "0.696572", "0.69654834", "0.6960908", "0.6955422", "0.6954382", "0.69533193", "0.69487166", "0.69472873", "0.69457024", "0.69448054", "0.6942395", "0.69407475", "0.6934784", "0.6932806", "0.6931312", "0.693047", "0.6924059", "0.6923796", "0.6921907", "0.6917521", "0.691669", "0.69109154", "0.69083655", "0.69049245", "0.6900766", "0.6898649", "0.6896998", "0.68967354", "0.6895132", "0.6895132", "0.6894609", "0.6894243", "0.6894243", "0.6893639", "0.68925035", "0.6892176", "0.6891794", "0.68915665", "0.68905526", "0.6885168", "0.6883589", "0.6881208", "0.6879856", "0.6879048", "0.68768936", "0.68757504", "0.68757504", "0.68755656", "0.6875004", "0.6871711", "0.68711066", "0.68701625" ]
0.75771433
0
Display a listing of the resource.
public function index() { $data['paragraphs'] = DB::table('paragraph')->where('type', 'P')->get(); $data['rows'] = Paragraph::where('type', 'R')->get(); return view('index', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446737", "0.73625076", "0.7300871", "0.72476006", "0.7163127", "0.7149414", "0.7131995", "0.7105663", "0.7102927", "0.7101388", "0.704981", "0.69946545", "0.69897777", "0.6935023", "0.690029", "0.68989694", "0.68925905", "0.68878543", "0.6866467", "0.6849924", "0.6829784", "0.68033314", "0.67971504", "0.6796001", "0.6786942", "0.6760321", "0.6743112", "0.6730776", "0.67266184", "0.67259544", "0.67259544", "0.67259544", "0.671818", "0.670783", "0.670644", "0.6704464", "0.6665842", "0.6663898", "0.6660563", "0.6660198", "0.6657512", "0.6654405", "0.6648237", "0.6620824", "0.6619237", "0.6618058", "0.66072917", "0.660077", "0.6600677", "0.6594786", "0.6587929", "0.65850085", "0.65824693", "0.6581521", "0.6577045", "0.6574634", "0.65729445", "0.65715027", "0.6570646", "0.6565125", "0.6563328", "0.6553843", "0.6553201", "0.6545921", "0.6537198", "0.6534121", "0.6533748", "0.65272135", "0.6526431", "0.6525868", "0.6519198", "0.65185314", "0.6517867", "0.65170157", "0.651509", "0.65070677", "0.6505637", "0.65033627", "0.6494597", "0.6492147", "0.64880013", "0.64871716", "0.6485315", "0.6485215", "0.64790684", "0.64767736", "0.64725083", "0.64709103", "0.64702755", "0.6466392", "0.64618254", "0.646148", "0.64601135", "0.6458744", "0.64543813", "0.64537513", "0.64530194", "0.6450726", "0.64492655", "0.6449169", "0.64466155" ]
0.0
-1
/ Method to store all kind paragraphs TYPE can be P pargraphs main page /index PL paragraphs legal page R pargraphs index page seeding from seeder pargraphSeeder file, default 3
public function store() { if (!Auth::check()) { return; } $data = Paragraph::find(Input::get("id")); if (!$data) { $data = new Paragraph; $data->type = Input::get("t"); $data->uid_create = 1; $data->uid_edit = 1; } $data->title = Input::get("title"); $data->content = Input::get("content"); $data->save(); /* update paragraph type = row custum parameters */ if ('R' == Input::get("t")) { Paragraph_attrs::where('par_id', Input::get("id")) ->where('name', 'ROW_URL_TEXT') ->update(['value' => Input::get("urlText")]); Paragraph_attrs::where('par_id', Input::get("id")) ->where('name', 'ROW_URL') ->update(['value' => Input::get("url")]); } return $data->id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_parade_images_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Images', 'parade_images', 'Image'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Images', '- Hidden -', 'Image'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Images', 'Above', 'Image'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "private function saveParagraphs()\n\t{\n\t\t$arrayDescription = array();\n\t\t\n\t\tif (isset ($_REQUEST['paragraph1']))\n\t\t\t$arrayDescription[\"paragraph\"][1] = getArrayParameter($_REQUEST, \t'paragraph1');\n\t\tif (isset ($_REQUEST['paragraph2']))\n\t\t\t$arrayDescription[\"paragraph\"][2] = getArrayParameter($_REQUEST, \t'paragraph2');\n\t\tif (isset ($_REQUEST['paragraph3']))\n\t\t\t$arrayDescription[\"paragraph\"][3] = getArrayParameter($_REQUEST, \t'paragraph3');\n\t\tif (isset ($_REQUEST['paragraph4']))\n\t\t\t$arrayDescription[\"paragraph\"][4] = getArrayParameter($_REQUEST, \t'paragraph4');\n\t\tif (isset ($_REQUEST['paragraph5']))\n\t\t\t$arrayDescription[\"paragraph\"][5] = getArrayParameter($_REQUEST, \t'paragraph5');\n\t\t\t\n\t\t$this->context->updateDescription($arrayDescription);\t\t\n\t}", "function get_parade_social_links_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Social links', 'parade_social_link', 'Link'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Social links', '- Visually Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_parallax_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Background', 'parade_background', 'File'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Enable parallax', 'parade_enable_parallax', 'Boolean'],\n ['Minimum height', 'parade_minimum_height', 'Number (integer)'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Text', '- Hidden -', 'Default'],\n ['Anchor', 'Above', 'Plain text'],\n ['Background', 'Above', 'URL to file'],\n ['Color scheme', 'Above', 'Label'],\n ['Enable parallax', 'Above', 'Boolean'],\n ['Minimum height', 'Above', 'Unformatted'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_image_text_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Image', 'parade_image', 'Image'],\n ['Layout', 'parade_layout', 'Entity reference'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ['View mode', 'parade_view_mode', 'View Mode Selector'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Image', '- Hidden -', 'Image'],\n ['Text', '- Hidden -', 'Default'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'inverse' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Text', '- Hidden -', 'Default'],\n ['Image', '- Hidden -', 'Image'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Layout', 'Above', 'Label'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Call to action', 'Above', 'Call to action'],\n ['Image', 'Above', 'URL to image'],\n ['Text', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_paragraphs_types_list() {\n return [\n ['', 'Chart box', 'chart_box', ''],\n ['', 'Header', 'header', ''],\n ['', 'Images', 'images', ''],\n ['', 'Locations', 'locations', ''],\n ['', 'Parallax', 'parallax', ''],\n ['', 'Simple', 'simple', ''],\n ['', 'Social links', 'social_links', ''],\n ['', 'Text & image', 'image_text', ''],\n ['', 'Text box', 'text_box', ''],\n ['', 'Text boxes', 'text_boxes', ''],\n ];\n}", "function get_parade_text_box_paragraphs_type_data() {\n $fields = [\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Image', 'parade_image', 'Image'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Image', '- Hidden -', 'Image'],\n ['Text', '- Hidden -', 'Default'],\n ['Call to action', 'Above', 'Call to action'],\n ['Color scheme', 'Above', 'Label'],\n ],\n 'custom' => [\n ['Content'],\n ['Image', '- Hidden -', 'Image'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Text', '- Hidden -', 'Default'],\n ['Call to action', 'Above', 'Call to action'],\n ['Color scheme', 'Above', 'Label'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['No field is displayed.'],\n ['Call to action', 'Above', 'Call to action'],\n ['Image', 'Above', 'URL to image'],\n ['Text', 'Above', 'Default'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_simple_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Content', 'parade_text', 'Text (formatted, long)'],\n ['Layout', 'parade_layout', 'Entity reference'],\n ['Title', 'parade_title', 'Text (plain)'],\n ['View mode', 'parade_view_mode', 'View Mode Selector'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Content', '- Hidden -', 'Default'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'inverse' => [\n ['Content'],\n ['Content', '- Hidden -', 'Default'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Layout', 'Above', 'Label'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Content', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_text_boxes_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Boxes', 'parade_paragraphs', 'Entity reference revisions'],\n ['Boxes per row', 'parade_boxes_per_row', 'Number (integer)'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Description', 'parade_text', 'Text (formatted, long)'],\n ['Layout', 'parade_layout', 'Entity reference'],\n ['Title', 'parade_title', 'Text (plain)'],\n ['View mode', 'parade_view_mode', 'View Mode Selector'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Description', '- Hidden -', 'Default'],\n ['Boxes', '- Hidden -', 'Rendered entity'],\n ['Call to action', 'Above', 'Call to action'],\n ['Anchor', 'Above', 'Plain text'],\n ['Boxes per row', 'Above', 'Unformatted'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'custom' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Boxes', '- Hidden -', 'Rendered entity'],\n ['Anchor', 'Above', 'Plain text'],\n ['Boxes per row', 'Above', 'Unformatted'],\n ['Call to action', 'Above', 'Call to action'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['Description', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Layout', 'Above', 'Label'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Boxes per row', 'Above', 'Unformatted'],\n ['Call to action', 'Above', 'Call to action'],\n ['Boxes', 'Above', 'Rendered entity'],\n ['Description', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "public function createParagraph($type, array $values) {\n $paragraph = Paragraph::create(['type' => $type]);\n\n foreach ($values as $value) {\n $paragraph->set($value['field'], $value['value']);\n }\n\n // Migrate all paragraphs as unpublished.\n $paragraph->set('status', FALSE);\n $paragraph->save();\n return $paragraph;\n }", "public function postCreateParagraph(){\n\t\t$paraData = Input::all();\n\t\t$paraNum = (int)Input::get('num_paragraph');\n\n\t\t//This is the validation section////////////////////\n\t\t//if use alpha_num does not work, treat num_paragraph as string, max is then the string length\n\t\t$rules = array(\n\t\t\t'num_paragraph' => array('numeric', 'required', 'min:1', 'max:20')\n\t\t);\n\n\t\t$message = array(\n\t\t\t'numeric' => 'Please enter a number.',\n\t\t\t'required' => 'This field is required',\n\t\t\t'min' => 'Please enter a number larger than or equal to 1',\n\t\t\t'max' => 'Please enter a numbe less than or equal to 20'\n\t\t);\n\n\t\t$validator = Validator::make($paraData, $rules, $message);\n\n\t\tif ($validator->fails() ) {\n\t\t\treturn Redirect::to('paragraph')->withInput()->withErrors($validator);\n\n\t\t}\n\n\t\t//////////////////////////////////////////////////////////////\n\n\n\n\t\t$generator = new Badcow\\LoremIpsum\\Generator();\n\t\t$paragraphs = $generator->getParagraphs($paraNum);\n\n\t\t//modify the usage accordingly\n\t\techo '<p>'.implode('</p><p>', $paragraphs).'</p>';\n\n\t}", "function get_parade_locations_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Geofield', 'parade_geofield', 'Geofield'],\n ['Map markers', 'parade_location', 'Text (plain)'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Geofield', '- Hidden -', 'Leaflet aggregated map'],\n ['Text', '- Hidden -', 'Default'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Map markers', 'Above', 'Plain text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Inline', 'Plain text'],\n ['Geofield', 'Above', 'Leaflet aggregated map'],\n ['Map markers', 'Above', 'Plain text'],\n ['Text', 'Above', 'Default'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "public function run()\n {\n DB::table('publication_type')->insert([\n 'title' => 'Стаття у фахових виданнях України',\n 'type' => 'article',\n 'scopus_wos' => 1\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Стаття-доповідь у матеріалах наукових конференціях',\n 'type' => 'article',\n 'scopus_wos' => 1\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Інші статті',\n 'type' => 'article',\n 'scopus_wos' => 1\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Книга',\n 'type' => 'book',\n 'scopus_wos' => 1\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Посібник / Підручник',\n 'type' => 'book',\n 'scopus_wos' => 0\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Монографія',\n 'type' => 'monograph',\n 'scopus_wos' => 1\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Розділ монографії',\n 'type' => 'monograph-part',\n 'scopus_wos' => 1\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Розділ книги',\n 'type' => 'book-part',\n 'scopus_wos' => 1\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Тези доповіді',\n 'type' => 'thesis',\n 'scopus_wos' => 1\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Патент',\n 'type' => 'patent',\n 'scopus_wos' => 0\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Свідоцтво про реєстрації авторських прав на твір/рішення',\n 'type' => 'certificate',\n 'scopus_wos' => 0\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Методичні вказівки / конспекти лекцій',\n 'type' => 'methodical',\n 'scopus_wos' => 0\n ]);\n DB::table('publication_type')->insert([\n 'title' => 'Електронні видання',\n 'type' => 'electronic',\n 'scopus_wos' => 0\n ]);\n }", "function get_parade_header_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Background', 'parade_background', 'File'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Enable parallax', 'parade_enable_parallax', 'Boolean'],\n ['Lead text', 'parade_lead_text', 'Text (plain, long)'],\n ['Slogan', 'parade_secondary_title', 'Text (plain)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Slogan', '- Hidden -', 'Plain text'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Lead text', '- Hidden -', 'Plain text'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Background', 'Above', 'URL to file'],\n ['Color scheme', 'Above', 'Label'],\n ['Enable parallax', 'Above', 'Boolean'],\n ],\n // @todo: Preview.\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "public function createPostTypes()\n {\n }", "public function savePostType($post_type)\n {\n //if normal was selected - do nothing\n //if main was selected\n if ($post_type == 1){\n //check if there is a previous post with main tag and make it normal\n $current_main = Article::where('post_type', $post_type)->first();\n if ($current_main){\n $current_main->post_type = 0;\n $current_main->save();\n }\n }\n //if post up is selected\n //check if there is a previous post with post-up tag and make it normal\n //if not just change post type to post up\n if ($post_type == 2){\n //check if there is a previous post with main tag and make it normal\n $current_up = Article::where('post_type', $post_type)->first();\n if ($current_up){\n $current_up->post_type = 0;\n $current_up->save();\n }\n }\n //if post down is selected\n //check if there is a previous post with post-down tag and make it normal\n //if not just change post type to post down\n if ($post_type == 3){\n //check if there is a previous post with main tag and make it normal\n $current_down = Article::where('post_type', $post_type)->first();\n if ($current_down){\n $current_down->post_type = 0;\n $current_down->save();\n }\n }\n }", "public function processParagraphField($field,$trainee,$nid,$action) {\n\t $entity_type_id = 'paragraph';\n $bundle = 'food_chart';\n foreach ($this->entityManager->getFieldDefinitions($entity_type_id, $bundle) as $field_name => $field_definition) {\n if (!empty($field_definition->getTargetBundle())) {\n //$bundleFields[$entity_type_id][$field_name]['type'] = $field_definition->getType();\n $bundleFields[$entity_type_id][$field_name]['label'] = $field_definition->getLabel();\n $bundleFields[$entity_type_id][$field_name]['allowed_values'] = $field_definition->getSettings()['allowed_values'];\n\t if(!empty($field_definition->getDescription())) {\n\t $descArr = explode('|', $field_definition->getDescription());\n\t\t$bundleFields[$entity_type_id][$field_name]['description'] = trim($descArr[0]);\n\t\t$bundleFields[$entity_type_id][$field_name]['minChecked'] = (int)trim($descArr[1]);\n\t }\n\t else {\n\t\t$bundleFields[$entity_type_id][$field_name]['description'] = '';\n\t\t//$bundleFields[$entity_type_id][$field_name]['minChecked'] = '';\n\t }\n }\n }\n\t \n\t \n\t $paragraph_id = '';\n\t $paragraph_data = '';\n\t if($action != 'add') {\n\t\t $db_table_name = 'node__'.$field;\n\t\t $connection = $this->connection;\n\t\t $chart_query = $connection->select($db_table_name, 'fi');\n\t\t $chart_query->fields('fi', ['field_food_items_target_id']);\n\t\t $chart_query->join('node__field_tagged_trainee', 'tt', 'tt.entity_id = fi.entity_id');\n\t\t $chart_query->join('paragraphs_item', 'pi', 'pi.id = fi.field_food_items_target_id');\n\t\t $chart_query->condition('tt.field_tagged_trainee_target_id', $trainee);\n\t\t $chart_query->condition('tt.entity_id', $nid);\n\t\t $paragraph_id = $chart_query->execute()->fetchField();\n\t\t if(!empty($paragraph_id)) {\n\t\t $paragraph_data = $this->entityManager->getStorage('paragraph')->load($paragraph_id);\n\t\t }\n\t }\n\t $food_chart_form = [];\n\t foreach($bundleFields['paragraph'] as $field_name => $field_data) {\n\t $selected_values = '';\n\t $selected_values_arr = [];\n\t $options = [];\n\t if($paragraph_data) {\n\t\t$selected_values = $paragraph_data->$field_name->getValue();\n\t\tif(count($selected_values)) {\n\t\t foreach($selected_values as $values) {\n\t $selected_values_arr[] = $values['value'];\n\t\t }\n\t\t}\n\t\telse if($action == 'detail' && count($selected_values) == 0) {\n\t\t continue;\n\t\t}\n\t }\n\t foreach($field_data['allowed_values'] as $key => $value) {\n\t\tif(in_array($key, $selected_values_arr)) {\n\t\t $selected = true;\n\t\t}\n\t\telse {\n\t $selected = false;\n\t\t}\n\t\tif($action == 'detail') {\n\t if($selected == false) {\n\t\t continue;\n\t\t }\n\t\t $ui_readonly = true;\n\t }\n\t else {\n\t\t $ui_readonly = false;\n\t }\n\t\t$options[] = [\n\t\t 'name' => \"$key\",\n\t\t 'value' => $value,\n\t\t 'selected' => $selected\n\t\t];\n\t }\n\t \n\t $food_chart_form[] = [\n\t 'identifier' => 'multicheckbox',\n\t\t'label' => $field_data['label'],\n\t\t'value' => true,\n\t\t'name' => $field_name,\n\t\t'options' => $options,\n\t\t'collections' => [\n\t\t 'type' => 'multicheckbox',\n\t\t],\n\t\t'ui' => [ 'class' => \"col-sm-12\",\n\t\t 'required' => true,\n\t\t\t\t 'readonly' => $ui_readonly\n\t\t ]\n\t ];\n\t if(isset($field_data['minChecked']) && !empty($field_data['minChecked'])) {\n\t\t$food_chart_form[0]['collections']['minChecked'] = $field_data['minChecked'];\n\t\tif($action != 'detail') {\n\t\t $food_chart_form[0]['validations'][0] = [\n\t\t 'name' => 'requireCheckboxToBeChecked',\n 'message' => $field_data['description'],\n 'validator' => 'custom'\t\t \n\t\t ];\n\t\t}\n\t }\n\t \n\t }\n\t return $food_chart_form;\n }", "public function mapParagraphsType(&$entity, $field, $item_data) {\n $field_name = $field['id'];\n foreach ($field['paragraph_list'] as $para_type => $para_fields) {\n $paragraph = $this->entityTypeManager\n ->getStorage('paragraph')\n ->create(['type' => $para_type]);\n foreach ($para_fields['fields'] as $key => $para_field) {\n $this->resolveFieldTypeMapping($paragraph, $para_field, $item_data);\n }\n if(!empty($paragraph) && $entity->hasField($field_name)) {\n $entity->$field_name->appendItem($paragraph);\n }\n }\n }", "function getPType(){\n\treturn 'normal';\n}", "function pa() {\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t//-- haben wir eine edit-id, koennen wir direkt zur auswahl gehen\n\t\t\t\tif ($edit_pid) return $this->pa_type();\n\t\t\t\t//-- seitenbaum auslesen\n\t\t\t\t$root_id = (int)$this->root_id;\n\t\t\t\t$set = new NestedSet();\n\t\t\t\t$set->set_table_name($this->mod_tbl);\n\t\t\t\t$nodes = $set->getNodes($root_id, '*', $this->DB->table_restriction($this->mod_tbl));\n\t\t\t\t$this->set_var('page_nodes', $nodes);\n\t\t\t\t$this->set_var('title', e::o('v_title_1'));\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir . 'pa.php');\n\t\t\t\treturn;\n\t\t\t}", "function crear_post_type_presentaciones() {\n\t$labels = array(\n\t\t'name' => _x( 'Presentaciones', 'Post Type General Name', 'molino9' ),\n\t\t'singular_name' => _x( 'Presentacion', 'Post Type Singular Name', 'molino9' ),\n\t\t'menu_name' => __( 'Presentaciones', 'molino9' ),\n\t\t'parent_item_colon' => __( 'Presentacion Padre', 'molino9' ),\n\t\t'all_items' => __( 'Todas las Presentaciones', 'molino9' ),\n\t\t'view_item' => __( 'Ver Presentacion', 'molino9' ),\n\t\t'add_new_item' => __( 'Agregar Nuevo Presentacion', 'molino9' ),\n\t\t'add_new' => __( 'Agregar Nuevo Presentacion', 'molino9' ),\n\t\t'edit_item' => __( 'Editar Presentacion', 'molino9' ),\n\t\t'update_item' => __( 'Actualizar Presentacion', 'molino9' ),\n\t\t'search_items' => __( 'Buscar Presentacion', 'molino9' ),\n\t\t'not_found' => __( 'No encontrado', 'molino9' ),\n\t\t'not_found_in_trash' => __( 'No encontrado en la papelera', 'molino9' ),\n\t);\n\n// Otras opciones para el post type\n\n\t$args = array(\n\t\t'label' => __( 'presentaciones', 'molino9' ),\n\t\t'description' => __( 'Presentacion news and reviews', 'molino9' ),\n\t\t'labels' => $labels,\n\t\t// Todo lo que soporta este post type\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions','page-attributes','post-formats'),\n\t\t/* Un Post Type hierarchical es como las paginas y puede tener padres e hijos.\n\t\t* Uno sin hierarchical es como los posts\n\t\t*/\n\t\t'hierarchical' => true, /* Es un comportamiento como las páginas */\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 25,\n\t\t'menu_icon' => 'dashicons-format-video',\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\n\t// Por ultimo registramos el post type\n\tregister_post_type( 'presentaciones', $args );\n\n}", "public function run()\n {\n \\DB::table('types')->delete();\n\n \\DB::table('types')->insert(array(\n 0 =>\n array(\n 'id' => 1,\n 'table' => 'posts',\n 'slug' => 'about',\n 'title' => 'About Me',\n 'parent_id' => null,\n 'description' => null,\n 'note' => null,\n 'width' => null,\n 'height' => null,\n 'path' => null,\n 'source' => null,\n 'created_at' => '2017-11-10 21:48:05',\n 'updated_at' => '2017-11-10 21:48:05',\n 'deleted_at' => null,\n ),\n 1 =>\n array(\n 'id' => 2,\n 'table' => 'posts',\n 'slug' => 'interviews',\n 'title' => 'Interviews',\n 'parent_id' => null,\n 'description' => null,\n 'note' => null,\n 'width' => null,\n 'height' => null,\n 'path' => null,\n 'source' => null,\n 'created_at' => '2017-11-10 21:48:05',\n 'updated_at' => '2017-11-10 21:48:05',\n 'deleted_at' => null,\n ),\n 2 =>\n array(\n 'id' => 3,\n 'table' => 'posts',\n 'slug' => 'projects',\n 'title' => 'Projects',\n 'parent_id' => null,\n 'description' => null,\n 'note' => null,\n 'width' => null,\n 'height' => null,\n 'path' => null,\n 'source' => null,\n 'created_at' => '2017-11-10 21:48:05',\n 'updated_at' => '2017-11-10 21:48:05',\n 'deleted_at' => null,\n ),\n 3 =>\n array(\n 'id' => 4,\n 'table' => 'posts',\n 'slug' => 'tutorials',\n 'title' => 'Tutorials',\n 'parent_id' => null,\n 'description' => null,\n 'note' => null,\n 'width' => null,\n 'height' => null,\n 'path' => null,\n 'source' => null,\n 'created_at' => '2017-11-10 21:48:05',\n 'updated_at' => '2017-11-10 21:48:05',\n 'deleted_at' => null,\n ),\n 4 =>\n array(\n 'id' => 5,\n 'table' => 'posts',\n 'slug' => 'articles',\n 'title' => 'Articles',\n 'parent_id' => null,\n 'description' => null,\n 'note' => null,\n 'width' => null,\n 'height' => null,\n 'path' => null,\n 'source' => null,\n 'created_at' => '2017-11-10 21:48:05',\n 'updated_at' => '2017-11-10 21:48:05',\n 'deleted_at' => null,\n ),\n 5 =>\n array(\n 'id' => 6,\n 'table' => 'posts',\n 'slug' => 'definitions',\n 'title' => 'Definitions',\n 'parent_id' => null,\n 'description' => 'Basic or SEO targeted information like: What is AMP? Why learn AMP?',\n 'note' => null,\n 'width' => null,\n 'height' => null,\n 'path' => null,\n 'source' => null,\n 'created_at' => '2017-11-10 21:48:05',\n 'updated_at' => '2017-11-10 21:48:05',\n 'deleted_at' => null,\n ),\n 6 =>\n array(\n 'id' => 7,\n 'table' => 'posts',\n 'slug' => 'tips',\n 'title' => 'Quick Tips / Short Clips',\n 'parent_id' => null,\n 'description' => null,\n 'note' => null,\n 'width' => null,\n 'height' => null,\n 'path' => null,\n 'source' => null,\n 'created_at' => '2017-11-10 21:48:05',\n 'updated_at' => '2017-11-10 21:48:05',\n 'deleted_at' => null,\n ),\n 7 =>\n array(\n 'id' => 8,\n 'table' => 'posts',\n 'slug' => 'trailers',\n 'title' => 'Topic or Tutorial Series Trailers (Promoted Ads)',\n 'parent_id' => null,\n 'description' => null,\n 'note' => null,\n 'width' => null,\n 'height' => null,\n 'path' => null,\n 'source' => null,\n 'created_at' => '2017-11-10 21:48:05',\n 'updated_at' => '2017-11-10 21:48:05',\n 'deleted_at' => null,\n ),\n\n ));\n }", "public function run()\n {\n \n\n \\DB::table('pages')->delete();\n \n \\DB::table('pages')->insert(array (\n 0 => \n array (\n 'id' => 2,\n 'title' => 'Privacy Policy',\n 'slug' => 'privacy-policy',\n 'contents' => '<p><strong>Acceptance the Use of HireANerd Technology Pvt Ltd Terms and Conditions</strong></p>\n\n<p>By availing any service from HireANerd Technology Pvt Ltd, you&rsquo;re acknowledging the terms and conditions provided by us. Any of your access is subject to follow these terms and conditions strictly. You will not avail Intlum for any purpose which is illegal or forbidden by these terms and conditions. If you&rsquo;re availing services from Intlum Technology, that denotes the agreement with the disclaimers, terms, and conditions provided in this page. If you&rsquo;re unlikely to this terms and conditions and do not want to accept, you need to instantly stop using our service.</p>\n\n<p><strong>Credit card details</strong></p>\n\n<p>You are requested not to enter any of your Credit Card details on any form of HireANerd Technology Pvt Ltd. Because we will never ask you for Credit Card details. If you find any form, documentation or payment that requires your Credit Card details, contact Intlum before you continue.</p>\n\n<p><strong>Advice</strong></p>\n\n<p>The contents of HireANerd Technology Pvt Ltd website do not establish opinion and should not be entirely relied upon in making or refusing any decision that you make. We write as per the current standard. But you can make your decisions.</p>\n\n<p><strong>Change of Use</strong></p>\n\n<p>HireANerd Technology Pvt Ltd reserves the right to:</p>\n\n<p>Modify or Eliminate anything from its website at any point of time without any notice. And by accepting these terms and condition you&rsquo;re confirming that Intlum Technology will neither be liable for any changes done in its site, nor it needs to inform about any modification to its website. Modify the terms and conditions at any time without any prior notice. And the continuing use of your website after the modification will convey your acceptance of the changes made.</p>\n\n<p><strong>Links to Third Party Websites</strong></p>\n\n<p>HireANerd Technology Pvt Ltd Website may contain links to external websites that are coordinated and preserved by others. Any link to other websites is not an advocacy of such websites and you accept and approve that we are not accountable for the content or accessibility of any such sites.</p>\n\n<p><strong>Copyright</strong></p>\n\n<p>Copyright, trademarks and all the further intellectual property permissions in the Website and its content (including the text, design, graphics and all source codes and software linked to the Website) are possessed by or registered to HireANerd Technology Pvt Ltd or else handled by HireANerd Technology Pvt Ltd as legalized by law.<br />\nWhile accessing the HireANerd Technology Pvt Ltd website, you agree that you will access the content exclusively for your private, non-commercial practice. None of the content may be transferred, copied, duplicated, broadcasted, saved, traded or distributed without the aforementioned written agreement of the copyright owner. This keeps out the downloading, replication and/or printing of pages of the Website for private, non-commercial usage only.</p>\n\n<p><strong>Disclaimers and Limitation of Liability</strong></p>\n\n<p>The Website is delivered on AS IS and AS AVAILABLE basis without any depiction or advocacy made and deprived of assurance of any kind whether articulated or suggested, counting but not limited to the indicated warranties of suitable quality, condition for a specific reason, non-violation, compatibility, safety, and precision.&nbsp;</p>\n\n<p>As allowable by regulation, HireANerd Technology Pvt Ltd will not be accountable for any unintended or subsequent damage or harm whatever (including but not limited to loss of prospect, business, information, revenues) arising out of or regarding the Website practice.<br />\nHireANerd Technology Pvt Ltd doesn&rsquo;t assure that the functionality of the Website will be continuous or free of errors, that flaws will be modified after the post-project support period or that the Website or the server that avails it is virus-free or free of other damaging or vicious elements.<br />\nNot anything in these Terms and Conditions will be interpreted in order to discard or limit the accountability of HireANerd Technology Pvt Ltd for death or individual damage as a result of the carelessness of HireANerd Technology Pvt Ltd or that of its staffs or managers.</p>\n\n<p><strong>Indemnity</strong></p>\n\n<p>You agree to ensure, and hold HireANerd Technology Pvt Ltd and its personnel and managers safe from and against all obligations, legal charges, compensations, debits, charges and other expenditures concerning any allegation or action brought against HireANerd Technology Pvt Ltd arising out of any violation by you of these Terms and Conditions or other obligations arising out of your use of Intlum Website.</p>\n\n<p><strong>Compensation</strong></p>\n\n<p>If any of these Terms and Conditions is verified by any court of competent jurisdiction to be unacceptable, unlawful or unenforceable for any cause, then the Term or Condition will certainly be cut off and the outstanding Terms and Conditions will continue and stay in full force and result and remain to be enforceable and compulsory.</p>\n\n<p>Governing Law</p>\n\n<p>These Terms and Conditions written on HireANerd Technology Pvt Ltd will be administered by and interpreted in line with the law of USA and you hereby submit to the complete authority of the USA courts.</p>',\n 'is_active' => 1,\n 'created_at' => '2019-08-22 16:07:52',\n 'updated_at' => '2019-08-22 16:25:16',\n ),\n 1 => \n array (\n 'id' => 3,\n 'title' => 'Terms & Conditions',\n 'slug' => 'terms-conditions',\n 'contents' => '<p><strong>Acceptance the Use of HireANerd Technology Pvt Ltd Terms and Conditions</strong></p>\n\n<p>By availing any service from HireANerd Technology Pvt Ltd, you&rsquo;re acknowledging the terms and conditions provided by us. Any of your access is subject to follow these terms and conditions strictly. You will not avail Intlum for any purpose which is illegal or forbidden by these terms and conditions. If you&rsquo;re availing services from Intlum Technology, that denotes the agreement with the disclaimers, terms, and conditions provided in this page. If you&rsquo;re unlikely to this terms and conditions and do not want to accept, you need to instantly stop using our service.</p>\n\n<p>Credit card details</p>\n\n<p>You are requested not to enter any of your Credit Card details on any form of HireANerd Technology Pvt Ltd. Because we will never ask you for Credit Card details. If you find any form, documentation or payment that requires your Credit Card details, contact Intlum before you continue.</p>\n\n<p>Advice</p>\n\n<p><strong>The contents of HireANerd Technology Pvt Ltd website do not establish opinion and should not be entirely relied upon in making or refusing any decision that you make. We write as per the current standard. But you can make your decisions.</strong></p>\n\n<p>Change of Use</p>\n\n<p>HireANerd Technology Pvt Ltd reserves the right to:</p>\n\n<p>Modify or Eliminate anything from its website at any point of time without any notice. And by accepting these terms and condition you&rsquo;re confirming that Intlum Technology will neither be liable for any changes done in its site, nor it needs to inform about any modification to its website. Modify the terms and conditions at any time without any prior notice. And the continuing use of your website after the modification will convey your acceptance of the changes made.</p>\n\n<p>Links to Third Party Websites</p>\n\n<p>HireANerd Technology Pvt Ltd Website may contain links to external websites that are coordinated and preserved by others. Any link to other websites is not an advocacy of such websites and you accept and approve that we are not accountable for the content or accessibility of any such sites.</p>\n\n<p>Copyright</p>\n\n<p>Copyright, trademarks and all the further intellectual property permissions in the Website and its content (including the text, design, graphics and all source codes and software linked to the Website) are possessed by or registered to HireANerd Technology Pvt Ltd or else handled by HireANerd Technology Pvt Ltd as legalized by law.<br />\nWhile accessing the HireANerd Technology Pvt Ltd website, you agree that you will access the content exclusively for your private, non-commercial practice. None of the content may be transferred, copied, duplicated, broadcasted, saved, traded or distributed without the aforementioned written agreement of the copyright owner. This keeps out the downloading, replication and/or printing of pages of the Website for private, non-commercial usage only.</p>\n\n<p>Disclaimers and Limitation of Liability</p>\n\n<p>The Website is delivered on AS IS and AS AVAILABLE basis without any depiction or advocacy made and deprived of assurance of any kind whether articulated or suggested, counting but not limited to the indicated warranties of suitable quality, condition for a specific reason, non-violation, compatibility, safety, and precision.&nbsp;</p>\n\n<p>As allowable by regulation, HireANerd Technology Pvt Ltd will not be accountable for any unintended or subsequent damage or harm whatever (including but not limited to loss of prospect, business, information, revenues) arising out of or regarding the Website practice.<br />\nHireANerd Technology Pvt Ltd doesn&rsquo;t assure that the functionality of the Website will be continuous or free of errors, that flaws will be modified after the post-project support period or that the Website or the server that avails it is virus-free or free of other damaging or vicious elements.<br />\nNot anything in these Terms and Conditions will be interpreted in order to discard or limit the accountability of HireANerd Technology Pvt Ltd for death or individual damage as a result of the carelessness of HireANerd Technology Pvt Ltd or that of its staffs or managers.</p>\n\n<p>Indemnity</p>\n\n<p>You agree to ensure, and hold HireANerd Technology Pvt Ltd and its personnel and managers safe from and against all obligations, legal charges, compensations, debits, charges and other expenditures concerning any allegation or action brought against HireANerd Technology Pvt Ltd arising out of any violation by you of these Terms and Conditions or other obligations arising out of your use of Intlum Website.</p>\n\n<p>Compensation</p>\n\n<p>If any of these Terms and Conditions is verified by any court of competent jurisdiction to be unacceptable, unlawful or unenforceable for any cause, then the Term or Condition will certainly be cut off and the outstanding Terms and Conditions will continue and stay in full force and result and remain to be enforceable and compulsory.</p>\n\n<p>Governing Law</p>\n\n<p>These Terms and Conditions written on HireANerd Technology Pvt Ltd will be administered by and interpreted in line with the law of USA and you hereby submit to the complete authority of the USA courts.</p>',\n 'is_active' => 1,\n 'created_at' => '2019-08-22 16:22:45',\n 'updated_at' => '2019-08-22 16:23:22',\n ),\n ));\n \n \n }", "public function setup_types() {\n\n foreach ( $this->post_types as $post_type ) :\n\n $args = [\n 'hierarchical' => false,\n 'public' => true,\n 'show_in_nav_menus' => true,\n 'show_ui' => true,\n 'has_archive' => true,\n 'query_var' => true,\n 'map_meta_cap' => true,\n 'capability_type' => 'cluster',\n ];\n\n switch ( $post_type ) {\n\n case 'pedestal_story':\n $singular = esc_html__( 'Story', 'pedestal' );\n $plural = esc_html__( 'Stories', 'pedestal' );\n $class = 'Posts\\\\Clusters\\\\Story';\n $args['menu_position'] = 101;\n $args['menu_icon'] = 'dashicons-book';\n $args['supports'] = [\n 'title',\n 'thumbnail',\n 'editor',\n 'excerpt',\n 'mailchimp-integration',\n 'follow-updates',\n ];\n $args['rewrite'] = [\n 'slug' => 'stories',\n ];\n break;\n\n case 'pedestal_topic':\n $singular = esc_html__( 'Topic', 'pedestal' );\n $plural = esc_html__( 'Topics', 'pedestal' );\n $class = 'Posts\\\\Clusters\\\\Topic';\n $args['menu_position'] = 102;\n $args['menu_icon'] = 'dashicons-pressthis';\n $args['supports'] = [\n 'title',\n 'thumbnail',\n ];\n $args['rewrite'] = [\n 'slug' => 'topics',\n 'with_front' => false,\n ];\n break;\n\n case 'pedestal_person':\n $singular = esc_html__( 'Person', 'pedestal' );\n $plural = esc_html__( 'People', 'pedestal' );\n $class = 'Posts\\\\Clusters\\\\Person';\n $args['menu_position'] = 103;\n $args['menu_icon'] = 'dashicons-id-alt';\n $args['supports'] = [\n 'title',\n 'thumbnail',\n ];\n $args['rewrite'] = [\n 'slug' => 'people',\n 'with_front' => false,\n ];\n break;\n\n case 'pedestal_org':\n $singular = esc_html__( 'Organization', 'pedestal' );\n $plural = esc_html__( 'Organizations', 'pedestal' );\n $class = 'Posts\\\\Clusters\\\\Org';\n $args['menu_position'] = 104;\n $args['menu_icon'] = 'dashicons-admin-multisite';\n $args['supports'] = [\n 'title',\n 'thumbnail',\n ];\n $args['rewrite'] = [\n 'slug' => 'organizations',\n 'with_front' => false,\n ];\n break;\n\n case 'pedestal_place':\n $singular = esc_html__( 'Place', 'pedestal' );\n $plural = esc_html__( 'Places', 'pedestal' );\n $class = 'Posts\\\\Clusters\\\\Geospaces\\\\Place';\n $args['menu_position'] = 105;\n $args['menu_icon'] = 'dashicons-location';\n $args['supports'] = [\n 'title',\n 'thumbnail',\n ];\n $args['rewrite'] = [\n 'slug' => 'places',\n 'with_front' => false,\n ];\n break;\n\n case 'pedestal_locality':\n $singular = esc_html__( 'Locality', 'pedestal' );\n $plural = esc_html__( 'Localities', 'pedestal' );\n $class = 'Posts\\\\Clusters\\\\Geospaces\\\\Localities\\\\Locality';\n $args['menu_position'] = 106;\n $args['menu_icon'] = 'dashicons-location-alt';\n $args['supports'] = [\n 'title',\n 'thumbnail',\n 'editor',\n 'excerpt',\n ];\n $args['rewrite'] = [\n 'slug' => '%locality_type%',\n 'with_front' => false,\n ];\n $args['has_archive'] = false;\n break;\n\n }// End switch().\n\n $post_types[ $post_type ] = compact( 'singular', 'plural', 'class', 'args' );\n\n endforeach;\n\n $this->post_types = $post_types;\n\n }", "function pa_type_DEP_130707() \n\t\t\t{\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t//-- haben wir keine edit-id, gibts eine seiten-tabelle zur auswahl\n\t\t\t\tif (!$edit_pid) return $this->pa();\n\t\t\t\t$this->set_var('edit_pid', $edit_pid);\n\t\t\t\t//-- der seitenpfad erscheint immer\n\t\t\t\t$this->set_var('show_path',$this->show_path($edit_pid));\n\t\t\t\t//-- vorhandene module lesen\n\t\t\t\t$mods = $this->MC->get_mods();\n\t\t\t\t//-- auslesen, fuer welche module rechte vergeben wurden\n\t\t\t\t$known_mods = $this->MC->get_page_mods($edit_pid);\n\t\t\t\t//-- seitenbaum auslesen\n\t\t\t\t$root_id = (int)$this->root_id;\n\t\t\t\t$set = new NestedSet();\n\t\t\t\t$set->set_table_name($this->mod_tbl);\n\t\t\t\t$nodes = $set->getNodes($root_id, '*', $this->DB->table_restriction($this->mod_tbl));\n\t\t\t\t$this->set_var('page_nodes', $nodes);\n\t\t\t\t$this->set_var('known_mods', $known_mods);\n\t\t\t\t$this->set_var('mod_list', $mods);\n\t\t\t\t$this->set_var('table_name', $this->mod_tbl);\n\t\t\t\t$this->set_var('title',e::o('v_title_2'));\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir . 'pa_type.php');\n\t\t\t}", "function publications(){\r\n\tregister_post_type('publication', array(\r\n\t'supports' => array('title', 'editor', 'excerpt'),\r\n\t'rewrite' => array('slug' => 'publications'),\r\n\t'has_archive' => true,\r\n\t'public' => true,\r\n\t'labels' => array(\r\n\t\t'name'=> 'Publications',\r\n\t\t'add_new_item' => 'Add New Publication',\r\n\t\t'edit_item' => 'Edit Publication',\r\n\t\t'singular' => 'Publication'\r\n\t),\r\n\t'menu_icon' => 'dashicons-book-alt'));\r\n}", "public function run()\n {\n $standardType = PageType::create([\n 'model' => 'PageStandard',\n 'vue_component' => 'PageStandard.vue',\n 'template' => 'Standard',\n ]);\n\n $specialType = PageType::create([\n 'model' => 'PageSpecial',\n 'vue_component' => 'PageSpecial.vue',\n 'template' => 'Special',\n ]);\n\n for ($i = 0; $i <= 4; $i++) {\n if ($i === 0 || $i === 4) {\n ${\"page_\" . $i} = PageSpecial::create(['special_field' => 'special field value ' . $i]);\n }\n else {\n ${\"page_\" . $i} = PageStandard::create(['standard_field' => 'standard field value ' . $i]);\n }\n }\n\n $mainPage = Page::create(['title' => 'Main page']);\n $mainPage->wrap($specialType, $page_0, $node = false);\n\n $childPage1 = Page::create(['title' => 'child page one']);\n $childPage1->wrap($standardType, $page_1, $mainPage);\n $childPage1->appendToNode($mainPage)->save();\n\n $childPage2 = Page::create(['title' => 'child page two']);\n $childPage2->wrap($standardType, $page_2, $mainPage);\n $childPage2->appendToNode($mainPage)->save();\n\n $grandChildPage3 = Page::create(['title' => 'grand child page one']);\n $grandChildPage3->wrap($standardType, $page_3, $childPage1);\n $grandChildPage3->appendToNode($childPage1)->save();\n\n $grandChildPage4 = Page::create(['title' => 'grand child page two']);\n $grandChildPage4->wrap($specialType, $page_4, $childPage2);\n $grandChildPage4->appendToNode($childPage2)->save();\n\n }", "function tpps_details_phenotype(array &$state) {\n $params = drupal_get_query_parameters($_POST);\n $page = 0;\n if (!empty($params['page'])) {\n $page = $params['page'];\n }\n $rows = array();\n $per_page = 20;\n $start = $page * $per_page;\n\n $query = db_select('chado.phenotype', 'p');\n $query->join('chado.stock_phenotype', 'sp', 'sp.phenotype_id = p.phenotype_id');\n $query->join('chado.project_stock', 'ps', 'ps.stock_id = sp.stock_id');\n $query->join('chado.stock', 's', 's.stock_id = sp.stock_id');\n $query->addExpression('count(p.phenotype_id)', 'count');\n $query->condition('ps.project_id', $state['ids']['project_id']);\n $query = $query->execute();\n $total = $query->fetchObject()->count;\n\n $_GET['page'] = $page;\n pager_default_initialize($total, $per_page);\n\n $query = db_select('chado.phenotype', 'p');\n $query->join('chado.stock_phenotype', 'sp', 'sp.phenotype_id = p.phenotype_id');\n $query->join('chado.project_stock', 'ps', 'ps.stock_id = sp.stock_id');\n $query->join('chado.stock', 's', 's.stock_id = sp.stock_id');\n $query->fields('p', array(\n 'phenotype_id',\n 'name',\n 'attr_id',\n 'observable_id',\n 'value',\n ));\n $query->fields('s', array('uniquename', 'stock_id'));\n $query->condition('ps.project_id', $state['ids']['project_id']);\n $query->range($start, $per_page);\n $query = $query->execute();\n\n // $query = db_select('chado.new_pheno_view_update', 'p');\n // $query->addField('p', 'phenotype_id', 'phenotype_id');\n // $query->addField('p', 'synonym', 'name');\n // $query->addField('p', 'structure_id', 'attr_id');\n // $query->addField('p', 'observable_id', 'observable_id');\n // $query->addField('p', 'value', 'value');\n // $query->addField('p', 'tree_acc', 'uniquename');\n // $query->addField('p', 'stock_id', 'stock_id');\n // $query->condition('p.project_id', $state['ids']['project_id']);\n // $query->range($start, $per_page);\n // $query = $query->execute();\n\n while (($result = $query->fetchObject())) {\n // preg_match('/^TGDR...-(.*)$/', $result->uniquename, $matches);\n preg_match('/^TGDR.{1,4}-(.*)$/', $result->uniquename, $matches);\n $tree = $matches[1];\n $obs = chado_get_cvterm(array(\n 'cvterm_id' => $result->observable_id,\n ))->name ?? \"\";\n $attr = chado_get_cvterm(array(\n 'cvterm_id' => $result->attr_id,\n ))->name ?? \"\";\n\n $rows[] = array(\n tpps_entity_link($result->stock_id, $tree, 'Stock'),\n tpps_entity_link($result->phenotype_id, $result->name, 'Phenotype'),\n $attr,\n $obs,\n $result->value,\n );\n }\n\n $vars = array(\n 'header' => array(\n 'Plant',\n 'Name',\n 'Attribute',\n 'Entity',\n 'Value',\n ),\n 'rows' => $rows,\n 'attributes' => array(\n 'class' => array('view'),\n 'id' => 'tpps_table_display',\n ),\n 'caption' => '',\n 'colgroups' => NULL,\n 'sticky' => FALSE,\n 'empty' => '',\n );\n $table = theme('table', $vars);\n $pager = theme('pager', array('quantity', $total));\n return $pager . $table;\n}", "function bsdchild_cpt_promotions() {\n\tregister_post_type( 'promotions',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Promotions' ),\n\t\t\t\t'singular_name' => __( 'Promotion' ),\n\t\t\t\t'add_new' => __( 'Add Promotion' ),\n\t\t\t\t'add_new_item' => __( 'Add a Promotion' )\n\t\t\t),\n\t\t\t'menu_icon' => 'dashicons-megaphone',\n\t\t\t'public' => true,\n\t\t\t'has_archive' => false,\n\t\t\t'supports' => array (\n\t\t\t\t'title',\n\t\t\t\t'thumbnail',\n\t\t\t\t'page-attributes',\n\t\t\t\t'editor'\n\t\t\t),\n\t\t)\n\t);\n\n}", "public function run()\n {\n $page = Page::create([\n 'name' => 'Landingpage APpxi',\n 'slug' => 'landingpage-appxi',\n 'description' => 'Pagina de Destino para Appxi',\n 'direction' => 'welcome',\n 'user_id' => 1,\n 'details' => null\n ]);\n\n\n //-------------------- PAges-----------\n $page = Page::create([\n 'name' => 'Politicas & Privacidad',\n 'slug' => 'policies',\n 'user_id' => 1,\n 'direction' => 'pages.generica',\n 'description' => 'Pagina para las politicas & seguridad'\n ]);\n $count = 1;\n Block::create([\n 'name' => 'body',\n 'title' => 'Blocke Generico',\n 'description' => 'Blocke Generico para Paginas',\n 'page_id' => $page->id,\n 'position' => $count++,\n 'type' => 'dinamyc-data',\n 'details' => json_encode([\n 'body' => [\n 'type' => 'rich_text_box',\n 'name' => 'body',\n 'label' => 'Editor HTML',\n 'value' => null,\n 'width' => 12\n ]\n ])\n ]);\n \n $page = Page::create([\n 'name' => 'Terminos & Condiones',\n 'slug' => 'terms',\n 'user_id' => 1,\n 'direction' => 'pages.generica',\n 'description' => 'Pagina para los terminos y condiciones'\n ]);\n $count = 1;\n Block::create([\n 'name' => 'body',\n 'title' => 'Blocke Generico',\n 'description' => 'Blocke Generico para Paginas',\n 'page_id' => $page->id,\n 'position' => $count++,\n 'type' => 'dinamyc-data',\n 'details' => json_encode([\n 'body' => [\n 'type' => 'rich_text_box',\n 'name' => 'body',\n 'label' => 'Editor HTML',\n 'value' => null,\n 'width' => 12\n ]\n ])\n ]);\n\n }", "function propuestasPostType() {\n\t$supports = array(\n\t'title', // post title\n\t'editor', // post content\n\t'author', // post author\n\t'thumbnail', // featured images\n\t'excerpt', // post excerpt\n\t'custom-fields', // custom fields\n\t// 'comments', // post comments\n\t// 'revisions', // post revisions\n\t'post-formats', // post formats\n\t'page-attributes'\n\t);\n\t$labels = array(\n\t'name' => _x('Propuesta', 'plural'),\n\t'singular_name' => _x('Propuestas', 'singular'),\n\t'menu_name' => _x('Propuestas', 'admin menu'),\n\t'name_admin_bar' => _x('Propuestas', 'admin bar'),\n\t'add_new' => _x('Añadir propuesta', 'add new'),\n\t'add_new_item' => __('Añadir nueva propuesta'),\n\t'new_item' => __('Nueva propuesta'),\n\t'edit_item' => __('Editar propuesta'),\n\t'view_item' => __('Ver propuesta'),\n\t'all_items' => __('Todas las propuestas'),\n\t'search_items' => __('Buscar'),\n\t'not_found' => __('No hay resultados.'),\n\t);\n\t$args = array(\n\t'supports' => $supports,\n\t'labels' => $labels,\n\t'public' => true,\n\t'query_var' => true,\n\t'rewrite' => array('slug' => 'propuestas'),\n\t'has_archive' => true,\n\t'hierarchical' => true,\n\t);\n\tregister_post_type('propuestasPostType', $args);\n\t}", "public function run()\n {\n DocumentType::create([\n 'document_type_name' => 'Surat Izin Pengedar',\n 'is_permit' => 0,\n ]);\n\n DocumentType::create([\n 'document_type_name' => 'SIUP/IUT',\n 'is_permit' => 0,\n ]);\n\n DocumentType::create([\n 'document_type_name' => 'Foto Lingkungan Perusahaan',\n 'is_permit' => 0,\n ]);\n\n DocumentType::create([\n 'document_type_name' => 'Surat Permohonan',\n 'is_permit' => 1,\n ]);\n\n DocumentType::create([\n 'document_type_name' => 'Dokumen Asal Usul',\n 'is_permit' => 1,\n ]);\n\n DocumentType::create([\n 'document_type_name' => 'Dokumen Izin Impor',\n 'is_permit' => 3,\n ]);\n\n DocumentType::create([\n 'document_type_name' => 'Form C',\n 'is_permit' => 4,\n ]);\n\n DocumentType::create([\n 'document_type_name' => 'BAP Stok Ekspor',\n 'is_permit' => 4,\n ]);\n\n DocumentType::create([\n 'document_type_name' => 'Dokumen Lainnya',\n 'is_permit' => 5,\n ]);\n\n DocumentType::create([\n 'document_type_name' => 'Dokumen Re-Upload',\n 'is_permit' => 2,\n ]);\n\n DocumentType::create([\n 'document_type_name' => 'Surat Permohonan',\n 'is_permit' => 2,\n ]);\n }", "function generate() {\n\t\t// List of post types to generate content\n\t\t$types = array(); \n\n\t\t// Per-type content \n\t\t$lorems = array();\n\t\t$photos = array();\n\n\t\t// Per-type per-post content counts\n\t\t$nposts = array();\n\t\t$nparas = array();\n\t\t$nphotos = array();\n\n\t\t// Post titles\n\t\t$titles = array();\n\n\t\t// Time spread of posts\n\t\t$months = $this->option( 'spread' );\n\n\t\t// Total counts\n\t\t$totalposts = 0;\n\t\t$total_text = 0;\n\t\t$total_photos = 0;\n\n\t\t$this->result( \"<p>Generating dummy content...</p>\" );\n\n\t\t$post_types = $this->param( 'post_types' );\n\t\tif( !$post_types ) $post_types = array();\n\n\t\t// Get Lorem content for each post type given the options\n\t\tforeach( $post_types as $type ) {\n\t\t\t$lengths = array();\n\n\t\t\t$type_nposts = $this->param( 'post_type_count', $type ); \n\t\t\t$nposts[$type] = is_numeric( $type_nposts ) ? $type_nposts : 0;\n\n\t\t\t$type_nparas = $this->param( 'post_type_paragraphs', $type );\n\t\t\t$nparas[$type] = is_numeric( $type_nparas ) ? $type_nparas : 0;\n\t\t\t\n\t\t\tif($nposts[$type] <= 0 || $nparas[$type] <= 0) $errors[] = \"Invalid parameters for $type\";\n\n\t\t\t$contents = array();\n\t\t\t$lorems[$type] = array();\n\n\t\t\t$type_contents = $this->param( 'post_content', $type );\n\t\t\tif( count( $type_contents ) ) {\n\t\t\t\tforeach( $type_contents as $content ) {\n\t\t\t\t\tif( $content == 'lists' ) $contents = array_merge($contents, array('ul', 'ol', 'dl'));\n\t\t\t\t\telse $contents[] = $content;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$type_lengths = $this->param( 'post_length', $type );\n\t\t\t\n\t\t\tif( count( $type_lengths ) ) {\n\t\t\t\t$num = $nparas[$type];\n\n\t\t\t\twhile($num > 0) {\n\t\t\t\t\tforeach( $type_lengths as $length ) {\n\t\t\t\t\t\t$rand = rand(1, $num - 1);\n\t\t\t\t\t\t$lengths[$length] += $rand;\n\t\t\t\t\t\t$num -= $rand;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$type_post_kind = $this->param( 'post_kind', $type );\n\n\t\t\tif( in_array( 'simple', $type_post_kind ) ) {\n\t\t\t\tif( count($lengths) ) {\n\t\t\t\t\tforeach( $lengths as $size => $count ) {\n\t\t\t\t\t\t$this->result( '<p>Gathering <strong>' . esc_html( $count ) . '</strong> paragraphs of <strong>' . esc_html( $size ) . '</strong> length for <strong>' . esc_html( $type ) . '</strong> posts...</p>' );\n\t\t\t\t\t\t$result = wp_remote_get( 'http://loripsum.net/api/' . $count . '/' . implode( '/', $contents ) . '/' . $size );\n\t\t\t\t\t\t$lorems[$type] = array_merge($lorems[$type], explode(\"\\n\\n\", trim($result['body'])));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif($type == \"page\") {\n \t$this->result( '<p>Gathering <strong>' . esc_html( $numparas ) . '</strong> paragraphs for <strong>' . esc_html( $type ) . '</strong> posts...</p>' );\n \t$result = wp_remote_get( 'http://loripsum.net/api/' . implode( '/', $contents ) . '/' . $nparas[$type] );\n \t$lorems[$type] = explode( \"\\n\\n\", trim( $result['body'] ) );\n \t}\n if($type == \"post\") {\n $this->result( '<p>Gathering <strong>' . esc_html( $numparas ) . '</strong> paragraphs for <strong>' . '</strong> posts...</p>' );\n \t$result = wp_remote_get( 'http://loripsum.net/api/' . implode( '/', $contents ) . '/' . $nparas[$type] );\n \t$lorems[$type] = explode( \"\\n\\n\", trim( $result['body'] ) );\n }\n\t\t\t\t}\n\t\t\t\t$total_text += count( $lorems[$type] );\n\t\t\t}\n\n\t\t\tif( in_array( 'photos', $type_post_kind ) ) {\n\t\t\t\t$nphotos[$type] = $this->param( 'post_type_photos', $type );\n\t\t\t\t$total_photos += $nphotos[$type] * $nposts[$type];\n\t\t\t}\n\n\t\t\t$totalposts += $nposts[$type];\n\t\t\t$types[] = $type;\n\t\t}\n\n\t\tif( $totalposts > 0 ) {\n\t\t\t$this->result( '<p>Gathering <strong>' . esc_html( $totalposts ) . '</strong> tidbits for post titles...</p>' );\n\n\t\t\t$titles = $this->gather($totalposts, 10);\n\t\t}\n\n\t\tif( $total_photos > 0 ) {\n\t\t\tif( $this->option( 'flickrkey' ) ) {\n\t\t\t\t$this->result( '<p>Gathering <strong>' . esc_html( $total_photos ) . '</strong> photos from flickr for post images...</p>' );\n\t\t\t\t\t\n\t\t\t\t$photos = $this->gatherphotos($total_photos);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->result( \"<p>Can't gather photos from flickr because: no flickr app key specified.</p>\" );\n\t\t\t}\n\t\t}\n\n\t\tif( $total_text > 0 ) {\n\t\t\t$this->result( \"<p>Text content generated. Lorem Ipsum generated from <a href='http://loripsum.net/#info'>LorIpsum.net</a>...</p>\\n\" );\n\t\t} else {\n\t\t\t$this->result( \"<p>No post text content generated.</p>\" );\n\t\t}\n\n\t\t// Process and gather taxonomy options\n\t\t$totalterms = 0;\n\t\t$connections = array();\n\t\t$newterms = array();\n\t\t$create_taxonomies = $this->param( 'taxonomies' );\n\t\tif( !$create_taxonomies ) $create_taxonomies = array();\n\n\t\tforeach( $create_taxonomies as $tax ) {\n\t\t\t$nterms = (int) $this->param( 'taxonomy_count', $tax );\n\n\t\t\tif($nterms > 0)\n\t\t\t\t$totalterms += $nterms;\n\t\t\telse $nterms = 0;\n\n\t\t\tif($links <= 0 && $nterms <= 0) {\n\t\t\t\t$errors[] = \"No terms created for taxonomy <strong>$tax</strong>\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t$newterms[$tax] = $nterms;\n\t\t}\n\n\t\t$link_make_connections = $this->param( 'make_connections' );\n\t\tif( !$link_make_connections ) $link_make_connections = array();\n\n\t\tforeach( $link_make_connections as $tax ) {\n\t\t\t$links = $this->param( 'connections', $tax );\n\n\t\t\tif($links > 0) {\n\t\t\t\t$connections[$tax] = array();\n\t\t\t\t$connect_tax_types = $this->param( 'connect_type', $tax );\n\t\t\t\tif( empty( $connect_tax_types ) )\n\t\t\t\t\t$connect_tax_types = $this->post_types();\n\t\t\t\telse\n\t\t\t\t\t$connect_tax_types = $connect_tax_types;\n\n\t\t\t\tforeach( $connect_tax_types as $type ) \n\t\t\t\t\t$connections[$tax][$type] = $links;\n\t\t\t}\n\t\t}\n\n\t\tif( $totalterms > 0 )\t {\n\t\t\t$this->result( \"<p>Gathering <strong>$totalterms</strong> tidbits for taxonomy terms...</p>\" );\n\n\t\t\t$terms = $this->gather( $totalterms, -3 );\n\t\t}\n\t\t\n\t\tforeach( $types as $type ) {\n\t\t\tunset( $photo );\n\t\t\t\n\t\t\tif($type == \"page\") {\n \t$this->result( \"<p>Generating {$nposts[$type]} <strong>$type</strong> posts...</p>\" );\n }\n if($type == \"post\") {\n \t$this->result( \"<p>Generating {$nposts[$type]} posts...</p>\" );\n }\n\t\t\t$alignments = $this->param( 'photo_align', $type );\n\n\t\t\tif( empty( $alignments ) )\n\t\t\t\t$alignments = array( 'left','right','center','' );\n\n\t\t\t$sizes = array(); \n\n\t\t\t$type_photo_size = $this->param( 'photo_size', $type );\n\t\t\tif( is_array( $type_photo_size ) ) foreach( $type_photo_size as $size ) \n\t\t\t\tif( preg_match( '/^t|m|z$/', $size ) ) $sizes[] = substr( $size, 0, 1 );\n\n\t\t\tif( empty( $sizes ) ) \n\t\t\t\t$sizes = array( 't', 'm', 'z' );\n\n\t\t\tfor( $i = 0; $i < $nposts[ $type ]; $i++ ) {\n\t\t\t\t$paras = array();\n\t\t\t\t$copy = $lorems[ $type ];\n\t\t\t\t// Generate number of paragraphs specified +- 20%\n\t\t\t\t$num = $nparas[ $type ] + (rand(0, ceil($nparas[ $type ] * .4)) - floor($nparas[ $type ] * .2));\n\t\t\t\tfor( $j = 0; $j < $num; $j++ ) {\n\t\t\t\t\t// Reset copy of $lorems if we've run out of paragraphs\n\t\t\t\t\tif(count($copy) == 0) $copy = $lorems[ $type ];\n\t\t\t\t\t$para = implode('', array_splice($copy, rand(0, count($copy) - 1), 1));\n\t\t\t\t\t$paras[] = $para;\n\t\t\t\t}\n\t\t\t\tif( isset( $photos ) && !empty( $photos ) && $nphotos[$type] > 0 ) {\n\t\t\t\t\t$copy = $photos;\n\t\t\t\t\t$num = $nphotos[$type] + (rand(0, ceil($nphotos[$type] * .4)) - floor($nphotos[$type] * .2));\n\t\t\t\t\t\n\t\t\t\t\tfor($j = 0; $j < $num; $j++) {\n\t\t\t\t\t\t$photo = implode('', array_splice($copy, mt_rand(0, count($copy) - 1), 1));\n\t\t\t\t\t\t$photo = sprintf( $photo, $sizes[(int)mt_rand(0,count($sizes)-1)] );\n\t\t\t\t\t\t$align = $alignments[(int)mt_rand(0,count($alignments)-1)];\n\t\t\t\t\t\tif( $align ) $align = 'class=\"align' . esc_attr( $align ) . '\"';\n\t\t\t\t\t\tarray_splice( $paras, rand( 0, count( $paras ) - 1 ), 0, array( '<img $align src=\"' . esc_attr( $photo ) . '\" />' ) );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$title = implode('', array_splice($titles, rand(0, count($titles) - 1), 1));\n\t\t\t\tif( $title ) {\n\t\t\t\t\t$post_data = array(\n\t\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t\t'post_type' => $type,\n\t\t\t\t\t\t'post_content' => implode(\"\\n\\n\", $paras),\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'post_author' => 1,\n\t\t\t\t\t\t'post_date' => date('Y-m-d H:i:s', time() - (mt_rand()/mt_getrandmax())*(60*60*24*30*$months))\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$post_ID = wp_insert_post( $post_data );\n\t\t\t\t\t\n\t\t\t\t\tupdate_post_meta( $post_ID, $this->meta_key_dummy, 1 );\n\t\t\n\t\t\t\t\t$post = get_post( $post_ID );\n\t\t\t\t\t\n\t\t\t\t\tif( $post ) {\n\t\t\t\t\t\t$result_message = '<a target=\"postPreview\" href=\"' . get_permalink( $post->ID ) . '\">Post ID #'. esc_html( $post->ID ) . ': ' . esc_html( $post->post_title ) . '</a> <strong>' . esc_html( $type ) . '</strong> #' . esc_html( $i + 1 ) . ' (' . esc_html( $num ) . ' paragraphs)';\n\n\t\t\t\t\t\tif( isset( $photo ) && $this->param( 'photo_featured', $type ) ) {\n\t\t\t\t\t\t\t$attachment_id = $this->sideload( $photo, $post );\n\n\t\t\t\t\t\t\tif( is_wp_error( $attachment_id ) || !$attachment_id ) {\n\t\t\t\t\t\t\t\t$result_message .= ', failed to download featured image at URL <em>' . esc_url( $photo ) . '</em>: ' . esc_html( $attachment_id->get_error_message() );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_ID, '_thumbnail_id', $attachment_id );\n\t\t\t\t\t\t\t\t$result_message .= ', featured image: ' . esc_url( $photo ) . ', attachment #' . esc_html( $attachment_id );\n\t\t\t\t\t\t\t\tupdate_post_meta( $attachment_id, $this->meta_key_dummy, 1 );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->result( '<p><a href=\"#post-$post->ID\" onclick=\"preview($post->ID)\">' . $result_message . ' (preview)</a></p>' );\n\t\t\t\t\t\t$this->result( '<div id=\"' . esc_attr( \"post-$post->ID\" ) . '\" style=\"height: 0; overflow: hidden\">' . apply_filters( 'the_content', $post->post_content ) . '</div>' );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->result( \"<p>Stupid! I couldn't come up with a title!!</p>\" );\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t$created_terms = get_option( 'oomph_dummy_terms' );\n\n\t\tif( !$created_terms ) $created_terms = array();\n\n\t\tforeach( $newterms as $tax => $count ) {\n\t\t\t$this->result( '<p>Creating <strong>' . esc_html( $count ) . '</strong> terms for taxonomy <strong>' . esc_html( $tax ) . '</strong></p>' );\n\t\t\t$created_terms[ $tax ] = array();\n\t\t\t$this->result( '<ul class=\"term-list\">' );\n\t\t\tfor($i = 0; $i < $count; $i++ ) {\n\t\t\t\t$term = implode('', array_splice($terms, mt_rand(0, count($terms) - 1), 1));\n\t\t\t\t$result = wp_insert_term( $term, $tax ); \n\t\t\t\t\n\t\t\t\t// Since there's no taxonomy meta, we've got to save all of the created terms\n\t\t\t\t// into an options field\n\t\t\t\tif( !is_wp_error( $result ) )\n\t\t\t\t\t$created_terms[ $tax ][] = $result['term_id'];\n\n\t\t\t\t$this->result( '<li>' . esc_html( $term ) . '</li>' );\n\t\t\t}\n\t\t\t$this->result( '</ul>' );\n\t\t}\n\n\t\tupdate_option( 'oomph_dummy_terms', $created_terms );\n\n\t\tforeach( $connections as $tax => $types ) {\n\t\t\t$terms = get_terms( $tax, array( 'hide_empty' => false, 'exclude' => $this->param( 'ignore_default', $tax ) ? 1 : 0 ) );\n\n\t\t\tforeach( $types as $type => $count ) {\n\t\t\t\t$this->result( '<p>Creating <strong>' . esc_html( $count ) . '</strong> connections from taxonomy <strong>' . esc_html( $tax ) . '</strong> to <strong>' . esc_html( $type ) . '</strong> posts...</p>' );\n\n\t\t\t\t$post_query = \"post_type=$type&orderby=rand&posts_per_page=-1\";\n\n\t\t\t\t$reset = false;\n\t\t\t\t// Special case for categories: Only assign new categories to posts in Uncategorized, or ID 1\n\t\t\t\tif( $type == 'post' && $tax == 'category' ) {\n\t\t\t\t\t$reset = true;\n\t\t\t\t\t$post_query .= '&category=1';\n\t\t\t\t}\n\n\t\t\t\t$posts = get_posts( $post_query );\n\n\t\t\t\t$this->result( \"<ol>\" );\n\t\t\t\tforeach($posts as $post) {\n\t\t\t\t\tfor($i = 0; $i < $count; $i++) {\n\t\t\t\t\t\t$term = array_slice( $terms, mt_rand( 0, count( $terms ) ) - 1, 1 );\n\t\t\t\t\t\t$this->result( \"<li>({$post->ID}) {$post->post_name} -> ({$term[0]->term_id}) {$term[0]->name}</li>\\n\" );\n\t\t\t\t\t\twp_set_object_terms( $post->ID, (int)$term[0]->term_id, $tax, !($reset && $i == 0) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->result( \"</ol>\" );\n\t\t\t}\n\t\t}\n\n\t\tif( isset( $errors ) && count( $errors ) ) print_r( $errors );\n\n\t\t$this->result( \"<h3>Done!</h3>\" );\n\t\t$this->result( \"<p>Enjoy your new dummy content!</p>\" );\n\n\t\tif( $this->async ) \n\t\t\t$this->dummy_content_count();\n\t}", "function createPages($pathToFolder, $pathToXML){\n $handle = fopen($pathToXML, 'r');\n $data = file_get_contents($pathToXML);\n $data = str_replace(' ', '', $data);\n $data = str_replace('<', '[', $data);\n $data = str_replace('>', ']', $data);\n file_put_contents($pathToXML, $data);\n $i=0;\n if ($handle)\n {\n //initializing all the variables needed to create the page and to keep in memory the strings of the old and new titles.\n $title;\n $oldTitle;\n $belongsTo=\"\";\n $contains=\"\";\n $content=\"\";\n $currentType=\"\";\n $titleLang=\"\";\n $fileOrga;\n while (!feof($handle)){\n $buffer = fgets($handle);\n \n if(!isset($fileOrga)){\n $temp = $this->checkFileOrganisation($buffer);\n if($temp!='continue'){\n $fileOrga=$temp;\n }\n }\n\n if(isset($fileOrga)){\n if($fileOrga==\"rdfWNames\"){ \n $currentType = $this->checktype($buffer);\n if($currentType=='title'){\n if(!isset($title))$title=$this->get_string_between($buffer, '#', '\"');\n if($title!=$this->get_string_between($buffer, '#', '\"')){\n $pageArray = array(0=>$title, 1=>$content, 2=>$belongsTo); \n $this->createPage($pathToFolder, $pageArray);\n $content=\"\";\n $belongsTo=\"\"; \n $title=$this->get_string_between($buffer, '#', '\"');\n }\n }\n\n if($currentType=='content'){\n $content=$content.\" contient \".$this->get_string_between($buffer, ']', '[/');\n }\n\n if($currentType=='belongsTo'){\n if($_SESSION['viki']===\"true\"){\n $belongsTo=$belongsTo.\" is a subclass from \".$_SESSION['url'].str_replace(' ', '', $this->get_string_between($buffer, '#', '\"'));\n }\n else{\n $belongsTo=$belongsTo.\" is a subclass from \".$this->get_string_between($buffer, '#', '\"');\n }\n }\n }\n \n if($fileOrga==\"rdfWONames\"){\n $currentType = $this->checktype($buffer);\n if(!$currentType!='continue'){\n if($currentType=='eoc'){\n $pageArray = array(0=>$title, 1=>$content, 2=>$belongsTo); \n $this->createPage($pathToFolder, $pageArray);\n $content=\"\";\n $belongsTo=\"\";\n $title=\"\"; \n $titleLang=\"\";\n }\n if($currentType=='title'){\n if($titleLang==\"en\" || $titleLang==\"\"){\n if(strpos($buffer, '\"fr\"')){\n $titleLang=\"fr\";\n }else{\n $titleLang==\"en\";\n }\n $title=$this->get_string_between($buffer, ']', '[/');\n }\n }\n if($currentType=='content' && !strpos(str_replace(\":\", \"\", $buffer), \"rdfresource\")){\n $content=$content.$this->get_string_between($buffer, ']', '[/').\"\\n\";\n }\n\n if($currentType=='belongsTo'){\n $belongsToTitle=$this->checkIfSubclassIsInFile($pathToXML, $this->get_string_between($buffer, '=\"', '\"/'));\n if($belongsToTitle!='fail'){\n if($_SESSION['viki']===\"true\"){\n $belongsTo=$belongsTo.\" is a subclass from\".$_SESSION['url'].str_replace(' ', '', $belongsToTitle);\n }\n else\n $belongsTo=$belongsTo.\" is a subclass from \".$belongsToTitle.\"\\n\";\n }\n if($belongsToTitle==\"fail\"){\n $tmp = $this->get_string_between($buffer, '=\"', '\"/');\n $belongsTo=$belongsTo.\" is a subclass from \".$tmp.\"\\n\";\n }\n }\n }\n }\n }\n }\n fclose($handle);\n } \n }", "public function run()\n {\n $itens = ['text','boolean','file','select','textarea'];\n\n foreach ($itens as $key => $item) {\n Type::create(['name'=>$item]);\n }\n\n $itens = [\n [\n 'name' => 'Nome Aplicação',\n 'description' => 'Nome da aplicação',\n 'slug' => str_slug('Nome Aplicacao', '.'),\n 'value' => 'Imobiliária',\n 'type_id' => 1,\n 'can_drop' => false\n ],\n [\n 'name' => 'Logo Aplicação',\n 'description' => 'Logo da Aplicação',\n 'slug' => str_slug('Logo Aplicacao', '.'),\n 'value' => '/',\n 'type_id' => 3,\n 'can_drop' => false\n ],\n [\n 'name' => 'Background Login Aplicação',\n 'description' => 'Background do Login da Aplicação',\n 'slug' => str_slug('Background login Aplicacao', '.'),\n 'value' => '/',\n 'type_id' => 3,\n 'can_drop' => false\n ],\n [\n 'name' => 'Background Aplicação',\n 'description' => 'Background da Aplicação',\n 'slug' => str_slug('Background Aplicacao', '.'),\n 'value' => '/',\n 'type_id' => 3,\n 'can_drop' => false\n ],\n [\n 'name' => 'Logo Minificado Aplicação',\n 'description' => 'Logo Minificado da Aplicação',\n 'slug' => str_slug('Logo Min Aplicacao', '.'),\n 'value' => '/',\n 'type_id' => 3,\n 'can_drop' => false\n ],\n [\n 'name' => 'Logo Footer',\n 'description' => 'Logo Footer',\n 'slug' => str_slug('Logo Footer', '.'),\n 'value' => '/',\n 'type_id' => 3,\n 'can_drop' => false\n ],\n [\n 'name' => 'Google API KEY',\n 'description' => 'Google API KEY',\n 'slug' => str_slug('Google API KEY', '.'),\n 'value' => 'AIzaSyB9sX1jVroVEP8y4Ng_2d6u9s3YjcrrZco',\n 'type_id' => 1,\n 'can_drop' => false\n ],\n [\n 'name' => 'Mail Driver',\n 'description' => 'Driver de Email',\n 'slug' => str_slug('Mail Driver', '.'),\n 'value' => null,\n 'type_id' => 1,\n 'can_drop' => false\n ],\n [\n 'name' => 'Mail Host',\n 'description' => 'Host do Email',\n 'slug' => str_slug('Mail Host', '.'),\n 'value' => null,\n 'type_id' => 1,\n 'can_drop' => false\n ],\n [\n 'name' => 'Mail Port',\n 'description' => 'Porta do Host',\n 'slug' => str_slug('Mail Port', '.'),\n 'value' => null,\n 'type_id' => 1,\n 'can_drop' => false\n ],\n [\n 'name' => 'Mail Username',\n 'description' => 'Usuário do Email',\n 'slug' => str_slug('Mail Username', '.'),\n 'value' => null,\n 'type_id' => 1,\n 'can_drop' => false\n ],\n [\n 'name' => 'Mail Password',\n 'description' => 'Senha do Email',\n 'slug' => str_slug('Mail Password', '.'),\n 'value' => null,\n 'type_id' => 1,\n 'can_drop' => false\n ],\n [\n 'name' => 'Mail Encryption',\n 'description' => 'Encriptacao do Host',\n 'slug' => str_slug('Mail Encryption', '.'),\n 'value' => null,\n 'type_id' => 1,\n 'can_drop' => false\n ],\n ];\n\n foreach ($itens as $key => $item) {\n Configuration::create($item);\n }\n }", "function escape_page_type_list($pagetype, $parentcontext, $currentcontext) {\n $module_pagetype = array(\n 'mod-escape-*'=>get_string('page-mod-escape-x', 'escape'),\n 'mod-escape-view'=>get_string('page-mod-escape-view', 'escape'),\n 'mod-escape-edit'=>get_string('page-mod-escape-edit', 'escape'));\n return $module_pagetype;\n}", "public function store(StorePagePost $request)\n {\n $data=[\n 'type'=>$request->type,\n 'title'=>$request->title,\n 'remark'=>isset($request->remark)?$request->remark:\"\",\n 'pic'=>isset($request->pic)?$request->pic:\"\",\n 'content'=>isset($request->contents)?$request->contents:\"\",\n ];\n if($request->file(\"file\")){\n $data['pic'] = $request->file('file')->store('page');\n }\n switch ($request->type){\n case \"1\":\n $result = Page::updateOrCreate(['type'=>1],$data);\n checkreturn($result instanceof Page,\"更新\");\n return redirect(route('admin.page.create'));\n break;\n case \"2\":\n $result = Page::updateOrCreate(['title'=>$request->title],$data);\n checkreturn($result instanceof Page,\"添加\");\n return redirect(route('admin.page.index'));\n break;\n case \"3\":\n $result = Page::updateOrCreate(['title'=>$request->title],$data);\n checkreturn($result instanceof Page,\"添加\");\n return redirect(route('admin.page.licheng'));\n break;\n }\n }", "public function store(Request $request)\n {\n //multi language variables\n $lang = Session::get('lang');\n $title = 'title_'.$lang;\n $date = 'date_'.$lang;\n $short_desc = 'short_desc_'.$lang;\n $description = 'description_'.$lang;\n \n if($request->type=='word'){\n\n // validation\n $this->validate($request,[\n $short_desc=>'required',\n $title=>'required',\n $date=>'required',\n 'image'=>'required|mimes:jpg,jpeg,png,bmp',\n ]);\n }\n elseif($request->type=='decree' || $request->type=='order'){\n // validation\n $this->validate($request,[\n $title=>'required|max:250',\n $short_desc=>'max:250',\n $date=>'required',\n $description=>'required',\n 'image'=>'mimes:jpg,jpeg,png,bmp',\n ]);\n }\n else{\n // validation\n $this->validate($request,[\n $title=>'required|max:250',\n $date=>'required',\n $short_desc=>'required|max:250',\n $description=>'required',\n 'image'=>'required|mimes:jpg,jpeg,png,bmp',\n ]);\n }\n\n //data storage\n $the_president = new President();\n $the_president->$title = $request->$title;\n if($lang!='en'){\n $the_president->date_pa = $request->$date;\n $the_president->date_dr = $request->$date;\n }\n else{\n $the_president->date_en = $request->$date;\n }\n $the_president->$short_desc = $request->$short_desc;\n $the_president->$description = $request->$description;\n $the_president->type = $request->type;\n\n //save the record to retreive id later\n $the_president->save();\n\n $log = new Log();\n\n $log->table_name = 'president';\n $log->table_item_id = $the_president->id;\n $log->activity = 'create';\n $log->user_id = Auth::user()->id;\n $log->save();\n\n //retreive id from previously stored record\n $id = $the_president->id;\n\n //retreive president object again\n $the_president = President::findOrFail($id);\n\n\n //make image path\n $path = 'uploads/'.$request->type.'/';\n\n //variable for thumb image if present or otherwise\n $image_thumb_name = '';\n\n //image uploading\n if($request->image!='') {\n\n $image = Image::make($request->image);\n\n //image names i.e. (image and image_thumb)\n $image_name = $id.'.'.$request->image->getClientOriginalExtension();\n $image_thumb_name = $id.'_t.'.$request->image->getClientOriginalExtension();\n\n //resize image for thumbnail\n $driver = new imageManager(array('driver'=>'gd'));\n $image_thumb = $image->resize(200, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n //store image and thumbnail in storage\n $request->image->move($path,$image_name);\n $image_thumb->save($path.$image_thumb_name);\n\n //db image storage\n $the_president->image = $image_name;\n $the_president->image_thumb = $image_thumb_name;\n\n }\n else {\n //if image not present for search table\n $image_thumb_name = 'default.jpg';\n\n //if no image received store the default\n $the_president->image = 'default.jpg';\n $the_president->image_thumb = 'thumb.jpg';\n }\n\n if($the_president->save()) {\n //search stuff\n $search = new Search();\n $search->$title = $request->$title;\n if($lang!='en'){\n $search->date_pa = $request->$date;\n $search->date_dr = $request->$date;\n }\n else{\n $search->date_en = $request->$date;\n }\n \n $search->$short_desc = $request->$short_desc;\n $search->$description = $request->$description;\n $search->table_name = 'president';\n $search->type = $request->type;\n $search->table_id = $id;\n $search->image_thumb = $path.$image_thumb_name;\n // print_r($search->image_thumb);exit;\n $search->save();\n }\n // print_r($title);exit;\n Session::put('lang','');\n Session::put('type','');\n // Log::info($id.\" President record created by \".Session::get('email').\" on \".date('l jS \\of F Y h:i:s A'));\n return Redirect()->route(\"admin_\".$request->type);\n }", "public function question_type() {\r\n $this->check_permission(18);\r\n $content_data['add'] = $this->check_page_action(18, 'add');\r\n $this->quick_page_setup(Settings_model::$db_config['adminpanel_theme'], 'adminpanel', $this->lang->line('question_type'), 'operation/question_type', 'header', 'footer', '', $content_data);\r\n }", "public function setPageType($type = 'form'){\n\t\t\t$this->setBodyClass($type == 'form' || $type == 'single' ? 'single' : 'index');\n\t\t}", "public function run()\n {\n $type_procedure = [\n ['name' => 'Massagem'],\n ['name' => 'Depilação'],\n ];\n foreach ($type_procedure as $key => $value) {\n TypeProcedures::create($value);\n }\n }", "private function post_types() {\n\t\t$this->section_data['general_post_types'] = array(\n\t\t\t'name' \t\t\t\t\t=> 'general_post_types',\n\t\t\t'label' \t\t\t\t=> __( 'Post types', 'fixedtoc' ),\n\t\t\t'default' \t\t\t=> array( 'post', 'page' ),\n\t\t\t'type' \t\t\t\t\t=> 'multi_checkbox',\n\t\t\t'choices'\t\t\t\t=> $this->obj_field_data->get_posttype_choices(),\n\t\t\t'des'\t\t\t\t\t\t=> __( 'Check the post types to be applied. Multiple choice.', 'fixedtoc' )\n\t\t);\n\t}", "public function create_post_types() {\n }", "public function actionParagraphs()\n {\n $paragraphs = (new ParagraphDao)::findAll([\n \"idRecipe\" => SiteUtil::getUrlParameters()[2],\n \"ORDER\" => \"paragraphPosition ASC\"\n ] );\n echo json_encode(EntityUtil::toArray($paragraphs, true));\n }", "function insertPage()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php\");\n\t\t\n\t\t$num = ilChapterHierarchyFormGUI::getPostMulti();\n\t\t$node_id = ilChapterHierarchyFormGUI::getPostNodeId();\n\t\t\n\t\tif (!ilChapterHierarchyFormGUI::getPostFirstChild())\t// insert after node id\n\t\t{\n\t\t\t$parent_id = $this->tree->getParentId($node_id);\n\t\t\t$target = $node_id;\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t// insert as first child\n\t\t{\n\t\t\t$parent_id = $node_id;\n\t\t\t$target = IL_FIRST_NODE;\n\t\t}\n\n\t\tfor ($i = 1; $i <= $num; $i++)\n\t\t{\n\t\t\t$page = new ilLMPageObject($this->content_object);\n\t\t\t$page->setType(\"pg\");\n\t\t\t$page->setTitle($lng->txt(\"cont_new_page\"));\n\t\t\t$page->setLMId($this->content_object->getId());\n\t\t\t$page->create();\n\t\t\tilLMObject::putInTree($page, $parent_id, $target);\n\t\t}\n\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}", "public function run()\n {\n //\n TypeNew::create([\n 'description' => 'General',\n \n ]);\n TypeNew::create([\n 'description' => 'Cursos',\n \n ]);\n TypeNew::create([\n 'description' => 'Ofertas Laborales',\n \n ]);\n \n }", "public function run()\n {\n DB::table('assessment_type')->insert([\n 'type' => 'Quiz',\n 'slug' => 'quiz',\n ]);\n\n DB::table('assessment_type')->insert([\n 'type' => 'Assignment',\n 'slug' => 'assignment',\n ]);\n\n DB::table('assessment_type')->insert([\n 'type' => 'Prelim Exam',\n 'slug' => 'prelim-exam',\n ]);\n }", "public function run()\n {\n Type::create(['description' => 'Acrilico','detail' =>'']);\n Type::create(['description' => 'Loza/Cerámica','detail' =>'']);\n Type::create(['description' => 'Madera','detail' =>'']);\n Type::create(['description' => 'Metal','detail' =>'']);\n Type::create(['description' => 'Plastico','detail' =>'']);\n Type::create(['description' => 'Ternopor','detail' =>'']);\n\n Type::create(['description' => 'Carton','detail' =>'']);\n Type::create(['description' => 'Papeleria','detail' =>'']);\n Type::create(['description' => 'Tela','detail' =>'']);\n Type::create(['description' => 'Vidrio','detail' =>'']);\n }", "public function setPaperType($paperType):self;", "function create_post_types(){\n\n/*\nregister_post_type('news', \n\tarray(\n\t\t'labels'\t=> array(\n\t\t\t'name' \t\t\t=> __('News'),\n\t\t\t'singular_name'\t=> __('News')\n\t\t\t),\n\t\t'public'\t\t=> true,\n\t\t'has_archive'\t=> true,\n\t\t'menu_position'\t=> 5,\n\t\t'publicly_queryable' => true,\n\t\t'supports' => array('title', 'excerpt', 'editor', 'thumbnail', 'revisions')\n\t)\n);\n*/\n\nregister_post_type('advertisement',\n\tarray(\n\t\t'labels'\t=> array(\n\t\t\t'name' \t\t\t=> __('Advertisements'),\n\t\t\t'singular_name'\t=> __('Advertisement')\n\t\t\t),\n\t\t'public'\t\t=> true,\n\t\t'has_archive'\t=> true,\n\t\t'menu_position'\t=> 5,\n\t\t'publicly_queryable' => true,\n\t\t'supports' => array('title', 'thumbnail', 'revisions')\n\t)\n);\n\nregister_post_type('featured',\n\tarray(\n\t\t'labels'\t=> array(\n\t\t\t'name' \t\t\t=> __('Featured Slides'),\n\t\t\t'singular_name'\t=> __('Featured Slide')\n\t\t\t),\n\t\t'public'\t\t=> true,\n\t\t'has_archive'\t=> false,\n\t\t'menu_position'\t=> 5,\n\t\t'publicly_queryable' => true,\n\t\t'supports' => array('title', 'thumbnail', 'revisions')\n\t)\n);\n\n\n}", "function obdiy_create_lp_post_type() {\n\tregister_post_type( 'landing_page',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Landing Pages' ),\n\t\t\t\t'singular_name' => __( 'Landing Page' )\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'hierarchical' => true, //Behave like a page\n\t\t\t'query_var' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'revisions', 'custom-fields', 'thumbnail', 'page-attributes' ),\n\t\t\t'rewrite' => array( 'slug' => 'valuable-stuff', 'with_front' => false ),\n\t\t\t'permalink_epmask' => EP_PERMALINK,\n\t\t\t'menu_icon' => 'dashicons-tag',\n\t\t)\n\t);\n}", "function prosody_poem_type_save_meta_box_data ($post_id=null)\n{\n $post_id = (is_null($post_id)) ? get_post()->ID : $post_id;\n\n /*\n * We need to verify this came from our screen and with proper\n * authorization, because the save_post action can be triggered at other\n * times.\n */\n\n // Check if our nonce is set.\n if ( ! isset( $_POST['prosody_poem_type_meta_box_nonce'] ) ) {\n return;\n }\n\n // Verify that the nonce is valid.\n $nonce = $_POST['prosody_poem_type_meta_box_nonce'];\n if ( ! wp_verify_nonce( $nonce, 'prosody_poem_type_meta_box' ) ) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't\n // want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n\n // Check the user's permissions.\n if ( isset( $_POST['post_type'] ) &&\n 'prosody_poem' == $_POST['post_type'] ) {\n\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return;\n }\n\n } else {\n\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n }\n\n /* OK, its safe for us to save the data now. */\n\n // Make sure that it is set.\n if ( ! isset( $_POST['prosody_poem_type'] ) ) {\n return;\n }\n\n // Sanitize user input. In this case we don't so the transform will work.\n $my_data = sanitize_text_field( $_POST['prosody_poem_type'] );\n\n // Update the meta field in the database.\n update_post_meta( $post_id, 'Type', $my_data );\n}", "function create_post_type() {\r\n\r\n\tregister_post_type( 'Editorials',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => __( 'Editorials' ),\r\n\t\t\t\t'singular_name' => __( 'Editorial' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'editorials'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n\tregister_post_type( 'Local news',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t\r\n\t\t\t\t'name' => __( 'Local news' ),\r\n\t\t\t\t'singular_name' => __( 'Local new' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'local news'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n}", "public function run()\n {\nfor ($i=0; $i <3 ; $i++) { \n$add=new Landingpage;\n \n$add->mainimg=\"wp-content/uploads/2017/05/l2.png\";\n$add->subimg=\"wp-content/uploads/2017/05/l2sub.png\";\n$add->tit=\"Components\";\n$add->sub_tit=\"Egypt\";\n$add->titlin2=\"Service\";\n$add->link=\"main\"; \n \n$add->save();\n}\n }", "public function store(Request $request)\n {\n\n $data = $request->all();\n\n $newPage = new Page;\n\n $newPage->user_id = $data['user_id'];\n\n $newPage->title = $data['title_page'];\n\n $newPage->slug = Str::slug($data['title_page']);\n\n $newPage->description = $data['description_page'];\n\n $newPage->save();\n\n\n $pageId = $newPage->id;\n\n\n $newSection = new Section;\n\n $newSection->page_id = $pageId;\n\n $newSection->title = $data['title_section'];\n\n $newSection->slug = Str::slug($data['title_section']);\n\n $newSection->save();\n\n\n $sectionId = $newSection->id;\n\n\n $newTitle = new Title;\n\n $newTitle->section_id = $sectionId;\n\n $newTitle->title = $data['element_title_title'];\n\n $newTitle->slug = Str::slug($data['element_title_title']);\n\n $newTitle->text = $data['element_text_title'];\n\n $newTitle->save();\n\n\n $newSubtitle = new Subtitle;\n\n $newSubtitle->section_id = $sectionId;\n\n $newSubtitle->title = $data['element_title_subtitle'];\n\n $newSubtitle->slug = Str::slug($data['element_title_subtitle']);\n\n $newSubtitle->text = $data['element_text_subtitle'];\n\n $newSubtitle->save();\n\n\n $newDescription = new Description;\n\n $newDescription->section_id = $sectionId;\n\n $newDescription->title = $data['element_title_description'];\n\n $newDescription->slug = Str::slug($data['element_title_description']);\n\n $newDescription->text = $data['element_text_description'];\n\n $newDescription->save();\n\n\n $newImage = new Image;\n\n $slug = Str::slug($data['element_title_image']);\n\n $newImage->section_id = $sectionId;\n\n $newImage->title = $data['element_title_image'];\n\n $newImage->slug = $slug;\n\n Storage::disk('public')->put('pageImage', $data['image']);\n\n $filename = $data['image']->hashName();\n\n $path = 'http://localhost:8000/storage/pageImage/' . $filename;\n\n $newImage->path = $path;\n\n $newImage->save();\n\n return redirect()->route('admin.pages.index');\n\n }", "function save_postdata( $post_id ) {\n\tglobal $post, $new_meta_boxes;\n\n\tif(isset($post) && $post->post_type=='page'){\n\t\t$new_meta_boxes=$GLOBALS['new_meta_boxes'];\n\t\tpexeto_save_meta_data($new_meta_boxes, $post_id);\n\t}\n}", "function repairParagraph(string $parent_type, string $parent_field_name, int $parent_id, int $paragraph_id) {\n global $updates;\n $database = \\Drupal::database();\n $entity_type_manager = \\Drupal::entityTypeManager();\n $parent_storage = $entity_type_manager->getStorage($parent_type);\n $parent = $parent_storage->load($parent_id);\n $parent_field = $parent->get($parent_field_name);\n $parent_field_value = $parent_field->getValue();\n\n foreach ($parent_field_value as $delta => $value) {\n if ((int) $value['target_id'] === $paragraph_id) {\n $revision_id = (int) $value['target_revision_id'];\n logMessage(\"$parent_type #{$parent_id}->$parent_field_name [$delta] points to revision #$revision_id of paragraph #$paragraph_id.\");\n\n // Check the corresponding row in the paragraphs_item table.\n $query = $database->select('paragraphs_item', 'p');\n $query->addField('p', 'id', 'id');\n $query->addField('p', 'revision_id', 'revision_id');\n $query->condition('id', $paragraph_id);\n $row = $query->execute()->fetchObject();\n $row_revision_id = (int) $row->revision_id;\n if ($revision_id === $row_revision_id) {\n logMessage(\"paragraphs_item row for $paragraph #$paragraph_id also points to revision #$revision_id... no action needed.\");\n }\n else {\n logMessage(\"paragraphs_item row for $paragraph #$paragraph_id points to revision #$row_revision_id... updating.\");\n $query = $database->update(\"paragraphs_item\");\n $query->fields([\n \"revision_id\" => $revision_id,\n ]);\n $query->condition('id', $paragraph_id);\n $query->condition('revision_id', $row_revision_id);\n $query->execute();\n $updates['node']['items'][] = $parent_id;\n $updates['paragraphs_item']['items'][] = $paragraph_id;\n }\n\n // Check the corresponding row in the paragraphs_item_field_data table.\n $query = $database->select('paragraphs_item_field_data', 'p');\n $query->addField('p', 'id', 'id');\n $query->addField('p', 'revision_id', 'revision_id');\n $query->addField('p', 'parent_id', 'parent_id');\n $query->addField('p', 'parent_type', 'parent_type');\n $query->condition('id', $paragraph_id);\n $row = $query->execute()->fetchObject();\n $row_revision_id = (int) $row->revision_id;\n $row_parent_id = (int) $row->parent_id;\n $row_parent_type = $row->parent_type;\n if ($parent_type !== $row_parent_type) {\n throw new \\Exception(\"paragraphs_item_field_data #$paragraph_id is pointing to $row_parent_type (expected: $parent_type). Something is terribly wrong!\");\n }\n else if ($revision_id === $row_revision_id && $parent_id === $row_parent_id) {\n logMessage(\"paragraphs_item_field_data row for $paragraph #$paragraph_id also points to revision #$revision_id and is parented by $parent_type #$parent_id... no action needed.\");\n }\n else {\n logMessage(\"paragraphs_item_field_data row for $paragraph #$paragraph_id points to revision #$row_revision_id (should be $revision_id) and parent $parent_type #$row_parent_id (should be #$parent_id)... updating.\");\n $query = $database->update(\"paragraphs_item_field_data\");\n $query->fields([\n \"revision_id\" => $revision_id,\n \"parent_id\" => $parent_id,\n ]);\n $query->condition('id', $paragraph_id);\n $query->condition('revision_id', $row_revision_id);\n $query->condition('parent_id', $row_parent_id);\n $query->execute();\n $updates['node']['items'][] = $parent_id;\n $updates['paragraphs_item_field_data']['items'][] = $paragraph_id;\n }\n\n // Check the corresponding row in the paragraphs_item_revision_field_data table.\n $query = $database->select('paragraphs_item_revision_field_data', 'p');\n $query->addField('p', 'id', 'id');\n $query->addField('p', 'revision_id', 'revision_id');\n $query->addField('p', 'parent_id', 'parent_id');\n $query->addField('p', 'parent_type', 'parent_type');\n $query->condition('id', $paragraph_id);\n $query->condition('revision_id', $revision_id);\n $row = $query->execute()->fetchObject();\n $row_revision_id = (int) $row->revision_id;\n $row_parent_id = (int) $row->parent_id;\n $row_parent_type = $row->parent_type;\n if ($parent_type !== $row_parent_type) {\n throw new \\Exception(\"paragraphs_item_revision_field_data #$paragraph_id is pointing to $row_parent_type (expected: $parent_type). Something is terribly wrong!\");\n }\n else if ($parent_id === $row_parent_id) {\n logMessage(\"paragraphs_item_revision_field_data row for $paragraph #$paragraph_id @ revision #$revision_id is parented by $parent_type #$parent_id... no action needed.\");\n }\n else {\n logMessage(\"paragraphs_item_revision_field_data row for $paragraph #$paragraph_id @ revision #$revision_id is parented by $parent_type #$row_parent_id (should be #$parent_id)... updating.\");\n $query = $database->update(\"paragraphs_item_revision_field_data\");\n $query->fields([\n \"parent_id\" => $parent_id,\n ]);\n $query->condition('id', $paragraph_id);\n $query->condition('revision_id', $row_revision_id);\n $query->condition('parent_id', $row_parent_id);\n $query->execute();\n $updates['node']['items'][] = $parent_id;\n $updates['paragraphs_item_revision_field_data']['items'][] = $paragraph_id;\n }\n\n }\n }\n}", "public function ghostpool_post_type_slides() {\t\n\t\n\t\t\tregister_post_type( 'gp_slide', array( \n\t\t\t\t'labels' => array( \n\t\t\t\t\t'name' => esc_html__( 'Slides', 'socialize-plugin' ),\n\t\t\t\t\t'singular_name' => esc_html__( 'Slide', 'socialize-plugin' ),\n\t\t\t\t\t'menu_name' => esc_html__( 'Slides', 'socialize-plugin' ),\n\t\t\t\t\t'all_items' => esc_html__( 'All Slides', 'socialize-plugin' ),\n\t\t\t\t\t'add_new' => _x( 'Add New', 'portfolio', 'socialize-plugin' ),\n\t\t\t\t\t'add_new_item' => esc_html__( 'Add New Slide', 'socialize-plugin' ),\n\t\t\t\t\t'edit_item' => esc_html__( 'Edit Slide', 'socialize-plugin' ),\n\t\t\t\t\t'new_item' => esc_html__( 'New Slide', 'socialize-plugin' ),\n\t\t\t\t\t'view_item' => esc_html__( 'View Slide', 'socialize-plugin' ),\n\t\t\t\t\t'search_items' => esc_html__( 'Search Slides', 'socialize-plugin' ),\n\t\t\t\t\t'not_found' => esc_html__( 'No slides found', 'socialize-plugin' ),\n\t\t\t\t\t'not_found_in_trash' => esc_html__( 'No slides found in Trash', 'socialize-plugin' ),\n\t\t\t\t ),\n\t\t\t\t'public' => true,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t\t'_builtin' => false,\n\t\t\t\t'_edit_link' => 'post.php?post=%d',\n\t\t\t\t'capability_type' => 'post',\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'rewrite' => array( 'slug' => 'slide' ),\n\t\t\t\t'menu_position' => 20,\n\t\t\t\t'with_front' => true,\n\t\t\t\t'has_archive' => 'gp_slides',\n\t\t\t\t'supports' => array( 'title', 'thumbnail' )\n\t\t\t ) );\n\t\n\t\n\t\t\t/*--------------------------------------------------------------\n\t\t\tSlide Categories Taxonomy\n\t\t\t--------------------------------------------------------------*/\n\t\t\t\n\t\t\tregister_taxonomy( 'gp_slides', 'gp_slide', array( \n\t\t\t\t'labels' => array( \n\t\t\t\t\t'name' => esc_html__( 'Slide Categories', 'socialize-plugin' ),\n\t\t\t\t\t'singular_name' => esc_html__( 'Slide Category', 'socialize-plugin' ),\n\t\t\t\t\t'all_items' => esc_html__( 'All Slide Categories', 'socialize-plugin' ),\n\t\t\t\t\t'add_new' => _x( 'Add New', 'portfolio', 'socialize-plugin' ),\n\t\t\t\t\t'add_new_item' => esc_html__( 'Add New Slide Category', 'socialize-plugin' ),\n\t\t\t\t\t'edit_item' => esc_html__( 'Edit Slide Category', 'socialize-plugin' ),\n\t\t\t\t\t'new_item' => esc_html__( 'New Slide Category', 'socialize-plugin' ),\n\t\t\t\t\t'view_item' => esc_html__( 'View Slide Category', 'socialize-plugin' ),\n\t\t\t\t\t'search_items' => esc_html__( 'Search Slide Categories', 'socialize-plugin' ),\n\t\t\t\t\t'menu_name' => esc_html__( 'Slide Categories', 'socialize-plugin' )\n\t\t\t\t ),\n\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'rewrite' => array( 'slug' => 'slides' )\n\t\t\t ) );\n\n\n\t\t\tregister_taxonomy_for_object_type( 'gp_slides', 'gp_slide' );\n\n\n\t\t\t/*--------------------------------------------------------------\n\t\t\tSlide Admin Columns\n\t\t\t--------------------------------------------------------------*/\n\n\t\t\tif ( ! function_exists( 'ghostpool_slide_edit_columns' ) ) { \n\t\t\t\tfunction ghostpool_slides_edit_columns( $columns ) {\n\t\t\t\t\t$columns = array( \n\t\t\t\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t\t\t\t'title' => esc_html__( 'Title', 'socialize-plugin' ),\t\n\t\t\t\t\t\t'slide_categories' => esc_html__( 'Categories', 'socialize-plugin' ),\n\t\t\t\t\t\t'slide_image' => esc_html__( 'Image', 'socialize-plugin' ),\t\t\t\t\n\t\t\t\t\t\t'date' => esc_html__( 'Date', 'socialize-plugin' )\n\t\t\t\t\t );\n\t\t\t\t\treturn $columns;\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tadd_filter( 'manage_edit-gp_slide_columns', 'ghostpool_slides_edit_columns' );\n\t\t\n\t\t}", "public function get_page_type()\n {\n switch ($this->type) {\n case self::TYPE_SLIDESHOW:\n return 'slideshow';\n break;\n default:\n return 'entry';\n }\n }", "public function property_type_of_practice() {\n\n\t\t\tif ( $this->add_package !== 3 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t $out = '<h3>Property Details:</h3>';\n\n\t\t\t$out = '<h4>Type of Practice</h4>';\n\t\t\t$out .= '<ul>';\n\n\t\t\t$practice_type = get_field( 'practice_type' );\n\t\t\t$practice_type_label = ( $practice_type != 'other' )\n\t\t\t\t? $practice_type\n\t\t\t\t: get_field( 'other_type' );\n\n\t\t\t$out .= '<li><em>Practice Type:</em> ' . $practice_type_label . '</li>';\n\n\t\t\t$small_animal_treated = get_field( 'small_animal_treated' );\n\t\t\t$equine_treated = get_field( 'equine_treated' );\n\t\t\t$bovine_treated = get_field( 'bovine_treated' );\n\t\t\t$other_treated = get_field( 'other_treated' );\n\t\t\t$other_animals_treated_cont = get_field( 'other_animals_treated_cont' );\n\n\n\t\t\tif ( $small_animal_treated ) {\n\t\t\t\t$treated_small = get_field( 'small_animal_choices' );\n\t\t\t\t$small_choices = rtrim( implode( ', ', $treated_small ), ',' );\n\t\t\t\t$out .= '<li><em>' . $small_animal_treated . '&#37; - Small</em> &#40; ' . $small_choices . ' &#41;</li>';\n\t\t\t}\n\n\t\t\tif ( $equine_treated ) {\n\t\t\t\t$treated_equine = get_field( 'equine_choices' );\n\t\t\t\t$equine_choices = rtrim( implode( ', ', $treated_equine ), ',' );\n\t\t\t\t$out .= '<li><em>' . $equine_treated . '&#37; - Equine</em> &#40; ' . $equine_choices . ' &#41;</li>';\n\t\t\t}\n\n\t\t\tif ( $bovine_treated ) {\n\t\t\t\t$treated_bovine = get_field( 'bovine_choices' );\n\t\t\t\t$bovine_choices = rtrim( implode( ', ', $treated_bovine ), ',' );\n\t\t\t\t$out .= '<li><em>' . $bovine_treated . '&#37; - Bovine</em> &#40; ' . $bovine_choices . ' &#41;</li>';\n\t\t\t}\n\n\t\t\tif ( $other_treated ) {\n\t\t\t\t$out .= '<li><em>' . $other_treated . '&#37; - Other</em> &#40; ' . $other_animals_treated_cont . '&#41;</li>';\n\t\t\t}\n\n\t\t\t$out .= '</ul>';\n\n\t\t\treturn $out;\n\t\t}", "public function store(Request $request, $typeSlug)\n {\n\n\n $pageType = PageType::where('slug', $typeSlug)->first();\n $fields = PageFields::where('page_type_id', $pageType->id)->get();\n\n if($pageType->type == \"one\") {\n if($pageType->edit == false){\n $entity = $this->createOneEntity($request, $pageType, $fields);\n\n return $entity;\n }\n else{\n $entity = $this->updateOneEntity($request, $pageType);\n return $entity;\n\n }\n }\n\n if ($pageType->type == \"many\"){\n $entity = $this->createManyEntities($request, $pageType, $fields);\n return $entity;\n }\n\n\n }", "function dataform_page_type_list($pagetype, $parentcontext, $currentcontext) {\n $module_pagetype = array('mod-dataform-*'=>get_string('page-mod-dataform-x', 'dataform'));\n return $module_pagetype;\n}", "public function run()\n {\n /**\n * 1\n */\n Prive::create([\n 'name' => 'superuser',\n 'discription' => 'Суперпользователь'\n ]);\n \n /**\n * 2\n */\n Prive::create([\n 'name' => 'admin_access',\n 'discription' => 'Вход в админку'\n ]);\n\n /**\n * 3\n */\n Prive::create([\n 'name' => 'user_index',\n 'discription' => 'Просмотр пользователей'\n ]);\n\n /**\n * 4\n */\n Prive::create([\n 'name' => 'user_create',\n 'discription' => 'Создание пользователей'\n ]);\n \n /**\n * 5\n */\n Prive::create([\n 'name' => 'user_update',\n 'discription' => 'Редактирование пользователей'\n ]);\n \n /**\n * 6\n */\n Prive::create([\n 'name' => 'user_delete',\n 'discription' => 'Удаление пользователей'\n ]);\n \n /**\n * 7\n */\n Prive::create([\n 'name' => 'prive_update',\n 'discription' => 'Редактирование прав'\n ]);\n\n /**\n * 8\n */\n Prive::create([\n 'name' => 'page_index',\n 'discription' => 'Просмотр и сортировка страниц'\n ]);\n\n /**\n * 9\n */\n Prive::create([\n 'name' => 'page_create',\n 'discription' => 'Создание страниц'\n ]);\n\n /**\n * 10\n */\n Prive::create([\n 'name' => 'page_update',\n 'discription' => 'Редактирование страниц'\n ]);\n\n /**\n * 11\n */\n Prive::create([\n 'name' => 'page_delete',\n 'discription' => 'Удаление страниц'\n ]);\n\n /**\n * 12\n */\n Prive::create([\n 'name' => 'block_create',\n 'discription' => 'Создание блоков'\n ]);\n\n /**\n * 13\n */\n Prive::create([\n 'name' => 'block_update',\n 'discription' => 'Редактирование блоков'\n ]);\n\n /**\n * 14\n */\n Prive::create([\n 'name' => 'block_delete',\n 'discription' => 'Удаление блоков'\n ]);\n\n /**\n * 15\n */\n Prive::create([\n 'name' => 'element_create',\n 'discription' => 'Создание элементов'\n ]);\n\n /**\n * 16\n */\n Prive::create([\n 'name' => 'element_update',\n 'discription' => 'Редактирование элементов'\n ]);\n\n /**\n * 17\n */\n Prive::create([\n 'name' => 'element_delete',\n 'discription' => 'Удаление элементов'\n ]);\n\n /**\n * 18\n */\n Prive::create([\n 'name' => 'review_index',\n 'discription' => 'Создание отзывов'\n ]);\n\n /**\n * 19\n */\n Prive::create([\n 'name' => 'review_create',\n 'discription' => 'Создание отзывов'\n ]);\n\n /**\n * 20\n */\n Prive::create([\n 'name' => 'review_update',\n 'discription' => 'Редактирование отзывов'\n ]);\n\n /**\n * 21\n */\n Prive::create([\n 'name' => 'review_delete',\n 'discription' => 'Удаление отзывов'\n ]);\n\n /**\n * 22\n */\n Prive::create([\n 'name' => 'message_index',\n 'discription' => 'Просмотр списка сообщений'\n ]);\n\n /**\n * 23\n */\n Prive::create([\n 'name' => 'message_show',\n 'discription' => 'Чтение сообщения'\n ]);\n\n /**\n * 24\n */\n Prive::create([\n 'name' => 'message_delete',\n 'discription' => 'Удаление сообщений'\n ]);\n\n /**\n * 25\n */\n Prive::create([\n 'name' => 'settings_update',\n 'discription' => 'Управление настройками сайта'\n ]);\n\n\n }", "public function run()\n {\n //\n DB::table('pages')->insert([\n [\n 'title' => 'Haqqımızda',\n 'text' => \"<p>Respublika Prezidentinin apardığı məqsədyönlü siyasət nəticəsində yaradılan sağlam mühit digər sahələrdə olduğu kimi\nözəl sektorun da sürətli inkişafına təkan vermişdir: Bu baxımdan 'Modern Style Construction Agro' MMC müvafiq lisenziya və icazələri alaraq qüvvədə olan\nqanunvericiliyə uyğun olaraq. 'Modern Style Construction Agro' MMC olaraq, qabaqcıl və müasir texnologiyaları tətbiq edərək, yeni istehsal sahələri yaratmağa\nvə etibarlı tərəfdaş kimi tanınmağa çalışırıq. Məqsədlərimizə tam və effektiv şəkildə nail olmaq üçün keyfiyyətə, sağlamlığa, təhlükəsizliyə və ətraf mühitin\n qorunmasına böyük önəm veririk.</p>\",\n 'img' => 'msca-logo.png'\n ],\n [\n 'title'=>'ƏKİN SAHƏLƏRİ',\n 'text' => \"<p> Qeyri neft sektoru Azərbaycanın İqtisadi inkişafının prioritetinə çevrilib. Xüsusi ilə bura Kənd Təsərrüfatının inkişafını qeyd etmək olar. Torpaqların inkişafı üçün əlimizdən gələni edirik. Torpaqların inkişafı ölkəmizin məhsuldarlığını artırmaq üçün böyük rol oynayacaqdır. Respublika prezidentinin apardığı məqsəd-yönlü siyasəti nəticəsində formalaşan sağlam mühit digər sahələr kimi, özəl sektorda sürətli inkişafına təkan vermişdir.Bu baxımdan 'Modern Style Construction Agro' MMC inkişaf etmiş şirkətlər kimi formalaşmışdır.</p>\",\n 'img' => 'ekin_sekil2.jpg'\n ],\n [\n 'title' => 'Agro Servis\t',\n 'text' => \" <span style='color: rgb(119, 119, 119);'>'Modern Style Construction Agro' MMC ildən artıqdır ki, 'Şahdağ agro' MMC-nin təsərrüfat\n sahələrinədə agro texniki xidmət göstərməkdədir. Biz 'Modern Style Construction Agro' MMC olraq 'Şahdağ agro ' MMC-nin rəhbərliyinə və işçi heyətinə\n təşəkkürümüzü bildiririk. 'Modern Style Construction Agro' - MMC bölgələrimizin bütün rayonlarında agro texniki xidmətlərin müasir standartlara\n uyğun qurulmasının , məhsuldarliğın artırılmmasına və torpaq ehtiyyatlarından daha səmərəli istifadəyə imkan yaradır. Eyni zamanda , müəssisə\n kompleks agro texniki xidmətlər,düzgün əkin metodunun seçilməsi,şum,səpin və suvarma işlərinin aparılması, məhsulun yığını və AGRONOM xidmətlər\n göstərməklə fermerlər və torpaq sahibləri üçün 'vahid pəncər' rolunu oynayır.</span>\",\n 'img' => 'agro_sekil1.jpg'\n ],\n\n [\n 'title' => 'Beton Zavod\t',\n 'text' => \" <span style='color: rgb(119, 119, 119);'>MSCA Beton Zavodu 2018-ci ildə Bakı şəhərində açılmışdır. MSCA şirkətlər qrupunun uğurlu inkişafında MSCA Beton zavodu böyük əhəmiyyət daşıyır. Beton zavodunun bütün lazım\nolan avadanlıqla təchiz olunmuşdur, işçi heyəti işə yüksək ixtisas dərəcəsinə malikdir Bu gun biz inşaatçıları istənilən ölçüdə betonla təchiz edə bilərik. Bundan əlavə betonun müasir müasir çatdırılması üsulu tikinti\nsahəsində gecikmələrin qarşısını alır. Beton istehsalı. Almaniyada istehsal olunmuş Liebherr markalı avadanlıqlardan istifadə olunaraq, həyata keçirilir. Beton istehsalında yalnız keyfiyyətli materiallardan istifadə olunur.\nBetonun tərkibi müəyyən olunmuş dövlət standartlarına uyğun olaraq təyin olunur. Zavodumuzda istehsal olunan betona kimyəvi maddələrdə əlavə olunur ki, bu da istehsal olunan məhsulun keyfiyyətini artırmağa imkan verir.\nBeton zavodumuz M100-M700 markali beton istehsal edir.</span>\",\n 'img' => 'beton_sekil1.jpg'\n ],\n [\n 'title' => 'Layihələr',\n 'text' => \" TƏQDİM ETDİYİMİZ İŞLƏR\",\n 'img' => ''\n ],\n [\n 'title' => 'Xidmətlərimiz',\n 'text' => \"Xidmətlər\",\n 'img' => ''\n ],\n\n ]);\n }", "public static function load_post_data($type,$ptype,$pid)\t{\t\t\t\t\t\n\t\t\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\tif($type == \"post\"){\n\t\t\t\t$cond =\"post_type != '\". self::$post_type.\"' AND post_type != 'page'\";\n\t\t\t\t$id = \"id_post\";\n\t\t\t} elseif ($type == \"page\") {\n\t\t\t\t$cond =\"post_type != '\". self::$post_type.\"' AND post_type != 'post'\";\n\t\t\t\t$id = \"id_page\";\n\t\t\t}\n\t\t\t$dis = \"\";\n\t\t\tif($type != $ptype){$dis = \"disabled\";}\n\t\t\t\n\t\t\t$sql = \"SELECT * \n FROM \" . $wpdb->prefix . \"posts \n WHERE \".$cond.\" AND post_status = 'publish'\n ORDER BY post_title ASC;\";\t\t\t\n\t\t\t\t\t\t\n\t\t\t$post_all = $wpdb->get_results($sql);\n\t\t\t$html = \"\";\t\t\t\n\t\t\tif(!empty($post_all)){\n\t\t\t\t\t\n\t\t\t\t\t$ctr = 1;\n $html = '<select id=\"'.$id.'\" style=\"width:280px;\" '.$dis.'>';\n\t\t\t\t\tforeach($post_all as $key => $val){ \n\t\t\t\t\t\t\t$sel = \"\";\n\t\t\t\t\t\t\tif($type == $ptype && $pid == $val->ID){$sel = \"selected\";}\n\t\t\t \t\t$html = $html . '<option value=\"'.$val->ID.'\" '.$sel.'>'.$val->post_title . \"</option>\";\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$html = $html . '</select>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}", "function ubercontent_save_node_types($types) {\n\n\t// create a new node type for each\n\tforeach($types as $type) {\n\t\t// Create the content type object\n\t\t$type = node_type_set_defaults($type);\n\n\t\t/**\n\t\t * Saving the content type after saving the variables allows modules to act\n\t\t * on those variables via hook_node_type_insert().\n\t\t */\n\t\t$status = node_type_save($type);\n\n\t\tdrupal_set_message('Node type \"'. $type->type . '\" ' . ($status == 2 ? 'Updated' : 'Saved'));\n\t}\n\n\t// rebuild the menus so we can see our new types\n\tnode_types_rebuild();\n\tmenu_rebuild();\n}", "function getParagraphsFields(): array {\n $database = \\Drupal::database();\n\n $query = $database->select('paragraphs_item_field_data', 'p');\n $query->addField('p', 'parent_type', 'parent_type');\n $query->addField('p', 'parent_field_name', 'parent_field_name');\n $result = $query->distinct()->execute()->fetchAll();\n\n return $result;\n}", "public function run()\n {\n PostType::create(['name' => 'Topic']);\n PostType::create(['name' => 'Report']);\n PostType::create(['name' => 'Help']);\n PostType::create(['name' => 'Campaign']);\n }", "protected function setContentType()\n {\n $this->content_type = 'Page';\n }", "public function run()\n {\n $t1 = 'bla1';\n $t2 = 'bla2';\n $t3 = 'bla3';\n $t4 = 'bla4';\n $t5 = 'bla5';\n $t6 = 'bla6';\n $t7 = 'bla7';\n $t8 = 'bla8';\n $t9 = 'bla9';\n $t10 = 'bla10';\n\n $p1 = [\n 'title' => $t1,\n 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Maecenas pharetra convallis posuere morbi. Purus gravida quis blandit turpis cursus in hac habitasse platea. Convallis convallis tellus id interdum velit. Faucibus a pellentesque sit amet porttitor eget.',\n 'featured' => DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'posts' . DIRECTORY_SEPARATOR . '15354696766.jpg',\n 'category_id' => 1,\n 'slug' => str_slug($t1),\n 'user_id' => 1\n ];\n $p2 = [\n 'title' => $t2,\n 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Maecenas pharetra convallis posuere morbi. Purus gravida quis blandit turpis cursus in hac habitasse platea. Convallis convallis tellus id interdum velit. Faucibus a pellentesque sit amet porttitor eget.',\n 'featured' => DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'posts' . DIRECTORY_SEPARATOR . '1535470315pv3.jpg',\n 'category_id' => 3,\n 'slug' => str_slug($t2),\n 'user_id' => 1\n ];\n $p3 = [\n 'title' => $t3,\n 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Maecenas pharetra convallis posuere morbi. Purus gravida quis blandit turpis cursus in hac habitasse platea. Convallis convallis tellus id interdum velit. Faucibus a pellentesque sit amet porttitor eget.',\n 'featured' => DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'posts' . DIRECTORY_SEPARATOR . 'myAvatar.png',\n 'category_id' => 1,\n 'slug' => str_slug($t3),\n 'user_id' => 1\n ];\n $p4 = [\n 'title' => $t4,\n 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Maecenas pharetra convallis posuere morbi. Purus gravida quis blandit turpis cursus in hac habitasse platea. Convallis convallis tellus id interdum velit. Faucibus a pellentesque sit amet porttitor eget.',\n 'featured' => DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'posts' . DIRECTORY_SEPARATOR . 'foodie.png',\n 'category_id' => 1,\n 'slug' => str_slug($t4),\n 'user_id' => 1\n ];\n $p5 = [\n 'title' => $t5,\n 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Maecenas pharetra convallis posuere morbi. Purus gravida quis blandit turpis cursus in hac habitasse platea. Convallis convallis tellus id interdum velit. Faucibus a pellentesque sit amet porttitor eget.',\n 'featured' => DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'posts' . DIRECTORY_SEPARATOR . 'footd.png',\n 'category_id' => 2,\n 'slug' => str_slug($t5),\n 'user_id' => 1\n ];\n $p6 = [\n 'title' => $t6,\n 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Maecenas pharetra convallis posuere morbi. Purus gravida quis blandit turpis cursus in hac habitasse platea. Convallis convallis tellus id interdum velit. Faucibus a pellentesque sit amet porttitor eget.',\n 'featured' => DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'posts' . DIRECTORY_SEPARATOR . 'versus.jpg',\n 'category_id' => 1,\n 'slug' => str_slug($t6),\n 'user_id' => 1\n ];\n $p7 = [\n 'title' => $t7,\n 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Maecenas pharetra convallis posuere morbi. Purus gravida quis blandit turpis cursus in hac habitasse platea. Convallis convallis tellus id interdum velit. Faucibus a pellentesque sit amet porttitor eget.',\n 'featured' => DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'posts' . DIRECTORY_SEPARATOR . '15356328404.jpg',\n 'category_id' => 2,\n 'slug' => str_slug($t7),\n 'user_id' => 1\n ];\n $p8 = [\n 'title' => $t8,\n 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Maecenas pharetra convallis posuere morbi. Purus gravida quis blandit turpis cursus in hac habitasse platea. Convallis convallis tellus id interdum velit. Faucibus a pellentesque sit amet porttitor eget.',\n 'featured' => DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'posts' . DIRECTORY_SEPARATOR . '15356323249.jpg',\n 'category_id' => 4,\n 'slug' => str_slug($t8),\n 'user_id' => 1\n ];\n $p9 = [\n 'title' => $t1,\n 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Maecenas pharetra convallis posuere morbi. Purus gravida quis blandit turpis cursus in hac habitasse platea. Convallis convallis tellus id interdum velit. Faucibus a pellentesque sit amet porttitor eget.',\n 'featured' => DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'posts' . DIRECTORY_SEPARATOR . 'bugs.jpg',\n 'category_id' => 2,\n 'slug' => str_slug($t1),\n 'user_id' => 1\n ];\n\n $p10 = [\n 'title' => $t10,\n 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Maecenas pharetra convallis posuere morbi. Purus gravida quis blandit turpis cursus in hac habitasse platea. Convallis convallis tellus id interdum velit. Faucibus a pellentesque sit amet porttitor eget.',\n 'featured' => DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'posts' . DIRECTORY_SEPARATOR . 'gossip.jpg',\n 'category_id' => 3,\n 'slug' => str_slug($t10),\n 'user_id' => 1\n ];\n\n\n $c1 = Post::create($p1);\n $c1->tags()->attach([1,2]);\n\n $c2 = Post::create($p2);\n $c2->tags()->attach([4, 3]);\n\n $c3 = Post::create($p3);\n $c3->tags()->attach([2]);\n\n $c4 = Post::create($p4);\n $c4->tags()->attach([3]);\n\n $c5 = Post::create($p5);\n $c5->tags()->attach([5]);\n\n $c6 = Post::create($p6);\n $c6->tags()->attach([1]);\n\n $c7 = Post::create($p7);\n $c7->tags()->attach([2]);\n\n $c8 = Post::create($p8);\n $c8->tags()->attach([1,3,4]);\n\n $c9 = Post::create($p9);\n $c9->tags()->attach([2,5,1]);\n\n $c10 = Post::create($p10);\n $c10->tags()->attach([1,5]);\n }", "private function setPageType($type) {\n\t\tif(!empty($type))\n\t\t\t$this->pageType = $type;\n\t\telse\n\t\t\tthrow new Exception('PageType cant be empty');\n\t}", "public function test_it_returns_list_of_pap_types()\n {\n $this->seed(PapTypesTableSeeder::class);\n\n $response = $this->getJson(route('api.pap_types.index'));\n\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n [\n 'id',\n 'name',\n 'slug'\n ]\n ],\n ]);\n }", "public function store()\n {\n Pages::create([\n 'title' => request()->get('title'),\n 'permalink' => request()->get('permalink'),\n 'description' => request()->get('description'),\n 'keywords' => request()->get('keywords'),\n 'content' => request()->get('content'),\n 'position' => request()->get('position'),\n 'status' => request()->get('status'),\n 'displayOrder' => request()->get('displayOrder'),\n ]);\n\n return redirect()->to('/admin/pages');\n }", "public function run()\n {\n \\App\\Models\\Page::create([\n 'title' => 'Terms',\n 'body' => $this->terms(),\n 'post_type' => 'page',\n 'author_id' => 1\n ]);\n\n \\App\\Models\\Page::create([\n 'title' => 'Policy',\n 'body' => $this->privacy(),\n 'post_type' => 'page',\n 'author_id' => 1\n ]);\n\n \\App\\Models\\Page::create([\n 'title' => 'Contact',\n 'body' => null,\n 'post_type' => 'page',\n 'author_id' => 1\n ]);\n }", "public function run()\n {\n\n $types = [\n 'NEWS',\n 'SUPPORT',\n ];\n $faker = Faker\\Factory::create();\n $data = [];\n\n foreach ($types as $type) {\n\n for ($i = 0; $i <= 10; $i++) {\n\n $cat_id = 1;\n $title = $faker->paragraph;\n $data[] = [\n 'pos_title' => $title,\n 'pos_rewrite' => removeTitle($title),\n 'pos_image' => $faker->image(dirname(__FILE__) . '/../../public/upload/', 254, 169,\n 'technics', false),\n 'pos_teaser' => $faker->paragraph(2),\n 'pos_content' => $faker->paragraph(10),\n 'pos_active' => 1,\n 'pos_category_id' => $cat_id,\n 'pos_is_hot' => round(rand(0, 1)),\n 'pos_show_home' => round(rand(0, 1)),\n 'pos_type' => strtoupper($type)\n ];\n }\n }\n\n $table = $this->table('posts');\n $table->truncate();\n $table->insert($data)\n ->save();\n }", "function generate($type, $data = NULL, $content = NULL) {\n\t\t$registerLoginButtons = $_SERVER['DOCUMENT_ROOT'].'/resources/markup/account_panel/register_login.html';\n\t\t$adminLogoutButtons = $_SERVER['DOCUMENT_ROOT'].'/resources/markup/account_panel/admin_logout.html';\n\t\t$accountLogoutButtons = $_SERVER['DOCUMENT_ROOT'].'/resources/markup/account_panel/account_logout.html';\n\t\t$posts = $_SERVER['DOCUMENT_ROOT'].'/database/posts.txt';\n\n\t\t$Backend = new Backend(); //create object to run backend processes\n\n\t\t$this->content = NULL;\t\t\t\t\n\t\tswitch ($type) {\n\t\t\tcase 'posts':\n\t\t\tcase 'posts_page':\n\t\t\tcase 'posts_admin':\n\t\t\t\t$this->handle = fopen($posts, 'r');\n\t\t\t\twhile($line = fgets($this->handle)) {\n\t\t\t\t\t$postId = explode('::', $line); //[0] = title, [1] = id, [2] = link, [3] = type, [4] = author\n\n foreach ($postId as $element)\n $element = str_replace(\"\\r\\n\", \"\", $element);\n //$postId[1] = str_replace(\"\\r\\n\",\"\",$postId[1]);\n\n\t\t\t\t\tswitch ($type) {\n\t\t\t\t\t\tcase 'posts':\n $subText = $postId[3];\n switch ($subText) {\n case 'image_link':\n $subText = 'Image';\n break;\n case 'text_area':\n $subText = 'Text';\n break;\n case 'link':\n $subText = 'Link';\n break;\n }\n\t\t\t\t\t\t\t$this->content = $this->content.'<a href=\"/post/'.$postId[1].'/\" class=\"list-group-item\"><h4 class=\"list-group-item-heading\">'.$postId[0].'</h4><p class=\"list-group-item-text\">'.$subText.'</p></a>';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'posts_admin':\n\t\t\t\t\t\t\t$this->content = $this->content.'<a href=\"/post/'.$postId[1].'/\" class=\"list-group-item\"><h4 class=\"list-group-item-heading\">'.$postId[0].'</h4><p class=\"list-group-item-text\"><form id=\"submit\" action=\"/admin/remove/\" method=\"post\"><input type=\"hidden\" name=\"id\" value='.$postId[1].'><input type=\"hidden\" name=\"type\" value=\"posts\"><button type=\"submit\" class=\"btn btn-default btn-xs\">Remove</button></form></p></a>';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'posts_page':\n if (strcmp($data, $postId[1]) == 0) {\n\t\t\t\t\t\t\t $this->content = $Backend->generatePostContent($postId);\n global $postFound;\n $postFound = TRUE;\n break 2;\n }\n $this->content = '<h2 class=\"center\">Post not found.</h2>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\tfclose($this->handle);\n\t\t \tbreak;\n\t\t\tcase 'account_panel':\n\t\t\t\tif (!isset($_SESSION))\n\t\t\t\t\tsession_start();\n\n\t\t\t\tif (isset ($_SESSION['userString'])) {\n\t\t\t\t\t$this->content = '<body>'.$_SESSION['userString'].'</body>';\n\t\t\t\t\tswitch ($this->levelCheck($_SESSION['userLevel'])) {\n\t\t\t\t\t\tcase 2: //user is an admin\n\t\t\t\t\t\t\t$this->content = $this->content.file_get_contents($adminLogoutButtons);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t$this->content = $this->content.file_get_contents($accountLogoutButtons);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse //no one is logged in\n\t\t\t\t\t$this->content = $this->content.file_get_contents($registerLoginButtons);\n\t\t \tbreak;\n\n\t\t\tcase 'accounts_admin': //list the accounts with admin options to remove\n\t\t\t\t$accounts = $_SERVER['DOCUMENT_ROOT'].'/database/accounts.txt';\n\t\t\t\t$this->handle = fopen($accounts, 'r');\n\n\t\t\t\twhile($line = fgets($this->handle)) {\n\t\t\t\t\t$credentials = explode('::', $line);\n\n\t\t\t\t\tforeach ($credentials as $element)\n\t\t\t\t\t\t$element = str_replace(\"\\r\\n\", \"\", $element);\n\n\t\t\t\t\t$this->content = $this->content.'<a href=\"\" class=\"list-group-item\"><h4 class=\"list-group-item-heading\">'.$credentials[0].'</h4><p class=\"list-group-item-text\"><form id=\"submit\" action=\"/admin/remove/\" method=\"post\"><input type=\"hidden\" name=\"username\" value=\"'.$credentials[0].'\"><input type=\"hidden\" name=\"type\" value=\"accounts\"><button type=\"submit\" class=\"btn btn-default btn-xs\">Remove</button></form></p></a>';\n\t\t\t\t}\n\t\t\t break;\n\n case 'notices_admin':\n $notices = $_SERVER['DOCUMENT_ROOT'].'/database/notices.txt';\n $this->handle = fopen($notices,'r');\n\n while($line = fgets($this->handle)) {\n $this->content = $this->content.$line.'<form id=\"submit\" action=\"/admin/remove/\" method=\"post\"><input type=\"hidden\" name=\"type\" value=\"notices\"><input type=\"hidden\" name=\"notice\" value=\"'.$line.'\"><button type=\"submit\" class=\"btn btn-default btn-xs\">Remove</button></form>';\n }\n fclose($this->handle);\n break;\n\n case 'comments':\n $this->handle = fopen($posts, 'r');\n while($line = fgets($this->handle)) {\n $postId = explode('::', $line); //[0] = title, [1] = id, [2] = link, [3] = type, [4] = author\n foreach ($postId as $element)\n $element = str_replace(\"\\r\\n\", \"\", $element);\n if (strcmp($data, $postId[1]) == 0) {\n $this->content = $this->content.$Backend->generateComments($postId); //postid array and post id string\n }\n }\n fclose($this->handle);\n break;\n\n case 'notices':\n $notices = $_SERVER['DOCUMENT_ROOT'].'/database/notices.txt';\n $this->handle = fopen($notices,'r');\n\n while($line = fgets($this->handle)) {\n $this->content = $this->content.$this->generateError($line);\n }\n fclose($this->handle);\n break;\n\t\t}\n\t\treturn $this->content;\n\n\t exit();\n\t}", "public static function getPpType() {\n return self::PP_TYPE_NAME;\n }", "function wv_create_post($title, $content, $postType = 'page') {\n $my_post = array(\n 'post_title' => $title,\n 'post_content' => $content,\n 'post_status' => 'publish',\n 'post_author' => 1,\n 'post_type' => $postType\n );\n\n // Insert the post into the database\n $pid = wp_insert_post($my_post);\n return $pid;\n }", "function poi_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'poi Types', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'poiType', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'poi', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'poi Type', 'text_domain' ),\n\t\t'archives' => __( 'poi Archives', 'text_domain' ),\n\t\t'attributes' => __( 'poi Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent poi', 'text_domain' ),\n\t\t'all_items' => __( 'All poi', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New poi', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'new_item' => __( 'New poi', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit poi', 'text_domain' ),\n\t\t'update_item' => __( 'Update poi', 'text_domain' ),\n\t\t'view_item' => __( 'View poi', 'text_domain' ),\n\t\t'view_items' => __( 'View pois', 'text_domain' ),\n\t\t'search_items' => __( 'Search poi', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into poi', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this poi', 'text_domain' ),\n\t\t'items_list' => __( 'pois list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'pois list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter pois list', 'text_domain' ),\n\t);\n\t$rewrite = array(\n\t\t'slug' => 'poi',\n\t\t'with_front' => true,\n\t\t'pages' => true,\n\t\t'feeds' => true,\n\t);\n\t$args = array(\n\t\t'label' => __( 'poiType', 'text_domain' ),\n\t\t'description' => __( 'poi Type Description', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => true,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-editor-customchar',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => $rewrite,\n\t\t'capability_type' => 'post',\n\t\t'show_in_rest' => true,\n\t);\n\tregister_post_type( 'poi_type', $args );\n\n}", "static function do_save_actions(WP_Post $p): void {\r\n self::save_title($p);\r\n self::save_all_sort_nums();\r\n }", "public function run()\n {\n //\n $tissue_types = TissueType::all();\n\n foreach ($tissue_types as $tissue_type) {\n \tswitch ($tissue_type->name) {\n \t\tcase 'Músculos':\n \t\t\t$tissue_type->slug = \"musculos\";\n \t\t\t$tissue_type->save();\n \t\t\tbreak;\n \t\t\tcase 'Huesos':\n \t\t\t\t$tissue_type->slug = \"huesos\";\n \t\t\t\t$tissue_type->save();\n \t\t\t\tbreak;\n \t\t\tcase 'Músculos Estriados':\n \t\t\t\t$tissue_type->slug = \"musculos-estriados\";\n \t\t\t\t$tissue_type->save();\n \t\t\t\tbreak;\n \t\t\tcase 'Músculos Lisos':\n \t\t\t\t$tissue_type->slug = \"musculos-lisos\";\n \t\t\t\t$tissue_type->save();\n \t\t\t\tbreak;\n\t\t\t\tcase 'Músculos Cardiacos':\n\t\t\t\t\t$tissue_type->slug = \"musculos-cardiacos\";\n\t\t\t\t\t$tissue_type->save();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Músculos Esqueléticos':\n\t\t\t\t\t$tissue_type->slug = \"musculos-esqueléticos\";\n\t\t\t\t\t$tissue_type->save();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Muscles':\n \t\t\t$tissue_type->slug = \"muscles\";\n \t\t\t$tissue_type->save();\n \t\t\tbreak;\n \t\t\tcase 'Bones':\n \t\t\t\t$tissue_type->slug = \"bones\";\n \t\t\t\t$tissue_type->save();\n \t\t\t\tbreak;\n \t\t\tcase 'Striated Muscles':\n \t\t\t\t$tissue_type->slug = \"striated-muscles\";\n \t\t\t\t$tissue_type->save();\n \t\t\t\tbreak;\n \t\t\tcase 'Smooth Muscles':\n \t\t\t\t$tissue_type->slug = \"smooth-muscles\";\n \t\t\t\t$tissue_type->save();\n \t\t\t\tbreak;\n\t\t\t\tcase 'Cardiac Muscles':\n\t\t\t\t\t$tissue_type->slug = \"cardiac-muscles\";\n\t\t\t\t\t$tissue_type->save();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Skeletal Muscles':\n\t\t\t\t\t$tissue_type->slug = \"skeletal-muscles\";\n\t\t\t\t\t$tissue_type->save();\n\t\t\t\t\tbreak;\n \t}\n }\n }", "public function run()\n {\n \\App\\GuideType::create([\n 'title' => 'Blog Post'\n ]);\n\n \\App\\GuideType::create([\n 'title' => 'Reddit Discussion'\n ]);\n\n \\App\\GuideType::create([\n 'title' => 'Video Guide'\n ]);\n\n \\App\\GuideType::create([\n 'title' => 'Replay Analysis'\n ]);\n\n \\App\\GuideType::create([\n 'title' => 'Pro Replay'\n ]);\n\n \\App\\GuideType::create([\n 'title' => 'Video Guide (Premium / Non-Free)'\n ]);\n\n \\App\\GuideType::create([\n 'title' => 'Tips n Tricks'\n ]);\n }", "function geneshop_polypeptides() {\n module_load_include('inc', 'tripal_feature', 'tripal_feature.api');\n $sql = '\n SELECT FRM.subject_id as feature_id\n FROM {gene} G\n INNER JOIN {feature_relationship} FRM ON FRM.object_id = G.gene_id\n INNER JOIN {chado_feature} CHF ON CHF.feature_id = gene_id\n WHERE chf.nid = :nid\n ';\n $data = '';\n foreach ($_SESSION['basket']['items'] as $nid => $value) {\n $args = array(':nid' => $nid);\n $result = db_query($sql, $args)->fetchObject();\n $feature_id = $result->feature_id;\n $sequence = array();\n $sequence = tripal_get_feature_sequences(\n array(\n 'feature_id' => $feature_id,\n ),\n array(\n 'aggregate' => 1,\n 'relationship_type' => 'derives_from',\n 'relationship_part' => 'object',\n 'is_html' => 0\n )\n );\n if (count($sequence)>0) {\n $data .= \">\".$sequence[0][defline].\"\\n\";\n if ($sequence[0]['residues']) { //if there are sequences in residues\n $sequence[0]['residues'] = strtoupper($sequence[0]['residues']);\n $data .= $sequence[0]['residues'].\"\\n\";\n }\n }\n }\n drupal_add_http_header('Content-Type: text/plain');\n print $data;\n drupal_exit();\n}", "function processPage($pageid, $pagetext)\n{\n\tglobal $tmpl_count, $param_count, $ohndl, $wikiname;\n\n\t$templates = getTemplates($pagetext);\n\tif (empty($templates)) return;\n\n\t$values = array();\n\n\tforeach ($templates as $template) {\n\t\tif (empty($template['params'])) continue;\n\t\t++$tmpl_count;\n\t\t$tmplname = sqlquote($template['name']);\n\n\t\tforeach ($template['params'] as $key => $value) {\n\t\t\t++$param_count;\n\t\t\t$key = sqlquote($key);\n\t\t\tif (strlen($value) > 1024) $value = substr($value, 0, 1024);\n\t\t\t$value = sqlquote($value);\n\t\t\t$values[] = \"($pageid,'$tmplname','$key','$value')\";\n\t\t}\n\t}\n\n\tif (empty($values)) return;\n\n\t$values = implode(',', $values);\n\n\tfwrite($ohndl, \"INSERT INTO `$wikiname` VALUES $values;\\n\");\n}", "protected function AssignPageTypeFields() {\n $this->AddField('showmap', self::DT_BOOLEAN, true);\n $this->AddField('mapaddress', self::DT_STRING);\n }", "public function store() {\n \t$this->middleware('is.allowed');\n\t $content = Input::get('Editor1');\n\t $page = new Page;\n\t $page->content = $content;\n\t $page->title = Input::get('title');\n\t $slug = Input::get('slug');\n\t $page->slug = str_replace(array(\"/\", ' '), \"_\", $slug);\n\t $page->parent_id = Input::get('parent');\n\t $publish = Input::get('publish');\n\t if (isset($publish)) {\n\t\t$page->status = 'Published';\n\t } else {\n\t\t$page->status = 'Unpublished';\n\t }\n\t $page->save();\n\t return redirect('cms/pages');\n }", "public function run()\n {\n $time = time();\n\n DB::table('article_category')->insert([\n [\n 'type_id' => 1, // Announcements\n 'parent_id' => null,\n 'name' => 'Press Releases',\n 'slug' => 'press-releases',\n 'public' => 1,\n 'parent_public' => 1,\n 'created_at' => $time,\n 'updated_at' => $time,\n ],\n [\n 'type_id' => 1, // Announcements\n 'parent_id' => null,\n 'name' => 'General',\n 'slug' => 'general',\n 'public' => 1,\n 'parent_public' => 1,\n 'created_at' => $time,\n 'updated_at' => $time,\n ],\n [\n 'type_id' => 2, // Knowledgebase\n 'parent_id' => null,\n 'name' => 'Getting Started',\n 'slug' => 'getting-started',\n 'public' => 1,\n 'parent_public' => 1,\n 'created_at' => $time,\n 'updated_at' => $time,\n ],\n [\n 'type_id' => 2, // Knowledgebase\n 'parent_id' => null,\n 'name' => 'Customisation',\n 'slug' => 'customisation',\n 'public' => 1,\n 'parent_public' => 1,\n 'created_at' => $time,\n 'updated_at' => $time,\n ],\n [\n 'type_id' => 2, // Knowledgebase\n 'parent_id' => 4,\n 'name' => 'API',\n 'slug' => 'api',\n 'public' => 1,\n 'parent_public' => 1,\n 'created_at' => $time,\n 'updated_at' => $time,\n ],\n [\n 'type_id' => 2, // Knowledgebase\n 'parent_id' => 4,\n 'name' => 'Plugins',\n 'slug' => 'plugins',\n 'public' => 0,\n 'parent_public' => 1,\n 'created_at' => $time,\n 'updated_at' => $time,\n ],\n [\n 'type_id' => 3, // Documentation\n 'parent_id' => null,\n 'name' => 'Installation',\n 'slug' => 'installation',\n 'public' => 1,\n 'parent_public' => 1,\n 'created_at' => $time,\n 'updated_at' => $time,\n ],\n [\n 'type_id' => 3, // Documentation\n 'parent_id' => null,\n 'name' => 'Release Notes',\n 'slug' => 'release-notes',\n 'public' => 1,\n 'parent_public' => 1,\n 'created_at' => $time,\n 'updated_at' => $time,\n ]\n ]);\n\n // Activity Log\n $this->activityLog([\n [ 'rel_id' => 1, 'rel_name' => 'Press Releases' ],\n [ 'rel_id' => 2, 'rel_name' => 'General' ],\n [ 'rel_id' => 3, 'rel_name' => 'Getting Started' ],\n [ 'rel_id' => 4, 'rel_name' => 'Customisation' ],\n [ 'rel_id' => 5, 'rel_name' => 'API' ],\n [ 'rel_id' => 6, 'rel_name' => 'Plugins' ],\n [ 'rel_id' => 7, 'rel_name' => 'Installation' ],\n [ 'rel_id' => 8, 'rel_name' => 'Release Notes' ],\n ]);\n }", "public function run()\n {\n $document = new Documento_tipo;\n $document->nome = 'CPF';\n $document->descricao = 'Copia o CPF da pessoa';\n $document->save();\n\n $document = new Documento_tipo;\n $document->nome = 'Comprovante de Residência';\n $document->descricao = 'Documento que comprova a moradia do estudante';\n $document->save();\n\n $document = new Documento_tipo;\n $document->nome = 'Comprovante de Matrícula';\n $document->descricao = 'Documento que comprova a matrícula do estudante em uma instituição escolar';\n $document->save();\n\n $document = new Documento_tipo;\n $document->nome = 'Termo de Uso de Imagem e Voz';\n $document->descricao = 'Documento que comprova que os responsáveis estão de acordo com o uso de imagem e voz do estudante';\n $document->save();\n }", "public function run()\n {\n Page::create([\n 'title' => 'Front Page',\n 'content' => '\n <p>Platanus is an established hotel in Barrio Barretto that offers leisure and recreation\n within the hustle of Barretto, Olongapo City. Only 10 minutes away from the bars and\n restaurants that offer a broad selection of diverse cuisines from all over the world. </p>\n\n <p>The hotel ensures guests comfort and gives them the quality service. With 9 spacious air-conditioned rooms,\n among the amenities offered are complimentary Wi-Fi access, non-smoking rooms, cable TV, air-conditioned rooms,\n private bathroom with hot and cold water, some rooms have access to a balcony.</p>\n\n <p>Take a breather in the hotel\\'s incredible facilities like an outdoor swimming pool, fitness center, massage, and garden area where you can sit back and laze.</p>\n <p>Hotel Platanus is an excellent choice for quality accommodation in Barretto for daily and long term stay.</p>',\n ]);\n\n Page::create([\n 'title' => 'Side Description',\n 'content' => '<p>Set in Clark, 32 km from Mount Pinatubo, Platanus Hotel features an outdoor swimming pool.\n Featuring a restaurant, the property also has a garden. The property offers a 24-hour front desk. </p>',\n ]);\n }", "public function store(Request $request)\n {\n\n $objectLanguage = array();\n $language = Language::pluck('key')->toArray();\n\n\n\n $validator = Validator::make($request->all(), [\n 'name' => 'required',\n 'label' => 'required|max:255',\n ]);\n\n if ($validator->passes()){\n\n\n $field = new PageFields();\n\n $field->label = $request->input('label');\n $field->name = $request->input('name');\n $field->type = $request->input('type');\n $field->rule = $request->input('rule');\n $field->slugable = $request->input('slugable');\n $field->page_type_id = $request->input('page_type_id');\n\n if($request->input('type') == \"text\" || $request->input('type') == \"editor\"){\n\n foreach ($language as $key) {\n $objectLanguage[$key] = \"\";\n }\n\n $field->model = $objectLanguage;\n\n\n }else{\n $field->model = $request->input('name');\n }\n\n $field->save();\n\n $entities = PageEntity::where('type_id', $request->input('page_type_id'))->get();\n\n if ($entities != null){\n foreach ($entities as $entity){\n\n $collection = new PageCollection();\n $collection->entity_id = $entity->id;\n $collection->field_id = $field->id;\n $collection->field_name = $field->name;\n $collection->field_type = $field->type;\n $collection->value = $field->model;\n $collection->save();\n\n if($collection->field_type == \"gallery\"){\n $entityGallery = new PageEntityGallery();\n $entityGallery->entity_id = $entity->id;\n $entityGallery->field_id = $field->id;\n $entityGallery->save();\n }\n }\n\n }\n\n return $field;\n }\n\n return response()->json([\"errors\" => $validator->messages()], 422);\n }", "public function getPageTypes() {}", "public function run()\n {\n $type = new Type();\n $type->name =\"Hourly\";\n $type->save();\n $type = new Type();\n $type->name =\"Fixed Price\";\n $type->save();\n $type = new Type();\n $type->name =\"Contract\";\n $type->save();\n $type = new Type();\n $type->name =\"FullTime\";\n $type->save();\n $type = new Type();\n $type->name =\"Internship\";\n $type->save();\n $type = new Type();\n $type->name =\"Volunteer\";\n $type->save();\n }", "public function index() {\n $data['paragraphs'] = DB::table('paragraph')->where('type', 'P')->get();\n $data['rows'] = Paragraph::where('type', 'R')->get();\n return view('index', $data);\n }", "function pro_types($op = null)\n{\n global $user;\n $editorid = $user->uid;\n\n $Block['title'] = 'Professional Type';\n $content = '';\n $time = time();\n \n $_ProType = _pro_roles();\n $type_keys = implode(',',array_keys($_ProType));\n if($op == 'view' || $op == null)\n {\n $sql = \"select count(rid) as cnt, rid from users_roles, maenna_people where rid in ($type_keys) and uid = pid and (delete_marker is null or delete_marker != 1) group by rid\";\n \n $result = db_query($sql);\n while(($Row = db_fetch_object($result)) !== false)\n {\n $cnt = $Row->cnt;\n $rid = $Row->rid;\n $type = $_ProType[\"$rid\"];\n $content .= \"<div class=row style='padding:2px 0;position:relative;'><div style='position:absolute;text-align:right;width:100%'>$cnt</div>$type</div>\";\n }\n// $content .= \"<div style='border-top:solid 1px #ebebeb;text-align:right;'>\".\n// \"<a href='/account?a=professionals&panel=pro_types_panel'>more</a></div>\";\n $Block['body'] = sidebar_box($Block['title'], $content);\n }\n return $Block;\n}", "public function run()\n {\n DB::table('page')->insert([\n 'title1' => 'Home',\n 'page_type' => 'home',\n 'status' => 1,\n 'show_in_menu' => 1,\n 'rank' => 1,\n ]);\n\n DB::table('page')->insert([\n 'title1' => 'About Us',\n 'lsug' => str_slug('About Us'),\n 'page_type' => 'page',\n 'status' => 1,\n 'show_in_menu' => 1,\n 'rank' => 2,\n ]);\n\n DB::table('page')->insert([\n 'title1' => 'What is and Why - COSMETIC TATTOO?',\n 'page_type' => 'what-is-and-why-cosmetic-tattoo',\n 'status' => 1,\n 'show_in_menu' => 0,\n 'rank' => 25,\n ]);\n\n }", "public function getProcessTypes() {\n return array(\n 'media_seller',\n 'ad_network',\n 'product',\n // Publisher is requested per publisher ID.\n 'publisher',\n );\n }", "function create_post_type(){\n\n\t/*|>>>>>>>>>>>>>>>>>>>> SLIDER HOME <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels = array(\n\t\t'name' => __('Slider Home'),\n\t\t'singular_name' => __('Slider'),\n\t\t'add_new' => __('Nuevo Slider'),\n\t\t'add_new_item' => __('Agregar nuevo Slider Principal'),\n\t\t'edit_item' => __('Editar Slider'),\n\t\t'view_item' => __('Ver Slider'),\n\t\t'search_items' => __('Buscar Slider'),\n\t\t'not_found' => __('Slider no encontrado'),\n\t\t'not_found_in_trash' => __('Slider no encontrado en la papelera'),\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => true,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag','banner_category'),\n\t\t'menu_icon' => 'dashicons-nametag',\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> SERVICIOS <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels2 = array(\n\t\t'name' => __('Servicios'),\n\t\t'singular_name' => __('Servicio'),\n\t\t'add_new' => __('Nuevo Servicio'),\n\t\t'add_new_item' => __('Agregar nuevo Servicio'),\n\t\t'edit_item' => __('Editar Servicio'),\n\t\t'view_item' => __('Ver Servicio'),\n\t\t'search_items' => __('Buscar Servicios'),\n\t\t'not_found' => __('Servicio no encontrado'),\n\t\t'not_found_in_trash' => __('Servicio no encontrado en la papelera'),\n\t);\n\n\t$args2 = array(\n\t\t'labels' => $labels2,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes' ),\n\t\t'taxonomies' => array( 'servicio_category' , 'post_tag' ),\n\t\t'menu_icon' => 'dashicons-exerpt-view',\n\t);\t\n\n\t/*|>>>>>>>>>>>>>>>>>>>> CLIENTES <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels3 = array(\n\t\t'name' => __('Clientes'),\n\t\t'singular_name' => __('Sector o Categoría'),\n\t\t'add_new' => __('Nuevo Sector o Categoría'),\n\t\t'add_new_item' => __('Agregar nuevo Sector o Categoría'),\n\t\t'edit_item' => __('Editar Sector o Categoría'),\n\t\t'view_item' => __('Ver Sector o Categoría'),\n\t\t'search_items' => __('Buscar Sector o Categoría'),\n\t\t'not_found' => __('Sector o Categoría no encontrado'),\n\t\t'not_found_in_trash' => __('Sector o Categoría no encontrado en la papelera'),\n\t);\n\n\t$args3 = array(\n\t\t'labels' => $labels3,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-money',\n\t);\t\n\n\t\n\t/*|>>>>>>>>>>>>>>>>>>>> GALERÍA IMAGENES <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels4 = array(\n\t\t'name' => __('Gal. Imágenes'),\n\t\t'singular_name' => __('Galería'),\n\t\t'add_new' => __('Nueva Galería'),\n\t\t'add_new_item' => __('Agregar nueva Galería'),\n\t\t'edit_item' => __('Editar Galería'),\n\t\t'view_item' => __('Ver Galería'),\n\t\t'search_items' => __('Buscar Galería'),\n\t\t'not_found' => __('Galería no encontrada'),\n\t\t'not_found_in_trash' => __('Galería no encontrada en la papelera'),\n\t);\n\n\t$args4 = array(\n\t\t'labels' => $labels4,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-images-alt2',\n\t);\t\n\n\t/*|>>>>>>>>>>>>>>>>>>>> GALERÍA VIDEOS <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels5 = array(\n\t\t'name' => __('Gal. Videos'),\n\t\t'singular_name' => __('Video'),\n\t\t'add_new' => __('Nuevo Video'),\n\t\t'add_new_item' => __('Agregar nuevo Video'),\n\t\t'edit_item' => __('Editar Video'),\n\t\t'view_item' => __('Ver Video'),\n\t\t'search_items' => __('Buscar Video'),\n\t\t'not_found' => __('Video no encontrado'),\n\t\t'not_found_in_trash' => __('Video no encontrado en la papelera'),\n\t);\n\n\t$args5 = array(\n\t\t'labels' => $labels5,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag','category'),\n\t\t'menu_icon' => 'dashicons-video-alt',\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> PRODUCTOS <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels6 = array(\n\t\t'name' => __('Productos La Dorita'),\n\t\t'singular_name' => __('Producto'),\n\t\t'add_new' => __('Nuevo Producto'),\n\t\t'add_new_item' => __('Agregar nuevo Producto'),\n\t\t'edit_item' => __('Editar Producto'),\n\t\t'view_item' => __('Ver Producto'),\n\t\t'search_items' => __('Buscar Producto'),\n\t\t'not_found' => __('Producto no encontrado'),\n\t\t'not_found_in_trash' => __('Producto no encontrado en la papelera'),\n\t);\n\n\t$args6 = array(\n\t\t'labels' => $labels6,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-cart',\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> REGISTRAR <<<<<<<<<<<<<<<<<<<<|*/\n\tregister_post_type( 'slider-home' , $args );\n\tregister_post_type( 'servicio' , $args2 );\n\tregister_post_type( 'cliente' , $args3 );\n\tregister_post_type( 'galery-images' , $args4 );\n\tregister_post_type( 'galery-videos' , $args5 );\n\tregister_post_type( 'producto-dorita' , $args6 );\n\n\tflush_rewrite_rules();\n}", "public function run()\n {\n $now = date(\"Y-m-d H:i:s\");\n DB::table('petition_types')->insert([\n [\n 'id' =>1,\n 'title' =>'Título Tipo1',\n 'header_address' =>'IV',\n 'header_num_process' => 'S',\n 'header_author' =>'QC',\n 'header_culprit' =>'QC',\n 'header_name_action' =>'LB',\n 'active' =>1, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>2,\n 'title' =>'Título Tipo2',\n 'header_address' =>'NV',\n 'header_num_process' =>\"N\",\n 'header_author' =>'JQ',\n 'header_culprit' =>'JQ',\n 'header_name_action' =>'ML',\n 'active' => 0, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>3,\n 'title' =>'Título Tipo3',\n 'header_address' =>'IV',\n 'header_num_process' =>'S',\n 'header_author' =>'QC',\n 'header_culprit' =>'JQ',\n 'header_name_action' =>'ML',\n 'active' =>1, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>4,\n 'title' =>'Título Tipo3',\n 'header_address' =>'NV',\n 'header_num_process' =>'N',\n 'header_author' =>'JQ',\n 'header_culprit' =>'QC',\n 'header_name_action' =>'LB',\n 'active' =>0, \n 'created_at' => $now,\n 'updated_at' => $now,\n ],\n [\n 'id' =>5,\n 'title' =>'Título Tipo1',\n 'header_address' =>'IV',\n 'header_num_process' => 'S',\n 'header_author' =>'QC',\n 'header_culprit' =>'QC',\n 'header_name_action' =>'LB',\n 'active' =>1, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>6,\n 'title' =>'Título Tipo2',\n 'header_address' =>'NV',\n 'header_num_process' =>\"N\",\n 'header_author' =>'JQ',\n 'header_culprit' =>'JQ',\n 'header_name_action' =>'ML',\n 'active' => 0, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>7,\n 'title' =>'Título Tipo3',\n 'header_address' =>'IV',\n 'header_num_process' =>'S',\n 'header_author' =>'QC',\n 'header_culprit' =>'JQ',\n 'header_name_action' =>'ML',\n 'active' =>1, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>8,\n 'title' =>'Título Tipo3',\n 'header_address' =>'NV',\n 'header_num_process' =>'N',\n 'header_author' =>'JQ',\n 'header_culprit' =>'QC',\n 'header_name_action' =>'LB',\n 'active' =>0, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>9,\n 'title' =>'Título Tipo1',\n 'header_address' =>'IV',\n 'header_num_process' => 'S',\n 'header_author' =>'QC',\n 'header_culprit' =>'QC',\n 'header_name_action' =>'LB',\n 'active' =>1, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>10,\n 'title' =>'Título Tipo2',\n 'header_address' =>'NV',\n 'header_num_process' =>\"N\",\n 'header_author' =>'JQ',\n 'header_culprit' =>'JQ',\n 'header_name_action' =>'ML',\n 'active' => 0, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>11,\n 'title' =>'Título Tipo3',\n 'header_address' =>'IV',\n 'header_num_process' =>'S',\n 'header_author' =>'QC',\n 'header_culprit' =>'JQ',\n 'header_name_action' =>'ML',\n 'active' =>1, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>12,\n 'title' =>'Título Tipo3',\n 'header_address' =>'NV',\n 'header_num_process' =>'N',\n 'header_author' =>'JQ',\n 'header_culprit' =>'QC',\n 'header_name_action' =>'LB',\n 'active' =>0, \n 'created_at' => $now,\n 'updated_at' => $now,\n ],\n [\n 'id' =>13,\n 'title' =>'Título Tipo1',\n 'header_address' =>'IV',\n 'header_num_process' => 'S',\n 'header_author' =>'QC',\n 'header_culprit' =>'QC',\n 'header_name_action' =>'LB',\n 'active' =>1, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>14,\n 'title' =>'Título Tipo2',\n 'header_address' =>'NV',\n 'header_num_process' =>\"N\",\n 'header_author' =>'JQ',\n 'header_culprit' =>'JQ',\n 'header_name_action' =>'ML',\n 'active' => 0, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>15,\n 'title' =>'Título Tipo3',\n 'header_address' =>'IV',\n 'header_num_process' =>'S',\n 'header_author' =>'QC',\n 'header_culprit' =>'JQ',\n 'header_name_action' =>'ML',\n 'active' =>1, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n [\n 'id' =>16,\n 'title' =>'Título Tipo3',\n 'header_address' =>'NV',\n 'header_num_process' =>'N',\n 'header_author' =>'JQ',\n 'header_culprit' =>'QC',\n 'header_name_action' =>'LB',\n 'active' =>0, \n 'created_at' => $now,\n 'updated_at' => $now,\n ], \n ]);\n }", "public static function post_type(){}", "function proyecto_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'proyectos', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'proyecto', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Post Types', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n\t\t'archives' => __( 'Item Archives', 'text_domain' ),\n\t\t'attributes' => __( 'Item Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n\t\t'all_items' => __( 'All Items', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Item', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'new_item' => __( 'New Item', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Item', 'text_domain' ),\n\t\t'update_item' => __( 'Update Item', 'text_domain' ),\n\t\t'view_item' => __( 'View Item', 'text_domain' ),\n\t\t'view_items' => __( 'View Items', 'text_domain' ),\n\t\t'search_items' => __( 'Search Item', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n\t\t'items_list' => __( 'Items list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'proyecto', 'text_domain' ),\n\t\t'description' => __( 'personalización del proyecto', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-images-alt2',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'proyecto', $args );\n\n}" ]
[ "0.62758553", "0.60319227", "0.59696245", "0.5949527", "0.59222096", "0.58391273", "0.5837216", "0.57955337", "0.57569593", "0.55926216", "0.5566034", "0.5523942", "0.53163064", "0.52020603", "0.51821727", "0.50831866", "0.50666434", "0.50259", "0.50124466", "0.50022495", "0.49741724", "0.49400347", "0.49322578", "0.49286786", "0.4900704", "0.48918027", "0.4890061", "0.48749217", "0.4867249", "0.48098138", "0.47906435", "0.47791436", "0.477574", "0.47722858", "0.47699904", "0.47601345", "0.4751439", "0.4748037", "0.47209376", "0.47167882", "0.47088766", "0.47057727", "0.46993536", "0.4684154", "0.46636572", "0.46591133", "0.46401182", "0.46348795", "0.46112654", "0.4606776", "0.45928708", "0.4588471", "0.45865378", "0.45839137", "0.45802587", "0.45773134", "0.45769015", "0.45745423", "0.4573521", "0.45732504", "0.45636123", "0.4561637", "0.45567465", "0.4556629", "0.4542145", "0.45412534", "0.45393607", "0.45299044", "0.4528867", "0.4527874", "0.45238742", "0.45223856", "0.45208114", "0.45132715", "0.45113155", "0.45054376", "0.45023975", "0.44993135", "0.4498675", "0.44958103", "0.44912001", "0.44891506", "0.44889963", "0.44863907", "0.44850636", "0.44803715", "0.44704467", "0.44540423", "0.4449761", "0.44433975", "0.4442994", "0.44331428", "0.44251797", "0.44192347", "0.4414095", "0.4412584", "0.44093195", "0.44084167", "0.44013685", "0.44011575" ]
0.58974266
5
Returns paths for specified term IDs.
function _taxonomy_menu_trails_get_paths($tids, $entity, $settings) { $paths = array(); switch ($settings['term_path']) { case 'custom': foreach ($tids as $tid) { $term_paths = str_replace('[tid]', $tid, $settings['term_path_patterns']); $paths = array_merge($paths, $term_paths); } break; case 'api': // We have to keep tids order for the final paths array. // First fill paths array with "tid => array()" map. $paths = array_combine($tids, array_fill(0, count($tids), array())); // Call hook implementations and fill paths array for each term. $hook = 'taxonomy_menu_trails_get_paths'; foreach (module_implements($hook) as $module) { $function = $module . '_' . $hook; if (function_exists($function)) { // Use call_user_func() to force passing arguments by value, not by // reference. $results = call_user_func($function, $tids, $settings['entity_type'], $entity, $settings); if (empty($results) || !is_array($results)) { continue; } foreach ($results as $tid => $term_paths) { if (empty($term_paths)) { continue; } if (is_string($term_paths)) { $paths[$tid][] = $term_paths; } elseif (is_array($term_paths)) { $paths[$tid] = array_merge($paths[$tid], $term_paths); } } } } // For terms with empty mappings fallback to default path. For the rest // make sure paths are unique. foreach ($paths as $tid => $term_paths) { if (empty($term_paths)) { $paths[$tid][] = _taxonomy_menu_trails_default_term_path($tid); } else { $paths[$tid] = array_unique($paths[$tid]); } } // Merge paths into flat array. The order of tids will be kept. $paths = call_user_func_array('array_merge', $paths); break; case 'tm': if (module_exists('taxonomy_menu')) { // Unfortunately, there is no way to get tids-vids map without DB query. // If you know one, please create issue and describe method. $vids = db_select('taxonomy_term_data', 'ttd') ->fields('ttd', array('tid', 'vid')) ->condition('ttd.tid', $tids, 'IN') ->execute() ->fetchAllKeyed(); foreach ($tids as $tid) { if (isset($vids[$tid])) { $paths[] = taxonomy_menu_create_path($vids[$tid], $tid); } else { $paths[] = _taxonomy_menu_trails_default_term_path($tid); } } break; } // Fallback to default path when Taxonomy Menu module not exists anymore. default: foreach ($tids as $tid) { $paths[] = _taxonomy_menu_trails_default_term_path($tid); } } return $paths; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function path(string ...$_ids): string\n {\n return \\implode(self::PATH_DELIMITER, $_ids);\n }", "function term_relationships_handler( $object_id, $term_ids ) {\n\t\tforeach ( (array)$term_ids as $term_id ) {\n\t\t\t$this->term_relationship_handler( $object_id, $term_id );\n\t\t}\n\t}", "public function getPaths();", "public function getPathsWithIds($path_ids) {\n return $this->get('get_paths_with_ids', ['path_ids' => $this->toArray($path_ids)]);\n }", "public function retrieveObjectIds( $termId = 0, $args = array() )\n\t{\n\t\tif( 0 === $termId ) {\n\t\t\treturn false;\n\t\t}\n\t\n\t\tif( !is_array($args) ) {\n\t\t\t$args = array($args);\n\t\t}\n\t\n\t\t$ids = get_objects_in_term( $termId, $this->taxomomyStr, $args );\n\t\n\t\tif( empty( $ids ) || is_wp_error( $ids ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn $ids;\n\t\t}\n\t}", "public function getPath($id);", "public static function getPath($id);", "abstract protected function paths();", "function term_taxonomies_handler( $tt_ids ) {\n\t\tforeach( (array)$tt_ids as $tt_id ) {\n\t\t\t$this->term_taxonomy_handler( $tt_id );\n\t\t}\n\t}", "function _muckypup_database_get_term_ids ($vocabularies) {\n\n $terms = array ();\n \n foreach ($vocabularies as $vocabulary) {\n if ($vocabulary != 0) {\n $term_tree = taxonomy_get_tree($vocabulary);\n \n foreach ($term_tree as $term_branch) {\n $terms[] = $term_branch->tid;\n }\n }\n }\n\n\treturn $terms;\n}", "public function getHandledPaths();", "protected function getSearchPaths() {}", "public function setTaxonomyPaths($paths);", "public static function getTermAndSubIds($termId, $taxonomy)\n {\n $termIds = array($termId);\n $subs = get_categories(array(\n 'child_of' => $termId,\n 'hide_empty' => false,\n 'taxonomy' => $taxonomy\n ));\n foreach ($subs as $sub) {\n $termIds[] = $sub->term_id;\n }\n\n return $termIds;\n }", "protected static function getPathsInternal() {}", "public function get_taxonomy_terms( $post_id = null, $taxonomy = null ) {\n\n\t\tif ( ! $post_id || ! $taxonomy ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$term_uris = array();\n\n\t\t$terms = wp_get_post_terms( $post_id, $taxonomy, array( 'fields' => 'ids' ) );\n\n\t\tif ( is_wp_error( $terms ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( $terms ) {\n\t\t\tforeach ( $terms as $term ) {\n\n\t\t\t\t$ptv_id = get_term_meta( $term, 'uri', true );\n\n\t\t\t\tif ( $ptv_id ) {\n\t\t\t\t\t$term_uris[] = sanitize_text_field( $ptv_id );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $term_uris ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $term_uris;\n\t}", "public function getTerms($term)\n {\n return $this->terms = wp_get_post_terms($this->id, $term);\n }", "private function mk_paths(string $id) {\n\t\t$this->dir_path = LIBRESIGNAGE_ROOT.SLIDES_DIR.'/'.$id;\n\t\t$this->conf_path = $this->dir_path.'/conf.json';\n\t\t$this->asset_path = $this->dir_path.'/assets';\n\t}", "public function getPath($path, $entity_id);", "function rest_get_route_for_term($term)\n {\n }", "public function searchPaths() {\n\n $searchQuery = Input::get('searchQuery');\n\n\t\t$keywords = explode(\" \", $searchQuery);\n\n\t\t// Create empty array of paths\n\t\t$paths = array();\n\n\t\t// Iterate through each keyword\n foreach ($keywords as $keyword) {\n \t// Get tag by keyword\n $tags = Tag::where('name', '=', $keyword)->get();\n\n // For each tag (should be only one)\n foreach ($tags as $tag) {\n \t// Get all paths corresponding to this tag\n \t$tmpPaths = $tag->paths->all();\n \t// Add all paths from this tag to paths array\n \t$paths = array_merge($paths, $tmpPaths);\n }\n\n // Find all paths that have keyword in the title\n $titlePaths = Path::where('title', 'LIKE', '%' . $keyword . '%')->get()->all();\n // and merge with other paths\n $paths = array_merge($paths, $titlePaths);\n }\n\n // Remove duplicates\n $paths = array_unique($paths);\n return View::make(\"search.results\", array(\"paths\" => $paths));\n\t}", "function set_object_terms_handler( $object_id, $terms, $tt_ids ) {\n\t\t$this->term_relationships_handler( $object_id, $tt_ids );\n\t}", "public function get_pathnames_for_class(int $classid) {\n // Find all pathids relating to $classid\n $query = $this->db\n ->select('pathname')\n ->from('classexercise')\n ->join('exercisedir','classexercise.pathid=exercisedir.id')\n ->where('classexercise.classid',$classid)\n ->get();\n\n $pathset = array(); // This is used as a set\n foreach ($query->result() as $row) {\n // Find all templates for a relevant student relating to each path\n\n // We need to escape parentheses i pathnames twice. So ( becomes \\\\(\n $escaped_pathname = str_replace(\"\\\\\",\"\\\\\\\\\",addcslashes($row->pathname,\"()\"));\n\n $query2 = $this->db\n ->select('pathname')\n ->where(\"pathname REGEXP '^{$this->quizzespath}/$escaped_pathname/[^/]*$'\")\n ->get('sta_quiztemplate');\n foreach ($query2->result() as $row2)\n $pathset[$row2->pathname] = true;\n }\n\n $result = array();\n $prefix_length = strlen($this->quizzespath . '/');\n foreach ($pathset as $pathname => $ignore)\n $result[] = substr($pathname,$prefix_length,-4); // Strip prefix and '.3et'\n\n sort($result);\n return $result;\n }", "protected function _evalPath($id = 0){\n\t\t$db = new DB_WE();\n\t\t$path = '';\n\t\tif($id == 0){\n\t\t\t$id = $this->ParentID;\n\t\t\t$path = $this->Text;\n\t\t}\n\n\t\t$result = getHash('SELECT Text,ParentID FROM ' . $this->_table . ' WHERE ' . $this->_primaryKey . '=' . intval($id), $db);\n\t\t$path = '/' . (isset($result['Text']) ? $result['Text'] : '') . $path;\n\t\t$pid = isset($result['ParentID']) ? intval($result['ParentID']) : 0;\n\t\twhile($pid > 0){\n\t\t\t$result = getHash('SELECT Text,ParentID FROM ' . $this->_table . ' WHERE ' . $this->_primaryKey . '=' . $pid, $db);\n\t\t\t$path = '/' . $result['Text'] . $path;\n\t\t\t$pid = intval($result['ParentID']);\n\t\t}\n\t\treturn $path;\n\t}", "function get_term_custom_keys( $term_id = 0 ) {\n\t$custom = get_term_custom( $term_id );\n\n\tif ( !is_array( $custom ) )\n\t\treturn;\n\n\tif ( $keys = array_keys( $custom ) )\n\t\treturn $keys;\n}", "public function getTaxonomyTerm($id, $taxonomy);", "public static function getPath($id) {\n\t\treturn self::$defaultInstance->getPath($id);\n\t}", "public function getTaxonomyTerms();", "public function getPaths()\n\t{\n\t\treturn [\n '/containers/winnative/api/context',\n\t\t];\n\t}", "public function get_terms( $post_id , $slugs = false ){\n\t\t\n\t\t$terms = get_the_terms( $post_id , $this->get_slug() );\n\t\t\n\t\tif ( ! is_array( $terms ) ) $terms = array();\n\t\t\n\t\tif ( $slugs ){\n\t\t\t\n\t\t\t$term_slugs = array();\n\t\t\t\n\t\t\tforeach( $terms as $term ){\n\t\t\t\t\n\t\t\t\t$term_slugs[] = $term->slug;\n\t\t\t\t\n\t\t\t} // end foreach\n\t\t\t\n\t\t\treturn $term_slugs;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\treturn $terms;\n\t\t\t\n\t\t} // end if\n\t\t\n\t}", "public static function getAllSdById($term){\n // ->join('clienttype as ct', function($join){\n // $join->on('c.ClientType', '=', 'ct.ClientTypeID');\n // })\n // ->join('acctstat as as', function($join){\n // $join->on('c.AccountStatus', '=', 'as.AcctStatID');\n // })\n // ->where('c.ClientID', '=', $clientIdSd)\n // ->get();\n\n return DB::table('client as c')\n ->join('clienttype as ct', function($join) {\n $join->on('c.ClientType', '=', 'ct.ClientTypeID');\n })\n ->join('acctstat as acs', function($join){\n $join->on('c.AccountStatus', '=', 'acs.AcctStatID');\n })\n ->where('c.ClientID', '=', $term)\n ->orWhere('c.FName', 'like', '%'.$term.'%')\n ->orWhere('c.LName', 'like', '%'.$term.'%')\n // ->where('c.AccountStatus', '=', $status)\n // ->orWhere('c.AccountStatus', '=', $status)\n // ->orWhere('c.AccountStatus', '=', $status)\n ->paginate(10);\n }", "public function getLocations(array $glyphIds) {}", "protected function buildPath($ref_ids)\n\t{\n\t\tinclude_once 'Services/Link/classes/class.ilLink.php';\n\n\t\tif (!count($ref_ids)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$result = array();\n\t\tforeach ($ref_ids as $ref_id) {\n\t\t\t$path = \"\";\n\t\t\t$path_full = self::dic()->tree()->getPathFull($ref_id);\n\t\t\tforeach ($path_full as $idx => $data) {\n\t\t\t\tif ($idx) {\n\t\t\t\t\t$path .= \" &raquo; \";\n\t\t\t\t}\n\t\t\t\tif ($ref_id != $data['ref_id']) {\n\t\t\t\t\t$path .= $data['title'];\n\t\t\t\t} else {\n\t\t\t\t\t$path .= ('<a target=\"_top\" href=\"' . ilLink::_getLink($data['ref_id'], $data['type']) . '\">' . $data['title'] . '</a>');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$result[] = $path;\n\t\t}\n\n\t\treturn $result;\n\t}", "function get_all_nodes_belong_to_taxonomy_hierarchy($tids) {\n if (is_array($tids)) {\n foreach ($tids as $key => $value) {\n if ($value <= 0) {\n return \"Please Enter a valid taxonomy term id set\";\n }\n }\n }\n if (is_array($tids) && !empty($tids)) {\n foreach ($tids as $key => $value) {\n $term = taxonomy_term_load($value);\n $hierarchical_terms_object[] = taxonomy_get_tree($term->vid, $term->tid);\n }\n $flat_terms_object = multitosingle($hierarchical_terms_object);\n if (is_array($flat_terms_object) && !empty($flat_terms_object)) {\n foreach ($flat_terms_object as $key => $value) {\n $flat_tids[] = $value->tid;\n }\n $flat_tids[] = $tids;\n return array_unique(get_nodes_directly_mapped_to_term($flat_tids));\n }\n else {\n $flat_tids = $tids;\n return array_unique(get_nodes_directly_mapped_to_term($flat_tids));\n }\n }\n elseif (!is_array($tids) && $tids > 0) {\n $flat_tids = $tids;\n return get_all_nodes_belong_to_taxonomy_hierarchy(array($flat_tids));\n }\n else {\n return \"Please Enter a valid term id\";\n }\n}", "public function path(/* array */ $id): string {\n $torrentId = $id[0];\n $logId = $id[1];\n $key = strrev(sprintf('%04d', $torrentId));\n return sprintf('%s/%02d/%02d', self::STORAGE, substr($key, 0, 2), substr($key, 2, 2))\n . '/' . $torrentId . '_' . $logId . '.html';\n }", "public function get_paths()\n\t{\n\t\tif ( ! ee()->session->cache(__CLASS__, 'paths'))\n\t\t{\n\t\t\t$paths = array();\n\t\t\t$upload_prefs = $this->get_file_upload_preferences(NULL, NULL, TRUE);\n\n\t\t\tif (count($upload_prefs) == 0)\n\t\t\t{\n\t\t\t\treturn $paths;\n\t\t\t}\n\n\t\t\tforeach ($upload_prefs as $row)\n\t\t\t{\n\t\t\t\t$paths[$row['id']] = $row['url'];\n\t\t\t}\n\n\t\t\tee()->session->set_cache(__CLASS__, 'paths', $paths);\n\t\t}\n\n\t\treturn ee()->session->cache(__CLASS__, 'paths');\n\t}", "public function getAdminsForPath($path_id) {\n return $this->get('get_admins_for_path', ['path_id' => $path_id]);\n }", "public function getCategoryPath($id){\n\t\t\t$cat = $this->getNodeById($id);\t\n\t\t\t$return = array();\n\t\t\tif($cat != null){\n\t\t\t\twhile(!$cat->getCategory()->isServiceRoot()){\n\t\t\t\t\t$return[] = $cat->getCategory();\n\t\t\t\t\t$cat = $this->getNodeById($cat->getParentId());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $return;\n\t\t}", "public function get_paths() {\n return array(new convert_path('question_categories', '/MOODLE_BACKUP/QUESTION_CATEGORIES'));\n }", "public function path(/* array */$id) {\n $key = strrev(sprintf('%04d', $id));\n $k1 = substr($key, 0, 2);\n $k2 = substr($key, 2, 2);\n return sprintf('%s/%02d/%02d/%d.torrent', self::STORAGE, $k1, $k2, $id);\n }", "function custom_taxonomies_terms_links( $post_id ){\n // get post by post id\n $post = get_post( $post_id );\n\n // get post type by post\n $post_type = $post->post_type;\n\n // get post type taxonomies\n $taxonomies = get_object_taxonomies( $post_type, 'objects' );\n\n $out = array();\n foreach ( $taxonomies as $taxonomy_slug => $taxonomy ){\n\n // get the terms related to post\n $terms = get_the_terms( $post_id, $taxonomy_slug );\n\n if ( !empty( $terms ) ) {\n $out[] = \"<h2>\" . $taxonomy->label . \"</h2>\\n<ul>\";\n foreach ( $terms as $term ) {\n $out[] =\n ' <li><a href=\"'\n . get_term_link( $term->slug, $taxonomy_slug ) .'\">'\n . $term->name\n . \"</a></li>\\n\";\n }\n $out[] = \"</ul>\\n\";\n }\n }\n\n return implode('', $out );\n}", "function currentTypes($id){\n\t$term_id = get_the_terms($id, 'marcato_type');\n\t$terms = \"\";\n\tforeach($term_id as $genre){\n\t//\tprint_r($genre->name);\n\t\t$terms .= strtolower($genre->name) . \" \";\n\t}\n\n\treturn $terms;\n}", "public function index() {\n // Loads all terms by vocabulary.\n $vid = 'sas_normativa';\n $output = [];\n // Gets only father terms.\n $query = \\Drupal::database()\n ->select('taxonomy_term_data', 'td')\n ->fields('td', ['tid']);\n $query->join('taxonomy_term_hierarchy', 'th', 'td.tid = th.tid');\n $query->condition('td.vid', $vid)\n ->condition('th.parent', 0);\n $parent_tids = $query->execute()->fetchCol();\n\n foreach ($parent_tids as $tid) {\n /** @var \\Drupal\\taxonomy\\Entity\\Term $term */\n $term = Term::load($tid);\n $term_url = current($term->get('field_map_url')->getValue());\n $url = filter_var($term_url['uri'], FILTER_VALIDATE_URL) ? $term_url['uri'] : '#';\n\n $output[$term->id()] = [\n 'name' => $term->getName(),\n 'url' => $url,\n ];\n\n // Check if parent has children.\n $children = \\Drupal::entityTypeManager()\n ->getStorage('taxonomy_term')\n ->loadTree($vid, $term->id());\n if (!empty($children)) {\n foreach ($children as $child) {\n /** @var \\Drupal\\taxonomy\\Entity\\Term $term_child */\n $term_child = Term::load($child->tid);\n $term_url = current($term_child->get('field_map_url')->getValue());\n $url = filter_var($term_url['uri'], FILTER_VALIDATE_URL) ? $term_url['uri'] : '#';\n $output[$term->id()]['children'][] = [\n 'name' => $term_child->getName(),\n 'url' => $url,\n ];\n }\n }\n }\n\n return [\n '#theme' => 'map_url',\n '#terms' => $output,\n '#attached' => [\n 'library' => ['map_url/map_url'],\n ],\n ];\n }", "public function find(string $term, string $namespace) : array;", "public function getUrlsPaths($storeId)\r\n {\r\n $adapter = $this->_getReadAdapter();\r\n $select = $adapter->select()\r\n ->from($this->getTable('core/url_rewrite'), array('request_path'))\r\n ->where('store_id=?', $storeId)\r\n ->where('is_system=1');\r\n return $adapter->fetchCol($select);\r\n }", "function mini_get_term_id_by_pid( $pid ){\n \n $terms = get_the_terms( $pid, 'project_tax' );\n\nif ( $terms && ! is_wp_error( $terms ) ){ \n \n $p_terms = array();\n \n foreach ( $terms as $term ) {\n $p_terms[] = $term->term_id;\n }\n \n return $p_terms;\n } else {\n return [];\n //return $p_terms;\n }\n}", "function _get_svn_paths( $def, $base = '' ) {\n\t\t$depth = substr_count( $def, '*' ) - 1;\n\n\t\t$path_rels = array( $base );\n\n\t\t$i = 0;\n\t\tdo {\n\t\t\t$at_depth_paths = array();\n\t\t\tforeach ( $path_rels as $base ) {\n\t\t\t\tif ( !$these_paths = $this->svn->ls( $this->svn_url . $base, 'type=dir' ) )\n\t\t\t\t\tcontinue;\n\t\t\t\tforeach ( $these_paths as $this_path )\n\t\t\t\t\t$at_depth_paths[] = $base . $this_path;\n\t\t\t}\n\n\t\t\t$path_rels = $at_depth_paths;\n\n\t\t\t$i++;\n\t\t} while ( $i <= $depth );\n\n\t\t$return = Automattic_Paths::group( $path_rels, $def );\n\n\t\treturn $return;\n\t}", "public static function getPath($id)\n\t{\n\t\t$sql = \"SELECT c.*, p.level, p.order \"\n\t\t\t. \"FROM \" . self::$PathTable . \" p \"\n\t\t\t. \"JOIN \" . self::$ClientTable . \" c ON c.`id`=p.`parent` \"\n\t\t\t. \"WHERE p.`id`={$id} ORDER BY p.`order`\";\n\t\treturn self::query($sql);\n\t}", "function insert_wp_term_relationships($wpdb, $id, $in_args){\n $args = explode(',' , $in_args);\n $table = $wpdb->prefix.\"terms\";\n foreach($args as $a)\n {\n $q = \"SELECT term_id FROM \".$table.\" WHERE name = '\".strtoupper($a).\"'\";\n $terms = $wpdb->get_results($wpdb->prepare($q));\n foreach($terms as $t)\n {\n $arr = array(\n 'object_id' => $id,\n 'term_taxonomy_id' => $t->term_id,\n );\n $wpdb->insert($wpdb->prefix.'term_relationships', $arr);\n }\n }\n}", "public function setTaxonomyIds(&$var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->taxonomy_ids = $arr;\n }", "public static function findAllByTerm($term, $parentId)\n {\n $QueryBuilder = self::getQueryBuilder()\n ->select('iddepartamento,nombre,estado')\n ->from('departamento')\n ->where('pais_idpais = :parentId')\n ->andWhere('nombre like :like')\n ->setParameter(':like', \"%{$term}%\")\n ->orderBy('nombre', 'asc');\n\n return self::findByQueryBuilder($QueryBuilder);\n }", "function get_nodes_directly_mapped_to_term($tid) {\n if (is_array($tid) && !empty($tid)) {\n foreach ($tid as $key => $value) {\n $nids[] = taxonomy_select_nodes($value);\n $flat_nids = multitosingle($nids);\n }\n return $flat_nids;\n }\n else {\n $nid = taxonomy_select_nodes($tid);\n return $nid;\n }\n}", "function wp_get_split_terms($old_term_id)\n {\n }", "private function _getRequestPaths()\n {\n $paths = array();\n \n // Find maxPages with the ceil of the total properties / the maximum\n // pageSize\n $maxPages = ceil($this->getTotal() / $this->getMaxPageSize());\n \n // Use plus one as the first page will have already be requested\n for ($i = $this->getPage() + 1; $i <= $maxPages; $i++) {\n $paths[] = $this->getRequestPath($i, $this->getMaxPageSize());\n }\n \n return $paths;\n }", "public function getRequestPaths($storeId)\r\n {\r\n $storeIdExpr = $this->_getReadAdapter()->getIfNullSql('url_category.store_id', 'url_product.store_id');\r\n\r\n $select = $this->_getReadAdapter()->select()\r\n ->from(array('url_rewrite' => $this->getTable('core_url_rewrite/url_rewrite')),\r\n array('request_path', 'store_id' => $storeIdExpr))\r\n ->joinLeft(array('url_product' => $this->getTable('ves_urlrewrite/product')),\r\n 'url_product.url_rewrite_id = url_rewrite.url_rewrite_id AND ' .\r\n $this->_getReadAdapter()->quoteInto('url_product.store_id = ?', $storeId),\r\n array()\r\n )\r\n ->joinLeft(array('url_category' => $this->getTable('ves_urlrewrite/category')),\r\n 'url_category.url_rewrite_id = url_rewrite.url_rewrite_id AND ' .\r\n $this->_getReadAdapter()->quoteInto('url_category.store_id = ?', $storeId),\r\n array()\r\n )\r\n ->where('is_system = ?', 1);\r\n\r\n $result = $this->_getReadAdapter()->fetchAll($select);\r\n $requestPaths = array();\r\n foreach ($result as $item) {\r\n if ($storeId == $item['store_id']) {\r\n $requestPaths[] = $item['request_path'];\r\n }\r\n }\r\n return $requestPaths;\r\n }", "function get_taxonomy_term_ids_inside_vocab($vocab_machine_name) {\n $vocab = taxonomy_vocabulary_machine_name_load($vocab_machine_name);\n if (is_object($vocab)) {\n $term_tree = taxonomy_get_tree($vocab->vid);\n if (is_array($term_tree) && !empty($term_tree)) {\n foreach ($term_tree as $key => $value) {\n $tids[] = $value->tid;\n }\n } if (empty($term_tree)) {\n $tids = array();\n }\n } else\n return \"No Vocab Found with the given name\";\n\n return ($tids);\n}", "function custom_taxonomies_terms_links($post_ID){\n // get post by post id\n $post = get_post( $post_ID );\n \n // get post type by post\n $post_type = $post->post_type;\n \n // get post type taxonomies\n $taxonomies = get_object_taxonomies( $post_type, 'objects' );\n \n $out = array();\n \n foreach ( $taxonomies as $taxonomy_slug => $taxonomy ){\n \n // get the terms related to post\n $terms = get_the_terms( $post->ID, $taxonomy_slug );\n \n if ( !empty( $terms ) ) {\n foreach ( $terms as $term ) {\n $out[] = $term->slug;\n }\n }\n }\n \n return implode(' ', $out );\n}", "public function get_paths() {\n return array(\n new convert_path('roles', '/MOODLE_BACKUP/ROLES'),\n new convert_path(\n 'roles_role', '/MOODLE_BACKUP/ROLES/ROLE',\n array(\n 'newfields' => array(\n 'description' => '',\n 'sortorder' => 0,\n 'archetype' => ''\n )\n )\n )\n );\n }", "public static function action_clean_term_cache( $term_ids ) {\n\t\t$keys = array();\n\t\t$term_ids = is_array( $term_ids ) ? $term_ids : array( $term_id );\n\t\tforeach ( $term_ids as $term_id ) {\n\t\t\t$keys[] = 'term-' . $term_id;\n\t\t\t$keys[] = 'rest-term-' . $term_id;\n\t\t}\n\t\tpantheon_wp_clear_edge_keys( $keys );\n\t}", "public function getPaths()\n {\n return $this->paths;\n }", "public function getStudentsForPath($path_id) {\n return $this->get('get_students_for_path', ['path_id' => $path_id]);\n }", "public function getPaths(): array\n {\n return $this->paths;\n }", "public function getPaths(): array\n {\n return $this->paths;\n }", "final public function get_paths() {\n return array();\n }", "public function setPaths($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->paths = $arr;\n\n return $this;\n }", "public function getTerms($service_id) {\n $stmt = $this->conn->prepare(\"SELECT * FROM `terms` where service_id = ?\");\n $stmt->bind_param(\"i\", $service_id);\n $stmt->execute();\n $terms = $stmt->get_result();\n $stmt->close();\n return $terms;\n }", "public function listPaths(callable $filter = null): array\n {\n return iterator_to_array($this->scanPaths($filter));\n }", "public function actionRoleSearch($id, $target, $term = '')\n {\n $authManager = Yii::$app->authManager;\n $avaliable = [];\n $assigned = [];\n foreach ($authManager->getRolesByUser($id) as $role) {\n $type = $role->type;\n $assigned[$type == Item::TYPE_ROLE ? 'Roles' : 'Permissions'][$role->name] = $role->name;\n }\n foreach ($authManager->getRoles() as $role) {\n if (!isset($assigned['Roles'][$role->name])) {\n $avaliable['Roles'][$role->name] = $role->name;\n }\n }\n foreach ($authManager->getPermissions() as $role) {\n if ($role->name[0] !== '/' && !isset($assigned['Permissions'][$role->name])) {\n $avaliable['Permissions'][$role->name] = $role->name;\n }\n }\n\n $result = [];\n $var = ${$target};\n if (!empty($term)) {\n foreach (['Roles', 'Permissions'] as $type) {\n if (isset($var[$type])) {\n foreach ($var[$type] as $role) {\n if (strpos($role, $term) !== false) {\n $result[$type][$role] = $role;\n }\n }\n }\n }\n } else {\n $result = $var;\n }\n\n return Html::renderSelectOptions('', $result);\n }", "function penci_get_term_parents( $term_id = '', $taxonomy = 'category' ) {\n\t\t$list = array();\n\n\t\t// If no term ID or taxonomy is given, return an empty array.\n\t\tif ( empty( $term_id ) || empty( $taxonomy ) ) {\n\t\t\treturn $list;\n\t\t}\n\n\t\tdo {\n\t\t\t$list[] = $term_id;\n\n\t\t\t// Get next parent term\n\t\t\t$term = get_term( $term_id, $taxonomy );\n\t\t\t$term_id = $term->parent;\n\t\t} while ( $term_id );\n\n\t\t// Reverse the array to put them in the proper order for the trail.\n\t\t$list = array_reverse( $list );\n\t\tarray_pop( $list );\n\n\t\treturn $list;\n\t}", "protected function getTermsForSelect($view, $id)\n {\n $customVocab = $view->api()->read('custom_vocabs', $id)->getContent();\n $terms = array_map('trim', preg_split(\"/\\r\\n|\\n|\\r/\", $customVocab->terms()));\n return array_combine($terms, $terms);\n }", "private function listKeywords($idSetter)\n\t{\n\t\t$sql = <<<END_SQL\nSELECT theWord\nFROM keyword\nWHERE idSetter=:idSetter\nORDER BY theWord;\nEND_SQL;\n\t\t$stmt = $this->dbx->prepare($sql);\n\t\t$stmt->execute(array(\n\t\t\t\":idSetter\" => $idSetter,\n\t\t));\n\t\t$words = $stmt->fetchAll(PDO::FETCH_ASSOC) ?: array();\n\n\t\t// We now need to rearrange the keywords as an associative array ...\n\t\t$records = array();\n\t\t$count = count($words);\n\t\tfor ($i = 0; $i < $count; ++$i)\n\t\t{\n\t\t\t$key = $words[$i][\"theWord\"];\n\t\t\t$records[strtolower($key)] = $key;\n\t\t}\n\n\t\treturn array\n\t\t(\n\t\t\t\"action\" => \"list\",\n\t\t\t\"table\" => \"keyword\",\n\t\t\t\"idSetter\" => $idSetter,\n\t\t\t\"records\" => $records,\n\t\t);\n\t}", "function _fullcalendar_colors_filter_term_ids($fields) {\n $term_ids = array();\n foreach ($fields as $key => $value) {\n foreach ($value as $language => $term) {\n foreach ($term as $content) {\n if (isset($content['tid'])) {\n $term_ids[] = $content['tid'];\n }\n }\n }\n }\n return $term_ids;\n}", "private function get_post_terms_urls( WP_Post $post ) {\r\n\t\t$urls = [];\r\n\t\t$taxonomies = get_object_taxonomies( get_post_type( $post->ID ), 'objects' );\r\n\r\n\t\tforeach ( $taxonomies as $taxonomy ) {\r\n\t\t\tif ( ! $taxonomy->public || 'product_shipping_class' === $taxonomy->name ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Get the terms related to post.\r\n\t\t\t$terms = get_the_terms( $post->ID, $taxonomy->name );\r\n\r\n\t\t\tif ( empty( $terms ) || is_wp_error( $terms ) ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ( $terms as $term ) {\r\n\t\t\t\t$term_url = get_term_link( $term->slug, $taxonomy->name );\r\n\t\t\t\tif ( ! is_wp_error( $term_url ) ) {\r\n\t\t\t\t\t$urls[] = $term_url;\r\n\t\t\t\t}\r\n\t\t\t\tif ( ! is_taxonomy_hierarchical( $taxonomy->name ) ) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$ancestors = (array) get_ancestors( $term->term_id, $taxonomy->name );\r\n\t\t\t\tforeach ( $ancestors as $ancestor ) {\r\n\t\t\t\t\t$ancestor_object = get_term( $ancestor, $taxonomy->name );\r\n\t\t\t\t\tif ( ! $ancestor_object instanceof WP_Term ) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$ancestor_term_url = get_term_link( $ancestor_object->slug, $taxonomy->name );\r\n\t\t\t\t\tif ( ! is_wp_error( $ancestor_term_url ) ) {\r\n\t\t\t\t\t\t$urls[] = $ancestor_term_url;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t/**\r\n\t\t * Filter the list of taxonomies URLs\r\n\t\t *\r\n\t\t * @since 1.1.0\r\n\t\t *\r\n\t\t * @param array $urls List of taxonomies URLs\r\n\t\t*/\r\n\t\treturn apply_filters( 'rocket_post_terms_urls', $urls );\r\n\t}", "public function getSeedPaths();", "function gigx_get_the_term_list( $id = 0, $taxonomy, $before = '', $sep = '', $after = '', $exclude = array() ) {\n\t$terms = get_the_terms( $id, $taxonomy );\n\n\tif ( is_wp_error( $terms ) )\n\t\treturn $terms;\n\n\tif ( empty( $terms ) )\n\t\treturn false;\n\n\tforeach ( $terms as $term ) {\n\n\t\tif(!in_array($term->term_id,$exclude)) {\n\t\t\t$link = get_term_link( $term, $taxonomy );\n\t\t\tif ( is_wp_error( $link ) )\n\t\t\t\treturn $link;\n\t\t\t$term_links[] = '<a href=\"' . $link . '\" rel=\"tag\">' . $term->name . '</a>';\n\t\t}\n\t}\n\n\t$term_links = apply_filters( \"term_links-$taxonomy\", $term_links );\n\n\treturn $before . join( $sep, $term_links ) . $after;\n}", "public function lookup($ids, $options = []);", "function get_SOUR_rows(Tree $tree, $term) {\n\treturn Database::prepare(\n\t\t\"SELECT s_id AS xref, s_gedcom AS gedcom\" .\n\t\t\" FROM `##sources`\" .\n\t\t\" WHERE s_name LIKE CONCAT('%', REPLACE(:term, ' ', '%'), '%') AND s_file = :tree_id\" .\n\t\t\" ORDER BY s_name COLLATE :collation\"\n\t)->execute(array(\n\t\t'term' => $term,\n\t\t'tree_id' => $tree->getTreeId(),\n\t\t'collation' => I18N::collation(),\n\t))->fetchAll();\n}", "function term_relationship_handler( $object_id, $term_id ) {\n\t\t$this->add_ping( 'db', array( 'term_relationship' => array( 'object_id' => $object_id, 'term_taxonomy_id' => $term_id ) ) );\n\t}", "function get_REPO_rows(Tree $tree, $term) {\n\treturn Database::prepare(\n\t\t\"SELECT o_id AS xref, o_gedcom AS gedcom\" .\n\t\t\" FROM `##other`\" .\n\t\t\" JOIN `##name` ON o_id = n_id AND o_file = n_file\" .\n\t\t\" WHERE n_full LIKE CONCAT('%', REPLACE(:term, ' ', '%'), '%') AND o_file = :tree_id AND o_type = 'REPO'\" .\n\t\t\" ORDER BY n_full COLLATE :collation\"\n\t)->execute(array(\n\t\t'term' => $term,\n\t\t'tree_id' => $tree->getTreeId(),\n\t\t'collation' => I18N::collation(),\n\t))->fetchAll();\n}", "private function has_tax_children( $term_id, $tax ) {\n\t\t$child = new \\WP_Term_Query( [\n\t\t\t'taxonomy' => $tax,\n\t\t\t'parent' => $term_id,\n\t\t\t'fields' => 'ids',\n\t\t] );\n\n\t\treturn empty( $child->get_terms() ) ? [] : $child->get_terms();\n\t}", "public function getPaths()\n {\n return array_map(function (ScriptBranch $branch) {\n return $branch->getPath();\n }, $this->descriptorMap);\n }", "function get_content_category_ids($str_ids){\n if(!$str_ids)\n return;\n $fs_table = FSFactory::getClass('fstable'); \n \n\t\t // search for category\n \n $query = \" SELECT id,alias\n FROM \".$fs_table -> getTable('fs_aq_categories').\"\n WHERE id IN (\".$str_ids.\")\n \";\n \n global $db;\n $sql = $db->query($query);\n $result = $db->getObjectList();\n $array_alias = array();\n if($result)\n\t foreach ($result as $item){\n\t \t$array_alias[$item -> id] = $item -> alias;\n\t }\n return $array_alias;\n\t\t}", "protected function get_paths()\n {\n\n return array(\n WP_LANG_DIR . '/' . $this->textdomain . '-' . get_locale() . '.mo',\n Kirki::$path . '/languages/' . $this->textdomain . '-' . get_locale() . '.mo',\n );\n\n }", "function path( $categoryID=0 )\r\n {\r\n if ( $categoryID == 0 )\r\n {\r\n $categoryID = $this->ID;\r\n }\r\n\r\n $category = new eZImageCategory( $categoryID );\r\n\r\n $path = array();\r\n\r\n $parent = $category->parent();\r\n\r\n if ( $parent != 0 )\r\n {\r\n $path = array_merge( $path, $this->path( $parent->id() ) );\r\n }\r\n else\r\n {\r\n// array_push( $path, $category->name() );\r\n }\r\n\r\n if ( $categoryID != 0 )\r\n array_push( $path, array( $category->id(), $category->name() ) );\r\n\r\n return $path;\r\n }", "public function loadArrayByTaxonID($searchTerm) {\n global $connection;\n $returnvalue = array();\n $operator = \"=\";\n // change to a like search if a wildcard character is present\n if (!(strpos($searchTerm,\"%\")===false)) { $operator = \"like\"; }\n if (!(strpos($searchTerm,\"_\")===false)) { $operator = \"like\"; }\n $sql = \"SELECT DeterminationID FROM determination WHERE TaxonID $operator '$searchTerm'\";\n $preparedsql = \"SELECT DeterminationID FROM determination WHERE TaxonID $operator ? \";\n if ($statement = $connection->prepare($preparedsql)) { \n $statement->bind_param(\"s\", $searchTerm);\n $statement->execute();\n $statement->bind_result($id);\n while ($statement->fetch()) { ;\n $obj = new huh_determination();\n $obj->load($id);\n $returnvalue[] = $obj;\n }\n $statement->close();\n }\n return $returnvalue;\n }", "public static function getSentence($term_id, $term, $em, $max_width = 40) {\n $str_r = self::getContext(\n \"SELECT t.content FROM AppBundle\\Entity\\Token t WHERE t.id > ?1 ORDER BY t.id\", \n $term_id, 1, $em, $max_width);\n \n $str_l = self::getContext(\"SELECT t.content FROM AppBundle\\Entity\\Token t WHERE t.id < ?1 ORDER BY t.id DESC\", \n $term_id, 2, $em, $max_width);\n \n return array($str_l, $term, $str_r);\n }", "function _get_path($pid) {\n\t\t\t\t$set = new NestedSet();\n\t\t\t\t$set->set_table_name($this->mod_tbl);\n\t\t\t\treturn $set->getPath($pid);\n\t\t\t}", "function getTextPath($id = \"0\", $urlPrefix = '') {\n if($id == \"\") { $id = \"0\"; }\n $treeRecord = $this->getTreeRecord($id);\n\n if($treeRecord != null) {\n if($treeRecord->belongs_to == \"0\") {\n return \"/ \".$treeRecord->title;\n } else {\n $path = $this->getTextPath($treeRecord->belongs_to, $urlPrefix);\n return $path . \" / \" . $treeRecord->title;\n }\n } else {\n return \"/ \";\n }\n }", "protected function getSchemeIdsAffectingTermVisibility(): array {\n // TODO: This pattern of loading and enumerating schemes is repeated in at\n // least 7 places in the TAC Lite code . It should be refactored out into a\n // settings repository service object. That's too big a lift for a security\n // patch, so it is not being tackled at this time.\n $settings = \\Drupal::config('tac_lite.settings');\n $schemes = $settings->get('tac_lite_schemes');\n\n $scheme_ids = [];\n\n for ($scheme_index = 1; $scheme_index <= $schemes; $scheme_index++) {\n $config = SchemeForm::tacLiteConfig($scheme_index);\n\n if ($config['term_visibility']) {\n $scheme_ids[] = $scheme_index;\n }\n }\n\n return $scheme_ids;\n }", "public function getTerms(NodeInterface $node) {\n $tids = $this->connection->query('SELECT tid FROM {taxonomy_index} WHERE nid = :nid', array(':nid' => $node->id()))->fetchCol();\n return Term::loadMultiple($tids);\n }", "private function setPathR($id){\n $branch = $this->getChildrens($id);\n\n if(!empty($branch)){\n foreach($branch as $item){\n $this->setPath($item['node']['id']);\n $this->setPathR($item['node']['id']);\n };\n };\n }", "function update_termmeta_cache($term_ids)\n {\n }", "public function getByIds($ids){\r\n\t\t$pfx = $this->c->dbprefix;\r\n\t\t$conn = $this->conn();\r\n\r\n\t\t$sql = \"select\r\n\t\t\tid,type,title,optionlength,\r\n\t\t\toption1,option2,option3,option4,option5,option6,option7,\r\n\t\t\tdescription,cent,id_quiz,id_parent,layout,path_listen\r\n\t\t\t from \".$pfx.\"wls_question where id in (\".$ids.\") or (id_parent !=0 and id_parent in (\".$ids.\")) order by id; \";\r\n\r\n\t\t$res = mysql_query($sql,$conn);\r\n\t\tif($res==false)die($sql);\r\n\t\t$data = array();\r\n\t\twhile($temp = mysql_fetch_assoc($res)){\r\n\t\t\tif($temp==false)die($sql);\r\n\t\t\t$temp['title'] = str_replace(\"__IMAGEPATH__\",$this->c->filePath.\"images/\",$temp['title']);\r\n\t\t\t$data[] = $temp;\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "function getPath($id = \"0\", $urlPrefix = '') {\n if($id == \"\") { $id = \"0\"; }\n $treeRecord = $this->getTreeRecord($id);\n\n if($treeRecord != null) {\n if($treeRecord->belongs_to == \"0\") {\n return \"<li class=\\\"breadcrumb-item\\\"><a href=\\\"\" . $urlPrefix . \"index.php?id=\".$treeRecord->id.\"\\\">\".$treeRecord->title.\"</a></li>\";\n } else {\n $path = $this->getPath($treeRecord->belongs_to, $urlPrefix);\n return $path . \"<li class=\\\"breadcrumb-item\\\"><a href=\\\"\" . $urlPrefix . \"index.php?id=\".$treeRecord->id.\"\\\">\" . $treeRecord->title.\"</a></li>\";\n }\n } else {\n return \"/ \";\n }\n }", "public function getItemPath($item_id)\n {\n // Finds a path to an item\n\n $path = array();\n\n //FIXME This does not return the correct path when one of the elements is a mapped element\n\n while ($item_id != 0) {\n $row = $this->db->select($this->config->item('database_table_menu') . '.item_id, ' . $this->config->item('database_table_menu') . '.parent_item_id, ' . $this->config->item('database_table_menu') . '.item_name, ' . $this->config->item('database_table_pages') . '.page_uri')\n ->where($this->config->item('database_table_menu') . '.item_id', $item_id)\n ->join($this->config->item('database_table_pages'),\n $this->config->item('database_table_pages') . '.page_id = ' . $this->config->item('database_table_menu') . '.page_id')\n ->get($this->config->item('database_table_menu'))\n ->row();\n\n if (!isset($row->parent_item_id)) {\n break;\n }\n\n $item_id = $row->parent_item_id;\n\n $path[] = $row;\n }\n\n return array_reverse($path);\n }", "public function terms() {\n\t\treturn $this->terms->terms();\n\t}", "public function getPaths()\n {\n return $this->_paths;\n }", "public function find($id)\n {\n $model = Term::find($id);\n\n if ($model) {\n return $model;\n }\n\n throw new ResourceNotFoundException('Term was not found.');\n }", "function term_handler( $term_id, $tt_id=null ) {\n\t\t$this->add_ping( 'db', array( 'term' => $term_id ) );\n\t\tif ( $tt_id )\n\t\t\t$this->term_taxonomy_handler( $tt_id );\n\t}", "public function getPathIdsUsingNestedSets($a_endnode_id, $a_startnode_id = 0)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// The nested sets algorithm is very easy to implement.\n\t\t// Unfortunately it always does a full table space scan to retrieve the path\n\t\t// regardless whether indices on lft and rgt are set or not.\n\t\t// (At least, this is what happens on MySQL 4.1).\n\t\t// This algorithms performs well for small trees which are deeply nested.\n\t\t\n\t\t$fields = array('integer','integer','integer');\n\t\t$data = array($a_endnode_id,$this->getTree()->getTreeId(),$this->getTree()->getTreeId());\n\t\t\n\t\t$query = \"SELECT T2.child \".\n\t\t\t\"FROM \".$this->getTree()->getTreeTable().\" T1, \".$this->getTree()->getTreeTable().\" T2 \".\n\t\t\t\"WHERE T1.child = %s \".\n\t\t\t\"AND T1.lft BETWEEN T2.lft AND T2.rgt \".\n\t\t\t\"AND T1.\".$this->getTree()->getTreePk().\" = %s \".\n\t\t\t\"AND T2.\".$this->getTree()->getTreePk().\" = %s \".\n\t\t\t\"ORDER BY T2.depth\";\n\n\t\t$res = $ilDB->queryF($query,$fields,$data);\n\t\t\n\t\t$takeId = $a_startnode_id == 0;\n\t\twhile($row = $ilDB->fetchAssoc($res))\n\t\t{\n\t\t\tif ($takeId || $row['child'] == $a_startnode_id)\n\t\t\t{\n\t\t\t\t$takeId = true;\n\t\t\t\t$pathIds[] = $row['child'];\n\t\t\t}\n\t\t}\n\t\treturn $pathIds ? $pathIds : array();\n\t}" ]
[ "0.6086078", "0.6037254", "0.58894396", "0.57974255", "0.5530714", "0.5480775", "0.5432417", "0.53837633", "0.5319609", "0.52858067", "0.52775437", "0.52147365", "0.5176799", "0.5167247", "0.5163217", "0.5105998", "0.50830436", "0.507903", "0.50528306", "0.50436866", "0.5041511", "0.50378925", "0.50243884", "0.5013524", "0.49944195", "0.49859428", "0.49844834", "0.49836135", "0.49717504", "0.49625337", "0.49589193", "0.4946875", "0.49430653", "0.49363473", "0.4902437", "0.49009866", "0.48895293", "0.4888308", "0.4875851", "0.48758498", "0.4863981", "0.48635894", "0.485799", "0.4834919", "0.48333174", "0.4824973", "0.48243362", "0.48197585", "0.48152608", "0.48113474", "0.4805534", "0.4802927", "0.47876105", "0.47791153", "0.47740284", "0.47530493", "0.4748203", "0.47462255", "0.47456935", "0.47409695", "0.47397628", "0.47346407", "0.47346407", "0.47267482", "0.47228765", "0.47202498", "0.47175205", "0.47121176", "0.46963164", "0.4688121", "0.46765998", "0.46748686", "0.46677595", "0.4666903", "0.46616274", "0.46575183", "0.4657007", "0.46524543", "0.4645232", "0.4642383", "0.4642193", "0.46395645", "0.46351603", "0.4628684", "0.4615704", "0.46145633", "0.46136585", "0.46067268", "0.4604457", "0.46026513", "0.4602638", "0.46007138", "0.4598037", "0.45964175", "0.45918235", "0.4590401", "0.45896015", "0.45865384", "0.45851916", "0.4585051" ]
0.6763758
0
Set active trail to entitie's term selected by method specified in settings.
function _taxonomy_menu_trails_process($entity, $settings) { $instances = $settings['instances']; $tids = array(); //TODO figure out: maybe we have to choose language in term reference fields foreach ($instances as $field) { foreach ($entity->$field as $lang => $terms) { foreach ($terms as $term) { $tids[] = $term['tid']; } } } // Filter out terms with different language if this option is enabled. if (module_exists('i18n_taxonomy') && $settings['terms_with_current_language']) { $terms = taxonomy_term_load_multiple($tids); $allowed_languages = array('und', $GLOBALS['language_content']->language); foreach($tids as $index => $tid) { if (empty($terms[$tid]) || !in_array($terms[$tid]->language, $allowed_languages)) { unset($tids[$index]); } } } if ($settings['selection_method'] == 'last') { $tids = array_reverse($tids); } // Get paths for each tid. $paths = _taxonomy_menu_trails_get_paths($tids, $entity, $settings); // Retrieve the list of menu names sorted by preference. This list is used // by menu system to get order of menus and not as a filter, we do the same. // See menu_link_get_preferred(). $menu_names = menu_get_active_menu_names(); $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC)); $query->leftJoin('menu_router', 'm', 'm.path = ml.router_path'); $query->fields('ml'); // Weight must be taken from {menu_links}, not {menu_router}. $query->addField('ml', 'weight', 'link_weight'); $query->fields('m'); $query->condition('ml.link_path', $paths, 'IN'); $query->condition('ml.hidden', '0'); if ($settings['selection_method'] == 'deepest-in-menu') { $query->orderBy('ml.depth', 'DESC'); } $query->orderBy('ml.weight', 'ASC'); $results = $query->execute(); $selected_item = FALSE; $vars = compact('menu_names', 'results', 'paths', 'selected_items', 'settings'); switch ($settings['selection_method']) { case 'first': case 'last': $selected_items = _taxonomy_menu_trails_fetch_link_simple($vars); break; case 'deepest-in-menu': $selected_items = _taxonomy_menu_trails_fetch_link_deepest($vars); break; } if (!$selected_items) { return; } // Set selected menu item as an active path for its menu. // Function menu_tree_set_path() available since Drupal 7.9, so we should // check it exists. if (function_exists('menu_tree_set_path')) { foreach($selected_items as $selected_item) { menu_tree_set_path($selected_item['menu_name'], $selected_item['link_path']); } // } // Save selected item and "set_breadcrumb" setting for // taxonomy_menu_trails_menu_breadcrumb_alter(). if (!empty($settings['set_breadcrumb'])) { foreach($selected_items as $selected_item) { $selected_item['set_breadcrumb'] = $settings['set_breadcrumb']; taxonomy_menu_trails_selected_item_for_breadcrumb($selected_item); } } // TODO: Remove workaround when Menu Block will remove its // _menu_link_get_preferred(). But it's safe to leave it here even after // Menu Block update to keep compatibility with old Menu Block releases. // So, probably it should be here forever or until the next major release. if (module_exists('menu_block')) { // Also set preferred item for Menu Block module $mb_preferred_links = &drupal_static('_menu_link_get_preferred'); foreach($selected_items as $selected_item) { $mb_preferred_links[$_GET['q']][$selected_item['menu_name']] = $selected_item; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setActiveTerm($term)\n {\n if (strlen($term)) {\n $this->putSession('term', $term);\n } else {\n $this->resetSession();\n }\n\n $this->activeTerm = $term;\n }", "public function setActiveTerm($term)\n {\n if (strlen($term)) {\n $this->putSession('term', $term);\n }\n else {\n $this->resetSession();\n }\n\n $this->activeTerm = $term;\n }", "public function menu_set_active_trail($new_trail = NULL)\n {\n return menu_set_active_trail($new_trail);\n }", "function setActive() ;", "public function setActive() {}", "public function setActive()\r\n {\r\n $this->active = true;\r\n }", "public function SetActive ($active = TRUE);", "public function setTerm($term) {\n $this->_term = $term;\n return $this;\n }", "public function setActive($value);", "public function actionManageCurrentTerm()\n {\n $message = null;\n if (isset($_POST['term'])) {\n Yii::app()->session['current_term'] = $_POST['term'];\n // echo ' Yii app session:' . Yii::app()->session['current_term'];\n $current_term = Yii::app()->session['current_term'];\n $message = \"$current_term has been selected\";\n }\n\n $term = Term::model()->getLatest();\n // echo ' Yii app session:' . Yii::app()->session['current_term'];\n // echo ' latest term id:' . $term->id;\n $this->render('manageCurrentTerm', array('term' => $term->id, 'message' => $message));\n }", "function setTermStatus($term){\n $termClass = new DatabaseTable('terms');\n $termNew = [\n 'tid'=>$term['tid'],\n 'tmid'=>$term['tmid'],\n 'tname'=>$term['tname'],\n 'tsdate'=>$term['tsdate'],\n 'tedate'=>$term['tedate'],\n 'tstatus'=>checkDateStatus($term['tsdate'], $term['tedate'])\n ];\n $termClass->update($termNew, 'tid');\n $term = $termClass->find('tid', $term['tid']);\n $term = $term->fetch();\n return $term;\n }", "public function setActive()\n\t\t{\n\t\t\t$this->_state = 1;\n\t\t}", "function setActive($a_active)\n\t{\n\t\t$this->active = $a_active;\n\t}", "function setTabs($a_tab = \"levels\")\n\t{\n\t\tglobal $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;\n\n\t\t$ilTabs->clearTargets();\n\t\t$ilHelp->setScreenIdComponent(\"skmg_skll\");\n//\t\t$ilTabs->setBackTarget($lng->txt(\"skmg_skill_hierarchie\"),\n//\t\t\t$ilCtrl->getLinkTargetByClass(\"ilobjskillmanagementgui\", \"editSkills\"));\n\n\t\tif (is_object($this->node_object))\n\t\t{\n\n\t\t\t// levels\n\t\t\t$ilTabs->addTab(\"levels\", $lng->txt(\"skmg_skill_levels\"),\n\t\t\t\t$ilCtrl->getLinkTarget($this, 'edit'));\n\t\n\t\t\t// properties\n\t\t\t$ilTabs->addTab(\"properties\", $lng->txt(\"settings\"),\n\t\t\t\t$ilCtrl->getLinkTarget($this, 'editProperties'));\n\n\t\t\t// usage\n\t\t\t$this->addUsageTab($ilTabs);\n\n\t\t\t$ilCtrl->setParameterByClass(\"ilskillrootgui\", \"obj_id\",\n\t\t\t\t$this->node_object->skill_tree->getRootId());\n\t\t\t$ilTabs->setBackTarget($lng->txt(\"obj_skmg\"),\n\t\t\t\t$ilCtrl->getLinkTargetByClass(\"ilskillrootgui\", \"listSkills\"));\n\t\t\t$ilCtrl->setParameterByClass(\"ilskillrootgui\", \"obj_id\",\n\t\t\t\t$_GET[\"obj_id\"]);\n\t\t\t\n\t\t\t$ilTabs->activateTab($a_tab);\n\n\t\t\t$tpl->setTitle($lng->txt(\"skmg_skill\").\": \".\n\t\t\t\t$this->node_object->getTitle());\n\t\t\n\t\t\t$this->setSkillNodeDescription();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tpl->setTitle($lng->txt(\"skmg_skill\"));\n\t\t\t$tpl->setDescription(\"\");\n\t\t}\n\t\tparent::setTitleIcon();\n\t}", "function autoSetActiveSYTerm()\n\t{\n require 'b_ConnectionString.php';\n\n\t\t$activeTermArray = array();\n $query = \"SELECT * from syterms WHERE isActive = 1;\";\n $tableQuery = mysqli_query($mySQL_ConStr, $query); \n\n $activeTermArray = mysqli_fetch_assoc($tableQuery);\n\n\n\t\tif (sizeof($activeTermArray) != 1)\n\t\t{\n\t\t\t$query = \n\t\t\t\t\"SELECT * FROM syterms \n \t\tORDER BY schoolYear ASC , termNumber ASC LIMIT 0, 1;\";\n\t\t\t$tableQuery = mysqli_query($mySQL_ConStr, $query); \n\n\t\t\twhile($getRow = mysqli_fetch_assoc($tableQuery))\n\t\t\t{\n\t\t\t\t$selectedSYTerm = $getRow['syTermID'];\n\t\t\t}\n\n\t\t $query = \n\t\t \"UPDATE syterms SET isActive = '1' \n\t WHERE syTermID = $selectedSYTerm;\";\n\t \tmysqli_query($mySQL_ConStr, $query);\n\t\t \n\t \t$query = \n\t \t\"UPDATE syterms SET isActive = '0' \n\t WHERE syTermID != $selectedSYTerm;\";\n\t\t mysqli_query($mySQL_ConStr, $query);\n\t }\n \t\n\t}", "function activate() {\n \n // actualizar las reglas de escritura para que observen la nueva taxonomia\n flush_rewrite_rules();\n }", "public function setTerms(){\n\t\t$this->terms = new stdClass();\n\t\tforeach (get_taxonomies() as $taxonomy ) {\n\t\t\t$this->terms->$taxonomy = $this->getTerms( $taxonomy);\n\t\t\t//$this->{'terms_'.$taxonomy} = $this->terms[$taxonomy];\n\t\t}\n\t}", "function set_object_terms_handler( $object_id, $terms, $tt_ids ) {\n\t\t$this->term_relationships_handler( $object_id, $tt_ids );\n\t}", "public function setTerm(string $value): self\n {\n $this->term = $value;\n\n return $this;\n }", "public function setActive($value) {\n\t\t$this->_active = $value;\n\t}", "public function edit(Term $term)\n {\n //\n }", "public function edit(Term $term)\n {\n //\n }", "public function activate()\n {\n $this->add_setting('financialmodelingprep_API', '1a2abc9df3aed370108ba7b4db47314d');\n }", "function get_edit_term_link($term, $taxonomy = '', $object_type = '')\n {\n }", "public function setActive($active)\n {\n $this->active = $active;\n }", "public function setActive($active)\n {\n $this->active = $active;\n }", "public function setCurrentPage( $page );", "public function setActive($active = true)\n {\n $this->active = $active;\n }", "public function setActive($active){\n $this->active = $active;\n return $this;\n }", "private function setSeparator()\n\t\t{\n\t\t\t$separetor = explode('/', $this->_url);\n\t\t\t$separetor[2] = (isset($separetor[2]) && $separetor[2] != null ? $separetor[2] . 'Action' : 'indexAction');\n\t\t\tunset($separetor[0]);\n\t\t\t$this->_separetor = $separetor;\n\t\t}", "public function setActive()\n {\n $this->update(['status' => static::STATUS_ACTIVE]);\n }", "private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}", "public function toggle_term() {\n\t\tglobal $post;\n\n\t\t$post = array_shift( get_posts( array(\n\t\t\t'post_type' => $this->params['post_type'],\n\t\t\t'name' => $this->params['post_name']\n\t\t) ) );\n\n\t\t$taxonomy = $this->params['action_key'];\n\n\t\t$terms = is_array( $this->params['extra'] ) ? explode( ',', $this->params['extra'][0] ) : array();\n\n\t\tforeach ( $terms as $term_key => $term ) {\n\t\t\tif ( is_string( $term ) ) {\n\t\t\t\tif ( ! $this_term = term_exists( $term, $taxonomy ) ) {\n\t\t\t\t\t// $caption = ucwords(str_replace(\"_\", \" \", (string) $field_name));\n\t\t\t\t\twp_insert_term( ucwords( str_replace( array( \"_\", \"-\" ), \" \", $term ) ), $taxonomy, array( 'slug' => $term ) );\n\t\t\t\t\t$this_term = get_term_by( 'slug', $term, $taxonomy, ARRAY_A );\n\t\t\t\t}\n\n\t\t\t\t$term_id = $this_term['term_id'];\n\t\t\t} else {\n\t\t\t\t$term_id = $term;\n\t\t\t}\n\n\t\t\t$current_action = $this->get_current_action();\n\t\t\tif ( has_term( $term_id, $taxonomy, $post->ID ) ) {\n\t\t\t\t$existing_terms_array = wp_get_post_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );\n\n\t\t\t\t// Remove the current term form the terms array\n\t\t\t\tforeach ( $existing_terms_array as $term_index => $existing_term ) {\n\t\t\t\t\tif ( $term_id == $existing_term ) {\n\t\t\t\t\t\tunset( $existing_terms_array[$term_index] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->action_results[ 'data' ][ 'post_id' ] = $post->ID;\n\n\t\t\t\t// Remove the term, the fourth parameter 'false' relaces the term array\n\t\t\t\tif ( $result = wp_set_post_terms( $post->ID, $existing_terms_array, $taxonomy, false ) ) {\n\t\t\t\t\t$action_status = 'success';\n\t\t\t\t\t$this->action_results[ 'messages' ][ 'note' ] = __( 'Term Removed', 'kickpress' );\n\t\t\t\t\t$this->action_results[ 'data' ][ 'terms' ] = $result;\n\t\t\t\t} else {\n\t\t\t\t\tif ( false === $result ) {\n\t\t\t\t\t\t$action_status = 'failure';\n\t\t\t\t\t\t$this->action_results[ 'messages' ][ 'note' ] = __( 'Failed to Remove Term', 'kickpress' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$action_status = 'success';\n\t\t\t\t\t\t$this->action_results[ 'messages' ][ 'note' ] = __( 'Term Removed', 'kickpress' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Add the term, the fourth parameter 'true' appends the term to the term array\n\t\t\t\tif ( $result = wp_set_post_terms( $post->ID, array( intval( $term_id ) ), $taxonomy, true ) ) {\n\t\t\t\t\t$this->action_results[ 'data' ][ 'terms' ] = $result;\n\t\t\t\t\t$action_status = 'success';\n\t\t\t\t\t$this->action_results[ 'messages' ][ 'note' ] = __( 'Term Added', 'kickpress' );\n\t\t\t\t} else {\n\t\t\t\t\t$action_status = 'failure';\n\t\t\t\t\t$this->action_results[ 'messages' ][ 'note' ] = __( 'Failed to Remove Term', 'kickpress' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->action_results[ 'status' ] = $action_status;\n\t\t\t$this->action_results[ 'data' ][ 'terms' ] = wp_get_post_terms( $post->ID, $taxonomy );\n\t\t}\n\t}", "public function taxonomy_highlight() {\n\t\t\tglobal $current_screen, $taxnow;\n\n\t\t\tif ( is_a( $current_screen, 'WP_Screen' ) && ! empty( $taxnow ) && in_array( $taxnow, array( wct_get_tag(), wct_get_category() ) ) ) {\n\t \t\t\t$current_screen->post_type = $this->post_type;\n\t \t\t}\n\t\t}", "private function setCurrentPath(){\n\t\t$dirs = explode('/', $this->pages[0]);\n\t\t// if last character is a / then just use it\n\t\tif(empty($dirs[count($dirs)-1]) || is_null($dirs[count($dirs)-1])){\n\t\t\t$this->current_path = $this->pages[0];\n\t\t// if end of path was a filename, remove it and add a /\n\t\t} else {\n\t\t\tarray_pop($dirs);\n\t\t\t$this->current_path = implode('/', $dirs).'/';\n\t\t}\n\t}", "public function setActivePaths(array $paths): void\n {\n $this->activePaths = $paths;\n }", "public function SetTrails()\n\t\t{\n\t\t\t// into an array and work out the category ID\n\t\t\t$arrCats = explode(\"/\", $this->GetCatPath());\n\n\t\t\t// Replace all bad variables back in\n\t\t\tfor ($i = 0; $i < count($arrCats); $i++) {\n\t\t\t\t$arrCats[$i] = MakeURLNormal($arrCats[$i]);\n\t\t\t}\n\n\t\t\t// The first category *MUST* have a parent ID of 0 or it's invalid\n\t\t\t$query = sprintf(\"select * from [|PREFIX|]categories where lower(catname) = '%s' and catparentid='0'\", $GLOBALS['ISC_CLASS_DB']->Quote(isc_strtolower($arrCats[0])));\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\n\t\t\tif ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$this->SetTrail(array($row['categoryid'], $row['catname']));\n\n\t\t\t\t// The root category is valid, try and loop through each category to find the ID of the last category in the set\n\t\t\t\tif (count($arrCats) > 1) {\n\t\t\t\t\t$parentCat = $row['categoryid'];\n\n\t\t\t\t\tfor ($i = 1; $i < count($arrCats); $i++) {\n\t\t\t\t\t\t$query = sprintf(\"select * from [|PREFIX|]categories where lower(catname)='%s' and catparentid='%d'\", $GLOBALS['ISC_CLASS_DB']->Quote(isc_strtolower($arrCats[$i])), $GLOBALS['ISC_CLASS_DB']->Quote($parentCat));\n\t\t\t\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\n\t\t\t\t\t\tif ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t\t\t\t$parentCat = $row['categoryid'];\n\t\t\t\t\t\t\t$this->Data = $row;\n\t\t\t\t\t\t\t$this->SetTrail(array($row['categoryid'], $row['catname']));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->Data = $row;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->Data = $row;\n\t\t\t}\n\n\t\t\t$GLOBALS['CatTrail'] = $this->GetTrails();\n\t\t}", "function setMethod($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }", "protected function setStep($new_step)\n\t{\n\t\t$this->activeStep = $new_step;\n\t}", "function term_handler( $term_id, $tt_id=null ) {\n\t\t$this->add_ping( 'db', array( 'term' => $term_id ) );\n\t\tif ( $tt_id )\n\t\t\t$this->term_taxonomy_handler( $tt_id );\n\t}", "public function setCurrentURI( $uri )\n {\n $this->currentURI = $uri;\n }", "function update_audit_trail()\n {\n $parameter_array = $this->get_parameter_array();\n \n parent::update($this->id, 'siis', $parameter_array);\n }", "public function setActive($id)\n {\n }", "public function setActive($id)\n {\n }", "public function setActivePaths(array $paths)\n {\n $this->activePaths = $paths;\n }", "function updateSYTerm()\n\t{\n\n require 'b_ConnectionString.php';\n\n\t\t$capturedIsActiveData = $_POST['sendIsActiveData'];\n\t\t$capturedSYTermIDData = $_POST['sendSYTermIDData'];\n\n\t\t$query = \"UPDATE syterms \n\t\t\tSET isActive = '$capturedIsActiveData'\n\t\t\tWHERE syTermID = '$capturedSYTermIDData'\";\n\n\t\tmysqli_query($mySQL_ConStr, $query);\n\t\t\n\t\tif ($capturedIsActiveData == '1')\n\t\t{\n\t\t\t$query = \"UPDATE syterms \n\t\t\t\tSET isActive = '0'\n\t\t\t\tWHERE\n\t\t\t\tsyTermID != '$capturedSYTermIDData'\";\n\n\n\t\t\tmysqli_query($mySQL_ConStr, $query);\n\t\t}\n\n //autoSetActiveSYTerm();\n\t}", "function edit_term_link($link = '', $before = '', $after = '', $term = \\null, $display = \\true)\n {\n }", "public function getActiveTerm()\n {\n return $this->activeTerm = $this->getSession('term', '');\n }", "public function getActiveTerm()\n {\n return $this->activeTerm = $this->getSession('term', '');\n }", "public function settings_menu_highlight() {\n\t\t\tglobal $parent_file, $submenu_file, $typenow;\n\n\t\t\t$parent_file = add_query_arg( 'post_type', $this->post_type, 'edit.php' );\n\t\t\t$submenu_file = add_query_arg( 'page', 'wc_talks', 'options-general.php' );\n\t\t\t$typenow = $this->post_type;\n\t\t}", "public function setModeCurrent() {\n\t\t$this->mode = 'current';\n\t}", "function entity_translation_taxonomy_term_tab_access() {\n $args = func_get_args();\n $term = array_shift($args);\n if (entity_translation_enabled('taxonomy_term', $term)) {\n return entity_translation_tab_access('taxonomy_term', $term);\n }\n else {\n $function = array_shift($args);\n return $function ? call_user_func_array($function, $args) : FALSE;\n }\n}", "public function ToggleOn ( $query_term )\r\n\t{\r\n\t\tself::Toggle ( $query_term, '+' );\r\n\t}", "public static function activate ()\n\t{\n\t\t// Create or update options\n\t\tself::generate_options ();\n\t}", "function _setDegreeTypeMenu() {\n\t\t$this->loadModel('DegreeType');\n\t\t$degrees = $this->DegreeType->find('threaded');\n\t\t$this->set('degrees', $degrees);\n\t}", "public function setSearchTerm($term)\n {\n if (!empty($term)) {\n $this->showTree = false;\n }\n\n $this->searchTerm = $term;\n }", "public function setFeature($fea)\n {\n $this->languageNow = $this->language[$fea];\n }", "private function setController()\n\t\t{\n\t\t\t$this->_controller = $this->_separetor[1];\n\t\t}", "function set_current_record($recordVar, Omeka_Record_AbstractRecord $record, $setPreviousRecord = false)\n{\n get_view()->setCurrentRecord($recordVar, $record, $setPreviousRecord);\n}", "public function set_primary_term( $new_primary_term ) {\n\t\tupdate_post_meta( $this->post_ID, WPSEO_Meta::$meta_prefix . 'primary_' . $this->taxonomy_name, $new_primary_term );\n\t}", "public function testGetSet()\n {\n $term = new LP21Term('type', 'uuid');\n $term\n ->setUrl('url')\n ->setCode('code')\n ->setCantons(['BE'])\n ->setVersion('version')\n ->setCycles([1]);\n\n $this->assertEquals('url', $term->getUrl(), \"The getter/setter works for URLs.\");\n $this->assertEquals('code', $term->getCode(), \"The getter/setter works for codes.\");\n $this->assertEquals(['BE'], $term->getCantons(), \"The getter/setter works for cantons.\");\n $this->assertEquals('version', $term->getVersion(), \"The getter/setter works for versions.\");\n $this->assertEquals([1], $term->getCycles(), \"The getter/setter works for cycles.\");\n }", "public function _handleTerm()\n\t{\n\t\t$this->_should_stop = true;\n\t}", "private function setCurrent($dir)\n\t{\n\t\t$this->current_dir = str_replace(self::$dir, '', $dir);\n\t}", "function activate() {\r\r\n }", "public function menu_set_active_item($path)\n {\n return menu_set_active_item($path);\n }", "function set_current_url() {\r\n\t\t\t$this->current_url = $this->get_current_url();\r\n\t\t}", "function journalize_auto_tag_activate() {\n\t$options = get_option('journalize');\n\t$options['auto_tag'] = true;\n\tupdate_option('journalize', $options);\n}", "function _update_breadcrumb_line()\n {\n $tmp = Array();\n\n $tmp[] = Array\n (\n MIDCOM_NAV_URL => \"/\",\n MIDCOM_NAV_NAME => $this->_l10n->get('index'),\n );\n\n $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp);\n }", "abstract protected function setMethod();", "public function setLiActiveClass(string $liActiveClass);", "function setMethod( $val){\n\t$this->_method = $val;\n\t}", "function set_active($path, $active = 'active') {\n\n return call_user_func_array('Request::is', (array)$path) ? $active : '';\n\n}", "public function setCurrHyperlink($tag)\n {\n $this->currHyperlink = $tag;\n }", "public function click() {\r\n\t\tswitch($this->current) {\r\n\t\t\tdefault:\r\n\t\t\t\t$this->current = self::SEA;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase self::ISLAND:\r\n\t\t\t\t$this->current = self::NONE;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase self::SEA:\r\n\t\t\t\t$this->current = self::ISLAND;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function activate()\n {\n $this->find('css', '.filter-criteria-selector span.caret')->click();\n }", "function _taxonomy_menu_trails_get_paths($tids, $entity, $settings) {\n $paths = array();\n switch ($settings['term_path']) {\n case 'custom':\n foreach ($tids as $tid) {\n $term_paths = str_replace('[tid]', $tid, $settings['term_path_patterns']);\n $paths = array_merge($paths, $term_paths);\n }\n break;\n\n case 'api':\n // We have to keep tids order for the final paths array.\n // First fill paths array with \"tid => array()\" map.\n $paths = array_combine($tids, array_fill(0, count($tids), array()));\n\n // Call hook implementations and fill paths array for each term.\n $hook = 'taxonomy_menu_trails_get_paths';\n foreach (module_implements($hook) as $module) {\n $function = $module . '_' . $hook;\n if (function_exists($function)) {\n // Use call_user_func() to force passing arguments by value, not by\n // reference.\n $results = call_user_func($function, $tids, $settings['entity_type'], $entity, $settings);\n if (empty($results) || !is_array($results)) {\n continue;\n }\n \n foreach ($results as $tid => $term_paths) {\n if (empty($term_paths)) {\n continue;\n }\n \n if (is_string($term_paths)) {\n $paths[$tid][] = $term_paths;\n }\n elseif (is_array($term_paths)) {\n $paths[$tid] = array_merge($paths[$tid], $term_paths);\n }\n }\n }\n }\n\n // For terms with empty mappings fallback to default path. For the rest\n // make sure paths are unique.\n foreach ($paths as $tid => $term_paths) {\n if (empty($term_paths)) {\n $paths[$tid][] = _taxonomy_menu_trails_default_term_path($tid);\n }\n else {\n $paths[$tid] = array_unique($paths[$tid]);\n }\n }\n\n // Merge paths into flat array. The order of tids will be kept.\n $paths = call_user_func_array('array_merge', $paths);\n break;\n\n case 'tm':\n if (module_exists('taxonomy_menu')) {\n // Unfortunately, there is no way to get tids-vids map without DB query.\n // If you know one, please create issue and describe method.\n $vids = db_select('taxonomy_term_data', 'ttd')\n ->fields('ttd', array('tid', 'vid'))\n ->condition('ttd.tid', $tids, 'IN')\n ->execute()\n ->fetchAllKeyed();\n foreach ($tids as $tid) {\n if (isset($vids[$tid])) {\n $paths[] = taxonomy_menu_create_path($vids[$tid], $tid);\n }\n else {\n $paths[] = _taxonomy_menu_trails_default_term_path($tid);\n }\n }\n break;\n }\n // Fallback to default path when Taxonomy Menu module not exists anymore.\n \n default:\n foreach ($tids as $tid) {\n $paths[] = _taxonomy_menu_trails_default_term_path($tid);\n }\n }\n return $paths;\n}", "function activate() \n {\n // prepare the options\n $this->get_options();\n // set the WordPress hooks\n $this->wp_hooks();\n }", "function set($id, $value){\n // Change the order of the menu links to match core\n // Collect all the parent links, and then add all of\n // their children to the list as well.\n $value = self::sort_tree($value);\n\n return parent::set($id, $value);\n }", "protected function setSubstep($new_substep)\n\t{\n\t\t$this->activeSubstep = $new_substep;\n\t}", "function _setSubjectMenu() {\n\t\t$this->loadModel('Subject');\n\t\t$subjects = $this->Subject->find('threaded');\n\t\t$this->set('subjects', $subjects);\n\t}", "public function setCurrentPage($currentPage);", "function applyFinal($q, $settings, $trail_mlids);", "public function setInterestingTerms($term)\n {\n return $this->setOption('interestingTerms', $term);\n }", "protected function setTypo3Context() {}", "public function setSearchTerm($term)\n {\n $this->searchTerm = $term;\n }", "public static function activate(){\n }", "public function setup_selected() {\n\t}", "function activeLink($name=null,$tree=false)\n {\n\n\n\n if ( $tree and $name == 'setup' )\n {\n\n $setupArray = ['client-types','resources','teams','costs'];\n\n if ( in_array(request()->segment(1) ,$setupArray) )\n {\n return 'active selected';\n }\n return '';\n\n\n }\n\n if ( $tree and $name == 'reports' )\n {\n $reportArray = ['opportunity-report','activity-report','proposal-report','invoice-report'];\n\n if ( in_array(request()->segment(1) ,$reportArray) )\n {\n return 'active selected';\n }\n return '';\n\n\n }\n\n if ( !is_null($name) and request()->segment(1) == $name )\n {\n if ( $tree )\n {\n return 'current-page';\n }\n\n return 'active selected';\n }\n\n\n }", "function threadratinglog_activate()\n{\n\tchange_admin_permission('tools', 'ratinglog');\n}", "public function setPath()\n {\n $this->path = $this->getNamespace() . $this->getControllerName();\n }", "public function setFocus(\\SetaPDF_Core_Document_Action $action) {}", "function set_active($path, $active = 'active')\n{\n return Request::is($path) ? $active : '';\n}", "function term_taxonomy_handler( $tt_id ) {\n\t\t$this->add_ping( 'db', array( 'term_taxonomy' => $tt_id ) );\n\t}", "function setCurrentPage($page) {\n $this->current_page = $page;\n }", "public function SetMethod ($method = NULL);", "public function setActive($active) {\n\t\t$this->active = $active;\n\t\treturn $this;\n\t}", "public function setActive(NodeInterface $active)\n {\n $this->active = $active;\n }", "public function activateTrace()\n\t{\n\t\t$this->database->activateTrace();\n\t}", "public function transitionTo(Etat $etat): void\n {\n echo \"Context: Transition to \" . get_class($etat) . \".\\n\";\n $this->setEtat($etat);\n $this->etat->setJoueur($this);\n }", "public function setTermType($term_type)\n {\n $this->term_type = $term_type;\n return $this;\n }" ]
[ "0.5667513", "0.56638426", "0.563585", "0.55159944", "0.5182864", "0.4919319", "0.48787898", "0.4719171", "0.4694278", "0.46688136", "0.466092", "0.46495026", "0.46405223", "0.46359992", "0.46139756", "0.4611716", "0.45968887", "0.4554546", "0.45353466", "0.45245606", "0.4522117", "0.4522117", "0.45121494", "0.44943833", "0.4484929", "0.4484929", "0.44354764", "0.44069418", "0.4404391", "0.44003144", "0.4396733", "0.4395434", "0.43864825", "0.4376433", "0.43606713", "0.4359538", "0.43572405", "0.43564087", "0.43563408", "0.43418303", "0.4336658", "0.43365055", "0.4315862", "0.4315862", "0.43005857", "0.42743447", "0.42718047", "0.4266703", "0.4266703", "0.42594558", "0.42589244", "0.42561656", "0.42551583", "0.42236233", "0.42123112", "0.41994005", "0.41907665", "0.41855946", "0.41855115", "0.41746452", "0.41565704", "0.41538307", "0.41527414", "0.41490075", "0.41400567", "0.4136348", "0.41309938", "0.41304508", "0.41284505", "0.41250083", "0.412279", "0.4104655", "0.41033426", "0.4100232", "0.40951604", "0.40903026", "0.40866843", "0.40805057", "0.40725476", "0.40647274", "0.4050878", "0.40503344", "0.4048435", "0.40478548", "0.4041707", "0.4039445", "0.4035903", "0.4035269", "0.40340158", "0.4031182", "0.4027158", "0.4017367", "0.40149644", "0.40126252", "0.4010174", "0.4002474", "0.399673", "0.39963636", "0.39931673", "0.3986265" ]
0.46941966
9
Selects menu item using "first" or "last" selection method. There is no difference in these two methods because terms array is reversed in _taxonomy_menu_trails_process() if "last" is used.
function _taxonomy_menu_trails_fetch_link_simple($vars) { extract($vars); // Sort candidates by link path and menu name. $candidates = array(); foreach ($results as $candidate) { //Prefer the lightest of items with the same menu and path if (!isset($candidates[$candidate['link_path']][$candidate['menu_name']])) { $candidate['weight'] = $candidate['link_weight']; $candidates[$candidate['link_path']][$candidate['menu_name']] = $candidate; // Add any menus not already in the menu name search list. if (!in_array($candidate['menu_name'], $menu_names)) { $menu_names[] = $candidate['menu_name']; } } } // processing array according on saved settings $processed_candidates = array(); switch($settings['multiple_menu']) { default: case 'all': $processed_candidates = $candidates; break; case 'first': foreach($candidates as $k => $v) { array_pop($v); // unset last array item $processed_candidates[$k] = $v; } break; case 'last': foreach($candidates as $k => $v) { array_shift($v); // unset last array item $processed_candidates[$k] = $v; } break; } if (!empty($processed_candidates)) { // Pick the most specific link, in the most preferred menu. foreach ($paths as $link_path) { if (!isset($processed_candidates[$link_path])) { continue; } foreach ($menu_names as $menu_name) { if (!isset($processed_candidates[$link_path][$menu_name])) { continue; } $candidate_item = $processed_candidates[$link_path][$menu_name]; $map = explode('/', $link_path); _menu_translate($candidate_item, $map); if ($candidate_item['access']) { $selected_items[] = $candidate_item; } } } } return $selected_items; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ac_first_and_last_menu_class($items) {\n foreach($items as $k => $v){\n $parent[$v->menu_item_parent][] = $v;\n }\n foreach($parent as $k => $v){\n $v[0]->classes[] = 'first';\n $v[count($v)-1]->classes[] = 'last';\n }\n return $items;\n}", "function _taxonomy_menu_trails_process($entity, $settings) {\n $instances = $settings['instances'];\n $tids = array();\n //TODO figure out: maybe we have to choose language in term reference fields\n foreach ($instances as $field) {\n foreach ($entity->$field as $lang => $terms) {\n foreach ($terms as $term) {\n $tids[] = $term['tid'];\n }\n }\n }\n\n // Filter out terms with different language if this option is enabled.\n if (module_exists('i18n_taxonomy') && $settings['terms_with_current_language']) {\n $terms = taxonomy_term_load_multiple($tids);\n $allowed_languages = array('und', $GLOBALS['language_content']->language);\n foreach($tids as $index => $tid) {\n if (empty($terms[$tid]) ||\n !in_array($terms[$tid]->language, $allowed_languages)) {\n unset($tids[$index]);\n }\n }\n }\n\n if ($settings['selection_method'] == 'last') {\n $tids = array_reverse($tids);\n }\n\n // Get paths for each tid.\n $paths = _taxonomy_menu_trails_get_paths($tids, $entity, $settings);\n\n // Retrieve the list of menu names sorted by preference. This list is used\n // by menu system to get order of menus and not as a filter, we do the same.\n // See menu_link_get_preferred().\n $menu_names = menu_get_active_menu_names();\n\n $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC));\n $query->leftJoin('menu_router', 'm', 'm.path = ml.router_path');\n $query->fields('ml');\n // Weight must be taken from {menu_links}, not {menu_router}.\n $query->addField('ml', 'weight', 'link_weight');\n $query->fields('m');\n $query->condition('ml.link_path', $paths, 'IN');\n $query->condition('ml.hidden', '0');\n if ($settings['selection_method'] == 'deepest-in-menu') {\n $query->orderBy('ml.depth', 'DESC');\n }\n $query->orderBy('ml.weight', 'ASC');\n $results = $query->execute();\n\n $selected_item = FALSE;\n $vars = compact('menu_names', 'results', 'paths', 'selected_items', 'settings');\n switch ($settings['selection_method']) {\n case 'first':\n case 'last':\n $selected_items = _taxonomy_menu_trails_fetch_link_simple($vars);\n break;\n case 'deepest-in-menu':\n $selected_items = _taxonomy_menu_trails_fetch_link_deepest($vars);\n break;\n }\n\n if (!$selected_items) {\n return;\n }\n\n // Set selected menu item as an active path for its menu.\n // Function menu_tree_set_path() available since Drupal 7.9, so we should\n // check it exists.\n if (function_exists('menu_tree_set_path')) {\n foreach($selected_items as $selected_item) {\n menu_tree_set_path($selected_item['menu_name'], $selected_item['link_path']);\n }\n //\n }\n \n // Save selected item and \"set_breadcrumb\" setting for\n // taxonomy_menu_trails_menu_breadcrumb_alter().\n if (!empty($settings['set_breadcrumb'])) {\n foreach($selected_items as $selected_item) {\n $selected_item['set_breadcrumb'] = $settings['set_breadcrumb'];\n taxonomy_menu_trails_selected_item_for_breadcrumb($selected_item);\n }\n }\n \n // TODO: Remove workaround when Menu Block will remove its\n // _menu_link_get_preferred(). But it's safe to leave it here even after\n // Menu Block update to keep compatibility with old Menu Block releases.\n // So, probably it should be here forever or until the next major release.\n if (module_exists('menu_block')) {\n // Also set preferred item for Menu Block module\n $mb_preferred_links = &drupal_static('_menu_link_get_preferred');\n foreach($selected_items as $selected_item) {\n $mb_preferred_links[$_GET['q']][$selected_item['menu_name']] = $selected_item;\n }\n }\n}", "function mdx_tertiary_menu($args) {\n\tinclude_once 'functions/class-walker-tertiary-menu.php';\n\t$uri_parts = explode('/', $_SERVER['REQUEST_URI']);\n\t$args['ancestor'] = get_page_by_path($uri_parts[1]);\n\t$args['echo'] = false;\n\t$args['walker'] = new Walker_Tertiary_Menu();\n\treturn wp_nav_menu($args);\n}", "function vcex_get_first_term( $post = '', $taxonomy = 'category', $terms = '' ) {\n\tif ( function_exists( 'wpex_get_first_term' ) ) {\n\t\treturn wpex_get_first_term( $post, $taxonomy, $terms );\n\t}\n}", "function menu_select($start_id,$direction,$number_levels,$only_active,$menu_only,$exclude_subseiten)\n{\n//$start_id ist die ID, von der weg geprüft werden soll.\n//$direction ist entweder \"up\" oder \"down\".\n//$numer_levels ist ein numerischer Wert, der nur bei \"down\" relevanz hat. Er gibt an, wie viele Ebenen durchsucht werden sollen.\n//$only active ist enteder \"1\" oder was anderes. Nur wenn es \"1\" ist, werden nur die aktiven Einträge druchsucht. \n//$menu_only ist entweder \"1\" oder \"2\" oder was anderes. Nur wenn es \"1\" ist, werden nur die Menüeinträge gezeigt. Wenn es \"2\" ist, werden nur jene Einträge wieder gegeben, die selbst kein Meunü sind.\n//Aufrufen durch: print_r(menu_select('46','down','1','',''));\n\tunset($GLOBALS['menu_select_siblings']);\n\tunset($GLOBALS['menu_select_parent']);\n\tif($only_active==\"1\"){$search_append_string=\"and (active_startdate<=now() or active_startdate='0000-00-00') and (active_enddate>=now() or active_enddate='0000-00-00') and active='A'\";}\n\tif($menu_only==\"1\"){$search_append_string=$search_append_string.\" and display='1'\";}\n\tif($exclude_subseiten==\"1\"){$search_append_string=$search_append_string.\" and search_type not like '%Subseiten%'\";}\n\n\t$i=-1;\n\tif(function_exists('menu_select_siblings')){unset ($menu_select_siblings);} else\n\t{\n\t\tfunction menu_select_siblings($parent_id,$number_levels,$i,$search_append_string,$menu_only)\n\t\t{\n\t\t\t$i=$i+1;\n\t\t\tif($i<$number_levels or $number_levels==0 or $number_levels==\"\")\n\t\t\t{\n\t\t\t\tglobal $menu_select_siblings;\n\t\t\t\t$sibling_query=mysql_query(\"select id, description, display from menu where parent_id=$parent_id $search_append_string order by sort\") or die (\"sibling_query: \".mysql_error());\n\t\t\t\techo $parent_id;\n\t\t\t\tif($parent_id==3) {echo \"hh\";echo \"select id, description, display from menu where parent_id=$parent_id $search_append_string order by sort\";}\n\t\t\t\t\n\t\t\t\twhile($sibling_query_result=mysql_fetch_assoc($sibling_query))\n\t\t\t\t{\n\t\t\t\t\tif(($menu_only==2 and $sibling_query_result['display']==0) or $menu_only!=2){//if the selector menu only is set to 2, only those items are recorded that are actually NOT menus.\n\t\t\t\t\t\t$menu_select_siblings['id'][] = $sibling_query_result['id'];\n\t\t\t\t\t\t$menu_select_siblings['description'][] = $sibling_query_result['description'];\n\t\t\t\t\t\t$menu_select_siblings['googleurl'][] = find_googleurl($sibling_query_result['id']);\t\t\t\n\t\t\t\t\t\t$menu_select_siblings['level_down'][] = $i;\t\n\t\t\t\t\t}\n\t\t\t\t\tmenu_select_siblings($sibling_query_result['id'],$number_levels,$i,$search_append_string,$menu_only);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn($menu_select_siblings);\n\t\t}\n\t}\n\t\n\tif(function_exists('menu_select_parents')){} else\n\t{\n\t\tfunction menu_select_parents($sibling_id, $only_active_string)\n\t\t{\tif($sibling_id==\"\" or $sibling_id==\"0\" or !$sibling_id){} else\n\t\t\t{\n\t\t\t\tglobal $menu_select_parent;\n\t\t\t\t$parent_query=mysql_query(\"select id, parent_id, description from menu where id=$sibling_id $search_append_string order by sort\") or die (\"parent_query: \".mysql_error());\n\t\t\t\twhile($parent_query_result=mysql_fetch_assoc($parent_query))\n\t\t\t\t{\n\t\t\t\t\tif($parent_query_result[id]==0){break;}\n\t\t\t\t\t$menu_select_parent['id'][] = $parent_query_result['id'];\n\t\t\t\t\t$menu_select_parent['description'][] = $parent_query_result['description'];\n\t\t\t\t\t$menu_select_parent['googleurl'][] = find_googleurl($parent_query_result['id']);\t\t\t\n\t\t\t\t\tmenu_select_parents($parent_query_result[parent_id],$search_append_string);\n\t\t\t\t}\n\t\t\t\treturn($menu_select_parent);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif($direction==\"up\"){return(menu_select_parents($start_id,$search_append_string));}\n\telseif($direction==\"down\"){return(menu_select_siblings($start_id,$number_levels,$i,$search_append_string,$menu_only));}\n}", "function _taxonomy_menu_trails_fetch_link_deepest($vars) {\n extract($vars);\n\n $candidates = array();\n foreach ($results as $candidate) {\n //Prefer the lightest of items with the same menu and path\n if (!isset($candidates[$candidate['menu_name']][$candidate['link_path']])) {\n $candidate['weight'] = $candidate['link_weight'];\n $candidates[$candidate['menu_name']][$candidate['link_path']] = $candidate;\n\n // Add any menus not already in the menu name search list.\n if (!in_array($candidate['menu_name'], $menu_names)) {\n $menu_names[] = $candidate['menu_name'];\n }\n }\n }\n\n // processing array according on saved settings\n switch($settings['multiple_menu']) {\n case 'first':\n array_pop($candidates);\n break;\n\n case 'last':\n array_shift($candidates);\n break;\n }\n\n if (!empty($candidates)) {\n foreach ($menu_names as $menu_name) {\n if (!empty($candidates[$menu_name])) {\n foreach ($candidates[$menu_name] as $candidate_item) {\n $map = explode('/', $candidate_item['link_path']);\n _menu_translate($candidate_item, $map);\n if ($candidate_item['access']) {\n $selected_items[] = $candidate_item;\n }\n }\n }\n }\n }\n\n return $selected_items;\n}", "function _get_first_menu( $lang ) {\n\t\tglobal $wpdb;\n\t\t$menu_tt_id = $wpdb->get_var( \"SELECT MIN(element_id) FROM {$wpdb->prefix}icl_translations WHERE element_type='tax_nav_menu' AND language_code='\" . esc_sql( $lang ) . \"'\" );\n\n\t\treturn $menu_tt_id\n\t\t\t? (int) $wpdb->get_var( $wpdb->prepare( \"SELECT term_id FROM {$wpdb->term_taxonomy} WHERE term_taxonomy_id=%d\", $menu_tt_id ) )\n\t\t\t: false;\n\t}", "function vcex_get_first_term_link( $post = '', $taxonomy = 'category', $terms = '' ) {\n\tif ( function_exists( 'wpex_get_first_term_link' ) ) {\n\t\treturn wpex_get_first_term_link( $post, $taxonomy, $terms );\n\t}\n}", "function get_first_term( $post_id = 0, $key = '' ) {\n\n\t// First check for terms.\n\t$terms = get_the_terms( $post_id, 'category' );\n\n\t// If we have no terms for the post, use the default.\n\tif ( empty( $terms ) || is_wp_error( $terms ) ) {\n\n\t\t// Get the default category.\n\t\t$defcat = get_option( 'default_category', '1' );\n\n\t\t// Set the term data.\n\t\t$deftrm = get_term( $defcat, 'category', ARRAY_A );\n\n\t\t// Return the entire thing if we didn't include a key\n\t\tif ( empty( $key ) ) {\n\t\t\treturn $deftrm;\n\t\t}\n\n\t\t// Return a single portion of the data.\n\t\treturn isset( $deftrm[ $key ] ) ? $deftrm[ $key ] : false;\n\t}\n\n\t// Reset array so we can pull easily.\n\t$terms = array_values( $terms );\n\n\t// Pull out the first one.\n\t$term = (array) $terms[0];\n\n\t// Bail without a term.\n\tif ( empty( $term ) ) {\n\t\treturn false;\n\t}\n\n\t// Return the entire thing if we didn't include a key\n\tif ( empty( $key ) ) {\n\t\treturn $term;\n\t}\n\n\t// Return a single portion of the data.\n\treturn isset( $term[ $key ] ) ? $term[ $key ] : false;\n}", "function add_first_and_last($output) {\n\t$output = preg_replace('/class=\"menu-item/', 'class=\"first-menu-item menu-item', $output, 1);\n\t$output = substr_replace($output, 'class=\"last-menu-item menu-item', strripos($output, 'class=\"menu-item'), strlen('class=\"menu-item'));\n\treturn $output;\n}", "function carton_order_terms( $the_term, $next_id, $taxonomy, $index = 0, $terms = null ) {\n\n\tif( ! $terms ) $terms = get_terms($taxonomy, 'menu_order=ASC&hide_empty=0&parent=0' );\n\tif( empty( $terms ) ) return $index;\n\n\t$id\t= $the_term->term_id;\n\n\t$term_in_level = false; // flag: is our term to order in this level of terms\n\n\tforeach ($terms as $term) {\n\n\t\tif( $term->term_id == $id ) { // our term to order, we skip\n\t\t\t$term_in_level = true;\n\t\t\tcontinue; // our term to order, we skip\n\t\t}\n\t\t// the nextid of our term to order, lets move our term here\n\t\tif(null !== $next_id && $term->term_id == $next_id) {\n\t\t\t$index++;\n\t\t\t$index = carton_set_term_order($id, $index, $taxonomy, true);\n\t\t}\n\n\t\t// set order\n\t\t$index++;\n\t\t$index = carton_set_term_order($term->term_id, $index, $taxonomy);\n\n\t\t// if that term has children we walk through them\n\t\t$children = get_terms($taxonomy, \"parent={$term->term_id}&menu_order=ASC&hide_empty=0\");\n\t\tif( !empty($children) ) {\n\t\t\t$index = carton_order_terms( $the_term, $next_id, $taxonomy, $index, $children );\n\t\t}\n\t}\n\n\t// no nextid meaning our term is in last position\n\tif( $term_in_level && null === $next_id )\n\t\t$index = carton_set_term_order($id, $index+1, $taxonomy, true);\n\n\treturn $index;\n}", "function render_expo_submenu($tax_slug = false) {\n\n $exhibition_types = get_terms('tipo-de-exposicion');\n if ($exhibition_types) {\n foreach ($exhibition_types as $type) {\n ?>\n <li><a class=\"filter-term <?php if ($tax_slug === $type->slug) {echo 'active';}?>\" href=\"<?php echo get_term_link($type->term_id); ?>\"><?php echo $type->name; ?></a></li>\n <?php\n }\n }\n ?>\n <li>&nbsp;</li>\n <li><a href=\"<?php echo home_url('exposiciones/'); ?>\" class=\"filter-term filter-term-all <?php echo $tax_slug ? '' : 'active'; ?>\"><?php echo __('[:es]Todas[:en]All'); ?></a></li>\n<?php\n}", "function the_terms($post_id, $taxonomy, $before = '', $sep = ', ', $after = '')\n {\n }", "public abstract function getNextMenu();", "function _wp_check_split_nav_menu_terms($term_id, $new_term_id, $term_taxonomy_id, $taxonomy)\n {\n }", "function nav_menu_add_classes($items, $args) {\n //Add first item class\n $items[1]->classes[] = 'first';\n\n //Add last item class\n $i = count($items);\n while($items[$i]->menu_item_parent != 0 && $i > 0) {\n $i--;\n }\n $items[$i]->classes[] = 'last';\n\n return $items;\n}", "function pdl_selector($uid,$current=\"\") {\n\n\t$o = '';\n\n\t// You can use anybody's Comanche layouts on this site that haven't been protected in some way\n\n\t$sql_extra = item_permissions_sql($uid);\n\n\t// By default order by title (therefore at this time pdl's need a unique title across this system), \n\t// though future work may allow categorisation\n\t// based on taxonomy terms\n\n\t$r = q(\"select title, mid from item where (item_restrict & %d) $sql_extra order by title\",\n\t\tintval(ITEM_PDL)\n\t);\n\n\t$arr = array('channel_id' => $uid, 'current' => $current, 'entries' => $r);\n\tcall_hooks('pdl_selector',$arr);\n\n\t$entries = $arr['entries'];\n\t$current = $arr['current'];\t\t\n \n\t$o .= \"<select name=\\\"pdl_select\\\" id=\\\"pdl_select\\\" size=\\\"1\\\" >\";\n\t$entries[] = array('title' => t('Default'), 'mid' => '');\n\tforeach($entries as $selection) {\n\t\t$selected = (($selection == $current) ? ' selected=\"selected\" ' : '');\n\t\t$o .= \"<option value=\\\"{$selection['mid']}\\\" $selected >{$selection['title']}</option>\";\n\t}\n\n\t$o .= '</select>';\n\treturn $o;\n}", "#[Pure] public function choose (int $index) : MenuItem {\r\n return $this->items()[$index];\r\n }", "function _wp_check_split_terms_in_menus($term_id, $new_term_id, $term_taxonomy_id, $taxonomy)\n {\n }", "public static function get_first_term( $post_id, $taxonomy, $args = array() ) {\n\t\tif ( ! $post = self::get( $post_id ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$args = wp_parse_args( $args, array(\n\t\t\t'orderby' => 'name',\n\t\t\t'order' => 'ASC',\n\t\t\t'fields' => 'all'\n\t\t) );\n\n\t\t$terms = wp_get_object_terms( $post->ID, $taxonomy, $args );\n\n\t\tif ( is_wp_error( $terms ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn reset( $terms );\n\t}", "function wp_get_split_term($old_term_id, $taxonomy)\n {\n }", "public function current() {\n\t\tif(($this->endItemIdx !== null) && isset($this->lastItems[$this->endItemIdx])) {\n\t\t\treturn $this->lastItems[$this->endItemIdx][1];\n\t\t} else if(isset($this->firstItems[$this->firstItemIdx])) {\n\t\t\treturn $this->firstItems[$this->firstItemIdx][1];\n\t\t} else {\n\t\t\tif($this->items->current()->hasMethod($this->titleField)) {\n\t\t\t\treturn $this->items->current()->{$this->titleField}();\n\t\t\t}\n\n\t\t\treturn $this->items->current()->{$this->titleField};\n\t\t}\n\t}", "function PKG_multiPackageSelectionsSelection($selName,$first,$addFirstEntry=\"\")\n{\n\t$selections = HELPER_array2AssociativeArray(PKG_getAllPackageSelections($addFirstEntry));\n\treturn(HTML_selection($selName,$selections, SELTYPE_selection, true, $first, false, \"\", 5));\n}", "function cms_frontend_menu_tree__menu_footer_second_menu(&$variables) {\n return '<ul class=\"menu nav\">' . $variables['tree'] . '</ul>';\n}", "public function firstItem();", "public static function submenu($controller, $current, array $items = array())\n\t{\n\t\treturn Tart::html(NULL, function($h) use ($controller, $current, $items) {\n\t\t\t$h('ul.nav.nav-pills', function($h) use ($controller, $current, $items) {\n\t\t\t\tforeach ($items as $item => $title)\n\t\t\t\t{\n\t\t\t\t\t$h('li', array('class' => ($current == $item) ? 'active' : NULL), function($h) use ($title, $item, $controller) {\n\t\t\t\t\t\t$h('a', array('href' => Tart::uri($controller, array('category' => $item))), $title);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function entity_translation_taxonomy_term_autocomplete($langcode = NULL, $field_name = '', $tags_typed = '') {\n // If the request has a '/' in the search text, then the menu system will have\n // split it into multiple arguments, recover the intended $tags_typed.\n $args = func_get_args();\n // Shift off the $langcode and $field_name arguments.\n array_shift($args);\n array_shift($args);\n $tags_typed = implode('/', $args);\n\n // Make sure the field exists and is a taxonomy field.\n if (!($field = field_info_field($field_name)) || $field['type'] !== 'taxonomy_term_reference') {\n // Error string. The JavaScript handler will realize this is not JSON and\n // will display it as debugging information.\n print t('Taxonomy field @field_name not found.', array('@field_name' => $field_name));\n exit;\n }\n\n // The user enters a comma-separated list of tags. We only autocomplete the\n // last tag.\n $tags_typed = drupal_explode_tags($tags_typed);\n $tag_last = drupal_strtolower(array_pop($tags_typed));\n\n $term_matches = array();\n if ($tag_last != '') {\n if (!isset($langcode) || $langcode == LANGUAGE_NONE) {\n $langcode = $GLOBALS['language_content']->language;\n }\n\n // Part of the criteria for the query come from the field's own settings.\n $vocabulary = _entity_translation_taxonomy_reference_get_vocabulary($field);\n\n $entity_type = 'taxonomy_term';\n $query = new EntityFieldQuery();\n $query->addTag('taxonomy_term_access');\n $query->entityCondition('entity_type', $entity_type);\n\n // If the Title module is enabled and the taxonomy term name is replaced for\n // the current bundle, we can look for translated names, otherwise we fall\n // back to the regular name property.\n if (module_invoke('title', 'field_replacement_enabled', $entity_type, $vocabulary->machine_name, 'name')) {\n $name_field = 'name_field';\n $language_group = 0;\n // Do not select already entered terms.\n $column = 'value';\n if (!empty($tags_typed)) {\n $query->fieldCondition($name_field, $column, $tags_typed, 'NOT IN', NULL, $language_group);\n }\n $query->fieldCondition($name_field, $column, $tag_last, 'CONTAINS', NULL, $language_group);\n $query->fieldLanguageCondition($name_field, array($langcode, LANGUAGE_NONE), NULL, NULL, $language_group);\n }\n else {\n $name_field = 'name';\n // Do not select already entered terms.\n if (!empty($tags_typed)) {\n $query->propertyCondition($name_field, $tags_typed, 'NOT IN');\n }\n $query->propertyCondition($name_field, $tag_last, 'CONTAINS');\n }\n\n // Select rows that match by term name.\n $query->propertyCondition('vid', $vocabulary->vid);\n $query->range(0, 10);\n $result = $query->execute();\n\n // Populate the results array.\n $prefix = count($tags_typed) ? drupal_implode_tags($tags_typed) . ', ' : '';\n $terms = !empty($result[$entity_type]) ? taxonomy_term_load_multiple(array_keys($result[$entity_type])) : array();\n foreach ($terms as $tid => $term) {\n $name = _entity_translation_taxonomy_label($term, $langcode);\n $n = $name;\n // Term names containing commas or quotes must be wrapped in quotes.\n if (strpos($name, ',') !== FALSE || strpos($name, '\"') !== FALSE) {\n $n = '\"' . str_replace('\"', '\"\"', $name) . '\"';\n }\n $term_matches[$prefix . $n] = check_plain($name);\n }\n }\n\n drupal_json_output($term_matches);\n}", "function entity_translation_taxonomy_term_tab_access() {\n $args = func_get_args();\n $term = array_shift($args);\n if (entity_translation_enabled('taxonomy_term', $term)) {\n return entity_translation_tab_access('taxonomy_term', $term);\n }\n else {\n $function = array_shift($args);\n return $function ? call_user_func_array($function, $args) : FALSE;\n }\n}", "function power_do_subnav() {\n\n\t// Do nothing if menu not supported.\n\tif ( ! power_nav_menu_supported( 'secondary' ) ) {\n\t\treturn;\n\t}\n\n\t$class = 'menu power-nav-menu menu-secondary';\n\tif ( power_superfish_enabled() ) {\n\t\t$class .= ' js-superfish';\n\t}\n\n\tpower_nav_menu(\n\t\t[\n\t\t\t'theme_location' => 'secondary',\n\t\t\t'menu_class' => $class,\n\t\t]\n\t);\n\n}", "public function getNextTerm() {\n \treturn $this->next();\n }", "function medialab_custom_menu_order() {\n\t\treturn array( 'index.php', 'separator1', 'edit.php?post_type=page' );\n}", "function enlighten_get_menu_order($item, $args, $which = 'first') {\n\tstatic $cache = array('first' => array(), 'last' => array());\n\n\t// return cached item\n\tif (isset($cache[$which][$item->menu_item_parent]))\n\t\treturn $cache[$which][$item->menu_item_parent];\n\n\t// Get the menu order for both the menu level and direction\n\tif (!isset($cache[$which][$item->menu_item_parent]) && $args->theme_location && ($locations = get_nav_menu_locations()) && isset($locations[$args->theme_location])) {\n\t\tglobal $wpdb;\n\t\t$found = $wpdb->get_var($wpdb->prepare(\"\n\t\t\tSELECT p.menu_order FROM {$wpdb->prefix}term_relationships tr\n\t\t\tINNER JOIN {$wpdb->prefix}posts p ON p.ID = tr.object_id\n\t\t\tINNER JOIN {$wpdb->prefix}postmeta pm ON pm.post_id = p.ID AND pm.meta_key = '_menu_item_menu_item_parent' AND pm.meta_value = %s\n\t\t\tWHERE tr.term_taxonomy_id = %d\n\t\t\tORDER BY p.menu_order \". ($which === 'last' ? 'DESC' : 'ASC') .\" LIMIT 1\", $item->menu_item_parent, $locations[$args->theme_location]));\n\t\tif ($found) {\n\t\t\treturn $cache[$which][$item->menu_item_parent] = $found;\n\t\t}\n\t}\n}", "function matchFirstCategory( $menuname, $categories ) {\n # First load and parse the template page \n $content = loadTemplate( $menuname );\n \n # Navigation list\n $breadcrumb = '';\n preg_match_all( \"`<li>\\s*?(.*?)\\s*</li>`\", $content, $matches, PREG_PATTERN_ORDER );\n \n # Look for the first matching category or a default string\n foreach ( $matches[1] as $nav ) {\n $pos = strpos( $nav, DELIM ); // End of category\n if ( $pos !== false ) {\n $cat = trim( substr($nav, 0, $pos) );\n $crumb = trim( substr($nav, $pos + 1) );\n // Is there a match for any of our page's categories? \n if ( $cat == 'default' ) {\n $breadcrumb = $crumb;\n }\n else if ( in_array( $cat, $categories ) ) {\n $breadcrumb = $crumb;\n break;\n }\n }\n }\n \n return normalizeParameters( $breadcrumb, DELIM, 3 );\n}", "private function _add_default_menus()\n\t{\t\n\t\t$menu_terms = array(\n\n\t\t\t// main navigation\n\t\t\t'main' => array(\n\t\t\t\t'term' => __( 'Main Navigation', 'particle' ),\n\t\t\t\t'taxonomy' => 'nav_menu',\n\t\t\t\t'args' => array( \n\t\t\t\t\t'description' \t=> __( 'The primary navigation menu', 'particle' ),\n\t\t\t\t\t'slug' \t\t\t=> 'main-navigation',\n\t\t\t\t\t'parent' \t\t=> 0\n\t\t\t\t)\n\t\t\t),\n\n\t\t\t// footer navigation\n\t\t\t'footer' => array(\n\t\t\t\t'term' => __( 'Footer Navigation', 'particle' ),\n\t\t\t\t'taxonomy' => 'nav_menu',\n\t\t\t\t'args' => array( \n\t\t\t\t\t'description' \t=> __( 'The footer navigation menu', 'particle' ),\n\t\t\t\t\t'slug' \t\t\t=> 'footer-navigation',\n\t\t\t\t\t'parent' \t\t=> 0\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\n\t\t$menu_terms = apply_filters( 'particle_default_menu_terms', $menu_terms );\n\n\t\t// boolean indicating whether or not the theme_mod option should be updated\n\t\t$update_theme_mod = false;\n\n\t\t// check to see if each of the menu items have been created\n\t\tforeach( $menu_terms as $name=>$menu ) {\n\t\t\textract( $menu );\n\n\t\t\tif( !term_exists( $term, $taxonomy ) ) {\n\t\t\t\t$update_theme_mod = true;\n\t\t\t\t$ids = wp_insert_term( $term, $taxonomy, $args );\n\n\t\t\t\t// set value to be saved to the theme_mod option later\n\t\t\t\t$value[ $name ] = $ids['term_id'];\n\t\t\t}\n\t\t}\n\n\t\tif( $update_theme_mod )\n\t\t\tset_theme_mod( 'nav_menu_locations', $value );\t\t\n\t}", "function minorite_menu_link(array $variables) {\n $element = $variables['element'];\n $path = $element['#href'];\n $sub_menu = '';\n\n // Append active class.\n if (($path == $_GET['q'] || ($path == '<front>' && drupal_is_front_page())) &&\n (empty($options['language']) || $options['language']->language == $language_url->language)) {\n $element['#attributes']['class'][] = 'nav-selected';\n }\n\n if (!empty($element['#below'])) {\n $sub_menu = drupal_render($element['#below']);\n $element['#attributes']['class'][] = 'nav-has-child';\n }\n $output = l($element['#title'], $element['#href'], $element['#localized_options']);\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "function _wp_check_split_default_terms($term_id, $new_term_id, $term_taxonomy_id, $taxonomy)\n {\n }", "public function toggle_term() {\n\t\tglobal $post;\n\n\t\t$post = array_shift( get_posts( array(\n\t\t\t'post_type' => $this->params['post_type'],\n\t\t\t'name' => $this->params['post_name']\n\t\t) ) );\n\n\t\t$taxonomy = $this->params['action_key'];\n\n\t\t$terms = is_array( $this->params['extra'] ) ? explode( ',', $this->params['extra'][0] ) : array();\n\n\t\tforeach ( $terms as $term_key => $term ) {\n\t\t\tif ( is_string( $term ) ) {\n\t\t\t\tif ( ! $this_term = term_exists( $term, $taxonomy ) ) {\n\t\t\t\t\t// $caption = ucwords(str_replace(\"_\", \" \", (string) $field_name));\n\t\t\t\t\twp_insert_term( ucwords( str_replace( array( \"_\", \"-\" ), \" \", $term ) ), $taxonomy, array( 'slug' => $term ) );\n\t\t\t\t\t$this_term = get_term_by( 'slug', $term, $taxonomy, ARRAY_A );\n\t\t\t\t}\n\n\t\t\t\t$term_id = $this_term['term_id'];\n\t\t\t} else {\n\t\t\t\t$term_id = $term;\n\t\t\t}\n\n\t\t\t$current_action = $this->get_current_action();\n\t\t\tif ( has_term( $term_id, $taxonomy, $post->ID ) ) {\n\t\t\t\t$existing_terms_array = wp_get_post_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );\n\n\t\t\t\t// Remove the current term form the terms array\n\t\t\t\tforeach ( $existing_terms_array as $term_index => $existing_term ) {\n\t\t\t\t\tif ( $term_id == $existing_term ) {\n\t\t\t\t\t\tunset( $existing_terms_array[$term_index] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->action_results[ 'data' ][ 'post_id' ] = $post->ID;\n\n\t\t\t\t// Remove the term, the fourth parameter 'false' relaces the term array\n\t\t\t\tif ( $result = wp_set_post_terms( $post->ID, $existing_terms_array, $taxonomy, false ) ) {\n\t\t\t\t\t$action_status = 'success';\n\t\t\t\t\t$this->action_results[ 'messages' ][ 'note' ] = __( 'Term Removed', 'kickpress' );\n\t\t\t\t\t$this->action_results[ 'data' ][ 'terms' ] = $result;\n\t\t\t\t} else {\n\t\t\t\t\tif ( false === $result ) {\n\t\t\t\t\t\t$action_status = 'failure';\n\t\t\t\t\t\t$this->action_results[ 'messages' ][ 'note' ] = __( 'Failed to Remove Term', 'kickpress' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$action_status = 'success';\n\t\t\t\t\t\t$this->action_results[ 'messages' ][ 'note' ] = __( 'Term Removed', 'kickpress' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Add the term, the fourth parameter 'true' appends the term to the term array\n\t\t\t\tif ( $result = wp_set_post_terms( $post->ID, array( intval( $term_id ) ), $taxonomy, true ) ) {\n\t\t\t\t\t$this->action_results[ 'data' ][ 'terms' ] = $result;\n\t\t\t\t\t$action_status = 'success';\n\t\t\t\t\t$this->action_results[ 'messages' ][ 'note' ] = __( 'Term Added', 'kickpress' );\n\t\t\t\t} else {\n\t\t\t\t\t$action_status = 'failure';\n\t\t\t\t\t$this->action_results[ 'messages' ][ 'note' ] = __( 'Failed to Remove Term', 'kickpress' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->action_results[ 'status' ] = $action_status;\n\t\t\t$this->action_results[ 'data' ][ 'terms' ] = wp_get_post_terms( $post->ID, $taxonomy );\n\t\t}\n\t}", "function get_top_menu($nav){\n foreach(deka(array(), $nav,'data') as $menu_item) :\n $linkclass = $menu_item['slug'];\n if( (defined('URI_PART_0')) && ($linkclass === URI_PART_0 ) ) $linkclass .= ' current';\n echo '<li class=\"' . $linkclass . '\">';\n echo get_cat_link($menu_item);\n\n if(deka(array(), $menu_item, 'children')) :\n echo '<ul class=\"subMenu\">';\n foreach($menu_item['children'] as $k => $sub_menu_item) :\n $sublinkclass = $k+1;\n if($k+1 === count($menu_item['children'])) $sublinkclass .= ' last';\n echo '<li class=\"' . $sublinkclass . '\">';\n echo get_subcat_link($menu_item, $sub_menu_item);\n echo '</li>';\n endforeach; // menu_item['children'] as sub_menu_item\n echo '</ul>';\n endif; // deka(array(), menu_item, 'children'\n\n echo '</li>';\n endforeach; // deka(array(), nav, 'data') as menu_item\n}", "function wp_get_split_terms($old_term_id)\n {\n }", "public function render_menu_item( Term $term, $config )\n\t{\n\t\t$title = $term->term_display;\n\t\t$link = '';\n\t\t$objects = $term->object_types();\n\n\t\t$active = false;\n\t\t$spacer = false;\n\t\tforeach( $objects as $object_id => $type ) {\n\t\t\tswitch( $type ) {\n\t\t\t\tcase 'post':\n\t\t\t\t\t$post = Post::get( array( 'id' => $object_id ) );\n\t\t\t\t\tif( $post instanceof Post ) {\n\t\t\t\t\t\t$link = $post->permalink;\n\t\t\t\t\t\tif( $config[ 'theme' ]->posts instanceof Post && $config[ 'theme' ]->posts->id == $post->id ) {\n\t\t\t\t\t\t\t$active = true;\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\t// The post doesn't exist or the user does not have access to it\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'menu':\n\t\t\t\t\t$item_types = $this->get_item_types();\n\t\t\t\t\tswitch( $object_id ) {\n\t\t\t\t\t\tcase $item_types[ 'url' ]:\n\t\t\t\t\t\t\t$link = $term->info->url;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase $item_types[ 'spacer' ]:\n\t\t\t\t\t\t\tif ( empty( $term->term_display ) ) {\n\t\t\t\t\t\t\t\t$title = '&nbsp;';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$spacer = true;\n\t\t\t\t\t\t\t// no need to break, default below is just fine.\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$link = null;\n\t\t\t\t\t\t\t$link = Plugins::filter( 'get_item_link', $link, $term, $object_id, $type );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif( empty( $link ) ) {\n\t\t\t$config[ 'wrapper' ] = sprintf($config[ 'linkwrapper' ], $title);\n\t\t}\n\t\telse {\n\t\t\t$config[ 'wrapper' ] = sprintf( $config[ 'linkwrapper' ], \"<a href=\\\"{$link}\\\">{$title}</a>\" );\n\t\t}\n\t\tif( $active ) {\n\t\t\t$config[ 'itemattr' ][ 'class' ] = 'active';\n\t\t}\n\t\telse {\n\t\t\t$config[ 'itemattr' ][ 'class' ] = 'inactive';\n\t\t}\n\t\tif( $spacer ) {\n\t\t\t$config[ 'itemattr' ][ 'class' ] .= ' spacer';\n\t\t}\n\t\treturn $config;\n\t}", "public function lastItem();", "function wpcf_custom_types_menu_order_move( &$menu, $item_move, $item_target ) {\n\n // if item move comes after target we have to select the next element,\n // otherwise the $item_move would be added before the target.\n if( $item_move > $item_target )\n $item_target++;\n\n // if $item_target is the last menu item, place $item_move to the end of the array\n if( !isset( $menu[$item_target]) ) {\n $tmp_menu_item = $menu[$item_move];\n unset( $menu[$item_move] );\n $menu[] = $tmp_menu_item;\n\n // $item_target is not the last menu, place $item_move after it\n } else {\n $cut_moving_element = array_splice( $menu, $item_move, 1 );\n array_splice( $menu, $item_target, 0, $cut_moving_element );\n }\n\n}", "function selected($selected, $current = \\true, $display = \\true)\n {\n }", "function firstArrow(){\n\t\tglobal $paged;\n\n\t\t\n\t\t// This firs set of if's ads the arrows to the pagination\n // if there are more than 2 pages and the page is outside the range, before show the <<\n\t\t \n if($paged > 2 && $paged > $this->range+1 && $this->count < $this->pages) \n\t\t {\n\t\t\t $this->content .= \"<li><a href='\".get_pagenum_link($page).\"'>&laquo;</a></li>\";\n\t\t }\n\t\t\t\t \n\t\t\n\t}", "function getFirstItem() { return $this->m_firstItem; }", "function _entity_translation_taxonomy_autocomplete_widget_get_terms($element) {\n $items = isset($element['#entity']->{$element['#field_name']}[$element['#language']]) ?\n $element['#entity']->{$element['#field_name']}[$element['#language']] : array();\n $tids = array_map(function ($item) { return $item['tid']; }, $items);\n return taxonomy_term_load_multiple($tids);\n}", "function custom_menu_separators( $menu_items, $args ) {\n\t$filtered_menu_items = array();\n\n\t$limit = count( $menu_items );\n\n\t$separator = new WP_Post();\n\n\t// These parameters will be added to our separator object.\n\t$add = array(\n\t\t'type' => 'sep',\n\t\t'type_label' => 'sep',\n\t\t'title' => '|',\n\t\t'classes' => array( 'menu-separator' ),\n\t);\n\tforeach ( $add as $k => $v ) $separator->{$k} = $v;\n\n\t$i = 0;\n\t$last_sep = null;\n\t$last_toplevel_page = null;\n\tforeach ( $menu_items as $k => $item ) {\n\t\t$filtered_menu_items[$i] = $item;\n\t\tif ( $item->menu_item_parent == false ) {\n\t\t\t$last_toplevel_page = $i;\n\t\t}\n\t\t$i++;\n\n\t\t// Add our separator if this item is a top-level item (has no parent)\n\t\tif ( $item->menu_item_parent == false ) {\n\t\t\t// Our separator object is not a menu item, but a wp_post object. Add any missing menu item keys with a value of false (prevents errors)\n\t\t\tforeach ( $item as $menu_k => $menu_v ) if ( !property_exists( $separator, $menu_k ) ) {\n\t\t\t\t$separator->{$menu_k} = false;\n\t\t\t}\n\n\t\t\t// Use the ID of the current item, with append -sep to prevent ID clashing.\n\t\t\t$separator->ID = $item->ID . '-sep';\n\n\t\t\t// Add our separator to the menu\n\t\t\t$filtered_menu_items[$i] = $separator;\n\t\t\t$last_sep = $i;\n\t\t\t$i++;\n\t\t}\n\t}\n\n\t// The last element should never be a separator.\n\tif ( $last_sep && ( $last_toplevel_page < $last_sep ) ) {\n\t\tunset( $filtered_menu_items[$last_sep] );\n\t}\n\n\treturn $filtered_menu_items;\n}", "function get_terms( $terms, $taxonomies, $args ){\r\n\r\n\t\t// give users a chance to disable the no term feature\r\n\t\tif( ! apply_filters( 'radio-buttons-for-taxonomies-no-term-' . $this->taxonomy, TRUE ) )\r\n\t\t\treturn $terms;\r\n\r\n\t\tif ( is_admin() && function_exists( 'get_current_screen' ) && ! is_wp_error( $screen = get_current_screen() ) && is_object( $screen ) && in_array( $screen->base, array( 'post', 'edit-post', 'edit' ) ) ) {\r\n\r\n\t\t\tif( in_array( $this->taxonomy, ( array ) $taxonomies ) && ! in_array( 'category', $taxonomies ) ) {\r\n\r\n\t\t\t\t$no_term = sprintf( __( 'No %s', 'radio-buttons-for-taxonomies' ), $this->tax_obj->labels->singular_name );\r\n\r\n\t\t\t\t$uncategorized = (object) array( 'term_id' => '0', 'slug' => '0', 'name' => $no_term, 'parent' => '0' );\r\n\r\n\t\t\t\t$terms['null'] = $uncategorized;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $terms;\r\n\t}", "public abstract function getPrevMenu();", "public function NextOf($item)\n {\n return SelectOption::Schema()->ByPrevious($item);\n }", "function get_primary_menu($the_menu) {\n if ($the_menu == 'secondary') {\n $menu_name = $the_menu;\n\n if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {\n $menu = wp_get_nav_menu_object( $locations[ $menu_name ] );\n\n $menu_items = wp_get_nav_menu_items($menu->term_id);\n $menu_list = '<ul id=\"one-page-nav\" class=\"nav\" >';\n\n foreach ( (array) $menu_items as $key => $menu_item ) {\n $title = $menu_item->title;\n $id = $menu_item->object_id;\n $url = $menu_item->url;\n $slug = strtolower($title);\n $slug = str_replace(' ', '-', $slug);\n $slug = str_replace('å', 'a', $slug);\n $slug = str_replace('ä', 'a', $slug);\n $slug = str_replace('ö', 'o', $slug);\n $menu_list .= '<li><a href=\"'. $url . '\" class=\"page-scroll\">' . $title . '</a></li>';\n }\n $menu_list .= '</ul>';\n } \n else {\n $menu_list = '<ul><li>Menu \"' . $menu_name . '\" not defined.</li></ul>';\n }\n return $menu_list;\n }\n else {\n $menu_name = $the_menu;\n\n if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {\n $menu = wp_get_nav_menu_object( $locations[ $menu_name ] );\n\n $menu_items = wp_get_nav_menu_items($menu->term_id);\n\n $menu_list = '<ul id=\"one-page-nav\" class=\"nav navbar-nav\" >';\n\n foreach ( (array) $menu_items as $key => $menu_item ) {\n if ($menu_item->title ==\"Om\") {\n $title = $menu_item->title;\n $id = $menu_item->object_id;\n $url = $menu_item->url;\n $slug = get_the_slug( $menu_item->object_id );\n $menu_list .= '<li><a href=\"#' . $slug . '\" class=\"page-scroll\">' . $title . ' <span class=\"notranslate\">Hamnfestivalen</span></a></li>';\n\n }\n else {\n $title = $menu_item->title;\n $id = $menu_item->object_id;\n $url = $menu_item->url;\n $slug = get_the_slug( $menu_item->object_id );\n $menu_list .= '<li><a href=\"#' . $slug . '\" class=\"page-scroll\">' . $title . '</a></li>';\n }\n }\n $menu_list .= '</ul>';\n } \n else {\n $menu_list = '<ul><li>Menu \"' . $menu_name . '\" not defined.</li></ul>';\n }\n return $menu_list;\n }\n}", "public static function alm_build_terms_select($obj, $matchArray, $selected, $terms){\n\n\t\t\t$items_count = 0;\n\n\t\t\tforeach($terms as $item) {\n\n\t\t\t\t$items_count++;\n\t\t\t\t$name = $item->name;\n\t\t\t\t$slug = $item->slug;\n\t\t\t\t$total = alm_filters_build_count( $obj['show_count'], $item, false );\n\t\t\t\t$total = ! empty( $total ) ? apply_filters( 'alm_filters_show_count_select_display', ' [' . $item->count . ']', $item->count ) : '';\n\t\t\t\t$has_parent = ( isset($item->parent) && $item->parent > 0 ) ? true : false;\n\t\t\t\t$parent = ($has_parent) ? ' has_parent' : '';\n\t\t\t\t$fieldname_val = $obj['key'] .'-'. $obj['field_type'] .'-'. $obj['count'];\n\t\t\t\t$fieldname = ($obj['field_type'] === 'radio') ? ' name=\"'. $fieldname_val .'\"' : '';\n\n\t\t\t\t// If category_and use ID\n\t\t\t\t$slug = ($obj['key'] === 'category_and') ? $item->term_id : $slug;\n\n\t\t\t\t// If tag_and use ID\n\t\t\t\t$slug = ($obj['key'] === 'tag_and') ? $item->term_id : $slug;\n\n\t\t\t\tif(!empty($matchArray)){\n\t\t\t\t\t$selected = (in_array($slug, $matchArray)) ? ' selected=\"selected\"' : '';\n\t\t\t\t}\n\n\t\t\t\tif($items_count === 1 && $obj['label']){\n\t\t\t\t\techo '<option value=\"#\"'. $selected .'>'. $obj['label'] .'</option>';\n\t\t\t\t}\n\n\t\t\t\techo '<option id=\"'. $obj['field_type'] .'-'. $slug .'\"'. $fieldname .' value=\"'. $slug .'\"'. $selected .'>';\n\t\t\t\techo ! empty( $parent ) ? ' - '. $name . $total : $name . $total;\n\t\t\t\techo '</option>';\n\t\t\t}\n\t\t}", "public function taxonomy();", "function wp_dropdown_roles($selected = '')\n {\n }", "public function first_term(){\n return $this->first_day_first_semester->day.' '\n .trans('dates.month.'.$this->first_day_first_semester->month).' - '\n .$this->last_day_first_semester->day.' '\n .trans('dates.month.'.$this->last_day_first_semester->month);\n }", "function get_next_post($in_same_term = \\false, $excluded_terms = '', $taxonomy = 'category')\n {\n }", "private function PH_PageMenu(){\n $site_menu = self::$xvi_api->GetSiteMenu();\n $page_menu = self::$xvi_api->GetPageMenu();\n \n $menu =\"\";\n foreach($site_menu as $menu_item=>$menu_path) {\n if (strcmp($menu_item,$page_menu[\"item\"])) { /*not selected menu item*/\n $menu .= \"<li><a href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n } else { /* it is selected menu*/\n $menu .= \"<li><a class=\\\"sel\\\" href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n }\n }\n return $menu;\n }", "public function taxonomy_highlight() {\n\t\t\tglobal $current_screen, $taxnow;\n\n\t\t\tif ( is_a( $current_screen, 'WP_Screen' ) && ! empty( $taxnow ) && in_array( $taxnow, array( wct_get_tag(), wct_get_category() ) ) ) {\n\t \t\t\t$current_screen->post_type = $this->post_type;\n\t \t\t}\n\t\t}", "function audiotheme_nav_menu_classes( $items, $args ) {\n\tglobal $wp;\n\n\t$classes = array();\n\t$first_top = -1;\n\n\t$current_url = trailingslashit( home_url( add_query_arg( array(), $wp->request ) ) );\n\t$blog_page_id = get_option( 'page_for_posts' );\n\t$is_blog_post = is_singular( 'post' );\n\n\t$is_audiotheme_post_type = is_singular( array( 'audiotheme_gig', 'audiotheme_record', 'audiotheme_track', 'audiotheme_video' ) );\n\t$post_type_archive_id = get_audiotheme_post_type_archive( get_post_type() );\n\t$post_type_archive_link = get_post_type_archive_link( get_post_type() );\n\n\tforeach ( $items as $key => $item ) {\n\t\tif ( 0 == $item->menu_item_parent ) {\n\t\t\t$first_top = ( -1 == $first_top ) ? $key : $first_top;\n\t\t\t$last_top = $key;\n\t\t} else {\n\t\t\tif ( ! isset( $classes['first-child-items'][ $item->menu_item_parent ] ) ) {\n\t\t\t\t$classes['first-child-items'][ $item->menu_item_parent ] = $key;\n\t\t\t\t$items[ $key ]->classes[] = 'first-child-item';\n\t\t\t}\n\t\t\t$classes['last-child-items'][ $item->menu_item_parent ] = $key;\n\t\t}\n\n\t\tif ( ! is_404() && ! is_search() ) {\n\t\t\tif (\n\t\t\t\t'audiotheme_archive' == $item->object &&\n\t\t\t\t$post_type_archive_id == $item->object_id &&\n\t\t\t\ttrailingslashit( $item->url ) == $current_url\n\t\t\t) {\n\t\t\t\t$items[ $key ]->classes[] = 'current-menu-item';\n\t\t\t}\n\n\t\t\tif ( $is_blog_post && $blog_page_id == $item->object_id ) {\n\t\t\t\t$items[ $key ]->classes[] = 'current-menu-parent';\n\t\t\t}\n\n\t\t\t// Add 'current-menu-parent' class to CPT archive links when viewing a singular template.\n\t\t\tif ( $is_audiotheme_post_type && $post_type_archive_link == $item->url ) {\n\t\t\t\t$items[ $key ]->classes[] = 'current-menu-parent';\n\t\t\t}\n\t\t}\n\t}\n\n\t$items[ $first_top ]->classes[] = 'first-item';\n\t$items[ $last_top ]->classes[] = 'last-item';\n\n\tif ( isset( $classes['last-child-items'] ) ) {\n\t\tforeach ( $classes['last-child-items'] as $item_id ) {\n\t\t\t$items[ $item_id ]->classes[] = 'last-child-item';\n\t\t}\n\t}\n\n\treturn $items;\n}", "private function pupulate_default_terms()\n {\n\n $taxonomies = get_taxonomies();\n if (is_array($taxonomies)) {\n foreach ($taxonomies as $taxonomy) {\n $current_values = get_terms($taxonomy, array('hide_empty' => false));\n if (empty($current_values)) {\n $defaults = $this->get_default_taxonomy_values($taxonomy);\n if (!empty($defaults)) {\n foreach ($defaults as $default) {\n if (!term_exists($default['name'], $taxonomy)) {\n wp_insert_term($default['name'], $taxonomy, array('slug' => $default['short']));\n }\n }\n }\n }\n }\n }\n }", "function _post_format_get_terms($terms, $taxonomies, $args)\n {\n }", "public function getSelected() {}", "public function getSelected() {}", "static function sideSelect($item)\n\t{\n\t\treturn ($GLOBALS['subpg']==$item? ' class=\"sideCurr\"':'');\n\t}", "function links__system_secondary_menu($vars){\n $menu_links = menu_tree_output(menu_tree_all_data('main-menu'));\n\n // Initialize some variables to prevent errors\n $output = '';\n $sub_menu = '';\n\n foreach ($menu_links as $key => $link) {\n // Add special class needed for Foundation dropdown menu to work\n !empty($link['#below']) ? $link['#attributes']['class'][] = 'has-dropdown' : '';\n\n // Render top level and make sure we have an actual link\n if (!empty($link['#href'])) {\n $output .= '<li' . drupal_attributes($link['#attributes']) . '>' . l($link['#title'], $link['#href']);\n // Get sub navigation links if they exist\n foreach ($link['#below'] as $key => $sub_link) {\n if (!empty($sub_link['#href'])) {\n $sub_menu .= '<li>' . l($sub_link['#title'], $sub_link['#href']) . '</li>';\n }\n\n }\n $output .= !empty($link['#below']) ? '<ul class=\"dropdown\">' . $sub_menu . '</ul>' : '';\n\n // Reset dropdown to prevent duplicates\n unset($sub_menu);\n $sub_menu = '';\n\n $output .= '</li>';\n }\n }\n return $output;\n}", "function uwwtd_menu_link__main_menu(&$variables) {\n $element = $variables['element'];\n\n $sub_menu = ($element['#below'] ? drupal_render($element['#below']) : '');\n $depth = $element['#original_link']['depth'] + 1;\n\n $unused = array('leaf', 'first', 'menu-mlid-' . $element['#original_link']['mlid']);\n $element['#attributes']['class'] = array_diff($element['#attributes']['class'], $unused);\n\n $element['#attributes']['class'][] = 'menu-item';\n $element['#attributes']['class'][] = 'menu-item--depth-' . $element['#original_link']['depth'];\n\n $element['#localized_options']['html'] = TRUE;\n $element['#localized_options']['attributes']['class'][] = 'menu-link';\n $element['#localized_options']['attributes']['class'][] = 'menu-link--depth-' . $element['#original_link']['depth'];\n\n if (!empty($sub_menu)) {\n // Wrap menu-level for each level.\n $sub_menu = '<div class=\"menu-level menu-level--' . $depth . '\">' . $sub_menu . '</div>';\n }\n // krumo($element);\n if ($depth == 2 && $element['#below']) {\n $link = l('<span class=\"title\">' . $element['#title'] . ' <i style=\"float:right;line-height:20px;\" class=\"fa fa-caret-down\"></i></span>', $element['#href'], $element['#localized_options']);\n } elseif ($depth == 3 && $element['#below']) {\n $link = l('<span class=\"title\">' . $element['#title'] . ' <i style=\"float:right;line-height:20px;\" class=\"fa fa-caret-right\"></i></span>', $element['#href'], $element['#localized_options']);\n } else {\n $link = l('<span class=\"title\">' . $element['#title'] . '</span>', $element['#href'], $element['#localized_options']);\n }\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $link . $sub_menu . '</li>';\n\n}", "function katayam_get_terms($postID,$term){\r\n\t$terms_list= wp_get_post_terms($postID,$term);\r\n\t$output='';\r\n\t\t\t\t\t$i=0;\r\n foreach($terms_list as $term){$i++;\r\n\t\t\t\t\t if($i>1){$output.=',';}\r\n\t $output.='<a href=\"'.get_term_link($term).'\">'.$term->name.'</a>';\r\n }\r\n\t\t\t\t\t\t\t return $output;\r\n}", "static function get_first_term_name( $taxonomy ) {\n\t\tglobal $post;\n\n\t\t$terms = get_the_terms( $post, $taxonomy );\n\t\tif ( ! empty( $terms ) ) {\n\t\t\treturn $terms[0]->name;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}", "public function kong_get_menu_items_terms($menu_taxonomy_terms ,$taxonomy ,$parent_menu_slug, $callbackname) {\n foreach ($menu_taxonomy_terms as $terms) {\n //print_r($terms);\n //$term_slug = $terms->slug;\n /*add_submenu_page( $taxonomy['slug'].'-'.$parent_menu_slug, $terms->name, $terms->name.' <span>'.$this->kong_terms_count_by_loggedid($terms->taxonomy,$terms->slug).'</span>',\n 'edit_tickets', $taxonomy['slug'].'-'.$terms->slug,array($this,$callbackname));*/\n\n add_submenu_page( $taxonomy['slug'].'-'.$parent_menu_slug, $terms->name, $terms->name,\n 'edit_tickets', $taxonomy['slug'].'-'.$terms->slug,array($this,$callbackname));\n }\n\n }", "function twig_last(Twig_Environment $env, $item)\n{\n $elements = twig_slice($env, $item, -1, 1, false);\n return is_string($elements) ? $elements[0] : current($elements);\n}", "public function first(){\n $this->debugBacktrace();\n $this->selectModifier = \"first\";\n return $this;\n }", "function roots_cpt_active_menu($menu) {\n if ('base_service' === get_post_type()) {\n $menu = str_replace('active', '', $menu);\n $menu = str_replace('menu-services', 'menu-services active', $menu);\n }\n if ('base_portfolio' === get_post_type()) {\n $menu = str_replace('active', '', $menu);\n $menu = str_replace('menu-portfolio', 'menu-portfolio active', $menu);\n }\n return $menu;\n}", "function twig_first(Twig_Environment $env, $item)\n{\n $elements = twig_slice($env, $item, 0, 1, false);\n return is_string($elements) ? $elements[0] : current($elements);\n}", "function wp_dropdown_cats($current_cat = 0, $current_parent = 0, $category_parent = 0, $level = 0, $categories = 0)\n {\n }", "public function menu_secondary_menu()\n {\n return menu_secondary_menu();\n }", "function get_first_category_link($post_id) {\n $category = get_the_category($post_id);\n if ($category[0]) {\n return get_category_link($category[0]->term_id);\n }\n}", "private function set_firstItemTreeView()\n {\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n // RETURN current filter isn't a tree view\n // #i0117, 141223, dwildt, 1-/+\n //if ( !in_array( $table, $this->arr_tablesWiTreeparentfield ) )\n if ( !in_array( $this->curr_tableField, $this->arr_tablesWiTreeparentfield ) )\n {\n return;\n }\n // RETURN current filter isn't a tree view\n // Prepend the first item to class var $rows\n $this->set_firstItem();\n\n return;\n }", "function getSfMenu($selected) {\n $activeMenusAndLinkContent = getActiveMenuAndLinkContent();\n $activeMenus = $activeMenusAndLinkContent['results'];\n $link_content_id = $activeMenusAndLinkContent['link_contents_id'];\n $link_content_details = getLinkContentDetails($link_content_id);\n \n// Format our active menus for sturcturing a tree for main menu\n $formatedMenus = formatTree($activeMenus, 1);\n $menuStr = \"<ul id='nav'>\";\n foreach ($formatedMenus as $menu) {\n if (!empty($menu['submenu'])) {\n $mnuclass = \"\";\n $p = $link_content_details[$menu['link_content']]['content_uri'];\n $link = $AbsoluteURL . 'index.php?p=' . $p;\n if ($menu['type'] == \"external\") {\n $link = $menu['external_link'];\n }\n if ($p == $selected) {\n $mnuclass = \"class='active'\";\n } elseif (is_submenu_selected($menu['submenu'], $selected, $link_content_details)) {\n $mnuclass = \"class='active'\";\n }\n\n $menuStr.='<li ' . $mnuclass . '><a href = \"' . $link . '\">' . $menu['menu_name'] . '</a>';\n $menuStr.=\"<ul>\";\n foreach ($menu['submenu'] as $submenu) {\n $submnuclass = \"\";\n $p = $link_content_details[$submenu['link_content']]['content_uri'];\n $link = $AbsoluteURL . 'index.php?p=' . $p;\n if ($submenu['type'] == \"external\") {\n $link = $submenu['external_link'];\n }\n if ($submenu['type'] == \"category\") {\n $link = \"index.php?p=allproducts&c=\".$submenu['menu_id'];\n }\n if ($p == $selected)\n $submnuclass = \"class='sub_active'\";\n\n $menuStr.='<li ' . $submnuclass . '><a href = \"' . $link . '\">' . $submenu['menu_name'] . '</a></li>';\n }\n $menuStr.=\"</ul></li>\";\n } else {\n $mnuclass = \"\";\n $p = $link_content_details[$menu['link_content']]['content_uri'];\n $link = $AbsoluteURL . 'index.php?p=' . $p;\n if ($menu['type'] == \"external\") {\n $link = $menu['external_link'];\n }\n if ($p == $selected)\n $mnuclass = \"class='active'\";\n $menuStr.='<li ' . $mnuclass . '><a href = \"' . $link . '\">' . $menu['menu_name'] . '</a><li>';\n }\n }\n $menuStr.=\"</ul>\";\n return $menuStr;\n}", "function taxvalue($tax) {\n $args = array(\n 'parent' => 0,\n 'orderby' => 'slug',\n 'hide_empty' => false\n );\n\n $terms = get_terms( $tax, $args);\n if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){\n echo '<ul class=\"listcat listcat-'.$tax.'\">';\n foreach ( $terms as $term ) {\n $subterms1 = get_terms($tax, array('parent' => $term->term_id, 'orderby' => 'slug', 'hide_empty' => false));\n\n if (sizeof($subterms1) > 0) {\n echo '<li class=\"listcat-item\"><a href=\"'.esc_url( get_term_link( $term ) ).'\">' . $term->name . '</a>';\n\n // sub term 1\n echo '<ul class=\"subterm\">';\n foreach ($subterms1 as $term) {\n $subterms2 = get_terms($tax, array('parent' => $term->term_id, 'orderby' => 'slug', 'hide_empty' => false));\n\n if (sizeof($subterms2) > 0) {\n echo '<li class=\"listcat-item has-subterm\"><a href=\"'.esc_url( get_term_link( $term ) ).'\">' . $term->name . '</a>';\n\n // sub term 2\n echo '<ul class=\"subterm\">';\n foreach ($subterms2 as $term) {\n echo '<li class=\"listcat-item\"><a href=\"'.esc_url( get_term_link( $term ) ).'\">' . $term->name . '</a></li>';\n }\n echo '</ul></li>';\n } else {\n echo '<li class=\"listcat-item\"><a href=\"'.esc_url( get_term_link( $term ) ).'\">' . $term->name . '</a></li>';\n }\n }\n echo '</ul></li>';\n } else {\n echo '<li class=\"listcat-item\"><a href=\"'.esc_url( get_term_link( $term ) ).'\">' . $term->name . '</a></li>';\n }\n }\n echo '</ul>';\n }\n}", "function wp_nav_menu_update_menu_items($nav_menu_selected_id, $nav_menu_selected_title)\n {\n }", "public function term_by_query( $args, $assoc_args ) {\n\n\t\t$sites = $args[0] ? explode( ',', $args[0] ) : [];\n\n\t\t$sites = array_filter( $sites, function( $site_id ) {\n\t\t\treturn is_numeric( $site_id );\n\t\t} );\n\n\t\t$method = isset( $assoc_args['method'] ) ? $assoc_args['method'] : 'sync';\n\n\t\tif ( ! $sites ) {\n\t\t\tWP_CLI::error( 'Invalid site ID param' );\n\t\t}\n\n\t\tif ( empty( $assoc_args['taxonomy'] ) ) {\n\t\t\tWP_CLI::error( 'Please define the taxonomy query arg.' );\n\t\t}\n\n\t\t$query_args = wp_parse_args( $assoc_args, [\n\t\t\t'taxonomy' => 'post_tag',\n\t\t\t'offset' => 0,\n\t\t\t'number' => 100,\n\t\t\t'hide_empty' => false,\n\t\t] );\n\n\t\tif ( empty( $assoc_args['force_sync'] ) || 'false' === $assoc_args['force_sync'] ) {\n\t\t\t$assoc_args['force_sync'] = false;\n\t\t}\n\n\t\tif ( isset( $assoc_args['include'] ) ) {\n\t\t\t$query_args['include'] = explode( ',', str_replace( ' ', '', $query_args['include'] ) );\n\t\t}\n\n\t\t$query_args['taxonomy'] = explode( ',', str_replace( ' ', '', $query_args['taxonomy'] ) );\n\n\t\tif ( isset( $query_args['name'] ) ) {\n\t\t\t$query_args['name'] = explode( ',', str_replace( ' ', '', $query_args['name'] ) );\n\t\t}\n\n\t\tif ( isset( $query_args['slug'] ) ) {\n\t\t\t$query_args['slug'] = explode( ',', str_replace( ' ', '', $query_args['slug'] ) );\n\t\t}\n\n\t\t$terms = get_terms( $query_args );\n\n\t\tWP_CLI::line( sprintf( 'Processing %d terms', count( $terms ) ) );\n\n\t\tforeach ( $terms as $key => $term ) {\n\n\t\t\tif ( 0 === ( $key % 20 ) ) {\n\t\t\t\t$this->stop_the_insanity();\n\t\t\t}\n\n\t\t\t$syncable = EA\\Master::get_syncable( $term );\n\n\t\t\tforeach ( $sites as $site ) {\n\n\t\t\t\tif ( ! get_blog_details( [ 'blog_id' => $site ] ) ) {\n\t\t\t\t\tWP_CLI::warning( sprintf( 'Blog %s does not exist' ) );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $syncable->source_is_detached( $term->term_id, $site ) && ! $assoc_args['force_sync'] ) {\n\t\t\t\t\tWP_CLI::warning( sprintf( 'Syncable %d has been detached on the destination site %d', $term->term_id, $site ) );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$id = $syncable->sync_to( $site, $method );\n\n\t\t\t\tif ( 'sync' === $method ) {\n\t\t\t\t\t$syncable->set_is_syncable( $site, $term->term_id, true );\n\t\t\t\t}\n\n\t\t\t\tWP_CLI::line( sprintf( 'Synced %s (%d) to site %d, Destination id: %d', $term->taxonomy, $term->term_id, $site, $id ) );\n\t\t\t}\n\t\t}\n\t}", "protected function prepareMenuItemsForRootlineMenu() {}", "function wp_get_associated_nav_menu_items($object_id = 0, $object_type = 'post_type', $taxonomy = '')\n {\n }", "function get_selected()\n {\n }", "public function initial_taxonomy() {\n $labels = array(\n 'name' => __( 'Taxonomies', Settings::$text_domain ),\n 'singular_name' => __( 'Taxonomy', Settings::$text_domain ),\n 'menu_name' => __( 'Taxonomies', Settings::$text_domain ),\n 'name_admin_bar' => __( 'Taxonomies', Settings::$text_domain ),\n 'add_new' => __( 'Add New', Settings::$text_domain ),\n 'add_new_item' => __( 'Add New Taxonomy', Settings::$text_domain ),\n 'new_item' => __( 'New Taxonomy', Settings::$text_domain ),\n 'edit_item' => __( 'Edit Taxonomy', Settings::$text_domain ),\n 'view_item' => __( 'View Taxonomy', Settings::$text_domain ),\n 'all_items' => __( 'Taxonomies', Settings::$text_domain ),\n 'search_items' => __( 'Search Taxonomies', Settings::$text_domain ),\n 'parent_item_colon' => __( 'Parent Taxonomies:', Settings::$text_domain ),\n 'not_found' => __( 'No taxonomy found.', Settings::$text_domain ),\n 'not_found_in_trash' => __( 'No taxonomies found in Trash.', Settings::$text_domain )\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_menu' => 'tools.php',\n 'show_in_nav_menus' => false,\n 'query_var' => true,\n 'capability_type' => 'post',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'menu_position' => null,\n 'taxonomies' => array( '' ),\n 'menu_icon' => 'dashicons-category',\n 'supports' => array('title')\n );\n\n register_post_type( Settings::$main_taxonomy_name, $args );\n\n $taxonomy_factory = new Taxonomy_Factory();\n $taxonomy_factory->register_all_taxonomies();\n\n //Configura o número de posts por página\n add_action('pre_get_posts', array($taxonomy_factory, 'set_posts_per_page'));\n }", "function __checked_selected_helper($helper, $current, $display, $type)\n {\n }", "function custom_menu_order($menu_ord) {\r\n if (!$menu_ord) return true;\r\n return array(\r\n 'edit.php?post_type=solutions', // Solutions\r\n 'edit.php?post_type=by-industry', // By Industry\r\n 'edit.php?post_type=by-department', // By Department\r\n 'separator1', // First separator\r\n 'edit.php?post_type=platform-features', // Platform Features\r\n 'edit.php?post_type=data-connectors', // Data Connectors\r\n 'edit.php?post_type=resources', // Resources\r\n 'edit.php?post_type=marketing', // Marketing Pages\r\n 'edit.php?post_type=event-promos', // Event Promotions\r\n 'separator2', // Second separator\r\n 'edit.php?post_type=videos', // Videos\r\n 'edit.php?post_type=print-materials', // Print Materials\r\n 'edit.php?post_type=webinars', // Webinars\r\n 'edit.php?post_type=white-papers', // White Papers\r\n 'edit.php?post_type=careers', // Careers\r\n 'separator-last', // Last separator\r\n 'index.php', // Dashboard\r\n 'edit.php?post_type=page', // Pages\r\n 'edit.php', // Posts\r\n 'upload.php', // Media\r\n 'edit-comments.php', // Comments\r\n 'separator3', // Third separator\r\n 'themes.php', // Appearance\r\n 'plugins.php', // Plugins\r\n 'users.php', // Users\r\n 'tools.php', // Tools\r\n 'options-general.php', // Settings\r\n );\r\n}", "function control_custom_menus() {\n\n\t// Check if the menu exists\n\t$menu_exists = wp_get_nav_menu_object( 'secondary' );\n\n\t// If it doesn't exist, let's create it.\n\tif( !$menu_exists){\n\t\t$menu_id = wp_create_nav_menu( 'secondary' );\n\n\t\t$user = wp_get_current_user();\n\n\t\t// Set up default menu items\n\t\t$menu_author_id = wp_update_nav_menu_item($menu_id, 0, array(\n\t\t\t'menu-item-title' => __( $user->display_name ),\n\t\t\t'menu-item-url' => get_author_posts_url( $user->ID ),\n\t\t\t'menu-item-status' => 'publish'));\n\n\t\t// Set up default menu items\n\t\t$menu_logout_id = wp_update_nav_menu_item($menu_id, 0, array(\n\t\t\t'menu-item-title' => __( 'Logout' ),\n\t\t\t'menu-item-parent-id' => $menu_author_id,\n\t\t\t'menu-item-url' => wp_logout_url(),\n\t\t\t'menu-item-status' => 'publish'));\n\n\t}\n}", "function _wp_batch_split_terms()\n {\n }", "public function get_letter_bar($firstinitial, $lastinitial) {\n\n $baseurl = $this->userdirectory->get_current_url();\n $baseurl->remove_params(['page', 'sifirst']);\n\n $strall = get_string('all');\n $alpha = explode(',', get_string('alphabet', 'langconfig'));\n\n $html = '';\n\n // Bar of first initials.\n $html .= '<div class=\"initialbar firstinitial paging\"><span>' . get_string('firstname') . ':</span>';\n // All button.\n if (!empty($firstinitial)) {\n $html .= '<a class=\"btn\" href=\"' . $baseurl->out() . '&amp;sifirst=\">' . $strall . '</a>';\n } else {\n $html .= '<a class=\"btn selected active\" href=\"' . $baseurl->out() . '&amp;sifirst=\">' . $strall . '</a>';\n }\n // Show each letter.\n foreach ($alpha as $letter) {\n if ($letter == $firstinitial) {\n $html .= '<a class=\"btn selected active\" href=\"'\n . $baseurl->out()\n . '&amp;sifirst=' . $letter . '\">' . $letter . '</a>';\n } else {\n $html .= '<a class=\"btn\" href=\"' . $baseurl->out() . '&amp;sifirst=' . $letter . '\">' . $letter . '</a>';\n }\n }\n $html .= '</div>';\n\n $baseurl = $this->userdirectory->get_current_url();\n $baseurl->remove_params(['page', 'silast']);\n\n // Bar of last initials.\n $html .= '<div class=\"initialbar lastinitial paging\"><span>' . get_string('lastname') . ':</span>';\n // All button.\n if (!empty($lastinitial)) {\n $html .= '<a class=\"btn\" href=\"' . $baseurl->out() . '&amp;silast=\">' . $strall . '</a>';\n } else {\n $html .= '<a class=\"btn selected active\" href=\"' . $baseurl->out() . '&amp;silast=\">' . $strall . '</a>';\n }\n // Show each letter.\n foreach ($alpha as $letter) {\n if ($letter == $lastinitial) {\n $html .= '<a class=\"btn selected active\" href=\"'\n . $baseurl->out()\n . '&amp;silast=' . $letter . '\">' . $letter . '</a>';\n } else {\n $html .= '<a class=\"btn\" href=\"' . $baseurl->out() . '&amp;silast=' . $letter . '\">' . $letter . '</a>';\n }\n }\n $html .= '</div>';\n\n return $html;\n }", "public function getFirstItem();", "public static function get_terms( $args = null, $maybe_args = array(), $TermClass = 'Timber\\Term' ) {\n\t\treturn TermGetter::get_terms($args, $maybe_args, $TermClass);\n\t}", "function add_current_nav_class($classes, $item) {\n\tglobal $post;\n\t// Getting the post type of the current post\n\t$current_post_type = get_post_type_object(get_post_type($post->ID));\n\t$current_post_type_slug = $current_post_type->rewrite['slug'];\n\t// Getting the URL of the menu item\n\t$menu_slug = strtolower(trim($item->url));\n\t// If the menu item URL contains the current post types slug add the current-menu-item class\n\tif (strpos($menu_slug,$current_post_type_slug) !== false) {\n\t\t$classes[] = 'current-menu-item';\n\t}\n\t// Return the corrected set of classes to be added to the menu item\n\treturn $classes;\n}", "function get_terminal_post_in_category($categoryID, $first = true) {\n\tglobal $post;\n\t\n\t$temp = $wp_query; $wp_query = null;\n\t$sortOrder = $first ? \"asc\" : \"desc\";\n\t$terminalComicQuery = new WP_Query(); $terminalComicQuery->query(\"showposts=1&order=${sortOrder}&cat=${categoryID}\");\n\t$terninalPost = false;\n\tif ($terminalComicQuery->have_posts()) {\n\t\t$terminalPost = reset($terminalComicQuery->posts);\n\t}\n\t\n\t$wp_query = null; $wp_query = $temp;\n\treturn $terminalPost;\n}", "public function getFirstItem(...$types);", "function special_nav_class($classes, $item){\n if( in_array('current-menu-item', $classes) ){\n $classes[] = 'active ';\n }\n return $classes;\n}", "public static function select_by_term_taxonomy_id($term_taxonomy_id, $columns = NULL, $as_array = TRUE, $limit = NULL)\n\t{\n\t\t$where_params = array();\n\t\tif ( ! empty($term_taxonomy_id))\n\t\t{\n\t\t\t$where_params['term_taxonomy_id'] = $term_taxonomy_id;\n\t\t}\n\t\t$order_by = array('term_taxonomy_id' => NULL, 'object_id' => NULL);\n\t\t$query_params = array('columns' => $columns, 'limit' => $limit, 'order_by' => $order_by, '$query_params' => $where_params);\n\t\tif ($as_array)\n\t\t{\n\t\t\treturn MMI_DB::select(self::$_table_name, $as_array, $query_params);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn MMI_Jelly::select(self::$_table_name, $as_array, $query_params);\n\t\t}\n\t}", "private function _set_menus_language() {\n\t\tglobal $wpdb, $sitepress;\n\n\t\t$default_language = $sitepress->get_default_language();\n\t\t$untranslated_menus = $wpdb->get_col(\n\t\t\t\"\n\t\t\t\t\t\t\t\t\t SELECT term_taxonomy_id\n\t\t\t\t\t\t\t\t\t FROM {$wpdb->term_taxonomy} tt\n\t\t\t\t\t\t\t\t\t LEFT JOIN {$wpdb->prefix}icl_translations i\n\t\t\t\t\t\t\t\t\t ON CONCAT('tax_', tt.taxonomy ) = i.element_type\n\t\t\t\t\t\t\t\t\t AND i.element_id = tt.term_taxonomy_id\n\t\t\t\t\t\t\t\t\t WHERE tt.taxonomy='nav_menu'\n\t\t\t\t\t\t\t\t\t AND i.language_code IS NULL\"\n\t\t);\n\t\tforeach ( (array) $untranslated_menus as $item ) {\n\t\t\t$sitepress->set_element_language_details( $item, 'tax_nav_menu', null, $default_language );\n\t\t}\n\t\t$untranslated_menu_items = $wpdb->get_col(\n\t\t\t\"\n\t\t\t\t\t\t\t\t\t\t SELECT p.ID\n\t\t\t\t\t\t\t\t\t\t FROM {$wpdb->posts} p\n\t\t\t\t\t\t\t\t\t\t LEFT JOIN {$wpdb->prefix}icl_translations i\n\t\t\t\t\t\t\t\t\t\t ON CONCAT('post_', p.post_type ) = i.element_type\n\t\t\t\t\t\t\t\t\t\t AND i.element_id = p.ID\n\t\t\t\t\t\t\t\t\t\t WHERE p.post_type = 'nav_menu_item'\n\t\t\t\t\t\t\t\t\t\t AND i.language_code IS NULL\"\n\t\t);\n\t\tif ( ! empty( $untranslated_menu_items ) ) {\n\t\t\tforeach ( $untranslated_menu_items as $item ) {\n\t\t\t\t$sitepress->set_element_language_details( $item, 'post_nav_menu_item', null, $default_language );\n\t\t\t}\n\t\t}\n\t}", "function custom_menu_item_id_class( $menu_items, $args ) {\n\t$counter = array();\n\n\tforeach ( $menu_items as $k => $item ) {\n\t\tif ( !isset( $counter[$item->menu_item_parent] ) ) {\n\t\t\t$counter[$item->menu_item_parent] = 0;\n\t\t}\n\t\t$counter[$item->menu_item_parent] += 1;\n\n\t\t$item->menu_index = $counter[$item->menu_item_parent];\n\t\t$item->classes[] = 'nth-' . $item->menu_index;\n\t}\n\n\tforeach ( $menu_items as $k => $item ) {\n\t\tif ( $item->menu_index == 1 ) {\n\t\t\t$item->classes[] = 'menu-first';\n\t\t}\n\t\tif ( $item->menu_index == $counter[$item->menu_item_parent] ) {\n\t\t\t$item->classes[] = 'menu-last';\n\t\t}\n\t}\n\n\treturn $menu_items;\n}", "function my_walker_nav_menu_start_el($item_output, $item, $depth, $args) {\n $classes = implode(' ', $item->classes);\n $item_output = preg_replace('/<a /', '<a class=\"'.$classes.'\"', $item_output, 1);\n return $item_output;\n }" ]
[ "0.5009467", "0.49942586", "0.49548197", "0.48352084", "0.47935122", "0.47753453", "0.4756996", "0.47081494", "0.46254545", "0.45124623", "0.44266924", "0.44184387", "0.44133508", "0.44052848", "0.43945277", "0.43736756", "0.43681532", "0.43664208", "0.43637145", "0.4354195", "0.4314362", "0.42897153", "0.42693537", "0.42572656", "0.42569456", "0.4251379", "0.42444244", "0.42388263", "0.42225128", "0.4201419", "0.420013", "0.41988274", "0.41800216", "0.41769746", "0.4170664", "0.41603953", "0.41561326", "0.41237357", "0.4123676", "0.41168842", "0.4114511", "0.40978146", "0.4091991", "0.40896076", "0.40843725", "0.4081365", "0.4080928", "0.4079694", "0.4071009", "0.4054428", "0.4052877", "0.4050477", "0.404739", "0.40390387", "0.4025931", "0.40231204", "0.40226328", "0.40083215", "0.39997628", "0.39925674", "0.39920416", "0.3989316", "0.3989316", "0.39848843", "0.39808577", "0.39774266", "0.39648342", "0.39643833", "0.3959937", "0.39586732", "0.3957849", "0.3953234", "0.39503774", "0.3947901", "0.39404458", "0.3930134", "0.39291304", "0.392759", "0.39272586", "0.3922136", "0.39210564", "0.39198738", "0.3919736", "0.39139602", "0.39131126", "0.39126748", "0.3900837", "0.3895102", "0.3891633", "0.3878705", "0.38763908", "0.387573", "0.38741603", "0.38729593", "0.38712254", "0.38648748", "0.38591707", "0.38545159", "0.38528147", "0.3851369" ]
0.50394577
0
Selects deepest menu item.
function _taxonomy_menu_trails_fetch_link_deepest($vars) { extract($vars); $candidates = array(); foreach ($results as $candidate) { //Prefer the lightest of items with the same menu and path if (!isset($candidates[$candidate['menu_name']][$candidate['link_path']])) { $candidate['weight'] = $candidate['link_weight']; $candidates[$candidate['menu_name']][$candidate['link_path']] = $candidate; // Add any menus not already in the menu name search list. if (!in_array($candidate['menu_name'], $menu_names)) { $menu_names[] = $candidate['menu_name']; } } } // processing array according on saved settings switch($settings['multiple_menu']) { case 'first': array_pop($candidates); break; case 'last': array_shift($candidates); break; } if (!empty($candidates)) { foreach ($menu_names as $menu_name) { if (!empty($candidates[$menu_name])) { foreach ($candidates[$menu_name] as $candidate_item) { $map = explode('/', $candidate_item['link_path']); _menu_translate($candidate_item, $map); if ($candidate_item['access']) { $selected_items[] = $candidate_item; } } } } } return $selected_items; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getParentMenuItem() {}", "abstract protected function getMenuTree();", "private function recurse_tree_select($items, & $array = array(), $indent = 4, & $depth = 0, $key = 'name')\n\t{\n\t\tforeach($items as $item)\n\t\t{\n\t\t\t$array[$item->id] = str_repeat('&nbsp;', ($depth * $indent)).$item->$key;\n\n\t\t\t$children = $item->children->find_all();\n\t\t\t\n\t\t\tif (count($children))\n\t\t\t{\n\t\t\t\t$child_depth = $depth + 1;\n\t\t\t\t\n\t\t\t\t$this->recurse_tree_select($children, $array, $indent, $child_depth, $key);\n\t\t\t}\n\t\t}\t\t\n\t}", "function menu_select($start_id,$direction,$number_levels,$only_active,$menu_only,$exclude_subseiten)\n{\n//$start_id ist die ID, von der weg geprüft werden soll.\n//$direction ist entweder \"up\" oder \"down\".\n//$numer_levels ist ein numerischer Wert, der nur bei \"down\" relevanz hat. Er gibt an, wie viele Ebenen durchsucht werden sollen.\n//$only active ist enteder \"1\" oder was anderes. Nur wenn es \"1\" ist, werden nur die aktiven Einträge druchsucht. \n//$menu_only ist entweder \"1\" oder \"2\" oder was anderes. Nur wenn es \"1\" ist, werden nur die Menüeinträge gezeigt. Wenn es \"2\" ist, werden nur jene Einträge wieder gegeben, die selbst kein Meunü sind.\n//Aufrufen durch: print_r(menu_select('46','down','1','',''));\n\tunset($GLOBALS['menu_select_siblings']);\n\tunset($GLOBALS['menu_select_parent']);\n\tif($only_active==\"1\"){$search_append_string=\"and (active_startdate<=now() or active_startdate='0000-00-00') and (active_enddate>=now() or active_enddate='0000-00-00') and active='A'\";}\n\tif($menu_only==\"1\"){$search_append_string=$search_append_string.\" and display='1'\";}\n\tif($exclude_subseiten==\"1\"){$search_append_string=$search_append_string.\" and search_type not like '%Subseiten%'\";}\n\n\t$i=-1;\n\tif(function_exists('menu_select_siblings')){unset ($menu_select_siblings);} else\n\t{\n\t\tfunction menu_select_siblings($parent_id,$number_levels,$i,$search_append_string,$menu_only)\n\t\t{\n\t\t\t$i=$i+1;\n\t\t\tif($i<$number_levels or $number_levels==0 or $number_levels==\"\")\n\t\t\t{\n\t\t\t\tglobal $menu_select_siblings;\n\t\t\t\t$sibling_query=mysql_query(\"select id, description, display from menu where parent_id=$parent_id $search_append_string order by sort\") or die (\"sibling_query: \".mysql_error());\n\t\t\t\techo $parent_id;\n\t\t\t\tif($parent_id==3) {echo \"hh\";echo \"select id, description, display from menu where parent_id=$parent_id $search_append_string order by sort\";}\n\t\t\t\t\n\t\t\t\twhile($sibling_query_result=mysql_fetch_assoc($sibling_query))\n\t\t\t\t{\n\t\t\t\t\tif(($menu_only==2 and $sibling_query_result['display']==0) or $menu_only!=2){//if the selector menu only is set to 2, only those items are recorded that are actually NOT menus.\n\t\t\t\t\t\t$menu_select_siblings['id'][] = $sibling_query_result['id'];\n\t\t\t\t\t\t$menu_select_siblings['description'][] = $sibling_query_result['description'];\n\t\t\t\t\t\t$menu_select_siblings['googleurl'][] = find_googleurl($sibling_query_result['id']);\t\t\t\n\t\t\t\t\t\t$menu_select_siblings['level_down'][] = $i;\t\n\t\t\t\t\t}\n\t\t\t\t\tmenu_select_siblings($sibling_query_result['id'],$number_levels,$i,$search_append_string,$menu_only);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn($menu_select_siblings);\n\t\t}\n\t}\n\t\n\tif(function_exists('menu_select_parents')){} else\n\t{\n\t\tfunction menu_select_parents($sibling_id, $only_active_string)\n\t\t{\tif($sibling_id==\"\" or $sibling_id==\"0\" or !$sibling_id){} else\n\t\t\t{\n\t\t\t\tglobal $menu_select_parent;\n\t\t\t\t$parent_query=mysql_query(\"select id, parent_id, description from menu where id=$sibling_id $search_append_string order by sort\") or die (\"parent_query: \".mysql_error());\n\t\t\t\twhile($parent_query_result=mysql_fetch_assoc($parent_query))\n\t\t\t\t{\n\t\t\t\t\tif($parent_query_result[id]==0){break;}\n\t\t\t\t\t$menu_select_parent['id'][] = $parent_query_result['id'];\n\t\t\t\t\t$menu_select_parent['description'][] = $parent_query_result['description'];\n\t\t\t\t\t$menu_select_parent['googleurl'][] = find_googleurl($parent_query_result['id']);\t\t\t\n\t\t\t\t\tmenu_select_parents($parent_query_result[parent_id],$search_append_string);\n\t\t\t\t}\n\t\t\t\treturn($menu_select_parent);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif($direction==\"up\"){return(menu_select_parents($start_id,$search_append_string));}\n\telseif($direction==\"down\"){return(menu_select_siblings($start_id,$number_levels,$i,$search_append_string,$menu_only));}\n}", "function parent_dropdown($default_page = 0, $parent_page = 0, $level = 0, $post = \\null)\n {\n }", "public abstract function getNextMenu();", "#[Pure] public function choose (int $index) : MenuItem {\r\n return $this->items()[$index];\r\n }", "public function tree_select($indent = 4, $start_id = 0, $items = array(), $depth = 0, $key = 'name')\n\t{\n\t\t$start = $this\n\t\t\t->where('parent_id', '=', $start_id)\n\t\t\t->find_all();\n\n\t\t$this->recurse_tree_select($start, $items, $indent, $depth, $key);\n\n\t\treturn $items;\n\t}", "function viewTreeMenuPointSelected( $depth, $siblingAmount, $app, $userId)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$str=\"\";\n\n\t\t\t\t\t\t\t\t\t\t\t$str=$str.\"<div class='textobjectThreadPlainTreeContainerMenuPointActive' \".$this->getOnClickURLWebservice( $this->textobjectObject ).\">\";\n\t\t\t\t\t\t\t\t\t\t\t$str=$str.$this->textobjectObject->getArgumentCutted().\"\";\n\t\t\t\t\t\t\t\t\t\t\t$str=$str.\"</div>\";\n\n\t\t\t\t\t\t\t\t\t\treturn $str;\n\t\t\t\t\t\t\t\t\t}", "private function set_firstItemTreeView()\n {\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n // RETURN current filter isn't a tree view\n // #i0117, 141223, dwildt, 1-/+\n //if ( !in_array( $table, $this->arr_tablesWiTreeparentfield ) )\n if ( !in_array( $this->curr_tableField, $this->arr_tablesWiTreeparentfield ) )\n {\n return;\n }\n // RETURN current filter isn't a tree view\n // Prepend the first item to class var $rows\n $this->set_firstItem();\n\n return;\n }", "function viewTreeMenuPointSelected( $depth, $siblingAmount, $app, $userId)\n\t\t\t\t\t{\n\t\t\t\t\t\t$str=\"\";\n\n\t\t\t\t\t\t\t$str=$str.\"<div class='textobjectThreadPlainTreeContainerMenuPointActive' \".$this->getOnClickURLWebservice( $this->textobjectObject ).\">\";\n\t\t\t\t\t\t\t$str=$str.$this->textobjectObject->getArgumentCutted().\" []\";\n\t\t\t\t\t\t\t$str=$str.\"</div>\";\n\n\t\t\t\t\t\treturn $str;\n\t\t\t\t\t}", "function _recursiveMoveMenuItem($result)\n\t{\n\t\t$i = 0;\n\t\twhile(count($result->child))\n\t\t{\n\t\t\tunset($node);\n\t\t\t$node = array_shift($result->child);\n\n\t\t\t$this->moveMenuItem($this->menuSrl, $node->parent_node, $i, $node->node, 'move');\n\t\t\t$this->_recursiveMoveMenuItem($node);\n\t\t\t$i = $node->node;\n\t\t}\n\t}", "public function getLowestTopChild()\n {\n $current = $this->getCurrent();\n while (!\\is_null($current)) {\n if ($current instanceof TopMenuItem) {\n return $current;\n }\n $current = $current->getParent();\n }\n\n return null;\n }", "public function MenuCurrentItem() {\n return $this->MainMenu()->find('Code', 'KapostAdmin');\n }", "function walk_page_dropdown_tree(...$args)\n {\n }", "function display_children($parent, $level) {\n $result = mysql_query('SELECT * FROM treeview_items WHERE parent_id=\"'.$parent.'\";'); \n while ($row = mysql_fetch_array($result)) { \n echo \"<option value='\".$row['id'].\"'>\".str_repeat('--',$level).$row['name'].\"</option>\" .\"<br>\"; \n display_children($row['id'], $level+1); \n\n } \n\n }", "function selectLevelTrigger()\n\t{\n\t\tglobal $ilCtrl, $ilTabs, $lng, $tree, $tpl;\n\n\t\t$this->setLevelHead();\n\t\t$ilTabs->activateTab(\"level_trigger\");\n\n\t\tinclude_once 'Services/Search/classes/class.ilSearchRootSelector.php';\n\t\t$exp = new ilSearchRootSelector(\n\t\t\t$ilCtrl->getLinkTarget($this,'showRepositorySelection'));\n\t\t$exp->setExpand($_GET[\"search_root_expand\"] ? $_GET[\"search_root_expand\"] : $tree->readRootId());\n\t\t$exp->setExpandTarget($ilCtrl->getLinkTarget($this,'selectLevelTrigger'));\n\t\t$exp->setTargetClass(get_class($this));\n\t\t$exp->setCmd('saveLevelTrigger');\n\t\t$exp->setClickableTypes(array(\"crs\"));\n\n\t\t// build html-output\n\t\t$exp->setOutput(0);\n\t\t$tpl->setContent($exp->getOutput());\n\n\t}", "function printrightMenu($tree,$level=0) {\n\tif(!is_null($tree) && count($tree) > 0) {\n\tif($level==0){\n\techo '<ul class=\"dropdown-menu rightClickMenu\">';\n\t}\n\t\tforeach($tree as $node) {\n\t\techo \"\\n\";\n\t\t\t// Top level\n\t\t\tif ( empty($node['children']) ) {\n\t\t\t\tif ( !empty($node['value']['menu_type']) AND ($node['value']['menu_type']== \"inlineForm\") ) {\n\t\t\t\t\techo '<li><a class=\"trigger right-caret '.$node['value']['action_type'].' '.$node['value']['icon'].' '.$node['value']['menu_type'].' '.$node['value']['action_type'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>\n\t\t\t\t<ul class=\"dropdown-menu sub-menu\"><li>'. $node['value']['custom'] . '</li></ul></li>';\n\t\t\t\t}else{\n\t\t\t\techo '<li><a class=\"iconItemSelection '.$node['value']['action_type'].' '.$node['value']['icon'].' MenuActionItem '.$node['value']['menu_type'].' '.$node['value']['code'].' '.$node['value']['action_type'].'\" type=\"button\" data-animationui=\"'.$node['value']['code'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-code=\"'.$node['value']['code'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>'. (!empty($node[\"value\"][\"code\"]) ? '<span data-animationui=\"'.$node['value']['code'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" style=\"position:absolute; right:15px; top:9px; text-size=16px;\" class=\"addKeyframeMenu fa fa-plus-square-o fa-lg pull-right\"></span>' : ''). '</li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( !empty($node['children']) AND !empty($node['children']['0']['children'] )) {\n\t\t\t\techo '<li class=\"dropdown-submenu\">\n\t\t\t\t<a class=\"trigger right-caret '.$node['value']['icon'].' '.$node['value']['action_type'].' '.$node['value']['menu_type'].' '.$node['value']['code'].' '.$node['value']['action_type'].'\" data-animationui=\"'.$node['value']['code'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-code=\"'.$node['value']['code'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>\n\t\t\t\t<ul class=\"dropdown-menu sub-menu\">';\n\t\t\t}\n\t\t\tif ( !empty($node['children']) AND empty($node['children']['0']['children']) ) {\n\t\t\t\techo '<li class=\"dropdown-submenu\">\n\t\t\t\t<a class=\"trigger right-caret '.$node['value']['action_type'].' '.$node['value']['icon'].' '.$node['value']['menu_type'].' '.$node['value']['code'].' '.$node['value']['action_type'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-code=\"'.$node['value']['code'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>\n\t\t\t\t<ul class=\"dropdown-menu sub-menu\" style=\"max-height:400px;overflow:auto;\">';\n\t\t\t}\n\t\t\tprintrightMenu($node['children'], $level+1);\n\t\t\tif (!empty($node['children']) ) {echo '</li></ul>';}\n\t\t} // end foreach\n\t} // end if\n\tif($level==0){\n\techo '<div class=\"currentAnimations\"></div>';\n\t}\n}", "function ItemSelect($class, $name, $selected=\"\")\r\n\t{\r\n\t\tif(isset($this->MyClasses[$class]['db']['title']))\r\n\t\t{\r\n\t\t\t$Order = array(\"title\"=>\"ASC\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$Order = array();\r\n\t\t}\r\n\t\t$Items = $this->GetRecords($class, array(), $Order, \"\");\r\n\t\t// make options from data\r\n\t\t$Options['0'] = \"...\";\r\n\t\t// check if we have parent_id, make list with children\r\n\t\tif(isset($this->MyClasses[$class]['db']['parent']))\r\n\t\t{\r\n\t\t\t$finarr = array();\r\n\t\t\t$finarr = $this->GetListRecursive($class, \"0\", $finarr, \"\");\r\n\t\t\tforeach($finarr as $burat)\r\n\t\t\t{\r\n\t\t\t\t$BoriArr = explode(\"|:|\", $burat);\r\n\t\t\t\t$Options[$BoriArr[0]] = $BoriArr[1];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach($Items as $item)\r\n\t\t\t{\r\n\t\t\t\t$Options[$item['id']] = $item['title'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->makeDropDown($Options, $name, $selected);\r\n\t}", "function appendChildren () {\n $this->menu[]=new Marker('start');\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $this->current->id() ) {\n $this->menu[]=$item;\n }\n }\n $check=end($this->menu);\n if ( $check->isStart() )\n array_pop($this->menu);\n else\n $this->menu[]=new Marker('end');\n }", "function _printMultiRecurse($objItem, $id='') {\n\t\t$go_on = true;\n\t\t$curLevel = $objItem->getOutlineLevel();\n\t\t$mid = ($id)?' id=\"'.$id.'\"':'';\n\t\techo \"<ul$mid>\";\n\t\tdo {\n\t\t\techo '<li';\n\t\t\tif ($objItem->id == $GLOBALS['objPage']->id ||\n\t\t\t\t$this->_parentCurrent && $objItem->isOutlineParentOf($GLOBALS['objPage']->getOutline()))\n\t\t\t{\n\t\t\t\techo ' class=\"current\"';\n\t\t\t}\n\t\t\techo '><a href=\"'.$objItem->getUrl().'\">'.$objItem->get('title')\n\t\t\t\t.'<span>'.$objItem->get('menu').'</span></a>';\n\t\t\t$objItem = $this->_pageList->rNext();\n\t\t\tif ($objItem) {\n\t\t\t\t$nextLevel = $objItem->getOutlineLevel();\n\t\t\t\tif ($nextLevel > $curLevel) {\n\t\t\t\t\tif ($objItem = $this->_printMultiRecurse($objItem)) {\n\t\t\t\t\t\t$nextLevel = $objItem->getOutlineLevel();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$nextLevel = 0;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tif ($nextLevel < $curLevel) {\n\t\t\t\t\t$go_on = false;\n\t\t\t\t} else {\n\t\t\t\t\t$curLevel = $nextLevel;\n\t\t\t\t}\n\t\t\t}\n\t\t\techo '</li>';\n\t\t} while ($objItem && $go_on);\n\t\techo '</ul>';\n\t\treturn $objItem;\n\t}", "public function FirstChildOf($item)\n {\n $sql = Access::SqlBuilder();\n if ($item)\n {\n $tblNavItem = NavigationItem::Schema()->Table();\n $where = $sql->IsNull($tblNavItem->Field('Previous'))\n ->And_($sql->Equals($tblNavItem->Field('Parent'), $sql->Value($item->GetID())));\n \n return NavigationItem::Schema()->First($where);\n }\n else\n {\n return $this->TopMost();\n }\n }", "function start_el( &$output, $item, $depth = 0, $args = Array(), $id = 0 ) {\n global $wp_query, $wpdb;\n $indent = ( $depth > 0 ? str_repeat( \"\\t\", $depth ) : '' ); // code indent\n\n // depth dependent classes\n $depth_classes = array(\n ( $depth == 0 ? '' : '' ), //class for the top level menu which got sub-menu\n ( $depth >=1 ? '' : 'dropdown' ), //class for the level-1 sub-menu which got level-2 sub-menu\n ( $depth >=2 ? 'sub-sub-menu-item' : '' ), //class for the level-2 sub-menu which got level-3 sub-menu\n ( $depth % 2 ? 'menu-item-odd' : 'menu-item-even' ),\n 'menu-item-depth-' . $depth\n );\n $depth_class_names = esc_attr( implode( ' ', $depth_classes ) );\n\n // passed classes\n $classes = empty( $item->classes ) ? array() : (array) $item->classes;\n $class_names = esc_attr( implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ) );\n\n // build html\n $output .= $indent . '<li id=\"nav-menu-item-'. $item->ID . '\" class=\"' . $depth_class_names . ' ' . $class_names . '\">';\n\n // link attributes\n $attributes = ! empty( $item->attr_title ) ? ' title=\"' . esc_attr( $item->attr_title ) .'\"' : '';\n $attributes .= ! empty( $item->target ) ? ' target=\"' . esc_attr( $item->target ) .'\"' : '';\n $attributes .= ! empty( $item->xfn ) ? ' rel=\"' . esc_attr( $item->xfn ) .'\"' : '';\n $attributes .= ! empty( $item->url ) ? ' href=\"' . esc_attr( $item->url ) .'\"' : '';\n //$attributes .= ' class=\"' . ( $depth > 0 ? '' : '' ) . '\"';\n\n // Check if menu item is in main menu\n $has_children = $wpdb->get_var(\"SELECT COUNT(meta_id)\n FROM wp_postmeta\n WHERE meta_key='_menu_item_menu_item_parent'\n AND meta_value='\".$item->ID.\"'\");\n\n if ( $depth == 0 && $has_children > 0 ) {\n // These lines adds your custom class and attribute\n $attributes .= ' class=\"dropdown-toggle\"';\n $attributes .= ' data-toggle=\"dropdown\"';\n $attributes .= ' data-hover=\"dropdown\"';\n $attributes .= ' data-animations=\"fadeInUp\"';\n }\n $description = ! empty( $item->description ) ? '<i class=\"fa '.esc_attr( $item->description ).'\" aria-hidden=\"true\"></i>' : '';\n\n $item_output = $args->before;\n $item_output .= '<a'. $attributes .'>';\n $item_output .= $description.$args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; //If you want the description to be output after <a>\n //$item_output .= $description.$args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; //If you want the description to be output before </a>\n\n // Add the caret if menu level is 0\n if ( $depth == 0 && $has_children > 0 ) {\n $item_output .= ' &nbsp;<i class=\"fa fa-caret-down\"></i>';\n }\n\n $item_output .= '</a>';\n $item_output .= $args->after;\n\n // build html\n $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args, $id );\n}", "protected function getLevelSelector() {}", "function walk_nav_menu_tree($items, $depth, $args)\n {\n }", "public function build_category_tree($output, $preselected, $parent=0, $indent=''){\t\n $this->db->select('category_id,category_name,parentid');\n $this->db->where('parentid',$parent); \n $sql = $this->db->get('category'); \n \n foreach ($sql->result_array() as $c)\n {\n $selected = ($c[\"category_id\"] == $preselected) ? \"selected=\\\"selected\\\"\" : \"\";\n $output .= \"<option value=\\\"\" . $c[\"category_id\"] . \"\\\" \" . $selected . \">\" . $indent . $c[\"category_name\"] . \"</option>\";\n if($c[\"category_id\"] != $parent){\n $this->crud_model->build_category_tree($output, $preselected, $c[\"category_id\"], $indent . \"&nbsp;&nbsp;\");\n } \n }\n return $sql->result_array();\n}", "function categoryTree($id_parent= 0,$sub_mark =''){\n global $db;\n $query = $db->query(\"SELECT * FROM category WHERE id_parent = $id_parent ORDER BY name DESC \" );\n \n if ($query->num_rows > 0){\n while ($row = $query-> fetch_assoc()){\n \n echo '<option value=\"'.$row['id_c'].'\">'.$sub_mark.$row['name'].'</option>';\n \n categoryTree($row['id_c'],$sub_mark.'---');\n }\n \n }\n }", "protected function getTopmenuActiveItem() {\n return 0;\n }", "function mdx_tertiary_menu($args) {\n\tinclude_once 'functions/class-walker-tertiary-menu.php';\n\t$uri_parts = explode('/', $_SERVER['REQUEST_URI']);\n\t$args['ancestor'] = get_page_by_path($uri_parts[1]);\n\t$args['echo'] = false;\n\t$args['walker'] = new Walker_Tertiary_Menu();\n\treturn wp_nav_menu($args);\n}", "function getItem($i, $parent=null) {\n\t\tif ($parent === null) {\n\t\t\tif (isset($this->items[$i])){\n\t\t\t\treturn $this->items[$i];\t\t\n\t\t\t}else{\n\t\t\t\tthrow new Exception(\"Item '$i' Not found\");\n\t\t\t}\n\t\t}else{\n\t\t\t//var_dump($parent);\n\t\t\t//var_dump($this->items);\n\t\t\tif (isset($this->items[$parent]) && isset($this->items[$parent]->children) ){\n\t\t\t\t\n\t\t\t\tforeach ( $this->items[$parent]->children as $child ) {\n\t\t\t\t\tif ($child->getPage()->alias == $i) {\n\t\t\t\t\t\treturn $child ;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t}", "function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {\n\t\tglobal $wp_query;\n\t\t$indent = ( $depth > 0 ? str_repeat( \"\\t\", $depth ) : '' ); // code indent\n\n\t\t// Set the current item.\n\t\t$this->currentItemID = $item->ID;\n\n\t\t// Passed classes.\n\t\t$classes = empty( $item->classes ) ? array() : (array) $item->classes;\n\n\t\t// Remove \"has-children\" class from second level items.\n\t\t$key = array_search( 'menu-item-has-children', $classes, true );\n\n\t\tif ( $depth > 0 && $key !== false ) {\n\t\t\tunset( $classes[$key] );\n\t\t}\n\n\t\t// Apply filters and prepare classes for use.\n\t\t$class_names = esc_attr( implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ) );\n\n\t\t// Build HTML.\n\t\t$active_classes = [ 'current-menu-item', 'current-menu-ancestor' ];\n\t\t$output .= \n\t\t\t$indent\n\t\t\t. '<li id=\"nav-menu-item-'. $item->ID . '\"'\n\t\t\t. ' class=\"' . $class_names . '\"'\n\t\t\t. ( in_array( 'menu-item-has-children', $classes, true ) ?\n\t\t\t\t' data-dropdown=\"nav-sub-menu-' . $item->ID . '\"'\n\t\t\t\t. ' data-dropdown-content=\".nav-sub-menu-'. $item->ID . '\"'\n\t\t\t\t. ' data-dropdown-toggle=\".nav-sub-menu-button-'. $item->ID . '\"'\n\t\t\t\t. ' data-visible=\"' . ( count( array_intersect( $active_classes, $classes ) ) > 0 ? 'yes' : 'no' ) . '\"'\n\t\t\t\t. ' data-toggleable=\"no\"'\n\t\t\t: '' )\n\t\t\t. '>';\n\n\t\t// Apply nav menu item filter.\n\t\t$args = apply_filters( 'nav_menu_item_args', $args, $item, $depth );\n\n\t\t// Link attributes.\n\t\t$attributes = ! empty( $item->url ) ? ' href=\"' . esc_url( $item->url ) . '\"' : '';\n\n\t\t// Build HTML output and pass through the proper filter.\n\t\t$item_output = sprintf( '%1$s<a%2$s>%3$s%4$s%5$s</a>%6$s',\n\t\t\t$args->before,\n\t\t\t$attributes,\n\t\t\t$args->link_before,\n\t\t\tapply_filters( 'the_title', $item->title, $item->ID ),\n\t\t\t$args->link_after,\n\t\t\t$args->after\n\t\t);\n\n\t\t$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );\n\n\t\tif ( in_array( 'menu-item-has-children', $classes, true ) ) {\n\t\t\t$label = __( 'Expand submenu for ', 'shiro' ) . apply_filters( 'the_title', $item->title, $item->ID );\n\t\t\t$output .= \n\t\t\t'<button class=\"menu-item__expand nav-sub-menu-button-'. $item->ID . '\"'\n\t\t\t. ' hidden'\n\t\t\t. ' aria-label=\"' . esc_attr( $label ) . '\"'\n\t\t\t. ' aria-expanded=\"' . ( count( array_intersect( $active_classes, $classes ) ) > 0 ? 'true' : 'false' ) . '\"'\n\t\t\t. ' data-dropdown-toggle=\"nav-sub-menu-'. $item->ID . '\">'\n\t\t\t. '<span class=\"btn-label-a11y\">'\n\t\t\t. esc_html( $label )\n\t\t\t. '</span></button>';\n\t\t}\n\t}", "function bethel_restrict_depth_of_primary_menu ($args) {\n\t$a=1;\n\tif ($args['theme_location'] == 'primary') {\n\t\t$args['depth'] = 3;\n\t}\n\treturn $args;\n}", "public function getParentMenu(){\n return $this->parentMenu;\n }", "function pdl_selector($uid,$current=\"\") {\n\n\t$o = '';\n\n\t// You can use anybody's Comanche layouts on this site that haven't been protected in some way\n\n\t$sql_extra = item_permissions_sql($uid);\n\n\t// By default order by title (therefore at this time pdl's need a unique title across this system), \n\t// though future work may allow categorisation\n\t// based on taxonomy terms\n\n\t$r = q(\"select title, mid from item where (item_restrict & %d) $sql_extra order by title\",\n\t\tintval(ITEM_PDL)\n\t);\n\n\t$arr = array('channel_id' => $uid, 'current' => $current, 'entries' => $r);\n\tcall_hooks('pdl_selector',$arr);\n\n\t$entries = $arr['entries'];\n\t$current = $arr['current'];\t\t\n \n\t$o .= \"<select name=\\\"pdl_select\\\" id=\\\"pdl_select\\\" size=\\\"1\\\" >\";\n\t$entries[] = array('title' => t('Default'), 'mid' => '');\n\tforeach($entries as $selection) {\n\t\t$selected = (($selection == $current) ? ' selected=\"selected\" ' : '');\n\t\t$o .= \"<option value=\\\"{$selection['mid']}\\\" $selected >{$selection['title']}</option>\";\n\t}\n\n\t$o .= '</select>';\n\treturn $o;\n}", "function uwwtd_menu_link__main_menu(&$variables) {\n $element = $variables['element'];\n\n $sub_menu = ($element['#below'] ? drupal_render($element['#below']) : '');\n $depth = $element['#original_link']['depth'] + 1;\n\n $unused = array('leaf', 'first', 'menu-mlid-' . $element['#original_link']['mlid']);\n $element['#attributes']['class'] = array_diff($element['#attributes']['class'], $unused);\n\n $element['#attributes']['class'][] = 'menu-item';\n $element['#attributes']['class'][] = 'menu-item--depth-' . $element['#original_link']['depth'];\n\n $element['#localized_options']['html'] = TRUE;\n $element['#localized_options']['attributes']['class'][] = 'menu-link';\n $element['#localized_options']['attributes']['class'][] = 'menu-link--depth-' . $element['#original_link']['depth'];\n\n if (!empty($sub_menu)) {\n // Wrap menu-level for each level.\n $sub_menu = '<div class=\"menu-level menu-level--' . $depth . '\">' . $sub_menu . '</div>';\n }\n // krumo($element);\n if ($depth == 2 && $element['#below']) {\n $link = l('<span class=\"title\">' . $element['#title'] . ' <i style=\"float:right;line-height:20px;\" class=\"fa fa-caret-down\"></i></span>', $element['#href'], $element['#localized_options']);\n } elseif ($depth == 3 && $element['#below']) {\n $link = l('<span class=\"title\">' . $element['#title'] . ' <i style=\"float:right;line-height:20px;\" class=\"fa fa-caret-right\"></i></span>', $element['#href'], $element['#localized_options']);\n } else {\n $link = l('<span class=\"title\">' . $element['#title'] . '</span>', $element['#href'], $element['#localized_options']);\n }\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $link . $sub_menu . '</li>';\n\n}", "function select_idxmenu(){\n $query = $this->db->query(\"\n select title, file_path\n from sys_menu \n where is_parent = 0 order by id\n \");\n return $query;\n }", "function build () {\n foreach ( $this->items as $item ) {\n if ( $item->id() == $this->current->id() ) {\n $this->menu[]=$item;\n $this->appendChildren();\n } else if ( $item->parent_id() == $this->current->parent_id() ) {\n $this->menu[]=$item;\n }\n }\n reset ( $this->menu );\n }", "function galleryParentSelectList( &$row ) {\r\n $database =& JFactory::getDBO();\r\n\r\n $id = '';\r\n if ( $row->id ) {\r\n $id = \" AND id != $row->id\";\r\n }\r\n\r\n // get a list of the menu items\r\n // excluding the current menu item and its child elements\r\n $query = \"SELECT *\"\r\n . \" FROM #__rsgallery2_galleries\"\r\n . \" WHERE published != -2\"\r\n . $id\r\n . \" ORDER BY parent, ordering\"\r\n ;\r\n $database->setQuery( $query );\r\n \r\n $mitems = $database->loadObjectList();\r\n\r\n // establish the hierarchy of the menu\r\n $children = array();\r\n\r\n if ( $mitems ) {\r\n // first pass - collect children\r\n foreach ( $mitems as $v ) {\r\n $pt = $v->parent;\r\n $list = @$children[$pt] ? $children[$pt] : array();\r\n array_push( $list, $v );\r\n $children[$pt] = $list;\r\n }\r\n }\r\n\r\n // second pass - get an indent list of the items\r\n $list = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0 );\r\n\r\n // assemble menu items to the array\r\n $mitems = array();\r\n $mitems[] = JHTMLSelect::option( '0', JText::_('Top Gallery') );\r\n\r\n foreach ( $list as $item ) {\r\n $mitems[] = JHTMLSelect::option( $item->id, '&nbsp;&nbsp;&nbsp;'. $item->treename );\r\n }\r\n\r\n $output = JHTML::_(\"select.genericlist\", $mitems, 'parent', 'class=\"inputbox\" size=\"10\"', 'value', 'text', $row->parent );\r\n\r\n return $output;\r\n}", "function walk_category_dropdown_tree(...$args)\n {\n }", "static function parentSelector($e, $parent_id, $selfId)\n\t{\n\t\t$h = \"<label for=parent>Родитель</label>\\n<select name='_parent'>\";\n\t\t$h .= \"<option value=''>без родителя</option>\\n\";\n\t\t$m = new Message();\n\t\t$m->action = \"load\";\n\t\t$m->urn = 'urn-'.$e->name;\n\t\t$m->order = $e->defaultorder;\n\t\t// $m->_parent = 'NULL';\n\t\t//$m->_parent = $parent_id;\n\t\t//if ($e->has_field('ordered')) $m->order = array('ordered'=>'ASC');\n\t\t$ds = $m->deliver();\n\t\t$ds->treesort(); // TREESORT\n\t\t/*\n\t\tforeach ($ds as $p)\n\t\t{\n\t\t\t$sel = '';\n\t\t\tif ($parent_id == $p->id) $sel = 'SELECTED';\n\t\t\t$h .= \"<option data-type='treeroot' $sel value='{$p->id}'>{$p->title}</option>\\n\";\n\t\t}\n\t\t*/\n\t\t$h .= dataset2htmloptions($ds, array(\"urn-{$e->name}-{$parent_id}\"),0, $selfId);\n\t\t$h .= \"</select>\";\n\t\treturn \"<div style='margin: 5px; border: 0px solid red;'>\" . $h . \"</div>\\n\";\n\t}", "function wimbase_menu_link__menu_top_tasks(array $variables) {\n $element = $variables['element'];\n $sub_menu = '';\n $icon = NULL;\n\n $menu_icon = isset($element['#localized_options']['menu_icon']) ? $element['#localized_options']['menu_icon'] : NULL;\n // Add menu item icon.\n if (is_array($menu_icon) && $menu_icon['enable'] && $menu_icon['path']) {\n $icon = '<span><img class=\"item-icon rs_skip\" src=\"' . image_style_url($menu_icon['image_style'], $menu_icon['path']) . '\"></span>';\n $element['#localized_options']['html'] = TRUE;\n }\n if ($element['#below'] && !empty($element['#original_link']['depth']) && $element['#original_link']['depth'] == 1) {\n // Add our own wrapper.\n unset($element['#below']['#theme_wrappers']);\n $sub_menu = '<ul class=\"dropdown-menu\">' . drupal_render($element['#below']) . '</ul>';\n // Generate as standard dropdown.\n $element['#attributes']['class'][] = 'dropdown';\n $element['#localized_options']['html'] = TRUE;\n\n // Set dropdown trigger element to # to prevent inadvertant page loading\n // when a submenu link is clicked.\n $element['#localized_options']['attributes']['class'][] = 'dropdown-toggle';\n }\n // On primary navigation menu, class 'active' is not set on active menu item.\n // @see https://drupal.org/node/1896674\n if (($element['#href'] == $_GET['q'] || ($element['#href'] === '<front>' && drupal_is_front_page())) && (empty($element['#localized_options']['language']))) {\n $element['#attributes']['class'][] = 'active';\n }\n $element['#attributes']['class'] = array_diff($element['#attributes']['class'], ['expanded']);\n\n if ($element['#original_link']['depth'] == 1 && !$element['#below']) {\n $element['#localized_options']['attributes']['class'][] = 'dropdown-toggle';\n $element['#attributes']['class'][] = 'dropdown';\n $element['#localized_options']['attributes']['class'][] = 'nolink';\n }\n\n if ($element['#href'] === '<nolink>') {\n $element['#localized_options']['attributes']['class'][] = 'nolink';\n $output = '<a href=\"#\" ' . drupal_attributes($element['#localized_options']['attributes']) . '>' . check_plain($element['#title']) . '</a>';\n }\n else {\n $output = l($icon . $element['#title'], $element['#href'], $element['#localized_options']);\n }\n\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "function start_el(&$output, $item, $depth, $args){\n $item->title = str_repeat(\"&nbsp;\", $depth * 4).$item->title;\n\n\n\n $output .= $indent . ' id=\"menu-item-'. $item->ID . '\"' . $value . $class_names .'>'; \n $attributes = ! empty( $item->attr_title ) ? ' title=\"' . esc_attr( $item->attr_title ) .'\"' : ''; \n $attributes .= ! empty( $item->target ) ? ' target=\"' . esc_attr( $item->target ) .'\"' : ''; \n $attributes .= ! empty( $item->xfn ) ? ' rel=\"' . esc_attr( $item->xfn ) .'\"' : ''; \n $attributes .= ! empty( $item->url ) ? ' value=\"' . esc_attr( $item->url ) .'\"' : ''; \n \n $item_output .= '<option'. $attributes .'>'; \n $item_output .= $args->link_before .apply_filters( 'the_title', $item->title, $item->ID ); \n $item_output .= '</option>'; \n \n $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); \n\n\n\n // no point redefining this method too, we just replace the li tag...\n $output = str_replace('<li', '<option', $output);\n }", "function getChildRubrique_article($idRubrique,$niveau,$rub_selected)\n{\n\t$req = mysql_query(\"SELECT * FROM RUBRIQUE WHERE id_mere=\".$idRubrique);\n\t$niveau++;\n\twhile ($rubrique=mysql_fetch_array($req)) {\n\t\tif($rubrique['id_rubrique']!=null){\n\t\t\t$selected = \"\";\n\t\t\tif($rub_selected == $rubrique['id_rubrique'])\n\t\t\t\t$selected = \"selected='selected'\";\n\t\t\techo \"<option value='\".$rubrique['id_rubrique'].\"'\".$selected.\">\";\n\t\t\tfor($i=0;$i<$niveau;$i++){\n\t\t\t\techo \"----\";\n\t\t\t}\n\t\t\techo \">\";\n\t\t\techo $rubrique['titreFR_rubrique'].\"</option>\";\n\t\t\tgetChildRubrique_article($rubrique[0],$niveau,$rub_selected);\n\t\t}\n\t}\n}", "public function getParentMenuArr() {}", "function moveItemDown()\r\n\t{\r\n\t\t$this->content_obj->moveItemDown();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "protected function hasParentMenuItem() {}", "function ladder_dropdown($array,$depth = 0,$links=array()){\n $return = $links;\n foreach ($array as $item) {\n $return[$item['id']] = repeater(\"-|-\", $depth).$item['title'];\n if (!empty ($item['children']))\n {\n $return = ladder_dropdown ($item['children'],$depth+1, $return);\n }\n }\n return $return; \n }", "function ep_get_nav_item_parent($single_menu_item, $menu_items) {\n\t\n\tif ( empty( $single_menu_item->menu_item_parent ) ) {\n\t\treturn false;\n\t}\n\n\tforeach ($menu_items as $one_menu_item) {\n\n\t\tif ($single_menu_item->menu_item_parent == $one_menu_item->ID) {\n\t\t\treturn $one_menu_item;\n\t\t}\n\n\t}\n\n\treturn false;\n\n}", "protected function prepareMenuItemsForRootlineMenu() {}", "public function getSelected() {}", "public function getSelected() {}", "function drev_sync_path_menu_update_menu($tree, $parent_alias = NULL) {\n \n foreach($tree as $item) {\n \n // Update the item\n $new_parent_alias = drev_sync_path_menu_update_menu_item($item, $parent_alias);\n \n // And go deeper if we can...\n if(!empty($item['below'])) {\n drev_sync_path_menu_update_menu($item['below'], $new_parent_alias);\n }\n }\n \n}", "function ep_get_nav_menu_top_parent($menu_name) {\n\n\t$menulocations = get_nav_menu_locations();\n\t$menu_items = wp_get_nav_menu_items( $menulocations[$menu_name] );\n\t$top_parent_item = null;\n\t$current_item = null;\n\t$parent_item = null;\n\n\t// Find current post in menu\n\tforeach ($menu_items as $one_item) {\n\t\tif (get_queried_object_id() == $one_item->object_id) {\n\t\t\t$current_item = $one_item;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ($current_item) {\n\n\t\t// got current item, now look for top parent\n\t\t$parent_item = $current_item;\n\t\t$found_parent_item = null;\n\t\twhile ( $found_parent_item !== false ) {\n\t\t\t$found_parent_item = ep_get_nav_item_parent($parent_item, $menu_items);\n\t\t\tif ($found_parent_item !== false)\n\t\t\t\t$parent_item = $found_parent_item;\n\t\t}\n\n\t}\n\n\treturn $parent_item;\n\n}", "function getSfMenu($selected) {\n $activeMenusAndLinkContent = getActiveMenuAndLinkContent();\n $activeMenus = $activeMenusAndLinkContent['results'];\n $link_content_id = $activeMenusAndLinkContent['link_contents_id'];\n $link_content_details = getLinkContentDetails($link_content_id);\n \n// Format our active menus for sturcturing a tree for main menu\n $formatedMenus = formatTree($activeMenus, 1);\n $menuStr = \"<ul id='nav'>\";\n foreach ($formatedMenus as $menu) {\n if (!empty($menu['submenu'])) {\n $mnuclass = \"\";\n $p = $link_content_details[$menu['link_content']]['content_uri'];\n $link = $AbsoluteURL . 'index.php?p=' . $p;\n if ($menu['type'] == \"external\") {\n $link = $menu['external_link'];\n }\n if ($p == $selected) {\n $mnuclass = \"class='active'\";\n } elseif (is_submenu_selected($menu['submenu'], $selected, $link_content_details)) {\n $mnuclass = \"class='active'\";\n }\n\n $menuStr.='<li ' . $mnuclass . '><a href = \"' . $link . '\">' . $menu['menu_name'] . '</a>';\n $menuStr.=\"<ul>\";\n foreach ($menu['submenu'] as $submenu) {\n $submnuclass = \"\";\n $p = $link_content_details[$submenu['link_content']]['content_uri'];\n $link = $AbsoluteURL . 'index.php?p=' . $p;\n if ($submenu['type'] == \"external\") {\n $link = $submenu['external_link'];\n }\n if ($submenu['type'] == \"category\") {\n $link = \"index.php?p=allproducts&c=\".$submenu['menu_id'];\n }\n if ($p == $selected)\n $submnuclass = \"class='sub_active'\";\n\n $menuStr.='<li ' . $submnuclass . '><a href = \"' . $link . '\">' . $submenu['menu_name'] . '</a></li>';\n }\n $menuStr.=\"</ul></li>\";\n } else {\n $mnuclass = \"\";\n $p = $link_content_details[$menu['link_content']]['content_uri'];\n $link = $AbsoluteURL . 'index.php?p=' . $p;\n if ($menu['type'] == \"external\") {\n $link = $menu['external_link'];\n }\n if ($p == $selected)\n $mnuclass = \"class='active'\";\n $menuStr.='<li ' . $mnuclass . '><a href = \"' . $link . '\">' . $menu['menu_name'] . '</a><li>';\n }\n }\n $menuStr.=\"</ul>\";\n return $menuStr;\n}", "public function TopMost()\n {\n $tblNavItem = NavigationItem::Schema()->Table();\n $sql = Access::SqlBuilder();\n $where = $sql->Equals($tblNavItem->Field('Navigation'), $sql->Value($this->navi->GetID()))\n ->And_($sql->IsNull($tblNavItem->Field('Parent')))\n ->And_($sql->IsNull($tblNavItem->Field('Previous')));\n \n return NavigationItem::Schema()->First($where);\n }", "private function PH_PageMenu(){\n $site_menu = self::$xvi_api->GetSiteMenu();\n $page_menu = self::$xvi_api->GetPageMenu();\n \n $menu =\"\";\n foreach($site_menu as $menu_item=>$menu_path) {\n if (strcmp($menu_item,$page_menu[\"item\"])) { /*not selected menu item*/\n $menu .= \"<li><a href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n } else { /* it is selected menu*/\n $menu .= \"<li><a class=\\\"sel\\\" href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n }\n }\n return $menu;\n }", "function get_top_menu($nav){\n foreach(deka(array(), $nav,'data') as $menu_item) :\n $linkclass = $menu_item['slug'];\n if( (defined('URI_PART_0')) && ($linkclass === URI_PART_0 ) ) $linkclass .= ' current';\n echo '<li class=\"' . $linkclass . '\">';\n echo get_cat_link($menu_item);\n\n if(deka(array(), $menu_item, 'children')) :\n echo '<ul class=\"subMenu\">';\n foreach($menu_item['children'] as $k => $sub_menu_item) :\n $sublinkclass = $k+1;\n if($k+1 === count($menu_item['children'])) $sublinkclass .= ' last';\n echo '<li class=\"' . $sublinkclass . '\">';\n echo get_subcat_link($menu_item, $sub_menu_item);\n echo '</li>';\n endforeach; // menu_item['children'] as sub_menu_item\n echo '</ul>';\n endif; // deka(array(), menu_item, 'children'\n\n echo '</li>';\n endforeach; // deka(array(), nav, 'data') as menu_item\n}", "private function category_drop_down($selected_id = '') {\n\t\t\tglobal $dbh;\n\t\t\n\t\t$parent_drop_down = '<select class=\"category_dd\" onchange=\"this.form.submit();\" name=\"category\">'.LB;\n\t\t\n\t\t$parent_drop_down .= '<option value=\"all\">View All</option>';\n\t\t\n\t\t$sql_query = \"SELECT\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tcategory_name,\n\t\t\t\t\t\tparent_category_id\n\t\t\t\t\t FROM\n\t\t\t\t\t\tcategories\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tzip_id is NULL\n\t\t\t\t\t AND\n\t\t\t\t\t\tparent_category_id = 0\n\t\t\t\t\t ORDER BY sort_order ASC, category_name ASC\n\t\t\t\t\t ;\";\n\t\t\t\t\t \n\t\t// store results in memcached\n\t\t$rows = db_memc_str($sql_query);\n\t\t\n\t\tforeach ($rows as $categories) {\n\t\t $ind = '--';\n\t\t \n\t\t // draw child drop down\n\t\t $parent_drop_down_child = $this->parent_dd_child_chk($categories['id'],$ind,$selected_id);\n\t\t \n\t\t // draw parent drop down\n\t\t $parent_drop_down_parent = '<option value=\"'.$categories['id'].'\" '.($selected_id == $categories['id'] ? 'selected=\"selected\" ' : '').'>'.htmlentities($categories['category_name']).'</option>'.LB;\n\t\t \n\t\t $parent_drop_down .= $parent_drop_down_parent . $parent_drop_down_child;\n\t\t}\n\t\t\n\t\t$parent_drop_down .= '</select>'.LB;\n\t\t\n\treturn $parent_drop_down;\n\t}", "function showCategoryList(&$category_tree, $type_text, $level = 0) {\n\t$row_idx = 1;\n\t\n foreach ($category_tree as $category) {\n?>\n <tr class=\"row_style_<?php echo $row_idx; ?>\">\n\t\t\t<td></td>\n \t<td class=\"left\"><?php echo str_repeat('&nbsp;--', $level).'&nbsp;'.$category->name; ?></td>\n \t<td>\n \t <a href=\"#\" onclick=\"select_for_menu_item('<?php echo $type_text.' - '.$category->name; ?>', '<?php echo $category->id; ?>'); return false;\">\n \t <?php _e('Select'); ?></a>\n \t</td>\n </tr>\n<?php\n $row_idx = 1 - $row_idx;\n \n if (sizeof($category->slaves['ProductCategory']) > 0) {\n $level++;\n showCategoryList($category->slaves['ProductCategory'], $type_text, $level);\n $level--;\n }\n }\n}", "function psts_levels_select($name, $selected) {\r\n\tglobal $psts;\r\n\t$psts->levels_select($name, $selected);\r\n}", "public function getGrandParent();", "function easl_walker_nav_menu_start_el( $item_output, $item, $depth, $args ) {\n\tif ( is_array( $item->classes ) && in_array( 'ilc-hide-link', $item->classes ) ) {\n\t\treturn '';\n\t}\n\n\treturn $item_output;\n}", "function renderTree($item, $offset, $depth, $options) {\n global $Core;\n global $Router;\n \n # Core::Dump(array($item, $offset, $depth, $options));\n\n $attribs = array();\n $sublist = '';\n $active = $options['show_all'] ? true : $item->isActive();\n\n if ($active && $item->hasChildren() && ($offset + $depth + 1) > 0) {\n\n $n=0;\n foreach ($item->getChildren() as $child) {\n $subListOptions = $options;\n if ($offset === -1) {\n $subListOptions['li_class'] = '';\n $subListOptions['a_class'] = '';\n if ($n == 0) {\n $subListOptions['li_class'] .= ' firstChild';\n }\n if ($n == count($item->getChildren())-1) {\n $subListOptions['li_class'] .= ' lastChild';\n }\n $subListOptions['li_class'] = trim($subListOptions['li_class']);\n }\n $sublist .= $this->renderTree($child, $offset-1, $depth-1, $subListOptions);\n $n++;\n }\n\n if (is_null($item->get('title')) || $offset > 0) return $sublist;\n\n $sublist = HtmlUtils::tag(\n 'div',\n array(\n 'class' => Filter::get(\n $options, \n 'submenu_class', \n $DEFAULT_OPTIONS['submenu_class']\n )),\n HtmlUtils::tag(\n 'ul',\n array(),\n $sublist\n )\n );\n }\n\n if ($offset > 0) return '';\n\n // add css class 'active' to the LI containing current link\n \n if (Filter::get($options, 'li_class', $DEFAULT_OPTIONS['li_class'])) {\n $attribs['class'] .= Filter::get($options, 'li_class', $DEFAULT_OPTIONS['li_class']);\n }\n if ($item->isActive()) {\n $attribs['class'] .= ($attribs['class'] ? ' ' : '') . Filter::get($options, 'active_class');\n }\n \n // don't create a to the page we're currently viewing\n\n $attrs = array('href' => $Router->GetLink($item->get('id')));\n if ($item->get('id') == DEFAULT_PAGE) {\n $attrs['class'] = 'home';\n $attrs['class'] .= ($attrs['class'] ? ' ' : '') . Filter::get($options, 'active_class');\n }\n if (Filter::get($options, 'a_class', $DEFAULT_OPTIONS['a_class'])) {\n $attrs['class'] .= ($attrs['class'] ? ' ' : '') . Filter::get($options, 'a_class', $DEFAULT_OPTIONS['a_class']);\n }\n $link = HtmlUtils::tag(\n 'a',\n $attrs,\n HtmlUtils::tag(\n 'span',\n array('class'=>'linktext'),\n ucwords($item->get('title'))\n )\n );\n\n return HtmlUtils::tag('li', $attribs, \"{$link}\\n\" . $sublist);\n }", "public static function menu(){\n $sql = \"select * from pageweb where id_parent = 1 AND menu = 1 ORDER BY ordre\";\n $parents = DB::get_sql_tab($sql);\n for($i=0;$i<count($parents);$i++) {\n $sql2 = \"select * from pageweb where id_parent = '\".$parents[$i][\"id\"].\"'AND menu = 1\";\n $enfants = DB::get_sql_tab($sql2);\n $parents[$i][\"enfants\"] = $enfants;\n }\n return $parents;\n }", "function minorite_menu_link(array $variables) {\n $element = $variables['element'];\n $path = $element['#href'];\n $sub_menu = '';\n\n // Append active class.\n if (($path == $_GET['q'] || ($path == '<front>' && drupal_is_front_page())) &&\n (empty($options['language']) || $options['language']->language == $language_url->language)) {\n $element['#attributes']['class'][] = 'nav-selected';\n }\n\n if (!empty($element['#below'])) {\n $sub_menu = drupal_render($element['#below']);\n $element['#attributes']['class'][] = 'nav-has-child';\n }\n $output = l($element['#title'], $element['#href'], $element['#localized_options']);\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "public function FirstChildOf($item)\n {\n if ($item)\n {\n $sql = Access::SqlBuilder();\n $tbl = PageContent::Schema()->Table();\n $where = $sql->Equals($tbl->Field('Parent'), $sql->Value($item->GetID()))\n ->And_($sql->IsNull($tbl->Field('Previous')));\n \n return PageContent::Schema()->First($where);\n }\n else\n {\n return $this->TopMost();\n }\n }", "function carton_walk_category_dropdown_tree() {\n\t$args = func_get_args();\n\n\t// the user's options are the third parameter\n\tif ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )\n\t\t$walker = new CTN_Product_Cat_Dropdown_Walker;\n\telse\n\t\t$walker = $args[2]['walker'];\n\n\treturn call_user_func_array(array( &$walker, 'walk' ), $args );\n}", "function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {\n global $wp_query;\n $indent = ( $depth > 0 ? str_repeat( \"\\t\", $depth ) : '' ); // code indent\n \n // depth dependent classes\n $depth_classes = array(\n ( $depth == 0 ? 'main-menu-item' : 'sub-menu-item' ),\n ( $depth >=2 ? 'sub-sub-menu-item' : '' ),\n ( $depth % 2 ? 'menu-item-odd' : 'menu-item-even' ),\n 'menu-item-depth-' . $depth\n );\n $depth_class_names = esc_attr( implode( ' ', $depth_classes ) );\n \n // passed classes\n $classes = empty( $item->classes ) ? array() : (array) $item->classes;\n $class_names = esc_attr( implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ) );\n \n // build html\n $output .= $indent . '<li id=\"nav-menu-item-'. $item->ID . '\" class=\"' . $depth_class_names . ' ' . $class_names . '\">';\n \n // link attributes\n $attributes = ! empty( $item->attr_title ) ? ' title=\"' . esc_attr( $item->attr_title ) .'\"' : '';\n $attributes .= ! empty( $item->target ) ? ' target=\"' . esc_attr( $item->target ) .'\"' : '';\n $attributes .= ! empty( $item->xfn ) ? ' rel=\"' . esc_attr( $item->xfn ) .'\"' : '';\n $attributes .= ! empty( $item->url ) ? ' href=\"' . esc_attr( $item->url ) .'\"' : '';\n $attributes .= ' class=\"menu-link ' . ( $depth > 0 ? 'sub-menu-link' : 'main-menu-link' ) . '\"';\n \n $item_output = sprintf( '%1$s<a%2$s>%3$s%4$s%5$s</a>%6$s',\n $args->before,\n $attributes,\n $args->link_before,\n apply_filters( 'the_title', $item->title, $item->ID ),\n $args->link_after,\n $args->after\n );\n \n // build html\n $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );\n}", "function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {\n global $wp_query;\n $indent = ( $depth > 0 ? str_repeat( \"\\t\", $depth ) : '' ); // code indent\n \n // depth dependent classes\n $depth_classes = array(\n ( $depth == 0 ? 'main-menu-item' : 'sub-menu-item' ),\n ( $depth >=2 ? 'sub-sub-menu-item' : '' ),\n ( $depth % 2 ? 'menu-item-odd' : 'menu-item-even' ),\n 'menu-item-depth-' . $depth\n );\n $depth_class_names = esc_attr( implode( ' ', $depth_classes ) );\n \n // passed classes\n $classes = empty( $item->classes ) ? array() : (array) $item->classes;\n $class_names = esc_attr( implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ) );\n \n // build html\n $output .= $indent . '<li id=\"nav-menu-item-'. $item->ID . '\" class=\"' . $depth_class_names . ' ' . $class_names . '\">';\n \n // link attributes\n $attributes = ! empty( $item->attr_title ) ? ' title=\"' . esc_attr( $item->attr_title ) .'\"' : '';\n $attributes .= ! empty( $item->target ) ? ' target=\"' . esc_attr( $item->target ) .'\"' : '';\n $attributes .= ! empty( $item->xfn ) ? ' rel=\"' . esc_attr( $item->xfn ) .'\"' : '';\n $attributes .= ! empty( $item->url ) ? ' href=\"' . esc_attr( $item->url ) .'\"' : '';\n $attributes .= ' class=\"menu-link ' . ( $depth > 0 ? 'sub-menu-link' : 'main-menu-link' ) . '\"';\n \n $item_output = sprintf( '%1$s<a%2$s>%3$s%4$s%5$s</a>%6$s',\n $args->before,\n $attributes,\n $args->link_before,\n apply_filters( 'the_title', $item->title, $item->ID ),\n $args->link_after,\n $args->after\n );\n \n // build html\n $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );\n}", "function renderChildrenOf($pa, $root = null, $output = '', $level = 0) {\n if(!$root) $root = wire(\"pages\")->get(1);\n $output = '';\n $level++;\n foreach($pa as $child) {\n $class = '';\n $has_children = ($child->id == \"1018\" || $child->id == \"1263\" || count($child->children('include=all'))) ? true : false;\n\n if($has_children && $child !== $root) {\n if($level == 1){\n $class .= 'parent'; // first level boostrap dropdown li class\n //$atoggle .= ' class=\"dropdown-toggle\" data-toggle=\"dropdown\"'; // first level anchor attributes\n }\n }\n\n // make the current page and only its first level parent have an active class\n if($child === wire(\"page\") && $child !== $root){\n $class .= ' active';\n } else if($level == 1 && $child !== $root){\n if($child === wire(\"page\")->rootParent || wire(\"page\")->parents->has($child)){\n $class .= ' active';\n }\n }\n\n $class = strlen($class) ? \" class='\".trim($class).\"'\" : '';\n if($child->menu_item_url) {$childlink = $child->menu_item_url; } else { $childlink = $child->url; }\n $output .= \"<li$class><a href='$childlink'>$child->title</a>\";\n\n // If this child is itself a parent and not the root page, then render its children in their own menu too...\n \n if($has_children && $child !== $root) {\n \n // check for special menu items\n if ($child->id == \"1263\") { //services main item\n\n $output .= '<div class=\"megamenu\"><div class=\"megamenu-row\">';\n \n // promo\n $output .= '<div class=\"col3\">';\n $output .= '<h4 class=\"megamenu-col-title\">Promotional Offer:</h4>';\n $output .= '<a href=\"#\"><img src=\"http://placehold.it/270x244\" alt=\"\"></a>';\n $output .= '</div>';\n // end promo\n \n // first column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuServicesList('General');\n $output .= '</div>';\n // end first column\n\n // second column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuServicesList('Cosmetic Dentistry');\n $output .= megaMenuServicesList('Dental Restorations');\n $output .= '</div>';\n // end second column\n\n // third column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuServicesList('Specialty');\n $output .= '</div>';\n // end third column\n\n $output .= '</div></div>';\n }elseif ($child->id == \"1018\") {// blog main menu item\n \n $output .= '<div class=\"megamenu\"><div class=\"megamenu-row\">';\n\n // first column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuBlogCatList('general-dentistry');\n $output .= megaMenuBlogCatList('sleep-apnea-snoring');\n $output .= '</div>';\n // end first column\n\n // second column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuBlogCatList('cosmetic-dentistry');\n $output .= '</div>';\n // end second column\n\n // third column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuBlogCatList('childrens-dentistry');\n $output .= '</div>';\n // end third column\n\n // dourth column\n $output .= '<div class=\"col3\">';\n $output .= megaMenuBlogCatList('sedation-dentistry'); \n $output .= megaMenuBlogCatList('restorations');\n $output .= '</div>';\n // end dourth column\n\n $output .= '</div></div>';\n \n }else {// default case for all other menu items\n\n $output .= renderChildrenOf($child->children('include=all'), $root, $output, $level);\n\n }\n }\n $output .= '</li>';\n\n\n }\n $outerclass = ($level == 1) ? \"menuzord-menu\" : 'dropdown';\n return \"<ul class='$outerclass'>$output</ul>\";\n}", "private function setTreeOutput(){\n \n $item = $this->item;\n \n $treeoutput = NULL;\n $menuname = NULL;\n $parameters = NULL;\n \n $menutree = \\Drupal::menuTree();\n \n if($item->menu_name == 'active-menu'){\n \n $menuname = $this->getCurrentMenuName();\n \n if($menuname)\n $parameters = $menutree->getCurrentRouteMenuTreeParameters($menuname);\n \n }else{\n $parameters = new MenuTreeParameters();\n $parameters->root = $item->menu_plid;\n $menuname = $item->menu_name;\n }\n \n \n if($parameters && $menuname){\n \n $parameters->setMaxDepth($item->menu_level);\n\n $tree = $menutree->load($menuname, $parameters);\n $treeoutput = $menutree->build($tree);\n \n }\n \n $this->treeoutput = $treeoutput;\n }", "public function obtenerElementosMenu();", "function appendChildren ($item) {\n if (array_key_exists($item->name(),$this->parents)) {\n $this->menu[]=new Marker('start');\n foreach ( $this->children[$item->name()] as $child ) {\n $this->menu[]=$child;\n $this->appendChildren($child);\n }\n $check=end($this->menu);\n if ( $check->isStart() )\n array_pop($this->menu);\n else\n $this->menu[]=new Marker('end');\n }\n }", "public function current ( ) {\n\n return current($this->_childs);\n }", "public abstract function getPrevMenu();", "function start_el( &$output, $item, $depth, $args ) {\n\t\tglobal $wp_query;\n\t\t$indent = ( $depth > 0 ? str_repeat( \"\\t\", $depth ) : '' ); // code indent\n\n\t\t// passed classes\n\t\t$classes = empty( $item->classes ) ? array() : (array) $item->classes;\n\t\t$class_names = esc_attr( implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ) );\n\n\t\t// build html\n\t\t$deptClass = \"\";\n\t\tif($depth == 0){\n\t\t\t$deptClass = \"rootNode\";\n\t\t}\n\t\t$output .= $indent . '<li id=\"nav-menu-item-'. $item->ID . '\" class=\"'.$deptClass.'\">';\n\t\t\n\t\t\n\n\t\t// link attributes\n\t\t$attributes = ! empty( $item->attr_title ) ? ' title=\"' . esc_attr( $item->attr_title ) .'\"' : '';\n\t\t$attributes .= ! empty( $item->target ) ? ' target=\"' . esc_attr( $item->target ) .'\"' : '';\n\t\t$attributes .= ! empty( $item->xfn ) ? ' rel=\"' . esc_attr( $item->xfn ) .'\"' : '';\n\t\t$attributes .= ! empty( $item->url ) ? ' href=\"' . esc_attr( $item->url ) .'\"' : '';\n\t\t$attributes .= ' class=\"' . (! empty ( $item->post_name ) ? esc_attr($item->post_name) : '') . '\"';\n\n\t\t$item_output = sprintf( '%1$s<a%2$s>%3$s%4$s%5$s</a>%6$s',\n\t\t\t\t$args->before,\n\t\t\t\t$attributes,\n\t\t\t\t$args->link_before,\n\t\t\t\tapply_filters( 'the_title', $item->title, $item->ID ),\n\t\t\t\t$args->link_after,\n\t\t\t\t$args->after\n\t\t);\n\n\t\t// build html\n\t\t$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );\n\t}", "public function getMenu($params=null){\n\t\t\tif (!isset($this->menu) || (isset($params) && !empty($params))){\n\t\t\t\tif (isset($params) && !empty($params)){\n\t\t\t\t\t$this->params->bind($params);\n\t\t\t\t}\n\n\t\t\t\t// Initialize variables.\n\t\t\t\t$app\t\t= JFactory::getApplication();\n\t\t\t\t$sitemenu\t= $app->getMenu();\n\n\t\t\t\t// If no active menu, use default\n\t\t\t\t$active = ($sitemenu->getActive()) ? $sitemenu->getActive() : $sitemenu->getDefault();\n\t\t\t\t$path\t\t= $active->tree;\n\t\t\t\t$start\t\t= (int) $this->params->get('startlevel', 0);\n\t\t\t\t$end\t\t= (int) $this->params->get('endlevel', -1);\n\t\t\t\t$deep\t\t= $end - $start + 1;\n\n\t\t\t\t$items \t\t= $sitemenu->getItems('menutype', $this->params->get('menutype', 'mainmenu'));\n\n\t\t\t\t$root = new YtMenu(null, $this->params);\n\t\t\t\t$k = array();\n\n\t\t\t\tif (isset($items) && count($items)>0){\n\n\t\t\t\t\t$itemids = array();\n\t\t\t\t\t$itemobj = array();\n\t\t\t\t\t$smallest_level = 99999;\n\n\t\t\t\t\tforeach($items as $i => $item){\n\t\t\t\t\t\t$iid = $item->id;\n\n\t\t\t\t\t\t$itemids[$iid] = 1;\n\t\t\t\t\t\t$itemobj[$iid] =& $items[$i];\n\t\t\t\t\t\tif (!isset($item->sublevel)){\n\t\t\t\t\t\t\tif ($smallest_level > $item->level){\n\t\t\t\t\t\t\t\t$smallest_level = $item->level;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ($smallest_level > $item->sublevel){\n\t\t\t\t\t\t\t$smallest_level = $item->sublevel;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\tforeach($items as $i => $item){\n\t\t\t\t\t\t// level filter\n\t\t\t\t\t\t$s_parent_item = false;\n\t\t\t\t\t\t$spid = $item->tree[0];\n\t\t\t\t\t\t$iid = $item->id;\n\t\t\t\t\t\t$ideep = count($item->tree);\n\n\t\t\t\t\t\tif (!isset($item->sublevel)){\n\t\t\t\t\t\t\tif ($start>$item->level) continue;\n\t\t\t\t\t\t} else if ($start>$item->sublevel) continue;\n\t\t\t\t\t\t// if $deep<=0 ignore endlevel check.\n\t\t\t\t\t\tif (!isset($item->sublevel)){\n\t\t\t\t\t\t\tif ($deep>0 && $end <$item->level) continue;\n\t\t\t\t\t\t} else if ($deep>0 && $end <$item->sublevel) continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if is not child of start level items.\n\t\t\t\t\t\tif (!isset($item->sublevel)){\n\t\t\t\t\t\t\tif ($deep>1 && $itemobj[$spid]->level>$smallest_level) continue;\n\t\t\t\t\t\t} else if ($deep>1 && $itemobj[$spid]->sublevel>$smallest_level) continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$k[$iid] = new YtMenu($item, $this->params);\n\t\t\t\t\t};\n\n\t\t\t\t\t// set active items\n\t\t\t\t\tforeach ($path as $id){\n\t\t\t\t\t\tif (isset($k[$id])){\n\t\t\t\t\t\t\t$k[$id]->set('active', 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($k as $key => $item){\n\t\t\t\t\t\t// if type is alias (value is 'menulink' in Joomla 1.5)\n\t\t\t\t\t\tif ($item->type=='menulink'){\n\t\t\t\t\t\t\t$refid = $item->query['Itemid'];\n\t\t\t\t\t\t\t$aliasitem = $sitemenu->getItem($refid);\n\t\t\t\t\t\t\tif ($aliasitem){\n\t\t\t\t\t\t\t\t$item->set('_aliasitem', new YtMenu($aliasitem, $this->params));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$item->set('_aliasitem', false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//$item->debug();die();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// id of item's parent\n\t\t\t\t\t\t$ipid = $item->get('parent');\n\t\t\t\t\t\t$ideep = count($item->tree);\n\n\t\t\t\t\t\tif (!isset($k[$ipid])) {\n\t\t\t\t\t\t\t$root->addChild($item);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//echo \"<br>parent is $ipid\";\n\t\t\t\t\t\t$parentNode =& $k[$ipid];\n\t\t\t\t\t\t$parentNode->addChild($item);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tunset($itemids);\n\t\t\t\tunset($itemobj);\n\t\t\t\t$this->menu = $root;\n\t\t\t}\n\t\t\treturn $this->menu;\n\t\t}", "function mnu_EchoMainMenu($selmenuid)\n{\n global $menu;\n for ($i = 0; $i < count($menu); $i++) {\n if ($menu[$i]['visible'] == true) {\n if (!isset($menu[$i]['newwindow']))\n $menu[$i]['newwindow'] = false;\n if ($menu[$i]['newwindow'] == true)\n $target_blank = \"target='_blank'\";\n else\n $target_blank = \"\";\n\n if ($menu[$i]['siteid'] == $selmenuid || is_array($menu[$i]['siteid']) && in_array($selmenuid, $menu[$i]['siteid'])) {\n echo '<li><a class=\"selected bg-green06\" href=\"' . $menu[$i]['filename'] . '\">' . htmlspecialchars($menu[$i]['menustring'], ENT_COMPAT, 'UTF-8') . '</a></li>';\n } else {\n echo '<li><a ' . $target_blank . ' href=\"' . $menu[$i]['filename'] . '\">' . htmlspecialchars($menu[$i]['menustring'], ENT_COMPAT, 'UTF-8') . '</a></li>';\n }\n }\n }\n}", "public static function findMenuItem(ItemInterface $menuItem, $name): ?ItemInterface\n {\n if (null === $name) {\n return null;\n }\n $item = $menuItem->getChild($name);\n if (!$item) {\n foreach ($menuItem->getChildren() as $child) {\n $item = self::findMenuItem($child, $name);\n if ($item instanceof ItemInterface) {\n break;\n }\n }\n }\n\n return $item;\n }", "public function getMultiLevelDropdownWrapper($item)\n {\n }", "function add_main_menu_item($options = array(), $parent = '')\n{\n $default_options = array(\n 'name',\n 'permission',\n 'icon',\n 'url',\n 'id'\n );\n $order = '';\n if (isset($options['order'])) {\n $order = $options['order'];\n unset($options['order']);\n }\n $data = array();\n for ($i = 0; $i < count($default_options); $i++) {\n if (isset($options[$default_options[$i]])) {\n $data[$default_options[$i]] = $options[$default_options[$i]];\n } else {\n $data[$default_options[$i]] = '';\n }\n }\n $menu = get_option('aside_menu_active');\n $menu = json_decode($menu);\n // check if the id exists\n if ($data['id'] == '') {\n $data['id'] = slug_it($data['name']);\n }\n $total_exists = 0;\n foreach ($menu->aside_menu_active as $item) {\n if ($item->id == $data['id']) {\n $total_exists++;\n }\n }\n if ($total_exists > 0) {\n return false;\n }\n $_data = new stdClass();\n foreach ($data as $key => $val) {\n $_data->{$key} = $val;\n }\n\n $data = $_data;\n if ($parent == '') {\n if ($order == '') {\n array_push($menu->aside_menu_active, $data);\n } else {\n if ($order == 1) {\n array_unshift($menu->aside_menu_active, array());\n } else {\n $order = $order - 1;\n array_splice($menu->aside_menu_active, $order, 0, array(\n ''\n ));\n }\n $menu->aside_menu_active[$order] = $_data;\n }\n } else {\n $i = 0;\n foreach ($menu->aside_menu_active as $item) {\n if ($item->id == $parent) {\n if (!isset($item->children)) {\n $menu->aside_menu_active[$i]->children = array();\n $menu->aside_menu_active[$i]->children[] = $data;\n break;\n } else {\n if ($order == '') {\n $menu->aside_menu_active[$i]->children[] = $data;\n } else {\n if ($order == 1) {\n array_unshift($menu->aside_menu_active[$i]->children, array());\n } else {\n $order = $order - 1;\n array_splice($menu->aside_menu_active[$i]->children, $order, 0, array(\n ''\n ));\n }\n $menu->aside_menu_active[$i]->children[$order] = $data;\n }\n break;\n }\n }\n $i++;\n }\n }\n if (update_option('aside_menu_active', json_encode($menu))) {\n return true;\n }\n\n return false;\n}", "public function getChildSelectorName();", "function _wp_reset_invalid_menu_item_parent($menu_item_data)\n {\n }", "public function getParentSelectorName();", "public function next() {\n return $this->_next($this->parent->children(), func_get_args());\n }", "public function nextInvisible() {\n if(!$this->parent) {\n return null;\n } else {\n return $this->_next($this->parent->children(), func_get_args(), 'invisible');\n }\n }", "public function getCurrentItem($menu): ItemInterface\n {\n $rootItem = $this->get($menu);\n\n $currentItem = $this->helper->getCurrentItem($rootItem);\n\n if (null === $currentItem) {\n $currentItem = $rootItem;\n }\n\n return $currentItem;\n }", "function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='')\r\n {\r\n\t\t// phpcs:enable\r\n global $langs,$conf;\r\n\r\n // Clean parameters\r\n\r\n\r\n // Check parameters\r\n if (! is_array($dirmenuarray)) return -1;\r\n\r\n\t\t$menuarray=array();\r\n foreach ($conf->file->dol_document_root as $dirroot)\r\n {\r\n foreach($dirmenuarray as $dirtoscan)\r\n {\r\n $dir=$dirroot.$dirtoscan;\r\n //print $dir.'<br>';\r\n if (is_dir($dir))\r\n {\r\n \t $handle=opendir($dir);\r\n \t if (is_resource($handle))\r\n \t {\r\n \t while (($file = readdir($handle))!==false)\r\n \t {\r\n \t if (is_file($dir.\"/\".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && substr($file, 0, 5) != 'index')\r\n \t {\r\n \t if (preg_match('/lib\\.php$/i',$file)) continue;\t// We exclude library files\r\n \t if (preg_match('/eldy_(backoffice|frontoffice)\\.php$/i',$file)) continue;\t\t// We exclude all menu manager files\r\n \t if (preg_match('/auguria_(backoffice|frontoffice)\\.php$/i',$file)) continue;\t// We exclude all menu manager files\r\n \t if (preg_match('/smartphone_(backoffice|frontoffice)\\.php$/i',$file)) continue;\t// We exclude all menu manager files\r\n\r\n \t $filelib=preg_replace('/\\.php$/i','',$file);\r\n \t \t\t\t\t$prefix='';\r\n \t \t\t\t\t// 0=Recommanded, 1=Experimental, 2=Developpement, 3=Other\r\n \t \t\t\t\tif (preg_match('/^eldy/i',$file)) $prefix='0';\r\n else if (preg_match('/^smartphone/i',$file)) $prefix='2';\r\n \t \t\t\t\telse $prefix='3';\r\n\r\n \t if ($file == $selected)\r\n \t {\r\n \t \t\t\t\t\t$menuarray[$prefix.'_'.$file]='<option value=\"'.$file.'\" selected>'.$filelib.'</option>';\r\n \t }\r\n \t else\r\n \t {\r\n \t $menuarray[$prefix.'_'.$file]='<option value=\"'.$file.'\">'.$filelib.'</option>';\r\n \t }\r\n \t }\r\n \t }\r\n \t closedir($handle);\r\n \t }\r\n }\r\n }\r\n }\r\n\t\tksort($menuarray);\r\n\r\n\t\t// Output combo list of menus\r\n print '<select class=\"flat\" id=\"'.$htmlname.'\" name=\"'.$htmlname.'\"'.($moreattrib?' '.$moreattrib:'').'>';\r\n $oldprefix='';\r\n\t\tforeach ($menuarray as $key => $val)\r\n\t\t{\r\n\t\t\t$tab=explode('_',$key);\r\n\t\t\t$newprefix=$tab[0];\r\n\t\t\tif ($newprefix=='1' && ($conf->global->MAIN_FEATURES_LEVEL < 1)) continue;\r\n\t\t\tif ($newprefix=='2' && ($conf->global->MAIN_FEATURES_LEVEL < 2)) continue;\r\n\t\t\tif ($newprefix != $oldprefix)\t// Add separators\r\n\t\t\t{\r\n\t\t\t\t// Affiche titre\r\n\t\t\t\tprint '<option value=\"-1\" disabled>';\r\n\t\t\t\tif ($newprefix=='0') print '-- '.$langs->trans(\"VersionRecommanded\").' --';\r\n if ($newprefix=='1') print '-- '.$langs->trans(\"VersionExperimental\").' --';\r\n\t\t\t\tif ($newprefix=='2') print '-- '.$langs->trans(\"VersionDevelopment\").' --';\r\n\t\t\t\tif ($newprefix=='3') print '-- '.$langs->trans(\"Other\").' --';\r\n\t\t\t\tprint '</option>';\r\n\t\t\t\t$oldprefix=$newprefix;\r\n\t\t\t}\r\n\t\t\tprint $val.\"\\n\";\t// Show menu entry\r\n\t\t}\r\n\t\tprint '</select>';\r\n }", "public function getSubmenu()\n {\n return $this->hasOne(Menu::className(), ['id'=>'menu_id']);\n }", "public static function getItemExceededMaxNestingLevel(ItemInterface $menu, ItemInterface $item)\n {\n $maxNestingLevel = $menu->getExtra('max_nesting_level', 0);\n\n if ($maxNestingLevel && $item->getLevel() > $maxNestingLevel) {\n return $item;\n }\n\n foreach ($item->getChildren() as $child) {\n $result = self::getItemExceededMaxNestingLevel($menu, $child);\n if ($result) {\n return $result;\n }\n }\n\n return null;\n }", "public function parentmenus() {\n $this->db->where('menuparentid', \" \"); \n $this->db->order_by('serialid', \"asc\");\n $query = $this->db->get('menu');\n return $query->result();\n }", "function start_el( &$output, $item, $depth = 0, $args = [], $id = 0 ) {\n\t\tglobal $wp_query;\n\t\t$indent = ( $depth ) ? str_repeat( \"\\t\", $depth ) : '';\n\t\t$class_names = $value = '';\n\t\t$classes = empty( $item->classes ) ? array() : (array) $item->classes;\n\n\t\t/* If this item has a dropdown menu, add the 'dropdown' class for Bootstrap */\n\t\tif ( $item->hasChildren ) {\n\t\t\t$classes[] = 'dropdown';\n\t\t\t// level-1 menus also need the 'dropdown-submenu' class\n\t\t\tif ( $depth == 1 ) {\n\t\t\t\t$classes[] = 'dropdown-submenu';\n\t\t\t}\n\t\t}\n\n\t\t/* This is the stock WordPress code that builds the <li> with all of its attributes */\n\t\t$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );\n\t\t$class_names = ' class=\"' . esc_attr( $class_names ) . '\"';\n\t\t$output .= $indent . '<li id=\"menu-item-' . $item->ID . '\"' . $value . $class_names . '>';\n\t\t$attributes = ! empty( $item->attr_title ) ? ' title=\"' . esc_attr( $item->attr_title ) . '\"' : '';\n\t\t$attributes .= ! empty( $item->target ) ? ' target=\"' . esc_attr( $item->target ) . '\"' : '';\n\t\t$attributes .= ! empty( $item->xfn ) ? ' rel=\"' . esc_attr( $item->xfn ) . '\"' : '';\n\t\t$attributes .= ! empty( $item->url ) ? ' href=\"' . esc_attr( $item->url ) . '\"' : '';\n\t\t$item_output = $args->before;\n\n\t\t/* If this item has a dropdown menu, make clicking on this link toggle it */\n\t\tif ( $item->hasChildren && $depth == 0 ) {\n\t\t\t$item_output .= '<a' . $attributes . ' class=\"dropdown-toggle\" data-toggle=\"dropdown\" data-hover=\"dropdown\" data-delay=\"100\" data-close-others=\"true\">';\n\t\t} else {\n\t\t\t$item_output .= '<a' . $attributes . '>';\n\t\t}\n\n\t\t$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;\n\n\t\t/* Output the actual caret for the user to click on to toggle the menu */\n\t\tif ( $item->hasChildren && $depth == 0 ) {\n\t\t\t$item_output .= '<b class=\"caret\"></b></a>';\n\t\t} else {\n\t\t\t$item_output .= '</a>';\n\t\t}\n\n\t\t$item_output .= $args->after;\n\t\t$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );\n\t\treturn;\n\t}", "public function getMenuForEdit()\n {\n $root = $this->findRoot();\n $result = $this->findChildren($root);\n return $result;\n }", "public function getMenu();", "public static function returnMenu() {\n }", "public function level($n) {\n\t\tif ($n<1) return $this;\n\t\tif (sizeof($this->links)>0) {\n\t\t\tforeach($this->links as $link) {\n\t\t\t\tif ($link->is_selected()) {\n\t\t\t\t\t$rc = $link->sublinks? $link->sublinks->level($n-1) : false;\n\t\t\t\t\tif ($rc&&$rc->links) {\n\t\t\t\t\t\tif ($rc->links->count()==0) return false;\n\t\t\t\t\t}\n\t\t\t\t\treturn $rc;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function gard_menu_link__menu_main_d(array $variables) {\n $element = $variables['element'];\n $sub_menu = '';\n\n $options = !empty($element['#localized_options']) ? $element['#localized_options'] : array();\n $depth = $element['#original_link']['depth'];\n\n // Check plain title if \"html\" is not set, otherwise, filter for XSS attacks.\n $mlid = $element['#original_link']['mlid'];\n $title = empty($options['html']) ? check_plain($element['#title']) : filter_xss_admin($element['#title']);\n\n // Ensure \"html\" is now enabled so l() doesn't double encode. This is now\n // safe to do since both check_plain() and filter_xss_admin() encode HTML\n // entities. See: https://www.drupal.org/node/2854978\n $options['html'] = TRUE;\n\n $href = $element['#href'];\n $attributes = !empty($element['#attributes']) ? $element['#attributes'] : array();\n\n // если используется модуль taxonomy_menu\n // меняем ссылку на заданную в словаре Главное Меню\n if ($element['#original_link']['menu_name'] == 'menu-main-d') {\n $source_tid = str_replace('taxonomy/term/', '', $element['#original_link']['link_path']);\n if ($source_term_wr = entity_metadata_wrapper('taxonomy_term', $source_tid)) {\n\n $href = $source_term_wr->field_link->value();\n $tid = strpos($href, 'taxonomy/term/' ) === 0 ? str_replace('taxonomy/term/', '', $href) : null;\n\n // панель второго уровня\n if ($depth == 2) {\n $image_uri = empty($source_term_wr->field_shop_category_image->value()) ? 'public://default_images/no_photo.png' : $source_term_wr->field_shop_category_image->file->value()->uri;\n $image_url = file_create_url($image_uri);\n $title = '<div class=\"category-img\"><img src=\"' . $image_url . '\" alt=\"' . $title . ' - ООО ТД Кирово-Чепецкая Химическая Компания\" loading=\"lazy\"/></div>'\n . '<div class=\"category-link\">' . $title . '</div>';\n// $title = '<div class=\"category-img\"></div>'\n// . '<div class=\"category-link\">' . $title . '</div>';\n\n // формируем при необходимости меню третьего уровня\n // тащим экземпляры заданной сущности\n // или пункты следующего уровня\n $list = [];\n\n if ($field_entity = empty($source_term_wr->field_entity->value()) ? '' : $source_term_wr->field_entity->value()) {\n $field_entity_field = empty($source_term_wr->field_entity_field->value()) ? '' : $source_term_wr->field_entity_field->value();\n $field_tids = empty($source_term_wr->field_textfield_1->value()) ? '' : $source_term_wr->field_textfield_1->value();\n $tids = explode(',', $field_tids);\n if (count($tids) == 1) $tids = [$tid];\n $list = _get_menu_entities($field_entity, $field_entity_field, $tids);\n }\n\n // если сущности для второй трети выше не заданы\n // проверить наличие подпунктов и вывести их\n if (empty($list) && $element['#below']) {\n $list = _get_menu_terms($element['#below']);\n }\n\n // третий уровень выводить только при наличии наполнения второй трети\n if ($list) {\n // определяем наполнение первой трети\n // если это каталог\n if ($tid) {\n $category_subtitle_color = '';\n $parents = taxonomy_get_parents_all($tid);\n if (empty($parents[1])) {\n $category_title = $parents[0]->name;\n $category_subtitle = t('View more');\n $category_title_color = $parents[0]->field_color['und'][0]['value'];\n $category_subtitle_color = '';\n $category_title_url = url('taxonomy/term/' . $parents[0]->tid);\n $category_subtitle_url = $category_title_url;\n } else {\n $category_title = $parents[1]->name;\n $category_subtitle = $parents[0]->name;\n $category_title_color = $parents[1]->field_color['und'][0]['value'];\n// $category_subtitle_color = $parents[0]->field_color['und'][0]['value'];\n $category_title_url = url('taxonomy/term/' . $parents[1]->tid);\n $category_subtitle_url = url('taxonomy/term/' . $parents[0]->tid);\n }\n $chevron_color = $category_subtitle_color ? $category_subtitle_color : $category_title_color;\n\n // выводить ли прайс-лист\n $szr = false;\n if (in_array($parents[0]->tid, [AGRO_CATEGORY_FERT_TID, AGRO_CATEGORY_SURFACTANTS_TID, AGRO_CATEGORY_DESICCANTS_TID, AGRO_CATEGORY_HERBICIDES_TID, AGRO_CATEGORY_DISINFECTANTS_TID, AGRO_CATEGORY_FUNGICIDES_TID, AGRO_CATEGORY_INSECTICIDES_TID])) $szr = true;\n\n // если ссылка на раздел\n } else {\n $category_title = $element['#title'];\n $category_subtitle = t('View more');\n $category_title_color = '';\n $category_subtitle_color = '';\n $category_title_url = url($href);\n $category_subtitle_url = $category_title_url;\n }\n $list_html = _pack_list_to_html($list, empty($chevron_color) ? [] : ['color' => $chevron_color]);\n\n // определяем наполнение последней трети\n // подготовить баннер при наличии\n $banner_html = '';\n if ($element['#below']) {\n foreach ($element['#below'] as $key => $item) {\n if (is_numeric($key) && $banner_html = _get_banner_html($element['#below'][$key])) {\n unset($element['#below'][$key]);\n break;\n }\n }\n }\n\n\n $sub_menu = '<div class=\"level-3-wrapper\">'\n . '<div class=\"col-sm-12\">'\n . '<div class=\"row fix-heights\">'\n . '<div class=\"col-sm-3 col-first\">'\n . '<a href=\"' . $category_title_url . '\" class=\"category-title\" ><h3 style=\"color: #' . $category_title_color . '\">' . $category_title . '</h3></a>'\n . '<a href=\"' . $category_subtitle_url . '\" ' . ($category_subtitle_color ? 'style=\"color: #' . $category_subtitle_color . '\"' : '') . '><h4>' . $category_subtitle . '&nbsp;&nbsp;<i class=\"fa fa-chevron-right\"></i></h4></a>'\n . (!empty($szr) ? '<div class=\"price-list\"><a href=\"/catalog/agrochemicals/price-list\">' . t('Price-list') . '</a></div>' : '')\n . '</div>'\n . '<div class=\"col-sm-6\">'\n . $list_html\n . '</div>'\n . '<div class=\"col-sm-3' . ($banner_html ? ' menu-banner' : '') . '\">' . $banner_html . '</div>'\n . '</div>'\n . '</div>'\n . '</div>';\n\n unset($element['#below']);\n }\n }\n\n }\n }\n\n if (!empty($element['#below'])) {\n unset($element['#below']['#theme_wrappers']);\n $sub_menu = '<div class=\"dropdown-menu level-' . ($depth + 1) . '-wrapper\">'\n . '<ul class=\"level-' . ($depth + 1) . '\">'\n . drupal_render($element['#below'])\n . '</ul>'\n . '</div>';\n\n $attributes['class'][] = 'dropdown';\n $attributes['id'] = 'dropdown';\n\n $options['attributes']['class'][] = 'dropdown-toggle';\n $options['attributes']['data-toggle'] = 'dropdown';\n }\n $attributes['class'][] = 'level-' . $depth . '-item';\n if (isset($tid) && $tid == 16) $attributes['class'][] = 'visible';\n\n return '<li' . drupal_attributes($attributes) . '>' . l($title, $href, $options) . $sub_menu . \"</li>\";\n}", "function cms_frontend_menu_tree__menu_footer_second_menu(&$variables) {\n return '<ul class=\"menu nav\">' . $variables['tree'] . '</ul>';\n}", "public function getChild($i) {\n if (array_key_exists ($i, $this->items) ) {\n return $this->items[$i];\n }\n }", "public function getSubMenu(){\n return $this->subMenu;\n }" ]
[ "0.64473027", "0.58796465", "0.5610532", "0.554877", "0.55274355", "0.5495325", "0.5425105", "0.538044", "0.5320571", "0.531702", "0.52651745", "0.52553964", "0.52366686", "0.5226921", "0.51837695", "0.51570916", "0.51450884", "0.51418304", "0.5108643", "0.507442", "0.5047146", "0.504615", "0.50405216", "0.5032864", "0.50314474", "0.50309855", "0.50271386", "0.5020429", "0.50120336", "0.50106645", "0.4989735", "0.49892017", "0.49742863", "0.49699038", "0.49683475", "0.49674582", "0.49426094", "0.4937087", "0.4933903", "0.4923438", "0.49215496", "0.48966753", "0.4894986", "0.48824215", "0.4873354", "0.4857665", "0.484981", "0.48476344", "0.4842095", "0.48348892", "0.48348892", "0.4833324", "0.482398", "0.48072767", "0.47980663", "0.47962916", "0.4794894", "0.4794774", "0.47793582", "0.47672203", "0.4766717", "0.47571865", "0.4723672", "0.47134012", "0.47119883", "0.47073346", "0.47055012", "0.47031626", "0.47031626", "0.47007215", "0.46997777", "0.469826", "0.46906173", "0.46892035", "0.46853855", "0.46807414", "0.46731547", "0.4670416", "0.46631286", "0.46581203", "0.46571812", "0.46531907", "0.46523407", "0.46513632", "0.46507475", "0.46491906", "0.464668", "0.46374565", "0.4630203", "0.4629036", "0.4624909", "0.4620887", "0.46201998", "0.4617837", "0.4617342", "0.46076453", "0.46073648", "0.4603653", "0.4602758", "0.46025127" ]
0.5297245
10
Returns list of possible front page paths.
function _taxonomy_menu_trails_homepage_paths() { return array( '<front>', variable_get('site_frontpage', 'node'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function get_rewrite_fronts() {\n\t\tglobal $wp_rewrite;\n\n\t\t$front = substr( $wp_rewrite->front, 1 );\n\n\t\t$category_base = get_option( 'category_base' );\n\t\tif ( ! $category_base ) {\n\t\t\t$category_base = $front . 'category';\n\t\t}\n\n\t\t$tag_base = get_option( 'tag_base' );\n\t\tif ( ! $tag_base ) {\n\t\t\t$tag_base = $front . 'tag';\n\t\t}\n\n\t\t$date_base = $front;\n\t\tif ( strpos( $wp_rewrite->permalink_structure, '%post_id%' ) !== false ) {\n\t\t\t$date_base = $front . 'date/';\n\t\t}\n\n\t\t$author_base = $front . $wp_rewrite->author_base . '/';\n\n\t\treturn array(\n\t\t\t'category' \t=> $category_base,\n\t\t\t'tag' \t\t=> $tag_base,\n\t\t\t'date' \t\t=> $date_base,\n\t\t\t'author' \t=> $author_base,\n\t\t\t'default' \t=> $front,\n\t\t);\n\t}", "public function install_get_path_search_list()\n {\n return array(\n 0 => '/',\n 1 => 'mybb',\n 2 => 'forum',\n 3 => 'forums',\n 4 => 'board',\n 5 => 'boards',\n 6 => 'upload',\n 7 => 'uploads',\n 8 => '../forums',\n 9 => '../forum',\n 10 => '../boards',\n 11 => '../board',\n 12 => '../mybb',\n 13 => '../upload',\n 14 => '../uploads',\n 15 => '../themes',\n 16 => '../theme',\n 17 => '../main'\n );\n }", "public function requestPaths() {\n\t\treturn array(\n\t\t\tarray('homepage', 'homepage'),\n\t\t\tarray('homepage.html', 'homepage'),\n\t\t\tarray('homepage/subpage.html', 'homepage/subpage'),\n\t\t\tarray('homepage/subpage.rss.xml', 'homepage/subpage')\n\t\t);\n\t}", "public function get_navigation_scheme() : array {\n\t\tglobal $post;\n\t\t$front_page_id = get_option( 'page_on_front' );\n\t\t$breadcrumbs = [];\n\n\t\tif ( is_front_page() ) {\n\t\t\tarray_push( $breadcrumbs, [\n\t\t\t\t'title' => esc_html( get_the_title() ),\n\t\t\t\t'permalink' => null,\n\t\t\t] );\n\t\t} else {\n\t\t\tarray_push( $breadcrumbs, [\n\t\t\t\t'title' => esc_html( get_the_title( $front_page_id ) ),\n\t\t\t\t'permalink' => esc_url( home_url( '/' ) ),\n\t\t\t]);\n\n\t\t\tif ( $post->ancestors ) {\n\t\t\t\tforeach ( array_reverse( $post->ancestors ) as $parent ) {\n\n\t\t\t\t\tif ( (int) $front_page_id === $parent ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push( $breadcrumbs, [\n\t\t\t\t\t\t'title' => esc_html( get_the_title( $parent ) ),\n\t\t\t\t\t\t'permalink' => get_page_link( $parent ),\n\t\t\t\t\t] );\n\t\t\t\t}\n\t\t\t} elseif ( $post->parent ) {\n\t\t\t\tarray_push( $breadcrumbs, [\n\t\t\t\t\t'title' => esc_html( get_the_title( $post->parent ) ),\n\t\t\t\t\t'permalink' => get_page_link( $post->parent ),\n\t\t\t\t] );\n\t\t\t}\n\n\t\t\tarray_push($breadcrumbs, [\n\t\t\t\t'title' => esc_html( get_the_title() ),\n\t\t\t\t'permalink' => null,\n\t\t\t]);\n\t\t}\n\n\t\treturn $breadcrumbs;\n\t}", "public static function getAllSegments()\n {\n $segments = explode('/', trim(parse_url(self::$__uri)['path'], '/'));\n array_unshift($segments, 'zero_segment');\n return $segments;\n }", "public function getFrontPageUrl();", "static public function getUrlArray()\n {\n \tstatic $url_array = NULL;\n \tif( is_null( $url_array ) ) {\n\t\t\t$url_array = explode( '/', ltrim( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ), '/' ) );\n\t\t\tforeach( $url_array as &$url_part ) {\n\t\t\t\t$url_part = ( $url_part !== \"\" ) ? strtolower( $url_part ) : \"index\";\n\t\t\t}\n\t\t}\n\t\treturn $url_array;\n }", "public function getPagePath();", "public function getUrlOptions()\n {\n $allPages = Page::sortBy('baseFileName')->lists('title', 'baseFileName');\n $pages = array(\n '' => 'No page link'\n );\n foreach ($allPages as $key => $value) {\n $pages[$key] = \"$key\";\n }\n return $pages;\n }", "public function getFrontPath()\n {\n // we use trim() instead of empty() on string elements\n // to allow for string-zero values.\n return (empty($this->path) ? '' : $this->_pathEncode($this->path))\n . (trim($this->format) === '' ? '' : '.' . urlencode($this->format));\n }", "private function getPages()\n {\n $directory = __DIR__.'/Page/';\n // remove .. and . folder in unix\n $pageFolders = array_diff(scandir($directory), array('..', '.'));\n\n return $pageFolders;\n }", "function data() {\n\t\t return array(\n\t\t\t // Check against an odd redirect\n\t\t\t array( '/page/2/', '/page/2/' ),\n\t\t\t array( '/?page=2', '/page/2/' ),\n\t\t\t array( '/page/1/', '/' ),\n\t\t\t array( '/?page=1', '/' ),\n\n\t\t\t // The page designated as the front page should redirect to the front of the site\n\t\t\t array( '/front-page/', '/' ),\n\t\t\t array( '/front-page/2/', '/page/2/' ),\n\t\t\t array( '/front-page/?page=2', '/page/2/' ),\n\t\t\t array( '/blog-page/?paged=2', '/blog-page/page/2/' ),\n\t\t );\n\t}", "function getNavs() {\n\t$pageData = getPageData();\n\t$li = '';\n\tforeach($pageData as $k => $v) {\n\t\t$li .= '<li><a href=\"' . COVER_PAGE . '?show=' . $k .'\">' . $k . '</a></li>' . \"\\n\";\n\t}\n\treturn $li;\n}", "public function getPathList() {\n \n $path_list = '';\n foreach($this->_path as $path) {\n $path_list .= '<li>' . $path . '</li>'; \n }\n\n return $path_list;\n }", "public function getHandledPaths();", "public function getActivePaths(): array\n {\n return $this->activePaths;\n }", "public function getActivePaths()\n {\n return $this->activePaths;\n }", "public function get_url_list() {\n\t\t$home_no_www = str_replace( '://www.', '://', get_option( 'home' ) );\n\t\t$home_yes_www = str_replace( '://', '://www.', $home_no_www );\n\n\t\t// Build the search links.\n\t\t$search = array(\n\t\t\tstr_replace( 'https://', 'http://', $home_yes_www ),\n\t\t\tstr_replace( 'https://', 'http://', $home_no_www ),\n\t\t\t\"src='http://\",\n\t\t\t'src=\"http://',\n\t\t);\n\n\t\treturn array(\n\t\t\t'search' => $search, // The search links.\n\t\t\t'replace' => str_replace( 'http://', 'https://', $search ), // The replace links.\n\t\t);\n\t}", "public function getFrontPageUrl()\n {\n return $this->_frontPageUrl;\n }", "private function _getRequestPaths()\n {\n $paths = array();\n \n // Find maxPages with the ceil of the total properties / the maximum\n // pageSize\n $maxPages = ceil($this->getTotal() / $this->getMaxPageSize());\n \n // Use plus one as the first page will have already be requested\n for ($i = $this->getPage() + 1; $i <= $maxPages; $i++) {\n $paths[] = $this->getRequestPath($i, $this->getMaxPageSize());\n }\n \n return $paths;\n }", "public function get_paths()\n\t{\n\t\tif ( ! ee()->session->cache(__CLASS__, 'paths'))\n\t\t{\n\t\t\t$paths = array();\n\t\t\t$upload_prefs = $this->get_file_upload_preferences(NULL, NULL, TRUE);\n\n\t\t\tif (count($upload_prefs) == 0)\n\t\t\t{\n\t\t\t\treturn $paths;\n\t\t\t}\n\n\t\t\tforeach ($upload_prefs as $row)\n\t\t\t{\n\t\t\t\t$paths[$row['id']] = $row['url'];\n\t\t\t}\n\n\t\t\tee()->session->set_cache(__CLASS__, 'paths', $paths);\n\t\t}\n\n\t\treturn ee()->session->cache(__CLASS__, 'paths');\n\t}", "protected function getSearchPaths() {}", "public function getAllPaths(): array\n {\n return [\n 'all_users_profile' => $this->getAllUsersProfilePath(),\n 'app_data' => $this->getAppDataPath(),\n 'com_spec' => $this->getComSpecPath(),\n 'common_program_files' => $this->getCommonProgramFilesPath(),\n 'common_program_files_x86' => $this->getCommonProgramFilesX86Path(),\n 'driver_data' => $this->getDriverDataPath(),\n 'home_drive' => $this->getHomeDrivePath(),\n 'home' => $this->getHomePath(),\n 'local_app_data' => $this->getLocalAppDataPath(),\n 'logon_server' => $this->getLogonServerPath(),\n 'one_drive' => $this->getOneDrivePath(),\n 'path' => $this->getPath(),\n 'program_data' => $this->getProgramDataPath(),\n 'program_files' => $this->getProgramFilesPath(),\n 'program_files_x86' => $this->getProgramFilesX86Path(),\n 'public' => $this->getPublicPath(),\n 'system_drive' => $this->getSystemDrivePath(),\n 'system_root' => $this->getSystemRootPath(),\n 'temp' => $this->getTempPath(),\n 'user_profile' => $this->getUserProfilePath(),\n 'win_dir' => $this->getWindirPath(),\n ];\n }", "function get_home_path()\n {\n }", "public function getHomepageAllowableValues()\n {\n return [\n self::HOMEPAGE_WALL,\n self::HOMEPAGE_FORUM,\n self::HOMEPAGE_ALLIANCEFORUM,\n ];\n }", "function front_end_home () {\n $request_url = parse_url($_SERVER['HTTP_REFERER']);\n return str_replace($request_url['path'], '', $_SERVER['HTTP_REFERER']);\n}", "function admin_getPathway( $back = 0 )\n{\n\t$pathway = '';\n\n\tglobal $g_admin_pathway;\n\n\t/*\n\t * Default behaviour\n\t * -----------------\n\t * This function is called by a script wich is required from the \"backend\"\n\t * The variable $g_admin_pathway have been initialized in the main admin script : '/admin/index.php'\n\t */\n\tif (isset($g_admin_pathway))\n\t{\n\t\tif ($back < 0) {\n\t\t\t$back *= -1; # $back is strictly >= 0\n\t\t}\n\n\t\t$steps = count($g_admin_pathway);\n\t\tif ($back < $steps)\n\t\t{\n\t\t\t$pathway = '?'.$g_admin_pathway[0]['url'];\n\n\t\t\tfor ($i=1; $i<$steps-$back; $i++) {\n\t\t\t\t$pathway .= '&amp;'.$g_admin_pathway[$i]['url'];\n\t\t\t}\n\t\t}\n\t}\n\t/*\n\t * Special behaviour (to allow the loading of backend scripts in frontend)\n\t * -----------------\n\t * This function is called by a script wich is required from the \"frontend\"\n\t * In frontend the variable $g_admin_pathway should never be initialized !\n\t */\n\telse\n\t{\n\t\tif ($_SERVER['QUERY_STRING']) {\n\t\t\t$pathway = '?'.$_SERVER['QUERY_STRING'];\n\t\t}\n\t}\n\n\treturn $pathway;\n}", "final public function get_paths() {\n return array();\n }", "public function getFrontUrl()\n {\n if ($this->front !== null) {\n return $this->front;\n } else {\n return $this->server;\n }\n }", "public function getPageUris();", "public static function optsRoute()\n {\n return \\Yii::$app->getModule('pages')->availableRoutes;\n }", "public function getPaths();", "public function getUrlsList()\n {\n $instanceName = MoufManager::getMoufManager()->findInstanceName($this);\n\n $route = new SplashRoute($this->url, $instanceName, \"action\", null, null);\n\n return array($route);\n }", "public static final function paths()\n {\n\treturn self::$_paths;\n }", "public static function getFallbackRootPages()\n {\n return \\Database::getInstance()->prepare(\"SELECT * FROM tl_page WHERE published = 1 AND fallback = 1 \")\n ->execute($strDns);\n }", "public function get_site_frontpage(){\r\n $command = sprintf(\"%s/%s\", $this->path, 'vset site_frontpage node');\r\n return $this->exec([$command, false]); \r\n }", "abstract protected function paths();", "public static function segments() {\n static $segments = null;\n\n if (is_null($segments)) {\n if (isset($_SERVER['PATH_INFO'])) {\n $segments = explode('/', trim($_SERVER['PATH_INFO'], '/'));\n } else {\n $segments = array();\n }\n\n // assign default values to segments\n $index = 0;\n if (USE_NAMESPACE) {\n $segments[$index] = Arrays::get($segments, $index, DEFAULT_NAMESPACE);\n $index++;\n }\n $segments[$index] = Arrays::get($segments, $index, DEFAULT_MODEL);\n $index++;\n $segments[$index] = Arrays::get($segments, $index, DEFAULT_VIEW);\n }\n\n return $segments;\n }", "private static function get_paths($view_path){\n\t\tif(substr($view_path, -1) != \"/\") $view_path.=\"/\";\n\t\t$check = strpos($view_path, \"?\");\n\t\tif(strpos($view_path, substr(DEFAULT_DIR, 1))){\n\t\t\tif($check != false) $path = explode(\"/\", substr($view_path, strlen(DEFAULT_DIR)+1, $check-1));\n\t\t\telse $path = explode(\"/\", substr($view_path, strlen(DEFAULT_DIR)+1));\n\t\t}else{\n\t\t\tif($check != false) $path = explode(\"/\", substr($view_path, 1, $check-1));\n\t\t\telse $path = explode(\"/\", substr($view_path, 1));\n\t\t}\n\t\t$path = flexMVC::filter_params($path);\n\t\tflexMVC::$params = $path;\n\t\treturn $path;\n\t}", "public function get_template_paths() {\n\n\t\t$theme_directory = trailingslashit( apply_filters( 'rocketgalleries_theme_template_directory', '' ) );\n\n\t\t$file_paths = array(\n\t\t\t10 => trailingslashit( get_template_directory() ) . $theme_directory,\n\t\t\t100 => $this->get_templates_dir()\n\t\t);\n\n\t\t// Only add this conditionally, so non-child themes don't redundantly check active theme twice.\n\t\tif ( is_child_theme() ) {\n\t\t\t$file_paths[1] = trailingslashit( get_stylesheet_directory() ) . $theme_directory;\n\t\t}\n\n\t\t// Allow ordered list of template paths to be amended\n\t\t$file_paths = apply_filters( 'rocketgalleries_template_paths', $file_paths );\n\n\t\t// Sort the file paths based on priority\n\t\tksort( $file_paths, SORT_NUMERIC );\n\n\t\treturn array_map( 'trailingslashit', $file_paths );\n\n\t}", "protected function get_template_paths() {\n\t\t$theme_directory = trailingslashit( $this->theme_template_directory );\n\n\t\t$file_paths = array(\n\t\t\t10 => trailingslashit( get_template_directory() ) . $theme_directory,\n\t\t\t100 => $this->get_templates_dir(),\n\t\t);\n\n\t\t// Only add this conditionally, so non-child themes don't redundantly check active theme twice.\n\t\tif ( is_child_theme() ) {\n\t\t\t$file_paths[1] = trailingslashit( get_stylesheet_directory() ) . $theme_directory;\n\t\t}\n\n\t\t/**\n\t\t * Allow ordered list of template paths to be amended.\n\t\t */\n\t\t$file_paths = apply_filters( $this->filter_prefix . '_template_paths', $file_paths );\n\n\t\t// sort the file paths based on priority\n\t\tksort( $file_paths, SORT_NUMERIC );\n\n\t\treturn array_map( 'trailingslashit', $file_paths );\n\t}", "protected function get() : array\n {\n $barra = explode('/', $_SERVER[\"REQUEST_URI\"]);\n\n array_shift($barra);\n\n return $barra;\n }", "function qa_page_routing()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn array(\n\t\t'account' => 'pages/account.php',\n\t\t'activity/' => 'pages/activity.php',\n\t\t'admin/' => 'pages/admin/admin-default.php',\n\t\t'admin/approve' => 'pages/admin/admin-approve.php',\n\t\t'admin/categories' => 'pages/admin/admin-categories.php',\n\t\t'admin/flagged' => 'pages/admin/admin-flagged.php',\n\t\t'admin/hidden' => 'pages/admin/admin-hidden.php',\n\t\t'admin/layoutwidgets' => 'pages/admin/admin-widgets.php',\n\t\t'admin/moderate' => 'pages/admin/admin-moderate.php',\n\t\t'admin/pages' => 'pages/admin/admin-pages.php',\n\t\t'admin/plugins' => 'pages/admin/admin-plugins.php',\n\t\t'admin/points' => 'pages/admin/admin-points.php',\n\t\t'admin/recalc' => 'pages/admin/admin-recalc.php',\n\t\t'admin/stats' => 'pages/admin/admin-stats.php',\n\t\t'admin/userfields' => 'pages/admin/admin-userfields.php',\n\t\t'admin/usertitles' => 'pages/admin/admin-usertitles.php',\n\t\t'answers/' => 'pages/answers.php',\n\t\t'ask' => 'pages/ask.php',\n\t\t'categories/' => 'pages/categories.php',\n\t\t'comments/' => 'pages/comments.php',\n\t\t'confirm' => 'pages/confirm.php',\n\t\t'favorites' => 'pages/favorites.php',\n\t\t'favorites/questions' => 'pages/favorites-list.php',\n\t\t'favorites/users' => 'pages/favorites-list.php',\n\t\t'favorites/tags' => 'pages/favorites-list.php',\n\t\t'feedback' => 'pages/feedback.php',\n\t\t'forgot' => 'pages/forgot.php',\n\t\t'hot/' => 'pages/hot.php',\n\t\t'ip/' => 'pages/ip.php',\n\t\t'login' => 'pages/login.php',\n\t\t'logout' => 'pages/logout.php',\n\t\t'messages/' => 'pages/messages.php',\n\t\t'message/' => 'pages/message.php',\n\t\t'questions/' => 'pages/questions.php',\n\t\t'register' => 'pages/register.php',\n\t\t'reset' => 'pages/reset.php',\n\t\t'search' => 'pages/search.php',\n\t\t'tag/' => 'pages/tag.php',\n\t\t'tags' => 'pages/tags.php',\n\t\t'unanswered/' => 'pages/unanswered.php',\n\t\t'unsubscribe' => 'pages/unsubscribe.php',\n\t\t'updates' => 'pages/updates.php',\n\t\t'user/' => 'pages/user.php',\n\t\t'users' => 'pages/users.php',\n\t\t'users/blocked' => 'pages/users-blocked.php',\n\t\t'users/new' => 'pages/users-newest.php',\n\t\t'users/special' => 'pages/users-special.php',\n\t);\n}", "protected function _getDefaultLandingPath()\n {\n return '/';\n }", "protected function getMainControllers()\n {\n $controllers = array();\n $front_controllers = Dispatcher::getControllers(_PS_FRONT_CONTROLLER_DIR_);\n $controllers['subpages'] = 'subpages';\n\n foreach (array_keys($front_controllers) as $key) {\n $controllers[$key] = $key;\n }\n\n return $controllers;\n }", "public function getRoutesDefinition()\n {\n $lang = Environment::getConfig('lang');\n\n $routeList = new RouteList();\n $routeList[] = $frontRouter = new RouteList('Front');\n $frontRouter[] = new Route(\"[<locale={$lang} sk|hu|cs>/]<presenter>/<action>[/<id>]\", array(\n 'presenter' => array(\n Route::VALUE => 'Homepage',\n Route::FILTER_TABLE => array(\n 'testovaci' => 'Test',\n// 'presmerovano' => 'TestRedirect',\n ),\n ),\n 'action' => array(\n Route::VALUE => 'default',\n Route::FILTER_TABLE => array(\n 'operace-ok' => 'operationSuccess',\n ),\n ),\n 'id' => null,\n 'locale' => [\n Route::FILTER_TABLE => [\n 'cz' => 'cs',\n 'sk' => 'sk',\n 'pl' => 'pl',\n 'com' => 'en'\n ]]\n ));\n return $routeList;\n\n }", "public function getPaths()\n {\n return array_map(function (ScriptBranch $branch) {\n return $branch->getPath();\n }, $this->descriptorMap);\n }", "protected static function getPathsInternal() {}", "function findPageUrls();", "public function getPageFolders();", "private function getExposedRoutes() : array\n {\n $routes = [];\n $routeCollection = $this->router->getRouteCollection();\n\n foreach ($routeCollection as $name => $route) {\n if ($route->hasOption('sitemap') === true\n && $route->getOption('sitemap') === true\n ) {\n $routes[] = $name;\n }\n }\n\n return $routes;\n }", "function get_pages_images_list() {\n\t$files = scandir(BASEPATH . \"/../public/images/pages\");\n\tarray_shift($files); // remove \".\"\n\tarray_shift($files); // remove \"..\"\n\treturn $files;\n}", "public function get_scan_urls() {\r\n\t\t// Calculate URLs to Check.\r\n\t\t$args = array(\r\n\t\t\t'orderby' => 'rand',\r\n\t\t\t'posts_per_page' => '1',\r\n\t\t\t'ignore_sticky_posts' => true,\r\n\t\t\t'post_status' => 'publish',\r\n\t\t);\r\n\r\n\t\t$urls = array();\r\n\r\n\t\t$urls[] = home_url();\r\n\r\n\t\t$post_types = get_post_types();\r\n\t\t$post_types = array_diff( $post_types, array( 'attachment', 'nav_menu_item', 'revision' ) );\r\n\r\n\t\tforeach ( $post_types as $post_type ) {\r\n\t\t\t$args['post_type'] = $post_type;\r\n\t\t\t$posts = get_posts( $args );\r\n\t\t\tif ( $posts ) {\r\n\t\t\t\t$urls[] = get_permalink( $posts[0] );\r\n\t\t\t}\r\n\r\n\t\t\t$archive_link = get_post_type_archive_link( $post_type );\r\n\t\t\tif ( $archive_link ) {\r\n\t\t\t\t$urls[] = $archive_link;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$post = get_post( get_option( 'page_for_posts' ) );\r\n\t\tif ( get_option( 'show_on_front' ) && $post ) {\r\n\t\t\t$urls[] = get_permalink( $post->ID );\r\n\t\t}\r\n\r\n\t\t$urls = array_unique( $urls );\r\n\r\n\t\t$urls_list = array();\r\n\t\t// Duplicate every URL 3 times. This will be enough to generate all the files for most of the sites.\r\n\t\tfor ( $i = 0; $i < 3; $i++ ) {\r\n\t\t\t$urls_list = array_merge( $urls_list, $urls );\r\n\t\t}\r\n\r\n\t\tsort( $urls_list );\r\n\t\treturn $urls_list;\r\n\t}", "protected function navigations(): iterable\n {\n return [\n Menu::make('Basic Elements')\n ->route('platform.example.fields'),\n\n Menu::make('Advanced Elements')\n ->route('platform.example.advanced'),\n\n Menu::make('Text Editors')\n ->route('platform.example.editors'),\n\n Menu::make('Run Actions')\n ->route('platform.example.actions'),\n ];\n }", "private static function splitPath_getPath($page) /* WARNING: maybe we can simplify this fonction as dots are probably not used anymore */\r\n\t{\r\n\t\tif( ! strstr($page, '.') )\r\n\t\t\treturn Array($page, \"$page/\");\r\n\t\treturn Array(str_replace('.', '/', $page), '');\r\n\t}", "public function fetchPath()\n {\n $path = array();\n foreach ($this->forumNode()->fetchPath() as $item)\n {\n $path[] = array(\n 'url' => $item->urlAlias(),\n 'text' => $item->Name\n );\n }\n \n $path[] = array(\n 'url' => $this->forumNode()->urlAlias(),\n 'text' => $this->forumNode()->Name\n );\n \n $path[] = array(\n 'url' => $this->urlAlias(),\n 'text' => $this->attribute('name')\n );\n \n return $path;\n }", "protected function get_active_plugins_paths() {\n\t\t$plugin_slugs = (array) get_option( 'active_plugins', array() );\n\t\t$plugin_slugs = array_filter( $plugin_slugs, array( $this, 'is_directory_plugin' ) );\n\t\treturn array_map( array( $this, 'create_plugin_path' ), $plugin_slugs );\n\t}", "function get_home_front_page_url() {\r\n\r\n\t$front_page_ID = get_option( 'page_on_front' );\r\n\t$front_page_template = get_post_meta( $front_page_ID, '_wp_page_template', true );\r\n\tif ( $front_page_template === 'template-home.php' ) { // If front page uses Home template\r\n\t\treturn get_permalink( $front_page_ID ); // retrun url of front page\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n\r\n}", "public function getAvailablePaths()\n {\n $paths = [];\n $datasources = array_reverse($this->datasources);\n foreach ($datasources as $datasource) {\n $paths = array_merge($paths, $datasource->getAvailablePaths());\n }\n return $paths;\n }", "public function getPathParts()\n {\n if (empty($this->path)) {\n $this->path = $this->composeDefaultPath();\n }\n if (is_array($this->path)) {\n return $this->path;\n }\n return explode('.', $this->path);\n }", "public function GetCombinedSegments() {\n\n $Out= array();\n $Segments= explode('/', ltrim($this->UrlParts['path'], '/'));\n $Segments= array_slice($Segments, $this->PathPrefixSegments);\n $xMax= count($Segments);\n for($x= 0; $x < $xMax; $x= $x+2) {\n $Out[$Segments[$x]]= isset($Segments[$x+1]) ? $Segments[$x+1] : null;\n }\n return $Out;\n }", "protected function _default_segments()\n\t{\n\t\t// Check for default controller\n\t\tif (empty($this->default_controller))\n\t\t{\n\t\t\t// Return empty array\n\t\t\treturn array();\n\t\t}\n\n\t\t// Break out default controller\n\t\t$default = explode('/', $this->default_controller);\n\t\tif ( ! isset($default[1]))\n\t\t{\n\t\t\t// Add default method\n\t\t\t$default[] = 'index';\n\t\t}\n\n\t\treturn $default;\n\t}", "public function getFirstPageUrl();", "protected function getPathSite() {}", "protected function getPathSite() {}", "function getUrlInfo()\n{\n $url = \"{$_SERVER['REQUEST_URI']}\";\n $url = htmlspecialchars( $url, ENT_QUOTES, 'UTF-8' );\n $parse = parse_url($url);\n $url = rtrim($parse['path'], '/');\n $url = strtolower($url);\n $filtered = array_filter(explode('/', $url));\n $filtered = array_values($filtered);\n return $filtered;\n}", "public function getBreadCrumb()\n {\n $oContent = $this->getContent();\n\n $aPaths = array();\n $aPath = array();\n\n $aPath['title'] = $oContent->oxcontents__oxtitle->value;\n $aPath['link'] = $this->getLink();\n $aPaths[] = $aPath;\n\n return $aPaths;\n }", "public function ancestorsNames()\n {\n $ancestors = explode('/', array_get($this->route, 'path'));\n\n if (empty($ancestors)) {\n return null;\n }\n\n array_pop($ancestors);\n\n return array_map('ucfirst', $ancestors);\n }", "private function _getActiveElements()\n {\n $elements = array();\n $segments = craft()->request->getSegments();\n\n // Add homepage\n $element = craft()->elements->getElementByUri('__home__');\n if ($element) {\n $elements[] = $element;\n }\n\n // Find other elements\n if (count($segments)) {\n $count = 0; // Start at second\n $segmentString = $segments[0]; // Add first\n while ($count < count($segments)) {\n // Get element\n $element = craft()->elements->getElementByUri($segmentString);\n\n // Add element to active elements\n if ($element) {\n $elements[] = $element;\n }\n\n // Search for next possible element\n $count ++;\n if (isset($segments[$count])) {\n $segmentString .= '/' . $segments[$count];\n }\n }\n }\n return $elements;\n }", "function retrieve_path_values($css_list)\n{\n $path_list = array_map('_get_path_values',$css_list);\n return $path_list;\n}", "public static function all()\n\t{\n\t\treturn Route::$_routes + Kohana::$tree['routes']['external'];\n\t}", "function ajan_core_get_site_path() {\n\tglobal $current_site;\n\n\tif ( is_multisite() )\n\t\t$site_path = $current_site->path;\n\telse {\n\t\t$site_path = (array) explode( '/', home_url() );\n\n\t\tif ( count( $site_path ) < 2 )\n\t\t\t$site_path = '/';\n\t\telse {\n\t\t\t// Unset the first three segments (http(s)://domain.com part)\n\t\t\tunset( $site_path[0] );\n\t\t\tunset( $site_path[1] );\n\t\t\tunset( $site_path[2] );\n\n\t\t\tif ( !count( $site_path ) )\n\t\t\t\t$site_path = '/';\n\t\t\telse\n\t\t\t\t$site_path = '/' . implode( '/', $site_path ) . '/';\n\t\t}\n\t}\n\n\treturn apply_filters( 'ajan_core_get_site_path', $site_path );\n}", "public static function paths() {\n\t\tif (is_null(static::$paths)) {\n\t\t\tstatic::$paths = new ApplicationPathProvider();\n\t\t}\n\n\t\treturn static::$paths;\n\t}", "public function get_paths() {\n return array(new convert_path('question_categories', '/MOODLE_BACKUP/QUESTION_CATEGORIES'));\n }", "public function urlSegments() {\n\t\treturn $this->urlSegments; \n\t}", "protected function _checkPath()\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'check that path is given on error or normal page',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $path = array();\n\n if ($this->_get) {\n $path[0] = $this->_get->path();\n $path[1] = $this->_get->path(TRUE);\n } else {\n $path[0] = $path[1] = get::realPath($this->_options['test']);\n }\n\n return $path;\n }", "public function getSearchPaths()\n {\n return $this->searchPaths;\n }", "function get_wp_home_path()\n {\n // Ensure get_home_path is available\n if ( ! function_exists( 'get_home_path' ) )\n require_once( ABSPATH . 'wp-admin/includes/file.php' );\n return apply_filters(\n 'home_path',\n function_exists( 'get_home_path' )\n ? apply_filters( 'get_home_path', get_home_path() )\n : preg_replace(\n apply_filters( 'wpmvc_home_path_regex_rule', '/wp-content[\\s\\S]+/' ),\n apply_filters( 'wpmvc_home_path_regex_replacement', '' ),\n __DIR__\n )\n );\n }", "public static function homeList()\r\n\t{\r\n\t\t// reset the value of _rawData\r\n\t\tself::$_rawData = array();\r\n\t\t// gets the full list of declared classes\r\n\t\tself::$_declaredClasses = get_declared_classes();\r\n\t\t// reset the value of _alreadyIncluded\r\n\t\tself::$_alreadyIncluded = array();\r\n\t\t// extracts the controller data of the controllers that are part of the core web application\r\n\t\tself::extractControllers('application.controllers', false, 'homeList');\r\n\t\t// extracts the controller and module data of the controllers that belong to a module\r\n\t\tself::extractControllers('application.modules.*.controllers', true, 'homeList');\r\n\t\treturn self::$_rawData;\r\n\t}", "public function getPaths(): array\n {\n $templatePaths = [];\n\n $paths = $this->blade->getFinder()->getPaths();\n $hints = $this->blade->getFinder()->getHints();\n\n foreach ($paths as $path) {\n $templatePaths[] = new TemplatePath($path);\n }\n foreach ($hints as $namespace => $paths) {\n foreach ($paths as $path) {\n $templatePaths[] = new TemplatePath($path, $namespace);\n }\n }\n\n return array_reverse($templatePaths);\n }", "function get_nav_menu_locations()\n {\n }", "public function getPreferencePaths()\n {\n return $this->getHelper()->getPreferences($this);\n }", "public function setInitialPaths() {}", "public function getBreadCrumb()\n {\n $aPaths = array();\n $aPath = array();\n $iBaseLanguage = oxRegistry::getLang()->getBaseLanguage();\n $sSelfLink = $this->getViewConfig()->getSelfLink();\n\n $aPath['title'] = oxRegistry::getLang()->translateString('MY_ACCOUNT', $iBaseLanguage, false);\n $aPath['link'] = oxRegistry::get(\"oxSeoEncoder\")->getStaticUrl($sSelfLink . 'cl=account');\n $aPaths[] = $aPath;\n\n $aPath['title'] = oxRegistry::getLang()->translateString('ORDER_HISTORY', $iBaseLanguage, false);\n $aPath['link'] = $this->getLink();\n $aPaths[] = $aPath;\n\n return $aPaths;\n }", "public function routes(): array\n {\n $language = $this->language;\n $kirby = $language->kirby();\n $routes = $kirby->routes();\n\n // only keep the scoped language routes\n $routes = array_values(array_filter($routes, function ($route) use ($language) {\n\n // no language scope\n if (empty($route['language']) === true) {\n return false;\n }\n\n // wildcard\n if ($route['language'] === '*') {\n return true;\n }\n\n // get all applicable languages\n $languages = Str::split(strtolower($route['language']), '|');\n\n // validate the language\n return in_array($language->code(), $languages) === true;\n }));\n\n // add the page-scope if necessary\n foreach ($routes as $index => $route) {\n if ($pageId = ($route['page'] ?? null)) {\n if ($page = $kirby->page($pageId)) {\n\n // convert string patterns to arrays\n $patterns = A::wrap($route['pattern']);\n\n // prefix all patterns with the page slug\n $patterns = array_map(function ($pattern) use ($page, $language) {\n return $page->uri($language) . '/' . $pattern;\n }, $patterns);\n\n // reinject the pattern and the full page object\n $routes[$index]['pattern'] = $patterns;\n $routes[$index]['page'] = $page;\n } else {\n throw new NotFoundException('The page \"' . $pageId . '\" does not exist');\n }\n }\n }\n\n return $routes;\n }", "function get_css_files() {\n\t$csslist = array();\n\n\t// List pfSense files, then any BETA files followed by any user-contributed files\n\t$cssfiles = glob(\"/usr/local/www/css/*.css\");\n\n\tif (is_array($cssfiles)) {\n\t\tarsort($cssfiles);\n\t\t$usrcss = $pfscss = $betacss = array();\n\n\t\tforeach ($cssfiles as $css) {\n\t\t\t// Don't display any login/logo page related CSS files\n\t\t\tif (strpos($css, \"login\") == 0 &&\n\t\t\t strpos($css, \"logo\") == 0) {\n\t\t\t\tif (strpos($css, \"BETA\") != 0) {\n\t\t\t\t\tarray_push($betacss, $css);\n\t\t\t\t} else if (strpos($css, \"pfSense\") != 0) {\n\t\t\t\t\tarray_push($pfscss, $css);\n\t\t\t\t} else {\n\t\t\t\t\tarray_push($usrcss, $css);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$css = array_merge($pfscss, $betacss, $usrcss);\n\n\t\tforeach ($css as $file) {\n\t\t\t$file = basename($file);\n\t\t\t$csslist[$file] = pathinfo($file, PATHINFO_FILENAME);\n\t\t}\n\t}\n\treturn $csslist;\n}", "public function prevPage(): array\n {\n return $this->prev()->getPage();\n }", "function pageList(){\n\t\t$path = ROOT . DS . 'pages';\n\t\t$pagesArray = array_diff(scandir($path), array('..', '.', '.svn','.htaccess'));\n\n\t\tforeach ($pagesArray as $page) {\n\t\t\t$tmp[basename($page)] = filemtime($page);\n\t\t}\n\t\tasort($tmp);\n\t\t$pagesArray = array_keys($tmp);\n\n\t\t// sorting by date can be added but name wise listing pages seems more pleasing.\n\t\t// later add extra sort-by-date option.\n\t\treturn $pagesArray;\n\t}", "public static function getPages(): ?array\n {\n return collect(Filament::getPages())\n ->filter(function ($page) {\n if (Utils::isGeneralExcludeEnabled()) {\n return ! in_array(Str::afterLast($page, '\\\\'), Utils::getExcludedPages());\n }\n\n return true;\n })\n ->reduce(function ($pages, $page) {\n $prepend = Str::of(Utils::getPagePermissionPrefix())->append('_');\n $name = Str::of(class_basename($page))\n ->prepend($prepend);\n\n $pages[\"{$name}\"] = \"{$name}\";\n\n return $pages;\n }, collect())\n ->toArray();\n }", "public function getPathSegments () {\n return $this->pathSegments;\n }", "protected function getIndexBreadcrumbs()\n {\n return [];\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/google_search.php',\n 'lang_custom/EN/google_search.ini',\n 'sources_custom/blocks/side_google_search.php',\n 'sources_custom/blocks/main_google_results.php',\n 'themes/default/templates_custom/BLOCK_SIDE_GOOGLE_SEARCH.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_GOOGLE_SEARCH_RESULTS.tpl',\n 'themes/default/css_custom/google_search.css',\n 'pages/comcode_custom/EN/_google_search.txt',\n );\n }", "public static function get_registered_nav_menu_locations()\n {\n }", "function listAllPages() {\n $PAGES_PATH = $_SERVER['DOCUMENT_ROOT'] . '/pages';\n //Ignore '.', '..', and '.gitkeep' in the returned directory array:\n $files = array_diff(scandir($PAGES_PATH), array('.', '..', '.gitkeep'));\n\n //ignore if there are no pages\n if ($files) {\n foreach($files as $file) {\n $pageName = substr($file, 0, strrpos($file, \".\"));\n echo '<li class=\"pages-menu-item\"><a href=\"/pages/' . $pageName . '.php\" id=\"pages-menu-' . $pageName . '\" style=\"text-decoration: none; color: #FFFFFF;\">' . $pageName . '</a></li>';\n }\n }\n }", "protected function getExcludedURLSegments()\n {\n $excludes = [];\n\n // Build from rules\n foreach (Director::config()->get('rules') as $pattern => $rule) {\n $route = explode('/', $pattern ?? '');\n if (!empty($route) && strpos($route[0] ?? '', '$') === false) {\n $excludes[] = strtolower($route[0] ?? '');\n }\n }\n\n // Build from base folders\n foreach (glob(Director::publicFolder() . '/*', GLOB_ONLYDIR) as $folder) {\n $excludes[] = strtolower(basename($folder ?? ''));\n }\n\n $this->extend('updateExcludedURLSegments', $excludes);\n return $excludes;\n }", "public function getShowInHome();", "private function findPaths() {\n\t\tif(ini_get('open_basedir')) {\n\t\t\t$searchPath = explode(PATH_SEPARATOR, ini_get('open_basedir'));\n\t\t\t$dirs = array();\n\t\t\tforeach ($searchPath as $path) {\n\t\t\t\t// Silencing against https://bugs.php.net/69240\n\t\t\t\tif(@is_dir($path)) $dirs[] = $path;\n\t\t\t}\n\t\t} else {\n\t\t\t$dirs = array_merge(\n\t\t\t\texplode(PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')),\n\t\t\t\t$this->optimizersExtraPaths\n\t\t\t);\n\t\t\treturn implode(PATH_SEPARATOR . ' ', array_filter($dirs));\n\t\t}\n\t}", "public function getPageUrlOptions()\n {\n $currentTheme = Theme::getEditTheme();\n $allThemePages = Page::listInTheme($currentTheme, true);\n $options = [];\n foreach ($allThemePages as $p){\n $options['url='.$p->url.'&type=cms_pages'] = $p->title;\n }\n\n $tree = StaticPageClass::buildMenuTree($currentTheme); \n foreach ($tree as $key => $page){\n if(isset($page['title']) && isset($page['url'])){\n $options['url='.$page['url'].'&type=pages_plugin'] = $page['title'];\n }\n }\n return $options;\n }", "public function getParts()\n {\n if (empty($this->parts)) {\n $this->parts = $this->getUrlArguments();\n if (empty($this->parts)) {\n $this->parts = array('index');\n }\n else if (reset($this->parts) == 'api') {\n array_shift($this->parts);\n }\n }\n return $this->parts;\n }", "public function get_all_active_plugins_paths() {\n\t\tglobal $jetpack_autoloader_activating_plugins_paths;\n\n\t\t$active_plugins_paths = $this->get_active_plugins_paths();\n\t\t$multisite_plugins_paths = $this->get_multisite_plugins_paths();\n\t\t$activating_plugins_paths = $this->get_plugins_activating_via_request();\n\n\t\treturn array_unique(\n\t\t\tarray_merge(\n\t\t\t\t$active_plugins_paths,\n\t\t\t\t$activating_plugins_paths,\n\t\t\t\t$multisite_plugins_paths,\n\t\t\t\t(array) $jetpack_autoloader_activating_plugins_paths\n\t\t\t)\n\t\t);\n\t}" ]
[ "0.6351442", "0.61262155", "0.6075716", "0.57314897", "0.5729852", "0.5623523", "0.55784607", "0.5528506", "0.55015844", "0.54849386", "0.53984845", "0.5364132", "0.5343629", "0.5320566", "0.52925247", "0.5271854", "0.52415264", "0.5225874", "0.5223749", "0.52025664", "0.5199446", "0.5195602", "0.51755595", "0.5158822", "0.5144175", "0.51355577", "0.51051706", "0.5103452", "0.5096476", "0.50910974", "0.5069939", "0.50683284", "0.5065603", "0.50569695", "0.50407773", "0.504064", "0.50322604", "0.50305575", "0.5028723", "0.5016135", "0.50062996", "0.4974562", "0.49648112", "0.49605832", "0.49545515", "0.49519765", "0.4949295", "0.49471673", "0.4943941", "0.49325243", "0.49280888", "0.4923293", "0.4919541", "0.49095652", "0.48988956", "0.48978806", "0.48837644", "0.48774642", "0.48749536", "0.4872232", "0.48716494", "0.4871529", "0.48554912", "0.48504472", "0.48504472", "0.4847217", "0.48459747", "0.48455533", "0.48425254", "0.48373377", "0.48280978", "0.48212728", "0.48159876", "0.4810829", "0.48055038", "0.4805226", "0.48041922", "0.479934", "0.4793923", "0.4790759", "0.47906336", "0.47899118", "0.4784169", "0.47840896", "0.4773418", "0.47694382", "0.47631943", "0.47614136", "0.47564256", "0.47528583", "0.4752777", "0.47485915", "0.47475418", "0.47405848", "0.47400227", "0.47333986", "0.4732275", "0.47180903", "0.4715405", "0.47140214" ]
0.6752886
0
Returns TRUE when passed breadcrumb is empty. "Empty" here means there are no items between "Home" (or breadcrumb start) and current tab root menu item.
function _taxonomy_menu_trails_menu_breadcrumb_is_empty($active_trail) { if (empty($active_trail)) { return TRUE; } // Skip first item if it has homepage href. $first_item = reset($active_trail); $frontpage_hrefs = _taxonomy_menu_trails_homepage_paths(); if (in_array($first_item['href'], $frontpage_hrefs)) { array_shift($active_trail); } // Look into the next item (if any) and check if it has current tab root href. $next_item = reset($active_trail); if (empty($next_item)) { return TRUE; } $menu_item = menu_get_item(); if ($next_item['href'] == $menu_item['tab_root_href']) { return TRUE; } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function isHome(): bool\n {\n if (! $this->context->get('is_entry')) {\n return false;\n }\n\n if (! $this->context->get('page')) {\n return false;\n }\n\n return $this->context->get('parent') === null;\n }", "function tc_is_home_empty() {\r\n //check if the users has choosen the \"no posts or page\" option for home page\r\n return ( (is_home() || is_front_page() ) && 'nothing' == get_option( 'show_on_front' ) ) ? true : false;\r\n }", "public function is_empty() {\n\t\treturn (\n\t\t\t! isset( $this->root )\n\t\t\t|| ! $this->root->hasChildNodes()\n\t\t);\n\t}", "public function getIsHomePage()\n {\n return $this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true));\n }", "public function getIsHomePage()\n {\n return $this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true));\n }", "public function isBreadcrumbNotonrootpage()\r\n\t{\r\n\t\treturn $this->breadcrumbNotonrootpage;\r\n\t}", "public function isEmpty()\n {\n return $this->head == null;\n }", "public function isEmpty()\r\n {\r\n return count($this->childs) > 0 ? false : true;\r\n }", "private function has_children() {\n return !empty($this->menuitems);\n }", "public function isBreadcrumbBottom()\r\n\t{\r\n\t\treturn $this->breadcrumbBottom;\r\n\t}", "public function isHomePage() {\n return $this->uri === $this->kirby->options['home'];\n }", "public function isEmpty() {\r\n\t\treturn count($this->stack) == 0;\r\n\t}", "function shIsCurrentPageHome()\n{\n\t$currentPage = Sh404sefHelperUrl::sortUrl(\n\t\tShlSystem_Strings::pr('/(&|\\?)lang=[a-zA-Z]{2,3}/iu', '', empty($_SERVER['QUERY_STRING']) ? '' : $_SERVER['QUERY_STRING'])); // V 1.2.4.t\n\t$currentPage = JString::ltrim(str_replace('index.php', '', $currentPage), '/');\n\t$currentPage = JString::ltrim($currentPage, '?');\n\t$shHomePage = ShlSystem_Strings::pr('/(&|\\?)lang=[a-zA-Z]{2,3}/iu', '', Sh404sefFactory::getPageInfo()->homeLink);\n\t$shHomePage = JString::ltrim(str_replace('index.php', '', $shHomePage), '/');\n\t$shHomePage = JString::ltrim($shHomePage, '?');\n\treturn $currentPage == $shHomePage;\n}", "function tc_is_home() {\r\n \r\n //get info whether the front page is a list of last posts or a page\r\n return ( (is_home() && ( 'posts' == get_option( 'show_on_front' ) || 'nothing' == get_option( 'show_on_front' ) ) ) || is_front_page() ) ? true : false;\r\n }", "public function is_empty() {\n return ($this->count == 0);\n }", "function empty()\n {\n return count($this->items) == 0;\n }", "function isEmpty()\n {\n return $this->head == $this->tail;\n }", "public function isEmpty()\n {\n \treturn 0 == $this->getItemCount();\n }", "public function isEmpty() {\n\n\t\treturn (count($this->search) < 1) ? true : false;\n\n\t}", "public function isEmpty(): bool\n {\n return $this->getLeft()->isEqualTo($this->getRight());\n }", "public function isBreadcrumbEnable()\r\n\t{\r\n\t\treturn $this->breadcrumbEnable;\r\n\t}", "function isEmpty() {\n return $this->front==$this->rear;\n }", "public function isEmpty()\n\t{\n\t\treturn empty($this->stack);\n\t}", "private function add_breadcrumbs() {\n\t\tif ( is_front_page() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->context->breadcrumbs_enabled ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isEmpty()\n {\n return empty($this->stack);\n }", "public function isEmpty()\n {\n return empty($this->stack);\n }", "public function is_empty() {\n\t\treturn 0 === count( $this->get_cart() );\n\t}", "public function isEmpty() {\n return empty($this->stack);\n }", "function isLeaf()\r\n\t\t{\r\n\t\t\t//a node is a leaf if it doesn't have a less pointer and none\r\n\t\t\t//of its elements have child pointers\r\n\t\t\t\r\n\t\t\tif ($this->less != null)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach ($this->elements as $element)\r\n\t\t\t{\r\n\t\t\t\tif ($element->link != null)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "public function isEmpty()\n {\n if(empty($this->items))\n \t{\n \t\t//empty\n \t\treturn false;\n \t}\n }", "public function isEmpty()\n {\n return ($this->shelfs[0]->count() == 0) ? true : false;\n }", "public function isEmpty(): bool {\n return empty($this->items);\n }", "public function isEmpty(): bool\n {\n return empty($this->items);\n }", "public function isEmpty(): bool\n {\n return empty($this->items);\n }", "public function isEmpty()\n {\n if($this->front==-1 && $this->rear==-1){\n return true;\n }\n else{\n return false;\n }\n }", "final public function empty(): bool\n {\n return count($this->elements) === 0;\n }", "final public function hasChildren(): bool\n {\n return $this->valid() && $this->current()->hasPages();\n }", "function is_empty($path) \n {\n \n $files = $this->files($path,'.',false,array());\n $folders = $this->folders($path);\n \n if ((count($files) + count($folders)) < 1) {\n return true;\n }\n return false;\n }", "public function is_leaf()\n {\n return ( ! $this->has_children());\n }", "public function isLeaf()\r\n {\r\n return null === $this->children[static::POSITION_LEFT]\r\n && null === $this->children[static::POSITION_RIGHT];\r\n }", "public function isEmpty() : bool\n {\n return empty($this->items);\n }", "public function isEmpty()\n\t{\n\t\treturn $this->count === 0;\n\t}", "public function isEmpty()\n {\n return $this->count() === 0;\n }", "public function is_home()\n {\n }", "public function hasChildren()\n {\n return $this->children->count() == 0 ? false : true;\n }", "protected function breadcrumbTest() {\n // Breadcrumb should show Keywords: orange > Type: article, item.\n $initial_query = ['search_api_fulltext' => 'foo', 'test_param' => 1];\n $this->drupalGet('search-api-test-fulltext', ['query' => $initial_query]);\n\n $this->clickLink('item');\n $this->assertSession()->linkExists('Type: item');\n\n $this->clickLink('article');\n $this->assertSession()->linkExists('Type: article, item');\n\n $this->clickLink('orange');\n $this->assertSession()->linkExists('Keywords: orange');\n $this->assertSession()->linkExists('Type: article, item');\n\n $this->clickLink('Type: article, item');\n\n $this->assertSession()->linkExists('Keywords: orange');\n $this->assertSession()->linkExists('Type: article, item');\n $this->checkFacetIsActive('orange');\n $this->checkFacetIsActive('item');\n $this->checkFacetIsActive('article');\n\n $this->clickLink('Keywords: orange');\n $this->assertSession()->linkExists('Keywords: orange');\n $this->assertSession()->linkNotExists('Type: article, item');\n $this->checkFacetIsActive('orange');\n $this->checkFacetIsNotActive('item');\n $this->checkFacetIsNotActive('article');\n\n // Check that the current url still has the initial parameters.\n $curr_url = UrlHelper::parse($this->getUrl());\n foreach ($initial_query as $key => $value) {\n $this->assertArrayHasKey($key, $curr_url['query']);\n $this->assertEquals($value, $curr_url['query'][$key]);\n }\n }", "public function isEmpty()\n {\n return count($this->index) == 0;\n }", "public function hasChildren()\n\t{\n\t\treturn ! $this->current()->isLeaf();\n\t}", "function is_empty() {\n\t\treturn !$this->count();\n\t}", "public function isEmpty(): bool\n\t{\n\t\treturn $this->count() === 0;\n\t}", "public function isHomePage()\n\t{\n\t\treturn $this->home_page;\n\t}", "public function isEmpty(): bool\n {\n return $this->count() === 0;\n }", "public function isEmpty(): bool\n {\n return $this->count() === 0;\n }", "public function isEmpty(): bool\n {\n return $this->count() === 0;\n }", "public function isEmpty(): bool {\n return $this->size() === 0;\n }", "public function isEmpty() {\n return $this->size() == 0;\n }", "public function isEmpty() {\n\t\treturn ($this->count === 0);\n\t}", "protected function check_empty_node_in_alt($alt) {\n foreach ($alt->operands as $operand) {\n if ($operand->type == qtype_preg_node::TYPE_LEAF_META\n && $operand->subtype == qtype_preg_leaf_meta::SUBTYPE_EMPTY) {\n return true;\n }\n }\n return false;\n }", "public function hasChildren()\n {\n return !empty($this->children);\n }", "public function isEmpty(): bool\n {\n return\n null === $this->exclude\n && empty($this->items)\n && empty($this->actions);\n }", "public function is_empty(){\r\n\t\treturn $this->size==0;\r\n\t}", "public function hasChildren() : bool\n {\n return $this->children->isNotEmpty();\n }", "public function isRoot()\n {\n // return (empty($this->{$this->getTreeColumn('parent')})) ? true : false;\n return $this->{$this->getTreeColumn('path')} === $this->getKey() . '/'\n && $this->{$this->getTreeColumn('level')} === 0;\n }", "public function hasChildren()\n\t{\n\t\treturn !empty($this->children);\n\t}", "public function isEmpty()\r\n\t{\r\n\t\treturn ( 0 === $this->count() );\r\n\t}", "public function hasMenuActiveItem()\n {\n return $this->activeItem !== null;\n }", "public function isEmpty()\n {\n return $this->length === 0;\n }", "public function is_home();", "public function isEmpty()\n {\n return ($this->count() === 0);\n }", "public function isEmpty()\n {\n if ( !empty( $this->cartItems ) )\n {\n return false;\n }\n return true;\n }", "public function isEmpty(): bool\n {\n return 0 === $this->count();\n }", "function isEmpty() {\r\n return empty($this->list);\r\n }", "public function isEmpty()\n {\n return empty($this->items);\n }", "public function isEmpty()\n {\n return empty($this->items);\n }", "public function isEmpty()\r\n {\r\n return isset($this->data['total']) AND $this->data['total'] == '0';\r\n }", "function isEmpty() {\n if($this->rear==-1&&$this->front==-1){\n\n return true;\n }else{\n\n return false;\n }\n\n }", "public function isEmpty() {\n\n $isEmpty =\n empty($this->get('cta_text')->getValue()) &&\n empty($this->get('cta_link')->getValue());\n\n return $isEmpty;\n }", "public function isNotEmpty() : bool\n {\n return !empty($this->items);\n }", "public function hasChildren() {\n\t\treturn $this->children()->count() > 0;\n\t}", "public function isEmpty() {\n return empty($this->items);\n }", "public function isEmpty()\n\t{\n\t\treturn count( $this ) < 1;\n\t}", "public function isEmpty(): bool\n {\n return ($this->count() === 0);\n }", "public function isEmpty()\n {\n return ($this->size == 0);\n }", "public function isEmpty() {\n return (0 == $this->size());\n }", "public function isEmpty()\n\t{\n\t\treturn (empty($this->title)\n\t\t\t\t&& empty($this->body)\n\t\t\t\t&& is_null($this->sub_alert));\n\t}", "public function hasItems() {\n foreach ($this->items as $item) {\n if ($item === self::SEPARATOR) {\n continue;\n }\n if ($item instanceof MenuItem) {\n return true;\n }\n if ($item->hasItems()) {\n return true;\n }\n }\n\n return false;\n }", "public function isEmpty()\n {\n return ($this->count() == 0);\n }", "public function isEmpty() {\n return $this->getLength() == 0;\n }", "public function anyHistory() {\n return $this->getHistoryCount() !== 0;\n }", "public function getIsEmpty():bool\n\t{\n\t\treturn empty($this->stackArray);\n\t}", "public function hasChildren() \n {\n return count($this->children) > 0;\n }", "public function isEmpty(): bool\n {\n return [] === $this->periods;\n }", "public function empty() : bool\n {\n return empty($this->container());\n }", "function isEmpty(){\n\t\tif($this->first==null) return true;\n\t\telse return false;\n\t}", "public function isEmpty(): bool\n {\n return $this->actions->isEmpty();\n }", "public function isEmpty(): bool\n {\n return 0 === $this->size;\n }", "public function hasChildren()\n {\n return (null !== $this->children) && count($this->children);\n }", "public function hasChildren(): bool\n {\n return $this->children()->count() > 0;\n }", "public function is_empty()\n\t\t{\n\t\t\tif ($this->is_cached()) {\n\t\t\t\treturn !is_null($this->content);\n\t\t\t}\n\n\t\t\tif ($this->exists() || $this->saved) {\n\t\t\t\treturn $this->size() <= 0;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "public function hasUnlistedChildren(): bool\n {\n return $this->children()->unlisted()->count() > 0;\n }" ]
[ "0.6678801", "0.6439316", "0.6400061", "0.63234127", "0.63234127", "0.6230286", "0.6209764", "0.62023747", "0.61009765", "0.60344565", "0.59969705", "0.59475785", "0.590761", "0.58932424", "0.5879672", "0.583803", "0.58277655", "0.5791052", "0.57815015", "0.5762014", "0.57507145", "0.57481945", "0.5745921", "0.57382435", "0.57358885", "0.57358885", "0.5721616", "0.5717945", "0.5686026", "0.5685052", "0.5678038", "0.5676989", "0.5671027", "0.5671027", "0.5664959", "0.56520253", "0.5640621", "0.5637293", "0.5636627", "0.563208", "0.5615357", "0.5613698", "0.5612988", "0.5606104", "0.56040174", "0.5601122", "0.55967593", "0.5596276", "0.5585359", "0.55840397", "0.5577369", "0.55638486", "0.55638486", "0.55638486", "0.55506015", "0.5546946", "0.55459744", "0.5545809", "0.5538553", "0.5537338", "0.5536234", "0.5531515", "0.552495", "0.552035", "0.5508489", "0.5507092", "0.5504444", "0.54945207", "0.54901", "0.5486105", "0.5485364", "0.5476986", "0.547493", "0.547493", "0.5469044", "0.54670656", "0.5466869", "0.54628384", "0.5462561", "0.54580355", "0.5455916", "0.54554313", "0.5452693", "0.5452475", "0.5448364", "0.54473877", "0.54441077", "0.5440292", "0.54368657", "0.5426468", "0.5426131", "0.5416855", "0.54015857", "0.5401304", "0.5398784", "0.5387996", "0.5385533", "0.53743064", "0.53720933", "0.53718877" ]
0.74815893
0
Listen to the queue.
public function listen(): void { $receive = function () { each($this->receiveMessages(), $this->parseAndConsumeMessage()); }; $this->settings->beforeReceive($receive); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listen()\n {\n $this->open();\n $callback = function(AMQPMessage $message) {\n $job = $this->unserialize($message->body);\n if ($this->getQueue()->run($job)) {\n $message->delivery_info['channel']->basic_ack($message->delivery_info['delivery_tag']);\n }\n };\n $this->_channel->basic_qos(null, 1, null);\n $this->_channel->basic_consume($this->queueName, '', false, false, false, false, $callback);\n while(count($this->_channel->callbacks)) {\n $this->_channel->wait();\n }\n }", "public function listen(): void\n {\n $this->logger->debug('Start listening to the queue.');\n $handler = function (MessageInterface $message) {\n $this->worker->process($message, $this);\n };\n\n $this->driver->subscribe($handler);\n $this->logger->debug('Finish listening to the queue.');\n }", "public function listen($queueName);", "public function listen()\n {\n $this->openWorker();\n while (!Signal::isExit()) {\n if (($payload = $this->pop(3)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n }\n $this->closeWorker();\n }", "public function listen();", "public function listen()\n {\n $this->log->addInfo('Begin listen routine');\n \n $connection = new AMQPConnection('localhost', 5672, 'guest', 'guest');\n $channel = $connection->channel();\n \n $channel->queue_declare(\n 'invoice_queue', #queue\n false, #passive\n true, #durable, make sure that RabbitMQ will never lose our queue if a crash occurs\n false, #exclusive - queues may only be accessed by the current connection\n false #auto delete - the queue is deleted when all consumers have finished using it\n );\n \n /**\n * don't dispatch a new message to a worker until it has processed and \n * acknowledged the previous one. Instead, it will dispatch it to the \n * next worker that is not still busy.\n */\n $channel->basic_qos(\n null, #prefetch size - prefetch window size in octets, null meaning \"no specific limit\"\n 1, #prefetch count - prefetch window in terms of whole messages\n null #global - global=null to mean that the QoS settings should apply per-consumer, global=true to mean that the QoS settings should apply per-channel\n );\n \n /**\n * indicate interest in consuming messages from a particular queue. When they do \n * so, we say that they register a consumer or, simply put, subscribe to a queue.\n * Each consumer (subscription) has an identifier called a consumer tag\n */ \n $channel->basic_consume(\n 'invoice_queue', #queue\n '', #consumer tag - Identifier for the consumer, valid within the current channel. just string\n false, #no local - TRUE: the server will not send messages to the connection that published them\n false, #no ack, false - acks turned on, true - off. send a proper acknowledgment from the worker, once we're done with a task\n false, #exclusive - queues may only be accessed by the current connection\n false, #no wait - TRUE: the server will not respond to the method. The client should not wait for a reply method\n array($this, 'process') #callback\n );\n \n $this->log->addInfo('Consuming from queue');\n \n while(count($channel->callbacks)) {\n $this->log->addInfo('Waiting for incoming messages');\n $channel->wait();\n }\n \n $channel->close();\n $connection->close();\n }", "protected function listen()\n {\n do {\n $data = fgets($this->socket, 512);\n if (!empty($data)) {\n $request = $this->receive($data);\n $cmd = strtolower($request->getCommand());\n\n if ($cmd === 'privmsg') {\n $event_name = 'message.' . ($request->isPrivateMessage() ? 'private' : 'channel');\n } else {\n $event_name = 'server.' . $cmd;\n }\n\n // Skip processing if the incoming message is from the bot\n if ($request->getSendingUser() === $this->config['nick']) {\n continue;\n }\n\n $event = new Event($request);\n $this->dispatcher->dispatch($event_name, $event);\n $responses = $event->getResponses();\n\n if (!empty($responses)) {\n $this->send($responses);\n }\n }\n } while (!feof($this->socket));\n }", "public function listen($args, $assoc_args = array())\n {\n global $wp_queue;\n\n $worker = new WP_Worker($wp_queue);\n\n WP_CLI::log('Listening for queue jobs...');\n\n while (true) {\n if ($worker->should_run()) {\n if ($worker->process_next_job()) {\n WP_CLI::success('Processed: ' . $worker->get_job_name());\n sleep(1);\n }\n } else {\n sleep(5);\n }\n }\n }", "public function startListening();", "public function listen() {\n $this->source->listen($this->id);\n }", "public function handle()\n {\n MessagingAmqpService::declareSysQueues();\n ExchangeService::bindAllExchanges();\n MessagingAmqpService::listen(\n config('amqp.log_queue'),\n [ MessageService::class, 'consumeLog' ]\n );\n }", "public function listen(): bool;", "public function handle()\n {\n $mqManager = app(MQManager::class);\n\n try {\n $mqManager->listen();\n } catch (IncorrectQueueFormatException $e) {\n $this->info($e->getMessage() . ' - closing MQ connection');\n die();\n }\n\n $this->info('MQ Manager is listening for messages');\n }", "protected function listen()\n {\n // Set time limit to indefinite execution\n set_time_limit (0);\n\n $this->socket = socket_create(\n AF_INET,\n SOCK_DGRAM,\n SOL_UDP\n );\n\n if (!is_resource($this->socket))\n {\n $this->logger->log(\"Failed to create a socket for the discovery server. The reason was: \" .\n socket_strerror(socket_last_error()));\n }\n\n if (!@socket_bind(\n $this->socket,\n $this->config->getSetting('discovery-address'),\n $this->config->getSetting('discovery-port')))\n {\n $this->logger->log(\"Failed to bind to socket while initialising the discovery server.\");\n }\n\n // enter an infinite loop, waiting for data\n $data = '';\n while (true)\n {\n if (@socket_recv($this->socket, $data, 9999, MSG_WAITALL))\n {\n $this->logger->log(\"Discovery server received the following: $data\");\n\n $this->handleMessage($data);\n }\n }\n }", "public function listen($listener);", "public function handle()\n {\n echo \"Running telegram messages listener...\\n\";\n\n\n while (true) {\n $offset = $this->getPreviousUpdateID();\n $this->processMessages($offset);\n sleep(1);\n }\n }", "public function receive(): void\n {\n $connection = $this->getConnection();\n $node = $connection->getCurrentNode();\n\n do {\n $this->_run($node);\n } while (\n false === $connection->isDisconnected() &&\n true !== $node->isMessageComplete()\n );\n }", "public static function listen() {\n $projectId = \"sunday-1601040613995\";\n\n # Instantiates a client\n $pubsub = new PubSubClient([\n 'projectId' => $projectId\n ]);\n\n # The name for the new topic\n $topicName = 'gmail';\n\n # Creates the new topic\n $topic = $pubsub->createTopic($topicName);\n\n echo 'Topic ' . $topic->name() . ' created.';\n }", "private function listenSocket() {\n $result = socket_listen($this->listeningSocket);\n $this->checkResult($result);\n }", "public function run()\n {\n $this->router->listen();\n }", "public function run(): void\n {\n $this->logger->debug('Start processing queue messages.');\n $count = 0;\n\n while ($this->loop->canContinue() && $message = $this->driver->nextMessage()) {\n $this->worker->process($message, $this);\n $count++;\n }\n\n $this->logger->debug(\n 'Finish processing queue messages. There were {count} messages to work with.',\n ['count' => $count]\n );\n }", "public function run()\n {\n $this->openWorker();\n while (($payload = $this->pop(0)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n $this->closeWorker();\n }", "public function listenTo($file);", "public function Run()\n\t{\n\t\t$q1 = new AMQPQueue($this->cnn);\n\t\t$q1->declare('queue1');\n\t\t$q1->purge('queue1');\n\t\t\n\t\t$options = array(\n\t\t 'min' => 0,\n\t\t 'max' => 10,\n\t\t 'ack' => true\n\t\t);\n\n\t\t// Bind it on the exchange to routing.key\n\t\t$q1->bind(\\Constant\\AMQPChannelConstant::AMF, \\Constant\\AMQPCommand::BingoBroadcast);\n\t\t\n\t\t// Read from the queue\n\t\twhile (TRUE)\n\t\t{\n\t\t\t$msg = $q1->consume($options);\n\n\t\t\tvar_dump($msg);\n\t\t}\n\t}", "function listen()\n {\n $method = strtoupper($_SERVER['REQUEST_METHOD']);\n $path = trim($_SERVER['REQUEST_URI']);\n\n print $this->match_and_exec($method, $path);\n }", "public function processQueue ()\n {\n $lastRestartTime = $this->getLastRestartTime();\n $app = Application::getInstance();\n\n while ( true ) {\n //check if the code is updated in between the run time\n $this->needsRestart($lastRestartTime);\n\n //check if the system is down for maintenance\n if ( $app->isDownForMaintenance() ) continue;\n\n //get all pending events for the period\n $events = $this->getPendingEvents();\n\n foreach ( $events as $event ) {\n $event->start_time = DateUtil::getDateTime();\n\n //no event is registered for the given record\n $handler = $event->event_detail;\n if ( !$handler ) {\n $this->saveEvent($event);\n continue;\n }\n\n //set event to broadcast of its event\n event(new EventQueueRaised($event));\n\n //process the job mentioned with the event\n $this->dispatchEventJob($event);\n\n //dispatch notification if any attached to the event\n $this->dispatchNotificationJob($event);\n\n //save the given event with necessary datetime params\n $this->saveEvent($event);\n }\n\n //check if the program has to sleep or not\n if ( !sizeof($events) ) $this->rest();\n\n Cache::forever($this->identifier, false);\n }\n }", "public function runQueue();", "public function handle()\n {\n //\n $connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest', '/');\n\n $channel = $connection->channel();\n\n $channel->exchange_declare('ex1', 'direct', false, true, false, false, false);\n\n $channel->queue_declare('queue1', false, true, false, false);\n\n $channel->queue_bind('queue1', 'ex1', 'routingkey1');\n\n $msg = new AMQPMessage('Hello World!', ['delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT, 'content_type' => 'text/plain']);\n\n $wait = true;\n $returnListener = function (\n $replyCode,\n $replyText,\n $exchange,\n $routingKey,\n $message\n ) use ($wait) {\n $GLOBALS['wait'] = false;\n echo \"return: \",\n $replyCode, \"\\n\",\n $replyText, \"\\n\",\n $exchange, \"\\n\",\n $routingKey, \"\\n\",\n $message->body, \"\\n\";\n };\n\n // 监听没有成功路由到队列的消息\n $channel->set_return_listener($returnListener);\n\n $channel->basic_publish($msg, 'ex1', 'routingkey123', true, false);\n\n while ($wait) {\n $channel->wait();\n }\n\n $channel->close();\n\n $connection->close();\n }", "public function handle()\n {\n $this->info(\"start listening rabbitmq\");\n $this->listenPerson();\n $this->info(\"finish listening rabbitmq\");\n }", "public function listen(Message $message, Command $command);", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "public function handle()\n {\n Log::info('Command check is que working called');\n event(new CheckIsQueWorkingEvent());\n Log::info('Command check is que working finished');\n }", "public function handle()\n {\n \n while (true) {\n \n $loop = ReactEventLoopFactory::create();\n\n $client = new SlackRealTimeClient($loop);\n $client->setToken(config('services.slack.token'));\n\n // disconnect after first message\n $client->on('message', function ($data) use ($client) {\n //echo \"Someone typed a message: \".$data['text'].\"\\n\";\n //print_r($data);\n //$client->disconnect();\n \n if($data['type'] == 'message'){\n \n if(!isset($data['text'])) return;\n if(isset($data['username']) && $data['username'] == 'bot') return;\n\n print_r($data);\n\n if(substr($data['channel'], 0, 1) == 'D'){\n //If it's a DM, treat it as a search query\n echo \"Direct Message: \";\n print_r($data);\n }elseif(!isset($data['user'])){\n $this->error('No valid user. Previous event not saved');\n Log::debug('No valid user. Previous event not saved');\n }else{\n //Insert new message to DB\n $message = new Messages;\n $message->message = $data['text'];\n $message->user = $data['user'];\n $message->channel = $data['channel'];\n $message->ts = convert_timestamp($data['ts']);\n $message->save();\n\n $message->addToIndex(); //add to ES Index\n }\n\n\n }//END IF DATA TYPE CHECK\n $client->disconnect();\n\n });\n\n $client->connect()->then(function () {\n echo \"Connected!\\n\";\n });\n\n $loop->run();\n\n }//END WHILE INF\n }", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "public function isListening ()\r\n\t\t{\r\n\t\t\t\treturn $this -> currentState == self :: STATE_LISTENING;\r\n\t\t}", "public function listen()\n\t{\n\t\t$uri = $_REQUEST['uri'] ?? '';\n\t\t$uri = trim($uri, '/\\^$');\n\t\t$replacementValues = array();\n\n\t\t// List through the stored URI's\n\t\tforeach ($this->urls as $step => $url)\n\t\t{\n\t\t\t// See if there is a match\n\t\t\tif (preg_match(\"#^$url$#\", $uri))\n\t\t\t{\n\t\t\t\t// Replace the values\n\t\t\t\t$realUri = explode('/', $uri);\n\t\t\t\t$fakeUri = explode('/', $url);\n\n\t\t\t\t// Gather the .+ values with the real values in the URI\n\t\t\t\tforeach ($fakeUri as $key => $value) {\n\t\t\t\t\tif ($value == '.+')\t$replacementValues[] = $realUri[$key];\n\t\t\t\t}\n\n\t\t\t\t// Pass an array for arguments\n\t\t\t\tcall_user_func_array($this->functions[$step], $replacementValues);\n\t\t\t\texit;\n\t\t\t}\n\n\t\t} // End of Loop\n\n\t}", "public function isListening(): bool\n {\n return $this->listening;\n }", "protected function listenForSignals()\n {\n pcntl_async_signals(true);\n\n pcntl_signal(SIGTERM, function () {\n $this->shouldQuit = true;\n });\n\n pcntl_signal(SIGUSR2, function () {\n $this->paused = true;\n });\n\n pcntl_signal(SIGCONT, function () {\n $this->paused = false;\n });\n }", "public function handle()\n {\n $this->laravel->bind(RedisSubscribe::class,$this->handler);\n $instance = $this->laravel->make(RedisSubscribe::class);\n\n while(true) {\n $value = Redis::brpop($this->channel, 0);\n\n $channel = $value[0];\n $data = $value[1];\n\n $instance->reset();\n $instance->setData($channel,json_decode($data,true));\n $instance->handle();\n }\n }", "public function looping($callback)\n {\n $this->app['events']->listen('custom.queue.looping', $callback);\n }", "public function handle()\n {\n $queue = 'fila_teste';\n $job = (new TestJob())->onQueue($queue);\n dispatch($job);\n }", "public function listener()\n {\n /** @var \\Illuminate\\Redis\\Connections\\PhpRedisConnection|\\Illuminate\\Redis\\Connections\\PredisConnection $connection */\n $connection = Redis::connection($this->connection());\n\n register_shutdown_function(function () use ($connection) {\n $connection->disconnect();\n abort(200);\n });\n\n return response()->stream(function () use ($connection) {\n\n // Send the message with a retry timer\n $this->message()->retry($this->timeRetry())->send();\n\n // If the Last-Event-Id header is set, restore the connection with the last message id.\n if (request()->hasHeader('Last-Event-Id')) {\n $this->restore(request()->header('Last-Event-Id'));\n }\n\n // Listen for new messages\n $connection->subscribe([$this->channel()], fn (string $message) => $this->handler($message));\n\n }, Response::HTTP_OK, $this->headers());\n }", "public function handle()\n {\n $this->getStream('client')->handle(new TimeoutTimer($this->delay/4));\n $this->getStream('workerHandler')->handle(new TimeoutTimer($this->delay/4));\n $this->handleWorkerHandlerQueue();\n $this->getStream('workerHandlerStatus')->handle(new TimeoutTimer($this->delay/4));\n $this->handleExpired();\n $this->handleExpiredWorkerHandlers();\n }", "public function handle()\n {\n $websocketServer = new WebSocketServer();\n $websocketServer->start();\n }", "public function run()\n {\n $timeout = $this->_options[self::OPT_TIMEOUT];\n Streamwide_Engine_Logger::info( 'Going to main loop' );\n \n for ( ; ; ) {\n // Fetch a new signal from the SW Engine's queue\n $signal = Streamwide_Engine_Signal::dequeue( array( 'timeout' => $timeout ) );\n if ( false === $signal ) {\n continue;\n }\n \n // Update the loggers event items\n Streamwide_Engine_Logger::updateLogEventItems( array( $signal->getPhpId() => $signal->getParams() ) );\n // Log the received signal\n Streamwide_Engine_Logger::dump( $signal->toArray(), 'Received event from SW Engine:' );\n \n if ( $signal->getName() === Streamwide_Engine_Signal::CREATE ) {\n // We have received a CREATE (new call), we need to create a new application to handle\n // the call\n if ( false === ( $application = $this->_createNewApplication( $signal ) ) ) {\n continue;\n }\n \n // Add the new application to the controller's running apps storage (will call\n // the application's start method)\n $this->addApp( $signal->getPhpId(), $application );\n } else {\n // We have received a signal from SW Engine, we need to notify the listeners\n $event = new Streamwide_Engine_Events_Event( $signal->getName() );\n $event->setParam( 'signal', $signal );\n $this->dispatchEvent( $event );\n }\n }\n }", "public function handle()\n {\n\t //创建server\n $server = new \\swoole_websocket_server(\"0.0.0.0\" , 9501);\n\n\t $server->on(\"open\" , function(Server $server , $request){\n//\t\t $this->info($request->fd . \"连接成功\");\n\t\t echo $request->fd . \"连接成功\";\n\t });\n\n\t $server->on(\"message\" , function(Server $server , $request){\n\t\t $msg = $request->data;\n\n\t\t foreach($server->connections as $fd){\n\t\t\t $server->push($fd , $msg);\n\t\t }\n\t });\n\n\t $server->on(\"close\" , function(Server $server , $request){\n//\t\t $this->info($request->fd . \"断开连接\");\n\t\t echo $request->fd . \"断开连接\";\n\t });\n\n\t $server->start();\n }", "public function fire() {\n $loop = \\React\\EventLoop\\Factory::create();\n\n if (config('wamp.enablePush')) {\n $this->enablePush($loop);\n }\n\n // Set up our WebSocket server for clients wanting real-time updates\n $webSock = new \\React\\Socket\\Server($loop);\n $webSock->listen($this->option('port'), '0.0.0.0'); // Binding to 0.0.0.0 means remotes can connect\n new \\Ratchet\\Server\\IoServer(/**/\n new \\Ratchet\\Http\\HttpServer(/**/\n new \\Ratchet\\WebSocket\\WsServer(/**/\n new \\Ratchet\\Wamp\\WampServer(/**/\n $this->wamp))), $webSock);\n\n if (config('wamp.allowFlash')) {\n $this->allowFlash($loop);\n }\n\n Event::fire('wamp.start');\n\n /**\n * heartbeat\n */\n if (config('wamp.enableHeartbeat', false)) {\n $loop->addPeriodicTimer(config('wamp.heartbeatInterval', 5), function () {\n /**\n * TODO zombie/half connections check goes here\n */\n /**\n * send heart to clients\n */\n WAMPServer::publish(config('wamp.heartbeatTopic', 'heartbeat'), ['heartbeat']);\n });\n }\n\n $this->info('Listening on port ' . $this->option('port') . ' zmq port ' . config('wamp.zmqPort'));\n $loop->run();\n }", "public static function listen() {\n\t\tif ( filter_has_var( INPUT_GET, 'xml_notification' ) || filter_has_var( INPUT_GET, 'xml_notifaction' ) ) {\n\t\t\t$data = file_get_contents( 'php://input' );\n\n\t\t\t$xml = Pronamic_WP_Util::simplexml_load_string( $data );\n\n\t\t\tif ( ! is_wp_error( $xml ) ) {\n\t\t\t\t$notification = Pronamic_WP_Pay_Gateways_IDealBasic_XML_NotificationParser::parse( $xml );\n\n\t\t\t\t$purchase_id = $notification->get_purchase_id();\n\n\t\t\t\t$payment = get_pronamic_payment_by_meta( '_pronamic_payment_purchase_id', $purchase_id );\n\n\t\t\t\tif ( $payment ) {\n\t\t\t\t\t$payment->set_transaction_id( $notification->get_transaction_id() );\n\t\t\t\t\t$payment->set_status( $notification->get_status() );\n\n\t\t\t\t\tPronamic_WP_Pay_Plugin::update_payment( $payment );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function startMessageConsumer()\n {\n $this->process->start();\n }", "public function start()\n {\n $this->server->on(\"open\", [$this, 'wsOpen']);\n $this->server->on(\"message\", [$this, 'wsMessage']);\n $this->server->on(\"close\", [$this, 'wsClose']);\n\n $this->server->start();\n }", "function startQueue(){\n\n // Maintain the array checkLogQ as a FIFO buffer with length 4.\n // When a new entry is added, remove oldest entry and shuffle.\n function addCheckLog($message){\n global $checkLogQ;\n $length = 4;\n // If checkLogQ size is smaller than 4 add the message\n if(count($checkLogQ)<$length){\n $checkLogQ[] = $message;\n }\n // If checkLogQ size is bigger than 4 - Remove the oldest message and add the new one\n else{\n array_shift($checkLogQ);\n $checkLogQ[] = $message;\n }\n }\n // Prints all checkLogQ messages to the console \n function printCheckLogQ(){\n global $checkLogQ;\n foreach($checkLogQ as $message){\n print($message);\n }\n $checkLogQ = array(); // reset a variable to an empty array\n }\n \n try{\n while(true){\n addCheckLog(date('Y/m/d H:i:s').\" Awaiting a message...\\n\");\n\n // Receive messages from queue, maximum waits for 20 seconds for message\n // receive_request - contain all the queue messages\n global $sqs;\n $receive_request = $sqs->receiveMessage(array(\n 'QueueUrl' => ds_config(\"QUEUE_URL\"),\n 'WaitTimeSeconds' => 20,\n 'MaxNumberOfMessages' => 10\n ));\n // Count the amount of messages received\n $msgCount = 0;\n if($receive_request->getPath('Messages') !== NULL){\n $msgCount = count($receive_request->getPath('Messages'));\n }\n addCheckLog(date('Y/m/d H:i:s').\" found $msgCount message(s)\\n\");\n // If at least one message has been received\n if ($msgCount!=0) {\n printCheckLogQ();\n foreach ($receive_request->getPath('Messages') as $msg) {\n messageHandle($msg, $receive_request);\n }\n }\n }\n }\n catch (Exception $e) {\n printCheckLogQ();\n print(date('Y/m/d H:i:s').\" Queue receive error: $e\");\n sleep(5);\n global $restart;\n $restart = true;\n }\n }", "public function listen(callable $callback);", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "public function run()\n {\n $port = (int) CommandLine::getInput('p');\n\n if (!$port) {\n die('You must specify a valid port for the socket server. For example: \"-p=1024\"');\n }\n\n $server = new SocketServer('127.0.0.1', $port);\n\n // Set greetings for the new connection\n $server->greetings(\"\\nHi! Just type your brackets sequence and you will see the result\\n\");\n\n // Set handler of the incoming messages\n $server->setMessageHandler($this->messageHandler);\n\n // Start up the server\n $server->run();\n }", "public function poll()\n {\n }", "public function listen() :void {\n\n echo \"Starting websocket server on... \" . $this->address . \":\" . $this->port;\n \n socket_listen($this->server);\n socket_set_nonblock($this->server);\n $this->clients[] = new WebSocket($this->server);\n\n do {\n\n $read = array_map(function($ws) {return $ws->socket;}, $this->clients);\n $write = null; \n $except = null;\n\n $ready = socket_select($read, $write, $except, 0);\n if ($ready === false) {\n if ($this->onError !== null) {\n $callback = $this->onError;\n $callback(\"[\".socket_last_error().\"]\".\" \".socket_strerror(socket_last_error()));\n }\n\n return;\n }\n\n if ($ready < 1) continue;\n\n // check if there is a client trying to connect.\n if (in_array($this->server, $read)) {\n if (($client = socket_accept($this->server)) !== false) {\n\n // send websocket handshake headers.\n if (!$this->sendHandshakeHeaders($client)) {\n continue;\n }\n\n // add the new client to the $clients array.\n $ws = new WebSocket($client);\n $this->clients[] = $ws;\n\n // call \"connection\" event handler for each new client.\n if ($this->onConnect !== null) {\n $callback = $this->onConnect;\n $callback($ws);\n }\n\n // remove the listening socket from the clients-with-data array.\n $key = array_search($this->server, $read);\n unset($read[$key]);\n }\n }\n\n foreach ($read as $key => $client) {\n\n $buffer = \"\";\n $bytes = @socket_recv($client, $buffer, 2048, 0);\n\n // check if the client is disconnected.\n if ($bytes === false) {\n\n // remove client from $clients array\n // and call disconnect event handler.\n unset($this->clients[$key]);\n if ($this->onDisconnect !== null) {\n $callback = $this->onDisconnect;\n $callback();\n }\n\n continue;\n }\n\n $ws = $this->clients[$key];\n $callback = $ws->onMessage;\n if ($callback !== null) {\n $callback($ws, $this->unmask($buffer));\n }\n }\n } while (true);\n socket_close($this->server);\n }", "public function handle()\n {\n $msg = new AMQPMessage(json_encode(['Hello World!']));\n \\RabbitMQ::channel()->basic_publish($msg, '', \\RabbitMQ::getQueueName());\n\n echo \" [x] Sent 'Hello World!'\\n\";\n\n \\RabbitMQ::close();\n }", "public function handle()\n {\n $QUEUE = $_SERVER['argv'][2] ?? 'default';\n\n $count = 2;\n $COUNT = $_SERVER['argv'][3] ?? 2;\n if(!empty($COUNT) && $COUNT > 1) {\n $count = $COUNT;\n }\n\n $BLOCKING = $_SERVER['argv'][4] ?? false;\n\n if($count > 1) {\n for($i = 0; $i < $count; ++$i) {\n $pid = ResqueServiceNew::fork();\n if($pid === false || $pid === -1) {\n die('Could not fork worker {count}');\n }\n // Child, start the worker\n else if(!$pid) {\n $worker = new ResqueServiceNew($QUEUE);\n $interval = 5;\n $worker->work($interval, $BLOCKING);\n// break;\n }\n }\n }\n// Start a single worker\n else {\n $worker = new ResqueServiceNew($QUEUE);\n $interval = 5;\n $worker->work($interval, $BLOCKING);\n }\n }", "private function main()\n {\n $this->initDataSource();\n while ($this->running) {\n try {\n $this->eventDispatcher->dispatch(new QueueStatus($this));\n } catch (\\Throwable $e) {\n $this->stdOutLogger->error('Watch coroutine exception, msg:' . $e->getMessage());\n $this->fileLogger->alert('Watch coroutine exception', [\n 'file' => $e->getFile(),\n 'line' => $e->getLine(),\n 'msg' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n }\n\n Coroutine::sleep(self::WATCH_COMMAND_TIME);\n }\n $this->stdOutLogger->info('消费进程(' . $this->process->pid . ')退出');\n $this->fileLogger->info('消费进程(' . $this->process->pid . ')退出');\n }", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "public function receive();", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "public function handle()\n {\n $this->output->writeln('Waiting for jobs...');\n\n return $this->call('queue:work', [\n '--timeout' => '-1',\n ]);\n }", "public function listen(): static\n {\n $this->breakLoop = false;\n $this->listening = true;\n\n $baseTime = microtime(true);\n $times = [];\n $lastCycle = $baseTime;\n $this->generateMaps = false;\n $this->generateMaps();\n\n $this->startSignalHandlers();\n $this->breakLoop = false;\n\n while (!$this->breakLoop) {\n $socketCount = count($this->sockets);\n $streamCount = count($this->streams);\n $signalCount = count($this->signals);\n $timerCount = count($this->timers);\n\n if ($this->generateMaps) {\n $this->generateMaps();\n }\n\n $hasHandler = false;\n\n\n // Timers\n if (!empty($this->timers)) {\n $hasHandler = true;\n $time = microtime(true);\n\n foreach ($this->timers as $id => $binding) {\n if ($binding->frozen) {\n continue;\n }\n\n $dTime = $times[$id] ?? $baseTime;\n $diff = $time - $dTime;\n\n if ($diff > $binding->duration) {\n $times[$id] = $time;\n $binding->trigger(null);\n }\n }\n }\n\n\n\n // Signals\n if (!empty($this->signals) && $this->hasPcntl) {\n $hasHandler = true;\n pcntl_signal_dispatch();\n }\n\n // Sockets\n if (!empty($this->socketMap)) {\n $hasHandler = true;\n $e = null;\n\n /** @var array<int, resource|Socket> $read */\n $read = $this->socketMap[self::RESOURCE][self::READ];\n /** @var array<int, resource|Socket> $write */\n $write = $this->socketMap[self::RESOURCE][self::WRITE];\n\n try {\n /* @phpstan-ignore-next-line */\n $res = socket_select($read, $write, $e, 0, 10000);\n } catch (Throwable $e) {\n $res = false;\n }\n\n if ($res === false) {\n // TODO: deal with error\n } elseif ($res > 0) {\n foreach ($read as $resourceId => $socket) {\n foreach (Coercion::toArray(\n $this->socketMap[self::HANDLER][self::READ][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($socket);\n }\n }\n\n foreach ($write as $resourceId => $socket) {\n foreach (Coercion::toArray(\n $this->socketMap[self::HANDLER][self::WRITE][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($socket);\n }\n }\n }\n\n // TODO: add timeout handler\n }\n\n // Streams\n if (!empty($this->streamMap)) {\n $hasHandler = true;\n $e = null;\n\n /** @var array<int, resource> $read */\n $read = $this->streamMap[self::RESOURCE][self::READ];\n /** @var array<int, resource> $write */\n $write = $this->streamMap[self::RESOURCE][self::WRITE];\n\n try {\n $res = stream_select($read, $write, $e, 0, 10000);\n } catch (Throwable $e) {\n $res = false;\n }\n\n\n if ($res === false) {\n // TODO: deal with error\n } elseif ($res > 0) {\n foreach ($read as $resourceId => $stream) {\n foreach (Coercion::toArray(\n $this->streamMap[self::HANDLER][self::READ][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($stream);\n }\n }\n\n foreach ($write as $resourceId => $stream) {\n foreach (Coercion::toArray(\n $this->streamMap[self::HANDLER][self::WRITE][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($stream);\n }\n }\n }\n\n // TODO: add timeout handler\n }\n\n\n // Tick\n if (\n !$this->breakLoop &&\n $this->tickHandler\n ) {\n if (false === ($this->tickHandler)($this)) {\n $this->breakLoop = true;\n }\n }\n\n // Cycle\n if (\n !$this->breakLoop &&\n $this->cycleHandler\n ) {\n $time = microtime(true);\n\n if ($time - $lastCycle > 1) {\n $lastCycle = $time;\n\n if (false === ($this->cycleHandler)(++$this->cycles, $this)) {\n $this->breakLoop = true;\n }\n }\n }\n\n\n if (!$hasHandler) {\n $this->breakLoop = true;\n } elseif (\n $socketCount !== count($this->sockets) ||\n $streamCount !== count($this->streams) ||\n $signalCount !== count($this->signals) ||\n $timerCount !== count($this->timers)\n ) {\n $this->generateMaps = true;\n }\n\n usleep(30000);\n }\n\n $this->breakLoop = false;\n $this->listening = false;\n\n $this->stopSignalHandlers();\n\n return $this;\n }", "public function run()\n {\n if ($this->connect()) {\n $this->login();\n $this->join();\n $this->listen();\n }\n }", "public function handle()\n {\n //\n// echo PHP_EOL . 'Demo' . PHP_EOL;\n $rabbit = new RabbitMQ();\n\n $message = 'test queue : ' . date('Y-m-d H:i:s');\n $queue = 'demo';\n $rabbit->publishMessage($message, $queue);\n\n// $msg = $rabbit->getMessage($queue);\n// echo PHP_EOL;\n// var_dump($msg);\n// echo PHP_EOL;\n\n\n }", "public function handle()\n {\n Log::info(\"Running polling\");\n $params = [];\n\n $phones = Phones::get();\n\n $params['phones'] = fractal()\n ->collection($phones)\n ->serializeWith(DataArraySansIncludeSerializer::class)\n ->transformWith(PhoneTransformer::class)\n ->toArray()['data'];\n\n event(new PhoneEvent($params['phones']));\n\n $inbox = Inbox::where('processed', false)->get();\n $params['inbox'] = [];\n if (count($inbox)){\n foreach ($inbox as $row){\n $params['inbox'][] = [\n 'from' => $row->SenderNumber,\n 'message' => $row->TextDecoded\n ];\n $data = fractal()\n ->item($row)\n ->transformWith(OutboxTransformer::class)\n ->serializeWith(DataArraySansIncludeSerializer::class)\n ->toArray();\n event(new OutboxEvent($data));\n }\n }\n\n $this->sendPolling($params);\n\n\n }", "public function handle()\n {\n $options = $this->gatherProcessingOptions();\n\n $this->registerLogWriters($options->connectionName);\n $this->listenForEvents();\n\n $nameResolver = new NameResolver(\n $this->getEvent($options->connectionName),\n $options->service\n );\n\n $consumer = (new ConsumerFactory($this->context, $this->laravel[AmqpTopic::class]))\n ->make($nameResolver);\n\n $processor = new MessageProcessor(\n $this->events,\n $this->exceptions,\n new JobsFactory($this->laravel, $this->context, $consumer),\n $options\n );\n\n (new Worker($consumer, $processor, $this->exceptions))->work($options);\n }", "public function actionStartListening()\n {\n if (!isset($_REQUEST['source']))\n {\n echo json_encode(array('errors' => array('Unknown connection type')));\n\n Yii::app()->end();\n }\n\n\n $source = strtoupper ($_REQUEST['source']);\n $communication_type = !empty($_REQUEST['communication_type']) ? strtoupper ($_REQUEST['communication_type']) : 'COMMUNICATION_TYPE_NONE' ;\n\n $last_connection = Listener::getLastConnectionInfo($source);\n\n if ($last_connection && !$last_connection['stopped'])\n {\n echo json_encode(array('ok_still' => 1));\n\n Yii::app()->end();\n }\n\n\n\n $command = Yii::app()->params['applications']['php_exe_path'] . ' -f ' . Yii::app()->params['console_app_path'] . ' listen '. $source .' '. $communication_type .' Admin';\n It::runAsynchCommand($command);\n\n echo json_encode(array('ok' => 1));\n\n Yii::app()->end();\n }", "public function isListened()\n {\n return !empty($this->socket);\n }", "public function eventsAction()\n {\n $callback = function ($msg) {\n //check the db before running anything\n if (!$this->isDbConnected('db')) {\n return ;\n }\n\n if ($this->di->has('dblocal')) {\n if (!$this->isDbConnected('dblocal')) {\n return ;\n }\n }\n\n //we get the data from our event trigger and unserialize\n $event = unserialize($msg->body);\n\n //overwrite the user who is running this process\n if (isset($event['userData']) && $event['userData'] instanceof Users) {\n $this->di->setShared('userData', $event['userData']);\n }\n\n //lets fire the event\n $this->events->fire($event['event'], $event['source'], $event['data']);\n\n $this->log->info(\n \"Notification ({$event['event']}) - Process ID \" . $msg->delivery_info['consumer_tag']\n );\n };\n\n Queue::process(QUEUE::EVENTS, $callback);\n }", "public function run(Queue ...$queues): Promise\n {\n return $this->entryPoint->listen(...$queues);\n }", "public function handle()\n {\n $this->connectAmqp();\n\n //声明callback队列(exclusive置为true,只有此连接才能使用此queue,且连接断开之后自动删除之)\n list($this->callBackQueueName, ,) = $this->channel->queue_declare(\"\", false, false, true, false);\n\n //监听响应队列\n $this->channel->basic_consume($this->callBackQueueName, '', false, false, false, false, [$this, 'onResponse']);\n\n //rcp调用\n $n = $this->argument('n');\n $result = $this->callRpc($n);\n echo \" [.] Got \", $this->response, \". Rpc result: ${result}\\n\";\n\n $this->closeAmqp();\n }", "public function run()\n {\n while (($payload = array_shift($this->payloads)) !== null) {\n list($ttr, $message) = $payload;\n $this->startedId = $this->finishedId + 1;\n $this->handleMessage($this->startedId, $message, $ttr, 1);\n $this->finishedId = $this->startedId;\n $this->startedId = 0;\n }\n }", "public function invoke(): void\n {\n foreach (array_keys($this->pendingEventListenerClassNames) as $listenerClassName) {\n $job = new CatchUpEventListenerJob($listenerClassName);\n // TODO make queue name configurable (per event type?)\n $this->jobManager->queue('neos-eventsourcing', $job);\n }\n $this->pendingEventListenerClassNames = [];\n }", "public function listener() {\n\t\treturn $this->_runtime['listener'];\n\t}", "public function subscribe();", "public function handle()\n\t{\n\t\t$this->dispatcher->dispatchNow($this->job);\n\t}", "public function callback(AMQPMessage $req);", "public function run()\n {\n $this->init();\n\n while (true) {\n $this->processControl->checkForSignals();\n $this->checkOnConsumers();\n\n usleep(self::LOOP_PAUSE);\n }\n }", "public function listen(PriorityInterface $priority)\n {\n $this->logger->info(sprintf(\"Listening for %s messages...\", $priority->toString()));\n $topic = $this->topicGenerator->generate([\n $this->configuration->topicPending,\n $priority->toString(),\n ]);\n $this->eventConsumer->consume([$this, 'consume'], $topic);\n }", "public function handle()\n {\n foreach (Subscription::query()\n ->where('active', true)\n ->whereNotNull('email_verified_at')->get() as $sub) {\n $sub->notify((new DailyMailNotification())->onQueue('dailyMail'));\n }\n }", "public function accept();", "public function handle()\n {\n $job = (new SendRequestJob)\n ->onQueue('sender:request')\n ->delay(Carbon::now()->addSeconds(5));\n\n dispatch($job);\n }", "public function consumeQueue()\n {\n try {\n $queue = Di::getDefault()->get('queue');\n\n /** @var \\Aws\\Result $messages*/\n $messages = $this->getMessagesFromQueue($queue);\n\n if (count($messages->get('Messages')) == 0) {\n return;\n }\n\n $queueName = (new QueueService())->getFullQueueName('notifications');\n foreach ($messages->get('Messages') as $message) {\n $idList = json_decode($message['Body'], true);\n\n if (!empty($idList)) {\n $this->trySendNotificationsFromMessage($idList);\n }\n\n $queue->deleteMessage([\n 'QueueUrl' => $queue->getQueueUrl(['QueueName' => $queueName])->get('QueueUrl'),\n 'ReceiptHandle' => $message['ReceiptHandle'],\n ]);\n }\n } catch (AwsException $e) {\n Di::getDefault()->get('logger')->error($e->getMessage());\n } catch (\\Exception $e) {\n // Do nothing\n } catch (\\Throwable $e) {\n // Do nothing\n }\n\n sleep(5);\n $this->consumeQueue();\n }", "public function run()\n {\n $quit = false;\n while (!$quit)\n {\n \\Mutex::lock($this->thread_mutex);\n if (count($this->req_queue) == 0)\n {\n \\Cond::wait($this->thread_cond, $this->thread_mutex);\n if (count($this->req_queue) == 0)\n {\n \\Mutex::unlock($this->thread_mutex);\n continue;\n }\n }\n $reqs = array();\n while (count($this->req_queue) > 0 and count($reqs) < 10)\n {\n $m = $this->req_queue->shift();\n if ($m[0] == 'stop')\n {\n $quit = true;\n break;\n }\n $reqs[] = array($m[1], $m[2], $m[3], $m[4]);\n }\n \\Mutex::unlock($this->thread_mutex);\n if (count($reqs) > 0)\n $this->pubbatch($reqs);\n }\n }", "public function listener(Listener $listener);", "public function listen(\\ReflectionClass $class): void;", "public function getQueue();", "public function getQueue();", "public function handleWorkerHandlerQueue()\n {\n if (!$this->workerHandlerReady || count($this->workerHandlerQueue) == 0) {\n return;\n }\n $requestId = array_shift($this->workerHandlerQueue);\n $request = $this->getRequest($requestId);\n\n if ($request === null) {\n return;\n }\n\n $this->getLogger()->debug('Sending request: '.$requestId.' to worker-handler.');\n\n $this->workerHandlerReady = false;\n\n $this->getStream('workerHandler')->send(\n new ClientHandlerJobRequest(\n $requestId,\n $request->getActionName(),\n $request->getParams()\n )\n );\n }", "public function Subscribe() {\n\t\t// Process pending messages if any\n\t\t$this->ProcessPendingMessages();\n\t\t// Subscribe\n\t\t$this->GetSubsConn()->subscribe(\n\t\t\t[$this->GetChannel()],\n\t\t\t[$this, 'SubscribeCallback']\n\t\t);\n\t}", "public function __construct()\n {\n $this->onQueue('daily-game-play');\n }", "public function subscription();", "public function __construct()\n {\n $this->onQueue('tags');\n }", "public abstract function receive();", "public function run()\n {\n $this->server->start();\n }", "public function listen($worker_id = 'SendMailWorker')\r\n {\r\n // Gearman servers from config\r\n // Comma separated servers e.g. 127.0.0.1:4730,127.0.0.1:4731\r\n $servers = $this->config['gearman']['worker']['servers'];\r\n\r\n $worker = new \\GearmanWorker();\r\n $worker->addServers($servers);\r\n $worker->addFunction(\r\n $worker_id,\r\n [$this, 'sendMail'],\r\n [\r\n 'Storage' => $this->Storage,\r\n ]\r\n );\r\n while ($worker->work()) {\r\n if ($worker->returnCode() != GEARMAN_SUCCESS) {\r\n throw new \\Exception('Return code: ' . $worker->returnCode());\r\n break;\r\n }\r\n }\r\n }", "public function listen(ServerInterface $socket)\n {\n $socket->on('connection', array($this->parser, 'handle'));\n }", "abstract public function receive();" ]
[ "0.8488886", "0.84336644", "0.8078416", "0.7967954", "0.7611704", "0.74802107", "0.72017545", "0.7086666", "0.6929526", "0.6912977", "0.664768", "0.6587696", "0.6341747", "0.6300742", "0.62757045", "0.6234088", "0.60886693", "0.6077273", "0.60747397", "0.60554487", "0.6034642", "0.6033766", "0.600001", "0.596974", "0.5866443", "0.5845351", "0.5837202", "0.5835051", "0.57902527", "0.57556283", "0.5718403", "0.57141745", "0.5704731", "0.5689163", "0.56763977", "0.5673719", "0.56458133", "0.56452775", "0.56115174", "0.56082714", "0.56032884", "0.5594998", "0.5534304", "0.55178493", "0.550355", "0.5499254", "0.54909146", "0.5486456", "0.5468861", "0.54445213", "0.5440226", "0.5437432", "0.5435055", "0.54282796", "0.54275566", "0.5424272", "0.5421912", "0.5418986", "0.5411768", "0.54086906", "0.5391015", "0.5386916", "0.53785497", "0.5376607", "0.5375651", "0.5371966", "0.53641397", "0.536273", "0.5360732", "0.5352712", "0.5346676", "0.5334834", "0.53302324", "0.5329127", "0.53227514", "0.53048474", "0.5301033", "0.5285192", "0.52622086", "0.5254967", "0.5246664", "0.52445066", "0.5243932", "0.5243811", "0.52350086", "0.523222", "0.5226348", "0.52257806", "0.52075624", "0.52075624", "0.51959985", "0.5188457", "0.51698923", "0.5165375", "0.5154549", "0.5151613", "0.5149233", "0.51492304", "0.5140587", "0.51359355" ]
0.7319916
6
Higher order function that parses and consumes the message received.
private function parseAndConsumeMessage(): callable { return function ($message) { $parser = $this->getPayloadParser($message); $headers = $parser->getHeaders($message); $body = $parser->getBody($message); $this->events->triggerActions($headers, $body); $this->deleteMessage($message['ReceiptHandle']); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function consume();", "public function consume();", "#[Pure]\nfunction http_parse_message($message) {}", "public function parseRequest($message);", "public function process(Message $message);", "abstract function receive();", "private function ProcessMessage($message) {\n\t\tif($message !== false) {\n\t\t\t$message = json_decode($message, true);\n\t\t\tif($message !== false) {\n\t\t\t\t$this->Consume($message['id'], $message['content']);\n\t\t\t} else throw new Exception('Error while decoding json message');\n\t\t}\n\t}", "public function consume($data);", "private function parse()\r\n\t{\r\n\t\t// Suppress annoying notices/warnings\r\n\t\tset_error_handler(function() { /* Nothing */ }, E_NOTICE|E_WARNING);\r\n\r\n\t\t$structure = mailparse_msg_get_structure($this->resource);\r\n\t\t$this->parts = array();\r\n\t\tforeach ($structure as $part_id) {\r\n\t\t\t$part = mailparse_msg_get_part($this->resource, $part_id);\r\n\t\t\t$this->parts[$part_id] = mailparse_msg_get_part_data($part);\r\n\t\t}\r\n\r\n\t\trestore_error_handler();\r\n\t}", "public function receiveMsg() {\n\n $rawData = file_get_contents(\"php://input\");\n $input = json_decode($rawData, true);\n\n return $input;\n }", "protected abstract function receive();", "public abstract function receive();", "abstract public function receive();", "private function parseMessage() {\n\n\t\t# Regexp to parse a formatted message\n\t\t# The message should come in format of\n\t\t# :(.*)\\!(.*)\\@(.*) PRIVMSG #channelname \\:(.*) for regular chatter\n\t\t# thus returning nickname, realname, hostmask, (command, arguments) || (botname: command (arguments)) || (chatter)\n\t\t$matched = false;\n\n # Try to match against the bots name!\n # This could mean it is a direct message in chan followed by a command request\n if(!$matched) {\n $pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:('.$this->config['username'].')\\:(?: +)?([^\\s]*) (.*)/';\n preg_match($pattern, $this->inbound, $matches);\n if(count($matches) > 1) {\n $matched = true;\n $this->lastMessage = array(\n 'nickname' => $matches[1],\n 'realname' => $matches[2],\n 'hostname' => $matches[3],\n 'command' => $matches[5],\n 'args' => rtrim($matches[6],\"\\n\\r\"),\n 'chatter' => ''\n );\n # Have to match a case whereby a command of 'botname: command' with no args is provided (for help)\n # If this case occurs we have to do some arg movement otherwise the command parser won't get a hit\n if($this->lastMessage['args'] != \"\" && $this->lastMessage['command'] == '') {\n $this->lastMessage['command'] = $this->lastMessage['args'];\n $this->lastMessage['args'] = \"\";\n }\n }\n }\n\n\t\tif(!$matched) {\n\t\t\t$pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:(.*)/';\n\t\t\tpreg_match($pattern, $this->inbound, $matches);\n\t\t\tif(count($matches) > 1) {\n\t\t\t\t$this->lastMessage = array(\n\t\t\t\t\t'nickname' => $matches[1],\n\t\t\t\t\t'realname' => $matches[2],\n\t\t\t\t\t'hostname' => $matches[3],\n\t\t\t\t\t'command' => '',\n\t\t\t\t\t'args' => '',\n\t\t\t\t\t'chatter' => rtrim($matches[4],\"\\n\\r\")\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "abstract protected function handleMessage($message);", "public function receive();", "public function parseResponse($message);", "abstract public function readMessageEnd();", "function foward_message($msg) {\n\n\t\tglobal $front_queue_get, $back_queue_get, $file_back;\n\n\t\t// this is what will be called when a new message is received from\n\t\t// the next consumer.\n\t\t$func = function($str) {\n global $front_queue_get, $back_queue_get;\n\n\t\t\techo \" [x] Received from server in '$back_queue_get' : $str\\n\";\n\n\t\t\t$body = \"NULL\";\n\t\t\tif ($str && $str != \"NULL\")\n\t\t\t\t$body = format_body($str);\n\n\t\t\techo \" [x] Forwarded to client in '$front_queue_get' : $body\\n\";\n\t\t\treturn $body;\n\t\t};\n\t\t// end of function\n\n\t\techo \" [x] Received from client in '$front_queue_get' : $msg\\n\";\n\n\t\t// replace an underscores with spaces\n\t\t$refined_title = refine_title($msg);\n\n\t\techo \" [x] Forwarded to server in '$back_queue_get' : $refined_title\\n\";\n\n\t\t// $rpcClient = new RpcClient($file_back);\n\t\tglobal $rpcClient;\n\t\t$response = $rpcClient->call($back_queue_get, $refined_title, $func);\n\n\t\treturn $response;\n\n\t}", "abstract protected function handleMessage(Message $message);", "private function _readInput() {\n $input = fopen('php://stdin', 'r');\n\n $message = fgets($input);\n return $this->_trigerMessage($message);\n }", "public function consume()\n {\n }", "function readIncoming()\n {\n\n $this->logDebug(\"Reading incoming messages.\");\n \n $payloadChain = '';\n $opCode = null;\n\n try\n {\n do\n {\n $frameInfo = $this->readFrame();\n $this->counter++;\n\n if($frameInfo === false)\n {\n $this->logError(\"Could not read frame. Breaking.\");\n return null;\n }\n \n $payloadChain .= $frameInfo['Payload'];\n \n if($opCode === null)\n $opCode = $frameInfo['OpCode'];\n \n } while($frameInfo['IsFinal'] == false);\n }\n \n catch(Exception $ex)\n {\n $this->logError(\"Could not processing incoming message because of exception [\" . get_class($ex) . \"]: \" . $ex->getMessage());\n return false;\n }\n \n if($this->removePreviousMessage() === false)\n {\n $this->logError(\"Could not remove message just processed.\");\n return false;\n }\n \n $messageInfo = array(\n 'OpCode' => $opCode,\n 'PayloadChain' => $payloadChain,\n );\n \n if($this->m->messageReceived($this->socket, $messageInfo) === false)\n {\n $this->logError(\"Message-received callback failed.\");\n return false;\n }\n \n return $messageInfo;\n }", "function processMessageIn($message) {\n\t\t$service = $message->getKeyword();\n\t\t$keyword = $message->getKeyword(2);\n\n\t\tswitch ($keyword) {\n\t\t\tcase \"get\":\n\t\t\t\t$this->addSubscriber($message);\n\t\t\tbreak;\n\t\t\tcase \"yes\":\n\t\t\t\t$this->confirmSubscriber($message);\n\t\t\tbreak;\n\t\t\tcase \"cancel\":\n\t\t\tcase \"quit\":\n\t\t\tcase \"end\":\n\t\t\tcase \"unsubscribe\":\n\t\t\tcase \"stop\":\n\t\t\t\t$this->removeSubscriber($message);\n\t\t\tbreak;\n\t\t\tcase \"#\":\n\t\t\t\t$this->processMessageOut($message, null);\n\t\t\tbreak;\n\t\t\tcase \"#uk\":\n\t\t\t\t$this->processMessageOut($message, \"UK\");\n\t\t\tbreak;\n\t\t\tcase \"#us\":\n\t\t\t\t$this->processMessageOut($message, \"US\");\n\t\t\tbreak;\n\t\t\tcase \"status\":\n\t\t\t\t$this->statusCheck($message, $service);\n\t\t\tbreak;\n\t\t}\n\n\t}", "abstract public function handler(string $message);", "function message(Message $message);", "abstract public function getMessage(): ReceivedMessage;", "abstract public function getMessage(): ReceivedMessage;", "abstract public function get_message();", "abstract protected function process($user, $message);", "public function getInboundMessage();", "private function parseMessage(DOMElement $node)\n {\n if ($node->getAttribute('type') == 'error') {\n foreach ($node->childNodes as $_node)\n {\n if ($_node->localName == 'error')\n {\n // todo handle error response\n Log::info(\"===error===\");\n Log::error($_node->textContent);\n }\n }\n }elseif ($node->firstChild->localName == 'gcm' && ($json = $node->firstChild->textContent) && ($data = json_decode($json)) && @$data->message_type && @$data->message_id) {\n\n switch ($data->message_type)\n {\n case 'ack':\n // message acknowledgement received\n $this->events->fire(new MessageAcknowledged($data->message_id));\n break;\n case 'nack':\n switch (strtolower($data->error))\n {\n case 'bad_registration':\n // unregistered/uninstalled app\n $this->events->fire(new InvalidDeviceRegistration($data->from));\n break;\n case 'device_unregistered':\n // unregistered/uninstalled app\n $this->events->fire(new InvalidDeviceRegistration($data->from));\n break;\n case 'device_message_rate_exceeded':\n // device rate exceeded\n $this->events->fire(new DeviceMessageRateExceeded($data->from, null, $data->message_id));\n break;\n case 'invalid_json':\n // invalid json\n $this->events->fire(new InvalidJson($data->from, $data->description));\n break;\n default:\n // unknown error\n $this->events->fire(new AbstractError($data->error, $data->from, $data->description));\n break;\n }\n break;\n case 'control':\n if ($data->control_type == 'CONNECTION_DRAINING')\n {\n // connection server connection drainage\n $this->events->fire(new ConnectionDrainage());\n }\n break;\n case 'receipt':\n // ack for receipt of message receipt before processing receipt\n $this->sendAck($data->message_id, $data->data->device_registration_id);\n\n // message receipt\n $this->events->fire(new MessageReceiptReceived((array)$data));\n break;\n default:\n break;\n }\n\n if (@$data->registration_id) {\n // registration expired for token\n $this->events->fire(new RegistrationExpired($data->from, $data->registration_id));\n }\n\n } elseif (($json = $node->firstChild->textContent) && ($mData = json_decode($json)) && ($client_token = $mData->from) && ($client_message = $mData->data)) {\n // ack for receipt before processing message\n $this->sendAck($mData->message_id, $mData->from);\n\n // message received\n $this->events->fire(new MessageReceived((array)$mData, 'xmpp'));\n }\n }", "protected abstract function _message();", "public function run()\n {\n $this->openWorker();\n while (($payload = $this->pop(0)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n $this->closeWorker();\n }", "public function callback(AMQPMessage $req);", "function process() {\n return $this->_parse();\n }", "protected function processMessages()\n {\n while ($done = curl_multi_info_read($this->multiHandle)) {\n $request = $this->resourceHash[(int)$done['handle']];\n $this->processResponse($request, $this->handles[$request], $done);\n }\n }", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "function message($message) {\n\t\t\t\t\t\t$GLOBALS['statusmsg'] = \"RX-OK|\";\n\n\t\t\t\t\t\t //**Store the received message to a global variable\n\t\t\t\t\t\t$GLOBALS['rcv_message'] = $message->payload; \n\t\t\t\t}", "function process_message($message)\r\n{\r\n $updateid = $message[\"update_id\"];\r\n $message_data = $message[\"message\"];\r\n if (isset($message_data[\"text\"])) {\r\n $chatid = $message_data[\"chat\"][\"id\"];\r\n $message_id = $message_data[\"message_id\"];\r\n $text = $message_data[\"text\"];\r\n $response = create_response($text, $message_data);\r\n if (!empty($response))\r\n send_reply($chatid, $message_id, $response);\r\n }\r\n return $updateid;\r\n}", "function msgsrv_receive($callback, $timeout = 30000 , $link = null) {}", "public function parseData()\n {\n $jsonMessage = json_decode($this->payload);\n // :: Check if handler contains fully qualified namespace\n if (strpos($jsonMessage->handler, '\\\\') !== false) {\n $parts = explode('\\\\', $jsonMessage->handler);\n $jsonMessage->handler = $parts[count($parts) - 1];\n }\n $exploded = explode('@', $jsonMessage->handler);\n $obj = new StdClass();\n $obj->class = 'Ktbots\\\\Core\\\\Handlers\\\\' . $exploded[0];\n $obj->method = $exploded[1];\n $obj->value = $jsonMessage->value;\n return $obj;\n }", "public function getParsedInput();", "abstract public function parse ();", "public function parse();", "public function parse();", "public function parse();", "protected function parse() {}", "private function parse()\n {\n $lines = file($this->filename);\n\n // skip get worker info\n $offset = 0;\n while (isset($lines[$offset])) {\n $line = $lines[$offset];\n\n if (preg_match('/(?:\\[0m\\t)(\\[.*\\])\\s*({.*})(?:[\\r\\n]*)$/', $line, $matches)) {\n $ctx = json_decode($matches[2], true);\n if (isset($ctx['receive'])) {\n $this->in[] = [$matches[1], $matches[2]];\n $offset++;\n continue;\n }\n\n $this->out[] = [$matches[1], $matches[2]];\n }\n\n $offset++;\n }\n }", "public function parse(): array\n {\n // Text.\n if ($this->type === 'text') {\n return [\n 'text' => $this->message,\n ];\n }\n\n // Template.\n if ($this->type === 'template') {\n $payload = Arr::get($this->message, 'attachments.0.payload');\n\n // Generic template.\n if (Arr::get($payload, 'template_type') === 'generic') {\n return [\n 'generic' => $this->parseGenericTempalte($payload),\n ];\n }\n }\n\n // Image\n if ($this->type === 'image') {\n $payload = Arr::get($this->message, 'attachments.0.payload');\n return [\n 'image' => $this->parseImageAttachment($payload),\n ];\n }\n\n // This for unsupported messages.\n return [];\n }", "public function aim_recv()\r\n\t{\r\n\t\t$header = fread($this->resource, 6);\r\n if ($this->user['debug']) $this->aim_debug($header, AIM_RAW);\r\n\r\n\t\t// Need error checking here to prevent bad data\r\n\t\ttry {\r\n\t\t\tif (!$data = @unpack(\"aone/Ctwo/nthree/nfour\", $header)) {\r\n\t\t\t\t// This normally happens if you sign on elsewhere with the same name,\r\n // or, if the TOC server resets (AOL likes to do this alot).\r\n\t\t\t\tthrow new TACException('Connection to TOC server interrupted.');\r\n\t\t\t} \r\n\t\t} catch(TACException $ex) {\r\n\t\t\t$ex->display();\r\n\t\t}\r\n\r\n if ($this->user['debug']) print_r($data);\r\n\t\t$msg = fread($this->resource, $data['four']);\r\n\t\t$msg = implode('', unpack(\"a*done\", $msg));\r\n if ($this->user['debug']) var_dump($msg);\r\n\r\n // match incoming commands\r\n preg_match(\"/^([A-Z0-9_]{4,19})\\:(.*)/s\", $msg, $matches);\r\n @list($orig, $cmd, $args) = $matches;\r\n // send the command and arguments to our parser\r\n $this->parser->aim_parse_command($cmd, $args);\r\n // regain some memory\r\n unset($header, $orig, $data, $matches);\r\n\t}", "public function parse($buffer)\n {\n $pos = 1; // The remain length is start from second byte.\n $remainLen = \\Mqtt\\Message\\Util::decodeRemainLength($buffer, $pos);\n $this->header->setRemainLen($remainLen);\n $this->header->parseVarHeader($buffer, $pos);\n $this->parseBody($buffer, $pos);\n }", "public function readMsg()\n\t{\n\t\tglobal $_THRESH, $_LOCKTHRESH;\n\t\t\n\t\tif($this->_SERIAL->_ckOpened() == false) { return \"fail\";}\n\t\t$this->_SERIAL->serialflush();\n\t\t\n\t\t$result = -5;\n\t\t$data = \"\";\n\t\t$i = 0;\n\t\t\n\t\t//This regex looks for any whitespace characters (\\n, char(10), etc.)\n\t\twhile (!preg_match(\"/[\\s,]+/\", $data))\n\t\t{\n\t\t\tif($i >=75000) {\n\t\t\t\treturn \"failed to read data. Value of loop: \".$i;\n\t\t\t}\n\t\t\n\t\t\t$i++;\n\t\t\t$data .= $this->_SERIAL->readPort();\n\t\t}\n\n\t\t$arr = str_split($data);\n\n\t\t// First byte of incoming message determines what type it is.\n\t\t$resultID = $arr[0];\n\n\t\t// after type is determined these statements extract relevant data from rest of the message.\n\t\tif ($resultID == \"s\")\n\t\t{\n\t\t\t$value = (ord($arr[3])*256)+ord($arr[4]);\n\n\t\t\tif($value > $_THRESH)\n\t\t\t\t$result = 1; // Filled\n\t\t\telse \n\t\t\t\t$result = 0; // UnFilled\n\t\t}\n\t\telseif ($resultID == \"l\")\n\t\t{\n\t\t\t$value = (ord($arr[3])*256)+ord($arr[4]);\n\n\t\t\tif($value < $_LOCKTHRESH) \n\t\t\t\t$result = 1; // UnLocked\n\t\t\telse \n\t\t\t\t$result = 0; // locked\n\t\t}\n\t\telseif ($resultID == \"a\")\n\t\t{\n\t\t\t$result = 1; // message was confirmed\n\t\t}\n\t\telseif ($resultID == \"n\")\n\t\t{\n\t\t\t$iDplusCol = Array(0 => ord($arr[1]), 1 => ord($arr[2]));\n\t\t\treturn $iDplusCol; // new column was found return the number of boxes\n\t\t}\n\t\telseif ($resultID == \"t\")\n\t\t{\n\t\t\t$result= ord($arr[3]); // returns the size of queried box\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function fetchMessage()\n {\n if ($this->socket === null) {\n $this->socket = stream_socket_server(static::buildFullAddress($this->address));\n }\n return @stream_socket_accept($this->socket);\n }", "public function parse()\n {\n return $this->connection->protocol()->parse($this);\n }", "public function receiveToken() {\n\n\t\t$parseToken = ($this->JWTParser);\n\t\t$TokenObject = $parseToken->parse($this->Token);\n\n\t\t$this->setTokenObject($TokenObject);\n\t}", "public function onReceive(string $str)\n {\n }", "public function onReceive(string $str)\n {\n }", "public function parseEventMessage(\\PhpAmqpLib\\Message\\AMQPMessage $message)\n {\n Yii::info(\"Got new amqp message: '{$message->body}'\", StringHelper::basename(self::class));\n $channel = $message->getChannel();\n // Send a message with the string \"quit\" to cancel the consumer.\n if ($message->body === 'quit') {\n $channel->basic_cancel($message->getConsumerTag());\n } else {\n try {\n $array = Json::decode($message->body);\n $data = ArrayHelper::getValue($array, 'data.event', []);\n } catch (\\InvalidArgumentException $e) {\n Yii::error($e->getMessage(), StringHelper::basename(self::class));\n $message->ack();\n\n return;\n }\n\n $sport_id = intval(ArrayHelper::getValue($data, 'sport_id', 0));\n\n if (!$sport_id) {\n $message->ack();\n\n return;\n }\n if (!isset($this->_detailsMapping[$sport_id])) {\n if (Yii::$app->cache->exists('statscore-details-' . $sport_id)) {\n $this->_detailsMapping[$sport_id] = Yii::$app->cache->get('statscore-details-' . $sport_id);\n $this->_statsMapping[$sport_id] = Yii::$app->cache->get('statscore-stats-' . $sport_id);\n $this->_resultsMapping[$sport_id] = Yii::$app->cache->get('statscore-results-' . $sport_id);\n } else {\n try {\n $sport = $this->getSport((string)$sport_id);\n\n $this->_detailsMapping[$sport_id] = ArrayHelper::index($sport->details, 'id');\n $this->_statsMapping[$sport_id] = ArrayHelper::index($sport->stats, 'id');\n $this->_resultsMapping[$sport_id] = ArrayHelper::index($sport->results, 'id');\n\n Yii::$app->cache->set(\n 'statscore-details-' . $sport_id,\n $this->_detailsMapping[$sport_id],\n 60 * 60 * 24\n );\n Yii::$app->cache->set(\n 'statscore-stats-' . $sport_id,\n $this->_statsMapping[$sport_id],\n 60 * 60 * 24\n );\n Yii::$app->cache->set(\n 'statscore-results-' . $sport_id,\n $this->_resultsMapping[$sport_id],\n 60 * 60 * 24\n );\n } catch (HttpException $e) {\n Yii::error($e->getMessage(), StringHelper::basename(self::class));\n $message->ack();\n\n return;\n }\n }\n }\n\n $details = ArrayHelper::remove($data, 'details', []);\n $participants = ArrayHelper::remove($data, 'participants', []);\n $event = new Event();\n $event->setAttributes($data);\n\n foreach ($details as $d) {\n if (!isset($d['id'])) {\n continue;\n }\n $detail = new Detail();\n $detail->setAttributes(ArrayHelper::merge($d, [\n 'name' => ArrayHelper::getValue($this->_detailsMapping, [$sport_id, $d['id'], 'name']),\n 'description' => ArrayHelper::getValue($this->_detailsMapping, [$sport_id, $d['id'], 'description'])\n ]));\n\n $event->details[] = $detail;\n }\n foreach ($participants as $p) {\n $stats = ArrayHelper::remove($p, 'stats', []);\n $results = ArrayHelper::remove($p, 'results', []);\n// $subParticipants = ArrayHelper::remove($p, 'subparticipants', []);\n $participant = new Participant();\n $participant->setAttributes($p);\n\n foreach ($stats as $s) {\n if (!isset($s['id'])) {\n continue;\n }\n $stat = new Stat();\n $stat->setAttributes(ArrayHelper::merge($s, [\n 'short_name' => ArrayHelper::getValue(\n $this->_statsMapping,\n [$sport_id, $s['id'], 'short_name']\n ),\n 'name' => ArrayHelper::getValue($this->_statsMapping, [$sport_id, $s['id'], 'name']),\n 'code' => ArrayHelper::getValue($this->_statsMapping, [$sport_id, $s['id'], 'code']),\n 'data_type' => ArrayHelper::getValue($this->_statsMapping, [$sport_id, $s['id'], 'data_type'])\n ]));\n\n $participant->stats[] = $stat;\n }\n foreach ($results as $r) {\n if (!isset($r['id'])) {\n continue;\n }\n $result = new Result();\n $result->setAttributes(ArrayHelper::merge($r, [\n 'short_name' => ArrayHelper::getValue(\n $this->_resultsMapping,\n [$sport_id, $r['id'], 'short_name']\n ),\n 'name' => ArrayHelper::getValue($this->_resultsMapping, [$sport_id, $r['id'], 'name']),\n 'code' => ArrayHelper::getValue($this->_resultsMapping, [$sport_id, $r['id'], 'code']),\n 'type' => ArrayHelper::getValue($this->_resultsMapping, [$sport_id, $r['id'], 'type']),\n 'data_type' => ArrayHelper::getValue($this->_resultsMapping, [$sport_id, $r['id'], 'data_type'])\n ]));\n\n $participant->results[] = $result;\n }\n\n $event->participants[] = $participant;\n }\n\n $this->trigger(self::EVENT_AMQP_NEW_EVENT, new AMQPNewEventEvent([\n 'sender' => $this,\n 'event' => $event\n ]));\n }\n $message->ack();\n }", "public function parse()\n\t{\n\t\t//we don't need to hit the API everytime parse is called\n\t\tif (!$this->response)\n\t\t\t$this->response = $this->request->execute();\n\t\t\n\t\treturn $this->invokeParserMethod();\t\n\t}", "public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n if (!empty($postStr)){\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch ($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->receiveText1($postObj);\n break;\n case \"event\":\n $resultStr = $this->receiveEvent($postObj);\n break;\n default:\n $resultStr = \"\";\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n // \t//extract post data\n\t\t// if (!empty($postStr)){\n // /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n // the best way is to check the validity of xml by yourself */\n // libxml_disable_entity_loader(true);\n // \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n // $fromUsername = $postObj->FromUserName;\n // $toUsername = $postObj->ToUserName;\n // $keyword = trim($postObj->Content);\n // $time = time();\n // $textTpl = \"<xml>\n\t\t// \t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t// \t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t// \t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t// \t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t// \t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t// \t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t// \t\t\t\t\t</xml>\"; \n\t\t// \t\tif(!empty( $keyword ))\n // {\n // \t\t$msgType = \"text\";\n // \t$contentStr = \"Welcome to wechat world!\";\n // \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n // \techo $resultStr;\n // }else{\n // \techo \"Input something...\";\n // }\n\n // }else {\n // \techo \"\";\n // \texit;\n // }\n }", "abstract protected function parse($data);", "public function parse($data)\n {\n $callback = $this->callback;\n return $callback($data);\n }", "public function onReceivedMessage($data)\n {\n try {\n // Decode incoming data and log it\n $message = json_decode($data, true, 512, JSON_THROW_ON_ERROR);\n echo print_r($message, true);\n } catch (\\JsonException $e) {\n // If it's not valid JSON, we can ignore it, but we should send and\n // ACK regardless. NOTE: This is probably the opening message from\n // OOCSI\n $this->connection->send('.');\n return;\n }\n \n // Send back a dot as acknowledgement\n $this->connection->send('.');\n\n // Check if the message contains a timestamp\n if (!$message['timestamp']) {\n onDataReceived($message);\n }\n\n // Pass the data off to the next function\n $this->handleData($message);\n }", "public function getNextMessage(){\r\n }", "private function readNextElement()\n {\n $xr = $this->xmlReader;\n \n if ($this->emptyXml)\n return NULL;\n \n while ($xr->read())\n {\n // Read: /meta\n if ($xr->nodeType == XMLReader::ELEMENT &&\n $xr->name === 'meta')\n {\n return $this->readMeta();\n }\n \n // Read: /messages/msg\n if ($xr->nodeType == XMLReader::ELEMENT &&\n $xr->name === 'msg')\n {\n $type = $xr->getAttribute('type');\n \n // Read: /messages/msg/[TEXT]\n if (!$xr->read())\n break;\n assert ($xr->nodeType == XMLReader::TEXT);\n $text = $xr->value;\n \n return new Splunk_ResultsMessage($type, $text);\n }\n \n // Read: /result\n if ($xr->nodeType == XMLReader::ELEMENT &&\n $xr->name === 'result')\n {\n return $this->readResult();\n }\n }\n return NULL;\n }", "public function parsePayload()\n { \n return $this->_payload;\n }", "public function parse()\n {\n }", "public function listen(): void\n {\n $receive = function () {\n each($this->receiveMessages(), $this->parseAndConsumeMessage());\n };\n\n $this->settings->beforeReceive($receive);\n }", "public function __invoke(Message $message, Serializer $serializer);", "public function dataReceived($data);", "function wsOnReceive($clientID, $message, $messageLength, $binary) {\r\n\tglobal $Server;\r\n\r\n\t$message = json_decode($message, true);\r\n\t$command = $message['command'];\r\n\t$argument = $message['argument'];\r\n\r\n\t// check if message length is 0\r\n\tif ($messageLength == 0) {\r\n\t\t$Server->wsClose($clientID);\r\n\t\treturn;\r\n\t}\r\n\t$command($clientID, $argument);\r\n\r\n\t//The speaker is the only person in the room. Don't let them feel lonely.\r\n\t/*foreach ( $Server->wsClients as $id => $client )\r\n\t\tif ( $id != $clientID )\r\n\t\t\t$Server->wsSend($id, \"Visitor $clientID ($ip) said \\\"$message\\\"\");\r\n\t*/\r\n}", "protected function parseMessage($messageText)\n {\n\n $lines = explode(PHP_EOL, $messageText);\n\n // [*17-Aug-2010 13:57:24*] PHP Notice: Undefined variable...\n $time = substr($lines[0], 1, 20);\n $data = array();\n\n // [17-Aug-2010 13:57:24] PHP Notice*:* Undefined variable...\n $typeEndPos = strpos($lines[0], ':', 27);\n // [17-Aug-2010 13:57:24] PHP *Notice*: Undefined variable...\n $type = substr($lines[0], 27, $typeEndPos - 27);\n // [17-Aug-2010 13:57:24] PHP Notice: *Undefined variable...*\n $text = substr($lines[0], $typeEndPos + 2);\n\n // $lines[1] == 'Stack trace:'\n $stackTrace = '';\n $i = 2;\n do {\n $stackTrace .= $lines[$i] . PHP_EOL;\n $i++;\n } while ( strncasecmp('Url:', $lines[$i], 4) !== 0 );\n\n // Url: http://localhost/tlumoceni-preklady.cz/portal/tlumoceni-preklady.cz/htdocs/\tReferer: unknown\n list($url, $referer, $ip) = explode(\"\\t\", $lines[$i]);\n $url = substr($url, 5);\n $referer = substr($referer, 9);\n $ip = substr($ip, 4);\n $key = md5($type . $text);\n\n return new Message(array(\n 'time' => $time,\n 'type' => $type,\n 'text' => $text,\n 'key' => $key,\n 'stackTrace' => $stackTrace,\n 'url' => $url,\n 'referer' => $referer,\n 'ip' => $ip\n ));\n }", "function processMessage($message) {\n $message_id = $message['message_id'];\n $chat_id = $message['chat']['id'];\n if (isset($message['text'])) {\n \n $text = $message['text'];//texto recebido na mensagem\n if (strpos($text, \"/start\") === 0) {\n\t\t//envia a mensagem ao usuário\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => 'Olá, '. $message['from']['first_name'].\n\t\t'! Eu sou um bot que informa a previsao do tempo na sua cidade?', 'reply_markup' => array(\n 'keyboard' => array(array('São Paulo', 'Porto Alegre'),array('Curitiba','Florianópolis')),\n 'one_time_keyboard' => true)));\n } else if ($text === \"São Paulo\") {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => getWeather($text)));\n } else if ($text === \"Porto Alegre\") {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => getWeather($text)));\n } else if ($text === \"Florianópolis\") {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => getWeather($text)));\n } else if ($text === \"Curitiba\") {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => getWeather( $text)));\n } else {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => 'Desculpe, mas não entendi essa mensagem. :('));\n }\n } else {\n sendMessage(\"sendMessage\", array('chat_id' => $chat_id, \"text\" => 'Desculpe, mas só compreendo mensagens em texto'));\n }\n}", "public static function treatMessage($message) {\n return $message;\n }", "public function resolve($message);", "public static function ReadInput( $msg = '', $type = 'raw', $validateFunc = NULL, $isPass = FALSE, $useStar = FALSE )\n\t\t{\n\t\t\tif ( empty( $validateFunc ) ) $validateFunc = function( $val ){ return TRUE; };\n\t\t\tif ( !is_callable( $validateFunc ) ) $validateFunc = function( $val ){ return !empty($val); };\n\n\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$value = TO( PBStdIO::READ( $msg, $isPass, $useStar), $type );\n\t\t\t\tif ( $validateFunc($value) ) break;\n\t\t\t}\n\t\t\twhile( 1 );\n\n\t\t\treturn $value;\n\t\t}", "private function apply($message)\n {\n return strlen($message) > 0 ? $this->stack->current()->apply($message) : $message;\n }", "abstract protected function processMessage(array $data, array $message) : bool;", "public function process(Message $command);", "public abstract function parse($text);", "public function receive(Message $message, Connection $connection);", "function process_message($socket, $data){\r\n\tif($socket->process == true){\r\n\t\toutput($data);\r\n\t}\r\n}", "public function parsePayload()\n {\n return($this->_payload);\n }", "public function extractMessage($object);", "public function getMessages($f) { }", "public function process($data = [])\n {\n if ($this->_function == null) {\n throw new Exception\\Parser();\n }\n\n try {\n $function = $this->_function;\n return $function($data);\n } catch (\\Exception $e) {\n throw new Exception\\Parser($e);\n }\n }", "function parseMessage(string $message): array\n{\n $result = [\n 'code' => null,\n 'amount' => null,\n 'receiver' => null,\n ];\n\t\n\t\n\t// The first - check for yandex account number 41001XXXXX..XXX\n\t// Y.M. test accounts: 41003XXXXX..XXX\n preg_match_all('/(^(?:.*?\\D|))(4100[\\d\\-]{7,})((?:[\\s.,].*?|)$)/isu', $message, $matches, PREG_SET_ORDER);\n if (empty($matches)) {\n throw new \\Exception('Receiver not found');\n }\n if (count($matches) > 1) {\n throw new \\Exception('Multiple receivers found');\n }\n\t\n $result['receiver'] = preg_replace('/\\D+/', '', $matches[0][2]);\n\n\t// Exclude found entity from next searches\n $message = $matches[0][1] . $matches[0][count($matches[0]) - 1];\n\t\n\t\n\t// Detect amount of money transfered\n\t// It may have 1-2 fractional digits, and may not (integer amount)\n\t// Also fractional part may apeears in different formats - \".\", \",\" \n\t// or even smth like \"XXX р. YY к.\" (\"...YY коп\")\n\t$rurReg = 'р\\.|р\\b|руб|rub|rur|₽|&\\#8381;';\n\t$rurFracReg = 'к\\.|к\\b|коп|kop';\n preg_match_all(\n\t\t\"/(^(?:.*?\\\\s|))(\n\t\t\t(\\\\d+)((,|\\\\.|\\\\s*(?:{$rurReg})\\\\s*)(\\\\d{1,2})|)\\\\s*(?:{$rurReg}|{$rurFracReg})\n\t\t)((?:[\\\\s.,].*?|)$)/isux\", $message, $matches, PREG_SET_ORDER);\n if (empty($matches)) {\n throw new \\Exception('Amount not found');\n }\n if (count($matches) > 1) {\n throw new \\Exception('Multiple amounts found');\n }\n $result['amount'] = floatval($matches[0][3] . '.' . $matches[0][6]);\n\n $message = $matches[0][1] . $matches[0][count($matches[0]) - 1];\n\t\n\n\t// Detect verification code (verification password)\n\t// For now, we sincerelly believe it must be just set of 4-6 digits\n preg_match_all('/(^|\\D)(\\d{4,})(\\D|$)/isu', $message, $matches, PREG_SET_ORDER);\n if (empty($matches)) {\n throw new \\Exception('Code not found');\n }\n if (count($matches) > 1) {\n throw new \\Exception('Multiple codes found');\n }\n $result['code'] = $matches[0][2];\n\n return $result;\n}", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n $this->logMessage($postStr);\n\n $messageHandler=new MessageHandler();\n $messageBase=$messageHandler.serialize($postStr);\n $messageToReturn=new MessageBase();\n $messageToReturn->ToUserName=$messageBase->FromUserName;\n $messageToReturn->FromUserName=$messageBase->ToUserName;\n $messageToReturn->CreateTime=time();\n\n if($messageBase->MsgType == \"text\"){\n $messageToReturn->MsgType=\"image\";\n $messageBase->Message=new imageMessage();\n $stor = new SaeStorage();\n $url = $stor->getUrl($domain,$fileDataName);\n $messageBase->Message->PicUrl=$url;\n\n }else{\n $messageToReturn->MsgType=\"text\";\n $messageBase->Message=new textMessage();\n $messageBase->Message->Content=\"try send text message.\";\n\n }\n\n echo $messageHandler->deserialize($messageToReturn);\n/*\n\n\n //extract post data\n if (!empty($postStr)){\n\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml><ToUserName><![CDATA[%s]]></ToUserName><FromUserName><![CDATA[%s]]></FromUserName><CreateTime>%s</CreateTime><MsgType><![CDATA[%s]]></MsgType><Content><![CDATA[%s]]></Content></xml>\"; \n if(!empty( $keyword ))\n {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else{\n echo \"Input something...\";\n }\n\n }else {\n echo \"\";\n exit;\n }*/\n}", "abstract public function act($message);", "public function onRead() {\n\t\tstart:\n\t\tif ($this->type === 'udp') {\n\t\t\t$this->onUdpPacket($this->read($this->highMark));\n\t\t}\n\t\tif ($this->state === self::STATE_ROOT) {\n\t\t\tif (false === ($hdr = $this->readExact(2))) {\n\t\t\t\treturn; // not enough data\n\t\t\t}\n\t\t\t$this->pctSize = Binary::bytes2int($hdr, true);\n\t\t\t$this->setWatermark($this->pctSize);\n\t\t\t$this->state = self::STATE_PACKET;\n\t\t}\n\t\tif ($this->state === self::STATE_PACKET) {\n\t\t\tif (false === ($pct = $this->readExact($this->pctSize))) {\n\t\t\t\treturn; // not enough data\n\t\t\t}\n\t\t\t$this->state = self::STATE_ROOT;\n\t\t\t$this->setWatermark(2);\n\t\t\t$this->onUdpPacket($pct);\n\t\t}\n\t\tgoto start;\n\t}", "public function nativeMessageProcessing($message): array\n\t{\n\t\treturn $message;\n\t}", "private function readMessage()\n {\n $fromIp = \"\";\n $fromPort = 0;\n $msg = null;\n \n if (!@socket_recvfrom($this->socket, $msg, 65535, 0, $fromIp, $fromPort)) {\n $err_no = socket_last_error($this->socket);\n if ($err_no == 4) {\n \techo \"\\n\\nCaught SIGINT, quiting...\\n\";\n \t$this->keepRunning = false;\n }\n }\n\n if (!$msg) {\n \treturn false;\n }\n\n if ($this->fromIp === null && $this->fromPort === null) {\n \t$this->fromIp = $fromIp;\n \t$this->fromPort = $fromPort;\n } else if ($this->fromIp != $fromIp || $this->fromPort != $fromPort) {\n \tdie(sprintf(\"Error: sender changed from %s:%d to %s:%d, aborting...\\n\", $this->fromIp, $this->fromPort, $fromIp, $fromPort));\n }\n \n return [\n \t\"timestamp\"\t=> microtime(true),\n \t\"msg\" \t\t=> $msg,\n \t\"from_ip\" \t=> $fromIp,\n \t\"from_port\"\t=> $fromPort\n ];\n }", "public function receive(): void\n {\n $connection = $this->getConnection();\n $node = $connection->getCurrentNode();\n\n do {\n $this->_run($node);\n } while (\n false === $connection->isDisconnected() &&\n true !== $node->isMessageComplete()\n );\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }" ]
[ "0.6483314", "0.6483314", "0.64683837", "0.6426685", "0.6159424", "0.59597224", "0.5952275", "0.59307355", "0.59205276", "0.5917634", "0.5906658", "0.58068544", "0.58000076", "0.57836914", "0.57433695", "0.57396555", "0.5724019", "0.5666338", "0.5665814", "0.5661805", "0.5646301", "0.56190383", "0.55810565", "0.557895", "0.55329657", "0.5530129", "0.55044097", "0.55044097", "0.5496066", "0.54720825", "0.5457355", "0.5456394", "0.5429876", "0.5424135", "0.5407", "0.5359788", "0.53529155", "0.5336388", "0.5336388", "0.5336388", "0.5336388", "0.53092706", "0.52816254", "0.52723694", "0.5256931", "0.52525705", "0.5242675", "0.5240425", "0.5240425", "0.5240425", "0.52361655", "0.522917", "0.52253056", "0.5216628", "0.52026385", "0.5164102", "0.5152721", "0.5100682", "0.5091978", "0.5086632", "0.5086632", "0.5080442", "0.50635517", "0.5050207", "0.504812", "0.5047117", "0.5044081", "0.5043988", "0.50382465", "0.50372285", "0.50364393", "0.50301397", "0.5021192", "0.5015732", "0.500886", "0.5004092", "0.49991372", "0.49964464", "0.49376553", "0.4933977", "0.4933859", "0.4929198", "0.49288255", "0.4920839", "0.49182925", "0.49176216", "0.49138153", "0.49060312", "0.49039447", "0.49029335", "0.49003008", "0.48980093", "0.48812398", "0.48795554", "0.4874735", "0.4874357", "0.48728096", "0.48674205", "0.48674205", "0.4866678" ]
0.758607
0
Gets the right kind of payload parser.
private function getPayloadParser(array $message) { if (isset($message['Body']) === true) { $body = \GuzzleHttp\json_decode($message['Body'], true); if (isset($body['Type']) === true && $body['Type'] === 'Notification') { return new SqsSnsPayloadParser(); } } return new SqsStandardPayloadParser(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parsePayload()\n { \n return $this->_payload;\n }", "public function getMessageType()\n { \n $this->_exploded_payload = explode(\"\\n\",$this->_payload);\n \n foreach($this->_exploded_payload as $line)\n {\n $exploded = explode(\"|\",$line);\n \n if($exploded[0] == 'MSH')\n {\n return($exploded[8]);\n }\n }\n }", "public function parsePayload()\n {\n return($this->_payload);\n }", "protected function _getParser() {}", "public function getParser() {}", "public function getParser() {}", "public function getParser() {}", "public function getParser($contentType)\n {\n return isset($this->parsers[$contentType]) ? $this->parsers[$contentType] : null;\n }", "public function getStreamParser() {}", "public function getStreamParser() {}", "public function getParser(): ?ParserInterface;", "public function getParser() {\n $parser = $this->parser;\n if (is_null($this->parser)) {\n $parser = new HypermediaParser();\n }\n\n return $parser;\n }", "function getParser()\n {\n return $this->parser;\n }", "public function get_payload() {\n\t\tif ( ! empty( $this->data->payload ) )\n\t\t\treturn json_decode( $this->data->payload );\n\t\telse\n\t\t\treturn false;\n\t}", "protected function getParser()\n {\n return $this->app->make(DocumentParser::class);\n }", "public function getParser(): Parser\n {\n\n return $this->parser;\n\n }", "public function getParser()\n {\n return $this->parser;\n }", "public function getParser()\n {\n return $this->parser;\n }", "protected function getParser()\n {\n if (class_exists(ParserFactory::class)) {\n return (new ParserFactory())->create(ParserFactory::PREFER_PHP7);\n }\n\n //return new Parser(new Lexer());\n }", "public function getType() {\n /* could not have header */\n return $this->payload->getFormatType();\n }", "public function parseType()\n {\n if ( ! $this->type ) {\n $this->stream->resetPointer();\n\n switch ( $this->stream->read(2) ) {\n case \"BM\":\n return $this->type = 'bmp';\n case \"GI\":\n return $this->type = 'gif';\n case chr(0xFF) . chr(0xd8):\n return $this->type = 'jpeg';\n case \"\\0\\0\":\n switch ( $this->readByte($this->stream->peek(1)) ) {\n case 1:\n return $this->type = 'ico';\n case 2:\n return $this->type = 'cur';\n }\n\n return false;\n\n case chr(0x89) . 'P':\n return $this->type = 'png';\n case \"RI\":\n if ( substr($this->stream->read(10), 6, 4) == 'WEBP' ) {\n return $this->type = 'webp';\n }\n\n return false;\n case'8B':\n return $this->type = 'psd';\n case \"II\":\n case \"MM\":\n return $this->type = 'tiff';\n default:\n $this->stream->resetPointer();\n\n // Keep reading bytes until we find '<svg'.\n while ( true ) {\n $byte = $this->stream->read( 1 );\n if ( '<' === $byte && 'svg' === $this->stream->peek( 3 ) ) {\n $this->type = 'svg';\n return $this->type;\n }\n }\n return false;\n }\n }\n\n return $this->type;\n }", "public function getParser()\n\t{\n\t\treturn $this->root->parser;\n\t}", "protected final function _type_from_payload ($payload) {\n return 'flg_'.$payload->name();\n }", "public function get_payload();", "public function parser()\n\t{\n\t\tif ( ! $this->parser)\n\t\t{\n\t\t\t$this->parser = $this->_app->get_object('Parser');\n\t\t}\n\t\treturn $this->parser;\n\t}", "public function parsePayload()\n {\n $_MTI_url = 'http://ii.nlm.nih.gov/cgi-bin/II/Interactive/interactiveMTI.pl'; \n $dom = new DOMDocument;\n $fields = array('InputText' => urlencode($this->_payload));\n\n $curl_ressource = curl_init();\n \n curl_setopt($curl_ressource,CURLOPT_URL, $_MTI_url);\n curl_setopt($curl_ressource,CURLOPT_POST, count($fields));\n curl_setopt($curl_ressource,CURLOPT_POSTFIELDS, $fields);\n curl_setopt($curl_ressource, CURLOPT_RETURNTRANSFER, true); \n curl_setopt($curl_ressource, CURLOPT_TIMEOUT, 40);\n \n // Parses result html to extract MTI semantical parser results\n $dom->loadHTML(curl_exec($curl_ressource));\n $pres = $dom->getElementsByTagName('pre');\n \n foreach($pres as $pre)\n if(strstr($pre->nodeValue,\"Command: MTI\"))\n {\n $array = explode(\"\\n\", $pre->nodeValue);\n array_shift($array);\n array_shift($array);\n array_shift($array);\n array_shift($array);\n $result = implode(\"\\n\", $array); \n $this->_parsed_payload = $result; \n }\n \n curl_close($curl_ressource);\n \n return $result;\n }", "protected function getFormat(string $payload): string\n {\n if (\\is_file($file = $payload)) {\n $format = \\pathinfo($file, \\PATHINFO_EXTENSION);\n } else {\n // try if content is json\n \\json_decode($payload);\n\n if (\\json_last_error() === \\JSON_ERROR_NONE) {\n return 'json';\n }\n\n $format = (new finfo(\\FILEINFO_MIME_TYPE))->buffer($payload);\n }\n\n return self::$supportedMimeTypes[$format] ?? (string) $format;\n }", "protected function getParserService()\n {\n $class = $this->getParameter('parser.class');\n $instance = new $class($this->getI18nService());\n\n return $instance;\n }", "protected function getMethodForPayload()\n {\n if (! $this->payload) {\n return 'noContent';\n }\n\n $method = str_replace('_', '', strtolower($this->payload->getStatus()));\n return method_exists($this, $method) ? $method : 'unknown';\n }", "function _get_type() {\n\t\treturn $this->type();\n\n\t}", "function getPayload();", "public function getParsedBody()\n {\n if ($this->bodyParsed) {\n return $this->bodyParsed;\n }\n\n if (!$this->body) {\n return null;\n }\n\n $mediaType = $this->getMediaType();\n $body = (string)$this->getBody();\n\n if (isset($this->bodyParsers[$mediaType]) === true) {\n $parsed = $this->bodyParsers[$mediaType]($body);\n\n if (!is_null($parsed) && !is_object($parsed) && !is_array($parsed)) {\n throw new RuntimeException('Request body media type parser return value must be an array, an object, or null');\n }\n $this->bodyParsed = $parsed;\n }\n\n return $this->bodyParsed;\n }", "public function parseData()\n {\n $jsonMessage = json_decode($this->payload);\n // :: Check if handler contains fully qualified namespace\n if (strpos($jsonMessage->handler, '\\\\') !== false) {\n $parts = explode('\\\\', $jsonMessage->handler);\n $jsonMessage->handler = $parts[count($parts) - 1];\n }\n $exploded = explode('@', $jsonMessage->handler);\n $obj = new StdClass();\n $obj->class = 'Ktbots\\\\Core\\\\Handlers\\\\' . $exploded[0];\n $obj->method = $exploded[1];\n $obj->value = $jsonMessage->value;\n return $obj;\n }", "public function autoParse()\n {\n $type = $this->getMimeType();\n $contents = '';\n\n if ($type == 'application/json' || $type == 'text/json') {\n $contents = $this->parseJson();\n } elseif ($type == 'application/xml' || $type == 'text/xml') {\n $contents = $this->parseXml();\n } elseif ($type == 'application/x-yaml' || $type == 'text/yaml') {\n $contents = $this->parseYaml();\n } else {\n $contents = $this->getContents();\n }\n\n return $contents;\n }", "public function getPayload();", "public function getPayload();", "public function getPayload();", "public function getParserFactory() {}", "public function parse($payload)\n {\n return json_decode($payload, true);\n }", "public function getPayload($dflt=null)\n { return $this->get('payload',$dflt); }", "function getType() { return $this->readType(); }", "public function getType()\n {\n $type = $this->data['type'];\n if (null === $type) {\n $type = Reader\\Reader::detectType($this->getDomDocument());\n $this->setType($type);\n }\n return $type;\n }", "public function papier(){\n\t\treturn $this->dataInfos['XMLPM']['PAPIER']['TYPE'];\n\t}", "function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}", "protected function _type() {\r\n\r\n $urlParts = explode('/', $this->url);\r\n\r\n $type = array_pop($urlParts);\r\n\r\n return $type;\r\n\r\n }", "protected abstract function _body_from_payload ($payload);", "public function getPayload(): ?string;", "public function getPayloadDeliveryPlatform()\n {\n if (array_key_exists(\"payloadDeliveryPlatform\", $this->_propDict)) {\n if (is_a($this->_propDict[\"payloadDeliveryPlatform\"], \"\\Beta\\Microsoft\\Graph\\Model\\PayloadDeliveryPlatform\") || is_null($this->_propDict[\"payloadDeliveryPlatform\"])) {\n return $this->_propDict[\"payloadDeliveryPlatform\"];\n } else {\n $this->_propDict[\"payloadDeliveryPlatform\"] = new PayloadDeliveryPlatform($this->_propDict[\"payloadDeliveryPlatform\"]);\n return $this->_propDict[\"payloadDeliveryPlatform\"];\n }\n }\n return null;\n }", "public function getPayload()\n {\n return @json_decode($this->body);\n }", "public function getParser(string $type): ParserContract\n {\n if (isset(self::$supportedParsers[$type])) {\n return new self::$supportedParsers[$type]();\n }\n\n if (isset(self::$supportedMimeTypes[$type])) {\n $class = self::$supportedParsers[self::$supportedMimeTypes[$type]];\n\n if (\\is_string($class)) {\n return new $class();\n }\n\n return $class;\n }\n\n throw new NotSupportedException(\\sprintf('Given extension or mime type [%s] is not supported.', $type));\n }", "public function getPayload(): string\n {\n return $this->payload;\n }", "public function type(): ?string\n {\n if (isset($this->type)) {\n return $this->type;\n }\n if (Str::startsWith($this->mimeType(), 'image')) {\n return $this->type = 'image';\n }\n if (Str::startsWith($this->mimeType(), 'text')) {\n return $this->type = 'text';\n }\n if (Str::startsWith($this->mimeType(), 'audio')) {\n return $this->type = 'audio';\n }\n if (Str::startsWith($this->mimeType(), 'video')) {\n return $this->type = 'video';\n }\n if ($this->mimeType() === MimeType::fromExtension('pdf')) {\n return $this->type = 'pdf';\n }\n if ($this->matchExtensions(['doc', 'docx', 'odt', 'odm', 'ott'])) {\n return $this->type = 'document';\n }\n if ($this->matchExtensions(['ppt', 'pptx', 'pps', 'odp', 'otp'])) {\n return $this->type = 'presentation';\n }\n if ($this->matchExtensions(['xls', 'xlsx', 'ods', 'ots'])) {\n return $this->type = 'spreadsheet';\n }\n if ($this->matchExtensions(['gz', '7z', 'bz2', 'rar', 'tar', 'zip'])) {\n return $this->type = 'archive';\n }\n return null;\n }", "public function get_type();", "function getType ()\n\t{\n\t\tswitch ( $this->get () )\n\t\t{\n\t\t\tcase self::DB_TOKEN:\n\t\t\t\treturn self::DB_TOKEN ;\n\n\t\t\tcase self::SERVICES_TOKEN:\n\t\t\t\treturn self::SERVICES_TOKEN ;\n\n\t\t\tcase self::REST_TOKEN:\n\t\t\t\treturn self::REST_TOKEN ;\n\n\t\t\tcase self::DEV_TOKEN:\n\t\t\t\treturn self::DEV_TOKEN ;\n\t\t}\n\n\t\treturn null ;\n\t}", "private function getTypeOfRequest() {\n\t\t\n\t\t// If this is a POST request, likely it's Google, but let's check to confirm\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\ttry {\n\t\t\t\t$json = file_get_contents($this->inputStream);\n\t\t\t\t$action = json_decode($json, true);\n\t\t\t\tif ($action == '' or $action == null) {\n\t\t\t\t\treturn 'other';\n }\n // Confirm that this request matches the projectID // TODO\n\t\t\t\t$this->decodedWebhook = $action; // Make the webhook JSON available to the class\n\t\t\t\treturn 'webhook';\n\t\t\t}\n\t\t\tcatch (Exception $e) {\n\t\t\t\treturn 'other';\n\t\t\t}\n\t\t}\n return 'other'; // Else, just return something else\n\t}", "public function getPayload()\n {\n return $this->source['payload'];\n }", "abstract protected function getPacketType();", "public function get_payload_request();", "public function getPayload()\n {\n return $this->payload;\n }", "public function getPayload()\n {\n return $this->payload;\n }", "public function getPayload()\n {\n return $this->payload;\n }", "public function getPayload()\n {\n return $this->payload;\n }", "public function getPayload()\n {\n return $this->payload;\n }", "public function getPayload() {\n return $this->_payload;\n }", "public function getPayload() {\n return $this->payload;\n }", "public function getPayload() {\n return $this->payload;\n }", "private function getYamlParser()\n\t{\n\t\tif (!$this->yamlParser) {\n\t\t\t$this->yamlParser = new Yaml();\n\t\t}\n\n\t\treturn $this->yamlParser;\n\t}", "public function getParsedBody()\n {\n if (! $this->parsedBody) {\n $parser = new BodyParser($this->getHeaderLine('Content-Type'));\n $this->parsedBody = $parser->parse($this->getBody());\n }\n return $this->parsedBody;\n }", "public function getParserModel($type)\n {\n $parserModels = $this->getParserModels();\n\n if (!isset($parserModels[$type])) {\n return false;\n }\n\n $model = Mage::getModel($parserModels[$type]);\n\n return $model;\n }", "private function get_type() {\n\n\t}", "function readType() { return $this->_type; }", "abstract public function parse($data, $type);", "public function acceptType() {\n\t\treturn $this->getDecoder()->acceptType();\n\t}", "public function payload();", "public function payload();", "public function getPayloadName(): ?string {\n $val = $this->getBackingStore()->get('payloadName');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'payloadName'\");\n }", "public function getPayload(): ?StreamInterface {\n $val = $this->getBackingStore()->get('payload');\n if (is_null($val) || $val instanceof StreamInterface) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'payload'\");\n }", "public function setMessageType()\n {\n return ($this->isMessageTypeArray()) ? new Message\\MessageArray() : new Message\\Pusher\\Pusher();\n }", "public function getType()\n {\n $explode = explode('.', $this->name);\n return $type = array_first($explode);\n }", "public function getPayloadConfig($type);", "public function make($payload)\n {\n $payload = container($payload);\n\n switch(true)\n {\n case $payload->has('canon_url'):\n return new BitbucketPayload($payload);\n case $payload->has('ref'):\n return new GithubPayload($payload);\n default:\n throw new \\UnexpectedValueException('Can\\'t detect payload: '.$payload);\n }\n }", "public function getType(){\n return get_class($this->current());\n }", "public function GetBodyType() {\n\n return isset($this->Headers['CONTENT-TYPE'])\n ? trim(explode(';', $this->Headers['CONTENT-TYPE'])[0])\n : ''; // maybe 'application/octet-stream' as default?\n }", "public function getType()\r\n\t{\r\n\t\treturn isset($this->parsedQuery['querytype']) ? strtolower($this->parsedQuery['querytype']) : null;\r\n\t}", "protected function type()\n {\n $this->match(Lexer::T_TYPE);\n\n return $this->lexer->value();\n }", "function getKind() { return $this->readKind(); }", "public function getPayload()\r\n\t{\r\n\t\treturn $this->getDecodedBody()->getBody();\r\n\t}", "public function get_type(): string;", "public function getPayloadId(): ?string {\n $val = $this->getBackingStore()->get('payloadId');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'payloadId'\");\n }", "public function getBodyType(): string\n {\n return $this->requireString('body_type');\n }", "public static function get_post_type(){\n global $TFUSE;\n return $TFUSE->ext->seek->get_post_type();\n }", "final protected function get_type() {\n return $this->type;\n }", "public function get_type() { return substr( strrchr( get_called_class(), '\\\\' ), 1 ); }", "public function getPayerType() {\n return $this->_payerType;\n }", "public function getType()\n\t{\n\t\treturn empty($this->type) ? $this->guessType() : $this->type;\n\t}", "function readKind() { return $this->_kind; }", "public function getTargetType(): ?string\n {\n return $this->get(ConfigUtil::TARGET_TYPE);\n }", "public function getType()\n {\n $result = \"\";\n if (preg_match('/int/',$this->type))\n $result = \"int\";\n\n if (preg_match('/year/',$this->type))\n $result = \"int\";\n\n if (preg_match('/integer/',$this->type))\n $result = \"int\";\n\n if (preg_match('/tynyint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/smallint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/mediumint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/bigint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/varchar/',$this->type))\n $result = \"string\";\n\n if (preg_match('/char/',$this->type))\n $result = \"string\";\n\n if (preg_match('/text/',$this->type))\n $result = \"string\";\n\n if (preg_match('/tyntext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/mediumtext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/longtext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/char/',$this->type))\n $result = \"string\";\n\n if (preg_match('/enum/',$this->type))\n $result = \"enum\";\n\n if (preg_match('/set/',$this->type))\n $result = \"string\";\n\n if (preg_match('/date/',$this->type))\n $result = \"date\";\n\n if (preg_match('/time/',$this->type))\n $result = \"time\";\n\n if (preg_match('/datetime/',$this->type))\n $result = \"datetime\";\n\n if (preg_match('/decimal/',$this->type))\n $result = \"float\";\n\n if (preg_match('/float/',$this->type))\n $result = \"float\";\n\n if (preg_match('/double/',$this->type))\n $result = \"double\";\n\n if (preg_match('/real/',$this->type))\n $result = \"real\";\n\n if (preg_match('/fixed/',$this->type))\n $result = \"float\";\n\n if (preg_match('/numeric/',$this->type))\n $result = \"float\";\n\n if (empty($result)){\n // $result = $this->type;\n $result = \"string\";\n }\n\n // TODO EVALUATES BIT, TIMESTAMP, VARBINARY, BLOB MySQL data types\n return $result;\n }", "protected function handlePayload($payload)\n {\n if(is_null($payload)) {\n return $this->buildEmptyResponse();\n }\n\n if(is_bool($payload)) {\n return $this->buildEmptyResponse();\n }\n\n if(is_string($payload)) {\n return $this->buildStringResponse($payload);\n }\n\n return $this->isIlluminateResource($payload)\n ? $this->buildResponse($payload) \n : $this->buildResponse($this->intoResource($payload));\n }", "public function getHandler() {\n\t\t/** @var \\Cundd\\Rest\\HandlerInterface $handler */\n\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($this->dispatcher->getPath());\n\n\t\t// Check if an extension provides a Handler\n\t\t$handlerClass = 'Tx_' . $extension . '_Rest_Handler';\n\t\tif (!class_exists($handlerClass)) {\n\t\t\t$handlerClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\Handler';\n\t\t}\n\n\t\t// Get the specific builtin handler\n\t\tif (!class_exists($handlerClass)) {\n\t\t\t$handlerClass = 'Cundd\\\\Rest\\\\Handler\\\\' . $extension . 'Handler';\n\t\t\t// Get the default handler\n\t\t\tif (!class_exists($handlerClass)) {\n\t\t\t\t$handlerClass = 'Cundd\\\\Rest\\\\HandlerInterface';\n\t\t\t}\n\t\t}\n\t\t$handler = $this->get($handlerClass);\n\t\t//$handler->setRequest($this->dispatcher->getRequest());\n\t\treturn $handler;\n\t}" ]
[ "0.609541", "0.59994483", "0.5939426", "0.58099246", "0.5763826", "0.5763408", "0.5763408", "0.5687573", "0.56246287", "0.56246287", "0.5624324", "0.5578273", "0.5545322", "0.5501659", "0.5491196", "0.5450238", "0.5419508", "0.5419508", "0.5393875", "0.53603685", "0.53567004", "0.53317857", "0.5300072", "0.52609485", "0.52129257", "0.5212313", "0.5171824", "0.5145868", "0.51308244", "0.5114364", "0.5114216", "0.5103435", "0.50936294", "0.5092171", "0.5083027", "0.5083027", "0.5083027", "0.50510263", "0.50492996", "0.5041695", "0.50309706", "0.5020625", "0.5001512", "0.49972203", "0.49887806", "0.49725118", "0.4965716", "0.49427113", "0.49303347", "0.49247813", "0.49007025", "0.49006835", "0.48828852", "0.4874799", "0.48709083", "0.48705864", "0.4866462", "0.48626617", "0.4857197", "0.4857197", "0.4857197", "0.4857197", "0.4857197", "0.48553383", "0.48399618", "0.48399618", "0.48379293", "0.4813393", "0.48021683", "0.48017913", "0.4795226", "0.478796", "0.47856778", "0.47754335", "0.47754335", "0.47734585", "0.47718963", "0.4770861", "0.4764669", "0.4761595", "0.4750525", "0.47463548", "0.47391888", "0.47384486", "0.47377387", "0.4723635", "0.47234008", "0.47104686", "0.47027826", "0.46998936", "0.46674243", "0.46566093", "0.46385467", "0.4636596", "0.46363592", "0.4636254", "0.4635827", "0.46326986", "0.46230903", "0.4613378" ]
0.5100535
32
Receives messages from sqs queue.
private function receiveMessages(): array { $result = SqsClient::instance()->receiveMessage( [ 'AttributeNames' => ['SentTimestamp'], 'MaxNumberOfMessages' => 1, 'MessageAttributeNames' => ['All'], 'QueueUrl' => $this->getSqsUrl(), 'WaitTimeSeconds' => 20, ] ); $messages = $result->get('Messages'); if (isset($messages) === true) { return $messages; } return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listen()\n {\n $this->open();\n $callback = function(AMQPMessage $message) {\n $job = $this->unserialize($message->body);\n if ($this->getQueue()->run($job)) {\n $message->delivery_info['channel']->basic_ack($message->delivery_info['delivery_tag']);\n }\n };\n $this->_channel->basic_qos(null, 1, null);\n $this->_channel->basic_consume($this->queueName, '', false, false, false, false, $callback);\n while(count($this->_channel->callbacks)) {\n $this->_channel->wait();\n }\n }", "function read_messages_from_queue($queue_url, $region, $queue_name)\n {\n $sqs_client = new Aws\\Sqs\\SqsClient([\n 'version' => 'latest',\n 'region' => \"$region\"\n ]);\n\n try\n {\n $sqs_msgs = $sqs_client->receiveMessage([\n 'QueueUrl' => $queue_url\n ]);\n return $sqs_msgs;\n }\n catch(\\Aws\\Sqs\\Exception\\SqsException $sqs_exception)\n {\n echo \"Failed to read message to queue: $queue_name, \" . $sqs_exception->getMessage() . \"\\n\";\n exit(1);\n }\n }", "public function consumeQueue()\n {\n try {\n $queue = Di::getDefault()->get('queue');\n\n /** @var \\Aws\\Result $messages*/\n $messages = $this->getMessagesFromQueue($queue);\n\n if (count($messages->get('Messages')) == 0) {\n return;\n }\n\n $queueName = (new QueueService())->getFullQueueName('notifications');\n foreach ($messages->get('Messages') as $message) {\n $idList = json_decode($message['Body'], true);\n\n if (!empty($idList)) {\n $this->trySendNotificationsFromMessage($idList);\n }\n\n $queue->deleteMessage([\n 'QueueUrl' => $queue->getQueueUrl(['QueueName' => $queueName])->get('QueueUrl'),\n 'ReceiptHandle' => $message['ReceiptHandle'],\n ]);\n }\n } catch (AwsException $e) {\n Di::getDefault()->get('logger')->error($e->getMessage());\n } catch (\\Exception $e) {\n // Do nothing\n } catch (\\Throwable $e) {\n // Do nothing\n }\n\n sleep(5);\n $this->consumeQueue();\n }", "public function listen()\n {\n $this->log->addInfo('Begin listen routine');\n \n $connection = new AMQPConnection('localhost', 5672, 'guest', 'guest');\n $channel = $connection->channel();\n \n $channel->queue_declare(\n 'invoice_queue', #queue\n false, #passive\n true, #durable, make sure that RabbitMQ will never lose our queue if a crash occurs\n false, #exclusive - queues may only be accessed by the current connection\n false #auto delete - the queue is deleted when all consumers have finished using it\n );\n \n /**\n * don't dispatch a new message to a worker until it has processed and \n * acknowledged the previous one. Instead, it will dispatch it to the \n * next worker that is not still busy.\n */\n $channel->basic_qos(\n null, #prefetch size - prefetch window size in octets, null meaning \"no specific limit\"\n 1, #prefetch count - prefetch window in terms of whole messages\n null #global - global=null to mean that the QoS settings should apply per-consumer, global=true to mean that the QoS settings should apply per-channel\n );\n \n /**\n * indicate interest in consuming messages from a particular queue. When they do \n * so, we say that they register a consumer or, simply put, subscribe to a queue.\n * Each consumer (subscription) has an identifier called a consumer tag\n */ \n $channel->basic_consume(\n 'invoice_queue', #queue\n '', #consumer tag - Identifier for the consumer, valid within the current channel. just string\n false, #no local - TRUE: the server will not send messages to the connection that published them\n false, #no ack, false - acks turned on, true - off. send a proper acknowledgment from the worker, once we're done with a task\n false, #exclusive - queues may only be accessed by the current connection\n false, #no wait - TRUE: the server will not respond to the method. The client should not wait for a reply method\n array($this, 'process') #callback\n );\n \n $this->log->addInfo('Consuming from queue');\n \n while(count($channel->callbacks)) {\n $this->log->addInfo('Waiting for incoming messages');\n $channel->wait();\n }\n \n $channel->close();\n $connection->close();\n }", "public function receive(): void\n {\n $connection = $this->getConnection();\n $node = $connection->getCurrentNode();\n\n do {\n $this->_run($node);\n } while (\n false === $connection->isDisconnected() &&\n true !== $node->isMessageComplete()\n );\n }", "public function receiveMessages($queueId, $max = 1, $options = null);", "public function getReceivedMessages();", "public function listen($queueName);", "public function listen(): void\n {\n $this->logger->debug('Start listening to the queue.');\n $handler = function (MessageInterface $message) {\n $this->worker->process($message, $this);\n };\n\n $this->driver->subscribe($handler);\n $this->logger->debug('Finish listening to the queue.');\n }", "protected function receiveAWS() {\n // @todo DI\n $message = Message::fromRawPostData();\n\n if (config('tenfour.messaging.validate_sns_message')) {\n // Validate the message and log errors if invalid.\n $validator = new MessageValidator();\n\n try {\n $validator->validate($message);\n } catch (InvalidSnsMessageException $e) {\n Log::info('SNS Message Validation Error: ' . $e->getMessage());\n // Pretend we're not here if the message is invalid.\n abort(404);\n }\n }\n\n // Check the type of the message and handle the subscription.\n if ($message['Type'] === 'SubscriptionConfirmation') {\n Log::info('SNS Subscription Confirmed');\n // Confirm the subscription by sending a GET request to the SubscribeURL\n file_get_contents($message['SubscribeURL']);\n }\n\n if ($message['Type'] === 'UnsubscribeConfirmation') {\n Log::info('SNS Unsubscribe');\n // Confirm the subscription by sending a GET request to the SubscribeURL\n file_get_contents($message['SubscribeURL']);\n }\n\n if ($message['Type'] === 'Notification') {\n $emailMessage = json_decode($message['Message'], true);\n $original_content = $emailMessage['content'];\n $emailMessage = new EmailMessage(['raw' => $original_content]);\n\n // Output first text/plain part\n $plainText = null;\n $html = null;\n foreach (new \\RecursiveIteratorIterator($emailMessage) as $part) {\n try {\n if (strtok($part->contentType, ';') == 'text/plain') {\n $plainText = $part;\n break;\n }\n if (strtok($part->contentType, ';') == 'text/html') {\n $html = $part;\n }\n } catch (\\Zend\\Mail\\Exception $e) {\n Log::warning($e);\n }\n }\n\n $from = $emailMessage->getHeader('From')->getAddressList()->current()->getEmail();\n $to = $emailMessage->getHeader('To')->getAddressList()->current()->getEmail();\n\n if ($plainText) {\n Log::info(\"Received message (plain text): \". $message['MessageId']);\n $this->saveEmail($from, $plainText->getContent(), $to, $message['MessageId'], 'aws-ses-sns');\n }\n elseif ($html) {\n Log::info(\"Received message (html): \". $message['MessageId']);\n $text = strip_tags($html->getContent());\n $this->saveEmail($from, $text, $to, $message['MessageId'], 'aws-ses-sns');\n }\n else {\n $parts = preg_split(\"/\\n\\r?\\n/\", $original_content);\n\n if (count($parts)>1) {\n Log::info(\"Received message (regex): \". $message['MessageId']);\n\n $text = strip_tags($parts[1]);\n\n $this->saveEmail($from, $text, $to, $message['MessageId'], 'aws-ses-sns');\n } else {\n app('sentry')->captureMessage(\"Could not parse weird email: %s\", $message);\n\n Log::info(\"No plain text or html found for \" . $message['MessageId'], ['original_content' => $original_content]);\n }\n }\n }\n }", "public function handle()\n {\n MessagingAmqpService::declareSysQueues();\n ExchangeService::bindAllExchanges();\n MessagingAmqpService::listen(\n config('amqp.log_queue'),\n [ MessageService::class, 'consumeLog' ]\n );\n }", "public function get()\n {\n $result = $this->sqs_client->ReceiveMessage([\n 'QueueUrl' => 'https://sqs.us-east-1.amazonaws.com/947603853016/rs-video-harvester.fifo'\n ]);\n\n return TRUE;\n }", "public function listen()\n {\n $this->openWorker();\n while (!Signal::isExit()) {\n if (($payload = $this->pop(3)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n }\n $this->closeWorker();\n }", "public function processMessages() {\n while ( ( $execution = array_shift($this->queue) ) ) { \n $execution->event('continue');\n $this->messagesDelivered++;\n }\n }", "private function ProcessPendingMessages() {\n\t\twhile($message = $this->GetRedisConn()->rPop($this->GetChannel())) {\n\t\t\t$this->ProcessMessage($message);\n\t\t}\n\t}", "function startQueue(){\n\n // Maintain the array checkLogQ as a FIFO buffer with length 4.\n // When a new entry is added, remove oldest entry and shuffle.\n function addCheckLog($message){\n global $checkLogQ;\n $length = 4;\n // If checkLogQ size is smaller than 4 add the message\n if(count($checkLogQ)<$length){\n $checkLogQ[] = $message;\n }\n // If checkLogQ size is bigger than 4 - Remove the oldest message and add the new one\n else{\n array_shift($checkLogQ);\n $checkLogQ[] = $message;\n }\n }\n // Prints all checkLogQ messages to the console \n function printCheckLogQ(){\n global $checkLogQ;\n foreach($checkLogQ as $message){\n print($message);\n }\n $checkLogQ = array(); // reset a variable to an empty array\n }\n \n try{\n while(true){\n addCheckLog(date('Y/m/d H:i:s').\" Awaiting a message...\\n\");\n\n // Receive messages from queue, maximum waits for 20 seconds for message\n // receive_request - contain all the queue messages\n global $sqs;\n $receive_request = $sqs->receiveMessage(array(\n 'QueueUrl' => ds_config(\"QUEUE_URL\"),\n 'WaitTimeSeconds' => 20,\n 'MaxNumberOfMessages' => 10\n ));\n // Count the amount of messages received\n $msgCount = 0;\n if($receive_request->getPath('Messages') !== NULL){\n $msgCount = count($receive_request->getPath('Messages'));\n }\n addCheckLog(date('Y/m/d H:i:s').\" found $msgCount message(s)\\n\");\n // If at least one message has been received\n if ($msgCount!=0) {\n printCheckLogQ();\n foreach ($receive_request->getPath('Messages') as $msg) {\n messageHandle($msg, $receive_request);\n }\n }\n }\n }\n catch (Exception $e) {\n printCheckLogQ();\n print(date('Y/m/d H:i:s').\" Queue receive error: $e\");\n sleep(5);\n global $restart;\n $restart = true;\n }\n }", "public function receive()\n {\n $messages = array();\n\n if (apcu_exists($this->key)) {\n $messages = apcu_fetch($this->key);\n apcu_delete($this->key);\n }\n\n return $messages;\n }", "public function Run()\n\t{\n\t\t$q1 = new AMQPQueue($this->cnn);\n\t\t$q1->declare('queue1');\n\t\t$q1->purge('queue1');\n\t\t\n\t\t$options = array(\n\t\t 'min' => 0,\n\t\t 'max' => 10,\n\t\t 'ack' => true\n\t\t);\n\n\t\t// Bind it on the exchange to routing.key\n\t\t$q1->bind(\\Constant\\AMQPChannelConstant::AMF, \\Constant\\AMQPCommand::BingoBroadcast);\n\t\t\n\t\t// Read from the queue\n\t\twhile (TRUE)\n\t\t{\n\t\t\t$msg = $q1->consume($options);\n\n\t\t\tvar_dump($msg);\n\t\t}\n\t}", "protected function listen()\n {\n do {\n $data = fgets($this->socket, 512);\n if (!empty($data)) {\n $request = $this->receive($data);\n $cmd = strtolower($request->getCommand());\n\n if ($cmd === 'privmsg') {\n $event_name = 'message.' . ($request->isPrivateMessage() ? 'private' : 'channel');\n } else {\n $event_name = 'server.' . $cmd;\n }\n\n // Skip processing if the incoming message is from the bot\n if ($request->getSendingUser() === $this->config['nick']) {\n continue;\n }\n\n $event = new Event($request);\n $this->dispatcher->dispatch($event_name, $event);\n $responses = $event->getResponses();\n\n if (!empty($responses)) {\n $this->send($responses);\n }\n }\n } while (!feof($this->socket));\n }", "public function popQueueMessagesExtern($params = null);", "public function receive($queue, $interfaceConfig, $options)\n {\n $this->init($interfaceConfig);\n\n self::$conn->subscribe(\"/queue/\" . $queue);\n\n $result = new ArrayList();\n $count = 0;\n $limit = ($options && isset($options[\"limit\"])) ? $options[\"limit\"] : 0;\n while ((!$limit || $count < $limit) && ($frame = self::$conn->readFrame())) {\n $result->push(new MessageFrame($frame->body, $frame->headers, $queue));\n self::$conn->ack($frame);\n $count++;\n }\n\n self::$conn->unsubscribe($queue);\n\n return $result;\n }", "protected function processMessages()\n {\n while ($done = curl_multi_info_read($this->multiHandle)) {\n $request = $this->resourceHash[(int)$done['handle']];\n $this->processResponse($request, $this->handles[$request], $done);\n }\n }", "public function testConsumesUpdateQueues()\n {\n $rabbit = $this->getModelMock('messenger/transport_rabbitmq', array('_getChannel', '_close'));\n $channel = $this->_getChannelMock();\n $rabbit->expects($this->any())->method('_getChannel')->will($this->returnValue($channel));\n $rabbit->setConsumeQueues(array('test'));\n\n $channel->expects($this->once())->method('queue_declare')->with($this->equalTo('test'));\n $channel->expects($this->once())->method('basic_consume')->with($this->equalTo('test'));\n $this->_startReceiving($rabbit);\n }", "public function receive();", "function msgsrv_receive($callback, $timeout = 30000 , $link = null) {}", "public function processQueue()\n {\n $gate_arr = config('gates');\n foreach ($gate_arr as $gate_item) {\n $this->sendSmsOne($gate_item['name']);\n }\n }", "public function handle()\n {\n Log::warning('Disabled sms:receive command as it is unused and needs maintenance.');\n return;\n\n // Get last reply id from provider\n // TODO: Track provider ids separately. Also this is most likely provider\n // dependent\n $last_reply_id = $this->replies->getLastReplyId();\n\n $messages = $this->message_service->getMessages(['lastReceivedId' => $last_reply_id]);\n\n foreach ($messages as $message)\n {\n Log::info('[ReceiveSMS] Received SMS message from: ' . $message['from'] . \" with id: \" . $message['id']);\n\n if (!starts_with($message['from'], '+')) {\n $message['from'] = '+' . $message['from'];\n }\n\n $saved = $this->replies->save($from, $message['message'], $message['id']);\n\n // TODO:\n // send \"Response received\" from same number it was received on\n // log sms with relevant check_in_id\n\n if ($saved) {\n $this->message_service->sendResponseReceivedSMS($message['from']);\n }\n }\n }", "public function receive()\n\t{\n\t\t$payloads = parent::receive();\n\t\t\n\t\t// If the latest payload(s) are received, clear the buffer. We don't need that copy any more.\n\t\tif ($payloads)\n\t\t\t$this->received = array();\n\n\t\t// Return the latest received payloads\n\t\treturn $payloads;\n\t}", "public function receive(Message $message, Connection $connection);", "public function run()\n {\n $this->openWorker();\n while (($payload = $this->pop(0)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n $this->closeWorker();\n }", "public function callback(AMQPMessage $req);", "public function handle()\n {\n //\n// echo PHP_EOL . 'Demo' . PHP_EOL;\n $rabbit = new RabbitMQ();\n\n $message = 'test queue : ' . date('Y-m-d H:i:s');\n $queue = 'demo';\n $rabbit->publishMessage($message, $queue);\n\n// $msg = $rabbit->getMessage($queue);\n// echo PHP_EOL;\n// var_dump($msg);\n// echo PHP_EOL;\n\n\n }", "public function handle()\n {\n //\n $connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest', '/');\n\n $channel = $connection->channel();\n\n $channel->exchange_declare('ex1', 'direct', false, true, false, false, false);\n\n $channel->queue_declare('queue1', false, true, false, false);\n\n $channel->queue_bind('queue1', 'ex1', 'routingkey1');\n\n $msg = new AMQPMessage('Hello World!', ['delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT, 'content_type' => 'text/plain']);\n\n $wait = true;\n $returnListener = function (\n $replyCode,\n $replyText,\n $exchange,\n $routingKey,\n $message\n ) use ($wait) {\n $GLOBALS['wait'] = false;\n echo \"return: \",\n $replyCode, \"\\n\",\n $replyText, \"\\n\",\n $exchange, \"\\n\",\n $routingKey, \"\\n\",\n $message->body, \"\\n\";\n };\n\n // 监听没有成功路由到队列的消息\n $channel->set_return_listener($returnListener);\n\n $channel->basic_publish($msg, 'ex1', 'routingkey123', true, false);\n\n while ($wait) {\n $channel->wait();\n }\n\n $channel->close();\n\n $connection->close();\n }", "public function fetchMessages(){\n\t\t$sql = $this->dbh->query(\"SELECT * FROM `wsMessages`\");\n\t\t$msgs = $sql->fetchAll();\n\t\treturn $msgs;\n\t}", "public function handle()\n {\n $token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhZG1pbiIsImlhdCI6MTU4MzY2NDY3NSwiZXhwIjo0MTAyNDQ0ODAwLCJ1aWQiOjc3ODg5LCJyb2xlcyI6WyJST0xFX1VTRVIiXX0.h_B-LUEd5-XwsMThdLwTKNDyRSb7-fqqKEwbwi21f1w\";\n $datetime = new DateTime();\n $deviceid = 115988;\n $function = new functions();\n\n\n //Start Read Messages\n $searchArray = [];\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://smsgateway.me/api/v4/message/search\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 50,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"[ \" . json_encode($searchArray) . \"]\",\n CURLOPT_HTTPHEADER => array(\n \"authorization: $token\",\n \"cache-control: no-cache\"\n ),\n ));\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n if ($err) {\n dd($err);\n } else { \n $messagesRaw = json_decode($response);\n $filteredMessages = [];\n \n\n // dd(date('Y-m-d H:i:s'));\n foreach ($messagesRaw->results as $key => $message) {\n \n $currentTime = date(\"Y-m-d H:i:s\", strtotime(\"now\")); //current time\n $adjustedTime = date('Y-m-d H:i:s', strtotime('-5 minutes',strtotime(\"now\"))); //subtract 5mins from current time\n $messageTime = date(\"Y-m-d H:i:s\", strtotime($message->created_at));\n \n if($message->status == 'received' && $message->device_id == '115988' && $messageTime >= $adjustedTime && $messageTime <= $currentTime){\n $filteredMessages[] = $message;\n } \n }\n\n\n // // dd($filteredMessages);\n foreach ($filteredMessages as $key => $message){ // \n $currentTime = date(\"Y-m-d H:i:s\", strtotime(\"now\")); //current time\n $messageTime = date(\"Y-m-d H:i:s\", strtotime($message->created_at));\n $currentyear = date('Y', strtotime($currentTime));\n $currentmonth = date('m', strtotime($currentTime));\n $currentday = date('d', strtotime($currentTime));\n $currenthours = date('G', strtotime($currentTime));\n $currentminutes = date('i', strtotime($currentTime));\n $messageyear = date('Y', strtotime($messageTime));\n $messagemonth = date('m', strtotime($messageTime));\n $messageday = date('d', strtotime($messageTime)); \n $messagehours = date('G', strtotime($messageTime));\n $messageminutes = date('i', strtotime($messageTime));\n echo $currentTime . \"\\n\";\n echo $messageTime . \"\\n\";\n\n if($currentyear == $messageyear && $currentmonth == $messagemonth && $currentday == $messageday && $currenthours == $messagehours && ($currentminutes<=$messageminutes || $messageminutes>=$currentminutes)){\n // $filteredMessages[] = $message;\n\n $currentTime = date(\"Y-m-d H:i:s\", strtotime(\"now\")); //current time\n $messageTime = date(\"Y-m-d H:i:s\", strtotime($message->created_at));\n\n $content = $message->message;\n $stringcontent = str_replace(PHP_EOL, '', $content);\n echo $stringcontent.\"\\n\";\n echo $content.\"\\n\";\n echo strlen($stringcontent).\"\\n\";\n echo strlen($content).\"\\n\";\n echo \"Right Message\\n\";\n\n // if ($message->phone_number == \"+639278893743\"){\n if (strlen($stringcontent) == 16){\n\n //split string\n $meternum1 = $function->splitmeternum1($content);\n $status1 = $function->splitstat1($content);\n $meternum2 = $function->splitmeternum2($content);\n $status2 = $function->splitstat2($content);\n $meternum3 = $function->splitmeternum3($content);\n $status3 = $function->splitstat3($content);\n $variables = array($meternum1=>$status1, $meternum2=>$status2, $meternum3=>$status3);\n\n foreach ($variables as $meternum=>$status){ \n\n echo $meternum . \" \" . \" \" . $status;\n echo \"<br>\";\n\n $accounts = DB::table('accounts')\n ->where('meter_number', $meternum)\n ->first();\n \n DB::table('notifications')\n ->insert([\n 'id' => $message->id,\n 'phone_number' => $message->phone_number,\n 'message' => $message->message,\n 'accountnum' =>$accounts->account_number,\n 'meternum' => $meternum,\n 'status' => $status,\n 'created' => $messageTime\n ]);\n \n\n //prepare smsbody\n if ($status == \"1\"){\n $smsbody = $function->smsReconnect($meternum, $messageTime);\n }else if ($status == \"0\"){\n $smsbody = $function->smsDisconnect($meternum, $messageTime);\n }\n echo $smsbody . \"<br>\";\n\n //send notif\n $function->sendnotif($smsbody, $meternum);\n\n //update tables-delete row from processaccounts\n $function->deletefromProcessAcc($meternum);\n\n //update status from accounts and add row to reconnected acc\n if ($status == \"1\"){\n $function->updatestatusOne($meternum);\n $function->addReconnectedT($meternum, $currentTime);\n $function->deletefromDisconnectedAcc($meternum, $messageTime);\n }else if ($status == \"0\"){\n $function->updatestatusZero($meternum);\n $function->addDisconnectedT($meternum, $currentTime);\n }\n }\n\n }else if (strlen($stringcontent) == 12){\n //split string\n $meternum1 = $function->splitmeternumfirst($content);\n $status1 = $function->splitstatfirst($content);\n $meternum2 = $function->splitmeternumsecond($content);\n $status2 = $function->splitstatsecond($content);\n $variables = array($meternum1=>$status1, $meternum2=>$status2);\n\n\n foreach ($variables as $meternum=>$status){ \n\n echo $meternum . \" \" . \" \" . $status;\n echo \"<br>\";\n\n $accounts = DB::table('accounts')\n ->where('meter_number', $meternum)\n ->first();\n \n DB::table('notifications')\n ->insert([\n 'id' => $message->id,\n 'phone_number' => $message->phone_number,\n 'message' => $message->message,\n 'accountnum' =>$accounts->account_number,\n 'meternum' => $meternum,\n 'status' => $status,\n 'created' => $messageTime\n ]);\n\n //prepare smsbody\n if ($status == \"1\"){\n $smsbody = $function->smsReconnect($meternum, $messageTime);\n }else if ($status == \"0\"){\n $smsbody = $function->smsDisconnect($meternum, $messageTime);\n }\n echo $smsbody;\n\n //send notif\n $function->sendnotif($smsbody, $meternum);\n\n //update tables-delete row from processaccounts\n $function->deletefromProcessAcc($meternum);\n\n //update status from accounts and add row to reconnected acc\n if ($status == \"1\"){\n $function->updatestatusOne($meternum);\n $function->addReconnectedT($meternum, $currentTime);\n $function->deletefromDisconnectedAcc($meternum, $messageTime);\n }else if ($status == \"0\"){\n $function->updatestatusZero($meternum);\n $function->addDisconnectedT($meternum, $currentTime);\n }\n }\n\n }else if (strlen($stringcontent) == 8){\n\n //split string\n $meternum = $function->splitmeternum($content);\n $status = $function->splitstatus($content);\n echo $meternum . \" \" . \" \" . $status;\n echo \"<br>\";\n\n $accounts = DB::table('accounts')\n ->where('meter_number', $meternum)\n ->first();\n \n DB::table('notifications')\n ->insert([\n 'id' => $message->id,\n 'phone_number' => $message->phone_number,\n 'message' => $message->message,\n 'accountnum' =>$accounts->account_number,\n 'meternum' => $meternum,\n 'status' => $status,\n 'created' => $messageTime\n ]); \n\n //prepare smsbody\n if ($status == \"1\"){\n $smsbody = $function->smsReconnect($meternum, $messageTime);\n }else if ($status == \"0\"){\n $smsbody = $function->smsDisconnect($meternum, $messageTime);\n }\n echo $smsbody;\n\n //send notif\n $function->sendnotif($smsbody, $meternum);\n\n //update tables-delete row from processaccounts\n $function->deletefromProcessAcc($meternum);\n\n //update status from accounts and add row to reconnected acc\n if ($status == \"1\"){\n $function->updatestatusOne($meternum);\n $function->addReconnectedT($meternum, $currentTime);\n $function->deletefromDisconnectedAcc($meternum, $messageTime);\n }else if ($status == \"0\"){\n $function->updatestatusZero($meternum);\n $function->addDisconnectedT($meternum, $currentTime);\n }\n }\n else{\n echo \"invalid format\\n\".\"-----------------------------------------\\n\";\n }\n }\n else{\n echo \"no message received\\n\".\"----------------------------------------\\n\";\n }\n }\n }\n //End Read SMS\n }", "abstract public function receive();", "public function getMessagesAndFlush() {}", "public function listen(): void\n {\n $receive = function () {\n each($this->receiveMessages(), $this->parseAndConsumeMessage());\n };\n\n $this->settings->beforeReceive($receive);\n }", "public function getMessageQueue()\n\t{\n\t\treturn $this->messages;\n\t}", "abstract public function readMessageEnd();", "public function Poll(){\n\n\t\t$myEppServer = new EppServer();\n\t\tif(DEBUG_lEVEL >=5){ print \"<p>Starting Connection</p>\";}\n\t\t$myEppServer->Start();\n\t\t$flag = 0;\t\t\t\t\t\t\n\t\twhile ($flag != 1){\n\t\t\t\t$TransactionID = $myEppServer->Chat($this->xmlPoll());\n\t\t\t\t$resultcode = $myEppServer->ResultCode();\n\t\n\t\t\t\tif(DEBUG_lEVEL >=5){ print \"<p>Result code: $resultcode</p>\";}\n\t\t\t\n\t\t\t\t\tif ($resultcode == 1300){\n\t\t\t\t\t\tif(DEBUG_lEVEL >=5){ print \"<p>There are no messages in the queue</p>\";}\n\t\t\t\t\t\tprint \"<p>There are no messages in the queue</p>\";\n\t\t\t\t\t\t$flag =1;\n\n\t\t\t\t\t}elseif ($resultcode == 1301){\n\t\t\t\t\t\tif(DEBUG_lEVEL >=5){ print \"<p>There are messages</p>\";}\n\t\t\t\t\t\t$EPPID = $this->xmlPollProcess($myEppServer->OutXML, $TransactionID);\n\t\t\t\t\t\t\tprint \"<p>Loading Message</p>\";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(DEBUG_lEVEL >=5){ print \"<p>ACK message</p>\";}\n\t\t\t\t\t\t\t$myEppServer->Chat($this->xmlAck($EPPID));\n\t\t\t\t\t\t\t$resultcode2 = $myEppServer->ResultCode();\n\t\t\t\t\t\tif(DEBUG_lEVEL >=5){ print \"<p>ACK Result Code: $resultcode2</p>\";}\n\t\t\t\t\t\t\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(DEBUG_lEVEL >=5){ print \"<p>Failed due to an unknown Error</p>\";}\n\t\t\t\t\t\t$flag =1;\n\t\t\t\t\t}\n\t\t}\n\t\t$myEppServer->Stop();\n\t\tif(DEBUG_lEVEL >=5){ print \"<p>Stopping Connection</p>\";}\n\t}", "public abstract function receive();", "public function handle()\n {\n $msg = new AMQPMessage(json_encode(['Hello World!']));\n \\RabbitMQ::channel()->basic_publish($msg, '', \\RabbitMQ::getQueueName());\n\n echo \" [x] Sent 'Hello World!'\\n\";\n\n \\RabbitMQ::close();\n }", "public function fetchMessageFromQueue()\n {\n $whereParams = [\n 'status' => 'PENDING',\n ];\n $orderBy = 'attempts';\n return $this->db->first($this->table, $whereParams, $orderBy);\n\n }", "public function receiveData()\n {\n while (false !== ($data = socket_read($this->socket, 512))) {\n if ($data === '') {\n $this->reactor->removeReader($this->socket);\n \n call_user_func($this->callback, Response::fromString($this->buffer));\n return;\n }\n \n $this->buffer .= $data;\n }\n }", "function pull_messages($projectId, $subscriptionName)\n{\n $pubsub = new PubSubClient([\n 'projectId' => $projectId,\n ]);\n $subscription = $pubsub->subscription($subscriptionName);\n foreach ($subscription->pull() as $message) {\n printf('Message: %s' . PHP_EOL, $message->data());\n // Acknowledge the Pub/Sub message has been received, so it will not be pulled multiple times.\n $subscription->acknowledge($message);\n }\n}", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "public function listQueueMessages($queue)\n {\n $conf = $this->consumers[(string) $queue];\n\n $count = 0;\n $process = new Process(sprintf(\n 'rabbitmqadmin -H %s -P %s -V %s -u %s -p %s list queues name messages --format=kvp',\n $conf['host'],\n $conf['port'],\n $conf['vhost'],\n $conf['user'],\n $conf['pwd']\n ));\n $process->run(function ($type, $buffer) use (&$count, $conf) {\n if (strpos($buffer, 'command not found')) {\n throw new RuntimeException('Command rabbitmqadmin not found in the system');\n }\n\n preg_match(\n '/^name=\"(?<name>.*)\" messages=\"(?<count>\\d+)\"$/',\n trim($buffer),\n $matches\n );\n\n if (\n isset($matches['name']) &&\n $matches['name'] === $conf['queue']\n ) {\n $count = (int) $matches['count'];\n }\n });\n\n return $count;\n }", "public function countMessages(Queue $queue);", "public function consume();", "public function consume();", "public function handle()\n {\n $this->laravel->bind(RedisSubscribe::class,$this->handler);\n $instance = $this->laravel->make(RedisSubscribe::class);\n\n while(true) {\n $value = Redis::brpop($this->channel, 0);\n\n $channel = $value[0];\n $data = $value[1];\n\n $instance->reset();\n $instance->setData($channel,json_decode($data,true));\n $instance->handle();\n }\n }", "public static function readNotificationQueue() {\n global $wpdb;\n //TODO\n // 1- Add user_id field to token table\n // 2- if the notification isn't an admin\n //TODO Use This when There is a user Id with multiple tokens\n $tokens = [];\n $table = self::getQueueTableName();\n $query = \"SELECT * FROM $table WHERE `is_sent` = 0 LIMIT 100\";\n //Admin Notifications\n $results = $wpdb->get_results($query);\n if(count($results) < 1) {\n return 0;\n }\n else {\n foreach ($results as $result) {\n $token_id = $result->token_id;\n $token = KibarToken::getTokenByID($token_id);\n $notification = self::getNotificationById($result->notification_id);\n //Call FCM For each token row\n $args = array(\n 'entry_id' => $result->id,\n 'to' => $token,\n 'notification' => $notification\n );\n\n KibarFCM::sendFCMMsg($args);\n //set each token is_sent to false\n }\n }\n }", "public function handle()\r\n {\r\n $currentTime = time();\r\n $emailPlaybook = EmailPlaybook::where('msgscheduled', 'Activated')\r\n ->where('message_total_level', '>', 0)\r\n ->where('last_message_sent_at', '<=', $currentTime)\r\n ->get();\r\n if($emailPlaybook){\r\n foreach ($emailPlaybook as $key => $playbook) {\r\n // $this->queueEmailMsg($playbook);\r\n }\r\n }\r\n }", "protected function getMessagesFromQueue($queue)\n {\n return $queue->receiveMessage([\n 'AttributeNames' => ['SentTimestamp'],\n 'MaxNumberOfMessages' => 10,\n 'MessageAttributeNames' => ['All'],\n 'QueueUrl' => $queue->getQueueUrl(\n ['QueueName' => (new QueueService())->getFullQueueName('notifications')]\n )->get('QueueUrl'),\n ]);\n }", "public function getMessages() {}", "public function getMessages() {}", "protected abstract function receive();", "public function consume()\n {\n }", "public function runQueue();", "public function actionSingle() {\n// $conn = $amqp->Connection();\n// $channel = $amqp->Channel($conn);\n// $amqp->Exchange($conn, $channel);\n// $amqp->Queue($channel);\n }", "public function consumerQueue($message) {\n\n echo '------- mbc-resubscribe-mailchimp MBI_MailchimpResubscribe consumerQueue START' . date('D M j G:i:s T Y') . ' -------', PHP_EOL;\n \n $resubscribe = unserialize($message->body);\n \n\n // Submit subscription to Mailchimp\n $mc = new \\Drewm\\MailChimp($this->settings['mailchimp_apikey']);\n \n // Debugging\n //$results1 = $mc->call(\"lists/list\", array());\n //$results2 = $mc->call(\"lists/interest-groupings\", array('id' => 'f2fab1dfd4')); // DoSomething Members f2fab1dfd4, Old People a27895fe0c\n\n $results = $mc->call(\"lists/subscribe\", array(\n 'id' => 'a27895fe0c',\n 'email' => array(\n 'email' => $resubscribe['email']\n ),\n 'merge_vars' => array(\n 'groupings' => array(\n 0 => array(\n 'id' => $this->settings['mailchimp_grouping_id'], // Campaigns2013 (10621), Campaigns2014 (10637), Old People ()\n )\n ),\n 'FNAME' => $resubscribe['FNAME'],\n 'MMERGE10' => isset($resubscribe['birthdate']) ? $resubscribe['birthdate'] : '',\n ),\n 'double_optin' => FALSE,\n 'update_existing' => TRUE,\n 'replace_interests' => FALSE,\n 'send_welcome' => FALSE,\n ));\n\n echo '------- mbc-resubscribe-mailchimp MBI_MailchimpResubscribe consumerQueue - END' . date('D M j G:i:s T Y') . ' -------', PHP_EOL;\n }", "private function readMessage()\n {\n $fromIp = \"\";\n $fromPort = 0;\n $msg = null;\n \n if (!@socket_recvfrom($this->socket, $msg, 65535, 0, $fromIp, $fromPort)) {\n $err_no = socket_last_error($this->socket);\n if ($err_no == 4) {\n \techo \"\\n\\nCaught SIGINT, quiting...\\n\";\n \t$this->keepRunning = false;\n }\n }\n\n if (!$msg) {\n \treturn false;\n }\n\n if ($this->fromIp === null && $this->fromPort === null) {\n \t$this->fromIp = $fromIp;\n \t$this->fromPort = $fromPort;\n } else if ($this->fromIp != $fromIp || $this->fromPort != $fromPort) {\n \tdie(sprintf(\"Error: sender changed from %s:%d to %s:%d, aborting...\\n\", $this->fromIp, $this->fromPort, $fromIp, $fromPort));\n }\n \n return [\n \t\"timestamp\"\t=> microtime(true),\n \t\"msg\" \t\t=> $msg,\n \t\"from_ip\" \t=> $fromIp,\n \t\"from_port\"\t=> $fromPort\n ];\n }", "public function getQueue();", "public function getQueue();", "abstract function receive();", "public function handle()\r\n {\r\n $ex_name = 'ex.zdjz.news';\r\n $quene_name = 'quene.zdjz.news';\r\n $bind_key = 'xian.zdjz.news';\r\n $connection = new \\AMQPConnection(array('host'=>'127.0.0.1','port'=>'5672','vhost'=>'/zdjz','login'=>'guest','password'=>'guest'));\r\n if(!$connection->connect()) {\r\n echo \"链接失败\";\r\n }\r\n $chann = new \\AMQPChannel($connection);\r\n\r\n //创建一个fonmant交换器\r\n $ex = new \\AMQPExchange($chann);\r\n $ex->setName($ex_name);//交换器名称\r\n $ex->setType(AMQP_EX_TYPE_FANOUT);//交换器类型\r\n $ex->setFlags(AMQP_DURABLE);//是否持久化\r\n $ex->setFlags(AMQP_AUTODELETE);//是否自动删除 当所有队列和交换机器绑定到当前交换器上不在使用时,是否自动删除交换器 true:删除false:不删除\r\n\r\n $quene = new \\AMQPQueue($chann);\r\n $quene->setName($quene_name);\r\n $quene->setFlags(AMQP_AUTODELETE);//是否自动删除 当前队列上没有订阅的消费者时 自动删除\r\n $quene->setFlags(AMQP_DURABLE);//是否持久化\r\n $quene->bind($ex_name,$bind_key);\r\n $message = $quene->get();\r\n $body = $message->getBody();\r\n var_dump($message);\r\n if($message['body']){\r\n //确认消息\r\n echo $message['body'].'';\r\n $quene->ack($message['delivery_tag']);\r\n }\r\n\r\n\r\n $chann->close();\r\n $connection->close();\r\n }", "public function receive($maxMessages=null, $timeout=null, Zend_Queue $queue=null)\n {\n if ($maxMessages === null) {\n $maxMessages = 1;\n }\n\n if ($timeout === null) {\n $timeout = self::RECEIVE_TIMEOUT_DEFAULT;\n }\n if ($queue === null) {\n $queue = $this->_queue;\n }\n\n $msgs = array();\n if ($maxMessages > 0 ) {\n for ($i = 0; $i < $maxMessages; $i++) {\n \t$job = $this->_pheanstalk->watch($queue->getName())->reserve();\n $data = array(\n 'handle' => $job,\n 'body' => $job->getData(),\n );\n $msgs[] = $data;\n }\n }\n\n $options = array(\n 'queue' => $queue,\n 'data' => $msgs,\n 'messageClass' => $queue->getMessageClass(),\n );\n\n $classname = $queue->getMessageSetClass();\n if (!class_exists($classname)) {\n require_once 'Zend/Loader.php';\n Zend_Loader::loadClass($classname);\n }\n return new $classname($options);\n }", "abstract protected function onMessageRecieved(WebSocketClient $sender, $message);", "public function eventsAction()\n {\n $callback = function ($msg) {\n //check the db before running anything\n if (!$this->isDbConnected('db')) {\n return ;\n }\n\n if ($this->di->has('dblocal')) {\n if (!$this->isDbConnected('dblocal')) {\n return ;\n }\n }\n\n //we get the data from our event trigger and unserialize\n $event = unserialize($msg->body);\n\n //overwrite the user who is running this process\n if (isset($event['userData']) && $event['userData'] instanceof Users) {\n $this->di->setShared('userData', $event['userData']);\n }\n\n //lets fire the event\n $this->events->fire($event['event'], $event['source'], $event['data']);\n\n $this->log->info(\n \"Notification ({$event['event']}) - Process ID \" . $msg->delivery_info['consumer_tag']\n );\n };\n\n Queue::process(QUEUE::EVENTS, $callback);\n }", "public function send(){\n\t\t\n\t\t$database = new Database();\n\t\t$query = $database->selectOne('message_queues', array('id',\n\t\t\t\t\t\t\t\t\t 'is_executed','executed_at','message','cellphone'), \n\t\t\t\t\t\t\t\t\t ' is_executed=0 ');\n\t\t$exec = $database->query($query);\n\t\tif ($exec) {\n\t\t\t$record = $database->fetchArray($exec);\n\t\t\t$response = $this->sendMessage($database, $record);\n\n\t\t\treturn json_encode(array('status' => $response['status'], 'message' => $response['message']));\n\t\t}\n\n\t}", "public function run()\n {\n while (($payload = array_shift($this->payloads)) !== null) {\n list($ttr, $message) = $payload;\n $this->startedId = $this->finishedId + 1;\n $this->handleMessage($this->startedId, $message, $ttr, 1);\n $this->finishedId = $this->startedId;\n $this->startedId = 0;\n }\n }", "public function getQueue()\n {\n return $this->doRequest('GET', \"queue\", []);\n }", "public function handle()\n {\n Log::info(\"Running polling\");\n $params = [];\n\n $phones = Phones::get();\n\n $params['phones'] = fractal()\n ->collection($phones)\n ->serializeWith(DataArraySansIncludeSerializer::class)\n ->transformWith(PhoneTransformer::class)\n ->toArray()['data'];\n\n event(new PhoneEvent($params['phones']));\n\n $inbox = Inbox::where('processed', false)->get();\n $params['inbox'] = [];\n if (count($inbox)){\n foreach ($inbox as $row){\n $params['inbox'][] = [\n 'from' => $row->SenderNumber,\n 'message' => $row->TextDecoded\n ];\n $data = fractal()\n ->item($row)\n ->transformWith(OutboxTransformer::class)\n ->serializeWith(DataArraySansIncludeSerializer::class)\n ->toArray();\n event(new OutboxEvent($data));\n }\n }\n\n $this->sendPolling($params);\n\n\n }", "public function get_all() {\n try {\n \n $where = $this->getSafe('where', '');\n $order_by = $this->getSafe('order_by', '');\n \n $db = $this->app->getDbo();\n \n $data = array (\n 'order_by' => $order_by,\n 'where' => $where\n );\n \n $list = $this->messagequeue_model->get_all($data);\n \n $ret = array (\n 'messages' => $list\n );\n \n $this->renderJson($ret);\n \n } catch (Exception $ex) {\n $this->app->write_log('messagequeue_get_all_exception - ' . $ex->getMessage());\n \n $ret = $this->message(1, 'messagequeue_get_all_exception', $ex->getMessage());\n $this->renderJson($ret);\n }\n }", "public function Subscribe() {\n\t\t// Process pending messages if any\n\t\t$this->ProcessPendingMessages();\n\t\t// Subscribe\n\t\t$this->GetSubsConn()->subscribe(\n\t\t\t[$this->GetChannel()],\n\t\t\t[$this, 'SubscribeCallback']\n\t\t);\n\t}", "public function handleSendMessage() {\n\t\t$json = file_get_contents(\"php://input\"); //vytánutí všech dat z POST požadavku - data ve formátu JSON\n\t\t$data = Json::decode($json); //prijata zprava dekodovana z JSONu\n\t\t$user = $this->getPresenter()->getUser();\n\t\t$addMessage = $this->addMessage($data, $user);\n\t\tif (!empty($addMessage)) {\n\t\t\t$this->sendRefreshResponse($data->lastid);\n\t\t}\n\t}", "function fetchSMS(){\n\n\t$sql=\"select requestID,MSISDN,messageContent,processed from incomingRequests where processed = 5\";\n\t$result=mysql_query($sql);\n\tif(!$result){\n\t\t$dbErr=\"SQL Error: \".mysql_error().\"SQL CODE: \".$sql;\n\t\tflog($dbErr, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t}else{\n\t\t$subLogs = \"Fetched 1 sms bucket of approx \".mysql_num_rows($result).\" items.\";\n\t\tlogSubs($subLogs, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t\n\t}\n\treturn $result;\n}", "public function dequeue();", "public function sendMessage($msgdata)\n\t{\n\t\ttry {\n\t\t\t$this->channel->queue_declare(MQ::MAILQUEUE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\t\t\t$this->channel->queue_declare(MQ::SMSQUEUE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\t\t\t$this->channel->queue_declare(MQ::CONTACTCACHEINITIATE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\t\t\t$this->channel->queue_declare(MQ::INVALIDATECACHE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\t\t\t$this->channel->queue_declare(MQ::AGENT_NOTIFICATIONSQUEUE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\t\t\t$this->channel->queue_declare(MQ::BUFFER_INSTANT_NOTIFICATION_QUEUE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\t\t\t$this->channel->queue_declare(MQ::DELETE_RETRIEVE_QUEUE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\t\t\t$this->channel->queue_declare(MQ::UPDATE_SEEN_QUEUE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\t\t\t$this->channel->queue_declare(MQ::UPDATE_FEATURED_PROFILE_QUEUE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\n\t\t\t$this->channel->queue_declare(MQ::CHAT_MESSAGE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\n\t\t\t$this->channel->queue_declare(MQ::DUPLICATE_LOG_QUEUE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\t\t\t$this->channel->queue_declare(MQ::PROFILE_CACHE_Q_DELETE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n $this->channel->queue_declare(MQ::VIEW_LOG, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\t\t\t$this->channel->queue_declare(MQ::SCREENING_QUEUE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\t\t\t$this->channel->queue_declare(MQ::LOGGING_QUEUE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n $this->channel->queue_declare(MQ::DISC_HISTORY_QUEUE, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE);\n\n $this->channel->queue_declare(MQ::SCRIPT_PROFILER_Q, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE); \n\t\t\t$this->channel->queue_declare(MQ::WRITE_MSG_queueRightNow);\n\t\t\t$this->channel->exchange_declare(MQ::WRITE_MSG_exchangeRightNow, 'direct');\n\t\t\t$this->channel->queue_bind(MQ::WRITE_MSG_queueRightNow, MQ::WRITE_MSG_exchangeRightNow);\n\t\t\t$this->channel->queue_declare(MQ::WRITE_MSG_queueDelayed5min, MQ::PASSIVE, MQ::DURABLE, MQ::EXCLUSIVE, MQ::AUTO_DELETE, true, \n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"x-dead-letter-exchange\" => array(\"S\", MQ::WRITE_MSG_exchangeRightNow),\n\t\t\t\t\t\t\"x-message-ttl\" => array(\"I\", MQ::DELAY_WRITEMSG*1000))\n\t\t\t\t\t);\n\t\t\t$this->channel->exchange_declare(MQ::WRITE_MSG_exchangeDelayed5min, 'direct');\n\t\t\t$this->channel->queue_bind(MQ::WRITE_MSG_queueDelayed5min, MQ::WRITE_MSG_exchangeDelayed5min);\n\n\t\t} catch (Exception $exception) {\n\t\t\t$str = \"\\nRabbitMQ Error in producer, Unable to\" . \" declare queues : \" . $exception->getMessage() . \"\\tLine:\" . __LINE__;\n\t\t\tRabbitmqHelper::sendAlert($str, \"default\");\n\t\t\treturn;\n\t\t}\n\t\t$data = json_encode($msgdata);\n\t\t$msg = new AMQPMessage($data, array('delivery_mode' => MQ::DELIVERYMODE));\n\t\t$process = $msgdata['process'];\n\t\ttry {\n\t\t\tswitch ($process) {\n\t\t\t\tcase \"MAIL\":\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::MAILQUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"SMS\":\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::SMSQUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::SMSQUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"GCM\":\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::GCMQUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"AGENT_NOTIFICATIONS\":\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::AGENT_NOTIFICATIONSQUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CACHE\":\n\t\t\t\t\t$data = $msgdata['data'];\n\t\t\t\t\t$msg = new AMQPMessage($data, array('delivery_mode' => MQ::DELIVERYMODE));\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::CONTACTCACHEINITIATE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INVALIDATE\":\n\t\t\t\t\t$data = $msgdata['data'];\n\t\t\t\t\t$msg = new AMQPMessage($data, array('delivery_mode' => MQ::DELIVERYMODE));\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::INVALIDATECACHE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"BUFFER_INSTANT_NOTIFICATIONS\" :\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::BUFFER_INSTANT_NOTIFICATION_QUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DELETE_RETRIEVE\":\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::DELETE_RETRIEVE_QUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CHATROSTERS\":\n\t\t\t\t\tif (JsConstants::$jsChatFlag >= 1) {\n\t\t\t\t\t\t$data = $msgdata['data'];\n\t\t\t\t\t\t$msg = new AMQPMessage(json_encode($data), array('delivery_mode' => MQ::DELIVERYMODE));\n\t\t\t\t\t\t$this->channel->basic_publish($msg, MQ::CHATEXCHANGE, \"roster\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"UPDATE_SEEN\":\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::UPDATE_SEEN_QUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"UPDATE_FEATURED_PROFILE\":\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::UPDATE_FEATURED_PROFILE_QUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"USERCREATION\":\n\t\t\t\t\tif (JsConstants::$jsChatFlag >= 1) {\n\t\t\t\t\t\t$data = $msgdata['data'];\n\t\t\t\t\t\t$msg = new AMQPMessage($data, array('delivery_mode' => MQ::DELIVERYMODE));\n\t\t\t\t\t\t$this->channel->basic_publish($msg, MQ::CHATEXCHANGE, \"profile_created\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"USERLOGIN\":\n\t\t\t\t\tif (JsConstants::$jsChatFlag >= 1) {\n\t\t\t\t\t\t$data = $msgdata['data'];\n\t\t\t\t\t\t$msg = new AMQPMessage($data, array('delivery_mode' => MQ::DELIVERYMODE));\n\t\t\t\t\t\t$this->channel->basic_publish($msg, MQ::CHATEXCHANGE, \"profile_created\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DUPLICATE_LOG\":\n\t\t\t\t\t $this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::DUPLICATE_LOG_QUEUE,MQ::MANDATORY,MQ::IMMEDIATE);\n\t\t\t\t\t break;\n\t\t\t\tcase \"USER_DELETE\":\n\t\t\t\t\tif (JsConstants::$jsChatFlag >= 1) {\n\t\t\t\t\t\t$data = $msgdata['data'];\n\t\t\t\t\t\t$msg = new AMQPMessage($data, array('delivery_mode' => MQ::DELIVERYMODE));\n\t\t\t\t\t\t$this->channel->basic_publish($msg, MQ::CHATEXCHANGE, \"profile_deleted\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\t\t\t\n\t\t\t\tcase \"CHATMESSAGE\":\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::CHAT_MESSAGE, MQ::MANDATORY, MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"ROSTERCREATION\":\n\t\t\t\t\t$data = $msgdata['data'];\n\t\t\t\t\t$msg = new AMQPMessage($data, array('delivery_mode' => MQ::DELIVERYMODE));\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::CHATEXCHANGE,\"roster_created\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DUPLICATE_LOG\":\n $this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::DUPLICATE_LOG_QUEUE,MQ::MANDATORY,MQ::IMMEDIATE);\n break;\n\n\t\t\t\tcase MQ::PROCESS_PROFILE_CACHE_DELETE:\n $this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::PROFILE_CACHE_Q_DELETE,MQ::MANDATORY,MQ::IMMEDIATE);\n\t\t\t\t\tbreak;\n case \"ViewLogQueue\":\n $this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::VIEW_LOG,MQ::MANDATORY,MQ::IMMEDIATE);\n break;\n case MQ::SCREENING_Q_EOI:\n \t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::SCREENING_QUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n \tbreak;\n\t\t\t\tcase MQ::WRITE_MSG_Q:\n\t\t\t\t\t$this->channel->basic_publish($msg, MQ::WRITE_MSG_exchangeDelayed5min);\n\t\t\t\t\tbreak;\n case 'LOGGING_TRACKING':\n \t$this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::LOGGING_QUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n \tbreak;\n\n case 'DISCOUNT_HISTORY':\n $this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::DISC_HISTORY_QUEUE, MQ::MANDATORY, MQ::IMMEDIATE);\n break;\n case MQ::SCRIPT_PROFILER_PROCESS:\n $this->channel->basic_publish($msg, MQ::EXCHANGE, MQ::SCRIPT_PROFILER_Q,MQ::MANDATORY,MQ::IMMEDIATE);\n break;\n\n\t\t\t}\n\t\t} catch (Exception $exception) {\n\t\t\t$str = \"\\nRabbitMQ Error in producer, Unable to publish message : \" . $exception->getMessage() . \"\\tLine:\" . __LINE__;\n\t\t\tRabbitmqHelper::sendAlert($str, \"default\");\n\t\t\treturn;\n\t\t}\n\t}", "function delete_message_from_queue($queue_url, $message_handle, $region, $queue_name)\n {\n $sqs_client = new Aws\\Sqs\\SqsClient([\n 'version' => 'latest',\n 'region' => \"$region\"\n ]);\n\n try\n {\n $sqs_client->deleteMessage([\n 'QueueUrl' => $queue_url,\n 'ReceiptHandle' => $message_handle\n ]);\n }\n catch(\\Aws\\Sqs\\Exception\\SqsException $sqs_exception)\n {\n echo \"Failed to delete message in queue: $queue_name, \" . $sqs_exception->getMessage() . \"\\n\";\n exit(1);\n }\n }", "public function flushQueue(Swift_Transport $transport, &$failedRecipients = null)\n {\n $failedRecipients = (array)$failedRecipients;\n $count = 0;\n $time = time();\n\n $maxNumberOfMessages = max(\n min(\n $this->getMessageLimit(),\n static::MAX_NUMBER_MESSAGES\n ),\n static::MIN_NUMBER_MESSAGES\n );\n\n $options = [\n 'MaxNumberOfMessages' => $maxNumberOfMessages,\n 'WaitTimeSeconds' => $this->longPollingTimeout\n ];\n\n while (true) {\n try {\n $response = $this->sqs->receiveMessage([\n 'QueueUrl' => $this->queueUrl,\n ] + $options);\n } catch (\\Exception $e) {\n $this->logError('Load messages from SQS', $e);\n return $count;\n }\n\n $messages = $response->get('Messages');\n if (!is_array($messages) || count($messages) == 0) {\n return $count;\n }\n\n foreach ($messages as $sqsMessage) {\n if (!$transport->isStarted()) {\n $transport->start();\n }\n\n $message = unserialize(gzuncompress(base64_decode((string)$sqsMessage['Body'])));\n\n try {\n $count += $transport->send($message, $failedRecipients);\n } catch (\\Exception $e) {\n $this->logError('Send e-mail', $e);\n }\n\n $this->removeSqsMessage((string)$sqsMessage['ReceiptHandle']);\n\n if ($this->getMessageLimit() && ($count >= $this->getMessageLimit())) {\n return $count;\n }\n\n if ($this->getTimeLimit() && ((time() - $time) >= $this->getTimeLimit())) {\n return $count;\n }\n }\n }\n\n return $count;\n }", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function logQueueReceiveEvent(QueueReceiveEvent $event)\n {\n $this->output->writeln('QueueReceiveEvent:: Queue received job '.json_encode(array(\n 'job_id' => $event->getStorage()->getJobId()\n )));\n }", "public function listen($args, $assoc_args = array())\n {\n global $wp_queue;\n\n $worker = new WP_Worker($wp_queue);\n\n WP_CLI::log('Listening for queue jobs...');\n\n while (true) {\n if ($worker->should_run()) {\n if ($worker->process_next_job()) {\n WP_CLI::success('Processed: ' . $worker->get_job_name());\n sleep(1);\n }\n } else {\n sleep(5);\n }\n }\n }", "function send_message_to_queue($queue_url, $message_body, $region, $queue_name)\n {\n $sqs_client = new Aws\\Sqs\\SqsClient([\n 'version' => 'latest',\n 'region' => \"$region\"\n ]);\n\n try\n {\n $sqs_client->sendMessage([\n 'QueueUrl' => \"$queue_url\",\n 'MessageBody' => \"$message_body\"\n ]);\n }\n catch(\\Aws\\Sqs\\Exception\\SqsException $sqs_exception)\n {\n echo \"Failed to send message to queue: $queue_name, \" . $sqs_exception->getMessage() . \"\\n\";\n exit(1);\n }\n }", "function onMessage(ConnectionInterface $from, $msg);", "function exec_queue()\n\t{\n\t\t$vbulletin =& $this->registry;\n\n\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t{\n\t\t\t// Lock mailqueue table so that only one process can\n\t\t\t// send a batch of emails and then delete them\n\t\t\t$vbulletin->db->lock_tables(array('mailqueue' => 'WRITE'));\n\t\t}\n\n\t\t$emails = $vbulletin->db->query_read(\"\n\t\t\tSELECT *\n\t\t\tFROM \" . TABLE_PREFIX . \"mailqueue\n\t\t\tORDER BY mailqueueid\n\t\t\tLIMIT \" . intval($vbulletin->options['emailsendnum'])\n\t\t);\n\n\t\t$mailqueueids = '';\n\t\t$newmail = 0;\n\t\t$emailarray = array();\n\t\twhile ($email = $vbulletin->db->fetch_array($emails))\n\t\t{\n\t\t\t// count up number of mails about to send\n\t\t\t$mailqueueids .= ',' . $email['mailqueueid'];\n\t\t\t$newmail++;\n\t\t\t$emailarray[] = $email;\n\t\t}\n\t\tif (!empty($mailqueueids))\n\t\t{\n\t\t\t// remove mails from queue - to stop duplicates being sent\n\t\t\t$vbulletin->db->query_write(\"\n\t\t\t\tDELETE FROM \" . TABLE_PREFIX . \"mailqueue\n\t\t\t\tWHERE mailqueueid IN (0 $mailqueueids)\n\t\t\t\");\n\n\t\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t\t{\n\t\t\t\t$vbulletin->db->unlock_tables();\n\t\t\t}\n\n\t\t\tif ($vbulletin->options['use_smtp'])\n\t\t\t{\n\t\t\t\t$prototype =& new vB_SmtpMail($vbulletin);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$prototype =& new vB_Mail($vbulletin);\n\t\t\t}\n\n\t\t\tforeach ($emailarray AS $index => $email)\n\t\t\t{\n\t\t\t\t// send those mails\n\t\t\t\t$mail = (phpversion() < '5' ? $prototype : clone($prototype)); // avoid ctor overhead\n\t\t\t\t$mail->quick_set($email['toemail'], $email['subject'], $email['message'], $email['header'], $email['fromemail']);\n\t\t\t\t$mail->send();\n\t\t\t}\n\n\t\t\t$newmail = 'data - ' . intval($newmail);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t\t{\n\t\t\t\t$vbulletin->db->unlock_tables();\n\t\t\t}\n\n\t\t\t$newmail = 0;\n\t\t}\n\n\t\t// update number of mails remaining\n\t\t$vbulletin->db->query_write(\"\n\t\t\tUPDATE \" . TABLE_PREFIX . \"datastore SET\n\t\t\t\tdata = \" . $newmail . \",\n\t\t\t\tdata = IF(data < 0, 0, data)\n\t\t\tWHERE title = 'mailqueue'\n\t\t\");\n\n\t\t// if we're using a alternate datastore, we need to give it an integer value\n\t\t// this may not be atomic\n\t\tif (method_exists($vbulletin->datastore, 'build'))\n\t\t{\n\t\t\t$mailqueue_db = $vbulletin->db->query_first(\"\n\t\t\t\tSELECT data\n\t\t\t\tFROM \" . TABLE_PREFIX . \"datastore\n\t\t\t\tWHERE title = 'mailqueue'\n\t\t\t\");\n\t\t\t$vbulletin->datastore->build('mailqueue', intval($mailqueue_db['data']));\n\t\t}\n\t}", "public static function getMessages() {\n $con = pg_connect(\"host=\".CON_HOST.\" dbname=\".CON_DBNAME.\" user=\".CON_USER.\" password=\".CON_PASSWORD.\"\")\n or die (\"Could not connect to server.\");\n\n $query = \"SELECT * FROM message WHERE start_date <= now()::date AND end_date >= now()::date AND removed = false\";\n\n $result = pg_query($con, $query)\n or die(\"Cannot execute the query.\");\n\n return pg_fetch_all($result);\n }", "function process_mail_queue()\n\t{\n\t\t//-----------------------------------------\n\t\t// SET UP\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->vars['mail_queue_per_blob'] = isset($this->vars['mail_queue_per_blob']) ? $this->vars['mail_queue_per_blob'] : 5;\n\t\t\n\t\t$this->cache['systemvars']['mail_queue'] = isset( $this->cache['systemvars']['mail_queue'] ) ? intval( $this->cache['systemvars']['mail_queue'] ) : 0;\n\t\t\n\t\t$sent_ids = array();\n\t\t\n\t\tif ( $this->cache['systemvars']['mail_queue'] > 0 )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Require the emailer...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\trequire_once( ROOT_PATH . 'sources/classes/class_email.php' );\n\t\t\t$emailer = new emailer(ROOT_PATH);\n\t\t\t$emailer->ipsclass =& $this;\n\t\t\t$emailer->email_init();\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Get the mail stuck in the queue\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->DB->simple_construct( array( 'select' => '*', 'from' => 'mail_queue', 'order' => 'mail_id', 'limit' => array( 0, $this->vars['mail_queue_per_blob'] ) ) );\n\t\t\t$this->DB->simple_exec();\n\t\t\t\n\t\t\twhile ( $r = $this->DB->fetch_row() )\n\t\t\t{\n\t\t\t\t$data[] = $r;\n\t\t\t\t$sent_ids[] = $r['mail_id'];\n\t\t\t}\n\t\t\t\n\t\t\tif ( count($sent_ids) )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Delete sent mails and update count\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->cache['systemvars']['mail_queue'] = $this->cache['systemvars']['mail_queue'] - count($sent_ids);\n\t\t\t\t\n\t\t\t\t$this->DB->simple_exec_query( array( 'delete' => 'mail_queue', 'where' => 'mail_id IN ('.implode(\",\", $sent_ids).')' ) );\n\t\t\t\n\t\t\t\tforeach( $data as $mail )\n\t\t\t\t{\n\t\t\t\t\tif ( $mail['mail_to'] and $mail['mail_subject'] and $mail['mail_content'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$emailer->to = $mail['mail_to'];\n\t\t\t\t\t\t$emailer->from = $mail['mail_from'] ? $mail['mail_from'] : $this->vars['email_out'];\n\t\t\t\t\t\t$emailer->subject = $mail['mail_subject'];\n\t\t\t\t\t\t$emailer->message = $mail['mail_content'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $mail['mail_html_on'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$emailer->html_email = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$emailer->html_email = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$emailer->send_mail();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// No mail after all?\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->cache['systemvars']['mail_queue'] = 0;\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Update cache with remaning email count\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->update_cache( array( 'array' => 1, 'name' => 'systemvars', 'donow' => 1, 'deletefirst' => 0 ) );\n\t\t}\n\t}", "public function receiveMsg() {\n\n $rawData = file_get_contents(\"php://input\");\n $input = json_decode($rawData, true);\n\n return $input;\n }", "public function handle()\n {\n// $mq = new Rabbitmq('demo_product', 'demo_product_queue', 'direct', false, [\n// 'delay' => true\n// ]);\n//\n// $mq->pull(function ($body) {\n//\n// $start_time = $body['time'];\n// $end_time = Carbon::now()->toDateTimeString();\n// echo '发送时间:' . $start_time . ' Name:' . $body['name'] . ' 消费时间:' . $end_time . ' 延迟:' . Carbon::parse($end_time)->diffInSeconds($start_time) . PHP_EOL;\n//\n// dd('消费成功,但未删除队列可以重复消费');\n// });\n\n $mq = new DemoMQ();\n $mq->run();\n }", "public function handle()\n {\n echo \"Running telegram messages listener...\\n\";\n\n\n while (true) {\n $offset = $this->getPreviousUpdateID();\n $this->processMessages($offset);\n sleep(1);\n }\n }", "public function handle()\n {\n \n while (true) {\n \n $loop = ReactEventLoopFactory::create();\n\n $client = new SlackRealTimeClient($loop);\n $client->setToken(config('services.slack.token'));\n\n // disconnect after first message\n $client->on('message', function ($data) use ($client) {\n //echo \"Someone typed a message: \".$data['text'].\"\\n\";\n //print_r($data);\n //$client->disconnect();\n \n if($data['type'] == 'message'){\n \n if(!isset($data['text'])) return;\n if(isset($data['username']) && $data['username'] == 'bot') return;\n\n print_r($data);\n\n if(substr($data['channel'], 0, 1) == 'D'){\n //If it's a DM, treat it as a search query\n echo \"Direct Message: \";\n print_r($data);\n }elseif(!isset($data['user'])){\n $this->error('No valid user. Previous event not saved');\n Log::debug('No valid user. Previous event not saved');\n }else{\n //Insert new message to DB\n $message = new Messages;\n $message->message = $data['text'];\n $message->user = $data['user'];\n $message->channel = $data['channel'];\n $message->ts = convert_timestamp($data['ts']);\n $message->save();\n\n $message->addToIndex(); //add to ES Index\n }\n\n\n }//END IF DATA TYPE CHECK\n $client->disconnect();\n\n });\n\n $client->connect()->then(function () {\n echo \"Connected!\\n\";\n });\n\n $loop->run();\n\n }//END WHILE INF\n }" ]
[ "0.7139947", "0.69708943", "0.69189733", "0.6365437", "0.6147463", "0.6139044", "0.61243004", "0.61120796", "0.60715896", "0.6031232", "0.60245407", "0.5951988", "0.59456456", "0.58390653", "0.5787365", "0.57839274", "0.5739187", "0.56539655", "0.5632431", "0.5622104", "0.56178683", "0.5581059", "0.5574326", "0.5555022", "0.55415195", "0.5538377", "0.5532683", "0.55322003", "0.55106527", "0.5508834", "0.54814637", "0.5480675", "0.54453", "0.54437935", "0.5432961", "0.5400687", "0.53597087", "0.5333983", "0.5330771", "0.5318381", "0.53161526", "0.5290265", "0.5267406", "0.52646816", "0.5260985", "0.52523065", "0.52478373", "0.52451026", "0.5237883", "0.52306074", "0.52306074", "0.5227122", "0.52135503", "0.52122694", "0.5211994", "0.5210504", "0.5210504", "0.5207291", "0.51985097", "0.51903325", "0.51856667", "0.51848555", "0.517651", "0.5174291", "0.5174291", "0.51662004", "0.5166192", "0.5161859", "0.5145596", "0.5143309", "0.51383436", "0.5137576", "0.511323", "0.51121366", "0.50979257", "0.5088106", "0.5085252", "0.5083902", "0.5077965", "0.5072679", "0.506627", "0.5065855", "0.5065396", "0.5065396", "0.5065396", "0.5065396", "0.5065396", "0.5065396", "0.5065396", "0.5063068", "0.50573295", "0.5054643", "0.50480783", "0.50394195", "0.503423", "0.50261945", "0.5026002", "0.5018709", "0.500321", "0.49959135" ]
0.65180534
3
Deletes messages from sqs queue.
private function deleteMessage(string $receipt) { SqsClient::instance()->deleteMessage( [ 'QueueUrl' => $this->getSqsUrl(), 'ReceiptHandle' => $receipt, ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete()\n {\n parent::delete();\n\n $this->sqs->deleteMessage([\n 'QueueUrl' => $this->queue, 'ReceiptHandle' => $this->job->getReceiptHandle(),\n ]);\n }", "public function deleteQueue();", "public function delete()\n {\n $this->sqs_client->DeleteMessage([\n 'QueueUrl' => 'https://sqs.us-east-1.amazonaws.com/947603853016/rs-video-harvester.fifo',\n 'ReceiptHandle' => $message['ReceiptHandle']\n ]);\n\n return TRUE;\n }", "public function deleteMarkedMessages()\n {\n $connection = $this->getConnection();\n\n $select = $connection->select()\n ->from(['queue_message_status' => $this->getMessageStatusTable()], ['message_id'])\n ->where('status <> ?', QueueManagement::MESSAGE_STATUS_TO_BE_DELETED)\n ->distinct();\n $messageIds = $connection->fetchCol($select);\n\n $condition = count($messageIds) > 0 ? ['id NOT IN (?)' => $messageIds] : null;\n $connection->delete($this->getMessageTable(), $condition);\n }", "public function deleteMessages() {\n\t\t$query = 'TRUNCATE TABLE chat';\n\t\t$result = $this -> mysqli -> query($query);\n\t}", "public function deleteMessages()\n {\n $query = 'TRUNCATE TABLE chat';\n //execute the SQL query\n $result = $this->mMysqli->query($query);\n }", "public function deleteAllMessages(){\r\n\t\t$query = 'TRUNCATE TABLE chat';\r\n\t\t$result = $this->mysqli->query($query);\r\n\t}", "public function delete()\n {\n parent::delete();\n $this->azure->deleteMessage($this->job);\n }", "public function deleteMessages()\n {\n $this->_Database->query(\"DELETE FROM chat WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(time_posted) >= 3200\");\n }", "public function _destroy_queue() {\n\t\tglobal $wpdb;\n\n\t\t$status = \\SearchWP::$index->get_tables()['status']->table_name;\n\t\t$wpdb->query( $wpdb->prepare( \"\n\t\t\tDELETE FROM {$status}\n\t\t\tWHERE indexed IS NULL\n\t\t\tAND omitted IS NULL\n\t\t\tAND queued IS NOT NULL\n\t\t\tAND site = %d\",\n\t\t\tget_current_blog_id()\n\t\t) );\n\t}", "function delete_message_from_queue($queue_url, $message_handle, $region, $queue_name)\n {\n $sqs_client = new Aws\\Sqs\\SqsClient([\n 'version' => 'latest',\n 'region' => \"$region\"\n ]);\n\n try\n {\n $sqs_client->deleteMessage([\n 'QueueUrl' => $queue_url,\n 'ReceiptHandle' => $message_handle\n ]);\n }\n catch(\\Aws\\Sqs\\Exception\\SqsException $sqs_exception)\n {\n echo \"Failed to delete message in queue: $queue_name, \" . $sqs_exception->getMessage() . \"\\n\";\n exit(1);\n }\n }", "public function clearMessages() {\n $this->connection->truncate($this->messageTable)\n ->execute();\n }", "public function deleteMessage($messageId);", "public function deleteMessage(Zend_Queue_Message $message)\n {\n \treturn $this->_pheanstalk->delete($message->handle);\n }", "public function delete()\n {\n $this->queue->delete($this);\n }", "public function deleteMessage($queueId, $message, $options = null);", "function messageDeleteBulk(Collection $messages);", "public function delete_messages()\n {\n $this->message=array();\n Session::instance()->delete(\"hana_message\");\n }", "public function delete()\n {\n parent::delete();\n $receiptHandle = $this->job->getReceiptHandle();\n $this->mns->deleteMessage($receiptHandle);\n }", "public function execute()\n {\n foreach ($this->queue->pull(1000) as $message) {\n $this->process($message)->delete();\n }\n }", "function deleteMessages($messageId){\n\t\t\t//load data from persistence object\n\t\t\t$storageType \t\t= $this->configManager->getStorageType();\n\t\t\n\t\t\t\t\t\t\t\t\n\t\t\tif(strtolower($storageType) == 'file'){\n\t\t\t\t$fileName = $this->configManager->getDataDir().'/'.$this->configManager->getMessageFileName();\n\t\t\t\t$this->persistenceManager->setStorageType('file');\n\t\t\t\t$this->persistenceManager->setMessageFile($fileName);\n\t\t\t}elseif(strtolower($storageType) == 'mysql'){\n\t\t\t\tdie(\"MySQL storage type, not implemented yet!\");\n\t\t\t}else{\n\t\t\t\tdie(\"Unknown storage type!\");\n\t\t\t}\n\t\t\t\n\t\t\t$this->persistenceManager->deleteMessage($messageId);\n\t\t\t\n\t\t}", "function messageDelete(Message $message);", "function edd_pup_clear_queue() {\n\n\tif ( ! wp_verify_nonce( $_REQUEST['nonce'], 'clear-queue-'.$_REQUEST['email'] ) ) {\n\t\techo 'noncefail';\n\t\texit;\n\t}\n\n\tglobal $wpdb;\n\n\t// Clear queue\n\tif ( $_POST['email'] == 'all' ) {\n\n\t\t// Build array of queued emails before clearing table\n\t\t$queueemails = edd_pup_queue_emails();\n\n\t\t// Build array of sent email data before clearing table\n\t\tforeach ( $queueemails as $email => $id ) {\n\t\t\t$recipients[$id] = edd_pup_check_queue( $id );\n\t\t}\n\n\t\t// Clear the database table\n\t\t$qr = $wpdb->query( \"TRUNCATE TABLE $wpdb->edd_pup_queue\" );\n\n\t} else {\n\n\t\t$recipients = edd_pup_check_queue( $_POST['email'] );\n\n\t\t// Delete the rows WHERE the specified email_id matches\n\t\t$qr = $wpdb->delete( \"$wpdb->edd_pup_queue\", array( 'email_id' => $_POST['email'] ), array( '%d' ) );\n\n\t}\n\n\t// If clear queue fails, bail out of function with error message, otherwise change post statuses\n\tif ( false === $qr ) {\n\t\twp_die( __( 'Error: could not complete database query.', 'edd-pup' ), __( 'Clear Queue Error', 'edd-pup' ) );\n\n\t} else {\n\n\t\tif ( !empty( $queueemails ) ) {\n\n\t\t\tforeach ( $queueemails as $email => $id ) {\n\t\t\t\t$post[] = wp_update_post( array( 'ID' => $id, 'post_status' => 'abandoned' ) );\n\t\t\t\tupdate_post_meta ( $id, '_edd_pup_recipients', $recipients[$id] );\n\t\t\t}\n\n\t\t} else if ( absint( $_POST['email'] ) != 0 ) {\n\n\t\t\t$post = wp_update_post( array( 'ID' => $_POST['email'], 'post_status' => 'abandoned' ) );\n\t\t\tupdate_post_meta ( $post, '_edd_pup_recipients', $recipients );\n\n\t\t} else {\n\n\t\t\twp_die( __( 'Error: Valid email ID not supplied.', 'edd-pup' ), __( 'Clear Queue Error', 'edd-pup' ) );\n\t\t}\n\t}\n\n\tdie();\n}", "public function deleteQueueExtern($params = null);", "public function testDeleteWebhookQueueAccountMessage()\n {\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::webhookQueueAccountMessageDelete());\n\n $webhook = $sw->deleteWebhookQueueAccountMessage('MessageID');\n $this->assertInstanceOf(SmartwaiverWebhookMessageDelete::class, $webhook);\n\n $this->checkDeleteRequests($container, ['/v4/webhooks/queues/account/MessageID']);\n }", "public function deleteMessage($queue, $id)\n {\n throw new \\RuntimeException(\"Delete is not supported by GaeQueue.\");\n }", "public function consumeQueue()\n {\n try {\n $queue = Di::getDefault()->get('queue');\n\n /** @var \\Aws\\Result $messages*/\n $messages = $this->getMessagesFromQueue($queue);\n\n if (count($messages->get('Messages')) == 0) {\n return;\n }\n\n $queueName = (new QueueService())->getFullQueueName('notifications');\n foreach ($messages->get('Messages') as $message) {\n $idList = json_decode($message['Body'], true);\n\n if (!empty($idList)) {\n $this->trySendNotificationsFromMessage($idList);\n }\n\n $queue->deleteMessage([\n 'QueueUrl' => $queue->getQueueUrl(['QueueName' => $queueName])->get('QueueUrl'),\n 'ReceiptHandle' => $message['ReceiptHandle'],\n ]);\n }\n } catch (AwsException $e) {\n Di::getDefault()->get('logger')->error($e->getMessage());\n } catch (\\Exception $e) {\n // Do nothing\n } catch (\\Throwable $e) {\n // Do nothing\n }\n\n sleep(5);\n $this->consumeQueue();\n }", "function deleteMessage($messageId){\r\n //$GLOBALS['link'] = connect();\r\n mysqli_query($GLOBALS['link'], 'delete from messages where `id`='. $messageId .';')or die(mysqli_error($GLOBALS['link']));\r\n\r\n return mysqli_affected_rows($GLOBALS['link']);\r\n}", "public function prune() {\n $this->connection->delete('queue')\n ->condition('name', $this->name)\n ->condition('expire', 0, '>')\n ->execute();\n }", "public function deleteAllMessage()\n {\n\n $db = $this->getDb();\n $user = $this->getUser();\n $userID = $user->getId();\n $orm = $this->getOrm();\n\n $queries = [];\n $queries[] = 'UPDATE buiz_message set flag_sender_deleted = true WHERE id_sender = '.$userID.';';\n $queries[] = 'DELETE FROM buiz_message_receiver WHERE vid = '.$userID.';';\n $queries[] = 'DELETE FROM buiz_message_aspect WHERE id_receiver = '.$userID.';';\n\n foreach ($queries as $query) {\n $db->exec($query);\n }\n\n // alle\n $sql = <<<SQL\nSELECT\n\tmsg.rowid as msg_id\nFROM\n\tbuiz_message msg\nJOIN\n\tbuiz_message_receiver recv\n\t\tON recv.id_message = msg.rowid\n--having count(recv.rowid) = 0\nWHERE\n\tmsg.id_sender = {$userID}\nSQL;\n\n\n $messages = $db->select($sql);\n\n $msgIds = [];\n\n foreach ( $messages as $msg ) {\n $msgIds[] = $msg['msg_id'];\n }\n\n $whereString = implode(', ', $msgIds);\n\n $orm->deleteWhere('BuizMessageAspect', 'id_message IN('.$whereString.')'); // aspekt flags\n $orm->deleteWhere('BuizTask', 'id_message IN('.$whereString.')'); // eventueller task aspekt\n $orm->deleteWhere('BuizAppointment', 'id_message IN('.$whereString.')'); // eventueller appointment aspekt\n $orm->deleteWhere('BuizMessageReceiver', 'id_message IN('.$whereString.')'); // alle receiver\n $orm->deleteWhere('BuizDataIndex', 'id_message IN('.$whereString.')'); // fulltext index der db\n $orm->deleteWhere('BuizDataLink', 'id_message IN('.$whereString.')'); // referenzen\n $orm->deleteWhere('BuizEntityAttachment', 'id_message IN('.$whereString.')'); // attachments\n\n }", "static function deleteWS($aOptions){\n $db = new DB();\n if( empty( $aOptions[\"id\"] ) ) return false;\n if( empty( $aOptions[\"token\"] ) ) return false;\n \n $sql = \"\n DELETE FROM export_queue\n WHERE id = \".intval( $aOptions[\"id\"] ).\"\n AND token = '\".$db->escape( $aOptions[\"token\"] ).\"'\n \";\n $db->query( $sql );\n if( $db->affectedrows > 0 ) return true;\n return false;\n }", "public function delete_sended_message() {\n // First we delete the message from recipient table\n $this->delete_received_message();\n // Then we detach or actually delete the whole message from message table\n $this->db->query(\"DELETE FROM `message` WHERE id = ?\", array(\n $this->id\n ));\n\n return ($this->db->error()) ? false : true;\n }", "function mailqueue_cleanup() {\nglobal $db, $jconf;\n\n\t$date_month_ago = date(\"Y-m-d H:i:s\", strtotime(' -1 month'));\n\t$date_year_ago = date(\"Y-m-d H:i:s\", strtotime(' -1 year'));\n\n\t$query = \"\n\t\tDELETE FROM\n\t\t\tmailqueue\n\t\tWHERE\n\t\t\t( status = 'sent' AND timestamp < '\" . $date_month_ago . \"' ) OR\n timestamp < '\" . $date_year_ago . \"'\";\n \n\ttry {\n\t\t$rs = $db->Execute($query);\n\t} catch (exception $err) {\n\t\t$debug->log($jconf['log_dir'], $jconf['jobid_maintenance'] . \".log\", \"[ERROR] SQL query failed. Query:\\n\\n\" . trim($query), $sendmail = true);\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "private function removeExpiredMessages(): void\n {\n if (! isset($this->removeExpiredMessagesLastExecutedAt)) {\n $this->removeExpiredMessagesLastExecutedAt = microtime(true);\n } elseif (microtime(true) - $this->removeExpiredMessagesLastExecutedAt < 1) {\n return;\n }\n\n $this->connection->createQueryBuilder()\n ->delete($this->tableName)\n ->andWhere('(time_to_live IS NOT NULL) AND (time_to_live < :now)')\n ->andWhere('delivery_id IS NULL')\n ->setParameter('now', new DateTimeImmutable(), Types::DATETIMETZ_IMMUTABLE)\n ->executeStatement();\n\n $this->removeExpiredMessagesLastExecutedAt = microtime(true);\n }", "public function purgeAllQueues()\n {\n $this->cleanup();\n }", "public function deleteMessage( $id )\n\t{\n\t\t$record = Message::find( $id );\n\t\t$record->delete();\n\t}", "public function deleteSelection($msgIds)\n {\n\n $db = $this->getDb();\n $user = $this->getUser();\n $userID = $user->getId();\n $orm = $this->getOrm();\n\n if (!$msgIds)\n return;\n\n $sqlIds = implode(', ', $msgIds);\n\n $queries = [];\n $queries[] = 'UPDATE buiz_message set flag_sender_deleted = true WHERE id_sender = '.$userID.' AND rowid IN('.$sqlIds.');';\n $queries[] = 'DELETE FROM buiz_message_receiver WHERE vid = '.$userID.' AND id_message IN('.$sqlIds.');';\n $queries[] = 'DELETE FROM buiz_message_aspect WHERE id_receiver = '.$userID.' AND id_message IN('.$sqlIds.');';\n\n foreach ($queries as $query) {\n $db->exec($query);\n }\n\n // alle\n $sql = <<<SQL\nSELECT\n\tmsg.rowid as msg_id\nFROM\n\tbuiz_message msg\nJOIN\n\tbuiz_message_receiver recv\n\t\tON recv.id_message = msg.rowid\nhaving count(recv.rowid) = 0\nWHERE\n\tmsg.id_sender = {$userID} AND msg.rowid IN({$sqlIds})\nSQL;\n\n\n $messages = $db->select($sql);\n\n $msgIds = [];\n\n foreach ( $messages as $msg ) {\n $msgIds[] = $msg['msg_id'];\n }\n\n // wenn keine msg ids dann sind wir fertig\n if(!$msgIds)\n return;\n\n $whereString = implode(', ', $msgIds);\n\n $orm->deleteWhere('BuizMessageAspect', 'id_message IN('.$whereString.')'); // aspekt flags\n $orm->deleteWhere('BuizTask', 'id_message IN('.$whereString.')'); // eventueller task aspekt\n $orm->deleteWhere('BuizAppointment', 'id_message IN('.$whereString.')'); // eventueller appointment aspekt\n $orm->deleteWhere('BuizMessageReceiver', 'id_message IN('.$whereString.')'); // alle receiver\n $orm->deleteWhere('BuizDataIndex', 'id_message IN('.$whereString.')'); // fulltext index der db\n $orm->deleteWhere('BuizDataLink', 'id_message IN('.$whereString.')'); // referenzen\n $orm->deleteWhere('BuizEntityAttachment', 'id_message IN('.$whereString.')'); // attachments\n\n }", "protected function deleteAllQueues(): void\n {\n /** @var ConnectionsFactoryInterface $connections */\n $connections = $this->app->make(ConnectionsFactoryInterface::class);\n /** @var QueuesFactoryInterface $queues */\n $queues = $this->app->make(QueuesFactoryInterface::class);\n\n // Delete all queues for all connections\n foreach ($connections->names() as $connection_name) {\n $connection = $connections->make($connection_name);\n\n foreach ($queues->ids() as $id) {\n $queue = $queues->make($id);\n\n $connection->deleteQueue($queue);\n }\n }\n }", "public function FlushQueue()\n {\n do\n {\n $result = $this->FlushMsg();\n } while ($result);\n }", "function deleteAllMessages(){\n\t\t\t\n\t\t\t$storageType \t\t= $this->configManager->getStorageType();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\tif(strtolower($storageType) == 'file'){\n\t\t\t\t$fileName = $this->configManager->getDataDir().'/'.$this->configManager->getMessageFileName();\n\t\t\t\t$this->persistenceManager->setStorageType('file');\n\t\t\t\t$this->persistenceManager->setMessageFile($fileName);\n\t\t\t}elseif(strtolower($storageType) == 'mysql'){\n\t\t\t\tdie(\"MySQL storage type, not implemented yet!\");\n\t\t\t}else{\n\t\t\t\tdie(\"Unknown storage type!\");\n\t\t\t}\n\t\t\t\n\t\t\t$this->persistenceManager->deleteAllMessage();\n\t\t}", "public function destroy(Messages $messages)\n {\n //\n }", "public function purgeAllQueues() {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('purgeAllQueues', func_get_args()));\n }", "public function purgeAllQueues() {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('purgeAllQueues', func_get_args()));\n }", "protected function deleteQueueMonitor(): void\n {\n if ( ! $monitor = $this->getQueueMonitor()) {\n return;\n }\n\n $monitor->delete();\n }", "function remove_message($db, $id)\n{\n\t$sql = \"DELETE from messages where id = :id\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':id'=>$id));\n\treturn;\n}", "public static function DeleteMessage(Request $request) {\n if ($request->msg_id) {\n Usermessage::destroy($request->msg_id);\n }\n }", "public function deleteItemsQueue($id_shop)\n {\n Db::getInstance()->execute('DELETE from ' . _DB_PREFIX_ . 'doofinder_updates WHERE id_shop = ' . (int) $id_shop);\n }", "public function remove(MailQueue $messageQueue)\n {\n $em = $this->doctrine->getEntityManager();\n $em->remove($messageQueue);\n $em->flush();\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 }", "public function delete_msg($id){\n\n\n\t\t$this->query(\"DELETE FROM `my_cart`.`messege` WHERE `id` = '$id'\");\n\n\t}", "public function delete()\n {\n foreach ($this->users as $user) {\n $this->quitUser($user);\n }\n $this->messages()->delete();\n return parent::delete();\n }", "public function testDeleteQueuedMessagesForSmsDefinition()\n {\n $resourceCreator = new ResourceCreator();\n $resourceCreator->setContainer($this->container);\n $resourceCreator->setModelClass(__FUNCTION__, DeleteQueuedMessagesForSendDefinitionResponse::class);\n $resourceCreator->setClient($this->getClient());\n\n /** @var EmailDefinition $resource */\n $resource = $resourceCreator->create();\n\n // The actual test\n /** @var \\SalesForce\\MarketingCloud\\Api\\TransactionalMessagingApi $client */\n $client = $this->getClient();\n $response = $client->deleteQueuedMessagesForSmsDefinition($resource->getDefinitionKey());\n\n Assert::assertNotNull($response->getRequestId());\n }", "public function testDeleteWebhookQueueTemplateMessage()\n {\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::webhookQueueTemplateMessageDelete());\n\n $webhook = $sw->deleteWebhookQueueTemplateMessage('TestingGUID', 'MessageID');\n $this->assertInstanceOf(SmartwaiverWebhookMessageDelete::class, $webhook);\n\n $this->checkDeleteRequests($container, ['/v4/webhooks/queues/template/TestingGUID/MessageID']);\n }", "protected function removeSqsMessage($receiptHandle)\n {\n try {\n $response = $this->sqs->deleteMessage([\n 'QueueUrl' => $this->queueUrl,\n 'ReceiptHandle' => $receiptHandle\n ]);\n } catch (\\Exception $e) {\n $this->logError('Remove message from SQS', $e);\n return false;\n }\n\n return true;\n }", "public function deleteQueue($queueId, $options = null);", "public function\n\tclearMessages()\n\t{\n\t\t$this -> m_aStorage = [];\n\t}", "public function action_delete() {\n\t\t$id = $this->request->param('id');\n\t\tif($id) {\n\t\t\t$message = ORM::factory('Message', $id);\n\t\t\tif($message->loaded()) {\n\t\t\t\ttry {\n\t\t\t\t\t$message->delete();\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t$this->_set_msg('Could not delete message because another user is tied to it', 'error');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->redirect($this->request->referrer());\n\t\t}\n\t\t$this->_set_content('message_delete');\n\t}", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "public function destroy(sms $sms)\n {\n //\n }", "public function action_Delete_Message()\n\t{\n\t\t// load item\n\t\t$item = ORM::factory('Ticket_Message', $this->request->param('id'));\n\n\t\tif ( ! $item->loaded())\n\t\t\t$this->not_found('Could not find ticket message to delete. Already deleted maybe?');\n\n\t\t$ticket_id = $item->ticket->id;\n\n\t\t$item->deleted_at = date('Y-m-d H:i:s');\n\t\t$item->save();\n\n\t\tHTTP::redirect('Ticket/Detail/'.$ticket_id);\n\t}", "public function clearQueue() {\n\n try {\n if (count(URLRequest::all()) > 0) { //Get the count of all the records in the database.\n URLRequest::truncate(); //Remove all records in the database.\n shell_exec('sudo rm -R /Stream && sudo mkdir /Stream'); //Remove the /Stream directory and then recreate it.\n return true;\n }\n return false;\n } catch (\\Exception $exception) {\n throw new \\Exception($exception);\n }\n\n }", "function messageDeleteBulkRaw(TextChannelInterface $channel, array $messageIDs);", "public function popQueueMessagesExtern($params = null);", "public function testDeleteWebhookQueueAccountMessageRaw()\n {\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, APISuccessResponses::webhookQueueAccountMessageDelete());\n\n $response = $sw->deleteWebhookQueueAccountMessageRaw('MessageId');\n $this->assertInstanceOf(SmartwaiverRawResponse::class, $response);\n\n $this->checkDeleteRequests($container, ['/v4/webhooks/queues/account/MessageId']);\n }", "abstract public function deleteMessage($messageNo, $mailboxPath=null);", "public function Delete()\n {\n \t$rs = mysql_query(\"DELETE FROM subscriptions WHERE subscription_id=\" . $this->subscription_id);\n \t\n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n }", "public function deleteMessage($messageId)\n {\n\n $db = $this->getDb();\n $orm = $this->getOrm();\n $user = $this->getUser();\n\n // erst mal eventuelle receiver & aspekte des users löschen\n $orm->deleteWhere( 'BuizMessageReceiver', 'vid = '.$user->getId().' and id_message = '.$messageId );\n $orm->deleteWhere('BuizMessageAspect', 'id_message='.$messageId.' and id_receiver = '.$user->getId() );\n\n $sql = <<<SQL\nSELECT\n\tmsg.flag_sender_deleted,\n\tmsg.id_sender,\n\tcount(recv.rowid) as num_receiver\nFROM\n\tbuiz_message msg\nLEFT JOIN\n\tbuiz_message_receiver recv\n\t\tON recv.id_message = msg.rowid AND recv.vid = {$user->getId()}\nWHERE\n \tmsg.rowid = {$messageId}\n \t\tAND NOT recv.flag_deleted = true\nGROUP BY\n\tmsg.id_sender,\n\tmsg.flag_sender_deleted\nSQL;\n\n $tmpData = $db->select($sql)->get();\n\n if (!$tmpData) {\n // ok sollte nicht passieren\n return;\n }\n\n if( $tmpData['id_sender'] == $user->getId() ) {\n\n // nur löschen wenn keine receiver mehr da sind\n if( $tmpData['num_receiver'] ) {\n $orm->update( 'BuizMessage', $messageId, array('flag_sender_deleted'=>true) );\n return;\n }\n\n } else {\n\n // löschen wenn deleted flag\n if( 't' != $tmpData['flag_sender_deleted'] ) {\n return;\n }\n\n }\n\n $orm->delete('BuizMessage', $messageId);\n\n // referenz tabellen leeren\n $orm->deleteWhere('BuizMessageAspect', 'id_message='.$messageId); // aspekt flags\n $orm->deleteWhere('BuizTask', 'id_message='.$messageId); // eventueller task aspekt\n $orm->deleteWhere('BuizAppointment', 'id_message='.$messageId); // eventueller appointment aspekt\n $orm->deleteWhere('BuizMessageReceiver', 'vid='.$messageId); // alle receiver\n $orm->deleteWhere('BuizDataIndex', 'vid='.$messageId); // fulltext index der db\n $orm->deleteWhere('BuizDataLink', 'vid='.$messageId); // referenzen\n $orm->deleteWhere('BuizEntityAttachment', 'vid='.$messageId); // attachments\n\n }", "public function deleteMessages($channelId, $messageId)\n {\n $this->curlRequest(\"{$this->discordURI}/channels/{$channelId}/messages/bulk-delete\", \"POST\", json_encode($messageId), true);\n }", "public static function removeMessage() {\n $con = pg_connect(\"host=\".CON_HOST.\" dbname=\".CON_DBNAME.\" user=\".CON_USER.\" password=\".CON_PASSWORD.\"\")\n or die (\"Could not connect to server.\");\n\n if($_REQUEST['id'] > 1) {\n $query = \"UPDATE message SET removed = true WHERE message_id = \". $_REQUEST['id'];\n }\n\n pg_query($con, $query) or die(\"Cannot execute the query.\");\n return true;\n }", "public function deleteBulkSMS(Request $request)\n {\n $appStage = app_config('AppStage');\n if ($appStage == 'Demo') {\n return redirect('user/sms/history')->with([\n 'message' => language_data('This Option is Disable In Demo Mode'),\n 'message_important' => true\n ]);\n }\n\n if ($request->has('data_ids')) {\n $all_ids = explode(',', $request->get('data_ids'));\n\n if (is_array($all_ids) && count($all_ids) > 0) {\n SMSHistory::where('userid', Auth::guard('client')->user()->id)->whereIn('id', $all_ids)->delete();\n }\n }\n }", "public function deleteMessage(Request $request)\n {\n $messageId = $request->messageId;\n $getMessgeById = Contacts::find($messageId);\n if($getMessgeById->delete()){\n Session::flash('danger','Message deleted successfully');\n return redirect()->back();\n }\n else{\n Session::flash('danger','sorry ! message could not be deleted.');\n return redirect()->back();\n }\n }", "function GST_deleteMessage($message_GUID, $check_if_read=TRUE)\n\t{\n $this->GST_setClassDB();\n \n\t\t$GUIDs = explode('|', $message_GUID);\n\t\t$affected = 0;\n \n\t\tfor($i=0; $i<count($GUIDs); $i++)\n\t\t{\n $query = $this->DB->query(\"DELETE FROM guestbook WHERE message_GUID='\".$GUIDs[$i].\"' \".\n ($check_if_read ? \"AND condition!='UNREAD' \" : \"\").\"AND \".\n \"(user_GUID='\".$_SESSION['__user_GUID'].\"' OR writer_GUID='\".$_SESSION['__user_GUID'].\"')\");\n $query->run();\n\t\t\tif($query->affected_rows == 1) { $affected--; }\n\t\t}\n \n\t\tUser::USR_setGstCounter($affected);\n \n\t\treturn $affected;\n\t}", "protected function forum_queue_hard_delete()\n\t{\n\t\tif (!$this->phpbb_post_id)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tphpbb::_include('functions_posting', 'delete_post');\n\n\t\t$sql = 'SELECT t.*, p.*\n\t\t\tFROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p\n\t\t\tWHERE p.post_id = ' . $this->phpbb_post_id . '\n\t\t\t\tAND t.topic_id = p.topic_id';\n\t\t$result = phpbb::$db->sql_query($sql);\n\t\t$post_data = phpbb::$db->sql_fetchrow($result);\n\t\tphpbb::$db->sql_freeresult($result);\n\n\t\tdelete_post($post_data['forum_id'], $post_data['topic_id'], $post_data['post_id'], $post_data);\n\t}", "public function destroy(Message $message) {\n //\n }", "Public Function RemoveFrombevomedia_queue($jobId)\n {\n \t$this->jobId = $jobId;\n \t\n \t$DatabaseObj = Zend_Registry::get('Instance/DatabaseObj');\n \t\t\n \t$UpdateArray = array(\n \t\t\t'Deleted' => 1,\t\t\t\t\t\t \t\t\t\n \t\t);\n \t\t\n \t\t$DatabaseObj->update('bevomedia_queue', $UpdateArray, \"jobId = '{$jobId}'\");\n \t\t\n \t\t$this->status = 'Deleted';\n \t\n }", "public function delete($queue, $id)\n {\n $this->db->createCommand()->delete($this->table, ['id' => $id])->execute();\n }", "public function delete($messageId) {\n return $this->_post(\n $this->_serverPath['delete'],\n array(\n 'messages' => $messageId,\n 'trash' => '1'\n )\n );\n\t}", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function destroy(Message $message)\n {\n //\n }", "public function testSendInvoiceToBatchUnsuccessfulSendViaDestructor()\n {\n $validator = new InvoiceValidator();\n\n $sqsClient = $this->getMockedAwsSdk()->createSqs(['version' => '2012-11-05']);\n $cmd = $sqsClient->getCommand('SendMessage', [\n 'QueueName' => 'my-queue-name'\n ]);\n\n $results = [\n # Result for GetQueueUrl command\n new Result(['QueueUrl' => 'my-queue-url']),\n # Result for SendMessage command\n new AwsException('Exception message', $cmd)\n ];\n\n $sqsQueue = $this->getSqsQueueInstance($results);\n\n foreach ($this->getValidInvoiceData() as $data) {\n $invoice = Invoice::load($data, $validator);\n $sqsQueue->sendInvoiceToBatch($invoice, $validator);\n }\n # Destroy the object. This should trigger the batch send.\n unset($sqsQueue);\n }", "public static function delete2(){\n\t\t$now = time() - 5*24*3600;\n\t\t$result = MGameBase::getInstance()->getDB()->query(\"DELETE FROM messages WHERE readed = 2 and time < '\".$now.\"'\");\n\t}", "public function deleteMessages($message_ids)\n\t\t\t{\n\t\t\t\t$message_ids_arr = explode(',', $message_ids);\n\t\t\t\tforeach($message_ids_arr as $combined_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$id_arr = explode('_', $combined_id);\n\t\t\t\t\t\t$from_id = $id_arr[0];\n\t\t\t\t\t\t$to_id = $id_arr[1];\n\t\t\t\t\t\t$message_id = $id_arr[2];\n\t\t\t\t\t\tif($this->fields_arr['folder']=='trash')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($to_id == $this->CFG['user']['user_id'])\n\t\t \t\t\t\t\t\t\t$this->updateMessageStatusTrash('to_delete', $message_id);\n\t\t\t\t\t\t\t\tif ($from_id == $this->CFG['user']['user_id'])\n\t\t\t\t\t\t\t\t\t$this->updateMessageStatusTrash('from_delete', $message_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($to_id == $this->CFG['user']['user_id'])\n\t\t \t\t\t\t\t\t\t$this->updateMessageStatusDelete('to_delete', $message_id);\n\t\t\t\t\t\t\t\tif ($from_id == $this->CFG['user']['user_id'])\n\t\t\t\t\t\t\t\t\t$this->updateMessageStatusDelete('from_delete', $message_id);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\tif (in_array($this->fields_arr['folder'], $this->updateNewMailInFolder))\n\t\t\t\t\t\t$this->updateNewMailCount();\n\t\t\t}", "public static function emptyQueues()\n {\n //Get the tracks in all the queues\n $tracks = [];\n foreach (self::$queues as $queue) {\n $tracks = array_merge($tracks, self::getTracksInQueue($queue));\n }\n\n foreach ($tracks as $track) {\n self::removeRequestFromQueue($track['queue'], $track['requestid']);\n }\n }", "public function testSendInvoiceToBatchSuccessfulSendViaDestructor()\n {\n $validator = new InvoiceValidator();\n $invoice = Invoice::load($this->getValidInvoiceData()[0], $validator);\n\n $results = [\n # Result for GetQueueUrl command\n new Result(['QueueUrl' => 'my-queue-url']),\n # Result for SendMessageBatch command\n new Result([])\n ];\n\n $sqsQueue = $this->getSqsQueueInstance($results);\n\n $sqsQueue->sendInvoiceToBatch($invoice, $validator);\n # Destroy the object. This should trigger the batch send.\n unset($sqsQueue);\n\n # Confirm the stack is empty (ie. that the API calls HAVE been made)\n $this->assertEquals(0, $this->getAwsMockHandlerStackCount());\n }", "public function delete_message_by_id($id)\n\t{\n\t\t\n\t\t$this->db->where('message_id', $id);\n\t\t$this->db->delete('message');\n\t\treturn $this->db->affected_rows();\n\t\t\n\t\n\t}", "public function deleteBulkScheduleSMS(Request $request)\n {\n\n $appStage = app_config('AppStage');\n if ($appStage == 'Demo') {\n return redirect('user/sms/history')->with([\n 'message' => language_data('This Option is Disable In Demo Mode'),\n 'message_important' => true\n ]);\n }\n\n if ($request->has('data_ids')) {\n $all_ids = explode(',', $request->get('data_ids'));\n\n if (isset($all_ids) && is_array($all_ids) && count($all_ids) > 0) {\n foreach ($all_ids as $id) {\n $sms = ScheduleSMS::where('userid', Auth::guard('client')->user()->id)->find($id);\n if ($sms) {\n $client = Client::find($sms->userid);\n $client->sms_limit += $sms->amount;\n $client->save();\n\n $sms->delete();\n }\n }\n }\n }\n }", "public function deleted(AssignmentSubmitted $as) {\n Messages::where('id', $as->message_id)->delete();\n }", "public function clear()\r\n {\r\n $this->messages->clear();\r\n }", "public function delete($message_id){\n $message = Message::where('id', '=', $message_id)->firstOrFail();\n // Remove from database\n $message->delete();\n\n Session::flash('success', 'You have correctly removed that message' );\n return back();\n }" ]
[ "0.77614427", "0.7146417", "0.7074337", "0.70095444", "0.6915364", "0.6891873", "0.6641498", "0.6637051", "0.66349745", "0.65924543", "0.65761733", "0.6568287", "0.6529984", "0.6472974", "0.64281785", "0.6394445", "0.6349554", "0.6337633", "0.62821585", "0.6262146", "0.6200856", "0.6190456", "0.61634177", "0.6161938", "0.61342216", "0.61236036", "0.6094545", "0.60901076", "0.60681206", "0.605524", "0.5960832", "0.5954658", "0.59513175", "0.5949185", "0.59346545", "0.5920257", "0.5906062", "0.58662397", "0.58564514", "0.5844249", "0.5836327", "0.5832632", "0.5832632", "0.580856", "0.57891375", "0.5783137", "0.5777497", "0.57715213", "0.57621396", "0.57588106", "0.5754851", "0.5753847", "0.5728373", "0.5715968", "0.5692625", "0.565759", "0.56471956", "0.56368273", "0.5632786", "0.5629775", "0.56159025", "0.5609432", "0.56010306", "0.5584021", "0.55777675", "0.55713713", "0.5563209", "0.55614674", "0.5543046", "0.55385464", "0.5501781", "0.54958606", "0.54797435", "0.54716843", "0.5470178", "0.54656774", "0.54647166", "0.5460189", "0.5460189", "0.5460189", "0.5460189", "0.5460189", "0.5460189", "0.5460189", "0.5460189", "0.5460189", "0.5460189", "0.5460189", "0.5460189", "0.5460189", "0.54594374", "0.5457215", "0.5439907", "0.5438305", "0.54280055", "0.54256475", "0.54244834", "0.54199505", "0.53993154", "0.5394073" ]
0.5667246
55